veo-sdk 0.6.3 → 0.6.4
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-PPLIAUCM.mjs → builder-5F2EFT4X.mjs} +4 -4
- package/dist/{builder-PPLIAUCM.mjs.map → builder-5F2EFT4X.mjs.map} +1 -1
- package/dist/builder.cjs +42 -11
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.mjs +4 -4
- package/dist/{chunk-3JEAPZ6A.mjs → chunk-72YH2GXC.mjs} +3 -3
- package/dist/{chunk-3JEAPZ6A.mjs.map → chunk-72YH2GXC.mjs.map} +1 -1
- package/dist/{chunk-SZCIXA5X.mjs → chunk-CMPOHTUM.mjs} +44 -13
- package/dist/chunk-CMPOHTUM.mjs.map +1 -0
- package/dist/{chunk-DU6I4ZU2.mjs → chunk-YEKCBVNJ.mjs} +3 -3
- package/dist/{chunk-DU6I4ZU2.mjs.map → chunk-YEKCBVNJ.mjs.map} +1 -1
- package/dist/index.cjs +52 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +1 -1
- package/dist/veo-builder.js +18 -18
- package/dist/veo-builder.js.map +1 -1
- package/dist/veo-guides.js +6 -6
- package/dist/veo-guides.js.map +1 -1
- package/dist/veo.js +2 -2
- package/dist/veo.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-SZCIXA5X.mjs.map +0 -1
package/dist/veo-builder.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var veoBuilder=(function(exports){'use strict';var Rn="application/x-veo-block";function Mn(o){let{host:e,stepIndex:t,onDrop:n}=o,i=e.ownerDocument,r=null,s=null,l=()=>e.shadowRoot?.querySelector(".veo-guide-content")??null,a=b=>Array.from(b.children).filter(C=>C instanceof HTMLElement&&C.dataset.veoIdx!==void 0),c=()=>{r?.remove(),r=null,s=null;},p=b=>{r||(r=i.createElement("div"),r.style.cssText="position:fixed;height:3px;border-radius:2px;background:#FF5B35;box-shadow:0 0 0 1px rgba(255,255,255,0.65);pointer-events:none;z-index:2147483647;",e.shadowRoot?.appendChild(r)),r.style.left=`${b.rect.left+4}px`,r.style.width=`${Math.max(0,b.rect.width-8)}px`,r.style.top=`${b.y-1.5}px`;},m=b=>{let C=b.dataTransfer?.types;return !!C&&Array.from(C).includes(Rn)},u=48,d=b=>{let C=l();if(!C)return null;let R=C.getBoundingClientRect(),E=a(C),P=null,I=E.length===0?R.top+R.height/2:0;for(let Y of E){let H=Y.getBoundingClientRect();if(b<H.top+H.height/2){let J=Number(Y.dataset.veoIdx);P=Number.isFinite(J)?J:null,I=H.top;break}I=H.bottom;}return {beforeIndex:P,y:I,rect:R}},f=(b,C,R)=>b>=R.left-u&&b<=R.right+u&&C>=R.top-u&&C<=R.bottom+u,g=(b,C)=>{let R=d(C);return !R||!f(b,C,R.rect)?(c(),false):(s=R,p(R),true)},v=(b,C)=>{let R=d(C);return c(),!R||!f(b,C,R.rect)?null:{beforeIndex:R.beforeIndex}},y=b=>{if(!m(b))return;let C=d(b.clientY);C&&(b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="copy"),s=C,p(C));},k=b=>{if(!m(b))return;b.preventDefault();let C=b.dataTransfer?.getData(Rn)??"",R=s??d(b.clientY);c(),!(!C||!R)&&n({stepIndex:t,blockType:C,beforeIndex:R.beforeIndex});},L=b=>{let C=b.relatedTarget;C instanceof Node&&(C===e||e.contains(C))||c();};return e.addEventListener("dragover",y),e.addEventListener("drop",k),e.addEventListener("dragleave",L),{hoverAt:g,dropAt:v,cancelHover:c,detach(){e.removeEventListener("dragover",y),e.removeEventListener("drop",k),e.removeEventListener("dragleave",L),c();}}}function ye(){return typeof window<"u"}function Ce(){return typeof document<"u"}var nt="veoBuilder",Ct="veoBuilderOrigin",Pn="veoBuilderPanel",In="veoBuilderPanelPath",$n="veoGuide";var Mr="veoPreview",Bn="veo:preview_token";function Pr(){try{return window.sessionStorage}catch{return null}}function Ir(){if(!ye())return null;let o=null;try{let t=new URLSearchParams(window.location.search).get(Mr);o=t||null;}catch{o=null;}let e=Pr();if(o){try{e?.setItem(Bn,o);}catch{}return o}try{return e?.getItem(Bn)||null}catch{return null}}function Nn(){return Ir()!==null}var Wt="veo:builder_ctx",Hn="veo:builder_ctx:",$r=1800*1e3;function Ut(){try{return window.sessionStorage}catch{return null}}function Oo(){try{return window.localStorage}catch{return null}}function Dn(o){return Hn+(o||"default")}function Br(o){try{Ut()?.setItem(Wt,JSON.stringify(o));}catch{}try{let e={...o,savedAt:Date.now()};Oo()?.setItem(Dn(o.guide),JSON.stringify(e));}catch{}}function Nr(){let o=Oo();if(!o)return null;let e=null;try{for(let i=0;i<o.length;i++){let r=o.key(i);if(!r?.startsWith(Hn))continue;let s=o.getItem(r);if(!s)continue;let l=null;try{l=JSON.parse(s);}catch{continue}if(typeof l?.savedAt!="number"||Date.now()-l.savedAt>$r){try{o.removeItem(r);}catch{}continue}(!e||l.savedAt>e.savedAt)&&(e=l);}}catch{return null}if(!e)return null;let{savedAt:t,...n}=e;return n}function Hr(){try{let o=new URLSearchParams(window.location.search);if(o.get(nt))return o;let e=window.location.hash.replace(/^#/,"");return e.includes(`${nt}=`)?new URLSearchParams(e):o}catch{return null}}function _n(){if(!ye())return null;let o=Hr(),e=o?.get(nt);if(e){let n={token:e,origin:o?.get(Ct)??null,panel:o?.get(Pn)==="1",guide:o?.get($n)??null,panelPath:o?.get(In)??null};return Br(n),n}if(Nn())return null;try{let n=Ut()?.getItem(Wt);if(n)return JSON.parse(n)}catch{}let t=Nr();if(t)try{Ut()?.setItem(Wt,JSON.stringify(t));}catch{}return t}function On(){if(!ye())return;let o=null;try{let e=Ut()?.getItem(Wt);e&&(o=JSON.parse(e).guide??null);}catch{}try{Ut()?.removeItem(Wt);}catch{}try{Oo()?.removeItem(Dn(o));}catch{}}var zn=[/^css-[a-z0-9]{4,}$/i,/^_[a-z0-9]+_[a-z0-9]{4,}_\d+$/,/^[a-z]{2,4}-[a-z0-9]{6,}$/i,/^[a-f0-9]{6,}$/i,/^sc-[a-z0-9]+$/i];function Dr(o){return zn.some(e=>e.test(o))}function St(o){return Array.from(o.classList).filter(e=>!Dr(e)&&e.length<64)}var _r=["data-testid","data-test","data-cy","name","aria-label","placeholder","alt","title","href","role","type"],Or=100;function zo(o){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(o):o.replace(/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g,"\\$&")}function Gn(o){return o.replace(/[\\"]/g,"\\$&")}function zr(o,e){for(let t of _r){let n=o.getAttribute(t);if(n&&n.length>0&&n.length<=Or)return `${e}[${t}="${Gn(n)}"]`}return null}function Gr(o){let e=o.tagName.toLowerCase(),t=o.getAttribute("data-veo-tag");if(t)return `${e}[data-veo-tag="${Gn(t)}"]`;if(o.id){let s=St(o),l=s.length>0?`.${s.map(zo).join(".")}`:"";return `${e}#${zo(o.id)}${l}`}let n=zr(o,e);if(n)return n;let i=St(o),r=i.length>0?`.${i.map(zo).join(".")}`:"";return `${e}${r}`}function pt(o,e=5){let t=[],n=o,i=0;for(;n&&n!==document.documentElement&&i<=e;)t.unshift(Gr(n)),n=n.parentElement,i++;return t.join(" > ")}function Fn(o,e=typeof window>"u"?1024:window.innerWidth){if(!o||o==="all")return true;let t=e<=767;return o==="mobile"?t:!t}function jt(o){let e=o?.trigger??"immediate";return e==="immediate"||e==="delayed"?true:e==="on_click"||e==="on_hover"?o?.autoShow===true:false}function Wn(o){if(!jt(o))return 0;let e=o?.delayMs??0;return Number.isFinite(e)&&e>0?e:0}var Un=["http:","https:"],jn="data-veo-guide";var Fr={P:"p",BR:"br",STRONG:"strong",B:"strong",EM:"em",I:"em",U:"u",S:"s",UL:"ul",OL:"ol",LI:"li",A:"a"},Wr=new Set(["SCRIPT","STYLE","TEMPLATE","IFRAME","OBJECT","EMBED","NOSCRIPT","TITLE","TEXTAREA","SELECT","SVG","MATH"]),Vn=16*1024,Ur=20,jr=1e3;function Lt(o,e){let t=e.createDocumentFragment();if(typeof o!="string"||o.length===0)return t;let n;try{n=new DOMParser().parseFromString(o.length>Vn?o.slice(0,Vn):o,"text/html");}catch{return t.appendChild(e.createTextNode(o)),t}let i={nodes:0,exceeded:false};for(let r of Array.from(n.body.childNodes)){let s=Vt(r,e,0,i);s&&t.appendChild(s);}if(i.exceeded){let r=e.createDocumentFragment();return r.appendChild(e.createTextNode(n.body.textContent??"")),r}return t}function Vt(o,e,t,n){if(n.exceeded)return null;if(++n.nodes>jr||t>Ur)return n.exceeded=true,null;if(o.nodeType===Node.TEXT_NODE)return e.createTextNode(o.textContent??"");if(o.nodeType!==Node.ELEMENT_NODE)return null;let i=o;if(Wr.has(i.tagName))return null;let r=Fr[i.tagName];if(!r){let l=e.createDocumentFragment();for(let a of Array.from(i.childNodes)){let c=Vt(a,e,t+1,n);c&&l.appendChild(c);}return l}if(r==="a"){let l=i.getAttribute("href")??"";if(!fe(l)){let c=e.createDocumentFragment();for(let p of Array.from(i.childNodes)){let m=Vt(p,e,t+1,n);m&&c.appendChild(m);}return c}let a=e.createElement("a");a.setAttribute("href",l),a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer nofollow");for(let c of Array.from(i.childNodes)){let p=Vt(c,e,t+1,n);p&&a.appendChild(p);}return a}let s=e.createElement(r);for(let l of Array.from(i.childNodes)){let a=Vt(l,e,t+1,n);a&&s.appendChild(a);}return s}function Vr(o,e){let t;try{t=new URL(e);}catch{return null}if(t.protocol!=="https:"&&t.protocol!=="http:")return null;let n=t.hostname.replace(/^www\./,"").replace(/^m\./,""),i=(r,s)=>s.match(r)?.[1]??null;switch(o){case "youtube":{let r=null;return n==="youtube.com"||n==="youtube-nocookie.com"?r=t.searchParams.get("v")??i(/^\/(?:embed|shorts|live)\/([A-Za-z0-9_-]{6,})/,t.pathname):n==="youtu.be"&&(r=i(/^\/([A-Za-z0-9_-]{6,})/,t.pathname)),!r||!/^[A-Za-z0-9_-]{6,}$/.test(r)?null:`https://www.youtube-nocookie.com/embed/${r}`}case "vimeo":{if(n!=="vimeo.com"&&n!=="player.vimeo.com")return null;let r=i(/(\d{6,})/,t.pathname);return r?`https://player.vimeo.com/video/${r}`:null}case "loom":{if(n!=="loom.com")return null;let r=i(/^\/(?:share|embed)\/([A-Za-z0-9]{16,})/,t.pathname);return r?`https://www.loom.com/embed/${r}`:null}case "wistia":{if(!Tt(n,"wistia.com")&&!Tt(n,"wistia.net"))return null;let r=i(/\/(?:medias|embed\/iframe)\/([A-Za-z0-9]{6,})/,t.pathname);return r?`https://fast.wistia.net/embed/iframe/${r}`:null}case "msstream":{if(!Tt(n,"microsoftstream.com"))return null;let r=i(/\/(?:embed\/)?video\/([0-9a-f-]{36})/i,t.pathname);return r?`https://web.microsoftstream.com/embed/video/${r}?autoplay=false&showinfo=true`:null}case "vidyard":{if(!Tt(n,"vidyard.com"))return null;let r=i(/\/watch\/([A-Za-z0-9_-]{8,})/,t.pathname)??(n==="play.vidyard.com"?i(/^\/([A-Za-z0-9_-]{8,})/,t.pathname):null);return r?`https://play.vidyard.com/${r}`:null}case "sharepoint":return t.protocol==="https:"&&Tt(n,"sharepoint.com")?t.href:null;case "brightcove":return t.protocol==="https:"&&n==="players.brightcove.net"&&t.searchParams.get("videoId")?t.href:null;case "kaltura":return t.protocol==="https:"&&Tt(n,"kaltura.com")&&t.pathname.startsWith("/p/")?t.href:null;default:return null}}function Tt(o,e){return o===e||o.endsWith(`.${e}`)}function qr(o){try{let e=new URL(o);return e.protocol!=="https:"&&e.protocol!=="http:"?null:/\.(mp4|webm|mov)$/i.test(e.pathname)?e.href:null}catch{return null}}function qn(o,e,t={}){let n=o.provider==="file",i=typeof o.url=="string"?n?qr(o.url):Vr(o.provider,o.url):null;if(!i)return null;let r=o.style??{},s=e.createElement("div");s.className="veo-guide-video";let l=r.aspect==="4:3"?"4 / 3":"16 / 9";if(s.style.aspectRatio=l,r.widthMode==="fill")s.style.width="100%";else {let p=typeof r.width=="number"&&Number.isFinite(r.width)?r.width:400;s.style.width=`${Math.max(120,Math.min(1600,p))}px`,s.style.maxWidth="100%";}let a=r.align==="center"?"center":r.align==="right"?"flex-end":"flex-start";if(s.style.alignSelf=a,n){let p=e.createElement("video");return p.src=i,p.controls=true,p.setAttribute("playsinline",""),p.preload="metadata",p.setAttribute("aria-label",typeof o.alt=="string"&&o.alt.trim()?o.alt.trim():"Video"),t.editing&&(p.style.pointerEvents="none"),s.appendChild(p),s}let c=e.createElement("iframe");return c.src=i,c.title=typeof o.alt=="string"&&o.alt.trim()?o.alt.trim():"Video",c.setAttribute("loading","lazy"),c.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),c.setAttribute("allow",`accelerometer; autoplay; clipboard-write; encrypted-media; picture-in-picture${t.editing?"":"; fullscreen"}`),t.editing||c.setAttribute("allowfullscreen",""),t.editing&&(c.style.pointerEvents="none"),s.appendChild(c),s}function he(o,e,t){let n=e.createElement("div");n.className="veo-guide-content";let i=Yn(o);return i?Xr(n,i,e,t):Kr(n,o,e,t),n.appendChild(ut(e,()=>t.onDismiss())),n}function Xn(o,e){let t=Yn(o);if(t){let i=[];for(let{block:r,idx:s}of t){if(r.type==="button")continue;let l=At(r,e);l&&(l.dataset.veoIdx=String(s),i.push(l));}return i}let n=[];if(typeof o.imageUrl=="string"&&o.imageUrl&&fe(o.imageUrl)){let i=e.createElement("img");i.className="veo-guide-image",i.src=o.imageUrl,i.alt=typeof o.title=="string"?o.title:"",n.push(i);}if(typeof o.title=="string"&&o.title){let i=e.createElement("h2");i.className="veo-guide-title",i.textContent=o.title,n.push(i);}if(typeof o.content=="string"&&o.content){let i=e.createElement("p");i.className="veo-guide-text",i.textContent=o.content,n.push(i);}return n}function Kr(o,e,t,n){if(typeof e.imageUrl=="string"&&e.imageUrl&&fe(e.imageUrl)){let r=t.createElement("img");r.className="veo-guide-image",r.src=e.imageUrl,r.alt=typeof e.title=="string"?e.title:"",o.appendChild(r);}if(typeof e.title=="string"&&e.title){let r=t.createElement("h2");r.className="veo-guide-title",r.textContent=e.title,o.appendChild(r);}if(typeof e.content=="string"&&e.content){let r=t.createElement("p");r.className="veo-guide-text",r.textContent=e.content,o.appendChild(r);}let i=t.createElement("div");if(i.className="veo-guide-actions",typeof e.ctaText=="string"&&e.ctaText){let r=t.createElement("button");r.type="button",r.className="veo-guide-cta",r.textContent=e.ctaText,r.addEventListener("click",()=>{let s=e.ctaAction??"dismiss",l=Qr(e);n.onCtaClick(s,l);}),i.appendChild(r);}o.appendChild(i);}function Yn(o){if(!Array.isArray(o.blocks)||o.blocks.length===0)return null;let e=o.blocks.map((t,n)=>({block:t,idx:n})).filter(t=>{let n=t.block;return !n||typeof n!="object"?false:n.type==="image"?typeof n.url=="string"&&fe(n.url):n.type==="title"||n.type==="text"||n.type==="button"});return e.length>0?e:null}function Xr(o,e,t,n){let i=0;for(;i<e.length;){let r=e[i];if(r?.block.type==="button"){let l=t.createElement("div");l.className="veo-guide-actions",l.dataset.veoIdx=String(r.idx);let a;for(;i<e.length&&e[i]?.block.type==="button";){let c=e[i].block;if(!a){let p=c.style?.align;(p==="left"||p==="center"||p==="right")&&(a=p);}l.appendChild(Jr(c,t,n)),i++;}a&&(l.style.justifyContent=Go[a]),o.appendChild(l);continue}let s=r?At(r.block,t):null;s&&r&&(s.dataset.veoIdx=String(r.idx),o.appendChild(s)),i++;}}function At(o,e,t={}){switch(o.type){case "video":return qn(o,e,t);case "divider":return Zr(o,e);case "title":{let n=e.createElement("h2");return n.className="veo-guide-title",n.textContent=typeof o.text=="string"?o.text:"",Me(n,o.style,"text"),n}case "text":{let n=e.createElement("div");return n.className="veo-guide-text",typeof o.html=="string"&&o.html?n.appendChild(Lt(o.html,e)):n.textContent=typeof o.text=="string"?o.text:"",Me(n,o.style,"text"),n}case "image":{if(typeof o.url!="string"||!fe(o.url))return null;let n=e.createElement("img");return n.className="veo-guide-image",n.src=o.url,n.alt=typeof o.alt=="string"?o.alt:"",Me(n,o.style,"image"),n}default:return null}}var Yr=new Set(["solid","dotted","dashed"]);function Zr(o,e){let t=o.style??{},n=e.createElement("div");n.className="veo-guide-divider",n.setAttribute("role","separator");let i=e.createElement("hr"),r=t.preset==="custom",s=r&&typeof t.color=="string"&&t.color?t.color:t.colorMode==="dark"?"rgba(255, 255, 255, 0.35)":"#e5e7eb",l=r&&typeof t.thickness=="number"&&Number.isFinite(t.thickness)?me(Math.round(t.thickness),1,12):1,a=typeof t.lineStyle=="string"&&Yr.has(t.lineStyle)?t.lineStyle:"solid";i.style.borderTop=`${l}px ${a} ${s}`,n.appendChild(i);for(let[c,p]of [["marginTop","marginTop"],["marginRight","marginRight"],["marginBottom","marginBottom"],["marginLeft","marginLeft"]]){let m=t[c];typeof m=="number"&&Number.isFinite(m)&&(n.style[p]=`${me(m,0,64)}px`);}return n}function Jr(o,e,t){let n=e.createElement("button");return n.type="button",n.className="veo-guide-cta",n.textContent=typeof o.text=="string"&&o.text?o.text:"OK",Me(n,o.style,"button"),n.addEventListener("click",()=>{let i=o.action??"dismiss",r=i==="next"||i==="url"||i==="guide"?i:"dismiss",s=r==="url"&&typeof o.url=="string"&&fe(o.url)?o.url:r==="guide"&&typeof o.targetGuideId=="string"&&o.targetGuideId?o.targetGuideId:void 0,l={...typeof o.id=="string"&&o.id?{buttonId:o.id}:{},...typeof o.text=="string"&&o.text?{buttonText:o.text}:{}};t.onCtaClick(r,s,Object.keys(l).length?l:void 0);}),n}var Go={left:"flex-start",center:"center",right:"flex-end"};function me(o,e,t){return Math.min(t,Math.max(e,o))}var Kn={title:{size:18,weight:600,lineHeight:1.3},subtitle:{size:16,weight:600,lineHeight:1.35},paragraph:{size:14,weight:400,lineHeight:1.5},small:{size:12,weight:400,lineHeight:1.5}};function Me(o,e,t){if(t==="text"){let r=e&&typeof e=="object"?e.preset:void 0;o.dataset.veoPreset=typeof r=="string"?r:o.classList.contains("veo-guide-title")?"title":"paragraph";}if(!e||typeof e!="object")return;let n=e;if(t==="image"&&n.bleed===true){o.classList.add("veo-guide-image--bleed");return}let i=typeof n.align=="string"?n.align:null;if(i&&(i==="left"||i==="center"||i==="right")&&(t==="text"?(o.style.textAlign=i,o.style.alignSelf=Go[i]):t==="image"&&(o.style.alignSelf=Go[i])),t==="text"&&typeof n.preset=="string"&&n.preset in Kn){let r=Kn[n.preset];if(r){let s=n.preset==="small"?null:`--veo-t-${n.preset}`;o.style.fontSize=s?`var(${s}-size, ${r.size}px)`:`${r.size}px`,o.style.fontWeight=s?`var(${s}-weight, ${r.weight})`:String(r.weight),o.style.lineHeight=String(r.lineHeight);}}if(t!=="image"&&n.colorMode==="dark"&&(o.style.background="#1f1d1b",o.style.color="#f5f0eb",o.style.borderRadius=o.style.borderRadius||"8px"),t!=="image"&&typeof n.color=="string"&&(o.style.color=n.color),t==="text"&&typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&(o.style.fontSize=`${me(n.fontSize,8,72)}px`),t==="image"&&n.naturalSize===true?(o.style.width="auto",o.style.maxWidth="100%",o.style.maxHeight="none",o.style.objectFit="contain"):t==="image"&&typeof n.width=="number"&&Number.isFinite(n.width)&&(o.style.width=`${me(n.width,10,100)}%`),t==="image"&&typeof n.radius=="number"&&Number.isFinite(n.radius)&&(o.style.borderRadius=`${me(n.radius,0,48)}px`),typeof n.marginTop=="number"&&Number.isFinite(n.marginTop)&&(o.style.marginTop=`${me(n.marginTop,0,64)}px`),typeof n.marginBottom=="number"&&Number.isFinite(n.marginBottom)&&(o.style.marginBottom=`${me(n.marginBottom,0,64)}px`),t!=="image"&&(typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&(o.style.fontSize=`${me(n.fontSize,8,96)}px`),typeof n.fontFamily=="string"&&n.fontFamily&&n.fontFamily!=="inherit"&&(o.style.fontFamily=n.fontFamily),typeof n.fontWeight=="string"&&n.fontWeight&&(o.style.fontWeight=n.fontWeight),typeof n.textTransform=="string"&&n.textTransform&&n.textTransform!=="none"&&(o.style.textTransform=n.textTransform),typeof n.lineHeight=="number"&&Number.isFinite(n.lineHeight)&&(o.style.lineHeight=`${me(n.lineHeight,50,300)}%`),typeof n.letterSpacing=="number"&&Number.isFinite(n.letterSpacing)&&(o.style.letterSpacing=`${me(n.letterSpacing,-5,20)}px`)),typeof n.background=="string"&&n.background&&(o.style.background=n.background),typeof n.borderWidth=="number"&&n.borderWidth>0){let r=typeof n.borderColor=="string"&&n.borderColor?n.borderColor:"#bbbbbb";o.style.border=`${me(n.borderWidth,0,20)}px solid ${r}`;}t!=="image"&&typeof n.radius=="number"&&Number.isFinite(n.radius)&&(o.style.borderRadius=`${me(n.radius,0,64)}px`),typeof n.height=="number"&&Number.isFinite(n.height)&&n.height>0&&(o.style.height=`${me(n.height,1,2e3)}px`),t!=="image"&&typeof n.width=="number"&&Number.isFinite(n.width)&&n.width>0&&(o.style.width=`${me(n.width,1,2e3)}px`);for(let r of ["Top","Right","Bottom","Left"]){let s=n[`padding${r}`];typeof s=="number"&&Number.isFinite(s)&&o.style.setProperty(`padding-${r.toLowerCase()}`,`${me(s,0,128)}px`);let l=n[`margin${r}`];typeof l=="number"&&Number.isFinite(l)&&o.style.setProperty(`margin-${r.toLowerCase()}`,`${me(l,0,128)}px`);}}function ut(o,e,t="veo-guide-close"){let n=o.createElement("button");return n.type="button",n.className=t,n.setAttribute("aria-label","Cerrar"),n.textContent="\xD7",n.addEventListener("click",e),n}function fe(o){if(typeof o!="string"||o.length===0)return false;try{let e=typeof window<"u"?window.location.href:"http://localhost/",t=new URL(o,e);return Un.includes(t.protocol)}catch{return false}}function Qr(o){let e=o.style?.ctaUrl;if(typeof e=="string")return fe(e)?e:void 0}function Zn(){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 Rt(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=Wo(n.fixedHeight));let s=Zn(),l=e.style?.tailwind===true;i.srcdoc=is(e.html??"",e.css??"",e.js??"",s,{hostCss:ts(),htmlAttrs:os(),tailwind:l});let a=()=>t.onClose(),c=p=>{if(p.source!==i.contentWindow)return;let m=p.data;if(!(!m||typeof m!="object"||m.__veo!==s))switch(m.type){case "dismiss":t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"dismissed"}),a();break;case "cta":t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"cta_clicked"}),typeof m.url=="string"&&fe(m.url)&&window.open(m.url,"_blank","noopener,noreferrer"),m.close!==false&&a();break;case "navigate":typeof m.url=="string"&&fe(m.url)&&window.location.assign(m.url);break;case "track":typeof m.name=="string"&&t.onTrack&&t.onTrack(m.name,ns(m.props)?m.props:void 0);break;case "resize":!r&&typeof m.height=="number"&&m.height>0&&(i.style.height=`${Math.ceil(m.height)}px`);break}};return window.addEventListener("message",c),{iframe:i,cleanup:()=>window.removeEventListener("message",c)}}function Wo(o){return typeof o=="number"?`${o}px`:o}var es=800*1024;function ts(){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}
|
|
2
|
-
`,o.length>
|
|
1
|
+
var veoBuilder=(function(exports){'use strict';var Mn="application/x-veo-block";function Pn(o){let{host:e,stepIndex:t,onDrop:n}=o,i=e.ownerDocument,r=null,s=null,l=()=>e.shadowRoot?.querySelector(".veo-guide-content")??null,a=b=>Array.from(b.children).filter(C=>C instanceof HTMLElement&&C.dataset.veoIdx!==void 0),c=()=>{r?.remove(),r=null,s=null;},p=b=>{r||(r=i.createElement("div"),r.style.cssText="position:fixed;height:3px;border-radius:2px;background:#FF5B35;box-shadow:0 0 0 1px rgba(255,255,255,0.65);pointer-events:none;z-index:2147483647;",e.shadowRoot?.appendChild(r)),r.style.left=`${b.rect.left+4}px`,r.style.width=`${Math.max(0,b.rect.width-8)}px`,r.style.top=`${b.y-1.5}px`;},m=b=>{let C=b.dataTransfer?.types;return !!C&&Array.from(C).includes(Mn)},u=48,d=b=>{let C=l();if(!C)return null;let R=C.getBoundingClientRect(),k=a(C),P=null,I=k.length===0?R.top+R.height/2:0;for(let F of k){let B=F.getBoundingClientRect();if(b<B.top+B.height/2){let J=Number(F.dataset.veoIdx);P=Number.isFinite(J)?J:null,I=B.top;break}I=B.bottom;}return {beforeIndex:P,y:I,rect:R}},f=(b,C,R)=>b>=R.left-u&&b<=R.right+u&&C>=R.top-u&&C<=R.bottom+u,h=(b,C)=>{let R=d(C);return !R||!f(b,C,R.rect)?(c(),false):(s=R,p(R),true)},v=(b,C)=>{let R=d(C);return c(),!R||!f(b,C,R.rect)?null:{beforeIndex:R.beforeIndex}},y=b=>{if(!m(b))return;let C=d(b.clientY);C&&(b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="copy"),s=C,p(C));},E=b=>{if(!m(b))return;b.preventDefault();let C=b.dataTransfer?.getData(Mn)??"",R=s??d(b.clientY);c(),!(!C||!R)&&n({stepIndex:t,blockType:C,beforeIndex:R.beforeIndex});},T=b=>{let C=b.relatedTarget;C instanceof Node&&(C===e||e.contains(C))||c();};return e.addEventListener("dragover",y),e.addEventListener("drop",E),e.addEventListener("dragleave",T),{hoverAt:h,dropAt:v,cancelHover:c,detach(){e.removeEventListener("dragover",y),e.removeEventListener("drop",E),e.removeEventListener("dragleave",T),c();}}}function ye(){return typeof window<"u"}function Ce(){return typeof document<"u"}var nt="veoBuilder",St="veoBuilderOrigin",In="veoBuilderPanel",$n="veoBuilderPanelPath",Nn="veoGuide";var Ir="veoPreview",Bn="veo:preview_token";function $r(){try{return window.sessionStorage}catch{return null}}function Nr(){if(!ye())return null;let o=null;try{let t=new URLSearchParams(window.location.search).get(Ir);o=t||null;}catch{o=null;}let e=$r();if(o){try{e?.setItem(Bn,o);}catch{}return o}try{return e?.getItem(Bn)||null}catch{return null}}function Hn(){return Nr()!==null}var Ut="veo:builder_ctx",Dn="veo:builder_ctx:",Br=1800*1e3;function jt(){try{return window.sessionStorage}catch{return null}}function zo(){try{return window.localStorage}catch{return null}}function _n(o){return Dn+(o||"default")}function Hr(o){try{jt()?.setItem(Ut,JSON.stringify(o));}catch{}try{let e={...o,savedAt:Date.now()};zo()?.setItem(_n(o.guide),JSON.stringify(e));}catch{}}function Dr(){let o=zo();if(!o)return null;let e=null;try{for(let i=0;i<o.length;i++){let r=o.key(i);if(!r?.startsWith(Dn))continue;let s=o.getItem(r);if(!s)continue;let l=null;try{l=JSON.parse(s);}catch{continue}if(typeof l?.savedAt!="number"||Date.now()-l.savedAt>Br){try{o.removeItem(r);}catch{}continue}(!e||l.savedAt>e.savedAt)&&(e=l);}}catch{return null}if(!e)return null;let{savedAt:t,...n}=e;return n}function _r(){try{let o=new URLSearchParams(window.location.search);if(o.get(nt))return o;let e=window.location.hash.replace(/^#/,"");return e.includes(`${nt}=`)?new URLSearchParams(e):o}catch{return null}}function On(){if(!ye())return null;let o=_r(),e=o?.get(nt);if(e){let n={token:e,origin:o?.get(St)??null,panel:o?.get(In)==="1",guide:o?.get(Nn)??null,panelPath:o?.get($n)??null};return Hr(n),n}if(Hn())return null;try{let n=jt()?.getItem(Ut);if(n)return JSON.parse(n)}catch{}let t=Dr();if(t)try{jt()?.setItem(Ut,JSON.stringify(t));}catch{}return t}function zn(){if(!ye())return;let o=null;try{let e=jt()?.getItem(Ut);e&&(o=JSON.parse(e).guide??null);}catch{}try{jt()?.removeItem(Ut);}catch{}try{zo()?.removeItem(_n(o));}catch{}}var Gn=[/^css-[a-z0-9]{4,}$/i,/^_[a-z0-9]+_[a-z0-9]{4,}_\d+$/,/^[a-z]{2,4}-[a-z0-9]{6,}$/i,/^[a-f0-9]{6,}$/i,/^sc-[a-z0-9]+$/i];function Or(o){return Gn.some(e=>e.test(o))}function Lt(o){return Array.from(o.classList).filter(e=>!Or(e)&&e.length<64)}var zr=["data-testid","data-test","data-cy","name","aria-label","placeholder","alt","title","href","role","type"],Gr=100;function Go(o){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(o):o.replace(/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g,"\\$&")}function Fn(o){return o.replace(/[\\"]/g,"\\$&")}function Fr(o,e){for(let t of zr){let n=o.getAttribute(t);if(n&&n.length>0&&n.length<=Gr)return `${e}[${t}="${Fn(n)}"]`}return null}function Wr(o){let e=o.tagName.toLowerCase(),t=o.getAttribute("data-veo-tag");if(t)return `${e}[data-veo-tag="${Fn(t)}"]`;if(o.id){let s=Lt(o),l=s.length>0?`.${s.map(Go).join(".")}`:"";return `${e}#${Go(o.id)}${l}`}let n=Fr(o,e);if(n)return n;let i=Lt(o),r=i.length>0?`.${i.map(Go).join(".")}`:"";return `${e}${r}`}function dt(o,e=5){let t=[],n=o,i=0;for(;n&&n!==document.documentElement&&i<=e;)t.unshift(Wr(n)),n=n.parentElement,i++;return t.join(" > ")}function Wn(o,e=typeof window>"u"?1024:window.innerWidth){if(!o||o==="all")return true;let t=e<=767;return o==="mobile"?t:!t}function Vt(o){let e=o?.trigger??"immediate";return e==="immediate"||e==="delayed"?true:e==="on_click"||e==="on_hover"?o?.autoShow===true:false}function Un(o){if(!Vt(o))return 0;let e=o?.delayMs??0;return Number.isFinite(e)&&e>0?e:0}var jn=["http:","https:"],Vn="data-veo-guide",qn="data-veo-badge";var Ur={P:"p",BR:"br",STRONG:"strong",B:"strong",EM:"em",I:"em",U:"u",S:"s",UL:"ul",OL:"ol",LI:"li",A:"a"},jr=new Set(["SCRIPT","STYLE","TEMPLATE","IFRAME","OBJECT","EMBED","NOSCRIPT","TITLE","TEXTAREA","SELECT","SVG","MATH"]),Kn=16*1024,Vr=20,qr=1e3;function Tt(o,e){let t=e.createDocumentFragment();if(typeof o!="string"||o.length===0)return t;let n;try{n=new DOMParser().parseFromString(o.length>Kn?o.slice(0,Kn):o,"text/html");}catch{return t.appendChild(e.createTextNode(o)),t}let i={nodes:0,exceeded:false};for(let r of Array.from(n.body.childNodes)){let s=qt(r,e,0,i);s&&t.appendChild(s);}if(i.exceeded){let r=e.createDocumentFragment();return r.appendChild(e.createTextNode(n.body.textContent??"")),r}return t}function qt(o,e,t,n){if(n.exceeded)return null;if(++n.nodes>qr||t>Vr)return n.exceeded=true,null;if(o.nodeType===Node.TEXT_NODE)return e.createTextNode(o.textContent??"");if(o.nodeType!==Node.ELEMENT_NODE)return null;let i=o;if(jr.has(i.tagName))return null;let r=Ur[i.tagName];if(!r){let l=e.createDocumentFragment();for(let a of Array.from(i.childNodes)){let c=qt(a,e,t+1,n);c&&l.appendChild(c);}return l}if(r==="a"){let l=i.getAttribute("href")??"";if(!fe(l)){let c=e.createDocumentFragment();for(let p of Array.from(i.childNodes)){let m=qt(p,e,t+1,n);m&&c.appendChild(m);}return c}let a=e.createElement("a");a.setAttribute("href",l),a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer nofollow");for(let c of Array.from(i.childNodes)){let p=qt(c,e,t+1,n);p&&a.appendChild(p);}return a}let s=e.createElement(r);for(let l of Array.from(i.childNodes)){let a=qt(l,e,t+1,n);a&&s.appendChild(a);}return s}function Kr(o,e){let t;try{t=new URL(e);}catch{return null}if(t.protocol!=="https:"&&t.protocol!=="http:")return null;let n=t.hostname.replace(/^www\./,"").replace(/^m\./,""),i=(r,s)=>s.match(r)?.[1]??null;switch(o){case "youtube":{let r=null;return n==="youtube.com"||n==="youtube-nocookie.com"?r=t.searchParams.get("v")??i(/^\/(?:embed|shorts|live)\/([A-Za-z0-9_-]{6,})/,t.pathname):n==="youtu.be"&&(r=i(/^\/([A-Za-z0-9_-]{6,})/,t.pathname)),!r||!/^[A-Za-z0-9_-]{6,}$/.test(r)?null:`https://www.youtube-nocookie.com/embed/${r}`}case "vimeo":{if(n!=="vimeo.com"&&n!=="player.vimeo.com")return null;let r=i(/(\d{6,})/,t.pathname);return r?`https://player.vimeo.com/video/${r}`:null}case "loom":{if(n!=="loom.com")return null;let r=i(/^\/(?:share|embed)\/([A-Za-z0-9]{16,})/,t.pathname);return r?`https://www.loom.com/embed/${r}`:null}case "wistia":{if(!At(n,"wistia.com")&&!At(n,"wistia.net"))return null;let r=i(/\/(?:medias|embed\/iframe)\/([A-Za-z0-9]{6,})/,t.pathname);return r?`https://fast.wistia.net/embed/iframe/${r}`:null}case "msstream":{if(!At(n,"microsoftstream.com"))return null;let r=i(/\/(?:embed\/)?video\/([0-9a-f-]{36})/i,t.pathname);return r?`https://web.microsoftstream.com/embed/video/${r}?autoplay=false&showinfo=true`:null}case "vidyard":{if(!At(n,"vidyard.com"))return null;let r=i(/\/watch\/([A-Za-z0-9_-]{8,})/,t.pathname)??(n==="play.vidyard.com"?i(/^\/([A-Za-z0-9_-]{8,})/,t.pathname):null);return r?`https://play.vidyard.com/${r}`:null}case "sharepoint":return t.protocol==="https:"&&At(n,"sharepoint.com")?t.href:null;case "brightcove":return t.protocol==="https:"&&n==="players.brightcove.net"&&t.searchParams.get("videoId")?t.href:null;case "kaltura":return t.protocol==="https:"&&At(n,"kaltura.com")&&t.pathname.startsWith("/p/")?t.href:null;default:return null}}function At(o,e){return o===e||o.endsWith(`.${e}`)}function Xr(o){try{let e=new URL(o);return e.protocol!=="https:"&&e.protocol!=="http:"?null:/\.(mp4|webm|mov)$/i.test(e.pathname)?e.href:null}catch{return null}}function Xn(o,e,t={}){let n=o.provider==="file",i=typeof o.url=="string"?n?Xr(o.url):Kr(o.provider,o.url):null;if(!i)return null;let r=o.style??{},s=e.createElement("div");s.className="veo-guide-video";let l=r.aspect==="4:3"?"4 / 3":"16 / 9";if(s.style.aspectRatio=l,r.widthMode==="fill")s.style.width="100%";else {let p=typeof r.width=="number"&&Number.isFinite(r.width)?r.width:400;s.style.width=`${Math.max(120,Math.min(1600,p))}px`,s.style.maxWidth="100%";}let a=r.align==="center"?"center":r.align==="right"?"flex-end":"flex-start";if(s.style.alignSelf=a,n){let p=e.createElement("video");return p.src=i,p.controls=true,p.setAttribute("playsinline",""),p.preload="metadata",p.setAttribute("aria-label",typeof o.alt=="string"&&o.alt.trim()?o.alt.trim():"Video"),t.editing&&(p.style.pointerEvents="none"),s.appendChild(p),s}let c=e.createElement("iframe");return c.src=i,c.title=typeof o.alt=="string"&&o.alt.trim()?o.alt.trim():"Video",c.setAttribute("loading","lazy"),c.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),c.setAttribute("allow",`accelerometer; autoplay; clipboard-write; encrypted-media; picture-in-picture${t.editing?"":"; fullscreen"}`),t.editing||c.setAttribute("allowfullscreen",""),t.editing&&(c.style.pointerEvents="none"),s.appendChild(c),s}function ge(o,e,t){let n=e.createElement("div");n.className="veo-guide-content";let i=Jn(o);return i?Zr(n,i,e,t):Yr(n,o,e,t),n.appendChild(pt(e,()=>t.onDismiss())),n}function Zn(o,e){let t=Jn(o);if(t){let i=[];for(let{block:r,idx:s}of t){if(r.type==="button")continue;let l=Rt(r,e);l&&(l.dataset.veoIdx=String(s),i.push(l));}return i}let n=[];if(typeof o.imageUrl=="string"&&o.imageUrl&&fe(o.imageUrl)){let i=e.createElement("img");i.className="veo-guide-image",i.src=o.imageUrl,i.alt=typeof o.title=="string"?o.title:"",n.push(i);}if(typeof o.title=="string"&&o.title){let i=e.createElement("h2");i.className="veo-guide-title",i.textContent=o.title,n.push(i);}if(typeof o.content=="string"&&o.content){let i=e.createElement("p");i.className="veo-guide-text",i.textContent=o.content,n.push(i);}return n}function Yr(o,e,t,n){if(typeof e.imageUrl=="string"&&e.imageUrl&&fe(e.imageUrl)){let r=t.createElement("img");r.className="veo-guide-image",r.src=e.imageUrl,r.alt=typeof e.title=="string"?e.title:"",o.appendChild(r);}if(typeof e.title=="string"&&e.title){let r=t.createElement("h2");r.className="veo-guide-title",r.textContent=e.title,o.appendChild(r);}if(typeof e.content=="string"&&e.content){let r=t.createElement("p");r.className="veo-guide-text",r.textContent=e.content,o.appendChild(r);}let i=t.createElement("div");if(i.className="veo-guide-actions",typeof e.ctaText=="string"&&e.ctaText){let r=t.createElement("button");r.type="button",r.className="veo-guide-cta",r.textContent=e.ctaText,r.addEventListener("click",()=>{let s=e.ctaAction??"dismiss",l=ts(e);n.onCtaClick(s,l);}),i.appendChild(r);}o.appendChild(i);}function Jn(o){if(!Array.isArray(o.blocks)||o.blocks.length===0)return null;let e=o.blocks.map((t,n)=>({block:t,idx:n})).filter(t=>{let n=t.block;return !n||typeof n!="object"?false:n.type==="image"?typeof n.url=="string"&&fe(n.url):n.type==="title"||n.type==="text"||n.type==="button"});return e.length>0?e:null}function Zr(o,e,t,n){let i=0;for(;i<e.length;){let r=e[i];if(r?.block.type==="button"){let l=t.createElement("div");l.className="veo-guide-actions",l.dataset.veoIdx=String(r.idx);let a;for(;i<e.length&&e[i]?.block.type==="button";){let c=e[i].block;if(!a){let p=c.style?.align;(p==="left"||p==="center"||p==="right")&&(a=p);}l.appendChild(es(c,t,n)),i++;}a&&(l.style.justifyContent=Fo[a]),o.appendChild(l);continue}let s=r?Rt(r.block,t):null;s&&r&&(s.dataset.veoIdx=String(r.idx),o.appendChild(s)),i++;}}function Rt(o,e,t={}){switch(o.type){case "video":return Xn(o,e,t);case "divider":return Qr(o,e);case "title":{let n=e.createElement("h2");return n.className="veo-guide-title",n.textContent=typeof o.text=="string"?o.text:"",Me(n,o.style,"text"),n}case "text":{let n=e.createElement("div");return n.className="veo-guide-text",typeof o.html=="string"&&o.html?n.appendChild(Tt(o.html,e)):n.textContent=typeof o.text=="string"?o.text:"",Me(n,o.style,"text"),n}case "image":{if(typeof o.url!="string"||!fe(o.url))return null;let n=e.createElement("img");return n.className="veo-guide-image",n.src=o.url,n.alt=typeof o.alt=="string"?o.alt:"",Me(n,o.style,"image"),n}default:return null}}var Jr=new Set(["solid","dotted","dashed"]);function Qr(o,e){let t=o.style??{},n=e.createElement("div");n.className="veo-guide-divider",n.setAttribute("role","separator");let i=e.createElement("hr"),r=t.preset==="custom",s=r&&typeof t.color=="string"&&t.color?t.color:t.colorMode==="dark"?"rgba(255, 255, 255, 0.35)":"#e5e7eb",l=r&&typeof t.thickness=="number"&&Number.isFinite(t.thickness)?me(Math.round(t.thickness),1,12):1,a=typeof t.lineStyle=="string"&&Jr.has(t.lineStyle)?t.lineStyle:"solid";i.style.borderTop=`${l}px ${a} ${s}`,n.appendChild(i);for(let[c,p]of [["marginTop","marginTop"],["marginRight","marginRight"],["marginBottom","marginBottom"],["marginLeft","marginLeft"]]){let m=t[c];typeof m=="number"&&Number.isFinite(m)&&(n.style[p]=`${me(m,0,64)}px`);}return n}function es(o,e,t){let n=e.createElement("button");return n.type="button",n.className="veo-guide-cta",n.textContent=typeof o.text=="string"&&o.text?o.text:"OK",Me(n,o.style,"button"),n.addEventListener("click",()=>{let i=o.action??"dismiss",r=i==="next"||i==="url"||i==="guide"?i:"dismiss",s=r==="url"&&typeof o.url=="string"&&fe(o.url)?o.url:r==="guide"&&typeof o.targetGuideId=="string"&&o.targetGuideId?o.targetGuideId:void 0,l={...typeof o.id=="string"&&o.id?{buttonId:o.id}:{},...typeof o.text=="string"&&o.text?{buttonText:o.text}:{}};t.onCtaClick(r,s,Object.keys(l).length?l:void 0);}),n}var Fo={left:"flex-start",center:"center",right:"flex-end"};function me(o,e,t){return Math.min(t,Math.max(e,o))}var Yn={title:{size:18,weight:600,lineHeight:1.3},subtitle:{size:16,weight:600,lineHeight:1.35},paragraph:{size:14,weight:400,lineHeight:1.5},small:{size:12,weight:400,lineHeight:1.5}};function Me(o,e,t){if(t==="text"){let r=e&&typeof e=="object"?e.preset:void 0;o.dataset.veoPreset=typeof r=="string"?r:o.classList.contains("veo-guide-title")?"title":"paragraph";}if(!e||typeof e!="object")return;let n=e;if(t==="image"&&n.bleed===true){o.classList.add("veo-guide-image--bleed");return}let i=typeof n.align=="string"?n.align:null;if(i&&(i==="left"||i==="center"||i==="right")&&(t==="text"?(o.style.textAlign=i,o.style.alignSelf=Fo[i]):t==="image"&&(o.style.alignSelf=Fo[i])),t==="text"&&typeof n.preset=="string"&&n.preset in Yn){let r=Yn[n.preset];if(r){let s=n.preset==="small"?null:`--veo-t-${n.preset}`;o.style.fontSize=s?`var(${s}-size, ${r.size}px)`:`${r.size}px`,o.style.fontWeight=s?`var(${s}-weight, ${r.weight})`:String(r.weight),o.style.lineHeight=String(r.lineHeight);}}if(t!=="image"&&n.colorMode==="dark"&&(o.style.background="#1f1d1b",o.style.color="#f5f0eb",o.style.borderRadius=o.style.borderRadius||"8px"),t!=="image"&&typeof n.color=="string"&&(o.style.color=n.color),t==="text"&&typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&(o.style.fontSize=`${me(n.fontSize,8,72)}px`),t==="image"&&n.naturalSize===true?(o.style.width="auto",o.style.maxWidth="100%",o.style.maxHeight="none",o.style.objectFit="contain"):t==="image"&&typeof n.width=="number"&&Number.isFinite(n.width)&&(o.style.width=`${me(n.width,10,100)}%`),t==="image"&&typeof n.radius=="number"&&Number.isFinite(n.radius)&&(o.style.borderRadius=`${me(n.radius,0,48)}px`),typeof n.marginTop=="number"&&Number.isFinite(n.marginTop)&&(o.style.marginTop=`${me(n.marginTop,0,64)}px`),typeof n.marginBottom=="number"&&Number.isFinite(n.marginBottom)&&(o.style.marginBottom=`${me(n.marginBottom,0,64)}px`),t!=="image"&&(typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&(o.style.fontSize=`${me(n.fontSize,8,96)}px`),typeof n.fontFamily=="string"&&n.fontFamily&&n.fontFamily!=="inherit"&&(o.style.fontFamily=n.fontFamily),typeof n.fontWeight=="string"&&n.fontWeight&&(o.style.fontWeight=n.fontWeight),typeof n.textTransform=="string"&&n.textTransform&&n.textTransform!=="none"&&(o.style.textTransform=n.textTransform),typeof n.lineHeight=="number"&&Number.isFinite(n.lineHeight)&&(o.style.lineHeight=`${me(n.lineHeight,50,300)}%`),typeof n.letterSpacing=="number"&&Number.isFinite(n.letterSpacing)&&(o.style.letterSpacing=`${me(n.letterSpacing,-5,20)}px`)),typeof n.background=="string"&&n.background&&(o.style.background=n.background),typeof n.borderWidth=="number"&&n.borderWidth>0){let r=typeof n.borderColor=="string"&&n.borderColor?n.borderColor:"#bbbbbb";o.style.border=`${me(n.borderWidth,0,20)}px solid ${r}`;}t!=="image"&&typeof n.radius=="number"&&Number.isFinite(n.radius)&&(o.style.borderRadius=`${me(n.radius,0,64)}px`),typeof n.height=="number"&&Number.isFinite(n.height)&&n.height>0&&(o.style.height=`${me(n.height,1,2e3)}px`),t!=="image"&&typeof n.width=="number"&&Number.isFinite(n.width)&&n.width>0&&(o.style.width=`${me(n.width,1,2e3)}px`);for(let r of ["Top","Right","Bottom","Left"]){let s=n[`padding${r}`];typeof s=="number"&&Number.isFinite(s)&&o.style.setProperty(`padding-${r.toLowerCase()}`,`${me(s,0,128)}px`);let l=n[`margin${r}`];typeof l=="number"&&Number.isFinite(l)&&o.style.setProperty(`margin-${r.toLowerCase()}`,`${me(l,0,128)}px`);}}function pt(o,e,t="veo-guide-close"){let n=o.createElement("button");return n.type="button",n.className=t,n.setAttribute("aria-label","Cerrar"),n.textContent="\xD7",n.addEventListener("click",e),n}function fe(o){if(typeof o!="string"||o.length===0)return false;try{let e=typeof window<"u"?window.location.href:"http://localhost/",t=new URL(o,e);return jn.includes(t.protocol)}catch{return false}}function ts(o){let e=o.style?.ctaUrl;if(typeof e=="string")return fe(e)?e:void 0}function Qn(){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 Mt(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=Uo(n.fixedHeight));let s=Qn(),l=e.style?.tailwind===true;i.srcdoc=ss(e.html??"",e.css??"",e.js??"",s,{hostCss:ns(),htmlAttrs:is(),tailwind:l});let a=()=>t.onClose(),c=p=>{if(p.source!==i.contentWindow)return;let m=p.data;if(!(!m||typeof m!="object"||m.__veo!==s))switch(m.type){case "dismiss":t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"dismissed"}),a();break;case "cta":t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"cta_clicked"}),typeof m.url=="string"&&fe(m.url)&&window.open(m.url,"_blank","noopener,noreferrer"),m.close!==false&&a();break;case "navigate":typeof m.url=="string"&&fe(m.url)&&window.location.assign(m.url);break;case "track":typeof m.name=="string"&&t.onTrack&&t.onTrack(m.name,rs(m.props)?m.props:void 0);break;case "resize":!r&&typeof m.height=="number"&&m.height>0&&(i.style.height=`${Math.ceil(m.height)}px`);break}};return window.addEventListener("message",c),{iframe:i,cleanup:()=>window.removeEventListener("message",c)}}function Uo(o){return typeof o=="number"?`${o}px`:o}var os=800*1024;function ns(){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}
|
|
2
|
+
`,o.length>os)return o}}}catch{return o}return o}function is(){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 rs(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function ss(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>${Wo(i.hostCss,"style")}</style>`:"",l=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>"+l+`<style>${Wo(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>${Wo(t,"script")}</script>`:"")+"</body></html>"}function Wo(o,e){let t=e==="script"?/<\/script/gi:/<\/style/gi;return o.replace(t,`<\\/${e}`)}var jo="data-veo-raw-block";function as(o,e,t){let n=o.parentNode;if(t==="prepend"){let i=o.firstChild;for(let r of e)o.insertBefore(r,i);}else if(t==="append")for(let i of e)o.appendChild(i);else if(t==="before")for(let i of e)n?.insertBefore(i,o);else {let i=o;for(let r of e)n?.insertBefore(r,i.nextSibling),i=r;}}var ls=0;function Vo(o,e,t,n,i){if(o.sandboxed){let c={html:o.html??"",css:o.css,js:o.js},{iframe:p,cleanup:m}=Mt(e,c,t,{width:"100%"}),u=e.createElement("div");return u.className="veo-code-sandbox",u.appendChild(p),{node:u,cleanup:m}}let r=e,s=[];if(typeof o.css=="string"&&o.css.trim()){let c=r.createElement("style");c.textContent=o.css,r.head.appendChild(c),s.push(c);}let l=null;if(typeof o.html=="string"&&o.html.trim()){let c=e.createElement("div");c.className="veo-code-html",c.innerHTML=o.html;for(let p of Array.from(c.querySelectorAll("script")))s.push(ds(p,r)),p.remove();if(i){let p=Array.from(c.childNodes);if(i.tagBlockId)for(let m of p)m instanceof Element&&m.setAttribute(jo,i.tagBlockId);as(i.anchor,p,i.pos),s.push(...p);}else if(n){let p=`veo-code-${++ls}`;c.slot=p,n.appendChild(c),s.push(c);let m=e.createElement("slot");m.setAttribute("name",p);let u=e.createElement("div");u.className="veo-code-host",u.appendChild(m),l=u;}else l=c;}let a=false;if(typeof o.js=="string"&&o.js.trim()){let c=o.js,p=()=>{if(a)return;let m=r.createElement("script");m.textContent=cs(c),r.body.appendChild(m),s.push(m);};n&&!n.isConnected?queueMicrotask(p):p();}return {node:l,cleanup:()=>{a=true;for(let c of s)c.parentNode?.removeChild(c);}}}function cs(o){return `(function(){try{
|
|
3
3
|
${o}
|
|
4
|
-
}catch(e){console.error("[OnUser] Error en el bloque de c\xF3digo:",e)}})();`}function ls(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}var it=Math.min,We=Math.max,Kt=Math.round,Xt=Math.floor,Se=o=>({x:o,y:o}),cs={left:"right",right:"left",bottom:"top",top:"bottom"};function ao(o,e,t){return We(o,it(e,t))}function Mt(o,e){return typeof o=="function"?o(e):o}function rt(o){return o.split("-")[0]}function Pt(o){return o.split("-")[1]}function Vo(o){return o==="x"?"y":"x"}function lo(o){return o==="y"?"height":"width"}function Ue(o){let e=o[0];return e==="t"||e==="b"?"y":"x"}function co(o){return Vo(Ue(o))}function ei(o,e,t){t===void 0&&(t=false);let n=Pt(o),i=co(o),r=lo(i),s=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=qt(s)),[s,qt(s)]}function ti(o){let e=qt(o);return [so(o),e,so(e)]}function so(o){return o.includes("start")?o.replace("start","end"):o.replace("end","start")}var Jn=["left","right"],Qn=["right","left"],ds=["top","bottom"],ps=["bottom","top"];function us(o,e,t){switch(o){case "top":case "bottom":return t?e?Qn:Jn:e?Jn:Qn;case "left":case "right":return e?ds:ps;default:return []}}function oi(o,e,t,n){let i=Pt(o),r=us(rt(o),t==="start",n);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(so)))),r}function qt(o){let e=rt(o);return cs[e]+o.slice(e.length)}function ms(o){return {top:0,right:0,bottom:0,left:0,...o}}function qo(o){return typeof o!="number"?ms(o):{top:o,right:o,bottom:o,left:o}}function mt(o){let{x:e,y:t,width:n,height:i}=o;return {width:n,height:i,top:t,left:e,right:e+n,bottom:t+i,x:e,y:t}}function ni(o,e,t){let{reference:n,floating:i}=o,r=Ue(e),s=co(e),l=lo(s),a=rt(e),c=r==="y",p=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2,u=n[l]/2-i[l]/2,d;switch(a){case "top":d={x:p,y:n.y-i.height};break;case "bottom":d={x:p,y:n.y+n.height};break;case "right":d={x:n.x+n.width,y:m};break;case "left":d={x:n.x-i.width,y:m};break;default:d={x:n.x,y:n.y};}switch(Pt(e)){case "start":d[s]-=u*(t&&c?-1:1);break;case "end":d[s]+=u*(t&&c?-1:1);break}return d}async function ii(o,e){var t;e===void 0&&(e={});let{x:n,y:i,platform:r,rects:s,elements:l,strategy:a}=o,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:u=false,padding:d=0}=Mt(e,o),f=qo(d),v=l[u?m==="floating"?"reference":"floating":m],y=mt(await r.getClippingRect({element:(t=await(r.isElement==null?void 0:r.isElement(v)))==null||t?v:v.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:p,strategy:a})),k=m==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),b=await(r.isElement==null?void 0:r.isElement(L))?await(r.getScale==null?void 0:r.getScale(L))||{x:1,y:1}:{x:1,y:1},C=mt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:L,strategy:a}):k);return {top:(y.top-C.top+f.top)/b.y,bottom:(C.bottom-y.bottom+f.bottom)/b.y,left:(y.left-C.left+f.left)/b.x,right:(C.right-y.right+f.right)/b.x}}var fs=50,ri=async(o,e,t)=>{let{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=t,l=s.detectOverflow?s:{...s,detectOverflow:ii},a=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:o,floating:e,strategy:i}),{x:p,y:m}=ni(c,n,a),u=n,d=0,f={};for(let g=0;g<r.length;g++){let v=r[g];if(!v)continue;let{name:y,fn:k}=v,{x:L,y:b,data:C,reset:R}=await k({x:p,y:m,initialPlacement:n,placement:u,strategy:i,middlewareData:f,rects:c,platform:l,elements:{reference:o,floating:e}});p=L??p,m=b??m,f[y]={...f[y],...C},R&&d<fs&&(d++,typeof R=="object"&&(R.placement&&(u=R.placement),R.rects&&(c=R.rects===true?await s.getElementRects({reference:o,floating:e,strategy:i}):R.rects),{x:p,y:m}=ni(c,u,a)),g=-1);}return {x:p,y:m,placement:u,strategy:i,middlewareData:f}},si=o=>({name:"arrow",options:o,async fn(e){let{x:t,y:n,placement:i,rects:r,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:p=0}=Mt(o,e)||{};if(c==null)return {};let m=qo(p),u={x:t,y:n},d=co(i),f=lo(d),g=await s.getDimensions(c),v=d==="y",y=v?"top":"left",k=v?"bottom":"right",L=v?"clientHeight":"clientWidth",b=r.reference[f]+r.reference[d]-u[d]-r.floating[f],C=u[d]-r.reference[d],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),E=R?R[L]:0;(!E||!await(s.isElement==null?void 0:s.isElement(R)))&&(E=l.floating[L]||r.floating[f]);let P=b/2-C/2,I=E/2-g[f]/2-1,Y=it(m[y],I),H=it(m[k],I),J=Y,re=E-g[f]-H,oe=E/2-g[f]/2+P,ie=ao(J,oe,re),q=!a.arrow&&Pt(i)!=null&&oe!==ie&&r.reference[f]/2-(oe<J?Y:H)-g[f]/2<0,Q=q?oe<J?oe-J:oe-re:0;return {[d]:u[d]+Q,data:{[d]:ie,centerOffset:oe-ie-Q,...q&&{alignmentOffset:Q}},reset:q}}});var ai=function(o){return o===void 0&&(o={}),{name:"flip",options:o,async fn(e){var t,n;let{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:p=true,crossAxis:m=true,fallbackPlacements:u,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=true,...v}=Mt(o,e);if((t=r.arrow)!=null&&t.alignmentOffset)return {};let y=rt(i),k=Ue(l),L=rt(l)===l,b=await(a.isRTL==null?void 0:a.isRTL(c.floating)),C=u||(L||!g?[qt(l)]:ti(l)),R=f!=="none";!u&&R&&C.push(...oi(l,g,f,b));let E=[l,...C],P=await a.detectOverflow(e,v),I=[],Y=((n=r.flip)==null?void 0:n.overflows)||[];if(p&&I.push(P[y]),m){let oe=ei(i,s,b);I.push(P[oe[0]],P[oe[1]]);}if(Y=[...Y,{placement:i,overflows:I}],!I.every(oe=>oe<=0)){var H,J;let oe=(((H=r.flip)==null?void 0:H.index)||0)+1,ie=E[oe];if(ie&&(!(m==="alignment"?k!==Ue(ie):false)||Y.every(ne=>Ue(ne.placement)===k?ne.overflows[0]>0:true)))return {data:{index:oe,overflows:Y},reset:{placement:ie}};let q=(J=Y.filter(Q=>Q.overflows[0]<=0).sort((Q,ne)=>Q.overflows[1]-ne.overflows[1])[0])==null?void 0:J.placement;if(!q)switch(d){case "bestFit":{var re;let Q=(re=Y.filter(ne=>{if(R){let ce=Ue(ne.placement);return ce===k||ce==="y"}return true}).map(ne=>[ne.placement,ne.overflows.filter(ce=>ce>0).reduce((ce,se)=>ce+se,0)]).sort((ne,ce)=>ne[1]-ce[1])[0])==null?void 0:re[0];Q&&(q=Q);break}case "initialPlacement":q=l;break}if(i!==q)return {reset:{placement:q}}}return {}}}};var gs=new Set(["left","top"]);async function hs(o,e){let{placement:t,platform:n,elements:i}=o,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=rt(t),l=Pt(t),a=Ue(t)==="y",c=gs.has(s)?-1:1,p=r&&a?-1:1,m=Mt(e,o),{mainAxis:u,crossAxis:d,alignmentAxis:f}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof f=="number"&&(d=l==="end"?f*-1:f),a?{x:d*p,y:u*c}:{x:u*c,y:d*p}}var li=function(o){return o===void 0&&(o=0),{name:"offset",options:o,async fn(e){var t,n;let{x:i,y:r,placement:s,middlewareData:l}=e,a=await hs(e,o);return s===((t=l.offset)==null?void 0:t.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},ci=function(o){return o===void 0&&(o={}),{name:"shift",options:o,async fn(e){let{x:t,y:n,placement:i,platform:r}=e,{mainAxis:s=true,crossAxis:l=false,limiter:a={fn:y=>{let{x:k,y:L}=y;return {x:k,y:L}}},...c}=Mt(o,e),p={x:t,y:n},m=await r.detectOverflow(e,c),u=Ue(rt(i)),d=Vo(u),f=p[d],g=p[u];if(s){let y=d==="y"?"top":"left",k=d==="y"?"bottom":"right",L=f+m[y],b=f-m[k];f=ao(L,f,b);}if(l){let y=u==="y"?"top":"left",k=u==="y"?"bottom":"right",L=g+m[y],b=g-m[k];g=ao(L,g,b);}let v=a.fn({...e,[d]:f,[u]:g});return {...v,data:{x:v.x-t,y:v.y-n,enabled:{[d]:s,[u]:l}}}}}};function po(){return typeof window<"u"}function gt(o){return pi(o)?(o.nodeName||"").toLowerCase():"#document"}function ve(o){var e;return (o==null||(e=o.ownerDocument)==null?void 0:e.defaultView)||window}function Le(o){var e;return (e=(pi(o)?o.ownerDocument:o.document)||window.document)==null?void 0:e.documentElement}function pi(o){return po()?o instanceof Node||o instanceof ve(o).Node:false}function we(o){return po()?o instanceof Element||o instanceof ve(o).Element:false}function Pe(o){return po()?o instanceof HTMLElement||o instanceof ve(o).HTMLElement:false}function di(o){return !po()||typeof ShadowRoot>"u"?false:o instanceof ShadowRoot||o instanceof ve(o).ShadowRoot}function $t(o){let{overflow:e,overflowX:t,overflowY:n,display:i}=Ee(o);return /auto|scroll|overlay|hidden|clip/.test(e+n+t)&&i!=="inline"&&i!=="contents"}function ui(o){return /^(table|td|th)$/.test(gt(o))}function Yt(o){try{if(o.matches(":popover-open"))return !0}catch{}try{return o.matches(":modal")}catch{return false}}var vs=/transform|translate|scale|rotate|perspective|filter/,bs=/paint|layout|strict|content/,ft=o=>!!o&&o!=="none",Ko;function uo(o){let e=we(o)?Ee(o):o;return ft(e.transform)||ft(e.translate)||ft(e.scale)||ft(e.rotate)||ft(e.perspective)||!mo()&&(ft(e.backdropFilter)||ft(e.filter))||vs.test(e.willChange||"")||bs.test(e.contain||"")}function mi(o){let e=je(o);for(;Pe(e)&&!ht(e);){if(uo(e))return e;if(Yt(e))return null;e=je(e);}return null}function mo(){return Ko==null&&(Ko=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ko}function ht(o){return /^(html|body|#document)$/.test(gt(o))}function Ee(o){return ve(o).getComputedStyle(o)}function Zt(o){return we(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:{scrollLeft:o.scrollX,scrollTop:o.scrollY}}function je(o){if(gt(o)==="html")return o;let e=o.assignedSlot||o.parentNode||di(o)&&o.host||Le(o);return di(e)?e.host:e}function fi(o){let e=je(o);return ht(e)?o.ownerDocument?o.ownerDocument.body:o.body:Pe(e)&&$t(e)?e:fi(e)}function It(o,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=true);let i=fi(o),r=i===((n=o.ownerDocument)==null?void 0:n.body),s=ve(i);if(r){let l=fo(s);return e.concat(s,s.visualViewport||[],$t(i)?i:[],l&&t?It(l):[])}else return e.concat(i,It(i,[],t))}function fo(o){return o.parent&&Object.getPrototypeOf(o.parent)?o.frameElement:null}function bi(o){let e=Ee(o),t=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=Pe(o),r=i?o.offsetWidth:t,s=i?o.offsetHeight:n,l=Kt(t)!==r||Kt(n)!==s;return l&&(t=r,n=s),{width:t,height:n,$:l}}function Yo(o){return we(o)?o:o.contextElement}function Bt(o){let e=Yo(o);if(!Pe(e))return Se(1);let t=e.getBoundingClientRect(),{width:n,height:i,$:r}=bi(e),s=(r?Kt(t.width):t.width)/n,l=(r?Kt(t.height):t.height)/i;return (!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var ys=Se(0);function yi(o){let e=ve(o);return !mo()||!e.visualViewport?ys:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function xs(o,e,t){return e===void 0&&(e=false),!t||e&&t!==ve(o)?false:e}function vt(o,e,t,n){e===void 0&&(e=false),t===void 0&&(t=false);let i=o.getBoundingClientRect(),r=Yo(o),s=Se(1);e&&(n?we(n)&&(s=Bt(n)):s=Bt(o));let l=xs(r,t,n)?yi(r):Se(0),a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,p=i.width/s.x,m=i.height/s.y;if(r){let u=ve(r),d=n&&we(n)?ve(n):n,f=u,g=fo(f);for(;g&&n&&d!==f;){let v=Bt(g),y=g.getBoundingClientRect(),k=Ee(g),L=y.left+(g.clientLeft+parseFloat(k.paddingLeft))*v.x,b=y.top+(g.clientTop+parseFloat(k.paddingTop))*v.y;a*=v.x,c*=v.y,p*=v.x,m*=v.y,a+=L,c+=b,f=ve(g),g=fo(f);}}return mt({width:p,height:m,x:a,y:c})}function go(o,e){let t=Zt(o).scrollLeft;return e?e.left+t:vt(Le(o)).left+t}function xi(o,e){let t=o.getBoundingClientRect(),n=t.left+e.scrollLeft-go(o,t),i=t.top+e.scrollTop;return {x:n,y:i}}function ws(o){let{elements:e,rect:t,offsetParent:n,strategy:i}=o,r=i==="fixed",s=Le(n),l=e?Yt(e.floating):false;if(n===s||l&&r)return t;let a={scrollLeft:0,scrollTop:0},c=Se(1),p=Se(0),m=Pe(n);if((m||!m&&!r)&&((gt(n)!=="body"||$t(s))&&(a=Zt(n)),m)){let d=vt(n);c=Bt(n),p.x=d.x+n.clientLeft,p.y=d.y+n.clientTop;}let u=s&&!m&&!r?xi(s,a):Se(0);return {width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-a.scrollLeft*c.x+p.x+u.x,y:t.y*c.y-a.scrollTop*c.y+p.y+u.y}}function Es(o){return Array.from(o.getClientRects())}function ks(o){let e=Le(o),t=Zt(o),n=o.ownerDocument.body,i=We(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=We(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),s=-t.scrollLeft+go(o),l=-t.scrollTop;return Ee(n).direction==="rtl"&&(s+=We(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:l}}var gi=25;function Cs(o,e){let t=ve(o),n=Le(o),i=t.visualViewport,r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;let p=mo();(!p||p&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop);}let c=go(n);if(c<=0){let p=n.ownerDocument,m=p.body,u=getComputedStyle(m),d=p.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,f=Math.abs(n.clientWidth-m.clientWidth-d);f<=gi&&(r-=f);}else c<=gi&&(r+=c);return {width:r,height:s,x:l,y:a}}function Ss(o,e){let t=vt(o,true,e==="fixed"),n=t.top+o.clientTop,i=t.left+o.clientLeft,r=Pe(o)?Bt(o):Se(1),s=o.clientWidth*r.x,l=o.clientHeight*r.y,a=i*r.x,c=n*r.y;return {width:s,height:l,x:a,y:c}}function hi(o,e,t){let n;if(e==="viewport")n=Cs(o,t);else if(e==="document")n=ks(Le(o));else if(we(e))n=Ss(e,t);else {let i=yi(o);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height};}return mt(n)}function wi(o,e){let t=je(o);return t===e||!we(t)||ht(t)?false:Ee(t).position==="fixed"||wi(t,e)}function Ls(o,e){let t=e.get(o);if(t)return t;let n=It(o,[],false).filter(l=>we(l)&>(l)!=="body"),i=null,r=Ee(o).position==="fixed",s=r?je(o):o;for(;we(s)&&!ht(s);){let l=Ee(s),a=uo(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||$t(s)&&!a&&wi(o,s))?n=n.filter(p=>p!==s):i=l,s=je(s);}return e.set(o,n),n}function Ts(o){let{element:e,boundary:t,rootBoundary:n,strategy:i}=o,s=[...t==="clippingAncestors"?Yt(e)?[]:Ls(e,this._c):[].concat(t),n],l=hi(e,s[0],i),a=l.top,c=l.right,p=l.bottom,m=l.left;for(let u=1;u<s.length;u++){let d=hi(e,s[u],i);a=We(d.top,a),c=it(d.right,c),p=it(d.bottom,p),m=We(d.left,m);}return {width:c-m,height:p-a,x:m,y:a}}function As(o){let{width:e,height:t}=bi(o);return {width:e,height:t}}function Rs(o,e,t){let n=Pe(e),i=Le(e),r=t==="fixed",s=vt(o,true,r,e),l={scrollLeft:0,scrollTop:0},a=Se(0);function c(){a.x=go(i);}if(n||!n&&!r)if((gt(e)!=="body"||$t(i))&&(l=Zt(e)),n){let d=vt(e,true,r,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop;}else i&&c();r&&!n&&i&&c();let p=i&&!n&&!r?xi(i,l):Se(0),m=s.left+l.scrollLeft-a.x-p.x,u=s.top+l.scrollTop-a.y-p.y;return {x:m,y:u,width:s.width,height:s.height}}function Xo(o){return Ee(o).position==="static"}function vi(o,e){if(!Pe(o)||Ee(o).position==="fixed")return null;if(e)return e(o);let t=o.offsetParent;return Le(o)===t&&(t=t.ownerDocument.body),t}function Ei(o,e){let t=ve(o);if(Yt(o))return t;if(!Pe(o)){let i=je(o);for(;i&&!ht(i);){if(we(i)&&!Xo(i))return i;i=je(i);}return t}let n=vi(o,e);for(;n&&ui(n)&&Xo(n);)n=vi(n,e);return n&&ht(n)&&Xo(n)&&!uo(n)?t:n||mi(o)||t}var Ms=async function(o){let e=this.getOffsetParent||Ei,t=this.getDimensions,n=await t(o.floating);return {reference:Rs(o.reference,await e(o.floating),o.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Ps(o){return Ee(o).direction==="rtl"}var Is={convertOffsetParentRelativeRectToViewportRelativeRect:ws,getDocumentElement:Le,getClippingRect:Ts,getOffsetParent:Ei,getElementRects:Ms,getClientRects:Es,getDimensions:As,getScale:Bt,isElement:we,isRTL:Ps};function ki(o,e){return o.x===e.x&&o.y===e.y&&o.width===e.width&&o.height===e.height}function $s(o,e){let t=null,n,i=Le(o);function r(){var l;clearTimeout(n),(l=t)==null||l.disconnect(),t=null;}function s(l,a){l===void 0&&(l=false),a===void 0&&(a=1),r();let c=o.getBoundingClientRect(),{left:p,top:m,width:u,height:d}=c;if(l||e(),!u||!d)return;let f=Xt(m),g=Xt(i.clientWidth-(p+u)),v=Xt(i.clientHeight-(m+d)),y=Xt(p),L={rootMargin:-f+"px "+-g+"px "+-v+"px "+-y+"px",threshold:We(0,it(1,a))||1},b=true;function C(R){let E=R[0].intersectionRatio;if(E!==a){if(!b)return s();E?s(false,E):n=setTimeout(()=>{s(false,1e-7);},1e3);}E===1&&!ki(c,o.getBoundingClientRect())&&s(),b=false;}try{t=new IntersectionObserver(C,{...L,root:i.ownerDocument});}catch{t=new IntersectionObserver(C,L);}t.observe(o);}return s(true),r}function Zo(o,e,t,n){n===void 0&&(n={});let{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=false}=n,c=Yo(o),p=i||r?[...c?It(c):[],...e?It(e):[]]:[];p.forEach(y=>{i&&y.addEventListener("scroll",t,{passive:true}),r&&y.addEventListener("resize",t);});let m=c&&l?$s(c,t):null,u=-1,d=null;s&&(d=new ResizeObserver(y=>{let[k]=y;k&&k.target===c&&d&&e&&(d.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var L;(L=d)==null||L.observe(e);})),t();}),c&&!a&&d.observe(c),e&&d.observe(e));let f,g=a?vt(o):null;a&&v();function v(){let y=vt(o);g&&!ki(g,y)&&t(),g=y,f=requestAnimationFrame(v);}return t(),()=>{var y;p.forEach(k=>{i&&k.removeEventListener("scroll",t),r&&k.removeEventListener("resize",t);}),m?.(),(y=d)==null||y.disconnect(),d=null,a&&cancelAnimationFrame(f);}}var Ie=li;var $e=ci,Be=ai;var st=si;var Ne=(o,e,t)=>{let n=new Map,i={platform:Is,...t},r={...i.platform,_c:n};return ri(o,e,{...i,platform:r})};var Bs={"--veo-bg":"#1f2937","--veo-text":"#f9fafb","--veo-text-secondary":"#d1d5db","--veo-shadow":"0 20px 60px rgba(0, 0, 0, 0.55)"},Qo={left:"flex-start",center:"center",right:"flex-end"},Ns={left:"flex-start",center:"center",right:"flex-end"},Hs={title:"text",text:"text",image:"self"},Ci={none:"none",soft:"0 4px 14px rgba(0, 0, 0, 0.10)",medium:"0 8px 30px rgba(0, 0, 0, 0.18)",strong:"0 24px 60px rgba(0, 0, 0, 0.32)"},Si={center:[.5,.5],top:[.5,0],bottom:[.5,1],left:[0,.5],right:[1,.5],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},He=/^#[0-9a-f]{3,8}$|^(rgb|rgba|hsl|hsla)\([\d.,%/\sdeg]+\)$|^[a-z]{3,20}$/i;function ge(o,e,t){return Math.min(t,Math.max(e,o))}function Li(o,e){if(!e||typeof e!="object")return;let t=e;if(typeof t.accentColor=="string"&&He.test(t.accentColor.trim())&&o.style.setProperty("--veo-primary",t.accentColor.trim()),typeof t.fontFamily=="string"&&t.fontFamily.length<=200&&!/[<>{}]/.test(t.fontFamily)&&o.style.setProperty("--veo-font",t.fontFamily.trim()),t.theme==="dark")for(let[r,s]of Object.entries(Bs))o.style.setProperty(r,s);typeof t.background=="string"&&He.test(t.background.trim())&&o.style.setProperty("--veo-bg",t.background.trim()),typeof t.textColor=="string"&&He.test(t.textColor.trim())&&o.style.setProperty("--veo-text",t.textColor.trim()),typeof t.textSecondaryColor=="string"&&He.test(t.textSecondaryColor.trim())&&o.style.setProperty("--veo-text-secondary",t.textSecondaryColor.trim()),typeof t.radius=="number"&&Number.isFinite(t.radius)&&o.style.setProperty("--veo-radius",`${ge(t.radius,0,48)}px`),typeof t.width=="number"&&Number.isFinite(t.width)&&o.style.setProperty("--veo-width",`${ge(t.width,220,720)}px`),typeof t.height=="number"&&Number.isFinite(t.height)&&o.style.setProperty("--veo-min-h",`${ge(t.height,120,900)}px`),(t.align==="left"||t.align==="center"||t.align==="right")&&o.style.setProperty("--veo-actions-justify",Qo[t.align]),typeof t.padding=="number"&&Number.isFinite(t.padding)&&o.style.setProperty("--veo-pad",`${ge(t.padding,0,64)}px`),typeof t.margin=="number"&&Number.isFinite(t.margin)&&o.style.setProperty("--veo-margin",`${ge(t.margin,0,64)}px`),typeof t.borderWidth=="number"&&Number.isFinite(t.borderWidth)&&o.style.setProperty("--veo-border-width",`${ge(t.borderWidth,0,16)}px`),typeof t.borderColor=="string"&&He.test(t.borderColor.trim())&&o.style.setProperty("--veo-border-color",t.borderColor.trim()),typeof t.shadow=="string"&&Ci[t.shadow]&&o.style.setProperty("--veo-shadow",Ci[t.shadow]);let n,i;if(typeof t.posX=="number"&&typeof t.posY=="number"?(n=ge(t.posX,0,1),i=ge(t.posY,0,1)):typeof t.overlayPosition=="string"&&Si[t.overlayPosition]&&([n,i]=Si[t.overlayPosition]),n!==void 0&&i!==void 0&&(o.style.setProperty("--veo-pos-x",`${n*100}%`),o.style.setProperty("--veo-pos-y",`${i*100}%`)),t.elements&&typeof t.elements=="object"){let r=t.elements;Jo(o,"title",r.title),Jo(o,"text",r.text),Jo(o,"image",r.image),Ds(o,r.cta);}}function Ds(o,e){if(!e||typeof e!="object")return;let t=e;typeof t.align=="string"&&Qo[t.align]&&o.style.setProperty("--veo-actions-justify",Qo[t.align]),typeof t.background=="string"&&He.test(t.background.trim())&&o.style.setProperty("--veo-cta-bg",t.background.trim()),typeof t.color=="string"&&He.test(t.color.trim())&&o.style.setProperty("--veo-cta-color",t.color.trim()),typeof t.fontSize=="number"&&Number.isFinite(t.fontSize)&&o.style.setProperty("--veo-cta-size",`${ge(t.fontSize,10,24)}px`),typeof t.radius=="number"&&Number.isFinite(t.radius)&&o.style.setProperty("--veo-cta-radius",`${ge(t.radius,0,48)}px`);}function Jo(o,e,t){if(!t||typeof t!="object")return;let n=t;if(typeof n.align=="string"&&(n.align==="left"||n.align==="center"||n.align==="right")){let r=(Hs[e]??"text")==="self"?Ns[n.align]:n.align;o.style.setProperty(`--veo-${e}-align`,r);}typeof n.color=="string"&&He.test(n.color.trim())&&o.style.setProperty(`--veo-${e}-color`,n.color.trim()),typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&o.style.setProperty(`--veo-${e}-size`,`${ge(n.fontSize,8,72)}px`),typeof n.width=="number"&&Number.isFinite(n.width)&&o.style.setProperty(`--veo-${e}-width`,`${ge(n.width,10,100)}%`),typeof n.radius=="number"&&Number.isFinite(n.radius)&&o.style.setProperty(`--veo-${e}-radius`,`${ge(n.radius,0,48)}px`),typeof n.marginTop=="number"&&Number.isFinite(n.marginTop)&&o.style.setProperty(`--veo-${e}-mt`,`${ge(n.marginTop,0,64)}px`),typeof n.marginBottom=="number"&&Number.isFinite(n.marginBottom)&&o.style.setProperty(`--veo-${e}-mb`,`${ge(n.marginBottom,0,64)}px`);}function De(o){let e=o?.inlinePosition;return e==="before"||e==="prepend"||e==="append"?e:"after"}function be(o,e,t){switch(t){case "before":o.before(e);break;case "after":o.after(e);break;case "prepend":o.prepend(e);break;case "append":o.append(e);break}}function xe(o,e,t){let n=window.setInterval(()=>{if(o.isConnected)return;let i=document.querySelector(e);i&&be(i,o,t);},1e3);return ()=>window.clearInterval(n)}function le(o,e=5e3){return new Promise(t=>{let n=()=>{try{return document.querySelector(o)}catch{return null}},i=n();if(i){t(i);return}let r=false,s=c=>{r||(r=true,l.disconnect(),clearTimeout(a),t(c));},l=new MutationObserver(()=>{let c=n();c&&s(c);});l.observe(document.body,{childList:true,subtree:true});let a=setTimeout(()=>s(null),e);})}var ho=`
|
|
4
|
+
}catch(e){console.error("[OnUser] Error en el bloque de c\xF3digo:",e)}})();`}function ds(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}var it=Math.min,We=Math.max,Xt=Math.round,Yt=Math.floor,Se=o=>({x:o,y:o}),ps={left:"right",right:"left",bottom:"top",top:"bottom"};function co(o,e,t){return We(o,it(e,t))}function Pt(o,e){return typeof o=="function"?o(e):o}function rt(o){return o.split("-")[0]}function It(o){return o.split("-")[1]}function qo(o){return o==="x"?"y":"x"}function po(o){return o==="y"?"height":"width"}function Ue(o){let e=o[0];return e==="t"||e==="b"?"y":"x"}function uo(o){return qo(Ue(o))}function oi(o,e,t){t===void 0&&(t=false);let n=It(o),i=uo(o),r=po(i),s=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=Kt(s)),[s,Kt(s)]}function ni(o){let e=Kt(o);return [lo(o),e,lo(e)]}function lo(o){return o.includes("start")?o.replace("start","end"):o.replace("end","start")}var ei=["left","right"],ti=["right","left"],us=["top","bottom"],ms=["bottom","top"];function fs(o,e,t){switch(o){case "top":case "bottom":return t?e?ti:ei:e?ei:ti;case "left":case "right":return e?us:ms;default:return []}}function ii(o,e,t,n){let i=It(o),r=fs(rt(o),t==="start",n);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(lo)))),r}function Kt(o){let e=rt(o);return ps[e]+o.slice(e.length)}function hs(o){return {top:0,right:0,bottom:0,left:0,...o}}function Ko(o){return typeof o!="number"?hs(o):{top:o,right:o,bottom:o,left:o}}function ut(o){let{x:e,y:t,width:n,height:i}=o;return {width:n,height:i,top:t,left:e,right:e+n,bottom:t+i,x:e,y:t}}function ri(o,e,t){let{reference:n,floating:i}=o,r=Ue(e),s=uo(e),l=po(s),a=rt(e),c=r==="y",p=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2,u=n[l]/2-i[l]/2,d;switch(a){case "top":d={x:p,y:n.y-i.height};break;case "bottom":d={x:p,y:n.y+n.height};break;case "right":d={x:n.x+n.width,y:m};break;case "left":d={x:n.x-i.width,y:m};break;default:d={x:n.x,y:n.y};}switch(It(e)){case "start":d[s]-=u*(t&&c?-1:1);break;case "end":d[s]+=u*(t&&c?-1:1);break}return d}async function si(o,e){var t;e===void 0&&(e={});let{x:n,y:i,platform:r,rects:s,elements:l,strategy:a}=o,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:u=false,padding:d=0}=Pt(e,o),f=Ko(d),v=l[u?m==="floating"?"reference":"floating":m],y=ut(await r.getClippingRect({element:(t=await(r.isElement==null?void 0:r.isElement(v)))==null||t?v:v.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:p,strategy:a})),E=m==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),b=await(r.isElement==null?void 0:r.isElement(T))?await(r.getScale==null?void 0:r.getScale(T))||{x:1,y:1}:{x:1,y:1},C=ut(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:T,strategy:a}):E);return {top:(y.top-C.top+f.top)/b.y,bottom:(C.bottom-y.bottom+f.bottom)/b.y,left:(y.left-C.left+f.left)/b.x,right:(C.right-y.right+f.right)/b.x}}var gs=50,ai=async(o,e,t)=>{let{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=t,l=s.detectOverflow?s:{...s,detectOverflow:si},a=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:o,floating:e,strategy:i}),{x:p,y:m}=ri(c,n,a),u=n,d=0,f={};for(let h=0;h<r.length;h++){let v=r[h];if(!v)continue;let{name:y,fn:E}=v,{x:T,y:b,data:C,reset:R}=await E({x:p,y:m,initialPlacement:n,placement:u,strategy:i,middlewareData:f,rects:c,platform:l,elements:{reference:o,floating:e}});p=T??p,m=b??m,f[y]={...f[y],...C},R&&d<gs&&(d++,typeof R=="object"&&(R.placement&&(u=R.placement),R.rects&&(c=R.rects===true?await s.getElementRects({reference:o,floating:e,strategy:i}):R.rects),{x:p,y:m}=ri(c,u,a)),h=-1);}return {x:p,y:m,placement:u,strategy:i,middlewareData:f}},li=o=>({name:"arrow",options:o,async fn(e){let{x:t,y:n,placement:i,rects:r,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:p=0}=Pt(o,e)||{};if(c==null)return {};let m=Ko(p),u={x:t,y:n},d=uo(i),f=po(d),h=await s.getDimensions(c),v=d==="y",y=v?"top":"left",E=v?"bottom":"right",T=v?"clientHeight":"clientWidth",b=r.reference[f]+r.reference[d]-u[d]-r.floating[f],C=u[d]-r.reference[d],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),k=R?R[T]:0;(!k||!await(s.isElement==null?void 0:s.isElement(R)))&&(k=l.floating[T]||r.floating[f]);let P=b/2-C/2,I=k/2-h[f]/2-1,F=it(m[y],I),B=it(m[E],I),J=F,re=k-h[f]-B,oe=k/2-h[f]/2+P,ie=co(J,oe,re),K=!a.arrow&&It(i)!=null&&oe!==ie&&r.reference[f]/2-(oe<J?F:B)-h[f]/2<0,Q=K?oe<J?oe-J:oe-re:0;return {[d]:u[d]+Q,data:{[d]:ie,centerOffset:oe-ie-Q,...K&&{alignmentOffset:Q}},reset:K}}});var ci=function(o){return o===void 0&&(o={}),{name:"flip",options:o,async fn(e){var t,n;let{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:p=true,crossAxis:m=true,fallbackPlacements:u,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=true,...v}=Pt(o,e);if((t=r.arrow)!=null&&t.alignmentOffset)return {};let y=rt(i),E=Ue(l),T=rt(l)===l,b=await(a.isRTL==null?void 0:a.isRTL(c.floating)),C=u||(T||!h?[Kt(l)]:ni(l)),R=f!=="none";!u&&R&&C.push(...ii(l,h,f,b));let k=[l,...C],P=await a.detectOverflow(e,v),I=[],F=((n=r.flip)==null?void 0:n.overflows)||[];if(p&&I.push(P[y]),m){let oe=oi(i,s,b);I.push(P[oe[0]],P[oe[1]]);}if(F=[...F,{placement:i,overflows:I}],!I.every(oe=>oe<=0)){var B,J;let oe=(((B=r.flip)==null?void 0:B.index)||0)+1,ie=k[oe];if(ie&&(!(m==="alignment"?E!==Ue(ie):false)||F.every(ne=>Ue(ne.placement)===E?ne.overflows[0]>0:true)))return {data:{index:oe,overflows:F},reset:{placement:ie}};let K=(J=F.filter(Q=>Q.overflows[0]<=0).sort((Q,ne)=>Q.overflows[1]-ne.overflows[1])[0])==null?void 0:J.placement;if(!K)switch(d){case "bestFit":{var re;let Q=(re=F.filter(ne=>{if(R){let ce=Ue(ne.placement);return ce===E||ce==="y"}return true}).map(ne=>[ne.placement,ne.overflows.filter(ce=>ce>0).reduce((ce,se)=>ce+se,0)]).sort((ne,ce)=>ne[1]-ce[1])[0])==null?void 0:re[0];Q&&(K=Q);break}case "initialPlacement":K=l;break}if(i!==K)return {reset:{placement:K}}}return {}}}};var vs=new Set(["left","top"]);async function bs(o,e){let{placement:t,platform:n,elements:i}=o,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=rt(t),l=It(t),a=Ue(t)==="y",c=vs.has(s)?-1:1,p=r&&a?-1:1,m=Pt(e,o),{mainAxis:u,crossAxis:d,alignmentAxis:f}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof f=="number"&&(d=l==="end"?f*-1:f),a?{x:d*p,y:u*c}:{x:u*c,y:d*p}}var di=function(o){return o===void 0&&(o=0),{name:"offset",options:o,async fn(e){var t,n;let{x:i,y:r,placement:s,middlewareData:l}=e,a=await bs(e,o);return s===((t=l.offset)==null?void 0:t.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},pi=function(o){return o===void 0&&(o={}),{name:"shift",options:o,async fn(e){let{x:t,y:n,placement:i,platform:r}=e,{mainAxis:s=true,crossAxis:l=false,limiter:a={fn:y=>{let{x:E,y:T}=y;return {x:E,y:T}}},...c}=Pt(o,e),p={x:t,y:n},m=await r.detectOverflow(e,c),u=Ue(rt(i)),d=qo(u),f=p[d],h=p[u];if(s){let y=d==="y"?"top":"left",E=d==="y"?"bottom":"right",T=f+m[y],b=f-m[E];f=co(T,f,b);}if(l){let y=u==="y"?"top":"left",E=u==="y"?"bottom":"right",T=h+m[y],b=h-m[E];h=co(T,h,b);}let v=a.fn({...e,[d]:f,[u]:h});return {...v,data:{x:v.x-t,y:v.y-n,enabled:{[d]:s,[u]:l}}}}}};function mo(){return typeof window<"u"}function ft(o){return mi(o)?(o.nodeName||"").toLowerCase():"#document"}function ve(o){var e;return (o==null||(e=o.ownerDocument)==null?void 0:e.defaultView)||window}function Le(o){var e;return (e=(mi(o)?o.ownerDocument:o.document)||window.document)==null?void 0:e.documentElement}function mi(o){return mo()?o instanceof Node||o instanceof ve(o).Node:false}function we(o){return mo()?o instanceof Element||o instanceof ve(o).Element:false}function Pe(o){return mo()?o instanceof HTMLElement||o instanceof ve(o).HTMLElement:false}function ui(o){return !mo()||typeof ShadowRoot>"u"?false:o instanceof ShadowRoot||o instanceof ve(o).ShadowRoot}function Nt(o){let{overflow:e,overflowX:t,overflowY:n,display:i}=Ee(o);return /auto|scroll|overlay|hidden|clip/.test(e+n+t)&&i!=="inline"&&i!=="contents"}function fi(o){return /^(table|td|th)$/.test(ft(o))}function Zt(o){try{if(o.matches(":popover-open"))return !0}catch{}try{return o.matches(":modal")}catch{return false}}var ys=/transform|translate|scale|rotate|perspective|filter/,xs=/paint|layout|strict|content/,mt=o=>!!o&&o!=="none",Xo;function fo(o){let e=we(o)?Ee(o):o;return mt(e.transform)||mt(e.translate)||mt(e.scale)||mt(e.rotate)||mt(e.perspective)||!ho()&&(mt(e.backdropFilter)||mt(e.filter))||ys.test(e.willChange||"")||xs.test(e.contain||"")}function hi(o){let e=je(o);for(;Pe(e)&&!ht(e);){if(fo(e))return e;if(Zt(e))return null;e=je(e);}return null}function ho(){return Xo==null&&(Xo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xo}function ht(o){return /^(html|body|#document)$/.test(ft(o))}function Ee(o){return ve(o).getComputedStyle(o)}function Jt(o){return we(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:{scrollLeft:o.scrollX,scrollTop:o.scrollY}}function je(o){if(ft(o)==="html")return o;let e=o.assignedSlot||o.parentNode||ui(o)&&o.host||Le(o);return ui(e)?e.host:e}function gi(o){let e=je(o);return ht(e)?o.ownerDocument?o.ownerDocument.body:o.body:Pe(e)&&Nt(e)?e:gi(e)}function $t(o,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=true);let i=gi(o),r=i===((n=o.ownerDocument)==null?void 0:n.body),s=ve(i);if(r){let l=go(s);return e.concat(s,s.visualViewport||[],Nt(i)?i:[],l&&t?$t(l):[])}else return e.concat(i,$t(i,[],t))}function go(o){return o.parent&&Object.getPrototypeOf(o.parent)?o.frameElement:null}function xi(o){let e=Ee(o),t=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=Pe(o),r=i?o.offsetWidth:t,s=i?o.offsetHeight:n,l=Xt(t)!==r||Xt(n)!==s;return l&&(t=r,n=s),{width:t,height:n,$:l}}function Zo(o){return we(o)?o:o.contextElement}function Bt(o){let e=Zo(o);if(!Pe(e))return Se(1);let t=e.getBoundingClientRect(),{width:n,height:i,$:r}=xi(e),s=(r?Xt(t.width):t.width)/n,l=(r?Xt(t.height):t.height)/i;return (!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var ws=Se(0);function wi(o){let e=ve(o);return !ho()||!e.visualViewport?ws:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Es(o,e,t){return e===void 0&&(e=false),!t||e&&t!==ve(o)?false:e}function gt(o,e,t,n){e===void 0&&(e=false),t===void 0&&(t=false);let i=o.getBoundingClientRect(),r=Zo(o),s=Se(1);e&&(n?we(n)&&(s=Bt(n)):s=Bt(o));let l=Es(r,t,n)?wi(r):Se(0),a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,p=i.width/s.x,m=i.height/s.y;if(r){let u=ve(r),d=n&&we(n)?ve(n):n,f=u,h=go(f);for(;h&&n&&d!==f;){let v=Bt(h),y=h.getBoundingClientRect(),E=Ee(h),T=y.left+(h.clientLeft+parseFloat(E.paddingLeft))*v.x,b=y.top+(h.clientTop+parseFloat(E.paddingTop))*v.y;a*=v.x,c*=v.y,p*=v.x,m*=v.y,a+=T,c+=b,f=ve(h),h=go(f);}}return ut({width:p,height:m,x:a,y:c})}function vo(o,e){let t=Jt(o).scrollLeft;return e?e.left+t:gt(Le(o)).left+t}function Ei(o,e){let t=o.getBoundingClientRect(),n=t.left+e.scrollLeft-vo(o,t),i=t.top+e.scrollTop;return {x:n,y:i}}function ks(o){let{elements:e,rect:t,offsetParent:n,strategy:i}=o,r=i==="fixed",s=Le(n),l=e?Zt(e.floating):false;if(n===s||l&&r)return t;let a={scrollLeft:0,scrollTop:0},c=Se(1),p=Se(0),m=Pe(n);if((m||!m&&!r)&&((ft(n)!=="body"||Nt(s))&&(a=Jt(n)),m)){let d=gt(n);c=Bt(n),p.x=d.x+n.clientLeft,p.y=d.y+n.clientTop;}let u=s&&!m&&!r?Ei(s,a):Se(0);return {width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-a.scrollLeft*c.x+p.x+u.x,y:t.y*c.y-a.scrollTop*c.y+p.y+u.y}}function Cs(o){return Array.from(o.getClientRects())}function Ss(o){let e=Le(o),t=Jt(o),n=o.ownerDocument.body,i=We(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=We(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),s=-t.scrollLeft+vo(o),l=-t.scrollTop;return Ee(n).direction==="rtl"&&(s+=We(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:l}}var vi=25;function Ls(o,e){let t=ve(o),n=Le(o),i=t.visualViewport,r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;let p=ho();(!p||p&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop);}let c=vo(n);if(c<=0){let p=n.ownerDocument,m=p.body,u=getComputedStyle(m),d=p.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,f=Math.abs(n.clientWidth-m.clientWidth-d);f<=vi&&(r-=f);}else c<=vi&&(r+=c);return {width:r,height:s,x:l,y:a}}function Ts(o,e){let t=gt(o,true,e==="fixed"),n=t.top+o.clientTop,i=t.left+o.clientLeft,r=Pe(o)?Bt(o):Se(1),s=o.clientWidth*r.x,l=o.clientHeight*r.y,a=i*r.x,c=n*r.y;return {width:s,height:l,x:a,y:c}}function bi(o,e,t){let n;if(e==="viewport")n=Ls(o,t);else if(e==="document")n=Ss(Le(o));else if(we(e))n=Ts(e,t);else {let i=wi(o);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height};}return ut(n)}function ki(o,e){let t=je(o);return t===e||!we(t)||ht(t)?false:Ee(t).position==="fixed"||ki(t,e)}function As(o,e){let t=e.get(o);if(t)return t;let n=$t(o,[],false).filter(l=>we(l)&&ft(l)!=="body"),i=null,r=Ee(o).position==="fixed",s=r?je(o):o;for(;we(s)&&!ht(s);){let l=Ee(s),a=fo(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Nt(s)&&!a&&ki(o,s))?n=n.filter(p=>p!==s):i=l,s=je(s);}return e.set(o,n),n}function Rs(o){let{element:e,boundary:t,rootBoundary:n,strategy:i}=o,s=[...t==="clippingAncestors"?Zt(e)?[]:As(e,this._c):[].concat(t),n],l=bi(e,s[0],i),a=l.top,c=l.right,p=l.bottom,m=l.left;for(let u=1;u<s.length;u++){let d=bi(e,s[u],i);a=We(d.top,a),c=it(d.right,c),p=it(d.bottom,p),m=We(d.left,m);}return {width:c-m,height:p-a,x:m,y:a}}function Ms(o){let{width:e,height:t}=xi(o);return {width:e,height:t}}function Ps(o,e,t){let n=Pe(e),i=Le(e),r=t==="fixed",s=gt(o,true,r,e),l={scrollLeft:0,scrollTop:0},a=Se(0);function c(){a.x=vo(i);}if(n||!n&&!r)if((ft(e)!=="body"||Nt(i))&&(l=Jt(e)),n){let d=gt(e,true,r,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop;}else i&&c();r&&!n&&i&&c();let p=i&&!n&&!r?Ei(i,l):Se(0),m=s.left+l.scrollLeft-a.x-p.x,u=s.top+l.scrollTop-a.y-p.y;return {x:m,y:u,width:s.width,height:s.height}}function Yo(o){return Ee(o).position==="static"}function yi(o,e){if(!Pe(o)||Ee(o).position==="fixed")return null;if(e)return e(o);let t=o.offsetParent;return Le(o)===t&&(t=t.ownerDocument.body),t}function Ci(o,e){let t=ve(o);if(Zt(o))return t;if(!Pe(o)){let i=je(o);for(;i&&!ht(i);){if(we(i)&&!Yo(i))return i;i=je(i);}return t}let n=yi(o,e);for(;n&&fi(n)&&Yo(n);)n=yi(n,e);return n&&ht(n)&&Yo(n)&&!fo(n)?t:n||hi(o)||t}var Is=async function(o){let e=this.getOffsetParent||Ci,t=this.getDimensions,n=await t(o.floating);return {reference:Ps(o.reference,await e(o.floating),o.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function $s(o){return Ee(o).direction==="rtl"}var Ns={convertOffsetParentRelativeRectToViewportRelativeRect:ks,getDocumentElement:Le,getClippingRect:Rs,getOffsetParent:Ci,getElementRects:Is,getClientRects:Cs,getDimensions:Ms,getScale:Bt,isElement:we,isRTL:$s};function Si(o,e){return o.x===e.x&&o.y===e.y&&o.width===e.width&&o.height===e.height}function Bs(o,e){let t=null,n,i=Le(o);function r(){var l;clearTimeout(n),(l=t)==null||l.disconnect(),t=null;}function s(l,a){l===void 0&&(l=false),a===void 0&&(a=1),r();let c=o.getBoundingClientRect(),{left:p,top:m,width:u,height:d}=c;if(l||e(),!u||!d)return;let f=Yt(m),h=Yt(i.clientWidth-(p+u)),v=Yt(i.clientHeight-(m+d)),y=Yt(p),T={rootMargin:-f+"px "+-h+"px "+-v+"px "+-y+"px",threshold:We(0,it(1,a))||1},b=true;function C(R){let k=R[0].intersectionRatio;if(k!==a){if(!b)return s();k?s(false,k):n=setTimeout(()=>{s(false,1e-7);},1e3);}k===1&&!Si(c,o.getBoundingClientRect())&&s(),b=false;}try{t=new IntersectionObserver(C,{...T,root:i.ownerDocument});}catch{t=new IntersectionObserver(C,T);}t.observe(o);}return s(true),r}function Jo(o,e,t,n){n===void 0&&(n={});let{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=false}=n,c=Zo(o),p=i||r?[...c?$t(c):[],...e?$t(e):[]]:[];p.forEach(y=>{i&&y.addEventListener("scroll",t,{passive:true}),r&&y.addEventListener("resize",t);});let m=c&&l?Bs(c,t):null,u=-1,d=null;s&&(d=new ResizeObserver(y=>{let[E]=y;E&&E.target===c&&d&&e&&(d.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var T;(T=d)==null||T.observe(e);})),t();}),c&&!a&&d.observe(c),e&&d.observe(e));let f,h=a?gt(o):null;a&&v();function v(){let y=gt(o);h&&!Si(h,y)&&t(),h=y,f=requestAnimationFrame(v);}return t(),()=>{var y;p.forEach(E=>{i&&E.removeEventListener("scroll",t),r&&E.removeEventListener("resize",t);}),m?.(),(y=d)==null||y.disconnect(),d=null,a&&cancelAnimationFrame(f);}}var Ie=di;var $e=pi,Ne=ci;var st=li;var Be=(o,e,t)=>{let n=new Map,i={platform:Ns,...t},r={...i.platform,_c:n};return ai(o,e,{...i,platform:r})};var Hs={"--veo-bg":"#1f2937","--veo-text":"#f9fafb","--veo-text-secondary":"#d1d5db","--veo-shadow":"0 20px 60px rgba(0, 0, 0, 0.55)"},en={left:"flex-start",center:"center",right:"flex-end"},Ds={left:"flex-start",center:"center",right:"flex-end"},_s={title:"text",text:"text",image:"self"},Li={none:"none",soft:"0 4px 14px rgba(0, 0, 0, 0.10)",medium:"0 8px 30px rgba(0, 0, 0, 0.18)",strong:"0 24px 60px rgba(0, 0, 0, 0.32)"},Ti={center:[.5,.5],top:[.5,0],bottom:[.5,1],left:[0,.5],right:[1,.5],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},He=/^#[0-9a-f]{3,8}$|^(rgb|rgba|hsl|hsla)\([\d.,%/\sdeg]+\)$|^[a-z]{3,20}$/i;function he(o,e,t){return Math.min(t,Math.max(e,o))}function Ai(o,e){if(!e||typeof e!="object")return;let t=e;if(typeof t.accentColor=="string"&&He.test(t.accentColor.trim())&&o.style.setProperty("--veo-primary",t.accentColor.trim()),typeof t.fontFamily=="string"&&t.fontFamily.length<=200&&!/[<>{}]/.test(t.fontFamily)&&o.style.setProperty("--veo-font",t.fontFamily.trim()),t.theme==="dark")for(let[r,s]of Object.entries(Hs))o.style.setProperty(r,s);typeof t.background=="string"&&He.test(t.background.trim())&&o.style.setProperty("--veo-bg",t.background.trim()),typeof t.textColor=="string"&&He.test(t.textColor.trim())&&o.style.setProperty("--veo-text",t.textColor.trim()),typeof t.textSecondaryColor=="string"&&He.test(t.textSecondaryColor.trim())&&o.style.setProperty("--veo-text-secondary",t.textSecondaryColor.trim()),typeof t.radius=="number"&&Number.isFinite(t.radius)&&o.style.setProperty("--veo-radius",`${he(t.radius,0,48)}px`),typeof t.width=="number"&&Number.isFinite(t.width)&&o.style.setProperty("--veo-width",`${he(t.width,220,720)}px`),typeof t.height=="number"&&Number.isFinite(t.height)&&o.style.setProperty("--veo-min-h",`${he(t.height,120,900)}px`),(t.align==="left"||t.align==="center"||t.align==="right")&&o.style.setProperty("--veo-actions-justify",en[t.align]),typeof t.padding=="number"&&Number.isFinite(t.padding)&&o.style.setProperty("--veo-pad",`${he(t.padding,0,64)}px`),typeof t.margin=="number"&&Number.isFinite(t.margin)&&o.style.setProperty("--veo-margin",`${he(t.margin,0,64)}px`),typeof t.borderWidth=="number"&&Number.isFinite(t.borderWidth)&&o.style.setProperty("--veo-border-width",`${he(t.borderWidth,0,16)}px`),typeof t.borderColor=="string"&&He.test(t.borderColor.trim())&&o.style.setProperty("--veo-border-color",t.borderColor.trim()),typeof t.shadow=="string"&&Li[t.shadow]&&o.style.setProperty("--veo-shadow",Li[t.shadow]);let n,i;if(typeof t.posX=="number"&&typeof t.posY=="number"?(n=he(t.posX,0,1),i=he(t.posY,0,1)):typeof t.overlayPosition=="string"&&Ti[t.overlayPosition]&&([n,i]=Ti[t.overlayPosition]),n!==void 0&&i!==void 0&&(o.style.setProperty("--veo-pos-x",`${n*100}%`),o.style.setProperty("--veo-pos-y",`${i*100}%`)),t.elements&&typeof t.elements=="object"){let r=t.elements;Qo(o,"title",r.title),Qo(o,"text",r.text),Qo(o,"image",r.image),Os(o,r.cta);}}function Os(o,e){if(!e||typeof e!="object")return;let t=e;typeof t.align=="string"&&en[t.align]&&o.style.setProperty("--veo-actions-justify",en[t.align]),typeof t.background=="string"&&He.test(t.background.trim())&&o.style.setProperty("--veo-cta-bg",t.background.trim()),typeof t.color=="string"&&He.test(t.color.trim())&&o.style.setProperty("--veo-cta-color",t.color.trim()),typeof t.fontSize=="number"&&Number.isFinite(t.fontSize)&&o.style.setProperty("--veo-cta-size",`${he(t.fontSize,10,24)}px`),typeof t.radius=="number"&&Number.isFinite(t.radius)&&o.style.setProperty("--veo-cta-radius",`${he(t.radius,0,48)}px`);}function Qo(o,e,t){if(!t||typeof t!="object")return;let n=t;if(typeof n.align=="string"&&(n.align==="left"||n.align==="center"||n.align==="right")){let r=(_s[e]??"text")==="self"?Ds[n.align]:n.align;o.style.setProperty(`--veo-${e}-align`,r);}typeof n.color=="string"&&He.test(n.color.trim())&&o.style.setProperty(`--veo-${e}-color`,n.color.trim()),typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&o.style.setProperty(`--veo-${e}-size`,`${he(n.fontSize,8,72)}px`),typeof n.width=="number"&&Number.isFinite(n.width)&&o.style.setProperty(`--veo-${e}-width`,`${he(n.width,10,100)}%`),typeof n.radius=="number"&&Number.isFinite(n.radius)&&o.style.setProperty(`--veo-${e}-radius`,`${he(n.radius,0,48)}px`),typeof n.marginTop=="number"&&Number.isFinite(n.marginTop)&&o.style.setProperty(`--veo-${e}-mt`,`${he(n.marginTop,0,64)}px`),typeof n.marginBottom=="number"&&Number.isFinite(n.marginBottom)&&o.style.setProperty(`--veo-${e}-mb`,`${he(n.marginBottom,0,64)}px`);}function De(o){let e=o?.inlinePosition;return e==="before"||e==="prepend"||e==="append"?e:"after"}function be(o,e,t){switch(t){case "before":o.before(e);break;case "after":o.after(e);break;case "prepend":o.prepend(e);break;case "append":o.append(e);break}}function xe(o,e,t){let n=window.setInterval(()=>{if(o.isConnected)return;let i=document.querySelector(e);i&&be(i,o,t);},1e3);return ()=>window.clearInterval(n)}function le(o,e=5e3){return new Promise(t=>{let n=()=>{try{return document.querySelector(o)}catch{return null}},i=n();if(i){t(i);return}let r=false,s=c=>{r||(r=true,l.disconnect(),clearTimeout(a),t(c));},l=new MutationObserver(()=>{let c=n();c&&s(c);});l.observe(document.body,{childList:true,subtree:true});let a=setTimeout(()=>s(null),e);})}var Qt=`
|
|
5
5
|
:host {
|
|
6
6
|
--veo-primary: #FF5B35;
|
|
7
7
|
--veo-text: #1f2937;
|
|
@@ -707,7 +707,7 @@ ${o}
|
|
|
707
707
|
from { transform: translateY(-10px); opacity: 0; }
|
|
708
708
|
to { transform: translateY(0); opacity: 1; }
|
|
709
709
|
}
|
|
710
|
-
`;var ee=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(jn,"");let t=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=ho,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&&Li(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 _s={top:"bottom",bottom:"top",left:"right",right:"left"},Os={top:["top","left"],right:["top","right"],bottom:["bottom","right"],left:["bottom","left"]};function at(o,e,t){let n=_s[e.split("-")[0]??"bottom"]??"top";for(let r of ["top","bottom","left","right"])o.style.setProperty(r,"");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");let i=o.dataset.veoBorder;if(i){for(let r of ["top","right","bottom","left"])o.style.setProperty(`border-${r}-width`,Os[n].includes(r)?`${i}px`:"0");o.style.zIndex="1";}}var zs=150,vo=class extends ee{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 le(i);if(!r)return;let{host:s,root:l}=this.createHost(),a=l.ownerDocument??document;this.applyDesign(n.style);let c=n.style?.width;typeof c=="number"&&Number.isFinite(c)&&s.style.setProperty("--veo-badge-tip-width",`${Math.min(720,Math.max(220,c))}px`),this.trigger=n.style?.badgeTrigger==="click"?"click":"hover";let p=n.style?.tooltipPlacement;this.side=p==="bottom"||p==="left"||p==="right"?p:"top";let m=De(n.style);s.style.display="inline-flex",s.style.verticalAlign="middle";let u=Ai(Ti(n),a);l.appendChild(u),this.badgeBtn=u,be(r,s,m),this.registerCleanup(xe(s,i,m));let d=a.createElement("div");d.className="veo-tooltip veo-badge-tooltip",d.style.display="none";let f=(b,C)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:b,...C?{metadata:C}:{}});},g=b=>he(b,a,{onCtaClick:(C,R,E)=>{f("cta_clicked",E),C==="url"&&R&&window.open(R,"_blank","noopener,noreferrer"),this.closeTooltip(),C==="guide"&&R&&t.onOpenGuide?.(R);},onDismiss:()=>this.closeTooltip()}),v=g(n);d.appendChild(v);let y=a.createElement("div");y.className="veo-tooltip-arrow",d.appendChild(y),l.appendChild(d),this.tooltip=d,this.arrowEl=y,this.liveContainer=d,this.liveContent=v,this.liveKey=this.liveKeyOf(n),this.liveBuild=g;let k=()=>{this.cancelClose(),this.open||(this.openTooltip(u),this.shownEmitted||(this.shownEmitted=true,f("shown")));};if(this.trigger==="hover"){let b=()=>{this.cancelClose(),this.closeTimer=window.setTimeout(()=>this.closeTooltip(),zs);};u.addEventListener("mouseenter",k),u.addEventListener("focus",k),u.addEventListener("mouseleave",b),u.addEventListener("blur",b),d.addEventListener("mouseenter",()=>this.cancelClose()),d.addEventListener("mouseleave",b);}else {u.addEventListener("click",()=>{this.open?this.closeTooltip():k();});let b=C=>{this.open&&(C.composedPath().includes(s)||this.closeTooltip());};document.addEventListener("click",b,true),this.registerCleanup(()=>document.removeEventListener("click",b,true));}let L=b=>{b.key==="Escape"&&this.open&&this.closeTooltip();};document.addEventListener("keydown",L),this.registerCleanup(()=>document.removeEventListener("keydown",L)),t.isPreview&&k();}liveKeyOf(t){let n=t.selector??"",i=De(t.style),r=t.style?.badgeTrigger==="click"?"click":"hover";return `${n}|${i}|${r}`}onLiveUpdate(t){if(this.badgeBtn){let i=this.badgeBtn.ownerDocument,r=Ai(Ti(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:l,middlewareData:a}=await Ne(t,n,{strategy:"fixed",placement:this.side,middleware:[Ie(8),Be(),$e({padding:8}),st({element:i})]});n.style.left=`${r}px`,n.style.top=`${s}px`,at(i,l,a.arrow);}};function Ti(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"&&He.test(t.color.trim())?t.color.trim():null,size:typeof t.size=="number"&&Number.isFinite(t.size)?t.size:null}}function Jt(o,e,t){return Math.min(t,Math.max(e,o))}function Ai(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=Jt(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=`${Jt(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=`${Jt(Math.round(n*.7),9,28)}px`,o.color&&(t.style.color=o.color);break}case "image":{if(o.imageUrl&&fe(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=`${Jt(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=`${Jt(Math.round(n*.62),8,32)}px`,o.color&&(t.style.color=o.color);break}}return t}function Nt(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 l=n.createElement("div");l.className="veo-walkthrough-progress";for(let f=0;f<t;f++){let g=n.createElement("span");g.className="veo-walkthrough-progress-dot",f<e&&g.classList.add("completed"),f===e&&g.classList.add("active"),l.appendChild(g);}r.appendChild(l);for(let f of Xn(o,n))r.appendChild(f);let a=n.createElement("div");a.className="veo-walkthrough-actions";let c=n.createElement("button");c.type="button",c.className="veo-walkthrough-skip",c.textContent="Omitir",c.addEventListener("click",()=>i.onSkip()),a.appendChild(c);let p=n.createElement("div");if(p.className="veo-walkthrough-actions-right",e>0){let f=n.createElement("button");f.type="button",f.className="veo-walkthrough-btn-secondary",f.textContent="Atr\xE1s",f.addEventListener("click",()=>i.onBack()),p.appendChild(f);}let m=e===t-1,u=n.createElement("button");u.type="button",u.className="veo-guide-cta";let d=m?"Finalizar":"Siguiente";return u.textContent=typeof o.ctaText=="string"&&o.ctaText?o.ctaText:d,u.addEventListener("click",()=>{m?i.onComplete():i.onNext();}),p.appendChild(u),a.appendChild(p),r.appendChild(a),r.appendChild(ut(n,()=>i.onSkip())),r}var Qt=class extends ee{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 le(r),!s))return;let{host:l,root:a}=this.createHost();this.applyDesign(n.style);let c=a.ownerDocument??document,p=c.createElement("div");p.className=Ri(i,!!s);let m=(d,f,g)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:t,action:d,...g?{metadata:g}:{}}),f&&window.open(f,"_blank","noopener,noreferrer"),e.onClose();},u=e.nav?Nt(n,e.nav.stepIndex,e.nav.totalSteps,c,e.nav.callbacks):he(n,c,{onCtaClick:(d,f,g)=>{m("cta_clicked",d==="url"?f:void 0,g),d==="guide"&&f&&e.onOpenGuide?.(f);},onDismiss:()=>m("dismissed")});if(p.appendChild(u),a.appendChild(p),r&&s){l.style.display="block";let d=i==="top"?"prepend":"append";be(s,l,d),this.registerCleanup(xe(l,r,d));}e.nav||(this.liveContainer=p,this.liveContent=u,this.liveBuild=d=>he(d,c,{onCtaClick:(f,g,v)=>{m("cta_clicked",f==="url"?g:void 0,v),f==="guide"&&g&&e.onOpenGuide?.(g);},onDismiss:()=>m("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=Ri(t,n);}}};function Ri(o,e){return e?"veo-banner veo-banner-embedded":`veo-banner veo-banner-${o}`}var Ve={iconEmptyColor:"#e7e2de",iconFillColor:"#406a31",barColor:"#406a31",barHeight:8,fontSize:14,fontWeight:600,titleColor:"#2c2825",subtitleColor:"#8a8582",subtitleTemplate:"Completado <%= currentStep %> de <%= totalSteps %> pasos"},Mi={regular:400,medium:500,semibold:600,bold:700};function Gs(o){let e=o??{},t=(l,a)=>typeof e[l]=="string"&&e[l].trim()?e[l]:a,n=(l,a,c,p)=>typeof e[l]=="number"&&Number.isFinite(e[l])?Math.min(p,Math.max(c,e[l])):a,i=e.fontWeight,r=typeof i=="number"?Math.min(900,Math.max(100,i)):typeof i=="string"&&Mi[i.toLowerCase()]?Mi[i.toLowerCase()]:Ve.fontWeight,s=e.colorMode==="dark";return {colorMode:s?"dark":"light",iconEmptyColor:t("iconEmptyColor",s?"#3c3734":Ve.iconEmptyColor),iconFillColor:t("iconFillColor",Ve.iconFillColor),barColor:t("barColor",Ve.barColor),barHeight:n("barHeight",Ve.barHeight,2,40),fontSize:n("fontSize",Ve.fontSize,10,40),fontWeight:r,titleColor:t("titleColor",s?"#f5efeb":Ve.titleColor),subtitleColor:t("subtitleColor",s?"#b0a9a5":Ve.subtitleColor),subtitleTemplate:t("subtitleTemplate",Ve.subtitleTemplate)}}function Fs(o,e){return o.replace(/<%=\s*currentStep\s*%>/g,String(e.currentStep)).replace(/<%=\s*totalSteps\s*%>/g,String(e.totalSteps))}var en=10,Pi=2*Math.PI*en;function Ws(o,e,t,n){let i="http://www.w3.org/2000/svg",r=o.createElementNS(i,"svg");r.setAttribute("viewBox","0 0 28 28"),r.setAttribute("class","veo-checklist-ring"),r.setAttribute("aria-hidden","true");let s=o.createElementNS(i,"circle");if(s.setAttribute("cx","14"),s.setAttribute("cy","14"),s.setAttribute("r",String(en)),s.setAttribute("fill",t?n.iconFillColor:"none"),s.setAttribute("stroke",n.iconEmptyColor),s.setAttribute("stroke-width","4.5"),r.appendChild(s),t){let a=o.createElementNS(i,"path");return a.setAttribute("d","M9 14.5l3.2 3.2L19 11"),a.setAttribute("fill","none"),a.setAttribute("stroke","#fff"),a.setAttribute("stroke-width","2.4"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),r.appendChild(a),r}let l=Math.max(0,Math.min(1,e));if(l>0){let a=o.createElementNS(i,"circle");a.setAttribute("cx","14"),a.setAttribute("cy","14"),a.setAttribute("r",String(en)),a.setAttribute("fill","none"),a.setAttribute("stroke",n.iconFillColor),a.setAttribute("stroke-width","4.5"),a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-dasharray",`${(Pi*l).toFixed(2)} ${Pi.toFixed(2)}`),a.setAttribute("transform","rotate(-90 14 14)"),r.appendChild(a);}return r}function Ii(o,e,t){let n=Gs(o.style),i=(o.items??[]).filter(f=>f&&typeof f.guideId=="string"&&f.guideId),r=e.createElement("div");if(r.className=`veo-checklist${n.colorMode==="dark"?" veo-checklist--dark":""}`,r.style.setProperty("--veo-cl-font-size",`${n.fontSize}px`),r.style.setProperty("--veo-cl-font-weight",String(n.fontWeight)),r.style.setProperty("--veo-cl-title",n.titleColor),r.style.setProperty("--veo-cl-subtitle",n.subtitleColor),r.style.setProperty("--veo-cl-bar",n.barColor),r.style.setProperty("--veo-cl-bar-h",`${n.barHeight}px`),typeof o.html=="string"&&o.html||typeof o.text=="string"&&o.text){let f=e.createElement("div");f.className="veo-checklist-title",typeof o.html=="string"&&o.html?f.appendChild(Lt(o.html,e)):f.textContent=o.text,r.appendChild(f);}let s=e.createElement("div");s.className="veo-checklist-items",s.setAttribute("role","list"),r.appendChild(s);let l=e.createElement("div");l.className="veo-checklist-footer";let a=e.createElement("div");a.className="veo-checklist-summary";let c=e.createElement("span");c.className="veo-checklist-count";let p=e.createElement("span");p.className="veo-checklist-percent",a.append(c,p);let m=e.createElement("div");m.className="veo-checklist-bar";let u=e.createElement("div");u.className="veo-checklist-bar-fill",m.appendChild(u),l.append(a,m),r.appendChild(l);let d=f=>{s.textContent="";let g=f?i.filter(L=>f.has(L.guideId)):i,v=0;for(let L of g){let b=f?.get(L.guideId)??null;b?.completed&&v++;let C=e.createElement("button");C.type="button",C.className=`veo-checklist-item${b?.completed?" veo-checklist-item--done":""}`,C.setAttribute("role","listitem");let R=b&&b.totalSteps>0?b.currentStep/b.totalSteps:0;C.appendChild(Ws(e,R,b?.completed===true,n));let E=e.createElement("span");E.className="veo-checklist-texts";let P=e.createElement("span");if(P.className="veo-checklist-label",P.textContent=(L.text??"").trim()||b?.guideName||"Gu\xEDa",b&&b.published===false&&(C.title="Gu\xEDa no publicada: los usuarios no la ver\xE1n"),E.appendChild(P),b){let I=e.createElement("span");I.className="veo-checklist-sub",I.textContent=Fs(n.subtitleTemplate,b),E.appendChild(I);}C.appendChild(E),C.addEventListener("click",I=>{if(I.preventDefault(),I.stopPropagation(),t.isPreview)return;let Y=b&&!b.completed?Math.min(b.currentStep,b.totalSteps-1):0;t.onOpenGuideAt?t.onOpenGuideAt(L.guideId,Y):t.onOpenGuide?.(L.guideId);}),s.appendChild(C);}let y=g.length,k=y>0?Math.round(v/y*100):0;c.textContent=`${v} de ${y} ${y===1?"completada":"completadas"}`,p.textContent=`${k}%`,u.style.width=`${k}%`,l.hidden=y===0;};if(t.isPreview&&i.length===0){let f=new Map([["__sample_1",{guideId:"__sample_1",guideName:"Configura tu primer env\xEDo",totalSteps:2,currentStep:1,completed:false}],["__sample_2",{guideId:"__sample_2",guideName:"Conecta tu tienda",totalSteps:2,currentStep:2,completed:true}]]);i.push({guideId:"__sample_1",text:"Configura tu primer env\xEDo"},{guideId:"__sample_2",text:"Conecta tu tienda"}),d(f);let g=e.createElement("p");return g.className="veo-checklist-empty",g.textContent="Ejemplo: agrega gu\xEDas a la lista desde Opciones.",r.appendChild(g),r}return d(null),t.fetchProgress&&i.length>0&&t.fetchProgress(i.map(f=>f.guideId)).then(f=>d(new Map(f.map(g=>[g.guideId,g])))).catch(()=>{}),r}function bo(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 u=t.createElement("h2");u.className="veo-guide-title",u.textContent=n.title,s.appendChild(u);}if(n.content){let u=t.createElement("p");u.className="veo-guide-text",u.textContent=n.content,s.appendChild(u);}let l=[],a=t.createElement("form");a.className="veo-form",a.noValidate=true;for(let u of i){let{wrapper:d,read:f}=tn(u,t);l.push({field:u,read:f}),a.appendChild(d);}let c=t.createElement("p");c.className="veo-form-error",c.style.display="none",a.appendChild(c);let p=t.createElement("div");p.className="veo-guide-actions";let m=t.createElement("button");m.type="submit",m.className="veo-guide-cta",m.textContent=n.ctaText||"Enviar",p.appendChild(m),a.appendChild(p),a.addEventListener("submit",u=>{u.preventDefault(),c.style.display="none";let d={};for(let{field:g,read:v}of l){let y=v();if(y==null||y===""){if(g.required){c.textContent=`Completa "${g.label}"`,c.style.display="block";return}continue}d[g.key]=y;}if(Object.keys(d).length===0){c.textContent="Responde al menos un campo",c.style.display="block";return}m.disabled=true,(e.onFormSubmit??(()=>Promise.resolve(true)))(d).then(g=>{if(!g){m.disabled=false,c.textContent="No se pudo enviar. Prueba de nuevo.",c.style.display="block";return}e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"completed"});let v=e.isPreview?e.previewNote??"Vista previa: la respuesta NO se guard\xF3.":null;Us(o,t,v),window.setTimeout(()=>e.onClose(),v?2200:1400);});}),s.appendChild(a),s.appendChild(ut(t,r)),o.appendChild(s);}function Us(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 tn(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 l=e.createElement("option");l.value=s,l.textContent=s,i.appendChild(l);}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 l of o.options??[]){let a=e.createElement("label");a.className="veo-form-option";let c=e.createElement("input");c.type="radio",c.name=r,c.value=l,s.push(c);let p=e.createElement("span");p.textContent=l,a.appendChild(c),a.appendChild(p),i.appendChild(a);}return t.appendChild(i),{wrapper:t,read:()=>s.find(l=>l.checked)?.value}}case "multiselect":{let i=e.createElement("div");i.className="veo-form-options";let r=[];for(let s of o.options??[]){let l=e.createElement("label");l.className="veo-form-option";let a=e.createElement("input");a.type="checkbox",a.value=s,r.push(a);let c=e.createElement("span");c.textContent=s,l.appendChild(a),l.appendChild(c),i.appendChild(l);}return t.appendChild(i),{wrapper:t,read:()=>{let s=r.filter(l=>l.checked).map(l=>l.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,l]=o.options?.length===2?o.options:["S\xED","No"],a=[];for(let{label:c,value:p}of [{label:s,value:true},{label:l,value:false}]){let m=e.createElement("label");m.className="veo-form-option";let u=e.createElement("input");u.type="radio",u.name=r,a.push({input:u,value:p});let d=e.createElement("span");d.textContent=c,m.appendChild(u),m.appendChild(d),i.appendChild(m);}return t.appendChild(i),{wrapper:t,read:()=>a.find(c=>c.input.checked)?.value}}case "nps":{let i=typeof o.min=="number"?o.min:0,r=typeof o.max=="number"&&o.max>i?o.max:10;return $i(t,e,i,r,"veo-nps-btn",void 0,{labels:o.scaleLabels??[],showLabels:o.showLabels!==false})}case "rating":return $i(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 $i(o,e,t,n,i,r,s={labels:[],showLabels:false}){let l=e.createElement("div");l.className="veo-form-scale";let a,c=[],p=u=>s.labels[u-t]?.trim()??"",m=s.showLabels&&Array.from({length:n-t+1},(u,d)=>t+d).some(u=>p(u));for(let u=t;u<=n;u++){let d=e.createElement("button");d.type="button",d.className=i,d.textContent=r??String(u);let f=p(u);if(d.setAttribute("aria-label",f?`${u} \xB7 ${f}`:String(u)),f&&(d.title=f),d.addEventListener("click",()=>{a=u,c.forEach((y,k)=>{let L=r?k+t<=u:k+t===u;y.classList.toggle("veo-scale-active",L);});}),c.push(d),!m){l.appendChild(d);continue}let g=e.createElement("div");g.className=`veo-scale-item${u===t?" veo-scale-item--first":u===n?" veo-scale-item--last":""}`;let v=e.createElement("span");v.className="veo-scale-label",v.textContent=f,g.append(d,v),l.appendChild(g);}return o.appendChild(l),{wrapper:o,read:()=>a}}var js="workspace",Bi={soft:{y:4,blur:14,alpha:.12},medium:{y:12,blur:32,alpha:.22},strong:{y:24,blur:64,alpha:.38}},nn={left:"flex-start",center:"center",right:"flex-end",distribute:"space-between"};function rn(o){let e=o.replace("#",""),t=e.length===3?[...e].map(i=>i+i).join(""):e.slice(0,6),n=i=>Number.parseInt(t.slice(i,i+2),16)||0;return [n(0),n(2),n(4)]}function Vs(o,e){if(o==="none")return "none";let t=Bi[o],[n,i,r]=rn(e);return `0 ${t.y}px ${t.blur}px rgba(${n}, ${i}, ${r}, ${t.alpha})`}function qs(o){let[e,t,n]=rn(o);return (.2126*e+.7152*t+.0722*n)/255>.6?"#111827":"#ffffff"}function Ni(o,e){return !o||e.theme!==js?null:(e.colorMode==="dark"?o.dark:o.light)??null}function Hi(o,e,t){if((e?o.embedded:o.overlay).align==="distribute")return null;let i=t==="secondary"?o.buttons?.secondary:t==="link"?o.buttons?.tertiary:t==null||t==="primary"?o.buttons?.primary:void 0;return i?nn[i.align]??null:null}function on(o,e){let t=e.defaultView;if(!t)return null;if(o==="inherit")return t.getComputedStyle(e.body).fontFamily||null;if(o==="app-heading"){let n=Array.from(e.querySelectorAll("h1,h2,h3")).find(i=>i.getClientRects().length>0);return t.getComputedStyle(n??e.body).fontFamily||null}return o}function Di(o,e,t=false){let n=e?o.embedded:o.overlay,i=t?o.tooltip:void 0,r=i?.padding??n.padding,s={background:i?i.background:e?"transparent":n.background??o.colors.background,color:o.colors.text,paddingTop:r.top,paddingRight:r.right,paddingBottom:r.bottom,paddingLeft:r.left,borderColor:i?.borderColor??n.borderColor,borderWidth:i?.borderWidth??n.borderWidth,radius:i?.borderRadius??n.borderRadius},l=i?.shadow??n.shadow,a=i?.shadowColor??n.shadowColor;if(l==="none")Object.assign(s,{shadowColor:"transparent",shadowBlur:0});else {let c=Bi[l],[p,m,u]=rn(a);Object.assign(s,{shadowX:0,shadowY:c.y,shadowBlur:c.blur,shadowSpread:0,shadowColor:`rgba(${p}, ${m}, ${u}, ${c.alpha})`});}return s}function _i(o,e,t,n=false){let i=o.ownerDocument??document,r=t?e.embedded:e.overlay,s=(u,d)=>{d&&o.style.setProperty(u,d);};o.classList.add("veo-card--themed"),s("--veo-primary",e.colors.accent),s("--veo-cta-color",qs(e.colors.accent));let l=e.buttons?.primary,a=(u,d)=>{if(!d)return;let f=d.padding;s(`${u}-bg`,d.background),s(`${u}-color`,d.color),s(`${u}-pad`,`${f.top}px ${f.right}px ${f.bottom}px ${f.left}px`),s(`${u}-size`,`${d.fontSize}px`),s(`${u}-weight`,String(d.fontWeight)),s(`${u}-radius`,`${d.borderRadius}px`),s(`${u}-border`,d.borderWidth>0?`${d.borderWidth}px solid ${d.borderColor}`:"none");};a("--veo-cta",l),a("--veo-cta2",e.buttons?.secondary),a("--veo-cta3",e.buttons?.tertiary),s("--veo-text",e.colors.text),s("--veo-text-secondary",e.colors.textMuted),s("--veo-font",on("inherit",i)),s("--veo-actions-justify",r.align==="distribute"||!l?nn[r.align]:nn[l.align]);let c=e.form;if(c){o.classList.add("veo-card--themed-form");let u=c.padding;s("--veo-f-bg",c.background),s("--veo-f-accent",c.accent),s("--veo-f-on-accent",c.onAccent),s("--veo-f-pad",`${u.top}px ${u.right}px ${u.bottom}px ${u.left}px`),typeof c.borderWidth=="number"&&c.borderColor&&s("--veo-f-border",c.borderWidth>0?`${c.borderWidth}px solid ${c.borderColor}`:"none"),typeof c.borderRadius=="number"&&s("--veo-f-radius",`${c.borderRadius}px`),c.shadow&&c.shadowColor&&s("--veo-f-shadow",Vs(c.shadow,c.shadowColor));for(let[d,f]of [["primary",c.text.primary],["secondary",c.text.secondary]])s(`--veo-f-${d}-color`,f.color),s(`--veo-f-${d}-size`,`${f.fontSize}px`),s(`--veo-f-${d}-weight`,String(f.fontWeight)),s(`--veo-f-${d}-align`,f.align),s(`--veo-f-${d}-font`,on(f.fontFamily,i));}let p=n?e.tooltip?.text:void 0,m=[["title",p?.primary??e.text.title],["subtitle",p?.secondary??e.text.subtitle],["paragraph",p?.secondary??e.text.paragraph]];for(let[u,d]of m)s(`--veo-t-${u}-color`,d.color),s(`--veo-t-${u}-size`,`${d.fontSize}px`),s(`--veo-t-${u}-weight`,String(d.fontWeight)),s(`--veo-t-${u}-align`,d.align),s(`--veo-t-${u}-font`,on(d.fontFamily,i));}function eo(o){let e=new Map,t=[],n=-1;return o.forEach((i,r)=>{if(!i)return;let s;typeof i.row=="number"&&Number.isFinite(i.row)?(s=i.row,n=s):(s=n+.5,n=s);let l=typeof i.col=="number"&&Number.isFinite(i.col)?i.col:0,a=e.get(s);a||(a={row:s,columns:[]},e.set(s,a),t.push(s));let c=a.columns.find(p=>p.col===l);c||(c={col:l,blocks:[]},a.columns.push(c)),c.blocks.push({block:i,index:r});}),t.sort((i,r)=>i-r).map(i=>{let r=e.get(i);return r.columns.sort((s,l)=>s.col-l.col),r})}var yo=new WeakMap;function yt(o=document){let e=o.documentElement,t=o.body;if(!e||!t)return ()=>{};let n=yo.get(o);if(!n){n={count:0,html:{overflow:e.style.overflow,paddingRight:e.style.paddingRight},body:{overflow:t.style.overflow,paddingRight:t.style.paddingRight}},yo.set(o,n);let r=o.defaultView,s=r?Math.max(0,r.innerWidth-e.clientWidth):0;s>0&&(t.style.paddingRight=`${s}px`),e.style.overflow="hidden",t.style.overflow="hidden";}n.count+=1;let i=false;return ()=>{if(i)return;i=true;let r=yo.get(o);r&&(r.count-=1,!(r.count>0)&&(yo.delete(o),e.style.overflow=r.html.overflow,e.style.paddingRight=r.html.paddingRight,t.style.overflow=r.body.overflow,t.style.paddingRight=r.body.paddingRight));}}var Ks=o=>`veo:snooze:${o}`,Oi={hour:36e5,day:864e5,week:6048e5};function Xs(o,e){return (Number.isFinite(o)&&o>0?Math.floor(o):1)*(Oi[e]??Oi.day)}function zi(o,e,t,n=Date.now()){try{localStorage.setItem(Ks(o),String(n+Xs(e,t)));}catch{}}var Gi="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021",Fi="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75",Wi="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",sn="M21 12a9 9 0 11-18 0 9 9 0 0118 0z",Ys="M7.5 3.75H6A2.25 2.25 0 0 0 3.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0 1 20.25 6v1.5m0 9V18A2.25 2.25 0 0 1 18 20.25h-1.5m-9 0H6A2.25 2.25 0 0 1 3.75 18v-1.5M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z",an={info:{paths:[sn,Gi],dots:[[12,8.25]]},exclamation:{paths:[sn,"M12 8v4.5"],dots:[[12,15.75]]},question:{paths:[sn,Fi],dots:[[12,17.25]]},star:{paths:[Wi]},"info-solid":{paths:[Gi],dots:[[12,8.25]],solid:true,scale:.8},"exclamation-solid":{paths:["M12 8v4.5"],dots:[[12,15.75]],solid:true,scale:.8},"question-solid":{paths:[Fi],dots:[[12,17.25]],solid:true,scale:.8},"star-solid":{paths:[Wi],solid:true,scale:.55},"target-solid":{paths:[Ys],solid:true,scale:.6},new:{paths:[],text:"New"}},Zs=14,Js=19e3,Ui=8;function lt(o,e){return typeof o=="number"&&Number.isFinite(o)?o:e}function ji(o,e,t,n){let i=an[e]??an.info;if(i.text){let c=o.createElement("span");return c.textContent=i.text,c.style.font=`700 ${Math.round(t*.85)}px/1 system-ui, -apple-system, sans-serif`,c.style.color=n,c}let r="http://www.w3.org/2000/svg",s=o.createElementNS(r,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("width",String(t)),s.setAttribute("height",String(t)),s.setAttribute("fill","none"),s.setAttribute("aria-hidden","true");let l=i.solid?"#ffffff":n;if(i.solid){let c=o.createElementNS(r,"circle");c.setAttribute("cx","12"),c.setAttribute("cy","12"),c.setAttribute("r","12"),c.setAttribute("fill",n),s.appendChild(c);}let a=o.createElementNS(r,"g");if(a.setAttribute("stroke",l),a.setAttribute("stroke-width",i.solid?"2":"1.8"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),i.scale&&i.scale!==1){let c=i.scale,p=12-12*c;a.setAttribute("transform",`translate(${p} ${p}) scale(${c})`);}for(let c of i.paths){let p=o.createElementNS(r,"path");p.setAttribute("d",c),a.appendChild(p);}for(let[c,p]of i.dots??[]){let m=o.createElementNS(r,"circle");m.setAttribute("cx",String(c)),m.setAttribute("cy",String(p)),m.setAttribute("r","0.9"),m.setAttribute("fill",l),m.setAttribute("stroke","none"),a.appendChild(m);}return s.appendChild(a),s}function qi(o,e){let t=lt(e.size,Zs),n=e.color||"#000000",i=o.createElement("span");if(i.className=`veo-badge-marker veo-badge-marker-${e.kind}`,i.style.display="inline-flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.boxSizing="border-box",i.style.lineHeight="1",e.kind==="image"){let r=o.createElement("img");return r.alt="",r.src=e.imageUrl||"",r.style.width=`${t}px`,r.style.height=`${t}px`,r.style.objectFit="contain",r.style.display="block",i.appendChild(r),i}if(e.kind==="icon-text"){i.style.gap="6px",i.style.color=n,i.style.fontSize=`${t}px`,i.style.fontFamily="inherit",i.style.fontWeight="600",i.style.whiteSpace="nowrap",i.style.background=e.bgColor||"transparent";let r=lt(e.borderWidth,0);r>0&&(i.style.border=`${r}px solid ${e.borderColor||n}`),i.style.padding=`${lt(e.paddingY,6)}px ${lt(e.paddingX,10)}px`,i.style.borderRadius=`${lt(e.radius,999)}px`,e.showIcon!==false&&i.appendChild(ji(o,e.icon||"star",t,n));let s=o.createElement("span");return s.textContent=e.text||"",i.appendChild(s),i}return i.style.width=`${t}px`,i.style.height=`${t}px`,i.appendChild(ji(o,e.icon||"info",t,n)),i}function Vi(o,e,t,n){let i=o.left+o.width,r=o.top+o.height,s=o.top+o.height/2-e.height/2,l=o.left+o.width/2-e.width/2,a,c;switch(t){case "top-left":a=o.left-e.width/2,c=o.top-e.height/2;break;case "bottom-left":a=o.left-e.width/2,c=r-e.height/2;break;case "bottom-right":a=i-e.width/2,c=r-e.height/2;break;case "left":a=o.left-e.width-Ui,c=s;break;case "right":a=i+Ui,c=s;break;case "center":a=l,c=s;break;default:a=i-e.width/2,c=o.top-e.height/2;}return {x:a+n.x,y:c+n.y}}var Qs=new Set(["img","input","textarea","select","iframe","video","audio","canvas","br","hr","svg","object","embed"]);function ea(o){let e=o.ownerDocument.defaultView;if(!e||!(o instanceof e.HTMLElement)||Qs.has(o.tagName.toLowerCase()))return false;let t=e.getComputedStyle(o);return t.display==="contents"?false:`${t.overflow} ${t.overflowX} ${t.overflowY}`.split(/\s+/).filter(Boolean).every(i=>i==="visible")}function Ki(o,e,t){e.style.position="absolute",e.style.zIndex=String(lt(t.zIndex,Js)),e.style.margin="0";let n=t.position??"top-right",i={x:lt(t.offsetX,0),y:lt(t.offsetY,0)},r=()=>{let a=e.getBoundingClientRect();return {width:a.width,height:a.height}};if(ea(o)){let a=o.ownerDocument.defaultView,c=o.style.position,p=a.getComputedStyle(o).position;(!p||p==="static")&&(o.style.position="relative"),o.appendChild(e);let m=g=>{g.preventDefault(),g.stopPropagation();},u=g=>g.stopPropagation();e.addEventListener("click",m),e.addEventListener("pointerdown",u),e.addEventListener("mousedown",u);let d=()=>{let{x:g,y:v}=Vi({left:-o.clientLeft,top:-o.clientTop,width:o.offsetWidth,height:o.offsetHeight},r(),n,i);e.style.left=`${Math.round(g)}px`,e.style.top=`${Math.round(v)}px`;};d();let f=Zo(o,e,d,{ancestorScroll:false,layoutShift:false});return ()=>{f(),e.removeEventListener("click",m),e.removeEventListener("pointerdown",u),e.removeEventListener("mousedown",u),e.remove(),o.style.position=c;}}o.ownerDocument.body.appendChild(e);let s=()=>{let a=o.getBoundingClientRect(),{x:c,y:p}=Vi({left:a.left+window.scrollX,top:a.top+window.scrollY,width:a.width,height:a.height},r(),n,i);e.style.left=`${Math.round(c)}px`,e.style.top=`${Math.round(p)}px`;};s();let l=Zo(o,e,s);return ()=>{l(),e.remove();}}var cn={left:"flex-start",center:"center",right:"flex-end"},Xi={...cn,distribute:"space-between"},Yi={top:"flex-start",center:"center",bottom:"flex-end"};function ta(o,e){let t=o.style;typeof e.background=="string"&&e.background&&(t.background=e.background);for(let n of ["Top","Right","Bottom","Left"]){let i=e[`padding${n}`];typeof i=="number"&&Number.isFinite(i)&&t.setProperty(`padding-${n.toLowerCase()}`,`${i}px`);let r=e[`margin${n}`];typeof r=="number"&&Number.isFinite(r)&&t.setProperty(`margin-${n.toLowerCase()}`,`${r}px`);}typeof e.minHeight=="number"&&Number.isFinite(e.minHeight)&&e.minHeight>0&&(t.minHeight=`${e.minHeight}px`),e.align&&Xi[e.align]&&(t.justifyContent=Xi[e.align],o.classList.add("veo-row--aligned")),e.valign&&Yi[e.valign]&&(t.alignItems=Yi[e.valign]);}var xo=class extends ee{constructor(){super(...arguments);this.themeRowJustify=null;}async render(t){let n=t.nav?.stepIndex??0,i=t.guide.guideSteps[n];if(!i)return;let r=i.badge?.enabled===true,s=(i.position==="relative-to-element"||i.presentation==="inline"||r)&&i.anchorSelector?.trim()||void 0,l=null;if(s&&(l=await le(s),!l))return;let a=i.blocks??[],c=a.length===1&&a[0]?.type==="code"?a[0]:void 0;if(i.presentation==="inline"&&l&&c&&!c.sandboxed){let E=l.ownerDocument??document,{cleanup:P}=jo(c,E,t,void 0,{anchor:l,pos:ln(i.inlinePosition),...t.isPreview&&c.editorId?{tagBlockId:c.editorId}:{}});this.registerCleanup(P),t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:"shown"});return}let{host:p,root:m}=this.createHost(),u=m.ownerDocument??document,d=i.design??{};typeof d.zIndex=="number"&&(p.style.zIndex=String(d.zIndex));let f=u.createElement("div");f.className="veo-card";let g=Ni(t.guide.theme,d),v=i.presentation==="inline",y=!v&&(r||i.position==="relative-to-element");g&&_i(f,g,v,y),this.themeRowJustify=g?E=>Hi(g,v,E):null;let k=g?{...Di(g,v,y),...d}:d;da(f,k),typeof d.ariaLabel=="string"&&d.ariaLabel.trim()&&(f.setAttribute("role","dialog"),f.setAttribute("aria-label",d.ariaLabel.trim()));let L=(E,P)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:E,...{}});},b=[];if(this.buildContent(f,i.blocks??[],u,t,n,b,p),a.length===0&&(f.classList.add("veo-card--empty"),t.isPreview)){let E=u.createElement("div");E.className="veo-card-empty-zone";let P=u.createElement("b");P.textContent="+";let I=u.createElement("span");I.textContent="Clic para agregar contenido",E.append(P,I),f.appendChild(E);let Y=()=>{f.classList.toggle("veo-card--narrow",f.clientWidth<ca);};if(typeof ResizeObserver<"u"){let H=new ResizeObserver(Y);H.observe(f),this.registerCleanup(()=>H.disconnect());}Y();}let C=f.lastElementChild;C&&!C.style.marginBottom&&(C.style.marginBottom="0");let R=null;if(d.closeButton!==false){let E=ut(u,()=>{if(R){R();return}L("dismissed"),this.closeOrSkip(t);}),P=typeof d.closeColor=="string"?d.closeColor:null,I=typeof d.closeHoverColor=="string"?d.closeHoverColor:null;P&&(E.style.color=P);let Y=typeof d.closePosition=="string"?d.closePosition:"top-right";sa(E,Y);for(let H of ["Top","Right","Bottom","Left"]){let J=d[`closePadding${H}`];typeof J=="number"&&E.style.setProperty(`padding-${H.toLowerCase()}`,`${J}px`);let re=d[`closeMargin${H}`];typeof re=="number"&&E.style.setProperty(`margin-${H.toLowerCase()}`,`${re}px`);}I&&(E.addEventListener("mouseenter",()=>{E.style.color=I;}),E.addEventListener("mouseleave",()=>{E.style.color=P??"";})),f.appendChild(E),ra(f,a,Y,k);}if(r&&l){R=this.renderBadgeMode(i,f,l,s,p,m,u,t,n,k);return}if(i.presentation==="inline"&&l){p.style.display="block";let E=ln(i.inlinePosition);m.appendChild(f),be(l,p,E),this.registerCleanup(xe(p,s,E));}else if(i.position==="relative-to-element"&&l){if(d.backdrop===true){let I=u.createElement("div");I.className="veo-composite-overlay veo-composite-overlay--dim",typeof d.backdropColor=="string"&&(I.style.background=d.backdropColor);let Y=typeof d.backdropZIndex=="number"?d.backdropZIndex:2e5;I.style.zIndex=String(Y),m.appendChild(I),this.registerCleanup(yt(u)),d.targetAbove===true&&this.registerCleanup(aa(l,Y+1));}let E=u.createElement("div");E.className="veo-composite-anchored";let P=d.caret===false?null:Ji(u,k);P&&E.appendChild(P),E.appendChild(f),m.appendChild(E),this.registerCleanup(await Qi(l,E,P));}else {let E=u.createElement("div");E.className="veo-composite-overlay",d.backdrop!==false&&(E.classList.add("veo-composite-overlay--dim"),typeof d.backdropColor=="string"&&(E.style.background=d.backdropColor),typeof d.backdropZIndex=="number"&&(E.style.zIndex=String(d.backdropZIndex)),E.addEventListener("click",P=>{P.target===E&&(L("dismissed"),this.closeOrSkip(t));}),this.registerCleanup(yt(u))),oa(f,i.position,d),E.appendChild(f),m.appendChild(E);}t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:"shown"});}buildContent(t,n,i,r,s,l,a){let c=f=>{r.onInteraction({guideId:r.guide.guideId,stepIndex:s,action:"cta_clicked",...f.id?{metadata:{buttonId:f.id}}:{}});},p=(f,g,v)=>(f.dataset.veoBlock=String(v),g.editorId&&(f.dataset.veoBlockId=g.editorId),f),m=(f,g)=>{if(!r.isPreview||!f.editorId)return null;let v=i.createElement("div");return v.className="veo-block-placeholder",v.textContent=g,v},u=(f,g)=>{let v=0;for(;v<g.length;){let{block:y,index:k}=g[v];if(y.type==="button"){let b=i.createElement("div");b.className="veo-guide-actions";let C,R=y.style?.preset;for(;v<g.length&&g[v]?.block.type==="button";){let{block:E,index:P}=g[v];if(!C){let I=E.style?.align;(I==="left"||I==="center"||I==="right")&&(C=I);}b.appendChild(p(this.buildButton(E,i,r,s,l,c),E,P)),v++;}if(C)b.style.justifyContent=cn[C]??"flex-end";else {let E=this.themeRowJustify?.(R);E&&(b.style.justifyContent=E);}f.appendChild(b);continue}if(y.type==="code"){let{node:b,cleanup:C}=jo(y,i,r,a),R=b??m(y,"Bloque de c\xF3digo");R&&f.appendChild(p(R,y,k)),this.registerCleanup(C),v++;continue}if(y.type==="form"){f.appendChild(p(this.buildForm(y,i,r,s,l,c),y,k)),v++;continue}if(y.type==="checklist"){let b=Ii(y,i,r);Me(b,y.style,"text"),b.style.alignSelf="stretch",b.style.width="100%",f.appendChild(p(b,y,k)),v++;continue}let L=At(y,i,{editing:r.isPreview===true})??m(y,y.type==="image"?"Imagen (sin URL)":y.type==="video"?"Video (elige proveedor y pega la URL)":"Bloque vac\xEDo");L&&f.appendChild(p(L,y,k)),v++;}},d=r.guide.guideSteps[s]?.rows;for(let f of eo(n)){let g=Number.isInteger(f.row)?d?.[String(f.row)]:void 0;if(f.columns.length===1&&!g){u(t,f.columns[0].blocks);continue}let v=i.createElement("div");v.className="veo-row",Number.isInteger(f.row)&&(v.dataset.veoRow=String(f.row));for(let y of f.columns){let k=i.createElement("div");k.className="veo-col",u(k,y.blocks),v.appendChild(k);}g&&ta(v,g),t.appendChild(v);}}buildForm(t,n,i,r,s,l){let a=n.createElement("div");a.className="veo-form";let c=t.style??{},{marginTop:p,marginBottom:m,...u}=c;for(let[v,y]of [["marginTop",p],["marginBottom",m]])typeof y=="number"&&Number.isFinite(y)&&(a.style[v]=`${y}px`);let d=null;(typeof t.html=="string"&&t.html||typeof t.text=="string"&&t.text)&&(d=n.createElement("div"),d.className="veo-form-question",typeof t.html=="string"&&t.html?d.appendChild(Lt(t.html,n)):d.textContent=t.text,Me(d,u,"text"),a.appendChild(d));let f=d?.textContent?.trim()??"",g=[];for(let v of t.fields??[]){let{wrapper:y,read:k}=tn(v,n),L=t.style??{};if(typeof L.scaleColor=="string"&&L.scaleColor&&y.style.setProperty("--veo-scale-color",L.scaleColor),typeof L.scaleSize=="number"&&L.scaleSize>=24&&L.scaleSize<=96&&y.style.setProperty("--veo-scale-size",`${L.scaleSize}px`),d&&(y.querySelector(".veo-form-label")?.remove(),f))for(let C of y.querySelectorAll("input, textarea, select"))C.setAttribute("aria-label",f);let b={field:v,read:k,blockId:t.id??null};s.push(b),g.push(b),a.appendChild(y);}if(t.submit){let v=n.createElement("div");v.className="veo-guide-actions";let y={...t.submit,type:"button"},k=y.style?.align;(k==="left"||k==="center"||k==="right")&&(v.style.justifyContent=cn[k]??"flex-end"),v.appendChild(this.buildButton(y,n,i,r,s,l,g)),a.appendChild(v);}return a}buildButton(t,n,i,r,s,l,a){let c=n.createElement("button");c.type="button",c.className="veo-guide-cta",c.textContent=t.text?.trim()||"OK";let p=t.style??{};(p.preset==="secondary"||p.preset==="link")&&c.classList.add(`veo-guide-cta--${p.preset}`),typeof p.ariaLabel=="string"&&p.ariaLabel.trim()&&c.setAttribute("aria-label",p.ariaLabel.trim()),Me(c,t.style,"button");let m=i.nav?.callbacks,u=g=>{switch(g.action){case "next":m?m.onNext():i.onClose();break;case "prev":m?.onBack();break;case "goto":m?.onGoto&&typeof g.targetStep=="number"?m.onGoto(g.targetStep):i.onClose();break;case "snooze":zi(i.guide.guideId,typeof g.snoozeEvery=="number"?g.snoozeEvery:1,g.snoozeUnit??"day"),i.onClose();break;case "url":typeof g.url=="string"&&fe(g.url)&&(g.newTab===false?window.location.assign(g.url):window.open(g.url,"_blank","noopener,noreferrer"));break;case "guide":g.targetGuideId&&i.onOpenGuide?.(g.targetGuideId),this.closeOrSkip(i);break;default:this.closeOrSkip(i);}},d=()=>{t.secondAction?.action&&u(t.secondAction);},f=()=>{switch(t.action){case "next":case "prev":case "goto":case "snooze":case "url":case "guide":l(t),u(t),d();break;case "submit-forms":case "submit-forms-advance":case "submit-forms-goto":this.submitForms(s,i,r,c,()=>{l(t),t.action==="submit-forms"||!m?i.onClose():t.action==="submit-forms-goto"&&typeof t.targetStep=="number"&&m.onGoto?m.onGoto(t.targetStep):m.onNext();});break;default:l(t),this.closeOrSkip(i),d();}};return c.addEventListener("click",()=>{a?this.submitForms(a,i,r,c,f):f();}),c}submitForms(t,n,i,r,s){let l={};for(let{field:m,read:u}of t){let d=u();if(d==null||d===""){if(m.required){r.textContent=`Completa "${m.label}"`;return}continue}l[m.key]=d;}if(Object.keys(l).length===0){s();return}r.disabled=true;let a=n.onFormSubmit??(()=>Promise.resolve(true)),c=new Set(t.filter(m=>l[m.field.key]!==void 0).map(m=>m.blockId??"")),p=c.size===1&&[...c][0]||void 0;a(l,{...p?{pollId:p}:{},stepIndex:i}).then(m=>{if(r.disabled=false,!m)return;(!n.nav||i>=n.nav.totalSteps-1)&&n.onInteraction({guideId:n.guide.guideId,stepIndex:i,action:"completed"}),s();});}closeOrSkip(t){t.nav?.callbacks?t.nav.callbacks.onSkip():t.onClose();}renderBadgeMode(t,n,i,r,s,l,a,c,p,m){let u=t.badge?.trigger==="click"?"click":"hover",d=t.badge?.placement==="top"||t.badge?.placement==="left"||t.badge?.placement==="right"?t.badge.placement:"bottom",f=a.createElement("div");f.className="veo-composite-badge",f.setAttribute("role","button"),f.tabIndex=0,f.style.cursor="pointer",f.style.display="inline-flex",f.style.alignItems="center";let g=t.badge?.marker??null;g?f.appendChild(qi(a,g)):this.buildContent(f,t.badge?.blocks??[],a,c,p,[],s),l.appendChild(f),m.fullWidth===true?(n.style.width="auto",n.style.maxWidth="320px"):!n.style.width&&!n.style.maxWidth&&(n.style.maxWidth="320px");let v=a.createElement("div");v.className="veo-composite-anchored",v.style.display="none";let y=m.caret===false?null:Ji(a,m);if(y&&v.appendChild(y),v.appendChild(n),l.appendChild(v),g)s.style.display="inline-block",this.registerCleanup(Ki(i,s,g));else {s.style.display="inline-block";let P=ln(t.inlinePosition);be(i,s,P),this.registerCleanup(xe(s,r,P));}let k=false,L=null,b=null,C=false,R=()=>{k||(k=true,v.style.display="block",Qi(f,v,y,d).then(P=>{k?L=P:P();}),C||(C=true,c.onInteraction({guideId:c.guide.guideId,stepIndex:p,action:"shown"})));},E=()=>{k=false,v.style.display="none",L?.(),L=null;};if(u==="hover"){let P=()=>{b!==null&&(clearTimeout(b),b=null);},I=()=>{P(),b=window.setTimeout(E,150);};f.addEventListener("mouseenter",()=>{P(),R();}),f.addEventListener("mouseleave",I),f.addEventListener("focus",R),v.addEventListener("mouseenter",P),v.addEventListener("mouseleave",I);}else f.addEventListener("click",()=>{k?E():R();});return this.registerCleanup(()=>{L?.(),b!==null&&clearTimeout(b);}),c.badgeOpen&&R(),E}};function ln(o){return o==="before"||o==="prepend"||o==="append"?o:"after"}function oa(o,e,t){let n=o.style;n.position="fixed";let i=16,r=d=>typeof t[d]=="number"&&Number.isFinite(t[d])?t[d]:0;n.margin="0";let s=t.hAlign==="left"?"left":t.hAlign==="right"?"right":null,l=e.includes("top")?"top":e.includes("bottom")?"bottom":"middle",a=s??(e.includes("left")?"left":e.includes("right")?"right":"middle");l==="top"?n.top=`${i+r("marginTop")}px`:l==="bottom"?n.bottom=`${i+r("marginBottom")}px`:n.top="50%",a==="left"?n.left=`${i+r("marginLeft")}px`:a==="right"?n.right=`${i+r("marginRight")}px`:n.left="50%";let c=r("marginLeft")-r("marginRight"),p=r("marginTop")-r("marginBottom"),m=a==="middle"?`calc(-50% + ${c}px)`:"0",u=l==="middle"?`calc(-50% + ${p}px)`:"0";n.transform=m==="0"&&u==="0"?"":`translate(${m}, ${u})`;}var Zi="10px",na=42,ia=20;function ra(o,e,t,n){if(e.length===0)return;let i=t.includes("bottom")?"Bottom":"Top";if((i==="Top"?e[0]:e[e.length-1])?.type==="image")return;let s=n[`closeMargin${i}`],l=na+(typeof s=="number"?s:0),a=n[`padding${i}`];(typeof a=="number"?a:ia)<l&&o.style.setProperty(`padding-${i.toLowerCase()}`,`${l}px`);}function sa(o,e){let t=o.style;t.top="auto",t.right="auto",t.bottom="auto",t.left="auto";let n=e.includes("bottom")?"bottom":"top",i=e.includes("left")?"left":"right";t.setProperty(n,Zi),t.setProperty(i,Zi);}function Ji(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}`,t.dataset.veoBorder=String(e.borderWidth);}return t}function aa(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 Qi(o,e,t,n="bottom"){let i=async()=>{let{x:s,y:l,placement:a,middlewareData:c}=await Ne(o,e,{placement:n,strategy:"fixed",middleware:[Ie(t?10:8),Be(),$e({padding:8}),...t?[st({element:t})]:[]]});e.style.left=`${s}px`,e.style.top=`${l}px`,t&&at(t,a,c.arrow);};await i();let r=()=>{i();};return window.addEventListener("scroll",r,true),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,true),window.removeEventListener("resize",r);}}var la=120,ca=260;function da(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;e.colorMode==="dark"&&(t.background="#1f1d1b",t.color="#f5f0eb",o.classList.add("veo-card--dark")),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=c=>typeof e[c]=="number"?e[c]:0;t.boxShadow=`${a("shadowX")}px ${a("shadowY")}px ${a("shadowBlur")}px ${a("shadowSpread")}px ${i(e.shadowColor)??"rgba(0,0,0,0.2)"}`;}let l=typeof e.width=="number"&&Number.isFinite(e.width)?`${Math.max(la,e.width)}px`:null;e.fullWidth===true?t.width="100%":e.widthType==="fluid"?(t.width="100%",l&&(t.maxWidth=l)):l&&(t.width=l);for(let a of ["Top","Right","Bottom","Left"]){let c=n(e[`padding${a}`]);c&&t.setProperty(`padding-${a.toLowerCase()}`,c);let p=n(e[`margin${a}`]);p&&t.setProperty(`margin-${a.toLowerCase()}`,p);}}var pa={mode:"floating",position:"bottom-right"},er=16,ua=360,wo=class extends ee{async render(e){let t=e.guide.guideSteps[0];if(!t||typeof t.html!="string"||t.html.length===0)return;let n=t.placement??pa,i=null;if(n.mode==="anchored"){let p=n.selector??t.selector??e.guide.activationRules.selector;if(typeof p!="string"||p.length===0||(i=await le(p),!i))return}let{root:r}=this.createHost(),s=r.ownerDocument??document,l=s.createElement("div");l.className=n.mode==="anchored"?"veo-custom-anchored":"veo-custom-floating";let{iframe:a,cleanup:c}=Rt(s,t,e,{width:Wo(n.width??ua),fixedHeight:n.height??null});this.registerCleanup(c),l.appendChild(a),r.appendChild(l),n.mode==="floating"?ma(l,n):i&&this.registerCleanup(await this.setupAnchoredPosition(i,l,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:l,y:a}=await Ne(e,t,{placement:i,strategy:"fixed",middleware:[Ie(n.offsetY??8),Be(),$e({padding:8})]});t.style.left=`${l}px`,t.style.top=`${a}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 ma(o,e){let t=e.position??"bottom-right",n=`${e.offsetX??er}px`,i=`${e.offsetY??er}px`,r=o.style;if(t==="center"){r.top="50%",r.left="50%",r.transform="translate(-50%, -50%)";return}let[s,l]=t.split("-");s==="top"?r.top=i:r.bottom=i,l==="left"?r.left=n:l==="right"?r.right=n:(r.left="50%",r.transform="translateX(-50%)");}var Eo=class extends ee{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",bo(s,e,i),r.appendChild(s),n.appendChild(r),this.registerCleanup(yt(i));let l=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();};r.addEventListener("click",c=>{c.target===r&&l();});let a=c=>{c.key==="Escape"&&l();};document.addEventListener("keydown",a),this.registerCleanup(()=>document.removeEventListener("keydown",a)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var ko=class extends ee{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 le(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=De(t.style);be(i,r,l),this.registerCleanup(xe(r,n,l));let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-custom-inline";let{iframe:p,cleanup:m}=Rt(a,t,e,{width:"100%"});this.registerCleanup(m),c.appendChild(p),s.appendChild(c),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var Co=class extends ee{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 le(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=De(t.style);be(i,r,l),this.registerCleanup(xe(r,n,l)),this.applyDesign(t.style);let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-inline",bo(c,e,a),s.appendChild(c),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var So=class extends ee{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 le(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=De(t.style);be(i,r,l),this.registerCleanup(xe(r,n,l)),this.applyDesign(t.style);let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-inline";let p=(u,d,f)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:u,...f?{metadata:f}:{}}),d&&window.open(d,"_blank","noopener,noreferrer"),e.onClose();},m=he(t,a,{onCtaClick:(u,d,f)=>{p("cta_clicked",u==="url"?d:void 0,f),u==="guide"&&d&&e.onOpenGuide?.(d);},onDismiss:()=>p("dismissed")});c.appendChild(m),s.appendChild(c),this.liveContainer=c,this.liveContent=m,this.liveKey=`${n}|${l}`,this.liveBuild=u=>he(u,a,{onCtaClick:(d,f,g)=>{p("cta_clicked",d==="url"?f:void 0,g),d==="guide"&&f&&e.onOpenGuide?.(f);},onDismiss:()=>p("dismissed")}),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(e){return `${e.selector??""}|${De(e.style)}`}};function tr(o){return o.style?.backdrop===false?"veo-modal-overlay veo-modal-overlay--none":"veo-modal-overlay"}var to=class extends ee{constructor(){super(...arguments);this.overlay=null;this.releaseScroll=null;}syncScrollLock(t){let n=t.style?.backdrop!==false;n&&!this.releaseScroll?this.releaseScroll=yt(this.host?.ownerDocument??document):!n&&this.releaseScroll&&(this.releaseScroll(),this.releaseScroll=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,l=s.createElement("div");l.className=tr(i),this.overlay=l,this.syncScrollLock(i);let a=s.createElement("div");a.className="veo-modal-card";let c=(d,f,g)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:d,...g?{metadata:g}:{}}),f&&window.open(f,"_blank","noopener,noreferrer"),t.onClose();},p=()=>{t.nav?t.nav.callbacks.onSkip():c("dismissed");},m=t.nav?Nt(i,t.nav.stepIndex,t.nav.totalSteps,s,t.nav.callbacks):he(i,s,{onCtaClick:(d,f,g)=>{c("cta_clicked",d==="url"?f:void 0,g),d==="guide"&&f&&t.onOpenGuide?.(f);},onDismiss:()=>c("dismissed")});a.appendChild(m),l.appendChild(a),r.appendChild(l),t.nav||(this.liveContainer=a,this.liveContent=m,this.liveBuild=d=>he(d,s,{onCtaClick:(f,g,v)=>{c("cta_clicked",f==="url"?g:void 0,v),f==="guide"&&g&&t.onOpenGuide?.(g);},onDismiss:()=>c("dismissed")})),l.addEventListener("click",d=>{d.target===l&&p();});let u=d=>{d.key==="Escape"&&p();};document.addEventListener("keydown",u),this.registerCleanup(()=>document.removeEventListener("keydown",u)),t.nav||t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"shown"});}onLiveUpdate(t){this.overlay&&(this.overlay.className=tr(t)),this.syncScrollLock(t);}destroy(){this.overlay=null,this.releaseScroll?.(),this.releaseScroll=null,super.destroy();}};var Lo=class extends ee{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 le(i);if(!r)return;let s=n.style?.tooltipPlacement;this.side=s==="top"||s==="left"||s==="right"?s:"bottom";let{root:l}=this.createHost();this.applyDesign(n.style);let a=l.ownerDocument??document,c=a.createElement("div");c.className="veo-tooltip";let p=(g,v,y)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:g,...y?{metadata:y}:{}}),v&&window.open(v,"_blank","noopener,noreferrer"),t.onClose();},m=he(n,a,{onCtaClick:(g,v,y)=>{p("cta_clicked",g==="url"?v:void 0,y),g==="guide"&&v&&t.onOpenGuide?.(v);},onDismiss:()=>p("dismissed")});c.appendChild(m);let u=a.createElement("div");u.className="veo-tooltip-arrow",c.appendChild(u),l.appendChild(c);let d=async()=>{let{x:g,y:v,placement:y,middlewareData:k}=await Ne(r,c,{placement:this.side,middleware:[Ie(10),Be(),$e({padding:8}),st({element:u})]});c.style.left=`${g}px`,c.style.top=`${v}px`,at(u,y,k.arrow);};await d();let f=()=>{d();};this.reposition=f,window.addEventListener("scroll",f,true),window.addEventListener("resize",f),this.registerCleanup(()=>{window.removeEventListener("scroll",f,true),window.removeEventListener("resize",f);}),this.liveContainer=c,this.liveContent=m,this.liveKey=i,this.liveBuild=g=>he(g,a,{onCtaClick:(v,y,k)=>{p("cta_clicked",v==="url"?y:void 0,k),v==="guide"&&y&&t.onOpenGuide?.(y);},onDismiss:()=>p("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 To=class extends ee{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 le(n,5e3);if(!i)return false;let r=t.style?.tooltipPlacement,s=r==="top"||r==="left"||r==="right"?r:"bottom",{root:l}=this.createHost();this.applyDesign(t.style);let a=l.ownerDocument??document,c=a.createElement("div");c.className="veo-walkthrough";let p=Nt(t,e.currentStepIndex,e.guide.guideSteps.length,a,e.callbacks);c.appendChild(p);let m=a.createElement("div");m.className="veo-walkthrough-arrow",c.appendChild(m),l.appendChild(c);let u=async()=>{let{x:f,y:g,placement:v,middlewareData:y}=await Ne(i,c,{placement:s,middleware:[Ie(10),Be(),$e({padding:8}),st({element:m})]});c.style.left=`${f}px`,c.style.top=`${g}px`,at(m,v,y.arrow);};await u();let d=()=>{u();};return window.addEventListener("scroll",d,true),window.addEventListener("resize",d),this.registerCleanup(()=>{window.removeEventListener("scroll",d,true),window.removeEventListener("resize",d);}),true}};var fa="__veo_preview__",dn=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"&&e.badgeOpen===true==(this.input.badgeOpen===true)&&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=ga(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),l=n.guideSteps[s];l&&(n.guideSteps=[l]);let a=this.renderSingleStep(n);return {close:()=>this.close(),ready:a,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 ee?this.walkthrough.hostElement():null}close(e=false){let t=e?this.input?.onClosed:void 0;this.singleStep&&(xt(this.singleStep),this.singleStep=null),this.walkthrough&&(xt(this.walkthrough),this.walkthrough=null),this.walkthroughGuide=null,this.walkthroughIndex=0,this.input=null,t?.();}async renderSingleStep(e){let t=ha(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(!0),badgeOpen:this.input?.badgeOpen??jt(this.input?.activationRules),onTrack:()=>{},onOpenGuide:()=>{},onFormSubmit:this.input?.formSubmit??(()=>Promise.resolve(!0)),...this.input?.fetchProgress?{fetchProgress:this.input.fetchProgress}:{},isPreview:!0,...this.input?.formSubmit&&this.input.formSubmitNote!==void 0?{previewNote:this.input.formSubmitNote}:{}});}catch{return this.close(),{rendered:false}}return this.singleStep!==t?(xt(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&&(xt(this.walkthrough),this.walkthrough=null);let n={onNext:()=>{let a=this.walkthroughIndex+1;if(a>=t.guideSteps.length){this.close();return}this.walkthroughIndex=a,this.renderWalkthroughStep(a);},onBack:()=>{let a=this.walkthroughIndex-1;a<0||(this.walkthroughIndex=a,this.renderWalkthroughStep(a));},onSkip:()=>this.close(),onComplete:()=>this.close()},r=t.guideSteps[e]?.style?.render;if(r==="modal"||r==="banner"){let a=r==="modal"?new to:new Qt;try{a.render({guide:t,onInteraction:()=>{},onClose:()=>this.close(!0),nav:{stepIndex:e,totalSteps:t.guideSteps.length,callbacks:n}});}catch{return xt(a),false}return this.walkthroughGuide!==t?(xt(a),false):(this.walkthrough=a,true)}let s=new To,l=false;try{l=await s.render({guide:t,currentStepIndex:e,callbacks:n});}catch{l=false;}return !l||this.walkthroughGuide!==t?(xt(s),false):(this.walkthrough=s,true)}},Ao=null;function Ro(o){return Ce()?(Ao||(Ao=new dn),Ao.preview(o)):{close:()=>{},ready:Promise.resolve({rendered:false}),host:()=>null}}function qe(){Ao?.close();}function ga(o){let e=o.activationRules?.selector,t={url:o.activationRules?.url??{type:"prefix",pattern:"/"},trigger:"immediate",...e!==void 0?{selector:e}:{}};return {guideId:fa,guideName:o.guideName??"Preview",guideType:o.guideType,guideSteps:o.guideSteps,activationRules:t,displayFrequency:"always",displayPriority:0,...o.theme?{theme:o.theme}:{}}}function ha(o){switch(o){case "modal":return new to;case "banner":return new Qt;case "tooltip":return new Lo;case "custom":return new wo;case "inline":return new So;case "inline-custom":return new ko;case "form":return new Eo;case "inline-form":return new Co;case "badge":return new vo;case "composite":return new xo;case "walkthrough":return null;default:return null}}function xt(o){try{o.destroy();}catch{}}function or(o){let e=[o];try{let t=new URL(o);e.push(`${t.pathname}${t.search}${t.hash}`),t.hash.startsWith("#/")&&e.push(t.hash.slice(1));}catch{}return e}function va(o,e){let t=or(e);switch(o.type){case "exact":return t.some(n=>n===o.pattern);case "prefix":return t.some(n=>n.startsWith(o.pattern));case "regex":try{let n=new RegExp(o.pattern);return t.some(i=>n.test(i))}catch{return false}}}function nr(o,e){return !o||o.scope==="sitewide"?true:o.scope==="pages"?(o.rules??[]).some(n=>ba(n,e)):o.pattern?va({type:o.matchType??"prefix",pattern:o.pattern},e):true}function ba(o,e){let t=o.pattern.toLowerCase(),n=or(e).map(i=>i.toLowerCase());switch(o.type){case "exact":return n.some(i=>i===t);case "prefix":return n.some(i=>i.startsWith(t));case "contains":return n.some(i=>i.includes(t));case "regex":try{let i=new RegExp(o.pattern,"i");return n.some(r=>i.test(r))}catch{return false}default:return false}}var Ht="veo-builder";var Mo=64,Po=128,ya={bolt:'<path stroke-linecap="round" stroke-linejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"/>',desktop:'<path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"/>',updown:'<path stroke-linecap="round" stroke-linejoin="round" d="M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"/>',map:'<path stroke-linecap="round" stroke-linejoin="round" d="M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z"/>',eye:'<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"/><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>',chevronDown:'<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>',chevronUp:'<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 15.75 7.5-7.5 7.5 7.5"/>',plus:'<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/>',pencil:'<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"/>',copy:'<path stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"/>',trash:'<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>',cursor:'<path stroke-linecap="round" stroke-linejoin="round" d="M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59"/>',spinner:'<path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"/>'};function ke(o,e=20){return `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true">${ya[o]}</svg>`}function xa(o){if(!o)return "";let e=new Date(o);return Number.isNaN(e.getTime())?"":e.toLocaleDateString("es",{day:"numeric",month:"short"}).replace(".","")}function te(o,e,t){let n=document.createElement(o);return n.className=e,t!==void 0&&(n.innerHTML=t),n}function pn(o,e,t=""){let n=te("button",`veo-tb-icon ${t}`.trim(),ke(o));return n.type="button",n.title=e,n.setAttribute("aria-label",e),n}function rr(o){if(!ye()||!Ce())return {setState:()=>{},height:()=>0,dock:()=>"top",setPreview:()=>{},setHidden:()=>{},onHeightChange:()=>{},teardown:()=>{}};let e=document.createElement("div");e.setAttribute("data-veo-builder-chrome",""),e.setAttribute("data-veo-ignore","");let t=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=wa;let i=te("div","veo-chrome"),r=te("div","veo-tb"),s=te("div","veo-tb-brand",ke("bolt",18)),l=te("div","veo-tb-name"),a=te("span","veo-tb-status");a.hidden=true;let c=te("span","veo-tb-sep"),p=te("div","veo-tb-app",`${ke("desktop",16)}<span></span>`);p.querySelector("span").textContent=o.appLabel;let m=te("div","veo-tb-left");m.append(s,l,a,c,p);let u=te("div","veo-tb-right"),d=pn("updown","Mover la barra abajo"),f=pn("map","Mostrar el editor"),g=pn("eye","Vista previa"),v=te("button","veo-tb-text","Salir");v.type="button";let y=te("div","veo-tb-save"),k=te("button","veo-tb-save-main","<span>Guardar</span>");k.type="button";let L=te("button","veo-tb-save-more",ke("chevronDown",16));L.type="button",L.title="M\xE1s opciones de guardado",L.setAttribute("aria-label","M\xE1s opciones de guardado");let b=te("div","veo-tb-menu"),C=te("button","veo-tb-menu-item","Guardar y salir");C.type="button",b.append(C),b.hidden=true,y.append(k,L,b),u.append(d,f,g,te("span","veo-tb-vsep"),v,y),r.append(m,u);let R=te("div","veo-steps"),E=te("div","veo-steps-list");R.append(E);let P=te("button","veo-steps-toggle");P.type="button",i.append(r,R,P);let I=te("div","veo-preview-pill"),Y=te("span","veo-preview-label",`${ke("eye",18)}<span>Est\xE1s en vista previa</span>`),H=te("button","veo-preview-exit","Salir");H.type="button",I.append(Y,H),I.hidden=true,t.append(n,i,I),document.body.appendChild(e);let J=document.documentElement,re=J.style.marginTop,oe=J.style.marginBottom,ie=false,q="top",Q=false,ne=false,ce=null,se=false,ct=()=>Mo+(ie||se?0:Po),Te=()=>{let W=Q||ne?0:ct();J.style.marginTop=q==="top"?`${W}px`:re,J.style.marginBottom=q==="bottom"?`${W}px`:oe,i.style.setProperty("--veo-chrome-h",`${ct()}px`),i.classList.toggle("is-bottom",q==="bottom"),R.hidden=ie||se,P.hidden=se,g.hidden=se,y.hidden=se,f.title=se?"Mostrar el panel":"Mostrar el editor";let ze=q==="top"?"chevronUp":"chevronDown",Ae=q==="top"?"chevronDown":"chevronUp";P.innerHTML=`<span>${ie?"Mostrar pasos":"Ocultar pasos"}</span>${ke(ie?Ae:ze,16)}`,d.title=q==="top"?"Mover la barra abajo":"Mover la barra arriba",d.setAttribute("aria-label",d.title),ce?.(W);},_e=W=>{Q=W,i.hidden=W||ne,I.hidden=!W,Te();},wt=W=>{ne=W,i.hidden=W||Q,Te();};P.addEventListener("click",()=>{ie=!ie,Te();});let ae=W=>o.onAction(W);d.addEventListener("click",()=>{q=q==="top"?"bottom":"top",Te(),ae({action:"dock",position:q});}),f.addEventListener("click",()=>ae({action:"show-panel"})),g.addEventListener("click",()=>ae({action:"preview"})),H.addEventListener("click",()=>ae({action:"exit-preview"})),v.addEventListener("click",()=>ae({action:"exit"})),k.addEventListener("click",()=>ae({action:"save",exit:false})),L.addEventListener("click",W=>{W.stopPropagation(),b.hidden=!b.hidden;}),C.addEventListener("click",()=>{b.hidden=true,ae({action:"save",exit:true});});let Ot=()=>{b.hidden=true;};document.addEventListener("click",Ot);let no=null,Oe=()=>{let W=no;if(!W)return;let ze=W.variant==="tagging";ze!==se&&(se=ze,Te());let Ae=xa(W.createdAt);l.textContent=se?W.guideName.trim()||"Modo tagging":`${W.guideName.trim()||"Sin nombre"}${Ae?` \xB7 ${Ae}`:""}`,W.status?(a.hidden=false,a.textContent=W.status.label,a.dataset.tone=W.status.tone,a.title="Estado de la gu\xEDa (se cambia desde la lista de gu\xEDas)"):a.hidden=true,k.innerHTML=W.saving?`${ke("spinner",16)}<span>Guardando\u2026</span>`:"<span>Guardar</span>",k.disabled=W.saving,C.disabled=W.saving,E.replaceChildren();let zt=ir(ke("cursor",22),"Activaci\xF3n",W.section==="activation");zt.addEventListener("click",()=>ae({action:"select-activation"})),E.append(zt),W.steps.forEach((Ye,dt)=>{let Gt=Ye.presentation==="inline"?'<div class="veo-thumb veo-thumb-inline"><i></i><i></i><i></i></div>':'<div class="veo-thumb"><i></i><i></i><b></b></div>',Ho=W.section==="step"||W.section==="block"||W.section==="add-block"||W.section==="row"||W.section==="structure",Ze=ir(Gt,Ye.label,Ho&&W.activeStep===dt,{canRemove:true,onEdit:()=>ae({action:"select-step",index:dt}),onDuplicate:()=>ae({action:"duplicate-step",index:dt}),onRemove:()=>ae({action:"remove-step",index:dt})});E.append(Ze);});let Xe=te("button","veo-step-add",`${ke("plus",18)}<span>Agregar paso</span>`);Xe.type="button",Xe.addEventListener("click",()=>ae({action:"add-step"})),E.append(Xe);};return Te(),{setState:W=>{no=W,Oe();},height:ct,dock:()=>q,setPreview:_e,setHidden:wt,onHeightChange:W=>{ce=W;},teardown:()=>{document.removeEventListener("click",Ot),J.style.marginTop=re,J.style.marginBottom=oe,e.remove();}}}function ir(o,e,t,n){let i=`veo-step${t?" is-active":""}`;if(!n){let a=te("button",i,`<div class="veo-step-box">${o}</div><span class="veo-step-label"></span>`);return a.type="button",a.querySelector(".veo-step-label").textContent=e,a.setAttribute("aria-pressed",t?"true":"false"),a}let r=te("div",i,`<div class="veo-step-box">${o}<div class="veo-step-hover"><div class="veo-step-hover-top"><button type="button" class="veo-step-icon veo-step-remove" title="Eliminar paso" aria-label="Eliminar paso">${ke("trash",14)}</button><button type="button" class="veo-step-icon veo-step-duplicate" title="Duplicar paso" aria-label="Duplicar paso">${ke("copy",14)}</button></div><div class="veo-step-hover-main"><button type="button" class="veo-step-edit">${ke("pencil",14)}<span>Editar</span></button></div></div></div><span class="veo-step-label"></span>`);r.querySelector(".veo-step-label").textContent=e,r.setAttribute("aria-current",t?"step":"false");let s=r.querySelector(".veo-step-remove");s.disabled=!n.canRemove,n.canRemove||(s.title="La gu\xEDa necesita al menos un paso");let l=(a,c)=>{r.querySelector(a)?.addEventListener("click",p=>{p.stopPropagation(),c();});};return l(".veo-step-edit",n.onEdit),l(".veo-step-duplicate",n.onDuplicate),l(".veo-step-remove",n.onRemove),r.addEventListener("click",n.onEdit),r}var wa=`
|
|
710
|
+
`;var ee=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(Vn,"");let t=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=Qt,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}}createDetachedHost(e=qn){let t=document.createElement("div");t.setAttribute(e,"");let n=t.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=Qt,n.appendChild(i);let r=document.createElement("div");return n.appendChild(r),this.registerCleanup(()=>t.remove()),{host:t,root:r}}applyDesign(e){this.host&&Ai(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 zs={top:"bottom",bottom:"top",left:"right",right:"left"},Gs={top:["top","left"],right:["top","right"],bottom:["bottom","right"],left:["bottom","left"]};function at(o,e,t){let n=zs[e.split("-")[0]??"bottom"]??"top";for(let r of ["top","bottom","left","right"])o.style.setProperty(r,"");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");let i=o.dataset.veoBorder;if(i){for(let r of ["top","right","bottom","left"])o.style.setProperty(`border-${r}-width`,Gs[n].includes(r)?`${i}px`:"0");o.style.zIndex="1";}}var Fs=150,bo=class extends ee{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 le(i);if(!r)return;let{host:s,root:l}=this.createHost(),a=l.ownerDocument??document;this.applyDesign(n.style);let c=n.style?.width;typeof c=="number"&&Number.isFinite(c)&&s.style.setProperty("--veo-badge-tip-width",`${Math.min(720,Math.max(220,c))}px`),this.trigger=n.style?.badgeTrigger==="click"?"click":"hover";let p=n.style?.tooltipPlacement;this.side=p==="bottom"||p==="left"||p==="right"?p:"top";let m=De(n.style);s.style.display="inline-flex",s.style.verticalAlign="middle";let u=Mi(Ri(n),a);l.appendChild(u),this.badgeBtn=u,be(r,s,m),this.registerCleanup(xe(s,i,m));let d=a.createElement("div");d.className="veo-tooltip veo-badge-tooltip",d.style.display="none";let f=(b,C)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:b,...C?{metadata:C}:{}});},h=b=>ge(b,a,{onCtaClick:(C,R,k)=>{f("cta_clicked",k),C==="url"&&R&&window.open(R,"_blank","noopener,noreferrer"),this.closeTooltip(),C==="guide"&&R&&t.onOpenGuide?.(R);},onDismiss:()=>this.closeTooltip()}),v=h(n);d.appendChild(v);let y=a.createElement("div");y.className="veo-tooltip-arrow",d.appendChild(y),l.appendChild(d),this.tooltip=d,this.arrowEl=y,this.liveContainer=d,this.liveContent=v,this.liveKey=this.liveKeyOf(n),this.liveBuild=h;let E=()=>{this.cancelClose(),this.open||(this.openTooltip(u),this.shownEmitted||(this.shownEmitted=true,f("shown")));};if(this.trigger==="hover"){let b=()=>{this.cancelClose(),this.closeTimer=window.setTimeout(()=>this.closeTooltip(),Fs);};u.addEventListener("mouseenter",E),u.addEventListener("focus",E),u.addEventListener("mouseleave",b),u.addEventListener("blur",b),d.addEventListener("mouseenter",()=>this.cancelClose()),d.addEventListener("mouseleave",b);}else {u.addEventListener("click",()=>{this.open?this.closeTooltip():E();});let b=C=>{this.open&&(C.composedPath().includes(s)||this.closeTooltip());};document.addEventListener("click",b,true),this.registerCleanup(()=>document.removeEventListener("click",b,true));}let T=b=>{b.key==="Escape"&&this.open&&this.closeTooltip();};document.addEventListener("keydown",T),this.registerCleanup(()=>document.removeEventListener("keydown",T)),t.isPreview&&E();}liveKeyOf(t){let n=t.selector??"",i=De(t.style),r=t.style?.badgeTrigger==="click"?"click":"hover";return `${n}|${i}|${r}`}onLiveUpdate(t){if(this.badgeBtn){let i=this.badgeBtn.ownerDocument,r=Mi(Ri(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:l,middlewareData:a}=await Be(t,n,{strategy:"fixed",placement:this.side,middleware:[Ie(8),Ne(),$e({padding:8}),st({element:i})]});n.style.left=`${r}px`,n.style.top=`${s}px`,at(i,l,a.arrow);}};function Ri(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"&&He.test(t.color.trim())?t.color.trim():null,size:typeof t.size=="number"&&Number.isFinite(t.size)?t.size:null}}function eo(o,e,t){return Math.min(t,Math.max(e,o))}function Mi(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=eo(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=`${eo(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=`${eo(Math.round(n*.7),9,28)}px`,o.color&&(t.style.color=o.color);break}case "image":{if(o.imageUrl&&fe(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=`${eo(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=`${eo(Math.round(n*.62),8,32)}px`,o.color&&(t.style.color=o.color);break}}return t}function Ht(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 l=n.createElement("div");l.className="veo-walkthrough-progress";for(let f=0;f<t;f++){let h=n.createElement("span");h.className="veo-walkthrough-progress-dot",f<e&&h.classList.add("completed"),f===e&&h.classList.add("active"),l.appendChild(h);}r.appendChild(l);for(let f of Zn(o,n))r.appendChild(f);let a=n.createElement("div");a.className="veo-walkthrough-actions";let c=n.createElement("button");c.type="button",c.className="veo-walkthrough-skip",c.textContent="Omitir",c.addEventListener("click",()=>i.onSkip()),a.appendChild(c);let p=n.createElement("div");if(p.className="veo-walkthrough-actions-right",e>0){let f=n.createElement("button");f.type="button",f.className="veo-walkthrough-btn-secondary",f.textContent="Atr\xE1s",f.addEventListener("click",()=>i.onBack()),p.appendChild(f);}let m=e===t-1,u=n.createElement("button");u.type="button",u.className="veo-guide-cta";let d=m?"Finalizar":"Siguiente";return u.textContent=typeof o.ctaText=="string"&&o.ctaText?o.ctaText:d,u.addEventListener("click",()=>{m?i.onComplete():i.onNext();}),p.appendChild(u),a.appendChild(p),r.appendChild(a),r.appendChild(pt(n,()=>i.onSkip())),r}var to=class extends ee{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 le(r),!s))return;let{host:l,root:a}=this.createHost();this.applyDesign(n.style);let c=a.ownerDocument??document,p=c.createElement("div");p.className=Pi(i,!!s);let m=(d,f,h)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:t,action:d,...h?{metadata:h}:{}}),f&&window.open(f,"_blank","noopener,noreferrer"),e.onClose();},u=e.nav?Ht(n,e.nav.stepIndex,e.nav.totalSteps,c,e.nav.callbacks):ge(n,c,{onCtaClick:(d,f,h)=>{m("cta_clicked",d==="url"?f:void 0,h),d==="guide"&&f&&e.onOpenGuide?.(f);},onDismiss:()=>m("dismissed")});if(p.appendChild(u),a.appendChild(p),r&&s){l.style.display="block";let d=i==="top"?"prepend":"append";be(s,l,d),this.registerCleanup(xe(l,r,d));}e.nav||(this.liveContainer=p,this.liveContent=u,this.liveBuild=d=>ge(d,c,{onCtaClick:(f,h,v)=>{m("cta_clicked",f==="url"?h:void 0,v),f==="guide"&&h&&e.onOpenGuide?.(h);},onDismiss:()=>m("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=Pi(t,n);}}};function Pi(o,e){return e?"veo-banner veo-banner-embedded":`veo-banner veo-banner-${o}`}var Ve={iconEmptyColor:"#e7e2de",iconFillColor:"#406a31",barColor:"#406a31",barHeight:8,fontSize:14,fontWeight:600,titleColor:"#2c2825",subtitleColor:"#8a8582",subtitleTemplate:"Completado <%= currentStep %> de <%= totalSteps %> pasos"},Ii={regular:400,medium:500,semibold:600,bold:700};function Ws(o){let e=o??{},t=(l,a)=>typeof e[l]=="string"&&e[l].trim()?e[l]:a,n=(l,a,c,p)=>typeof e[l]=="number"&&Number.isFinite(e[l])?Math.min(p,Math.max(c,e[l])):a,i=e.fontWeight,r=typeof i=="number"?Math.min(900,Math.max(100,i)):typeof i=="string"&&Ii[i.toLowerCase()]?Ii[i.toLowerCase()]:Ve.fontWeight,s=e.colorMode==="dark";return {colorMode:s?"dark":"light",iconEmptyColor:t("iconEmptyColor",s?"#3c3734":Ve.iconEmptyColor),iconFillColor:t("iconFillColor",Ve.iconFillColor),barColor:t("barColor",Ve.barColor),barHeight:n("barHeight",Ve.barHeight,2,40),fontSize:n("fontSize",Ve.fontSize,10,40),fontWeight:r,titleColor:t("titleColor",s?"#f5efeb":Ve.titleColor),subtitleColor:t("subtitleColor",s?"#b0a9a5":Ve.subtitleColor),subtitleTemplate:t("subtitleTemplate",Ve.subtitleTemplate)}}function Us(o,e){return o.replace(/<%=\s*currentStep\s*%>/g,String(e.currentStep)).replace(/<%=\s*totalSteps\s*%>/g,String(e.totalSteps))}var tn=10,$i=2*Math.PI*tn;function js(o,e,t,n){let i="http://www.w3.org/2000/svg",r=o.createElementNS(i,"svg");r.setAttribute("viewBox","0 0 28 28"),r.setAttribute("class","veo-checklist-ring"),r.setAttribute("aria-hidden","true");let s=o.createElementNS(i,"circle");if(s.setAttribute("cx","14"),s.setAttribute("cy","14"),s.setAttribute("r",String(tn)),s.setAttribute("fill",t?n.iconFillColor:"none"),s.setAttribute("stroke",n.iconEmptyColor),s.setAttribute("stroke-width","4.5"),r.appendChild(s),t){let a=o.createElementNS(i,"path");return a.setAttribute("d","M9 14.5l3.2 3.2L19 11"),a.setAttribute("fill","none"),a.setAttribute("stroke","#fff"),a.setAttribute("stroke-width","2.4"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),r.appendChild(a),r}let l=Math.max(0,Math.min(1,e));if(l>0){let a=o.createElementNS(i,"circle");a.setAttribute("cx","14"),a.setAttribute("cy","14"),a.setAttribute("r",String(tn)),a.setAttribute("fill","none"),a.setAttribute("stroke",n.iconFillColor),a.setAttribute("stroke-width","4.5"),a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-dasharray",`${($i*l).toFixed(2)} ${$i.toFixed(2)}`),a.setAttribute("transform","rotate(-90 14 14)"),r.appendChild(a);}return r}function Ni(o,e,t){let n=Ws(o.style),i=(o.items??[]).filter(f=>f&&typeof f.guideId=="string"&&f.guideId),r=e.createElement("div");if(r.className=`veo-checklist${n.colorMode==="dark"?" veo-checklist--dark":""}`,r.style.setProperty("--veo-cl-font-size",`${n.fontSize}px`),r.style.setProperty("--veo-cl-font-weight",String(n.fontWeight)),r.style.setProperty("--veo-cl-title",n.titleColor),r.style.setProperty("--veo-cl-subtitle",n.subtitleColor),r.style.setProperty("--veo-cl-bar",n.barColor),r.style.setProperty("--veo-cl-bar-h",`${n.barHeight}px`),typeof o.html=="string"&&o.html||typeof o.text=="string"&&o.text){let f=e.createElement("div");f.className="veo-checklist-title",typeof o.html=="string"&&o.html?f.appendChild(Tt(o.html,e)):f.textContent=o.text,r.appendChild(f);}let s=e.createElement("div");s.className="veo-checklist-items",s.setAttribute("role","list"),r.appendChild(s);let l=e.createElement("div");l.className="veo-checklist-footer";let a=e.createElement("div");a.className="veo-checklist-summary";let c=e.createElement("span");c.className="veo-checklist-count";let p=e.createElement("span");p.className="veo-checklist-percent",a.append(c,p);let m=e.createElement("div");m.className="veo-checklist-bar";let u=e.createElement("div");u.className="veo-checklist-bar-fill",m.appendChild(u),l.append(a,m),r.appendChild(l);let d=f=>{s.textContent="";let h=f?i.filter(T=>f.has(T.guideId)):i,v=0;for(let T of h){let b=f?.get(T.guideId)??null;b?.completed&&v++;let C=e.createElement("button");C.type="button",C.className=`veo-checklist-item${b?.completed?" veo-checklist-item--done":""}`,C.setAttribute("role","listitem");let R=b&&b.totalSteps>0?b.currentStep/b.totalSteps:0;C.appendChild(js(e,R,b?.completed===true,n));let k=e.createElement("span");k.className="veo-checklist-texts";let P=e.createElement("span");if(P.className="veo-checklist-label",P.textContent=(T.text??"").trim()||b?.guideName||"Gu\xEDa",b&&b.published===false&&(C.title="Gu\xEDa no publicada: los usuarios no la ver\xE1n"),k.appendChild(P),b){let I=e.createElement("span");I.className="veo-checklist-sub",I.textContent=Us(n.subtitleTemplate,b),k.appendChild(I);}C.appendChild(k),C.addEventListener("click",I=>{if(I.preventDefault(),I.stopPropagation(),t.isPreview)return;let F=b&&!b.completed?Math.min(b.currentStep,b.totalSteps-1):0;t.onOpenGuideAt?t.onOpenGuideAt(T.guideId,F):t.onOpenGuide?.(T.guideId);}),s.appendChild(C);}let y=h.length,E=y>0?Math.round(v/y*100):0;c.textContent=`${v} de ${y} ${y===1?"completada":"completadas"}`,p.textContent=`${E}%`,u.style.width=`${E}%`,l.hidden=y===0;};if(t.isPreview&&i.length===0){let f=new Map([["__sample_1",{guideId:"__sample_1",guideName:"Configura tu primer env\xEDo",totalSteps:2,currentStep:1,completed:false}],["__sample_2",{guideId:"__sample_2",guideName:"Conecta tu tienda",totalSteps:2,currentStep:2,completed:true}]]);i.push({guideId:"__sample_1",text:"Configura tu primer env\xEDo"},{guideId:"__sample_2",text:"Conecta tu tienda"}),d(f);let h=e.createElement("p");return h.className="veo-checklist-empty",h.textContent="Ejemplo: agrega gu\xEDas a la lista desde Opciones.",r.appendChild(h),r}return d(null),t.fetchProgress&&i.length>0&&t.fetchProgress(i.map(f=>f.guideId)).then(f=>d(new Map(f.map(h=>[h.guideId,h])))).catch(()=>{}),r}function yo(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 u=t.createElement("h2");u.className="veo-guide-title",u.textContent=n.title,s.appendChild(u);}if(n.content){let u=t.createElement("p");u.className="veo-guide-text",u.textContent=n.content,s.appendChild(u);}let l=[],a=t.createElement("form");a.className="veo-form",a.noValidate=true;for(let u of i){let{wrapper:d,read:f}=on(u,t);l.push({field:u,read:f}),a.appendChild(d);}let c=t.createElement("p");c.className="veo-form-error",c.style.display="none",a.appendChild(c);let p=t.createElement("div");p.className="veo-guide-actions";let m=t.createElement("button");m.type="submit",m.className="veo-guide-cta",m.textContent=n.ctaText||"Enviar",p.appendChild(m),a.appendChild(p),a.addEventListener("submit",u=>{u.preventDefault(),c.style.display="none";let d={};for(let{field:h,read:v}of l){let y=v();if(y==null||y===""){if(h.required){c.textContent=`Completa "${h.label}"`,c.style.display="block";return}continue}d[h.key]=y;}if(Object.keys(d).length===0){c.textContent="Responde al menos un campo",c.style.display="block";return}m.disabled=true,(e.onFormSubmit??(()=>Promise.resolve(true)))(d).then(h=>{if(!h){m.disabled=false,c.textContent="No se pudo enviar. Prueba de nuevo.",c.style.display="block";return}e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"completed"});let v=e.isPreview?e.previewNote??"Vista previa: la respuesta NO se guard\xF3.":null;Vs(o,t,v),window.setTimeout(()=>e.onClose(),v?2200:1400);});}),s.appendChild(a),s.appendChild(pt(t,r)),o.appendChild(s);}function Vs(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 on(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 l=e.createElement("option");l.value=s,l.textContent=s,i.appendChild(l);}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 l of o.options??[]){let a=e.createElement("label");a.className="veo-form-option";let c=e.createElement("input");c.type="radio",c.name=r,c.value=l,s.push(c);let p=e.createElement("span");p.textContent=l,a.appendChild(c),a.appendChild(p),i.appendChild(a);}return t.appendChild(i),{wrapper:t,read:()=>s.find(l=>l.checked)?.value}}case "multiselect":{let i=e.createElement("div");i.className="veo-form-options";let r=[];for(let s of o.options??[]){let l=e.createElement("label");l.className="veo-form-option";let a=e.createElement("input");a.type="checkbox",a.value=s,r.push(a);let c=e.createElement("span");c.textContent=s,l.appendChild(a),l.appendChild(c),i.appendChild(l);}return t.appendChild(i),{wrapper:t,read:()=>{let s=r.filter(l=>l.checked).map(l=>l.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,l]=o.options?.length===2?o.options:["S\xED","No"],a=[];for(let{label:c,value:p}of [{label:s,value:true},{label:l,value:false}]){let m=e.createElement("label");m.className="veo-form-option";let u=e.createElement("input");u.type="radio",u.name=r,a.push({input:u,value:p});let d=e.createElement("span");d.textContent=c,m.appendChild(u),m.appendChild(d),i.appendChild(m);}return t.appendChild(i),{wrapper:t,read:()=>a.find(c=>c.input.checked)?.value}}case "nps":{let i=typeof o.min=="number"?o.min:0,r=typeof o.max=="number"&&o.max>i?o.max:10;return Bi(t,e,i,r,"veo-nps-btn",void 0,{labels:o.scaleLabels??[],showLabels:o.showLabels!==false})}case "rating":return Bi(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 Bi(o,e,t,n,i,r,s={labels:[],showLabels:false}){let l=e.createElement("div");l.className="veo-form-scale";let a,c=[],p=u=>s.labels[u-t]?.trim()??"",m=s.showLabels&&Array.from({length:n-t+1},(u,d)=>t+d).some(u=>p(u));for(let u=t;u<=n;u++){let d=e.createElement("button");d.type="button",d.className=i,d.textContent=r??String(u);let f=p(u);if(d.setAttribute("aria-label",f?`${u} \xB7 ${f}`:String(u)),f&&(d.title=f),d.addEventListener("click",()=>{a=u,c.forEach((y,E)=>{let T=r?E+t<=u:E+t===u;y.classList.toggle("veo-scale-active",T);});}),c.push(d),!m){l.appendChild(d);continue}let h=e.createElement("div");h.className=`veo-scale-item${u===t?" veo-scale-item--first":u===n?" veo-scale-item--last":""}`;let v=e.createElement("span");v.className="veo-scale-label",v.textContent=f,h.append(d,v),l.appendChild(h);}return o.appendChild(l),{wrapper:o,read:()=>a}}var qs="workspace",Hi={soft:{y:4,blur:14,alpha:.12},medium:{y:12,blur:32,alpha:.22},strong:{y:24,blur:64,alpha:.38}},rn={left:"flex-start",center:"center",right:"flex-end",distribute:"space-between"};function sn(o){let e=o.replace("#",""),t=e.length===3?[...e].map(i=>i+i).join(""):e.slice(0,6),n=i=>Number.parseInt(t.slice(i,i+2),16)||0;return [n(0),n(2),n(4)]}function Ks(o,e){if(o==="none")return "none";let t=Hi[o],[n,i,r]=sn(e);return `0 ${t.y}px ${t.blur}px rgba(${n}, ${i}, ${r}, ${t.alpha})`}function Xs(o){let[e,t,n]=sn(o);return (.2126*e+.7152*t+.0722*n)/255>.6?"#111827":"#ffffff"}function Di(o,e){return !o||e.theme!==qs?null:(e.colorMode==="dark"?o.dark:o.light)??null}function _i(o,e,t){if((e?o.embedded:o.overlay).align==="distribute")return null;let i=t==="secondary"?o.buttons?.secondary:t==="link"?o.buttons?.tertiary:t==null||t==="primary"?o.buttons?.primary:void 0;return i?rn[i.align]??null:null}function nn(o,e){let t=e.defaultView;if(!t)return null;if(o==="inherit")return t.getComputedStyle(e.body).fontFamily||null;if(o==="app-heading"){let n=Array.from(e.querySelectorAll("h1,h2,h3")).find(i=>i.getClientRects().length>0);return t.getComputedStyle(n??e.body).fontFamily||null}return o}function Oi(o,e,t=false){let n=e?o.embedded:o.overlay,i=t?o.tooltip:void 0,r=i?.padding??n.padding,s={background:i?i.background:e?"transparent":n.background??o.colors.background,color:o.colors.text,paddingTop:r.top,paddingRight:r.right,paddingBottom:r.bottom,paddingLeft:r.left,borderColor:i?.borderColor??n.borderColor,borderWidth:i?.borderWidth??n.borderWidth,radius:i?.borderRadius??n.borderRadius},l=i?.shadow??n.shadow,a=i?.shadowColor??n.shadowColor;if(l==="none")Object.assign(s,{shadowColor:"transparent",shadowBlur:0});else {let c=Hi[l],[p,m,u]=sn(a);Object.assign(s,{shadowX:0,shadowY:c.y,shadowBlur:c.blur,shadowSpread:0,shadowColor:`rgba(${p}, ${m}, ${u}, ${c.alpha})`});}return s}function zi(o,e,t,n=false){let i=o.ownerDocument??document,r=t?e.embedded:e.overlay,s=(u,d)=>{d&&o.style.setProperty(u,d);};o.classList.add("veo-card--themed"),s("--veo-primary",e.colors.accent),s("--veo-cta-color",Xs(e.colors.accent));let l=e.buttons?.primary,a=(u,d)=>{if(!d)return;let f=d.padding;s(`${u}-bg`,d.background),s(`${u}-color`,d.color),s(`${u}-pad`,`${f.top}px ${f.right}px ${f.bottom}px ${f.left}px`),s(`${u}-size`,`${d.fontSize}px`),s(`${u}-weight`,String(d.fontWeight)),s(`${u}-radius`,`${d.borderRadius}px`),s(`${u}-border`,d.borderWidth>0?`${d.borderWidth}px solid ${d.borderColor}`:"none");};a("--veo-cta",l),a("--veo-cta2",e.buttons?.secondary),a("--veo-cta3",e.buttons?.tertiary),s("--veo-text",e.colors.text),s("--veo-text-secondary",e.colors.textMuted),s("--veo-font",nn("inherit",i)),s("--veo-actions-justify",r.align==="distribute"||!l?rn[r.align]:rn[l.align]);let c=e.form;if(c){o.classList.add("veo-card--themed-form");let u=c.padding;s("--veo-f-bg",c.background),s("--veo-f-accent",c.accent),s("--veo-f-on-accent",c.onAccent),s("--veo-f-pad",`${u.top}px ${u.right}px ${u.bottom}px ${u.left}px`),typeof c.borderWidth=="number"&&c.borderColor&&s("--veo-f-border",c.borderWidth>0?`${c.borderWidth}px solid ${c.borderColor}`:"none"),typeof c.borderRadius=="number"&&s("--veo-f-radius",`${c.borderRadius}px`),c.shadow&&c.shadowColor&&s("--veo-f-shadow",Ks(c.shadow,c.shadowColor));for(let[d,f]of [["primary",c.text.primary],["secondary",c.text.secondary]])s(`--veo-f-${d}-color`,f.color),s(`--veo-f-${d}-size`,`${f.fontSize}px`),s(`--veo-f-${d}-weight`,String(f.fontWeight)),s(`--veo-f-${d}-align`,f.align),s(`--veo-f-${d}-font`,nn(f.fontFamily,i));}let p=n?e.tooltip?.text:void 0,m=[["title",p?.primary??e.text.title],["subtitle",p?.secondary??e.text.subtitle],["paragraph",p?.secondary??e.text.paragraph]];for(let[u,d]of m)s(`--veo-t-${u}-color`,d.color),s(`--veo-t-${u}-size`,`${d.fontSize}px`),s(`--veo-t-${u}-weight`,String(d.fontWeight)),s(`--veo-t-${u}-align`,d.align),s(`--veo-t-${u}-font`,nn(d.fontFamily,i));}function oo(o){let e=new Map,t=[],n=-1;return o.forEach((i,r)=>{if(!i)return;let s;typeof i.row=="number"&&Number.isFinite(i.row)?(s=i.row,n=s):(s=n+.5,n=s);let l=typeof i.col=="number"&&Number.isFinite(i.col)?i.col:0,a=e.get(s);a||(a={row:s,columns:[]},e.set(s,a),t.push(s));let c=a.columns.find(p=>p.col===l);c||(c={col:l,blocks:[]},a.columns.push(c)),c.blocks.push({block:i,index:r});}),t.sort((i,r)=>i-r).map(i=>{let r=e.get(i);return r.columns.sort((s,l)=>s.col-l.col),r})}var xo=new WeakMap;function bt(o=document){let e=o.documentElement,t=o.body;if(!e||!t)return ()=>{};let n=xo.get(o);if(!n){n={count:0,html:{overflow:e.style.overflow,paddingRight:e.style.paddingRight},body:{overflow:t.style.overflow,paddingRight:t.style.paddingRight}},xo.set(o,n);let r=o.defaultView,s=r?Math.max(0,r.innerWidth-e.clientWidth):0;s>0&&(t.style.paddingRight=`${s}px`),e.style.overflow="hidden",t.style.overflow="hidden";}n.count+=1;let i=false;return ()=>{if(i)return;i=true;let r=xo.get(o);r&&(r.count-=1,!(r.count>0)&&(xo.delete(o),e.style.overflow=r.html.overflow,e.style.paddingRight=r.html.paddingRight,t.style.overflow=r.body.overflow,t.style.paddingRight=r.body.paddingRight));}}var Ys=o=>`veo:snooze:${o}`,Gi={hour:36e5,day:864e5,week:6048e5};function Zs(o,e){return (Number.isFinite(o)&&o>0?Math.floor(o):1)*(Gi[e]??Gi.day)}function Fi(o,e,t,n=Date.now()){try{localStorage.setItem(Ys(o),String(n+Zs(e,t)));}catch{}}function yt(o,e){return typeof o!="number"||!Number.isFinite(o)?e:Math.max(-2147483647,Math.min(2147483647,Math.round(o)))}var Wi="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021",Ui="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75",ji="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",an="M21 12a9 9 0 11-18 0 9 9 0 0118 0z",Js="M7.5 3.75H6A2.25 2.25 0 0 0 3.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0 1 20.25 6v1.5m0 9V18A2.25 2.25 0 0 1 18 20.25h-1.5m-9 0H6A2.25 2.25 0 0 1 3.75 18v-1.5M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z",ln={info:{paths:[an,Wi],dots:[[12,8.25]]},exclamation:{paths:[an,"M12 8v4.5"],dots:[[12,15.75]]},question:{paths:[an,Ui],dots:[[12,17.25]]},star:{paths:[ji]},"info-solid":{paths:[Wi],dots:[[12,8.25]],solid:true,scale:.8},"exclamation-solid":{paths:["M12 8v4.5"],dots:[[12,15.75]],solid:true,scale:.8},"question-solid":{paths:[Ui],dots:[[12,17.25]],solid:true,scale:.8},"star-solid":{paths:[ji],solid:true,scale:.55},"target-solid":{paths:[Js],solid:true,scale:.6},new:{paths:[],text:"New"}},Qs=14,ea=19e3,Vi=8;function xt(o,e){return typeof o=="number"&&Number.isFinite(o)?o:e}function qi(o,e,t,n){let i=ln[e]??ln.info;if(i.text){let c=o.createElement("span");return c.textContent=i.text,c.style.font=`700 ${Math.round(t*.85)}px/1 system-ui, -apple-system, sans-serif`,c.style.color=n,c}let r="http://www.w3.org/2000/svg",s=o.createElementNS(r,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("width",String(t)),s.setAttribute("height",String(t)),s.setAttribute("fill","none"),s.setAttribute("aria-hidden","true");let l=i.solid?"#ffffff":n;if(i.solid){let c=o.createElementNS(r,"circle");c.setAttribute("cx","12"),c.setAttribute("cy","12"),c.setAttribute("r","12"),c.setAttribute("fill",n),s.appendChild(c);}let a=o.createElementNS(r,"g");if(a.setAttribute("stroke",l),a.setAttribute("stroke-width",i.solid?"2":"1.8"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),i.scale&&i.scale!==1){let c=i.scale,p=12-12*c;a.setAttribute("transform",`translate(${p} ${p}) scale(${c})`);}for(let c of i.paths){let p=o.createElementNS(r,"path");p.setAttribute("d",c),a.appendChild(p);}for(let[c,p]of i.dots??[]){let m=o.createElementNS(r,"circle");m.setAttribute("cx",String(c)),m.setAttribute("cy",String(p)),m.setAttribute("r","0.9"),m.setAttribute("fill",l),m.setAttribute("stroke","none"),a.appendChild(m);}return s.appendChild(a),s}function Xi(o,e){let t=xt(e.size,Qs),n=e.color||"#000000",i=o.createElement("span");if(i.className=`veo-badge-marker veo-badge-marker-${e.kind}`,i.style.display="inline-flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.boxSizing="border-box",i.style.lineHeight="1",e.kind==="image"){let r=o.createElement("img");return r.alt="",r.src=e.imageUrl||"",r.style.width=`${t}px`,r.style.height=`${t}px`,r.style.objectFit="contain",r.style.display="block",i.appendChild(r),i}if(e.kind==="icon-text"){i.style.gap="6px",i.style.color=n,i.style.fontSize=`${t}px`,i.style.fontFamily="inherit",i.style.fontWeight="600",i.style.whiteSpace="nowrap",i.style.background=e.bgColor||"transparent";let r=xt(e.borderWidth,0);r>0&&(i.style.border=`${r}px solid ${e.borderColor||n}`),i.style.padding=`${xt(e.paddingY,6)}px ${xt(e.paddingX,10)}px`,i.style.borderRadius=`${xt(e.radius,999)}px`,e.showIcon!==false&&i.appendChild(qi(o,e.icon||"star",t,n));let s=o.createElement("span");return s.textContent=e.text||"",i.appendChild(s),i}return i.style.width=`${t}px`,i.style.height=`${t}px`,i.appendChild(qi(o,e.icon||"info",t,n)),i}function Ki(o,e,t,n){let i=o.left+o.width,r=o.top+o.height,s=o.top+o.height/2-e.height/2,l=o.left+o.width/2-e.width/2,a,c;switch(t){case "top-left":a=o.left-e.width/2,c=o.top-e.height/2;break;case "bottom-left":a=o.left-e.width/2,c=r-e.height/2;break;case "bottom-right":a=i-e.width/2,c=r-e.height/2;break;case "left":a=o.left-e.width-Vi,c=s;break;case "right":a=i+Vi,c=s;break;case "center":a=l,c=s;break;default:a=i-e.width/2,c=o.top-e.height/2;}return {x:a+n.x,y:c+n.y}}var ta=new Set(["img","input","textarea","select","iframe","video","audio","canvas","br","hr","svg","object","embed"]);function oa(o){let e=o.ownerDocument.defaultView;if(!e||!(o instanceof e.HTMLElement)||ta.has(o.tagName.toLowerCase()))return false;let t=e.getComputedStyle(o);return t.display==="contents"?false:`${t.overflow} ${t.overflowX} ${t.overflowY}`.split(/\s+/).filter(Boolean).every(i=>i==="visible")}function Yi(o,e,t){e.style.position="absolute",e.style.zIndex=String(yt(t.zIndex,ea)),e.style.margin="0";let n=t.position??"top-right",i={x:xt(t.offsetX,0),y:xt(t.offsetY,0)},r=()=>{let a=e.getBoundingClientRect();return {width:a.width,height:a.height}};if(oa(o)){let a=o.ownerDocument.defaultView,c=o.style.position,p=a.getComputedStyle(o).position;(!p||p==="static")&&(o.style.position="relative"),o.appendChild(e);let m=h=>{h.preventDefault(),h.stopPropagation();},u=h=>h.stopPropagation();e.addEventListener("click",m),e.addEventListener("pointerdown",u),e.addEventListener("mousedown",u);let d=()=>{let{x:h,y:v}=Ki({left:-o.clientLeft,top:-o.clientTop,width:o.offsetWidth,height:o.offsetHeight},r(),n,i);e.style.left=`${Math.round(h)}px`,e.style.top=`${Math.round(v)}px`;};d();let f=Jo(o,e,d,{ancestorScroll:false,layoutShift:false});return ()=>{f(),e.removeEventListener("click",m),e.removeEventListener("pointerdown",u),e.removeEventListener("mousedown",u),e.remove(),o.style.position=c;}}o.ownerDocument.body.appendChild(e);let s=()=>{let a=o.getBoundingClientRect(),{x:c,y:p}=Ki({left:a.left+window.scrollX,top:a.top+window.scrollY,width:a.width,height:a.height},r(),n,i);e.style.left=`${Math.round(c)}px`,e.style.top=`${Math.round(p)}px`;};s();let l=Jo(o,e,s);return ()=>{l(),e.remove();}}var dn={left:"flex-start",center:"center",right:"flex-end"},Zi={...dn,distribute:"space-between"},Ji={top:"flex-start",center:"center",bottom:"flex-end"};function na(o,e){let t=o.style;typeof e.background=="string"&&e.background&&(t.background=e.background);for(let n of ["Top","Right","Bottom","Left"]){let i=e[`padding${n}`];typeof i=="number"&&Number.isFinite(i)&&t.setProperty(`padding-${n.toLowerCase()}`,`${i}px`);let r=e[`margin${n}`];typeof r=="number"&&Number.isFinite(r)&&t.setProperty(`margin-${n.toLowerCase()}`,`${r}px`);}typeof e.minHeight=="number"&&Number.isFinite(e.minHeight)&&e.minHeight>0&&(t.minHeight=`${e.minHeight}px`),e.align&&Zi[e.align]&&(t.justifyContent=Zi[e.align],o.classList.add("veo-row--aligned")),e.valign&&Ji[e.valign]&&(t.alignItems=Ji[e.valign]);}var wo=class extends ee{constructor(){super(...arguments);this.themeRowJustify=null;}async render(t){let n=t.nav?.stepIndex??0,i=t.guide.guideSteps[n];if(!i)return;let r=i.badge?.enabled===true,s=(i.position==="relative-to-element"||i.presentation==="inline"||r)&&i.anchorSelector?.trim()||void 0,l=null;if(s&&(l=await le(s),!l))return;let a=i.blocks??[],c=a.length===1&&a[0]?.type==="code"?a[0]:void 0;if(i.presentation==="inline"&&l&&c&&!c.sandboxed){let k=l.ownerDocument??document,{cleanup:P}=Vo(c,k,t,void 0,{anchor:l,pos:cn(i.inlinePosition),...t.isPreview&&c.editorId?{tagBlockId:c.editorId}:{}});this.registerCleanup(P),t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:"shown"});return}let{host:p,root:m}=this.createHost(),u=m.ownerDocument??document,d=i.design??{};typeof d.zIndex=="number"&&(p.style.zIndex=String(yt(d.zIndex,0)));let f=u.createElement("div");f.className="veo-card";let h=Di(t.guide.theme,d),v=i.presentation==="inline",y=!v&&(r||i.position==="relative-to-element");h&&zi(f,h,v,y),this.themeRowJustify=h?k=>_i(h,v,k):null;let E=h?{...Oi(h,v,y),...d}:d;ua(f,E),typeof d.ariaLabel=="string"&&d.ariaLabel.trim()&&(f.setAttribute("role","dialog"),f.setAttribute("aria-label",d.ariaLabel.trim()));let T=(k,P)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:k,...{}});},b=[];if(this.buildContent(f,i.blocks??[],u,t,n,b,p),a.length===0&&(f.classList.add("veo-card--empty"),t.isPreview)){let k=u.createElement("div");k.className="veo-card-empty-zone";let P=u.createElement("b");P.textContent="+";let I=u.createElement("span");I.textContent="Clic para agregar contenido",k.append(P,I),f.appendChild(k);let F=()=>{f.classList.toggle("veo-card--narrow",f.clientWidth<pa);};if(typeof ResizeObserver<"u"){let B=new ResizeObserver(F);B.observe(f),this.registerCleanup(()=>B.disconnect());}F();}let C=f.lastElementChild;C&&!C.style.marginBottom&&(C.style.marginBottom="0");let R=null;if(d.closeButton!==false){let k=pt(u,()=>{if(R){R();return}T("dismissed"),this.closeOrSkip(t);}),P=typeof d.closeColor=="string"?d.closeColor:null,I=typeof d.closeHoverColor=="string"?d.closeHoverColor:null;P&&(k.style.color=P);let F=typeof d.closePosition=="string"?d.closePosition:"top-right";la(k,F);for(let B of ["Top","Right","Bottom","Left"]){let J=d[`closePadding${B}`];typeof J=="number"&&k.style.setProperty(`padding-${B.toLowerCase()}`,`${J}px`);let re=d[`closeMargin${B}`];typeof re=="number"&&k.style.setProperty(`margin-${B.toLowerCase()}`,`${re}px`);}I&&(k.addEventListener("mouseenter",()=>{k.style.color=I;}),k.addEventListener("mouseleave",()=>{k.style.color=P??"";})),f.appendChild(k),aa(f,a,F,E);}if(r&&l){R=this.renderBadgeMode(i,f,l,s,p,m,u,t,n,E);return}if(i.presentation==="inline"&&l){p.style.display="block";let k=cn(i.inlinePosition);m.appendChild(f),be(l,p,k),this.registerCleanup(xe(p,s,k));}else if(i.position==="relative-to-element"&&l){if(d.backdrop===true){let I=u.createElement("div");I.className="veo-composite-overlay veo-composite-overlay--dim",typeof d.backdropColor=="string"&&(I.style.background=d.backdropColor);let F=yt(d.backdropZIndex,2e5);I.style.zIndex=String(F),m.appendChild(I),this.registerCleanup(bt(u)),d.targetAbove===true&&this.registerCleanup(ca(l,F+1));}let k=u.createElement("div");k.className="veo-composite-anchored";let P=d.caret===false?null:er(u,E);P&&k.appendChild(P),k.appendChild(f),m.appendChild(k),this.registerCleanup(await tr(l,k,P));}else {let k=u.createElement("div");k.className="veo-composite-overlay",d.backdrop!==false&&(k.classList.add("veo-composite-overlay--dim"),typeof d.backdropColor=="string"&&(k.style.background=d.backdropColor),typeof d.backdropZIndex=="number"&&(k.style.zIndex=String(yt(d.backdropZIndex,0))),k.addEventListener("click",P=>{P.target===k&&(T("dismissed"),this.closeOrSkip(t));}),this.registerCleanup(bt(u))),ia(f,i.position,d),k.appendChild(f),m.appendChild(k);}t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:"shown"});}buildContent(t,n,i,r,s,l,a){let c=f=>{r.onInteraction({guideId:r.guide.guideId,stepIndex:s,action:"cta_clicked",...f.id?{metadata:{buttonId:f.id}}:{}});},p=(f,h,v)=>(f.dataset.veoBlock=String(v),h.editorId&&(f.dataset.veoBlockId=h.editorId),f),m=(f,h)=>{if(!r.isPreview||!f.editorId)return null;let v=i.createElement("div");return v.className="veo-block-placeholder",v.textContent=h,v},u=(f,h)=>{let v=0;for(;v<h.length;){let{block:y,index:E}=h[v];if(y.type==="button"){let b=i.createElement("div");b.className="veo-guide-actions";let C,R=y.style?.preset;for(;v<h.length&&h[v]?.block.type==="button";){let{block:k,index:P}=h[v];if(!C){let I=k.style?.align;(I==="left"||I==="center"||I==="right")&&(C=I);}b.appendChild(p(this.buildButton(k,i,r,s,l,c),k,P)),v++;}if(C)b.style.justifyContent=dn[C]??"flex-end";else {let k=this.themeRowJustify?.(R);k&&(b.style.justifyContent=k);}f.appendChild(b);continue}if(y.type==="code"){let{node:b,cleanup:C}=Vo(y,i,r,a),R=b??m(y,"Bloque de c\xF3digo");R&&f.appendChild(p(R,y,E)),this.registerCleanup(C),v++;continue}if(y.type==="form"){f.appendChild(p(this.buildForm(y,i,r,s,l,c),y,E)),v++;continue}if(y.type==="checklist"){let b=Ni(y,i,r);Me(b,y.style,"text"),b.style.alignSelf="stretch",b.style.width="100%",f.appendChild(p(b,y,E)),v++;continue}let T=Rt(y,i,{editing:r.isPreview===true})??m(y,y.type==="image"?"Imagen (sin URL)":y.type==="video"?"Video (elige proveedor y pega la URL)":"Bloque vac\xEDo");T&&f.appendChild(p(T,y,E)),v++;}},d=r.guide.guideSteps[s]?.rows;for(let f of oo(n)){let h=Number.isInteger(f.row)?d?.[String(f.row)]:void 0;if(f.columns.length===1&&!h){u(t,f.columns[0].blocks);continue}let v=i.createElement("div");v.className="veo-row",Number.isInteger(f.row)&&(v.dataset.veoRow=String(f.row));for(let y of f.columns){let E=i.createElement("div");E.className="veo-col",u(E,y.blocks),v.appendChild(E);}h&&na(v,h),t.appendChild(v);}}buildForm(t,n,i,r,s,l){let a=n.createElement("div");a.className="veo-form";let c=t.style??{},{marginTop:p,marginBottom:m,...u}=c;for(let[v,y]of [["marginTop",p],["marginBottom",m]])typeof y=="number"&&Number.isFinite(y)&&(a.style[v]=`${y}px`);let d=null;(typeof t.html=="string"&&t.html||typeof t.text=="string"&&t.text)&&(d=n.createElement("div"),d.className="veo-form-question",typeof t.html=="string"&&t.html?d.appendChild(Tt(t.html,n)):d.textContent=t.text,Me(d,u,"text"),a.appendChild(d));let f=d?.textContent?.trim()??"",h=[];for(let v of t.fields??[]){let{wrapper:y,read:E}=on(v,n),T=t.style??{};if(typeof T.scaleColor=="string"&&T.scaleColor&&y.style.setProperty("--veo-scale-color",T.scaleColor),typeof T.scaleSize=="number"&&T.scaleSize>=24&&T.scaleSize<=96&&y.style.setProperty("--veo-scale-size",`${T.scaleSize}px`),d&&(y.querySelector(".veo-form-label")?.remove(),f))for(let C of y.querySelectorAll("input, textarea, select"))C.setAttribute("aria-label",f);let b={field:v,read:E,blockId:t.id??null};s.push(b),h.push(b),a.appendChild(y);}if(t.submit){let v=n.createElement("div");v.className="veo-guide-actions";let y={...t.submit,type:"button"},E=y.style?.align;(E==="left"||E==="center"||E==="right")&&(v.style.justifyContent=dn[E]??"flex-end"),v.appendChild(this.buildButton(y,n,i,r,s,l,h)),a.appendChild(v);}return a}buildButton(t,n,i,r,s,l,a){let c=n.createElement("button");c.type="button",c.className="veo-guide-cta",c.textContent=t.text?.trim()||"OK";let p=t.style??{};(p.preset==="secondary"||p.preset==="link")&&c.classList.add(`veo-guide-cta--${p.preset}`),typeof p.ariaLabel=="string"&&p.ariaLabel.trim()&&c.setAttribute("aria-label",p.ariaLabel.trim()),Me(c,t.style,"button");let m=i.nav?.callbacks,u=h=>{switch(h.action){case "next":m?m.onNext():i.onClose();break;case "prev":m?.onBack();break;case "goto":m?.onGoto&&typeof h.targetStep=="number"?m.onGoto(h.targetStep):i.onClose();break;case "snooze":Fi(i.guide.guideId,typeof h.snoozeEvery=="number"?h.snoozeEvery:1,h.snoozeUnit??"day"),i.onClose();break;case "url":typeof h.url=="string"&&fe(h.url)&&(h.newTab===false?window.location.assign(h.url):window.open(h.url,"_blank","noopener,noreferrer"));break;case "guide":h.targetGuideId&&i.onOpenGuide?.(h.targetGuideId),this.closeOrSkip(i);break;default:this.closeOrSkip(i);}},d=()=>{t.secondAction?.action&&u(t.secondAction);},f=()=>{switch(t.action){case "next":case "prev":case "goto":case "snooze":case "url":case "guide":l(t),u(t),d();break;case "submit-forms":case "submit-forms-advance":case "submit-forms-goto":this.submitForms(s,i,r,c,()=>{l(t),t.action==="submit-forms"||!m?i.onClose():t.action==="submit-forms-goto"&&typeof t.targetStep=="number"&&m.onGoto?m.onGoto(t.targetStep):m.onNext();});break;default:l(t),this.closeOrSkip(i),d();}};return c.addEventListener("click",()=>{a?this.submitForms(a,i,r,c,f):f();}),c}submitForms(t,n,i,r,s){let l={};for(let{field:m,read:u}of t){let d=u();if(d==null||d===""){if(m.required){r.textContent=`Completa "${m.label}"`;return}continue}l[m.key]=d;}if(Object.keys(l).length===0){s();return}r.disabled=true;let a=n.onFormSubmit??(()=>Promise.resolve(true)),c=new Set(t.filter(m=>l[m.field.key]!==void 0).map(m=>m.blockId??"")),p=c.size===1&&[...c][0]||void 0;a(l,{...p?{pollId:p}:{},stepIndex:i}).then(m=>{if(r.disabled=false,!m)return;(!n.nav||i>=n.nav.totalSteps-1)&&n.onInteraction({guideId:n.guide.guideId,stepIndex:i,action:"completed"}),s();});}closeOrSkip(t){t.nav?.callbacks?t.nav.callbacks.onSkip():t.onClose();}renderBadgeMode(t,n,i,r,s,l,a,c,p,m){let u=t.badge?.trigger==="click"?"click":"hover",d=t.badge?.placement==="top"||t.badge?.placement==="left"||t.badge?.placement==="right"?t.badge.placement:"bottom",{host:f,root:h}=this.createDetachedHost(),v=a.createElement("div");v.className="veo-composite-badge",v.setAttribute("role","button"),v.tabIndex=0,v.style.cursor="pointer",v.style.display="inline-flex",v.style.alignItems="center";let y=t.badge?.marker??null;y?v.appendChild(Xi(a,y)):this.buildContent(v,t.badge?.blocks??[],a,c,p,[],s),h.appendChild(v),s.style.display="block",m.fullWidth===true?(n.style.width="auto",n.style.maxWidth="320px"):!n.style.width&&!n.style.maxWidth&&(n.style.maxWidth="320px");let E=a.createElement("div");E.className="veo-composite-anchored",E.style.display="none";let T=m.caret===false?null:er(a,m);if(T&&E.appendChild(T),E.appendChild(n),l.appendChild(E),y)f.style.display="inline-block",this.registerCleanup(Yi(i,f,y));else {f.style.display="inline-block";let F=cn(t.inlinePosition);be(i,f,F),this.registerCleanup(xe(f,r,F));}let b=false,C=null,R=null,k=false,P=()=>{b||(b=true,E.style.display="block",tr(v,E,T,d).then(F=>{b?C=F:F();}),k||(k=true,c.onInteraction({guideId:c.guide.guideId,stepIndex:p,action:"shown"})));},I=()=>{b=false,E.style.display="none",C?.(),C=null;};if(u==="hover"){let F=()=>{R!==null&&(clearTimeout(R),R=null);},B=()=>{F(),R=window.setTimeout(I,150);};v.addEventListener("mouseenter",()=>{F(),P();}),v.addEventListener("mouseleave",B),v.addEventListener("focus",P),E.addEventListener("mouseenter",F),E.addEventListener("mouseleave",B);}else v.addEventListener("click",()=>{b?I():P();});return this.registerCleanup(()=>{C?.(),R!==null&&clearTimeout(R);}),c.badgeOpen&&P(),I}};function cn(o){return o==="before"||o==="prepend"||o==="append"?o:"after"}function ia(o,e,t){let n=o.style;n.position="fixed";let i=16,r=d=>typeof t[d]=="number"&&Number.isFinite(t[d])?t[d]:0;n.margin="0";let s=t.hAlign==="left"?"left":t.hAlign==="right"?"right":null,l=e.includes("top")?"top":e.includes("bottom")?"bottom":"middle",a=s??(e.includes("left")?"left":e.includes("right")?"right":"middle");l==="top"?n.top=`${i+r("marginTop")}px`:l==="bottom"?n.bottom=`${i+r("marginBottom")}px`:n.top="50%",a==="left"?n.left=`${i+r("marginLeft")}px`:a==="right"?n.right=`${i+r("marginRight")}px`:n.left="50%";let c=r("marginLeft")-r("marginRight"),p=r("marginTop")-r("marginBottom"),m=a==="middle"?`calc(-50% + ${c}px)`:"0",u=l==="middle"?`calc(-50% + ${p}px)`:"0";n.transform=m==="0"&&u==="0"?"":`translate(${m}, ${u})`;}var Qi="10px",ra=42,sa=20;function aa(o,e,t,n){if(e.length===0)return;let i=t.includes("bottom")?"Bottom":"Top";if((i==="Top"?e[0]:e[e.length-1])?.type==="image")return;let s=n[`closeMargin${i}`],l=ra+(typeof s=="number"?s:0),a=n[`padding${i}`];(typeof a=="number"?a:sa)<l&&o.style.setProperty(`padding-${i.toLowerCase()}`,`${l}px`);}function la(o,e){let t=o.style;t.top="auto",t.right="auto",t.bottom="auto",t.left="auto";let n=e.includes("bottom")?"bottom":"top",i=e.includes("left")?"left":"right";t.setProperty(n,Qi),t.setProperty(i,Qi);}function er(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}`,t.dataset.veoBorder=String(e.borderWidth);}return t}function ca(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(yt(e,0)),()=>{t.style.position=n,t.style.zIndex=i;}}async function tr(o,e,t,n="bottom"){let i=async()=>{let{x:s,y:l,placement:a,middlewareData:c}=await Be(o,e,{placement:n,strategy:"fixed",middleware:[Ie(t?10:8),Ne(),$e({padding:8}),...t?[st({element:t})]:[]]});e.style.left=`${s}px`,e.style.top=`${l}px`,t&&at(t,a,c.arrow);};await i();let r=()=>{i();};return window.addEventListener("scroll",r,true),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,true),window.removeEventListener("resize",r);}}var da=120,pa=260;function ua(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;e.colorMode==="dark"&&(t.background="#1f1d1b",t.color="#f5f0eb",o.classList.add("veo-card--dark")),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=c=>typeof e[c]=="number"?e[c]:0;t.boxShadow=`${a("shadowX")}px ${a("shadowY")}px ${a("shadowBlur")}px ${a("shadowSpread")}px ${i(e.shadowColor)??"rgba(0,0,0,0.2)"}`;}let l=typeof e.width=="number"&&Number.isFinite(e.width)?`${Math.max(da,e.width)}px`:null;e.fullWidth===true?t.width="100%":e.widthType==="fluid"?(t.width="100%",l&&(t.maxWidth=l)):l&&(t.width=l);for(let a of ["Top","Right","Bottom","Left"]){let c=n(e[`padding${a}`]);c&&t.setProperty(`padding-${a.toLowerCase()}`,c);let p=n(e[`margin${a}`]);p&&t.setProperty(`margin-${a.toLowerCase()}`,p);}}var ma={mode:"floating",position:"bottom-right"},or=16,fa=360,Eo=class extends ee{async render(e){let t=e.guide.guideSteps[0];if(!t||typeof t.html!="string"||t.html.length===0)return;let n=t.placement??ma,i=null;if(n.mode==="anchored"){let p=n.selector??t.selector??e.guide.activationRules.selector;if(typeof p!="string"||p.length===0||(i=await le(p),!i))return}let{root:r}=this.createHost(),s=r.ownerDocument??document,l=s.createElement("div");l.className=n.mode==="anchored"?"veo-custom-anchored":"veo-custom-floating";let{iframe:a,cleanup:c}=Mt(s,t,e,{width:Uo(n.width??fa),fixedHeight:n.height??null});this.registerCleanup(c),l.appendChild(a),r.appendChild(l),n.mode==="floating"?ha(l,n):i&&this.registerCleanup(await this.setupAnchoredPosition(i,l,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:l,y:a}=await Be(e,t,{placement:i,strategy:"fixed",middleware:[Ie(n.offsetY??8),Ne(),$e({padding:8})]});t.style.left=`${l}px`,t.style.top=`${a}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 ha(o,e){let t=e.position??"bottom-right",n=`${e.offsetX??or}px`,i=`${e.offsetY??or}px`,r=o.style;if(t==="center"){r.top="50%",r.left="50%",r.transform="translate(-50%, -50%)";return}let[s,l]=t.split("-");s==="top"?r.top=i:r.bottom=i,l==="left"?r.left=n:l==="right"?r.right=n:(r.left="50%",r.transform="translateX(-50%)");}var ko=class extends ee{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",yo(s,e,i),r.appendChild(s),n.appendChild(r),this.registerCleanup(bt(i));let l=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();};r.addEventListener("click",c=>{c.target===r&&l();});let a=c=>{c.key==="Escape"&&l();};document.addEventListener("keydown",a),this.registerCleanup(()=>document.removeEventListener("keydown",a)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var Co=class extends ee{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 le(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=De(t.style);be(i,r,l),this.registerCleanup(xe(r,n,l));let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-custom-inline";let{iframe:p,cleanup:m}=Mt(a,t,e,{width:"100%"});this.registerCleanup(m),c.appendChild(p),s.appendChild(c),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var So=class extends ee{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 le(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=De(t.style);be(i,r,l),this.registerCleanup(xe(r,n,l)),this.applyDesign(t.style);let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-inline",yo(c,e,a),s.appendChild(c),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var Lo=class extends ee{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 le(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=De(t.style);be(i,r,l),this.registerCleanup(xe(r,n,l)),this.applyDesign(t.style);let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-inline";let p=(u,d,f)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:u,...f?{metadata:f}:{}}),d&&window.open(d,"_blank","noopener,noreferrer"),e.onClose();},m=ge(t,a,{onCtaClick:(u,d,f)=>{p("cta_clicked",u==="url"?d:void 0,f),u==="guide"&&d&&e.onOpenGuide?.(d);},onDismiss:()=>p("dismissed")});c.appendChild(m),s.appendChild(c),this.liveContainer=c,this.liveContent=m,this.liveKey=`${n}|${l}`,this.liveBuild=u=>ge(u,a,{onCtaClick:(d,f,h)=>{p("cta_clicked",d==="url"?f:void 0,h),d==="guide"&&f&&e.onOpenGuide?.(f);},onDismiss:()=>p("dismissed")}),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(e){return `${e.selector??""}|${De(e.style)}`}};function nr(o){return o.style?.backdrop===false?"veo-modal-overlay veo-modal-overlay--none":"veo-modal-overlay"}var no=class extends ee{constructor(){super(...arguments);this.overlay=null;this.releaseScroll=null;}syncScrollLock(t){let n=t.style?.backdrop!==false;n&&!this.releaseScroll?this.releaseScroll=bt(this.host?.ownerDocument??document):!n&&this.releaseScroll&&(this.releaseScroll(),this.releaseScroll=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,l=s.createElement("div");l.className=nr(i),this.overlay=l,this.syncScrollLock(i);let a=s.createElement("div");a.className="veo-modal-card";let c=(d,f,h)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:n,action:d,...h?{metadata:h}:{}}),f&&window.open(f,"_blank","noopener,noreferrer"),t.onClose();},p=()=>{t.nav?t.nav.callbacks.onSkip():c("dismissed");},m=t.nav?Ht(i,t.nav.stepIndex,t.nav.totalSteps,s,t.nav.callbacks):ge(i,s,{onCtaClick:(d,f,h)=>{c("cta_clicked",d==="url"?f:void 0,h),d==="guide"&&f&&t.onOpenGuide?.(f);},onDismiss:()=>c("dismissed")});a.appendChild(m),l.appendChild(a),r.appendChild(l),t.nav||(this.liveContainer=a,this.liveContent=m,this.liveBuild=d=>ge(d,s,{onCtaClick:(f,h,v)=>{c("cta_clicked",f==="url"?h:void 0,v),f==="guide"&&h&&t.onOpenGuide?.(h);},onDismiss:()=>c("dismissed")})),l.addEventListener("click",d=>{d.target===l&&p();});let u=d=>{d.key==="Escape"&&p();};document.addEventListener("keydown",u),this.registerCleanup(()=>document.removeEventListener("keydown",u)),t.nav||t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:"shown"});}onLiveUpdate(t){this.overlay&&(this.overlay.className=nr(t)),this.syncScrollLock(t);}destroy(){this.overlay=null,this.releaseScroll?.(),this.releaseScroll=null,super.destroy();}};var To=class extends ee{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 le(i);if(!r)return;let s=n.style?.tooltipPlacement;this.side=s==="top"||s==="left"||s==="right"?s:"bottom";let{root:l}=this.createHost();this.applyDesign(n.style);let a=l.ownerDocument??document,c=a.createElement("div");c.className="veo-tooltip";let p=(h,v,y)=>{t.onInteraction({guideId:t.guide.guideId,stepIndex:0,action:h,...y?{metadata:y}:{}}),v&&window.open(v,"_blank","noopener,noreferrer"),t.onClose();},m=ge(n,a,{onCtaClick:(h,v,y)=>{p("cta_clicked",h==="url"?v:void 0,y),h==="guide"&&v&&t.onOpenGuide?.(v);},onDismiss:()=>p("dismissed")});c.appendChild(m);let u=a.createElement("div");u.className="veo-tooltip-arrow",c.appendChild(u),l.appendChild(c);let d=async()=>{let{x:h,y:v,placement:y,middlewareData:E}=await Be(r,c,{placement:this.side,middleware:[Ie(10),Ne(),$e({padding:8}),st({element:u})]});c.style.left=`${h}px`,c.style.top=`${v}px`,at(u,y,E.arrow);};await d();let f=()=>{d();};this.reposition=f,window.addEventListener("scroll",f,true),window.addEventListener("resize",f),this.registerCleanup(()=>{window.removeEventListener("scroll",f,true),window.removeEventListener("resize",f);}),this.liveContainer=c,this.liveContent=m,this.liveKey=i,this.liveBuild=h=>ge(h,a,{onCtaClick:(v,y,E)=>{p("cta_clicked",v==="url"?y:void 0,E),v==="guide"&&y&&t.onOpenGuide?.(y);},onDismiss:()=>p("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 Ao=class extends ee{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 le(n,5e3);if(!i)return false;let r=t.style?.tooltipPlacement,s=r==="top"||r==="left"||r==="right"?r:"bottom",{root:l}=this.createHost();this.applyDesign(t.style);let a=l.ownerDocument??document,c=a.createElement("div");c.className="veo-walkthrough";let p=Ht(t,e.currentStepIndex,e.guide.guideSteps.length,a,e.callbacks);c.appendChild(p);let m=a.createElement("div");m.className="veo-walkthrough-arrow",c.appendChild(m),l.appendChild(c);let u=async()=>{let{x:f,y:h,placement:v,middlewareData:y}=await Be(i,c,{placement:s,middleware:[Ie(10),Ne(),$e({padding:8}),st({element:m})]});c.style.left=`${f}px`,c.style.top=`${h}px`,at(m,v,y.arrow);};await u();let d=()=>{u();};return window.addEventListener("scroll",d,true),window.addEventListener("resize",d),this.registerCleanup(()=>{window.removeEventListener("scroll",d,true),window.removeEventListener("resize",d);}),true}};var ga="__veo_preview__",pn=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"&&e.badgeOpen===true==(this.input.badgeOpen===true)&&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=va(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),l=n.guideSteps[s];l&&(n.guideSteps=[l]);let a=this.renderSingleStep(n);return {close:()=>this.close(),ready:a,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 ee?this.walkthrough.hostElement():null}close(e=false){let t=e?this.input?.onClosed:void 0;this.singleStep&&(wt(this.singleStep),this.singleStep=null),this.walkthrough&&(wt(this.walkthrough),this.walkthrough=null),this.walkthroughGuide=null,this.walkthroughIndex=0,this.input=null,t?.();}async renderSingleStep(e){let t=ba(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(!0),badgeOpen:this.input?.badgeOpen??Vt(this.input?.activationRules),onTrack:()=>{},onOpenGuide:()=>{},onFormSubmit:this.input?.formSubmit??(()=>Promise.resolve(!0)),...this.input?.fetchProgress?{fetchProgress:this.input.fetchProgress}:{},isPreview:!0,...this.input?.formSubmit&&this.input.formSubmitNote!==void 0?{previewNote:this.input.formSubmitNote}:{}});}catch{return this.close(),{rendered:false}}return this.singleStep!==t?(wt(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&&(wt(this.walkthrough),this.walkthrough=null);let n={onNext:()=>{let a=this.walkthroughIndex+1;if(a>=t.guideSteps.length){this.close();return}this.walkthroughIndex=a,this.renderWalkthroughStep(a);},onBack:()=>{let a=this.walkthroughIndex-1;a<0||(this.walkthroughIndex=a,this.renderWalkthroughStep(a));},onSkip:()=>this.close(),onComplete:()=>this.close()},r=t.guideSteps[e]?.style?.render;if(r==="modal"||r==="banner"){let a=r==="modal"?new no:new to;try{a.render({guide:t,onInteraction:()=>{},onClose:()=>this.close(!0),nav:{stepIndex:e,totalSteps:t.guideSteps.length,callbacks:n}});}catch{return wt(a),false}return this.walkthroughGuide!==t?(wt(a),false):(this.walkthrough=a,true)}let s=new Ao,l=false;try{l=await s.render({guide:t,currentStepIndex:e,callbacks:n});}catch{l=false;}return !l||this.walkthroughGuide!==t?(wt(s),false):(this.walkthrough=s,true)}},Ro=null;function Mo(o){return Ce()?(Ro||(Ro=new pn),Ro.preview(o)):{close:()=>{},ready:Promise.resolve({rendered:false}),host:()=>null}}function qe(){Ro?.close();}function va(o){let e=o.activationRules?.selector,t={url:o.activationRules?.url??{type:"prefix",pattern:"/"},trigger:"immediate",...e!==void 0?{selector:e}:{}};return {guideId:ga,guideName:o.guideName??"Preview",guideType:o.guideType,guideSteps:o.guideSteps,activationRules:t,displayFrequency:"always",displayPriority:0,...o.theme?{theme:o.theme}:{}}}function ba(o){switch(o){case "modal":return new no;case "banner":return new to;case "tooltip":return new To;case "custom":return new Eo;case "inline":return new Lo;case "inline-custom":return new Co;case "form":return new ko;case "inline-form":return new So;case "badge":return new bo;case "composite":return new wo;case "walkthrough":return null;default:return null}}function wt(o){try{o.destroy();}catch{}}function ir(o){let e=[o];try{let t=new URL(o);e.push(`${t.pathname}${t.search}${t.hash}`),t.hash.startsWith("#/")&&e.push(t.hash.slice(1));}catch{}return e}function ya(o,e){let t=ir(e);switch(o.type){case "exact":return t.some(n=>n===o.pattern);case "prefix":return t.some(n=>n.startsWith(o.pattern));case "regex":try{let n=new RegExp(o.pattern);return t.some(i=>n.test(i))}catch{return false}}}function rr(o,e){return !o||o.scope==="sitewide"?true:o.scope==="pages"?(o.rules??[]).some(n=>xa(n,e)):o.pattern?ya({type:o.matchType??"prefix",pattern:o.pattern},e):true}function xa(o,e){let t=o.pattern.toLowerCase(),n=ir(e).map(i=>i.toLowerCase());switch(o.type){case "exact":return n.some(i=>i===t);case "prefix":return n.some(i=>i.startsWith(t));case "contains":return n.some(i=>i.includes(t));case "regex":try{let i=new RegExp(o.pattern,"i");return n.some(r=>i.test(r))}catch{return false}default:return false}}var Dt="veo-builder";var Po=64,Io=128,wa={bolt:'<path stroke-linecap="round" stroke-linejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"/>',desktop:'<path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"/>',updown:'<path stroke-linecap="round" stroke-linejoin="round" d="M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"/>',map:'<path stroke-linecap="round" stroke-linejoin="round" d="M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z"/>',eye:'<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"/><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>',chevronDown:'<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>',chevronUp:'<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 15.75 7.5-7.5 7.5 7.5"/>',plus:'<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/>',pencil:'<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"/>',copy:'<path stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"/>',trash:'<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>',cursor:'<path stroke-linecap="round" stroke-linejoin="round" d="M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59"/>',spinner:'<path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"/>'};function ke(o,e=20){return `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true">${wa[o]}</svg>`}function Ea(o){if(!o)return "";let e=new Date(o);return Number.isNaN(e.getTime())?"":e.toLocaleDateString("es",{day:"numeric",month:"short"}).replace(".","")}function te(o,e,t){let n=document.createElement(o);return n.className=e,t!==void 0&&(n.innerHTML=t),n}function un(o,e,t=""){let n=te("button",`veo-tb-icon ${t}`.trim(),ke(o));return n.type="button",n.title=e,n.setAttribute("aria-label",e),n}function ar(o){if(!ye()||!Ce())return {setState:()=>{},height:()=>0,dock:()=>"top",setPreview:()=>{},setHidden:()=>{},onHeightChange:()=>{},teardown:()=>{}};let e=document.createElement("div");e.setAttribute("data-veo-builder-chrome",""),e.setAttribute("data-veo-ignore","");let t=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=ka;let i=te("div","veo-chrome"),r=te("div","veo-tb"),s=te("div","veo-tb-brand",ke("bolt",18)),l=te("div","veo-tb-name"),a=te("span","veo-tb-status");a.hidden=true;let c=te("span","veo-tb-sep"),p=te("div","veo-tb-app",`${ke("desktop",16)}<span></span>`);p.querySelector("span").textContent=o.appLabel;let m=te("div","veo-tb-left");m.append(s,l,a,c,p);let u=te("div","veo-tb-right"),d=un("updown","Mover la barra abajo"),f=un("map","Mostrar el editor"),h=un("eye","Vista previa"),v=te("button","veo-tb-text","Salir");v.type="button";let y=te("div","veo-tb-save"),E=te("button","veo-tb-save-main","<span>Guardar</span>");E.type="button";let T=te("button","veo-tb-save-more",ke("chevronDown",16));T.type="button",T.title="M\xE1s opciones de guardado",T.setAttribute("aria-label","M\xE1s opciones de guardado");let b=te("div","veo-tb-menu"),C=te("button","veo-tb-menu-item","Guardar y salir");C.type="button",b.append(C),b.hidden=true,y.append(E,T,b),u.append(d,f,h,te("span","veo-tb-vsep"),v,y),r.append(m,u);let R=te("div","veo-steps"),k=te("div","veo-steps-list");R.append(k);let P=te("button","veo-steps-toggle");P.type="button",i.append(r,R,P);let I=te("div","veo-preview-pill"),F=te("span","veo-preview-label",`${ke("eye",18)}<span>Est\xE1s en vista previa</span>`),B=te("button","veo-preview-exit","Salir");B.type="button",I.append(F,B),I.hidden=true,t.append(n,i,I),document.body.appendChild(e);let J=document.documentElement,re=J.style.marginTop,oe=J.style.marginBottom,ie=false,K="top",Q=false,ne=false,ce=null,se=false,lt=()=>Po+(ie||se?0:Io),Te=()=>{let U=Q||ne?0:lt();J.style.marginTop=K==="top"?`${U}px`:re,J.style.marginBottom=K==="bottom"?`${U}px`:oe,i.style.setProperty("--veo-chrome-h",`${lt()}px`),i.classList.toggle("is-bottom",K==="bottom"),R.hidden=ie||se,P.hidden=se,h.hidden=se,y.hidden=se,f.title=se?"Mostrar el panel":"Mostrar el editor";let ze=K==="top"?"chevronUp":"chevronDown",Ae=K==="top"?"chevronDown":"chevronUp";P.innerHTML=`<span>${ie?"Mostrar pasos":"Ocultar pasos"}</span>${ke(ie?Ae:ze,16)}`,d.title=K==="top"?"Mover la barra abajo":"Mover la barra arriba",d.setAttribute("aria-label",d.title),ce?.(U);},_e=U=>{Q=U,i.hidden=U||ne,I.hidden=!U,Te();},Et=U=>{ne=U,i.hidden=U||Q,Te();};P.addEventListener("click",()=>{ie=!ie,Te();});let ae=U=>o.onAction(U);d.addEventListener("click",()=>{K=K==="top"?"bottom":"top",Te(),ae({action:"dock",position:K});}),f.addEventListener("click",()=>ae({action:"show-panel"})),h.addEventListener("click",()=>ae({action:"preview"})),B.addEventListener("click",()=>ae({action:"exit-preview"})),v.addEventListener("click",()=>ae({action:"exit"})),E.addEventListener("click",()=>ae({action:"save",exit:false})),T.addEventListener("click",U=>{U.stopPropagation(),b.hidden=!b.hidden;}),C.addEventListener("click",()=>{b.hidden=true,ae({action:"save",exit:true});});let zt=()=>{b.hidden=true;};document.addEventListener("click",zt);let ro=null,Oe=()=>{let U=ro;if(!U)return;let ze=U.variant==="tagging";ze!==se&&(se=ze,Te());let Ae=Ea(U.createdAt);l.textContent=se?U.guideName.trim()||"Modo tagging":`${U.guideName.trim()||"Sin nombre"}${Ae?` \xB7 ${Ae}`:""}`,U.status?(a.hidden=false,a.textContent=U.status.label,a.dataset.tone=U.status.tone,a.title="Estado de la gu\xEDa (se cambia desde la lista de gu\xEDas)"):a.hidden=true,E.innerHTML=U.saving?`${ke("spinner",16)}<span>Guardando\u2026</span>`:"<span>Guardar</span>",E.disabled=U.saving,C.disabled=U.saving,k.replaceChildren();let Gt=sr(ke("cursor",22),"Activaci\xF3n",U.section==="activation");Gt.addEventListener("click",()=>ae({action:"select-activation"})),k.append(Gt),U.steps.forEach((Ye,ct)=>{let Ft=Ye.presentation==="inline"?'<div class="veo-thumb veo-thumb-inline"><i></i><i></i><i></i></div>':'<div class="veo-thumb"><i></i><i></i><b></b></div>',Do=U.section==="step"||U.section==="block"||U.section==="add-block"||U.section==="row"||U.section==="structure",Ze=sr(Ft,Ye.label,Do&&U.activeStep===ct,{canRemove:true,onEdit:()=>ae({action:"select-step",index:ct}),onDuplicate:()=>ae({action:"duplicate-step",index:ct}),onRemove:()=>ae({action:"remove-step",index:ct})});k.append(Ze);});let Xe=te("button","veo-step-add",`${ke("plus",18)}<span>Agregar paso</span>`);Xe.type="button",Xe.addEventListener("click",()=>ae({action:"add-step"})),k.append(Xe);};return Te(),{setState:U=>{ro=U,Oe();},height:lt,dock:()=>K,setPreview:_e,setHidden:Et,onHeightChange:U=>{ce=U;},teardown:()=>{document.removeEventListener("click",zt),J.style.marginTop=re,J.style.marginBottom=oe,e.remove();}}}function sr(o,e,t,n){let i=`veo-step${t?" is-active":""}`;if(!n){let a=te("button",i,`<div class="veo-step-box">${o}</div><span class="veo-step-label"></span>`);return a.type="button",a.querySelector(".veo-step-label").textContent=e,a.setAttribute("aria-pressed",t?"true":"false"),a}let r=te("div",i,`<div class="veo-step-box">${o}<div class="veo-step-hover"><div class="veo-step-hover-top"><button type="button" class="veo-step-icon veo-step-remove" title="Eliminar paso" aria-label="Eliminar paso">${ke("trash",14)}</button><button type="button" class="veo-step-icon veo-step-duplicate" title="Duplicar paso" aria-label="Duplicar paso">${ke("copy",14)}</button></div><div class="veo-step-hover-main"><button type="button" class="veo-step-edit">${ke("pencil",14)}<span>Editar</span></button></div></div></div><span class="veo-step-label"></span>`);r.querySelector(".veo-step-label").textContent=e,r.setAttribute("aria-current",t?"step":"false");let s=r.querySelector(".veo-step-remove");s.disabled=!n.canRemove,n.canRemove||(s.title="La gu\xEDa necesita al menos un paso");let l=(a,c)=>{r.querySelector(a)?.addEventListener("click",p=>{p.stopPropagation(),c();});};return l(".veo-step-edit",n.onEdit),l(".veo-step-duplicate",n.onDuplicate),l(".veo-step-remove",n.onRemove),r.addEventListener("click",n.onEdit),r}var ka=`
|
|
711
711
|
:host { all: initial; }
|
|
712
712
|
.veo-chrome {
|
|
713
713
|
position: fixed; top: 0; left: 0; right: 0;
|
|
@@ -722,7 +722,7 @@ ${o}
|
|
|
722
722
|
.veo-chrome.is-bottom { top: auto; bottom: 0; flex-direction: column-reverse; }
|
|
723
723
|
.veo-chrome.is-bottom .veo-tb-menu { top: auto; bottom: calc(100% + 8px); }
|
|
724
724
|
.veo-chrome.is-bottom .veo-steps { border-bottom: 0; border-top: 1px solid #d6cfc8; }
|
|
725
|
-
.veo-chrome.is-bottom .veo-steps-toggle { top: auto; bottom: var(--veo-chrome-h, ${
|
|
725
|
+
.veo-chrome.is-bottom .veo-steps-toggle { top: auto; bottom: var(--veo-chrome-h, ${Po+Io}px); transform: translate(-50%, 50%); }
|
|
726
726
|
.veo-preview-pill {
|
|
727
727
|
position: fixed; top: 28px; left: 50%; transform: translateX(-50%);
|
|
728
728
|
z-index: 2147483646;
|
|
@@ -736,7 +736,7 @@ ${o}
|
|
|
736
736
|
.veo-preview-exit { border: 0; background: transparent; color: #fff; font: inherit; cursor: pointer; padding: 0 2px; }
|
|
737
737
|
.veo-preview-exit:hover { text-decoration: underline; }
|
|
738
738
|
.veo-tb {
|
|
739
|
-
height: ${
|
|
739
|
+
height: ${Po}px; box-sizing: border-box;
|
|
740
740
|
display: flex; align-items: center; justify-content: space-between;
|
|
741
741
|
padding: 0 20px; gap: 16px;
|
|
742
742
|
background: #2b2623; color: #fff;
|
|
@@ -784,7 +784,7 @@ ${o}
|
|
|
784
784
|
}
|
|
785
785
|
.veo-tb-menu-item:hover { background: #f5efe9; }
|
|
786
786
|
.veo-steps {
|
|
787
|
-
height: ${
|
|
787
|
+
height: ${Io}px; box-sizing: border-box;
|
|
788
788
|
background: #e7e1dc; border-bottom: 1px solid #d6cfc8;
|
|
789
789
|
padding: 16px 28px 0; overflow-x: auto;
|
|
790
790
|
}
|
|
@@ -829,18 +829,18 @@ ${o}
|
|
|
829
829
|
.veo-step-add { border: 0; background: transparent; font: inherit; font-size: 15px; color: #6b635d; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 64px; padding: 0 8px; }
|
|
830
830
|
.veo-step-add:hover { color: #2b2623; }
|
|
831
831
|
.veo-steps-toggle {
|
|
832
|
-
position: absolute; left: 50%; top: var(--veo-chrome-h, ${
|
|
832
|
+
position: absolute; left: 50%; top: var(--veo-chrome-h, ${Po+Io}px);
|
|
833
833
|
transform: translate(-50%, -50%);
|
|
834
834
|
border: 0; background: #2b2623; color: #fff; font: inherit; font-size: 14px; font-weight: 500;
|
|
835
835
|
border-radius: 999px; padding: 10px 18px; cursor: pointer;
|
|
836
836
|
display: inline-flex; align-items: center; gap: 8px;
|
|
837
837
|
box-shadow: 0 6px 18px rgba(0,0,0,0.25);
|
|
838
838
|
}
|
|
839
|
-
`;var
|
|
839
|
+
`;var Ca="/guides/design",Sa=484,La=660,$o=320,fn=320,Ke=16,hn=52;function lr(o){if(!ye()||!Ce())return {target:()=>null,frameRect:()=>null,teardown:()=>{},setTitle:()=>{},setVisible:()=>{},isVisible:()=>false,setTopOffset:()=>{},setSize:()=>{}};let e=Ma(o),t=document.createElement("div");t.setAttribute("data-veo-builder-panel","");let n=t.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=Pa;let r=document.createElement("div");r.className="veo-panel";let s=o.topOffset??0,l=40,a=s+Ke;r.style.left=`${l}px`,r.style.top=`${a}px`,r.style.width=`${Sa}px`,r.style.height=`${La}px`;let c=document.createElement("div");c.className="veo-panel-header";let p=document.createElement("span");p.className="veo-panel-grip",p.setAttribute("aria-hidden","true"),p.textContent="\xB7\xB7\xB7";let m=document.createElement("span");m.className="veo-panel-title",m.textContent="OnUser \xB7 Editor";let u=document.createElement("div");u.className="veo-panel-actions";let d=mn(Ta,"Abrir en ventana aparte"),f=mn(Aa,"Maximizar"),h=mn(Ra,"Minimizar");u.append(d,f,h),c.append(p,m,u);let v=document.createElement("iframe");v.className="veo-panel-frame",v.title="Editor de Veo",v.src=e;let y=document.createElement("div");y.className="veo-panel-resize",y.setAttribute("aria-hidden","true"),r.append(c,v,y),n.append(i,r),document.body.appendChild(t);let E=true,T=false,b=null,C=B=>{E=B,r.style.display=B&&!(P&&!P.closed)?"":"none";};h.addEventListener("click",()=>C(false));let R=null,k=B=>{T||P&&!P.closed||(B?(R||(R={w:r.offsetWidth,h:r.offsetHeight}),r.style.minHeight="0",r.style.width=`${_t(Math.round(B.width),$o,window.innerWidth-Ke*2)}px`,r.style.height=`${_t(Math.round(B.height)+hn,hn+80,window.innerHeight-a-Ke)}px`):R&&(r.style.minHeight="",r.style.width=`${R.w}px`,r.style.height=`${R.h}px`,R=null));};f.addEventListener("click",()=>{T=!T,T?(b={left:l,top:a,w:r.offsetWidth,h:r.offsetHeight},l=Ke,a=s+Ke,r.style.left=`${l}px`,r.style.top=`${a}px`,r.style.width=`${Math.max($o,window.innerWidth-Ke*2)}px`,r.style.height=`${Math.max(fn,window.innerHeight-a-Ke)}px`,f.title="Restaurar"):b&&(l=b.left,a=b.top,r.style.left=`${l}px`,r.style.top=`${a}px`,r.style.width=`${b.w}px`,r.style.height=`${b.h}px`,f.title="Maximizar");});let P=null,I,F=()=>{I!==void 0&&(clearInterval(I),I=void 0);};return d.addEventListener("click",()=>{let B=window.open(e,"veo-editor",`popup,width=${Math.round(r.offsetWidth)},height=${Math.round(r.offsetHeight)+60}`);B&&(P=B,r.style.display="none",I=setInterval(()=>{P?.closed&&(F(),o.onClose());},600));}),c.addEventListener("mousedown",B=>{if(B.target?.closest(".veo-panel-btn"))return;B.preventDefault();let J=B.clientX,re=B.clientY,oe=l,ie=a;v.style.pointerEvents="none";let K=ne=>{l=_t(oe+(ne.clientX-J),0,Math.max(0,window.innerWidth-r.offsetWidth)),a=_t(ie+(ne.clientY-re),s,Math.max(s,window.innerHeight-40)),r.style.left=`${l}px`,r.style.top=`${a}px`;},Q=()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",Q),v.style.pointerEvents="";};window.addEventListener("mousemove",K),window.addEventListener("mouseup",Q);}),y.addEventListener("mousedown",B=>{B.preventDefault(),B.stopPropagation();let J=B.clientX,re=B.clientY,oe=r.offsetWidth,ie=r.offsetHeight;v.style.pointerEvents="none";let K=ne=>{r.style.width=`${_t(oe+(ne.clientX-J),$o,window.innerWidth)}px`,r.style.height=`${_t(ie+(ne.clientY-re),fn,window.innerHeight)}px`;},Q=()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",Q),v.style.pointerEvents="";};window.addEventListener("mousemove",K),window.addEventListener("mouseup",Q);}),{target:()=>P&&!P.closed?P:v.contentWindow,frameRect:()=>P&&!P.closed?null:v.getBoundingClientRect(),teardown:()=>{F(),P&&!P.closed&&P.close(),t.remove();},setTitle:B=>{m.textContent=B;},setVisible:C,setSize:k,isVisible:()=>E,setTopOffset:B=>{s=B,a<s+Ke&&(a=s+Ke,r.style.top=`${a}px`);}}}var Ta='<path stroke-linecap="round" stroke-linejoin="round" d="m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"/>',Aa='<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"/>',Ra='<path stroke-linecap="round" stroke-linejoin="round" d="M5 12h14"/>';function mn(o,e){let t=document.createElement("button");return t.className="veo-panel-btn",t.type="button",t.title=e,t.setAttribute("aria-label",e),t.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true">${o}</svg>`,t}function _t(o,e,t){return Math.min(Math.max(o,e),t)}function Ma(o){let e=o.panelPath??Ca,t=new URL(e,o.dashboardOrigin);return t.searchParams.set("veoToken",o.token),t.searchParams.set("veoApp",o.appOrigin),o.guide&&t.searchParams.set("veoGuide",o.guide),t.toString()}var Pa=`
|
|
840
840
|
:host { all: initial; }
|
|
841
841
|
.veo-panel {
|
|
842
842
|
position: fixed;
|
|
843
|
-
min-width: ${
|
|
843
|
+
min-width: ${$o}px; min-height: ${fn}px;
|
|
844
844
|
max-width: 96vw; max-height: 94vh;
|
|
845
845
|
display: flex; flex-direction: column;
|
|
846
846
|
background: #fff;
|
|
@@ -851,7 +851,7 @@ ${o}
|
|
|
851
851
|
font-family: system-ui, -apple-system, sans-serif;
|
|
852
852
|
}
|
|
853
853
|
.veo-panel-header {
|
|
854
|
-
position: relative; flex: 0 0 auto; height: ${
|
|
854
|
+
position: relative; flex: 0 0 auto; height: ${hn}px; box-sizing: border-box;
|
|
855
855
|
display: flex; align-items: center; justify-content: space-between;
|
|
856
856
|
padding: 10px 14px 0 22px;
|
|
857
857
|
background: #fbf8f5; color: #1c1917; border-bottom: 1px solid #e8e2dc;
|
|
@@ -880,7 +880,7 @@ ${o}
|
|
|
880
880
|
linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.25) 50%, rgba(0,0,0,0.25) 60%,
|
|
881
881
|
transparent 60%, transparent 72%, rgba(0,0,0,0.25) 72%, rgba(0,0,0,0.25) 82%, transparent 82%);
|
|
882
882
|
}
|
|
883
|
-
`;var
|
|
883
|
+
`;var Ia=["n","s","e","w","ne","nw","se","sw"],dr=`
|
|
884
884
|
.veo-mnp-card {
|
|
885
885
|
outline: 1.5px dashed rgba(255, 91, 53, 0.75);
|
|
886
886
|
outline-offset: 2px;
|
|
@@ -915,11 +915,11 @@ ${o}
|
|
|
915
915
|
.veo-mnp-sw { bottom: -4px; left: -4px; width: 12px; height: 12px; cursor: nesw-resize; }
|
|
916
916
|
.veo-mnp-banner { outline: 1.5px dashed rgba(255, 91, 53, 0.75); outline-offset: -2px; cursor: grab; }
|
|
917
917
|
.veo-mnp-banner:active { cursor: grabbing; }
|
|
918
|
-
`;function
|
|
918
|
+
`;function Ot(o,e,t){return Math.min(Math.max(o,e),t)}function cr(o){return Math.round(o*1e3)/1e3}function pr(o){return !!(o instanceof Element&&o.closest("button, a, input, textarea, select, label"))}function ur(o){let e=o.host.shadowRoot;if(!e)return null;let t=e.querySelector(".veo-modal-card");if(t)return $a(o,e,t);let n=e.querySelector(".veo-banner");return n&&!n.classList.contains("veo-banner-embedded")?Na(o,e,n):null}function $a(o,e,t){if(t.dataset.veoManipulated==="1")return null;t.dataset.veoManipulated="1",t.classList.add("veo-mnp-card");let n=t.ownerDocument,i=n.createElement("style");i.textContent=dr,e.appendChild(i);let r=[];for(let h of Ia){let v=n.createElement("div");v.className=`veo-mnp-handle veo-mnp-${h}`,v.dataset.veoDir=h,t.appendChild(v),r.push(v);}let s=false,l=false,a={},c=h=>{let v=o.host;h.px!==void 0&&v.style.setProperty("--veo-pos-x",`${h.px*100}%`),h.py!==void 0&&v.style.setProperty("--veo-pos-y",`${h.py*100}%`),h.w!==void 0&&v.style.setProperty("--veo-width",`${h.w}px`),h.h!==void 0&&v.style.setProperty("--veo-min-h",`${h.h}px`);},p=(h,v)=>{h.preventDefault(),h.stopPropagation(),s=true,a={};let y=t.getBoundingClientRect(),E=h.clientX,T=h.clientY,b=0,C=null,R=()=>{if(b=0,!C)return;let I=v(C.clientX-E,C.clientY-T,y);a={...a,...I},c({...I.posX!==void 0?{px:I.posX}:{},...I.posY!==void 0?{py:I.posY}:{},...I.width!==void 0?{w:I.width}:{},...I.height!==void 0?{h:I.height}:{}});},k=I=>{C=I,typeof window.requestAnimationFrame!="function"?R():b||(b=window.requestAnimationFrame(R));},P=()=>{window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",P),b&&window.cancelAnimationFrame(b),R(),s=false,Object.keys(a).length>0&&!l&&o.onCommit({stepIndex:o.stepIndex,style:a}),o.onGestureEnd?.();};window.addEventListener("mousemove",k),window.addEventListener("mouseup",P);},m=(h,v)=>{let y=window.innerWidth-v;return y<=0?.5:cr(Ot(h/y,0,1))},u=(h,v)=>{let y=window.innerHeight-v;return y<=0?.5:cr(Ot(h/y,0,1))},d=h=>{pr(h.target)||h.target instanceof Element&&h.target.closest(".veo-mnp-handle")||p(h,(v,y,E)=>({posX:m(E.left+v,E.width),posY:u(E.top+y,E.height)}));},f=h=>{let v=h.currentTarget.dataset.veoDir;p(h,(y,E,T)=>{let b={};return v.includes("e")&&(b.width=Math.round(Ot(T.width+y,220,720))),v.includes("w")&&(b.width=Math.round(Ot(T.width-y,220,720)),b.posX=m(T.right-b.width,b.width)),v.includes("s")&&(b.height=Math.round(Ot(T.height+E,120,900))),v.includes("n")&&(b.height=Math.round(Ot(T.height-E,120,900)),b.posY=u(T.bottom-b.height,b.height)),b});};t.addEventListener("mousedown",d);for(let h of r)h.addEventListener("mousedown",f);return {isDragging:()=>s,detach:()=>{if(!l){l=true,t.removeEventListener("mousedown",d);for(let h of r)h.remove();i.remove(),t.classList.remove("veo-mnp-card"),delete t.dataset.veoManipulated;}}}}function Na(o,e,t){if(t.dataset.veoManipulated==="1")return null;t.dataset.veoManipulated="1",t.classList.add("veo-mnp-banner");let i=t.ownerDocument.createElement("style");i.textContent=dr,e.appendChild(i);let r=false,s=false,l=()=>t.classList.contains("veo-banner-bottom")?"bottom":"top",a=c=>{if(pr(c.target))return;c.preventDefault(),r=true;let p=l(),m=p,u=f=>{let h=f.clientY<window.innerHeight/2?"top":"bottom";h!==m&&(m=h,t.classList.remove("veo-banner-top","veo-banner-bottom"),t.classList.add(`veo-banner-${h}`));},d=()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d),r=false,m!==p&&!s&&o.onCommit({stepIndex:o.stepIndex,style:{position:m}}),o.onGestureEnd?.();};window.addEventListener("mousemove",u),window.addEventListener("mouseup",d);};return t.addEventListener("mousedown",a),{isDragging:()=>r,detach:()=>{s||(s=true,t.removeEventListener("mousedown",a),i.remove(),t.classList.remove("veo-mnp-banner"),delete t.dataset.veoManipulated);}}}var Ba=["button","link","tab","menuitem","menuitemcheckbox","menuitemradio","checkbox","radio","switch","option","combobox","textbox","searchbox","slider","spinbutton"],gn=["button","a[href]",'input:not([type="hidden"])',"select","textarea","form","summary",'[contenteditable="true"]',"[onclick]","[data-veo-tag]",...Ba.map(o=>`[role="${o}"]`)].join(", ");function mr(o){try{return o.closest(gn)}catch{return null}}var Ha=/\p{Extended_Pictographic}|\p{Emoji_Modifier}|\u{FE0F}|\u{200D}|\u{20E3}/gu;function No(o,e=120){let t=r=>(r??"").replace(Ha,"").replace(/\s+/g," ").trim(),n=t(o.textContent);return n?n.slice(0,e):(t(o.getAttribute("aria-label"))||t(o.getAttribute("title"))).slice(0,e)}var vn=2147483646,Da="data-veo-picker",fr=5,_a=`
|
|
919
919
|
:host { all: initial; }
|
|
920
920
|
.veo-pick-box {
|
|
921
921
|
position: fixed;
|
|
922
|
-
z-index: ${
|
|
922
|
+
z-index: ${vn};
|
|
923
923
|
pointer-events: none;
|
|
924
924
|
box-sizing: border-box;
|
|
925
925
|
background: transparent;
|
|
@@ -929,7 +929,7 @@ ${o}
|
|
|
929
929
|
}
|
|
930
930
|
.veo-pick-label {
|
|
931
931
|
position: fixed;
|
|
932
|
-
z-index: ${
|
|
932
|
+
z-index: ${vn};
|
|
933
933
|
pointer-events: none;
|
|
934
934
|
max-width: 360px;
|
|
935
935
|
background: #2b2623;
|
|
@@ -946,7 +946,7 @@ ${o}
|
|
|
946
946
|
top: 28px;
|
|
947
947
|
left: 50%;
|
|
948
948
|
transform: translateX(-50%);
|
|
949
|
-
z-index: ${
|
|
949
|
+
z-index: ${vn};
|
|
950
950
|
pointer-events: none;
|
|
951
951
|
display: flex; align-items: center; gap: 16px;
|
|
952
952
|
max-width: min(760px, calc(100vw - 32px));
|
|
@@ -972,7 +972,7 @@ ${o}
|
|
|
972
972
|
font: inherit; font-weight: 600; cursor: pointer;
|
|
973
973
|
}
|
|
974
974
|
.veo-pick-cancel:hover { background: rgba(255,255,255,0.24); }
|
|
975
|
-
`,
|
|
975
|
+
`,Oa='<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 3.75H6A2.25 2.25 0 0 0 3.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0 1 20.25 6v1.5m0 9V18A2.25 2.25 0 0 1 18 20.25h-1.5m-9 0H6A2.25 2.25 0 0 1 3.75 18v-1.5M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>',bn=class{constructor(){this.host=null;this.box=null;this.label=null;this.current=null;this.maxAncestors=fr;this.only=null;this.onPick=null;this.onCancel=null;this.onMove=e=>{if(!(e.target instanceof Element)||this.isOwn(e.target))return;let t=this.resolveTarget(e.target);this.current=t,t?this.draw(t):this.hideBox();};this.onClick=e=>{if(e.altKey||this.isOwn(e.target))return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();let t=this.current??this.resolveTarget(e.target);if(!t)return;let n=this.describe(t),i=this.onPick;this.stop(),i?.(n);};this.onKey=e=>{if(e.key!=="Escape")return;e.preventDefault(),e.stopPropagation();let t=this.onCancel;this.stop(),t?.();};this.swallow=e=>{e.altKey||this.isOwn(e.target)||(e.preventDefault(),e.stopPropagation());};this.reposition=()=>{this.current&&this.draw(this.current);};}start(e){this.stop(),this.maxAncestors=e.maxAncestors??fr,this.only=e.only??null,this.onPick=e.onPick,this.onCancel=e.onCancel??null;let t=document.createElement("div");t.setAttribute(Da,"");let n=t.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=_a,this.box=document.createElement("div"),this.box.className="veo-pick-box",this.box.style.display="none",this.label=document.createElement("div"),this.label.className="veo-pick-label",this.label.style.display="none";let r=document.createElement("div");r.className="veo-pick-hint";let s=document.createElement("span");s.className="veo-pick-hint-icon",s.innerHTML=Oa;let l=document.createElement("div");l.className="veo-pick-hint-text";let a=document.createElement("span");a.className="veo-pick-hint-title",a.textContent=e.hint??"Selecciona un elemento existente para colocar la gu\xEDa.";let c=document.createElement("span");c.className="veo-pick-hint-sub",c.textContent=e.subhint??"Usa Alt + clic u Opci\xF3n + clic para abrir men\xFAs y desplegables.",l.append(a,c);let p=document.createElement("button");p.className="veo-pick-cancel",p.type="button",p.textContent="Cancelar",p.addEventListener("click",m=>{m.stopPropagation();let u=this.onCancel;this.stop(),u?.();}),r.append(s,l,p),n.append(i,this.box,this.label,r),document.body.appendChild(t),this.host=t,document.addEventListener("mousemove",this.onMove,true),document.addEventListener("click",this.onClick,true),document.addEventListener("mousedown",this.swallow,true),document.addEventListener("mouseup",this.swallow,true),document.addEventListener("keydown",this.onKey,true),window.addEventListener("scroll",this.reposition,true),window.addEventListener("resize",this.reposition);}stop(){document.removeEventListener("mousemove",this.onMove,true),document.removeEventListener("click",this.onClick,true),document.removeEventListener("mousedown",this.swallow,true),document.removeEventListener("mouseup",this.swallow,true),document.removeEventListener("keydown",this.onKey,true),window.removeEventListener("scroll",this.reposition,true),window.removeEventListener("resize",this.reposition),this.host?.parentNode&&this.host.parentNode.removeChild(this.host),this.host=null,this.box=null,this.label=null,this.current=null,this.only=null,this.onPick=null,this.onCancel=null;}resolveTarget(e){return !(e instanceof Element)||this.isOwn(e)?null:this.only==="interactive"?mr(e):e}hideBox(){this.box&&(this.box.style.display="none"),this.label&&(this.label.style.display="none");}isOwn(e){return e instanceof Node&&this.host!==null&&this.host.contains(e)}draw(e){if(!this.box||!this.label)return;let t=e.getBoundingClientRect();this.box.style.display="block",this.box.style.top=`${t.top}px`,this.box.style.left=`${t.left}px`,this.box.style.width=`${t.width}px`,this.box.style.height=`${t.height}px`;let n=dt(e,0);this.label.textContent="";let i=document.createElement("div");i.className="veo-pick-sel",i.textContent=n;let r=document.createElement("div");r.className="veo-pick-dim",r.textContent=`${Math.round(t.width)} \xD7 ${Math.round(t.height)}`,this.label.append(i,r),this.label.style.display="block";let s=48,l=t.bottom+8+s>window.innerHeight;this.label.style.top=l?`${Math.max(8,t.top-s-8)}px`:`${t.bottom+8}px`,this.label.style.left=`${Math.max(8,t.left)}px`;}describe(e){let t=e.getBoundingClientRect();return {selector:dt(e,this.maxAncestors),shortSelector:dt(e,0),tag:e.tagName.toLowerCase(),id:e.id||null,classes:Lt(e),text:No(e),rect:{x:Math.round(t.left),y:Math.round(t.top),width:Math.round(t.width),height:Math.round(t.height)}}}},io=null;function Bo(o){return Ce()?(io||(io=new bn),io.start(o),{stop:()=>io?.stop()}):{stop:()=>{}}}function hr(){io?.stop();}var za=`
|
|
976
976
|
:host { all: initial; }
|
|
977
977
|
.veo-confirm-backdrop {
|
|
978
978
|
position: fixed; inset: 0; z-index: 2147483645;
|
|
@@ -1006,5 +1006,5 @@ ${o}
|
|
|
1006
1006
|
}
|
|
1007
1007
|
.veo-confirm-btn:hover { background: #953c00; }
|
|
1008
1008
|
.veo-confirm-btn:focus-visible { outline: 3px solid rgba(183,77,0,0.35); outline-offset: 2px; }
|
|
1009
|
-
`;function No(){if(!ye()||!Ce())return null;let o=_n();if(!o)return null;let e=o.token,t=Ga(o.origin);if(!t)return null;let n=null,i=null,r=null,s=null,l=null,a=null,c=null,p=null,m=null,u=null,d=0,f=null,g=null,v=false,y=null,k=false,L=null,b=false,C=true,R=()=>i?i.target():s,E=h=>{R()?.postMessage({source:Ht,token:e,...h},t);},P=h=>h.guide.guideSteps?.[h.guide.startStepIndex??0],I=h=>nr(P(h)?.pageLocation,window.location.href),Y=h=>E({type:"preview-status",payload:h}),H=()=>{l?.detach(),l=null,a?.detach(),a=null,c?.(),c=null,Te?.(),Te=null,se=null,_e=false,p?.detach(),p=null,ae=null;},J=()=>{H(),ae=null,qe();},re=4,oe=0,ie=30,q={pencil:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"/></svg>',copy:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"/></svg>',trash:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/></svg>'},Q={left:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M19.5 12h-15m0 0 6.75 6.75M4.5 12l6.75-6.75"/></svg>',right:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 12h15m0 0-6.75-6.75M19.5 12l-6.75 6.75"/></svg>'},ne=(h,w)=>{for(let x of eo(h))for(let S=0;S<x.columns.length;S++)if(x.columns[S].blocks.some(A=>A.block.editorId===w))return {left:S>0,right:S<x.columns.length-1};return {left:false,right:false}},ce=[],se=null,ct=null,Te=null,_e=false,wt=null,ae=null,Ot=h=>{if(!h)return "";let{blocks:w,...x}=h;return JSON.stringify({rest:x,blocks:(w??[]).map(S=>{let{text:$,html:A,style:_,...z}=S;return z})})},no=h=>{let w=ae;if(!w||h.guide.guideType!=="composite"||w.guide.guideType!=="composite")return false;let x=h.guide.startStepIndex??0;if((w.guide.startStepIndex??0)!==x)return false;let S=M=>JSON.stringify({...M,guideSteps:void 0});if(S(w.guide)!==S(h.guide)||w.editable!==h.editable)return false;let $=document.querySelector("[data-veo-guide]"),A=$?Oe($):null;if(!$||!A)return false;let _=w.guide.guideSteps[x],z=h.guide.guideSteps[x];if(!_||!z||Ot(_)!==Ot(z))return false;let F=A.ownerDocument,B=_.blocks??[],T=z.blocks??[];for(let M=0;M<T.length;M++){let N=B[M],D=T[M];if(N.text===D.text&&N.html===D.html&&JSON.stringify(N.style)===JSON.stringify(D.style))continue;if(!D.editorId)return false;let O=A.querySelector(`[data-veo-block-id="${D.editorId}"]`);if(!O)return false;if(D.type==="button"){O.textContent=D.text?.trim()||"OK",O.removeAttribute("style"),O.classList.remove("veo-guide-cta--secondary","veo-guide-cta--link");let U=D.style??{};(U.preset==="secondary"||U.preset==="link")&&O.classList.add(`veo-guide-cta--${U.preset}`),typeof U.ariaLabel=="string"&&U.ariaLabel.trim()?O.setAttribute("aria-label",U.ariaLabel.trim()):O.removeAttribute("aria-label"),Me(O,D.style,"button");continue}if(D.type==="code"||D.type==="form")return false;let K=At(D,F,{editing:true})??(()=>{let U=F.createElement("div");return U.className="veo-block-placeholder",U.textContent=D.type==="image"?"Imagen (sin URL)":D.type==="video"?"Video (elige proveedor y pega la URL)":"Bloque vac\xEDo",U})();K.dataset.veoBlock=O.dataset.veoBlock??String(M),K.dataset.veoBlockId=D.editorId,O.replaceWith(K);}return ae=h,ce=T,ze($,x),bn($,x,T),true},Oe=h=>h.shadowRoot?.querySelector(".veo-card")??null,W=h=>{let w=Oe(h);if(w){for(let x of w.querySelectorAll(".veo-block--selected"))x.classList.remove("veo-block--selected");w.querySelector(".veo-block-toolbar")?.remove(),w.querySelector(".veo-block-frame")?.remove();}},ze=(h,w)=>{W(h);let x=Oe(h);if(!x)return;let S=m?x.querySelector(`[data-veo-block-id="${m}"]`):null;if(!S||!m){Ze(h,w);return}S.classList.add("veo-block--selected");let $=x.ownerDocument,A=getComputedStyle(x),_=Number.parseFloat(A.paddingLeft)||0,z=Number.parseFloat(A.paddingTop)||0,F=Number.parseFloat(A.paddingRight)||0,B=Number.parseFloat(A.paddingBottom)||0,T=S.parentElement,M=T?.classList.contains("veo-col")?T:null,N=M?M.offsetLeft:_,D=M?M.offsetLeft+M.offsetWidth:x.clientWidth-F,O=z,K=x.clientHeight-B,U=Math.max(N,S.offsetLeft-re),pe=Math.min(D,S.offsetLeft+S.offsetWidth+re),ue=Math.max(0,pe-U),G=Math.max(O,S.offsetTop-re),j=Math.min(K,S.offsetTop+S.offsetHeight+re),X=Math.max(oe,j-G),Z=$.createElement("div");Z.className="veo-block-frame",Z.setAttribute("data-veo-builder-chrome",""),Z.style.left=`${U}px`,Z.style.top=`${G}px`,Z.style.width=`${ue}px`,Z.style.height=`${X}px`,x.appendChild(Z);let V=$.createElement("div");V.className="veo-block-toolbar",V.setAttribute("data-veo-builder-chrome","");let de=m,Re=(Ln,Tn,Ar,Rr=true)=>{let ot=$.createElement("button");ot.type="button",ot.title=Tn,ot.setAttribute("aria-label",Tn),ot.className=`veo-block-toolbar-${Ln}`,ot.innerHTML=Ar,ot.disabled=!Rr,ot.addEventListener("click",An=>{An.preventDefault(),An.stopPropagation(),E({type:"block-action",payload:{stepIndex:w,blockId:de,action:Ln}});}),V.appendChild(ot);},kt=ne(ce,de);Re("edit","Editar",q.pencil),Re("duplicate","Duplicar",q.copy),Re("remove","Eliminar",q.trash),Re("move-left","Mover a la izquierda",Q.left,kt.left),Re("move-right","Mover a la derecha",Q.right,kt.right),V.style.right=`${Math.max(0,x.clientWidth-pe)}px`,x.appendChild(V);let tt=V.offsetHeight||ie;V.dataset.veoTopAbove=String(G-tt-6),V.dataset.veoTopBelow=String(j+6),V.style.top=V.dataset.veoTopAbove,Ze(h,w);},Ae=h=>({left:h.offsetLeft,top:h.offsetTop,right:h.offsetLeft+h.offsetWidth,bottom:h.offsetTop+h.offsetHeight}),zt=(h,w)=>h.left<w.right&&w.left<h.right&&h.top<w.bottom&&w.top<h.bottom,Xe=h=>{let w=h.querySelector(".veo-card-toolbar"),x=h.querySelector(".veo-block-toolbar"),S=h.querySelector(".veo-row-toolbar");if(x?.dataset.veoTopAbove&&(x.style.top=`${x.dataset.veoTopAbove}px`,w&&zt(Ae(x),Ae(w))&&(x.style.top=`${x.dataset.veoTopBelow}px`)),S?.dataset.veoRight){S.style.left="",S.style.right=`${S.dataset.veoRight}px`,S.style.top=`${S.dataset.veoTopBelow}px`;let $=[w,x].filter(_=>!!_),A=()=>$.some(_=>zt(Ae(S),Ae(_)));A()&&(S.style.right="",S.style.left=`${S.dataset.veoLeft}px`),A()&&x&&(S.style.left="",S.style.right=`${S.dataset.veoRight}px`,S.style.top=`${Ae(x).bottom+6}px`);}},Ye=h=>({left:h.offsetLeft,top:h.offsetTop,right:h.offsetLeft+h.offsetWidth,bottom:h.offsetTop+h.offsetHeight}),dt=h=>h.length===0?null:h.reduce((w,x)=>({left:Math.min(w.left,x.left),top:Math.min(w.top,x.top),right:Math.max(w.right,x.right),bottom:Math.max(w.bottom,x.bottom)})),Gt=(h,w)=>{let x=B=>B.editorId?h.querySelector(`[data-veo-block-id="${B.editorId}"]`):null,S=getComputedStyle(h),$=Number.parseFloat(S.paddingLeft)||0,A=Number.parseFloat(S.paddingRight)||0,_=$,z=h.clientWidth-A;return {rows:eo(w).map(B=>{let T=B.columns.map(K=>{let U=K.blocks.map(({block:j})=>({block:j,el:x(j)})).filter(j=>!!j.el&&!!j.block.editorId),pe=dt(U.map(j=>Ye(j.el)));if(!pe)return null;let ue=U[0]?.el.parentElement,G=ue?.classList.contains("veo-col")?Ye(ue):pe;return {items:U,rect:G}}).filter(K=>K!==null),M=dt(T.map(K=>K.rect));if(!M)return null;let N=T[0]?.items[0]?.el.parentElement?.parentElement,D=N?.classList.contains("veo-row")?Ye(N):{...M,left:_,right:z};return {id:T[0]?.items[0]?.block.editorId,row:B.row,columns:T,rect:D}}).filter(B=>B!==null),content:{left:_,right:z}}},Ho=h=>{h.querySelector(".veo-row-frame")?.remove(),h.querySelector(".veo-row-toolbar")?.remove();},Ze=(h,w)=>{let x=Oe(h);if(!x)return;Ho(x),Xe(x);let{rows:S}=Gt(x,ce),$=m?S.find(G=>G.columns.some(j=>j.items.some(X=>X.block.editorId===m))):void 0,A=(ct?S.find(G=>G.id===ct):void 0)??$??(se?S.find(G=>G.id===se):void 0);if(!A)return;let _=x.ownerDocument,z=getComputedStyle(x),F=Number.parseFloat(z.paddingTop)||0,B=Number.parseFloat(z.paddingBottom)||0,T=6,M=Math.max(0,A.rect.left-T),N=Math.min(x.clientWidth,A.rect.right+T),D=Math.max(Math.min(F,A.rect.top),A.rect.top-T),O=Math.min(Math.max(x.clientHeight-B,A.rect.bottom),A.rect.bottom+T),K=_.createElement("div");K.className="veo-row-frame",K.setAttribute("data-veo-builder-chrome",""),K.style.left=`${M}px`,K.style.top=`${D}px`,K.style.width=`${Math.max(0,N-M)}px`,K.style.height=`${Math.max(0,O-D)}px`,x.appendChild(K);let U=_.createElement("div");U.className="veo-row-toolbar",U.setAttribute("data-veo-builder-chrome","");let pe=A.id,ue=(G,j,X,Z)=>{let V=_.createElement("button");V.type="button",V.title=j,V.setAttribute("aria-label",j),V.className=`veo-row-toolbar-${G}`,V.innerHTML=X,Z&&V.append(Z),V.addEventListener("click",de=>{de.preventDefault(),de.stopPropagation(),E({type:"row-action",payload:{stepIndex:w,blockId:pe,action:G}});}),U.appendChild(V);};ue("edit","Editar fila",q.pencil,"Editar fila"),ue("duplicate","Duplicar fila",q.copy),ue("remove","Eliminar fila",q.trash),x.appendChild(U),U.dataset.veoRight=String(Math.max(0,x.clientWidth-N)),U.dataset.veoLeft=String(M),U.dataset.veoTopBelow=String(O+6),Xe(x);},Do=(h,w)=>{let x=Oe(h);if(!x)return;if(x.querySelector(".veo-card-frame")?.remove(),x.querySelector(".veo-card-toolbar")?.remove(),!_e){Xe(x);return}let S=x.ownerDocument,$=S.createElement("div");$.className="veo-card-frame",$.setAttribute("data-veo-builder-chrome",""),x.appendChild($);let A=S.createElement("div");A.className="veo-card-toolbar",A.setAttribute("data-veo-builder-chrome","");let _=(z,F,B)=>{let T=S.createElement("button");T.type="button",T.className=`veo-card-toolbar-${z}${B?" is-active":""}`,T.setAttribute("aria-pressed",B?"true":"false"),T.textContent=F,T.addEventListener("click",M=>{M.preventDefault(),M.stopPropagation(),E({type:"card-action",payload:{stepIndex:w,action:z}});}),A.appendChild(T);};_("edit-container","Editar contenedor",wt==="step"),_("edit-rows","Editar filas",wt==="structure"),x.appendChild(A),A.style.top=`${-Math.round((A.offsetHeight||34)/2)}px`,Xe(x);},gr=(h,w)=>{let x=$=>{let A=Oe(h);if(!A)return;let _=$.composedPath().some(O=>O instanceof Element&&(O.classList.contains("veo-card")||O.classList.contains("veo-card-toolbar")));if(_!==_e&&(_e=_,Do(h,w)),$.composedPath().some(O=>O instanceof Element&&O.classList.contains("veo-row-toolbar")))return;let z=A.getBoundingClientRect(),F=$.clientX-z.left-A.clientLeft,B=$.clientY-z.top-A.clientTop,T=A.querySelector(".veo-row-toolbar");if(T&&F>=T.offsetLeft-10&&F<=T.offsetLeft+T.offsetWidth+10&&B>=T.offsetTop-14&&B<=T.offsetTop+T.offsetHeight+10)return;let M=6,D=Gt(A,ce).rows.find(O=>F>=O.rect.left-M&&F<=O.rect.right+M&&B>=O.rect.top-M&&B<=O.rect.bottom+M)?.id??null;D!==se&&(se=D,Ze(h,w));},S=()=>{_e&&(_e=false,Do(h,w)),se!==null&&(se=null,Ze(h,w));};return h.addEventListener("mousemove",x),h.addEventListener("mouseleave",S),()=>{h.removeEventListener("mousemove",x),h.removeEventListener("mouseleave",S);}},bn=(h,w,x)=>{let S=Oe(h);if(!S)return;for(let M of S.querySelectorAll(".veo-gap"))M.remove();let $=S.ownerDocument,A=18,_=4,z=(M,N,D,O,K,U,pe,ue)=>{let G=$.createElement("div");G.className=`veo-gap veo-gap--${M}`,G.setAttribute("data-veo-builder-chrome",""),G.dataset.veoGapAction=ue,G.style.left=`${N}px`,G.style.top=`${D}px`,G.style.width=`${Math.max(O,A)}px`,G.style.height=`${Math.max(K,A)}px`;let j=$.createElement("i"),X=$.createElement("button");X.type="button",X.title=U,X.setAttribute("aria-label",U),X.textContent="+",X.addEventListener("click",Z=>{Z.preventDefault(),Z.stopPropagation(),E({type:"block-layout",payload:{stepIndex:w,blockId:pe,action:ue}});}),G.append(j,X),S.appendChild(G);},{rows:F,content:B}=Gt(S,x);if(F.length===0)return;let T=B.right-B.left;F.forEach((M,N)=>{let D=M.columns[0]?.items[0]?.block.editorId;if(N===0)z("h",B.left,M.rect.top-_-A,T,A,"Agregar fila",D,"row-before");else {let K=(F[N-1].rect.bottom+M.rect.top)/2-A/2;z("h",B.left,K,T,A,"Agregar fila",D,"row-before");}N===F.length-1&&z("h",B.left,M.rect.bottom+_,T,A,"Agregar fila",D,"row-after");});for(let M of F){let N=M.rect.bottom-M.rect.top;M.columns.forEach((D,O)=>{let K=D.items[0]?.block.editorId;if(O===0)z("v",M.rect.left-_-A,M.rect.top,A,N,"Agregar columna",K,"col-before");else {let pe=(M.columns[O-1].rect.right+D.rect.left)/2-A/2;z("v",pe,M.rect.top,A,N,"Agregar columna",K,"col-before");}O===M.columns.length-1&&z("v",M.rect.right+_,M.rect.top,A,N,"Agregar columna",K,"col-after");});}for(let M of F)for(let N of M.columns){let D=N.rect.right-N.rect.left;N.items.forEach((O,K)=>{let U=N.items[K+1];if(U){let pe=Ye(O.el),ue=Ye(U.el),G=(pe.bottom+ue.top)/2-A/2;z("h",N.rect.left,G,D,A,"Agregar bloque",O.block.editorId,"stack-after");}else M.columns.length>1&&N.rect.bottom<M.rect.bottom-A&&z("h",N.rect.left,N.rect.bottom+_,D,A,"Agregar bloque",O.block.editorId,"stack-after");});}},hr=(h,w)=>{let x=null,S=A=>{x={x:A.clientX,y:A.clientY};},$=A=>{let _=A.composedPath();if(_.some(T=>T instanceof Element&&(T.classList.contains("veo-block-toolbar")||T.classList.contains("veo-row-toolbar")||T.classList.contains("veo-card-toolbar")||T.classList.contains("veo-gap")))||!_.some(T=>T instanceof Element&&T.classList.contains("veo-card"))||x&&Math.hypot(A.clientX-x.x,A.clientY-x.y)>4)return;let F=_.find(T=>T instanceof HTMLElement&&!!T.dataset.veoBlockId);if(F){_.some(T=>T instanceof Element&&T.matches("button, a"))&&(A.preventDefault(),A.stopPropagation()),m=F.dataset.veoBlockId??null,ze(h,w),m&&E({type:"block-clicked",payload:{stepIndex:w,blockId:m}});return}_.some(T=>T instanceof Element&&T.matches("button, a, input, textarea, select, label, [contenteditable]"))||(m=null,W(h),Ze(h,w),E({type:"card-clicked",payload:{stepIndex:w}}));};return h.addEventListener("mousedown",S,true),h.addEventListener("click",$,true),()=>{h.removeEventListener("mousedown",S,true),h.removeEventListener("click",$,true);}},vr=(h,w)=>{let x=Array.from(document.querySelectorAll(`[${Uo}="${w}"]`));if(x.length===0)return null;let S=document,$=S.createElement("div");$.setAttribute("data-veo-builder-chrome",""),$.style.cssText="position:fixed;left:0;top:0;width:0;height:0;z-index:2147483646;",$.style.display="none";let A=$.attachShadow({mode:"open"}),_=S.createElement("style");_.textContent=ho,A.appendChild(_);let z=S.createElement("div");z.className="veo-block-frame",z.style.position="fixed";let F=S.createElement("div");F.className="veo-block-toolbar",F.style.position="fixed";let B=(G,j,X,Z=true)=>{let V=S.createElement("button");V.type="button",V.title=j,V.setAttribute("aria-label",j),V.className=`veo-block-toolbar-${G}`,V.innerHTML=X,V.disabled=!Z,V.addEventListener("click",de=>{de.preventDefault(),de.stopPropagation(),E({type:"block-action",payload:{stepIndex:h,blockId:w,action:G}});}),F.appendChild(V);};B("edit","Editar",q.pencil),B("duplicate","Duplicar",q.copy,false),B("remove","Eliminar",q.trash),B("move-left","Mover a la izquierda",Q.left,false),B("move-right","Mover a la derecha",Q.right,false),z.style.display="none",F.style.display="none";let T=18,M=4,N=(G,j,X)=>{let Z=S.createElement("div");Z.className=`veo-gap veo-gap--${G}`,Z.style.position="fixed",Z.dataset.veoGapAction=X;let V=S.createElement("i"),de=S.createElement("button");return de.type="button",de.title=j,de.setAttribute("aria-label",j),de.textContent="+",de.addEventListener("click",Re=>{Re.preventDefault(),Re.stopPropagation(),E({type:"block-layout",payload:{stepIndex:h,blockId:w,action:X}});}),Z.append(V,de),Z},D={top:N("h","Agregar fila","row-before"),bottom:N("h","Agregar fila","row-after"),left:N("v","Agregar columna","col-before"),right:N("v","Agregar columna","col-after")};A.append(z,F,D.top,D.bottom,D.left,D.right),S.body.appendChild($),$.style.display="";let O=false,K=(G,j,X,Z,V)=>{G.style.left=`${j}px`,G.style.top=`${X}px`,G.style.width=`${Z}px`,G.style.height=`${V}px`;},U=()=>{let G=x.filter(kt=>kt.isConnected);if(G.length===0)return;let j=Number.POSITIVE_INFINITY,X=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,V=Number.NEGATIVE_INFINITY;for(let kt of G){let tt=kt.getBoundingClientRect();tt.width===0&&tt.height===0||(j=Math.min(j,tt.left),X=Math.min(X,tt.top),Z=Math.max(Z,tt.right),V=Math.max(V,tt.bottom));}if(!Number.isFinite(j)||(K(D.top,j,X-M-T,Z-j,T),K(D.bottom,j,V+M,Z-j,T),K(D.left,j-M-T,X,T,V-X),K(D.right,Z+M,X,T,V-X),!O))return;K(z,j,X,Z-j,V-X);let de=F.offsetHeight||ie,Re=F.offsetWidth;F.style.left=`${Math.max(0,Z-Re)}px`,F.style.top=`${Math.max(0,X-de-6)}px`;},pe=G=>{O=G===w,z.style.display=O?"":"none",F.style.display=O?"":"none",U();};U();let ue=G=>{let j=G.composedPath();x.some(X=>j.includes(X))&&(j.some(X=>X instanceof Element&&X.matches("button, a"))&&(G.preventDefault(),G.stopPropagation()),m=w,pe(w),E({type:"block-clicked",payload:{stepIndex:h,blockId:w}}));};return S.addEventListener("click",ue,true),window.addEventListener("scroll",U,true),window.addEventListener("resize",U),{select:pe,detach:()=>{S.removeEventListener("click",ue,true),window.removeEventListener("scroll",U,true),window.removeEventListener("resize",U),$.remove();}}},Je=h=>{let w=!h.honorTrigger;if(w&&(Qe(),Ge(),k=true,b=false),g=w?{...h,honorTrigger:true}:h,!I(h)){Ge(),J(),Y({state:"page-mismatch",pattern:P(h)?.pageLocation?.pattern??""});return}let x=h.guide.activationRules?.devices;if(!w&&v&&x&&!Fn(x)){Ge(),J(),Y({state:"device-mismatch",devices:x});return}yr(g);},Qe=()=>{y?.(),y=null;},Ge=()=>{L&&clearTimeout(L),L=null;},yn=(h,w)=>{Qe();let x=S=>{let $=S.target;if($ instanceof Element&&!$.closest("[data-veo-builder-chrome],[data-veo-builder-panel],[data-veo-picker]")){try{if(!$.closest(h))return}catch{return}Qe(),k=true,b=false,g&&Je(g);}};document.addEventListener("click",x,true),w==="on_hover"&&document.addEventListener("mouseover",x,true),y=()=>{document.removeEventListener("click",x,true),document.removeEventListener("mouseover",x,true);},Y({state:"waiting-trigger",trigger:w,selector:h});},br=h=>{Ge(),L=setTimeout(()=>{L=null,k=true,g&&Je(g);},h),Y({state:"waiting-delay",delayMs:h});},yr=h=>{if(h.editable&&!v&&no(h)){d=h.guide.startStepIndex??0;return}H(),d=h.guide.startStepIndex??0;let w=h.guide.activationRules,x=w?.trigger,S=w?.selector?.trim(),$=h.honorTrigger&&!k&&v,A=(x==="on_click"||x==="on_hover")&&(!jt(w)||b);if($&&A&&S){Ge(),qe(),yn(S,x);return}let _=Wn(w);if($&&_>0){Qe(),qe(),L||br(_);return}Qe(),Ge();let z=Fa(),F=Ro({...h.guide,...z?{fetchProgress:z}:{},onClosed:()=>{if(H(),ae=null,k=false,b=true,v){let B=g?.guide.activationRules,T=B?.trigger,M=B?.selector?.trim();(T==="on_click"||T==="on_hover")&&M&&yn(M,T);}}});h.honorTrigger&&Y({state:"shown"}),!(!h.editable||v)&&F.ready.then(B=>{if(!B.rendered)return;let T=F.host();if(!T){let N=h.guide.startStepIndex??0,D=h.guide.guideSteps[N]?.blocks?.[0];D?.type==="code"&&D.editorId&&(p=vr(N,D.editorId),p?.select(m));return}T.classList.add("veo-no-anim"),ae=h,c=hr(T,h.guide.startStepIndex??0);let M=h.guide.guideSteps[h.guide.startStepIndex??0]?.blocks??[];ce=M,ze(T,h.guide.startStepIndex??0),bn(T,h.guide.startStepIndex??0,M),Te=gr(T,h.guide.startStepIndex??0),l=dr({host:T,guideType:h.guide.guideType,stepIndex:h.guide.startStepIndex??0,onCommit:N=>E({type:"design-updated",payload:N}),onGestureEnd:()=>{if(!f)return;let N=f;f=null,Je(N);}}),a=Mn({host:T,stepIndex:h.guide.startStepIndex??0,onDrop:N=>E({type:"block-dropped",payload:N})});});},io=()=>{u?.remove(),u=null;},xr=(h,w,x)=>{u||(u=document.createElement("div"),u.style.cssText="position:fixed;padding:4px 10px;border-radius:999px;background:#1c1917;color:#fff;font:12px/1.4 system-ui,sans-serif;box-shadow:0 4px 14px rgba(0,0,0,0.35);border:1px solid rgba(255,255,255,0.25);pointer-events:none;z-index:2147483647;",document.body.appendChild(u)),u.textContent=x,u.style.left=`${h+14}px`,u.style.top=`${w+12}px`;},wr=h=>{let w=i?.frameRect();if(!w||!a){h.phase!=="move"&&io(),a?.cancelHover();return}let x=w.left+h.x,S=w.top+h.y;if(h.phase==="move"){xr(x,S,h.label||h.blockType),a.hoverAt(x,S);return}if(io(),h.phase==="cancel"){a.cancelHover();return}let $=a.dropAt(x,S);$&&E({type:"block-dropped",payload:{stepIndex:d,blockType:h.blockType,...$}});},Er=h=>{switch(h.type){case "panel-ready":E(r?{type:"ready",chrome:true}:{type:"ready"});break;case "editor-state":if(r?.setState(h.state),wt!==h.state.section){wt=h.state.section;let w=document.querySelector("[data-veo-guide]");w&&_e&&!v&&Do(w,d);}i?.setTitle(h.state.panelTitle??(h.state.section==="activation"?"Ajustes de activaci\xF3n":h.state.section==="badge"?"Ajustes de badge":h.state.section==="target"?"Ajustes del elemento objetivo":h.state.section==="row"?"Editar fila":h.state.blockLabel?`Editor \xB7 ${h.state.blockLabel}`:h.state.steps[h.state.activeStep]?.label??"Paso"));break;case "panel-visibility":i?.setVisible(h.visible);break;case "panel-size":i?.setSize(h.size);break;case "start-picker":{n?.stop();let w=i?.isVisible()??false;w&&i?.setVisible(false),r?.setHidden(true);let x=g;x&&(H(),qe());let S=()=>{r?.setHidden(false),w&&i?.setVisible(true),x&&g===x&&Je(x);};n=Bo({onPick:$=>{n=null,S(),E({type:"picked",payload:$});},onCancel:()=>{n=null,S(),E({type:"pick-cancelled"});},...h.maxAncestors!==void 0?{maxAncestors:h.maxAncestors}:{},...h.hint!==void 0?{hint:h.hint}:{},...h.only!==void 0?{only:h.only}:{}});break}case "stop-picker":n?.stop(),n=null,r?.setHidden(false);break;case "scan-page":E({type:"page-scan",payload:Sr(h.selectors)});break;case "highlight":Tr(h.selector);break;case "show-confirmation":Lr(h.payload);break;case "preview":if(!h.guide)break;l?.isDragging()?f=h:Je(h);break;case "block-drag":wr(h);break;case "select-block":{m=h.blockId;let w=document.querySelector("[data-veo-guide]");w&&!v&&ze(w,d),v||p?.select(h.blockId);break}case "select-row":{ct=h.blockId;let w=document.querySelector("[data-veo-guide]");w&&!v&&Ze(w,d);break}case "close-preview":H(),io(),f=null,g=null,Qe(),Ge(),k=false,b=false,qe();break;case "teardown":_o();break}},xn=h=>{if(h.origin!==t)return;let w=h.data;!w||w.source!==Ht||w.token!==e||Er(w);},wn=()=>E({type:"closed"}),Et=()=>{g&&!l?.isDragging()&&Je(g);},En=window.history.pushState,kn=window.history.replaceState,kr=()=>{window.history.pushState=function(...w){let x=En.apply(this,w);return Et(),x},window.history.replaceState=function(...w){let x=kn.apply(this,w);return Et(),x},window.addEventListener("popstate",Et),window.addEventListener("hashchange",Et);},Cr=()=>{window.history.pushState=En,window.history.replaceState=kn,window.removeEventListener("popstate",Et),window.removeEventListener("hashchange",Et);},_o=()=>{window.removeEventListener("message",xn),window.removeEventListener("pagehide",wn),Cr(),n?.stop(),n=null,H(),io(),f=null,Qe(),Ge(),qe(),E({type:"closed"}),i?.teardown(),i=null,Ft?.remove(),Ft=null,Fe?.remove(),Fe=null,et&&document.removeEventListener("keydown",et,true),et=null,r?.teardown(),r=null,On();},Sr=h=>{let w=h.filter(B=>{try{return document.querySelector(B)!==null}catch{return false}}),x=new Set;for(let B of w)try{for(let T of Array.from(document.querySelectorAll(B)))x.add(T);}catch{}let S=new Set,$=[],A=document.querySelectorAll(gn);for(let B of Array.from(A)){if($.length>=200)break;if(B.closest("[data-veo-builder-chrome],[data-veo-builder-panel],[data-veo-picker]")||B.getClientRects().length===0)continue;let T=false;for(let N=B;N;N=N.parentElement)if(x.has(N)){T=true;break}if(T)continue;let M=pt(B,5);!M||S.has(M)||(S.add(M),$.push({selector:M,shortSelector:pt(B,0),tag:B.tagName.toLowerCase(),id:B.id||null,classes:St(B),text:$o(B)}));}let{pathname:_,hash:z}=window.location,F=/^#\/./.test(z)?`${_}${z}`:_;return {pagePath:_,routePath:F,candidates:$,present:w}},Fe=null,et=null,Cn=()=>{Fe&&(Fe.remove(),Fe=null,et&&document.removeEventListener("keydown",et,true),et=null,i?.setVisible(true),E({type:"confirmation-closed"}));},Lr=h=>{Fe&&(Fe.remove(),Fe=null),i?.setVisible(false);let w=document.createElement("div");w.setAttribute("data-veo-builder-chrome",""),w.setAttribute("data-veo-confirmation","");let x=w.attachShadow({mode:"open"}),S=document.createElement("style");S.textContent=_a;let $=document.createElement("div");$.className="veo-confirm-backdrop";let A=document.createElement("div");A.className="veo-confirm",A.setAttribute("role","dialog"),A.setAttribute("aria-modal","true"),A.setAttribute("aria-label",h.title);let _=document.createElement("div");_.className="veo-confirm-check",_.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>';let z=document.createElement("h2");z.className="veo-confirm-title",z.textContent=h.title;let F=document.createElement("p");F.className="veo-confirm-msg",F.textContent=h.message;let B=document.createElement("dl");B.className="veo-confirm-rows";for(let M of h.rows){let N=document.createElement("div");N.className="veo-confirm-row";let D=document.createElement("dt");D.textContent=M.label;let O=document.createElement("dd");O.textContent=M.value,N.append(D,O),B.appendChild(N);}let T=document.createElement("button");T.type="button",T.className="veo-confirm-btn",T.textContent=h.buttonLabel??"Listo",T.addEventListener("click",Cn),A.append(_,z,F),h.rows.length>0&&A.appendChild(B),A.appendChild(T),x.append(S,$,A),document.body.appendChild(w),Fe=w,et=M=>{M.key==="Escape"&&(M.preventDefault(),M.stopPropagation(),Cn());},document.addEventListener("keydown",et,true),T.focus();},Ft=null,Tr=h=>{if(Ft?.remove(),Ft=null,!h)return;let w=null;try{w=document.querySelector(h);}catch{return}if(!w)return;let x=w.getBoundingClientRect(),S=document.createElement("div");S.setAttribute("data-veo-builder-chrome",""),S.style.cssText=`position:fixed;left:${x.left-3}px;top:${x.top-3}px;width:${x.width+6}px;height:${x.height+6}px;border:2px solid #FF5B35;border-radius:6px;background:rgba(255,91,53,0.10);pointer-events:none;z-index:2147483646;`,document.body.appendChild(S),Ft=S;};if(o.panel)r=rr({appLabel:window.location.hostname,onAction:h=>{switch(h.action){case "dock":i?.setTopOffset(h.position==="top"?r?.height()??0:0);return;case "show-panel":i?.setVisible(true);return;case "preview":if(v)return;v=true,k=false,b=false,C=i?.isVisible()??true,i?.setVisible(false),r?.setPreview(true),g&&Je(g);return;case "exit-preview":if(!v)return;v=false,Qe(),Ge(),r?.setPreview(false),i?.setVisible(C),g&&Je(g);return;case "select-activation":case "select-step":case "add-step":i?.setVisible(true);break}E({type:"chrome-action",payload:h});}}),i=sr({dashboardOrigin:t,token:e,appOrigin:window.location.origin,guide:o.guide,panelPath:o.panelPath,onClose:()=>_o(),topOffset:r.height()}),r.onHeightChange(h=>i?.setTopOffset(r?.dock()==="top"?h:0));else if(s=za(),!s)return null;let Sn=()=>{window.addEventListener("message",xn),window.addEventListener("pagehide",wn),kr(),o.panel||E({type:"ready"});},ro=window.__veoBuilder;return !o.panel&&ro?.apiKey&&ro?.apiUrl?Oa(ro.apiUrl,ro.apiKey,e).then(h=>{h?Sn():window.console&&console.warn("[veo] token de builder inv\xE1lido \u2014 modo no activado");}):Sn(),{teardown:_o}}async function Oa(o,e,t){try{let n=`${o.replace(/\/+$/,"")}/v1/builder/verify`,i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":e},body:JSON.stringify({token:t})});return i.ok?(await i.json().catch(()=>null))?.valid!==!1:!0}catch{return true}}function za(){return window.opener&&window.opener!==window?window.opener:window.parent&&window.parent!==window?window.parent:null}function Ga(o){if(o)try{return new URL(o).origin}catch{return null}if(Ce()&&document.referrer)try{return new URL(document.referrer).origin}catch{return null}return null}function Fa(){let o=window.__veoBuilder;if(!o?.apiKey||!o?.apiUrl)return;let e=o.apiUrl.replace(/\/+$/,""),t=o.apiKey;return async n=>{let i=new URLSearchParams({endUserId:"veo_preview",guideIds:n.join(","),includeUnpublished:"1"}),r=await fetch(`${e}/v1/guides/progress?${i}`,{headers:{"X-Api-Key":t}});return r.ok?(await r.json()).items??[]:[]}}var Wa="popup,width=1280,height=860",Ua=600;function fr(o){if(!ye())return qa();let e=o.dashboardOrigin??window.location.origin,t=Va(o.appUrl),n=ja(o.appUrl,o.token,e),i=o.frame??null,r=i!==null,s=null;r?i.src=n:s=window.open(n,o.windowName??"veo-builder",o.windowFeatures??Wa);let l=()=>r?i?.contentWindow??null:s,a=u=>{let d=l();d&&(!r&&s?.closed||d.postMessage({source:Ht,token:o.token,...u},t??"*"));},c,p=()=>{window.removeEventListener("message",m),c!==void 0&&(clearInterval(c),c=void 0);},m=u=>{if(t&&u.origin!==t)return;let d=u.data;if(!(!d||d.source!==Ht||d.token!==o.token))switch(d.type){case "ready":o.onReady?.();break;case "picked":d.payload&&o.onPicked?.(d.payload);break;case "pick-cancelled":o.onCancelled?.();break;case "closed":p(),o.onClosed?.();break}};return window.addEventListener("message",m),r||(c=setInterval(()=>{s?.closed&&(p(),o.onClosed?.());},Ua)),{startPicker:u=>a({type:"start-picker",...u?.maxAncestors!==void 0?{maxAncestors:u.maxAncestors}:{},...u?.hint!==void 0?{hint:u.hint}:{}}),stopPicker:()=>a({type:"stop-picker"}),preview:u=>a({type:"preview",guide:u}),closePreview:()=>a({type:"close-preview"}),close:()=>{a({type:"teardown"}),r?i&&(i.src="about:blank"):s&&!s.closed&&s.close(),p();}}}function ja(o,e,t){try{let n=new URL(o,window.location.href);return n.searchParams.set(nt,e),n.searchParams.set(Ct,t),n.toString()}catch{return o}}function Va(o){try{return new URL(o,window.location.href).origin}catch{return null}}function qa(){return {startPicker:()=>{},stopPicker:()=>{},preview:()=>{},closePreview:()=>{},close:()=>{}}}No();exports.closeGuidePreview=qe;exports.createBuilderSession=fr;exports.initBuilderMode=No;exports.previewGuide=Ro;exports.startElementPicker=Bo;exports.stopElementPicker=mr;return exports;})({});//# sourceMappingURL=veo-builder.js.map
|
|
1009
|
+
`;function Ho(){if(!ye()||!Ce())return null;let o=On();if(!o)return null;let e=o.token,t=Wa(o.origin);if(!t)return null;let n=null,i=null,r=null,s=null,l=null,a=null,c=null,p=null,m=null,u=null,d=0,f=null,h=null,v=false,y=null,E=false,T=null,b=false,C=true,R=()=>i?i.target():s,k=g=>{R()?.postMessage({source:Dt,token:e,...g},t);},P=g=>g.guide.guideSteps?.[g.guide.startStepIndex??0],I=g=>rr(P(g)?.pageLocation,window.location.href),F=g=>k({type:"preview-status",payload:g}),B=()=>{l?.detach(),l=null,a?.detach(),a=null,c?.(),c=null,Te?.(),Te=null,se=null,_e=false,p?.detach(),p=null,ae=null;},J=()=>{B(),ae=null,qe();},re=4,oe=0,ie=30,K={pencil:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"/></svg>',copy:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"/></svg>',trash:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/></svg>'},Q={left:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M19.5 12h-15m0 0 6.75 6.75M4.5 12l6.75-6.75"/></svg>',right:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 12h15m0 0-6.75-6.75M19.5 12l-6.75 6.75"/></svg>'},ne=(g,w)=>{for(let x of oo(g))for(let S=0;S<x.columns.length;S++)if(x.columns[S].blocks.some(A=>A.block.editorId===w))return {left:S>0,right:S<x.columns.length-1};return {left:false,right:false}},ce=[],se=null,lt=null,Te=null,_e=false,Et=null,ae=null,zt=g=>{if(!g)return "";let{blocks:w,...x}=g;return JSON.stringify({rest:x,blocks:(w??[]).map(S=>{let{text:$,html:A,style:_,...z}=S;return z})})},ro=g=>{let w=ae;if(!w||g.guide.guideType!=="composite"||w.guide.guideType!=="composite")return false;let x=g.guide.startStepIndex??0;if((w.guide.startStepIndex??0)!==x)return false;let S=M=>JSON.stringify({...M,guideSteps:void 0});if(S(w.guide)!==S(g.guide)||w.editable!==g.editable)return false;let $=document.querySelector("[data-veo-guide]"),A=$?Oe($):null;if(!$||!A)return false;let _=w.guide.guideSteps[x],z=g.guide.guideSteps[x];if(!_||!z||zt(_)!==zt(z))return false;let W=A.ownerDocument,N=_.blocks??[],L=z.blocks??[];for(let M=0;M<L.length;M++){let H=N[M],D=L[M];if(H.text===D.text&&H.html===D.html&&JSON.stringify(H.style)===JSON.stringify(D.style))continue;if(!D.editorId)return false;let O=A.querySelector(`[data-veo-block-id="${D.editorId}"]`);if(!O)return false;if(D.type==="button"){O.textContent=D.text?.trim()||"OK",O.removeAttribute("style"),O.classList.remove("veo-guide-cta--secondary","veo-guide-cta--link");let j=D.style??{};(j.preset==="secondary"||j.preset==="link")&&O.classList.add(`veo-guide-cta--${j.preset}`),typeof j.ariaLabel=="string"&&j.ariaLabel.trim()?O.setAttribute("aria-label",j.ariaLabel.trim()):O.removeAttribute("aria-label"),Me(O,D.style,"button");continue}if(D.type==="code"||D.type==="form")return false;let X=Rt(D,W,{editing:true})??(()=>{let j=W.createElement("div");return j.className="veo-block-placeholder",j.textContent=D.type==="image"?"Imagen (sin URL)":D.type==="video"?"Video (elige proveedor y pega la URL)":"Bloque vac\xEDo",j})();X.dataset.veoBlock=O.dataset.veoBlock??String(M),X.dataset.veoBlockId=D.editorId,O.replaceWith(X);}return ae=g,ce=L,ze($,x),yn($,x,L),true},Oe=g=>g.shadowRoot?.querySelector(".veo-card")??null,U=g=>{let w=Oe(g);if(w){for(let x of w.querySelectorAll(".veo-block--selected"))x.classList.remove("veo-block--selected");w.querySelector(".veo-block-toolbar")?.remove(),w.querySelector(".veo-block-frame")?.remove();}},ze=(g,w)=>{U(g);let x=Oe(g);if(!x)return;let S=m?x.querySelector(`[data-veo-block-id="${m}"]`):null;if(!S||!m){Ze(g,w);return}S.classList.add("veo-block--selected");let $=x.ownerDocument,A=getComputedStyle(x),_=Number.parseFloat(A.paddingLeft)||0,z=Number.parseFloat(A.paddingTop)||0,W=Number.parseFloat(A.paddingRight)||0,N=Number.parseFloat(A.paddingBottom)||0,L=S.parentElement,M=L?.classList.contains("veo-col")?L:null,H=M?M.offsetLeft:_,D=M?M.offsetLeft+M.offsetWidth:x.clientWidth-W,O=z,X=x.clientHeight-N,j=Math.max(H,S.offsetLeft-re),pe=Math.min(D,S.offsetLeft+S.offsetWidth+re),ue=Math.max(0,pe-j),G=Math.max(O,S.offsetTop-re),V=Math.min(X,S.offsetTop+S.offsetHeight+re),Y=Math.max(oe,V-G),Z=$.createElement("div");Z.className="veo-block-frame",Z.setAttribute("data-veo-builder-chrome",""),Z.style.left=`${j}px`,Z.style.top=`${G}px`,Z.style.width=`${ue}px`,Z.style.height=`${Y}px`,x.appendChild(Z);let q=$.createElement("div");q.className="veo-block-toolbar",q.setAttribute("data-veo-builder-chrome","");let de=m,Re=(Tn,An,Mr,Pr=true)=>{let ot=$.createElement("button");ot.type="button",ot.title=An,ot.setAttribute("aria-label",An),ot.className=`veo-block-toolbar-${Tn}`,ot.innerHTML=Mr,ot.disabled=!Pr,ot.addEventListener("click",Rn=>{Rn.preventDefault(),Rn.stopPropagation(),k({type:"block-action",payload:{stepIndex:w,blockId:de,action:Tn}});}),q.appendChild(ot);},Ct=ne(ce,de);Re("edit","Editar",K.pencil),Re("duplicate","Duplicar",K.copy),Re("remove","Eliminar",K.trash),Re("move-left","Mover a la izquierda",Q.left,Ct.left),Re("move-right","Mover a la derecha",Q.right,Ct.right),q.style.right=`${Math.max(0,x.clientWidth-pe)}px`,x.appendChild(q);let tt=q.offsetHeight||ie;q.dataset.veoTopAbove=String(G-tt-6),q.dataset.veoTopBelow=String(V+6),q.style.top=q.dataset.veoTopAbove,Ze(g,w);},Ae=g=>({left:g.offsetLeft,top:g.offsetTop,right:g.offsetLeft+g.offsetWidth,bottom:g.offsetTop+g.offsetHeight}),Gt=(g,w)=>g.left<w.right&&w.left<g.right&&g.top<w.bottom&&w.top<g.bottom,Xe=g=>{let w=g.querySelector(".veo-card-toolbar"),x=g.querySelector(".veo-block-toolbar"),S=g.querySelector(".veo-row-toolbar");if(x?.dataset.veoTopAbove&&(x.style.top=`${x.dataset.veoTopAbove}px`,w&&Gt(Ae(x),Ae(w))&&(x.style.top=`${x.dataset.veoTopBelow}px`)),S?.dataset.veoRight){S.style.left="",S.style.right=`${S.dataset.veoRight}px`,S.style.top=`${S.dataset.veoTopBelow}px`;let $=[w,x].filter(_=>!!_),A=()=>$.some(_=>Gt(Ae(S),Ae(_)));A()&&(S.style.right="",S.style.left=`${S.dataset.veoLeft}px`),A()&&x&&(S.style.left="",S.style.right=`${S.dataset.veoRight}px`,S.style.top=`${Ae(x).bottom+6}px`);}},Ye=g=>({left:g.offsetLeft,top:g.offsetTop,right:g.offsetLeft+g.offsetWidth,bottom:g.offsetTop+g.offsetHeight}),ct=g=>g.length===0?null:g.reduce((w,x)=>({left:Math.min(w.left,x.left),top:Math.min(w.top,x.top),right:Math.max(w.right,x.right),bottom:Math.max(w.bottom,x.bottom)})),Ft=(g,w)=>{let x=N=>N.editorId?g.querySelector(`[data-veo-block-id="${N.editorId}"]`):null,S=getComputedStyle(g),$=Number.parseFloat(S.paddingLeft)||0,A=Number.parseFloat(S.paddingRight)||0,_=$,z=g.clientWidth-A;return {rows:oo(w).map(N=>{let L=N.columns.map(X=>{let j=X.blocks.map(({block:V})=>({block:V,el:x(V)})).filter(V=>!!V.el&&!!V.block.editorId),pe=ct(j.map(V=>Ye(V.el)));if(!pe)return null;let ue=j[0]?.el.parentElement,G=ue?.classList.contains("veo-col")?Ye(ue):pe;return {items:j,rect:G}}).filter(X=>X!==null),M=ct(L.map(X=>X.rect));if(!M)return null;let H=L[0]?.items[0]?.el.parentElement?.parentElement,D=H?.classList.contains("veo-row")?Ye(H):{...M,left:_,right:z};return {id:L[0]?.items[0]?.block.editorId,row:N.row,columns:L,rect:D}}).filter(N=>N!==null),content:{left:_,right:z}}},Do=g=>{g.querySelector(".veo-row-frame")?.remove(),g.querySelector(".veo-row-toolbar")?.remove();},Ze=(g,w)=>{let x=Oe(g);if(!x)return;Do(x),Xe(x);let{rows:S}=Ft(x,ce),$=m?S.find(G=>G.columns.some(V=>V.items.some(Y=>Y.block.editorId===m))):void 0,A=(lt?S.find(G=>G.id===lt):void 0)??$??(se?S.find(G=>G.id===se):void 0);if(!A)return;let _=x.ownerDocument,z=getComputedStyle(x),W=Number.parseFloat(z.paddingTop)||0,N=Number.parseFloat(z.paddingBottom)||0,L=6,M=Math.max(0,A.rect.left-L),H=Math.min(x.clientWidth,A.rect.right+L),D=Math.max(Math.min(W,A.rect.top),A.rect.top-L),O=Math.min(Math.max(x.clientHeight-N,A.rect.bottom),A.rect.bottom+L),X=_.createElement("div");X.className="veo-row-frame",X.setAttribute("data-veo-builder-chrome",""),X.style.left=`${M}px`,X.style.top=`${D}px`,X.style.width=`${Math.max(0,H-M)}px`,X.style.height=`${Math.max(0,O-D)}px`,x.appendChild(X);let j=_.createElement("div");j.className="veo-row-toolbar",j.setAttribute("data-veo-builder-chrome","");let pe=A.id,ue=(G,V,Y,Z)=>{let q=_.createElement("button");q.type="button",q.title=V,q.setAttribute("aria-label",V),q.className=`veo-row-toolbar-${G}`,q.innerHTML=Y,Z&&q.append(Z),q.addEventListener("click",de=>{de.preventDefault(),de.stopPropagation(),k({type:"row-action",payload:{stepIndex:w,blockId:pe,action:G}});}),j.appendChild(q);};ue("edit","Editar fila",K.pencil,"Editar fila"),ue("duplicate","Duplicar fila",K.copy),ue("remove","Eliminar fila",K.trash),x.appendChild(j),j.dataset.veoRight=String(Math.max(0,x.clientWidth-H)),j.dataset.veoLeft=String(M),j.dataset.veoTopBelow=String(O+6),Xe(x);},_o=(g,w)=>{let x=Oe(g);if(!x)return;if(x.querySelector(".veo-card-frame")?.remove(),x.querySelector(".veo-card-toolbar")?.remove(),!_e){Xe(x);return}let S=x.ownerDocument,$=S.createElement("div");$.className="veo-card-frame",$.setAttribute("data-veo-builder-chrome",""),x.appendChild($);let A=S.createElement("div");A.className="veo-card-toolbar",A.setAttribute("data-veo-builder-chrome","");let _=(z,W,N)=>{let L=S.createElement("button");L.type="button",L.className=`veo-card-toolbar-${z}${N?" is-active":""}`,L.setAttribute("aria-pressed",N?"true":"false"),L.textContent=W,L.addEventListener("click",M=>{M.preventDefault(),M.stopPropagation(),k({type:"card-action",payload:{stepIndex:w,action:z}});}),A.appendChild(L);};_("edit-container","Editar contenedor",Et==="step"),_("edit-rows","Editar filas",Et==="structure"),x.appendChild(A),A.style.top=`${-Math.round((A.offsetHeight||34)/2)}px`,Xe(x);},vr=(g,w)=>{let x=$=>{let A=Oe(g);if(!A)return;let _=$.composedPath().some(O=>O instanceof Element&&(O.classList.contains("veo-card")||O.classList.contains("veo-card-toolbar")));if(_!==_e&&(_e=_,_o(g,w)),$.composedPath().some(O=>O instanceof Element&&O.classList.contains("veo-row-toolbar")))return;let z=A.getBoundingClientRect(),W=$.clientX-z.left-A.clientLeft,N=$.clientY-z.top-A.clientTop,L=A.querySelector(".veo-row-toolbar");if(L&&W>=L.offsetLeft-10&&W<=L.offsetLeft+L.offsetWidth+10&&N>=L.offsetTop-14&&N<=L.offsetTop+L.offsetHeight+10)return;let M=6,D=Ft(A,ce).rows.find(O=>W>=O.rect.left-M&&W<=O.rect.right+M&&N>=O.rect.top-M&&N<=O.rect.bottom+M)?.id??null;D!==se&&(se=D,Ze(g,w));},S=()=>{_e&&(_e=false,_o(g,w)),se!==null&&(se=null,Ze(g,w));};return g.addEventListener("mousemove",x),g.addEventListener("mouseleave",S),()=>{g.removeEventListener("mousemove",x),g.removeEventListener("mouseleave",S);}},yn=(g,w,x)=>{let S=Oe(g);if(!S)return;for(let M of S.querySelectorAll(".veo-gap"))M.remove();let $=S.ownerDocument,A=18,_=4,z=(M,H,D,O,X,j,pe,ue)=>{let G=$.createElement("div");G.className=`veo-gap veo-gap--${M}`,G.setAttribute("data-veo-builder-chrome",""),G.dataset.veoGapAction=ue,G.style.left=`${H}px`,G.style.top=`${D}px`,G.style.width=`${Math.max(O,A)}px`,G.style.height=`${Math.max(X,A)}px`;let V=$.createElement("i"),Y=$.createElement("button");Y.type="button",Y.title=j,Y.setAttribute("aria-label",j),Y.textContent="+",Y.addEventListener("click",Z=>{Z.preventDefault(),Z.stopPropagation(),k({type:"block-layout",payload:{stepIndex:w,blockId:pe,action:ue}});}),G.append(V,Y),S.appendChild(G);},{rows:W,content:N}=Ft(S,x);if(W.length===0)return;let L=N.right-N.left;W.forEach((M,H)=>{let D=M.columns[0]?.items[0]?.block.editorId;if(H===0)z("h",N.left,M.rect.top-_-A,L,A,"Agregar fila",D,"row-before");else {let X=(W[H-1].rect.bottom+M.rect.top)/2-A/2;z("h",N.left,X,L,A,"Agregar fila",D,"row-before");}H===W.length-1&&z("h",N.left,M.rect.bottom+_,L,A,"Agregar fila",D,"row-after");});for(let M of W){let H=M.rect.bottom-M.rect.top;M.columns.forEach((D,O)=>{let X=D.items[0]?.block.editorId;if(O===0)z("v",M.rect.left-_-A,M.rect.top,A,H,"Agregar columna",X,"col-before");else {let pe=(M.columns[O-1].rect.right+D.rect.left)/2-A/2;z("v",pe,M.rect.top,A,H,"Agregar columna",X,"col-before");}O===M.columns.length-1&&z("v",M.rect.right+_,M.rect.top,A,H,"Agregar columna",X,"col-after");});}for(let M of W)for(let H of M.columns){let D=H.rect.right-H.rect.left;H.items.forEach((O,X)=>{let j=H.items[X+1];if(j){let pe=Ye(O.el),ue=Ye(j.el),G=(pe.bottom+ue.top)/2-A/2;z("h",H.rect.left,G,D,A,"Agregar bloque",O.block.editorId,"stack-after");}else M.columns.length>1&&H.rect.bottom<M.rect.bottom-A&&z("h",H.rect.left,H.rect.bottom+_,D,A,"Agregar bloque",O.block.editorId,"stack-after");});}},br=(g,w)=>{let x=null,S=A=>{x={x:A.clientX,y:A.clientY};},$=A=>{let _=A.composedPath();if(_.some(L=>L instanceof Element&&(L.classList.contains("veo-block-toolbar")||L.classList.contains("veo-row-toolbar")||L.classList.contains("veo-card-toolbar")||L.classList.contains("veo-gap")))||!_.some(L=>L instanceof Element&&L.classList.contains("veo-card"))||x&&Math.hypot(A.clientX-x.x,A.clientY-x.y)>4)return;let W=_.find(L=>L instanceof HTMLElement&&!!L.dataset.veoBlockId);if(W){_.some(L=>L instanceof Element&&L.matches("button, a"))&&(A.preventDefault(),A.stopPropagation()),m=W.dataset.veoBlockId??null,ze(g,w),m&&k({type:"block-clicked",payload:{stepIndex:w,blockId:m}});return}_.some(L=>L instanceof Element&&L.matches("button, a, input, textarea, select, label, [contenteditable]"))||(m=null,U(g),Ze(g,w),k({type:"card-clicked",payload:{stepIndex:w}}));};return g.addEventListener("mousedown",S,true),g.addEventListener("click",$,true),()=>{g.removeEventListener("mousedown",S,true),g.removeEventListener("click",$,true);}},yr=(g,w)=>{let x=Array.from(document.querySelectorAll(`[${jo}="${w}"]`));if(x.length===0)return null;let S=document,$=S.createElement("div");$.setAttribute("data-veo-builder-chrome",""),$.style.cssText="position:fixed;left:0;top:0;width:0;height:0;z-index:2147483646;",$.style.display="none";let A=$.attachShadow({mode:"open"}),_=S.createElement("style");_.textContent=Qt,A.appendChild(_);let z=S.createElement("div");z.className="veo-block-frame",z.style.position="fixed";let W=S.createElement("div");W.className="veo-block-toolbar",W.style.position="fixed";let N=(G,V,Y,Z=true)=>{let q=S.createElement("button");q.type="button",q.title=V,q.setAttribute("aria-label",V),q.className=`veo-block-toolbar-${G}`,q.innerHTML=Y,q.disabled=!Z,q.addEventListener("click",de=>{de.preventDefault(),de.stopPropagation(),k({type:"block-action",payload:{stepIndex:g,blockId:w,action:G}});}),W.appendChild(q);};N("edit","Editar",K.pencil),N("duplicate","Duplicar",K.copy,false),N("remove","Eliminar",K.trash),N("move-left","Mover a la izquierda",Q.left,false),N("move-right","Mover a la derecha",Q.right,false),z.style.display="none",W.style.display="none";let L=18,M=4,H=(G,V,Y)=>{let Z=S.createElement("div");Z.className=`veo-gap veo-gap--${G}`,Z.style.position="fixed",Z.dataset.veoGapAction=Y;let q=S.createElement("i"),de=S.createElement("button");return de.type="button",de.title=V,de.setAttribute("aria-label",V),de.textContent="+",de.addEventListener("click",Re=>{Re.preventDefault(),Re.stopPropagation(),k({type:"block-layout",payload:{stepIndex:g,blockId:w,action:Y}});}),Z.append(q,de),Z},D={top:H("h","Agregar fila","row-before"),bottom:H("h","Agregar fila","row-after"),left:H("v","Agregar columna","col-before"),right:H("v","Agregar columna","col-after")};A.append(z,W,D.top,D.bottom,D.left,D.right),S.body.appendChild($),$.style.display="";let O=false,X=(G,V,Y,Z,q)=>{G.style.left=`${V}px`,G.style.top=`${Y}px`,G.style.width=`${Z}px`,G.style.height=`${q}px`;},j=()=>{let G=x.filter(Ct=>Ct.isConnected);if(G.length===0)return;let V=Number.POSITIVE_INFINITY,Y=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,q=Number.NEGATIVE_INFINITY;for(let Ct of G){let tt=Ct.getBoundingClientRect();tt.width===0&&tt.height===0||(V=Math.min(V,tt.left),Y=Math.min(Y,tt.top),Z=Math.max(Z,tt.right),q=Math.max(q,tt.bottom));}if(!Number.isFinite(V)||(X(D.top,V,Y-M-L,Z-V,L),X(D.bottom,V,q+M,Z-V,L),X(D.left,V-M-L,Y,L,q-Y),X(D.right,Z+M,Y,L,q-Y),!O))return;X(z,V,Y,Z-V,q-Y);let de=W.offsetHeight||ie,Re=W.offsetWidth;W.style.left=`${Math.max(0,Z-Re)}px`,W.style.top=`${Math.max(0,Y-de-6)}px`;},pe=G=>{O=G===w,z.style.display=O?"":"none",W.style.display=O?"":"none",j();};j();let ue=G=>{let V=G.composedPath();x.some(Y=>V.includes(Y))&&(V.some(Y=>Y instanceof Element&&Y.matches("button, a"))&&(G.preventDefault(),G.stopPropagation()),m=w,pe(w),k({type:"block-clicked",payload:{stepIndex:g,blockId:w}}));};return S.addEventListener("click",ue,true),window.addEventListener("scroll",j,true),window.addEventListener("resize",j),{select:pe,detach:()=>{S.removeEventListener("click",ue,true),window.removeEventListener("scroll",j,true),window.removeEventListener("resize",j),$.remove();}}},Je=g=>{let w=!g.honorTrigger;if(w&&(Qe(),Ge(),E=true,b=false),h=w?{...g,honorTrigger:true}:g,!I(g)){Ge(),J(),F({state:"page-mismatch",pattern:P(g)?.pageLocation?.pattern??""});return}let x=g.guide.activationRules?.devices;if(!w&&v&&x&&!Wn(x)){Ge(),J(),F({state:"device-mismatch",devices:x});return}wr(h);},Qe=()=>{y?.(),y=null;},Ge=()=>{T&&clearTimeout(T),T=null;},xn=(g,w)=>{Qe();let x=S=>{let $=S.target;if($ instanceof Element&&!$.closest("[data-veo-builder-chrome],[data-veo-builder-panel],[data-veo-picker]")){try{if(!$.closest(g))return}catch{return}Qe(),E=true,b=false,h&&Je(h);}};document.addEventListener("click",x,true),w==="on_hover"&&document.addEventListener("mouseover",x,true),y=()=>{document.removeEventListener("click",x,true),document.removeEventListener("mouseover",x,true);},F({state:"waiting-trigger",trigger:w,selector:g});},xr=g=>{Ge(),T=setTimeout(()=>{T=null,E=true,h&&Je(h);},g),F({state:"waiting-delay",delayMs:g});},wr=g=>{if(g.editable&&!v&&ro(g)){d=g.guide.startStepIndex??0;return}B(),d=g.guide.startStepIndex??0;let w=g.guide.activationRules,x=w?.trigger,S=w?.selector?.trim(),$=g.honorTrigger&&!E&&v,A=(x==="on_click"||x==="on_hover")&&(!Vt(w)||b);if($&&A&&S){Ge(),qe(),xn(S,x);return}let _=Un(w);if($&&_>0){Qe(),qe(),T||xr(_);return}Qe(),Ge();let z=Ua(),W=Mo({...g.guide,...z?{fetchProgress:z}:{},onClosed:()=>{if(B(),ae=null,E=false,b=true,v){let N=h?.guide.activationRules,L=N?.trigger,M=N?.selector?.trim();(L==="on_click"||L==="on_hover")&&M&&xn(M,L);}}});g.honorTrigger&&F({state:"shown"}),!(!g.editable||v)&&W.ready.then(N=>{if(!N.rendered)return;let L=W.host();if(!L){let H=g.guide.startStepIndex??0,D=g.guide.guideSteps[H]?.blocks?.[0];D?.type==="code"&&D.editorId&&(p=yr(H,D.editorId),p?.select(m));return}L.classList.add("veo-no-anim"),ae=g,c=br(L,g.guide.startStepIndex??0);let M=g.guide.guideSteps[g.guide.startStepIndex??0]?.blocks??[];ce=M,ze(L,g.guide.startStepIndex??0),yn(L,g.guide.startStepIndex??0,M),Te=vr(L,g.guide.startStepIndex??0),l=ur({host:L,guideType:g.guide.guideType,stepIndex:g.guide.startStepIndex??0,onCommit:H=>k({type:"design-updated",payload:H}),onGestureEnd:()=>{if(!f)return;let H=f;f=null,Je(H);}}),a=Pn({host:L,stepIndex:g.guide.startStepIndex??0,onDrop:H=>k({type:"block-dropped",payload:H})});});},so=()=>{u?.remove(),u=null;},Er=(g,w,x)=>{u||(u=document.createElement("div"),u.style.cssText="position:fixed;padding:4px 10px;border-radius:999px;background:#1c1917;color:#fff;font:12px/1.4 system-ui,sans-serif;box-shadow:0 4px 14px rgba(0,0,0,0.35);border:1px solid rgba(255,255,255,0.25);pointer-events:none;z-index:2147483647;",document.body.appendChild(u)),u.textContent=x,u.style.left=`${g+14}px`,u.style.top=`${w+12}px`;},kr=g=>{let w=i?.frameRect();if(!w||!a){g.phase!=="move"&&so(),a?.cancelHover();return}let x=w.left+g.x,S=w.top+g.y;if(g.phase==="move"){Er(x,S,g.label||g.blockType),a.hoverAt(x,S);return}if(so(),g.phase==="cancel"){a.cancelHover();return}let $=a.dropAt(x,S);$&&k({type:"block-dropped",payload:{stepIndex:d,blockType:g.blockType,...$}});},Cr=g=>{switch(g.type){case "panel-ready":k(r?{type:"ready",chrome:true}:{type:"ready"});break;case "editor-state":if(r?.setState(g.state),Et!==g.state.section){Et=g.state.section;let w=document.querySelector("[data-veo-guide]");w&&_e&&!v&&_o(w,d);}i?.setTitle(g.state.panelTitle??(g.state.section==="activation"?"Ajustes de activaci\xF3n":g.state.section==="badge"?"Ajustes de badge":g.state.section==="target"?"Ajustes del elemento objetivo":g.state.section==="row"?"Editar fila":g.state.blockLabel?`Editor \xB7 ${g.state.blockLabel}`:g.state.steps[g.state.activeStep]?.label??"Paso"));break;case "panel-visibility":i?.setVisible(g.visible);break;case "panel-size":i?.setSize(g.size);break;case "start-picker":{n?.stop();let w=i?.isVisible()??false;w&&i?.setVisible(false),r?.setHidden(true);let x=h;x&&(B(),qe());let S=()=>{r?.setHidden(false),w&&i?.setVisible(true),x&&h===x&&Je(x);};n=Bo({onPick:$=>{n=null,S(),k({type:"picked",payload:$});},onCancel:()=>{n=null,S(),k({type:"pick-cancelled"});},...g.maxAncestors!==void 0?{maxAncestors:g.maxAncestors}:{},...g.hint!==void 0?{hint:g.hint}:{},...g.only!==void 0?{only:g.only}:{}});break}case "stop-picker":n?.stop(),n=null,r?.setHidden(false);break;case "scan-page":k({type:"page-scan",payload:Tr(g.selectors)});break;case "highlight":Rr(g.selector);break;case "show-confirmation":Ar(g.payload);break;case "preview":if(!g.guide)break;l?.isDragging()?f=g:Je(g);break;case "block-drag":kr(g);break;case "select-block":{m=g.blockId;let w=document.querySelector("[data-veo-guide]");w&&!v&&ze(w,d),v||p?.select(g.blockId);break}case "select-row":{lt=g.blockId;let w=document.querySelector("[data-veo-guide]");w&&!v&&Ze(w,d);break}case "close-preview":B(),so(),f=null,h=null,Qe(),Ge(),E=false,b=false,qe();break;case "teardown":Oo();break}},wn=g=>{if(g.origin!==t)return;let w=g.data;!w||w.source!==Dt||w.token!==e||Cr(w);},En=()=>k({type:"closed"}),kt=()=>{h&&!l?.isDragging()&&Je(h);},kn=window.history.pushState,Cn=window.history.replaceState,Sr=()=>{window.history.pushState=function(...w){let x=kn.apply(this,w);return kt(),x},window.history.replaceState=function(...w){let x=Cn.apply(this,w);return kt(),x},window.addEventListener("popstate",kt),window.addEventListener("hashchange",kt);},Lr=()=>{window.history.pushState=kn,window.history.replaceState=Cn,window.removeEventListener("popstate",kt),window.removeEventListener("hashchange",kt);},Oo=()=>{window.removeEventListener("message",wn),window.removeEventListener("pagehide",En),Lr(),n?.stop(),n=null,B(),so(),f=null,Qe(),Ge(),qe(),k({type:"closed"}),i?.teardown(),i=null,Wt?.remove(),Wt=null,Fe?.remove(),Fe=null,et&&document.removeEventListener("keydown",et,true),et=null,r?.teardown(),r=null,zn();},Tr=g=>{let w=g.filter(N=>{try{return document.querySelector(N)!==null}catch{return false}}),x=new Set;for(let N of w)try{for(let L of Array.from(document.querySelectorAll(N)))x.add(L);}catch{}let S=new Set,$=[],A=document.querySelectorAll(gn);for(let N of Array.from(A)){if($.length>=200)break;if(N.closest("[data-veo-builder-chrome],[data-veo-builder-panel],[data-veo-picker]")||N.getClientRects().length===0)continue;let L=false;for(let H=N;H;H=H.parentElement)if(x.has(H)){L=true;break}if(L)continue;let M=dt(N,5);!M||S.has(M)||(S.add(M),$.push({selector:M,shortSelector:dt(N,0),tag:N.tagName.toLowerCase(),id:N.id||null,classes:Lt(N),text:No(N)}));}let{pathname:_,hash:z}=window.location,W=/^#\/./.test(z)?`${_}${z}`:_;return {pagePath:_,routePath:W,candidates:$,present:w}},Fe=null,et=null,Sn=()=>{Fe&&(Fe.remove(),Fe=null,et&&document.removeEventListener("keydown",et,true),et=null,i?.setVisible(true),k({type:"confirmation-closed"}));},Ar=g=>{Fe&&(Fe.remove(),Fe=null),i?.setVisible(false);let w=document.createElement("div");w.setAttribute("data-veo-builder-chrome",""),w.setAttribute("data-veo-confirmation","");let x=w.attachShadow({mode:"open"}),S=document.createElement("style");S.textContent=za;let $=document.createElement("div");$.className="veo-confirm-backdrop";let A=document.createElement("div");A.className="veo-confirm",A.setAttribute("role","dialog"),A.setAttribute("aria-modal","true"),A.setAttribute("aria-label",g.title);let _=document.createElement("div");_.className="veo-confirm-check",_.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>';let z=document.createElement("h2");z.className="veo-confirm-title",z.textContent=g.title;let W=document.createElement("p");W.className="veo-confirm-msg",W.textContent=g.message;let N=document.createElement("dl");N.className="veo-confirm-rows";for(let M of g.rows){let H=document.createElement("div");H.className="veo-confirm-row";let D=document.createElement("dt");D.textContent=M.label;let O=document.createElement("dd");O.textContent=M.value,H.append(D,O),N.appendChild(H);}let L=document.createElement("button");L.type="button",L.className="veo-confirm-btn",L.textContent=g.buttonLabel??"Listo",L.addEventListener("click",Sn),A.append(_,z,W),g.rows.length>0&&A.appendChild(N),A.appendChild(L),x.append(S,$,A),document.body.appendChild(w),Fe=w,et=M=>{M.key==="Escape"&&(M.preventDefault(),M.stopPropagation(),Sn());},document.addEventListener("keydown",et,true),L.focus();},Wt=null,Rr=g=>{if(Wt?.remove(),Wt=null,!g)return;let w=null;try{w=document.querySelector(g);}catch{return}if(!w)return;let x=w.getBoundingClientRect(),S=document.createElement("div");S.setAttribute("data-veo-builder-chrome",""),S.style.cssText=`position:fixed;left:${x.left-3}px;top:${x.top-3}px;width:${x.width+6}px;height:${x.height+6}px;border:2px solid #FF5B35;border-radius:6px;background:rgba(255,91,53,0.10);pointer-events:none;z-index:2147483646;`,document.body.appendChild(S),Wt=S;};if(o.panel)r=ar({appLabel:window.location.hostname,onAction:g=>{switch(g.action){case "dock":i?.setTopOffset(g.position==="top"?r?.height()??0:0);return;case "show-panel":i?.setVisible(true);return;case "preview":if(v)return;v=true,E=false,b=false,C=i?.isVisible()??true,i?.setVisible(false),r?.setPreview(true),h&&Je(h);return;case "exit-preview":if(!v)return;v=false,Qe(),Ge(),r?.setPreview(false),i?.setVisible(C),h&&Je(h);return;case "select-activation":case "select-step":case "add-step":i?.setVisible(true);break}k({type:"chrome-action",payload:g});}}),i=lr({dashboardOrigin:t,token:e,appOrigin:window.location.origin,guide:o.guide,panelPath:o.panelPath,onClose:()=>Oo(),topOffset:r.height()}),r.onHeightChange(g=>i?.setTopOffset(r?.dock()==="top"?g:0));else if(s=Fa(),!s)return null;let Ln=()=>{window.addEventListener("message",wn),window.addEventListener("pagehide",En),Sr(),o.panel||k({type:"ready"});},ao=window.__veoBuilder;return !o.panel&&ao?.apiKey&&ao?.apiUrl?Ga(ao.apiUrl,ao.apiKey,e).then(g=>{g?Ln():window.console&&console.warn("[veo] token de builder inv\xE1lido \u2014 modo no activado");}):Ln(),{teardown:Oo}}async function Ga(o,e,t){try{let n=`${o.replace(/\/+$/,"")}/v1/builder/verify`,i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":e},body:JSON.stringify({token:t})});return i.ok?(await i.json().catch(()=>null))?.valid!==!1:!0}catch{return true}}function Fa(){return window.opener&&window.opener!==window?window.opener:window.parent&&window.parent!==window?window.parent:null}function Wa(o){if(o)try{return new URL(o).origin}catch{return null}if(Ce()&&document.referrer)try{return new URL(document.referrer).origin}catch{return null}return null}function Ua(){let o=window.__veoBuilder;if(!o?.apiKey||!o?.apiUrl)return;let e=o.apiUrl.replace(/\/+$/,""),t=o.apiKey;return async n=>{let i=new URLSearchParams({endUserId:"veo_preview",guideIds:n.join(","),includeUnpublished:"1"}),r=await fetch(`${e}/v1/guides/progress?${i}`,{headers:{"X-Api-Key":t}});return r.ok?(await r.json()).items??[]:[]}}var ja="popup,width=1280,height=860",Va=600;function gr(o){if(!ye())return Xa();let e=o.dashboardOrigin??window.location.origin,t=Ka(o.appUrl),n=qa(o.appUrl,o.token,e),i=o.frame??null,r=i!==null,s=null;r?i.src=n:s=window.open(n,o.windowName??"veo-builder",o.windowFeatures??ja);let l=()=>r?i?.contentWindow??null:s,a=u=>{let d=l();d&&(!r&&s?.closed||d.postMessage({source:Dt,token:o.token,...u},t??"*"));},c,p=()=>{window.removeEventListener("message",m),c!==void 0&&(clearInterval(c),c=void 0);},m=u=>{if(t&&u.origin!==t)return;let d=u.data;if(!(!d||d.source!==Dt||d.token!==o.token))switch(d.type){case "ready":o.onReady?.();break;case "picked":d.payload&&o.onPicked?.(d.payload);break;case "pick-cancelled":o.onCancelled?.();break;case "closed":p(),o.onClosed?.();break}};return window.addEventListener("message",m),r||(c=setInterval(()=>{s?.closed&&(p(),o.onClosed?.());},Va)),{startPicker:u=>a({type:"start-picker",...u?.maxAncestors!==void 0?{maxAncestors:u.maxAncestors}:{},...u?.hint!==void 0?{hint:u.hint}:{}}),stopPicker:()=>a({type:"stop-picker"}),preview:u=>a({type:"preview",guide:u}),closePreview:()=>a({type:"close-preview"}),close:()=>{a({type:"teardown"}),r?i&&(i.src="about:blank"):s&&!s.closed&&s.close(),p();}}}function qa(o,e,t){try{let n=new URL(o,window.location.href);return n.searchParams.set(nt,e),n.searchParams.set(St,t),n.toString()}catch{return o}}function Ka(o){try{return new URL(o,window.location.href).origin}catch{return null}}function Xa(){return {startPicker:()=>{},stopPicker:()=>{},preview:()=>{},closePreview:()=>{},close:()=>{}}}Ho();exports.closeGuidePreview=qe;exports.createBuilderSession=gr;exports.initBuilderMode=Ho;exports.previewGuide=Mo;exports.startElementPicker=Bo;exports.stopElementPicker=hr;return exports;})({});//# sourceMappingURL=veo-builder.js.map
|
|
1010
1010
|
//# sourceMappingURL=veo-builder.js.map
|