viewgate-wrapper 1.10.14 → 1.10.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,17 +1,17 @@
|
|
|
1
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;500;600;700;800&display=swap";body{margin:0!important;padding:0!important}:root{--vg-primary: #6366f1;--vg-primary-glow: rgba(99, 102, 241, .5);--vg-primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);--vg-bg-glass: rgba(255, 255, 255, .7);--vg-radius: 16px;--vg-font-main: "Inter", system-ui, sans-serif;--vg-font-alt: "Inter", system-ui, sans-serif;--placeholder-color: #94a3b8;--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow-premium: 0 20px 50px rgba(0, 0, 0, .1)}.vg-container,.vg-container *{box-sizing:border-box}.vg-container{font-family:var(--vg-font-main);-webkit-font-smoothing:antialiased}.vg-glassmorphism{background:var(--vg-bg-glass);backdrop-filter:blur(16px) saturate(180%);-webkit-backdrop-filter:blur(16px) saturate(180%);border:1px solid var(--vg-glass-border);box-shadow:0 8px 32px #0000001a;border-radius:var(--vg-radius);position:relative}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:12px 24px;font-family:var(--vg-font-main);font-size:14px;font-weight:700;cursor:pointer;transition:all .2s ease;border-radius:99px;display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 4px 12px #6366f14d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 20px #6366f166}.vg-button-primary:disabled,.vg-button-ghost:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(.4);transform:none!important;box-shadow:none!important;pointer-events:none}.vg-button-ghost{background:#fffc;color:#1e293b;border:1px solid #e2e8f0;padding:10px 24px;font-family:var(--vg-font-main);font-size:14px;font-weight:600;cursor:pointer;transition:all .2s ease;border-radius:99px;display:flex;align-items:center;justify-content:center;gap:8px}.vg-button-ghost:hover{background:#fff;border-color:#cbd5e1;box-shadow:0 4px 12px #0000000d}.vg-badge{background:#f1f5f9;color:#64748b;padding:4px 12px;font-size:11px;border-radius:99px;font-weight:600;display:inline-flex;align-items:center;gap:6px}.vg-textarea{width:100%;box-sizing:border-box;border:1px solid #e2e8f0;border-radius:12px;padding:12px;font-family:var(--vg-font-main);font-size:15px;color:#0f172a;resize:none;outline:none;background:#f8fafc;transition:all .2s ease}.vg-textarea:focus{background:#fff;border-color:var(--vg-primary);box-shadow:0 0 0 4px #6366f11a}@keyframes vg-pop-in{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.08);opacity:1}to{transform:scale(1);opacity:1}}@keyframes vg-slide-up-fade{0%{transform:translateY(12px) scale(.95);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.vg-animate-pop{animation:vg-pop-in .5s cubic-bezier(.34,1.56,.64,1) forwards}.vg-animate-slide-up{animation:vg-slide-up-fade .4s cubic-bezier(.22,1,.36,1) forwards}.vg-button-primary,.vg-button-ghost,.vg-pin-container,.vg-action-bar,.vg-glassmorphism{transition:all .3s cubic-bezier(.4,0,.2,1)}.vg-animate-slide{animation:vg-slide-in .4s cubic-bezier(.22,1,.36,1) forwards}.vg-animate-fade{animation:vg-fade-in .3s ease-out forwards}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px}.vg-toast{padding:12px 20px;display:flex;align-items:center;gap:12px;min-width:300px;border-radius:12px;box-shadow:0 10px 30px #0000001a;background:#fff}.vg-toast.success{border-left:6px solid #22c55e}.vg-toast.error{border-left:6px solid #ef4444}.vg-backdrop-blur{position:fixed;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:blur(8px) grayscale(.2);backdrop-filter:blur(8px) grayscale(.2);background:#0000001a;pointer-events:none;transition:opacity .3s ease,clip-path .2s cubic-bezier(.19,1,.22,1)}.vg-selection-pulse{position:fixed;pointer-events:none;border:2px solid var(--vg-primary);border-radius:8px;box-shadow:0 0 0 0 var(--vg-primary-glow);animation:vg-pulse 2s infinite;transition:all .2s cubic-bezier(.19,1,.22,1)}@keyframes vg-pulse{0%{box-shadow:0 0 0 0 var(--vg-primary-glow)}70%{box-shadow:0 0 0 15px #6366f100}to{box-shadow:0 0 #6366f100}}.vg-selection-label{position:absolute;top:-40px;left:0;background:var(--vg-primary-gradient);color:#fff;padding:8px 16px;border-radius:20px;font-size:13px;font-weight:700;white-space:nowrap;box-shadow:0 4px 12px #6366f14d;display:flex;align-items:center;gap:8px}.vg-pin-container{transition:transform .2s ease}.vg-pin-container:hover{transform:scale(1.1)}.vg-formal-pin{width:32px;height:32px;border-radius:50%;background:var(--vg-primary-gradient);border:3px solid white;box-shadow:0 4px 12px #6366f166;display:flex;align-items:center;justify-content:center;color:#fff;transition:all .2s ease}.vg-formal-pin.ready{background:linear-gradient(135deg,#10b981,#059669);box-shadow:0 4px 12px #10b98166}.vg-formal-pin.modal-variant{background:linear-gradient(135deg,#f59e0b,#d97706);box-shadow:0 4px 12px #f59e0b66;border-style:dashed}.vg-pin-tooltip{position:absolute;top:calc(100% + 12px);left:50%;transform:translate(-50%);padding:16px;border-radius:16px;background:#ffffffe6;backdrop-filter:blur(12px) saturate(160%);-webkit-backdrop-filter:blur(12px) saturate(160%);color:#1e293b;width:240px;font-size:13px;box-shadow:0 10px 40px #00000026;opacity:0;pointer-events:none;transition:all .3s cubic-bezier(.19,1,.22,1);border:1px solid rgba(255,255,255,.5);z-index:1000}.vg-tooltip-scroll{scrollbar-width:thin;scrollbar-color:rgba(99,102,241,.2) transparent}.vg-tooltip-scroll::-webkit-scrollbar{width:4px}.vg-tooltip-scroll::-webkit-scrollbar-track{background:transparent}.vg-tooltip-scroll::-webkit-scrollbar-thumb{background:#6366f14d;border-radius:10px}.vg-pin-badge{position:absolute;top:-8px;right:-8px;background:#f43f5e;color:#fff;font-size:10px;font-weight:800;width:20px;height:20px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:2px solid white;box-shadow:0 4px 12px #f43f5e66;z-index:2}.vg-pin-tooltip.vg-top{top:auto;bottom:calc(100% + 12px)}.vg-pin-container:hover .vg-pin-tooltip{opacity:1;transform:translate(-50%) translateY(-5px)}.vg-action-bar{display:flex;gap:12px;padding:0;background:transparent;border:none;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}.vg-custom-scrollbar::-webkit-scrollbar{width:6px}.vg-custom-scrollbar::-webkit-scrollbar-track{background:transparent}.vg-custom-scrollbar::-webkit-scrollbar-thumb{background:#6366f166;border-radius:10px;transition:all .2s ease}.vg-custom-scrollbar::-webkit-scrollbar-thumb:hover{background:#6366f1b3}.vg-spinner{border:3px solid rgba(99,102,241,.1);border-top:3px solid var(--vg-primary);border-radius:50%;width:32px;height:32px;animation:vg-spin .8s linear infinite}@keyframes vg-spin{to{transform:rotate(360deg)}}.vg-animate-spin{animation:vg-spin .8s linear infinite}.vg-cursor-pointer,.vg-cursor-pointer *{cursor:pointer!important}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
(function(
|
|
2
|
+
(function(N,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(N=typeof globalThis<"u"?globalThis:N||self,m(N.ViewGateWrapper={},N.React,N.ReactDOM))})(this,(function(N,m,Rt){"use strict";var xe={exports:{}},de={};var $e;function jt(){if($e)return de;$e=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var c=null;if(s!==void 0&&(c=""+s),a.key!==void 0&&(c=""+a.key),"key"in a){s={};for(var i in a)i!=="key"&&(s[i]=a[i])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:c,ref:a!==void 0?a:null,props:s}}return de.Fragment=t,de.jsx=n,de.jsxs=n,de}var ue={};var Ue;function _t(){return Ue||(Ue=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===me?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case W:return"Fragment";case Z:return"Profiler";case J:return"StrictMode";case De:return"Suspense";case F:return"SuspenseList";case St:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case I:return"Portal";case K:return l.displayName||"Context";case L:return(l._context.displayName||"Context")+".Consumer";case A:var x=l.render;return l=l.displayName,l||(l=x.displayName||x.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case $:return x=l.displayName||null,x!==null?x:e(l.type)||"Memo";case ke:x=l._payload,l=l._init;try{return e(l(x))}catch{}}return null}function t(l){return""+l}function n(l){try{t(l);var x=!1}catch{x=!0}if(x){x=console;var S=x.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return S.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),t(l)}}function r(l){if(l===W)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===ke)return"<...>";try{var x=e(l);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function a(){var l=oe.A;return l===null?null:l.getOwner()}function s(){return Error("react-stack-top-frame")}function c(l){if(Re.call(l,"key")){var x=Object.getOwnPropertyDescriptor(l,"key").get;if(x&&x.isReactWarning)return!1}return l.key!==void 0}function i(l,x){function S(){ie||(ie=!0,console.error("%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)",x))}S.isReactWarning=!0,Object.defineProperty(l,"key",{get:S,configurable:!0})}function u(){var l=e(this.type);return ee[l]||(ee[l]=!0,console.error("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.")),l=this.props.ref,l!==void 0?l:null}function p(l,x,S,E,G,B){var k=S.ref;return l={$$typeof:O,type:l,key:x,props:S,_owner:E},(k!==void 0?k:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:u}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function f(l,x,S,E,G,B){var k=x.children;if(k!==void 0)if(E)if(je(k)){for(E=0;E<k.length;E++)h(k[E]);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(k);if(Re.call(x,"key")){k=e(l);var z=Object.keys(x).filter(function(H){return H!=="key"});E=0<z.length?"{key: someKey, "+z.join(": ..., ")+": ...}":"{key: someKey}",_e[k+E]||(z=0<z.length?"{"+z.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
3
3
|
let props = %s;
|
|
4
4
|
<%s {...props} />
|
|
5
5
|
React keys must be passed directly to JSX without using spread:
|
|
6
6
|
let props = %s;
|
|
7
|
-
<%s key={someKey} {...props} />`,R,j,F,j),je[j+R]=!0)}if(j=null,k!==void 0&&(n(k),j=""+k),i(x)&&(n(x.key),j=""+x.key),"key"in x){k={};for(var ce in x)ce!=="key"&&(k[ce]=x[ce])}else k=x;return j&&c(k,typeof l=="function"?l.displayName||l.name||"Unknown":l),u(l,j,k,s(),M,J)}function f(l){v(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===Ee&&(l._payload.status==="fulfilled"?v(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function v(l){return typeof l=="object"&&l!==null&&l.$$typeof===S}var h=p,S=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),U=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),Ee=Symbol.for("react.lazy"),bt=Symbol.for("react.activity"),pe=Symbol.for("react.client.reference"),oe=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ke=Object.prototype.hasOwnProperty,Re=Array.isArray,X=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(l){return l()}};var ie,q={},me=h.react_stack_bottom_frame.bind(h,a)(),fe=X(r(a)),je={};ue.Fragment=P,ue.jsx=function(l,x,k){var R=1e4>oe.recentlyCreatedOwnerStacks++;return E(l,x,k,!1,R?Error("react-stack-top-frame"):me,R?X(r(l)):fe)},ue.jsxs=function(l,x,k){var R=1e4>oe.recentlyCreatedOwnerStacks++;return E(l,x,k,!0,R?Error("react-stack-top-frame"):me,R?X(r(l)):fe)}})()),ue}var Ue;function _t(){return Ue||(Ue=1,process.env.NODE_ENV==="production"?ye.exports=Rt():ye.exports=jt()),ye.exports}var o=_t();const Ot=({children:e})=>{const t=p.useRef(null),[n,r]=p.useState(null);return p.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const s=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(c=>{(c.textContent?.includes(".vg-")||c.textContent?.includes("--vg-"))&&s.appendChild(c.cloneNode(!0))});const i=document.createElement("link");i.rel="stylesheet",i.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap",s.appendChild(i),r(s)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:n&&kt.createPortal(e,n)})};const Be=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Tt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Vt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Ye=e=>{const t=Vt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Pt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const At=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Gt=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:i,...c},m)=>p.createElement("svg",{ref:m,...Pt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Be("lucide",s),...!a&&!At(c)&&{"aria-hidden":"true"},...c},[...i.map(([u,E])=>p.createElement(u,E)),...Array.isArray(a)?a:[a]]));const N=(e,t)=>{const n=p.forwardRef(({className:r,...s},a)=>p.createElement(Gt,{ref:a,iconNode:t,className:Be(`lucide-${Tt(Ye(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Ye(e),n};const Nt=N("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const ne=N("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Lt=N("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const Xe=N("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const Mt=N("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Je=N("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const It=N("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const xe=N("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);const zt=N("mouse-pointer-2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);const Dt=N("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Ft=N("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const Ht=N("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Ze=N("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Oe=N("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Wt={en:{enterMode:"Enter Feedback Mode",exitMode:"Exit Mode",feedbackHeader:"Feedback",selectedElement:"Selected element:",line:"Line",placeholder:"Tell us what you'd like to change...",cancel:"Cancel",send:"Send Feedback",submitting:"Submitting...",success:"Your feedback has been submitted successfully!",error:"Failed to submit feedback. Check backend connection.",successHeader:"Success",errorHeader:"Error",preview:"Preview",viewComments:"View Comments",close:"Close",observe:"Observe",pending:"Pending",readyForReview:"Ready for Review",noComments:"No comments found.",deleteConfirm:"Delete comment",markReady:"Mark as Ready",reopen:"Reopen",review:"Review",confirmDelete:"Are you sure you want to permanently delete this comment? This action cannot be undone.",markReadyConfirm:"Complete review",confirmMarkReady:"Do you want to mark this comment as ready? it will be moved to the completed state.",reopenConfirm:"Reopen comment",confirmReopen:"Do you want to set this comment back to pending status?",yes:"Yes, confirm",no:"No, cancel",deleteSuccess:"Comment deleted successfully.",updateSuccess:"Updated successfully.",navigating:"Redirecting to review...",selectToComment:"Click to comment",feedbackSubheader:"What would you like to improve here?",sendFeedback:"Send Comment",edit:"Edit",save:"Save",commentDetails:"Comment Details",annotations:"Comments",viewAll:"View All",exitConfirmTitle:"Close ViewGate?",exitConfirmMessage:"Are you sure you want to close ViewGate? You can reopen it at any time by adding ?viewgate=true to your URL."},es:{enterMode:"Activar Modo Comentarios",exitMode:"Salir del Modo",feedbackHeader:"Comentarios",selectedElement:"Elemento seleccionado:",line:"Línea",placeholder:"Cuéntanos qué te gustaría cambiar...",cancel:"Cancelar",send:"Enviar Comentarios",submitting:"Enviando...",success:"¡Tus comentarios se han enviado con éxito!",error:"Error al enviar comentarios. Revisa la conexión con el servidor.",successHeader:"Éxito",errorHeader:"Error",preview:"Vista previa",viewComments:"Ver Comentarios",close:"Cerrar",observe:"Observar",pending:"Pendiente",readyForReview:"Lista para revisión",noComments:"No hay comentarios.",deleteConfirm:"Eliminar comentario",markReady:"Marcar como Listo",reopen:"Reabrir",review:"Revisar",confirmDelete:"¿Estás seguro de que deseas eliminar permanentemente este comentario? Esta acción no se puede deshacer.",markReadyConfirm:"Finalizar revisión",confirmMarkReady:"¿Deseas marcar este comentario como listo? Pasará al estado completado.",reopenConfirm:"Reabrir comentario",confirmReopen:"¿Deseas volver a poner este comentario en estado pendiente?",yes:"Sí, confirmar",no:"No, cancelar",deleteSuccess:"El comentario ha sido eliminado.",updateSuccess:"Actualizado correctamente.",navigating:"Redirigiendo a revisión...",selectToComment:"Haz clic para comentar",feedbackSubheader:"¿Qué te gustaría mejorar aquí?",sendFeedback:"Enviar Comentario",edit:"Editar",save:"Guardar",commentDetails:"Detalles del Comentario",annotations:"Comentarios",viewAll:"Ver Todos",exitConfirmTitle:"¿Cerrar ViewGate?",exitConfirmMessage:"¿Estás seguro de que deseas cerrar ViewGate? Puedes volver a activarlo en cualquier momento agregando ?viewgate=true a la URL."}},Ke=p.createContext(void 0),Qe=()=>{const e=p.useContext(Ke);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Te="viewgate_enabled",$t=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Te,"true"),!0):sessionStorage.getItem(Te)==="true",Ut=({children:e,language:t="es",apiKey:n,baseUrl:r="https://view-gate.vercel.app"})=>{const[s,a]=p.useState(!1),[i,c]=p.useState([]);p.useEffect(()=>{a($t())},[]);const m=()=>{if(sessionStorage.removeItem(Te),a(!1),typeof window<"u"){const f=new URL(window.location.href);f.searchParams.delete("viewgate"),window.history.replaceState({},"",f.toString())}},u=(f,v)=>{const h=Date.now();c(S=>[...S,{id:h,message:f,type:v}]),setTimeout(()=>{c(S=>S.filter(O=>O.id!==h))},4e3)},E=Wt[t];return o.jsxs(Ke.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:248",value:{addToast:u,language:t,t:E,apiKey:n,baseUrl:r,disableViewGate:m,hasActiveToasts:i.length>0},children:[e,s&&o.jsx(Ot,{"data-source-path":"/src/components/ViewGateProvider.tsx:259",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:260",className:"vg-container",children:[o.jsx(vt,{"data-source-path":"/src/components/ViewGateProvider.tsx:261"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:262",className:"vg-toasts",style:{zIndex:2147483646},children:i.map(f=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:`vg-toast vg-animate-slide ${f.type}`,children:[f.type==="success"?o.jsx(ne,{"data-source-path":"/src/components/ViewGateProvider.tsx:266",size:24,color:"#22c55e"}):o.jsx(Nt,{"data-source-path":"/src/components/ViewGateProvider.tsx:268",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:270",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:271",style:{display:"block",fontSize:"13px",color:"#0f172a",textTransform:"uppercase",marginBottom:"2px"},children:f.type==="success"?E.successHeader:E.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",style:{fontSize:"14px",color:"#000000"},children:f.message})]})]},f.id))})]})})]})};function Bt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}const Yt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function K(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let re=null;function qe(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=K(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Xt(e){const t=we(e,"border-left-width"),n=we(e,"border-right-width");return e.clientWidth+t+n}function Jt(e){const t=we(e,"border-top-width"),n=we(e,"border-bottom-width");return e.clientHeight+t+n}function et(e,t={}){const n=t.width||Xt(e),r=t.height||Jt(e);return{width:n,height:r}}function Zt(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const D=16384;function Kt(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function ve(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Qt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qt(e,t,n){const r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),s.appendChild(a),a.appendChild(e),Qt(s)}const L=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||L(n,t)};function en(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function tn(e,t){return qe(t).map(n=>{const r=e.getPropertyValue(n),s=e.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function nn(e,t,n,r){const s=`.${e}:${t}`,a=n.cssText?en(n):tn(n,r);return document.createTextNode(`${s}{${a}}`)}function tt(e,t,n,r){const s=window.getComputedStyle(e,n),a=s.getPropertyValue("content");if(a===""||a==="none")return;const i=Yt();try{t.className=`${t.className} ${i}`}catch{return}const c=document.createElement("style");c.appendChild(nn(i,n,s,r)),t.appendChild(c)}function rn(e,t,n){tt(e,t,":before",n),tt(e,t,":after",n)}const nt="application/font-woff",rt="image/jpeg",an={woff:nt,woff2:nt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function sn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ve(e){const t=sn(e).toLowerCase();return an[t]||""}function on(e){return e.split(/,/)[1]}function Pe(e){return e.search(/^(data:)/)!==-1}function cn(e,t){return`data:${t};base64,${e}`}async function at(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const s=await r.blob();return new Promise((a,i)=>{const c=new FileReader;c.onerror=i,c.onloadend=()=>{try{a(n({res:r,result:c.result}))}catch(m){i(m)}},c.readAsDataURL(s)})}const Ae={};function ln(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Ge(e,t,n){const r=ln(e,t,n.includeQueryParams);if(Ae[r]!=null)return Ae[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const a=await at(e,n.fetchRequestInit,({res:i,result:c})=>(t||(t=i.headers.get("Content-Type")||""),on(c)));s=cn(a,t)}catch(a){s=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;a&&(i=typeof a=="string"?a:a.message),i&&console.warn(i)}return Ae[r]=s,s}async function dn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function un(e,t){if(e.currentSrc){const a=document.createElement("canvas"),i=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,i?.drawImage(e,0,0,a.width,a.height);const c=a.toDataURL();return ve(c)}const n=e.poster,r=Ve(n),s=await Ge(n,r,t);return ve(s)}async function pn(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await be(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function mn(e,t){return L(e,HTMLCanvasElement)?dn(e):L(e,HTMLVideoElement)?un(e,t):L(e,HTMLIFrameElement)?pn(e,t):e.cloneNode(st(e))}const fn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",st=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function hn(e,t,n){var r,s;if(st(t))return t;let a=[];return fn(e)&&e.assignedNodes?a=K(e.assignedNodes()):L(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=K(e.contentDocument.body.childNodes):a=K(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),a.length===0||L(e,HTMLVideoElement)||await a.reduce((i,c)=>i.then(()=>be(c,n)).then(m=>{m&&t.appendChild(m)}),Promise.resolve()),t}function gn(e,t,n){const r=t.style;if(!r)return;const s=window.getComputedStyle(e);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):qe(n).forEach(a=>{let i=s.getPropertyValue(a);a==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),L(e,HTMLIFrameElement)&&a==="display"&&i==="inline"&&(i="block"),a==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),r.setProperty(a,i,s.getPropertyPriority(a))})}function yn(e,t){L(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),L(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function xn(e,t){if(L(e,HTMLSelectElement)){const r=Array.from(t.children).find(s=>e.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function wn(e,t,n){return L(t,Element)&&(gn(e,t,n),rn(e,t,n),yn(e,t),xn(e,t)),t}async function vn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const c=n[a].getAttribute("xlink:href");if(c){const m=e.querySelector(c),u=document.querySelector(c);!m&&u&&!r[c]&&(r[c]=await be(u,t,!0))}}const s=Object.values(r);if(s.length){const a="http://www.w3.org/1999/xhtml",i=document.createElementNS(a,"svg");i.setAttribute("xmlns",a),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const c=document.createElementNS(a,"defs");i.appendChild(c);for(let m=0;m<s.length;m++)c.appendChild(s[m]);e.appendChild(i)}return e}async function be(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>mn(r,t)).then(r=>hn(e,r,t)).then(r=>wn(e,r,t)).then(r=>vn(r,t))}const ot=/url\((['"]?)([^'"]+?)\1\)/g,bn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Sn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Cn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function En(e){const t=[];return e.replace(ot,(n,r,s)=>(t.push(s),n)),t.filter(n=>!Pe(n))}async function kn(e,t,n,r,s){try{const a=n?Bt(t,n):t,i=Ve(t);let c;return s||(c=await Ge(a,i,r)),e.replace(Cn(t),`$1${c}$3`)}catch{}return e}function Rn(e,{preferredFontFormat:t}){return t?e.replace(Sn,n=>{for(;;){const[r,,s]=bn.exec(n)||[];if(!s)return"";if(s===t)return`src: ${r};`}}):e}function it(e){return e.search(ot)!==-1}async function ct(e,t,n){if(!it(e))return e;const r=Rn(e,n);return En(r).reduce((a,i)=>a.then(c=>kn(c,i,t,n)),Promise.resolve(r))}async function ae(e,t,n){var r;const s=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(s){const a=await ct(s,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function jn(e,t){await ae("background",e,t)||await ae("background-image",e,t),await ae("mask",e,t)||await ae("-webkit-mask",e,t)||await ae("mask-image",e,t)||await ae("-webkit-mask-image",e,t)}async function _n(e,t){const n=L(e,HTMLImageElement);if(!(n&&!Pe(e.src))&&!(L(e,SVGImageElement)&&!Pe(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,s=await Ge(r,Ve(r),t);await new Promise((a,i)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...m)=>{try{a(t.onImageErrorHandler(...m))}catch(u){i(u)}}:i;const c=e;c.decode&&(c.decode=a),c.loading==="lazy"&&(c.loading="eager"),n?(e.srcset="",e.src=s):e.href.baseVal=s})}async function On(e,t){const r=K(e.childNodes).map(s=>lt(s,t));await Promise.all(r).then(()=>e)}async function lt(e,t){L(e,Element)&&(await jn(e,t),await _n(e,t),await On(e,t))}function Tn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(s=>{n[s]=r[s]}),e}const dt={};async function ut(e){let t=dt[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},dt[e]=t,t}async function pt(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let c=i.replace(r,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),at(c,t.fetchRequestInit,({result:m})=>(n=n.replace(i,`url(${m})`),[i,m]))});return Promise.all(a).then(()=>n)}function mt(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const m=s.exec(r);if(m===null)break;t.push(m[0])}r=r.replace(s,"");const a=/@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");for(;;){let m=a.exec(r);if(m===null){if(m=c.exec(r),m===null)break;a.lastIndex=c.lastIndex}else c.lastIndex=a.lastIndex;t.push(m[0])}return t}async function Vn(e,t){const n=[],r=[];return e.forEach(s=>{if("cssRules"in s)try{K(s.cssRules||[]).forEach((a,i)=>{if(a.type===CSSRule.IMPORT_RULE){let c=i+1;const m=a.href,u=ut(m).then(E=>pt(E,t)).then(E=>mt(E).forEach(f=>{try{s.insertRule(f,f.startsWith("@import")?c+=1:s.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:f,error:v})}})).catch(E=>{console.error("Error loading remote css",E.toString())});r.push(u)}})}catch(a){const i=e.find(c=>c.href==null)||document.styleSheets[0];s.href!=null&&r.push(ut(s.href).then(c=>pt(c,t)).then(c=>mt(c).forEach(m=>{i.insertRule(m,i.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(s=>{if("cssRules"in s)try{K(s.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${s.href}`,a)}}),n))}function Pn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>it(t.style.getPropertyValue("src")))}async function An(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=K(e.ownerDocument.styleSheets),r=await Vn(n,t);return Pn(r)}function ft(e){return e.trim().replace(/["']/g,"")}function Gn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(ft(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nn(e,t){const n=await An(e,t),r=Gn(e);return(await Promise.all(n.filter(a=>r.has(ft(a.style.fontFamily))).map(a=>{const i=a.parentStyleSheet?a.parentStyleSheet.href:null;return ct(a.cssText,i,t)}))).join(`
|
|
8
|
-
`)}async function Ln(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nn(e,t);if(n){const r=document.createElement("style"),s=document.createTextNode(n);r.appendChild(s),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Mn(e,t={}){const{width:n,height:r}=et(e,t),s=await be(e,t,!0);return await Ln(s,t),await lt(s,t),Tn(s,t),await qt(s,n,r)}async function In(e,t={}){const{width:n,height:r}=et(e,t),s=await Mn(e,t),a=await ve(s),i=document.createElement("canvas"),c=i.getContext("2d"),m=t.pixelRatio||Zt(),u=t.canvasWidth||n,E=t.canvasHeight||r;return i.width=u*m,i.height=E*m,t.skipAutoScale||Kt(i),i.style.width=`${u}`,i.style.height=`${E}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,i.width,i.height)),c.drawImage(a,0,0,i.width,i.height),i}async function ht(e,t={}){return(await In(e,t)).toDataURL()}const Se=2147483647,Ne=Se,Le=2e6,zn=Se-10,Dn=Se-5,Fn=Se-15,Ce="data-vg-pin-id",Hn=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},Wn=e=>{let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return Math.abs(t).toString(16)},gt=(e,t)=>{if(!e)return"";try{const n=new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat(t==="es"?"es-ES":"en-US",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(n)}catch{return""}},$n=e=>{const t=(e.innerText||"").slice(0,30).trim(),n={tag:e.tagName.toLowerCase(),classHash:Wn(e.className),textSnippet:t,parentTag:e.parentElement?.tagName.toLowerCase(),neighborCount:e.parentElement?.children.length||0},r=e.getAttribute("aria-label");r&&(n.ariaLabel=r);const s=e.getAttribute("role");s&&(n.role=s);const a=e.getAttribute("name");return a&&(n.name=a),n},Un=(()=>{let e=null,t=null;return n=>{if(!n||typeof window>"u"||typeof document>"u")return n;if(n.includes("oklch")||n.includes("oklab")||n.includes("lab(")||n.includes("lch(")||n.includes("color("))try{if(e||(e=document.createElement("canvas"),e.width=1,e.height=1),t||(t=e.getContext("2d",{willReadFrequently:!0})),t){t.fillStyle="#000000",t.fillStyle=n;const a=t.fillStyle;if(a&&!a.includes("oklch")&&!a.includes("oklab"))return a}const r=document.createElement("div");r.style.color=n,document.body.appendChild(r);const s=getComputedStyle(r).color;return document.body.removeChild(r),s&&!s.includes("oklch")?s:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return n}})(),yt=(e,t,n,r)=>new Promise(s=>{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),c=window.devicePixelRatio||1,m=t.width+n*2,u=t.height+n*2;i.width=m*c,i.height=u*c;const E=i.getContext("2d");if(E){E.scale(c,c);let f=(t.left-n)*r,v=(t.top-n)*r,h=m*r,S=u*r,O=0,P=0,W=m,$=u;f<0&&(O=Math.abs(f)/r,h+=f,W-=O,f=0),f+h>a.width&&(h=a.width-f,W=h/r),v<0&&(P=Math.abs(v)/r,S+=v,$-=P,v=0),v+S>a.height&&(S=a.height-v,$=S/r),E.fillStyle="#ffffff",E.fillRect(0,0,m,u),h>0&&S>0&&E.drawImage(a,f,v,h,S,O,P,W,$)}s(i.toDataURL("image/png"))},a.onerror=()=>s(""),a.src=e}),Bn=e=>{const t=window.getComputedStyle(e),n={};return["display","position","margin","padding","font-size","color","background-color","width","height","z-index"].forEach(s=>{const a=t.getPropertyValue(s);n[s]=Un(a)}),n},Yn=e=>{const n=Object.keys(e).find(a=>a.startsWith("__reactFiber$")||a.startsWith("__reactInternalInstance$"));if(!n)return"";const r=[];let s=e[n];for(;s;){const a=s.type;if(typeof a=="function"){const i=a.displayName||a.name;i&&!i.includes("ViewGate")&&!r.includes(i)&&r.unshift(i)}s=s.return}return r.join(" > ")||"Generic Component"},xt=e=>{if(!e)return!1;const t=window.getComputedStyle(e),n=e.getBoundingClientRect(),r=e.getAttribute("role");if(r&&["listbox","menu","combobox","tooltip","option"].includes(r))return!1;const a=120;return n.width<a&&n.height<a||t.position!=="fixed"&&t.position!=="absolute"?!1:!!(e.closest('[role="dialog"]')||e.closest('[aria-modal="true"]')||e.classList.contains("modal")||e.classList.contains("modal-content"))},se=e=>{if(!e.isConnected)return!1;const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0"||e.offsetWidth===0||e.offsetHeight===0)return!1;let n=e.parentElement;for(;n;){const s=window.getComputedStyle(n);if(s.display==="none"||s.visibility==="hidden"||s.opacity==="0")return!1;n=n.parentElement}const r=e.getBoundingClientRect();return!(r.width===0||r.height===0||r.top===0&&r.left===0&&r.width>window.innerWidth*.9)},Me=(e,t=document)=>{const n=t.querySelector(e);if(n)return n;const r=t.querySelectorAll("*");for(const s of Array.from(r)){const a=s.shadowRoot;if(a){const i=Me(e,a);if(i)return i}}return null},wt=(e,t)=>{let n=document.elementFromPoint(e,t);for(;n&&n.shadowRoot;){const r=n.shadowRoot.elementFromPoint(e,t);if(!r||r===n)break;n=r}return n},Xn=e=>{if(!e.tag)return null;const t=document.getElementsByTagName(e.tag);let n=null,r=0;for(let s=0;s<t.length;s++){const a=t[s];let i=0;const c=a.getAttribute("placeholder");e.attributes?.placeholder&&c===e.attributes.placeholder?i+=6:c&&e.attributes?.placeholder&&c.includes(e.attributes.placeholder)&&(i+=2),a.innerText?.trim()===e.text.trim()?i+=5:a.innerText?.includes(e.text.slice(0,20))&&(i+=3),e.fingerprint?.classHash&&a.className.includes(e.fingerprint.classHash)&&(i+=2),e.fingerprint?.ariaLabel&&a.getAttribute("aria-label")===e.fingerprint.ariaLabel&&(i+=3),e.fingerprint?.role&&a.getAttribute("role")===e.fingerprint.role&&(i+=2),e.parentContext&&(a.parentElement?.innerText||"").includes(e.parentContext.slice(0,30))&&(i+=2),e.fingerprint?.neighborCount===a.parentElement?.children.length&&(i+=1),e.fingerprint?.parentTag===a.parentElement?.tagName.toLowerCase()&&(i+=1),i>r&&i>=7&&(r=i,n=a)}return n},Jn=(e,t)=>{if(t){const r=Array.from(document.querySelectorAll(`[${Ce}="${t}"]`));if(r.length>0){const s=r.find(a=>!(!se(a)||e.metadata?.isModal&&!a.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')));return s?(r.forEach(a=>{a!==s&&a.removeAttribute(Ce)}),s):null}}let n=Me(e.selector);if(n&&se(n))if(e.metadata?.isModal&&!n.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))n=null;else return n;if(e.fallbackSelectors){for(const r of e.fallbackSelectors)if(n=Me(r),n&&se(n)){if(e.metadata?.isModal&&!n.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))continue;return n}}return n=Xn(e),n&&se(n)?e.metadata?.isModal&&!n.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')?null:n:null},Ie=e=>({tag:e.tagName.toLowerCase(),text:(e.innerText||e.getAttribute("placeholder")||"").slice(0,50).trim(),role:e.getAttribute("role")||void 0,type:e.getAttribute("type")||void 0}),Zn=e=>{const t=e.parentElement;if(!t)return;const n=Array.from(t.children).filter(i=>i!==e).slice(0,5).map(i=>Ie(i)),r=Array.from(t.children),s=r.indexOf(e);let a="middle";return s===0&&(a="start"),s===r.length-1&&(a="end"),{target:{...Ie(e),location:`${a} of ${t.tagName.toLowerCase()}`},parent:Ie(t),siblings:n}},Kn=e=>{let t="unknown:0",n=e;for(;n;){const f=n.getAttribute("data-source-path");if(f){t=f;break}n=n.parentElement}const r=Yn(e),s=[],a=[],i=f=>{const v=[];let h=f;for(;h&&h.nodeType===Node.ELEMENT_NODE;){let S=h.nodeName.toLowerCase();a.unshift(S);const O=h.id&&!h.id.startsWith("__")?h.id:null;O&&s.push(`#${O}`);const P=h.getAttribute("data-testid")||h.getAttribute("data-qa");P&&s.push(`[data-testid="${P}"]`);const W=h.getAttribute("placeholder"),$=h.getAttribute("aria-label"),A=h.getAttribute("role"),U=h.getAttribute("name"),T=h.getAttribute("title");if(P){S=`[${h.hasAttribute("data-testid")?"data-testid":"data-qa"}="${P}"]`,v.unshift(S);break}else if(O){S="#"+O,v.unshift(S);break}else if(W){S=`${h.localName}[placeholder="${W}"]`,v.unshift(S);break}else if($){S=`${h.localName}[aria-label="${$}"]`,v.unshift(S);break}else if(A){S=`${h.localName}[role="${A}"]`,v.unshift(S);break}else if(U){S=`${h.localName}[name="${U}"]`,v.unshift(S);break}else if(T){S=`${h.localName}[title="${T}"]`,v.unshift(S);break}else{let Z=h,G=1;for(;Z.previousElementSibling;)Z=Z.previousElementSibling,Z.nodeName.toLowerCase()===h.nodeName.toLowerCase()&&G++;G>1&&(S+=`:nth-of-type(${G})`)}v.unshift(S),h=h.parentElement}return v.join(" > ")},c=xt(e.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')),m=i(e),u={};["placeholder","aria-label","name","type","alt","title","value","role"].forEach(f=>{const v=e.getAttribute(f);v&&(u[f]=v)});const E=`${e.tagName.toLowerCase()}-${(e.innerText||"").slice(0,20).replace(/\s+/g,"_")}-${m.split(" > ").slice(-1)}`;return{tag:e.tagName.toLowerCase(),id:e.id||"",classes:e.className||"",text:(e.innerText||"").slice(0,100).trim(),selector:m,outerHtml:e.outerHTML,parentContext:(e.parentElement?.innerText||"").slice(0,150).trim(),componentPath:r,signature:E,source:t,attributes:u,fallbackSelectors:[...new Set(s)].slice(0,5),domPath:a.slice(-10),viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:Zn(e),fingerprint:$n(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Bn(e),viewportBreakpoint:Hn(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:c}}},vt=()=>{const{addToast:e,language:t,t:n,apiKey:r,baseUrl:s,disableViewGate:a,hasActiveToasts:i}=Qe(),[c,m]=p.useState(!1),[u,E]=p.useState(null),[f,v]=p.useState(null),[h,S]=p.useState(""),[O,P]=p.useState(!1),[W,$]=p.useState(!1),[A,U]=p.useState(!1),[T,Z]=p.useState([]),[G,Y]=p.useState(null),[Ee,bt]=p.useState(!1),[pe,oe]=p.useState(!1),[ke,Re]=p.useState({}),[X,ie]=p.useState(null),[q,me]=p.useState(!1),[fe,je]=p.useState([]),[l,x]=p.useState(()=>{if(typeof window>"u")return{top:24,right:24};const d=localStorage.getItem("vg-exit-pos");return d?JSON.parse(d):{top:24,right:24}}),[k,R]=p.useState(!1),M=p.useRef(null),[J,j]=p.useState(()=>{if(typeof window>"u")return{bottom:30,right:30};const d=localStorage.getItem("vg-bar-pos");return d?JSON.parse(d):{bottom:30,right:30}}),[F,ce]=p.useState(!1),B=p.useRef(null),er=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(R(!0),M.current={x:d.clientX,y:d.clientY,top:l.top,right:l.right,width:g.width,height:g.height})},tr=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(ce(!0),B.current={x:d.clientX,y:d.clientY,bottom:J.bottom,right:J.right,width:g.width,height:g.height})};p.useEffect(()=>{if(!k&&!F)return;const d=w=>{if(k&&M.current){const V=w.clientX-M.current.x,_=w.clientY-M.current.y;let C=M.current.top+_,y=M.current.right-V;const b=10;C=Math.max(b,Math.min(window.innerHeight-M.current.height-b,C)),y=Math.max(b,Math.min(window.innerWidth-M.current.width-b,y)),x({top:C,right:y})}if(F&&B.current){const V=w.clientX-B.current.x,_=w.clientY-B.current.y;let C=B.current.bottom-_,y=B.current.right-V;const b=10;C=Math.max(b,Math.min(window.innerHeight-B.current.height-b,C)),y=Math.max(b,Math.min(window.innerWidth-B.current.width-b,y)),j({bottom:C,right:y})}},g=()=>{k&&(R(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(l)),M.current=null),F&&(ce(!1),localStorage.setItem("vg-bar-pos",JSON.stringify(J)),B.current=null)};return window.addEventListener("mousemove",d),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",g)}},[k,F,l,J]);const[St,De]=p.useState(null),[Ct,Et]=p.useState(""),[yr,xr]=p.useState({}),le=p.useRef(null),he=p.useRef(null),ge=p.useCallback(()=>{he.current||(he.current=requestAnimationFrame(()=>{const d=new Map,w=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(C=>xt(C)&&se(C)),V=!!w;T.forEach(C=>{if(!C.reference)return;const y=Jn(C.reference,C._id);if(!y||!se(y))return;const b=!!C.reference.metadata?.isModal;let H=!1;if(V?H=w.contains(y):H=!b,!H)return;y.getAttribute(Ce)||y.setAttribute(Ce,C._id),d.has(y)||d.set(y,[]),d.get(y).push(C)});const _=[];d.forEach((C,y)=>{const b=y.getBoundingClientRect(),H=b.left+b.width/2,I=b.top+b.height/2;if(H>=0&&H<=window.innerWidth&&I>=0&&I<=window.innerHeight){const Q=document.elementFromPoint(H,I);if(Q&&!y.contains(Q)&&!le.current?.contains(Q))return}_.push({id:C[0]._id,element:y,rect:b,annotations:C.sort((Q,te)=>new Date(te.timestamp||te.createdAt).getTime()-new Date(Q.timestamp||Q.createdAt).getTime()),isModal:!!C[0].reference?.metadata?.isModal})}),je(_),he.current=null}))},[T]),ee=p.useCallback(async()=>{if(r){oe(!0);try{const d=await fetch(`${s}/api/annotations`,{headers:{"x-api-key":r}});if(d.ok){const V=((await d.json()).data||[]).reduce((_,C)=>_.find(b=>b._id===C._id)?_:_.concat([C]),[]);Z(V)}}catch(d){console.error("Failed to fetch annotations",d)}finally{oe(!1)}}},[r,s]);p.useEffect(()=>{A&&T.length===0&&!pe&&U(!1)},[A,T.length,pe]),p.useEffect(()=>{if(!c&&T.length>0){ge();const d=new MutationObserver(()=>ge()),g=new ResizeObserver(()=>ge()),w=()=>ge();return d.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),g.observe(document.documentElement),window.addEventListener("scroll",w,!0),()=>{d.disconnect(),g.disconnect(),window.removeEventListener("scroll",w,!0),he.current&&cancelAnimationFrame(he.current)}}},[c,T.length,ge]),p.useEffect(()=>{ee()},[ee]),p.useEffect(()=>{le.current=document.getElementById("viewgate-shadow-host")},[]);const Fe=p.useCallback(d=>{if(!c||f)return;const g=wt(d.clientX,d.clientY);if(!g||le.current?.contains(g)||g.closest(".vg-no-capture")){E(null);return}const w=g.getBoundingClientRect();E({tag:g.tagName.toLowerCase(),source:g.getAttribute("data-source-path")||"unknown:0",rect:w,element:g,previewText:(g.innerText||"").slice(0,100)||(g.getAttribute("placeholder")||"").slice(0,100)||g.tagName.toLowerCase(),semanticReference:{...Kn(g),normalizedOffset:{x:(d.clientX-w.left)/w.width,y:(d.clientY-w.top)/w.height}}})},[c,f]),He=p.useCallback(async d=>{if(!c||f)return;const g=wt(d.clientX,d.clientY);if(!(!g||le.current?.contains(g)||g.closest(".vg-no-capture"))&&u){d.preventDefault(),d.stopPropagation(),$(!0);try{const _=window.scrollX,C=window.scrollY,y=await ht(document.documentElement,{pixelRatio:1.5,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",style:{transform:`scale(${1/window.devicePixelRatio}) translate(-${_}px, -${C}px)`,transformOrigin:"top left"},filter:te=>{const _e=te;return!(le.current?.contains(_e)||_e.id==="viewgate-ui")}}),b=u.element.getBoundingClientRect(),H=b.top>=0&&b.left>=0&&b.bottom<=window.innerHeight&&b.right<=window.innerWidth;let I="";if(H&&b.width>0&&b.height>0)I=await yt(y,b,24,1.5);else try{I=await ht(u.element,{pixelRatio:2,cacheBust:!0,backgroundColor:"#ffffff",filter:te=>{const _e=te;return!le.current?.contains(_e)}})}catch{I=await yt(y,b,24,1.5)}const Q={...u.semanticReference,metadata:{...u.semanticReference.metadata,screenshotUrl:y,elementScreenshot:I}};v({...u,visualPreview:I,semanticReference:Q})}catch(w){console.error("Failed to capture preview:",w),v(u)}finally{$(!1),E(null)}}},[c,u,f]);p.useEffect(()=>{const d=g=>{if(g.key==="Escape"){f?v(null):A?U(!1):c&&m(!1);return}const V=(()=>{let y=document.activeElement;for(;y&&y.shadowRoot&&y.shadowRoot.activeElement;)y=y.shadowRoot.activeElement;return y})();if(["input","textarea"].includes((V?.tagName||"").toLowerCase())||V?.isContentEditable)return;const C=g.key.toLowerCase();C==="c"&&!f&&!A&&m(y=>!y),C==="v"&&!f&&(T.length>0||A)&&(U(y=>!y),A||m(!1))};return c&&!f?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",d),window.addEventListener("mousemove",Fe,!0),window.addEventListener("click",He,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",d),window.removeEventListener("mousemove",Fe,!0),window.removeEventListener("click",He,!0)}},[c,f,A,T,Fe,He]);const nr=async()=>{if(!f||!h.trim())return;P(!0);const{semanticReference:d}=f,[g,w]=(d.source||"").split(":"),V=w||"0";try{if(!(await fetch(`${s}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({filePath:g,line:parseInt(V),url:window.location.href,message:h,componentName:d.componentPath||f.tag,reference:{...d,viewport:{width:window.innerWidth,height:window.innerHeight},userAgent:navigator.userAgent,timestamp:new Date().toISOString()}})})).ok)throw new Error("Backend failed");e(n.success,"success"),v(null),S(""),m(!1),ee()}catch(_){console.error(_),e(n.error,"error")}finally{P(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1080",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1081",className:"vg-no-capture",children:[!i&&o.jsxs("div",{style:{position:"fixed",top:`${l.top}px`,right:`${l.right}px`,zIndex:Ne+10,display:"flex",alignItems:"center",gap:"8px",transition:k?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:er,style:{width:"20px",height:"32px",borderRadius:"6px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:c?0:1,visibility:c?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor="white",d.currentTarget.style.color="#000000"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",d.currentTarget.style.color="#1e293b"},children:o.jsx(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1125",size:14})}),o.jsx("button",{onClick:d=>{d.stopPropagation(),Y({title:n.exitConfirmTitle||"Close ViewGate?",message:n.exitConfirmMessage||"Are you sure you want to close ViewGate?",type:"danger",onConfirm:()=>a()})},title:"Cerrar ViewGate",style:{width:"40px",height:"40px",borderRadius:"12px",backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(0,0,0,0.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",cursor:"pointer",color:"#64748b",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseEnter:d=>{d.currentTarget.style.transform="scale(1.1) rotate(90deg)",d.currentTarget.style.color="#ef4444",d.currentTarget.style.backgroundColor="white"},onMouseLeave:d=>{d.currentTarget.style.transform="scale(1) rotate(0deg)",d.currentTarget.style.color="#64748b",d.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.9)"},children:o.jsx(Oe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1165",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1171",style:{position:"fixed",bottom:`${J.bottom}px`,right:`${J.right}px`,zIndex:Ne,display:"flex",alignItems:"center",gap:"8px",transition:F?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:tr,style:{width:"24px",height:"40px",borderRadius:"10px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:c?0:1,visibility:c?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor="white",d.currentTarget.style.color="#000000"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",d.currentTarget.style.color="#1e293b"},className:"vg-animate-slide-up",children:o.jsx(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1214",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1217",className:"vg-action-bar vg-animate-slide-up",style:{transition:"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("button",{onClick:()=>m(!c),className:"vg-button-primary vg-animate-pop",style:{padding:"12px 24px",background:c?"#ef4444":void 0},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1226",style:{display:"flex",alignItems:"center",gap:"10px"},children:[c?o.jsx(Oe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1227",size:20,className:"vg-animate-pop"}):o.jsx(xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1227",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1228",children:c?n.exitMode:n.enterMode})]})}),T.length>0&&o.jsxs("button",{onClick:()=>{U(!A),m(!1),v(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Mt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1241",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1242",children:n.viewComments})]})]})]}),W&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1250",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Ne+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1256",className:"vg-glassmorphism",style:{padding:"30px 50px",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1257",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1258",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),c&&!f&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1265",className:"vg-backdrop-blur",style:{opacity:1,clipPath:u?`polygon(
|
|
7
|
+
<%s key={someKey} {...props} />`,E,k,z,k),_e[k+E]=!0)}if(k=null,S!==void 0&&(n(S),k=""+S),c(x)&&(n(x.key),k=""+x.key),"key"in x){S={};for(var ce in x)ce!=="key"&&(S[ce]=x[ce])}else S=x;return k&&i(S,typeof l=="function"?l.displayName||l.name||"Unknown":l),p(l,k,S,a(),G,B)}function h(l){C(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===ke&&(l._payload.status==="fulfilled"?C(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function C(l){return typeof l=="object"&&l!==null&&l.$$typeof===O}var j=m,O=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),K=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),De=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),ke=Symbol.for("react.lazy"),St=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),oe=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Re=Object.prototype.hasOwnProperty,je=Array.isArray,U=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(l){return l()}};var ie,ee={},fe=j.react_stack_bottom_frame.bind(j,s)(),he=U(r(s)),_e={};ue.Fragment=W,ue.jsx=function(l,x,S){var E=1e4>oe.recentlyCreatedOwnerStacks++;return f(l,x,S,!1,E?Error("react-stack-top-frame"):fe,E?U(r(l)):he)},ue.jsxs=function(l,x,S){var E=1e4>oe.recentlyCreatedOwnerStacks++;return f(l,x,S,!0,E?Error("react-stack-top-frame"):fe,E?U(r(l)):he)}})()),ue}var Be;function Ot(){return Be||(Be=1,process.env.NODE_ENV==="production"?xe.exports=jt():xe.exports=_t()),xe.exports}var o=Ot();const Tt=({children:e})=>{const t=m.useRef(null),[n,r]=m.useState(null);return m.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const a=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(i=>{(i.textContent?.includes(".vg-")||i.textContent?.includes("--vg-"))&&a.appendChild(i.cloneNode(!0))});const c=document.createElement("link");c.rel="stylesheet",c.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap",a.appendChild(c),r(a)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:n&&Rt.createPortal(e,n)})};const Ye=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Pt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Vt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Xe=e=>{const t=Vt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var At={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Gt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Nt=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:c,...i},u)=>m.createElement("svg",{ref:u,...At,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ye("lucide",a),...!s&&!Gt(i)&&{"aria-hidden":"true"},...i},[...c.map(([p,f])=>m.createElement(p,f)),...Array.isArray(s)?s:[s]]));const P=(e,t)=>{const n=m.forwardRef(({className:r,...a},s)=>m.createElement(Nt,{ref:s,iconNode:t,className:Ye(`lucide-${Pt(Xe(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Xe(e),n};const Mt=P("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const re=P("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const It=P("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const Je=P("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const Lt=P("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Ze=P("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const zt=P("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const we=P("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);const Dt=P("mouse-pointer-2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);const Ft=P("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Ht=P("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const Wt=P("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Ke=P("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Te=P("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$t={en:{enterMode:"Enter Feedback Mode",exitMode:"Exit Mode",feedbackHeader:"Feedback",selectedElement:"Selected element:",line:"Line",placeholder:"Tell us what you'd like to change...",cancel:"Cancel",send:"Send Feedback",submitting:"Submitting...",success:"Your feedback has been submitted successfully!",error:"Failed to submit feedback. Check backend connection.",successHeader:"Success",errorHeader:"Error",preview:"Preview",viewComments:"View Comments",close:"Close",observe:"Observe",pending:"Pending",readyForReview:"Ready for Review",noComments:"No comments found.",deleteConfirm:"Delete comment",markReady:"Mark as Ready",reopen:"Reopen",review:"Review",confirmDelete:"Are you sure you want to permanently delete this comment? This action cannot be undone.",markReadyConfirm:"Complete review",confirmMarkReady:"Do you want to mark this comment as ready? it will be moved to the completed state.",reopenConfirm:"Reopen comment",confirmReopen:"Do you want to set this comment back to pending status?",yes:"Yes, confirm",no:"No, cancel",deleteSuccess:"Comment deleted successfully.",updateSuccess:"Updated successfully.",navigating:"Redirecting to review...",selectToComment:"Click to comment",feedbackSubheader:"What would you like to improve here?",sendFeedback:"Send Comment",edit:"Edit",save:"Save",commentDetails:"Comment Details",annotations:"Comments",viewAll:"View All",exitConfirmTitle:"Close ViewGate?",exitConfirmMessage:"Are you sure you want to close ViewGate? You can reopen it at any time by adding ?viewgate=true to your URL."},es:{enterMode:"Activar Modo Comentarios",exitMode:"Salir del Modo",feedbackHeader:"Comentarios",selectedElement:"Elemento seleccionado:",line:"Línea",placeholder:"Cuéntanos qué te gustaría cambiar...",cancel:"Cancelar",send:"Enviar Comentarios",submitting:"Enviando...",success:"¡Tus comentarios se han enviado con éxito!",error:"Error al enviar comentarios. Revisa la conexión con el servidor.",successHeader:"Éxito",errorHeader:"Error",preview:"Vista previa",viewComments:"Ver Comentarios",close:"Cerrar",observe:"Observar",pending:"Pendiente",readyForReview:"Lista para revisión",noComments:"No hay comentarios.",deleteConfirm:"Eliminar comentario",markReady:"Marcar como Listo",reopen:"Reabrir",review:"Revisar",confirmDelete:"¿Estás seguro de que deseas eliminar permanentemente este comentario? Esta acción no se puede deshacer.",markReadyConfirm:"Finalizar revisión",confirmMarkReady:"¿Deseas marcar este comentario como listo? Pasará al estado completado.",reopenConfirm:"Reabrir comentario",confirmReopen:"¿Deseas volver a poner este comentario en estado pendiente?",yes:"Sí, confirmar",no:"No, cancelar",deleteSuccess:"El comentario ha sido eliminado.",updateSuccess:"Actualizado correctamente.",navigating:"Redirigiendo a revisión...",selectToComment:"Haz clic para comentar",feedbackSubheader:"¿Qué te gustaría mejorar aquí?",sendFeedback:"Enviar Comentario",edit:"Editar",save:"Guardar",commentDetails:"Detalles del Comentario",annotations:"Comentarios",viewAll:"Ver Todos",exitConfirmTitle:"¿Cerrar ViewGate?",exitConfirmMessage:"¿Estás seguro de que deseas cerrar ViewGate? Puedes volver a activarlo en cualquier momento agregando ?viewgate=true a la URL."}},Qe=m.createContext(void 0),qe=()=>{const e=m.useContext(Qe);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Pe="viewgate_enabled",Ut=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Pe,"true"),!0):sessionStorage.getItem(Pe)==="true",Bt=({children:e,language:t="es",apiKey:n,baseUrl:r="https://view-gate.vercel.app"})=>{const[a,s]=m.useState(!1),[c,i]=m.useState([]);m.useEffect(()=>{s(Ut())},[]);const u=()=>{if(sessionStorage.removeItem(Pe),s(!1),typeof window<"u"){const h=new URL(window.location.href);h.searchParams.delete("viewgate"),window.history.replaceState({},"",h.toString())}},p=(h,C)=>{const j=Date.now();i(O=>[...O,{id:j,message:h,type:C}]),setTimeout(()=>{i(O=>O.filter(I=>I.id!==j))},4e3)},f=$t[t];return o.jsxs(Qe.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:252",value:{addToast:p,language:t,t:f,apiKey:n,baseUrl:r,disableViewGate:u,hasActiveToasts:c.length>0},children:[e,a&&o.jsx(Tt,{"data-source-path":"/src/components/ViewGateProvider.tsx:263",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:"vg-container",children:[o.jsx(bt,{"data-source-path":"/src/components/ViewGateProvider.tsx:265"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:266",className:"vg-toasts",style:{zIndex:2147483646},children:c.map(h=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:268",className:`vg-toast vg-animate-slide ${h.type}`,children:[h.type==="success"?o.jsx(re,{"data-source-path":"/src/components/ViewGateProvider.tsx:270",size:24,color:"#22c55e"}):o.jsx(Mt,{"data-source-path":"/src/components/ViewGateProvider.tsx:272",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:275",style:{display:"block",fontSize:"13px",color:"#0f172a",textTransform:"uppercase",marginBottom:"2px"},children:h.type==="success"?f.successHeader:f.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:278",style:{fontSize:"14px",color:"#000000"},children:h.message})]})]},h.id))})]})})]})};function Yt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),a=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(a),t&&(r.href=t),a.href=e,a.href}const Xt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function X(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let ae=null;function et(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=X(window.getComputedStyle(document.documentElement)),ae))}function ve(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Jt(e){const t=ve(e,"border-left-width"),n=ve(e,"border-right-width");return e.clientWidth+t+n}function Zt(e){const t=ve(e,"border-top-width"),n=ve(e,"border-bottom-width");return e.clientHeight+t+n}function tt(e,t={}){const n=t.width||Jt(e),r=t.height||Zt(e);return{width:n,height:r}}function Kt(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const M=16384;function Qt(e){(e.width>M||e.height>M)&&(e.width>M&&e.height>M?e.width>e.height?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M):e.width>M?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M))}function be(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function qt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function en(e,t,n){const r="http://www.w3.org/2000/svg",a=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${n}`),a.setAttribute("viewBox",`0 0 ${t} ${n}`),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),qt(a)}const V=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||V(n,t)};function tn(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function nn(e,t){return et(t).map(n=>{const r=e.getPropertyValue(n),a=e.getPropertyPriority(n);return`${n}: ${r}${a?" !important":""};`}).join(" ")}function rn(e,t,n,r){const a=`.${e}:${t}`,s=n.cssText?tn(n):nn(n,r);return document.createTextNode(`${a}{${s}}`)}function nt(e,t,n,r){const a=window.getComputedStyle(e,n),s=a.getPropertyValue("content");if(s===""||s==="none")return;const c=Xt();try{t.className=`${t.className} ${c}`}catch{return}const i=document.createElement("style");i.appendChild(rn(c,n,a,r)),t.appendChild(i)}function an(e,t,n){nt(e,t,":before",n),nt(e,t,":after",n)}const rt="application/font-woff",at="image/jpeg",sn={woff:rt,woff2:rt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:at,jpeg:at,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function on(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ve(e){const t=on(e).toLowerCase();return sn[t]||""}function cn(e){return e.split(/,/)[1]}function Ae(e){return e.search(/^(data:)/)!==-1}function ln(e,t){return`data:${t};base64,${e}`}async function st(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const a=await r.blob();return new Promise((s,c)=>{const i=new FileReader;i.onerror=c,i.onloadend=()=>{try{s(n({res:r,result:i.result}))}catch(u){c(u)}},i.readAsDataURL(a)})}const Ge={};function dn(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Ne(e,t,n){const r=dn(e,t,n.includeQueryParams);if(Ge[r]!=null)return Ge[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await st(e,n.fetchRequestInit,({res:c,result:i})=>(t||(t=c.headers.get("Content-Type")||""),cn(i)));a=ln(s,t)}catch(s){a=n.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;s&&(c=typeof s=="string"?s:s.message),c&&console.warn(c)}return Ge[r]=a,a}async function un(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):be(t)}async function pn(e,t){if(e.currentSrc){const s=document.createElement("canvas"),c=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,c?.drawImage(e,0,0,s.width,s.height);const i=s.toDataURL();return be(i)}const n=e.poster,r=Ve(n),a=await Ne(n,r,t);return be(a)}async function mn(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await Se(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function fn(e,t){return V(e,HTMLCanvasElement)?un(e):V(e,HTMLVideoElement)?pn(e,t):V(e,HTMLIFrameElement)?mn(e,t):e.cloneNode(ot(e))}const hn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ot=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function gn(e,t,n){var r,a;if(ot(t))return t;let s=[];return hn(e)&&e.assignedNodes?s=X(e.assignedNodes()):V(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=X(e.contentDocument.body.childNodes):s=X(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||V(e,HTMLVideoElement)||await s.reduce((c,i)=>c.then(()=>Se(i,n)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function yn(e,t,n){const r=t.style;if(!r)return;const a=window.getComputedStyle(e);a.cssText?(r.cssText=a.cssText,r.transformOrigin=a.transformOrigin):et(n).forEach(s=>{let c=a.getPropertyValue(s);s==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),V(e,HTMLIFrameElement)&&s==="display"&&c==="inline"&&(c="block"),s==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),r.setProperty(s,c,a.getPropertyPriority(s))})}function xn(e,t){V(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),V(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function wn(e,t){if(V(e,HTMLSelectElement)){const r=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));r&&r.setAttribute("selected","")}}function vn(e,t,n){return V(t,Element)&&(yn(e,t,n),an(e,t,n),xn(e,t),wn(e,t)),t}async function bn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const i=n[s].getAttribute("xlink:href");if(i){const u=e.querySelector(i),p=document.querySelector(i);!u&&p&&!r[i]&&(r[i]=await Se(p,t,!0))}}const a=Object.values(r);if(a.length){const s="http://www.w3.org/1999/xhtml",c=document.createElementNS(s,"svg");c.setAttribute("xmlns",s),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const i=document.createElementNS(s,"defs");c.appendChild(i);for(let u=0;u<a.length;u++)i.appendChild(a[u]);e.appendChild(c)}return e}async function Se(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>fn(r,t)).then(r=>gn(e,r,t)).then(r=>vn(e,r,t)).then(r=>bn(r,t))}const it=/url\((['"]?)([^'"]+?)\1\)/g,Sn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Cn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function En(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function kn(e){const t=[];return e.replace(it,(n,r,a)=>(t.push(a),n)),t.filter(n=>!Ae(n))}async function Rn(e,t,n,r,a){try{const s=n?Yt(t,n):t,c=Ve(t);let i;return a||(i=await Ne(s,c,r)),e.replace(En(t),`$1${i}$3`)}catch{}return e}function jn(e,{preferredFontFormat:t}){return t?e.replace(Cn,n=>{for(;;){const[r,,a]=Sn.exec(n)||[];if(!a)return"";if(a===t)return`src: ${r};`}}):e}function ct(e){return e.search(it)!==-1}async function lt(e,t,n){if(!ct(e))return e;const r=jn(e,n);return kn(r).reduce((s,c)=>s.then(i=>Rn(i,c,t,n)),Promise.resolve(r))}async function se(e,t,n){var r;const a=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(a){const s=await lt(a,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function _n(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function On(e,t){const n=V(e,HTMLImageElement);if(!(n&&!Ae(e.src))&&!(V(e,SVGImageElement)&&!Ae(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,a=await Ne(r,Ve(r),t);await new Promise((s,c)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...u)=>{try{s(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const i=e;i.decode&&(i.decode=s),i.loading==="lazy"&&(i.loading="eager"),n?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Tn(e,t){const r=X(e.childNodes).map(a=>dt(a,t));await Promise.all(r).then(()=>e)}async function dt(e,t){V(e,Element)&&(await _n(e,t),await On(e,t),await Tn(e,t))}function Pn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(a=>{n[a]=r[a]}),e}const ut={};async function pt(e){let t=ut[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},ut[e]=t,t}async function mt(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async c=>{let i=c.replace(r,"$1");return i.startsWith("https://")||(i=new URL(i,e.url).href),st(i,t.fetchRequestInit,({result:u})=>(n=n.replace(c,`url(${u})`),[c,u]))});return Promise.all(s).then(()=>n)}function ft(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(r);if(u===null)break;t.push(u[0])}r=r.replace(a,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",i=new RegExp(c,"gi");for(;;){let u=s.exec(r);if(u===null){if(u=i.exec(r),u===null)break;s.lastIndex=i.lastIndex}else i.lastIndex=s.lastIndex;t.push(u[0])}return t}async function Vn(e,t){const n=[],r=[];return e.forEach(a=>{if("cssRules"in a)try{X(a.cssRules||[]).forEach((s,c)=>{if(s.type===CSSRule.IMPORT_RULE){let i=c+1;const u=s.href,p=pt(u).then(f=>mt(f,t)).then(f=>ft(f).forEach(h=>{try{a.insertRule(h,h.startsWith("@import")?i+=1:a.cssRules.length)}catch(C){console.error("Error inserting rule from remote css",{rule:h,error:C})}})).catch(f=>{console.error("Error loading remote css",f.toString())});r.push(p)}})}catch(s){const c=e.find(i=>i.href==null)||document.styleSheets[0];a.href!=null&&r.push(pt(a.href).then(i=>mt(i,t)).then(i=>ft(i).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(i=>{console.error("Error loading remote stylesheet",i)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(a=>{if("cssRules"in a)try{X(a.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),n))}function An(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>ct(t.style.getPropertyValue("src")))}async function Gn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=X(e.ownerDocument.styleSheets),r=await Vn(n,t);return An(r)}function ht(e){return e.trim().replace(/["']/g,"")}function Nn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(s=>{t.add(ht(s))}),Array.from(r.children).forEach(s=>{s instanceof HTMLElement&&n(s)})}return n(e),t}async function Mn(e,t){const n=await Gn(e,t),r=Nn(e);return(await Promise.all(n.filter(s=>r.has(ht(s.style.fontFamily))).map(s=>{const c=s.parentStyleSheet?s.parentStyleSheet.href:null;return lt(s.cssText,c,t)}))).join(`
|
|
8
|
+
`)}async function In(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Mn(e,t);if(n){const r=document.createElement("style"),a=document.createTextNode(n);r.appendChild(a),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Ln(e,t={}){const{width:n,height:r}=tt(e,t),a=await Se(e,t,!0);return await In(a,t),await dt(a,t),Pn(a,t),await en(a,n,r)}async function zn(e,t={}){const{width:n,height:r}=tt(e,t),a=await Ln(e,t),s=await be(a),c=document.createElement("canvas"),i=c.getContext("2d"),u=t.pixelRatio||Kt(),p=t.canvasWidth||n,f=t.canvasHeight||r;return c.width=p*u,c.height=f*u,t.skipAutoScale||Qt(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(i.fillStyle=t.backgroundColor,i.fillRect(0,0,c.width,c.height)),i.drawImage(s,0,0,c.width,c.height),c}async function gt(e,t={}){return(await zn(e,t)).toDataURL()}const Ce=2147483647,Me=Ce,Ie=2e6,Dn=Ce-10,Fn=Ce-5,Hn=Ce-15,Q="data-vg-pin-id",Wn=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},yt=(e,t)=>{if(!e)return"";try{const n=new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat(t==="es"?"es-ES":"en-US",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(n)}catch{return""}},pe=e=>{const t=[],n=[],r=[];let a=e;for(;a&&a.nodeType===Node.ELEMENT_NODE;){if(a.id&&!a.id.startsWith("vg-")&&!a.id.includes(":")){t.unshift(`#${a.id}`),r.unshift(`${a.localName}#${a.id}`);break}let s=a.localName;const c=Array.from(a.parentNode?.children||[]).indexOf(a),i=`${a.localName}[${c}]`;r.unshift(i);const u=a.getAttribute("data-testid")||a.getAttribute("data-qa");if(u&&n.push(`[data-testid="${u}"]`),a.getAttribute("placeholder"),a.getAttribute("aria-label"),a.getAttribute("role"),a.getAttribute("name"),a.getAttribute("title"),u){s=`[${a.hasAttribute("data-testid")?"data-testid":"data-qa"}="${u}"]`,t.unshift(s);break}const p=Array.from(a.parentNode?.children||[]).filter(f=>f.localName===a?.localName);if(p.length>1){const f=p.indexOf(a)+1;s+=`:nth-of-type(${f})`}t.unshift(s),a=a.parentElement}return{selector:t.join(" > "),fallbacks:n,vgPath:r.join(" > ")}},$n=e=>{const{vgPath:t}=pe(e);return{vgPath:t,classHash:e.className,parentTag:e.parentElement?.tagName.toLowerCase(),neighborCount:e.parentElement?.children.length,ariaLabel:e.getAttribute("aria-label")||void 0,role:e.getAttribute("role")||void 0,name:e.getAttribute("name")||void 0,type:e.getAttribute("type")||void 0,placeholder:e.getAttribute("placeholder")||void 0,textSnippet:(e.innerText||"").slice(0,30).trim()}},Un=(()=>{let e=null,t=null;return n=>{if(!n||typeof window>"u"||typeof document>"u")return n;if(n.includes("oklch")||n.includes("oklab")||n.includes("lab(")||n.includes("lch(")||n.includes("color("))try{if(e||(e=document.createElement("canvas"),e.width=1,e.height=1),t||(t=e.getContext("2d",{willReadFrequently:!0})),t){t.fillStyle="#000000",t.fillStyle=n;const s=t.fillStyle;if(s&&!s.includes("oklch")&&!s.includes("oklab"))return s}const r=document.createElement("div");r.style.color=n,document.body.appendChild(r);const a=getComputedStyle(r).color;return document.body.removeChild(r),a&&!a.includes("oklch")?a:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return n}})(),xt=(e,t,n,r)=>new Promise(a=>{const s=new Image;s.onload=()=>{const c=document.createElement("canvas"),i=window.devicePixelRatio||1,u=t.width+n*2,p=t.height+n*2;c.width=u*i,c.height=p*i;const f=c.getContext("2d");if(f){f.scale(i,i);let h=(t.left-n)*r,C=(t.top-n)*r,j=u*r,O=p*r,I=0,W=0,J=u,Z=p;h<0&&(I=Math.abs(h)/r,j+=h,J-=I,h=0),h+j>s.width&&(j=s.width-h,J=j/r),C<0&&(W=Math.abs(C)/r,O+=C,Z-=W,C=0),C+O>s.height&&(O=s.height-C,Z=O/r),f.fillStyle="#ffffff",f.fillRect(0,0,u,p),j>0&&O>0&&f.drawImage(s,h,C,j,O,I,W,J,Z)}a(c.toDataURL("image/png"))},s.onerror=()=>a(""),s.src=e}),Bn=e=>{const t=window.getComputedStyle(e),n={};return["display","position","margin","padding","font-size","color","background-color","width","height","z-index"].forEach(a=>{const s=t.getPropertyValue(a);n[a]=Un(s)}),n},Yn=e=>{const n=Object.keys(e).find(s=>s.startsWith("__reactFiber$")||s.startsWith("__reactInternalInstance$"));if(!n)return"";const r=[];let a=e[n];for(;a;){const s=a.type;if(typeof s=="function"){const c=s.displayName||s.name;c&&!c.includes("ViewGate")&&!r.includes(c)&&r.unshift(c)}a=a.return}return r.join(" > ")||"Generic Component"},Xn=e=>{if(!e)return!1;const t=window.getComputedStyle(e),n=e.getBoundingClientRect(),r=e.getAttribute("role");if(r&&["listbox","menu","combobox","tooltip","option"].includes(r))return!1;const s=120;return n.width<s&&n.height<s||t.position!=="fixed"&&t.position!=="absolute"?!1:!!(e.closest('[role="dialog"]')||e.closest('[aria-modal="true"]')||e.classList.contains("modal")||e.classList.contains("modal-content"))},q=e=>{if(!e.isConnected)return!1;const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0"||e.offsetWidth===0||e.offsetHeight===0)return!1;let n=e.parentElement;for(;n;){const a=window.getComputedStyle(n);if(a.display==="none"||a.visibility==="hidden"||a.opacity==="0")return!1;n=n.parentElement}const r=e.getBoundingClientRect();return!(r.width===0||r.height===0||r.top===0&&r.left===0&&r.width>window.innerWidth*.9)},wt=(e,t=document)=>{const n=t.querySelector(e);if(n)return n;const r=t.querySelectorAll("*");for(const a of Array.from(r)){const s=a.shadowRoot;if(s){const c=wt(e,s);if(c)return c}}return null},vt=(e,t)=>{let n=document.elementFromPoint(e,t);for(;n&&n.shadowRoot;){const r=n.shadowRoot.elementFromPoint(e,t);if(!r||r===n)break;n=r}return n},Jn=e=>{if(!e.tag)return null;const t=Array.from(document.getElementsByTagName(e.tag));let n=null,r=0;for(const a of t){if(!Ee(a,e))continue;let s=0;const c=a.getAttribute("placeholder"),i=e.attributes?.placeholder||e.fingerprint?.placeholder;i&&c===i&&(s+=6);const u=a.getAttribute("type"),p=e.attributes?.type||e.fingerprint?.type;if(p&&u===p&&(s+=2),a.innerText?.trim()===e.text.trim()&&(s+=5),e.fingerprint?.vgPath){const{vgPath:f}=pe(a);(f===e.vgPath||e.fingerprint?.vgPath===f)&&(s+=10)}s>r&&s>=7&&(r=s,n=a)}return n},Ee=(e,t)=>{if(e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;const n=e.getAttribute("placeholder"),r=t.attributes?.placeholder||t.fingerprint?.placeholder;if(r&&n&&r!==n)return!1;const a=e.getAttribute("type"),s=t.attributes?.type||t.fingerprint?.type;return!(s&&a&&s!==a)},Zn=(e,t)=>{if(t){const c=Array.from(document.querySelectorAll(`[${Q}="${t}"]`));if(c.length>0){const i=c.filter(u=>Ee(u,e));if(i.length===0)c.forEach(u=>u.removeAttribute(Q));else{const u=i.find(f=>{const{vgPath:h}=pe(f);return h===e.vgPath||e.fingerprint?.vgPath===h}),p=u&&q(u)?u:i.find(f=>!(!q(f)||e.metadata?.isModal&&!f.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')));return p?(c.forEach(f=>{f!==p&&f.removeAttribute(Q)}),p):null}}}const r=(e.selector?Array.from(document.querySelectorAll(e.selector)):[]).filter(c=>Ee(c,e));let a=r.find(c=>{const{vgPath:i}=pe(c);return i===e.vgPath||e.fingerprint?.vgPath===i})||r[0]||null;if(a&&q(a))if(e.metadata?.isModal&&!a.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))a=null;else return a;if(e.fallbackSelectors)for(const c of e.fallbackSelectors){const i=wt(c);if(i&&Ee(i,e)&&q(i)){if(e.metadata?.isModal&&!i.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))continue;return i}}const s=Jn(e);return s&&q(s)?e.metadata?.isModal&&!s.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')?null:s:null},Le=e=>({tag:e.tagName.toLowerCase(),text:(e.innerText||e.getAttribute("placeholder")||"").slice(0,50).trim(),role:e.getAttribute("role")||void 0,type:e.getAttribute("type")||void 0}),Kn=e=>{const t=e.parentElement;if(!t)return;const n=Array.from(t.children).filter(c=>c!==e).slice(0,5).map(c=>Le(c)),r=Array.from(t.children),a=r.indexOf(e);let s="middle";return a===0&&(s="start"),a===r.length-1&&(s="end"),{target:{...Le(e),location:`${s} of ${t.tagName.toLowerCase()}`},parent:Le(t),siblings:n}},Qn=e=>{let t="unknown:0",n=e;for(;n;){const f=n.getAttribute("data-source-path");if(f){t=f;break}n=n.parentElement}const r=Yn(e),{selector:a,fallbacks:s,vgPath:c}=pe(e),i={};["placeholder","aria-label","name","type","alt","title","value","role"].forEach(f=>{const h=e.getAttribute(f);h&&(i[f]=h)});const u=!!e.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'),p=`${e.tagName.toLowerCase()}-${(e.innerText||"").slice(0,20).replace(/\s+/g,"_")}-${a.split(" > ").slice(-1)}`;return{tag:e.tagName.toLowerCase(),id:e.id||"",classes:e.className||"",text:(e.innerText||"").slice(0,100).trim(),selector:a,vgPath:c,outerHtml:e.outerHTML,parentContext:(e.parentElement?.innerText||"").slice(0,150).trim(),componentPath:r,signature:p,source:t,attributes:i,fallbackSelectors:[...new Set(s)].slice(0,5),domPath:[],viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:Kn(e),fingerprint:$n(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Bn(e),viewportBreakpoint:Wn(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:u}}},bt=()=>{const{addToast:e,language:t,t:n,apiKey:r,baseUrl:a,disableViewGate:s,hasActiveToasts:c}=qe(),[i,u]=m.useState(!1),[p,f]=m.useState(null),[h,C]=m.useState(null),[j,O]=m.useState(""),[I,W]=m.useState(!1),[J,Z]=m.useState(!1),[L,K]=m.useState(!1),[A,De]=m.useState([]),[F,$]=m.useState(null),[ke,St]=m.useState(!1),[me,oe]=m.useState(!1),[Re,je]=m.useState({}),[U,ie]=m.useState(null),[ee,fe]=m.useState(!1),[he,_e]=m.useState([]),[l,x]=m.useState(()=>{if(typeof window>"u")return{top:24,right:24};const d=localStorage.getItem("vg-exit-pos");return d?JSON.parse(d):{top:24,right:24}}),[S,E]=m.useState(!1),G=m.useRef(null),[B,k]=m.useState(()=>{if(typeof window>"u")return{bottom:30,right:30};const d=localStorage.getItem("vg-bar-pos");return d?JSON.parse(d):{bottom:30,right:30}}),[z,ce]=m.useState(!1),H=m.useRef(null),tr=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(E(!0),G.current={x:d.clientX,y:d.clientY,top:l.top,right:l.right,width:g.width,height:g.height})},nr=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(ce(!0),H.current={x:d.clientX,y:d.clientY,bottom:B.bottom,right:B.right,width:g.width,height:g.height})};m.useEffect(()=>{if(!S&&!z)return;const d=w=>{if(S&&G.current){const _=w.clientX-G.current.x,R=w.clientY-G.current.y;let b=G.current.top+R,y=G.current.right-_;const v=10;b=Math.max(v,Math.min(window.innerHeight-G.current.height-v,b)),y=Math.max(v,Math.min(window.innerWidth-G.current.width-v,y)),x({top:b,right:y})}if(z&&H.current){const _=w.clientX-H.current.x,R=w.clientY-H.current.y;let b=H.current.bottom-R,y=H.current.right-_;const v=10;b=Math.max(v,Math.min(window.innerHeight-H.current.height-v,b)),y=Math.max(v,Math.min(window.innerWidth-H.current.width-v,y)),k({bottom:b,right:y})}},g=()=>{S&&(E(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(l)),G.current=null),z&&(ce(!1),localStorage.setItem("vg-bar-pos",JSON.stringify(B)),H.current=null)};return window.addEventListener("mousemove",d),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",g)}},[S,z,l,B]);const[Ct,Fe]=m.useState(null),[Et,kt]=m.useState(""),[xr,wr]=m.useState({}),le=m.useRef(null),ge=m.useRef(null),ye=m.useCallback(()=>{ge.current||(ge.current=requestAnimationFrame(()=>{const d=new Map,w=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(b=>Xn(b)&&q(b)),_=!!w;A.forEach(b=>{if(!b.reference)return;const y=Zn(b.reference,b._id);if(!y||!q(y))return;const v=!!b.reference.metadata?.isModal;let D=!1;if(_?D=w.contains(y):D=!v,!D)return;const T=y.getAttribute(Q);T!==b._id&&(document.querySelectorAll(`[${Q}="${b._id}"]`).forEach(Y=>{Y.removeAttribute(Q)}),T||y.setAttribute(Q,b._id)),d.has(y)||d.set(y,[]),d.get(y).push(b)});const R=[];d.forEach((b,y)=>{const v=y.getBoundingClientRect(),D=v.left+v.width/2,T=v.top+v.height/2;if(D>=0&&D<=window.innerWidth&&T>=0&&T<=window.innerHeight){const Y=document.elementFromPoint(D,T);if(Y&&!y.contains(Y)&&!le.current?.contains(Y))return}R.push({id:b[0]._id,element:y,rect:v,annotations:b.sort((Y,ne)=>new Date(ne.timestamp||ne.createdAt).getTime()-new Date(Y.timestamp||Y.createdAt).getTime()),isModal:!!b[0].reference?.metadata?.isModal})}),_e(R),ge.current=null}))},[A]),te=m.useCallback(async()=>{if(r){oe(!0);try{const d=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":r}});if(d.ok){const _=((await d.json()).data||[]).reduce((R,b)=>R.find(v=>v._id===b._id)?R:R.concat([b]),[]);De(_)}}catch(d){console.error("Failed to fetch annotations",d)}finally{oe(!1)}}},[r,a]);m.useEffect(()=>{L&&A.length===0&&!me&&K(!1)},[L,A.length,me]),m.useEffect(()=>{if(!i&&A.length>0){ye();const d=new MutationObserver(()=>ye()),g=new ResizeObserver(()=>ye()),w=()=>ye();return d.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),g.observe(document.documentElement),window.addEventListener("scroll",w,!0),()=>{d.disconnect(),g.disconnect(),window.removeEventListener("scroll",w,!0),ge.current&&cancelAnimationFrame(ge.current)}}},[i,A.length,ye]),m.useEffect(()=>{te()},[te]),m.useEffect(()=>{le.current=document.getElementById("viewgate-shadow-host")},[]);const He=m.useCallback(d=>{if(!i||h)return;const g=vt(d.clientX,d.clientY);if(!g||le.current?.contains(g)||g.closest(".vg-no-capture")){f(null);return}const w=g.getBoundingClientRect();f({tag:g.tagName.toLowerCase(),source:g.getAttribute("data-source-path")||"unknown:0",rect:w,element:g,previewText:(g.innerText||"").slice(0,100)||(g.getAttribute("placeholder")||"").slice(0,100)||g.tagName.toLowerCase(),semanticReference:{...Qn(g),normalizedOffset:{x:(d.clientX-w.left)/w.width,y:(d.clientY-w.top)/w.height}}})},[i,h]),We=m.useCallback(async d=>{if(!i||h)return;const g=vt(d.clientX,d.clientY);if(!(!g||le.current?.contains(g)||g.closest(".vg-no-capture"))&&p){d.preventDefault(),d.stopPropagation(),Z(!0);try{const R=window.scrollX,b=window.scrollY,y=await gt(document.documentElement,{pixelRatio:1.5,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",style:{transform:`scale(${1/window.devicePixelRatio}) translate(-${R}px, -${b}px)`,transformOrigin:"top left"},filter:ne=>{const Oe=ne;return!(le.current?.contains(Oe)||Oe.id==="viewgate-ui")}}),v=p.element.getBoundingClientRect(),D=v.top>=0&&v.left>=0&&v.bottom<=window.innerHeight&&v.right<=window.innerWidth;let T="";if(D&&v.width>0&&v.height>0)T=await xt(y,v,24,1.5);else try{T=await gt(p.element,{pixelRatio:2,cacheBust:!0,backgroundColor:"#ffffff",filter:ne=>{const Oe=ne;return!le.current?.contains(Oe)}})}catch{T=await xt(y,v,24,1.5)}const Y={...p.semanticReference,metadata:{...p.semanticReference.metadata,screenshotUrl:y,elementScreenshot:T}};C({...p,visualPreview:T,semanticReference:Y})}catch(w){console.error("Failed to capture preview:",w),C(p)}finally{Z(!1),f(null)}}},[i,p,h]);m.useEffect(()=>{const d=g=>{if(g.key==="Escape"){h?C(null):L?K(!1):i&&u(!1);return}const _=(()=>{let y=document.activeElement;for(;y&&y.shadowRoot&&y.shadowRoot.activeElement;)y=y.shadowRoot.activeElement;return y})();if(["input","textarea"].includes((_?.tagName||"").toLowerCase())||_?.isContentEditable)return;const b=g.key.toLowerCase();b==="c"&&!h&&!L&&u(y=>!y),b==="v"&&!h&&(A.length>0||L)&&(K(y=>!y),L||u(!1))};return i&&!h?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",d),window.addEventListener("mousemove",He,!0),window.addEventListener("click",We,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",d),window.removeEventListener("mousemove",He,!0),window.removeEventListener("click",We,!0)}},[i,h,L,A,He,We]);const rr=async()=>{if(!h||!j.trim())return;W(!0);const{semanticReference:d}=h,[g,w]=(d.source||"").split(":"),_=w||"0";try{if(!(await fetch(`${a}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({filePath:g,line:parseInt(_),url:window.location.href,message:j,componentName:d.componentPath||h.tag,reference:{...d,viewport:{width:window.innerWidth,height:window.innerHeight},userAgent:navigator.userAgent,timestamp:new Date().toISOString()}})})).ok)throw new Error("Backend failed");e(n.success,"success"),C(null),O(""),u(!1),te()}catch(R){console.error(R),e(n.error,"error")}finally{W(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1101",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1102",className:"vg-no-capture",children:[!c&&o.jsxs("div",{style:{position:"fixed",top:`${l.top}px`,right:`${l.right}px`,zIndex:Me+10,display:"flex",alignItems:"center",gap:"8px",transition:S?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:tr,style:{width:"20px",height:"32px",borderRadius:"6px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:i?0:1,visibility:i?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor="white",d.currentTarget.style.color="#000000"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",d.currentTarget.style.color="#1e293b"},children:o.jsx(Ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1146",size:14})}),o.jsx("button",{onClick:d=>{d.stopPropagation(),$({title:n.exitConfirmTitle||"Close ViewGate?",message:n.exitConfirmMessage||"Are you sure you want to close ViewGate?",type:"danger",onConfirm:()=>s()})},title:"Cerrar ViewGate",style:{width:"40px",height:"40px",borderRadius:"12px",backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(0,0,0,0.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",cursor:"pointer",color:"#64748b",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseEnter:d=>{d.currentTarget.style.transform="scale(1.1) rotate(90deg)",d.currentTarget.style.color="#ef4444",d.currentTarget.style.backgroundColor="white"},onMouseLeave:d=>{d.currentTarget.style.transform="scale(1) rotate(0deg)",d.currentTarget.style.color="#64748b",d.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.9)"},children:o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1186",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1192",style:{position:"fixed",bottom:`${B.bottom}px`,right:`${B.right}px`,zIndex:Me,display:"flex",alignItems:"center",gap:"8px",transition:z?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:nr,style:{width:"24px",height:"40px",borderRadius:"10px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:i?0:1,visibility:i?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor="white",d.currentTarget.style.color="#000000"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",d.currentTarget.style.color="#1e293b"},className:"vg-animate-slide-up",children:o.jsx(Ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1235",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1238",className:"vg-action-bar vg-animate-slide-up",style:{transition:"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("button",{onClick:()=>u(!i),className:"vg-button-primary vg-animate-pop",style:{padding:"12px 24px",background:i?"#ef4444":void 0},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1247",style:{display:"flex",alignItems:"center",gap:"10px"},children:[i?o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1248",size:20,className:"vg-animate-pop"}):o.jsx(we,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1248",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1249",children:i?n.exitMode:n.enterMode})]})}),A.length>0&&o.jsxs("button",{onClick:()=>{K(!L),u(!1),C(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Lt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1262",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1263",children:n.viewComments})]})]})]}),J&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1271",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Me+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1277",className:"vg-glassmorphism",style:{padding:"30px 50px",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1278",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1279",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),i&&!h&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1286",className:"vg-backdrop-blur",style:{opacity:1,clipPath:p?`polygon(
|
|
9
9
|
0% 0%, 0% 100%, 100% 100%, 100% 0%, 0% 0%,
|
|
10
|
-
${
|
|
11
|
-
${
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
)`:"none",zIndex:zn}}),c&&u&&!f&&!W&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1284",className:"vg-selection-pulse",style:{top:u.rect.top-4,left:u.rect.left-4,width:u.rect.width+8,height:u.rect.height+8,zIndex:Dn},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1294",className:"vg-selection-label",style:{...u.rect.top<60?u.rect.bottom>window.innerHeight-60?{top:"8px",bottom:"auto"}:{top:"100%",marginTop:"8px",bottom:"auto"}:{top:"-40px",bottom:"auto"},...u.rect.left+200>window.innerWidth?{left:"auto",right:"0"}:{left:"0",right:"auto"}},children:[o.jsx(zt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1310",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1311",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1312",style:{fontWeight:700},children:n.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1313",style:{fontSize:"10px",opacity:.8,fontFamily:"monospace"},children:[Math.round(u.rect.width)," × ",Math.round(u.rect.height)]})]})]})}),f&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1323",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Le},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1328",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"500px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1332",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1333",style:{width:"48px",height:"48px",background:"var(--vg-primary-gradient)",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",color:"white",boxShadow:"0 8px 16px rgba(99, 102, 241, 0.3)"},children:o.jsx(xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1338",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1340",style:{margin:"0 0 8px 0",fontSize:"24px",fontWeight:800,color:"#0f172a"},children:n.feedbackHeader}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1341",style:{margin:0,color:"#000000",fontSize:"15px"},children:n.feedbackSubheader})]}),f.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1345",style:{marginBottom:"24px",borderRadius:"12px",overflow:"hidden",border:"1px solid #e2e8f0",background:"#f8fafc",width:"fit-content",margin:"0 auto 24px auto"},children:o.jsx("img",{src:f.visualPreview,alt:"Preview",style:{maxWidth:"100%",maxHeight:"200px",objectFit:"contain",display:"block"}})}),o.jsx("textarea",{className:"vg-textarea",value:h,onChange:d=>S(d.target.value),rows:4,placeholder:n.placeholder,autoFocus:!0,style:{fontSize:"15px",padding:"16px",marginBottom:"24px"}}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1372",style:{display:"flex",gap:"12px"},children:[o.jsx("button",{onClick:()=>!O&&v(null),className:"vg-button-ghost",disabled:O,style:{flex:1,padding:"12px"},children:n.cancel}),o.jsx("button",{onClick:nr,className:"vg-button-primary",disabled:O||!h.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1387",style:{display:"flex",alignItems:"center",gap:"8px"},children:[O?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1388",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(Ht,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1388",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1389",children:O?n.submitting:n.sendFeedback||"Send Comment"})]})})]})]})}),A&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1399",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Le},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1404",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"650px",maxHeight:"85vh",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1408",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1409",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1410",style:{margin:0,fontSize:"20px",fontWeight:800,color:"#0f172a"},children:X?n.commentDetails:n.annotations}),!X&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1414",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:T.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1419",style:{display:"flex",gap:"8px"},children:[X&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1421",className:"vg-button-ghost",style:{padding:"6px 14px",fontSize:"12px"},onClick:()=>ie(null),children:n.viewAll||"View All"}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1429",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{U(!1),ie(null)},children:o.jsx(Oe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1434",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1439",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:pe?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1441",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1442",className:"vg-spinner"})}):(()=>{if(!X)return T;const d=fe.find(g=>g.annotations.some(w=>w._id===X));return d?d.annotations:T.filter(g=>g._id===X)})().map((d,g)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1451",className:"vg-glassmorphism vg-animate-slide",style:{padding:"20px",marginBottom:"16px",border:"1px solid rgba(0,0,0,0.05)",background:"rgba(255,255,255,0.5)",animationDelay:`${g*.05}s`},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1462",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1463",style:{display:"flex",gap:"12px",alignItems:"center"},children:[d.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1465",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a"},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1466",size:14})," ",n.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1469",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c"},children:[o.jsx(Lt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1470",size:14})," ",n.pending]}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1473",style:{fontSize:"12px",color:"#000000"},children:gt(d.timestamp||d.createdAt||d.reference?.timestamp,t)})]})}),St===d._id?o.jsx("textarea",{className:"vg-textarea",value:Ct,onChange:w=>Et(w.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1489",style:{margin:"0 0 20px 0",fontSize:"16px",color:"#1e293b",lineHeight:1.6},children:d.message}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1492",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:St===d._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1495",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${s}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({message:Ct})})).ok&&(De(null),ee(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}},children:n.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1517",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>De(null),children:n.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1521",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{De(d._id),Et(d.message)},children:[o.jsx(Dt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1529",size:14})," ",n.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1531",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.05s"},onClick:()=>{d.url&&(window.location.href=d.url)},children:[o.jsx(Xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1538",size:14})," ",n.review]}),d.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1541",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{Y({title:n.markReadyConfirm,message:n.confirmMarkReady,type:"success",onConfirm:async()=>{try{(await fetch(`${s}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"ready_for_review"})})).ok&&(ee(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{Y(null)}}})},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1569",size:14})," ",n.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1572",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{Y({title:n.reopenConfirm,message:n.confirmReopen,type:"success",onConfirm:async()=>{try{(await fetch(`${s}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"pending"})})).ok&&(ee(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{Y(null)}}})},children:[o.jsx(Ft,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1600",size:14})," ",n.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1603",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 12px",color:"#ef4444",borderColor:"#fee2e2",animationDelay:"0.15s"},onClick:()=>{Y({title:n.deleteConfirm,message:n.confirmDelete,type:"danger",onConfirm:async()=>{try{(await fetch(`${s}/api/annotations/${d._id}`,{method:"DELETE",headers:{"x-api-key":r}})).ok&&(ee(),e(n.deleteSuccess,"success"))}catch{e(n.error,"error")}finally{Y(null)}}})},children:o.jsx(Ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1630",size:16})})]})})]},d._id))})]})}),G&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1645",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(11, 15, 25, 0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Le+100},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1650",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"420px",textAlign:"center",border:"1px solid rgba(255, 255, 255, 0.1)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1657",style:{width:"64px",height:"64px",background:G.type==="danger"?"rgba(239, 68, 68, 0.1)":"rgba(99, 102, 241, 0.1)",borderRadius:"20px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px",color:G.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:G.type==="danger"?o.jsx(Ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1666",size:32}):o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1666",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1668",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:G.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1669",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:G.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1670",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1671",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!q&&Y(null),disabled:q,children:n.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1679",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:G.type==="danger"?"#ef4444":void 0,backgroundImage:G.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:q,onClick:async()=>{me(!0);try{await G.onConfirm()}catch(d){console.error("Confirmation error:",d)}finally{me(!1)}},children:q?o.jsx(It,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1704",size:18,className:"vg-animate-spin"}):n.yes})]})]})}),!c&&!A&&fe.map((d,g)=>{const{rect:w,annotations:V,isModal:_}=d,C=V[0],y=V.length;return o.jsxs("div",{className:"vg-pin-container vg-animate-pop",style:{position:"fixed",top:w.top-20,left:w.left+w.width/2-16,cursor:"pointer",transition:"all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)",zIndex:Fn},onMouseEnter:b=>{window.innerHeight-w.bottom<250?Re(I=>({...I,[d.id]:"vg-top"})):Re(I=>({...I,[d.id]:""}))},onClick:()=>{U(!0),ie(C._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1743",className:`vg-pin-tooltip ${ke[d.id]||""}`,style:{width:"280px",padding:"16px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1744",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1745",style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx(xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1746",size:14,color:"#6366f1"}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1747",style:{fontWeight:800,fontSize:"13px",color:"#0f172a"},children:[y," ",y===1?"Comentario":"Comentarios"]})]}),_&&o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1752",className:"vg-badge",style:{fontSize:"10px",background:"#fef3c7",color:"#92400e",border:"none"},children:"MODAL"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1755",className:"vg-tooltip-scroll",style:{maxHeight:"180px",overflowY:"auto"},children:V.map((b,H)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1757",style:{padding:"10px 0",borderTop:H===0?"none":"1px solid #f1f5f9",display:"flex",flexDirection:"column",gap:"4px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1764",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1765",style:{fontSize:"10px",fontWeight:600,color:"#64748b"},children:gt(b.timestamp||b.createdAt,t)}),b.status==="ready_for_review"&&o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1768",size:12,color:"#22c55e"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1770",style:{fontSize:"13px",color:"#1e293b",lineHeight:1.4,fontWeight:500},children:b.message.length>80?b.message.slice(0,80)+"...":b.message})]},b._id))})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1778",className:`vg-formal-pin ${C.status==="ready_for_review"?"ready":""} ${_?"modal-variant":""}`,style:{position:"relative"},children:[C.status==="ready_for_review"?o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1779",size:18}):_?o.jsx(Xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1779",size:16}):o.jsx(xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1779",size:16}),y>1&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1782",className:"vg-pin-badge vg-animate-pop",children:y})]})]},`group-${d.id}`)})]})})};function ze(e,t,n){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const r=c=>c.replace(/\\/g,"/"),s=r(t).replace(r(n),"");return e.split(`
|
|
16
|
-
`).map((
|
|
17
|
-
`)}function
|
|
10
|
+
${p.rect.left}px ${p.rect.top}px,
|
|
11
|
+
${p.rect.right}px ${p.rect.top}px,
|
|
12
|
+
${p.rect.right}px ${p.rect.bottom}px,
|
|
13
|
+
${p.rect.left}px ${p.rect.bottom}px,
|
|
14
|
+
${p.rect.left}px ${p.rect.top}px
|
|
15
|
+
)`:"none",zIndex:Dn}}),i&&p&&!h&&!J&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1305",className:"vg-selection-pulse",style:{top:p.rect.top-4,left:p.rect.left-4,width:p.rect.width+8,height:p.rect.height+8,zIndex:Fn},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1315",className:"vg-selection-label",style:{...p.rect.top<60?p.rect.bottom>window.innerHeight-60?{top:"8px",bottom:"auto"}:{top:"100%",marginTop:"8px",bottom:"auto"}:{top:"-40px",bottom:"auto"},...p.rect.left+200>window.innerWidth?{left:"auto",right:"0"}:{left:"0",right:"auto"}},children:[o.jsx(Dt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1331",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1332",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1333",style:{fontWeight:700},children:n.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1334",style:{fontSize:"10px",opacity:.8,fontFamily:"monospace"},children:[Math.round(p.rect.width)," × ",Math.round(p.rect.height)]})]})]})}),h&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1344",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Ie},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1349",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"500px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1353",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1354",style:{width:"48px",height:"48px",background:"var(--vg-primary-gradient)",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",color:"white",boxShadow:"0 8px 16px rgba(99, 102, 241, 0.3)"},children:o.jsx(we,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1359",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1361",style:{margin:"0 0 8px 0",fontSize:"24px",fontWeight:800,color:"#0f172a"},children:n.feedbackHeader}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1362",style:{margin:0,color:"#000000",fontSize:"15px"},children:n.feedbackSubheader})]}),h.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1366",style:{marginBottom:"24px",borderRadius:"12px",overflow:"hidden",border:"1px solid #e2e8f0",background:"#f8fafc",width:"fit-content",margin:"0 auto 24px auto"},children:o.jsx("img",{src:h.visualPreview,alt:"Preview",style:{maxWidth:"100%",maxHeight:"200px",objectFit:"contain",display:"block"}})}),o.jsx("textarea",{className:"vg-textarea",value:j,onChange:d=>O(d.target.value),rows:4,placeholder:n.placeholder,autoFocus:!0,style:{fontSize:"15px",padding:"16px",marginBottom:"24px"}}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1393",style:{display:"flex",gap:"12px"},children:[o.jsx("button",{onClick:()=>!I&&C(null),className:"vg-button-ghost",disabled:I,style:{flex:1,padding:"12px"},children:n.cancel}),o.jsx("button",{onClick:rr,className:"vg-button-primary",disabled:I||!j.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1408",style:{display:"flex",alignItems:"center",gap:"8px"},children:[I?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1409",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(Wt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1409",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1410",children:I?n.submitting:n.sendFeedback||"Send Comment"})]})})]})]})}),L&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1420",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Ie},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1425",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"650px",maxHeight:"85vh",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1429",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1430",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1431",style:{margin:0,fontSize:"20px",fontWeight:800,color:"#0f172a"},children:U?n.commentDetails:n.annotations}),!U&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1435",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:A.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1440",style:{display:"flex",gap:"8px"},children:[U&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1442",className:"vg-button-ghost",style:{padding:"6px 14px",fontSize:"12px"},onClick:()=>ie(null),children:n.viewAll||"View All"}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1450",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{K(!1),ie(null)},children:o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1455",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1460",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:me?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1462",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1463",className:"vg-spinner"})}):(()=>{if(!U)return A;const d=he.find(g=>g.annotations.some(w=>w._id===U));return d?d.annotations:A.filter(g=>g._id===U)})().map((d,g)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1472",className:"vg-glassmorphism vg-animate-slide",style:{padding:"20px",marginBottom:"16px",border:"1px solid rgba(0,0,0,0.05)",background:"rgba(255,255,255,0.5)",animationDelay:`${g*.05}s`},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1483",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1484",style:{display:"flex",gap:"12px",alignItems:"center"},children:[d.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1486",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a"},children:[o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1487",size:14})," ",n.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1490",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c"},children:[o.jsx(It,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1491",size:14})," ",n.pending]}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1494",style:{fontSize:"12px",color:"#000000"},children:yt(d.timestamp||d.createdAt||d.reference?.timestamp,t)})]})}),Ct===d._id?o.jsx("textarea",{className:"vg-textarea",value:Et,onChange:w=>kt(w.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1510",style:{margin:"0 0 20px 0",fontSize:"16px",color:"#1e293b",lineHeight:1.6},children:d.message}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1513",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:Ct===d._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1516",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({message:Et})})).ok&&(Fe(null),te(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}},children:n.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1538",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>Fe(null),children:n.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1542",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{Fe(d._id),kt(d.message)},children:[o.jsx(Ft,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1550",size:14})," ",n.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1552",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.05s"},onClick:()=>{d.url&&(window.location.href=d.url)},children:[o.jsx(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1559",size:14})," ",n.review]}),d.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1562",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{$({title:n.markReadyConfirm,message:n.confirmMarkReady,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"ready_for_review"})})).ok&&(te(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:[o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1590",size:14})," ",n.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1593",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{$({title:n.reopenConfirm,message:n.confirmReopen,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"pending"})})).ok&&(te(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:[o.jsx(Ht,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1621",size:14})," ",n.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1624",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 12px",color:"#ef4444",borderColor:"#fee2e2",animationDelay:"0.15s"},onClick:()=>{$({title:n.deleteConfirm,message:n.confirmDelete,type:"danger",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"DELETE",headers:{"x-api-key":r}})).ok&&(te(),e(n.deleteSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:o.jsx(Ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1651",size:16})})]})})]},d._id))})]})}),F&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1666",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(11, 15, 25, 0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Ie+100},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1671",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"420px",textAlign:"center",border:"1px solid rgba(255, 255, 255, 0.1)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1678",style:{width:"64px",height:"64px",background:F.type==="danger"?"rgba(239, 68, 68, 0.1)":"rgba(99, 102, 241, 0.1)",borderRadius:"20px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px",color:F.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:F.type==="danger"?o.jsx(Ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1687",size:32}):o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1687",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1689",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:F.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1690",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:F.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1691",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1692",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!ee&&$(null),disabled:ee,children:n.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1700",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:F.type==="danger"?"#ef4444":void 0,backgroundImage:F.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:ee,onClick:async()=>{fe(!0);try{await F.onConfirm()}catch(d){console.error("Confirmation error:",d)}finally{fe(!1)}},children:ee?o.jsx(zt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1725",size:18,className:"vg-animate-spin"}):n.yes})]})]})}),!i&&!L&&he.map((d,g)=>{const{rect:w,annotations:_,isModal:R}=d,b=_[0],y=_.length;return o.jsxs("div",{className:"vg-pin-container vg-animate-pop",style:{position:"fixed",top:w.top-20,left:w.left+w.width/2-16,cursor:"pointer",transition:"all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)",zIndex:Hn},onMouseEnter:v=>{window.innerHeight-w.bottom<250?je(T=>({...T,[d.id]:"vg-top"})):je(T=>({...T,[d.id]:""}))},onClick:()=>{K(!0),ie(b._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1764",className:`vg-pin-tooltip ${Re[d.id]||""}`,style:{width:"280px",padding:"16px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1765",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1766",style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx(we,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1767",size:14,color:"#6366f1"}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1768",style:{fontWeight:800,fontSize:"13px",color:"#0f172a"},children:[y," ",y===1?"Comentario":"Comentarios"]})]}),R&&o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1773",className:"vg-badge",style:{fontSize:"10px",background:"#fef3c7",color:"#92400e",border:"none"},children:"MODAL"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1776",className:"vg-tooltip-scroll",style:{maxHeight:"180px",overflowY:"auto"},children:_.map((v,D)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1778",style:{padding:"10px 0",borderTop:D===0?"none":"1px solid #f1f5f9",display:"flex",flexDirection:"column",gap:"4px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1785",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1786",style:{fontSize:"10px",fontWeight:600,color:"#64748b"},children:yt(v.timestamp||v.createdAt,t)}),v.status==="ready_for_review"&&o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1789",size:12,color:"#22c55e"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1791",style:{fontSize:"13px",color:"#1e293b",lineHeight:1.4,fontWeight:500},children:v.message.length>80?v.message.slice(0,80)+"...":v.message})]},v._id))})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1799",className:`vg-formal-pin ${b.status==="ready_for_review"?"ready":""} ${R?"modal-variant":""}`,style:{position:"relative"},children:[b.status==="ready_for_review"?o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1800",size:18}):R?o.jsx(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1800",size:16}):o.jsx(we,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1800",size:16}),y>1&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1803",className:"vg-pin-badge vg-animate-pop",children:y})]})]},`group-${d.id}`)})]})})};function ze(e,t,n){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const r=i=>i.replace(/\\/g,"/"),a=r(t).replace(r(n),"");return e.split(`
|
|
16
|
+
`).map((i,u)=>{const p=u+1;return i.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(f,h,C)=>f.includes("data-source-path")||C==="Fragment"||C==="React.Fragment"?f:`${h}<${C} data-source-path="${a}:${p}"`)}).join(`
|
|
17
|
+
`)}function qn(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:ze(e,t,process.cwd()),map:null}}}}function er(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,ze(e,t,process.cwd())):e}N.ViewGate=Bt,N.ViewGateOverlay=bt,N.transformSourcePaths=ze,N.useViewGate=qe,N.viewgateNextLoader=er,N.viewgatePlugin=qn,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})}));
|