veo-sdk 0.5.12 → 0.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder-Q6GDLAFC.mjs +5 -0
- package/dist/{builder-VIBRGCEY.mjs.map → builder-Q6GDLAFC.mjs.map} +1 -1
- package/dist/builder.cjs +13 -3
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.mjs +4 -4
- package/dist/{chunk-4QK7HRGW.mjs → chunk-DXMWX3Z2.mjs} +3 -3
- package/dist/{chunk-4QK7HRGW.mjs.map → chunk-DXMWX3Z2.mjs.map} +1 -1
- package/dist/{chunk-X7G6TBYG.mjs → chunk-JYLQLSO2.mjs} +3 -3
- package/dist/{chunk-X7G6TBYG.mjs.map → chunk-JYLQLSO2.mjs.map} +1 -1
- package/dist/{chunk-HXLCU7XW.mjs → chunk-NXO3T43M.mjs} +15 -5
- package/dist/chunk-NXO3T43M.mjs.map +1 -0
- package/dist/index.cjs +14 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/veo-builder.js +6 -6
- package/dist/veo-builder.js.map +1 -1
- package/dist/veo-guides.js +3 -3
- package/dist/veo-guides.js.map +1 -1
- package/package.json +1 -1
- package/dist/builder-VIBRGCEY.mjs +0 -5
- package/dist/chunk-HXLCU7XW.mjs.map +0 -1
package/dist/veo-guides.js
CHANGED
|
@@ -423,8 +423,8 @@ var veoGuides=(function(exports){'use strict';function wt(){return typeof window
|
|
|
423
423
|
to { transform: translateY(0); opacity: 1; }
|
|
424
424
|
}
|
|
425
425
|
`;var w=class{constructor(){this.host=null;this.shadow=null;this.cleanups=[];this.liveContainer=null;this.liveContent=null;this.liveBuild=null;this.liveKey="";}liveKeyOf(e){return ""}onLiveUpdate(e){}updateStep(e){if(!this.host||!this.liveContainer||!this.liveContent||!this.liveBuild||this.liveKeyOf(e)!==this.liveKey)return false;let t=this.liveBuild(e);return this.liveContainer.replaceChild(t,this.liveContent),this.liveContent=t,this.applyDesign(e.style),this.onLiveUpdate(e),true}createHost(){let e=document.createElement("div");e.setAttribute(Ct,"");let t=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=cn,t.appendChild(n);let i=document.createElement("div");return t.appendChild(i),document.body.appendChild(e),this.host=e,this.shadow=t,{host:e,shadow:t,root:i}}applyDesign(e){this.host&&dn(this.host,e);}registerCleanup(e){this.cleanups.push(e);}hostElement(){return this.host}destroy(){for(let e of this.cleanups)try{e();}catch{}this.cleanups=[],this.host?.parentNode&&this.host.parentNode.removeChild(this.host),this.host=null,this.shadow=null;}};var so={top:"bottom",bottom:"top",left:"right",right:"left"};function te(o,e,t){let n=so[e.split("-")[0]??"bottom"]??"top";for(let i of ["top","bottom","left","right"])o.style.setProperty(i,"");t?.x!=null&&o.style.setProperty("left",`${t.x}px`),t?.y!=null&&o.style.setProperty("top",`${t.y}px`),o.style.setProperty(n,"-6px");}var ao=150,ne=class extends w{constructor(){super(...arguments);this.tooltip=null;this.arrowEl=null;this.badgeBtn=null;this.open=false;this.shownEmitted=false;this.trigger="hover";this.side="top";this.closeTimer=null;this.stopFloat=null;}async render(t){let n=t.guide.guideSteps[0];if(!n)return;let i=n.selector??t.guide.activationRules.selector;if(typeof i!="string"||i.length===0)return;let r=await k(i);if(!r)return;let{host:s,root:a}=this.createHost(),d=a.ownerDocument??document;this.applyDesign(n.style);let l=n.style?.width;typeof l=="number"&&Number.isFinite(l)&&s.style.setProperty("--veo-badge-tip-width",`${Math.min(720,Math.max(220,l))}px`),this.trigger=n.style?.badgeTrigger==="click"?"click":"hover";let c=n.style?.tooltipPlacement;this.side=c==="bottom"||c==="left"||c==="right"?c:"top";let u=K(n.style);s.style.display="inline-flex",s.style.verticalAlign="middle";let m=pn(un(n),d);a.appendChild(m),this.badgeBtn=m,P(r,s,u),this.registerCleanup(M(s,i,u));let f=d.createElement("div");f.className="veo-tooltip veo-badge-tooltip",f.style.display="none";let p=(y,C)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:y,...C?{metadata:C}:{}});},h=y=>A(y,d,{onCtaClick:(C,S,q)=>{p("cta_clicked",q),C==="url"&&S&&window.open(S,"_blank","noopener,noreferrer"),this.closeTooltip(),C==="guide"&&S&&t.onOpenGuide?.(S);},onDismiss:()=>this.closeTooltip()}),g=h(n);f.appendChild(g);let v=d.createElement("div");v.className="veo-tooltip-arrow",f.appendChild(v),a.appendChild(f),this.tooltip=f,this.arrowEl=v,this.liveContainer=f,this.liveContent=g,this.liveKey=this.liveKeyOf(n),this.liveBuild=h;let b=()=>{this.cancelClose(),this.open||(this.openTooltip(m),this.shownEmitted||(this.shownEmitted=true,p("shown")));};if(this.trigger==="hover"){let y=()=>{this.cancelClose(),this.closeTimer=window.setTimeout(()=>this.closeTooltip(),ao);};m.addEventListener("mouseenter",b),m.addEventListener("focus",b),m.addEventListener("mouseleave",y),m.addEventListener("blur",y),f.addEventListener("mouseenter",()=>this.cancelClose()),f.addEventListener("mouseleave",y);}else {m.addEventListener("click",()=>{this.open?this.closeTooltip():b();});let y=C=>{this.open&&(C.composedPath().includes(s)||this.closeTooltip());};document.addEventListener("click",y,true),this.registerCleanup(()=>document.removeEventListener("click",y,true));}let x=y=>{y.key==="Escape"&&this.open&&this.closeTooltip();};document.addEventListener("keydown",x),this.registerCleanup(()=>document.removeEventListener("keydown",x)),t.isPreview&&b();}liveKeyOf(t){let n=t.selector??"",i=K(t.style),r=t.style?.badgeTrigger==="click"?"click":"hover";return `${n}|${i}|${r}`}onLiveUpdate(t){if(this.badgeBtn){let i=this.badgeBtn.ownerDocument,r=pn(un(t),i);this.badgeBtn.className=r.className,this.badgeBtn.setAttribute("style",r.getAttribute("style")??""),this.badgeBtn.replaceChildren(...Array.from(r.childNodes));}let n=t.style?.tooltipPlacement;this.side=n==="bottom"||n==="left"||n==="right"?n:"top",this.open&&this.badgeBtn&&this.position(this.badgeBtn);}destroy(){this.cancelClose(),this.stopFloat?.(),this.stopFloat=null,this.tooltip=null,this.arrowEl=null,this.badgeBtn=null,this.open=false,super.destroy();}openTooltip(t){if(!this.tooltip)return;this.tooltip.style.display="block",this.open=true,this.position(t);let n=()=>{this.position(t);};window.addEventListener("scroll",n,true),window.addEventListener("resize",n),this.stopFloat=()=>{window.removeEventListener("scroll",n,true),window.removeEventListener("resize",n);};}closeTooltip(){this.cancelClose(),!(!this.tooltip||!this.open)&&(this.tooltip.style.display="none",this.open=false,this.stopFloat?.(),this.stopFloat=null);}cancelClose(){this.closeTimer!==null&&(window.clearTimeout(this.closeTimer),this.closeTimer=null);}async position(t){let n=this.tooltip,i=this.arrowEl;if(!n||!i)return;let{x:r,y:s,placement:a,middlewareData:d}=await z(t,n,{strategy:"fixed",placement:this.side,middleware:[D(8),W(),H({padding:8}),ee({element:i})]});n.style.left=`${r}px`,n.style.top=`${s}px`,te(i,a,d.arrow);}};function un(o){let e=o.style?.badge;if(!e||typeof e!="object")return {kind:"icon"};let t=e;return {kind:t.kind==="dot"||t.kind==="pill"||t.kind==="text"||t.kind==="image"||t.kind==="icon"?t.kind:"icon",icon:typeof t.icon=="string"?t.icon:null,text:typeof t.text=="string"?t.text:null,imageUrl:typeof t.imageUrl=="string"?t.imageUrl:null,color:typeof t.color=="string"&&U.test(t.color.trim())?t.color.trim():null,size:typeof t.size=="number"&&Number.isFinite(t.size)?t.size:null}}function De(o,e,t){return Math.min(t,Math.max(e,o))}function pn(o,e){let t=e.createElement("button");t.type="button",t.className=`veo-badge veo-badge--${o.kind}`,t.setAttribute("aria-label","M\xE1s informaci\xF3n");let n=De(o.size??18,8,48);switch(o.kind){case "dot":t.style.width=`${n}px`,t.style.height=`${n}px`,o.color&&(t.style.background=o.color);break;case "pill":{t.textContent=o.text?.slice(0,24)||"Nuevo",t.style.fontSize=`${De(Math.round(n*.62),8,24)}px`,o.color&&(t.style.background=o.color);break}case "text":{t.textContent=o.text?.slice(0,32)||"Nuevo",t.style.fontSize=`${De(Math.round(n*.7),9,28)}px`,o.color&&(t.style.color=o.color);break}case "image":{if(o.imageUrl&&R(o.imageUrl)){let i=e.createElement("img");i.src=o.imageUrl,i.alt="",i.style.width=`${n}px`,i.style.height=`${n}px`,t.appendChild(i);}else t.className="veo-badge veo-badge--icon",t.textContent="?",t.style.width=`${n}px`,t.style.height=`${n}px`,t.style.fontSize=`${De(Math.round(n*.62),8,32)}px`;break}default:{t.textContent=(o.icon||"\u2139\uFE0F").slice(0,4),t.style.width=`${n}px`,t.style.height=`${n}px`,t.style.fontSize=`${De(Math.round(n*.62),8,32)}px`,o.color&&(t.style.color=o.color);break}}return t}function Ce(o,e,t,n,i){let r=n.createElement("div");r.className="veo-guide-content";let s=n.createElement("div");s.className="veo-walkthrough-counter",s.textContent=`Paso ${e+1} de ${t}`,r.appendChild(s);let a=n.createElement("div");a.className="veo-walkthrough-progress";for(let p=0;p<t;p++){let h=n.createElement("span");h.className="veo-walkthrough-progress-dot",p<e&&h.classList.add("completed"),p===e&&h.classList.add("active"),a.appendChild(h);}r.appendChild(a);for(let p of on(o,n))r.appendChild(p);let d=n.createElement("div");d.className="veo-walkthrough-actions";let l=n.createElement("button");l.type="button",l.className="veo-walkthrough-skip",l.textContent="Omitir",l.addEventListener("click",()=>i.onSkip()),d.appendChild(l);let c=n.createElement("div");if(c.className="veo-walkthrough-actions-right",e>0){let p=n.createElement("button");p.type="button",p.className="veo-walkthrough-btn-secondary",p.textContent="Atr\xE1s",p.addEventListener("click",()=>i.onBack()),c.appendChild(p);}let u=e===t-1,m=n.createElement("button");m.type="button",m.className="veo-guide-cta";let f=u?"Finalizar":"Siguiente";return m.textContent=typeof o.ctaText=="string"&&o.ctaText?o.ctaText:f,m.addEventListener("click",()=>{u?i.onComplete():i.onNext();}),c.appendChild(m),d.appendChild(c),r.appendChild(d),r.appendChild(fe(n,()=>i.onSkip())),r}var oe=class extends w{async render(e){let t=e.nav?.stepIndex??0,n=e.guide.guideSteps[t];if(!n)return;let i=n.style?.position==="bottom"?"bottom":"top",r=n.selector?.trim()||null,s=null;if(r&&(s=await k(r),!s))return;let{host:a,root:d}=this.createHost();this.applyDesign(n.style);let l=d.ownerDocument??document,c=l.createElement("div");c.className=fn(i,!!s);let u=(f,p,h)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:t,action:f,...h?{metadata:h}:{}}),p&&window.open(p,"_blank","noopener,noreferrer"),e.onClose();},m=e.nav?Ce(n,e.nav.stepIndex,e.nav.totalSteps,l,e.nav.callbacks):A(n,l,{onCtaClick:(f,p,h)=>{u("cta_clicked",f==="url"?p:void 0,h),f==="guide"&&p&&e.onOpenGuide?.(p);},onDismiss:()=>u("dismissed")});if(c.appendChild(m),d.appendChild(c),r&&s){a.style.display="block";let f=i==="top"?"prepend":"append";P(s,a,f),this.registerCleanup(M(a,r,f));}e.nav||(this.liveContainer=c,this.liveContent=m,this.liveBuild=f=>A(f,l,{onCtaClick:(p,h,g)=>{u("cta_clicked",p==="url"?h:void 0,g),p==="guide"&&h&&e.onOpenGuide?.(h);},onDismiss:()=>u("dismissed")}),this.liveKey=this.liveKeyOf(n),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"}));}liveKeyOf(e){let t=e.selector?.trim()??"";if(!t)return "";let n=e.style?.position==="bottom"?"bottom":"top";return `${t}|${n}`}onLiveUpdate(e){if(this.liveContainer){let t=e.style?.position==="bottom"?"bottom":"top",n=!!e.selector?.trim();this.liveContainer.className=fn(t,n);}}};function fn(o,e){return e?"veo-banner veo-banner-embedded":`veo-banner veo-banner-${o}`}function mn(){let e=Date.now().toString(16).padStart(12,"0"),t=new Uint8Array(10);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(t);else for(let i=0;i<t.length;i++)t[i]=Math.floor(Math.random()*256);t[0]=(t[0]??0)&15|112,t[2]=(t[2]??0)&63|128;let n=Array.from(t,i=>i.toString(16).padStart(2,"0")).join("");return [e.slice(0,8),e.slice(8,12),n.slice(0,4),n.slice(4,8),n.slice(8,20)].join("-")}function Se(o,e,t,n){let i=o.createElement("iframe");i.className="veo-custom-frame",i.setAttribute("sandbox","allow-scripts"),i.setAttribute("title",t.guide.guideName||"OnUser"),i.style.width=n.width;let r=n.fixedHeight!==void 0&&n.fixedHeight!==null;r&&(i.style.height=vt(n.fixedHeight));let s=mn(),a=e.style?.tailwind===true;i.srcdoc=fo(e.html??"",e.css??"",e.js??"",s,{hostCss:co(),htmlAttrs:uo(),tailwind:a});let d=()=>t.onClose(),l=c=>{if(c.source!==i.contentWindow)return;let u=c.data;if(!(!u||typeof u!="object"||u.__veo!==s))switch(u.type){case "dismiss":t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"dismissed"}),d();break;case "cta":t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"cta_clicked"}),typeof u.url=="string"&&R(u.url)&&window.open(u.url,"_blank","noopener,noreferrer"),u.close!==false&&d();break;case "navigate":typeof u.url=="string"&&R(u.url)&&window.location.assign(u.url);break;case "track":typeof u.name=="string"&&t.onTrack&&t.onTrack(u.name,po(u.props)?u.props:void 0);break;case "resize":!r&&typeof u.height=="number"&&u.height>0&&(i.style.height=`${Math.ceil(u.height)}px`);break}};return window.addEventListener("message",l),{iframe:i,cleanup:()=>window.removeEventListener("message",l)}}function vt(o){return typeof o=="number"?`${o}px`:o}var lo=800*1024;function co(){if(typeof document>"u")return "";let o="";try{for(let e of Array.from(document.styleSheets)){let t=null;try{t=e.cssRules;}catch{continue}if(t){for(let n of Array.from(t))if(o+=`${n.cssText}
|
|
426
|
-
`,o.length>lo)return o}}}catch{return o}return o}function uo(){if(typeof document>"u")return "";try{let o=document.documentElement,e=[];for(let t of ["class","style","data-theme","data-mode","data-color-mode"]){let n=o.getAttribute(t);n&&n.length<=1e3&&!/["<>]/.test(n)&&e.push(`${t}="${n}"`);}return e.join(" ")}catch{return ""}}function po(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function fo(o,e,t,n,i){let r=`(function(){var T=${JSON.stringify(n)};function P(m){m.__veo=T;parent.postMessage(m,'*');}window.veo={dismiss:function(){P({type:'dismiss'});},cta:function(u){P({type:'cta',url:u});},track:function(n,p){P({type:'track',name:n,props:p||{}});},navigate:function(u){P({type:'navigate',url:u});}};document.addEventListener('click',function(e){var a=e.target&&e.target.closest?e.target.closest('a[href]'):null;if(!a)return;var h=a.getAttribute('href');if(!h||h.charAt(0)==='#'||/^(javascript|mailto|tel):/i.test(h))return;e.preventDefault();if(a.target==='_blank'){P({type:'cta',url:a.href,close:false});}else{P({type:'navigate',url:h});}},true);function H(){var r=document.getElementById('__veo_root');var h=r?r.getBoundingClientRect().height:document.documentElement.scrollHeight;P({type:'resize',height:Math.ceil(h)});}window.addEventListener('load',H);try{if(typeof ResizeObserver!=='undefined'){var _r=document.getElementById('__veo_root');new ResizeObserver(H).observe(_r||document.documentElement);}}catch(e){}})();`,s=i.hostCss?`<style>${gt(i.hostCss,"style")}</style>`:"",a=i.tailwind?'<script src="https://cdn.tailwindcss.com"></script>':"";return `<!DOCTYPE html><html ${i.htmlAttrs}><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;}body{font-family:system-ui,-apple-system,sans-serif;}</style>`+s+"<style>html,body{margin:0!important;padding:0!important;background:transparent!important;height:auto!important;min-height:0!important;max-height:none!important;width:auto!important;min-width:0!important;overflow:visible!important;color-scheme:normal!important;}</style>"+a+`<style>${gt(e,"style")}</style></head><body style="margin:0!important;background:transparent!important;min-height:0!important;height:auto!important;"><div id="__veo_root">${o}</div><script>${r}</script>`+(t?`<script>${gt(t,"script")}</script>`:"")+"</body></html>"}function gt(o,e){let t=e==="script"?/<\/script/gi:/<\/style/gi;return o.replace(t,`<\\/${e}`)}function hn(o,e,t){if(o.sandboxed){let s={html:o.html??"",css:o.css,js:o.js},{iframe:a,cleanup:d}=Se(e,s,t,{width:"100%"}),l=e.createElement("div");return l.className="veo-code-sandbox",l.appendChild(a),{node:l,cleanup:d}}let n=e,i=[];if(typeof o.css=="string"&&o.css.trim()){let s=n.createElement("style");s.textContent=o.css,n.head.appendChild(s),i.push(s);}let r=null;if(typeof o.html=="string"&&o.html.trim()){r=e.createElement("div"),r.className="veo-code-html",r.innerHTML=o.html;for(let s of Array.from(r.querySelectorAll("script")))i.push(mo(s,n)),s.remove();}if(typeof o.js=="string"&&o.js.trim()){let s=n.createElement("script");s.textContent=o.js,n.body.appendChild(s),i.push(s);}return {node:r,cleanup:()=>{for(let s of i)s.parentNode?.removeChild(s);}}}function mo(o,e){let t=e.createElement("script");for(let n of Array.from(o.attributes))t.setAttribute(n.name,n.value);return o.src||(t.textContent=o.textContent),e.body.appendChild(t),t}function ot(o,e,t){let n=e.guide.guideSteps[0];if(!n)return;let i=n.fields??[],r=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();},s=t.createElement("div");if(s.className="veo-guide-content",n.title){let m=t.createElement("h2");m.className="veo-guide-title",m.textContent=n.title,s.appendChild(m);}if(n.content){let m=t.createElement("p");m.className="veo-guide-text",m.textContent=n.content,s.appendChild(m);}let a=[],d=t.createElement("form");d.className="veo-form",d.noValidate=true;for(let m of i){let{wrapper:f,read:p}=yt(m,t);a.push({field:m,read:p}),d.appendChild(f);}let l=t.createElement("p");l.className="veo-form-error",l.style.display="none",d.appendChild(l);let c=t.createElement("div");c.className="veo-guide-actions";let u=t.createElement("button");u.type="submit",u.className="veo-guide-cta",u.textContent=n.ctaText||"Enviar",c.appendChild(u),d.appendChild(c),d.addEventListener("submit",m=>{m.preventDefault(),l.style.display="none";let f={};for(let{field:h,read:g}of a){let v=g();if(v==null||v===""){if(h.required){l.textContent=`Completa "${h.label}"`,l.style.display="block";return}continue}f[h.key]=v;}if(Object.keys(f).length===0){l.textContent="Responde al menos un campo",l.style.display="block";return}u.disabled=true,(e.onFormSubmit??(()=>Promise.resolve(true)))(f).then(h=>{if(!h){u.disabled=false,l.textContent="No se pudo enviar. Prueba de nuevo.",l.style.display="block";return}e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"completed"});let g=e.isPreview?e.previewNote??"Vista previa: la respuesta NO se guard\xF3.":null;ho(o,t,g),window.setTimeout(()=>e.onClose(),g?2200:1400);});}),s.appendChild(d),s.appendChild(fe(t,r)),o.appendChild(s);}function ho(o,e,t){for(;o.firstChild;)o.removeChild(o.firstChild);let n=e.createElement("div");if(n.className="veo-form-thanks",n.textContent="\u2713 \xA1Gracias por tu respuesta!",o.appendChild(n),t){let i=e.createElement("p");i.className="veo-form-preview-note",i.textContent=t,o.appendChild(i);}}function yt(o,e){let t=e.createElement("div");t.className="veo-form-field";let n=e.createElement("label");switch(n.className="veo-form-label",n.textContent=o.required?`${o.label} *`:o.label,t.appendChild(n),o.type){case "textarea":{let i=e.createElement("textarea");return i.className="veo-form-input",i.rows=3,o.placeholder&&(i.placeholder=o.placeholder),t.appendChild(i),{wrapper:t,read:()=>i.value.trim()}}case "number":{let i=e.createElement("input");return i.type="number",i.className="veo-form-input",o.placeholder&&(i.placeholder=o.placeholder),t.appendChild(i),{wrapper:t,read:()=>i.value.trim()===""?void 0:Number(i.value)}}case "select":{let i=e.createElement("select");i.className="veo-form-input";let r=e.createElement("option");r.value="",r.textContent=o.placeholder||"Elige una opci\xF3n\u2026",i.appendChild(r);for(let s of o.options??[]){let a=e.createElement("option");a.value=s,a.textContent=s,i.appendChild(a);}return t.appendChild(i),{wrapper:t,read:()=>i.value||void 0}}case "radio":{let i=e.createElement("div");i.className="veo-form-options";let r=`veo-${o.key}`,s=[];for(let a of o.options??[]){let d=e.createElement("label");d.className="veo-form-option";let l=e.createElement("input");l.type="radio",l.name=r,l.value=a,s.push(l);let c=e.createElement("span");c.textContent=a,d.appendChild(l),d.appendChild(c),i.appendChild(d);}return t.appendChild(i),{wrapper:t,read:()=>s.find(a=>a.checked)?.value}}case "multiselect":{let i=e.createElement("div");i.className="veo-form-options";let r=[];for(let s of o.options??[]){let a=e.createElement("label");a.className="veo-form-option";let d=e.createElement("input");d.type="checkbox",d.value=s,r.push(d);let l=e.createElement("span");l.textContent=s,a.appendChild(d),a.appendChild(l),i.appendChild(a);}return t.appendChild(i),{wrapper:t,read:()=>{let s=r.filter(a=>a.checked).map(a=>a.value);return s.length>0?s:void 0}}}case "checkbox":{let i=e.createElement("label");i.className="veo-form-option";let r=e.createElement("input");r.type="checkbox";let s=e.createElement("span");return s.textContent=o.placeholder||"S\xED",i.appendChild(r),i.appendChild(s),t.appendChild(i),{wrapper:t,read:()=>r.checked?true:o.required?"":false}}case "yesno":{let i=e.createElement("div");i.className="veo-form-options";let r=`veo-${o.key}`,[s,a]=o.options?.length===2?o.options:["S\xED","No"],d=[];for(let{label:l,value:c}of [{label:s,value:true},{label:a,value:false}]){let u=e.createElement("label");u.className="veo-form-option";let m=e.createElement("input");m.type="radio",m.name=r,d.push({input:m,value:c});let f=e.createElement("span");f.textContent=l,u.appendChild(m),u.appendChild(f),i.appendChild(u);}return t.appendChild(i),{wrapper:t,read:()=>d.find(l=>l.input.checked)?.value}}case "nps":return gn(t,e,0,10,"veo-nps-btn");case "rating":return gn(t,e,1,5,"veo-rating-btn","\u2605");default:{let i=e.createElement("input");return i.type="text",i.className="veo-form-input",o.placeholder&&(i.placeholder=o.placeholder),t.appendChild(i),{wrapper:t,read:()=>i.value.trim()}}}}function gn(o,e,t,n,i,r){let s=e.createElement("div");s.className="veo-form-scale";let a,d=[];for(let l=t;l<=n;l++){let c=e.createElement("button");c.type="button",c.className=i,c.textContent=r??String(l),c.setAttribute("aria-label",String(l)),c.addEventListener("click",()=>{a=l,d.forEach((u,m)=>{let f=r?m+t<=l:m+t===l;u.classList.toggle("veo-scale-active",f);});}),d.push(c),s.appendChild(c);}return o.appendChild(s),{wrapper:o,read:()=>a}}var he=class extends w{constructor(){super(...arguments);this.badgeDelegate=null;}async render(t){let n=t.nav?.stepIndex??0,i=t.guide.guideSteps[n];if(!i)return;if(i.presentation==="badge"){let p={title:"",content:"",selector:i.anchorSelector??void 0,blocks:i.blocks??[],style:{...i.design??{},...i.badge?{badge:i.badge}:{},...i.badgeTrigger?{badgeTrigger:i.badgeTrigger}:{}}},h={...t.guide,guideSteps:[p]},{nav:g,...v}=t;this.badgeDelegate=new ne,await this.badgeDelegate.render({...v,guide:h});return}let r=(i.position==="relative-to-element"||i.presentation==="inline")&&i.anchorSelector?.trim()||void 0,s=null;if(r&&(s=await k(r),!s))return;let{host:a,root:d}=this.createHost(),l=d.ownerDocument??document,c=i.design??{};typeof c.zIndex=="number"&&(a.style.zIndex=String(c.zIndex));let u=l.createElement("div");u.className="veo-card",xo(u,c);let m=(p,h)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:p,...{}});},f=[];if(this.buildContent(u,i.blocks??[],l,t,n,f),c.closeButton!==false){let p=fe(l,()=>{m("dismissed"),this.closeOrSkip(t);}),h=typeof c.closeColor=="string"?c.closeColor:null,g=typeof c.closeHoverColor=="string"?c.closeHoverColor:null;h&&(p.style.color=h),g&&(p.addEventListener("mouseenter",()=>{p.style.color=g;}),p.addEventListener("mouseleave",()=>{p.style.color=h??"";})),u.appendChild(p);}if(i.presentation==="inline"&&s){a.style.display="block";let p=go(i.inlinePosition);d.appendChild(u),P(s,a,p),this.registerCleanup(M(a,r,p));}else if(i.position==="relative-to-element"&&s){if(c.backdrop===true){let g=l.createElement("div");g.className="veo-composite-overlay veo-composite-overlay--dim",typeof c.backdropColor=="string"&&(g.style.background=c.backdropColor);let v=typeof c.backdropZIndex=="number"?c.backdropZIndex:2e5;g.style.zIndex=String(v),d.appendChild(g),c.targetAbove===true&&this.registerCleanup(bo(s,v+1));}let p=l.createElement("div");p.className="veo-composite-anchored";let h=c.caret===false?null:yo(l,c);h&&p.appendChild(h),p.appendChild(u),d.appendChild(p),this.registerCleanup(await wo(s,p,h));}else {let p=l.createElement("div");p.className="veo-composite-overlay",i.position==="center"&&c.backdrop!==false&&(p.classList.add("veo-composite-overlay--dim"),typeof c.backdropColor=="string"&&(p.style.background=c.backdropColor),typeof c.backdropZIndex=="number"&&(p.style.zIndex=String(c.backdropZIndex)),p.addEventListener("click",h=>{h.target===p&&(m("dismissed"),this.closeOrSkip(t));})),vo(u,i.position,c),p.appendChild(u),d.appendChild(p);}t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:"shown"});}buildContent(t,n,i,r,s,a){let d=c=>{r.onInteraction({guideId:r.guide.guideId,stepIndex:s,action:"cta_clicked",...c.id?{metadata:{buttonId:c.id}}:{}});},l=0;for(;l<n.length;){let c=n[l];if(!c){l++;continue}if(c.type==="button"){let m=i.createElement("div");for(m.className="veo-guide-actions";l<n.length&&n[l]?.type==="button";)m.appendChild(this.buildButton(n[l],i,r,s,a,d)),l++;t.appendChild(m);continue}if(c.type==="code"){let{node:m,cleanup:f}=hn(c,i,r);m&&t.appendChild(m),this.registerCleanup(f),l++;continue}if(c.type==="form"){let m=i.createElement("div");m.className="veo-form";for(let f of c.fields??[]){let{wrapper:p,read:h}=yt(f,i);a.push({field:f,read:h}),m.appendChild(p);}t.appendChild(m),l++;continue}let u=nt(c,i);u&&t.appendChild(u),l++;}}buildButton(t,n,i,r,s,a){let d=n.createElement("button");d.type="button",d.className="veo-guide-cta",d.textContent=t.text?.trim()||"OK",xe(d,t.style,"button");let l=i.nav?.callbacks;return d.addEventListener("click",()=>{switch(t.action){case "next":a(t),l?l.onNext():i.onClose();break;case "prev":a(t),l?.onBack();break;case "url":a(t),typeof t.url=="string"&&R(t.url)&&window.open(t.url,"_blank","noopener,noreferrer");break;case "guide":a(t),t.targetGuideId&&i.onOpenGuide?.(t.targetGuideId),this.closeOrSkip(i);break;case "submit-forms":case "submit-forms-advance":case "submit-forms-goto":this.submitForms(s,i,r,d,()=>{a(t),t.action==="submit-forms"||!l?i.onClose():t.action==="submit-forms-goto"&&typeof t.targetStep=="number"&&l.onGoto?l.onGoto(t.targetStep):l.onNext();});break;default:a(t),this.closeOrSkip(i);}}),d}submitForms(t,n,i,r,s){let a={};for(let{field:l,read:c}of t){let u=c();if(u==null||u===""){if(l.required){r.textContent=`Completa "${l.label}"`;return}continue}a[l.key]=u;}if(t.length>0&&Object.keys(a).length===0)return;r.disabled=true,(n.onFormSubmit??(()=>Promise.resolve(true)))(a).then(l=>{r.disabled=false,l&&(n.onInteraction({guideId:n.guide.guideId,stepIndex:i,action:"completed"}),s());});}closeOrSkip(t){t.nav?.callbacks?t.nav.callbacks.onSkip():t.onClose();}destroy(){this.badgeDelegate?.destroy(),this.badgeDelegate=null,super.destroy();}};function go(o){return o==="before"||o==="prepend"||o==="append"?o:"after"}function vo(o,e,t){let n=o.style;n.position="fixed";let i="16px",r=t.hAlign==="left"?"left":t.hAlign==="right"?"right":null,s=e.includes("top")?"top":e.includes("bottom")?"bottom":"middle",a=r??(e.includes("left")?"left":e.includes("right")?"right":"middle");s==="top"?n.top=i:s==="bottom"?n.bottom=i:n.top="50%",a==="left"?n.left=i:a==="right"?n.right=i:n.left="50%";let d=a==="middle"?"-50%":"0",l=s==="middle"?"-50%":"0";n.transform=d==="0"&&l==="0"?"":`translate(${d}, ${l})`;}function yo(o,e){let t=o.createElement("div");t.className="veo-composite-caret";let n=typeof e.caretWidth=="number"?e.caretWidth:12,i=typeof e.caretHeight=="number"?e.caretHeight:12,r=t.style;if(r.position="absolute",r.width=`${n}px`,r.height=`${i}px`,r.transform="rotate(45deg)",r.background=typeof e.background=="string"?e.background:"#ffffff",typeof e.borderWidth=="number"&&e.borderWidth>0){let s=typeof e.borderColor=="string"?e.borderColor:"#bbbbbb";r.border=`${e.borderWidth}px solid ${s}`;}return t}function bo(o,e){let t=o,n=t.style.position,i=t.style.zIndex;return getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.style.zIndex=String(e),()=>{t.style.position=n,t.style.zIndex=i;}}async function wo(o,e,t){let n=async()=>{let{x:r,y:s,placement:a,middlewareData:d}=await z(o,e,{placement:"bottom",strategy:"fixed",middleware:[D(t?10:8),W(),H({padding:8}),...t?[ee({element:t})]:[]]});e.style.left=`${r}px`,e.style.top=`${s}px`,t&&te(t,a,d.arrow);};await n();let i=()=>{n();};return window.addEventListener("scroll",i,true),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i,true),window.removeEventListener("resize",i);}}function xo(o,e){let t=o.style,n=a=>typeof a=="number"&&Number.isFinite(a)?`${a}px`:null,i=a=>typeof a=="string"&&a?a:null;i(e.background)&&(t.background=e.background);let r=i(e.color)??i(e.textColor);r&&(t.color=r),n(e.fontSize)&&(t.fontSize=n(e.fontSize)),i(e.fontWeight)&&(t.fontWeight=e.fontWeight),i(e.fontFamily)&&e.fontFamily!=="inherit"&&(t.fontFamily=e.fontFamily),i(e.textTransform)&&e.textTransform!=="none"&&(t.textTransform=e.textTransform),typeof e.letterSpacing=="number"&&(t.letterSpacing=`${e.letterSpacing}px`),i(e.align)&&(t.textAlign=e.align),typeof e.lineHeight=="number"&&(t.lineHeight=`${e.lineHeight}%`),n(e.radius)&&(t.borderRadius=n(e.radius));let s=n(e.borderWidth);if(s&&(t.border=`${s} solid ${i(e.borderColor)??"#e5e5e5"}`),i(e.shadowColor)||typeof e.shadowBlur=="number"){let a=d=>typeof e[d]=="number"?e[d]:0;t.boxShadow=`${a("shadowX")}px ${a("shadowY")}px ${a("shadowBlur")}px ${a("shadowSpread")}px ${i(e.shadowColor)??"rgba(0,0,0,0.2)"}`;}e.fullWidth===true?t.width="100%":e.widthType==="fluid"?(t.width="auto",n(e.width)&&(t.maxWidth=n(e.width))):n(e.width)&&(t.width=n(e.width));for(let a of ["Top","Right","Bottom","Left"]){let d=n(e[`padding${a}`]);d&&t.setProperty(`padding-${a.toLowerCase()}`,d);let l=n(e[`margin${a}`]);l&&t.setProperty(`margin-${a.toLowerCase()}`,l);}}var Co={mode:"floating",position:"bottom-right"},vn=16,So=360,ke=class extends w{async render(e){let t=e.guide.guideSteps[0];if(!t||typeof t.html!="string"||t.html.length===0)return;let n=t.placement??Co,i=null;if(n.mode==="anchored"){let c=n.selector??t.selector??e.guide.activationRules.selector;if(typeof c!="string"||c.length===0||(i=await k(c),!i))return}let{root:r}=this.createHost(),s=r.ownerDocument??document,a=s.createElement("div");a.className=n.mode==="anchored"?"veo-custom-anchored":"veo-custom-floating";let{iframe:d,cleanup:l}=Se(s,t,e,{width:vt(n.width??So),fixedHeight:n.height??null});this.registerCleanup(l),a.appendChild(d),r.appendChild(a),n.mode==="floating"?ko(a,n):i&&this.registerCleanup(await this.setupAnchoredPosition(i,a,n)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}async setupAnchoredPosition(e,t,n){let i=n.side??"bottom",r=async()=>{let{x:a,y:d}=await z(e,t,{placement:i,strategy:"fixed",middleware:[D(n.offsetY??8),W(),H({padding:8})]});t.style.left=`${a}px`,t.style.top=`${d}px`;};await r();let s=()=>{r();};return window.addEventListener("scroll",s,true),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s,true),window.removeEventListener("resize",s);}}};function ko(o,e){let t=e.position??"bottom-right",n=`${e.offsetX??vn}px`,i=`${e.offsetY??vn}px`,r=o.style;if(t==="center"){r.top="50%",r.left="50%",r.transform="translate(-50%, -50%)";return}let[s,a]=t.split("-");s==="top"?r.top=i:r.bottom=i,a==="left"?r.left=n:a==="right"?r.right=n:(r.left="50%",r.transform="translateX(-50%)");}var Ee=class extends w{render(e){let t=e.guide.guideSteps[0];if(!t||(t.fields??[]).length===0)return;let{root:n}=this.createHost();this.applyDesign(t.style);let i=n.ownerDocument??document,r=i.createElement("div");r.className="veo-modal-overlay";let s=i.createElement("div");s.className="veo-modal-card",ot(s,e,i),r.appendChild(s),n.appendChild(r);let a=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();};r.addEventListener("click",l=>{l.target===r&&a();});let d=l=>{l.key==="Escape"&&a();};document.addEventListener("keydown",d),this.registerCleanup(()=>document.removeEventListener("keydown",d)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var Re=class extends w{async render(e){let t=e.guide.guideSteps[0];if(!t||typeof t.html!="string"||t.html.length===0)return;let n=t.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await k(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let a=K(t.style);P(i,r,a),this.registerCleanup(M(r,n,a));let d=s.ownerDocument??document,l=d.createElement("div");l.className="veo-custom-inline";let{iframe:c,cleanup:u}=Se(d,t,e,{width:"100%"});this.registerCleanup(u),l.appendChild(c),s.appendChild(l),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var Ie=class extends w{async render(e){let t=e.guide.guideSteps[0];if(!t||(t.fields??[]).length===0)return;let n=t.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await k(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let a=K(t.style);P(i,r,a),this.registerCleanup(M(r,n,a)),this.applyDesign(t.style);let d=s.ownerDocument??document,l=d.createElement("div");l.className="veo-inline",ot(l,e,d),s.appendChild(l),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var Te=class extends w{async render(e){let t=e.guide.guideSteps[0];if(!t)return;let n=t.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await k(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let a=K(t.style);P(i,r,a),this.registerCleanup(M(r,n,a)),this.applyDesign(t.style);let d=s.ownerDocument??document,l=d.createElement("div");l.className="veo-inline";let c=(m,f,p)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:m,...p?{metadata:p}:{}}),f&&window.open(f,"_blank","noopener,noreferrer"),e.onClose();},u=A(t,d,{onCtaClick:(m,f,p)=>{c("cta_clicked",m==="url"?f:void 0,p),m==="guide"&&f&&e.onOpenGuide?.(f);},onDismiss:()=>c("dismissed")});l.appendChild(u),s.appendChild(l),this.liveContainer=l,this.liveContent=u,this.liveKey=`${n}|${a}`,this.liveBuild=m=>A(m,d,{onCtaClick:(f,p,h)=>{c("cta_clicked",f==="url"?p:void 0,h),f==="guide"&&p&&e.onOpenGuide?.(p);},onDismiss:()=>c("dismissed")}),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(e){return `${e.selector??""}|${K(e.style)}`}};function yn(o){return o.style?.backdrop===false?"veo-modal-overlay veo-modal-overlay--none":"veo-modal-overlay"}var ie=class extends w{constructor(){super(...arguments);this.overlay=null;}render(t){let n=t.nav?.stepIndex??0,i=t.guide.guideSteps[n];if(!i)return;let{root:r}=this.createHost();this.applyDesign(i.style);let s=r.ownerDocument??document,a=s.createElement("div");a.className=yn(i),this.overlay=a;let d=s.createElement("div");d.className="veo-modal-card";let l=(f,p,h)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:f,...h?{metadata:h}:{}}),p&&window.open(p,"_blank","noopener,noreferrer"),t.onClose();},c=()=>{t.nav?t.nav.callbacks.onSkip():l("dismissed");},u=t.nav?Ce(i,t.nav.stepIndex,t.nav.totalSteps,s,t.nav.callbacks):A(i,s,{onCtaClick:(f,p,h)=>{l("cta_clicked",f==="url"?p:void 0,h),f==="guide"&&p&&t.onOpenGuide?.(p);},onDismiss:()=>l("dismissed")});d.appendChild(u),a.appendChild(d),r.appendChild(a),t.nav||(this.liveContainer=d,this.liveContent=u,this.liveBuild=f=>A(f,s,{onCtaClick:(p,h,g)=>{l("cta_clicked",p==="url"?h:void 0,g),p==="guide"&&h&&t.onOpenGuide?.(h);},onDismiss:()=>l("dismissed")})),a.addEventListener("click",f=>{f.target===a&&c();});let m=f=>{f.key==="Escape"&&c();};document.addEventListener("keydown",m),this.registerCleanup(()=>document.removeEventListener("keydown",m)),t.nav||t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"shown"});}onLiveUpdate(t){this.overlay&&(this.overlay.className=yn(t));}destroy(){this.overlay=null,super.destroy();}};var Ae=class extends w{constructor(){super(...arguments);this.side="bottom";this.reposition=null;}async render(t){let n=t.guide.guideSteps[0];if(!n)return;let i=n.selector??t.guide.activationRules.selector;if(typeof i!="string"||i.length===0)return;let r=await k(i);if(!r)return;let s=n.style?.tooltipPlacement;this.side=s==="top"||s==="left"||s==="right"?s:"bottom";let{root:a}=this.createHost();this.applyDesign(n.style);let d=a.ownerDocument??document,l=d.createElement("div");l.className="veo-tooltip";let c=(h,g,v)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:h,...v?{metadata:v}:{}}),g&&window.open(g,"_blank","noopener,noreferrer"),t.onClose();},u=A(n,d,{onCtaClick:(h,g,v)=>{c("cta_clicked",h==="url"?g:void 0,v),h==="guide"&&g&&t.onOpenGuide?.(g);},onDismiss:()=>c("dismissed")});l.appendChild(u);let m=d.createElement("div");m.className="veo-tooltip-arrow",l.appendChild(m),a.appendChild(l);let f=async()=>{let{x:h,y:g,placement:v,middlewareData:b}=await z(r,l,{placement:this.side,middleware:[D(10),W(),H({padding:8}),ee({element:m})]});l.style.left=`${h}px`,l.style.top=`${g}px`,te(m,v,b.arrow);};await f();let p=()=>{f();};this.reposition=p,window.addEventListener("scroll",p,true),window.addEventListener("resize",p),this.registerCleanup(()=>{window.removeEventListener("scroll",p,true),window.removeEventListener("resize",p);}),this.liveContainer=l,this.liveContent=u,this.liveKey=i,this.liveBuild=h=>A(h,d,{onCtaClick:(g,v,b)=>{c("cta_clicked",g==="url"?v:void 0,b),g==="guide"&&v&&t.onOpenGuide?.(v);},onDismiss:()=>c("dismissed")}),t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(t){return t.selector??""}onLiveUpdate(t){let n=t.style?.tooltipPlacement;this.side=n==="top"||n==="left"||n==="right"?n:"bottom",this.reposition?.();}};var Pe=class extends w{async render(e){let t=e.guide.guideSteps[e.currentStepIndex];if(!t)return false;let n=t.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return false;let i=await k(n,5e3);if(!i)return false;let r=t.style?.tooltipPlacement,s=r==="top"||r==="left"||r==="right"?r:"bottom",{root:a}=this.createHost();this.applyDesign(t.style);let d=a.ownerDocument??document,l=d.createElement("div");l.className="veo-walkthrough";let c=Ce(t,e.currentStepIndex,e.guide.guideSteps.length,d,e.callbacks);l.appendChild(c);let u=d.createElement("div");u.className="veo-walkthrough-arrow",l.appendChild(u),a.appendChild(l);let m=async()=>{let{x:p,y:h,placement:g,middlewareData:v}=await z(i,l,{placement:s,middleware:[D(10),W(),H({padding:8}),ee({element:u})]});l.style.left=`${p}px`,l.style.top=`${h}px`,te(u,g,v.arrow);};await m();let f=()=>{m();};return window.addEventListener("scroll",f,true),window.addEventListener("resize",f),this.registerCleanup(()=>{window.removeEventListener("scroll",f,true),window.removeEventListener("resize",f);}),true}};function Eo(o,e){switch(o.type){case "exact":return o.pattern===e;case "prefix":return e.startsWith(o.pattern);case "regex":try{return new RegExp(o.pattern).test(e)}catch{return false}}}function it(o,e){return !o||o.scope==="sitewide"||!o.pattern?true:Eo({type:o.matchType??"prefix",pattern:o.pattern},e)}var rt=class{constructor(e){this.state=null;this.storageKey=`${kt}${e}`,this.state=this.load(),this.state&&this.isAbandoned(this.state)&&this.clear();}current(){return this.state?this.isAbandoned(this.state)?(this.clear(),null):this.state:null}hasActive(){return this.current()!==null}start(e,t){let n=Date.now();return this.state={guideId:e,totalSteps:t,currentStepIndex:0,startedAt:n,lastProgressAt:n},this.persist(),this.state}advance(){if(!this.state)return null;let e=this.state.currentStepIndex+1;return e>=this.state.totalSteps?null:(this.state={...this.state,currentStepIndex:e,lastProgressAt:Date.now()},this.persist(),this.state)}back(){return this.state?this.state.currentStepIndex===0?this.state:(this.state={...this.state,currentStepIndex:this.state.currentStepIndex-1,lastProgressAt:Date.now()},this.persist(),this.state):null}clear(){if(this.state=null,!(typeof localStorage>"u"))try{localStorage.removeItem(this.storageKey);}catch{}}isAbandoned(e){return Date.now()-e.lastProgressAt>18e5}load(){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(this.storageKey);if(!e)return null;let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;return typeof n.guideId!="string"||typeof n.totalSteps!="number"||typeof n.currentStepIndex!="number"||typeof n.startedAt!="number"||typeof n.lastProgressAt!="number"?null:n}catch{return null}}persist(){if(!(typeof localStorage>"u"||!this.state))try{localStorage.setItem(this.storageKey,JSON.stringify(this.state));}catch{}}};var Io=3e4,To={shown:"shown",dismissed:"dismissed",cta_clicked:null,step_advanced:null,step_back:null,completed:"completed"},st=class{constructor(e,t){this.client=e;this.activeRenderers=new Set;this.activeByGuideId=new Map;this.dispatched=new Set;this.activeWalkthroughRenderer=null;this.activeWalkthroughGuide=null;this.resolveCache=null;this.inflightResolve=null;this.armedTriggers=new Map;this.pendingComposite=null;if(this.debug=t.debug===true,this.apiUrl=t.apiUrl,this.apiKey=t.apiKey,this.resolver=t.resolver??new ze(t.apiUrl,t.apiKey,this.debug),t.trackerQueue)this.trackerQueue=t.trackerQueue;else {let i=new Ue(t.apiUrl,t.apiKey);this.trackerQueue=new Ke({client:i,flushIntervalMs:3e3,batchSize:5,maxRetries:3,onError:(r,s)=>{this.debug&&console.warn(`[veo] dropped guide interaction after retries: guideId=${s.guideId} action=${s.payload.action}`,r);}});}let n=It(t.apiKey);this.frequencyCache=t.frequencyCache??new We(n),this.walkthroughState=t.walkthroughState??new rt(n);}get pendingInteractions(){return this.trackerQueue.size}clearFrequencyCache(){this.frequencyCache.clear();}clearWalkthroughState(){this.tearDownWalkthrough();}async checkGuides(e,t){let n=this.client.getEndUserId();if(!n){this.debug&&console.log("[veo] guides: skipped, no endUserId yet");return}if(await this.tryResumeWalkthrough(n,t,e))return;this.tryResumeComposite(t,e);let i;try{i=await this.resolveGuides(n,e);}catch(r){this.debug&&console.error("[veo] guides resolver threw:",r);return}this.debug&&console.log(`[veo] guides: ${i.length} eligible at ${e}`),this.disarmTriggers();for(let r of i){let s=r.activationRules.trigger;if((s==="on_click"||s==="on_hover")&&r.activationRules.selector){this.armInteractionTrigger(r,n,t,e);continue}await this.showGuide(r,n,t,e);}}async showGuide(e,t,n,i){if(this.frequencyCache.shouldFilter(e.guideId,e.displayFrequency)){this.debug&&console.log(`[veo] guides: filtered locally guideId=${e.guideId}`);return}if(this.activeByGuideId.has(e.guideId)){this.debug&&console.log(`[veo] guides: already shown guideId=${e.guideId}`);return}if(e.guideType==="walkthrough"&&e.guideSteps.length>1){if(this.walkthroughState.hasActive()){this.debug&&console.log(`[veo] guides: walkthrough ${e.guideId} skipped (another active)`);return}await this.startWalkthrough(e,t,n,i);return}if(e.guideType==="composite"){this.startComposite(e,n,i);return}this.runSingleStepRender(e,n,i);}armInteractionTrigger(e,t,n,i){if(this.frequencyCache.shouldFilter(e.guideId,e.displayFrequency)||this.activeByGuideId.has(e.guideId)||this.armedTriggers.has(e.guideId))return;let r=e.activationRules.selector,s=e.activationRules.trigger==="on_hover"?"mouseover":"click",a=l=>{let c=l.target;if(c instanceof Element){try{if(!c.closest(r))return}catch{return}d(),this.showGuide(e,t,n,i);}},d=()=>{document.removeEventListener(s,a,true),this.armedTriggers.delete(e.guideId);};document.addEventListener(s,a,true),this.armedTriggers.set(e.guideId,d),this.debug&&console.log(`[veo] guides: armed ${s} trigger for ${e.guideId} on ${r}`);}disarmTriggers(){for(let e of this.armedTriggers.values())e();this.armedTriggers.clear();}async resolveGuides(e,t){let n=`${e}
|
|
427
|
-
${t}`,i=Date.now();if(this.resolveCache?.key===n&&i-this.resolveCache.at<Io)return this.debug&&console.log("[veo] guides: resolve cache hit"),this.resolveCache.guides;if(this.inflightResolve?.key===n)return this.inflightResolve.promise;let r=this.resolver.resolve(e,t);this.inflightResolve={key:n,promise:r};try{let s=await r;return this.resolveCache={key:n,at:Date.now(),guides:s},s}finally{this.inflightResolve?.key===n&&(this.inflightResolve=null);}}destroy(){for(let e of this.activeRenderers)try{e.destroy();}catch(t){this.debug&&console.error("[veo] renderer destroy failed:",t);}if(this.activeRenderers.clear(),this.activeByGuideId.clear(),this.activeWalkthroughRenderer){try{this.activeWalkthroughRenderer.destroy();}catch{}this.activeWalkthroughRenderer=null,this.activeWalkthroughGuide=null;}this.disarmTriggers(),this.dispatched.clear(),this.resolveCache=null,this.inflightResolve=null,this.trackerQueue.destroy();}runSingleStepRender(e,t,n){let i=this.createSingleStepRenderer(e.guideType);if(!i)return;this.activeByGuideId.set(e.guideId,i);let r=e.activationRules.delayMs??0;window.setTimeout(()=>this.mountSingleStepRenderer(e,i,t,n),r);}startComposite(e,t,n){if(this.pendingComposite?.guide.guideId===e.guideId)return;let r=e.guideSteps.findIndex(s=>it(s.pageLocation,n));r!==-1&&this.renderCompositeStep(e,r,t,n);}tryResumeComposite(e,t){let n=this.pendingComposite;if(!n)return false;let r=n.guide.guideSteps[n.stepIndex];return r?it(r.pageLocation,t)?(this.pendingComposite=null,this.renderCompositeStep(n.guide,n.stepIndex,e,t),true):false:(this.pendingComposite=null,false)}renderCompositeStep(e,t,n,i){let r=e.guideSteps,s=new he;this.activeRenderers.add(s),this.activeByGuideId.set(e.guideId,s);let a=()=>{s.destroy(),this.activeRenderers.delete(s),this.activeByGuideId.get(e.guideId)===s&&this.activeByGuideId.delete(e.guideId);},d=c=>{if(a(),c<0||c>=r.length)return;let u=r[c];u&&it(u.pageLocation,i)?this.renderCompositeStep(e,c,n,i):this.pendingComposite={guide:e,stepIndex:c};},l=r.length>1?{stepIndex:t,totalSteps:r.length,callbacks:{onNext:()=>d(t+1),onBack:()=>d(t-1),onGoto:c=>d(c),onSkip:a,onComplete:a}}:void 0;try{s.render({guide:e,onInteraction:c=>this.handleInteraction(e,n,i,c),onClose:a,onTrack:(c,u)=>this.client.track(c,u),onFormSubmit:c=>this.submitFormResponse(e.guideId,c),onOpenGuide:c=>{this.openGuideById(c,n,i);},...l?{nav:l}:{}});}catch(c){this.debug&&console.error("[veo] composite renderer threw:",c),a();}}mountSingleStepRenderer(e,t,n,i){this.activeRenderers.add(t),this.activeByGuideId.set(e.guideId,t);let r=()=>{t.destroy(),this.activeRenderers.delete(t),this.activeByGuideId.get(e.guideId)===t&&this.activeByGuideId.delete(e.guideId);},s=c=>{this.handleInteraction(e,n,i,c);},a=(c,u)=>{this.client.track(c,u);},d=c=>this.submitFormResponse(e.guideId,c),l=c=>{this.openGuideById(c,n,i);};try{t.render({guide:e,onInteraction:s,onClose:r,onTrack:a,onFormSubmit:d,onOpenGuide:l});}catch(c){this.debug&&console.error("[veo] renderer.render threw:",c),this.activeRenderers.delete(t),this.activeByGuideId.get(e.guideId)===t&&this.activeByGuideId.delete(e.guideId);}}async openGuideById(e,t,n){if(this.activeByGuideId.has(e))return;let i=await this.resolver.fetchById(e);if(!i){this.debug&&console.warn(`[veo] guides: chained guide ${e} not found`);return}let r=this.client.getEndUserId()??this.client.getAnonymousId();if(i.guideType==="walkthrough"&&i.guideSteps.length>1){this.walkthroughState.hasActive()||await this.startWalkthrough(i,r,t,n);return}this.runSingleStepRender(i,t,n);}async tryResumeWalkthrough(e,t,n){let i=this.walkthroughState.current();if(!i)return false;let r=await this.resolver.fetchById(i.guideId);if(!r||r.guideType!=="walkthrough")return this.debug&&console.log(`[veo] guides: walkthrough ${i.guideId} no longer available, cleaning up`),this.tearDownWalkthrough(),true;let s=Math.min(i.currentStepIndex,r.guideSteps.length-1);return await this.renderWalkthroughStep(r,s,e,t,n),true}async startWalkthrough(e,t,n,i){this.walkthroughState.start(e.guideId,e.guideSteps.length),await this.renderWalkthroughStep(e,0,t,n,i)&&(this.enqueueInteractionOnce(e.guideId,t,n,i,"shown",0),this.frequencyCache.record(e.guideId,"shown"));}async renderWalkthroughStep(e,t,n,i,r){this.activeWalkthroughRenderer&&(this.activeWalkthroughRenderer.destroy(),this.activeWalkthroughRenderer=null),this.activeWalkthroughGuide=e;let s={onNext:()=>this.handleWalkthroughNext(n,i,r),onBack:()=>this.handleWalkthroughBack(n,i,r),onSkip:()=>this.handleWalkthroughSkip(n,i,r),onComplete:()=>this.handleWalkthroughComplete(n,i,r)},a=e.guideSteps[t],d=Ao(a);if(d==="modal"||d==="banner"){let u=d==="modal"?new ie:new oe;try{u.render({guide:e,onInteraction:()=>{},onClose:()=>{},nav:{stepIndex:t,totalSteps:e.guideSteps.length,callbacks:s}});}catch(m){return this.debug&&console.error("[veo] sequence renderer threw:",m),this.tearDownWalkthrough(),false}return this.activeWalkthroughRenderer=u,true}let l=new Pe,c=false;try{c=await l.render({guide:e,currentStepIndex:t,callbacks:s});}catch(u){this.debug&&console.error("[veo] walkthrough renderer threw:",u);}return c?(this.activeWalkthroughRenderer=l,true):(this.debug&&console.warn(`[veo] walkthrough ${e.guideId} step ${t} could not render, cancelling`),this.tearDownWalkthrough(),false)}handleWalkthroughNext(e,t,n){let i=this.activeWalkthroughGuide;if(!i)return;let r=this.walkthroughState.advance();if(!r){this.handleWalkthroughComplete(e,t,n);return}this.enqueueInteraction(i.guideId,e,t,n,"step_advanced",r.currentStepIndex),this.renderWalkthroughStep(i,r.currentStepIndex,e,t,n);}handleWalkthroughBack(e,t,n){let i=this.activeWalkthroughGuide;if(!i)return;let r=this.walkthroughState.current();if(!r||r.currentStepIndex===0)return;let s=this.walkthroughState.back();s&&(this.enqueueInteraction(i.guideId,e,t,n,"step_back",s.currentStepIndex),this.renderWalkthroughStep(i,s.currentStepIndex,e,t,n));}handleWalkthroughSkip(e,t,n){let i=this.activeWalkthroughGuide,r=this.walkthroughState.current();!i||!r||(this.enqueueInteraction(i.guideId,e,t,n,"dismissed",r.currentStepIndex),this.frequencyCache.record(i.guideId,"dismissed"),this.tearDownWalkthrough());}handleWalkthroughComplete(e,t,n){let i=this.activeWalkthroughGuide,r=this.walkthroughState.current();!i||!r||(this.enqueueInteraction(i.guideId,e,t,n,"completed",r.currentStepIndex),this.frequencyCache.record(i.guideId,"completed"),this.tearDownWalkthrough());}tearDownWalkthrough(){if(this.activeWalkthroughRenderer)try{this.activeWalkthroughRenderer.destroy();}catch{}this.activeWalkthroughRenderer=null,this.activeWalkthroughGuide=null,this.walkthroughState.clear();}handleInteraction(e,t,n,i){let r=i.metadata?.buttonId?`:${i.metadata.buttonId}`:"",s=`${e.guideId}:${i.action}${r}`;if(this.dispatched.has(s)){this.debug&&console.log(`[veo] guides: dedup hit ${s}`);return}this.dispatched.add(s);let a=To[i.action];a&&this.frequencyCache.record(e.guideId,a);let d=this.client.getEndUserId();if(!d){this.debug&&console.warn("[veo] guides: interaction without endUserId \u2014 skipping enqueue");return}this.trackerQueue.enqueue({guideId:e.guideId,payload:{endUserId:d,sessionId:t,action:i.action,stepIndex:i.stepIndex,pageUrl:n,pagePath:bn(n),...i.metadata?{metadata:i.metadata}:{}}});}enqueueInteraction(e,t,n,i,r,s){this.trackerQueue.enqueue({guideId:e,payload:{endUserId:t,sessionId:n,action:r,stepIndex:s,pageUrl:i,pagePath:bn(i)}});}enqueueInteractionOnce(e,t,n,i,r,s){let a=`${e}:${r}:${s}`;this.dispatched.has(a)||(this.dispatched.add(a),this.enqueueInteraction(e,t,n,i,r,s));}createSingleStepRenderer(e){switch(e){case "modal":return new ie;case "banner":return new oe;case "tooltip":return new Ae;case "custom":return new ke;case "inline":return new Te;case "inline-custom":return new Re;case "form":return new Ee;case "inline-form":return new Ie;case "badge":return new ne;case "composite":return new he;case "walkthrough":return null;default:return null}}async submitFormResponse(e,t){let n=this.client.getEndUserId()??this.client.getAnonymousId();try{let i=await fetch(`${this.apiUrl}/v1/guides/${e}/form-response`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":this.apiKey},body:JSON.stringify({endUserId:n,answers:t})});return !i.ok&&this.debug&&console.warn("[veo] form-response respondi\xF3",i.status),i.ok}catch(i){return this.debug&&console.warn("[veo] form-response fall\xF3:",i),false}}};function bn(o){try{return new URL(o).pathname}catch{return "/"}}function Ao(o){let e=o?.style?.render;return typeof e=="string"?e:"walkthrough"}var Po="__veo_preview__",bt=class{constructor(){this.singleStep=null;this.walkthrough=null;this.walkthroughGuide=null;this.walkthroughIndex=0;this.input=null;}preview(e){let t=e.guideSteps[0];if(this.singleStep&&this.input&&e.guideType===this.input.guideType&&e.guideType!=="walkthrough"&&t&&this.singleStep.updateStep(t))return this.input=e,{close:()=>this.close(),ready:Promise.resolve({rendered:true}),host:()=>this.activeHost()};this.close(),this.input=e;let n=Lo(e),i=typeof e.startStepIndex=="number"?e.startStepIndex:0;if(n.guideType==="composite"){let s=Math.min(Math.max(0,i),n.guideSteps.length-1),a=n.guideSteps[s];a&&(n.guideSteps=[a]);let d=this.renderSingleStep(n);return {close:()=>this.close(),ready:d,host:()=>this.activeHost()}}let r=n.guideType==="walkthrough"?this.startWalkthrough(n,i):this.renderSingleStep(n);return {close:()=>this.close(),ready:r,host:()=>this.activeHost()}}activeHost(){return this.singleStep?this.singleStep.hostElement():this.walkthrough instanceof w?this.walkthrough.hostElement():null}close(){this.singleStep&&(ge(this.singleStep),this.singleStep=null),this.walkthrough&&(ge(this.walkthrough),this.walkthrough=null),this.walkthroughGuide=null,this.walkthroughIndex=0,this.input=null;}async renderSingleStep(e){let t=Go(e.guideType);if(!t)return {rendered:false};this.singleStep=t;let n=false;try{await t.render({guide:e,onInteraction:i=>{i.action==="shown"&&(n=!0);},onClose:()=>this.close(),onTrack:()=>{},onOpenGuide:()=>{},onFormSubmit:this.input?.formSubmit??(()=>Promise.resolve(!0)),isPreview:!0,...this.input?.formSubmit&&this.input.formSubmitNote!==void 0?{previewNote:this.input.formSubmitNote}:{}});}catch{return this.close(),{rendered:false}}return this.singleStep!==t?(ge(t),{rendered:false}):{rendered:n}}async startWalkthrough(e,t=0){if(e.guideSteps.length===0)return {rendered:false};this.walkthroughGuide=e;let n=Math.min(Math.max(0,Math.floor(t)),e.guideSteps.length-1);return this.walkthroughIndex=n,{rendered:await this.renderWalkthroughStep(n)}}async renderWalkthroughStep(e){let t=this.walkthroughGuide;if(!t)return false;this.walkthrough&&(ge(this.walkthrough),this.walkthrough=null);let n={onNext:()=>{let d=this.walkthroughIndex+1;if(d>=t.guideSteps.length){this.close();return}this.walkthroughIndex=d,this.renderWalkthroughStep(d);},onBack:()=>{let d=this.walkthroughIndex-1;d<0||(this.walkthroughIndex=d,this.renderWalkthroughStep(d));},onSkip:()=>this.close(),onComplete:()=>this.close()},r=t.guideSteps[e]?.style?.render;if(r==="modal"||r==="banner"){let d=r==="modal"?new ie:new oe;try{d.render({guide:t,onInteraction:()=>{},onClose:()=>this.close(),nav:{stepIndex:e,totalSteps:t.guideSteps.length,callbacks:n}});}catch{return ge(d),false}return this.walkthroughGuide!==t?(ge(d),false):(this.walkthrough=d,true)}let s=new Pe,a=false;try{a=await s.render({guide:t,currentStepIndex:e,callbacks:n});}catch{a=false;}return !a||this.walkthroughGuide!==t?(ge(s),false):(this.walkthrough=s,true)}},at=null;function lt(o){return He()?(at||(at=new bt),at.preview(o)):{close:()=>{},ready:Promise.resolve({rendered:false}),host:()=>null}}function wn(){at?.close();}function Lo(o){let e=o.activationRules?.selector,t={url:o.activationRules?.url??{type:"prefix",pattern:"/"},trigger:"immediate",...e!==void 0?{selector:e}:{}};return {guideId:Po,guideName:o.guideName??"Preview",guideType:o.guideType,guideSteps:o.guideSteps,activationRules:t,displayFrequency:"always",displayPriority:0}}function Go(o){switch(o){case "modal":return new ie;case "banner":return new oe;case "tooltip":return new Ae;case "custom":return new ke;case "inline":return new Te;case "inline-custom":return new Re;case "form":return new Ee;case "inline-form":return new Ie;case "badge":return new ne;case "composite":return new he;case "walkthrough":return null;default:return null}}function ge(o){try{o.destroy();}catch{}}var dt=null;async function xn(o){if(!He())return null;dt?.teardown();let e=null;try{let a=await fetch(`${o.apiUrl}/v1/guides/preview-resolve`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":o.apiKey},body:JSON.stringify({token:o.token})});a.ok?e=(await a.json()).guide??null:o.debug&&console.warn("[veo] preview-resolve respondi\xF3",a.status);}catch(a){o.debug&&console.warn("[veo] preview-resolve fall\xF3:",a);}let t=async a=>{if(!e)return false;let d=window.veo,l=d?.getEndUserId?.()??d?.getAnonymousId?.()??null;if(!l)return false;try{return (await fetch(`${o.apiUrl}/v1/guides/${e.guideId}/form-response`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":o.apiKey},body:JSON.stringify({endUserId:l,answers:a})})).ok}catch{return false}},n=null,i=()=>{e&&(n?.close(),n=lt({guideType:e.guideType,guideSteps:e.guideSteps,activationRules:e.activationRules,guideName:e.guideName,formSubmit:t,formSubmitNote:"Vista previa: guardado en TU usuario para probar el flujo."}));},r=No({label:e?`Vista previa: ${e.guideName}`:"Link de preview inv\xE1lido o vencido",error:!e,onReshow:e?i:null,onClose:()=>s.teardown()}),s={teardown(){n?.close(),n=null,r.remove(),dt===s&&(dt=null);}};return dt=s,i(),s}function No(o){let e=document.createElement("div");e.setAttribute("data-veo-preview-chip","");let t=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=`
|
|
426
|
+
`,o.length>lo)return o}}}catch{return o}return o}function uo(){if(typeof document>"u")return "";try{let o=document.documentElement,e=[];for(let t of ["class","style","data-theme","data-mode","data-color-mode"]){let n=o.getAttribute(t);n&&n.length<=1e3&&!/["<>]/.test(n)&&e.push(`${t}="${n}"`);}return e.join(" ")}catch{return ""}}function po(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function fo(o,e,t,n,i){let r=`(function(){var T=${JSON.stringify(n)};function P(m){m.__veo=T;parent.postMessage(m,'*');}window.veo={dismiss:function(){P({type:'dismiss'});},cta:function(u){P({type:'cta',url:u});},track:function(n,p){P({type:'track',name:n,props:p||{}});},navigate:function(u){P({type:'navigate',url:u});}};document.addEventListener('click',function(e){var a=e.target&&e.target.closest?e.target.closest('a[href]'):null;if(!a)return;var h=a.getAttribute('href');if(!h||h.charAt(0)==='#'||/^(javascript|mailto|tel):/i.test(h))return;e.preventDefault();if(a.target==='_blank'){P({type:'cta',url:a.href,close:false});}else{P({type:'navigate',url:h});}},true);function H(){var r=document.getElementById('__veo_root');var h=r?r.getBoundingClientRect().height:document.documentElement.scrollHeight;P({type:'resize',height:Math.ceil(h)});}window.addEventListener('load',H);try{if(typeof ResizeObserver!=='undefined'){var _r=document.getElementById('__veo_root');new ResizeObserver(H).observe(_r||document.documentElement);}}catch(e){}})();`,s=i.hostCss?`<style>${gt(i.hostCss,"style")}</style>`:"",a=i.tailwind?'<script src="https://cdn.tailwindcss.com"></script>':"";return `<!DOCTYPE html><html ${i.htmlAttrs}><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;}body{font-family:system-ui,-apple-system,sans-serif;}</style>`+s+"<style>html,body{margin:0!important;padding:0!important;background:transparent!important;height:auto!important;min-height:0!important;max-height:none!important;width:auto!important;min-width:0!important;overflow:visible!important;color-scheme:normal!important;}</style>"+a+`<style>${gt(e,"style")}</style></head><body style="margin:0!important;background:transparent!important;min-height:0!important;height:auto!important;"><div id="__veo_root">${o}</div><script>${r}</script>`+(t?`<script>${gt(t,"script")}</script>`:"")+"</body></html>"}function gt(o,e){let t=e==="script"?/<\/script/gi:/<\/style/gi;return o.replace(t,`<\\/${e}`)}function hn(o,e,t){if(o.sandboxed){let s={html:o.html??"",css:o.css,js:o.js},{iframe:a,cleanup:d}=Se(e,s,t,{width:"100%"}),l=e.createElement("div");return l.className="veo-code-sandbox",l.appendChild(a),{node:l,cleanup:d}}let n=e,i=[];if(typeof o.css=="string"&&o.css.trim()){let s=n.createElement("style");s.textContent=o.css,n.head.appendChild(s),i.push(s);}let r=null;if(typeof o.html=="string"&&o.html.trim()){r=e.createElement("div"),r.className="veo-code-html",r.innerHTML=o.html;for(let s of Array.from(r.querySelectorAll("script")))i.push(mo(s,n)),s.remove();}if(typeof o.js=="string"&&o.js.trim()){let s=n.createElement("script");s.textContent=o.js,n.body.appendChild(s),i.push(s);}return {node:r,cleanup:()=>{for(let s of i)s.parentNode?.removeChild(s);}}}function mo(o,e){let t=e.createElement("script");for(let n of Array.from(o.attributes))t.setAttribute(n.name,n.value);return o.src||(t.textContent=o.textContent),e.body.appendChild(t),t}function ot(o,e,t){let n=e.guide.guideSteps[0];if(!n)return;let i=n.fields??[],r=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();},s=t.createElement("div");if(s.className="veo-guide-content",n.title){let m=t.createElement("h2");m.className="veo-guide-title",m.textContent=n.title,s.appendChild(m);}if(n.content){let m=t.createElement("p");m.className="veo-guide-text",m.textContent=n.content,s.appendChild(m);}let a=[],d=t.createElement("form");d.className="veo-form",d.noValidate=true;for(let m of i){let{wrapper:f,read:p}=yt(m,t);a.push({field:m,read:p}),d.appendChild(f);}let l=t.createElement("p");l.className="veo-form-error",l.style.display="none",d.appendChild(l);let c=t.createElement("div");c.className="veo-guide-actions";let u=t.createElement("button");u.type="submit",u.className="veo-guide-cta",u.textContent=n.ctaText||"Enviar",c.appendChild(u),d.appendChild(c),d.addEventListener("submit",m=>{m.preventDefault(),l.style.display="none";let f={};for(let{field:h,read:g}of a){let v=g();if(v==null||v===""){if(h.required){l.textContent=`Completa "${h.label}"`,l.style.display="block";return}continue}f[h.key]=v;}if(Object.keys(f).length===0){l.textContent="Responde al menos un campo",l.style.display="block";return}u.disabled=true,(e.onFormSubmit??(()=>Promise.resolve(true)))(f).then(h=>{if(!h){u.disabled=false,l.textContent="No se pudo enviar. Prueba de nuevo.",l.style.display="block";return}e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"completed"});let g=e.isPreview?e.previewNote??"Vista previa: la respuesta NO se guard\xF3.":null;ho(o,t,g),window.setTimeout(()=>e.onClose(),g?2200:1400);});}),s.appendChild(d),s.appendChild(fe(t,r)),o.appendChild(s);}function ho(o,e,t){for(;o.firstChild;)o.removeChild(o.firstChild);let n=e.createElement("div");if(n.className="veo-form-thanks",n.textContent="\u2713 \xA1Gracias por tu respuesta!",o.appendChild(n),t){let i=e.createElement("p");i.className="veo-form-preview-note",i.textContent=t,o.appendChild(i);}}function yt(o,e){let t=e.createElement("div");t.className="veo-form-field";let n=e.createElement("label");switch(n.className="veo-form-label",n.textContent=o.required?`${o.label} *`:o.label,t.appendChild(n),o.type){case "textarea":{let i=e.createElement("textarea");return i.className="veo-form-input",i.rows=3,o.placeholder&&(i.placeholder=o.placeholder),t.appendChild(i),{wrapper:t,read:()=>i.value.trim()}}case "number":{let i=e.createElement("input");return i.type="number",i.className="veo-form-input",o.placeholder&&(i.placeholder=o.placeholder),t.appendChild(i),{wrapper:t,read:()=>i.value.trim()===""?void 0:Number(i.value)}}case "select":{let i=e.createElement("select");i.className="veo-form-input";let r=e.createElement("option");r.value="",r.textContent=o.placeholder||"Elige una opci\xF3n\u2026",i.appendChild(r);for(let s of o.options??[]){let a=e.createElement("option");a.value=s,a.textContent=s,i.appendChild(a);}return t.appendChild(i),{wrapper:t,read:()=>i.value||void 0}}case "radio":{let i=e.createElement("div");i.className="veo-form-options";let r=`veo-${o.key}`,s=[];for(let a of o.options??[]){let d=e.createElement("label");d.className="veo-form-option";let l=e.createElement("input");l.type="radio",l.name=r,l.value=a,s.push(l);let c=e.createElement("span");c.textContent=a,d.appendChild(l),d.appendChild(c),i.appendChild(d);}return t.appendChild(i),{wrapper:t,read:()=>s.find(a=>a.checked)?.value}}case "multiselect":{let i=e.createElement("div");i.className="veo-form-options";let r=[];for(let s of o.options??[]){let a=e.createElement("label");a.className="veo-form-option";let d=e.createElement("input");d.type="checkbox",d.value=s,r.push(d);let l=e.createElement("span");l.textContent=s,a.appendChild(d),a.appendChild(l),i.appendChild(a);}return t.appendChild(i),{wrapper:t,read:()=>{let s=r.filter(a=>a.checked).map(a=>a.value);return s.length>0?s:void 0}}}case "checkbox":{let i=e.createElement("label");i.className="veo-form-option";let r=e.createElement("input");r.type="checkbox";let s=e.createElement("span");return s.textContent=o.placeholder||"S\xED",i.appendChild(r),i.appendChild(s),t.appendChild(i),{wrapper:t,read:()=>r.checked?true:o.required?"":false}}case "yesno":{let i=e.createElement("div");i.className="veo-form-options";let r=`veo-${o.key}`,[s,a]=o.options?.length===2?o.options:["S\xED","No"],d=[];for(let{label:l,value:c}of [{label:s,value:true},{label:a,value:false}]){let u=e.createElement("label");u.className="veo-form-option";let m=e.createElement("input");m.type="radio",m.name=r,d.push({input:m,value:c});let f=e.createElement("span");f.textContent=l,u.appendChild(m),u.appendChild(f),i.appendChild(u);}return t.appendChild(i),{wrapper:t,read:()=>d.find(l=>l.input.checked)?.value}}case "nps":return gn(t,e,0,10,"veo-nps-btn");case "rating":return gn(t,e,1,5,"veo-rating-btn","\u2605");default:{let i=e.createElement("input");return i.type="text",i.className="veo-form-input",o.placeholder&&(i.placeholder=o.placeholder),t.appendChild(i),{wrapper:t,read:()=>i.value.trim()}}}}function gn(o,e,t,n,i,r){let s=e.createElement("div");s.className="veo-form-scale";let a,d=[];for(let l=t;l<=n;l++){let c=e.createElement("button");c.type="button",c.className=i,c.textContent=r??String(l),c.setAttribute("aria-label",String(l)),c.addEventListener("click",()=>{a=l,d.forEach((u,m)=>{let f=r?m+t<=l:m+t===l;u.classList.toggle("veo-scale-active",f);});}),d.push(c),s.appendChild(c);}return o.appendChild(s),{wrapper:o,read:()=>a}}var go={left:"flex-start",center:"center",right:"flex-end"},he=class extends w{constructor(){super(...arguments);this.badgeDelegate=null;}async render(t){let n=t.nav?.stepIndex??0,i=t.guide.guideSteps[n];if(!i)return;if(i.presentation==="badge"){let p={title:"",content:"",selector:i.anchorSelector??void 0,blocks:i.blocks??[],style:{...i.design??{},...i.badge?{badge:i.badge}:{},...i.badgeTrigger?{badgeTrigger:i.badgeTrigger}:{}}},h={...t.guide,guideSteps:[p]},{nav:g,...v}=t;this.badgeDelegate=new ne,await this.badgeDelegate.render({...v,guide:h});return}let r=(i.position==="relative-to-element"||i.presentation==="inline")&&i.anchorSelector?.trim()||void 0,s=null;if(r&&(s=await k(r),!s))return;let{host:a,root:d}=this.createHost(),l=d.ownerDocument??document,c=i.design??{};typeof c.zIndex=="number"&&(a.style.zIndex=String(c.zIndex));let u=l.createElement("div");u.className="veo-card",Co(u,c);let m=(p,h)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:p,...{}});},f=[];if(this.buildContent(u,i.blocks??[],l,t,n,f),c.closeButton!==false){let p=fe(l,()=>{m("dismissed"),this.closeOrSkip(t);}),h=typeof c.closeColor=="string"?c.closeColor:null,g=typeof c.closeHoverColor=="string"?c.closeHoverColor:null;h&&(p.style.color=h),g&&(p.addEventListener("mouseenter",()=>{p.style.color=g;}),p.addEventListener("mouseleave",()=>{p.style.color=h??"";})),u.appendChild(p);}if(i.presentation==="inline"&&s){a.style.display="block";let p=vo(i.inlinePosition);d.appendChild(u),P(s,a,p),this.registerCleanup(M(a,r,p));}else if(i.position==="relative-to-element"&&s){if(c.backdrop===true){let g=l.createElement("div");g.className="veo-composite-overlay veo-composite-overlay--dim",typeof c.backdropColor=="string"&&(g.style.background=c.backdropColor);let v=typeof c.backdropZIndex=="number"?c.backdropZIndex:2e5;g.style.zIndex=String(v),d.appendChild(g),c.targetAbove===true&&this.registerCleanup(wo(s,v+1));}let p=l.createElement("div");p.className="veo-composite-anchored";let h=c.caret===false?null:bo(l,c);h&&p.appendChild(h),p.appendChild(u),d.appendChild(p),this.registerCleanup(await xo(s,p,h));}else {let p=l.createElement("div");p.className="veo-composite-overlay",i.position==="center"&&c.backdrop!==false&&(p.classList.add("veo-composite-overlay--dim"),typeof c.backdropColor=="string"&&(p.style.background=c.backdropColor),typeof c.backdropZIndex=="number"&&(p.style.zIndex=String(c.backdropZIndex)),p.addEventListener("click",h=>{h.target===p&&(m("dismissed"),this.closeOrSkip(t));})),yo(u,i.position,c),p.appendChild(u),d.appendChild(p);}t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:"shown"});}buildContent(t,n,i,r,s,a){let d=c=>{r.onInteraction({guideId:r.guide.guideId,stepIndex:s,action:"cta_clicked",...c.id?{metadata:{buttonId:c.id}}:{}});},l=0;for(;l<n.length;){let c=n[l];if(!c){l++;continue}if(c.type==="button"){let m=i.createElement("div");m.className="veo-guide-actions";let f;for(;l<n.length&&n[l]?.type==="button";){let p=n[l];if(!f){let h=p.style?.align;(h==="left"||h==="center"||h==="right")&&(f=h);}m.appendChild(this.buildButton(p,i,r,s,a,d)),l++;}f&&(m.style.justifyContent=go[f]??"flex-end"),t.appendChild(m);continue}if(c.type==="code"){let{node:m,cleanup:f}=hn(c,i,r);m&&t.appendChild(m),this.registerCleanup(f),l++;continue}if(c.type==="form"){let m=i.createElement("div");m.className="veo-form";for(let f of c.fields??[]){let{wrapper:p,read:h}=yt(f,i);a.push({field:f,read:h}),m.appendChild(p);}t.appendChild(m),l++;continue}let u=nt(c,i);u&&t.appendChild(u),l++;}}buildButton(t,n,i,r,s,a){let d=n.createElement("button");d.type="button",d.className="veo-guide-cta",d.textContent=t.text?.trim()||"OK",xe(d,t.style,"button");let l=i.nav?.callbacks;return d.addEventListener("click",()=>{switch(t.action){case "next":a(t),l?l.onNext():i.onClose();break;case "prev":a(t),l?.onBack();break;case "url":a(t),typeof t.url=="string"&&R(t.url)&&window.open(t.url,"_blank","noopener,noreferrer");break;case "guide":a(t),t.targetGuideId&&i.onOpenGuide?.(t.targetGuideId),this.closeOrSkip(i);break;case "submit-forms":case "submit-forms-advance":case "submit-forms-goto":this.submitForms(s,i,r,d,()=>{a(t),t.action==="submit-forms"||!l?i.onClose():t.action==="submit-forms-goto"&&typeof t.targetStep=="number"&&l.onGoto?l.onGoto(t.targetStep):l.onNext();});break;default:a(t),this.closeOrSkip(i);}}),d}submitForms(t,n,i,r,s){let a={};for(let{field:l,read:c}of t){let u=c();if(u==null||u===""){if(l.required){r.textContent=`Completa "${l.label}"`;return}continue}a[l.key]=u;}if(t.length>0&&Object.keys(a).length===0)return;r.disabled=true,(n.onFormSubmit??(()=>Promise.resolve(true)))(a).then(l=>{r.disabled=false,l&&(n.onInteraction({guideId:n.guide.guideId,stepIndex:i,action:"completed"}),s());});}closeOrSkip(t){t.nav?.callbacks?t.nav.callbacks.onSkip():t.onClose();}destroy(){this.badgeDelegate?.destroy(),this.badgeDelegate=null,super.destroy();}};function vo(o){return o==="before"||o==="prepend"||o==="append"?o:"after"}function yo(o,e,t){let n=o.style;n.position="fixed";let i="16px",r=t.hAlign==="left"?"left":t.hAlign==="right"?"right":null,s=e.includes("top")?"top":e.includes("bottom")?"bottom":"middle",a=r??(e.includes("left")?"left":e.includes("right")?"right":"middle");s==="top"?n.top=i:s==="bottom"?n.bottom=i:n.top="50%",a==="left"?n.left=i:a==="right"?n.right=i:n.left="50%";let d=a==="middle"?"-50%":"0",l=s==="middle"?"-50%":"0";n.transform=d==="0"&&l==="0"?"":`translate(${d}, ${l})`;}function bo(o,e){let t=o.createElement("div");t.className="veo-composite-caret";let n=typeof e.caretWidth=="number"?e.caretWidth:12,i=typeof e.caretHeight=="number"?e.caretHeight:12,r=t.style;if(r.position="absolute",r.width=`${n}px`,r.height=`${i}px`,r.transform="rotate(45deg)",r.background=typeof e.background=="string"?e.background:"#ffffff",typeof e.borderWidth=="number"&&e.borderWidth>0){let s=typeof e.borderColor=="string"?e.borderColor:"#bbbbbb";r.border=`${e.borderWidth}px solid ${s}`;}return t}function wo(o,e){let t=o,n=t.style.position,i=t.style.zIndex;return getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.style.zIndex=String(e),()=>{t.style.position=n,t.style.zIndex=i;}}async function xo(o,e,t){let n=async()=>{let{x:r,y:s,placement:a,middlewareData:d}=await z(o,e,{placement:"bottom",strategy:"fixed",middleware:[D(t?10:8),W(),H({padding:8}),...t?[ee({element:t})]:[]]});e.style.left=`${r}px`,e.style.top=`${s}px`,t&&te(t,a,d.arrow);};await n();let i=()=>{n();};return window.addEventListener("scroll",i,true),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i,true),window.removeEventListener("resize",i);}}function Co(o,e){let t=o.style,n=a=>typeof a=="number"&&Number.isFinite(a)?`${a}px`:null,i=a=>typeof a=="string"&&a?a:null;i(e.background)&&(t.background=e.background);let r=i(e.color)??i(e.textColor);r&&(t.color=r),n(e.fontSize)&&(t.fontSize=n(e.fontSize)),i(e.fontWeight)&&(t.fontWeight=e.fontWeight),i(e.fontFamily)&&e.fontFamily!=="inherit"&&(t.fontFamily=e.fontFamily),i(e.textTransform)&&e.textTransform!=="none"&&(t.textTransform=e.textTransform),typeof e.letterSpacing=="number"&&(t.letterSpacing=`${e.letterSpacing}px`),i(e.align)&&(t.textAlign=e.align),typeof e.lineHeight=="number"&&(t.lineHeight=`${e.lineHeight}%`),n(e.radius)&&(t.borderRadius=n(e.radius));let s=n(e.borderWidth);if(s&&(t.border=`${s} solid ${i(e.borderColor)??"#e5e5e5"}`),i(e.shadowColor)||typeof e.shadowBlur=="number"){let a=d=>typeof e[d]=="number"?e[d]:0;t.boxShadow=`${a("shadowX")}px ${a("shadowY")}px ${a("shadowBlur")}px ${a("shadowSpread")}px ${i(e.shadowColor)??"rgba(0,0,0,0.2)"}`;}e.fullWidth===true?t.width="100%":e.widthType==="fluid"?(t.width="auto",n(e.width)&&(t.maxWidth=n(e.width))):n(e.width)&&(t.width=n(e.width));for(let a of ["Top","Right","Bottom","Left"]){let d=n(e[`padding${a}`]);d&&t.setProperty(`padding-${a.toLowerCase()}`,d);let l=n(e[`margin${a}`]);l&&t.setProperty(`margin-${a.toLowerCase()}`,l);}}var So={mode:"floating",position:"bottom-right"},vn=16,ko=360,ke=class extends w{async render(e){let t=e.guide.guideSteps[0];if(!t||typeof t.html!="string"||t.html.length===0)return;let n=t.placement??So,i=null;if(n.mode==="anchored"){let c=n.selector??t.selector??e.guide.activationRules.selector;if(typeof c!="string"||c.length===0||(i=await k(c),!i))return}let{root:r}=this.createHost(),s=r.ownerDocument??document,a=s.createElement("div");a.className=n.mode==="anchored"?"veo-custom-anchored":"veo-custom-floating";let{iframe:d,cleanup:l}=Se(s,t,e,{width:vt(n.width??ko),fixedHeight:n.height??null});this.registerCleanup(l),a.appendChild(d),r.appendChild(a),n.mode==="floating"?Eo(a,n):i&&this.registerCleanup(await this.setupAnchoredPosition(i,a,n)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}async setupAnchoredPosition(e,t,n){let i=n.side??"bottom",r=async()=>{let{x:a,y:d}=await z(e,t,{placement:i,strategy:"fixed",middleware:[D(n.offsetY??8),W(),H({padding:8})]});t.style.left=`${a}px`,t.style.top=`${d}px`;};await r();let s=()=>{r();};return window.addEventListener("scroll",s,true),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s,true),window.removeEventListener("resize",s);}}};function Eo(o,e){let t=e.position??"bottom-right",n=`${e.offsetX??vn}px`,i=`${e.offsetY??vn}px`,r=o.style;if(t==="center"){r.top="50%",r.left="50%",r.transform="translate(-50%, -50%)";return}let[s,a]=t.split("-");s==="top"?r.top=i:r.bottom=i,a==="left"?r.left=n:a==="right"?r.right=n:(r.left="50%",r.transform="translateX(-50%)");}var Ee=class extends w{render(e){let t=e.guide.guideSteps[0];if(!t||(t.fields??[]).length===0)return;let{root:n}=this.createHost();this.applyDesign(t.style);let i=n.ownerDocument??document,r=i.createElement("div");r.className="veo-modal-overlay";let s=i.createElement("div");s.className="veo-modal-card",ot(s,e,i),r.appendChild(s),n.appendChild(r);let a=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();};r.addEventListener("click",l=>{l.target===r&&a();});let d=l=>{l.key==="Escape"&&a();};document.addEventListener("keydown",d),this.registerCleanup(()=>document.removeEventListener("keydown",d)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var Re=class extends w{async render(e){let t=e.guide.guideSteps[0];if(!t||typeof t.html!="string"||t.html.length===0)return;let n=t.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await k(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let a=K(t.style);P(i,r,a),this.registerCleanup(M(r,n,a));let d=s.ownerDocument??document,l=d.createElement("div");l.className="veo-custom-inline";let{iframe:c,cleanup:u}=Se(d,t,e,{width:"100%"});this.registerCleanup(u),l.appendChild(c),s.appendChild(l),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var Ie=class extends w{async render(e){let t=e.guide.guideSteps[0];if(!t||(t.fields??[]).length===0)return;let n=t.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await k(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let a=K(t.style);P(i,r,a),this.registerCleanup(M(r,n,a)),this.applyDesign(t.style);let d=s.ownerDocument??document,l=d.createElement("div");l.className="veo-inline",ot(l,e,d),s.appendChild(l),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var Te=class extends w{async render(e){let t=e.guide.guideSteps[0];if(!t)return;let n=t.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await k(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let a=K(t.style);P(i,r,a),this.registerCleanup(M(r,n,a)),this.applyDesign(t.style);let d=s.ownerDocument??document,l=d.createElement("div");l.className="veo-inline";let c=(m,f,p)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:m,...p?{metadata:p}:{}}),f&&window.open(f,"_blank","noopener,noreferrer"),e.onClose();},u=A(t,d,{onCtaClick:(m,f,p)=>{c("cta_clicked",m==="url"?f:void 0,p),m==="guide"&&f&&e.onOpenGuide?.(f);},onDismiss:()=>c("dismissed")});l.appendChild(u),s.appendChild(l),this.liveContainer=l,this.liveContent=u,this.liveKey=`${n}|${a}`,this.liveBuild=m=>A(m,d,{onCtaClick:(f,p,h)=>{c("cta_clicked",f==="url"?p:void 0,h),f==="guide"&&p&&e.onOpenGuide?.(p);},onDismiss:()=>c("dismissed")}),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(e){return `${e.selector??""}|${K(e.style)}`}};function yn(o){return o.style?.backdrop===false?"veo-modal-overlay veo-modal-overlay--none":"veo-modal-overlay"}var ie=class extends w{constructor(){super(...arguments);this.overlay=null;}render(t){let n=t.nav?.stepIndex??0,i=t.guide.guideSteps[n];if(!i)return;let{root:r}=this.createHost();this.applyDesign(i.style);let s=r.ownerDocument??document,a=s.createElement("div");a.className=yn(i),this.overlay=a;let d=s.createElement("div");d.className="veo-modal-card";let l=(f,p,h)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:f,...h?{metadata:h}:{}}),p&&window.open(p,"_blank","noopener,noreferrer"),t.onClose();},c=()=>{t.nav?t.nav.callbacks.onSkip():l("dismissed");},u=t.nav?Ce(i,t.nav.stepIndex,t.nav.totalSteps,s,t.nav.callbacks):A(i,s,{onCtaClick:(f,p,h)=>{l("cta_clicked",f==="url"?p:void 0,h),f==="guide"&&p&&t.onOpenGuide?.(p);},onDismiss:()=>l("dismissed")});d.appendChild(u),a.appendChild(d),r.appendChild(a),t.nav||(this.liveContainer=d,this.liveContent=u,this.liveBuild=f=>A(f,s,{onCtaClick:(p,h,g)=>{l("cta_clicked",p==="url"?h:void 0,g),p==="guide"&&h&&t.onOpenGuide?.(h);},onDismiss:()=>l("dismissed")})),a.addEventListener("click",f=>{f.target===a&&c();});let m=f=>{f.key==="Escape"&&c();};document.addEventListener("keydown",m),this.registerCleanup(()=>document.removeEventListener("keydown",m)),t.nav||t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"shown"});}onLiveUpdate(t){this.overlay&&(this.overlay.className=yn(t));}destroy(){this.overlay=null,super.destroy();}};var Ae=class extends w{constructor(){super(...arguments);this.side="bottom";this.reposition=null;}async render(t){let n=t.guide.guideSteps[0];if(!n)return;let i=n.selector??t.guide.activationRules.selector;if(typeof i!="string"||i.length===0)return;let r=await k(i);if(!r)return;let s=n.style?.tooltipPlacement;this.side=s==="top"||s==="left"||s==="right"?s:"bottom";let{root:a}=this.createHost();this.applyDesign(n.style);let d=a.ownerDocument??document,l=d.createElement("div");l.className="veo-tooltip";let c=(h,g,v)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:h,...v?{metadata:v}:{}}),g&&window.open(g,"_blank","noopener,noreferrer"),t.onClose();},u=A(n,d,{onCtaClick:(h,g,v)=>{c("cta_clicked",h==="url"?g:void 0,v),h==="guide"&&g&&t.onOpenGuide?.(g);},onDismiss:()=>c("dismissed")});l.appendChild(u);let m=d.createElement("div");m.className="veo-tooltip-arrow",l.appendChild(m),a.appendChild(l);let f=async()=>{let{x:h,y:g,placement:v,middlewareData:b}=await z(r,l,{placement:this.side,middleware:[D(10),W(),H({padding:8}),ee({element:m})]});l.style.left=`${h}px`,l.style.top=`${g}px`,te(m,v,b.arrow);};await f();let p=()=>{f();};this.reposition=p,window.addEventListener("scroll",p,true),window.addEventListener("resize",p),this.registerCleanup(()=>{window.removeEventListener("scroll",p,true),window.removeEventListener("resize",p);}),this.liveContainer=l,this.liveContent=u,this.liveKey=i,this.liveBuild=h=>A(h,d,{onCtaClick:(g,v,b)=>{c("cta_clicked",g==="url"?v:void 0,b),g==="guide"&&v&&t.onOpenGuide?.(v);},onDismiss:()=>c("dismissed")}),t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(t){return t.selector??""}onLiveUpdate(t){let n=t.style?.tooltipPlacement;this.side=n==="top"||n==="left"||n==="right"?n:"bottom",this.reposition?.();}};var Pe=class extends w{async render(e){let t=e.guide.guideSteps[e.currentStepIndex];if(!t)return false;let n=t.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return false;let i=await k(n,5e3);if(!i)return false;let r=t.style?.tooltipPlacement,s=r==="top"||r==="left"||r==="right"?r:"bottom",{root:a}=this.createHost();this.applyDesign(t.style);let d=a.ownerDocument??document,l=d.createElement("div");l.className="veo-walkthrough";let c=Ce(t,e.currentStepIndex,e.guide.guideSteps.length,d,e.callbacks);l.appendChild(c);let u=d.createElement("div");u.className="veo-walkthrough-arrow",l.appendChild(u),a.appendChild(l);let m=async()=>{let{x:p,y:h,placement:g,middlewareData:v}=await z(i,l,{placement:s,middleware:[D(10),W(),H({padding:8}),ee({element:u})]});l.style.left=`${p}px`,l.style.top=`${h}px`,te(u,g,v.arrow);};await m();let f=()=>{m();};return window.addEventListener("scroll",f,true),window.addEventListener("resize",f),this.registerCleanup(()=>{window.removeEventListener("scroll",f,true),window.removeEventListener("resize",f);}),true}};function Ro(o,e){switch(o.type){case "exact":return o.pattern===e;case "prefix":return e.startsWith(o.pattern);case "regex":try{return new RegExp(o.pattern).test(e)}catch{return false}}}function it(o,e){return !o||o.scope==="sitewide"||!o.pattern?true:Ro({type:o.matchType??"prefix",pattern:o.pattern},e)}var rt=class{constructor(e){this.state=null;this.storageKey=`${kt}${e}`,this.state=this.load(),this.state&&this.isAbandoned(this.state)&&this.clear();}current(){return this.state?this.isAbandoned(this.state)?(this.clear(),null):this.state:null}hasActive(){return this.current()!==null}start(e,t){let n=Date.now();return this.state={guideId:e,totalSteps:t,currentStepIndex:0,startedAt:n,lastProgressAt:n},this.persist(),this.state}advance(){if(!this.state)return null;let e=this.state.currentStepIndex+1;return e>=this.state.totalSteps?null:(this.state={...this.state,currentStepIndex:e,lastProgressAt:Date.now()},this.persist(),this.state)}back(){return this.state?this.state.currentStepIndex===0?this.state:(this.state={...this.state,currentStepIndex:this.state.currentStepIndex-1,lastProgressAt:Date.now()},this.persist(),this.state):null}clear(){if(this.state=null,!(typeof localStorage>"u"))try{localStorage.removeItem(this.storageKey);}catch{}}isAbandoned(e){return Date.now()-e.lastProgressAt>18e5}load(){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(this.storageKey);if(!e)return null;let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;return typeof n.guideId!="string"||typeof n.totalSteps!="number"||typeof n.currentStepIndex!="number"||typeof n.startedAt!="number"||typeof n.lastProgressAt!="number"?null:n}catch{return null}}persist(){if(!(typeof localStorage>"u"||!this.state))try{localStorage.setItem(this.storageKey,JSON.stringify(this.state));}catch{}}};var To=3e4,Ao={shown:"shown",dismissed:"dismissed",cta_clicked:null,step_advanced:null,step_back:null,completed:"completed"},st=class{constructor(e,t){this.client=e;this.activeRenderers=new Set;this.activeByGuideId=new Map;this.dispatched=new Set;this.activeWalkthroughRenderer=null;this.activeWalkthroughGuide=null;this.resolveCache=null;this.inflightResolve=null;this.armedTriggers=new Map;this.pendingComposite=null;if(this.debug=t.debug===true,this.apiUrl=t.apiUrl,this.apiKey=t.apiKey,this.resolver=t.resolver??new ze(t.apiUrl,t.apiKey,this.debug),t.trackerQueue)this.trackerQueue=t.trackerQueue;else {let i=new Ue(t.apiUrl,t.apiKey);this.trackerQueue=new Ke({client:i,flushIntervalMs:3e3,batchSize:5,maxRetries:3,onError:(r,s)=>{this.debug&&console.warn(`[veo] dropped guide interaction after retries: guideId=${s.guideId} action=${s.payload.action}`,r);}});}let n=It(t.apiKey);this.frequencyCache=t.frequencyCache??new We(n),this.walkthroughState=t.walkthroughState??new rt(n);}get pendingInteractions(){return this.trackerQueue.size}clearFrequencyCache(){this.frequencyCache.clear();}clearWalkthroughState(){this.tearDownWalkthrough();}async checkGuides(e,t){let n=this.client.getEndUserId();if(!n){this.debug&&console.log("[veo] guides: skipped, no endUserId yet");return}if(await this.tryResumeWalkthrough(n,t,e))return;this.tryResumeComposite(t,e);let i;try{i=await this.resolveGuides(n,e);}catch(r){this.debug&&console.error("[veo] guides resolver threw:",r);return}this.debug&&console.log(`[veo] guides: ${i.length} eligible at ${e}`),this.disarmTriggers();for(let r of i){let s=r.activationRules.trigger;if((s==="on_click"||s==="on_hover")&&r.activationRules.selector){this.armInteractionTrigger(r,n,t,e);continue}await this.showGuide(r,n,t,e);}}async showGuide(e,t,n,i){if(this.frequencyCache.shouldFilter(e.guideId,e.displayFrequency)){this.debug&&console.log(`[veo] guides: filtered locally guideId=${e.guideId}`);return}if(this.activeByGuideId.has(e.guideId)){this.debug&&console.log(`[veo] guides: already shown guideId=${e.guideId}`);return}if(e.guideType==="walkthrough"&&e.guideSteps.length>1){if(this.walkthroughState.hasActive()){this.debug&&console.log(`[veo] guides: walkthrough ${e.guideId} skipped (another active)`);return}await this.startWalkthrough(e,t,n,i);return}if(e.guideType==="composite"){this.startComposite(e,n,i);return}this.runSingleStepRender(e,n,i);}armInteractionTrigger(e,t,n,i){if(this.frequencyCache.shouldFilter(e.guideId,e.displayFrequency)||this.activeByGuideId.has(e.guideId)||this.armedTriggers.has(e.guideId))return;let r=e.activationRules.selector,s=e.activationRules.trigger==="on_hover"?"mouseover":"click",a=l=>{let c=l.target;if(c instanceof Element){try{if(!c.closest(r))return}catch{return}d(),this.showGuide(e,t,n,i);}},d=()=>{document.removeEventListener(s,a,true),this.armedTriggers.delete(e.guideId);};document.addEventListener(s,a,true),this.armedTriggers.set(e.guideId,d),this.debug&&console.log(`[veo] guides: armed ${s} trigger for ${e.guideId} on ${r}`);}disarmTriggers(){for(let e of this.armedTriggers.values())e();this.armedTriggers.clear();}async resolveGuides(e,t){let n=`${e}
|
|
427
|
+
${t}`,i=Date.now();if(this.resolveCache?.key===n&&i-this.resolveCache.at<To)return this.debug&&console.log("[veo] guides: resolve cache hit"),this.resolveCache.guides;if(this.inflightResolve?.key===n)return this.inflightResolve.promise;let r=this.resolver.resolve(e,t);this.inflightResolve={key:n,promise:r};try{let s=await r;return this.resolveCache={key:n,at:Date.now(),guides:s},s}finally{this.inflightResolve?.key===n&&(this.inflightResolve=null);}}destroy(){for(let e of this.activeRenderers)try{e.destroy();}catch(t){this.debug&&console.error("[veo] renderer destroy failed:",t);}if(this.activeRenderers.clear(),this.activeByGuideId.clear(),this.activeWalkthroughRenderer){try{this.activeWalkthroughRenderer.destroy();}catch{}this.activeWalkthroughRenderer=null,this.activeWalkthroughGuide=null;}this.disarmTriggers(),this.dispatched.clear(),this.resolveCache=null,this.inflightResolve=null,this.trackerQueue.destroy();}runSingleStepRender(e,t,n){let i=this.createSingleStepRenderer(e.guideType);if(!i)return;this.activeByGuideId.set(e.guideId,i);let r=e.activationRules.delayMs??0;window.setTimeout(()=>this.mountSingleStepRenderer(e,i,t,n),r);}startComposite(e,t,n){if(this.pendingComposite?.guide.guideId===e.guideId)return;let r=e.guideSteps.findIndex(s=>it(s.pageLocation,n));r!==-1&&this.renderCompositeStep(e,r,t,n);}tryResumeComposite(e,t){let n=this.pendingComposite;if(!n)return false;let r=n.guide.guideSteps[n.stepIndex];return r?it(r.pageLocation,t)?(this.pendingComposite=null,this.renderCompositeStep(n.guide,n.stepIndex,e,t),true):false:(this.pendingComposite=null,false)}renderCompositeStep(e,t,n,i){let r=e.guideSteps,s=new he;this.activeRenderers.add(s),this.activeByGuideId.set(e.guideId,s);let a=()=>{s.destroy(),this.activeRenderers.delete(s),this.activeByGuideId.get(e.guideId)===s&&this.activeByGuideId.delete(e.guideId);},d=c=>{if(a(),c<0||c>=r.length)return;let u=r[c];u&&it(u.pageLocation,i)?this.renderCompositeStep(e,c,n,i):this.pendingComposite={guide:e,stepIndex:c};},l=r.length>1?{stepIndex:t,totalSteps:r.length,callbacks:{onNext:()=>d(t+1),onBack:()=>d(t-1),onGoto:c=>d(c),onSkip:a,onComplete:a}}:void 0;try{s.render({guide:e,onInteraction:c=>this.handleInteraction(e,n,i,c),onClose:a,onTrack:(c,u)=>this.client.track(c,u),onFormSubmit:c=>this.submitFormResponse(e.guideId,c),onOpenGuide:c=>{this.openGuideById(c,n,i);},...l?{nav:l}:{}});}catch(c){this.debug&&console.error("[veo] composite renderer threw:",c),a();}}mountSingleStepRenderer(e,t,n,i){this.activeRenderers.add(t),this.activeByGuideId.set(e.guideId,t);let r=()=>{t.destroy(),this.activeRenderers.delete(t),this.activeByGuideId.get(e.guideId)===t&&this.activeByGuideId.delete(e.guideId);},s=c=>{this.handleInteraction(e,n,i,c);},a=(c,u)=>{this.client.track(c,u);},d=c=>this.submitFormResponse(e.guideId,c),l=c=>{this.openGuideById(c,n,i);};try{t.render({guide:e,onInteraction:s,onClose:r,onTrack:a,onFormSubmit:d,onOpenGuide:l});}catch(c){this.debug&&console.error("[veo] renderer.render threw:",c),this.activeRenderers.delete(t),this.activeByGuideId.get(e.guideId)===t&&this.activeByGuideId.delete(e.guideId);}}async openGuideById(e,t,n){if(this.activeByGuideId.has(e))return;let i=await this.resolver.fetchById(e);if(!i){this.debug&&console.warn(`[veo] guides: chained guide ${e} not found`);return}let r=this.client.getEndUserId()??this.client.getAnonymousId();if(i.guideType==="walkthrough"&&i.guideSteps.length>1){this.walkthroughState.hasActive()||await this.startWalkthrough(i,r,t,n);return}this.runSingleStepRender(i,t,n);}async tryResumeWalkthrough(e,t,n){let i=this.walkthroughState.current();if(!i)return false;let r=await this.resolver.fetchById(i.guideId);if(!r||r.guideType!=="walkthrough")return this.debug&&console.log(`[veo] guides: walkthrough ${i.guideId} no longer available, cleaning up`),this.tearDownWalkthrough(),true;let s=Math.min(i.currentStepIndex,r.guideSteps.length-1);return await this.renderWalkthroughStep(r,s,e,t,n),true}async startWalkthrough(e,t,n,i){this.walkthroughState.start(e.guideId,e.guideSteps.length),await this.renderWalkthroughStep(e,0,t,n,i)&&(this.enqueueInteractionOnce(e.guideId,t,n,i,"shown",0),this.frequencyCache.record(e.guideId,"shown"));}async renderWalkthroughStep(e,t,n,i,r){this.activeWalkthroughRenderer&&(this.activeWalkthroughRenderer.destroy(),this.activeWalkthroughRenderer=null),this.activeWalkthroughGuide=e;let s={onNext:()=>this.handleWalkthroughNext(n,i,r),onBack:()=>this.handleWalkthroughBack(n,i,r),onSkip:()=>this.handleWalkthroughSkip(n,i,r),onComplete:()=>this.handleWalkthroughComplete(n,i,r)},a=e.guideSteps[t],d=Po(a);if(d==="modal"||d==="banner"){let u=d==="modal"?new ie:new oe;try{u.render({guide:e,onInteraction:()=>{},onClose:()=>{},nav:{stepIndex:t,totalSteps:e.guideSteps.length,callbacks:s}});}catch(m){return this.debug&&console.error("[veo] sequence renderer threw:",m),this.tearDownWalkthrough(),false}return this.activeWalkthroughRenderer=u,true}let l=new Pe,c=false;try{c=await l.render({guide:e,currentStepIndex:t,callbacks:s});}catch(u){this.debug&&console.error("[veo] walkthrough renderer threw:",u);}return c?(this.activeWalkthroughRenderer=l,true):(this.debug&&console.warn(`[veo] walkthrough ${e.guideId} step ${t} could not render, cancelling`),this.tearDownWalkthrough(),false)}handleWalkthroughNext(e,t,n){let i=this.activeWalkthroughGuide;if(!i)return;let r=this.walkthroughState.advance();if(!r){this.handleWalkthroughComplete(e,t,n);return}this.enqueueInteraction(i.guideId,e,t,n,"step_advanced",r.currentStepIndex),this.renderWalkthroughStep(i,r.currentStepIndex,e,t,n);}handleWalkthroughBack(e,t,n){let i=this.activeWalkthroughGuide;if(!i)return;let r=this.walkthroughState.current();if(!r||r.currentStepIndex===0)return;let s=this.walkthroughState.back();s&&(this.enqueueInteraction(i.guideId,e,t,n,"step_back",s.currentStepIndex),this.renderWalkthroughStep(i,s.currentStepIndex,e,t,n));}handleWalkthroughSkip(e,t,n){let i=this.activeWalkthroughGuide,r=this.walkthroughState.current();!i||!r||(this.enqueueInteraction(i.guideId,e,t,n,"dismissed",r.currentStepIndex),this.frequencyCache.record(i.guideId,"dismissed"),this.tearDownWalkthrough());}handleWalkthroughComplete(e,t,n){let i=this.activeWalkthroughGuide,r=this.walkthroughState.current();!i||!r||(this.enqueueInteraction(i.guideId,e,t,n,"completed",r.currentStepIndex),this.frequencyCache.record(i.guideId,"completed"),this.tearDownWalkthrough());}tearDownWalkthrough(){if(this.activeWalkthroughRenderer)try{this.activeWalkthroughRenderer.destroy();}catch{}this.activeWalkthroughRenderer=null,this.activeWalkthroughGuide=null,this.walkthroughState.clear();}handleInteraction(e,t,n,i){let r=i.metadata?.buttonId?`:${i.metadata.buttonId}`:"",s=`${e.guideId}:${i.action}${r}`;if(this.dispatched.has(s)){this.debug&&console.log(`[veo] guides: dedup hit ${s}`);return}this.dispatched.add(s);let a=Ao[i.action];a&&this.frequencyCache.record(e.guideId,a);let d=this.client.getEndUserId();if(!d){this.debug&&console.warn("[veo] guides: interaction without endUserId \u2014 skipping enqueue");return}this.trackerQueue.enqueue({guideId:e.guideId,payload:{endUserId:d,sessionId:t,action:i.action,stepIndex:i.stepIndex,pageUrl:n,pagePath:bn(n),...i.metadata?{metadata:i.metadata}:{}}});}enqueueInteraction(e,t,n,i,r,s){this.trackerQueue.enqueue({guideId:e,payload:{endUserId:t,sessionId:n,action:r,stepIndex:s,pageUrl:i,pagePath:bn(i)}});}enqueueInteractionOnce(e,t,n,i,r,s){let a=`${e}:${r}:${s}`;this.dispatched.has(a)||(this.dispatched.add(a),this.enqueueInteraction(e,t,n,i,r,s));}createSingleStepRenderer(e){switch(e){case "modal":return new ie;case "banner":return new oe;case "tooltip":return new Ae;case "custom":return new ke;case "inline":return new Te;case "inline-custom":return new Re;case "form":return new Ee;case "inline-form":return new Ie;case "badge":return new ne;case "composite":return new he;case "walkthrough":return null;default:return null}}async submitFormResponse(e,t){let n=this.client.getEndUserId()??this.client.getAnonymousId();try{let i=await fetch(`${this.apiUrl}/v1/guides/${e}/form-response`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":this.apiKey},body:JSON.stringify({endUserId:n,answers:t})});return !i.ok&&this.debug&&console.warn("[veo] form-response respondi\xF3",i.status),i.ok}catch(i){return this.debug&&console.warn("[veo] form-response fall\xF3:",i),false}}};function bn(o){try{return new URL(o).pathname}catch{return "/"}}function Po(o){let e=o?.style?.render;return typeof e=="string"?e:"walkthrough"}var Lo="__veo_preview__",bt=class{constructor(){this.singleStep=null;this.walkthrough=null;this.walkthroughGuide=null;this.walkthroughIndex=0;this.input=null;}preview(e){let t=e.guideSteps[0];if(this.singleStep&&this.input&&e.guideType===this.input.guideType&&e.guideType!=="walkthrough"&&t&&this.singleStep.updateStep(t))return this.input=e,{close:()=>this.close(),ready:Promise.resolve({rendered:true}),host:()=>this.activeHost()};this.close(),this.input=e;let n=Go(e),i=typeof e.startStepIndex=="number"?e.startStepIndex:0;if(n.guideType==="composite"){let s=Math.min(Math.max(0,i),n.guideSteps.length-1),a=n.guideSteps[s];a&&(n.guideSteps=[a]);let d=this.renderSingleStep(n);return {close:()=>this.close(),ready:d,host:()=>this.activeHost()}}let r=n.guideType==="walkthrough"?this.startWalkthrough(n,i):this.renderSingleStep(n);return {close:()=>this.close(),ready:r,host:()=>this.activeHost()}}activeHost(){return this.singleStep?this.singleStep.hostElement():this.walkthrough instanceof w?this.walkthrough.hostElement():null}close(){this.singleStep&&(ge(this.singleStep),this.singleStep=null),this.walkthrough&&(ge(this.walkthrough),this.walkthrough=null),this.walkthroughGuide=null,this.walkthroughIndex=0,this.input=null;}async renderSingleStep(e){let t=No(e.guideType);if(!t)return {rendered:false};this.singleStep=t;let n=false;try{await t.render({guide:e,onInteraction:i=>{i.action==="shown"&&(n=!0);},onClose:()=>this.close(),onTrack:()=>{},onOpenGuide:()=>{},onFormSubmit:this.input?.formSubmit??(()=>Promise.resolve(!0)),isPreview:!0,...this.input?.formSubmit&&this.input.formSubmitNote!==void 0?{previewNote:this.input.formSubmitNote}:{}});}catch{return this.close(),{rendered:false}}return this.singleStep!==t?(ge(t),{rendered:false}):{rendered:n}}async startWalkthrough(e,t=0){if(e.guideSteps.length===0)return {rendered:false};this.walkthroughGuide=e;let n=Math.min(Math.max(0,Math.floor(t)),e.guideSteps.length-1);return this.walkthroughIndex=n,{rendered:await this.renderWalkthroughStep(n)}}async renderWalkthroughStep(e){let t=this.walkthroughGuide;if(!t)return false;this.walkthrough&&(ge(this.walkthrough),this.walkthrough=null);let n={onNext:()=>{let d=this.walkthroughIndex+1;if(d>=t.guideSteps.length){this.close();return}this.walkthroughIndex=d,this.renderWalkthroughStep(d);},onBack:()=>{let d=this.walkthroughIndex-1;d<0||(this.walkthroughIndex=d,this.renderWalkthroughStep(d));},onSkip:()=>this.close(),onComplete:()=>this.close()},r=t.guideSteps[e]?.style?.render;if(r==="modal"||r==="banner"){let d=r==="modal"?new ie:new oe;try{d.render({guide:t,onInteraction:()=>{},onClose:()=>this.close(),nav:{stepIndex:e,totalSteps:t.guideSteps.length,callbacks:n}});}catch{return ge(d),false}return this.walkthroughGuide!==t?(ge(d),false):(this.walkthrough=d,true)}let s=new Pe,a=false;try{a=await s.render({guide:t,currentStepIndex:e,callbacks:n});}catch{a=false;}return !a||this.walkthroughGuide!==t?(ge(s),false):(this.walkthrough=s,true)}},at=null;function lt(o){return He()?(at||(at=new bt),at.preview(o)):{close:()=>{},ready:Promise.resolve({rendered:false}),host:()=>null}}function wn(){at?.close();}function Go(o){let e=o.activationRules?.selector,t={url:o.activationRules?.url??{type:"prefix",pattern:"/"},trigger:"immediate",...e!==void 0?{selector:e}:{}};return {guideId:Lo,guideName:o.guideName??"Preview",guideType:o.guideType,guideSteps:o.guideSteps,activationRules:t,displayFrequency:"always",displayPriority:0}}function No(o){switch(o){case "modal":return new ie;case "banner":return new oe;case "tooltip":return new Ae;case "custom":return new ke;case "inline":return new Te;case "inline-custom":return new Re;case "form":return new Ee;case "inline-form":return new Ie;case "badge":return new ne;case "composite":return new he;case "walkthrough":return null;default:return null}}function ge(o){try{o.destroy();}catch{}}var dt=null;async function xn(o){if(!He())return null;dt?.teardown();let e=null;try{let a=await fetch(`${o.apiUrl}/v1/guides/preview-resolve`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":o.apiKey},body:JSON.stringify({token:o.token})});a.ok?e=(await a.json()).guide??null:o.debug&&console.warn("[veo] preview-resolve respondi\xF3",a.status);}catch(a){o.debug&&console.warn("[veo] preview-resolve fall\xF3:",a);}let t=async a=>{if(!e)return false;let d=window.veo,l=d?.getEndUserId?.()??d?.getAnonymousId?.()??null;if(!l)return false;try{return (await fetch(`${o.apiUrl}/v1/guides/${e.guideId}/form-response`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":o.apiKey},body:JSON.stringify({endUserId:l,answers:a})})).ok}catch{return false}},n=null,i=()=>{e&&(n?.close(),n=lt({guideType:e.guideType,guideSteps:e.guideSteps,activationRules:e.activationRules,guideName:e.guideName,formSubmit:t,formSubmitNote:"Vista previa: guardado en TU usuario para probar el flujo."}));},r=Mo({label:e?`Vista previa: ${e.guideName}`:"Link de preview inv\xE1lido o vencido",error:!e,onReshow:e?i:null,onClose:()=>s.teardown()}),s={teardown(){n?.close(),n=null,r.remove(),dt===s&&(dt=null);}};return dt=s,i(),s}function Mo(o){let e=document.createElement("div");e.setAttribute("data-veo-preview-chip","");let t=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=`
|
|
428
428
|
.chip { position: fixed; bottom: 16px; right: 16px; z-index: 2147483647;
|
|
429
429
|
display: flex; align-items: center; gap: 8px; padding: 8px 12px;
|
|
430
430
|
background: #111827; color: #f9fafb; border-radius: 9999px;
|
|
@@ -434,5 +434,5 @@ ${t}`,i=Date.now();if(this.resolveCache?.key===n&&i-this.resolveCache.at<Io)retu
|
|
|
434
434
|
button { all: unset; cursor: pointer; padding: 2px 6px; border-radius: 9999px;
|
|
435
435
|
font-size: 12px; line-height: 1; }
|
|
436
436
|
button:hover { background: rgba(255,255,255,.15); }
|
|
437
|
-
`,t.appendChild(n);let i=document.createElement("div");i.className=o.error?"chip error":"chip";let r=document.createElement("span");if(r.className="label",r.textContent=o.label,i.appendChild(r),o.onReshow){let a=document.createElement("button");a.textContent="\u21BB",a.title="Volver a mostrar la gu\xEDa",a.addEventListener("click",o.onReshow),i.appendChild(a);}let s=document.createElement("button");return s.textContent="\u2715",s.title="Salir de la vista previa",s.addEventListener("click",o.onClose),i.appendChild(s),t.appendChild(i),document.body.appendChild(e),{remove:()=>e.remove()}}function
|
|
437
|
+
`,t.appendChild(n);let i=document.createElement("div");i.className=o.error?"chip error":"chip";let r=document.createElement("span");if(r.className="label",r.textContent=o.label,i.appendChild(r),o.onReshow){let a=document.createElement("button");a.textContent="\u21BB",a.title="Volver a mostrar la gu\xEDa",a.addEventListener("click",o.onReshow),i.appendChild(a);}let s=document.createElement("button");return s.textContent="\u2715",s.title="Salir de la vista previa",s.addEventListener("click",o.onClose),i.appendChild(s),t.appendChild(i),document.body.appendChild(e),{remove:()=>e.remove()}}function Oo(o){return {name:"guides",install(e){if(!wt())return;let t=new st(e,o);window.__veoGuides={controller:t},e.on("identify",({sessionId:n})=>{t.checkGuides(window.location.href,n);}),e.on("pageview",({url:n,sessionId:i})=>{t.checkGuides(n,i);}),t.checkGuides(window.location.href,e.getSessionId());}}}exports.closeGuidePreview=wn;exports.guidesPlugin=Oo;exports.previewGuide=lt;exports.runPreviewMode=xn;return exports;})({});//# sourceMappingURL=veo-guides.js.map
|
|
438
438
|
//# sourceMappingURL=veo-guides.js.map
|