@bitux/review-layer-react 0.1.5 → 0.1.7

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,6 +1,6 @@
1
- import sr, { memo as Re, useState as F, useEffect as z, useCallback as j, useRef as me, useMemo as $e, createContext as Mr, useContext as Wr } from "react";
2
- import { createPortal as cr } from "react-dom";
3
- var Ae = { exports: {} }, le = {};
1
+ import dr, { memo as Ce, useState as N, useEffect as O, useCallback as I, useRef as pe, useMemo as We, createContext as Yr, useContext as Hr } from "react";
2
+ import { createPortal as fr } from "react-dom";
3
+ var Ne = { exports: {} }, fe = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.min.js
@@ -10,21 +10,21 @@ var Ae = { exports: {} }, le = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var or;
14
- function Br() {
15
- if (or) return le;
16
- or = 1;
17
- var r = sr, t = Symbol.for("react.element"), o = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function p(g, d, w) {
19
- var x, y = {}, P = null, S = null;
20
- w !== void 0 && (P = "" + w), d.key !== void 0 && (P = "" + d.key), d.ref !== void 0 && (S = d.ref);
21
- for (x in d) i.call(d, x) && !s.hasOwnProperty(x) && (y[x] = d[x]);
22
- if (g && g.defaultProps) for (x in d = g.defaultProps, d) y[x] === void 0 && (y[x] = d[x]);
23
- return { $$typeof: t, type: g, key: P, ref: S, props: y, _owner: a.current };
13
+ var nr;
14
+ function Gr() {
15
+ if (nr) return fe;
16
+ nr = 1;
17
+ var r = dr, t = Symbol.for("react.element"), o = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function u(v, f, m) {
19
+ var h, w = {}, j = null, k = null;
20
+ m !== void 0 && (j = "" + m), f.key !== void 0 && (j = "" + f.key), f.ref !== void 0 && (k = f.ref);
21
+ for (h in f) n.call(f, h) && !s.hasOwnProperty(h) && (w[h] = f[h]);
22
+ if (v && v.defaultProps) for (h in f = v.defaultProps, f) w[h] === void 0 && (w[h] = f[h]);
23
+ return { $$typeof: t, type: v, key: j, ref: k, props: w, _owner: i.current };
24
24
  }
25
- return le.Fragment = o, le.jsx = p, le.jsxs = p, le;
25
+ return fe.Fragment = o, fe.jsx = u, fe.jsxs = u, fe;
26
26
  }
27
- var se = {};
27
+ var ve = {};
28
28
  /**
29
29
  * @license React
30
30
  * react-jsx-runtime.development.js
@@ -34,91 +34,91 @@ var se = {};
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
36
  */
37
- var tr;
38
- function Yr() {
39
- return tr || (tr = 1, process.env.NODE_ENV !== "production" && function() {
40
- var r = sr, t = Symbol.for("react.element"), o = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), g = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), V = Symbol.iterator, $ = "@@iterator";
41
- function L(e) {
37
+ var ir;
38
+ function Xr() {
39
+ return ir || (ir = 1, process.env.NODE_ENV !== "production" && function() {
40
+ var r = dr, t = Symbol.for("react.element"), o = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), v = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), D = Symbol.iterator, M = "@@iterator";
41
+ function z(e) {
42
42
  if (e === null || typeof e != "object")
43
43
  return null;
44
- var n = V && e[V] || e[$];
45
- return typeof n == "function" ? n : null;
44
+ var a = D && e[D] || e[M];
45
+ return typeof a == "function" ? a : null;
46
46
  }
47
- var c = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function f(e) {
47
+ var g = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function c(e) {
49
49
  {
50
- for (var n = arguments.length, u = new Array(n > 1 ? n - 1 : 0), v = 1; v < n; v++)
51
- u[v - 1] = arguments[v];
52
- I("error", e, u);
50
+ for (var a = arguments.length, l = new Array(a > 1 ? a - 1 : 0), p = 1; p < a; p++)
51
+ l[p - 1] = arguments[p];
52
+ x("error", e, l);
53
53
  }
54
54
  }
55
- function I(e, n, u) {
55
+ function x(e, a, l) {
56
56
  {
57
- var v = c.ReactDebugCurrentFrame, E = v.getStackAddendum();
58
- E !== "" && (n += "%s", u = u.concat([E]));
59
- var R = u.map(function(h) {
60
- return String(h);
57
+ var p = g.ReactDebugCurrentFrame, S = p.getStackAddendum();
58
+ S !== "" && (a += "%s", l = l.concat([S]));
59
+ var C = l.map(function(E) {
60
+ return String(E);
61
61
  });
62
- R.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, R);
62
+ C.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, C);
63
63
  }
64
64
  }
65
- var N = !1, H = !1, re = !1, oe = !1, te = !1, X;
66
- X = Symbol.for("react.module.reference");
67
- function m(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === i || e === s || te || e === a || e === w || e === x || oe || e === S || N || H || re || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === y || e.$$typeof === p || e.$$typeof === g || e.$$typeof === d || // This needs to include all possible module reference object
65
+ var A = !1, $ = !1, ae = !1, se = !1, le = !1, ee;
66
+ ee = Symbol.for("react.module.reference");
67
+ function re(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === n || e === s || le || e === i || e === m || e === h || se || e === k || A || $ || ae || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === w || e.$$typeof === u || e.$$typeof === v || e.$$typeof === f || // This needs to include all possible module reference object
69
69
  // types supported by any Flight configuration anywhere since
70
70
  // we don't know which Flight build this will end up being used
71
71
  // with.
72
- e.$$typeof === X || e.getModuleId !== void 0));
72
+ e.$$typeof === ee || e.getModuleId !== void 0));
73
73
  }
74
- function k(e, n, u) {
75
- var v = e.displayName;
76
- if (v)
77
- return v;
78
- var E = n.displayName || n.name || "";
79
- return E !== "" ? u + "(" + E + ")" : u;
74
+ function y(e, a, l) {
75
+ var p = e.displayName;
76
+ if (p)
77
+ return p;
78
+ var S = a.displayName || a.name || "";
79
+ return S !== "" ? l + "(" + S + ")" : l;
80
80
  }
81
- function A(e) {
81
+ function R(e) {
82
82
  return e.displayName || "Context";
83
83
  }
84
- function T(e) {
84
+ function P(e) {
85
85
  if (e == null)
86
86
  return null;
87
- if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
87
+ 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")
88
88
  return e.displayName || e.name || null;
89
89
  if (typeof e == "string")
90
90
  return e;
91
91
  switch (e) {
92
- case i:
92
+ case n:
93
93
  return "Fragment";
94
94
  case o:
95
95
  return "Portal";
96
96
  case s:
97
97
  return "Profiler";
98
- case a:
98
+ case i:
99
99
  return "StrictMode";
100
- case w:
100
+ case m:
101
101
  return "Suspense";
102
- case x:
102
+ case h:
103
103
  return "SuspenseList";
104
104
  }
105
105
  if (typeof e == "object")
106
106
  switch (e.$$typeof) {
107
- case g:
108
- var n = e;
109
- return A(n) + ".Consumer";
110
- case p:
111
- var u = e;
112
- return A(u._context) + ".Provider";
113
- case d:
114
- return k(e, e.render, "ForwardRef");
115
- case y:
116
- var v = e.displayName || null;
117
- return v !== null ? v : T(e.type) || "Memo";
118
- case P: {
119
- var E = e, R = E._payload, h = E._init;
107
+ case v:
108
+ var a = e;
109
+ return R(a) + ".Consumer";
110
+ case u:
111
+ var l = e;
112
+ return R(l._context) + ".Provider";
113
+ case f:
114
+ return y(e, e.render, "ForwardRef");
115
+ case w:
116
+ var p = e.displayName || null;
117
+ return p !== null ? p : P(e.type) || "Memo";
118
+ case j: {
119
+ var S = e, C = S._payload, E = S._init;
120
120
  try {
121
- return T(h(R));
121
+ return P(E(C));
122
122
  } catch {
123
123
  return null;
124
124
  }
@@ -126,18 +126,18 @@ function Yr() {
126
126
  }
127
127
  return null;
128
128
  }
129
- var G = Object.assign, Y = 0, J, de, fe, ne, ie, _, q;
130
- function ae() {
129
+ var V = Object.assign, H = 0, Z, oe, he, ue, ce, _, J;
130
+ function Q() {
131
131
  }
132
- ae.__reactDisabledLog = !0;
133
- function ve() {
132
+ Q.__reactDisabledLog = !0;
133
+ function q() {
134
134
  {
135
- if (Y === 0) {
136
- J = console.log, de = console.info, fe = console.warn, ne = console.error, ie = console.group, _ = console.groupCollapsed, q = console.groupEnd;
135
+ if (H === 0) {
136
+ Z = console.log, oe = console.info, he = console.warn, ue = console.error, ce = console.group, _ = console.groupCollapsed, J = console.groupEnd;
137
137
  var e = {
138
138
  configurable: !0,
139
139
  enumerable: !0,
140
- value: ae,
140
+ value: Q,
141
141
  writable: !0
142
142
  };
143
143
  Object.defineProperties(console, {
@@ -150,279 +150,279 @@ function Yr() {
150
150
  groupEnd: e
151
151
  });
152
152
  }
153
- Y++;
153
+ H++;
154
154
  }
155
155
  }
156
- function pe() {
156
+ function be() {
157
157
  {
158
- if (Y--, Y === 0) {
158
+ if (H--, H === 0) {
159
159
  var e = {
160
160
  configurable: !0,
161
161
  enumerable: !0,
162
162
  writable: !0
163
163
  };
164
164
  Object.defineProperties(console, {
165
- log: G({}, e, {
166
- value: J
165
+ log: V({}, e, {
166
+ value: Z
167
167
  }),
168
- info: G({}, e, {
169
- value: de
168
+ info: V({}, e, {
169
+ value: oe
170
170
  }),
171
- warn: G({}, e, {
172
- value: fe
171
+ warn: V({}, e, {
172
+ value: he
173
173
  }),
174
- error: G({}, e, {
175
- value: ne
174
+ error: V({}, e, {
175
+ value: ue
176
176
  }),
177
- group: G({}, e, {
178
- value: ie
177
+ group: V({}, e, {
178
+ value: ce
179
179
  }),
180
- groupCollapsed: G({}, e, {
180
+ groupCollapsed: V({}, e, {
181
181
  value: _
182
182
  }),
183
- groupEnd: G({}, e, {
184
- value: q
183
+ groupEnd: V({}, e, {
184
+ value: J
185
185
  })
186
186
  });
187
187
  }
188
- Y < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
+ H < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
189
  }
190
190
  }
191
- var ke = c.ReactCurrentDispatcher, Ce;
192
- function ge(e, n, u) {
191
+ var Pe = g.ReactCurrentDispatcher, Te;
192
+ function xe(e, a, l) {
193
193
  {
194
- if (Ce === void 0)
194
+ if (Te === void 0)
195
195
  try {
196
196
  throw Error();
197
- } catch (E) {
198
- var v = E.stack.trim().match(/\n( *(at )?)/);
199
- Ce = v && v[1] || "";
197
+ } catch (S) {
198
+ var p = S.stack.trim().match(/\n( *(at )?)/);
199
+ Te = p && p[1] || "";
200
200
  }
201
201
  return `
202
- ` + Ce + e;
202
+ ` + Te + e;
203
203
  }
204
204
  }
205
- var Pe = !1, be;
205
+ var je = !1, ye;
206
206
  {
207
- var br = typeof WeakMap == "function" ? WeakMap : Map;
208
- be = new br();
207
+ var mr = typeof WeakMap == "function" ? WeakMap : Map;
208
+ ye = new mr();
209
209
  }
210
- function Me(e, n) {
211
- if (!e || Pe)
210
+ function Be(e, a) {
211
+ if (!e || je)
212
212
  return "";
213
213
  {
214
- var u = be.get(e);
215
- if (u !== void 0)
216
- return u;
214
+ var l = ye.get(e);
215
+ if (l !== void 0)
216
+ return l;
217
217
  }
218
- var v;
219
- Pe = !0;
220
- var E = Error.prepareStackTrace;
218
+ var p;
219
+ je = !0;
220
+ var S = Error.prepareStackTrace;
221
221
  Error.prepareStackTrace = void 0;
222
- var R;
223
- R = ke.current, ke.current = null, ve();
222
+ var C;
223
+ C = Pe.current, Pe.current = null, q();
224
224
  try {
225
- if (n) {
226
- var h = function() {
225
+ if (a) {
226
+ var E = function() {
227
227
  throw Error();
228
228
  };
229
- if (Object.defineProperty(h.prototype, "props", {
229
+ if (Object.defineProperty(E.prototype, "props", {
230
230
  set: function() {
231
231
  throw Error();
232
232
  }
233
233
  }), typeof Reflect == "object" && Reflect.construct) {
234
234
  try {
235
- Reflect.construct(h, []);
236
- } catch (W) {
237
- v = W;
235
+ Reflect.construct(E, []);
236
+ } catch (U) {
237
+ p = U;
238
238
  }
239
- Reflect.construct(e, [], h);
239
+ Reflect.construct(e, [], E);
240
240
  } else {
241
241
  try {
242
- h.call();
243
- } catch (W) {
244
- v = W;
242
+ E.call();
243
+ } catch (U) {
244
+ p = U;
245
245
  }
246
- e.call(h.prototype);
246
+ e.call(E.prototype);
247
247
  }
248
248
  } else {
249
249
  try {
250
250
  throw Error();
251
- } catch (W) {
252
- v = W;
251
+ } catch (U) {
252
+ p = U;
253
253
  }
254
254
  e();
255
255
  }
256
- } catch (W) {
257
- if (W && v && typeof W.stack == "string") {
258
- for (var b = W.stack.split(`
259
- `), M = v.stack.split(`
260
- `), D = b.length - 1, O = M.length - 1; D >= 1 && O >= 0 && b[D] !== M[O]; )
261
- O--;
262
- for (; D >= 1 && O >= 0; D--, O--)
263
- if (b[D] !== M[O]) {
264
- if (D !== 1 || O !== 1)
256
+ } catch (U) {
257
+ if (U && p && typeof U.stack == "string") {
258
+ for (var b = U.stack.split(`
259
+ `), W = p.stack.split(`
260
+ `), L = b.length - 1, F = W.length - 1; L >= 1 && F >= 0 && b[L] !== W[F]; )
261
+ F--;
262
+ for (; L >= 1 && F >= 0; L--, F--)
263
+ if (b[L] !== W[F]) {
264
+ if (L !== 1 || F !== 1)
265
265
  do
266
- if (D--, O--, O < 0 || b[D] !== M[O]) {
267
- var U = `
268
- ` + b[D].replace(" at new ", " at ");
269
- return e.displayName && U.includes("<anonymous>") && (U = U.replace("<anonymous>", e.displayName)), typeof e == "function" && be.set(e, U), U;
266
+ if (L--, F--, F < 0 || b[L] !== W[F]) {
267
+ var G = `
268
+ ` + b[L].replace(" at new ", " at ");
269
+ return e.displayName && G.includes("<anonymous>") && (G = G.replace("<anonymous>", e.displayName)), typeof e == "function" && ye.set(e, G), G;
270
270
  }
271
- while (D >= 1 && O >= 0);
271
+ while (L >= 1 && F >= 0);
272
272
  break;
273
273
  }
274
274
  }
275
275
  } finally {
276
- Pe = !1, ke.current = R, pe(), Error.prepareStackTrace = E;
276
+ je = !1, Pe.current = C, be(), Error.prepareStackTrace = S;
277
277
  }
278
- var K = e ? e.displayName || e.name : "", Z = K ? ge(K) : "";
279
- return typeof e == "function" && be.set(e, Z), Z;
278
+ var ne = e ? e.displayName || e.name : "", K = ne ? xe(ne) : "";
279
+ return typeof e == "function" && ye.set(e, K), K;
280
280
  }
281
- function hr(e, n, u) {
282
- return Me(e, !1);
281
+ function wr(e, a, l) {
282
+ return Be(e, !1);
283
283
  }
284
- function xr(e) {
285
- var n = e.prototype;
286
- return !!(n && n.isReactComponent);
284
+ function _r(e) {
285
+ var a = e.prototype;
286
+ return !!(a && a.isReactComponent);
287
287
  }
288
- function he(e, n, u) {
288
+ function me(e, a, l) {
289
289
  if (e == null)
290
290
  return "";
291
291
  if (typeof e == "function")
292
- return Me(e, xr(e));
292
+ return Be(e, _r(e));
293
293
  if (typeof e == "string")
294
- return ge(e);
294
+ return xe(e);
295
295
  switch (e) {
296
- case w:
297
- return ge("Suspense");
298
- case x:
299
- return ge("SuspenseList");
296
+ case m:
297
+ return xe("Suspense");
298
+ case h:
299
+ return xe("SuspenseList");
300
300
  }
301
301
  if (typeof e == "object")
302
302
  switch (e.$$typeof) {
303
- case d:
304
- return hr(e.render);
305
- case y:
306
- return he(e.type, n, u);
307
- case P: {
308
- var v = e, E = v._payload, R = v._init;
303
+ case f:
304
+ return wr(e.render);
305
+ case w:
306
+ return me(e.type, a, l);
307
+ case j: {
308
+ var p = e, S = p._payload, C = p._init;
309
309
  try {
310
- return he(R(E), n, u);
310
+ return me(C(S), a, l);
311
311
  } catch {
312
312
  }
313
313
  }
314
314
  }
315
315
  return "";
316
316
  }
317
- var ue = Object.prototype.hasOwnProperty, We = {}, Be = c.ReactDebugCurrentFrame;
318
- function xe(e) {
317
+ var de = Object.prototype.hasOwnProperty, Ue = {}, Ye = g.ReactDebugCurrentFrame;
318
+ function we(e) {
319
319
  if (e) {
320
- var n = e._owner, u = he(e.type, e._source, n ? n.type : null);
321
- Be.setExtraStackFrame(u);
320
+ var a = e._owner, l = me(e.type, e._source, a ? a.type : null);
321
+ Ye.setExtraStackFrame(l);
322
322
  } else
323
- Be.setExtraStackFrame(null);
323
+ Ye.setExtraStackFrame(null);
324
324
  }
325
- function yr(e, n, u, v, E) {
325
+ function Er(e, a, l, p, S) {
326
326
  {
327
- var R = Function.call.bind(ue);
328
- for (var h in e)
329
- if (R(e, h)) {
327
+ var C = Function.call.bind(de);
328
+ for (var E in e)
329
+ if (C(e, E)) {
330
330
  var b = void 0;
331
331
  try {
332
- if (typeof e[h] != "function") {
333
- var M = Error((v || "React class") + ": " + u + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
- throw M.name = "Invariant Violation", M;
332
+ if (typeof e[E] != "function") {
333
+ var W = Error((p || "React class") + ": " + l + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ throw W.name = "Invariant Violation", W;
335
335
  }
336
- b = e[h](n, h, v, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (D) {
338
- b = D;
336
+ b = e[E](a, E, p, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch (L) {
338
+ b = L;
339
339
  }
340
- b && !(b instanceof Error) && (xe(E), f("%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).", v || "React class", u, h, typeof b), xe(null)), b instanceof Error && !(b.message in We) && (We[b.message] = !0, xe(E), f("Failed %s type: %s", u, b.message), xe(null));
340
+ b && !(b instanceof Error) && (we(S), 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).", p || "React class", l, E, typeof b), we(null)), b instanceof Error && !(b.message in Ue) && (Ue[b.message] = !0, we(S), c("Failed %s type: %s", l, b.message), we(null));
341
341
  }
342
342
  }
343
343
  }
344
- var mr = Array.isArray;
345
- function je(e) {
346
- return mr(e);
344
+ var Rr = Array.isArray;
345
+ function Ve(e) {
346
+ return Rr(e);
347
347
  }
348
- function wr(e) {
348
+ function Sr(e) {
349
349
  {
350
- var n = typeof Symbol == "function" && Symbol.toStringTag, u = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
- return u;
350
+ var a = typeof Symbol == "function" && Symbol.toStringTag, l = a && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
+ return l;
352
352
  }
353
353
  }
354
- function _r(e) {
354
+ function Cr(e) {
355
355
  try {
356
- return Ye(e), !1;
356
+ return He(e), !1;
357
357
  } catch {
358
358
  return !0;
359
359
  }
360
360
  }
361
- function Ye(e) {
361
+ function He(e) {
362
362
  return "" + e;
363
363
  }
364
- function Ue(e) {
365
- if (_r(e))
366
- return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", wr(e)), Ye(e);
364
+ function Ge(e) {
365
+ if (Cr(e))
366
+ return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Sr(e)), He(e);
367
367
  }
368
- var Ge = c.ReactCurrentOwner, Er = {
368
+ var Xe = g.ReactCurrentOwner, kr = {
369
369
  key: !0,
370
370
  ref: !0,
371
371
  __self: !0,
372
372
  __source: !0
373
- }, He, Xe;
374
- function Rr(e) {
375
- if (ue.call(e, "ref")) {
376
- var n = Object.getOwnPropertyDescriptor(e, "ref").get;
377
- if (n && n.isReactWarning)
373
+ }, qe, Je;
374
+ function Pr(e) {
375
+ if (de.call(e, "ref")) {
376
+ var a = Object.getOwnPropertyDescriptor(e, "ref").get;
377
+ if (a && a.isReactWarning)
378
378
  return !1;
379
379
  }
380
380
  return e.ref !== void 0;
381
381
  }
382
- function Sr(e) {
383
- if (ue.call(e, "key")) {
384
- var n = Object.getOwnPropertyDescriptor(e, "key").get;
385
- if (n && n.isReactWarning)
382
+ function Tr(e) {
383
+ if (de.call(e, "key")) {
384
+ var a = Object.getOwnPropertyDescriptor(e, "key").get;
385
+ if (a && a.isReactWarning)
386
386
  return !1;
387
387
  }
388
388
  return e.key !== void 0;
389
389
  }
390
- function kr(e, n) {
391
- typeof e.ref == "string" && Ge.current;
390
+ function jr(e, a) {
391
+ typeof e.ref == "string" && Xe.current;
392
392
  }
393
- function Cr(e, n) {
393
+ function Vr(e, a) {
394
394
  {
395
- var u = function() {
396
- He || (He = !0, f("%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)", n));
395
+ var l = function() {
396
+ qe || (qe = !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)", a));
397
397
  };
398
- u.isReactWarning = !0, Object.defineProperty(e, "key", {
399
- get: u,
398
+ l.isReactWarning = !0, Object.defineProperty(e, "key", {
399
+ get: l,
400
400
  configurable: !0
401
401
  });
402
402
  }
403
403
  }
404
- function Pr(e, n) {
404
+ function Ir(e, a) {
405
405
  {
406
- var u = function() {
407
- Xe || (Xe = !0, f("%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)", n));
406
+ var l = function() {
407
+ Je || (Je = !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)", a));
408
408
  };
409
- u.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
- get: u,
409
+ l.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
+ get: l,
411
411
  configurable: !0
412
412
  });
413
413
  }
414
414
  }
415
- var jr = function(e, n, u, v, E, R, h) {
415
+ var Or = function(e, a, l, p, S, C, E) {
416
416
  var b = {
417
417
  // This tag allows us to uniquely identify this as a React Element
418
418
  $$typeof: t,
419
419
  // Built-in properties that belong on the element
420
420
  type: e,
421
- key: n,
422
- ref: u,
423
- props: h,
421
+ key: a,
422
+ ref: l,
423
+ props: E,
424
424
  // Record the component responsible for creating this element.
425
- _owner: R
425
+ _owner: C
426
426
  };
427
427
  return b._store = {}, Object.defineProperty(b._store, "validated", {
428
428
  configurable: !1,
@@ -433,49 +433,49 @@ function Yr() {
433
433
  configurable: !1,
434
434
  enumerable: !1,
435
435
  writable: !1,
436
- value: v
436
+ value: p
437
437
  }), Object.defineProperty(b, "_source", {
438
438
  configurable: !1,
439
439
  enumerable: !1,
440
440
  writable: !1,
441
- value: E
441
+ value: S
442
442
  }), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
443
443
  };
444
- function Vr(e, n, u, v, E) {
444
+ function Dr(e, a, l, p, S) {
445
445
  {
446
- var R, h = {}, b = null, M = null;
447
- u !== void 0 && (Ue(u), b = "" + u), Sr(n) && (Ue(n.key), b = "" + n.key), Rr(n) && (M = n.ref, kr(n, E));
448
- for (R in n)
449
- ue.call(n, R) && !Er.hasOwnProperty(R) && (h[R] = n[R]);
446
+ var C, E = {}, b = null, W = null;
447
+ l !== void 0 && (Ge(l), b = "" + l), Tr(a) && (Ge(a.key), b = "" + a.key), Pr(a) && (W = a.ref, jr(a, S));
448
+ for (C in a)
449
+ de.call(a, C) && !kr.hasOwnProperty(C) && (E[C] = a[C]);
450
450
  if (e && e.defaultProps) {
451
- var D = e.defaultProps;
452
- for (R in D)
453
- h[R] === void 0 && (h[R] = D[R]);
451
+ var L = e.defaultProps;
452
+ for (C in L)
453
+ E[C] === void 0 && (E[C] = L[C]);
454
454
  }
455
- if (b || M) {
456
- var O = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
- b && Cr(h, O), M && Pr(h, O);
455
+ if (b || W) {
456
+ var F = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
+ b && Vr(E, F), W && Ir(E, F);
458
458
  }
459
- return jr(e, b, M, E, v, Ge.current, h);
459
+ return Or(e, b, W, S, p, Xe.current, E);
460
460
  }
461
461
  }
462
- var Ve = c.ReactCurrentOwner, Je = c.ReactDebugCurrentFrame;
463
- function Q(e) {
462
+ var Ie = g.ReactCurrentOwner, Ze = g.ReactDebugCurrentFrame;
463
+ function te(e) {
464
464
  if (e) {
465
- var n = e._owner, u = he(e.type, e._source, n ? n.type : null);
466
- Je.setExtraStackFrame(u);
465
+ var a = e._owner, l = me(e.type, e._source, a ? a.type : null);
466
+ Ze.setExtraStackFrame(l);
467
467
  } else
468
- Je.setExtraStackFrame(null);
468
+ Ze.setExtraStackFrame(null);
469
469
  }
470
- var Te;
471
- Te = !1;
470
+ var Oe;
471
+ Oe = !1;
472
472
  function De(e) {
473
473
  return typeof e == "object" && e !== null && e.$$typeof === t;
474
474
  }
475
- function qe() {
475
+ function Qe() {
476
476
  {
477
- if (Ve.current) {
478
- var e = T(Ve.current.type);
477
+ if (Ie.current) {
478
+ var e = P(Ie.current.type);
479
479
  if (e)
480
480
  return `
481
481
 
@@ -484,202 +484,212 @@ Check the render method of \`` + e + "`.";
484
484
  return "";
485
485
  }
486
486
  }
487
- function Tr(e) {
487
+ function Lr(e) {
488
488
  return "";
489
489
  }
490
- var Ze = {};
491
- function Dr(e) {
490
+ var Ke = {};
491
+ function zr(e) {
492
492
  {
493
- var n = qe();
494
- if (!n) {
495
- var u = typeof e == "string" ? e : e.displayName || e.name;
496
- u && (n = `
493
+ var a = Qe();
494
+ if (!a) {
495
+ var l = typeof e == "string" ? e : e.displayName || e.name;
496
+ l && (a = `
497
497
 
498
- Check the top-level render call using <` + u + ">.");
498
+ Check the top-level render call using <` + l + ">.");
499
499
  }
500
- return n;
500
+ return a;
501
501
  }
502
502
  }
503
- function Qe(e, n) {
503
+ function er(e, a) {
504
504
  {
505
505
  if (!e._store || e._store.validated || e.key != null)
506
506
  return;
507
507
  e._store.validated = !0;
508
- var u = Dr(n);
509
- if (Ze[u])
508
+ var l = zr(a);
509
+ if (Ke[l])
510
510
  return;
511
- Ze[u] = !0;
512
- var v = "";
513
- e && e._owner && e._owner !== Ve.current && (v = " It was passed a child from " + T(e._owner.type) + "."), Q(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, v), Q(null);
511
+ Ke[l] = !0;
512
+ var p = "";
513
+ e && e._owner && e._owner !== Ie.current && (p = " It was passed a child from " + P(e._owner.type) + "."), te(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.', l, p), te(null);
514
514
  }
515
515
  }
516
- function Ke(e, n) {
516
+ function rr(e, a) {
517
517
  {
518
518
  if (typeof e != "object")
519
519
  return;
520
- if (je(e))
521
- for (var u = 0; u < e.length; u++) {
522
- var v = e[u];
523
- De(v) && Qe(v, n);
520
+ if (Ve(e))
521
+ for (var l = 0; l < e.length; l++) {
522
+ var p = e[l];
523
+ De(p) && er(p, a);
524
524
  }
525
525
  else if (De(e))
526
526
  e._store && (e._store.validated = !0);
527
527
  else if (e) {
528
- var E = L(e);
529
- if (typeof E == "function" && E !== e.entries)
530
- for (var R = E.call(e), h; !(h = R.next()).done; )
531
- De(h.value) && Qe(h.value, n);
528
+ var S = z(e);
529
+ if (typeof S == "function" && S !== e.entries)
530
+ for (var C = S.call(e), E; !(E = C.next()).done; )
531
+ De(E.value) && er(E.value, a);
532
532
  }
533
533
  }
534
534
  }
535
- function Ir(e) {
535
+ function Ar(e) {
536
536
  {
537
- var n = e.type;
538
- if (n == null || typeof n == "string")
537
+ var a = e.type;
538
+ if (a == null || typeof a == "string")
539
539
  return;
540
- var u;
541
- if (typeof n == "function")
542
- u = n.propTypes;
543
- else if (typeof n == "object" && (n.$$typeof === d || // Note: Memo only checks outer props here.
540
+ var l;
541
+ if (typeof a == "function")
542
+ l = a.propTypes;
543
+ else if (typeof a == "object" && (a.$$typeof === f || // Note: Memo only checks outer props here.
544
544
  // Inner props are checked in the reconciler.
545
- n.$$typeof === y))
546
- u = n.propTypes;
545
+ a.$$typeof === w))
546
+ l = a.propTypes;
547
547
  else
548
548
  return;
549
- if (u) {
550
- var v = T(n);
551
- yr(u, e.props, "prop", v, e);
552
- } else if (n.PropTypes !== void 0 && !Te) {
553
- Te = !0;
554
- var E = T(n);
555
- f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", E || "Unknown");
549
+ if (l) {
550
+ var p = P(a);
551
+ Er(l, e.props, "prop", p, e);
552
+ } else if (a.PropTypes !== void 0 && !Oe) {
553
+ Oe = !0;
554
+ var S = P(a);
555
+ c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
556
556
  }
557
- typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
+ typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
558
  }
559
559
  }
560
- function Or(e) {
560
+ function Fr(e) {
561
561
  {
562
- for (var n = Object.keys(e.props), u = 0; u < n.length; u++) {
563
- var v = n[u];
564
- if (v !== "children" && v !== "key") {
565
- Q(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), Q(null);
562
+ for (var a = Object.keys(e.props), l = 0; l < a.length; l++) {
563
+ var p = a[l];
564
+ if (p !== "children" && p !== "key") {
565
+ te(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), te(null);
566
566
  break;
567
567
  }
568
568
  }
569
- e.ref !== null && (Q(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), Q(null));
569
+ e.ref !== null && (te(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), te(null));
570
570
  }
571
571
  }
572
- var er = {};
573
- function rr(e, n, u, v, E, R) {
572
+ var or = {};
573
+ function tr(e, a, l, p, S, C) {
574
574
  {
575
- var h = m(e);
576
- if (!h) {
575
+ var E = re(e);
576
+ if (!E) {
577
577
  var b = "";
578
578
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (b += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var M = Tr();
580
- M ? b += M : b += qe();
581
- var D;
582
- e === null ? D = "null" : je(e) ? D = "array" : e !== void 0 && e.$$typeof === t ? (D = "<" + (T(e.type) || "Unknown") + " />", b = " Did you accidentally export a JSX literal instead of a component?") : D = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, b);
579
+ var W = Lr();
580
+ W ? b += W : b += Qe();
581
+ var L;
582
+ e === null ? L = "null" : Ve(e) ? L = "array" : e !== void 0 && e.$$typeof === t ? (L = "<" + (P(e.type) || "Unknown") + " />", b = " Did you accidentally export a JSX literal instead of a component?") : L = 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", L, b);
583
583
  }
584
- var O = Vr(e, n, u, E, R);
585
- if (O == null)
586
- return O;
587
- if (h) {
588
- var U = n.children;
589
- if (U !== void 0)
590
- if (v)
591
- if (je(U)) {
592
- for (var K = 0; K < U.length; K++)
593
- Ke(U[K], e);
594
- Object.freeze && Object.freeze(U);
584
+ var F = Dr(e, a, l, S, C);
585
+ if (F == null)
586
+ return F;
587
+ if (E) {
588
+ var G = a.children;
589
+ if (G !== void 0)
590
+ if (p)
591
+ if (Ve(G)) {
592
+ for (var ne = 0; ne < G.length; ne++)
593
+ rr(G[ne], e);
594
+ Object.freeze && Object.freeze(G);
595
595
  } else
596
- f("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
+ 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.");
597
597
  else
598
- Ke(U, e);
598
+ rr(G, e);
599
599
  }
600
- if (ue.call(n, "key")) {
601
- var Z = T(e), W = Object.keys(n).filter(function($r) {
602
- return $r !== "key";
603
- }), Ie = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!er[Z + Ie]) {
605
- var Nr = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
606
- f(`A props object containing a "key" prop is being spread into JSX:
600
+ if (de.call(a, "key")) {
601
+ var K = P(e), U = Object.keys(a).filter(function(Ur) {
602
+ return Ur !== "key";
603
+ }), Le = U.length > 0 ? "{key: someKey, " + U.join(": ..., ") + ": ...}" : "{key: someKey}";
604
+ if (!or[K + Le]) {
605
+ var Br = U.length > 0 ? "{" + U.join(": ..., ") + ": ...}" : "{}";
606
+ c(`A props object containing a "key" prop is being spread into JSX:
607
607
  let props = %s;
608
608
  <%s {...props} />
609
609
  React keys must be passed directly to JSX without using spread:
610
610
  let props = %s;
611
- <%s key={someKey} {...props} />`, Ie, Z, Nr, Z), er[Z + Ie] = !0;
611
+ <%s key={someKey} {...props} />`, Le, K, Br, K), or[K + Le] = !0;
612
612
  }
613
613
  }
614
- return e === i ? Or(O) : Ir(O), O;
614
+ return e === n ? Fr(F) : Ar(F), F;
615
615
  }
616
616
  }
617
- function Lr(e, n, u) {
618
- return rr(e, n, u, !0);
617
+ function Nr(e, a, l) {
618
+ return tr(e, a, l, !0);
619
619
  }
620
- function zr(e, n, u) {
621
- return rr(e, n, u, !1);
620
+ function $r(e, a, l) {
621
+ return tr(e, a, l, !1);
622
622
  }
623
- var Ar = zr, Fr = Lr;
624
- se.Fragment = i, se.jsx = Ar, se.jsxs = Fr;
625
- }()), se;
623
+ var Mr = $r, Wr = Nr;
624
+ ve.Fragment = n, ve.jsx = Mr, ve.jsxs = Wr;
625
+ }()), ve;
626
626
  }
627
- process.env.NODE_ENV === "production" ? Ae.exports = Br() : Ae.exports = Yr();
628
- var l = Ae.exports;
629
- function Ur(r) {
627
+ process.env.NODE_ENV === "production" ? Ne.exports = Gr() : Ne.exports = Xr();
628
+ var d = Ne.exports;
629
+ function qr(r) {
630
630
  if (r.id && /^[a-zA-Z][\w-]*$/.test(r.id))
631
631
  return `#${r.id}`;
632
632
  const t = [];
633
633
  let o = r;
634
634
  for (; o && o.nodeType === Node.ELEMENT_NODE; ) {
635
- let i = o.nodeName.toLowerCase();
635
+ let n = o.nodeName.toLowerCase();
636
636
  if (o.id && /^[a-zA-Z][\w-]*$/.test(o.id)) {
637
637
  t.unshift(`#${o.id}`);
638
638
  break;
639
639
  }
640
640
  if (o.className && typeof o.className == "string") {
641
- const a = o.className.trim().split(/\s+/).filter(Boolean);
642
- if (a.length > 0) {
643
- const s = a.filter((p) => /^[a-zA-Z][\w-]*$/.test(p)).slice(0, 2).map((p) => `.${p}`).join("");
644
- s && (i += s);
641
+ const i = o.className.trim().split(/\s+/).filter(Boolean);
642
+ if (i.length > 0) {
643
+ const s = i.filter((u) => /^[a-zA-Z][\w-]*$/.test(u)).slice(0, 2).map((u) => `.${u}`).join("");
644
+ s && (n += s);
645
645
  }
646
646
  }
647
647
  if (t.length > 0) {
648
- const a = o.parentElement;
649
- if (a) {
650
- const s = Array.from(a.children).filter(
651
- (p) => p.nodeName === o.nodeName
648
+ const i = o.parentElement;
649
+ if (i) {
650
+ const s = Array.from(i.children).filter(
651
+ (u) => u.nodeName === o.nodeName
652
652
  );
653
653
  if (s.length > 1) {
654
- const p = s.indexOf(o) + 1;
655
- i += `:nth-child(${p})`;
654
+ const u = s.indexOf(o) + 1;
655
+ n += `:nth-child(${u})`;
656
656
  }
657
657
  }
658
658
  }
659
- t.unshift(i), o = o.parentElement;
659
+ t.unshift(n), o = o.parentElement;
660
660
  }
661
661
  return t.join(" > ");
662
662
  }
663
- const Gr = "[data-review-layer-root]", Hr = 16;
664
- function Fe(r, t, o = Hr) {
663
+ const Jr = "[data-review-layer-root]", Zr = 16;
664
+ function $e(r, t, o = Zr) {
665
665
  if (typeof window > "u") return { x: r, y: t };
666
- const i = o, a = o, s = window.innerWidth - o, p = window.innerHeight - o;
666
+ const n = o, i = o, s = window.innerWidth - o, u = window.innerHeight - o;
667
667
  return {
668
- x: Math.max(i, Math.min(s, r)),
669
- y: Math.max(a, Math.min(p, t))
668
+ x: Math.max(n, Math.min(s, r)),
669
+ y: Math.max(i, Math.min(u, t))
670
670
  };
671
671
  }
672
- function dr(r) {
672
+ function vr(r) {
673
+ if (typeof document > "u" || !r) return [];
674
+ const t = [];
675
+ let o = r.parentElement;
676
+ for (; o && o !== document.body; ) {
677
+ const n = getComputedStyle(o), i = n.overflowX, s = n.overflowY;
678
+ (i === "scroll" || i === "auto" || i === "overlay" || s === "scroll" || s === "auto" || s === "overlay") && (o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth) && t.push(o), o = o.parentElement;
679
+ }
680
+ return t;
681
+ }
682
+ function pr(r) {
673
683
  var t;
674
684
  if (typeof document > "u" || !(r != null && r.trim())) return null;
675
685
  try {
676
686
  const o = document.querySelector(r);
677
- return !o || (t = o.closest) != null && t.call(o, Gr) ? null : o.getBoundingClientRect();
687
+ return !o || (t = o.closest) != null && t.call(o, Jr) ? null : o.getBoundingClientRect();
678
688
  } catch {
679
689
  return null;
680
690
  }
681
691
  }
682
- function Xr(r) {
692
+ function Qr(r) {
683
693
  if (typeof window > "u")
684
694
  return { relativeX: 0, relativeY: 0 };
685
695
  const t = window.innerWidth, o = window.innerHeight;
@@ -688,7 +698,7 @@ function Xr(r) {
688
698
  relativeY: o > 0 ? r.top / o : 0
689
699
  };
690
700
  }
691
- function Ne(r) {
701
+ function gr(r) {
692
702
  if (typeof window > "u")
693
703
  return {
694
704
  x: r.x ?? 0,
@@ -703,88 +713,164 @@ function Ne(r) {
703
713
  y: r.y ?? 0
704
714
  };
705
715
  }
706
- function Jr(r) {
707
- const { x: t, y: o } = Ne(r), i = r.width ?? 100, a = r.height ?? 40;
708
- return new DOMRect(t, o, i, a);
716
+ function Kr(r) {
717
+ const { x: t, y: o } = gr(r), n = r.width ?? 100, i = r.height ?? 40;
718
+ return new DOMRect(t, o, n, i);
709
719
  }
710
- function we(r) {
711
- const t = (r.relativeX ?? r.relative_x) != null && (r.relativeY ?? r.relative_y) != null, o = r.x != null && r.y != null;
712
- if (t || o)
713
- return Ne(r);
720
+ function Ee(r) {
714
721
  if (r.selector) {
715
- const i = dr(r.selector);
716
- if (i != null)
717
- return { x: i.left, y: i.top };
722
+ const t = pr(r.selector);
723
+ if (t != null)
724
+ return { x: t.left, y: t.top };
718
725
  }
719
- return Ne(r);
726
+ return gr(r);
720
727
  }
721
- const C = {
728
+ function Me() {
729
+ if (typeof window > "u") return "/";
730
+ try {
731
+ const r = new URLSearchParams(window.location.search).get("path");
732
+ if (r != null && r.trim() !== "")
733
+ return r.startsWith("/") ? r : `/${r}`;
734
+ } catch {
735
+ }
736
+ return window.location.pathname || "/";
737
+ }
738
+ const T = {
722
739
  PENDING: "pending",
723
740
  DEV_FIXED: "dev_fixed",
724
741
  VALIDATED: "validated"
725
- };
726
- function ce(r) {
742
+ }, ar = "[review-layer API]";
743
+ function X(r, t, o) {
744
+ if ("status" in o) {
745
+ const { status: v, statusText: f, body: m = "" } = o;
746
+ let h;
747
+ v === 401 ? h = "No autorizado (401). Revisa que apiKey sea correcta y esté aceptada por la API." : v === 403 ? h = "Acceso denegado (403). Revisa apiKey o permisos del proyecto." : v === 404 ? h = "Recurso no encontrado (404). Revisa apiUrl y que la ruta exista en el backend." : v >= 500 ? h = "Error del servidor (5xx). El backend puede estar caído o sobrecargado." : h = `Respuesta HTTP ${v} ${f}. Revisa la API.`, console.error(ar, r, {
748
+ motivo: h,
749
+ url: t,
750
+ status: v,
751
+ statusText: f,
752
+ body: m.slice(0, 300)
753
+ });
754
+ return;
755
+ }
756
+ const n = o.networkError, i = n instanceof Error ? n.message : String(n), u = n instanceof TypeError || /failed to fetch|networkerror|load failed|network request failed/i.test(i) ? "Posible CORS o error de red (servidor inalcanzable, bloqueo CORS o certificado). Revisa que apiUrl sea accesible desde este origen y que el backend permita CORS." : `Error inesperado: ${i}`;
757
+ console.error(ar, r, { motivo: u, url: t, error: n });
758
+ }
759
+ function ge(r) {
727
760
  return {
728
761
  "Content-Type": "application/json",
729
762
  "x-review-key": r
730
763
  };
731
764
  }
732
- async function qr(r, t, o) {
733
- const i = await fetch(`${r}/reviewers`, {
734
- headers: ce(t),
735
- signal: o == null ? void 0 : o.signal
736
- });
737
- if (!i.ok) throw new Error("Failed to fetch reviewers");
765
+ async function eo(r, t, o) {
766
+ const n = `${r}/reviewers`;
767
+ let i;
768
+ try {
769
+ i = await fetch(n, {
770
+ headers: ge(t),
771
+ signal: o == null ? void 0 : o.signal
772
+ });
773
+ } catch (u) {
774
+ throw X("fetchReviewers (red/CORS)", n, { networkError: u }), u;
775
+ }
776
+ if (!i.ok) {
777
+ const u = await i.text();
778
+ throw X("fetchReviewers", n, { status: i.status, statusText: i.statusText, body: u }), new Error("Failed to fetch reviewers");
779
+ }
738
780
  return (await i.json()).data ?? [];
739
781
  }
740
- async function Zr(r, t, o) {
741
- const i = await fetch(`${r}/comments`, {
742
- method: "POST",
743
- headers: ce(t),
744
- body: JSON.stringify(o)
745
- });
782
+ async function ro(r, t, o) {
783
+ const n = `${r}/comments`;
784
+ let i;
785
+ try {
786
+ i = await fetch(n, {
787
+ method: "POST",
788
+ headers: ge(t),
789
+ body: JSON.stringify(o)
790
+ });
791
+ } catch (u) {
792
+ throw X("createComment (red/CORS)", n, { networkError: u }), u;
793
+ }
746
794
  if (!i.ok) {
747
- const s = await i.json().catch(() => ({}));
748
- throw new Error(s.message || "Failed to create comment");
795
+ const u = await i.text();
796
+ let v = "Failed to create comment";
797
+ try {
798
+ v = JSON.parse(u).message ?? v;
799
+ } catch {
800
+ }
801
+ throw X("createComment", n, { status: i.status, statusText: i.statusText, body: u }), new Error(v);
749
802
  }
750
803
  return (await i.json()).data;
751
804
  }
752
- async function Qr(r, t, o, i) {
753
- const a = new URLSearchParams({ url: o }), s = await fetch(`${r}/comments?${a}`, {
754
- headers: ce(t),
755
- signal: i == null ? void 0 : i.signal
756
- });
757
- if (!s.ok) throw new Error("Failed to fetch comments");
758
- return (await s.json()).data ?? [];
805
+ async function oo(r, t, o, n) {
806
+ const i = new URLSearchParams({ url: o }), s = `${r}/comments?${i}`;
807
+ let u;
808
+ try {
809
+ u = await fetch(s, {
810
+ headers: ge(t),
811
+ signal: n == null ? void 0 : n.signal
812
+ });
813
+ } catch (f) {
814
+ throw X("fetchComments (red/CORS)", s, { networkError: f }), f;
815
+ }
816
+ if (!u.ok) {
817
+ const f = await u.text();
818
+ throw X("fetchComments", s, { status: u.status, statusText: u.statusText, body: f }), new Error("Failed to fetch comments");
819
+ }
820
+ return (await u.json()).data ?? [];
759
821
  }
760
- async function Kr(r, t, o, i) {
761
- const a = await fetch(`${r}/comments/${o}/status`, {
762
- method: "PATCH",
763
- headers: ce(t),
764
- body: JSON.stringify({ status: i })
765
- });
766
- if (!a.ok) {
767
- const p = await a.json().catch(() => ({}));
768
- throw new Error(p.message || "Failed to update comment status");
822
+ async function to(r, t, o, n) {
823
+ const i = `${r}/comments/${o}/status`;
824
+ let s;
825
+ try {
826
+ s = await fetch(i, {
827
+ method: "PATCH",
828
+ headers: ge(t),
829
+ body: JSON.stringify({ status: n })
830
+ });
831
+ } catch (v) {
832
+ throw X("updateCommentStatus (red/CORS)", i, { networkError: v }), v;
769
833
  }
770
- return (await a.json()).data;
834
+ if (!s.ok) {
835
+ const v = await s.text();
836
+ X("updateCommentStatus", i, { status: s.status, statusText: s.statusText, body: v });
837
+ let f = "Failed to update comment status";
838
+ try {
839
+ f = JSON.parse(v).message ?? f;
840
+ } catch {
841
+ }
842
+ throw new Error(f);
843
+ }
844
+ return (await s.json()).data;
771
845
  }
772
- async function eo(r, t, o) {
773
- const i = await fetch(`${r}/comments/${o}`, {
774
- method: "DELETE",
775
- headers: ce(t)
776
- });
846
+ async function no(r, t, o) {
847
+ const n = `${r}/comments/${o}`;
848
+ let i;
849
+ try {
850
+ i = await fetch(n, {
851
+ method: "DELETE",
852
+ headers: ge(t)
853
+ });
854
+ } catch (s) {
855
+ throw X("deleteComment (red/CORS)", n, { networkError: s }), s;
856
+ }
777
857
  if (!i.ok) {
778
- const a = await i.json().catch(() => ({}));
779
- throw new Error(a.message || "Failed to delete comment");
858
+ const s = await i.text();
859
+ X("deleteComment", n, { status: i.status, statusText: i.statusText, body: s });
860
+ let u = "Failed to delete comment";
861
+ try {
862
+ u = JSON.parse(s).message ?? u;
863
+ } catch {
864
+ }
865
+ throw new Error(u);
780
866
  }
781
867
  }
782
- const ro = {
868
+ const io = {
783
869
  position: "fixed",
784
870
  inset: 0,
785
871
  zIndex: 999997,
786
872
  backgroundColor: "transparent"
787
- }, oo = {
873
+ }, ao = {
788
874
  position: "fixed",
789
875
  minWidth: 320,
790
876
  maxWidth: 400,
@@ -794,7 +880,7 @@ const ro = {
794
880
  borderRadius: "var(--ui-radius_8, 8px)",
795
881
  boxShadow: "0 8px 24px var(--ui-color-black-alpha-20, rgba(0,0,0,0.15))",
796
882
  zIndex: 999998
797
- }, to = {
883
+ }, so = {
798
884
  width: "100%",
799
885
  minHeight: 80,
800
886
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",
@@ -805,14 +891,14 @@ const ro = {
805
891
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
806
892
  resize: "vertical",
807
893
  boxSizing: "border-box"
808
- }, no = {
894
+ }, lo = {
809
895
  width: "100%",
810
896
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",
811
897
  marginBottom: "var(--ui-positive-Value_300, 12px)",
812
898
  border: "1px solid var(--ui-color-border-default, #d9d9d9)",
813
899
  borderRadius: "var(--ui-radius_6, 6px)",
814
900
  fontSize: "var(--ui-font-size-sm, 14px)"
815
- }, nr = {
901
+ }, sr = {
816
902
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_400, 16px)",
817
903
  backgroundColor: "var(--ui-color-bg-fill-danger-default, #ff4d4f)",
818
904
  color: "var(--ui-color-text-on-color, #fff)",
@@ -822,132 +908,151 @@ const ro = {
822
908
  cursor: "pointer",
823
909
  fontWeight: "var(--ui-font-weight-medium, 500)"
824
910
  };
825
- function io({
911
+ function uo({
826
912
  apiUrl: r,
827
913
  apiKey: t,
828
914
  reviewers: o,
829
- position: i,
830
- payload: a,
915
+ position: n,
916
+ payload: i,
831
917
  onClose: s,
832
- onSuccess: p
918
+ onSuccess: u
833
919
  }) {
834
- var L;
835
- const [g, d] = F(""), [w, x] = F(
836
- ((L = o[0]) == null ? void 0 : L.id) ?? 0
837
- ), [y, P] = F(!1), [S, V] = F(null);
838
- z(() => {
839
- o.length > 0 && !w && x(o[0].id);
840
- }, [o, w]);
841
- const $ = j(
920
+ var g;
921
+ const [v, f] = N(""), [m, h] = N(
922
+ ((g = o[0]) == null ? void 0 : g.id) ?? 0
923
+ ), [w, j] = N(!1), [k, D] = N(null);
924
+ O(() => {
925
+ o.length > 0 && !m && h(o[0].id);
926
+ }, [o, m]);
927
+ const M = I(
842
928
  async (c) => {
843
- if (c.preventDefault(), !(!g.trim() || !w)) {
844
- P(!0), V(null);
929
+ if (c.preventDefault(), !(!v.trim() || !m)) {
930
+ j(!0), D(null);
845
931
  try {
846
- await Zr(r, t, {
847
- ...a,
848
- message: g.trim(),
849
- reviewerId: w
850
- }), p(), s();
851
- } catch (f) {
852
- V(f instanceof Error ? f.message : "Failed to send comment");
932
+ await ro(r, t, {
933
+ ...i,
934
+ message: v.trim(),
935
+ reviewerId: m
936
+ }), u(), s();
937
+ } catch (x) {
938
+ D(x instanceof Error ? x.message : "Failed to send comment");
853
939
  } finally {
854
- P(!1);
940
+ j(!1);
855
941
  }
856
942
  }
857
943
  },
858
- [r, t, a, g, w, p, s]
859
- );
860
- return z(() => {
861
- const c = (f) => {
862
- f.key === "Escape" && (f.preventDefault(), s());
944
+ [r, t, i, v, m, u, s]
945
+ ), z = pe(null);
946
+ return O(() => {
947
+ const c = (x) => {
948
+ x.key === "Escape" && (x.preventDefault(), s());
863
949
  };
864
950
  return document.addEventListener("keydown", c, !0), () => document.removeEventListener("keydown", c, !0);
865
- }, [s]), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
866
- /* @__PURE__ */ l.jsx(
867
- "div",
868
- {
869
- role: "presentation",
870
- style: ro,
871
- onClick: s
872
- }
873
- ),
874
- /* @__PURE__ */ l.jsx(
875
- "div",
876
- {
877
- style: {
878
- ...oo,
879
- left: Math.min(i.x, typeof window < "u" ? window.innerWidth - 420 : i.x),
880
- top: i.y + 12
881
- },
882
- onClick: (c) => c.stopPropagation(),
883
- children: /* @__PURE__ */ l.jsxs("form", { onSubmit: $, children: [
884
- /* @__PURE__ */ l.jsx(
885
- "textarea",
886
- {
887
- placeholder: "Escribe tu comentario...",
888
- value: g,
889
- onChange: (c) => d(c.target.value),
890
- style: to,
891
- required: !0,
892
- autoFocus: !0
893
- }
894
- ),
895
- /* @__PURE__ */ l.jsxs(
896
- "select",
897
- {
898
- value: w,
899
- onChange: (c) => x(Number(c.target.value)),
900
- style: no,
901
- required: !0,
902
- disabled: o.length === 0,
903
- children: [
904
- /* @__PURE__ */ l.jsx("option", { value: "", children: o.length === 0 ? "No hay revisores (ejecuta php artisan db:seed en la API)" : "Selecciona revisor" }),
905
- o.map((c) => /* @__PURE__ */ l.jsx("option", { value: c.id, children: c.name }, c.id))
906
- ]
907
- }
908
- ),
909
- S && /* @__PURE__ */ l.jsx(
910
- "div",
911
- {
912
- style: {
913
- color: "var(--ui-color-text-danger-default, #ff4d4f)",
914
- fontSize: "var(--ui-font-size-xs, 12px)",
915
- marginBottom: "var(--ui-positive-Value_200, 8px)"
916
- },
917
- children: S
918
- }
919
- ),
920
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "var(--ui-positive-Value_200, 8px)" }, children: [
921
- /* @__PURE__ */ l.jsx(
922
- "button",
923
- {
924
- type: "button",
925
- onClick: s,
926
- style: {
927
- ...nr,
928
- backgroundColor: "var(--ui-color-bg-fill-secondary-default, #f0f0f0)",
929
- color: "var(--ui-color-text-primary, #333)"
930
- },
931
- children: "Cancelar"
932
- }
933
- ),
934
- /* @__PURE__ */ l.jsx(
935
- "button",
936
- {
937
- type: "submit",
938
- style: nr,
939
- disabled: y || o.length === 0,
940
- children: y ? "Enviando..." : "Enviar comentario"
941
- }
942
- )
943
- ] })
944
- ] })
945
- }
946
- )
947
- ] });
951
+ }, [s]), O(() => {
952
+ const c = (x) => {
953
+ const A = x.target;
954
+ z.current && !z.current.contains(A) && (x.preventDefault(), x.stopPropagation(), s());
955
+ };
956
+ return document.addEventListener("mousedown", c, !0), () => document.removeEventListener("mousedown", c, !0);
957
+ }, [s]), O(() => {
958
+ var c;
959
+ (c = z.current) == null || c.focus();
960
+ }, []), /* @__PURE__ */ d.jsxs(
961
+ "div",
962
+ {
963
+ ref: z,
964
+ role: "dialog",
965
+ "aria-modal": "true",
966
+ tabIndex: -1,
967
+ style: { position: "fixed", inset: 0, zIndex: 999997, outline: "none" },
968
+ children: [
969
+ /* @__PURE__ */ d.jsx(
970
+ "div",
971
+ {
972
+ role: "presentation",
973
+ style: io,
974
+ onClick: s
975
+ }
976
+ ),
977
+ /* @__PURE__ */ d.jsx(
978
+ "div",
979
+ {
980
+ style: {
981
+ ...ao,
982
+ left: Math.min(n.x, typeof window < "u" ? window.innerWidth - 420 : n.x),
983
+ top: n.y + 12
984
+ },
985
+ onClick: (c) => c.stopPropagation(),
986
+ children: /* @__PURE__ */ d.jsxs("form", { onSubmit: M, children: [
987
+ /* @__PURE__ */ d.jsx(
988
+ "textarea",
989
+ {
990
+ placeholder: "Escribe tu comentario...",
991
+ value: v,
992
+ onChange: (c) => f(c.target.value),
993
+ style: so,
994
+ required: !0,
995
+ autoFocus: !0
996
+ }
997
+ ),
998
+ /* @__PURE__ */ d.jsxs(
999
+ "select",
1000
+ {
1001
+ value: m,
1002
+ onChange: (c) => h(Number(c.target.value)),
1003
+ style: lo,
1004
+ required: !0,
1005
+ disabled: o.length === 0,
1006
+ children: [
1007
+ /* @__PURE__ */ d.jsx("option", { value: "", children: o.length === 0 ? "No hay revisores (ejecuta php artisan db:seed en la API)" : "Selecciona revisor" }),
1008
+ o.map((c) => /* @__PURE__ */ d.jsx("option", { value: c.id, children: c.name }, c.id))
1009
+ ]
1010
+ }
1011
+ ),
1012
+ k && /* @__PURE__ */ d.jsx(
1013
+ "div",
1014
+ {
1015
+ style: {
1016
+ color: "var(--ui-color-text-danger-default, #ff4d4f)",
1017
+ fontSize: "var(--ui-font-size-xs, 12px)",
1018
+ marginBottom: "var(--ui-positive-Value_200, 8px)"
1019
+ },
1020
+ children: k
1021
+ }
1022
+ ),
1023
+ /* @__PURE__ */ d.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "var(--ui-positive-Value_200, 8px)" }, children: [
1024
+ /* @__PURE__ */ d.jsx(
1025
+ "button",
1026
+ {
1027
+ type: "button",
1028
+ onClick: s,
1029
+ style: {
1030
+ ...sr,
1031
+ backgroundColor: "var(--ui-color-bg-fill-secondary-default, #f0f0f0)",
1032
+ color: "var(--ui-color-text-primary, #333)"
1033
+ },
1034
+ children: "Cancelar"
1035
+ }
1036
+ ),
1037
+ /* @__PURE__ */ d.jsx(
1038
+ "button",
1039
+ {
1040
+ type: "submit",
1041
+ style: sr,
1042
+ disabled: w || o.length === 0,
1043
+ children: w ? "Enviando..." : "Enviar comentario"
1044
+ }
1045
+ )
1046
+ ] })
1047
+ ] })
1048
+ }
1049
+ )
1050
+ ]
1051
+ }
1052
+ );
948
1053
  }
949
- const ao = Re(io), uo = "var(--ui-color-red-500, #ef4444)";
950
- function lo(r) {
1054
+ const co = Ce(uo), fo = "var(--ui-color-red-500, #ef4444)";
1055
+ function vo(r) {
951
1056
  return {
952
1057
  position: "fixed",
953
1058
  outline: `2px solid ${r}`,
@@ -957,41 +1062,41 @@ function lo(r) {
957
1062
  boxSizing: "border-box"
958
1063
  };
959
1064
  }
960
- const so = Re(function({
1065
+ const po = Ce(function({
961
1066
  selector: t,
962
1067
  active: o,
963
- fallbackComment: i,
964
- outlineColor: a = uo
1068
+ fallbackComment: n,
1069
+ outlineColor: i = fo
965
1070
  }) {
966
- const [s, p] = F(null), g = j(() => {
1071
+ const [s, u] = N(null), v = I(() => {
967
1072
  if (!o) {
968
- p(null);
1073
+ u(null);
969
1074
  return;
970
1075
  }
971
- const d = t != null && t.trim() ? dr(t) : null;
972
- if (d) {
973
- p(d);
1076
+ const f = t != null && t.trim() ? pr(t) : null;
1077
+ if (f) {
1078
+ u(f);
974
1079
  return;
975
1080
  }
976
- if (i) {
977
- p(Jr(i));
1081
+ if (n) {
1082
+ u(Kr(n));
978
1083
  return;
979
1084
  }
980
- p(null);
981
- }, [t, o, i]);
982
- return z(() => {
983
- g();
984
- }, [g]), z(() => {
1085
+ u(null);
1086
+ }, [t, o, n]);
1087
+ return O(() => {
1088
+ v();
1089
+ }, [v]), O(() => {
985
1090
  if (o)
986
- return window.addEventListener("scroll", g, !0), window.addEventListener("resize", g), () => {
987
- window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", g);
1091
+ return window.addEventListener("scroll", v, !0), window.addEventListener("resize", v), () => {
1092
+ window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v);
988
1093
  };
989
- }, [o, g]), !o || s == null ? null : /* @__PURE__ */ l.jsx(
1094
+ }, [o, v]), !o || s == null ? null : /* @__PURE__ */ d.jsx(
990
1095
  "div",
991
1096
  {
992
1097
  "aria-hidden": !0,
993
1098
  style: {
994
- ...lo(a),
1099
+ ...vo(i),
995
1100
  left: s.left,
996
1101
  top: s.top,
997
1102
  width: s.width,
@@ -999,40 +1104,40 @@ const so = Re(function({
999
1104
  }
1000
1105
  }
1001
1106
  );
1002
- }), _e = 32, ir = 150, Oe = 250, B = {
1107
+ }), Re = 32, lr = 150, ze = 250, Y = {
1003
1108
  cardBg: "var(--ui-color-bg-surface-default, #ffffff)",
1004
1109
  cardFooterBg: "var(--ui-color-bg-surface-secondary-default, #f8fafc)",
1005
1110
  textDark: "var(--ui-color-text-primary, #333333)",
1006
1111
  textMuted: "var(--ui-color-text-secondary, #888888)",
1007
1112
  border: "var(--ui-color-border-default, #cccccc)",
1008
1113
  shadow: "var(--ui-shadow-card, 0 4px 16px rgba(0, 0, 0, 0.12))"
1009
- }, co = {
1010
- [C.PENDING]: "Pendiente",
1011
- [C.DEV_FIXED]: "Corregido",
1012
- [C.VALIDATED]: "Validado"
1013
- }, fo = {
1014
- [C.PENDING]: "PENDIENTE",
1015
- [C.DEV_FIXED]: "CORREGIDO",
1016
- [C.VALIDATED]: "VALIDADO"
1017
- }, ee = {
1018
- [C.PENDING]: "var(--ui-color-red-500, rgb(240, 69, 69))",
1019
- [C.DEV_FIXED]: "var(--ui-color-yellow-500, rgb(235, 179, 8))",
1020
- [C.VALIDATED]: "var(--ui-color-green-500, rgb(33, 196, 94))"
1021
- }, ar = {
1022
- [C.PENDING]: "var(--ui-color-bg-surface-danger-default, #fef2f2)",
1023
- [C.DEV_FIXED]: "var(--ui-color-bg-surface-warning-default, #fffbeb)",
1024
- [C.VALIDATED]: "var(--ui-color-bg-surface-success-default, #f0fdf4)"
1025
- }, Ee = {
1026
- [C.PENDING]: "var(--ui-color-red-500, #ef4444)",
1027
- [C.DEV_FIXED]: "var(--ui-color-orange-500, #f59e0b)",
1028
- [C.VALIDATED]: "var(--ui-color-green-500, #22c55e)"
1114
+ }, go = {
1115
+ [T.PENDING]: "Pendiente",
1116
+ [T.DEV_FIXED]: "Corregido",
1117
+ [T.VALIDATED]: "Validado"
1118
+ }, ho = {
1119
+ [T.PENDING]: "PENDIENTE",
1120
+ [T.DEV_FIXED]: "CORREGIDO",
1121
+ [T.VALIDATED]: "VALIDADO"
1122
+ }, ie = {
1123
+ [T.PENDING]: "var(--ui-color-red-500, rgb(240, 69, 69))",
1124
+ [T.DEV_FIXED]: "var(--ui-color-yellow-500, rgb(235, 179, 8))",
1125
+ [T.VALIDATED]: "var(--ui-color-green-500, rgb(33, 196, 94))"
1126
+ }, ur = {
1127
+ [T.PENDING]: "var(--ui-color-bg-surface-danger-default, #fef2f2)",
1128
+ [T.DEV_FIXED]: "var(--ui-color-bg-surface-warning-default, #fffbeb)",
1129
+ [T.VALIDATED]: "var(--ui-color-bg-surface-success-default, #f0fdf4)"
1130
+ }, Se = {
1131
+ [T.PENDING]: "var(--ui-color-red-500, #ef4444)",
1132
+ [T.DEV_FIXED]: "var(--ui-color-orange-500, #f59e0b)",
1133
+ [T.VALIDATED]: "var(--ui-color-green-500, #22c55e)"
1029
1134
  };
1030
- function vo(r) {
1135
+ function bo(r) {
1031
1136
  const t = r.trim().split(/\s+/);
1032
1137
  return t.length >= 2 ? (t[0][0] + t[t.length - 1][0]).toUpperCase() : r.slice(0, 2).toUpperCase() || "?";
1033
1138
  }
1034
- const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", style: { marginRight: 4, flexShrink: 0 }, children: /* @__PURE__ */ l.jsx("path", { d: "M10 3L4.5 8.5L2 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }), go = ({ color: r }) => /* @__PURE__ */ l.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", style: { flexShrink: 0 }, children: [
1035
- /* @__PURE__ */ l.jsx(
1139
+ const xo = () => /* @__PURE__ */ d.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", style: { marginRight: 4, flexShrink: 0 }, children: /* @__PURE__ */ d.jsx("path", { d: "M10 3L4.5 8.5L2 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }), yo = ({ color: r }) => /* @__PURE__ */ d.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", style: { flexShrink: 0 }, children: [
1140
+ /* @__PURE__ */ d.jsx(
1036
1141
  "path",
1037
1142
  {
1038
1143
  d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z",
@@ -1043,7 +1148,7 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1043
1148
  fill: "none"
1044
1149
  }
1045
1150
  ),
1046
- /* @__PURE__ */ l.jsx(
1151
+ /* @__PURE__ */ d.jsx(
1047
1152
  "path",
1048
1153
  {
1049
1154
  d: "M8 10h.01M12 10h.01M16 10h.01",
@@ -1052,12 +1157,12 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1052
1157
  strokeLinecap: "round"
1053
1158
  }
1054
1159
  )
1055
- ] }), bo = (r) => ({
1160
+ ] }), mo = (r) => ({
1056
1161
  position: "fixed",
1057
- width: _e,
1058
- height: _e,
1162
+ width: Re,
1163
+ height: Re,
1059
1164
  borderRadius: "50%",
1060
- backgroundColor: ee[r] ?? ee[C.PENDING],
1165
+ backgroundColor: ie[r] ?? ie[T.PENDING],
1061
1166
  color: "var(--ui-color-text-on-color, #fff)",
1062
1167
  display: "flex",
1063
1168
  alignItems: "center",
@@ -1067,31 +1172,31 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1067
1172
  boxShadow: "0 2px 8px var(--ui-color-black-alpha-20, rgba(0,0,0,0.2))",
1068
1173
  zIndex: 999998,
1069
1174
  border: "2px solid var(--ui-color-white, #fff)"
1070
- }), ho = {
1175
+ }), wo = {
1071
1176
  position: "fixed",
1072
- width: Oe,
1073
- minWidth: Oe,
1074
- maxWidth: Oe,
1177
+ width: ze,
1178
+ minWidth: ze,
1179
+ maxWidth: ze,
1075
1180
  boxSizing: "border-box",
1076
- backgroundColor: B.cardBg,
1181
+ backgroundColor: Y.cardBg,
1077
1182
  borderRadius: "var(--ui-radius_12, 12px)",
1078
- boxShadow: B.shadow,
1183
+ boxShadow: Y.shadow,
1079
1184
  fontSize: "var(--ui-font-size-sm, 14px)",
1080
1185
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
1081
1186
  zIndex: 999999,
1082
1187
  pointerEvents: "auto"
1083
- }, xo = {
1188
+ }, _o = {
1084
1189
  display: "flex",
1085
1190
  alignItems: "center",
1086
1191
  justifyContent: "space-between",
1087
1192
  gap: "var(--ui-positive-Value_250, 10px)",
1088
- borderBottom: `1px solid ${B.border}`,
1193
+ borderBottom: `1px solid ${Y.border}`,
1089
1194
  padding: "var(--ui-positive-Value_300, 12px)"
1090
- }, yo = (r) => ({
1195
+ }, Eo = (r) => ({
1091
1196
  width: 40,
1092
1197
  height: 40,
1093
1198
  borderRadius: "50%",
1094
- backgroundColor: ee[r] ?? ee[C.PENDING],
1199
+ backgroundColor: ie[r] ?? ie[T.PENDING],
1095
1200
  color: "var(--ui-color-text-on-color, #fff)",
1096
1201
  border: "2px solid var(--ui-color-white, #fff)",
1097
1202
  display: "flex",
@@ -1101,18 +1206,18 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1101
1206
  fontWeight: "var(--ui-font-weight-bold, 700)",
1102
1207
  flexShrink: 0,
1103
1208
  overflow: "hidden"
1104
- }), mo = Re(function({
1209
+ }), Ro = Ce(function({
1105
1210
  reviewer: t,
1106
1211
  status: o
1107
1212
  }) {
1108
- const i = t == null ? void 0 : t.image_url, a = (t == null ? void 0 : t.name) ?? "Revisor", s = yo(o);
1109
- if (i && i.trim()) {
1110
- const p = ee[o] ?? ee[C.PENDING];
1111
- return /* @__PURE__ */ l.jsx("div", { style: { ...s, border: `2px solid ${p}` }, children: /* @__PURE__ */ l.jsx(
1213
+ const n = t == null ? void 0 : t.image_url, i = (t == null ? void 0 : t.name) ?? "Revisor", s = Eo(o);
1214
+ if (n && n.trim()) {
1215
+ const u = ie[o] ?? ie[T.PENDING];
1216
+ return /* @__PURE__ */ d.jsx("div", { style: { ...s, border: `2px solid ${u}` }, children: /* @__PURE__ */ d.jsx(
1112
1217
  "img",
1113
1218
  {
1114
- src: i,
1115
- alt: a,
1219
+ src: n,
1220
+ alt: i,
1116
1221
  style: {
1117
1222
  width: "100%",
1118
1223
  height: "100%",
@@ -1122,8 +1227,8 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1122
1227
  }
1123
1228
  ) });
1124
1229
  }
1125
- return /* @__PURE__ */ l.jsx("div", { style: s, children: vo(a) });
1126
- }), wo = {
1230
+ return /* @__PURE__ */ d.jsx("div", { style: s, children: bo(i) });
1231
+ }), So = {
1127
1232
  flexShrink: 0,
1128
1233
  width: "var(--ui-positive-Value_600, 24px)",
1129
1234
  height: "var(--ui-positive-Value_600, 24px)",
@@ -1131,15 +1236,15 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1131
1236
  border: "none",
1132
1237
  borderRadius: "var(--ui-radius_6, 6px)",
1133
1238
  backgroundColor: "transparent",
1134
- color: B.textDark,
1239
+ color: Y.textDark,
1135
1240
  cursor: "pointer",
1136
1241
  fontSize: "var(--ui-positive-Value_450, 18px)",
1137
1242
  lineHeight: 1,
1138
1243
  display: "flex",
1139
1244
  alignItems: "center",
1140
1245
  justifyContent: "center"
1141
- }, _o = (r) => {
1142
- const t = Ee[r] ?? Ee[C.PENDING];
1246
+ }, Co = (r) => {
1247
+ const t = Se[r] ?? Se[T.PENDING];
1143
1248
  return {
1144
1249
  display: "inline-flex",
1145
1250
  alignItems: "center",
@@ -1150,42 +1255,42 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1150
1255
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
1151
1256
  textTransform: "uppercase",
1152
1257
  letterSpacing: "0.02em",
1153
- backgroundColor: ar[r] ?? ar[C.PENDING],
1258
+ backgroundColor: ur[r] ?? ur[T.PENDING],
1154
1259
  color: t,
1155
1260
  border: `1px solid ${t}`
1156
1261
  };
1157
- }, Eo = {
1262
+ }, ko = {
1158
1263
  display: "block",
1159
1264
  fontSize: "var(--ui-font-size-2xs, 10px)",
1160
1265
  fontWeight: "var(--ui-font-weight-semibold, 600)",
1161
1266
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
1162
- color: B.textMuted,
1267
+ color: Y.textMuted,
1163
1268
  textTransform: "uppercase",
1164
1269
  letterSpacing: "0.04em"
1165
- }, Ro = {
1270
+ }, Po = {
1166
1271
  width: "100%",
1167
1272
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",
1168
1273
  paddingRight: "var(--ui-positive-Value_800, 32px)",
1169
1274
  fontSize: "var(--ui-font-size-xs, 13px)",
1170
1275
  fontFamily: "var(--ui-font-family-ui, 'Inter', sans-serif)",
1171
1276
  borderRadius: "var(--ui-radius_8, 8px)",
1172
- border: `1px solid ${B.border}`,
1173
- backgroundColor: B.cardBg,
1174
- color: B.textDark,
1277
+ border: `1px solid ${Y.border}`,
1278
+ backgroundColor: Y.cardBg,
1279
+ color: Y.textDark,
1175
1280
  cursor: "pointer",
1176
1281
  appearance: "none",
1177
1282
  backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L2 4h8z'/%3E%3C/svg%3E")`,
1178
1283
  backgroundRepeat: "no-repeat",
1179
1284
  backgroundPosition: "right var(--ui-positive-Value_250, 10px) center"
1180
- }, So = {
1285
+ }, To = {
1181
1286
  display: "flex",
1182
1287
  alignItems: "center",
1183
1288
  justifyContent: "flex-end",
1184
1289
  gap: "var(--ui-positive-Value_200, 8px)",
1185
1290
  padding: "var(--ui-positive-Value_300, 12px)",
1186
- borderTop: `1px solid ${B.border}`,
1187
- backgroundColor: B.cardFooterBg
1188
- }, fr = {
1291
+ borderTop: `1px solid ${Y.border}`,
1292
+ backgroundColor: Y.cardFooterBg
1293
+ }, hr = {
1189
1294
  minWidth: 100,
1190
1295
  padding: "var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_350, 14px)",
1191
1296
  fontSize: "var(--ui-font-size-xs, 13px)",
@@ -1194,223 +1299,229 @@ const po = () => /* @__PURE__ */ l.jsx("svg", { width: "12", height: "12", viewB
1194
1299
  borderRadius: "var(--ui-radius_8, 8px)",
1195
1300
  cursor: "pointer",
1196
1301
  border: "none"
1197
- }, ko = {
1198
- ...fr,
1302
+ }, jo = {
1303
+ ...hr,
1199
1304
  backgroundColor: "transparent",
1200
- color: B.textDark
1201
- }, ye = "review-layer-resolve-btn", Co = [
1305
+ color: Y.textDark
1306
+ }, _e = "review-layer-resolve-btn", Vo = [
1202
1307
  "pending",
1203
1308
  "dev_fixed",
1204
1309
  "validated"
1205
- ], Po = {
1206
- ...fr,
1310
+ ], Io = {
1311
+ ...hr,
1207
1312
  backgroundColor: "var(--ui-color-bg-fill-success-default, #22c55e)",
1208
1313
  color: "var(--ui-color-text-on-color, #fff)"
1209
1314
  };
1210
- function jo({
1315
+ function Oo({
1211
1316
  comment: r,
1212
1317
  offset: t = { dx: 0, dy: 0 },
1213
1318
  apiUrl: o,
1214
- apiKey: i,
1215
- onStatusChange: a,
1319
+ apiKey: n,
1320
+ onStatusChange: i,
1216
1321
  reviewMode: s = !1
1217
1322
  }) {
1218
- var ne, ie;
1219
- const [p, g] = F(!1), [d, w] = F(!1), [x, y] = F(() => we(r)), [P, S] = F(!1), [V, $] = F(null), L = me(null), c = me(null), f = me(null), I = j(() => {
1220
- y(we(r));
1323
+ var ue, ce;
1324
+ const [u, v] = N(!1), [f, m] = N(!1), [h, w] = N(() => Ee(r)), [j, k] = N(!1), [D, M] = N(null), z = pe(null), g = pe(null), c = pe(null), x = I(() => {
1325
+ w(Ee(r));
1221
1326
  }, [r]);
1222
- z(() => {
1223
- I();
1224
- }, [I]), z(() => {
1327
+ O(() => {
1328
+ x();
1329
+ }, [x]), O(() => {
1225
1330
  if (!(typeof window > "u"))
1226
- return window.addEventListener("scroll", I, !0), window.addEventListener("resize", I), () => {
1227
- window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
1331
+ return window.addEventListener("scroll", x, !0), window.addEventListener("resize", x), () => {
1332
+ window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x);
1228
1333
  };
1229
- }, [I]);
1230
- const N = j(() => {
1231
- L.current !== null && (clearTimeout(L.current), L.current = null);
1232
- }, []), H = j(() => {
1233
- s || (N(), g(!0));
1234
- }, [s, N]), re = j(() => {
1235
- d || (L.current = setTimeout(() => {
1236
- L.current = null, g(!1);
1237
- }, ir));
1238
- }, [d]), oe = j(() => {
1239
- N(), g(!0);
1240
- }, [N]), te = j(() => {
1241
- d || (L.current = setTimeout(() => {
1242
- L.current = null, g(!1);
1243
- }, ir));
1244
- }, [d]), X = j(() => {
1334
+ }, [x]), O(() => {
1335
+ if (!r.selector || typeof document > "u") return;
1336
+ const _ = document.querySelector(r.selector);
1337
+ if (!_) return;
1338
+ const Q = vr(_).map((q) => (q.addEventListener("scroll", x, !0), () => q.removeEventListener("scroll", x, !0)));
1339
+ return () => Q.forEach((q) => q());
1340
+ }, [r.selector, x]);
1341
+ const A = I(() => {
1342
+ z.current !== null && (clearTimeout(z.current), z.current = null);
1343
+ }, []), $ = I(() => {
1344
+ s || (A(), v(!0));
1345
+ }, [s, A]), ae = I(() => {
1346
+ f || (z.current = setTimeout(() => {
1347
+ z.current = null, v(!1);
1348
+ }, lr));
1349
+ }, [f]), se = I(() => {
1350
+ A(), v(!0);
1351
+ }, [A]), le = I(() => {
1352
+ f || (z.current = setTimeout(() => {
1353
+ z.current = null, v(!1);
1354
+ }, lr));
1355
+ }, [f]), ee = I(() => {
1245
1356
  if (s) {
1246
- d && (w(!1), g(!1));
1357
+ f && (m(!1), v(!1));
1247
1358
  return;
1248
1359
  }
1249
- d ? (w(!1), g(!1)) : (w(!0), g(!0));
1250
- }, [s, d]);
1251
- z(() => {
1252
- if (!d) return;
1253
- const _ = (q) => {
1254
- var ve, pe;
1255
- const ae = q.target;
1256
- (ve = c.current) != null && ve.contains(ae) || (pe = f.current) != null && pe.contains(ae) || (w(!1), g(!1));
1360
+ f ? (m(!1), v(!1)) : (m(!0), v(!0));
1361
+ }, [s, f]);
1362
+ O(() => {
1363
+ if (!f) return;
1364
+ const _ = (J) => {
1365
+ var q, be;
1366
+ const Q = J.target;
1367
+ (q = g.current) != null && q.contains(Q) || (be = c.current) != null && be.contains(Q) || (m(!1), v(!1));
1257
1368
  };
1258
1369
  return document.addEventListener("mousedown", _, !0), () => document.removeEventListener("mousedown", _, !0);
1259
- }, [d]), z(() => () => N(), [N]), z(() => {
1260
- s && (w(!1), g(!1));
1370
+ }, [f]), O(() => () => A(), [A]), O(() => {
1371
+ s && (m(!1), v(!1));
1261
1372
  }, [s]);
1262
- const m = x.x + t.dx, k = x.y + t.dy, { x: A, y: T } = Fe(m, k, _e / 2), G = p && !d, Y = j(() => {
1263
- w(!1), g(!1);
1264
- }, []), J = j(
1373
+ const re = h.x + t.dx, y = h.y + t.dy, { x: R, y: P } = $e(re, y, Re / 2), V = u && !f, H = I(() => {
1374
+ m(!1), v(!1);
1375
+ }, []), Z = I(
1265
1376
  async (_) => {
1266
1377
  if (_ !== r.status) {
1267
- $(null), S(!0);
1378
+ M(null), k(!0);
1268
1379
  try {
1269
- await Kr(o, i, r.id, _), a();
1270
- } catch (q) {
1271
- $(q instanceof Error ? q.message : "Error al actualizar");
1380
+ await to(o, n, r.id, _), i();
1381
+ } catch (J) {
1382
+ M(J instanceof Error ? J.message : "Error al actualizar");
1272
1383
  } finally {
1273
- S(!1);
1384
+ k(!1);
1274
1385
  }
1275
1386
  }
1276
1387
  },
1277
- [o, i, r.id, r.status, a]
1278
- ), de = j(async () => {
1279
- $(null), S(!0);
1388
+ [o, n, r.id, r.status, i]
1389
+ ), oe = I(async () => {
1390
+ M(null), k(!0);
1280
1391
  try {
1281
- await eo(o, i, r.id), a(), Y();
1392
+ await no(o, n, r.id), i(), H();
1282
1393
  } catch (_) {
1283
- $(_ instanceof Error ? _.message : "Error al eliminar");
1394
+ M(_ instanceof Error ? _.message : "Error al eliminar");
1284
1395
  } finally {
1285
- S(!1);
1396
+ k(!1);
1286
1397
  }
1287
- }, [o, i, r.id, a, Y]), fe = $e(
1288
- () => ({ ...bo(r.status), left: A, top: T, transform: "translate(-50%, -50%)" }),
1289
- [r.status, A, T]
1398
+ }, [o, n, r.id, i, H]), he = We(
1399
+ () => ({ ...mo(r.status), left: R, top: P, transform: "translate(-50%, -50%)" }),
1400
+ [r.status, R, P]
1290
1401
  );
1291
- return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1292
- /* @__PURE__ */ l.jsx(
1293
- so,
1402
+ return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
1403
+ /* @__PURE__ */ d.jsx(
1404
+ po,
1294
1405
  {
1295
1406
  selector: r.selector,
1296
- active: G,
1407
+ active: V,
1297
1408
  fallbackComment: r,
1298
- outlineColor: Ee[r.status] ?? Ee[C.PENDING]
1409
+ outlineColor: Se[r.status] ?? Se[T.PENDING]
1299
1410
  }
1300
1411
  ),
1301
- /* @__PURE__ */ l.jsx(
1412
+ /* @__PURE__ */ d.jsx(
1302
1413
  "div",
1303
1414
  {
1304
- ref: c,
1415
+ ref: g,
1305
1416
  role: "button",
1306
1417
  tabIndex: 0,
1307
1418
  "aria-label": `Comentario: ${r.message.slice(0, 30)}...`,
1308
- "aria-expanded": p,
1309
- style: fe,
1310
- onMouseEnter: H,
1311
- onMouseLeave: re,
1312
- onClick: X,
1313
- children: /* @__PURE__ */ l.jsx(go, { color: "var(--ui-color-white, #fff)" })
1419
+ "aria-expanded": u,
1420
+ style: he,
1421
+ onMouseEnter: $,
1422
+ onMouseLeave: ae,
1423
+ onClick: ee,
1424
+ children: /* @__PURE__ */ d.jsx(yo, { color: "var(--ui-color-white, #fff)" })
1314
1425
  }
1315
1426
  ),
1316
- p && /* @__PURE__ */ l.jsxs(
1427
+ u && /* @__PURE__ */ d.jsxs(
1317
1428
  "div",
1318
1429
  {
1319
- ref: f,
1430
+ ref: c,
1320
1431
  role: "dialog",
1321
1432
  "aria-label": "Detalle del comentario",
1322
1433
  style: {
1323
- ...ho,
1324
- left: A + _e / 2 + 6,
1325
- top: T
1434
+ ...wo,
1435
+ left: R + Re / 2 + 6,
1436
+ top: P
1326
1437
  },
1327
- onMouseEnter: oe,
1328
- onMouseLeave: te,
1438
+ onMouseEnter: se,
1439
+ onMouseLeave: le,
1329
1440
  children: [
1330
- /* @__PURE__ */ l.jsxs("div", { style: xo, children: [
1331
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, flex: 1, minWidth: 0 }, children: [
1332
- /* @__PURE__ */ l.jsx(mo, { reviewer: r.reviewer, status: r.status }),
1333
- /* @__PURE__ */ l.jsxs("div", { children: [
1334
- /* @__PURE__ */ l.jsx("div", { style: { fontWeight: 700, fontSize: 14, color: B.textDark }, children: ((ne = r.reviewer) == null ? void 0 : ne.name) ?? "Revisor" }),
1335
- /* @__PURE__ */ l.jsx("div", { style: { fontSize: 12, color: B.textMuted }, children: ((ie = r.reviewer) == null ? void 0 : ie.job_title) ?? "Revisor" })
1441
+ /* @__PURE__ */ d.jsxs("div", { style: _o, children: [
1442
+ /* @__PURE__ */ d.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, flex: 1, minWidth: 0 }, children: [
1443
+ /* @__PURE__ */ d.jsx(Ro, { reviewer: r.reviewer, status: r.status }),
1444
+ /* @__PURE__ */ d.jsxs("div", { children: [
1445
+ /* @__PURE__ */ d.jsx("div", { style: { fontWeight: 700, fontSize: 14, color: Y.textDark }, children: ((ue = r.reviewer) == null ? void 0 : ue.name) ?? "Revisor" }),
1446
+ /* @__PURE__ */ d.jsx("div", { style: { fontSize: 12, color: Y.textMuted }, children: ((ce = r.reviewer) == null ? void 0 : ce.job_title) ?? "Revisor" })
1336
1447
  ] })
1337
1448
  ] }),
1338
- /* @__PURE__ */ l.jsx(
1449
+ /* @__PURE__ */ d.jsx(
1339
1450
  "button",
1340
1451
  {
1341
1452
  type: "button",
1342
- "aria-label": r.status === C.VALIDATED ? "Eliminar comentario" : "Cerrar",
1343
- style: wo,
1344
- disabled: P,
1453
+ "aria-label": r.status === T.VALIDATED ? "Eliminar comentario" : "Cerrar",
1454
+ style: So,
1455
+ disabled: j,
1345
1456
  onClick: (_) => {
1346
- _.stopPropagation(), r.status === C.VALIDATED ? de() : Y();
1457
+ _.stopPropagation(), r.status === T.VALIDATED ? oe() : H();
1347
1458
  },
1348
1459
  onMouseDown: (_) => _.stopPropagation(),
1349
1460
  children: "✕"
1350
1461
  }
1351
1462
  )
1352
1463
  ] }),
1353
- /* @__PURE__ */ l.jsxs("div", { style: { padding: 12, display: "flex", alignItems: "flex-start", flexDirection: "column", gap: 4 }, children: [
1354
- /* @__PURE__ */ l.jsxs("div", { style: _o(r.status), children: [
1355
- r.status === C.VALIDATED && /* @__PURE__ */ l.jsx(po, {}),
1356
- fo[r.status] ?? r.status
1464
+ /* @__PURE__ */ d.jsxs("div", { style: { padding: 12, display: "flex", alignItems: "flex-start", flexDirection: "column", gap: 4 }, children: [
1465
+ /* @__PURE__ */ d.jsxs("div", { style: Co(r.status), children: [
1466
+ r.status === T.VALIDATED && /* @__PURE__ */ d.jsx(xo, {}),
1467
+ ho[r.status] ?? r.status
1357
1468
  ] }),
1358
- /* @__PURE__ */ l.jsx("div", { style: { color: B.textDark, lineHeight: 1.5, marginBottom: 12, marginTop: 12 }, children: r.message }),
1359
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" }, children: [
1360
- /* @__PURE__ */ l.jsx("label", { style: Eo, htmlFor: `comment-status-${r.id}`, children: "Cambiar estado" }),
1361
- /* @__PURE__ */ l.jsx(
1469
+ /* @__PURE__ */ d.jsx("div", { style: { color: Y.textDark, lineHeight: 1.5, marginBottom: 12, marginTop: 12 }, children: r.message }),
1470
+ /* @__PURE__ */ d.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" }, children: [
1471
+ /* @__PURE__ */ d.jsx("label", { style: ko, htmlFor: `comment-status-${r.id}`, children: "Cambiar estado" }),
1472
+ /* @__PURE__ */ d.jsx(
1362
1473
  "select",
1363
1474
  {
1364
1475
  id: `comment-status-${r.id}`,
1365
- style: Ro,
1476
+ style: Po,
1366
1477
  value: r.status,
1367
- disabled: P,
1368
- onChange: (_) => J(_.target.value),
1478
+ disabled: j,
1479
+ onChange: (_) => Z(_.target.value),
1369
1480
  onMouseDown: (_) => _.stopPropagation(),
1370
1481
  "aria-label": "Cambiar estado del comentario",
1371
- children: Co.map((_) => /* @__PURE__ */ l.jsx("option", { value: _, children: co[_] }, _))
1482
+ children: Vo.map((_) => /* @__PURE__ */ d.jsx("option", { value: _, children: go[_] }, _))
1372
1483
  }
1373
1484
  ),
1374
- V && /* @__PURE__ */ l.jsx("div", { style: { marginTop: 8, fontSize: 11, color: "var(--ui-color-text-danger-default, rgb(240, 69, 69))" }, children: V })
1485
+ D && /* @__PURE__ */ d.jsx("div", { style: { marginTop: 8, fontSize: 11, color: "var(--ui-color-text-danger-default, rgb(240, 69, 69))" }, children: D })
1375
1486
  ] })
1376
1487
  ] }),
1377
- /* @__PURE__ */ l.jsxs("div", { style: So, children: [
1378
- /* @__PURE__ */ l.jsx(
1488
+ /* @__PURE__ */ d.jsxs("div", { style: To, children: [
1489
+ /* @__PURE__ */ d.jsx(
1379
1490
  "button",
1380
1491
  {
1381
1492
  type: "button",
1382
- style: ko,
1493
+ style: jo,
1383
1494
  onMouseDown: (_) => _.stopPropagation(),
1384
1495
  onClick: (_) => {
1385
- _.stopPropagation(), Y();
1496
+ _.stopPropagation(), H();
1386
1497
  },
1387
1498
  children: "Cerrar"
1388
1499
  }
1389
1500
  ),
1390
- r.status !== C.VALIDATED && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1391
- /* @__PURE__ */ l.jsx("style", { children: `
1392
- .${ye}:hover:not(:disabled) {
1501
+ r.status !== T.VALIDATED && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
1502
+ /* @__PURE__ */ d.jsx("style", { children: `
1503
+ .${_e}:hover:not(:disabled) {
1393
1504
  background-color: var(--ui-color-bg-fill-success-hover, #16a34a) !important;
1394
1505
  }
1395
- .${ye}:active:not(:disabled) {
1506
+ .${_e}:active:not(:disabled) {
1396
1507
  background-color: var(--ui-color-bg-fill-success-pressed, #15803d) !important;
1397
1508
  }
1398
- .${ye}:disabled {
1509
+ .${_e}:disabled {
1399
1510
  background-color: var(--ui-color-bg-fill-success-default, #22c55e) !important;
1400
1511
  opacity: 0.7;
1401
1512
  cursor: not-allowed;
1402
1513
  }
1403
1514
  ` }),
1404
- /* @__PURE__ */ l.jsx(
1515
+ /* @__PURE__ */ d.jsx(
1405
1516
  "button",
1406
1517
  {
1407
1518
  type: "button",
1408
- className: ye,
1409
- style: Po,
1410
- disabled: P,
1519
+ className: _e,
1520
+ style: Io,
1521
+ disabled: j,
1411
1522
  onMouseDown: (_) => _.stopPropagation(),
1412
1523
  onClick: (_) => {
1413
- _.stopPropagation(), J("validated");
1524
+ _.stopPropagation(), Z("validated");
1414
1525
  },
1415
1526
  children: "Validar"
1416
1527
  }
@@ -1422,123 +1533,133 @@ function jo({
1422
1533
  )
1423
1534
  ] });
1424
1535
  }
1425
- const Vo = Re(jo), To = 25, Do = 36;
1426
- function Io(r) {
1536
+ const Do = Ce(Oo), Lo = 25, zo = 36;
1537
+ function Ao(r) {
1427
1538
  const t = /* @__PURE__ */ new Map();
1428
1539
  for (let o = 0; o < r.length; o++) {
1429
- const i = r[o], { x: a, y: s } = we(i), { x: p, y: g } = Fe(a, s);
1430
- let d = 0;
1431
- for (let w = 0; w < o; w++) {
1432
- const { x, y } = we(r[w]), { x: P, y: S } = Fe(x, y);
1433
- Math.hypot(p - P, g - S) < To && d++;
1540
+ const n = r[o], { x: i, y: s } = Ee(n), { x: u, y: v } = $e(i, s);
1541
+ let f = 0;
1542
+ for (let m = 0; m < o; m++) {
1543
+ const { x: h, y: w } = Ee(r[m]), { x: j, y: k } = $e(h, w);
1544
+ Math.hypot(u - j, v - k) < Lo && f++;
1434
1545
  }
1435
- t.set(i.id, { dx: d * Do, dy: 0 });
1546
+ t.set(n.id, { dx: f * zo, dy: 0 });
1436
1547
  }
1437
1548
  return t;
1438
1549
  }
1439
- function Oo() {
1550
+ function Fo() {
1440
1551
  return typeof window > "u" ? "" : `${window.innerWidth}x${window.innerHeight}`;
1441
1552
  }
1442
- function Lo({
1553
+ function No({
1443
1554
  apiUrl: r,
1444
1555
  apiKey: t,
1445
1556
  reviewMode: o,
1446
- setReviewMode: i,
1447
- reviewers: a,
1557
+ setReviewMode: n,
1558
+ reviewers: i,
1448
1559
  comments: s,
1449
- loadComments: p,
1450
- commentsLoadFailed: g = !1
1560
+ loadComments: u,
1561
+ commentsLoadFailed: v = !1
1451
1562
  }) {
1452
- const [d, w] = F(null), x = me(null), [y, P] = F(null), S = j(() => {
1453
- d && (d.style.outline = "", d.style.outlineOffset = "", w(null));
1454
- }, [d]), V = j(() => {
1455
- x.current && (x.current.style.outline = "", x.current.style.outlineOffset = "", x.current = null);
1563
+ const [f, m] = N(null), h = pe(null), [w, j] = N(null), k = I(() => {
1564
+ f && (f.style.outline = "", f.style.outlineOffset = "", m(null));
1565
+ }, [f]), D = I(() => {
1566
+ h.current && (h.current.style.outline = "", h.current.style.outlineOffset = "", h.current = null);
1456
1567
  }, []);
1457
- z(() => {
1458
- o || (S(), V());
1459
- }, [o, S, V]), z(() => {
1568
+ O(() => {
1569
+ o || (k(), D());
1570
+ }, [o, k, D]), O(() => {
1460
1571
  if (typeof document > "u") return;
1461
- const m = document.body.style.cursor;
1462
- return y ? document.body.style.cursor = "default" : o && (document.body.style.cursor = "crosshair"), () => {
1463
- document.body.style.cursor = m;
1572
+ const y = document.body.style.cursor;
1573
+ return w ? document.body.style.cursor = "default" : o && (document.body.style.cursor = "crosshair"), () => {
1574
+ document.body.style.cursor = y;
1464
1575
  };
1465
- }, [o, y]);
1466
- const $ = j((m) => {
1467
- var A;
1468
- if (!m || typeof document > "u" || m === document.body || m === document.documentElement) return !0;
1469
- const k = (A = m.tagName) == null ? void 0 : A.toUpperCase();
1470
- return k === "BODY" || k === "HTML" ? !0 : m.parentElement !== document.body ? !1 : m.id === "root" || m.getAttribute("data-review-layer-host") != null || document.body.children.length === 1;
1471
- }, []), L = j(
1472
- (m) => {
1473
- if (!o || y) return;
1474
- const k = m.target.nodeType === Node.ELEMENT_NODE ? m.target : m.target.parentElement;
1475
- !k || $(k) || (S(), w(k), k.style.outline = "2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)", k.style.outlineOffset = "2px");
1576
+ }, [o, w]);
1577
+ const M = I((y) => {
1578
+ var P;
1579
+ if (!y || typeof document > "u" || y === document.body || y === document.documentElement) return !0;
1580
+ const R = (P = y.tagName) == null ? void 0 : P.toUpperCase();
1581
+ return R === "BODY" || R === "HTML" ? !0 : y.parentElement !== document.body ? !1 : y.id === "root" || y.getAttribute("data-review-layer-host") != null || document.body.children.length === 1;
1582
+ }, []), z = I(
1583
+ (y) => {
1584
+ if (!o || w) return;
1585
+ const R = y.target.nodeType === Node.ELEMENT_NODE ? y.target : y.target.parentElement;
1586
+ !R || M(R) || (k(), m(R), R.style.outline = "2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)", R.style.outlineOffset = "2px");
1476
1587
  },
1477
- [o, y, S, $]
1478
- ), c = j(
1479
- (m) => {
1480
- var A;
1481
- if (y) return;
1482
- const k = m.relatedTarget;
1483
- d && (!k || !d.contains(k)) && !(k && ((A = d.contains) != null && A.call(d, k))) && S();
1588
+ [o, w, k, M]
1589
+ ), g = I(
1590
+ (y) => {
1591
+ var P;
1592
+ if (w) return;
1593
+ const R = y.relatedTarget;
1594
+ f && (!R || !f.contains(R)) && !(R && ((P = f.contains) != null && P.call(f, R))) && k();
1484
1595
  },
1485
- [d, y, S]
1486
- ), f = j(
1487
- (m) => {
1488
- if (!o || y) return;
1489
- const k = m.target;
1490
- if (!k || $(k) || k.closest("[data-review-layer-root]")) return;
1491
- m.preventDefault(), m.stopPropagation(), S();
1492
- const A = k;
1493
- x.current = A, A.style.outline = "2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)", A.style.outlineOffset = "2px";
1494
- const T = A.getBoundingClientRect(), G = Ur(k), { relativeX: Y, relativeY: J } = Xr(T);
1495
- P({
1496
- position: { x: T.left + T.width / 2, y: T.bottom },
1596
+ [f, w, k]
1597
+ ), c = I(
1598
+ (y) => {
1599
+ if (!o || w) return;
1600
+ const R = y.target;
1601
+ if (!R || M(R) || R.closest("[data-review-layer-root]")) return;
1602
+ y.preventDefault(), y.stopPropagation(), k();
1603
+ const P = R;
1604
+ h.current = P, P.style.outline = "2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)", P.style.outlineOffset = "2px";
1605
+ const V = P.getBoundingClientRect(), H = qr(R), { relativeX: Z, relativeY: oe } = Qr(V);
1606
+ j({
1607
+ position: { x: V.left + V.width / 2, y: V.bottom },
1497
1608
  payload: {
1498
- selector: G,
1499
- x: Math.round(T.left),
1500
- y: Math.round(T.top),
1501
- relativeX: Y,
1502
- relativeY: J,
1503
- width: Math.round(T.width),
1504
- height: Math.round(T.height),
1505
- url: typeof window < "u" && window.location.pathname || "/",
1506
- viewport: Oo(),
1609
+ selector: H,
1610
+ x: Math.round(V.left),
1611
+ y: Math.round(V.top),
1612
+ relativeX: Z,
1613
+ relativeY: oe,
1614
+ width: Math.round(V.width),
1615
+ height: Math.round(V.height),
1616
+ url: typeof window < "u" ? Me() : "/",
1617
+ viewport: Fo(),
1507
1618
  userAgent: typeof navigator < "u" ? navigator.userAgent : "",
1508
1619
  pageTitle: typeof document < "u" ? document.title : ""
1509
1620
  }
1510
1621
  });
1511
1622
  },
1512
- [o, y, S, $]
1623
+ [o, w, k, M]
1513
1624
  );
1514
- z(() => {
1625
+ O(() => {
1515
1626
  if (o)
1516
- return document.addEventListener("mouseover", L, !0), document.addEventListener("mouseout", c, !0), document.addEventListener("click", f, !0), () => {
1517
- document.removeEventListener("mouseover", L, !0), document.removeEventListener("mouseout", c, !0), document.removeEventListener("click", f, !0);
1627
+ return document.addEventListener("mouseover", z, !0), document.addEventListener("mouseout", g, !0), document.addEventListener("click", c, !0), () => {
1628
+ document.removeEventListener("mouseover", z, !0), document.removeEventListener("mouseout", g, !0), document.removeEventListener("click", c, !0);
1518
1629
  };
1519
- }, [o, L, c, f]);
1520
- const [I, N] = F(0);
1521
- z(() => {
1522
- if (typeof window > "u") return;
1523
- const m = () => N((k) => k + 1);
1524
- return window.addEventListener("resize", m), window.addEventListener("scroll", m, !0), () => {
1525
- window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0);
1526
- };
1630
+ }, [o, z, g, c]);
1631
+ const [x, A] = N(0), $ = I(() => {
1632
+ if (A((y) => y + 1), h.current) {
1633
+ const y = h.current.getBoundingClientRect();
1634
+ j(
1635
+ (R) => R ? { ...R, position: { x: y.left + y.width / 2, y: y.bottom } } : null
1636
+ );
1637
+ }
1527
1638
  }, []);
1528
- const H = $e(
1529
- () => Io(s),
1530
- [s, I]
1531
- ), re = j(() => {
1532
- V(), P(null);
1533
- }, [V]), oe = {
1639
+ O(() => {
1640
+ if (!(typeof window > "u"))
1641
+ return window.addEventListener("resize", $), window.addEventListener("scroll", $, !0), () => {
1642
+ window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0);
1643
+ };
1644
+ }, [$]), O(() => {
1645
+ if (!w || !h.current) return;
1646
+ const y = h.current, P = vr(y).map((V) => (V.addEventListener("scroll", $, !0), () => V.removeEventListener("scroll", $, !0)));
1647
+ return () => P.forEach((V) => V());
1648
+ }, [w, $]);
1649
+ const ae = We(
1650
+ () => Ao(s),
1651
+ [s, x]
1652
+ ), se = I(() => {
1653
+ D(), j(null);
1654
+ }, [D]), le = {
1534
1655
  position: "fixed",
1535
1656
  inset: 0,
1536
1657
  zIndex: 999999,
1537
1658
  pointerEvents: "none",
1538
1659
  cursor: o ? "crosshair" : void 0
1539
- }, te = /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1540
- /* @__PURE__ */ l.jsx("div", { style: oe, "aria-hidden": !0, "data-review-layer-root": !0 }),
1541
- o && /* @__PURE__ */ l.jsxs(
1660
+ }, ee = /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
1661
+ /* @__PURE__ */ d.jsx("div", { style: le, "aria-hidden": !0, "data-review-layer-root": !0 }),
1662
+ o && /* @__PURE__ */ d.jsxs(
1542
1663
  "div",
1543
1664
  {
1544
1665
  "data-review-layer-root": !0,
@@ -1559,12 +1680,12 @@ function Lo({
1559
1680
  pointerEvents: "auto"
1560
1681
  },
1561
1682
  children: [
1562
- /* @__PURE__ */ l.jsx("span", { children: "Modo revisión (Shift+R para salir)" }),
1563
- /* @__PURE__ */ l.jsx(
1683
+ /* @__PURE__ */ d.jsx("span", { children: "Modo revisión (Shift+R para salir)" }),
1684
+ /* @__PURE__ */ d.jsx(
1564
1685
  "button",
1565
1686
  {
1566
1687
  type: "button",
1567
- onClick: () => i(!1),
1688
+ onClick: () => n(!1),
1568
1689
  "aria-label": "Salir del modo revisión",
1569
1690
  style: {
1570
1691
  padding: 0,
@@ -1588,7 +1709,7 @@ function Lo({
1588
1709
  ]
1589
1710
  }
1590
1711
  ),
1591
- g && /* @__PURE__ */ l.jsxs(
1712
+ v && /* @__PURE__ */ d.jsxs(
1592
1713
  "div",
1593
1714
  {
1594
1715
  style: {
@@ -1610,12 +1731,12 @@ function Lo({
1610
1731
  pointerEvents: "auto"
1611
1732
  },
1612
1733
  children: [
1613
- /* @__PURE__ */ l.jsx("span", { children: "No se pudo conectar. Mostrando últimos datos guardados. Reintentar no garantiza respuesta hasta que el servicio esté activo." }),
1614
- /* @__PURE__ */ l.jsx(
1734
+ /* @__PURE__ */ d.jsx("span", { children: "No se pudo conectar. Mostrando últimos datos guardados. Reintentar no garantiza respuesta hasta que el servicio esté activo." }),
1735
+ /* @__PURE__ */ d.jsx(
1615
1736
  "button",
1616
1737
  {
1617
1738
  type: "button",
1618
- onClick: () => p(),
1739
+ onClick: () => u(),
1619
1740
  style: {
1620
1741
  padding: "var(--ui-positive-Value_100, 4px) var(--ui-positive-Value_250, 10px)",
1621
1742
  fontSize: "var(--ui-font-size-xs, 12px)",
@@ -1632,33 +1753,33 @@ function Lo({
1632
1753
  ]
1633
1754
  }
1634
1755
  ),
1635
- s.map((m) => /* @__PURE__ */ l.jsx("div", { "data-review-layer-pin": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ l.jsx(
1636
- Vo,
1756
+ s.map((y) => /* @__PURE__ */ d.jsx("div", { "data-review-layer-pin": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ d.jsx(
1757
+ Do,
1637
1758
  {
1638
- comment: m,
1639
- offset: H.get(m.id),
1759
+ comment: y,
1760
+ offset: ae.get(y.id),
1640
1761
  apiUrl: r,
1641
1762
  apiKey: t,
1642
- onStatusChange: p,
1763
+ onStatusChange: u,
1643
1764
  reviewMode: o
1644
1765
  }
1645
- ) }, m.id)),
1646
- y && /* @__PURE__ */ l.jsx("div", { "data-review-layer-modal": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ l.jsx(
1647
- ao,
1766
+ ) }, y.id)),
1767
+ w && /* @__PURE__ */ d.jsx("div", { "data-review-layer-modal": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ d.jsx(
1768
+ co,
1648
1769
  {
1649
1770
  apiUrl: r,
1650
1771
  apiKey: t,
1651
- reviewers: a,
1652
- position: y.position,
1653
- payload: y.payload,
1654
- onClose: re,
1655
- onSuccess: p
1772
+ reviewers: i,
1773
+ position: w.position,
1774
+ payload: w.payload,
1775
+ onClose: se,
1776
+ onSuccess: u
1656
1777
  }
1657
1778
  ) })
1658
- ] }), X = typeof document < "u" ? document.body : null;
1659
- return X ? cr(te, X) : null;
1779
+ ] }), re = typeof document < "u" ? document.body : null;
1780
+ return re ? fr(ee, re) : null;
1660
1781
  }
1661
- const zo = `/**
1782
+ const $o = `/**
1662
1783
  * Tokens de diseño UI para review-layer-react.
1663
1784
  * Las variables se inyectan en :root al montar ReviewProvider.
1664
1785
  * Puedes sobrescribirlas en tu app para adaptar el tema.
@@ -1984,20 +2105,20 @@ const zo = `/**
1984
2105
  --ui-shadow-modal: 0 var(--ui-shadow-04-y) var(--ui-shadow-04-blur) var(--ui-shadow-04-Color);
1985
2106
  }
1986
2107
  `;
1987
- function Ao(r, t, o) {
1988
- const i = j(() => {
1989
- r && o((a) => !a);
2108
+ function Mo(r, t, o) {
2109
+ const n = I(() => {
2110
+ r && o((i) => !i);
1990
2111
  }, [r, o]);
1991
- z(() => {
2112
+ O(() => {
1992
2113
  if (!r) return;
1993
- const a = (s) => {
1994
- (s.key === "r" || s.key === "R" || s.code === "KeyR") && s.shiftKey && !s.ctrlKey && !s.metaKey && (s.preventDefault(), i());
2114
+ const i = (s) => {
2115
+ (s.key === "r" || s.key === "R" || s.code === "KeyR") && s.shiftKey && !s.ctrlKey && !s.metaKey && (s.preventDefault(), n());
1995
2116
  };
1996
- return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
1997
- }, [r, i]);
2117
+ return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
2118
+ }, [r, n]);
1998
2119
  }
1999
- const Fo = "review_layer:v1:";
2000
- function No(r, t) {
2120
+ const Wo = "review_layer:v1:";
2121
+ function Bo(r, t) {
2001
2122
  if (r == null) return t;
2002
2123
  try {
2003
2124
  return JSON.parse(r) ?? t;
@@ -2005,155 +2126,175 @@ function No(r, t) {
2005
2126
  return t;
2006
2127
  }
2007
2128
  }
2008
- function Se(r, t, o, i) {
2009
- const a = `${Fo}${$o(r)}:${o}`;
2010
- return i != null ? `${a}:${i}` : a;
2129
+ function ke(r, t, o, n) {
2130
+ const i = `${Wo}${Uo(r)}:${o}`;
2131
+ return n != null ? `${i}:${n}` : i;
2011
2132
  }
2012
- function $o(r) {
2133
+ function Uo(r) {
2013
2134
  return r.replace(/\/+$/, "") || "/";
2014
2135
  }
2015
- function vr(r) {
2136
+ function br(r) {
2016
2137
  if (typeof localStorage > "u") return null;
2017
2138
  const t = localStorage.getItem(r);
2018
- return No(t, null);
2139
+ return Bo(t, null);
2019
2140
  }
2020
- function pr(r, t) {
2141
+ function xr(r, t) {
2021
2142
  if (!(typeof localStorage > "u"))
2022
2143
  try {
2023
2144
  localStorage.setItem(r, JSON.stringify({ data: t, at: Date.now() }));
2024
2145
  } catch {
2025
2146
  }
2026
2147
  }
2027
- function Le(r, t, o) {
2028
- const i = vr(Se(r, t, "comments", o));
2029
- return (i == null ? void 0 : i.data) ?? null;
2148
+ function Ae(r, t, o) {
2149
+ const n = br(ke(r, t, "comments", o));
2150
+ return (n == null ? void 0 : n.data) ?? null;
2030
2151
  }
2031
- function Mo(r, t, o, i) {
2032
- pr(Se(r, t, "comments", o), i);
2152
+ function Yo(r, t, o, n) {
2153
+ xr(ke(r, t, "comments", o), n);
2033
2154
  }
2034
- function ur(r, t) {
2035
- const o = vr(Se(r, t, "reviewers"));
2155
+ function cr(r, t) {
2156
+ const o = br(ke(r, t, "reviewers"));
2036
2157
  return (o == null ? void 0 : o.data) ?? null;
2037
2158
  }
2038
- function Wo(r, t, o) {
2039
- pr(Se(r, t, "reviewers"), o);
2159
+ function Ho(r, t, o) {
2160
+ xr(ke(r, t, "reviewers"), o);
2040
2161
  }
2041
- const Bo = "https://review-layer-api.onrender.com/api";
2042
- function lr() {
2043
- return typeof window > "u" ? "/" : window.location.pathname || "/";
2044
- }
2045
- const gr = Mr(null);
2046
- let ze = null;
2047
- function Go() {
2048
- const r = Wr(gr);
2162
+ const Go = "https://review-layer-api.onrender.com/api", yr = Yr(null);
2163
+ let Fe = null;
2164
+ function Jo() {
2165
+ const r = Hr(yr);
2049
2166
  if (!r)
2050
2167
  throw new Error("useReview must be used within ReviewProvider");
2051
2168
  return r;
2052
2169
  }
2053
- function Ho({
2170
+ const B = "[review-layer]";
2171
+ function Zo({
2054
2172
  children: r,
2055
2173
  enabled: t = !0,
2056
2174
  apiUrl: o,
2057
- apiKey: i
2175
+ apiKey: n
2058
2176
  }) {
2059
- const a = (o == null ? void 0 : o.trim()) || Bo, [s, p] = F(!1), [g, d] = F([]), [w, x] = F([]), [y, P] = F(!1);
2060
- Ao(t, s, p);
2061
- const S = j(
2062
- async (c) => {
2063
- if (!(!t || !a || !i))
2064
- try {
2065
- const f = await qr(a, i, { signal: c });
2066
- c != null && c.aborted || (d(f), Wo(a, i, f));
2067
- } catch (f) {
2068
- if (f instanceof Error && f.name === "AbortError") return;
2069
- if (!(c != null && c.aborted)) {
2070
- const I = ur(a, i);
2071
- I != null && d(I);
2072
- }
2177
+ const i = (o == null ? void 0 : o.trim()) || Go, [s, u] = N(!1), [v, f] = N([]), [m, h] = N([]), [w, j] = N(!1);
2178
+ Mo(t, s, u);
2179
+ const k = I(
2180
+ async (g) => {
2181
+ if (!t || !i || !n) {
2182
+ console.warn(B, "loadReviewers omitido: faltan enabled, apiUrl o apiKey", {
2183
+ enabled: t,
2184
+ apiUrl: i,
2185
+ hasApiKey: !!n
2186
+ });
2187
+ return;
2188
+ }
2189
+ console.log(B, "Cargando revisores...", { apiUrl: i });
2190
+ try {
2191
+ const c = await eo(i, n, { signal: g });
2192
+ g != null && g.aborted || (f(c), Ho(i, n, c), console.log(B, "Revisores cargados:", c.length));
2193
+ } catch (c) {
2194
+ if (c instanceof Error && c.name === "AbortError") return;
2195
+ if (!(g != null && g.aborted)) {
2196
+ console.error(B, "Error al cargar revisores:", c);
2197
+ const x = cr(i, n);
2198
+ x != null && (f(x), console.log(B, "Usando revisores en caché:", x.length));
2073
2199
  }
2200
+ }
2074
2201
  },
2075
- [t, a, i]
2076
- ), V = j(
2077
- async (c) => {
2078
- if (!t || !a || !i) return;
2079
- const f = lr(), I = Le(a, i, f);
2080
- I != null && x(I);
2202
+ [t, i, n]
2203
+ ), D = I(
2204
+ async (g) => {
2205
+ if (!t || !i || !n) {
2206
+ console.warn(B, "loadComments omitido: faltan enabled, apiUrl o apiKey", {
2207
+ enabled: t,
2208
+ apiUrl: i,
2209
+ hasApiKey: !!n
2210
+ });
2211
+ return;
2212
+ }
2213
+ const c = Me(), x = Ae(i, n, c);
2214
+ x != null && h(x), console.log(B, "Cargando comentarios...", { apiUrl: i, url: c });
2081
2215
  try {
2082
- P(!1);
2083
- const N = await Qr(a, i, f, { signal: c });
2084
- c != null && c.aborted || (x(N), Mo(a, i, f, N));
2085
- } catch (N) {
2086
- if (N instanceof Error && N.name === "AbortError") return;
2087
- if (!(c != null && c.aborted)) {
2088
- P(!0);
2089
- const H = Le(a, i, f);
2090
- H != null && x(H);
2216
+ j(!1);
2217
+ const A = await oo(i, n, c, { signal: g });
2218
+ g != null && g.aborted || (h(A), Yo(i, n, c, A), console.log(B, "Comentarios cargados:", A.length));
2219
+ } catch (A) {
2220
+ if (A instanceof Error && A.name === "AbortError") return;
2221
+ if (!(g != null && g.aborted)) {
2222
+ j(!0), console.error(B, "Error al cargar comentarios:", A);
2223
+ const $ = Ae(i, n, c);
2224
+ $ != null ? (h($), console.log(B, "Usando comentarios en caché:", $.length)) : console.warn(B, "Sin caché de comentarios; la lista quedará vacía hasta que la API responda.");
2091
2225
  }
2092
2226
  }
2093
2227
  },
2094
- [t, a, i]
2228
+ [t, i, n]
2095
2229
  );
2096
- z(() => {
2097
- if (!t || !a || !i) return;
2098
- const c = lr(), f = ur(a, i), I = Le(a, i, c);
2099
- f != null && d(f), I != null && x(I);
2100
- }, [t, a, i]), z(() => {
2230
+ O(() => {
2231
+ if (!t || !i || !n) {
2232
+ console.warn(B, "Provider activo pero sin carga: enabled, apiUrl y apiKey son requeridos.", {
2233
+ enabled: t,
2234
+ apiUrl: i,
2235
+ hasApiKey: !!n
2236
+ });
2237
+ return;
2238
+ }
2239
+ const g = Me(), c = cr(i, n), x = Ae(i, n, g);
2240
+ c != null && (f(c), console.log(B, "Revisores desde caché (inicial):", c.length)), x != null && (h(x), console.log(B, "Comentarios desde caché (inicial):", x.length, { url: g }));
2241
+ }, [t, i, n]), O(() => {
2101
2242
  if (typeof document > "u") return;
2102
- const c = "review-layer-ui-variables";
2103
- if (!document.getElementById(c)) {
2104
- const f = document.createElement("style");
2105
- f.id = c, f.textContent = zo, document.head.appendChild(f);
2243
+ const g = "review-layer-ui-variables";
2244
+ if (!document.getElementById(g)) {
2245
+ const c = document.createElement("style");
2246
+ c.id = g, c.textContent = $o, document.head.appendChild(c);
2106
2247
  }
2107
- }, []), z(() => {
2108
- if (!t || !a || !i) return;
2109
- const c = `${a}:${i}`;
2110
- if (ze !== c)
2111
- return ze = c, S(), V(), () => {
2248
+ }, []), O(() => {
2249
+ if (!t || !i || !n) return;
2250
+ const g = `${i}:${n}`;
2251
+ if (Fe !== g)
2252
+ return Fe = g, console.log(B, "Inicio de carga (revisores + comentarios)", { apiUrl: i, apiKey: n ? "***" : "(vacío)" }), k(), D(), () => {
2112
2253
  setTimeout(() => {
2113
- ze = null;
2254
+ Fe = null;
2114
2255
  }, 0);
2115
2256
  };
2116
- }, [t, a, i, S, V]), z(() => {
2257
+ }, [t, i, n, k, D]), O(() => {
2117
2258
  if (!t) return;
2118
- const c = () => V();
2119
- return window.addEventListener("popstate", c), () => window.removeEventListener("popstate", c);
2120
- }, [t, V]);
2121
- const $ = $e(
2259
+ const g = () => D();
2260
+ return window.addEventListener("popstate", g), () => window.removeEventListener("popstate", g);
2261
+ }, [t, D]);
2262
+ const M = We(
2122
2263
  () => ({
2123
- apiUrl: a,
2124
- apiKey: i,
2264
+ apiUrl: i,
2265
+ apiKey: n,
2125
2266
  reviewMode: s,
2126
- setReviewMode: p,
2127
- reviewers: g,
2128
- comments: w,
2129
- loadComments: V,
2130
- commentsLoadFailed: y
2267
+ setReviewMode: u,
2268
+ reviewers: v,
2269
+ comments: m,
2270
+ loadComments: D,
2271
+ commentsLoadFailed: w
2131
2272
  }),
2132
- [a, i, s, p, g, w, V, y]
2133
- ), L = t && typeof document < "u" ? cr(
2134
- /* @__PURE__ */ l.jsx(
2135
- Lo,
2273
+ [i, n, s, u, v, m, D, w]
2274
+ ), z = t && typeof document < "u" ? fr(
2275
+ /* @__PURE__ */ d.jsx(
2276
+ No,
2136
2277
  {
2137
- apiUrl: a,
2138
- apiKey: i,
2278
+ apiUrl: i,
2279
+ apiKey: n,
2139
2280
  reviewMode: s,
2140
- setReviewMode: p,
2141
- reviewers: g,
2142
- comments: w,
2143
- loadComments: V,
2144
- commentsLoadFailed: y
2281
+ setReviewMode: u,
2282
+ reviewers: v,
2283
+ comments: m,
2284
+ loadComments: D,
2285
+ commentsLoadFailed: w
2145
2286
  }
2146
2287
  ),
2147
2288
  document.body
2148
2289
  ) : null;
2149
- return /* @__PURE__ */ l.jsxs(gr.Provider, { value: $, children: [
2290
+ return /* @__PURE__ */ d.jsxs(yr.Provider, { value: M, children: [
2150
2291
  r,
2151
- L
2292
+ z
2152
2293
  ] });
2153
2294
  }
2154
2295
  export {
2155
- Bo as DEFAULT_API_URL,
2156
- Ho as ReviewProvider,
2157
- Go as useReview
2296
+ Go as DEFAULT_API_URL,
2297
+ Zo as ReviewProvider,
2298
+ Jo as useReview
2158
2299
  };
2159
2300
  //# sourceMappingURL=review-layer-react.js.map