viewgate-wrapper 1.3.5 → 1.4.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.
- package/dist/components/ViewGateOverlay.d.ts.map +1 -1
- package/dist/components/ViewGateProvider.d.ts +14 -0
- package/dist/components/ViewGateProvider.d.ts.map +1 -1
- package/dist/viewgate-wrapper.js +520 -371
- package/dist/viewgate-wrapper.umd.cjs +6 -6
- package/mcp-server/dist/index.js +87 -0
- package/mcp-server/src/index.ts +99 -0
- package/package.json +1 -1
package/dist/viewgate-wrapper.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap";:root{--vg-primary: #2513ec;--vg-primary-gradient: linear-gradient(135deg, #2513ec 0%, #7e3ff2 100%);--vg-glass: rgba(255, 255, 255, .7);--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow: 0 8px 32px 0 rgba(31, 38, 135, .37);--vg-radius: 16px}body{font-family:Inter,system-ui,-apple-system,sans-serif!important;margin:0}.vg-glassmorphism{background:var(--vg-glass);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--vg-glass-border);box-shadow:var(--vg-shadow);border-radius:var(--vg-radius)}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:10px 24px;border-radius:12px;font-weight:600;cursor:pointer;transition:transform .2s,box-shadow .2s;box-shadow:0 4px 12px #2513ec4d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 16px #2513ec66}.vg-button-ghost{background:transparent;color:#444;border:1px solid #ddd;padding:10px 24px;border-radius:12px;cursor:pointer;transition:background .2s}.vg-button-ghost:hover{background:#0000000d}.vg-badge{background:#2513ec1a;color:var(--vg-primary);padding:4px 12px;border-radius:20px;font-size:12px;font-family:JetBrains Mono,monospace;font-weight:700;border:1px solid rgba(37,19,236,.2)}.vg-textarea{width:100%;border:1.5px solid #eee;border-radius:12px;padding:12px;font-family:inherit;color:#0f172a;resize:none;transition:border-color .2s,box-shadow .2s;outline:none}.vg-textarea:focus{border-color:var(--vg-primary);box-shadow:0 0 0 4px #2513ec1a}@keyframes vg-slide-in{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes vg-fade-in{0%{opacity:0}to{opacity:1}}.vg-animate-slide{animation:vg-slide-in .3s cubic-bezier(.16,1,.3,1)}.vg-animate-fade{animation:vg-fade-in .2s ease-out}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px;z-index:100000}.vg-toast{padding:16px 24px;display:flex;align-items:center;gap:12px;min-width:300px}.vg-toast.success{background:#ecfdf5;border:1px solid #10b981;color:#065f46}.vg-toast.error{background:#fef2f2;border:1px solid #ef4444;color:#991b1b}.vg-cursor-pointer *{cursor:pointer!important}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import Ae, { createContext as
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap";:root{--vg-primary: #2513ec;--vg-primary-gradient: linear-gradient(135deg, #2513ec 0%, #7e3ff2 100%);--vg-glass: rgba(255, 255, 255, .7);--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow: 0 8px 32px 0 rgba(31, 38, 135, .37);--vg-radius: 16px}body{font-family:Inter,system-ui,-apple-system,sans-serif!important;margin:0}.vg-glassmorphism{background:var(--vg-glass);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--vg-glass-border);box-shadow:var(--vg-shadow);border-radius:var(--vg-radius)}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:10px 24px;border-radius:12px;font-weight:600;cursor:pointer;transition:transform .2s,box-shadow .2s;box-shadow:0 4px 12px #2513ec4d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 16px #2513ec66}.vg-button-ghost{background:transparent;color:#444;border:1px solid #ddd;padding:10px 24px;border-radius:12px;cursor:pointer;transition:background .2s}.vg-button-ghost:hover{background:#0000000d}.vg-badge{background:#2513ec1a;color:var(--vg-primary);padding:4px 12px;border-radius:20px;font-size:12px;font-family:JetBrains Mono,monospace;font-weight:700;border:1px solid rgba(37,19,236,.2)}.vg-textarea{width:100%;border:1.5px solid #eee;border-radius:12px;padding:12px;font-family:inherit;color:#0f172a;resize:none;transition:border-color .2s,box-shadow .2s;outline:none}.vg-textarea:focus{border-color:var(--vg-primary);box-shadow:0 0 0 4px #2513ec1a}@keyframes vg-slide-in{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes vg-fade-in{0%{opacity:0}to{opacity:1}}.vg-animate-slide{animation:vg-slide-in .3s cubic-bezier(.16,1,.3,1)}.vg-animate-fade{animation:vg-fade-in .2s ease-out}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px;z-index:100000}.vg-toast{padding:16px 24px;display:flex;align-items:center;gap:12px;min-width:300px}.vg-toast.success{background:#ecfdf5;border:1px solid #10b981;color:#065f46}.vg-toast.error{background:#fef2f2;border:1px solid #ef4444;color:#991b1b}.vg-cursor-pointer *{cursor:pointer!important}@keyframes vg-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.vg-spinner{border:4px solid rgba(255,255,255,.3);border-top:4px solid white;border-radius:50%;width:40px;height:40px;animation:vg-spin 1s linear infinite;margin-bottom:16px}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
import Ae, { createContext as Le, useState as S, useContext as $e, useCallback as te, useEffect as ue } from "react";
|
|
3
|
+
var Y = { exports: {} }, D = {};
|
|
4
|
+
var de;
|
|
5
|
+
function Fe() {
|
|
6
|
+
if (de) return D;
|
|
7
|
+
de = 1;
|
|
8
8
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
9
|
function r(n, a, s) {
|
|
10
10
|
var i = null;
|
|
@@ -21,47 +21,47 @@ function Ve() {
|
|
|
21
21
|
props: s
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return D.Fragment = t, D.jsx = r, D.jsxs = r, D;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return
|
|
26
|
+
var N = {};
|
|
27
|
+
var fe;
|
|
28
|
+
function Ge() {
|
|
29
|
+
return fe || (fe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
30
|
function e(o) {
|
|
31
31
|
if (o == null) return null;
|
|
32
32
|
if (typeof o == "function")
|
|
33
|
-
return o.$$typeof ===
|
|
33
|
+
return o.$$typeof === z ? null : o.displayName || o.name || null;
|
|
34
34
|
if (typeof o == "string") return o;
|
|
35
35
|
switch (o) {
|
|
36
|
-
case
|
|
36
|
+
case O:
|
|
37
37
|
return "Fragment";
|
|
38
|
-
case
|
|
38
|
+
case H:
|
|
39
39
|
return "Profiler";
|
|
40
|
-
case
|
|
40
|
+
case k:
|
|
41
41
|
return "StrictMode";
|
|
42
|
-
case
|
|
42
|
+
case W:
|
|
43
43
|
return "Suspense";
|
|
44
|
-
case
|
|
44
|
+
case T:
|
|
45
45
|
return "SuspenseList";
|
|
46
|
-
case
|
|
46
|
+
case K:
|
|
47
47
|
return "Activity";
|
|
48
48
|
}
|
|
49
49
|
if (typeof o == "object")
|
|
50
50
|
switch (typeof o.tag == "number" && console.error(
|
|
51
51
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
52
|
), o.$$typeof) {
|
|
53
|
-
case
|
|
53
|
+
case M:
|
|
54
54
|
return "Portal";
|
|
55
|
-
case
|
|
55
|
+
case X:
|
|
56
56
|
return o.displayName || "Context";
|
|
57
|
-
case
|
|
57
|
+
case F:
|
|
58
58
|
return (o._context.displayName || "Context") + ".Consumer";
|
|
59
|
-
case
|
|
59
|
+
case Z:
|
|
60
60
|
var f = o.render;
|
|
61
61
|
return o = o.displayName, o || (o = f.displayName || f.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
62
|
-
case
|
|
62
|
+
case G:
|
|
63
63
|
return f = o.displayName || null, f !== null ? f : e(o.type) || "Memo";
|
|
64
|
-
case
|
|
64
|
+
case P:
|
|
65
65
|
f = o._payload, o = o._init;
|
|
66
66
|
try {
|
|
67
67
|
return e(o(f));
|
|
@@ -82,17 +82,17 @@ function Ie() {
|
|
|
82
82
|
}
|
|
83
83
|
if (f) {
|
|
84
84
|
f = console;
|
|
85
|
-
var
|
|
86
|
-
return
|
|
85
|
+
var x = f.error, y = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
86
|
+
return x.call(
|
|
87
87
|
f,
|
|
88
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
-
|
|
89
|
+
y
|
|
90
90
|
), t(o);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
function n(o) {
|
|
94
|
-
if (o ===
|
|
95
|
-
if (typeof o == "object" && o !== null && o.$$typeof ===
|
|
94
|
+
if (o === O) return "<>";
|
|
95
|
+
if (typeof o == "object" && o !== null && o.$$typeof === P)
|
|
96
96
|
return "<...>";
|
|
97
97
|
try {
|
|
98
98
|
var f = e(o);
|
|
@@ -102,48 +102,48 @@ function Ie() {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
function a() {
|
|
105
|
-
var o =
|
|
105
|
+
var o = m.A;
|
|
106
106
|
return o === null ? null : o.getOwner();
|
|
107
107
|
}
|
|
108
108
|
function s() {
|
|
109
109
|
return Error("react-stack-top-frame");
|
|
110
110
|
}
|
|
111
111
|
function i(o) {
|
|
112
|
-
if (
|
|
112
|
+
if (h.call(o, "key")) {
|
|
113
113
|
var f = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
114
114
|
if (f && f.isReactWarning) return !1;
|
|
115
115
|
}
|
|
116
116
|
return o.key !== void 0;
|
|
117
117
|
}
|
|
118
118
|
function c(o, f) {
|
|
119
|
-
function
|
|
120
|
-
|
|
119
|
+
function x() {
|
|
120
|
+
I || (I = !0, console.error(
|
|
121
121
|
"%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://react.dev/link/special-props)",
|
|
122
122
|
f
|
|
123
123
|
));
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
get:
|
|
125
|
+
x.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
126
|
+
get: x,
|
|
127
127
|
configurable: !0
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function u() {
|
|
131
131
|
var o = e(this.type);
|
|
132
|
-
return
|
|
132
|
+
return oe[o] || (oe[o] = !0, console.error(
|
|
133
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
134
|
)), o = this.props.ref, o !== void 0 ? o : null;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
var
|
|
136
|
+
function d(o, f, x, y, U, Q) {
|
|
137
|
+
var w = x.ref;
|
|
138
138
|
return o = {
|
|
139
|
-
$$typeof:
|
|
139
|
+
$$typeof: $,
|
|
140
140
|
type: o,
|
|
141
141
|
key: f,
|
|
142
|
-
props:
|
|
143
|
-
_owner:
|
|
144
|
-
}, (
|
|
142
|
+
props: x,
|
|
143
|
+
_owner: y
|
|
144
|
+
}, (w !== void 0 ? w : null) !== null ? Object.defineProperty(o, "ref", {
|
|
145
145
|
enumerable: !1,
|
|
146
|
-
get:
|
|
146
|
+
get: u
|
|
147
147
|
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
148
148
|
configurable: !1,
|
|
149
149
|
enumerable: !1,
|
|
@@ -158,109 +158,109 @@ function Ie() {
|
|
|
158
158
|
configurable: !1,
|
|
159
159
|
enumerable: !1,
|
|
160
160
|
writable: !0,
|
|
161
|
-
value:
|
|
161
|
+
value: U
|
|
162
162
|
}), Object.defineProperty(o, "_debugTask", {
|
|
163
163
|
configurable: !1,
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
writable: !0,
|
|
166
|
-
value:
|
|
166
|
+
value: Q
|
|
167
167
|
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
if (
|
|
174
|
-
for (
|
|
175
|
-
|
|
176
|
-
Object.freeze && Object.freeze(
|
|
169
|
+
function p(o, f, x, y, U, Q) {
|
|
170
|
+
var w = f.children;
|
|
171
|
+
if (w !== void 0)
|
|
172
|
+
if (y)
|
|
173
|
+
if (_(w)) {
|
|
174
|
+
for (y = 0; y < w.length; y++)
|
|
175
|
+
g(w[y]);
|
|
176
|
+
Object.freeze && Object.freeze(w);
|
|
177
177
|
} else
|
|
178
178
|
console.error(
|
|
179
179
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
180
|
);
|
|
181
|
-
else
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
var
|
|
185
|
-
return
|
|
181
|
+
else g(w);
|
|
182
|
+
if (h.call(f, "key")) {
|
|
183
|
+
w = e(o);
|
|
184
|
+
var V = Object.keys(f).filter(function(Ve) {
|
|
185
|
+
return Ve !== "key";
|
|
186
186
|
});
|
|
187
|
-
|
|
187
|
+
y = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", le[w + y] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
189
189
|
let props = %s;
|
|
190
190
|
<%s {...props} />
|
|
191
191
|
React keys must be passed directly to JSX without using spread:
|
|
192
192
|
let props = %s;
|
|
193
193
|
<%s key={someKey} {...props} />`,
|
|
194
|
-
w,
|
|
195
194
|
y,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
w,
|
|
196
|
+
V,
|
|
197
|
+
w
|
|
198
|
+
), le[w + y] = !0);
|
|
199
199
|
}
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
for (var
|
|
203
|
-
|
|
204
|
-
} else
|
|
205
|
-
return
|
|
206
|
-
|
|
200
|
+
if (w = null, x !== void 0 && (r(x), w = "" + x), i(f) && (r(f.key), w = "" + f.key), "key" in f) {
|
|
201
|
+
x = {};
|
|
202
|
+
for (var ee in f)
|
|
203
|
+
ee !== "key" && (x[ee] = f[ee]);
|
|
204
|
+
} else x = f;
|
|
205
|
+
return w && c(
|
|
206
|
+
x,
|
|
207
207
|
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
208
|
-
),
|
|
208
|
+
), d(
|
|
209
209
|
o,
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
w,
|
|
211
|
+
x,
|
|
212
212
|
a(),
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
U,
|
|
214
|
+
Q
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
217
|
+
function g(o) {
|
|
218
|
+
v(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === P && (o._payload.status === "fulfilled" ? v(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return typeof o == "object" && o !== null && o.$$typeof ===
|
|
220
|
+
function v(o) {
|
|
221
|
+
return typeof o == "object" && o !== null && o.$$typeof === $;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
223
|
+
var C = Ae, $ = /* @__PURE__ */ Symbol.for("react.transitional.element"), M = /* @__PURE__ */ Symbol.for("react.portal"), O = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), H = /* @__PURE__ */ Symbol.for("react.profiler"), F = /* @__PURE__ */ Symbol.for("react.consumer"), X = /* @__PURE__ */ Symbol.for("react.context"), Z = /* @__PURE__ */ Symbol.for("react.forward_ref"), W = /* @__PURE__ */ Symbol.for("react.suspense"), T = /* @__PURE__ */ Symbol.for("react.suspense_list"), G = /* @__PURE__ */ Symbol.for("react.memo"), P = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), z = /* @__PURE__ */ Symbol.for("react.client.reference"), m = C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, h = Object.prototype.hasOwnProperty, _ = Array.isArray, j = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
|
-
|
|
226
|
+
C = {
|
|
227
227
|
react_stack_bottom_frame: function(o) {
|
|
228
228
|
return o();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
var
|
|
232
|
-
|
|
231
|
+
var I, oe = {}, ie = C.react_stack_bottom_frame.bind(
|
|
232
|
+
C,
|
|
233
233
|
s
|
|
234
|
-
)(),
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
return
|
|
234
|
+
)(), ce = j(n(s)), le = {};
|
|
235
|
+
N.Fragment = O, N.jsx = function(o, f, x) {
|
|
236
|
+
var y = 1e4 > m.recentlyCreatedOwnerStacks++;
|
|
237
|
+
return p(
|
|
238
238
|
o,
|
|
239
239
|
f,
|
|
240
|
-
|
|
240
|
+
x,
|
|
241
241
|
!1,
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
y ? Error("react-stack-top-frame") : ie,
|
|
243
|
+
y ? j(n(o)) : ce
|
|
244
244
|
);
|
|
245
|
-
},
|
|
246
|
-
var
|
|
247
|
-
return
|
|
245
|
+
}, N.jsxs = function(o, f, x) {
|
|
246
|
+
var y = 1e4 > m.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return p(
|
|
248
248
|
o,
|
|
249
249
|
f,
|
|
250
|
-
|
|
250
|
+
x,
|
|
251
251
|
!0,
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
y ? Error("react-stack-top-frame") : ie,
|
|
253
|
+
y ? j(n(o)) : ce
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
|
-
})()),
|
|
256
|
+
})()), N;
|
|
257
257
|
}
|
|
258
|
-
var
|
|
259
|
-
function
|
|
260
|
-
return
|
|
258
|
+
var me;
|
|
259
|
+
function Ie() {
|
|
260
|
+
return me || (me = 1, process.env.NODE_ENV === "production" ? Y.exports = Fe() : Y.exports = Ge()), Y.exports;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
const
|
|
262
|
+
var l = Ie();
|
|
263
|
+
const De = {
|
|
264
264
|
en: {
|
|
265
265
|
enterMode: "🚀 Enter Feedback Mode",
|
|
266
266
|
exitMode: "✨ Exit Mode",
|
|
@@ -275,7 +275,14 @@ const Me = {
|
|
|
275
275
|
error: "Failed to submit feedback. Check backend connection.",
|
|
276
276
|
successHeader: "Success",
|
|
277
277
|
errorHeader: "Error",
|
|
278
|
-
preview: "Preview"
|
|
278
|
+
preview: "Preview",
|
|
279
|
+
viewComments: "👀 View Comments",
|
|
280
|
+
close: "Close",
|
|
281
|
+
observe: "Observe",
|
|
282
|
+
pending: "Pending",
|
|
283
|
+
readyForReview: "Ready for Review",
|
|
284
|
+
noComments: "No comments found.",
|
|
285
|
+
deleteConfirm: "Are you sure you want to close/delete this comment?"
|
|
279
286
|
},
|
|
280
287
|
es: {
|
|
281
288
|
enterMode: "🚀 Activar Modo Comentarios",
|
|
@@ -291,32 +298,39 @@ const Me = {
|
|
|
291
298
|
error: "Error al enviar comentarios. Revisa la conexión con el servidor.",
|
|
292
299
|
successHeader: "Éxito",
|
|
293
300
|
errorHeader: "Error",
|
|
294
|
-
preview: "Vista previa"
|
|
301
|
+
preview: "Vista previa",
|
|
302
|
+
viewComments: "👀 Ver Comentarios",
|
|
303
|
+
close: "Cerrar",
|
|
304
|
+
observe: "Observar",
|
|
305
|
+
pending: "Pendiente",
|
|
306
|
+
readyForReview: "Lista para revisión",
|
|
307
|
+
noComments: "No hay comentarios.",
|
|
308
|
+
deleteConfirm: "¿Estás seguro de que deseas cerrar y eliminar este comentario?"
|
|
295
309
|
}
|
|
296
|
-
},
|
|
297
|
-
const e =
|
|
310
|
+
}, be = Le(void 0), Ne = () => {
|
|
311
|
+
const e = $e(be);
|
|
298
312
|
if (!e) throw new Error("useViewGate must be used within a ViewGateProvider");
|
|
299
313
|
return e;
|
|
300
|
-
},
|
|
301
|
-
const [a, s] =
|
|
302
|
-
const
|
|
303
|
-
s((
|
|
304
|
-
s((
|
|
314
|
+
}, It = ({ children: e, language: t = "es", apiKey: r, baseUrl: n = "https://view-gate.vercel.app" }) => {
|
|
315
|
+
const [a, s] = S([]), i = (u, d) => {
|
|
316
|
+
const p = Date.now();
|
|
317
|
+
s((g) => [...g, { id: p, message: u, type: d }]), setTimeout(() => {
|
|
318
|
+
s((g) => g.filter((v) => v.id !== p));
|
|
305
319
|
}, 4e3);
|
|
306
|
-
}, c =
|
|
307
|
-
return /* @__PURE__ */
|
|
320
|
+
}, c = De[t];
|
|
321
|
+
return /* @__PURE__ */ l.jsxs(be.Provider, { "data-source-path": "/src/components/ViewGateProvider.tsx:113", value: { addToast: i, language: t, t: c, apiKey: r, baseUrl: n }, children: [
|
|
308
322
|
e,
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ l.jsx(Ft, { "data-source-path": "/src/components/ViewGateProvider.tsx:115" }),
|
|
324
|
+
/* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:116", className: "vg-toasts", children: a.map((u) => /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:118", className: `vg-toast vg-glassmorphism vg-animate-slide ${u.type}`, children: [
|
|
325
|
+
/* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:119", style: { fontSize: "20px" }, children: u.type === "success" ? "✅" : "❌" }),
|
|
326
|
+
/* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:120", children: [
|
|
327
|
+
/* @__PURE__ */ l.jsx("strong", { "data-source-path": "/src/components/ViewGateProvider.tsx:121", style: { display: "block" }, children: u.type === "success" ? c.successHeader : c.errorHeader }),
|
|
328
|
+
/* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:122", style: { fontSize: "14px" }, children: u.message })
|
|
315
329
|
] })
|
|
316
|
-
] },
|
|
330
|
+
] }, u.id)) })
|
|
317
331
|
] });
|
|
318
332
|
};
|
|
319
|
-
function
|
|
333
|
+
function Me(e, t) {
|
|
320
334
|
if (e.match(/^[a-z]+:\/\//i))
|
|
321
335
|
return e;
|
|
322
336
|
if (e.match(/^\/\//))
|
|
@@ -326,7 +340,7 @@ function He(e, t) {
|
|
|
326
340
|
const r = document.implementation.createHTMLDocument(), n = r.createElement("base"), a = r.createElement("a");
|
|
327
341
|
return r.head.appendChild(n), r.body.appendChild(a), t && (n.href = t), a.href = e, a.href;
|
|
328
342
|
}
|
|
329
|
-
const
|
|
343
|
+
const He = /* @__PURE__ */ (() => {
|
|
330
344
|
let e = 0;
|
|
331
345
|
const t = () => (
|
|
332
346
|
// eslint-disable-next-line no-bitwise
|
|
@@ -340,27 +354,27 @@ function R(e) {
|
|
|
340
354
|
t.push(e[r]);
|
|
341
355
|
return t;
|
|
342
356
|
}
|
|
343
|
-
let
|
|
344
|
-
function
|
|
345
|
-
return
|
|
357
|
+
let A = null;
|
|
358
|
+
function Ee(e = {}) {
|
|
359
|
+
return A || (e.includeStyleProperties ? (A = e.includeStyleProperties, A) : (A = R(window.getComputedStyle(document.documentElement)), A));
|
|
346
360
|
}
|
|
347
|
-
function
|
|
361
|
+
function q(e, t) {
|
|
348
362
|
const n = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
|
|
349
363
|
return n ? parseFloat(n.replace("px", "")) : 0;
|
|
350
364
|
}
|
|
351
|
-
function
|
|
352
|
-
const t =
|
|
365
|
+
function We(e) {
|
|
366
|
+
const t = q(e, "border-left-width"), r = q(e, "border-right-width");
|
|
353
367
|
return e.clientWidth + t + r;
|
|
354
368
|
}
|
|
355
|
-
function
|
|
356
|
-
const t =
|
|
369
|
+
function ze(e) {
|
|
370
|
+
const t = q(e, "border-top-width"), r = q(e, "border-bottom-width");
|
|
357
371
|
return e.clientHeight + t + r;
|
|
358
372
|
}
|
|
359
|
-
function
|
|
360
|
-
const r = t.width ||
|
|
373
|
+
function Se(e, t = {}) {
|
|
374
|
+
const r = t.width || We(e), n = t.height || ze(e);
|
|
361
375
|
return { width: r, height: n };
|
|
362
376
|
}
|
|
363
|
-
function
|
|
377
|
+
function Ue() {
|
|
364
378
|
let e, t;
|
|
365
379
|
try {
|
|
366
380
|
t = process;
|
|
@@ -373,7 +387,7 @@ const E = 16384;
|
|
|
373
387
|
function Ye(e) {
|
|
374
388
|
(e.width > E || e.height > E) && (e.width > E && e.height > E ? e.width > e.height ? (e.height *= E / e.width, e.width = E) : (e.width *= E / e.height, e.height = E) : e.width > E ? (e.height *= E / e.width, e.width = E) : (e.width *= E / e.height, e.height = E));
|
|
375
389
|
}
|
|
376
|
-
function
|
|
390
|
+
function B(e) {
|
|
377
391
|
return new Promise((t, r) => {
|
|
378
392
|
const n = new Image();
|
|
379
393
|
n.onload = () => {
|
|
@@ -390,18 +404,18 @@ async function Be(e, t, r) {
|
|
|
390
404
|
const n = "http://www.w3.org/2000/svg", a = document.createElementNS(n, "svg"), s = document.createElementNS(n, "foreignObject");
|
|
391
405
|
return a.setAttribute("width", `${t}`), a.setAttribute("height", `${r}`), a.setAttribute("viewBox", `0 0 ${t} ${r}`), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("x", "0"), s.setAttribute("y", "0"), s.setAttribute("externalResourcesRequired", "true"), a.appendChild(s), s.appendChild(e), qe(a);
|
|
392
406
|
}
|
|
393
|
-
const
|
|
407
|
+
const b = (e, t) => {
|
|
394
408
|
if (e instanceof t)
|
|
395
409
|
return !0;
|
|
396
410
|
const r = Object.getPrototypeOf(e);
|
|
397
|
-
return r === null ? !1 : r.constructor.name === t.name ||
|
|
411
|
+
return r === null ? !1 : r.constructor.name === t.name || b(r, t);
|
|
398
412
|
};
|
|
399
413
|
function Je(e) {
|
|
400
414
|
const t = e.getPropertyValue("content");
|
|
401
415
|
return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
|
|
402
416
|
}
|
|
403
417
|
function Xe(e, t) {
|
|
404
|
-
return
|
|
418
|
+
return Ee(t).map((r) => {
|
|
405
419
|
const n = e.getPropertyValue(r), a = e.getPropertyPriority(r);
|
|
406
420
|
return `${r}: ${n}${a ? " !important" : ""};`;
|
|
407
421
|
}).join(" ");
|
|
@@ -410,11 +424,11 @@ function Ze(e, t, r, n) {
|
|
|
410
424
|
const a = `.${e}:${t}`, s = r.cssText ? Je(r) : Xe(r, n);
|
|
411
425
|
return document.createTextNode(`${a}{${s}}`);
|
|
412
426
|
}
|
|
413
|
-
function
|
|
427
|
+
function pe(e, t, r, n) {
|
|
414
428
|
const a = window.getComputedStyle(e, r), s = a.getPropertyValue("content");
|
|
415
429
|
if (s === "" || s === "none")
|
|
416
430
|
return;
|
|
417
|
-
const i =
|
|
431
|
+
const i = He();
|
|
418
432
|
try {
|
|
419
433
|
t.className = `${t.className} ${i}`;
|
|
420
434
|
} catch {
|
|
@@ -424,16 +438,16 @@ function ue(e, t, r, n) {
|
|
|
424
438
|
c.appendChild(Ze(i, r, a, n)), t.appendChild(c);
|
|
425
439
|
}
|
|
426
440
|
function Ke(e, t, r) {
|
|
427
|
-
|
|
441
|
+
pe(e, t, ":before", r), pe(e, t, ":after", r);
|
|
428
442
|
}
|
|
429
|
-
const
|
|
430
|
-
woff:
|
|
431
|
-
woff2:
|
|
443
|
+
const he = "application/font-woff", ge = "image/jpeg", Qe = {
|
|
444
|
+
woff: he,
|
|
445
|
+
woff2: he,
|
|
432
446
|
ttf: "application/font-truetype",
|
|
433
447
|
eot: "application/vnd.ms-fontobject",
|
|
434
448
|
png: "image/png",
|
|
435
|
-
jpg:
|
|
436
|
-
jpeg:
|
|
449
|
+
jpg: ge,
|
|
450
|
+
jpeg: ge,
|
|
437
451
|
gif: "image/gif",
|
|
438
452
|
tiff: "image/tiff",
|
|
439
453
|
svg: "image/svg+xml",
|
|
@@ -443,20 +457,20 @@ function et(e) {
|
|
|
443
457
|
const t = /\.([^./]*?)$/g.exec(e);
|
|
444
458
|
return t ? t[1] : "";
|
|
445
459
|
}
|
|
446
|
-
function
|
|
460
|
+
function se(e) {
|
|
447
461
|
const t = et(e).toLowerCase();
|
|
448
462
|
return Qe[t] || "";
|
|
449
463
|
}
|
|
450
464
|
function tt(e) {
|
|
451
465
|
return e.split(/,/)[1];
|
|
452
466
|
}
|
|
453
|
-
function
|
|
467
|
+
function ne(e) {
|
|
454
468
|
return e.search(/^(data:)/) !== -1;
|
|
455
469
|
}
|
|
456
470
|
function rt(e, t) {
|
|
457
471
|
return `data:${t};base64,${e}`;
|
|
458
472
|
}
|
|
459
|
-
async function
|
|
473
|
+
async function Ce(e, t, r) {
|
|
460
474
|
const n = await fetch(e, t);
|
|
461
475
|
if (n.status === 404)
|
|
462
476
|
throw new Error(`Resource "${n.url}" not found`);
|
|
@@ -466,67 +480,67 @@ async function be(e, t, r) {
|
|
|
466
480
|
c.onerror = i, c.onloadend = () => {
|
|
467
481
|
try {
|
|
468
482
|
s(r({ res: n, result: c.result }));
|
|
469
|
-
} catch (
|
|
470
|
-
i(
|
|
483
|
+
} catch (u) {
|
|
484
|
+
i(u);
|
|
471
485
|
}
|
|
472
486
|
}, c.readAsDataURL(a);
|
|
473
487
|
});
|
|
474
488
|
}
|
|
475
|
-
const
|
|
489
|
+
const re = {};
|
|
476
490
|
function nt(e, t, r) {
|
|
477
491
|
let n = e.replace(/\?.*/, "");
|
|
478
492
|
return r && (n = e), /ttf|otf|eot|woff2?/i.test(n) && (n = n.replace(/.*\//, "")), t ? `[${t}]${n}` : n;
|
|
479
493
|
}
|
|
480
|
-
async function
|
|
494
|
+
async function ae(e, t, r) {
|
|
481
495
|
const n = nt(e, t, r.includeQueryParams);
|
|
482
|
-
if (
|
|
483
|
-
return
|
|
496
|
+
if (re[n] != null)
|
|
497
|
+
return re[n];
|
|
484
498
|
r.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
485
499
|
let a;
|
|
486
500
|
try {
|
|
487
|
-
const s = await
|
|
501
|
+
const s = await Ce(e, r.fetchRequestInit, ({ res: i, result: c }) => (t || (t = i.headers.get("Content-Type") || ""), tt(c)));
|
|
488
502
|
a = rt(s, t);
|
|
489
503
|
} catch (s) {
|
|
490
504
|
a = r.imagePlaceholder || "";
|
|
491
505
|
let i = `Failed to fetch resource: ${e}`;
|
|
492
506
|
s && (i = typeof s == "string" ? s : s.message), i && console.warn(i);
|
|
493
507
|
}
|
|
494
|
-
return
|
|
508
|
+
return re[n] = a, a;
|
|
495
509
|
}
|
|
496
510
|
async function st(e) {
|
|
497
511
|
const t = e.toDataURL();
|
|
498
|
-
return t === "data:," ? e.cloneNode(!1) :
|
|
512
|
+
return t === "data:," ? e.cloneNode(!1) : B(t);
|
|
499
513
|
}
|
|
500
514
|
async function at(e, t) {
|
|
501
515
|
if (e.currentSrc) {
|
|
502
516
|
const s = document.createElement("canvas"), i = s.getContext("2d");
|
|
503
517
|
s.width = e.clientWidth, s.height = e.clientHeight, i?.drawImage(e, 0, 0, s.width, s.height);
|
|
504
518
|
const c = s.toDataURL();
|
|
505
|
-
return
|
|
519
|
+
return B(c);
|
|
506
520
|
}
|
|
507
|
-
const r = e.poster, n =
|
|
508
|
-
return
|
|
521
|
+
const r = e.poster, n = se(r), a = await ae(r, n, t);
|
|
522
|
+
return B(a);
|
|
509
523
|
}
|
|
510
524
|
async function ot(e, t) {
|
|
511
525
|
var r;
|
|
512
526
|
try {
|
|
513
527
|
if (!((r = e?.contentDocument) === null || r === void 0) && r.body)
|
|
514
|
-
return await
|
|
528
|
+
return await J(e.contentDocument.body, t, !0);
|
|
515
529
|
} catch {
|
|
516
530
|
}
|
|
517
531
|
return e.cloneNode(!1);
|
|
518
532
|
}
|
|
519
533
|
async function it(e, t) {
|
|
520
|
-
return
|
|
534
|
+
return b(e, HTMLCanvasElement) ? st(e) : b(e, HTMLVideoElement) ? at(e, t) : b(e, HTMLIFrameElement) ? ot(e, t) : e.cloneNode(Re(e));
|
|
521
535
|
}
|
|
522
|
-
const ct = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT",
|
|
536
|
+
const ct = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Re = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
|
|
523
537
|
async function lt(e, t, r) {
|
|
524
538
|
var n, a;
|
|
525
|
-
if (
|
|
539
|
+
if (Re(t))
|
|
526
540
|
return t;
|
|
527
541
|
let s = [];
|
|
528
|
-
return ct(e) && e.assignedNodes ? s = R(e.assignedNodes()) :
|
|
529
|
-
|
|
542
|
+
return ct(e) && e.assignedNodes ? s = R(e.assignedNodes()) : b(e, HTMLIFrameElement) && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? s = R(e.contentDocument.body.childNodes) : s = R(((a = e.shadowRoot) !== null && a !== void 0 ? a : e).childNodes), s.length === 0 || b(e, HTMLVideoElement) || await s.reduce((i, c) => i.then(() => J(c, r)).then((u) => {
|
|
543
|
+
u && t.appendChild(u);
|
|
530
544
|
}), Promise.resolve()), t;
|
|
531
545
|
}
|
|
532
546
|
function ut(e, t, r) {
|
|
@@ -534,24 +548,24 @@ function ut(e, t, r) {
|
|
|
534
548
|
if (!n)
|
|
535
549
|
return;
|
|
536
550
|
const a = window.getComputedStyle(e);
|
|
537
|
-
a.cssText ? (n.cssText = a.cssText, n.transformOrigin = a.transformOrigin) :
|
|
551
|
+
a.cssText ? (n.cssText = a.cssText, n.transformOrigin = a.transformOrigin) : Ee(r).forEach((s) => {
|
|
538
552
|
let i = a.getPropertyValue(s);
|
|
539
|
-
s === "font-size" && i.endsWith("px") && (i = `${Math.floor(parseFloat(i.substring(0, i.length - 2))) - 0.1}px`),
|
|
553
|
+
s === "font-size" && i.endsWith("px") && (i = `${Math.floor(parseFloat(i.substring(0, i.length - 2))) - 0.1}px`), b(e, HTMLIFrameElement) && s === "display" && i === "inline" && (i = "block"), s === "d" && t.getAttribute("d") && (i = `path(${t.getAttribute("d")})`), n.setProperty(s, i, a.getPropertyPriority(s));
|
|
540
554
|
});
|
|
541
555
|
}
|
|
542
|
-
function ft(e, t) {
|
|
543
|
-
v(e, HTMLTextAreaElement) && (t.innerHTML = e.value), v(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
544
|
-
}
|
|
545
556
|
function dt(e, t) {
|
|
546
|
-
|
|
557
|
+
b(e, HTMLTextAreaElement) && (t.innerHTML = e.value), b(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
558
|
+
}
|
|
559
|
+
function ft(e, t) {
|
|
560
|
+
if (b(e, HTMLSelectElement)) {
|
|
547
561
|
const n = Array.from(t.children).find((a) => e.value === a.getAttribute("value"));
|
|
548
562
|
n && n.setAttribute("selected", "");
|
|
549
563
|
}
|
|
550
564
|
}
|
|
551
565
|
function mt(e, t, r) {
|
|
552
|
-
return
|
|
566
|
+
return b(t, Element) && (ut(e, t, r), Ke(e, t, r), dt(e, t), ft(e, t)), t;
|
|
553
567
|
}
|
|
554
|
-
async function
|
|
568
|
+
async function pt(e, t) {
|
|
555
569
|
const r = e.querySelectorAll ? e.querySelectorAll("use") : [];
|
|
556
570
|
if (r.length === 0)
|
|
557
571
|
return e;
|
|
@@ -559,8 +573,8 @@ async function ht(e, t) {
|
|
|
559
573
|
for (let s = 0; s < r.length; s++) {
|
|
560
574
|
const c = r[s].getAttribute("xlink:href");
|
|
561
575
|
if (c) {
|
|
562
|
-
const
|
|
563
|
-
!
|
|
576
|
+
const u = e.querySelector(c), d = document.querySelector(c);
|
|
577
|
+
!u && d && !n[c] && (n[c] = await J(d, t, !0));
|
|
564
578
|
}
|
|
565
579
|
}
|
|
566
580
|
const a = Object.values(n);
|
|
@@ -569,37 +583,37 @@ async function ht(e, t) {
|
|
|
569
583
|
i.setAttribute("xmlns", s), i.style.position = "absolute", i.style.width = "0", i.style.height = "0", i.style.overflow = "hidden", i.style.display = "none";
|
|
570
584
|
const c = document.createElementNS(s, "defs");
|
|
571
585
|
i.appendChild(c);
|
|
572
|
-
for (let
|
|
573
|
-
c.appendChild(a[
|
|
586
|
+
for (let u = 0; u < a.length; u++)
|
|
587
|
+
c.appendChild(a[u]);
|
|
574
588
|
e.appendChild(i);
|
|
575
589
|
}
|
|
576
590
|
return e;
|
|
577
591
|
}
|
|
578
|
-
async function
|
|
579
|
-
return !r && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((n) => it(n, t)).then((n) => lt(e, n, t)).then((n) => mt(e, n, t)).then((n) =>
|
|
592
|
+
async function J(e, t, r) {
|
|
593
|
+
return !r && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((n) => it(n, t)).then((n) => lt(e, n, t)).then((n) => mt(e, n, t)).then((n) => pt(n, t));
|
|
580
594
|
}
|
|
581
|
-
const
|
|
582
|
-
function
|
|
595
|
+
const ke = /url\((['"]?)([^'"]+?)\1\)/g, ht = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, gt = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
596
|
+
function xt(e) {
|
|
583
597
|
const t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
|
|
584
598
|
return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
|
|
585
599
|
}
|
|
586
600
|
function yt(e) {
|
|
587
601
|
const t = [];
|
|
588
|
-
return e.replace(
|
|
602
|
+
return e.replace(ke, (r, n, a) => (t.push(a), r)), t.filter((r) => !ne(r));
|
|
589
603
|
}
|
|
590
|
-
async function
|
|
604
|
+
async function wt(e, t, r, n, a) {
|
|
591
605
|
try {
|
|
592
|
-
const s = r ?
|
|
606
|
+
const s = r ? Me(t, r) : t, i = se(t);
|
|
593
607
|
let c;
|
|
594
|
-
return a || (c = await
|
|
608
|
+
return a || (c = await ae(s, i, n)), e.replace(xt(t), `$1${c}$3`);
|
|
595
609
|
} catch {
|
|
596
610
|
}
|
|
597
611
|
return e;
|
|
598
612
|
}
|
|
599
|
-
function
|
|
613
|
+
function vt(e, { preferredFontFormat: t }) {
|
|
600
614
|
return t ? e.replace(gt, (r) => {
|
|
601
615
|
for (; ; ) {
|
|
602
|
-
const [n, , a] =
|
|
616
|
+
const [n, , a] = ht.exec(r) || [];
|
|
603
617
|
if (!a)
|
|
604
618
|
return "";
|
|
605
619
|
if (a === t)
|
|
@@ -607,38 +621,38 @@ function bt(e, { preferredFontFormat: t }) {
|
|
|
607
621
|
}
|
|
608
622
|
}) : e;
|
|
609
623
|
}
|
|
610
|
-
function
|
|
611
|
-
return e.search(
|
|
624
|
+
function Te(e) {
|
|
625
|
+
return e.search(ke) !== -1;
|
|
612
626
|
}
|
|
613
|
-
async function
|
|
614
|
-
if (!
|
|
627
|
+
async function Pe(e, t, r) {
|
|
628
|
+
if (!Te(e))
|
|
615
629
|
return e;
|
|
616
|
-
const n =
|
|
617
|
-
return yt(n).reduce((s, i) => s.then((c) =>
|
|
630
|
+
const n = vt(e, r);
|
|
631
|
+
return yt(n).reduce((s, i) => s.then((c) => wt(c, i, t, r)), Promise.resolve(n));
|
|
618
632
|
}
|
|
619
|
-
async function
|
|
633
|
+
async function L(e, t, r) {
|
|
620
634
|
var n;
|
|
621
635
|
const a = (n = t.style) === null || n === void 0 ? void 0 : n.getPropertyValue(e);
|
|
622
636
|
if (a) {
|
|
623
|
-
const s = await
|
|
637
|
+
const s = await Pe(a, null, r);
|
|
624
638
|
return t.style.setProperty(e, s, t.style.getPropertyPriority(e)), !0;
|
|
625
639
|
}
|
|
626
640
|
return !1;
|
|
627
641
|
}
|
|
628
|
-
async function
|
|
629
|
-
await
|
|
642
|
+
async function bt(e, t) {
|
|
643
|
+
await L("background", e, t) || await L("background-image", e, t), await L("mask", e, t) || await L("-webkit-mask", e, t) || await L("mask-image", e, t) || await L("-webkit-mask-image", e, t);
|
|
630
644
|
}
|
|
631
645
|
async function Et(e, t) {
|
|
632
|
-
const r =
|
|
633
|
-
if (!(r && !
|
|
646
|
+
const r = b(e, HTMLImageElement);
|
|
647
|
+
if (!(r && !ne(e.src)) && !(b(e, SVGImageElement) && !ne(e.href.baseVal)))
|
|
634
648
|
return;
|
|
635
|
-
const n = r ? e.src : e.href.baseVal, a = await
|
|
649
|
+
const n = r ? e.src : e.href.baseVal, a = await ae(n, se(n), t);
|
|
636
650
|
await new Promise((s, i) => {
|
|
637
|
-
e.onload = s, e.onerror = t.onImageErrorHandler ? (...
|
|
651
|
+
e.onload = s, e.onerror = t.onImageErrorHandler ? (...u) => {
|
|
638
652
|
try {
|
|
639
|
-
s(t.onImageErrorHandler(...
|
|
640
|
-
} catch (
|
|
641
|
-
i(
|
|
653
|
+
s(t.onImageErrorHandler(...u));
|
|
654
|
+
} catch (d) {
|
|
655
|
+
i(d);
|
|
642
656
|
}
|
|
643
657
|
} : i;
|
|
644
658
|
const c = e;
|
|
@@ -646,13 +660,13 @@ async function Et(e, t) {
|
|
|
646
660
|
});
|
|
647
661
|
}
|
|
648
662
|
async function St(e, t) {
|
|
649
|
-
const n = R(e.childNodes).map((a) =>
|
|
663
|
+
const n = R(e.childNodes).map((a) => je(a, t));
|
|
650
664
|
await Promise.all(n).then(() => e);
|
|
651
665
|
}
|
|
652
|
-
async function
|
|
653
|
-
|
|
666
|
+
async function je(e, t) {
|
|
667
|
+
b(e, Element) && (await bt(e, t), await Et(e, t), await St(e, t));
|
|
654
668
|
}
|
|
655
|
-
function
|
|
669
|
+
function Ct(e, t) {
|
|
656
670
|
const { style: r } = e;
|
|
657
671
|
t.backgroundColor && (r.backgroundColor = t.backgroundColor), t.width && (r.width = `${t.width}px`), t.height && (r.height = `${t.height}px`);
|
|
658
672
|
const n = t.style;
|
|
@@ -660,49 +674,49 @@ function Rt(e, t) {
|
|
|
660
674
|
r[a] = n[a];
|
|
661
675
|
}), e;
|
|
662
676
|
}
|
|
663
|
-
const
|
|
664
|
-
async function
|
|
665
|
-
let t =
|
|
677
|
+
const xe = {};
|
|
678
|
+
async function ye(e) {
|
|
679
|
+
let t = xe[e];
|
|
666
680
|
if (t != null)
|
|
667
681
|
return t;
|
|
668
682
|
const n = await (await fetch(e)).text();
|
|
669
|
-
return t = { url: e, cssText: n },
|
|
683
|
+
return t = { url: e, cssText: n }, xe[e] = t, t;
|
|
670
684
|
}
|
|
671
|
-
async function
|
|
685
|
+
async function we(e, t) {
|
|
672
686
|
let r = e.cssText;
|
|
673
687
|
const n = /url\(["']?([^"')]+)["']?\)/g, s = (r.match(/url\([^)]+\)/g) || []).map(async (i) => {
|
|
674
688
|
let c = i.replace(n, "$1");
|
|
675
|
-
return c.startsWith("https://") || (c = new URL(c, e.url).href),
|
|
689
|
+
return c.startsWith("https://") || (c = new URL(c, e.url).href), Ce(c, t.fetchRequestInit, ({ result: u }) => (r = r.replace(i, `url(${u})`), [i, u]));
|
|
676
690
|
});
|
|
677
691
|
return Promise.all(s).then(() => r);
|
|
678
692
|
}
|
|
679
|
-
function
|
|
693
|
+
function ve(e) {
|
|
680
694
|
if (e == null)
|
|
681
695
|
return [];
|
|
682
696
|
const t = [], r = /(\/\*[\s\S]*?\*\/)/gi;
|
|
683
697
|
let n = e.replace(r, "");
|
|
684
698
|
const a = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
|
|
685
699
|
for (; ; ) {
|
|
686
|
-
const
|
|
687
|
-
if (
|
|
700
|
+
const u = a.exec(n);
|
|
701
|
+
if (u === null)
|
|
688
702
|
break;
|
|
689
|
-
t.push(
|
|
703
|
+
t.push(u[0]);
|
|
690
704
|
}
|
|
691
705
|
n = n.replace(a, "");
|
|
692
706
|
const s = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, i = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", c = new RegExp(i, "gi");
|
|
693
707
|
for (; ; ) {
|
|
694
|
-
let
|
|
695
|
-
if (
|
|
696
|
-
if (
|
|
708
|
+
let u = s.exec(n);
|
|
709
|
+
if (u === null) {
|
|
710
|
+
if (u = c.exec(n), u === null)
|
|
697
711
|
break;
|
|
698
712
|
s.lastIndex = c.lastIndex;
|
|
699
713
|
} else
|
|
700
714
|
c.lastIndex = s.lastIndex;
|
|
701
|
-
t.push(
|
|
715
|
+
t.push(u[0]);
|
|
702
716
|
}
|
|
703
717
|
return t;
|
|
704
718
|
}
|
|
705
|
-
async function
|
|
719
|
+
async function Rt(e, t) {
|
|
706
720
|
const r = [], n = [];
|
|
707
721
|
return e.forEach((a) => {
|
|
708
722
|
if ("cssRules" in a)
|
|
@@ -710,25 +724,25 @@ async function Ct(e, t) {
|
|
|
710
724
|
R(a.cssRules || []).forEach((s, i) => {
|
|
711
725
|
if (s.type === CSSRule.IMPORT_RULE) {
|
|
712
726
|
let c = i + 1;
|
|
713
|
-
const
|
|
727
|
+
const u = s.href, d = ye(u).then((p) => we(p, t)).then((p) => ve(p).forEach((g) => {
|
|
714
728
|
try {
|
|
715
|
-
a.insertRule(
|
|
716
|
-
} catch (
|
|
729
|
+
a.insertRule(g, g.startsWith("@import") ? c += 1 : a.cssRules.length);
|
|
730
|
+
} catch (v) {
|
|
717
731
|
console.error("Error inserting rule from remote css", {
|
|
718
|
-
rule:
|
|
719
|
-
error:
|
|
732
|
+
rule: g,
|
|
733
|
+
error: v
|
|
720
734
|
});
|
|
721
735
|
}
|
|
722
|
-
})).catch((
|
|
723
|
-
console.error("Error loading remote css",
|
|
736
|
+
})).catch((p) => {
|
|
737
|
+
console.error("Error loading remote css", p.toString());
|
|
724
738
|
});
|
|
725
|
-
n.push(
|
|
739
|
+
n.push(d);
|
|
726
740
|
}
|
|
727
741
|
});
|
|
728
742
|
} catch (s) {
|
|
729
743
|
const i = e.find((c) => c.href == null) || document.styleSheets[0];
|
|
730
|
-
a.href != null && n.push(
|
|
731
|
-
i.insertRule(
|
|
744
|
+
a.href != null && n.push(ye(a.href).then((c) => we(c, t)).then((c) => ve(c).forEach((u) => {
|
|
745
|
+
i.insertRule(u, i.cssRules.length);
|
|
732
746
|
})).catch((c) => {
|
|
733
747
|
console.error("Error loading remote stylesheet", c);
|
|
734
748
|
})), console.error("Error inlining remote css file", s);
|
|
@@ -744,54 +758,54 @@ async function Ct(e, t) {
|
|
|
744
758
|
}
|
|
745
759
|
}), r));
|
|
746
760
|
}
|
|
747
|
-
function
|
|
748
|
-
return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) =>
|
|
761
|
+
function kt(e) {
|
|
762
|
+
return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Te(t.style.getPropertyValue("src")));
|
|
749
763
|
}
|
|
750
|
-
async function
|
|
764
|
+
async function Tt(e, t) {
|
|
751
765
|
if (e.ownerDocument == null)
|
|
752
766
|
throw new Error("Provided element is not within a Document");
|
|
753
|
-
const r = R(e.ownerDocument.styleSheets), n = await
|
|
754
|
-
return
|
|
767
|
+
const r = R(e.ownerDocument.styleSheets), n = await Rt(r, t);
|
|
768
|
+
return kt(n);
|
|
755
769
|
}
|
|
756
|
-
function
|
|
770
|
+
function Oe(e) {
|
|
757
771
|
return e.trim().replace(/["']/g, "");
|
|
758
772
|
}
|
|
759
|
-
function
|
|
773
|
+
function Pt(e) {
|
|
760
774
|
const t = /* @__PURE__ */ new Set();
|
|
761
775
|
function r(n) {
|
|
762
776
|
(n.style.fontFamily || getComputedStyle(n).fontFamily).split(",").forEach((s) => {
|
|
763
|
-
t.add(
|
|
777
|
+
t.add(Oe(s));
|
|
764
778
|
}), Array.from(n.children).forEach((s) => {
|
|
765
779
|
s instanceof HTMLElement && r(s);
|
|
766
780
|
});
|
|
767
781
|
}
|
|
768
782
|
return r(e), t;
|
|
769
783
|
}
|
|
770
|
-
async function
|
|
771
|
-
const r = await
|
|
772
|
-
return (await Promise.all(r.filter((s) => n.has(
|
|
784
|
+
async function jt(e, t) {
|
|
785
|
+
const r = await Tt(e, t), n = Pt(e);
|
|
786
|
+
return (await Promise.all(r.filter((s) => n.has(Oe(s.style.fontFamily))).map((s) => {
|
|
773
787
|
const i = s.parentStyleSheet ? s.parentStyleSheet.href : null;
|
|
774
|
-
return
|
|
788
|
+
return Pe(s.cssText, i, t);
|
|
775
789
|
}))).join(`
|
|
776
790
|
`);
|
|
777
791
|
}
|
|
778
|
-
async function
|
|
779
|
-
const r = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await
|
|
792
|
+
async function Ot(e, t) {
|
|
793
|
+
const r = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await jt(e, t);
|
|
780
794
|
if (r) {
|
|
781
795
|
const n = document.createElement("style"), a = document.createTextNode(r);
|
|
782
796
|
n.appendChild(a), e.firstChild ? e.insertBefore(n, e.firstChild) : e.appendChild(n);
|
|
783
797
|
}
|
|
784
798
|
}
|
|
785
|
-
async function
|
|
786
|
-
const { width: r, height: n } =
|
|
787
|
-
return await
|
|
799
|
+
async function _t(e, t = {}) {
|
|
800
|
+
const { width: r, height: n } = Se(e, t), a = await J(e, t, !0);
|
|
801
|
+
return await Ot(a, t), await je(a, t), Ct(a, t), await Be(a, r, n);
|
|
788
802
|
}
|
|
789
|
-
async function
|
|
790
|
-
const { width: r, height: n } =
|
|
791
|
-
return i.width =
|
|
803
|
+
async function Vt(e, t = {}) {
|
|
804
|
+
const { width: r, height: n } = Se(e, t), a = await _t(e, t), s = await B(a), i = document.createElement("canvas"), c = i.getContext("2d"), u = t.pixelRatio || Ue(), d = t.canvasWidth || r, p = t.canvasHeight || n;
|
|
805
|
+
return i.width = d * u, i.height = p * u, t.skipAutoScale || Ye(i), i.style.width = `${d}`, i.style.height = `${p}`, t.backgroundColor && (c.fillStyle = t.backgroundColor, c.fillRect(0, 0, i.width, i.height)), c.drawImage(s, 0, 0, i.width, i.height), i;
|
|
792
806
|
}
|
|
793
|
-
async function
|
|
794
|
-
return (await
|
|
807
|
+
async function At(e, t = {}) {
|
|
808
|
+
return (await Vt(e, t)).toDataURL();
|
|
795
809
|
}
|
|
796
810
|
const Lt = (e) => {
|
|
797
811
|
const r = Object.keys(e).find((s) => s.startsWith("__reactFiber$") || s.startsWith("__reactInternalInstance$"));
|
|
@@ -807,24 +821,24 @@ const Lt = (e) => {
|
|
|
807
821
|
a = a.return;
|
|
808
822
|
}
|
|
809
823
|
return n.join(" > ") || "Generic Component";
|
|
810
|
-
},
|
|
824
|
+
}, $t = (e) => {
|
|
811
825
|
const t = e.getAttribute("data-source-path") || "unknown:0", r = Lt(e), a = ((c) => {
|
|
812
|
-
const
|
|
813
|
-
let
|
|
814
|
-
for (;
|
|
815
|
-
let
|
|
816
|
-
if (
|
|
817
|
-
|
|
826
|
+
const u = [];
|
|
827
|
+
let d = c;
|
|
828
|
+
for (; d && d.nodeType === Node.ELEMENT_NODE; ) {
|
|
829
|
+
let p = d.nodeName.toLowerCase();
|
|
830
|
+
if (d.id) {
|
|
831
|
+
p += "#" + d.id, u.unshift(p);
|
|
818
832
|
break;
|
|
819
833
|
} else {
|
|
820
|
-
let
|
|
821
|
-
for (;
|
|
822
|
-
|
|
823
|
-
|
|
834
|
+
let g = d, v = 1;
|
|
835
|
+
for (; g.previousElementSibling; )
|
|
836
|
+
g = g.previousElementSibling, g.nodeName.toLowerCase() === p && v++;
|
|
837
|
+
v > 1 && (p += `:nth-of-type(${v})`);
|
|
824
838
|
}
|
|
825
|
-
|
|
839
|
+
u.unshift(p), d = d.parentElement;
|
|
826
840
|
}
|
|
827
|
-
return
|
|
841
|
+
return u.join(" > ");
|
|
828
842
|
})(e), s = (e.innerText || "").slice(0, 50).trim(), i = `${e.tagName.toLowerCase()}-${s.replace(/\s+/g, "_")}-${a.split(" > ").slice(-2).join("_")}`;
|
|
829
843
|
return {
|
|
830
844
|
tag: e.tagName.toLowerCase(),
|
|
@@ -838,29 +852,50 @@ const Lt = (e) => {
|
|
|
838
852
|
signature: i,
|
|
839
853
|
source: t
|
|
840
854
|
};
|
|
841
|
-
},
|
|
842
|
-
const { addToast: e, language: t, t: r, apiKey: n, baseUrl: a } =
|
|
843
|
-
if (
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
855
|
+
}, Ft = () => {
|
|
856
|
+
const { addToast: e, language: t, t: r, apiKey: n, baseUrl: a } = Ne(), [s, i] = S(!1), [c, u] = S(null), [d, p] = S(null), [g, v] = S(""), [C, $] = S(!1), [M, O] = S(!1), [k, H] = S(!1), [F, X] = S([]), [Z, W] = S(!1), T = te(async () => {
|
|
857
|
+
if (n) {
|
|
858
|
+
W(!0);
|
|
859
|
+
try {
|
|
860
|
+
const m = await fetch(`${a}/api/annotations`, {
|
|
861
|
+
headers: { "x-api-key": n }
|
|
862
|
+
});
|
|
863
|
+
if (m.ok) {
|
|
864
|
+
const h = await m.json();
|
|
865
|
+
X(h);
|
|
866
|
+
}
|
|
867
|
+
} catch (m) {
|
|
868
|
+
console.error("Failed to fetch annotations", m);
|
|
869
|
+
} finally {
|
|
870
|
+
W(!1);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}, [n, a]);
|
|
874
|
+
ue(() => {
|
|
875
|
+
(s || k) && T();
|
|
876
|
+
}, [s, k, T]);
|
|
877
|
+
const G = te((m) => {
|
|
878
|
+
if (!s || d) return;
|
|
879
|
+
const h = document.elementFromPoint(m.clientX, m.clientY);
|
|
880
|
+
if (!h || h.id === "viewgate-overlay" || h.closest("#viewgate-ui")) {
|
|
881
|
+
u(null);
|
|
847
882
|
return;
|
|
848
883
|
}
|
|
849
|
-
|
|
850
|
-
tag:
|
|
851
|
-
source:
|
|
852
|
-
rect:
|
|
853
|
-
element:
|
|
854
|
-
previewText: (
|
|
855
|
-
semanticReference:
|
|
884
|
+
h.getAttribute("data-source-path"), u({
|
|
885
|
+
tag: h.tagName.toLowerCase(),
|
|
886
|
+
source: h.getAttribute("data-source-path") || "unknown:0",
|
|
887
|
+
rect: h.getBoundingClientRect(),
|
|
888
|
+
element: h,
|
|
889
|
+
previewText: (h.innerText || "").slice(0, 100) || (h.getAttribute("placeholder") || "").slice(0, 100) || h.tagName.toLowerCase(),
|
|
890
|
+
semanticReference: $t(h)
|
|
856
891
|
});
|
|
857
|
-
}, [s,
|
|
858
|
-
if (!(!s ||
|
|
859
|
-
|
|
892
|
+
}, [s, d]), P = te(async (m) => {
|
|
893
|
+
if (!(!s || d) && c) {
|
|
894
|
+
m.preventDefault(), m.stopPropagation(), O(!0);
|
|
860
895
|
try {
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
const
|
|
896
|
+
const h = c.element.style.display, _ = window.getComputedStyle(c.element).display === "inline";
|
|
897
|
+
_ && (c.element.style.display = "inline-block");
|
|
898
|
+
const j = await At(c.element, {
|
|
864
899
|
backgroundColor: "#ffffff",
|
|
865
900
|
pixelRatio: 2,
|
|
866
901
|
skipFonts: !0,
|
|
@@ -870,21 +905,21 @@ const Lt = (e) => {
|
|
|
870
905
|
// Extra padding for better look
|
|
871
906
|
}
|
|
872
907
|
});
|
|
873
|
-
|
|
874
|
-
} catch (
|
|
875
|
-
console.error("Failed to capture preview:",
|
|
908
|
+
_ && (c.element.style.display = h), p({ ...c, visualPreview: j });
|
|
909
|
+
} catch (h) {
|
|
910
|
+
console.error("Failed to capture preview:", h), p(c);
|
|
876
911
|
} finally {
|
|
877
|
-
|
|
912
|
+
O(!1), u(null);
|
|
878
913
|
}
|
|
879
914
|
}
|
|
880
|
-
}, [s, c,
|
|
881
|
-
|
|
882
|
-
document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove",
|
|
883
|
-
}), [s,
|
|
884
|
-
const
|
|
885
|
-
if (!
|
|
886
|
-
|
|
887
|
-
const { semanticReference:
|
|
915
|
+
}, [s, c, d, k]);
|
|
916
|
+
ue(() => (s && !d ? document.body.classList.add("vg-cursor-pointer") : document.body.classList.remove("vg-cursor-pointer"), window.addEventListener("mousemove", G), window.addEventListener("click", P, !0), () => {
|
|
917
|
+
document.body.classList.remove("vg-cursor-pointer"), window.removeEventListener("mousemove", G), window.removeEventListener("click", P, !0);
|
|
918
|
+
}), [s, d, G, P]);
|
|
919
|
+
const K = async () => {
|
|
920
|
+
if (!d || !g.trim()) return;
|
|
921
|
+
$(!0);
|
|
922
|
+
const { semanticReference: m } = d, [h, _] = m.source.split(":"), j = _ || "0";
|
|
888
923
|
try {
|
|
889
924
|
if (!(await fetch(`${a}/api/annotations`, {
|
|
890
925
|
method: "POST",
|
|
@@ -893,32 +928,45 @@ const Lt = (e) => {
|
|
|
893
928
|
"x-api-key": n
|
|
894
929
|
},
|
|
895
930
|
body: JSON.stringify({
|
|
896
|
-
filePath:
|
|
897
|
-
line: parseInt(
|
|
931
|
+
filePath: h,
|
|
932
|
+
line: parseInt(j),
|
|
898
933
|
url: window.location.href,
|
|
899
|
-
message:
|
|
900
|
-
componentName:
|
|
901
|
-
reference:
|
|
934
|
+
message: g,
|
|
935
|
+
componentName: m.componentPath || d.tag,
|
|
936
|
+
reference: m
|
|
902
937
|
})
|
|
903
938
|
})).ok) throw new Error("Backend failed");
|
|
904
|
-
e(r.success, "success"),
|
|
905
|
-
} catch (
|
|
906
|
-
console.error(
|
|
939
|
+
e(r.success, "success"), p(null), v(""), i(!1), T();
|
|
940
|
+
} catch (I) {
|
|
941
|
+
console.error(I), e(r.error, "error");
|
|
907
942
|
} finally {
|
|
908
|
-
|
|
943
|
+
$(!1);
|
|
909
944
|
}
|
|
910
|
-
}, z = (
|
|
911
|
-
return /* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
945
|
+
}, z = (m) => m.split("/").pop()?.split("\\").pop() || "unknown";
|
|
946
|
+
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
947
|
+
/* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:259", style: { position: "fixed", bottom: "30px", right: "30px", zIndex: 99999 }, id: "viewgate-ui", children: [
|
|
948
|
+
/* @__PURE__ */ l.jsx(
|
|
949
|
+
"button",
|
|
950
|
+
{
|
|
951
|
+
onClick: () => i(!s),
|
|
952
|
+
className: "vg-button-primary",
|
|
953
|
+
style: { padding: "12px 24px", fontSize: "15px" },
|
|
954
|
+
children: s ? r.exitMode : r.enterMode
|
|
955
|
+
}
|
|
956
|
+
),
|
|
957
|
+
F.length > 0 && /* @__PURE__ */ l.jsx(
|
|
958
|
+
"button",
|
|
959
|
+
{
|
|
960
|
+
onClick: () => {
|
|
961
|
+
H(!k), i(!1), p(null);
|
|
962
|
+
},
|
|
963
|
+
className: "vg-button-ghost",
|
|
964
|
+
style: { padding: "12px 24px", fontSize: "15px", marginLeft: "12px", background: "white" },
|
|
965
|
+
children: r.viewComments
|
|
966
|
+
}
|
|
967
|
+
)
|
|
968
|
+
] }),
|
|
969
|
+
M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:284", style: {
|
|
922
970
|
position: "fixed",
|
|
923
971
|
top: 0,
|
|
924
972
|
left: 0,
|
|
@@ -930,8 +978,11 @@ const Lt = (e) => {
|
|
|
930
978
|
justifyContent: "center",
|
|
931
979
|
zIndex: 1e5,
|
|
932
980
|
cursor: "wait"
|
|
933
|
-
}, children: /* @__PURE__ */
|
|
934
|
-
|
|
981
|
+
}, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:297", className: "vg-glassmorphism", style: { padding: "30px 50px", fontWeight: 700, display: "flex", flexDirection: "column", alignItems: "center", backgroundColor: "rgba(0,0,0,0.7)", color: "white", border: "1px solid rgba(255,255,255,0.1)" }, children: [
|
|
982
|
+
/* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:298", className: "vg-spinner" }),
|
|
983
|
+
"Capturing..."
|
|
984
|
+
] }) }),
|
|
985
|
+
s && c && !d && !M && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:306", style: {
|
|
935
986
|
position: "fixed",
|
|
936
987
|
top: c.rect.top,
|
|
937
988
|
left: c.rect.left,
|
|
@@ -945,7 +996,7 @@ const Lt = (e) => {
|
|
|
945
996
|
boxShadow: "0 0 15px rgba(37, 19, 236, 0.2)",
|
|
946
997
|
transition: "all 0.1s ease-out"
|
|
947
998
|
} }),
|
|
948
|
-
|
|
999
|
+
d && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:324", className: "vg-animate-fade", style: {
|
|
949
1000
|
position: "fixed",
|
|
950
1001
|
top: 0,
|
|
951
1002
|
left: 0,
|
|
@@ -957,33 +1008,33 @@ const Lt = (e) => {
|
|
|
957
1008
|
alignItems: "center",
|
|
958
1009
|
justifyContent: "center",
|
|
959
1010
|
zIndex: 99999
|
|
960
|
-
}, children: /* @__PURE__ */
|
|
1011
|
+
}, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:337", className: "vg-glassmorphism vg-animate-slide", style: {
|
|
961
1012
|
padding: "32px",
|
|
962
1013
|
width: "460px",
|
|
963
1014
|
background: "white",
|
|
964
1015
|
color: "#0f172a"
|
|
965
1016
|
}, children: [
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
|
|
1017
|
+
/* @__PURE__ */ l.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:343", style: { margin: "0 0 10px 0", fontSize: "24px", fontWeight: 800 }, children: r.feedbackHeader }),
|
|
1018
|
+
/* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:345", style: { marginBottom: "20px" }, children: [
|
|
1019
|
+
/* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:346", style: { display: "flex", flexWrap: "wrap", gap: "8px", alignItems: "center" }, children: [
|
|
1020
|
+
d.semanticReference.componentPath ? /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:348", className: "vg-badge", style: { backgroundColor: "#f5f3ff", color: "#7c3aed", borderColor: "#ddd6fe" }, children: [
|
|
970
1021
|
"📦 ",
|
|
971
|
-
|
|
972
|
-
] }) : /* @__PURE__ */
|
|
973
|
-
|
|
1022
|
+
d.semanticReference.componentPath
|
|
1023
|
+
] }) : /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:352", className: "vg-badge", children: d.tag }),
|
|
1024
|
+
d.semanticReference.source && !d.semanticReference.source.startsWith("unknown") ? /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:357", className: "vg-badge", style: { backgroundColor: "#fdf2f8", color: "#db2777", borderColor: "#fbcfe8" }, children: [
|
|
974
1025
|
"📄 ",
|
|
975
|
-
z(
|
|
976
|
-
] }) }) : /* @__PURE__ */
|
|
1026
|
+
z(d.semanticReference.source.split(":")[0] || "unknown")
|
|
1027
|
+
] }) }) : /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:362", className: "vg-badge", style: { backgroundColor: "#f0f9ff", color: "#0369a1", borderColor: "#bae6fd", maxWidth: "300px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
|
|
977
1028
|
"🆔 ",
|
|
978
|
-
|
|
1029
|
+
d.semanticReference.signature
|
|
979
1030
|
] })
|
|
980
1031
|
] }),
|
|
981
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:367", style: { marginTop: "8px", fontSize: "11px", color: "#94a3b8" }, children: [
|
|
982
1033
|
"🎯 ",
|
|
983
|
-
|
|
1034
|
+
d.semanticReference.selector
|
|
984
1035
|
] })
|
|
985
1036
|
] }),
|
|
986
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:373", style: {
|
|
987
1038
|
backgroundColor: "#f8fafc",
|
|
988
1039
|
borderRadius: "8px",
|
|
989
1040
|
border: "1px solid #e2e8f0",
|
|
@@ -992,8 +1043,8 @@ const Lt = (e) => {
|
|
|
992
1043
|
display: "flex",
|
|
993
1044
|
flexDirection: "column"
|
|
994
1045
|
}, children: [
|
|
995
|
-
/* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
1046
|
+
/* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:382", style: { padding: "8px 12px", fontSize: "10px", color: "#94a3b8", textTransform: "uppercase", fontWeight: 700, borderBottom: "1px solid #f1f5f9" }, children: r.preview }),
|
|
1047
|
+
/* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:385", style: {
|
|
997
1048
|
padding: "12px",
|
|
998
1049
|
display: "flex",
|
|
999
1050
|
justifyContent: "center",
|
|
@@ -1002,10 +1053,10 @@ const Lt = (e) => {
|
|
|
1002
1053
|
maxHeight: "150px",
|
|
1003
1054
|
overflow: "hidden",
|
|
1004
1055
|
backgroundColor: "white"
|
|
1005
|
-
}, children:
|
|
1056
|
+
}, children: d.visualPreview ? /* @__PURE__ */ l.jsx(
|
|
1006
1057
|
"img",
|
|
1007
1058
|
{
|
|
1008
|
-
src:
|
|
1059
|
+
src: d.visualPreview,
|
|
1009
1060
|
alt: "Element Preview",
|
|
1010
1061
|
style: {
|
|
1011
1062
|
maxWidth: "100%",
|
|
@@ -1015,77 +1066,175 @@ const Lt = (e) => {
|
|
|
1015
1066
|
borderRadius: "4px"
|
|
1016
1067
|
}
|
|
1017
1068
|
}
|
|
1018
|
-
) : /* @__PURE__ */
|
|
1069
|
+
) : /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:408", style: { fontSize: "13px", color: "#64748b", fontStyle: "italic" }, children: [
|
|
1019
1070
|
'"',
|
|
1020
|
-
|
|
1071
|
+
d.previewText,
|
|
1021
1072
|
'"'
|
|
1022
1073
|
] }) })
|
|
1023
1074
|
] }),
|
|
1024
|
-
/* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ l.jsx(
|
|
1025
1076
|
"textarea",
|
|
1026
1077
|
{
|
|
1027
1078
|
className: "vg-textarea",
|
|
1028
|
-
value:
|
|
1029
|
-
onChange: (
|
|
1079
|
+
value: g,
|
|
1080
|
+
onChange: (m) => v(m.target.value),
|
|
1030
1081
|
rows: 4,
|
|
1031
1082
|
placeholder: r.placeholder,
|
|
1032
1083
|
autoFocus: !0
|
|
1033
1084
|
}
|
|
1034
1085
|
),
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
1086
|
+
/* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:424", style: { display: "flex", justifyContent: "flex-end", gap: "12px", marginTop: "24px" }, children: [
|
|
1087
|
+
/* @__PURE__ */ l.jsx(
|
|
1037
1088
|
"button",
|
|
1038
1089
|
{
|
|
1039
|
-
onClick: () =>
|
|
1090
|
+
onClick: () => p(null),
|
|
1040
1091
|
className: "vg-button-ghost",
|
|
1041
1092
|
children: r.cancel
|
|
1042
1093
|
}
|
|
1043
1094
|
),
|
|
1044
|
-
/* @__PURE__ */
|
|
1095
|
+
/* @__PURE__ */ l.jsx(
|
|
1045
1096
|
"button",
|
|
1046
1097
|
{
|
|
1047
|
-
onClick:
|
|
1098
|
+
onClick: K,
|
|
1048
1099
|
className: "vg-button-primary",
|
|
1049
|
-
disabled:
|
|
1050
|
-
style: { opacity:
|
|
1051
|
-
children:
|
|
1100
|
+
disabled: C || !g.trim(),
|
|
1101
|
+
style: { opacity: C || !g.trim() ? 0.6 : 1 },
|
|
1102
|
+
children: C ? r.submitting : r.send
|
|
1052
1103
|
}
|
|
1053
1104
|
)
|
|
1054
1105
|
] })
|
|
1106
|
+
] }) }),
|
|
1107
|
+
k && /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:446", className: "vg-animate-fade", style: {
|
|
1108
|
+
position: "fixed",
|
|
1109
|
+
top: 0,
|
|
1110
|
+
left: 0,
|
|
1111
|
+
width: "100%",
|
|
1112
|
+
height: "100%",
|
|
1113
|
+
backgroundColor: "rgba(0,0,0,0.6)",
|
|
1114
|
+
backdropFilter: "blur(4px)",
|
|
1115
|
+
display: "flex",
|
|
1116
|
+
alignItems: "center",
|
|
1117
|
+
justifyContent: "center",
|
|
1118
|
+
zIndex: 99999
|
|
1119
|
+
}, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:459", className: "vg-glassmorphism vg-animate-slide", style: {
|
|
1120
|
+
padding: "32px",
|
|
1121
|
+
width: "600px",
|
|
1122
|
+
maxHeight: "80vh",
|
|
1123
|
+
background: "white",
|
|
1124
|
+
color: "#0f172a",
|
|
1125
|
+
display: "flex",
|
|
1126
|
+
flexDirection: "column"
|
|
1127
|
+
}, children: [
|
|
1128
|
+
/* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:468", style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "20px" }, children: [
|
|
1129
|
+
/* @__PURE__ */ l.jsx("h2", { "data-source-path": "/src/components/ViewGateOverlay.tsx:469", style: { margin: 0, fontSize: "24px", fontWeight: 800 }, children: r.feedbackHeader }),
|
|
1130
|
+
/* @__PURE__ */ l.jsx("button", { "data-source-path": "/src/components/ViewGateOverlay.tsx:470", onClick: () => H(!1), className: "vg-button-ghost", style: { padding: "6px 12px" }, children: "✕" })
|
|
1131
|
+
] }),
|
|
1132
|
+
/* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:473", style: { overflowY: "auto", flex: 1, paddingRight: "8px", display: "flex", flexDirection: "column", gap: "16px" }, children: Z ? /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:475", style: { textAlign: "center", padding: "40px", color: "#64748b" }, children: "Cargando..." }) : F.length === 0 ? /* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:477", style: { textAlign: "center", padding: "40px", color: "#64748b" }, children: r.noComments }) : F.map((m) => /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:480", style: {
|
|
1133
|
+
border: "1px solid #e2e8f0",
|
|
1134
|
+
borderRadius: "12px",
|
|
1135
|
+
padding: "16px",
|
|
1136
|
+
backgroundColor: m.status === "ready_for_review" ? "#f0fdf4" : "#fff"
|
|
1137
|
+
}, children: [
|
|
1138
|
+
/* @__PURE__ */ l.jsx("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:486", style: { display: "flex", justifyContent: "space-between", marginBottom: "12px" }, children: /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:487", style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
|
|
1139
|
+
m.status === "ready_for_review" ? /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:489", className: "vg-badge", style: { backgroundColor: "#dcfce7", color: "#166534", borderColor: "#bbf7d0" }, children: [
|
|
1140
|
+
"✓ ",
|
|
1141
|
+
r.readyForReview
|
|
1142
|
+
] }) : /* @__PURE__ */ l.jsxs("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:491", className: "vg-badge", style: { backgroundColor: "#fef3c7", color: "#92400e", borderColor: "#fde68a" }, children: [
|
|
1143
|
+
"⏳ ",
|
|
1144
|
+
r.pending
|
|
1145
|
+
] }),
|
|
1146
|
+
/* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:493", style: { fontSize: "12px", color: "#64748b" }, children: new Date(m.timestamp).toLocaleString() })
|
|
1147
|
+
] }) }),
|
|
1148
|
+
/* @__PURE__ */ l.jsxs("p", { "data-source-path": "/src/components/ViewGateOverlay.tsx:499", style: { margin: "0 0 12px 0", fontSize: "15px", fontWeight: 600 }, children: [
|
|
1149
|
+
'"',
|
|
1150
|
+
m.message,
|
|
1151
|
+
'"'
|
|
1152
|
+
] }),
|
|
1153
|
+
/* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:501", style: { display: "flex", gap: "6px", flexWrap: "wrap", marginBottom: "16px" }, children: [
|
|
1154
|
+
/* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:502", className: "vg-badge", style: { backgroundColor: "#f1f5f9", color: "#475569", border: "none" }, children: m.componentName || "UI Element" }),
|
|
1155
|
+
m.filePath && m.filePath !== "unknown" && /* @__PURE__ */ l.jsx("span", { "data-source-path": "/src/components/ViewGateOverlay.tsx:506", className: "vg-badge", style: { backgroundColor: "#f1f5f9", color: "#475569", border: "none" }, children: z(m.filePath) })
|
|
1156
|
+
] }),
|
|
1157
|
+
m.status === "ready_for_review" && /* @__PURE__ */ l.jsxs("div", { "data-source-path": "/src/components/ViewGateOverlay.tsx:513", style: { display: "flex", gap: "8px", justifyContent: "flex-end", borderTop: "1px solid #e2e8f0", paddingTop: "16px", marginTop: "8px" }, children: [
|
|
1158
|
+
/* @__PURE__ */ l.jsxs(
|
|
1159
|
+
"button",
|
|
1160
|
+
{
|
|
1161
|
+
"data-source-path": "/src/components/ViewGateOverlay.tsx:514",
|
|
1162
|
+
className: "vg-button-ghost",
|
|
1163
|
+
style: { display: "flex", alignItems: "center", gap: "6px" },
|
|
1164
|
+
onClick: async () => {
|
|
1165
|
+
try {
|
|
1166
|
+
(await fetch(`${a}/api/annotations/${m._id}`, {
|
|
1167
|
+
method: "PATCH",
|
|
1168
|
+
headers: { "Content-Type": "application/json", "x-api-key": n },
|
|
1169
|
+
body: JSON.stringify({ status: "pending" })
|
|
1170
|
+
})).ok && (T(), e(r.success, "success"));
|
|
1171
|
+
} catch {
|
|
1172
|
+
}
|
|
1173
|
+
},
|
|
1174
|
+
children: [
|
|
1175
|
+
"✍️ ",
|
|
1176
|
+
r.observe
|
|
1177
|
+
]
|
|
1178
|
+
}
|
|
1179
|
+
),
|
|
1180
|
+
/* @__PURE__ */ l.jsxs(
|
|
1181
|
+
"button",
|
|
1182
|
+
{
|
|
1183
|
+
"data-source-path": "/src/components/ViewGateOverlay.tsx:534",
|
|
1184
|
+
className: "vg-button-primary",
|
|
1185
|
+
style: { backgroundColor: "#ef4444", display: "flex", alignItems: "center", gap: "6px" },
|
|
1186
|
+
onClick: async () => {
|
|
1187
|
+
if (window.confirm(r.deleteConfirm))
|
|
1188
|
+
try {
|
|
1189
|
+
(await fetch(`${a}/api/annotations/${m._id}`, {
|
|
1190
|
+
method: "DELETE",
|
|
1191
|
+
headers: { "x-api-key": n }
|
|
1192
|
+
})).ok && (T(), e(r.success, "success"));
|
|
1193
|
+
} catch {
|
|
1194
|
+
}
|
|
1195
|
+
},
|
|
1196
|
+
children: [
|
|
1197
|
+
"🗑️ ",
|
|
1198
|
+
r.close
|
|
1199
|
+
]
|
|
1200
|
+
}
|
|
1201
|
+
)
|
|
1202
|
+
] })
|
|
1203
|
+
] }, m._id)) })
|
|
1055
1204
|
] }) })
|
|
1056
1205
|
] });
|
|
1057
1206
|
};
|
|
1058
|
-
function
|
|
1207
|
+
function _e(e, t, r) {
|
|
1059
1208
|
if (!t.endsWith(".tsx") && !t.endsWith(".jsx") || t.includes("node_modules")) return e;
|
|
1060
1209
|
const n = (c) => c.replace(/\\/g, "/"), a = n(t).replace(n(r), "");
|
|
1061
1210
|
return e.split(`
|
|
1062
|
-
`).map((c,
|
|
1063
|
-
const
|
|
1064
|
-
return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g, (
|
|
1211
|
+
`).map((c, u) => {
|
|
1212
|
+
const d = u + 1;
|
|
1213
|
+
return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g, (p, g, v) => p.includes("data-source-path") || v === "Fragment" || v === "React.Fragment" ? p : `${g}<${v} data-source-path="${a}:${d}"`);
|
|
1065
1214
|
}).join(`
|
|
1066
1215
|
`);
|
|
1067
1216
|
}
|
|
1068
|
-
function
|
|
1217
|
+
function Dt() {
|
|
1069
1218
|
return {
|
|
1070
1219
|
name: "vite-plugin-viewgate",
|
|
1071
1220
|
enforce: "pre",
|
|
1072
1221
|
transform(e, t) {
|
|
1073
1222
|
return {
|
|
1074
|
-
code:
|
|
1223
|
+
code: _e(e, t, process.cwd()),
|
|
1075
1224
|
map: null
|
|
1076
1225
|
};
|
|
1077
1226
|
}
|
|
1078
1227
|
};
|
|
1079
1228
|
}
|
|
1080
|
-
function
|
|
1229
|
+
function Nt(e) {
|
|
1081
1230
|
const t = this.resourcePath;
|
|
1082
|
-
return t ? (process.env.NODE_ENV,
|
|
1231
|
+
return t ? (process.env.NODE_ENV, _e(e, t, process.cwd())) : e;
|
|
1083
1232
|
}
|
|
1084
1233
|
export {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1234
|
+
It as ViewGate,
|
|
1235
|
+
Ft as ViewGateOverlay,
|
|
1236
|
+
_e as transformSourcePaths,
|
|
1237
|
+
Ne as useViewGate,
|
|
1238
|
+
Nt as viewgateNextLoader,
|
|
1239
|
+
Dt as viewgatePlugin
|
|
1091
1240
|
};
|