@dobeacon/sdk 0.0.0-stage → 2.0.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.
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).DoBeacon={})}(this,function(e){"use strict";let t={},n=null,o=null,i=null;const a=new Map;function r(){return"sess_"+Math.random().toString(36).slice(2)+Date.now().toString(36)}function s(e,t){return"function"!=typeof t?()=>{}:(a.has(e)||a.set(e,new Set),a.get(e).add(t),()=>d(e,t))}function d(e,t){a.get(e)?.delete(t)}function c(e,t){const n=e=>e&&e.forEach(e=>{try{e(t)}catch{}});n(a.get(e)),n(a.get("*"))}function l(e){t=e,n=r(),i=function(){try{const e=localStorage.getItem("__bvid");if(e)return e;const t="v_"+(crypto.randomUUID?.()??Math.random().toString(36).slice(2)+Date.now().toString(36));return localStorage.setItem("__bvid",t),t}catch{return"v_"+Math.random().toString(36).slice(2)+Date.now().toString(36)}}()}function p(){return{projectKey:t.projectKey,apiBase:t.apiBase,sessionId:n,visitorId:i,userId:o}}function u(e,a={}){const r={type:e,projectKey:t.projectKey,sessionId:n,visitorId:i,userId:o,timestamp:(new Date).toISOString(),...a};c(e,r);try{if(sessionStorage.getItem("dobeacon_preview_key"))return}catch{}if("function"==typeof t.sendEvent){try{t.sendEvent(r)}catch{}return}const s=`${t.apiBase}/api/events`;"undefined"!=typeof navigator&&navigator.sendBeacon?navigator.sendBeacon(s,JSON.stringify(r)):fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),keepalive:!0}).catch(()=>{})}const b={activeTourId:null,projectKey:null,visitorGroups:[],visitorUserId:null,visitorGroupsHash:null,visitorEmail:null,visitorName:null};function f(e){const t=[e.selector,...e.fallbackSelectors||[]].filter(Boolean);for(const e of t){const t=h(e);if(t)return t}if(e.ariaLabel){const t=document.querySelector(`[aria-label="${e.ariaLabel}"]`);if(t)return t}return null}function m(e,t=5e3){return new Promise((n,o)=>{const i=f(e);if(i)return n(i);const a=Date.now();let r=50;const s=()=>{const i=f(e);return i?n(i):Date.now()-a>=t?(document.dispatchEvent(new CustomEvent("dobeacon:selector_broken",{detail:{step:e}})),o(new Error(`Element not found: ${e.selector}`))):(r=Math.min(1.5*r,300),void setTimeout(s,r))};setTimeout(s,r)})}function h(e){try{return document.querySelector(e)}catch{return null}}let x=!1,g=null;function y(){x="undefined"!=typeof window&&"speechSynthesis"in window}function v(){_(),x=!1}function w(e){return x?new Promise(t=>{_(),g=new SpeechSynthesisUtterance(e),g.onend=t,g.onerror=t,window.speechSynthesis.speak(g)}):Promise.resolve()}function _(){"undefined"!=typeof window&&window.speechSynthesis&&window.speechSynthesis.cancel(),g=null}const C='-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif',k={"--dobeacon-primary":"#6366f1","--dobeacon-bg":"#fff","--dobeacon-border-color":"#e5e7eb","--dobeacon-radius":"8px","--dobeacon-shadow":"0 4px 24px rgba(0,0,0,.12)","--dobeacon-text":"#374151","--dobeacon-text-muted":"#9ca3af","--dobeacon-dot-active":"#6366f1","--dobeacon-dot-inactive":"#e5e7eb","--dobeacon-caption-bg":"rgba(0,0,0,0.82)","--dobeacon-caption-text":"#fff"},E=`background:var(--dobeacon-bg,#fff);border:1px solid var(--dobeacon-border-color,#e5e7eb);border-radius:var(--dobeacon-radius,8px);padding:16px;max-width:320px;box-shadow:var(--dobeacon-shadow,0 4px 24px rgba(0,0,0,.12));font-family:${C};`,S=`background:var(--dobeacon-bg,#fff);border-top:1px solid var(--dobeacon-border-color,#e5e7eb);padding:20px 24px;box-shadow:0 -4px 24px rgba(0,0,0,.12);font-family:${C};`,$="background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;",I="background:var(--dobeacon-bg,#fff);border-radius:calc(var(--dobeacon-radius,8px) + 4px);padding:32px;max-width:480px;width:90%;",T=`background:var(--dobeacon-bg,#fff);border-top:1px solid var(--dobeacon-border-color,#e5e7eb);padding:10px 16px 12px;box-shadow:0 -4px 16px rgba(0,0,0,.08);font-family:${C};`,A=`background:var(--dobeacon-primary,#6366f1);color:#fff;border:none;border-radius:var(--dobeacon-radius,8px);padding:8px 16px;cursor:pointer;font-family:${C};`,L=`background:var(--dobeacon-primary,#6366f1);color:#fff;border:none;border-radius:var(--dobeacon-radius,8px);padding:9px 20px;font-size:14px;cursor:pointer;font-family:${C};`,z=`background:var(--dobeacon-primary,#6366f1);color:#fff;border:none;border-radius:var(--dobeacon-radius,8px);padding:10px 20px;cursor:pointer;font-family:${C};`,B=`background:none;border:none;cursor:pointer;color:var(--dobeacon-text-muted,#9ca3af);font-size:12px;padding:0;font-family:${C};`,j="width:52px;height:52px;border-radius:50%;border:none;background:var(--dobeacon-primary,#6366f1);color:#fff;font-size:22px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 16px rgba(99,102,241,.4);";const M="@media (prefers-reduced-motion: reduce) { [data-dobeacon-ui], [data-dobeacon-ui] * { animation: none !important; transition: none !important; } }";function R(e){return"none"===e?"":`animation:dbcn-bbl-${e} 2s ease-in-out 2;`}function H(e){return String(e??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]))}function U(e){if(!e)return"";try{const t=new URL(e);return"https:"===t.protocol||"http:"===t.protocol?e:""}catch{return""}}const P=[{name:"youtube",toEmbed(e){const t=e.hostname.replace(/^www\.|^m\./,"");let n="";if("youtu.be"===t)n=e.pathname.slice(1);else if("youtube.com"===t||"youtube-nocookie.com"===t)if("/watch"===e.pathname)n=e.searchParams.get("v")||"";else{const t=e.pathname.match(/^\/(?:embed|shorts|v)\/([^/?#]+)/);t&&(n=t[1])}return/^[A-Za-z0-9_-]{6,20}$/.test(n)?`https://www.youtube-nocookie.com/embed/${n}`:null}}];function N(e){if(!U(e))return null;let t;try{t=new URL(e)}catch{return null}for(const e of P){const n=e.toEmbed(t);if(n)return n}return null}function q(e){return/^\S+$/.test(e)&&/^https?:\/\//i.test(e)}function O(e){return`<div style="position:relative;width:100%;padding-top:56.25%;margin:0 0 12px;border-radius:6px;overflow:hidden;"><iframe src="${H(e)}" style="position:absolute;inset:0;width:100%;height:100%;border:0;" sandbox="allow-scripts allow-same-origin allow-presentation allow-popups" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" title="Embedded video" loading="lazy"></iframe></div>`}const F=/!\[([^\]]*)\]\(([^)\s]+)\)|\[([^\]]+)\]\(([^)\s]+)\)|\*\*([^*]+?)\*\*|__([^_]+?)__|\*([^*]+?)\*|_([^_]+?)_|`([^`]+?)`/;function K(e){let t,n="",o=String(e);for(;t=F.exec(o);){if(n+=H(o.slice(0,t.index)),void 0!==t[1]&&void 0!==t[2]){const e=U(t[2]);n+=e?`<img src="${H(e)}" alt="${H(t[1])}" style="max-width:100%;border-radius:6px;">`:H(t[0])}else if(void 0!==t[3]&&void 0!==t[4]){const e=U(t[4]);n+=e?`<a href="${H(e)}" target="_blank" rel="noopener noreferrer nofollow">${H(t[3])}</a>`:H(t[3])}else void 0!==t[5]||void 0!==t[6]?n+=`<strong>${H(t[5]??t[6])}</strong>`:void 0!==t[7]||void 0!==t[8]?n+=`<em>${H(t[7]??t[8])}</em>`:void 0!==t[9]&&(n+=`<code>${H(t[9])}</code>`);o=o.slice(t.index+t[0].length)}return n+H(o)}const Y=["h3","h4","h5"];function V(e){const t=String(e??"");if(!t.trim())return"";const n=t.replace(/\r\n?/g,"\n").split("\n"),o=[];let i=[],a=0;const r=()=>{i.length&&(o.push(`<p>${i.map(K).join("<br>")}</p>`),i=[])};for(;a<n.length;){const e=n[a].trim();if(!e){r(),a++;continue}if(q(e)){const t=N(e);if(t){r(),o.push(O(t)),a++;continue}}const t=e.match(/^(#{1,3})\s+(.*)$/);if(t){r();const e=Y[t[1].length-1];o.push(`<${e}>${K(t[2])}</${e}>`),a++;continue}if(/^[-*]\s+/.test(e)){r();const e=[];for(;a<n.length&&/^[-*]\s+/.test(n[a].trim());)e.push(`<li>${K(n[a].trim().replace(/^[-*]\s+/,""))}</li>`),a++;o.push(`<ul>${e.join("")}</ul>`);continue}if(/^\d+\.\s+/.test(e)){r();const e=[];for(;a<n.length&&/^\d+\.\s+/.test(n[a].trim());)e.push(`<li>${K(n[a].trim().replace(/^\d+\.\s+/,""))}</li>`),a++;o.push(`<ol>${e.join("")}</ol>`);continue}i.push(e),a++}return r(),o.join("")}const D="dobeacon-overlay";let W=null,X=null,J=null,G=!1;const Q=36,Z=14;let ee=null,te=null,ne=null,oe=null;function ie(){null!==ne&&(document.body.style[ne]=oe||"",ne=null,oe=null)}function ae(){let e=document.getElementById(D);return e||(e=document.createElement("div"),e.id=D,e.setAttribute("data-dobeacon-ui",""),e.style.cssText="position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:2147483644;",document.body.appendChild(e)),e}function re(){if(document.getElementById("dobeacon-styles"))return;const e='-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif',t=document.createElement("style");t.id="dobeacon-styles",t.textContent=`\n @keyframes dobeacon-enter-fade { from { opacity:0 } to { opacity:1 } }\n @keyframes dobeacon-enter-slide-up { from { opacity:0; transform:translateY(14px) } to { opacity:1; transform:translateY(0) } }\n @keyframes dobeacon-enter-slide-down { from { opacity:0; transform:translateY(-14px) } to { opacity:1; transform:translateY(0) } }\n @keyframes dobeacon-enter-zoom { from { opacity:0; transform:scale(0.88) } to { opacity:1; transform:scale(1) } }\n @keyframes dobeacon-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.45); border-color: rgba(99,102,241,1); }\n 50% { box-shadow: 0 0 0 8px rgba(99,102,241,0); border-color: rgba(99,102,241,0.4); }\n }\n @keyframes dobeacon-glow {\n 0%, 100% { box-shadow: 0 0 0 4px rgba(99,102,241,0.2), 0 0 16px rgba(99,102,241,0.3); border-color: rgba(99,102,241,1); }\n 50% { box-shadow: 0 0 0 8px rgba(99,102,241,0.4), 0 0 32px rgba(99,102,241,0.6); border-color: rgba(99,102,241,0.8); }\n }\n @keyframes dobeacon-bounce {\n 0% { transform: translateY(0); }\n 6% { transform: translateY(-7px); }\n 12% { transform: translateY(-3px); }\n 18% { transform: translateY(-5px); }\n 20%, 100% { transform: translateY(0); }\n }\n @keyframes dobeacon-shake {\n 0% { transform: translateX(0); }\n 4% { transform: translateX(-6px); }\n 8% { transform: translateX(6px); }\n 12% { transform: translateX(-5px); }\n 16% { transform: translateX(5px); }\n 20%, 100% { transform: translateX(0); }\n }\n @keyframes dobeacon-lift {\n 0%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 0 0 2px rgba(99,102,241,.85); }\n 50% { box-shadow: 0 16px 32px rgba(0,0,0,.18), 0 8px 16px rgba(0,0,0,.12), 0 2px 4px rgba(99,102,241,.3), 0 0 0 2px rgba(99,102,241,.55); }\n }\n @keyframes dobeacon-pointer-bounce {\n 0%, 100% { transform: translateY(0) scale(1); opacity: 1; }\n 50% { transform: translateY(-8px) scale(1.18); opacity: 0.75; }\n }\n ${M}\n\n /* Progress bar sub-elements — styled here so user CSS can override them */\n #dobeacon-tour-name {\n font-size: 12px; font-weight: 700;\n color: var(--dobeacon-primary, #6366f1);\n letter-spacing: -0.1px;\n font-family: ${e};\n }\n #dobeacon-step-counter {\n font-size: 12px;\n color: var(--dobeacon-text-muted, #9ca3af);\n font-family: ${e};\n }\n #dobeacon-exit-btn {\n background: none; border: none; cursor: pointer;\n color: var(--dobeacon-text-muted, #9ca3af);\n font-size: 16px; line-height: 1; padding: 0 2px;\n transition: color .15s;\n }\n #dobeacon-progress-dots > div {\n width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0;\n background: var(--dobeacon-dot-inactive, #e5e7eb);\n transition: all .25s ease;\n }\n #dobeacon-progress-dots > div[data-done] {\n background: var(--dobeacon-dot-active, #6366f1);\n }\n #dobeacon-progress-dots > div[data-active] {\n width: 20px;\n background: var(--dobeacon-dot-active, #6366f1);\n }\n #dobeacon-powered-by {\n font-size: 10px; color: #d1d5db; text-decoration: none;\n white-space: nowrap; flex-shrink: 0; letter-spacing: 0.1px;\n font-family: ${e}; transition: color .15s;\n }\n #dobeacon-powered-by:hover { color: var(--dobeacon-primary, #6366f1); }\n\n /* Tooltip sub-elements */\n #dobeacon-tooltip-title {\n font-weight: 600; margin: 0 0 6px;\n color: var(--dobeacon-text, #374151);\n font-family: ${e};\n }\n #dobeacon-tooltip-body {\n margin: 0 0 12px;\n color: var(--dobeacon-text, #374151);\n font-family: ${e};\n }\n\n /* Spotlight sub-elements */\n #dobeacon-spotlight-title {\n font-weight: 700; font-size: 15px; margin: 0 0 8px;\n color: #111827;\n font-family: ${e};\n }\n #dobeacon-spotlight-body {\n margin: 0 0 14px; font-size: 14px; line-height: 1.5;\n color: var(--dobeacon-text, #374151);\n font-family: ${e};\n }\n\n /* TTS caption */\n #dobeacon-caption {\n background: var(--dobeacon-caption-bg, rgba(0,0,0,0.82));\n color: var(--dobeacon-caption-text, #fff);\n font-family: ${e};\n font-size: 15px;\n line-height: 1.5;\n text-align: center;\n padding: 10px 20px;\n border-radius: 8px;\n max-width: 640px;\n width: 90%;\n }\n\n /* Modal sub-elements */\n #dobeacon-modal-title {\n margin: 0 0 12px; font-size: 1.25rem;\n color: var(--dobeacon-text, #374151);\n font-family: ${e};\n }\n #dobeacon-modal-body {\n margin: 0 0 16px;\n color: var(--dobeacon-text, #374151);\n font-family: ${e};\n }\n\n /* Rich-text body content (rendered from the step's Markdown) */\n [data-dobeacon-richtext] p { margin: 0 0 10px; }\n [data-dobeacon-richtext] > :last-child { margin-bottom: 0; }\n [data-dobeacon-richtext] ul,\n [data-dobeacon-richtext] ol { margin: 0 0 10px; padding-left: 20px; }\n [data-dobeacon-richtext] li { margin: 2px 0; }\n [data-dobeacon-richtext] h3 { font-size: 16px; font-weight: 700; margin: 8px 0 6px; }\n [data-dobeacon-richtext] h4 { font-size: 14px; font-weight: 700; margin: 8px 0 6px; }\n [data-dobeacon-richtext] h5 { font-size: 13px; font-weight: 700; margin: 8px 0 6px; }\n [data-dobeacon-richtext] a { color: var(--dobeacon-primary, #6366f1); text-decoration: underline; }\n [data-dobeacon-richtext] img { max-width: 100%; border-radius: 6px; }\n [data-dobeacon-richtext] code {\n background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 4px;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em;\n }\n `,(document.head||document.documentElement).appendChild(t)}function se(e,t){if(G)return;const n=e.offsetHeight,o=e.offsetWidth,i=t.bottom+8+n<=window.innerHeight?t.bottom+8:Math.max(8,t.top-n-8),a=Math.max(8,Math.min(t.left,window.innerWidth-o-8));e.style.top=`${i}px`,e.style.left=`${a}px`}function de(e){ce(),W=e,X=()=>{J||(J=requestAnimationFrame(()=>{J=null,function(){if(!W)return;const e=document.getElementById(D);if(!e)return;const t=W.getBoundingClientRect(),n=e.querySelector("[data-dobeacon-hole]");n&&(n.style.top=t.top-8+"px",n.style.left=t.left-8+"px",n.style.width=`${t.width+16}px`,n.style.height=`${t.height+16}px`);const o=e.querySelector("[data-dobeacon-ring]");o&&(o.style.top=t.top-8-2+"px",o.style.left=t.left-8-2+"px",o.style.width=`${t.width+20}px`,o.style.height=`${t.height+20}px`);const i=document.getElementById("dobeacon-tooltip");i&&se(i,t);const a=e.querySelector("[data-dobeacon-pointer]");if(a&&ee){const e=ee.getBoundingClientRect(),[t,n]=me(e,te);a.style.top=`${t}px`,a.style.left=`${n}px`}}()}))},window.addEventListener("scroll",X,{passive:!0})}function ce(){X&&(window.removeEventListener("scroll",X),X=null),J&&(cancelAnimationFrame(J),J=null),W=null}function le(e){return`<button id="${e}" data-dobeacon-exit onclick="document.dispatchEvent(new CustomEvent('dobeacon:exit'))"\n style="${B}pointer-events:all;"\n aria-label="Exit tour">Exit tour</button>`}function pe(e,t,{waitForClick:n=!1,skipWait:o=!1}={}){const i=ae(),a=e.getBoundingClientRect(),r=document.createElement("div");r.setAttribute("role","tooltip"),r.setAttribute("aria-live","polite"),r.id="dobeacon-tooltip";const s=t.entrance??"slide-up";r.style.cssText="position:fixed;pointer-events:all;z-index:2147483647;"+E+("none"!==s?`animation:dobeacon-enter-${s} 0.28s ease-out;`:"");const d='<span style="font-size:12px;color:var(--dobeacon-text-muted,#9ca3af);">Click the highlighted element</span>',c=n?o?`<div style="display:flex;align-items:center;gap:8px;">${d}<button id="dobeacon-tooltip-next" data-dobeacon-next style="${A}font-size:12px;padding:6px 12px;pointer-events:all;" aria-label="Skip step">Skip</button></div>`:d:`<button id="dobeacon-tooltip-next" data-dobeacon-next style="${A}pointer-events:all;" aria-label="Next step">Next →</button>`;r.innerHTML=`\n <div data-dobeacon-drag style="cursor:grab;display:flex;justify-content:center;padding:2px 0 8px;margin:-4px -4px 4px;opacity:0.35;user-select:none;" title="Drag to move">\n <svg width="18" height="8" viewBox="0 0 18 8" fill="currentColor"><circle cx="3" cy="2" r="1.5"/><circle cx="9" cy="2" r="1.5"/><circle cx="15" cy="2" r="1.5"/><circle cx="3" cy="6" r="1.5"/><circle cx="9" cy="6" r="1.5"/><circle cx="15" cy="6" r="1.5"/></svg>\n </div>\n ${t.content?.title?`<p id="dobeacon-tooltip-title">${H(t.content.title)}</p>`:""}\n ${t.content?.body?`<div id="dobeacon-tooltip-body" data-dobeacon-richtext>${V(t.content.body)}</div>`:""}\n ${U(t.content?.mediaUrl)?`<img id="dobeacon-tooltip-media" src="${H(U(t.content.mediaUrl))}" alt="" style="width:100%;border-radius:4px;margin-bottom:12px">`:""}\n <div style="display:flex;align-items:center;justify-content:space-between;gap:12px;">\n ${le("dobeacon-tooltip-exit")}\n ${c}\n </div>\n `,i.appendChild(r),function(e){const t=e.querySelector("[data-dobeacon-drag]");if(!t)return;let n,o,i,a;const r=(t,r)=>{const s=Math.max(0,Math.min(window.innerWidth-e.offsetWidth,i+t-n)),d=Math.max(0,Math.min(window.innerHeight-e.offsetHeight,a+r-o));e.style.left=`${s}px`,e.style.top=`${d}px`,G=!0},s=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",s),t.style.cursor="grab"},d=e=>r(e.clientX,e.clientY),c=()=>{document.removeEventListener("touchmove",l),document.removeEventListener("touchend",c)},l=e=>{e.preventDefault(),r(e.touches[0].clientX,e.touches[0].clientY)};t.addEventListener("mousedown",r=>{r.preventDefault(),n=r.clientX,o=r.clientY,i=parseFloat(e.style.left),a=parseFloat(e.style.top),t.style.cursor="grabbing",document.addEventListener("mousemove",d),document.addEventListener("mouseup",s)}),t.addEventListener("touchstart",t=>{n=t.touches[0].clientX,o=t.touches[0].clientY,i=parseFloat(e.style.left),a=parseFloat(e.style.top),document.addEventListener("touchmove",l,{passive:!1}),document.addEventListener("touchend",c)},{passive:!0})}(r),e.setAttribute("aria-describedby","dobeacon-tooltip"),se(r,a)}function ue(e,t){xe(),e&&be(e,!1,t.animation??"pulse"),re();const n=t.placement??"bottom",o="left"===n||"right"===n;let i=!1;const a=ae(),r=document.createElement("div");function s(){const e={bottom:"paddingBottom",top:"paddingTop",left:"paddingLeft",right:"paddingRight"}[n],t=o?r.offsetWidth:r.offsetHeight;t>0&&(ne=e,oe=document.body.style[e]||"",document.body.style[e]=t+"px")}r.setAttribute("role","dialog"),r.setAttribute("aria-live","polite"),r.id="dobeacon-spotlight-panel",a.appendChild(r),function a(){ie();const d={bottom:"position:fixed;bottom:0;left:0;right:0;",top:"position:fixed;top:0;left:0;right:0;",left:"position:fixed;top:0;bottom:0;left:0;",right:"position:fixed;top:0;bottom:0;right:0;"}[n],c=`background:var(--dobeacon-bg,#fff);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;pointer-events:all;z-index:2147483647;box-shadow:${{bottom:"0 -4px 24px rgba(0,0,0,.12)",top:"0 4px 24px rgba(0,0,0,.12)",left:"4px 0 24px rgba(0,0,0,.12)",right:"-4px 0 24px rgba(0,0,0,.12)"}[n]};${{bottom:"border-top:1px solid var(--dobeacon-border-color,#e5e7eb);",top:"border-bottom:1px solid var(--dobeacon-border-color,#e5e7eb);",left:"border-right:1px solid var(--dobeacon-border-color,#e5e7eb);",right:"border-left:1px solid var(--dobeacon-border-color,#e5e7eb);"}[n]}`,l=t.entrance??"slide-up",p="none"!==l?`animation:dobeacon-enter-${l} .28s ease-out;`:"";i?(r.style.cssText=o?`${d}${c}min-width:220px;width:320px;overflow-y:auto;padding:20px;${p}`:`${d}${c}min-height:60px;max-height:50vh;overflow-y:auto;padding:20px 24px;${p}`,r.innerHTML=`\n <div style="max-width:640px;margin:0 auto;width:100%;">\n <div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;">\n ${t.content?.title?`<p style="font-size:15px;font-weight:700;color:var(--dobeacon-text,#111827);margin:0;">${H(t.content.title)}</p>`:"<span></span>"}\n <button data-dobeacon-collapse style="background:none;border:1px solid #e5e7eb;cursor:pointer;color:#6b7280;font-size:10px;font-weight:700;font-family:inherit;padding:2px 7px;border-radius:4px;white-space:nowrap;flex-shrink:0;letter-spacing:.3px;" aria-label="Collapse to condensed view">CONDENSE</button>\n </div>\n ${t.content?.body?`<div data-dobeacon-richtext style="font-size:14px;color:var(--dobeacon-text-secondary,#374151);line-height:1.6;margin-bottom:18px;">${V(t.content.body)}</div>`:""}\n ${U(t.content?.mediaUrl)?`<img src="${H(U(t.content.mediaUrl))}" alt="" style="max-width:100%;border-radius:6px;margin-bottom:18px;">`:""}\n <div style="display:flex;align-items:center;justify-content:space-between;">\n ${le("dobeacon-spotlight-exit")}\n <button id="dobeacon-spotlight-next" data-dobeacon-next style="${L}pointer-events:all;" aria-label="Next step">Next &#8594;</button>\n </div>\n </div>`):(r.style.cssText=o?`${d}${c}min-width:220px;width:220px;overflow-y:auto;padding:14px 16px;${p}`:`${d}${c}min-height:60px;max-height:30vh;overflow-y:auto;padding:14px 20px;${p}`,r.innerHTML=`\n <div style="max-width:640px;margin:0 auto;width:100%;">\n <div style="display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:${t.content?.body?"8px":"10px"};">\n <div style="display:flex;align-items:center;gap:8px;flex:1;min-width:0;">\n <div style="width:3px;height:18px;background:var(--dobeacon-primary,#6366f1);border-radius:2px;flex-shrink:0;margin-top:1px;"></div>\n ${t.content?.title?`<p style="font-size:13px;font-weight:700;color:var(--dobeacon-text,#111827);margin:0;line-height:1.3;">${H(t.content.title)}</p>`:""}\n </div>\n <button data-dobeacon-expand style="background:none;border:1px solid var(--dobeacon-primary,#6366f1);cursor:pointer;color:var(--dobeacon-primary,#6366f1);font-size:10px;font-weight:700;font-family:inherit;padding:2px 7px;border-radius:4px;white-space:nowrap;flex-shrink:0;letter-spacing:.3px;" aria-label="Expand for comfortable reading">EXPAND</button>\n </div>\n ${t.content?.body?`<div data-dobeacon-richtext style="font-size:13px;color:var(--dobeacon-text-secondary,#374151);line-height:1.45;margin:0 0 12px;">${V(t.content.body)}</div>`:""}\n ${U(t.content?.mediaUrl)?`<img src="${H(U(t.content.mediaUrl))}" alt="" style="max-width:100%;border-radius:6px;margin-bottom:12px;">`:""}\n <div style="display:flex;align-items:center;justify-content:space-between;">\n ${le("dobeacon-spotlight-exit")}\n <button id="dobeacon-spotlight-next" data-dobeacon-next style="${L}pointer-events:all;font-size:12px;padding:6px 14px;" aria-label="Next step">Next &#8594;</button>\n </div>\n </div>`),r.querySelector("[data-dobeacon-expand]")?.addEventListener("click",()=>{i=!0,a()}),r.querySelector("[data-dobeacon-collapse]")?.addEventListener("click",()=>{i=!1,a()}),r.querySelector("#dobeacon-spotlight-next")?.addEventListener("click",()=>{document.dispatchEvent(new CustomEvent("dobeacon:advance"))}),requestAnimationFrame(s),e&&e.setAttribute("aria-describedby","dobeacon-spotlight-panel")}()}function be(e,t=!1,n="pulse",o=!0){re();const i=ae(),a=e.getBoundingClientRect();if(o){const e=document.createElement("div");e.setAttribute("aria-hidden","true"),e.setAttribute("data-dobeacon-hole",""),e.style.cssText=`\n position:fixed;\n top:${a.top-8}px;\n left:${a.left-8}px;\n width:${a.width+16}px;\n height:${a.height+16}px;\n border-radius:8px;\n box-shadow:0 0 0 9999px rgba(0,0,0,0.6);\n pointer-events:none;\n `,i.appendChild(e)}if(de(e),"none"===n)return;const r=document.createElement("div");r.setAttribute("aria-hidden","true"),r.setAttribute("data-dobeacon-ring","");const s="bounce"===n||"shake"===n||"lift"===n,d=a.top-8-2,c=a.left-8-2,l=a.width+20,p=a.height+20;r.style.cssText=`\n position:fixed;\n top:${d}px;\n left:${c}px;\n width:${l}px;\n height:${p}px;\n border-radius:10px;\n border:2px solid rgba(99,102,241,1);\n pointer-events:none;\n animation:dobeacon-${n} ${s?"3s":"1.8s"} ease-in-out infinite;\n transform-origin:center;\n `,i.appendChild(r)}function fe(e,t=null){const n=ae(),o=document.createElement("div");o.id="dobeacon-modal-backdrop",o.style.cssText=`position:fixed;inset:0;pointer-events:all;z-index:2147483647;${$}`,o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-live","polite");const i=e.entrance??"zoom",a=document.createElement("div");if(a.id="dobeacon-modal-box",a.style.cssText=I+("none"!==i?`animation:dobeacon-enter-${i} 0.28s ease-out;`:""),a.innerHTML=`\n ${e.content?.title?`<h2 id="dobeacon-modal-title">${H(e.content.title)}</h2>`:""}\n ${e.content?.body?`<div id="dobeacon-modal-body" data-dobeacon-richtext>${V(e.content.body)}</div>`:""}\n ${U(e.content?.mediaUrl)&&"video"===e.type?`<video id="dobeacon-modal-media" src="${H(U(e.content.mediaUrl))}" controls style="width:100%;border-radius:6px;margin-bottom:16px"></video>`:U(e.content?.mediaUrl)?`<img id="dobeacon-modal-media" src="${H(U(e.content.mediaUrl))}" alt="" style="width:100%;border-radius:6px;margin-bottom:16px">`:""}\n <div style="display:flex;align-items:center;justify-content:space-between;gap:16px;">\n ${le("dobeacon-modal-exit")}\n <button id="dobeacon-modal-next" data-dobeacon-next style="${z}" aria-label="Next step">Next →</button>\n </div>\n `,o.appendChild(a),n.appendChild(o),t){re();const o=e.animation??"pulse";if("none"!==o){const e=t.getBoundingClientRect(),i=8,a="bounce"===o||"shake"===o||"lift"===o,r=document.createElement("div");r.setAttribute("aria-hidden","true"),r.setAttribute("data-dobeacon-ring",""),r.style.cssText=`\n position:fixed;\n top:${e.top-i-2}px;left:${e.left-i-2}px;\n width:${e.width+2*(i+2)}px;height:${e.height+2*(i+2)}px;\n border-radius:10px;border:2px solid rgba(99,102,241,1);\n pointer-events:none;\n animation:dobeacon-${o} ${a?"3s":"1.8s"} ease-in-out infinite;\n transform-origin:center;\n `,n.appendChild(r),de(t)}}}function me(e,t){let n,o;return"above"===t?(n=e.top-Z-Q,o=e.left+e.width/2-18):"below"===t?(n=e.bottom+Z,o=e.left+e.width/2-18):"left"===t?(n=e.top+e.height/2-18,o=e.left-Z-Q):(n=e.top+e.height/2-18,o=e.right+Z),[Math.max(4,Math.min(window.innerHeight-Q-4,n)),Math.max(4,Math.min(window.innerWidth-Q-4,o))]}function he(e){re();const t=ae();t.querySelector("[data-dobeacon-pointer]")?.remove(),ee=e,te=function(e){const t=e.top,n=e.left,o=window.innerWidth-e.right;return t>=50?"above":n>=50?"left":o>=50?"right":t>=window.innerHeight-e.bottom?"above":"below"}(e.getBoundingClientRect());const[n,o]=me(e.getBoundingClientRect(),te),i=document.createElement("div");i.setAttribute("data-dobeacon-ui",""),i.setAttribute("aria-hidden","true"),i.setAttribute("data-dobeacon-pointer",""),i.style.cssText=`\n position:fixed;top:${n}px;left:${o}px;\n width:36px;height:36px;\n pointer-events:none;\n transform:rotate(${{above:180,below:0,left:90,right:270}[te]}deg);\n transform-origin:center;\n `;const a=document.createElement("div");a.style.cssText="width:100%;height:100%;animation:dobeacon-pointer-bounce 1s ease-in-out infinite;",a.innerHTML='<svg viewBox="0 0 32 32" width="36" height="36" xmlns="http://www.w3.org/2000/svg">\n <path d="M16 5L28 26H4L16 5Z" fill="#6366f1"/>\n </svg>',i.appendChild(a),t.appendChild(i)}function xe(){ce(),ie(),G=!1,ee=null,te=null;const e=document.getElementById(D);e&&(e.innerHTML="")}const ge="dobeacon-progress";let ye=null;function ve(e){null===ye&&(ye=document.body.style.paddingBottom||""),document.body.style.paddingBottom=`${e.offsetHeight}px`}function we(e,t,n){Ce();const o=document.createElement("div");o.id=ge,o.setAttribute("data-dobeacon-ui",""),o.setAttribute("role","progressbar"),o.setAttribute("aria-valuemin","0"),o.setAttribute("aria-valuemax",String(t)),o.setAttribute("aria-valuenow",String(e+1)),o.style.cssText=`position:fixed;bottom:0;left:0;right:0;z-index:2147483645;${T}`;const i=Array.from({length:t},(t,n)=>`\n <div id="dobeacon-dot-${n}" ${n===e?"data-active":n<e?"data-done":""}></div>\n `).join("");o.innerHTML=`\n <div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;">\n <span id="dobeacon-tour-name">${H(n||"Tour")}</span>\n <div style="display:flex;align-items:center;gap:10px;">\n <span id="dobeacon-step-counter">Step ${e+1} of ${t}</span>\n <button id="dobeacon-exit-btn" aria-label="Exit tour" title="Exit tour">✕</button>\n </div>\n </div>\n <div style="display:flex;align-items:center;justify-content:space-between;gap:8px;">\n <div id="${ge}-dots" style="display:flex;align-items:center;gap:4px;">${i}</div>\n <a id="dobeacon-powered-by" href="https://dobeacon.com" target="_blank" rel="noopener noreferrer">\n Powered by <strong>DoBeacon</strong>\n </a>\n </div>\n `,o.querySelector("#dobeacon-exit-btn").addEventListener("click",()=>{document.dispatchEvent(new CustomEvent("dobeacon:exit"))}),document.body.appendChild(o),ve(o)}function _e(e,t){const n=document.getElementById(ge);if(!n)return;n.setAttribute("aria-valuenow",String(e+1));const o=n.querySelector("#dobeacon-step-counter")??n.querySelector("span:last-child");o&&(o.textContent=`Step ${e+1} of ${t}`);const i=document.getElementById(`${ge}-dots`);i&&(i.innerHTML=Array.from({length:t},(t,n)=>`\n <div id="dobeacon-dot-${n}" ${n===e?"data-active":n<e?"data-done":""}></div>\n `).join(""))}function Ce(){document.getElementById(ge)?.remove(),null!==ye&&(document.body.style.paddingBottom=ye,ye=null)}const ke="dobeacon-caption";function Ee(e){Se();const t=document.createElement("div");t.id=ke,t.setAttribute("data-dobeacon-ui",""),t.setAttribute("aria-live","polite");const n=document.getElementById(ge);t.style.cssText=`\n position:fixed;\n bottom:${n?n.offsetHeight+8:8}px;\n left:50%;transform:translateX(-50%);\n z-index:2147483645;pointer-events:none;\n animation:dobeacon-enter-fade 0.2s ease-out;\n `,t.textContent=e,document.body.appendChild(t)}function Se(){document.getElementById(ke)?.remove()}function $e(e,t){return`dobeacon_quiz_sub_${e}_${t}`}function Ie(e,t){try{return parseInt(localStorage.getItem($e(e,t))||"0",10)}catch{return 0}}function Te(e){return String(e??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]))}const Ae="#6366f1",Le="#e5e7eb",ze="#111827",Be="#6b7280";function je(e,t){Object.assign(e.style,t)}function Me(e,t=!0){const n=document.createElement("button");return n.textContent=e,n.setAttribute("data-dobeacon-ui",""),je(n,{display:"inline-block",cursor:"pointer",border:"none",borderRadius:"8px",padding:"9px 20px",fontSize:"13px",fontWeight:"600",transition:"opacity .15s",background:t?Ae:"#f3f4f6",color:t?"white":ze}),n.onmouseenter=()=>{n.style.opacity="0.88"},n.onmouseleave=()=>{n.style.opacity="1"},n}function Re(e,t,n){return new Promise(o=>{const i=e.maxSubmissions??1,a=Ie(t._id,n);if(a>=i){const{backdrop:t,continueBtn:n}=function(e,t,n){const o=e.feedbackType||"single",i=e.feedback?.options||[],a=document.createElement("div");a.setAttribute("data-dobeacon-ui",""),a.setAttribute("data-dobeacon-feedback",""),je(a,{position:"fixed",inset:"0",background:"rgba(0,0,0,0.45)",zIndex:"2147483640",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"system-ui,-apple-system,sans-serif",boxSizing:"border-box"});const r=document.createElement("div");if(r.setAttribute("data-dobeacon-ui",""),je(r,{background:"white",borderRadius:"16px",padding:"28px",width:"min(480px,90vw)",maxHeight:"80vh",overflowY:"auto",boxShadow:"0 20px 60px rgba(0,0,0,0.25)",position:"relative",boxSizing:"border-box"}),e.content?.title){const t=document.createElement("p");t.setAttribute("data-dobeacon-ui",""),t.textContent=e.content.title,je(t,{fontWeight:"700",fontSize:"16px",color:ze,margin:"0 0 6px"}),r.appendChild(t)}if(e.content?.body){const t=document.createElement("p");t.setAttribute("data-dobeacon-ui",""),t.textContent=e.content.body,je(t,{fontSize:"13px",color:Be,margin:"0 0 18px"}),r.appendChild(t)}if("freeform"===o){const e=document.createElement("div");e.setAttribute("data-dobeacon-ui",""),je(e,{width:"100%",boxSizing:"border-box",border:`1px solid ${Le}`,borderRadius:"8px",padding:"10px 12px",fontSize:"13px",minHeight:"80px",color:"#d1d5db",background:"#f9fafb",margin:"0 0 16px",userSelect:"none"}),e.textContent="Type your answer…",r.appendChild(e)}else if("rating"===o){const e=i.length?i:[{label:"Not at all",value:"1"},{label:"",value:"2"},{label:"",value:"3"},{label:"",value:"4"},{label:"Very useful",value:"5"}],t=document.createElement("div");t.setAttribute("data-dobeacon-ui",""),je(t,{display:"flex",gap:"8px",margin:"0 0 16px"}),e.forEach(e=>{const n=document.createElement("div");n.setAttribute("data-dobeacon-ui",""),n.textContent=e.label||e.value,je(n,{flex:"1",padding:"10px 4px",border:`1.5px solid ${Le}`,borderRadius:"8px",fontSize:"13px",fontWeight:"600",background:"#f9fafb",color:"#d1d5db",textAlign:"center",userSelect:"none"}),t.appendChild(n)}),r.appendChild(t)}else{const e=document.createElement("div");e.setAttribute("data-dobeacon-ui",""),je(e,{display:"flex",flexDirection:"column",gap:"8px",margin:"0 0 16px"}),i.forEach(t=>{const n=document.createElement("div");n.setAttribute("data-dobeacon-ui",""),je(n,{display:"flex",alignItems:"center",gap:"10px",border:`1.5px solid ${Le}`,borderRadius:"10px",padding:"10px 14px",background:"#f9fafb",boxSizing:"border-box",userSelect:"none"});const i=document.createElement("div");i.setAttribute("data-dobeacon-ui",""),je(i,{width:"16px",height:"16px",borderRadius:"multi"===o?"4px":"50%",border:"2px solid #d1d5db",background:"white",flexShrink:"0"});const a=document.createElement("span");a.setAttribute("data-dobeacon-ui",""),a.textContent=t.label,je(a,{fontSize:"13px",color:"#9ca3af",flex:"1"}),n.appendChild(i),n.appendChild(a),e.appendChild(n)}),r.appendChild(e)}const s=document.createElement("div");s.setAttribute("data-dobeacon-ui","");const d=1===t?"time":"times";s.textContent=`You have already submitted this quiz ${t} ${d}. No further submissions are allowed (limit: ${n}).`,je(s,{borderRadius:"10px",padding:"12px 14px",fontSize:"13px",lineHeight:"1.5",background:"#f9fafb",color:Be,border:`1px solid ${Le}`,marginBottom:"10px"});const c=Me("Continue →");je(c,{alignSelf:"flex-end"});const l=document.createElement("div");return l.setAttribute("data-dobeacon-ui",""),je(l,{display:"flex",flexDirection:"column",gap:"10px"}),l.appendChild(s),l.appendChild(c),r.appendChild(l),a.appendChild(r),{backdrop:a,continueBtn:c}}(e,a,i);return document.body.appendChild(t),void(n.onclick=()=>{t.remove(),o(null)})}const{backdrop:r,submitBtn:s,continueBtn:d,feedbackMsg:c,getValue:l,hasValidation:u,correct:b}=function(e){const t=e.feedbackType||"single",n=e.feedback?.options||[],o=e.feedback?.correct||[],i=o.length>0&&"freeform"!==t,a=document.createElement("div");a.setAttribute("data-dobeacon-ui",""),a.setAttribute("data-dobeacon-feedback",""),je(a,{position:"fixed",inset:"0",background:"rgba(0,0,0,0.45)",zIndex:"2147483640",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"system-ui,-apple-system,sans-serif",boxSizing:"border-box"});const r=document.createElement("div");if(r.setAttribute("data-dobeacon-ui",""),je(r,{background:"white",borderRadius:"16px",padding:"28px",width:"min(480px,90vw)",maxHeight:"80vh",overflowY:"auto",boxShadow:"0 20px 60px rgba(0,0,0,0.25)",position:"relative",boxSizing:"border-box"}),e.content?.title){const t=document.createElement("p");t.setAttribute("data-dobeacon-ui",""),t.textContent=e.content.title,je(t,{fontWeight:"700",fontSize:"16px",color:ze,margin:"0 0 6px"}),r.appendChild(t)}if(e.content?.body){const t=document.createElement("p");t.setAttribute("data-dobeacon-ui",""),t.textContent=e.content.body,je(t,{fontSize:"13px",color:Be,margin:"0 0 18px"}),r.appendChild(t)}let s;if("freeform"===t){const e=document.createElement("textarea");e.setAttribute("data-dobeacon-ui",""),e.placeholder="Type your answer…",je(e,{width:"100%",boxSizing:"border-box",border:`1px solid ${Le}`,borderRadius:"8px",padding:"10px 12px",fontSize:"13px",resize:"vertical",minHeight:"80px",color:ze,fontFamily:"inherit",outline:"none",display:"block",margin:"0 0 16px"}),r.appendChild(e),s=()=>e.value.trim()}else if("rating"===t){const e=n.length?n:[{label:"Not at all",value:"1"},{label:"",value:"2"},{label:"",value:"3"},{label:"",value:"4"},{label:"Very useful",value:"5"}],t=document.createElement("div");t.setAttribute("data-dobeacon-ui",""),je(t,{display:"flex",gap:"8px",margin:"0 0 6px"});let o=null;const i=[];e.forEach((e,n)=>{const a=document.createElement("button");a.setAttribute("data-dobeacon-ui",""),a.textContent=e.label||e.value,je(a,{flex:"1",padding:"10px 4px",border:`1.5px solid ${Le}`,borderRadius:"8px",fontSize:"13px",fontWeight:"600",background:"white",color:Be,cursor:"pointer",transition:"all .15s"}),a.onclick=()=>{o=e.value,i.forEach((e,t)=>{je(e,{background:t===n?Ae:"white",color:t===n?"white":Be,borderColor:t===n?Ae:Le})})},i.push(a),t.appendChild(a)}),r.appendChild(t);const a=document.createElement("div");a.setAttribute("data-dobeacon-ui",""),je(a,{display:"flex",justifyContent:"space-between",margin:"0 0 16px"});const d=e[0]?.label,c=e[e.length-1]?.label;(d||c)&&([d||"",c||""].forEach((e,t)=>{const n=document.createElement("span");n.setAttribute("data-dobeacon-ui",""),n.textContent=e,je(n,{fontSize:"11px",color:"#9ca3af"}),1===t&&(n.style.textAlign="right"),a.appendChild(n)}),r.appendChild(a)),s=()=>o?[o]:[]}else{const e="multi"===t,o=document.createElement("div");o.setAttribute("data-dobeacon-ui",""),je(o,{display:"flex",flexDirection:"column",gap:"8px",margin:"0 0 16px"});const i=new Set,a=[];n.forEach(t=>{const n=document.createElement("label");n.setAttribute("data-dobeacon-ui",""),je(n,{display:"flex",alignItems:"center",gap:"10px",border:`1.5px solid ${Le}`,borderRadius:"10px",padding:"10px 14px",cursor:"pointer",transition:"all .15s",boxSizing:"border-box"});const r=document.createElement("input");r.type=e?"checkbox":"radio",r.name="dobeacon-feedback-opt",r.value=t.value,je(r,{accentColor:Ae,width:"16px",height:"16px",flexShrink:"0",cursor:"pointer"}),r.onchange=()=>{e?r.checked?i.add(t.value):i.delete(t.value):(i.clear(),r.checked&&i.add(t.value)),a.forEach(({el:e,i:t})=>{je(e,{borderColor:t.checked?Ae:Le,background:t.checked?"#eef2ff":"white"})})};const s=document.createElement("span");s.setAttribute("data-dobeacon-ui",""),s.textContent=t.label,je(s,{fontSize:"13px",color:ze,flex:"1"}),n.appendChild(r),n.appendChild(s),o.appendChild(n),a.push({el:n,i:r})}),r.appendChild(o),s=()=>e?[...i]:i.size?[[...i][0]]:[]}const d=document.createElement("div");d.setAttribute("data-dobeacon-ui",""),je(d,{display:"flex",flexDirection:"column",gap:"10px"});const c=document.createElement("div");c.setAttribute("data-dobeacon-ui",""),je(c,{display:"none",borderRadius:"10px",padding:"12px 14px",fontSize:"13px",lineHeight:"1.5"});const l=Me("Submit"),p=Me("Continue →");return je(p,{display:"none",alignSelf:"flex-end"}),je(l,{alignSelf:"flex-end"}),d.appendChild(c),d.appendChild(l),d.appendChild(p),r.appendChild(d),a.appendChild(r),{backdrop:a,submitBtn:l,continueBtn:p,feedbackMsg:c,getValue:s,hasValidation:i,correct:o,feedbackType:t}}(e);document.body.appendChild(r),s.onclick=async()=>{const i=l();if(Array.isArray(i)?0===i.length:!i)return;let a=null;if(u){const e=new Set(Array.isArray(i)?i:[i]),t=new Set(b);a=e.size===t.size&&[...e].every(e=>t.has(e))}!function(e,t){try{localStorage.setItem($e(e,t),String(Ie(e,t)+1))}catch{}}(t._id,n),async function(e,t,n,o,i){const a=p();if(!a.projectKey||!a.apiBase)return;const r={projectKey:a.projectKey,tourId:t._id,projectId:t.projectId,stepIndex:n,feedbackType:e.feedbackType||"single",question:e.content?.title||"",answer:o,isCorrect:i,visitorId:a.visitorId,userId:a.userId,sessionId:a.sessionId};try{await fetch(`${a.apiBase}/api/feedback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}catch{}}(e,t,n,i,a),s.style.display="none",d.style.display="inline-block",u&&(je(c,{display:"block"}),a?(je(c,{background:"#f0fdf4",color:"#166534",border:"1px solid #bbf7d0"}),c.innerHTML="<strong>✓ Correct!</strong>"+(e.feedback?.correctFeedback?"<br>"+Te(e.feedback.correctFeedback):"")):(je(c,{background:"#fef2f2",color:"#991b1b",border:"1px solid #fecaca"}),c.innerHTML="<strong>✗ Not quite right</strong>"+(e.feedback?.incorrectFeedback?"<br>"+Te(e.feedback.incorrectFeedback):""))),d.onclick=()=>{r.remove(),o({answer:i,isCorrect:a})}}})}const He="#111827",Ue="#6b7280",Pe="#f0fdf4",Ne="#166534",qe="#bbf7d0",Oe="#fef2f2",Fe="#991b1b",Ke="#fecaca";function Ye(e,t){Object.assign(e.style,t)}function Ve(e){return String(e??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]))}function De(e,t){if(!e||Array.isArray(e)&&0===e.length)return null;return(Array.isArray(e)?e:[e]).map(e=>{const n=(t||[]).find(t=>t.value===e);return n?n.label:e}).join(", ")}const We="dobeacon-human-check";let Xe=null,Je=null,Ge=null,Qe=!1,Ze=Promise.resolve();function et(e){const t=Ze.then(()=>function(e){return function(e){Xe||(Xe=document.createElement("iframe"),Xe.setAttribute("data-dobeacon-ui",""),Xe.title="Security check",Xe.src=`${e.apiBase}/api/widget/human-check?projectKey=${encodeURIComponent(e.projectKey)}`,Je=new URL(Xe.src,window.location.href).origin,Xe.style.cssText="position:fixed;right:16px;bottom:88px;width:300px;height:70px;border:0;z-index:2147483647;visibility:hidden;background:transparent;",Ge=new Promise(e=>{Xe.addEventListener("load",e,{once:!0})}),document.body.appendChild(Xe))}(e),new Promise(e=>{const t=t=>{clearTimeout(n),window.removeEventListener("message",o),Xe&&(Xe.style.visibility="hidden"),e(t)},n=setTimeout(()=>t(null),2e4);function o(e){Xe&&e.source===Xe.contentWindow&&e.data?.type===We&&("interactive"in e.data?Xe.style.visibility=e.data.interactive?"visible":"hidden":e.data.token?t(e.data.token):e.data.failed&&t(null))}window.addEventListener("message",o),Ge.then(()=>{Xe?.contentWindow?.postMessage({type:We,request:!0},Je)})})}(e));return Ze=t.catch(()=>null),t}async function tt(e,t,n){const o=n=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,...n})}),i=async e=>428===e.status&&Boolean((await e.clone().json().catch(()=>({}))).humanCheckRequired),a=async()=>o({humanCheckToken:await et(n)??void 0});if(Qe){const e=await a();return await i(e)?a():e}const r=await o({});if(!await i(r))return r;Qe=!0;const s=await et(n);return s?o({humanCheckToken:s}):r}function nt(){const e=new URLSearchParams({visitorGroups:b.visitorGroups.join(",")});return b.visitorUserId&&e.set("userId",b.visitorUserId),b.visitorGroupsHash&&e.set("groupsHash",b.visitorGroupsHash),e.toString()}function ot(e,t,n,o,i,a){i.innerHTML="";const r=document.createElement("span");r.setAttribute("data-dobeacon-ui",""),r.style.cssText="font-size:11px;color:#9ca3af;",r.textContent="Sending…",i.appendChild(r),tt(`${a.apiBase}/api/chat/zendesk-ticket`,{projectKey:a.projectKey,transcript:e,note:o||void 0,pageUrl:window.location.href,visitorEmail:t,visitorName:n??void 0},a).then(e=>e.json().then(t=>({ok:e.ok,d:t}))).then(({ok:e,d:t})=>{r.textContent=e?"Ticket submitted! We'll follow up by email.":t.error||"Failed to submit. Try again.",r.style.color=e?"#16a34a":"#dc2626"}).catch(()=>{r.textContent="Failed to submit. Try again.",r.style.color="#dc2626"})}const it="dobeacon-bubble",at="dobeacon-bubble-picker",rt="dobeacon-bubble-dots",st="dobeacon-course-badge",dt="dobeacon-message-badge",ct="dobeacon-chat-panel";let lt=null,pt=[],ut=null;const bt={"bottom-right":"bottom:20px;right:20px;","bottom-left":"bottom:20px;left:20px;","top-right":"top:20px;right:20px;","top-left":"top:20px;left:20px;"};let ft=null;function mt(e={},t=[],n,o={}){if(document.getElementById(it))return;const i=ft??e.position??"bottom-right",a=e.icon||"?",r=e.label||"Open guide",s=e.animation??"pulse",d=1e3*(e.delay??0);zt();const c=document.createElement("button");c.id=it,c.setAttribute("data-dobeacon-ui",""),c.setAttribute("aria-label",r),c.title=r,c.style.cssText=`position:fixed;${bt[i]??bt["bottom-right"]}z-index:2147483646;transition:transform .15s ease;`+j+R(s),c.textContent=a,lt=()=>function(e,t,n,o={},i={}){const a=document.getElementById(at);if(a)return void a.remove();const r=e.getBoundingClientRect(),s=r.top>window.innerHeight/2,d=r.left<window.innerWidth/2,c=document.createElement("div");if(c.id=at,c.setAttribute("data-dobeacon-ui",""),c.style.cssText=`\n position:fixed;\n ${s?`bottom:${window.innerHeight-r.top+8}px`:`top:${r.bottom+8}px`};\n ${d?`left:${r.left}px`:`right:${window.innerWidth-r.right}px`};\n background:#fff;border-radius:14px;padding:6px;\n box-shadow:0 8px 32px rgba(0,0,0,.18);z-index:2147483647;\n min-width:260px;max-width:320px;\n max-height:calc(100vh - 100px);overflow-y:auto;\n font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;\n transform-origin:${d?"left":"right"} ${s?"bottom":"top"};\n animation:dbcn-picker-in 0.42s cubic-bezier(0.34,1.56,0.64,1) both;\n `,i.greeting){const e=document.createElement("p");e.setAttribute("data-dobeacon-ui",""),e.style.cssText="font-size:12px;color:#374151;padding:8px 10px 4px;margin:0;",e.textContent=i.greeting,c.appendChild(e)}if(t.length>0){const e=1===t.length,o=document.createElement("p");o.setAttribute("data-dobeacon-ui",""),o.style.cssText="font-size:10px;font-weight:700;color:#9ca3af;text-transform:uppercase;letter-spacing:.5px;padding:4px 10px 8px;margin:0;",o.textContent=e?"Guide available":`${t.length} guides available`,c.appendChild(o),t.forEach((t,o)=>{const i=document.createElement("div");i.setAttribute("data-dobeacon-ui","");const a=t.steps?.length??0;i.style.cssText=`\n padding:10px 12px;border-radius:8px;cursor:pointer;transition:background .12s;\n ${o>0?"border-top:1px solid #f3f4f6;":""}\n ${e?"background:#f5f3ff;":""}\n animation:dbcn-item-in 0.28s cubic-bezier(0.34,1.56,0.64,1) both ${80+55*o}ms;\n `;const r=document.createElement("div");if(r.setAttribute("data-dobeacon-ui",""),r.style.cssText="display:flex;align-items:center;justify-content:space-between;gap:8px;",r.innerHTML=`\n <span style="font-size:13px;font-weight:600;color:#111827;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${Mt(t.name)}</span>\n <span style="font-size:10px;font-weight:600;color:#6366f1;background:#eef2ff;border-radius:999px;padding:2px 7px;white-space:nowrap;flex-shrink:0;">${a} step${1!==a?"s":""}</span>\n `,i.appendChild(r),t.description){const e=document.createElement("p");e.setAttribute("data-dobeacon-ui",""),e.style.cssText="font-size:12px;color:#6b7280;margin:3px 0 0;line-height:1.4;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;",e.textContent=t.description,i.appendChild(e)}if(e){const e=document.createElement("p");e.setAttribute("data-dobeacon-ui",""),e.style.cssText="font-size:11px;color:#6366f1;font-weight:600;margin:5px 0 0;",e.textContent="Click to begin →",i.appendChild(e)}i.addEventListener("mouseover",()=>{i.style.background=e?"#ede9fe":"#f9fafb"}),i.addEventListener("mouseout",()=>{i.style.background=e?"#f5f3ff":""}),i.addEventListener("click",()=>{c.remove(),n(t._id)}),c.appendChild(i)})}const l=document.createElement("div");l.setAttribute("data-dobeacon-ui",""),l.style.cssText="border-top:1px solid #f3f4f6;margin:4px 0;",c.appendChild(l);const p=document.createElement("p");p.setAttribute("data-dobeacon-ui",""),p.style.cssText="font-size:10px;font-weight:700;color:#9ca3af;text-transform:uppercase;letter-spacing:.5px;padding:6px 10px 4px;margin:0;",p.textContent=1===t.length?"Or ask a question":"Ask a question",c.appendChild(p);const u=document.createElement("div");u.setAttribute("data-dobeacon-ui",""),u.style.cssText="overflow-y:auto;padding:0 8px;display:flex;flex-direction:column;gap:6px;",c.appendChild(u);const f=document.createElement("div");f.setAttribute("data-dobeacon-ui",""),f.style.cssText="display:flex;gap:6px;padding:6px 8px 8px;";const m=document.createElement("input");m.setAttribute("data-dobeacon-ui",""),m.setAttribute("data-dobeacon-chat-input",""),m.type="text",m.placeholder="Ask anything…",m.style.cssText="flex:1;border:1px solid #e5e7eb;border-radius:8px;padding:7px 10px;font-size:12px;color:#111827;outline:none;font-family:inherit;transition:border-color .12s;",m.addEventListener("focus",()=>{m.style.borderColor="#6366f1"}),m.addEventListener("blur",()=>{m.style.borderColor="#e5e7eb"});const h=document.createElement("button");h.setAttribute("data-dobeacon-ui",""),h.setAttribute("data-dobeacon-chat-send",""),h.setAttribute("aria-label","Send question"),h.style.cssText="background:#6366f1;color:#fff;border:none;border-radius:8px;padding:7px 11px;cursor:pointer;font-size:13px;flex-shrink:0;transition:background .12s;",h.textContent="↑",h.addEventListener("mouseover",()=>{h.disabled||(h.style.background="#4f46e5")}),h.addEventListener("mouseout",()=>{h.disabled||(h.style.background="#6366f1")}),f.appendChild(m),f.appendChild(h),c.appendChild(f),"chat"===i.mode&&setTimeout(()=>m.focus(),0);const x=`dobeacon_qa_${o.projectKey}`;let g=null;try{g=JSON.parse(sessionStorage.getItem(x))}catch{}const y=Array.isArray(g?.transcript)?[...g.transcript]:[],v=Array.isArray(g?.messages)?[...g.messages]:[];v.length&&(v.forEach(e=>{const t=document.createElement("div");t.setAttribute("data-dobeacon-ui",""),"user"===e.type?(t.style.cssText="align-self:flex-end;background:#6366f1;color:#fff;border-radius:12px 12px 2px 12px;padding:7px 10px;font-size:12px;max-width:85%;word-break:break-word;opacity:0.7;",t.textContent=e.text):(t.style.cssText="align-self:flex-start;background:#f3f4f6;border-radius:12px 12px 12px 2px;padding:7px 10px;font-size:12px;color:#374151;max-width:85%;word-break:break-word;opacity:0.7;",t.innerHTML=Bt(e.text)),u.appendChild(t)}),u.scrollTop=u.scrollHeight);async function w(){const e=m.value.trim();if(!e||h.disabled)return;const t=document.createElement("div");t.setAttribute("data-dobeacon-ui",""),t.style.cssText="align-self:flex-end;background:#6366f1;color:#fff;border-radius:12px 12px 2px 12px;padding:7px 10px;font-size:12px;max-width:85%;word-break:break-word;",t.textContent=e,u.appendChild(t),u.scrollTop=u.scrollHeight,v.push({type:"user",text:e});try{sessionStorage.setItem(x,JSON.stringify({messages:v,transcript:y}))}catch{}m.value="",h.disabled=!0,h.style.opacity="0.5";const n=document.createElement("div");n.setAttribute("data-dobeacon-ui",""),n.setAttribute("data-dobeacon-chat-reply",""),n.style.cssText="align-self:flex-start;background:#f3f4f6;border-radius:12px 12px 12px 2px;padding:7px 10px;font-size:12px;color:#9ca3af;",n.textContent="…",u.appendChild(n),u.scrollTop=u.scrollHeight;try{const t=await tt(`${o.apiBase}/api/chat`,{projectKey:o.projectKey,question:e,history:y.length>0?y.slice(-10):void 0,pageUrl:window.location.href,activeTourId:b.activeTourId??void 0,visitorGroups:b.visitorGroups,userId:b.visitorUserId??void 0,groupsHash:b.visitorGroupsHash??void 0,visitorId:(()=>{try{return localStorage.getItem("__bvid")}catch{return}})()},o),i=await t.json();if(n.style.color="#374151",i.answer?n.innerHTML=Bt(i.answer):n.textContent=i.error||"No answer returned.",i.answer){y.push({question:e,answer:i.answer}),v.push({type:"ai",text:i.answer});try{sessionStorage.setItem(x,JSON.stringify({messages:v,transcript:y}))}catch{}}if(i.noContext){const e=Array.isArray(i.supportLinks)?i.supportLinks:[];if(e.length){const t=document.createElement("div");t.setAttribute("data-dobeacon-ui",""),t.style.cssText="margin-top:8px;display:flex;flex-direction:column;gap:4px;",e.forEach(e=>{const n=document.createElement("a");n.href=e.url,n.target="_blank",n.rel="noopener",n.textContent=(e.label||e.url)+" →",n.style.cssText="font-size:11px;color:#6366f1;text-decoration:none;",t.appendChild(n)}),n.appendChild(t)}if(i.zendeskEnabled){const e=document.createElement("div");e.setAttribute("data-dobeacon-ui",""),e.style.cssText="margin-top:8px;display:flex;flex-direction:column;gap:4px;";const t=document.createElement("p");t.setAttribute("data-dobeacon-ui",""),t.style.cssText="font-size:11px;color:#6b7280;margin:0;line-height:1.5;",t.textContent=i.zendeskMessage||"Our team can help. Submit a ticket and a support agent will get back to you.",e.appendChild(t);const a=document.createElement("textarea");if(a.setAttribute("data-dobeacon-ui",""),a.placeholder="Add a note (optional)",a.rows=2,a.style.cssText="font-size:11px;border:1px solid #d1d5db;border-radius:6px;padding:4px 8px;width:100%;box-sizing:border-box;font-family:inherit;outline:none;resize:none;",e.appendChild(a),b.visitorEmail){const t=document.createElement("button");t.textContent="Send to Zendesk →",t.style.cssText="font-size:11px;color:#fff;background:#6366f1;border:none;border-radius:6px;padding:4px 10px;cursor:pointer;font-family:inherit;align-self:flex-start;",t.onclick=t=>{t.stopPropagation(),ot(y,b.visitorEmail,b.visitorName,a.value.trim(),e,o)},e.appendChild(t)}else{const t=document.createElement("input");t.type="email",t.placeholder="Your email to follow up",t.style.cssText="font-size:11px;border:1px solid #d1d5db;border-radius:6px;padding:4px 8px;width:100%;box-sizing:border-box;font-family:inherit;outline:none;";const n=document.createElement("button");n.textContent="Send to Zendesk →",n.style.cssText="font-size:11px;color:#fff;background:#6366f1;border:none;border-radius:6px;padding:4px 10px;cursor:pointer;font-family:inherit;align-self:flex-start;",n.onclick=n=>{n.stopPropagation();const i=t.value.trim();i&&ot(y,i,null,a.value.trim(),e,o)},e.appendChild(t),e.appendChild(n)}n.appendChild(e)}}}catch{n.textContent="Something went wrong. Please try again.",n.style.color="#dc2626"}finally{h.disabled=!1,h.style.opacity="1",u.scrollTop=u.scrollHeight}}Ct(u),h.addEventListener("click",w),m.addEventListener("keydown",e=>{"Enter"===e.key&&w()});const _=document.createElement("div");_.setAttribute("data-dobeacon-ui",""),_.style.cssText="border-top:1px solid #f3f4f6;margin:4px 0;",c.appendChild(_);const C=document.createElement("button");C.setAttribute("data-dobeacon-ui",""),C.setAttribute("data-dobeacon-docs-toggle",""),C.style.cssText="width:100%;text-align:left;display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background:none;border:none;cursor:pointer;font-family:inherit;",C.innerHTML='\n <span style="font-size:10px;font-weight:700;color:#9ca3af;text-transform:uppercase;letter-spacing:.5px;">📄 Related docs</span>\n <span id="dobeacon-docs-chevron" style="font-size:10px;color:#9ca3af;">▼</span>\n ',c.appendChild(C);const k=document.createElement("div");k.setAttribute("data-dobeacon-ui",""),k.style.cssText="display:none;padding:0 8px 8px;",c.appendChild(k);let E=!1;C.addEventListener("click",async()=>{const e=document.getElementById("dobeacon-docs-chevron");if("none"===k.style.display){if(k.style.display="block",e&&(e.textContent="▲"),!E){E=!0,k.innerHTML='<p style="font-size:12px;color:#9ca3af;padding:4px 2px;">Loading…</p>';try{const t=await fetch(`${o.apiBase}/api/chat/docs?projectKey=${encodeURIComponent(o.projectKey)}&pageUrl=${encodeURIComponent(window.location.href)}&${nt()}`),n=await t.json();if(k.innerHTML="",!Array.isArray(n)||0===n.length)return void(k.innerHTML='<p style="font-size:12px;color:#9ca3af;padding:4px 2px;">No related documents found.</p>');const i=new Set(["the","a","an","is","are","was","to","of","in","on","at","for","with","how","what","where","when","why","can","i","you","we","it","that","this","do","be","have","my","your","and","or","not","no","get","use"]);function a(e){if(!y.length)return 0;const t=y.slice(-4).map(e=>`${e.question} ${e.answer}`).join(" ").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(e=>e.length>2&&!i.has(e));if(!t.length)return 0;const n=e.name.toLowerCase();return t.filter(e=>n.includes(e)).length}const r=n.map(e=>({...e,_score:a(e)})).filter(e=>e._score>0).sort((e,t)=>t._score-e._score),s=r.length>0&&y.length>0;let d=!s;function c(e){k.querySelectorAll("[data-dobeacon-doc-row]").forEach(e=>e.remove()),e.forEach(e=>{const t=document.createElement("div");if(t.setAttribute("data-dobeacon-ui",""),t.setAttribute("data-dobeacon-doc-row",""),t.style.cssText="margin-bottom:4px;",e.sourceUrl){const n=document.createElement("a");n.setAttribute("data-dobeacon-ui",""),n.href=e.sourceUrl,n.target="_blank",n.rel="noopener noreferrer",n.style.cssText="display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:6px;text-decoration:none;transition:background .12s;",n.innerHTML=`\n <span style="font-size:12px;color:#111827;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${Mt(e.name)}</span>\n <span style="font-size:11px;color:#6366f1;flex-shrink:0;">↗</span>\n `,n.addEventListener("mouseover",()=>{n.style.background="#f9fafb"}),n.addEventListener("mouseout",()=>{n.style.background=""}),t.appendChild(n)}else{const n=document.createElement("button");n.setAttribute("data-dobeacon-ui",""),n.style.cssText="width:100%;display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:6px;background:none;border:none;cursor:pointer;font-family:inherit;transition:background .12s;text-align:left;",n.innerHTML=`\n <span style="font-size:12px;color:#111827;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${Mt(e.name)}</span>\n <span class="dobeacon-doc-expand-icon" style="font-size:14px;font-weight:700;color:#9ca3af;flex-shrink:0;line-height:1;">+</span>\n `,n.addEventListener("mouseover",()=>{n.style.background="#f9fafb"}),n.addEventListener("mouseout",()=>{n.style.background=""});const i=document.createElement("div");i.setAttribute("data-dobeacon-ui",""),i.style.cssText="display:none;max-height:200px;overflow-y:auto;background:#f9fafb;border-radius:6px;padding:8px 10px;margin-top:2px;font-size:11px;color:#374151;line-height:1.5;word-break:break-word;";let a=!1;n.addEventListener("click",async()=>{const t=n.querySelector(".dobeacon-doc-expand-icon");if("none"===i.style.display){if(i.style.display="block",t&&(t.textContent="−"),!a){a=!0,i.textContent="Loading…";try{const t=await fetch(`${o.apiBase}/api/chat/docs/${e._id}?projectKey=${encodeURIComponent(o.projectKey)}&${nt()}`),n=await t.json();i.innerHTML=Bt(n.content||"No content available.")}catch{i.innerHTML="Could not load document."}}}else i.style.display="none",t&&(t.textContent="+")}),t.appendChild(n),t.appendChild(i)}k.appendChild(t)})}if(s){const l=document.createElement("button");l.setAttribute("data-dobeacon-ui",""),l.style.cssText="font-size:10px;color:#6366f1;background:none;border:none;cursor:pointer;font-family:inherit;padding:0 2px 8px;display:block;text-align:left;",l.textContent=`Show all ${n.length} docs`,l.addEventListener("click",()=>{d=!d,l.textContent=d?"Show relevant only":`Show all ${n.length} docs`,c(d?n:r)}),k.appendChild(l),c(r)}else c(n)}catch{k.innerHTML='<p style="font-size:12px;color:#dc2626;padding:4px 2px;">Could not load documents.</p>'}}}else k.style.display="none",e&&(e.textContent="▼")}),document.body.appendChild(c),setTimeout(()=>{function t(n){c.contains(n.target)||n.target===e||(c.remove(),document.removeEventListener("click",t))}document.addEventListener("click",t)},0)}(c,t,n,o,e),c.addEventListener("click",()=>{c.style.transform="scale(0.86)",requestAnimationFrame(()=>{c.style.transform=""}),lt()});const l=()=>document.body.appendChild(c);d>0?setTimeout(l,d):l()}function ht(){document.getElementById(it)?.remove(),document.getElementById(at)?.remove(),document.getElementById(rt)?.remove(),document.getElementById(st)?.remove(),lt=null}function xt(){lt?lt():function(){const e=document.getElementById(ct);if(e)return void Et(e);St({_id:"",name:"Chat",steps:[]},"bottom-right")}()}function gt(e){const t=document.getElementById(it);t&&(t.style.visibility=e?"":"hidden")}function yt(e,t){if(document.getElementById(st))return;const n=(e.tourIds??[]).filter(e=>"1"===localStorage.getItem(`dobeacon_completed_${e}`)).length,o=e.tourIds?.length??0,i=document.getElementById(it);if(i){const e=document.createElement("div");e.id=st,e.setAttribute("data-dobeacon-ui",""),e.style.cssText='position:absolute;top:-6px;right:-6px;background:#4f46e5;color:#fff;border-radius:999px;font-size:9px;font-weight:700;line-height:1;padding:3px 6px;white-space:nowrap;pointer-events:none;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 1px 4px rgba(0,0,0,.25);',e.textContent=`${n}/${o}`,i.style.overflow="visible",i.appendChild(e)}else{zt();const i=document.createElement("button");i.id=st,i.setAttribute("data-dobeacon-ui",""),i.style.cssText='position:fixed;bottom:20px;right:20px;z-index:2147483646;background:#fff;border:1.5px solid #6366f1;border-radius:14px;padding:9px 14px;cursor:pointer;box-shadow:0 4px 16px rgba(99,102,241,.25);display:flex;align-items:center;gap:10px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;transition:transform .12s ease,box-shadow .12s ease;animation:dbcn-picker-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both;',i.innerHTML=`<span style="font-size:16px;flex-shrink:0;">📚</span><div style="min-width:0;text-align:left;"><div style="font-size:12px;font-weight:600;color:#111827;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:150px;">${a=e.courseName??"Course in progress",String(a??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]))}</div><div style="font-size:11px;color:#6366f1;font-weight:600;margin-top:1px;">${n} of ${o} complete${t?" · Continue →":""}</div></div>`,i.addEventListener("mouseover",()=>{i.style.transform="scale(1.03)",i.style.boxShadow="0 6px 24px rgba(99,102,241,.35)"}),i.addEventListener("mouseout",()=>{i.style.transform="",i.style.boxShadow="0 4px 16px rgba(99,102,241,.25)"}),t&&i.addEventListener("click",()=>{window.location.href=t}),document.body.appendChild(i)}var a}function vt(e,t){pt=Array.isArray(e)?e:[],ut="function"==typeof t?t:null}function wt(e){const t=document.getElementById(it);if(!(t&&e>0))return;let n=document.getElementById(dt);n||(n=document.createElement("div"),n.id=dt,n.setAttribute("data-dobeacon-ui",""),n.style.cssText='position:absolute;top:-6px;right:-6px;background:#4f46e5;color:#fff;border-radius:999px;font-size:10px;font-weight:700;line-height:1;min-width:18px;height:18px;padding:0 5px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;pointer-events:none;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 1px 4px rgba(0,0,0,.25);',t.style.overflow="visible",t.appendChild(n)),n.textContent=e>99?"99+":String(e)}function _t(){document.getElementById(dt)?.remove()}function Ct(e){if(!e||!pt.length)return;$t(),pt.forEach(t=>{const n=document.createElement("div");if(n.setAttribute("data-dobeacon-ui",""),n.style.cssText="align-self:flex-start;background:#f5f3ff;border:1px solid #e0e7ff;border-radius:12px 12px 12px 2px;padding:8px 11px;max-width:92%;word-break:break-word;animation:dobeacon-msg-in 0.3s ease both;",t.label){const e=document.createElement("div");e.setAttribute("data-dobeacon-ui",""),e.style.cssText="font-size:10px;font-weight:700;color:#6366f1;text-transform:uppercase;letter-spacing:.4px;margin-bottom:3px;",e.textContent=t.label,n.appendChild(e)}const o=document.createElement("div");o.setAttribute("data-dobeacon-ui",""),o.style.cssText="font-size:12px;color:#374151;line-height:1.5;",o.innerHTML=Bt(t.body??""),n.appendChild(o),e.appendChild(n)}),e.scrollTop=e.scrollHeight;const t=ut;pt=[],ut=null,t&&t()}const kt={"bottom-right":"bottom:80px;right:20px;","bottom-left":"bottom:80px;left:20px;","top-right":"top:80px;right:20px;","top-left":"top:80px;left:20px;"};function Et(e){"false"!==e.dataset.open?(e.style.transition="opacity .16s ease, transform .16s ease, filter .16s ease",e.style.opacity="0",e.style.transform="scale(0.92) translateY(10px)",e.style.filter="blur(3px)",e.style.pointerEvents="none",e.dataset.open="false"):(e.style.pointerEvents="all",e.dataset.open="true",e.style.transition="none",e.style.animation="none",requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.transition="",e.style.opacity="",e.style.transform="",e.style.filter="",e.style.animation="dbcn-panel-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both";const t=e.querySelector("#dobeacon-chat-messages");t&&(t.scrollTop=t.scrollHeight)})}))}function St(e,t){zt();const n=document.createElement("div");n.id=ct,n.setAttribute("data-dobeacon-ui",""),n.dataset.open="true",n.dataset.tourId=e._id??"",n.style.cssText=`\n position:fixed;${kt[t]??kt["bottom-right"]}\n width:320px;\n background:#fff;border-radius:16px;\n box-shadow:0 8px 40px rgba(0,0,0,.18);\n z-index:2147483647;\n display:flex;flex-direction:column;\n font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;\n overflow:hidden;\n opacity:0;\n transform-origin:${(t??"bottom-right").includes("left")?"left":"right"} bottom;\n `;const o=document.createElement("div");o.setAttribute("data-dobeacon-ui",""),o.style.cssText="\n padding:10px 12px;border-bottom:1px solid #e5e7eb;\n display:flex;align-items:center;gap:8px;flex-shrink:0;\n cursor:grab;user-select:none;\n ";const i=document.createElement("span");i.setAttribute("data-dobeacon-ui",""),i.style.cssText="color:#d1d5db;font-size:12px;flex-shrink:0;pointer-events:none;",i.textContent="⠿";const a=document.createElement("div");a.setAttribute("data-dobeacon-ui",""),a.style.cssText="flex:1;min-width:0;pointer-events:none;",a.innerHTML=`\n <p style="font-weight:600;font-size:13px;color:#111827;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${Mt(e.name||"Tour")}</p>\n <div style="display:flex;align-items:center;gap:7px;margin:3px 0 0;">\n <p id="dobeacon-chat-step-counter" style="font-size:11px;color:#9ca3af;margin:0;white-space:nowrap;"></p>\n <div id="dobeacon-panel-dots" style="display:flex;gap:3px;align-items:center;"></div>\n </div>\n `;const r="background:none;border:none;cursor:pointer;color:#9ca3af;font-size:14px;padding:3px 5px;border-radius:5px;transition:color .1s;line-height:1;flex-shrink:0;",s=document.createElement("button");s.setAttribute("data-dobeacon-ui",""),s.title="Collapse",s.style.cssText=r,s.innerHTML="&#8722;",s.addEventListener("mouseover",()=>{s.style.color="#6b7280"}),s.addEventListener("mouseout",()=>{s.style.color="#9ca3af"}),s.addEventListener("click",e=>{e.stopPropagation(),Et(n)});const d=document.createElement("button");d.id="dobeacon-chat-exit",d.setAttribute("data-dobeacon-ui",""),d.setAttribute("aria-label","Exit tour"),d.title="Exit tour",d.style.cssText=r,d.textContent="✕",d.addEventListener("mouseover",()=>{d.style.color="#6b7280"}),d.addEventListener("mouseout",()=>{d.style.color="#9ca3af"}),d.addEventListener("click",e=>{e.stopPropagation(),document.dispatchEvent(new CustomEvent("dobeacon:exit"))}),o.appendChild(i),o.appendChild(a),o.appendChild(s),o.appendChild(d);const c=document.createElement("div");c.id="dobeacon-chat-messages",c.style.cssText="overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px;min-height:60px;max-height:calc(100vh - 160px);";try{const t=`dobeacon_chat_${b.projectKey}_${e._id}`,n=sessionStorage.getItem(t);if(n){const{messages:e}=JSON.parse(n);Array.isArray(e)&&e.length&&($t(),e.forEach(({title:e,body:t})=>{const n=document.createElement("div");if(n.setAttribute("data-dobeacon-ui",""),n.style.cssText="background:#f5f5ff;border-left:3px solid #c7d2fe;border-radius:0 12px 12px 0;padding:10px 12px;max-width:95%;opacity:0.7;",e){const o=document.createElement("p");o.style.cssText=`font-size:13px;font-weight:600;color:#6b7280;margin:0${t?" 0 4px":""};`,o.textContent=e,n.appendChild(o)}if(t){const e=document.createElement("div");e.style.cssText="font-size:12px;color:#9ca3af;margin:0;line-height:1.5;",e.innerHTML=Bt(t),n.appendChild(e)}c.appendChild(n)}))}}catch{}n.appendChild(o),n.appendChild(c),document.body.appendChild(n),Ct(c),function(e,t){let n=!1,o=0,i=0;t.addEventListener("mousedown",a=>{if("BUTTON"===a.target.tagName)return;n=!0,t.style.cursor="grabbing";const r=e.getBoundingClientRect();e.style.bottom="",e.style.right="",e.style.top=r.top+"px",e.style.left=r.left+"px",o=a.clientX-r.left,i=a.clientY-r.top,a.preventDefault()}),document.addEventListener("mousemove",t=>{n&&(e.style.left=t.clientX-o+"px",e.style.top=t.clientY-i+"px")}),document.addEventListener("mouseup",()=>{n&&(n=!1,t.style.cursor="grab")})}(n,o),requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.animation="dbcn-panel-in 0.44s cubic-bezier(0.34,1.56,0.64,1) both",n.style.opacity=""})})}function $t(){if(document.getElementById("dobeacon-chat-styles"))return;const e=document.createElement("style");e.id="dobeacon-chat-styles",e.textContent="\n @keyframes dobeacon-msg-in {\n from { opacity:0; transform:translateY(10px) scale(0.97); }\n to { opacity:1; transform:translateY(0) scale(1); }\n }\n ",(document.head||document.documentElement).appendChild(e)}function It(e,t,n){const o=document.getElementById(ct);if(!o)return;o.style.animation="none",document.body.appendChild(o),requestAnimationFrame(()=>{o.style.animation=""}),document.getElementById("dobeacon-chat-inline-actions")?.remove();const i=o.querySelector("#dobeacon-chat-step-counter");i&&(i.textContent=`Step ${t+1} of ${n}`);const a=o.querySelector("#dobeacon-panel-dots");if(a&&n>1){a.innerHTML="";for(let e=0;e<n;e++){const n=document.createElement("div"),o=e===t?"active":e<t?"past":"future";n.style.cssText=Lt(o),a.appendChild(n)}}const r=o.querySelector("#dobeacon-chat-messages");if(!r)return;r.querySelectorAll("[data-dobeacon-msg-active]").forEach(e=>{delete e.dataset.dobeaconMsgActive,e.style.background="#f9fafb",e.style.borderLeftColor="#e5e7eb"});const s="chat-input"===e.type,d=s&&e.content?.title||"",c=s?e.content?.body||"":e.content?.chatContext||"";if(!d&&!c)return;$t();const l=document.createElement("div");if(l.setAttribute("data-dobeacon-ui",""),l.dataset.dobeaconMsgActive="",l.style.cssText="\n background:#f0f0ff;border-left:3px solid #6366f1;\n border-radius:0 12px 12px 0;padding:10px 12px;max-width:95%;\n transition:background .2s,border-left-color .2s;\n animation:dobeacon-msg-in 0.3s cubic-bezier(0.34,1.56,0.64,1) both;\n ",d){const e=document.createElement("p");e.style.cssText=`font-size:13px;font-weight:600;color:#111827;margin:0${c?" 0 4px":""};`,e.textContent=d,l.appendChild(e)}if(c){const e=document.createElement("div");e.style.cssText="font-size:12px;color:#6b7280;margin:0;line-height:1.5;",e.innerHTML=Bt(c),l.appendChild(e)}r.appendChild(l),r.scrollTop=r.scrollHeight,function(){try{const e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.type="sine",t.frequency.setValueAtTime(1046,e.currentTime),t.frequency.exponentialRampToValueAtTime(1318,e.currentTime+.08),n.gain.setValueAtTime(.12,e.currentTime),n.gain.exponentialRampToValueAtTime(1e-4,e.currentTime+.35),t.start(e.currentTime),t.stop(e.currentTime+.35),t.onended=()=>e.close()}catch{}}();const p=o.dataset.tourId;if(p&&b.projectKey)try{const e=`dobeacon_chat_${b.projectKey}_${p}`,t=JSON.parse(sessionStorage.getItem(e)||'{"messages":[]}');t.messages.push({title:d,body:c}),sessionStorage.setItem(e,JSON.stringify(t))}catch{}}function Tt(){const e=document.getElementById("dobeacon-chat-messages");if(!e)return;const t=document.createElement("div");t.id="dobeacon-chat-inline-actions",t.setAttribute("data-dobeacon-ui",""),t.style.cssText="display:flex;gap:8px;margin-top:4px;";const n=document.createElement("button");n.setAttribute("data-dobeacon-ui",""),n.style.cssText="\n flex:1;padding:8px 14px;\n background:#fff;color:#6b7280;\n border:1.5px solid #e5e7eb;border-radius:10px;cursor:pointer;\n font-size:13px;font-weight:500;transition:border-color .12s,color .12s;\n ",n.textContent="Exit",n.addEventListener("mouseover",()=>{n.style.borderColor="#d1d5db",n.style.color="#374151"}),n.addEventListener("mouseout",()=>{n.style.borderColor="#e5e7eb",n.style.color="#6b7280"}),n.addEventListener("click",()=>document.dispatchEvent(new CustomEvent("dobeacon:exit")));const o=document.createElement("button");o.setAttribute("data-dobeacon-ui",""),o.style.cssText="\n flex:2;padding:8px 14px;\n background:#6366f1;color:#fff;\n border:none;border-radius:10px;cursor:pointer;\n font-size:13px;font-weight:600;transition:background .12s;\n ",o.textContent="Next →",o.addEventListener("mouseover",()=>{o.style.background="#4f46e5"}),o.addEventListener("mouseout",()=>{o.style.background="#6366f1"}),o.addEventListener("click",()=>document.dispatchEvent(new CustomEvent("dobeacon:advance"))),t.appendChild(n),t.appendChild(o),e.appendChild(t),e.scrollTop=e.scrollHeight}function At(){document.getElementById(ct)?.remove()}function Lt(e){return`width:${"active"===e?"12px":"5px"};height:5px;border-radius:3px;background:${"active"===e?"#6366f1":"past"===e?"#a5b4fc":"rgba(99,102,241,0.2)"};transition:width .2s ease,background .2s ease;`}function zt(){if(document.getElementById("dobeacon-bubble-styles"))return;const e=document.createElement("style");e.id="dobeacon-bubble-styles",e.textContent=`\n @keyframes dbcn-bbl-pulse {\n 0%,100% { transform:scale(1); box-shadow:0 4px 16px rgba(99,102,241,.4) }\n 50% { transform:scale(1.06); box-shadow:0 6px 24px rgba(99,102,241,.7) }\n }\n @keyframes dbcn-bbl-bounce {\n 0%,100% { transform:translateY(0) }\n 40% { transform:translateY(-8px) }\n }\n @keyframes dbcn-picker-in {\n 0% { opacity:0; transform:scale(0.82) translateY(10px); filter:blur(6px); }\n 55% { filter:blur(0); }\n 75% { transform:scale(1.03) translateY(-2px); }\n 100% { opacity:1; transform:scale(1) translateY(0); filter:blur(0); }\n }\n @keyframes dbcn-item-in {\n from { opacity:0; transform:translateX(-7px) scale(0.96); }\n to { opacity:1; transform:translateX(0) scale(1); }\n }\n @keyframes dbcn-panel-in {\n 0% { opacity:0; transform:scale(0.82) translateY(14px); filter:blur(6px); }\n 55% { filter:blur(0); }\n 75% { transform:scale(1.02) translateY(-3px); }\n 100% { opacity:1; transform:scale(1) translateY(0); filter:blur(0); }\n }\n #${it}:hover { transform:scale(1.12) !important; animation-play-state:paused; }\n ${M}\n `,document.head.appendChild(e)}function Bt(e){if(!e)return"";const t=[];for(const n of e.split("\n")){const e=n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");if(!e.trim()){t.push('<div style="height:4px"></div>');continue}const o=e.match(/^(#{1,3})\s+(.*)/);if(o){const e=1===o[1].length?"14px":"13px";t.push(`<div style="font-weight:700;font-size:${e};color:#111827;margin:4px 0 2px;">${jt(o[2])}</div>`);continue}const i=e.match(/^[-*]\s+(.*)/);if(i){t.push(`<div style="padding-left:10px;">• ${jt(i[1])}</div>`);continue}const a=e.match(/^(\d+)\.\s+(.*)/);a?t.push(`<div style="padding-left:10px;">${a[1]}. ${jt(a[2])}</div>`):t.push(`<div>${jt(e)}</div>`)}return t.join("")}function jt(e){return e.replace(/`([^`]+)`/g,'<code style="background:#f3f4f6;padding:1px 4px;border-radius:3px;font-family:monospace;font-size:11px;">$1</code>').replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:#6366f1;text-decoration:underline;">$1</a>').replace(/(?<!['"=])(https?:\/\/[^\s<>"']+)/g,'<a href="$1" target="_blank" rel="noopener noreferrer" style="color:#6366f1;text-decoration:underline;">$1</a>')}function Mt(e){return String(e).replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]))}function Rt(e,t={}){return new Promise(n=>{if(!e)return n();if(!function(e){if(e.startsWith("/"))return!0;try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}}(e))return n();if(window.location.href===e||window.location.pathname===e)return n();const{tourId:o,stepIndex:i,projectKey:a}=t;o&&null!=i&&sessionStorage.setItem("dobeacon_resume",JSON.stringify({tourId:o,stepIndex:i,projectKey:a,timestamp:Date.now()})),window.location.href=e,setTimeout(n,100)})}class Ht{constructor(e){this._config=e,this._userId=null,this._userMeta={},this._userHash=null,this._mode="standard",this._stopVoiceListener=null,this._cancelled=!1,this._exitListener=null,this._stepResolve=null,this._queue=[],this._queueRunning=!1,this._courseContext=null,this._activeTour=null,this._currentStepIndex=-1,this._jumpTo=null,this._tours=[],this._ready=!1,this._messages=[],this._notifiedMessageIds=new Set,b.projectKey=e.projectKey,l(e)}start(){this._watchSpaNavigation(),this._fetchAndStart(),this._onBuilderStart=()=>this.pause(),this._onBuilderEnd=()=>this.resume(),document.addEventListener("dobeacon:builder-start",this._onBuilderStart),document.addEventListener("dobeacon:builder-end",this._onBuilderEnd)}pause(){this._paused=!0,this._queue=[],this._queueRunning=!1,clearInterval(this._navInterval),ht(),Ce(),At(),xe()}resume(){this._paused=!1,this._navInterval=setInterval(this._navHandler,500),this._fetchAndStart()}setUser(e,t){this._userId=e,this._userMeta=t,this._userHash=t?.userHash??null,function(e){o=e}(e),this._syncMessages()}async _syncMessages(){if(!this._userId)return;let e=[];try{const t=this._userHash?`&userHash=${encodeURIComponent(this._userHash)}`:"",n=`${this._config.apiBase}/api/sdk/messages?projectKey=${encodeURIComponent(this._config.projectKey)}&userId=${encodeURIComponent(this._userId)}${t}`,o=await fetch(n);if(!o.ok)return;const i=await o.json();e=Array.isArray(i.messages)?i.messages:[]}catch{return}this._messages=e,vt(e,()=>this.markMessagesRead()),e.length>0?(gt(!0),wt(e.length),e.forEach(e=>{this._notifiedMessageIds.has(e._id)||(this._notifiedMessageIds.add(e._id),function(e,t={}){c(e,{type:e,...t})}("message",{message:e}))})):_t()}getMessages(){return this._messages}getUnreadCount(){return this._messages.length}async markMessagesRead(e){if(!this._userId||0===this._messages.length)return void _t();const t=Array.isArray(e)&&e.length?e:this._messages.map(e=>e._id);try{await fetch(`${this._config.apiBase}/api/sdk/messages`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectKey:this._config.projectKey,userId:this._userId,userHash:this._userHash,ids:t})})}catch{}this._messages=this._messages.filter(e=>!t.includes(e._id)),vt(this._messages,()=>this.markMessagesRead()),this._messages.length>0?wt(this._messages.length):_t()}setMode(e){this._mode=e,"accessibility"===e?y():v()}openChat(){xt()}toggleChat(){xt()}sendChatMessage(e){!function(e){if(null==e||""===e)return;document.getElementById(ct)||St({_id:"",name:"Chat",steps:[]},"bottom-right");const t=document.getElementById("dobeacon-chat-messages");if(!t)return;$t();const n=document.createElement("div");n.setAttribute("data-dobeacon-ui",""),n.style.cssText="align-self:flex-end;background:#6366f1;color:#fff;border-radius:12px 12px 0 12px;padding:8px 12px;max-width:85%;font-size:13px;line-height:1.5;word-break:break-word;animation:dobeacon-msg-in 0.3s ease both;",n.textContent=e,t.appendChild(n),t.scrollTop=t.scrollHeight}(e)}clearChat(){!function(){const e=document.getElementById("dobeacon-chat-messages");e&&(e.innerHTML="")}()}closeChat(){!function(){document.getElementById(at)?.remove();const e=document.getElementById(ct);e&&"false"!==e.dataset.open&&Et(e)}()}isChatOpen(){return function(){if(document.getElementById(at))return!0;const e=document.getElementById(ct);return!!e&&"false"!==e.dataset.open}()}showBubble(){this._writeLauncherOverride({visibility:!0}),gt(!0)}hideBubble(){this._writeLauncherOverride({visibility:!1}),gt(!1)}setBubblePosition(e){const t=function(e){if(!bt[e])return!1;ft=e;const t=document.getElementById(it);return t&&(t.style.top=t.style.bottom=t.style.left=t.style.right="",t.style.cssText+=bt[e]),document.getElementById(at)?.remove(),!0}(e);return t&&this._writeLauncherOverride({position:e}),t}setBubbleMode(e){this._writeLauncherOverride({mode:e}),ht(),this._renderLauncher()}isBubbleVisible(){return function(){const e=document.getElementById(it);return!!e&&"hidden"!==e.style.visibility}()}_readLauncherOverride(){try{const e=localStorage.getItem(`dobeacon_launcher_${this._config.projectKey}`);return e?JSON.parse(e):{}}catch{return{}}}_writeLauncherOverride(e){try{const t={...this._readLauncherOverride(),...e};localStorage.setItem(`dobeacon_launcher_${this._config.projectKey}`,JSON.stringify(t))}catch{}}_renderLauncher(){if(this._paused)return;const e=this._tours??[],t=e.filter(e=>e.bubble?.enabled),n=this._readLauncherOverride();if(this._launcher){const e={...this._launcher};if(n.position&&(e.position=n.position),n.mode&&(e.mode=n.mode),!e.enabled)return;return mt(e,t,e=>this.loadAndPlay(e),this._config),void(!1===n.visibility&&gt(!1))}if(t.length>0)return void mt(t[0]?.bubble??{},t,e=>this.loadAndPlay(e),this._config);const o=e.filter(e=>e.steps?.some(e=>"chat-input"===e.type));o.length>0&&function(e,t){if(document.getElementById(it))return;const n=e.bubble??{},o=ft??n.position??"bottom-right",i=n.icon||"?",a=n.label||"Open guide",r=n.animation??"pulse",s=1e3*(n.delay??0);zt();const d=document.createElement("button");d.id=it,d.setAttribute("data-dobeacon-ui",""),d.setAttribute("aria-label",a),d.title=a,d.style.cssText=`position:fixed;${bt[o]??bt["bottom-right"]}z-index:2147483646;transition:transform .15s ease;`+j+R(r),d.textContent=i,lt=()=>{const n=document.getElementById(ct);n?Et(n):(St(e,o),t(e._id))},d.addEventListener("click",()=>{d.style.transform="scale(0.86)",requestAnimationFrame(()=>{d.style.transform=""}),lt()});const c=()=>document.body.appendChild(d);s>0?setTimeout(c,s):c()}(o[0],e=>this.loadAndPlay(e))}speak(e){w(e)}stopVoice(){_(),this._stopVoice()}next(){document.dispatchEvent(new CustomEvent("dobeacon:advance"))}exit(){document.dispatchEvent(new CustomEvent("dobeacon:exit"))}isPlaying(){return null!=b.activeTourId}getCurrentTour(){return b.activeTourId??null}getCurrentStep(){return this._playing?this._currentStepIndex:null}getProgress(){if(!this._activeTour)return null;const e=this._activeTour.steps?.length??0,t=this._currentStepIndex;return{index:t,total:e,percent:e?Math.round((t+1)/e*100):0}}getTours(){return(this._tours??[]).map(e=>({id:e._id,name:e.name,steps:e.steps?.length??0,completed:(()=>{try{return"1"===localStorage.getItem(`dobeacon_completed_${e._id}`)}catch{return!1}})()}))}on(e,t){return s(e,t)}off(e,t){d(e,t)}once(e,t){return function(e,t){const n=o=>{d(e,n),t(o)};return s(e,n)}(e,t)}reset(){o=null,n=r(),this._userId=null,this._userMeta={},this._userHash=null,this._messages=[],this._notifiedMessageIds.clear(),_t()}getVisitor(){return p()}getMode(){return this._mode}isReady(){return!0===this._ready}async startCourse(e){if(!e)return!1;const t=await this._initCourseSession(e);return t&&await this._drainQueue(),t}async getCourses(){try{const e=await fetch(`${this._config.apiBase}/api/sdk/courses?projectKey=${this._config.projectKey}`);if(!e.ok)return[];const t=await e.json();return(Array.isArray(t)?t:t.courses??[]).map(e=>({id:e._id,name:e.name,description:e.description??null,tourCount:e.tourCount??0}))}catch{return[]}}getCourseProgress(){const e=this._courseContext??this._loadSavedCourse();if(!e)return null;const t=e.tourIds??[],n=t.filter(e=>{try{return"1"===localStorage.getItem(`dobeacon_completed_${e}`)}catch{return!1}}).length;return{courseId:e.courseId,name:e.courseName??null,total:t.length,completed:n,percent:t.length?Math.round(n/t.length*100):0,currentTourId:e.currentTourId??null}}resetCourse(e){if(!e)return;const t=this._courseContext?.courseId===e?this._courseContext:this._loadSavedCourse();try{sessionStorage.removeItem(`dobeacon_course_${this._config.projectKey}_${e}`)}catch{}t?.courseId===e&&(t.tourIds??[]).forEach(e=>this._clearCompletion(e)),this._courseContext?.courseId===e&&(this._courseContext=null)}_loadSavedCourse(){try{const e=Object.keys(sessionStorage).find(e=>e.startsWith(`dobeacon_course_${this._config.projectKey}_`));return e?JSON.parse(sessionStorage.getItem(e)):null}catch{return null}}_stopActiveTour(){if(this._cancelled=!0,this._stepResolve){const e=this._stepResolve;this._stepResolve=null,e()}xe(),Ce()}enterPreview(e){if(e){try{sessionStorage.setItem("dobeacon_preview_key",e)}catch{}this._stopActiveTour(),this._fetchAndStart()}}exitPreview(){try{sessionStorage.removeItem("dobeacon_preview_key")}catch{}this._stopActiveTour(),this._fetchAndStart()}destroy(){if(this._paused=!0,this._cancelled=!0,this._stepResolve){const e=this._stepResolve;this._stepResolve=null,e()}clearInterval(this._navInterval),window.removeEventListener("popstate",this._navHandler),window.removeEventListener("dobeacon:urlchange",this._navHandler),this._onBuilderStart&&document.removeEventListener("dobeacon:builder-start",this._onBuilderStart),this._onBuilderEnd&&document.removeEventListener("dobeacon:builder-end",this._onBuilderEnd),ht(),Ce(),At(),xe(),this._navWatching=!1,this._ready=!1}goToStep(e){if(this._playing&&this._activeTour&&(this._jumpTo=e,this._stepResolve)){const e=this._stepResolve;this._stepResolve=null,e()}}back(){this._playing&&this.goToStep(this._currentStepIndex-1)}restartTour(e){if(e)return this._clearCompletion(e),this.loadAndPlay(e)}_clearCompletion(e){try{localStorage.removeItem(`dobeacon_completed_${e}`),localStorage.removeItem(`dobeacon_seen_${e}`),sessionStorage.removeItem(`dobeacon_steps_${e}`)}catch{}}resetCompletion(e){e&&this._clearCompletion(e)}markCompleted(e){if(e)try{localStorage.setItem(`dobeacon_completed_${e}`,"1"),localStorage.setItem(`dobeacon_seen_${e}`,"1")}catch{}}resetAll(){try{Object.keys(localStorage).filter(e=>e.startsWith("dobeacon_completed_")||e.startsWith("dobeacon_seen_")).forEach(e=>localStorage.removeItem(e))}catch{}}async hasCompleted(e){return"1"===localStorage.getItem(`dobeacon_completed_${e}`)}hasSeen(e){return this._hasSeen(e)}_hasSeen(e){return"1"===localStorage.getItem(`dobeacon_seen_${e}`)}async loadAndPlay(e,{fromSharedLink:t=!1}={}){this._queue=[];const n=t?"":`?projectKey=${this._config.projectKey}`,o=await fetch(`${this._config.apiBase}/api/tours/${e}${n}`);if(!o.ok)return void Ce();const i=await o.json();if(t&&i.startUrl)try{const t=new URL(i.startUrl,window.location.origin).pathname;if(window.location.pathname!==t){const t=new URL(i.startUrl,window.location.origin);return t.searchParams.set("dobeacontour",e),void(window.location.href=t.toString())}}catch{}localStorage.setItem(`dobeacon_seen_${i._id}`,"1"),await this._play(i)}async _fetchAndStart(){if(this._paused)return;let e=null;try{const t=sessionStorage.getItem("dobeacon_resume");if(t){const n=JSON.parse(t);Date.now()-n.timestamp<18e5&&(e=n),sessionStorage.removeItem("dobeacon_resume")}}catch{}try{const e=new URLSearchParams(window.location.search).get("dobeaconpreview");e&&sessionStorage.setItem("dobeacon_preview_key",e)}catch{}const t=(()=>{try{return sessionStorage.getItem("dobeacon_preview_key")}catch{return null}})(),n=t?`&previewKey=${encodeURIComponent(t)}`:"",o=e?`${this._config.apiBase}/api/tours?projectKey=${this._config.projectKey}&tourId=${e.tourId}${n}`:`${this._config.apiBase}/api/tours?projectKey=${this._config.projectKey}&url=${encodeURIComponent(window.location.href)}${n}`,i=await fetch(o);if(!i.ok)return void Ce();const a=await i.json(),r=Array.isArray(a)?a:a.tours??[],s=Array.isArray(a)?"":a.orgCss??"",d=Array.isArray(a)?"":a.projectCss??"",c=Array.isArray(a)?null:a.launcher??null;if(this._tours=r,this._launcher=c,this._ready=!0,this._injectCss("dobeacon-css-org",s),this._injectCss("dobeacon-css-project",d),e){const t=r.find(t=>t._id===e.tourId);t&&await this._play(t,e.stepIndex)}else{this._queue=[],this._courseContext=null;let e=!1;try{const t=new URLSearchParams(window.location.search).get("dobeaconcourse");if(t)e=await this._initCourseSession(t);else{const t=Object.keys(sessionStorage).find(e=>e.startsWith(`dobeacon_course_${this._config.projectKey}_`));if(t){const n=JSON.parse(sessionStorage.getItem(t));n&&(e=await this._resumeCourseSession(n))}}}catch{}if(e){if(0===this._queue.length&&Ce(),await this._drainQueue(),this._courseContext){if("1"===localStorage.getItem(`dobeacon_completed_${this._courseContext.currentTourId}`)){const e=this._courseContext.tourIds.find(e=>"1"!==localStorage.getItem(`dobeacon_completed_${e}`));return void(e?this._showCourseNextPrompt(e):this._showCourseCompletePrompt())}}return}try{const e=new URLSearchParams(window.location.search).get("dobeacontour");if(e){const t=await fetch(`${this._config.apiBase}/api/tours/${e}`);if(t.ok){const n=await t.json();if(n.startUrl)try{const t=new URL(n.startUrl,window.location.origin).pathname;if(window.location.pathname!==t){const t=new URL(n.startUrl,window.location.origin);return t.searchParams.set("dobeacontour",e),void(window.location.href=t.toString())}}catch{}this._queue.unshift(n)}}}catch{}for(const e of r)e.triggers?.some(e=>"auto"===e.type)&&!this._hasSeen(e._id)&&this._queue.push(e);0===this._queue.length&&Ce(),await this._drainQueue()}this._renderLauncher(),this._syncMessages();try{const e=Object.keys(sessionStorage).find(e=>e.startsWith(`dobeacon_course_${this._config.projectKey}_`));if(e){const t=JSON.parse(sessionStorage.getItem(e));if(t){const e=t.tourIds?.find(e=>"1"!==localStorage.getItem(`dobeacon_completed_${e}`)),n=t.tours?.find(t=>t._id===e);let o=null;if(n?.startUrl)try{const e=new URL(n.startUrl,window.location.origin);e.searchParams.set("dobeaconcourse",t.courseId),o=e.toString()}catch{}yt(t,o)}}}catch{}}async _drainQueue(){if(!this._queueRunning){for(this._queueRunning=!0;this._queue.length>0&&!this._paused;){const e=this._queue.shift();localStorage.setItem(`dobeacon_seen_${e._id}`,"1"),await this._play(e)}this._queueRunning=!1}}async _play(e,t=0){this._playing=!0,this._cancelled=!1,this._feedbackResults=[],this._activeTour=e,this._jumpTo=null,this._currentStepIndex=t,b.activeTourId=e._id;const n=`dobeacon_steps_${e._id}`;let o;try{const e=sessionStorage.getItem(n);o=e?new Set(JSON.parse(e)):new Set}catch{o=new Set}this._chatMode="chat"===e.bubble?.mode&&e.bubble?.enabled||e.steps?.some(e=>"chat-input"===e.type);const i=document.getElementById("dobeacon-bubble");i&&!this._chatMode&&(i.style.visibility="hidden"),document.getElementById("dobeacon-bubble-picker")?.remove(),this._injectCss("dobeacon-css-tour",e.customCss),this._exitListener=()=>{if(this._cancelled=!0,this._stepResolve){const e=this._stepResolve;this._stepResolve=null,e()}},document.addEventListener("dobeacon:exit",this._exitListener,{once:!0}),t>0?u("tour_resumed",{tourId:e._id,projectId:e.projectId,stepIndex:t}):u("tour_started",{tourId:e._id,projectId:e.projectId}),(e.accessibilityMode||"accessibility"===this._mode)&&(this.setMode("accessibility"),this._startVoiceAdvancement()),this._chatMode?function(e){if(document.getElementById(ct))return;St(e,e.bubble?.position??"bottom-right")}(e):we(t,e.steps.length,e.name);for(let i=t;i<e.steps.length&&!this._cancelled;i++){if(o.has(i))continue;const t=e.steps[i];this._currentStepIndex=i,this._chatMode?(It(t,i,e.steps.length),"chat-input"===t.type&&Tt()):_e(i,e.steps.length),u("step_viewed",{tourId:e._id,projectId:e.projectId,stepIndex:i});const a=await this._runStep(t,e,i);if("feedback"===t.type&&this._feedbackResults.push({step:t,stepIndex:i,result:a??null}),this._cancelled)break;if(null!=this._jumpTo){const t=Math.max(0,Math.min(this._jumpTo,e.steps.length-1));this._jumpTo=null;for(let n=t;n<e.steps.length;n++)o.delete(n);i=t-1;continue}o.add(i);try{sessionStorage.setItem(n,JSON.stringify([...o]))}catch{}u("step_completed",{tourId:e._id,projectId:e.projectId,stepIndex:i})}document.removeEventListener("dobeacon:exit",this._exitListener),this._exitListener=null,xe(),document.querySelectorAll("[data-dobeacon-feedback]").forEach(e=>e.remove()),document.querySelectorAll("[data-dobeacon-recap]").forEach(e=>e.remove()),this._chatMode?At():Ce(),this._stopVoice(),this._removeCss("dobeacon-css-tour"),this._removeCss("dobeacon-css-step");const a=document.getElementById("dobeacon-bubble");a&&(a.style.visibility=""),this._playing=!1,this._chatMode=!1,this._activeTour=null,this._currentStepIndex=-1,this._jumpTo=null,b.activeTourId=null;try{sessionStorage.removeItem(n)}catch{}sessionStorage.removeItem("dobeacon_resume"),this._cancelled?u("tour_dismissed",{tourId:e._id,projectId:e.projectId}):(this._chatMode&&function(e){if(e&&b.projectKey)try{sessionStorage.removeItem(`dobeacon_chat_${b.projectKey}_${e}`)}catch{}}(e._id),localStorage.setItem(`dobeacon_completed_${e._id}`,"1"),u("tour_completed",{tourId:e._id,projectId:e.projectId}),document.dispatchEvent(new CustomEvent("dobeacon:completed",{detail:{tourId:e._id}})))}async _runStep(e,t,n){if(this._injectCss("dobeacon-css-step",e.customCss),"accessibility"===this._mode){const t=e.content?.ttsScript||e.content?.body||e.content?.title||"";t&&await w(t)}const o=!1!==e.highlight&&!!e.selector,i=!1!==e.overlay&&!!e.selector,a=()=>m(e).catch(()=>null);if("tooltip"===e.type){const r=await a();if(!r)return this._handleMissingElement(e,t,n);r.scrollIntoView({block:"center",inline:"nearest"}),xe(),(o||i)&&be(r,!1,o?e.animation??"pulse":"none",i),e.pointer&&he(r),pe(r,e),await this._waitForAdvance()}else if("spotlight"===e.type){const o=await a();if(!o)return this._handleMissingElement(e,t,n);o.scrollIntoView({block:"center",inline:"nearest"}),ue(o,e),e.pointer&&he(o),await this._waitForAdvance()}else if("modal"===e.type){const t=e.selector?await a():null;t&&t.scrollIntoView({block:"center",inline:"nearest"}),xe(),fe(e,t),await this._waitForAdvance()}else if("autofill"===e.type){const r=await a();if(!r)return this._handleMissingElement(e,t,n);r.scrollIntoView({block:"center",inline:"nearest"}),e.action?.isDestructive?(xe(),(o||i)&&be(r,!0,o?e.animation??"pulse":"none",i),e.pointer&&he(r),pe(r,e,{waitForClick:!0}),await this._waitForClick(r)):(xe(),(o||i)&&be(r,!1,o?e.animation??"pulse":"none",i),e.pointer&&he(r),await async function(e,t){e.focus();const n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set||Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;n?n.call(e,t):e.value=t,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),e.blur()}(r,e.action?.value||""),pe(r,e),await this._waitForAdvance(),xe())}else if("clickwait"===e.type){const r=await a();if(!r)return this._handleMissingElement(e,t,n);r.scrollIntoView({block:"center",inline:"nearest"}),xe(),e.skipWait?((o||i)&&be(r,!1,o?e.animation??"pulse":"none",i),e.pointer&&he(r),pe(r,e,{waitForClick:!0,skipWait:!0}),await this._waitForAdvance()):((o||i)&&be(r,!0,o?e.animation??"pulse":"none",i),e.pointer&&he(r),pe(r,e,{waitForClick:!0}),await this._waitForClick(r),n+1<t.steps.length&&sessionStorage.setItem("dobeacon_resume",JSON.stringify({tourId:t._id,stepIndex:n+1,projectKey:this._config.projectKey,timestamp:Date.now()}))),xe()}else if("navigate"===e.type)xe(),await Rt(e.action?.value,{tourId:t._id,stepIndex:n+1,projectKey:this._config.projectKey});else if("video"===e.type){const t=e.selector?await a():null;t&&t.scrollIntoView({block:"center",inline:"nearest"}),xe(),fe(e,t),e.pointer&&t&&he(t),await this._waitForAdvance()}else if("chat-input"===e.type){if(e.selector){const t=await a();t&&(t.scrollIntoView({block:"center",inline:"nearest"}),(o||i)&&be(t,!1,o?e.animation??"pulse":"none",i),e.pointer&&he(t))}this._chatMode||fe(e,null),await this._waitForAdvance(),xe()}else if("tts"===e.type){const n=e.selector?await a():null;xe(),n&&(n.scrollIntoView({block:"center",inline:"nearest"}),n.focus({preventScroll:!0}),(o||i)&&be(n,!1,o?e.animation??"pulse":"none",i));const r=e.content?.ttsScript||e.content?.body||e.content?.title||"";!1!==e.showCaption&&r&&Ee(r),y(),await w(r),Se(),t.accessibilityMode||"accessibility"===this._mode||v()}else{if("feedback"===e.type)return xe(),await Re(e,t,n);"recap"===e.type&&(xe(),await function(e,t){return new Promise(n=>{const o=document.createElement("div");o.setAttribute("data-dobeacon-ui",""),o.setAttribute("data-dobeacon-recap",""),Ye(o,{position:"fixed",inset:"0",background:"rgba(0,0,0,0.45)",zIndex:"2147483640",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"system-ui,-apple-system,sans-serif",boxSizing:"border-box"});const i=document.createElement("div");i.setAttribute("data-dobeacon-ui",""),Ye(i,{background:"white",borderRadius:"16px",padding:"28px",width:"min(520px,92vw)",maxHeight:"85vh",overflowY:"auto",boxShadow:"0 20px 60px rgba(0,0,0,0.25)",position:"relative",boxSizing:"border-box"});const a=document.createElement("p");if(a.setAttribute("data-dobeacon-ui",""),a.textContent=e.content?.title||"Quiz Results",Ye(a,{fontWeight:"700",fontSize:"18px",color:He,margin:"0 0 4px"}),i.appendChild(a),e.content?.body){const t=document.createElement("p");t.setAttribute("data-dobeacon-ui",""),t.textContent=e.content.body,Ye(t,{fontSize:"13px",color:Ue,margin:"0 0 16px"}),i.appendChild(t)}const{correct:r,total:s}=function(e){let t=0,n=0;for(const{result:o}of e)o&&null!==o.isCorrect&&void 0!==o.isCorrect&&(n++,o.isCorrect&&t++);return{correct:t,total:n}}(t);if(s>0){const e=r===s,t=document.createElement("div");t.setAttribute("data-dobeacon-ui",""),t.innerHTML=`<strong>${r}/${s}</strong> correct`,Ye(t,{display:"inline-block",marginBottom:"20px",borderRadius:"999px",padding:"6px 16px",fontSize:"14px",background:e?Pe:0===r?Oe:"#fffbeb",color:e?Ne:0===r?Fe:"#92400e",border:`1px solid ${e?qe:0===r?Ke:"#fde68a"}`}),i.appendChild(t)}else e.content?.body||(a.style.marginBottom="16px");const d=t.filter(e=>null!==e.result);if(0===d.length){const e=document.createElement("p");e.setAttribute("data-dobeacon-ui",""),e.textContent="No quiz responses recorded for this tour.",Ye(e,{fontSize:"13px",color:Ue,margin:"0 0 20px"}),i.appendChild(e)}else{const e=document.createElement("div");e.setAttribute("data-dobeacon-ui",""),Ye(e,{display:"flex",flexDirection:"column",gap:"12px",marginBottom:"20px"});for(const{step:t,result:n}of d){const o=document.createElement("div");if(o.setAttribute("data-dobeacon-ui",""),Ye(o,{borderRadius:"12px",padding:"14px 16px",boxSizing:"border-box",border:"1px solid #e5e7eb",background:"#f9fafb"}),t.content?.title){const e=document.createElement("p");e.setAttribute("data-dobeacon-ui",""),e.textContent=t.content.title,Ye(e,{fontSize:"13px",fontWeight:"600",color:He,margin:"0 0 8px"}),o.appendChild(e)}const i=t.feedbackType||"single",a=n?.answer,r=n?.isCorrect,s=null!=r,d=document.createElement("div");if(d.setAttribute("data-dobeacon-ui",""),Ye(d,{display:"flex",alignItems:"flex-start",gap:"8px",marginBottom:s?"10px":"0"}),"freeform"===i){const e=document.createElement("span");e.setAttribute("data-dobeacon-ui",""),e.textContent=`"${a||""}"`,Ye(e,{fontSize:"13px",color:Ue,fontStyle:"italic",flex:"1"}),d.appendChild(e)}else if("rating"===i){const e=De(a,t.feedback?.options||[{label:"Not at all",value:"1"},{label:"",value:"2"},{label:"",value:"3"},{label:"",value:"4"},{label:"Very useful",value:"5"}])||(Array.isArray(a)?a[0]:a),n=document.createElement("span");n.setAttribute("data-dobeacon-ui",""),n.textContent=`Rated: ${e||"—"}`,Ye(n,{fontSize:"13px",color:Ue,flex:"1"}),d.appendChild(n)}else{const e=De(a,t.feedback?.options),n=document.createElement("span");if(n.setAttribute("data-dobeacon-ui",""),n.textContent=e||"—",Ye(n,{fontSize:"13px",color:He,flex:"1"}),d.appendChild(n),s){const e=document.createElement("span");e.setAttribute("data-dobeacon-ui",""),e.textContent=r?"✓ Correct":"✗ Incorrect",Ye(e,{fontSize:"12px",fontWeight:"600",padding:"2px 8px",borderRadius:"999px",flexShrink:"0",background:r?Pe:Oe,color:r?Ne:Fe,border:`1px solid ${r?qe:Ke}`}),d.appendChild(e)}}if(o.appendChild(d),s){const e=r?t.feedback?.correctFeedback:t.feedback?.incorrectFeedback;if(e){const t=document.createElement("p");t.setAttribute("data-dobeacon-ui",""),t.textContent=e,Ye(t,{fontSize:"12px",color:r?Ne:Fe,margin:"0",lineHeight:"1.5",padding:"8px 10px",borderRadius:"8px",background:r?Pe:Oe,border:`1px solid ${r?qe:Ke}`}),o.appendChild(t)}else if(!r&&(t.feedback?.correct||[]).length>0){const e=De(t.feedback.correct,t.feedback?.options);if(e){const t=document.createElement("p");t.setAttribute("data-dobeacon-ui",""),t.innerHTML=`Correct answer: <strong>${Ve(e)}</strong>`,Ye(t,{fontSize:"12px",color:Ne,margin:"0",padding:"8px 10px",borderRadius:"8px",background:Pe,border:`1px solid ${qe}`}),o.appendChild(t)}}}e.appendChild(o)}i.appendChild(e)}const c=document.createElement("button");c.setAttribute("data-dobeacon-ui",""),c.textContent="Continue →",Ye(c,{display:"block",marginLeft:"auto",cursor:"pointer",border:"none",borderRadius:"8px",padding:"9px 20px",fontSize:"13px",fontWeight:"600",transition:"opacity .15s",background:"#6366f1",color:"white"}),c.onmouseenter=()=>{c.style.opacity="0.88"},c.onmouseleave=()=>{c.style.opacity="1"},c.onclick=()=>{o.remove(),n()},i.appendChild(c),o.appendChild(i),document.body.appendChild(o)})}(e,this._feedbackResults))}}async _handleMissingElement(e,t,n){u("step_element_missing",{tourId:t._id,projectId:t.projectId,stepIndex:n,selector:e.selector}),xe();const o=document.createElement("div");o.style.cssText='\n position:fixed;bottom:80px;left:50%;transform:translateX(-50%);\n background:#fef2f2;border:1px solid #fca5a5;color:#991b1b;\n border-radius:8px;padding:12px 20px;font-size:13px;z-index:2147483647;\n display:flex;align-items:center;gap:12px;\n box-shadow:0 4px 16px rgba(0,0,0,.1);\n font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;\n ',o.innerHTML='\n <span>⚠ Element not found on this page — step will be skipped.</span>\n <button data-dobeacon-next style="background:#dc2626;color:#fff;border:none;border-radius:6px;padding:5px 12px;cursor:pointer;font-size:12px;font-weight:600;">Skip →</button>\n ',document.body.appendChild(o),await this._waitForAdvance(),o.remove()}_injectCss(e,t){if(!t)return void this._removeCss(e);let n=document.getElementById(e);n||(n=document.createElement("style"),n.id=e,document.head.appendChild(n)),n.textContent=t}_removeCss(e){document.getElementById(e)?.remove()}_watchSpaNavigation(){if(this._navWatching)return;this._navWatching=!0;let e=window.location.href;if(this._navHandler=()=>{if(this._playing||this._queueRunning)return;const t=window.location.href;t!==e&&(e=t,ht(),Ce(),xe(),this._fetchAndStart())},window.addEventListener("popstate",this._navHandler),!window.__dobeaconNavPatched){window.__dobeaconNavPatched=!0;for(const e of["pushState","replaceState"]){const t=history[e];history[e]=function(...e){t.apply(this,e),window.dispatchEvent(new Event("dobeacon:urlchange"))}}}window.addEventListener("dobeacon:urlchange",this._navHandler),this._navInterval=setInterval(this._navHandler,500)}async _initCourseSession(e){const t=await fetch(`${this._config.apiBase}/api/sdk/courses/${e}`);if(!t.ok)return!1;const n=await t.json(),o=n.tours??[];if(0===o.length)return!1;const i=o.find(e=>"1"!==localStorage.getItem(`dobeacon_completed_${e._id}`));if(!i)return!1;if(i.startUrl)try{const t=new URL(i.startUrl,window.location.origin).pathname;if(window.location.pathname!==t){const t=new URL(i.startUrl,window.location.origin);return t.searchParams.set("dobeaconcourse",e),window.location.href=t.toString(),!1}}catch{}const a=await fetch(`${this._config.apiBase}/api/tours/${i._id}`);if(!a.ok)return!1;const r=await a.json();this._courseContext={courseId:e,courseName:n.name,currentTourId:i._id,tourIds:o.map(e=>e._id),tours:o};try{sessionStorage.setItem(`dobeacon_course_${this._config.projectKey}_${e}`,JSON.stringify(this._courseContext))}catch{}return localStorage.setItem(`dobeacon_seen_${r._id}`,"1"),this._queue.push(r),!0}async _resumeCourseSession(e){const t=e.tourIds.find(e=>"1"!==localStorage.getItem(`dobeacon_completed_${e}`));if(!t){try{sessionStorage.removeItem(`dobeacon_course_${this._config.projectKey}_${e.courseId}`)}catch{}return this._courseContext=e,this._showCourseCompletePrompt(),!1}const n=e.tours?.find(e=>e._id===t);if(n?.startUrl)try{const e=new URL(n.startUrl,window.location.origin).pathname;if(window.location.pathname!==e)return!1}catch{}const o=await fetch(`${this._config.apiBase}/api/tours/${t}`);if(!o.ok)return!1;const i=await o.json();this._courseContext={...e,currentTourId:t};try{sessionStorage.setItem(`dobeacon_course_${this._config.projectKey}_${e.courseId}`,JSON.stringify(this._courseContext))}catch{}return localStorage.setItem(`dobeacon_seen_${i._id}`,"1"),this._queue.push(i),!0}_showCourseNextPrompt(e){const t=e=>String(e??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e])),n=this._courseContext,o=n?.tours?.find(t=>t._id===e),i=(n?.tourIds??[]).filter(e=>"1"===localStorage.getItem(`dobeacon_completed_${e}`)).length,a=n?.tourIds?.length??0;let r=null;if(o?.startUrl)try{const e=new URL(o.startUrl,window.location.origin);e.searchParams.set("dobeaconcourse",n.courseId),r=e.toString()}catch{}const s=document.createElement("div");s.setAttribute("data-dobeacon-ui",""),s.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:2147483647;display:flex;align-items:center;justify-content:center;";const d=document.createElement("div");d.style.cssText='background:#fff;border-radius:16px;padding:32px;max-width:360px;width:90%;box-shadow:0 8px 32px rgba(0,0,0,.12);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-align:center;',d.innerHTML=`\n ${n?.courseName?`<p style="font-size:12px;font-weight:600;color:#6366f1;text-transform:uppercase;letter-spacing:.05em;margin:0 0 4px;">${t(n.courseName)}</p>`:""}\n <p style="font-size:13px;color:#6b7280;margin:0 0 2px;">${i} of ${a} complete</p>\n <h2 style="font-size:18px;font-weight:700;color:#111827;margin:0 0 20px;">${t(o?.name??"Next tour")}</h2>\n <div style="display:flex;gap:12px;justify-content:center;">\n <button id="dobeacon-course-skip" style="border:1px solid #d1d5db;background:#fff;color:#374151;border-radius:8px;padding:10px 20px;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit;">Skip for now</button>\n ${r?'<button id="dobeacon-course-continue" style="background:#4f46e5;color:#fff;border:none;border-radius:8px;padding:10px 20px;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit;">Continue →</button>':""}\n </div>\n `,s.appendChild(d),document.body.appendChild(s),d.querySelector("#dobeacon-course-skip")?.addEventListener("click",()=>{s.remove(),yt(n,r)},{once:!0}),r&&d.querySelector("#dobeacon-course-continue")?.addEventListener("click",()=>{s.remove(),window.location.href=r},{once:!0})}_showCourseCompletePrompt(){const e=this._courseContext;try{sessionStorage.removeItem(`dobeacon_course_${this._config.projectKey}_${e?.courseId}`)}catch{}const t=document.createElement("div");t.setAttribute("data-dobeacon-ui",""),t.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:2147483647;display:flex;align-items:center;justify-content:center;";const n=document.createElement("div");var o;n.style.cssText='background:#fff;border-radius:16px;padding:32px;max-width:360px;width:90%;box-shadow:0 8px 32px rgba(0,0,0,.12);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-align:center;',n.innerHTML=`\n <div style="font-size:40px;margin-bottom:12px;">🎉</div>\n ${e?.courseName?`<p style="font-size:12px;font-weight:600;color:#6366f1;text-transform:uppercase;letter-spacing:.05em;margin:0 0 8px;">${o=e.courseName,String(o??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]))}</p>`:""}\n <h2 style="font-size:18px;font-weight:700;color:#111827;margin:0 0 8px;">Course complete!</h2>\n <p style="font-size:14px;color:#6b7280;margin:0 0 24px;">You've finished all the tours in this course.</p>\n <button id="dobeacon-course-done" style="background:#4f46e5;color:#fff;border:none;border-radius:8px;padding:10px 24px;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit;">Done</button>\n `,t.appendChild(n),document.body.appendChild(t),n.querySelector("#dobeacon-course-done")?.addEventListener("click",()=>t.remove(),{once:!0})}_waitForClick(e){return new Promise(t=>{const n=()=>{this._stepResolve=null,e.removeEventListener("click",n),document.removeEventListener("dobeacon:advance",n),o.disconnect(),t()};this._stepResolve=n,e.addEventListener("click",n,{once:!0}),document.addEventListener("dobeacon:advance",n,{once:!0});const o=new MutationObserver(()=>{document.contains(e)||n()});o.observe(document.body,{childList:!0,subtree:!0})})}_waitForAdvance(){return new Promise(e=>{const t=()=>{this._stepResolve=null,n?.removeEventListener("click",t),document.removeEventListener("dobeacon:advance",t),e()};this._stepResolve=t;const n=document.querySelector("[data-dobeacon-next]");n&&n.addEventListener("click",t,{once:!0}),document.addEventListener("dobeacon:advance",t,{once:!0})})}_startVoiceAdvancement(){this._stopVoiceListener=function(e,t){if("undefined"==typeof window||!("webkitSpeechRecognition"in window)&&!("SpeechRecognition"in window))return()=>{};const n=new(window.SpeechRecognition||window.webkitSpeechRecognition);return n.continuous=!0,n.interimResults=!1,n.lang="en-US",n.onresult=n=>{const o=n.results[n.results.length-1][0].transcript.toLowerCase().trim();e.some(e=>o.includes(e))&&t(o)},n.start(),()=>n.stop()}(["next","continue","done","yes","skip"],()=>document.dispatchEvent(new CustomEvent("dobeacon:advance")))}_stopVoice(){this._stopVoiceListener&&(this._stopVoiceListener(),this._stopVoiceListener=null)}}function Ut(e,t){for(const n of t.triggers||[])if(n.url){if("exact"===n.urlMatchType&&e===n.url)return!0;if("contains"===n.urlMatchType&&e.includes(n.url))return!0;if("regex"===n.urlMatchType)try{if(new RegExp(n.url).test(e))return!0}catch{}}return!1}let Pt=null,Nt={};function qt(e,t){Pt||window.__dobeaconInitialized||(window.__dobeaconInitialized=!0,Nt={projectKey:e,apiBase:t},Pt=new Ht(Nt),Pt.start())}const Ot={init(e){qt(e,"https://dobeacon.com")},identify(e,t={}){Pt&&(Pt.setUser(e,t),b.visitorGroups=Array.isArray(t?.groups)?t.groups:[],b.visitorUserId=e??null,b.visitorGroupsHash=t?.groupsHash??null,b.visitorEmail=t?.email??null,b.visitorName=t?.name??null)},startTour(e,t={}){Pt&&Pt.loadAndPlay(e,t)},hasCompleted:async e=>!!Pt&&Pt.hasCompleted(e),setMode(e){Pt&&Pt.setMode(e)},pause(){Pt?.pause()},resume(){Pt?.resume()},getMessages:()=>Pt?.getMessages()??[],getUnreadCount:()=>Pt?.getUnreadCount()??0,markMessagesRead:e=>Pt?.markMessagesRead(e),openChat(){Pt?.openChat()},toggleChat(){Pt?.toggleChat()},closeChat(){Pt?.closeChat()},isChatOpen:()=>Pt?.isChatOpen()??!1,sendChatMessage(e){Pt?.sendChatMessage(e)},clearChat(){Pt?.clearChat()},showBubble(){Pt?.showBubble()},hideBubble(){Pt?.hideBubble()},isBubbleVisible:()=>Pt?.isBubbleVisible()??!1,setBubblePosition:e=>Pt?.setBubblePosition(e)??!1,setBubbleMode(e){Pt?.setBubbleMode(e)},speak(e){Pt?.speak(e)},stopVoice(){Pt?.stopVoice()},next(){Pt?.next()},back(){Pt?.back()},goToStep(e){Pt?.goToStep(e)},exit(){Pt?.exit()},stopTour(){Pt?.exit()},restartTour:e=>Pt?.restartTour(e),hasSeen:e=>Pt?.hasSeen(e)??!1,resetCompletion(e){Pt?.resetCompletion(e)},markCompleted(e){Pt?.markCompleted(e)},resetAll(){Pt?.resetAll()},isPlaying:()=>Pt?.isPlaying()??!1,getCurrentTour:()=>Pt?.getCurrentTour()??null,getCurrentStep:()=>Pt?.getCurrentStep()??null,getProgress:()=>Pt?.getProgress()??null,getTours:()=>Pt?.getTours()??[],getVisitor:()=>Pt?.getVisitor()??null,reset(){Pt?.reset()},logout(){Pt?.reset()},on:(e,t)=>Pt?.on(e,t),off(e,t){Pt?.off(e,t)},once:(e,t)=>Pt?.once(e,t),getMode:()=>Pt?.getMode()??null,isReady:()=>Pt?.isReady()??!1,startCourse:e=>Pt?.startCourse(e),getCourses:()=>Pt?.getCourses()??Promise.resolve([]),getCourseProgress:()=>Pt?.getCourseProgress()??null,resetCourse(e){Pt?.resetCourse(e)},enterPreview(e){Pt?.enterPreview(e)},exitPreview(){Pt?.exitPreview()},destroy(){Pt?.destroy(),Pt=null;try{window.__dobeaconInitialized=!1}catch{}}};if("undefined"!=typeof document){const e=window._dobeaconProjectKey||(document.currentScript||document.querySelector("script[data-project-key]"))?.dataset?.projectKey;e&&Ot.init(e)}e.BUBBLE_STYLE=j,e.EXIT_BTN_STYLE=B,e.MODAL_BACKDROP_STYLE=$,e.MODAL_BOX_STYLE=I,e.MODAL_NEXT_BTN_STYLE=z,e.NEXT_BTN_STYLE=A,e.PROGRESS_BAR_STYLE=T,e.PROGRESS_EXIT_BTN_STYLE="background:none;border:none;cursor:pointer;color:var(--dobeacon-text-muted,#9ca3af);font-size:16px;line-height:1;padding:0 2px;transition:color .15s;",e.Player=Ht,e.REDUCED_MOTION_CSS=M,e.SPOTLIGHT_NEXT_BTN_STYLE=L,e.SPOTLIGHT_PANEL_STYLE=S,e.STEP_TYPES=[{value:"tooltip",label:"Tooltip — small callout near element",description:"Short callout anchored near the element — best for brief hints"},{value:"spotlight",label:"Drawer — slides in from page edge",description:"Panel that slides in from bottom/top/left/right, pushing page content aside — collapsible"},{value:"modal",label:"Modal — full-screen dialog",description:"Centered full-screen dialog — best for long explanations or media"},{value:"autofill",label:"Auto-fill",description:"Automatically fill a form input"},{value:"clickwait",label:"Wait for click",description:"Highlight and wait for the user to click"},{value:"navigate",label:"Navigate",description:"Navigate to a URL"},{value:"video",label:"Video",description:"Play a video in a modal"},{value:"tts",label:"Voice narration",description:"Read text aloud and optionally show it as a caption"},{value:"chat-input",label:"Chat input",description:"Prompt the user to type a response in the chat panel"},{value:"feedback",label:"Feedback / Quiz",description:"Collect a rating, quiz answer, or freeform response — centered modal, no DOM target needed"},{value:"recap",label:"Quiz Recap",description:"Show a summary of all quiz/feedback responses and scores — only useful when the tour has feedback steps"}],e.TOOLTIP_STYLE=E,e.VAR_DEFAULTS=k,e.applyFormat=function(e,t,n,o,i){const a=String(e??""),r=a.slice(0,t),s=a.slice(t,n),d=a.slice(n),c=(e,t)=>{const n=s||t,o=r.length+e.length;return{value:`${r}${e}${n}${e}${d}`,selectionStart:o,selectionEnd:o+n.length}},l=e=>{const t=r.lastIndexOf("\n")+1,o=a.slice(0,t),i=a.slice(t,n),s=a.slice(n),d=i.split("\n").map((t,n)=>e(n)+t).join("\n");return{value:`${o}${d}${s}`,selectionStart:t,selectionEnd:t+d.length}},p=e=>{const t=r.length+e.length;return{value:`${r}${e}${d}`,selectionStart:t,selectionEnd:t}};switch(o){case"bold":return c("**","bold text");case"italic":return c("*","italic text");case"heading":return l(()=>"## ");case"bulletList":return l(()=>"- ");case"numberedList":return l(e=>`${e+1}. `);case"link":return p(`[${s||"link text"}](${i||"https://"})`);case"image":return p(`![${s}](${i||"https://"})`);case"video":return p(`${r&&!r.endsWith("\n")?"\n":""}${i||""}${d&&!d.startsWith("\n")?"\n":""}`);default:return{value:a,selectionStart:t,selectionEnd:n}}},e.configureEvents=l,e.default=Ot,e.dobeaconBaseCSS=function(){return`\n:root {\n${Object.entries(k).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}\n\n#dobeacon-tooltip {\n background: var(--dobeacon-bg);\n border: 1px solid var(--dobeacon-border-color);\n border-radius: var(--dobeacon-radius);\n padding: 16px;\n max-width: 320px;\n box-shadow: var(--dobeacon-shadow);\n font-family: ${C};\n}\n\n#dobeacon-tooltip-title {\n font-weight: 600;\n margin: 0 0 6px;\n color: var(--dobeacon-text);\n font-family: ${C};\n}\n\n#dobeacon-tooltip-body {\n margin: 0 0 12px;\n color: var(--dobeacon-text);\n font-family: ${C};\n}\n\n#dobeacon-spotlight-panel {\n background: var(--dobeacon-bg);\n border-top: 1px solid var(--dobeacon-border-color);\n padding: 20px 24px;\n box-shadow: 0 -4px 24px rgba(0,0,0,.12);\n font-family: ${C};\n}\n\n#dobeacon-spotlight-title {\n font-weight: 700;\n font-size: 15px;\n margin: 0 0 8px;\n color: var(--dobeacon-text);\n font-family: ${C};\n}\n\n#dobeacon-spotlight-body {\n margin: 0 0 14px;\n font-size: 14px;\n line-height: 1.5;\n color: var(--dobeacon-text);\n font-family: ${C};\n}\n\n#dobeacon-modal-backdrop {\n background: rgba(0,0,0,0.5);\n}\n\n#dobeacon-modal-box {\n background: var(--dobeacon-bg);\n border-radius: calc(var(--dobeacon-radius) + 4px);\n padding: 32px;\n max-width: 480px;\n width: 90%;\n}\n\n#dobeacon-modal-title {\n margin: 0 0 12px;\n font-size: 1.25rem;\n color: var(--dobeacon-text);\n font-family: ${C};\n}\n\n#dobeacon-modal-body {\n margin: 0 0 16px;\n color: var(--dobeacon-text);\n}\n\n#dobeacon-progress {\n background: var(--dobeacon-bg);\n border-top: 1px solid var(--dobeacon-border-color);\n padding: 10px 16px 12px;\n box-shadow: 0 -4px 16px rgba(0,0,0,.08);\n font-family: ${C};\n}\n\n[data-dobeacon-next],\n#dobeacon-tooltip-next,\n#dobeacon-spotlight-next,\n#dobeacon-modal-next {\n background: var(--dobeacon-primary);\n color: #fff;\n border: none;\n border-radius: var(--dobeacon-radius);\n padding: 8px 16px;\n cursor: pointer;\n font-family: ${C};\n}\n\n[data-dobeacon-exit],\n#dobeacon-tooltip-exit,\n#dobeacon-spotlight-exit,\n#dobeacon-modal-exit {\n background: none;\n border: none;\n cursor: pointer;\n color: var(--dobeacon-text-muted);\n font-size: 12px;\n padding: 0;\n font-family: ${C};\n}\n\n#dobeacon-step-counter {\n font-size: 12px;\n color: var(--dobeacon-text-muted);\n}\n\n#dobeacon-exit-btn {\n background: none;\n border: none;\n cursor: pointer;\n color: var(--dobeacon-text-muted);\n font-size: 16px;\n line-height: 1;\n padding: 0 2px;\n transition: color .15s;\n}\n\n#dobeacon-tour-name {\n font-size: 12px;\n font-weight: 700;\n color: var(--dobeacon-primary);\n letter-spacing: -0.1px;\n}\n\n#dobeacon-powered-by {\n font-size: 10px;\n color: #d1d5db;\n text-decoration: none;\n white-space: nowrap;\n font-family: ${C};\n letter-spacing: 0.1px;\n transition: color .15s;\n}\n\n#dobeacon-progress-dots > div {\n width: 8px;\n height: 8px;\n border-radius: 999px;\n background: var(--dobeacon-dot-inactive);\n transition: all .25s ease;\n flex-shrink: 0;\n}\n\n#dobeacon-progress-dots > div[data-active] {\n width: 20px;\n background: var(--dobeacon-dot-active);\n}\n\n#dobeacon-caption {\n background: var(--dobeacon-caption-bg);\n color: var(--dobeacon-caption-text);\n font-family: ${C};\n font-size: 15px;\n line-height: 1.5;\n text-align: center;\n padding: 10px 20px;\n border-radius: 8px;\n max-width: 640px;\n width: 90%;\n}\n\n#dobeacon-bubble {\n background: var(--dobeacon-primary);\n color: #fff;\n border-radius: 50%;\n border: none;\n width: 52px;\n height: 52px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 22px;\n cursor: pointer;\n box-shadow: 0 4px 16px rgba(99,102,241,.4);\n}\n`.trim()},e.emit=u,e.getBestSelector=function(e,t=()=>!1){return e.dataset?.dobeaconId?`[data-dobeacon-id="${e.dataset.dobeaconId}"]`:e.dataset?.testid?`[data-testid="${e.dataset.testid}"]`:e.getAttribute("aria-label")?`[aria-label="${e.getAttribute("aria-label")}"]`:e.id?`#${CSS.escape(e.id)}`:function(e,t=()=>!1){const n=[];let o=e;for(;o&&o!==document.body;){let e=o.tagName.toLowerCase();if(o.id){n.unshift(`#${CSS.escape(o.id)}`);break}const i=Array.from(o.parentNode?.children||[]).filter(e=>e.tagName===o.tagName&&!t(e));i.length>1&&(e+=`:nth-of-type(${i.indexOf(o)+1})`),n.unshift(e),o=o.parentElement}return n.join(" > ")}(e,t)},e.getBoundingBox=function(e){const t=e.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX,width:t.width,height:t.height}},e.getStableSelector=function(e,t=()=>!1){return e.dataset?.dobeaconId?`[data-dobeacon-id="${e.dataset.dobeaconId}"]`:e.dataset?.testid?`[data-testid="${e.dataset.testid}"]`:e.getAttribute("aria-label")?`[aria-label="${e.getAttribute("aria-label")}"]`:function(e,t=()=>!1){const n=[];let o=e;for(;o&&o!==document.body;){let e=o.tagName.toLowerCase();const i=Array.from(o.classList).filter(e=>!/^(is-|has-|active|hover|focus|open|closed|visible|hidden|disabled|selected)/.test(e)).slice(0,2);i.length&&(e+="."+i.join("."));const a=Array.from(o.parentNode?.children||[]).filter(e=>e.tagName===o.tagName&&!t(e));a.length>1&&(e+=`:nth-of-type(${a.indexOf(o)+1})`),n.unshift(e),o=o.parentElement}return n.join(" > ")}(e,t)},e.initWithApiBase=function(e,t){qt(e,t)},e.launcherAnimationStyle=R,e.parseVideoEmbed=N,e.removeBubble=ht,e.removeCaption=Se,e.removeMessageBadge=_t,e.removeOverlay=xe,e.removeProgressBar=Ce,e.renderBubble=mt,e.renderCaption=Ee,e.renderHighlight=be,e.renderLoadingBar=function(){Ce();const e=document.createElement("div");if(e.id=ge,e.setAttribute("data-dobeacon-ui",""),e.style.cssText='\n position:fixed;bottom:0;left:0;right:0;\n background:#fff;border-top:1px solid #e5e7eb;\n padding:12px 16px;z-index:2147483645;\n font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;\n box-shadow:0 -4px 16px rgba(0,0,0,.08);\n display:flex;align-items:center;gap:10px;\n ',!document.getElementById("dobeacon-spin-style")){const e=document.createElement("style");e.id="dobeacon-spin-style",e.textContent="@keyframes dobeacon-spin{to{transform:rotate(360deg)}}",(document.head||document.documentElement).appendChild(e)}e.innerHTML='\n <div style="width:14px;height:14px;border:2px solid #e5e7eb;border-top-color:#6366f1;\n border-radius:50%;animation:dobeacon-spin .7s linear infinite;flex-shrink:0;"></div>\n <span style="font-size:12px;color:#9ca3af;">Loading tour…</span>\n ',document.body.appendChild(e),ve(e)},e.renderMessageBadge=wt,e.renderModal=fe,e.renderProgressBar=we,e.renderRichText=V,e.renderSpotlight=ue,e.renderTooltip=pe,e.resolveElement=f,e.setInboxMessages=vt,e.shouldAutoPlay=function(e,t){return t.triggers?.some(e=>"auto"===e.type)&&Ut(e,t)},e.updateProgressBar=_e,e.urlMatches=Ut,e.waitForElement=m,Object.defineProperty(e,"__esModule",{value:!0})}),"undefined"!=typeof window&&window.DoBeacon&&window.DoBeacon.default&&(window.DoBeacon=window.DoBeacon.default);
package/package.json CHANGED
@@ -1,6 +1,47 @@
1
1
  {
2
2
  "name": "@dobeacon/sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.4",
4
+ "type": "module",
5
+ "description": "DoBeacon guided tour SDK — embed tours in any website",
6
+ "license": "SEE LICENSE IN LICENSE",
7
+ "homepage": "https://dobeacon.com/docs/npm",
8
+ "keywords": [
9
+ "dobeacon",
10
+ "guided tours",
11
+ "product tours",
12
+ "onboarding",
13
+ "walkthrough",
14
+ "in-app assistant"
15
+ ],
16
+ "main": "dist/dobeacon.cjs",
17
+ "module": "dist/dobeacon.esm.js",
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/dobeacon.esm.js",
21
+ "require": "./dist/dobeacon.cjs",
22
+ "default": "./dist/dobeacon.esm.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist/dobeacon.esm.js",
27
+ "dist/dobeacon.cjs",
28
+ "dist/dobeacon.min.js"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "scripts": {
34
+ "build": "rollup -c",
35
+ "dev": "rollup -c --watch",
36
+ "test": "vitest run",
37
+ "test:watch": "vitest"
38
+ },
39
+ "devDependencies": {
40
+ "@rollup/plugin-commonjs": "^29.0.3",
41
+ "@rollup/plugin-node-resolve": "^16.0.3",
42
+ "@rollup/plugin-terser": "^1.0.2",
43
+ "jsdom": "^30.1.3",
44
+ "rollup": "^4.65.0",
45
+ "vitest": "^5.0.5"
46
+ }
47
+ }