@bitux/review-layer-react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1658 @@
1
+ import Qe, { useState as L, useEffect as N, useCallback as I, useRef as ge, useMemo as Ot, createContext as It, useContext as Lt } from "react";
2
+ import { createPortal as Ke } from "react-dom";
3
+ var Te = { exports: {} }, ue = {};
4
+ /**
5
+ * @license React
6
+ * react-jsx-runtime.production.min.js
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var Ge;
14
+ function At() {
15
+ if (Ge) return ue;
16
+ Ge = 1;
17
+ var t = Qe, o = Symbol.for("react.element"), r = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function v(d, E, b) {
19
+ var g, j = {}, R = null, _ = null;
20
+ b !== void 0 && (R = "" + b), E.key !== void 0 && (R = "" + E.key), E.ref !== void 0 && (_ = E.ref);
21
+ for (g in E) i.call(E, g) && !c.hasOwnProperty(g) && (j[g] = E[g]);
22
+ if (d && d.defaultProps) for (g in E = d.defaultProps, E) j[g] === void 0 && (j[g] = E[g]);
23
+ return { $$typeof: o, type: d, key: R, ref: _, props: j, _owner: s.current };
24
+ }
25
+ return ue.Fragment = r, ue.jsx = v, ue.jsxs = v, ue;
26
+ }
27
+ var ce = {};
28
+ /**
29
+ * @license React
30
+ * react-jsx-runtime.development.js
31
+ *
32
+ * Copyright (c) Facebook, Inc. and its affiliates.
33
+ *
34
+ * This source code is licensed under the MIT license found in the
35
+ * LICENSE file in the root directory of this source tree.
36
+ */
37
+ var Je;
38
+ function Ft() {
39
+ return Je || (Je = 1, process.env.NODE_ENV !== "production" && function() {
40
+ var t = Qe, o = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), d = Symbol.for("react.context"), E = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), j = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), A = Symbol.iterator, O = "@@iterator";
41
+ function y(e) {
42
+ if (e === null || typeof e != "object")
43
+ return null;
44
+ var n = A && e[A] || e[O];
45
+ return typeof n == "function" ? n : null;
46
+ }
47
+ var f = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function p(e) {
49
+ {
50
+ for (var n = arguments.length, a = new Array(n > 1 ? n - 1 : 0), u = 1; u < n; u++)
51
+ a[u - 1] = arguments[u];
52
+ F("error", e, a);
53
+ }
54
+ }
55
+ function F(e, n, a) {
56
+ {
57
+ var u = f.ReactDebugCurrentFrame, w = u.getStackAddendum();
58
+ w !== "" && (n += "%s", a = a.concat([w]));
59
+ var S = a.map(function(m) {
60
+ return String(m);
61
+ });
62
+ S.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, S);
63
+ }
64
+ }
65
+ var X = !1, te = !1, Q = !1, C = !1, P = !1, M;
66
+ M = Symbol.for("react.module.reference");
67
+ function W(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === c || P || e === s || e === b || e === g || C || e === _ || X || te || Q || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === j || e.$$typeof === v || e.$$typeof === d || e.$$typeof === E || // This needs to include all possible module reference object
69
+ // types supported by any Flight configuration anywhere since
70
+ // we don't know which Flight build this will end up being used
71
+ // with.
72
+ e.$$typeof === M || e.getModuleId !== void 0));
73
+ }
74
+ function re(e, n, a) {
75
+ var u = e.displayName;
76
+ if (u)
77
+ return u;
78
+ var w = n.displayName || n.name || "";
79
+ return w !== "" ? a + "(" + w + ")" : a;
80
+ }
81
+ function G(e) {
82
+ return e.displayName || "Context";
83
+ }
84
+ function V(e) {
85
+ if (e == null)
86
+ return null;
87
+ if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
+ return e.displayName || e.name || null;
89
+ if (typeof e == "string")
90
+ return e;
91
+ switch (e) {
92
+ case i:
93
+ return "Fragment";
94
+ case r:
95
+ return "Portal";
96
+ case c:
97
+ return "Profiler";
98
+ case s:
99
+ return "StrictMode";
100
+ case b:
101
+ return "Suspense";
102
+ case g:
103
+ return "SuspenseList";
104
+ }
105
+ if (typeof e == "object")
106
+ switch (e.$$typeof) {
107
+ case d:
108
+ var n = e;
109
+ return G(n) + ".Consumer";
110
+ case v:
111
+ var a = e;
112
+ return G(a._context) + ".Provider";
113
+ case E:
114
+ return re(e, e.render, "ForwardRef");
115
+ case j:
116
+ var u = e.displayName || null;
117
+ return u !== null ? u : V(e.type) || "Memo";
118
+ case R: {
119
+ var w = e, S = w._payload, m = w._init;
120
+ try {
121
+ return V(m(S));
122
+ } catch {
123
+ return null;
124
+ }
125
+ }
126
+ }
127
+ return null;
128
+ }
129
+ var H = Object.assign, J = 0, ne, oe, x, q, ie, ae, se;
130
+ function De() {
131
+ }
132
+ De.__reactDisabledLog = !0;
133
+ function it() {
134
+ {
135
+ if (J === 0) {
136
+ ne = console.log, oe = console.info, x = console.warn, q = console.error, ie = console.group, ae = console.groupCollapsed, se = console.groupEnd;
137
+ var e = {
138
+ configurable: !0,
139
+ enumerable: !0,
140
+ value: De,
141
+ writable: !0
142
+ };
143
+ Object.defineProperties(console, {
144
+ info: e,
145
+ log: e,
146
+ warn: e,
147
+ error: e,
148
+ group: e,
149
+ groupCollapsed: e,
150
+ groupEnd: e
151
+ });
152
+ }
153
+ J++;
154
+ }
155
+ }
156
+ function at() {
157
+ {
158
+ if (J--, J === 0) {
159
+ var e = {
160
+ configurable: !0,
161
+ enumerable: !0,
162
+ writable: !0
163
+ };
164
+ Object.defineProperties(console, {
165
+ log: H({}, e, {
166
+ value: ne
167
+ }),
168
+ info: H({}, e, {
169
+ value: oe
170
+ }),
171
+ warn: H({}, e, {
172
+ value: x
173
+ }),
174
+ error: H({}, e, {
175
+ value: q
176
+ }),
177
+ group: H({}, e, {
178
+ value: ie
179
+ }),
180
+ groupCollapsed: H({}, e, {
181
+ value: ae
182
+ }),
183
+ groupEnd: H({}, e, {
184
+ value: se
185
+ })
186
+ });
187
+ }
188
+ J < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
+ }
190
+ }
191
+ var xe = f.ReactCurrentDispatcher, Ee;
192
+ function fe(e, n, a) {
193
+ {
194
+ if (Ee === void 0)
195
+ try {
196
+ throw Error();
197
+ } catch (w) {
198
+ var u = w.stack.trim().match(/\n( *(at )?)/);
199
+ Ee = u && u[1] || "";
200
+ }
201
+ return `
202
+ ` + Ee + e;
203
+ }
204
+ }
205
+ var we = !1, pe;
206
+ {
207
+ var st = typeof WeakMap == "function" ? WeakMap : Map;
208
+ pe = new st();
209
+ }
210
+ function Oe(e, n) {
211
+ if (!e || we)
212
+ return "";
213
+ {
214
+ var a = pe.get(e);
215
+ if (a !== void 0)
216
+ return a;
217
+ }
218
+ var u;
219
+ we = !0;
220
+ var w = Error.prepareStackTrace;
221
+ Error.prepareStackTrace = void 0;
222
+ var S;
223
+ S = xe.current, xe.current = null, it();
224
+ try {
225
+ if (n) {
226
+ var m = function() {
227
+ throw Error();
228
+ };
229
+ if (Object.defineProperty(m.prototype, "props", {
230
+ set: function() {
231
+ throw Error();
232
+ }
233
+ }), typeof Reflect == "object" && Reflect.construct) {
234
+ try {
235
+ Reflect.construct(m, []);
236
+ } catch (z) {
237
+ u = z;
238
+ }
239
+ Reflect.construct(e, [], m);
240
+ } else {
241
+ try {
242
+ m.call();
243
+ } catch (z) {
244
+ u = z;
245
+ }
246
+ e.call(m.prototype);
247
+ }
248
+ } else {
249
+ try {
250
+ throw Error();
251
+ } catch (z) {
252
+ u = z;
253
+ }
254
+ e();
255
+ }
256
+ } catch (z) {
257
+ if (z && u && typeof z.stack == "string") {
258
+ for (var h = z.stack.split(`
259
+ `), $ = u.stack.split(`
260
+ `), T = h.length - 1, k = $.length - 1; T >= 1 && k >= 0 && h[T] !== $[k]; )
261
+ k--;
262
+ for (; T >= 1 && k >= 0; T--, k--)
263
+ if (h[T] !== $[k]) {
264
+ if (T !== 1 || k !== 1)
265
+ do
266
+ if (T--, k--, k < 0 || h[T] !== $[k]) {
267
+ var Y = `
268
+ ` + h[T].replace(" at new ", " at ");
269
+ return e.displayName && Y.includes("<anonymous>") && (Y = Y.replace("<anonymous>", e.displayName)), typeof e == "function" && pe.set(e, Y), Y;
270
+ }
271
+ while (T >= 1 && k >= 0);
272
+ break;
273
+ }
274
+ }
275
+ } finally {
276
+ we = !1, xe.current = S, at(), Error.prepareStackTrace = w;
277
+ }
278
+ var ee = e ? e.displayName || e.name : "", U = ee ? fe(ee) : "";
279
+ return typeof e == "function" && pe.set(e, U), U;
280
+ }
281
+ function lt(e, n, a) {
282
+ return Oe(e, !1);
283
+ }
284
+ function ut(e) {
285
+ var n = e.prototype;
286
+ return !!(n && n.isReactComponent);
287
+ }
288
+ function he(e, n, a) {
289
+ if (e == null)
290
+ return "";
291
+ if (typeof e == "function")
292
+ return Oe(e, ut(e));
293
+ if (typeof e == "string")
294
+ return fe(e);
295
+ switch (e) {
296
+ case b:
297
+ return fe("Suspense");
298
+ case g:
299
+ return fe("SuspenseList");
300
+ }
301
+ if (typeof e == "object")
302
+ switch (e.$$typeof) {
303
+ case E:
304
+ return lt(e.render);
305
+ case j:
306
+ return he(e.type, n, a);
307
+ case R: {
308
+ var u = e, w = u._payload, S = u._init;
309
+ try {
310
+ return he(S(w), n, a);
311
+ } catch {
312
+ }
313
+ }
314
+ }
315
+ return "";
316
+ }
317
+ var le = Object.prototype.hasOwnProperty, Ie = {}, Le = f.ReactDebugCurrentFrame;
318
+ function ve(e) {
319
+ if (e) {
320
+ var n = e._owner, a = he(e.type, e._source, n ? n.type : null);
321
+ Le.setExtraStackFrame(a);
322
+ } else
323
+ Le.setExtraStackFrame(null);
324
+ }
325
+ function ct(e, n, a, u, w) {
326
+ {
327
+ var S = Function.call.bind(le);
328
+ for (var m in e)
329
+ if (S(e, m)) {
330
+ var h = void 0;
331
+ try {
332
+ if (typeof e[m] != "function") {
333
+ var $ = Error((u || "React class") + ": " + a + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ throw $.name = "Invariant Violation", $;
335
+ }
336
+ h = e[m](n, m, u, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch (T) {
338
+ h = T;
339
+ }
340
+ h && !(h instanceof Error) && (ve(w), p("%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).", u || "React class", a, m, typeof h), ve(null)), h instanceof Error && !(h.message in Ie) && (Ie[h.message] = !0, ve(w), p("Failed %s type: %s", a, h.message), ve(null));
341
+ }
342
+ }
343
+ }
344
+ var dt = Array.isArray;
345
+ function be(e) {
346
+ return dt(e);
347
+ }
348
+ function ft(e) {
349
+ {
350
+ var n = typeof Symbol == "function" && Symbol.toStringTag, a = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
+ return a;
352
+ }
353
+ }
354
+ function pt(e) {
355
+ try {
356
+ return Ae(e), !1;
357
+ } catch {
358
+ return !0;
359
+ }
360
+ }
361
+ function Ae(e) {
362
+ return "" + e;
363
+ }
364
+ function Fe(e) {
365
+ if (pt(e))
366
+ return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ft(e)), Ae(e);
367
+ }
368
+ var $e = f.ReactCurrentOwner, ht = {
369
+ key: !0,
370
+ ref: !0,
371
+ __self: !0,
372
+ __source: !0
373
+ }, Ne, ze;
374
+ function vt(e) {
375
+ if (le.call(e, "ref")) {
376
+ var n = Object.getOwnPropertyDescriptor(e, "ref").get;
377
+ if (n && n.isReactWarning)
378
+ return !1;
379
+ }
380
+ return e.ref !== void 0;
381
+ }
382
+ function gt(e) {
383
+ if (le.call(e, "key")) {
384
+ var n = Object.getOwnPropertyDescriptor(e, "key").get;
385
+ if (n && n.isReactWarning)
386
+ return !1;
387
+ }
388
+ return e.key !== void 0;
389
+ }
390
+ function yt(e, n) {
391
+ typeof e.ref == "string" && $e.current;
392
+ }
393
+ function mt(e, n) {
394
+ {
395
+ var a = function() {
396
+ Ne || (Ne = !0, p("%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));
397
+ };
398
+ a.isReactWarning = !0, Object.defineProperty(e, "key", {
399
+ get: a,
400
+ configurable: !0
401
+ });
402
+ }
403
+ }
404
+ function xt(e, n) {
405
+ {
406
+ var a = function() {
407
+ ze || (ze = !0, p("%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));
408
+ };
409
+ a.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
+ get: a,
411
+ configurable: !0
412
+ });
413
+ }
414
+ }
415
+ var Et = function(e, n, a, u, w, S, m) {
416
+ var h = {
417
+ // This tag allows us to uniquely identify this as a React Element
418
+ $$typeof: o,
419
+ // Built-in properties that belong on the element
420
+ type: e,
421
+ key: n,
422
+ ref: a,
423
+ props: m,
424
+ // Record the component responsible for creating this element.
425
+ _owner: S
426
+ };
427
+ return h._store = {}, Object.defineProperty(h._store, "validated", {
428
+ configurable: !1,
429
+ enumerable: !1,
430
+ writable: !0,
431
+ value: !1
432
+ }), Object.defineProperty(h, "_self", {
433
+ configurable: !1,
434
+ enumerable: !1,
435
+ writable: !1,
436
+ value: u
437
+ }), Object.defineProperty(h, "_source", {
438
+ configurable: !1,
439
+ enumerable: !1,
440
+ writable: !1,
441
+ value: w
442
+ }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
443
+ };
444
+ function wt(e, n, a, u, w) {
445
+ {
446
+ var S, m = {}, h = null, $ = null;
447
+ a !== void 0 && (Fe(a), h = "" + a), gt(n) && (Fe(n.key), h = "" + n.key), vt(n) && ($ = n.ref, yt(n, w));
448
+ for (S in n)
449
+ le.call(n, S) && !ht.hasOwnProperty(S) && (m[S] = n[S]);
450
+ if (e && e.defaultProps) {
451
+ var T = e.defaultProps;
452
+ for (S in T)
453
+ m[S] === void 0 && (m[S] = T[S]);
454
+ }
455
+ if (h || $) {
456
+ var k = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
+ h && mt(m, k), $ && xt(m, k);
458
+ }
459
+ return Et(e, h, $, w, u, $e.current, m);
460
+ }
461
+ }
462
+ var Re = f.ReactCurrentOwner, Me = f.ReactDebugCurrentFrame;
463
+ function K(e) {
464
+ if (e) {
465
+ var n = e._owner, a = he(e.type, e._source, n ? n.type : null);
466
+ Me.setExtraStackFrame(a);
467
+ } else
468
+ Me.setExtraStackFrame(null);
469
+ }
470
+ var Se;
471
+ Se = !1;
472
+ function Ce(e) {
473
+ return typeof e == "object" && e !== null && e.$$typeof === o;
474
+ }
475
+ function We() {
476
+ {
477
+ if (Re.current) {
478
+ var e = V(Re.current.type);
479
+ if (e)
480
+ return `
481
+
482
+ Check the render method of \`` + e + "`.";
483
+ }
484
+ return "";
485
+ }
486
+ }
487
+ function bt(e) {
488
+ return "";
489
+ }
490
+ var Ve = {};
491
+ function Rt(e) {
492
+ {
493
+ var n = We();
494
+ if (!n) {
495
+ var a = typeof e == "string" ? e : e.displayName || e.name;
496
+ a && (n = `
497
+
498
+ Check the top-level render call using <` + a + ">.");
499
+ }
500
+ return n;
501
+ }
502
+ }
503
+ function Be(e, n) {
504
+ {
505
+ if (!e._store || e._store.validated || e.key != null)
506
+ return;
507
+ e._store.validated = !0;
508
+ var a = Rt(n);
509
+ if (Ve[a])
510
+ return;
511
+ Ve[a] = !0;
512
+ var u = "";
513
+ e && e._owner && e._owner !== Re.current && (u = " It was passed a child from " + V(e._owner.type) + "."), K(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, u), K(null);
514
+ }
515
+ }
516
+ function Ye(e, n) {
517
+ {
518
+ if (typeof e != "object")
519
+ return;
520
+ if (be(e))
521
+ for (var a = 0; a < e.length; a++) {
522
+ var u = e[a];
523
+ Ce(u) && Be(u, n);
524
+ }
525
+ else if (Ce(e))
526
+ e._store && (e._store.validated = !0);
527
+ else if (e) {
528
+ var w = y(e);
529
+ if (typeof w == "function" && w !== e.entries)
530
+ for (var S = w.call(e), m; !(m = S.next()).done; )
531
+ Ce(m.value) && Be(m.value, n);
532
+ }
533
+ }
534
+ }
535
+ function St(e) {
536
+ {
537
+ var n = e.type;
538
+ if (n == null || typeof n == "string")
539
+ return;
540
+ var a;
541
+ if (typeof n == "function")
542
+ a = n.propTypes;
543
+ else if (typeof n == "object" && (n.$$typeof === E || // Note: Memo only checks outer props here.
544
+ // Inner props are checked in the reconciler.
545
+ n.$$typeof === j))
546
+ a = n.propTypes;
547
+ else
548
+ return;
549
+ if (a) {
550
+ var u = V(n);
551
+ ct(a, e.props, "prop", u, e);
552
+ } else if (n.PropTypes !== void 0 && !Se) {
553
+ Se = !0;
554
+ var w = V(n);
555
+ p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", w || "Unknown");
556
+ }
557
+ typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
+ }
559
+ }
560
+ function Ct(e) {
561
+ {
562
+ for (var n = Object.keys(e.props), a = 0; a < n.length; a++) {
563
+ var u = n[a];
564
+ if (u !== "children" && u !== "key") {
565
+ K(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), K(null);
566
+ break;
567
+ }
568
+ }
569
+ e.ref !== null && (K(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
570
+ }
571
+ }
572
+ var He = {};
573
+ function Xe(e, n, a, u, w, S) {
574
+ {
575
+ var m = W(e);
576
+ if (!m) {
577
+ var h = "";
578
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " 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 $ = bt();
580
+ $ ? h += $ : h += We();
581
+ var T;
582
+ e === null ? T = "null" : be(e) ? T = "array" : e !== void 0 && e.$$typeof === o ? (T = "<" + (V(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : T = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, h);
583
+ }
584
+ var k = wt(e, n, a, w, S);
585
+ if (k == null)
586
+ return k;
587
+ if (m) {
588
+ var Y = n.children;
589
+ if (Y !== void 0)
590
+ if (u)
591
+ if (be(Y)) {
592
+ for (var ee = 0; ee < Y.length; ee++)
593
+ Ye(Y[ee], e);
594
+ Object.freeze && Object.freeze(Y);
595
+ } else
596
+ p("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
+ else
598
+ Ye(Y, e);
599
+ }
600
+ if (le.call(n, "key")) {
601
+ var U = V(e), z = Object.keys(n).filter(function(Dt) {
602
+ return Dt !== "key";
603
+ }), je = z.length > 0 ? "{key: someKey, " + z.join(": ..., ") + ": ...}" : "{key: someKey}";
604
+ if (!He[U + je]) {
605
+ var kt = z.length > 0 ? "{" + z.join(": ..., ") + ": ...}" : "{}";
606
+ p(`A props object containing a "key" prop is being spread into JSX:
607
+ let props = %s;
608
+ <%s {...props} />
609
+ React keys must be passed directly to JSX without using spread:
610
+ let props = %s;
611
+ <%s key={someKey} {...props} />`, je, U, kt, U), He[U + je] = !0;
612
+ }
613
+ }
614
+ return e === i ? Ct(k) : St(k), k;
615
+ }
616
+ }
617
+ function jt(e, n, a) {
618
+ return Xe(e, n, a, !0);
619
+ }
620
+ function _t(e, n, a) {
621
+ return Xe(e, n, a, !1);
622
+ }
623
+ var Pt = _t, Tt = jt;
624
+ ce.Fragment = i, ce.jsx = Pt, ce.jsxs = Tt;
625
+ }()), ce;
626
+ }
627
+ process.env.NODE_ENV === "production" ? Te.exports = At() : Te.exports = Ft();
628
+ var l = Te.exports;
629
+ function $t(t) {
630
+ if (t.id && /^[a-zA-Z][\w-]*$/.test(t.id))
631
+ return `#${t.id}`;
632
+ const o = [];
633
+ let r = t;
634
+ for (; r && r.nodeType === Node.ELEMENT_NODE; ) {
635
+ let i = r.nodeName.toLowerCase();
636
+ if (r.id && /^[a-zA-Z][\w-]*$/.test(r.id)) {
637
+ o.unshift(`#${r.id}`);
638
+ break;
639
+ }
640
+ if (r.className && typeof r.className == "string") {
641
+ const s = r.className.trim().split(/\s+/).filter(Boolean);
642
+ if (s.length > 0) {
643
+ const c = s.filter((v) => /^[a-zA-Z][\w-]*$/.test(v)).slice(0, 2).map((v) => `.${v}`).join("");
644
+ c && (i += c);
645
+ }
646
+ }
647
+ if (o.length > 0) {
648
+ const s = r.parentElement;
649
+ if (s) {
650
+ const c = Array.from(s.children).filter(
651
+ (v) => v.nodeName === r.nodeName
652
+ );
653
+ if (c.length > 1) {
654
+ const v = c.indexOf(r) + 1;
655
+ i += `:nth-child(${v})`;
656
+ }
657
+ }
658
+ }
659
+ o.unshift(i), r = r.parentElement;
660
+ }
661
+ return o.join(" > ");
662
+ }
663
+ function et(t) {
664
+ if (typeof document > "u" || !(t != null && t.trim())) return null;
665
+ try {
666
+ const o = document.querySelector(t);
667
+ return o ? o.getBoundingClientRect() : null;
668
+ } catch {
669
+ return null;
670
+ }
671
+ }
672
+ function Nt(t) {
673
+ if (typeof window > "u")
674
+ return { relativeX: 0, relativeY: 0 };
675
+ const o = window.innerWidth, r = window.innerHeight;
676
+ return {
677
+ relativeX: o > 0 ? t.left / o : 0,
678
+ relativeY: r > 0 ? t.top / r : 0
679
+ };
680
+ }
681
+ function zt(t) {
682
+ if (typeof window > "u")
683
+ return {
684
+ x: t.x ?? 0,
685
+ y: t.y ?? 0
686
+ };
687
+ const o = t.relativeX ?? null, r = t.relativeY ?? null;
688
+ return o != null && r != null ? {
689
+ x: o * window.innerWidth,
690
+ y: r * window.innerHeight
691
+ } : {
692
+ x: t.x ?? 0,
693
+ y: t.y ?? 0
694
+ };
695
+ }
696
+ function ye(t) {
697
+ if (t.selector) {
698
+ const o = et(t.selector);
699
+ if (o != null)
700
+ return { x: o.left, y: o.top };
701
+ }
702
+ return zt(t);
703
+ }
704
+ const D = {
705
+ PENDING: "pending",
706
+ DEV_FIXED: "dev_fixed",
707
+ VALIDATED: "validated"
708
+ };
709
+ function de(t) {
710
+ return {
711
+ "Content-Type": "application/json",
712
+ "x-review-key": t
713
+ };
714
+ }
715
+ async function Mt(t, o, r) {
716
+ const i = await fetch(`${t}/reviewers`, {
717
+ headers: de(o),
718
+ signal: r == null ? void 0 : r.signal
719
+ });
720
+ if (!i.ok) throw new Error("Failed to fetch reviewers");
721
+ return (await i.json()).data ?? [];
722
+ }
723
+ async function Wt(t, o, r) {
724
+ const i = await fetch(`${t}/comments`, {
725
+ method: "POST",
726
+ headers: de(o),
727
+ body: JSON.stringify(r)
728
+ });
729
+ if (!i.ok) {
730
+ const c = await i.json().catch(() => ({}));
731
+ throw new Error(c.message || "Failed to create comment");
732
+ }
733
+ return (await i.json()).data;
734
+ }
735
+ async function Vt(t, o, r, i) {
736
+ const s = new URLSearchParams({ url: r }), c = await fetch(`${t}/comments?${s}`, {
737
+ headers: de(o),
738
+ signal: i == null ? void 0 : i.signal
739
+ });
740
+ if (!c.ok) throw new Error("Failed to fetch comments");
741
+ return (await c.json()).data ?? [];
742
+ }
743
+ async function Bt(t, o, r, i) {
744
+ const s = await fetch(`${t}/comments/${r}/status`, {
745
+ method: "PATCH",
746
+ headers: de(o),
747
+ body: JSON.stringify({ status: i })
748
+ });
749
+ if (!s.ok) {
750
+ const v = await s.json().catch(() => ({}));
751
+ throw new Error(v.message || "Failed to update comment status");
752
+ }
753
+ return (await s.json()).data;
754
+ }
755
+ async function Yt(t, o, r) {
756
+ const i = await fetch(`${t}/comments/${r}`, {
757
+ method: "DELETE",
758
+ headers: de(o)
759
+ });
760
+ if (!i.ok) {
761
+ const s = await i.json().catch(() => ({}));
762
+ throw new Error(s.message || "Failed to delete comment");
763
+ }
764
+ }
765
+ const Ht = {
766
+ position: "fixed",
767
+ inset: 0,
768
+ zIndex: 999997,
769
+ backgroundColor: "transparent"
770
+ }, Xt = {
771
+ position: "fixed",
772
+ minWidth: 320,
773
+ maxWidth: 400,
774
+ padding: 16,
775
+ backgroundColor: "#fff",
776
+ border: "1px solid #e8e8e8",
777
+ borderRadius: 8,
778
+ boxShadow: "0 8px 24px rgba(0,0,0,0.15)",
779
+ zIndex: 999998
780
+ }, Gt = {
781
+ width: "100%",
782
+ minHeight: 80,
783
+ padding: "8px 12px",
784
+ marginBottom: 12,
785
+ border: "1px solid #d9d9d9",
786
+ borderRadius: 6,
787
+ fontSize: 14,
788
+ resize: "vertical",
789
+ boxSizing: "border-box"
790
+ }, Jt = {
791
+ width: "100%",
792
+ padding: "8px 12px",
793
+ marginBottom: 12,
794
+ border: "1px solid #d9d9d9",
795
+ borderRadius: 6,
796
+ fontSize: 14
797
+ }, qt = {
798
+ padding: "8px 16px",
799
+ backgroundColor: "#ff4d4f",
800
+ color: "#fff",
801
+ border: "none",
802
+ borderRadius: 6,
803
+ fontSize: 14,
804
+ cursor: "pointer",
805
+ fontWeight: 500
806
+ };
807
+ function Ut({
808
+ apiUrl: t,
809
+ apiKey: o,
810
+ reviewers: r,
811
+ position: i,
812
+ payload: s,
813
+ onClose: c,
814
+ onSuccess: v
815
+ }) {
816
+ var y;
817
+ const [d, E] = L(""), [b, g] = L(
818
+ ((y = r[0]) == null ? void 0 : y.id) ?? 0
819
+ ), [j, R] = L(!1), [_, A] = L(null);
820
+ N(() => {
821
+ r.length > 0 && !b && g(r[0].id);
822
+ }, [r, b]);
823
+ const O = async (f) => {
824
+ if (f.preventDefault(), !(!d.trim() || !b)) {
825
+ R(!0), A(null);
826
+ try {
827
+ await Wt(t, o, {
828
+ ...s,
829
+ message: d.trim(),
830
+ reviewerId: b
831
+ }), v(), c();
832
+ } catch (p) {
833
+ A(p instanceof Error ? p.message : "Failed to send comment");
834
+ } finally {
835
+ R(!1);
836
+ }
837
+ }
838
+ };
839
+ return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
840
+ /* @__PURE__ */ l.jsx(
841
+ "div",
842
+ {
843
+ role: "presentation",
844
+ style: Ht,
845
+ onClick: c,
846
+ onKeyDown: (f) => f.key === "Escape" && c()
847
+ }
848
+ ),
849
+ /* @__PURE__ */ l.jsx(
850
+ "div",
851
+ {
852
+ style: {
853
+ ...Xt,
854
+ left: Math.min(i.x, typeof window < "u" ? window.innerWidth - 420 : i.x),
855
+ top: i.y + 12
856
+ },
857
+ onClick: (f) => f.stopPropagation(),
858
+ children: /* @__PURE__ */ l.jsxs("form", { onSubmit: O, children: [
859
+ /* @__PURE__ */ l.jsx(
860
+ "textarea",
861
+ {
862
+ placeholder: "Escribe tu comentario...",
863
+ value: d,
864
+ onChange: (f) => E(f.target.value),
865
+ style: Gt,
866
+ required: !0,
867
+ autoFocus: !0
868
+ }
869
+ ),
870
+ /* @__PURE__ */ l.jsxs(
871
+ "select",
872
+ {
873
+ value: b,
874
+ onChange: (f) => g(Number(f.target.value)),
875
+ style: Jt,
876
+ required: !0,
877
+ disabled: r.length === 0,
878
+ children: [
879
+ /* @__PURE__ */ l.jsx("option", { value: "", children: r.length === 0 ? "No hay revisores (ejecuta php artisan db:seed en la API)" : "Selecciona revisor" }),
880
+ r.map((f) => /* @__PURE__ */ l.jsx("option", { value: f.id, children: f.name }, f.id))
881
+ ]
882
+ }
883
+ ),
884
+ _ && /* @__PURE__ */ l.jsx(
885
+ "div",
886
+ {
887
+ style: {
888
+ color: "#ff4d4f",
889
+ fontSize: 12,
890
+ marginBottom: 8
891
+ },
892
+ children: _
893
+ }
894
+ ),
895
+ /* @__PURE__ */ l.jsx(
896
+ "button",
897
+ {
898
+ type: "submit",
899
+ style: qt,
900
+ disabled: j || r.length === 0,
901
+ children: j ? "Enviando..." : "Enviar comentario"
902
+ }
903
+ )
904
+ ] })
905
+ }
906
+ )
907
+ ] });
908
+ }
909
+ const Zt = {
910
+ position: "fixed",
911
+ outline: "2px solid #ff4d4f",
912
+ outlineOffset: "2px",
913
+ pointerEvents: "none",
914
+ zIndex: 999997,
915
+ boxSizing: "border-box"
916
+ };
917
+ function Qt({ selector: t, active: o }) {
918
+ const [r, i] = L(null), s = I(() => {
919
+ if (!o || !(t != null && t.trim())) {
920
+ i(null);
921
+ return;
922
+ }
923
+ const c = et(t);
924
+ i(c);
925
+ }, [t, o]);
926
+ return N(() => {
927
+ s();
928
+ }, [s]), N(() => {
929
+ if (!(!o || !(t != null && t.trim())))
930
+ return window.addEventListener("scroll", s, !0), window.addEventListener("resize", s), () => {
931
+ window.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s);
932
+ };
933
+ }, [o, t, s]), !o || r == null ? null : /* @__PURE__ */ l.jsx(
934
+ "div",
935
+ {
936
+ "aria-hidden": !0,
937
+ style: {
938
+ ...Zt,
939
+ left: r.left,
940
+ top: r.top,
941
+ width: r.width,
942
+ height: r.height
943
+ }
944
+ }
945
+ );
946
+ }
947
+ const ke = 32, qe = 5e6, B = {
948
+ cardBg: "#ffffff",
949
+ textDark: "#333333",
950
+ textMuted: "#888888",
951
+ border: "#cccccc",
952
+ shadow: "0 4px 16px rgba(0, 0, 0, 0.12)"
953
+ }, Kt = {
954
+ [D.PENDING]: "Pendiente",
955
+ [D.DEV_FIXED]: "Corregido Desarrollo",
956
+ [D.VALIDATED]: "Validado"
957
+ }, er = {
958
+ [D.PENDING]: "PENDIENTE",
959
+ [D.DEV_FIXED]: "CORREGIDO DESARROLLO",
960
+ [D.VALIDATED]: "VALIDADO"
961
+ }, Z = {
962
+ [D.PENDING]: "rgb(240, 69, 69)",
963
+ [D.DEV_FIXED]: "rgb(235, 179, 8)",
964
+ [D.VALIDATED]: "rgb(33, 196, 94)"
965
+ };
966
+ function tr(t) {
967
+ const o = t.trim().split(/\s+/);
968
+ return o.length >= 2 ? (o[0][0] + o[o.length - 1][0]).toUpperCase() : t.slice(0, 2).toUpperCase() || "?";
969
+ }
970
+ const rr = () => /* @__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" }) }), nr = ({ color: t }) => /* @__PURE__ */ l.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", style: { flexShrink: 0 }, children: [
971
+ /* @__PURE__ */ l.jsx(
972
+ "path",
973
+ {
974
+ 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",
975
+ stroke: t,
976
+ strokeWidth: "2",
977
+ strokeLinecap: "round",
978
+ strokeLinejoin: "round",
979
+ fill: "none"
980
+ }
981
+ ),
982
+ /* @__PURE__ */ l.jsx(
983
+ "path",
984
+ {
985
+ d: "M8 10h.01M12 10h.01M16 10h.01",
986
+ stroke: "#fff",
987
+ strokeWidth: "1.5",
988
+ strokeLinecap: "round"
989
+ }
990
+ )
991
+ ] }), or = (t) => ({
992
+ position: "fixed",
993
+ width: ke,
994
+ height: ke,
995
+ borderRadius: "50%",
996
+ backgroundColor: Z[t] ?? Z[D.PENDING],
997
+ color: "#fff",
998
+ display: "flex",
999
+ alignItems: "center",
1000
+ justifyContent: "center",
1001
+ cursor: "pointer",
1002
+ fontFamily: "'Inter', sans-serif",
1003
+ boxShadow: "0 2px 8px rgba(0,0,0,0.2)",
1004
+ zIndex: 999998,
1005
+ border: "2px solid #fff"
1006
+ }), ir = {
1007
+ position: "fixed",
1008
+ maxWidth: 320,
1009
+ padding: "16px 14px",
1010
+ backgroundColor: B.cardBg,
1011
+ borderRadius: 12,
1012
+ boxShadow: B.shadow,
1013
+ fontSize: 13,
1014
+ fontFamily: "'Inter', sans-serif",
1015
+ zIndex: 999999,
1016
+ pointerEvents: "auto"
1017
+ }, ar = {
1018
+ display: "flex",
1019
+ alignItems: "center",
1020
+ justifyContent: "space-between",
1021
+ gap: 10,
1022
+ marginBottom: 12
1023
+ }, sr = (t) => ({
1024
+ width: 40,
1025
+ height: 40,
1026
+ borderRadius: "50%",
1027
+ backgroundColor: Z[t] ?? Z[D.PENDING],
1028
+ color: "#fff",
1029
+ border: "2px solid #fff",
1030
+ display: "flex",
1031
+ alignItems: "center",
1032
+ justifyContent: "center",
1033
+ fontSize: 14,
1034
+ fontWeight: 700,
1035
+ flexShrink: 0
1036
+ }), lr = {
1037
+ flexShrink: 0,
1038
+ width: 24,
1039
+ height: 24,
1040
+ padding: 0,
1041
+ border: "none",
1042
+ borderRadius: 6,
1043
+ backgroundColor: "transparent",
1044
+ color: B.textDark,
1045
+ cursor: "pointer",
1046
+ fontSize: 18,
1047
+ lineHeight: 1,
1048
+ display: "flex",
1049
+ alignItems: "center",
1050
+ justifyContent: "center"
1051
+ }, ur = (t) => {
1052
+ const o = t === D.DEV_FIXED;
1053
+ return {
1054
+ display: "inline-flex",
1055
+ alignItems: "center",
1056
+ marginBottom: 10,
1057
+ padding: "4px 10px",
1058
+ borderRadius: 9999,
1059
+ fontSize: 10,
1060
+ fontWeight: 700,
1061
+ fontFamily: "'Inter', sans-serif",
1062
+ textTransform: "uppercase",
1063
+ letterSpacing: "0.02em",
1064
+ backgroundColor: Z[t] ?? Z[D.PENDING],
1065
+ color: o ? B.textDark : "#fff"
1066
+ };
1067
+ }, cr = {
1068
+ display: "block",
1069
+ marginTop: 12,
1070
+ marginBottom: 6,
1071
+ fontSize: 10,
1072
+ fontWeight: 600,
1073
+ fontFamily: "'Inter', sans-serif",
1074
+ color: B.textMuted,
1075
+ textTransform: "uppercase",
1076
+ letterSpacing: "0.04em"
1077
+ }, dr = {
1078
+ width: "100%",
1079
+ padding: "8px 12px",
1080
+ paddingRight: 32,
1081
+ fontSize: 13,
1082
+ fontFamily: "'Inter', sans-serif",
1083
+ borderRadius: 8,
1084
+ border: `1px solid ${B.border}`,
1085
+ backgroundColor: B.cardBg,
1086
+ color: B.textDark,
1087
+ cursor: "pointer",
1088
+ appearance: "none",
1089
+ 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")`,
1090
+ backgroundRepeat: "no-repeat",
1091
+ backgroundPosition: "right 10px center"
1092
+ }, fr = {
1093
+ display: "flex",
1094
+ alignItems: "center",
1095
+ justifyContent: "flex-end",
1096
+ gap: 8,
1097
+ marginTop: 14,
1098
+ paddingTop: 12,
1099
+ borderTop: `1px solid ${B.border}`
1100
+ }, tt = {
1101
+ minWidth: 100,
1102
+ padding: "8px 14px",
1103
+ fontSize: 13,
1104
+ fontWeight: 600,
1105
+ fontFamily: "'Inter', sans-serif",
1106
+ borderRadius: 8,
1107
+ cursor: "pointer",
1108
+ border: "none"
1109
+ }, pr = {
1110
+ ...tt,
1111
+ backgroundColor: "transparent",
1112
+ color: B.textDark
1113
+ }, hr = {
1114
+ ...tt,
1115
+ backgroundColor: Z[D.VALIDATED],
1116
+ color: "#fff"
1117
+ };
1118
+ function vr({
1119
+ comment: t,
1120
+ offset: o = { dx: 0, dy: 0 },
1121
+ apiUrl: r,
1122
+ apiKey: i,
1123
+ onStatusChange: s
1124
+ }) {
1125
+ var ne, oe;
1126
+ const [c, v] = L(!1), [d, E] = L(!1), [b, g] = L(() => ye(t)), [j, R] = L(!1), [_, A] = L(null), O = ge(null), y = ge(null), f = ge(null), p = I(() => {
1127
+ g(ye(t));
1128
+ }, [t]);
1129
+ N(() => {
1130
+ p();
1131
+ }, [p]), N(() => {
1132
+ if (!(typeof window > "u"))
1133
+ return window.addEventListener("scroll", p, !0), window.addEventListener("resize", p), () => {
1134
+ window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", p);
1135
+ };
1136
+ }, [p]);
1137
+ const F = I(() => {
1138
+ O.current !== null && (clearTimeout(O.current), O.current = null);
1139
+ }, []), X = I(() => {
1140
+ F(), v(!0);
1141
+ }, [F]), te = I(() => {
1142
+ d || (O.current = setTimeout(() => {
1143
+ O.current = null, v(!1);
1144
+ }, qe));
1145
+ }, [d]), Q = I(() => {
1146
+ F(), v(!0);
1147
+ }, [F]), C = I(() => {
1148
+ d || (O.current = setTimeout(() => {
1149
+ O.current = null, v(!1);
1150
+ }, qe));
1151
+ }, [d]), P = I(() => {
1152
+ d ? (E(!1), v(!1)) : (E(!0), v(!0));
1153
+ }, [d]);
1154
+ N(() => {
1155
+ if (!d) return;
1156
+ const x = (q) => {
1157
+ var ae, se;
1158
+ const ie = q.target;
1159
+ (ae = y.current) != null && ae.contains(ie) || (se = f.current) != null && se.contains(ie) || (E(!1), v(!1));
1160
+ };
1161
+ return document.addEventListener("mousedown", x, !0), () => document.removeEventListener("mousedown", x, !0);
1162
+ }, [d]), N(() => () => F(), [F]);
1163
+ const M = b.x + o.dx, W = b.y + o.dy, re = c, G = I(() => {
1164
+ E(!1), v(!1);
1165
+ }, []), V = async (x) => {
1166
+ if (x !== t.status) {
1167
+ A(null), R(!0);
1168
+ try {
1169
+ await Bt(r, i, t.id, x), s();
1170
+ } catch (q) {
1171
+ A(q instanceof Error ? q.message : "Error al actualizar");
1172
+ } finally {
1173
+ R(!1);
1174
+ }
1175
+ }
1176
+ }, H = async () => {
1177
+ A(null), R(!0);
1178
+ try {
1179
+ await Yt(r, i, t.id), s(), G();
1180
+ } catch (x) {
1181
+ A(x instanceof Error ? x.message : "Error al eliminar");
1182
+ } finally {
1183
+ R(!1);
1184
+ }
1185
+ }, J = [
1186
+ "pending",
1187
+ "dev_fixed",
1188
+ "validated"
1189
+ ];
1190
+ return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1191
+ /* @__PURE__ */ l.jsx(Qt, { selector: t.selector, active: re }),
1192
+ /* @__PURE__ */ l.jsx(
1193
+ "div",
1194
+ {
1195
+ ref: y,
1196
+ role: "button",
1197
+ tabIndex: 0,
1198
+ "aria-label": `Comentario: ${t.message.slice(0, 30)}...`,
1199
+ "aria-expanded": c,
1200
+ style: {
1201
+ ...or(t.status),
1202
+ left: M,
1203
+ top: W,
1204
+ transform: "translate(-50%, -50%)"
1205
+ },
1206
+ onMouseEnter: X,
1207
+ onMouseLeave: te,
1208
+ onClick: P,
1209
+ children: /* @__PURE__ */ l.jsx(nr, { color: "#fff" })
1210
+ }
1211
+ ),
1212
+ c && /* @__PURE__ */ l.jsxs(
1213
+ "div",
1214
+ {
1215
+ ref: f,
1216
+ role: "dialog",
1217
+ "aria-label": "Detalle del comentario",
1218
+ style: {
1219
+ ...ir,
1220
+ left: M + ke / 2 + 6,
1221
+ top: W
1222
+ },
1223
+ onMouseEnter: Q,
1224
+ onMouseLeave: C,
1225
+ children: [
1226
+ /* @__PURE__ */ l.jsxs("div", { style: ar, children: [
1227
+ /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, flex: 1, minWidth: 0 }, children: [
1228
+ /* @__PURE__ */ l.jsx("div", { style: sr(t.status), children: tr(((ne = t.reviewer) == null ? void 0 : ne.name) ?? "Revisor") }),
1229
+ /* @__PURE__ */ l.jsxs("div", { children: [
1230
+ /* @__PURE__ */ l.jsx("div", { style: { fontWeight: 700, fontSize: 14, color: B.textDark }, children: ((oe = t.reviewer) == null ? void 0 : oe.name) ?? "Revisor" }),
1231
+ /* @__PURE__ */ l.jsx("div", { style: { fontSize: 12, color: B.textMuted }, children: "Revisor" })
1232
+ ] })
1233
+ ] }),
1234
+ /* @__PURE__ */ l.jsx(
1235
+ "button",
1236
+ {
1237
+ type: "button",
1238
+ "aria-label": t.status === D.VALIDATED ? "Eliminar comentario" : "Cerrar",
1239
+ style: lr,
1240
+ disabled: j,
1241
+ onClick: (x) => {
1242
+ x.stopPropagation(), t.status === D.VALIDATED ? H() : G();
1243
+ },
1244
+ onMouseDown: (x) => x.stopPropagation(),
1245
+ children: "✕"
1246
+ }
1247
+ )
1248
+ ] }),
1249
+ /* @__PURE__ */ l.jsxs("div", { style: ur(t.status), children: [
1250
+ t.status === D.VALIDATED && /* @__PURE__ */ l.jsx(rr, {}),
1251
+ er[t.status] ?? t.status
1252
+ ] }),
1253
+ /* @__PURE__ */ l.jsx("div", { style: { color: B.textDark, lineHeight: 1.5 }, children: t.message }),
1254
+ /* @__PURE__ */ l.jsx("label", { style: cr, htmlFor: `comment-status-${t.id}`, children: "Cambiar estado" }),
1255
+ /* @__PURE__ */ l.jsx(
1256
+ "select",
1257
+ {
1258
+ id: `comment-status-${t.id}`,
1259
+ style: dr,
1260
+ value: t.status,
1261
+ disabled: j,
1262
+ onChange: (x) => V(x.target.value),
1263
+ onMouseDown: (x) => x.stopPropagation(),
1264
+ "aria-label": "Cambiar estado del comentario",
1265
+ children: J.map((x) => /* @__PURE__ */ l.jsx("option", { value: x, children: Kt[x] }, x))
1266
+ }
1267
+ ),
1268
+ _ && /* @__PURE__ */ l.jsx("div", { style: { marginTop: 8, fontSize: 11, color: "rgb(240, 69, 69)" }, children: _ }),
1269
+ /* @__PURE__ */ l.jsxs("div", { style: fr, children: [
1270
+ /* @__PURE__ */ l.jsx(
1271
+ "button",
1272
+ {
1273
+ type: "button",
1274
+ style: pr,
1275
+ onMouseDown: (x) => x.stopPropagation(),
1276
+ onClick: (x) => {
1277
+ x.stopPropagation(), G();
1278
+ },
1279
+ children: "Cerrar"
1280
+ }
1281
+ ),
1282
+ t.status !== D.VALIDATED && /* @__PURE__ */ l.jsx(
1283
+ "button",
1284
+ {
1285
+ type: "button",
1286
+ style: hr,
1287
+ disabled: j,
1288
+ onMouseDown: (x) => x.stopPropagation(),
1289
+ onClick: (x) => {
1290
+ x.stopPropagation(), V("validated");
1291
+ },
1292
+ children: "Resolver hilo"
1293
+ }
1294
+ )
1295
+ ] })
1296
+ ]
1297
+ }
1298
+ )
1299
+ ] });
1300
+ }
1301
+ const gr = 25, yr = 36;
1302
+ function mr(t) {
1303
+ const o = /* @__PURE__ */ new Map();
1304
+ for (let r = 0; r < t.length; r++) {
1305
+ const i = t[r], { x: s, y: c } = ye(i);
1306
+ let v = 0;
1307
+ for (let d = 0; d < r; d++) {
1308
+ const E = t[d], { x: b, y: g } = ye(E);
1309
+ Math.hypot(s - b, c - g) < gr && v++;
1310
+ }
1311
+ o.set(i.id, { dx: v * yr, dy: 0 });
1312
+ }
1313
+ return o;
1314
+ }
1315
+ function xr() {
1316
+ return typeof window > "u" ? "" : `${window.innerWidth}x${window.innerHeight}`;
1317
+ }
1318
+ function Er({
1319
+ apiUrl: t,
1320
+ apiKey: o,
1321
+ reviewMode: r,
1322
+ reviewers: i,
1323
+ comments: s,
1324
+ loadComments: c,
1325
+ commentsLoadFailed: v = !1
1326
+ }) {
1327
+ const [d, E] = L(null), b = ge(null), [g, j] = L(null), R = I(() => {
1328
+ d && (d.style.outline = "", d.style.outlineOffset = "", E(null));
1329
+ }, [d]), _ = I(() => {
1330
+ b.current && (b.current.style.outline = "", b.current.style.outlineOffset = "", b.current = null);
1331
+ }, []);
1332
+ N(() => {
1333
+ r || (R(), _());
1334
+ }, [r, R, _]), N(() => {
1335
+ if (typeof document > "u") return;
1336
+ const C = document.body.style.cursor;
1337
+ return g ? document.body.style.cursor = "default" : r && (document.body.style.cursor = "crosshair"), () => {
1338
+ document.body.style.cursor = C;
1339
+ };
1340
+ }, [r, g]);
1341
+ const A = I(
1342
+ (C) => {
1343
+ if (!r || g) return;
1344
+ const P = C.target.nodeType === Node.ELEMENT_NODE ? C.target : C.target.parentElement;
1345
+ P && (R(), E(P), P.style.outline = "2px solid #ff4d4f", P.style.outlineOffset = "2px");
1346
+ },
1347
+ [r, g, R]
1348
+ ), O = I(
1349
+ (C) => {
1350
+ var M;
1351
+ if (g) return;
1352
+ const P = C.relatedTarget;
1353
+ d && (!P || !d.contains(P)) && !(P && ((M = d.contains) != null && M.call(d, P))) && R();
1354
+ },
1355
+ [d, g, R]
1356
+ ), y = I(
1357
+ (C) => {
1358
+ if (!r || g) return;
1359
+ C.preventDefault(), C.stopPropagation();
1360
+ const P = C.target;
1361
+ if (!P || P.closest("[data-review-layer-pin]") || P.closest("[data-review-layer-modal]")) return;
1362
+ R();
1363
+ const M = P;
1364
+ b.current = M, M.style.outline = "2px solid #ff4d4f", M.style.outlineOffset = "2px";
1365
+ const W = M.getBoundingClientRect(), re = $t(P), { relativeX: G, relativeY: V } = Nt(W);
1366
+ j({
1367
+ position: { x: W.left + W.width / 2, y: W.bottom },
1368
+ payload: {
1369
+ selector: re,
1370
+ x: Math.round(W.left),
1371
+ y: Math.round(W.top),
1372
+ relativeX: G,
1373
+ relativeY: V,
1374
+ width: Math.round(W.width),
1375
+ height: Math.round(W.height),
1376
+ url: typeof window < "u" && window.location.pathname || "/",
1377
+ viewport: xr(),
1378
+ userAgent: typeof navigator < "u" ? navigator.userAgent : "",
1379
+ pageTitle: typeof document < "u" ? document.title : ""
1380
+ }
1381
+ });
1382
+ },
1383
+ [r, g, R]
1384
+ );
1385
+ N(() => {
1386
+ if (r)
1387
+ return document.addEventListener("mouseover", A, !0), document.addEventListener("mouseout", O, !0), document.addEventListener("click", y, !0), () => {
1388
+ document.removeEventListener("mouseover", A, !0), document.removeEventListener("mouseout", O, !0), document.removeEventListener("click", y, !0);
1389
+ };
1390
+ }, [r, A, O, y]);
1391
+ const [f, p] = L(0);
1392
+ N(() => {
1393
+ if (typeof window > "u") return;
1394
+ const C = () => p((P) => P + 1);
1395
+ return window.addEventListener("resize", C), window.addEventListener("scroll", C, !0), () => {
1396
+ window.removeEventListener("resize", C), window.removeEventListener("scroll", C, !0);
1397
+ };
1398
+ }, []);
1399
+ const F = Ot(
1400
+ () => mr(s),
1401
+ [s, f]
1402
+ ), X = {
1403
+ position: "fixed",
1404
+ inset: 0,
1405
+ zIndex: 999999,
1406
+ pointerEvents: "none",
1407
+ cursor: r ? "crosshair" : void 0
1408
+ }, te = /* @__PURE__ */ l.jsxs("div", { style: X, "aria-hidden": !0, children: [
1409
+ r && /* @__PURE__ */ l.jsx(
1410
+ "div",
1411
+ {
1412
+ style: {
1413
+ position: "fixed",
1414
+ top: 10,
1415
+ left: 10,
1416
+ zIndex: 1e6,
1417
+ padding: "6px 12px",
1418
+ backgroundColor: "#ff4d4f",
1419
+ color: "#fff",
1420
+ borderRadius: 6,
1421
+ fontSize: 12,
1422
+ fontWeight: 500,
1423
+ pointerEvents: "auto"
1424
+ },
1425
+ children: "Modo revisión (Shift+R para salir)"
1426
+ }
1427
+ ),
1428
+ v && /* @__PURE__ */ l.jsxs(
1429
+ "div",
1430
+ {
1431
+ style: {
1432
+ position: "fixed",
1433
+ bottom: 16,
1434
+ left: "50%",
1435
+ transform: "translateX(-50%)",
1436
+ display: "flex",
1437
+ alignItems: "center",
1438
+ gap: 10,
1439
+ padding: "8px 14px",
1440
+ backgroundColor: "#fff",
1441
+ border: "1px solid #e8e8e8",
1442
+ borderRadius: 8,
1443
+ boxShadow: "0 2px 12px rgba(0,0,0,0.1)",
1444
+ fontSize: 12,
1445
+ color: "#333",
1446
+ zIndex: 999997,
1447
+ pointerEvents: "auto"
1448
+ },
1449
+ children: [
1450
+ /* @__PURE__ */ l.jsx("span", { children: "No se pudo conectar. Mostrando últimos datos guardados. Reintentar no garantiza respuesta hasta que el servicio esté activo." }),
1451
+ /* @__PURE__ */ l.jsx(
1452
+ "button",
1453
+ {
1454
+ type: "button",
1455
+ onClick: () => c(),
1456
+ style: {
1457
+ padding: "4px 10px",
1458
+ fontSize: 12,
1459
+ fontWeight: 600,
1460
+ backgroundColor: "rgb(33, 196, 94)",
1461
+ color: "#fff",
1462
+ border: "none",
1463
+ borderRadius: 6,
1464
+ cursor: "pointer"
1465
+ },
1466
+ children: "Reintentar"
1467
+ }
1468
+ )
1469
+ ]
1470
+ }
1471
+ ),
1472
+ s.map((C) => /* @__PURE__ */ l.jsx("div", { "data-review-layer-pin": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ l.jsx(
1473
+ vr,
1474
+ {
1475
+ comment: C,
1476
+ offset: F.get(C.id),
1477
+ apiUrl: t,
1478
+ apiKey: o,
1479
+ onStatusChange: c
1480
+ }
1481
+ ) }, C.id)),
1482
+ g && /* @__PURE__ */ l.jsx("div", { "data-review-layer-modal": !0, style: { pointerEvents: "auto" }, children: /* @__PURE__ */ l.jsx(
1483
+ Ut,
1484
+ {
1485
+ apiUrl: t,
1486
+ apiKey: o,
1487
+ reviewers: i,
1488
+ position: g.position,
1489
+ payload: g.payload,
1490
+ onClose: () => {
1491
+ _(), j(null);
1492
+ },
1493
+ onSuccess: c
1494
+ }
1495
+ ) })
1496
+ ] }), Q = typeof document < "u" ? document.body : null;
1497
+ return Q ? Ke(te, Q) : null;
1498
+ }
1499
+ function wr(t, o, r) {
1500
+ const i = I(() => {
1501
+ t && r((s) => !s);
1502
+ }, [t, r]);
1503
+ N(() => {
1504
+ if (!t) return;
1505
+ const s = (c) => {
1506
+ (c.key === "r" || c.key === "R" || c.code === "KeyR") && c.shiftKey && (c.preventDefault(), i());
1507
+ };
1508
+ return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
1509
+ }, [t, i]);
1510
+ }
1511
+ const br = "review_layer:v1:";
1512
+ function Rr(t, o) {
1513
+ if (t == null) return o;
1514
+ try {
1515
+ return JSON.parse(t) ?? o;
1516
+ } catch {
1517
+ return o;
1518
+ }
1519
+ }
1520
+ function me(t, o, r, i) {
1521
+ const s = `${br}${Sr(t)}:${r}`;
1522
+ return i != null ? `${s}:${i}` : s;
1523
+ }
1524
+ function Sr(t) {
1525
+ return t.replace(/\/+$/, "") || "/";
1526
+ }
1527
+ function rt(t) {
1528
+ if (typeof localStorage > "u") return null;
1529
+ const o = localStorage.getItem(t);
1530
+ return Rr(o, null);
1531
+ }
1532
+ function nt(t, o) {
1533
+ if (!(typeof localStorage > "u"))
1534
+ try {
1535
+ localStorage.setItem(t, JSON.stringify({ data: o, at: Date.now() }));
1536
+ } catch {
1537
+ }
1538
+ }
1539
+ function _e(t, o, r) {
1540
+ const i = rt(me(t, o, "comments", r));
1541
+ return (i == null ? void 0 : i.data) ?? null;
1542
+ }
1543
+ function Cr(t, o, r, i) {
1544
+ nt(me(t, o, "comments", r), i);
1545
+ }
1546
+ function Ue(t, o) {
1547
+ const r = rt(me(t, o, "reviewers"));
1548
+ return (r == null ? void 0 : r.data) ?? null;
1549
+ }
1550
+ function jr(t, o, r) {
1551
+ nt(me(t, o, "reviewers"), r);
1552
+ }
1553
+ function Ze() {
1554
+ return typeof window > "u" ? "/" : window.location.pathname || "/";
1555
+ }
1556
+ const ot = It(null);
1557
+ let Pe = null;
1558
+ function Tr() {
1559
+ const t = Lt(ot);
1560
+ if (!t)
1561
+ throw new Error("useReview must be used within ReviewProvider");
1562
+ return t;
1563
+ }
1564
+ function kr({
1565
+ children: t,
1566
+ enabled: o = !0,
1567
+ apiUrl: r,
1568
+ apiKey: i
1569
+ }) {
1570
+ const [s, c] = L(!1), [v, d] = L([]), [E, b] = L([]), [g, j] = L(!1);
1571
+ wr(o, s, c);
1572
+ const R = I(
1573
+ async (y) => {
1574
+ if (!(!o || !r || !i))
1575
+ try {
1576
+ const f = await Mt(r, i, { signal: y });
1577
+ y != null && y.aborted || (d(f), jr(r, i, f));
1578
+ } catch (f) {
1579
+ if (f instanceof Error && f.name === "AbortError") return;
1580
+ if (!(y != null && y.aborted)) {
1581
+ const p = Ue(r, i);
1582
+ p != null && d(p);
1583
+ }
1584
+ }
1585
+ },
1586
+ [o, r, i]
1587
+ ), _ = I(
1588
+ async (y) => {
1589
+ if (!o || !r || !i) return;
1590
+ const f = Ze(), p = _e(r, i, f);
1591
+ p != null && b(p);
1592
+ try {
1593
+ j(!1);
1594
+ const F = await Vt(r, i, f, { signal: y });
1595
+ y != null && y.aborted || (b(F), Cr(r, i, f, F));
1596
+ } catch (F) {
1597
+ if (F instanceof Error && F.name === "AbortError") return;
1598
+ if (!(y != null && y.aborted)) {
1599
+ j(!0);
1600
+ const X = _e(r, i, f);
1601
+ X != null && b(X);
1602
+ }
1603
+ }
1604
+ },
1605
+ [o, r, i]
1606
+ );
1607
+ N(() => {
1608
+ if (!o || !r || !i) return;
1609
+ const y = Ze(), f = Ue(r, i), p = _e(r, i, y);
1610
+ f != null && d(f), p != null && b(p);
1611
+ }, [o, r, i]), N(() => {
1612
+ if (!o || !r || !i) return;
1613
+ const y = `${r}:${i}`;
1614
+ if (Pe !== y)
1615
+ return Pe = y, R(), _(), () => {
1616
+ setTimeout(() => {
1617
+ Pe = null;
1618
+ }, 0);
1619
+ };
1620
+ }, [o, r, i, R, _]), N(() => {
1621
+ if (!o) return;
1622
+ const y = () => _();
1623
+ return window.addEventListener("popstate", y), () => window.removeEventListener("popstate", y);
1624
+ }, [o, _]);
1625
+ const A = {
1626
+ apiUrl: r,
1627
+ apiKey: i,
1628
+ reviewMode: s,
1629
+ setReviewMode: c,
1630
+ reviewers: v,
1631
+ comments: E,
1632
+ loadComments: _,
1633
+ commentsLoadFailed: g
1634
+ }, O = o && typeof document < "u" ? Ke(
1635
+ /* @__PURE__ */ l.jsx(
1636
+ Er,
1637
+ {
1638
+ apiUrl: r,
1639
+ apiKey: i,
1640
+ reviewMode: s,
1641
+ reviewers: v,
1642
+ comments: E,
1643
+ loadComments: _,
1644
+ commentsLoadFailed: g
1645
+ }
1646
+ ),
1647
+ document.body
1648
+ ) : null;
1649
+ return /* @__PURE__ */ l.jsxs(ot.Provider, { value: A, children: [
1650
+ t,
1651
+ O
1652
+ ] });
1653
+ }
1654
+ export {
1655
+ kr as ReviewProvider,
1656
+ Tr as useReview
1657
+ };
1658
+ //# sourceMappingURL=review-layer-react.js.map