@sentientui/snippet 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var SentientSnippet=(()=>{var j=Object.defineProperty,vt=Object.defineProperties,bt=Object.getOwnPropertyDescriptor,yt=Object.getOwnPropertyDescriptors,kt=Object.getOwnPropertyNames,at=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var st=(e,t,n)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))lt.call(t,n)&&st(e,n,t[n]);if(at)for(var n of at(t))Et.call(t,n)&&st(e,n,t[n]);return e},Q=(e,t)=>vt(e,yt(t));var St=(e,t)=>{for(var n in t)j(e,n,{get:t[n],enumerable:!0})},Lt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kt(t))!lt.call(e,i)&&i!==n&&j(e,i,{get:()=>t[i],enumerable:!(o=bt(t,i))||o.enumerable});return e};var Ct=e=>Lt(j({},"__esModule",{value:!0}),e);var jt={};St(jt,{buildStyleOps:()=>mt,clearTargetHighlights:()=>K,computeMoveAnchors:()=>F,deriveSlotId:()=>Y,drawTargetHighlights:()=>ft,mount:()=>gt});function wt(e){var n,o,i;let t=(o=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0)==null?void 0:o.location;return(i=t==null?void 0:t.pathname)!=null?i:""}function Tt(e,t){var n;if(t.tag&&e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;if(t.text){let o=((n=e.textContent)!=null?n:"").trim().toLowerCase(),i=t.text.trim().toLowerCase();if(!(o===i||o.startsWith(i)||i.startsWith(o)))return!1}return!0}function G(e,t){var i;if(e.urlMatch&&!wt(t).includes(e.urlMatch))return null;let n=[];if(e.id){let l=t.getElementById(e.id);n=l?[l]:[]}if(n.length===0&&((i=e.dataAttr)!=null&&i.name))try{let l=e.dataAttr.value.replace(/["\\]/g,"\\$&");n=Array.from(t.querySelectorAll(`[${e.dataAttr.name}="${l}"]`))}catch(l){n=[]}if(n.length===0&&e.selector)try{n=Array.from(t.querySelectorAll(e.selector))}catch(l){n=[]}if(n.length!==1)return null;let o=n[0];return e.fingerprint&&!Tt(o,e.fingerprint)?null:o}function dt(e){let t=globalThis;return t.CSS&&typeof t.CSS.escape=="function"?t.CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`)}function Bt(e,t){if(e.id)return`#${dt(e.id)}`;let n=[],o=e,i=0;for(;o&&o!==t.body&&o!==t.documentElement&&i<6;){if(o.id){n.unshift(`#${dt(o.id)}`);break}let l=o.tagName.toLowerCase(),f=o.parentElement;if(f){let p=Array.from(f.children).filter(g=>g.tagName===o.tagName);p.length>1&&(l+=`:nth-of-type(${p.indexOf(o)+1})`)}n.unshift(l),o=o.parentElement,i++}return n.join(" > ")}function U(e,t){var i;let n={v:1};e.id&&(n.id=e.id);for(let l of["data-framer-name","data-w-id","data-sentient-name"]){let f=e.getAttribute(l);if(f){n.dataAttr={name:l,value:f};break}}n.selector=Bt(e,t);let o=((i=e.textContent)!=null?i:"").trim().replace(/\s+/g," ").slice(0,80);return n.fingerprint=$({tag:e.tagName.toLowerCase()},o?{text:o}:{}),n}function q(e,t,n){return G(e,n)===t}var At="__snt_editor_token";function tt(){try{sessionStorage.removeItem(At)}catch(e){}}function It(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(36)}function $t(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)}function Y(e,t,n){var p,g;let o=t.id||((p=t.dataAttr)==null?void 0:p.value)||((g=n.textContent)!=null?g:"").trim()||n.tagName,i=$t(o)||"el",l=It(JSON.stringify(t));return`${e}-${i}-${l}`.slice(0,128)}var Mt="sentient-editor-highlight",E="sentient-editor-panel",V="sentient-editor-toast",ct="sentient-editor-styles",et="sentient-editor-target-highlight",Rt=10,Ht="Editor session expired. Reopen it from your dashboard to keep editing \u2014 your saved changes are safe.",zt="Couldn\u2019t load the editor \u2014 check your connection and reopen it from your dashboard.";function pt(){var t;if(document.getElementById(ct))return;let e=document.createElement("style");e.id=ct,e.textContent=`
1
+ "use strict";var SentientSnippet=(()=>{var F=Object.defineProperty,_t=Object.defineProperties,Pt=Object.getOwnPropertyDescriptor,Dt=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertyNames,wt=Object.getOwnPropertySymbols;var Lt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable;var Ct=(e,t,n)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||(t={}))Lt.call(t,n)&&Ct(e,n,t[n]);if(wt)for(var n of wt(t))jt.call(t,n)&&Ct(e,n,t[n]);return e},ct=(e,t)=>_t(e,Dt(t));var Ut=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},qt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Gt(t))!Lt.call(e,a)&&a!==n&&F(e,a,{get:()=>t[a],enumerable:!(r=Pt(t,a))||r.enumerable});return e};var Wt=e=>qt(F({},"__esModule",{value:!0}),e);var se={};Ut(se,{buildStyleOps:()=>Mt,clearTargetHighlights:()=>et,computeMoveAnchors:()=>Q,deriveSlotId:()=>Z,drawTargetHighlights:()=>At,mount:()=>Rt});function Yt(e){var n,r,a;let t=(r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0)==null?void 0:r.location;return(a=t==null?void 0:t.pathname)!=null?a:""}function Vt(e,t){var n;if(t.tag&&e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;if(t.text){let r=((n=e.textContent)!=null?n:"").trim().toLowerCase(),a=t.text.trim().toLowerCase();if(!(r===a||r.startsWith(a)||a.startsWith(r)))return!1}return!0}function J(e,t){var a;if(e.urlMatch&&!Yt(t).includes(e.urlMatch))return null;let n=[];if(e.id){let d=t.getElementById(e.id);n=d?[d]:[]}if(n.length===0&&((a=e.dataAttr)!=null&&a.name))try{let d=e.dataAttr.value.replace(/["\\]/g,"\\$&");n=Array.from(t.querySelectorAll(`[${e.dataAttr.name}="${d}"]`))}catch(d){n=[]}if(n.length===0&&e.selector)try{n=Array.from(t.querySelectorAll(e.selector))}catch(d){n=[]}if(n.length!==1)return null;let r=n[0];return e.fingerprint&&!Vt(r,e.fingerprint)?null:r}function St(e){let t=globalThis;return t.CSS&&typeof t.CSS.escape=="function"?t.CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`)}function Ft(e,t){if(e.id)return`#${St(e.id)}`;let n=[],r=e,a=0;for(;r&&r!==t.body&&r!==t.documentElement&&a<6;){if(r.id){n.unshift(`#${St(r.id)}`);break}let d=r.tagName.toLowerCase(),p=r.parentElement;if(p){let b=Array.from(p.children).filter(h=>h.tagName===r.tagName);b.length>1&&(d+=`:nth-of-type(${b.indexOf(r)+1})`)}n.unshift(d),r=r.parentElement,a++}return n.join(" > ")}function P(e,t){var a;let n={v:1};e.id&&(n.id=e.id);for(let d of["data-framer-name","data-w-id","data-sentient-name"]){let p=e.getAttribute(d);if(p){n.dataAttr={name:d,value:p};break}}n.selector=Ft(e,t);let r=((a=e.textContent)!=null?a:"").trim().replace(/\s+/g," ").slice(0,80);return n.fingerprint=_({tag:e.tagName.toLowerCase()},r?{text:r}:{}),n}function K(e,t,n){return J(e,n)===t}var Jt="__snt_editor_token";function ut(){try{sessionStorage.removeItem(Jt)}catch(e){}}function $t(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(36)}function X(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)}function Z(e,t,n){var b,h;let r=t.id||((b=t.dataAttr)==null?void 0:b.value)||((h=n.textContent)!=null?h:"").trim()||n.tagName,a=X(r)||"el",d=$t(JSON.stringify(t));return`${e}-${a}-${d}`.slice(0,128)}var Kt="sentient-editor-highlight",Xt="sentient-editor-selection",B="sentient-editor-panel",tt="sentient-editor-toast",Tt="sentient-editor-styles",pt="sentient-editor-target-highlight",Zt=10,Qt="Editor session expired. Reopen it from your dashboard to keep editing \u2014 your saved changes are safe.",te="Couldn\u2019t load the editor \u2014 check your connection and reopen it from your dashboard.";function It(){var t;if(document.getElementById(Tt))return;let e=document.createElement("style");e.id=Tt,e.textContent=`
2
2
  @keyframes sntedi-in {
3
3
  from { opacity: 0; transform: translateY(28px) scale(0.94); }
4
4
  to { opacity: 1; transform: translateY(0) scale(1); }
@@ -11,13 +11,13 @@
11
11
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.55); }
12
12
  50% { box-shadow: 0 0 0 5px rgba(52,211,153,0); }
13
13
  }
14
- #${E} {
14
+ #${B} {
15
15
  animation: sntedi-in 0.42s cubic-bezier(0.2,0.9,0.25,1.15) both,
16
16
  sntedi-attn 1.7s ease-in-out 0.42s 3;
17
17
  }
18
- #${E} .sntedi-dot { animation: sntedi-dot 1.4s ease-in-out infinite; }
19
- #${V} { animation: sntedi-in 0.42s cubic-bezier(0.2,0.9,0.25,1.15) both; }
18
+ #${B} .sntedi-dot { animation: sntedi-dot 1.4s ease-in-out infinite; }
19
+ #${tt} { animation: sntedi-in 0.42s cubic-bezier(0.2,0.9,0.25,1.15) both; }
20
20
  @media (prefers-reduced-motion: reduce) {
21
- #${E}, #${E} .sntedi-dot, #${V} { animation: none !important; }
21
+ #${B}, #${B} .sntedi-dot, #${tt} { animation: none !important; }
22
22
  }
23
- `,((t=document.head)!=null?t:document.documentElement).appendChild(e)}function ut(e){var o;pt(),(o=document.getElementById(V))==null||o.remove();let t=d("div",{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483647",maxWidth:"320px",padding:"14px 16px",borderRadius:"14px",background:"#111827",color:"#fff",font:"13px/1.45 system-ui, sans-serif",border:"1px solid rgba(245,158,11,0.6)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)",display:"flex",gap:"10px",alignItems:"flex-start",cursor:"pointer"});t.id=V;let n=d("span",{width:"9px",height:"9px",marginTop:"4px",borderRadius:"50%",background:"#f59e0b",flex:"0 0 auto"});t.append(n,d("div",{},e)),document.body.appendChild(t),t.addEventListener("click",()=>t.remove()),setTimeout(()=>t.remove(),1e4)}function _t(){let e=window.__sentientEditor;return e&&typeof e.token=="string"&&typeof e.apiBase=="string"?e:null}async function Nt(e){try{let t=await fetch(`${e.apiBase}/v1/editor/verify`,{headers:{authorization:`Bearer ${e.token}`}});if(t.status===401)return{ok:!1,unauthorized:!0};if(!t.ok)return{ok:!1,unauthorized:!1};let n=(await t.json()).projectId;return n?{ok:!0,projectId:n}:{ok:!1,unauthorized:!1}}catch(t){return{ok:!1,unauthorized:!1}}}async function W(e,t,n){try{let o=await fetch(`${e.apiBase}${t}`,{method:"POST",headers:{authorization:`Bearer ${e.token}`,"content-type":"application/json"},body:JSON.stringify(n)});return o.ok?"ok":o.status===401?"expired":"error"}catch(o){return"error"}}async function Ot(e){try{let t=await fetch(`${e.apiBase}/v1/editor/targets`,{headers:{authorization:`Bearer ${e.token}`}});if(!t.ok)return[];let n=await t.json();return Array.isArray(n.targets)?n.targets:[]}catch(t){return[]}}function K(e=document){for(let t of Array.from(e.querySelectorAll(`.${et}`)))t.remove()}function ft(e,t=document){K(t);let n=0;for(let o of e){if(n>=Rt)break;let i=G(o.locator,t);if(!i)continue;let l=i.getBoundingClientRect(),f=d("div",{position:"fixed",pointerEvents:"none",zIndex:"2147483645",left:`${l.left}px`,top:`${l.top}px`,width:`${l.width}px`,height:`${l.height}px`,border:"2px dashed #10b981",background:"rgba(16,185,129,0.08)"});f.className=et;let p=d("div",{position:"fixed",pointerEvents:"none",zIndex:"2147483645",left:`${l.left}px`,top:`${Math.max(0,l.top-20)}px`,padding:"2px 6px",borderRadius:"4px",background:"#10b981",color:"#fff",font:"11px system-ui, sans-serif",whiteSpace:"nowrap"},o.label);p.className=et,t.body.append(f,p),n+=1}}function F(e,t){let n=e.previousElementSibling,o=e.nextElementSibling,i=n?U(n,t):null,l=o?U(o,t):null;return{prevEl:n,nextEl:o,prevLocator:n&&i&&q(i,n,t)?i:null,nextLocator:o&&l&&q(l,o,t)?l:null}}function Dt(e){return e.length>0&&!/[;{}<>]/.test(e)}function mt(e){let t={};for(let n of["color","background","fontSize","fontWeight","borderRadius","textAlign"]){let o=e[n];typeof o=="string"&&Dt(o.trim())&&(t[n]=o.trim())}return t}function d(e,t,n){let o=document.createElement(e);return Object.assign(o.style,t),n!==void 0&&(o.textContent=n),o}function gt(e){let t=null,n=d("div",{position:"fixed",pointerEvents:"none",zIndex:"2147483646",border:"2px solid #6366f1",background:"rgba(99,102,241,0.12)",display:"none"});n.id=Mt,pt();let o=d("div",{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483647",width:"320px",padding:"16px",borderRadius:"14px",background:"#111827",color:"#fff",font:"13px/1.4 system-ui, sans-serif",border:"1px solid rgba(99,102,241,0.55)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)"});o.id=E;let i=d("span",{width:"9px",height:"9px",borderRadius:"50%",background:"#34d399",display:"inline-block",flex:"0 0 auto"});i.className="sntedi-dot";let l=d("div",{display:"flex",alignItems:"center",gap:"8px",fontWeight:"700",fontSize:"14px",marginBottom:"6px"});l.append(i,d("span",{},"SentientUI editor"));let f=d("div",{opacity:"0.85",marginBottom:"10px"},"Click any element on the page to adapt it."),p=d("div",{fontSize:"12px",marginBottom:"10px",minHeight:"16px"}),g=d("button",v("#6366f1"),"Test different text here"),S=d("button",v("#374151"),"Change style"),L=d("button",v("#374151"),"Track clicks as a goal"),C=d("button",v("#374151"),"Move up"),w=d("button",v("#374151"),"Move down"),M=d("button",v("#6366f1"),"Save this arrangement"),R=d("button",v("#374151"),"Undo"),H=d("button",Q($({},v("transparent")),{opacity:"0.6"}),"Close editor");for(let r of[g,S,L,C,w,H])r.disabled=!0;M.style.display="none",R.style.display="none",o.append(l,f,p,g,S,L,C,w,M,R,H),document.body.append(n,o);let z=d("div",{marginTop:"10px"});o.append(z);let T=()=>{z.textContent=""},J=(r,a,s)=>{T();let c={};for(let h of r){let Z=d("label",{display:"block",fontSize:"12px",opacity:"0.85",marginTop:"8px"},h.label),P=d("input",{display:"block",width:"100%",marginTop:"4px",padding:"7px 9px",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.18)",background:"#1f2937",color:"#fff",font:"13px system-ui, sans-serif"});P.setAttribute("data-field",h.key),h.value!==void 0&&(P.value=h.value),c[h.key]=P,z.append(Z,P)}let x=d("button",v("#6366f1"),a),D=d("button",Q($({},v("transparent")),{opacity:"0.6"}),"Cancel");x.onclick=()=>s(Object.fromEntries(Object.entries(c).map(([h,Z])=>[h,Z.value]))),D.onclick=T,z.append(x,D)},u=(r,a=!0)=>{p.textContent=r,p.style.color=a?"#a7f3d0":"#fca5a5"},_=(r,a)=>{r==="ok"?u(a,!0):u(r==="expired"?"Editor session expired \u2014 reopen it from your dashboard to save this. Your earlier changes are safe.":"\u26A0 Couldn\u2019t save \u2014 try again.",!1)},m=null,N=!1,B=null,A=null,b=null,y=null,I=null,O=null,k=!1,xt=()=>{C.disabled=!N||!b,w.disabled=!N||!y},X=r=>{M.style.display=r?"block":"none",R.style.display=r?"block":"none",xt()},nt=()=>{if(k&&t&&I&&I.insertBefore(t,O),k=!1,I=null,O=null,t){let r=F(t,document);B=r.prevEl,A=r.nextEl,b=r.prevLocator,y=r.nextLocator}X(!1)},ot=r=>{let a=r.target;if(!a||o.contains(a)||a===n)return;K(document);let s=a.getBoundingClientRect();Object.assign(n.style,{display:"block",left:`${s.left}px`,top:`${s.top}px`,width:`${s.width}px`,height:`${s.height}px`})},rt=r=>{let a=r.target;if(!a||o.contains(a))return;r.preventDefault(),r.stopPropagation(),nt(),t=a,m=U(a,document);let s=q(m,a,document);N=s,u(s?"\u2713 Selected \u2014 matches exactly 1 element":"\u26A0 Couldn\u2019t target this element uniquely",s);for(let x of[g,S,L,H])x.disabled=!1;g.disabled=!s,S.disabled=!s,L.disabled=!s;let c=F(a,document);B=c.prevEl,A=c.nextEl,b=c.prevLocator,y=c.nextLocator,C.disabled=!s||!b,w.disabled=!s||!y};g.onclick=()=>{var s,c;if(!t||!m)return;let r=m,a=(c=(s=t.textContent)==null?void 0:s.trim())!=null?c:"";J([{key:"current",label:"Current wording",value:a},{key:"alt",label:"Alternative wording to test",value:""}],"Save draft",async x=>{let D=Y("text",r,t);u("Saving\u2026");let h=await W(e,`/v1/editor/slots/${encodeURIComponent(D)}`,{kind:"arms",target:r,draftConfig:{arms:[{id:"a",displayName:"Original",ops:{text:x.current}},{id:"b",displayName:"Alternative",ops:{text:x.alt}}]}});h==="ok"&&T(),_(h,"\u2713 Saved as a draft \u2014 publish it from your dashboard.")})},L.onclick=()=>{if(!t||!m)return;let r=m;J([{key:"goal",label:"Goal name",value:"demo_requested"}],"Save goal",async a=>{let s=a.goal.trim();if(!s){u("\u26A0 Enter a goal name.",!1);return}u("Saving\u2026");let c=await W(e,`/v1/editor/goals/${encodeURIComponent(s)}`,{event:"click",locator:r});c==="ok"&&T(),_(c,"\u2713 Goal saved as a draft.")})},S.onclick=()=>{if(!t||!m)return;let r=m;J([{key:"color",label:"Text colour (e.g. #1a1a1a)",value:""},{key:"background",label:"Background colour",value:""},{key:"fontSize",label:"Font size (e.g. 20px)",value:""},{key:"fontWeight",label:"Font weight (e.g. 700)",value:""},{key:"borderRadius",label:"Corner radius (e.g. 8px)",value:""},{key:"textAlign",label:"Alignment (left/center/right)",value:""}],"Save draft",async a=>{let s=mt(a);if(Object.keys(s).length===0){u("\u26A0 Enter at least one style change.",!1);return}let c=Y("style",r,t);u("Saving\u2026");let x=await W(e,`/v1/editor/slots/${encodeURIComponent(c)}`,{kind:"arms",target:r,draftConfig:{arms:[{id:"a",displayName:"Current look",ops:{}},{id:"b",displayName:"New look",ops:{style:s}}]}});x==="ok"&&T(),_(x,"\u2713 Saved as a draft \u2014 publish it from your dashboard.")})};let it=r=>{if(!t)return;let a=t.parentElement;if(!a)return;k||(I=a,O=t.nextSibling,k=!0),r==="up"&&B?a.insertBefore(t,B):r==="down"&&A&&a.insertBefore(t,A.nextSibling);let s=F(t,document);B=s.prevEl,A=s.nextEl,b=s.prevLocator,y=s.nextLocator,X(!0),u("Previewing the new position \u2014 keep moving, save, or undo.")};C.onclick=()=>it("up"),w.onclick=()=>it("down"),R.onclick=()=>{nt(),u("Move undone \u2014 back to the original position.")},M.onclick=async()=>{if(!t||!m||!k||!N)return;let r=b?"moveAfter":"moveBefore",a=b!=null?b:y;if(!a){u("\u26A0 Couldn\u2019t anchor the new position \u2014 nudge it next to a section with an id.",!1);return}let s=Y("move",m,t);u("Saving\u2026");let c=await W(e,`/v1/editor/slots/${encodeURIComponent(s)}`,{kind:"arms",target:m,draftConfig:{arms:[{id:"a",ops:{}},{id:"b",ops:{[r]:a}}]}});c==="ok"&&(k=!1,I=null,O=null,X(!1)),_(c,"\u2713 Saved as a draft \u2014 publish it from your dashboard.")};let ht=()=>{document.removeEventListener("mousemove",ot,!0),document.removeEventListener("click",rt,!0),K(document),n.remove(),o.remove(),tt()};H.onclick=ht,document.addEventListener("mousemove",ot,!0),document.addEventListener("click",rt,!0)}function v(e){return{display:"block",width:"100%",marginTop:"8px",padding:"8px 10px",borderRadius:"8px",border:"none",background:e,color:"#fff",font:"13px system-ui, sans-serif",cursor:"pointer",textAlign:"left"}}async function Pt(){if(typeof document=="undefined")return;let e=_t();if(!e)return;let t=await Nt(e);if(!t.ok){t.unauthorized?(tt(),ut(Ht)):ut(zt);return}if(document.getElementById(E))return;gt(e);let n=await Ot(e);ft(n,document)}Pt();return Ct(jt);})();
23
+ `,((t=document.head)!=null?t:document.documentElement).appendChild(e)}function Bt(e){var r;It(),(r=document.getElementById(tt))==null||r.remove();let t=l("div",{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483647",maxWidth:"320px",padding:"14px 16px",borderRadius:"14px",background:"#111827",color:"#fff",font:"13px/1.45 system-ui, sans-serif",border:"1px solid rgba(245,158,11,0.6)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)",display:"flex",gap:"10px",alignItems:"flex-start",cursor:"pointer"});t.id=tt;let n=l("span",{width:"9px",height:"9px",marginTop:"4px",borderRadius:"50%",background:"#f59e0b",flex:"0 0 auto"});t.append(n,l("div",{},e)),document.body.appendChild(t),t.addEventListener("click",()=>t.remove()),setTimeout(()=>t.remove(),1e4)}function ee(){let e=window.__sentientEditor;return e&&typeof e.token=="string"&&typeof e.apiBase=="string"?e:null}async function ne(e){try{let t=await fetch(`${e.apiBase}/v1/editor/verify`,{headers:{authorization:`Bearer ${e.token}`}});if(t.status===401)return{ok:!1,unauthorized:!0};if(!t.ok)return{ok:!1,unauthorized:!1};let n=(await t.json()).projectId;return n?{ok:!0,projectId:n}:{ok:!1,unauthorized:!1}}catch(t){return{ok:!1,unauthorized:!1}}}async function T(e,t,n){try{let r=await fetch(`${e.apiBase}${t}`,{method:"POST",headers:{authorization:`Bearer ${e.token}`,"content-type":"application/json"},body:JSON.stringify(n)});return r.ok?"ok":r.status===401?"expired":"error"}catch(r){return"error"}}async function oe(e){try{let t=await fetch(`${e.apiBase}/v1/editor/targets`,{headers:{authorization:`Bearer ${e.token}`}});if(!t.ok)return[];let n=await t.json();return Array.isArray(n.targets)?n.targets:[]}catch(t){return[]}}function et(e=document){for(let t of Array.from(e.querySelectorAll(`.${pt}`)))t.remove()}function At(e,t=document){et(t);let n=0;for(let r of e){if(n>=Zt)break;let a=J(r.locator,t);if(!a)continue;let d=a.getBoundingClientRect(),p=l("div",{position:"fixed",pointerEvents:"none",zIndex:"2147483645",left:`${d.left}px`,top:`${d.top}px`,width:`${d.width}px`,height:`${d.height}px`,border:"2px dashed #10b981",background:"rgba(16,185,129,0.08)"});p.className=pt;let b=l("div",{position:"fixed",pointerEvents:"none",zIndex:"2147483645",left:`${d.left}px`,top:`${Math.max(0,d.top-20)}px`,padding:"2px 6px",borderRadius:"4px",background:"#10b981",color:"#fff",font:"11px system-ui, sans-serif",whiteSpace:"nowrap"},r.label);b.className=pt,t.body.append(p,b),n+=1}}function Q(e,t){let n=e.previousElementSibling,r=e.nextElementSibling,a=n?P(n,t):null,d=r?P(r,t):null;return{prevEl:n,nextEl:r,prevLocator:n&&a&&K(a,n,t)?a:null,nextLocator:r&&d&&K(d,r,t)?d:null}}function re(e){return e.length>0&&!/[;{}<>]/.test(e)}function Mt(e){let t={};for(let n of["color","background","fontSize","fontWeight","borderRadius","textAlign"]){let r=e[n];typeof r=="string"&&re(r.trim())&&(t[n]=r.trim())}return t}function l(e,t,n){let r=document.createElement(e);return Object.assign(r.style,t),n!==void 0&&(r.textContent=n),r}function Rt(e){let t=null,n=l("div",{position:"fixed",pointerEvents:"none",zIndex:"2147483646",border:"2px solid #6366f1",background:"rgba(99,102,241,0.12)",display:"none"});n.id=Kt;let r=l("div",{position:"fixed",pointerEvents:"none",zIndex:"2147483646",border:"2px solid #10b981",background:"rgba(16,185,129,0.10)",borderRadius:"4px",display:"none"});r.id=Xt;let a=()=>{if(!t||!t.isConnected){r.style.display="none";return}let o=t.getBoundingClientRect();Object.assign(r.style,{display:"block",left:`${o.left-2}px`,top:`${o.top-2}px`,width:`${o.width}px`,height:`${o.height}px`})},d=()=>a();It();let p=l("div",{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483647",width:"320px",padding:"16px",borderRadius:"14px",background:"#111827",color:"#fff",font:"13px/1.4 system-ui, sans-serif",border:"1px solid rgba(99,102,241,0.55)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)"});p.id=B;let b=l("span",{width:"9px",height:"9px",borderRadius:"50%",background:"#34d399",display:"inline-block",flex:"0 0 auto"});b.className="sntedi-dot";let h=l("div",{display:"flex",alignItems:"center",gap:"8px",fontWeight:"700",fontSize:"14px",marginBottom:"6px"});h.append(b,l("span",{},"SentientUI editor"));let Ht=l("div",{opacity:"0.85",marginBottom:"8px"},"Click any element on the page to adapt it."),nt=l("div",{fontSize:"12px",marginBottom:"6px",padding:"5px 8px",borderRadius:"8px",background:"rgba(16,185,129,0.14)",border:"1px solid rgba(16,185,129,0.45)",display:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),ot=l("div",{fontSize:"12px",marginBottom:"8px",minHeight:"16px"}),rt=o=>l("div",{fontSize:"10px",letterSpacing:"0.08em",textTransform:"uppercase",opacity:"0.55",marginTop:"10px",marginBottom:"2px"},o),$=l("button",g("#6366f1"),"Test different text here"),I=l("button",g("#374151"),"Change style"),A=l("button",g("#374151"),"Track clicks as a goal"),M=l("button",g("#374151"),"Track form submissions as a goal"),ft=l("button",g("#374151"),"Track page visits as a goal"),y=l("button",g("#374151"),"Move up"),k=l("button",g("#374151"),"Move down"),D=l("button",g("#6366f1"),"Save this arrangement"),G=l("button",g("#374151"),"Undo"),gt=l("button",ct(_({},g("transparent")),{opacity:"0.6"}),"Close editor"),E=l("button",g("#10b981"),"Publish now \u2014 go live"),w=l("button",g("#10b981"),"Start tracking now");for(let o of[$,I,A,y,k])o.disabled=!0;let mt=[$,I,A,M,y,k];for(let o of mt)o.style.display="none";D.style.display="none",G.style.display="none",E.style.display="none",w.style.display="none",p.append(h,Ht,nt,ot,rt("Content & style"),$,I,rt("Track a goal"),A,M,ft,rt("Move"),y,k,D,G,E,w,gt),document.body.append(n,r,p);let j=l("div",{marginTop:"10px"});p.append(j);let R=()=>{j.textContent=""},bt=(o,i,s)=>{R();let u={};for(let v of o){let dt=l("label",{display:"block",fontSize:"12px",opacity:"0.85",marginTop:"8px"},v.label),V=l("input",{display:"block",width:"100%",marginTop:"4px",padding:"7px 9px",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.18)",background:"#1f2937",color:"#fff",font:"13px system-ui, sans-serif"});V.setAttribute("data-field",v.key),v.value!==void 0&&(V.value=v.value),u[v.key]=V,j.append(dt,V)}let f=l("button",g("#6366f1"),i),C=l("button",ct(_({},g("transparent")),{opacity:"0.6"}),"Cancel");f.onclick=()=>s(Object.fromEntries(Object.entries(u).map(([v,dt])=>[v,dt.value]))),C.onclick=R,j.append(f,C)},c=(o,i=!0)=>{ot.textContent=o,ot.style.color=i?"#a7f3d0":"#fca5a5"},U=(o,i)=>{o==="ok"?c(i,!0):c(o==="expired"?"Editor session expired \u2014 reopen it from your dashboard to save this. Your earlier changes are safe.":"\u26A0 Couldn\u2019t save \u2014 try again.",!1)},q=null,it=o=>{q=o,E.style.display="block"};E.onclick=async()=>{if(!q)return;E.disabled=!0,c("Publishing\u2026");let o=await T(e,`/v1/editor/slots/${encodeURIComponent(q)}/publish`,{});E.disabled=!1,o==="ok"?(c("\u2713 Published \u2014 live for new visitors.",!0),E.style.display="none",q=null):c(o==="expired"?"Editor session expired \u2014 reopen it from your dashboard to publish. Your saved draft is safe.":"\u26A0 Couldn\u2019t publish \u2014 try again.",!1)};let m=null,H=!1,z=null,N=null,x=null,L=null,O=null,W=null,S=!1,vt=(o,i)=>H?o?"":`Nothing to swap with ${i} \u2014 it\u2019s at the edge, or that neighbor can\u2019t be targeted reliably.`:"This element can\u2019t be targeted reliably, so it can\u2019t be moved.",xt=()=>{y.disabled=!H||!x,k.disabled=!H||!L,y.title=y.disabled?vt(x,"above"):"",k.title=k.disabled?vt(L,"below"):""},st=o=>{D.style.display=o?"block":"none",G.style.display=o?"block":"none",xt()},ht=()=>{if(S&&t&&O&&O.insertBefore(t,W),S=!1,O=null,W=null,t){let o=Q(t,document);z=o.prevEl,N=o.nextEl,x=o.prevLocator,L=o.nextLocator}a(),st(!1)},yt=o=>{let i=o.target;if(!i||p.contains(i)||i===n)return;et(document);let s=i.getBoundingClientRect();Object.assign(n.style,{display:"block",left:`${s.left}px`,top:`${s.top}px`,width:`${s.width}px`,height:`${s.height}px`})},zt=o=>{var s;let i=((s=o.textContent)!=null?s:"").trim().replace(/\s+/g," ");return i?i.length>40?`${i.slice(0,37)}\u2026`:i:o.tagName.toLowerCase()},kt=o=>{let i=o.target;if(!i||p.contains(i))return;o.preventDefault(),o.stopPropagation(),ht(),R(),t=i,m=P(i,document);let s=K(m,i,document);H=s,a(),nt.style.display="block",nt.textContent=`Selected: ${zt(i)}`,c(s?"\u2713 Matches exactly 1 element":"\u26A0 Couldn\u2019t target this element uniquely",s);for(let C of mt)C.style.display="block";$.disabled=!s,I.disabled=!s,A.disabled=!s;let u=i.closest("form");M.style.display=u?"block":"none",M.disabled=!u;let f=Q(i,document);z=f.prevEl,N=f.nextEl,x=f.prevLocator,L=f.nextLocator,xt()};$.onclick=()=>{var s,u;if(!t||!m)return;let o=m,i=(u=(s=t.textContent)==null?void 0:s.trim())!=null?u:"";bt([{key:"current",label:"Current wording",value:i},{key:"alt",label:"Alternative wording to test",value:""}],"Save draft",async f=>{let C=Z("text",o,t);c("Saving\u2026");let v=await T(e,`/v1/editor/slots/${encodeURIComponent(C)}`,{kind:"arms",target:o,draftConfig:{arms:[{id:"a",displayName:"Original",ops:{text:f.current}},{id:"b",displayName:"Alternative",ops:{text:f.alt}}]}});v==="ok"&&(R(),it(C)),U(v,"\u2713 Saved as a draft. Click \u201CPublish now\u201D to go live.")})};let Y=null,Nt=o=>{Y=o,w.style.display="block"};w.onclick=async()=>{if(!Y)return;w.disabled=!0,c("Activating\u2026");let o=await T(e,`/v1/editor/goals/${encodeURIComponent(Y)}/publish`,{});w.disabled=!1,o==="ok"?(c("\u2713 Tracking is live \u2014 it counts from your next visitor.",!0),w.style.display="none",Y=null):c(o==="expired"?"Editor session expired \u2014 reopen it from your dashboard to activate. Your saved goal is safe.":"\u26A0 Couldn\u2019t activate \u2014 try again.",!1)};let at=(o,i)=>`${X(o)||"goal"}-${$t(i)}`.slice(0,128),lt=async(o,i)=>{c("Saving\u2026");let s=await T(e,`/v1/editor/goals/${encodeURIComponent(o)}`,i);s==="ok"&&Nt(o),U(s,"\u2713 Goal saved. Click \u201CStart tracking now\u201D to go live.")};A.onclick=()=>{var i;if(!t||!m)return;let o=at(((i=t.textContent)!=null?i:"").trim()||"element-clicked",JSON.stringify(m));lt(o,{event:"click",locator:m})},M.onclick=()=>{var u,f;let o=t==null?void 0:t.closest("form");if(!o)return;let i=P(o,document),s=(f=(u=o.getAttribute("id"))!=null?u:o.getAttribute("name"))!=null?f:"form-submitted";lt(at(s,JSON.stringify(i)),{event:"form_submit",locator:i})},ft.onclick=()=>{let o=window.location.pathname||"/",i=X(o)?`reached-${X(o)}`:"page-visited";lt(at(i,o),{event:"url_reached",urlPattern:o})},I.onclick=()=>{if(!t||!m)return;let o=m;bt([{key:"color",label:"Text colour (e.g. #1a1a1a)",value:""},{key:"background",label:"Background colour",value:""},{key:"fontSize",label:"Font size (e.g. 20px)",value:""},{key:"fontWeight",label:"Font weight (e.g. 700)",value:""},{key:"borderRadius",label:"Corner radius (e.g. 8px)",value:""},{key:"textAlign",label:"Alignment (left/center/right)",value:""}],"Save draft",async i=>{let s=Mt(i);if(Object.keys(s).length===0){c("\u26A0 Enter at least one style change.",!1);return}let u=Z("style",o,t);c("Saving\u2026");let f=await T(e,`/v1/editor/slots/${encodeURIComponent(u)}`,{kind:"arms",target:o,draftConfig:{arms:[{id:"a",displayName:"Current look",ops:{}},{id:"b",displayName:"New look",ops:{style:s}}]}});f==="ok"&&(R(),it(u)),U(f,"\u2713 Saved as a draft. Click \u201CPublish now\u201D to go live.")})};let Et=o=>{if(!t)return;let i=t.parentElement;if(!i)return;S||(O=i,W=t.nextSibling,S=!0),o==="up"&&z?i.insertBefore(t,z):o==="down"&&N&&i.insertBefore(t,N.nextSibling);let s=Q(t,document);z=s.prevEl,N=s.nextEl,x=s.prevLocator,L=s.nextLocator;try{t.scrollIntoView({block:"nearest",behavior:"smooth"})}catch(u){}a(),st(!0),c("Previewing the new position \u2014 keep moving, save, or undo.")};y.onclick=()=>Et("up"),k.onclick=()=>Et("down"),G.onclick=()=>{ht(),c("Move undone \u2014 back to the original position.")},D.onclick=async()=>{if(!t||!m||!S||!H)return;let o=x?"moveAfter":"moveBefore",i=x!=null?x:L;if(!i){c("\u26A0 Couldn\u2019t anchor the new position \u2014 nudge it next to a section with an id.",!1);return}let s=Z("move",m,t);c("Saving\u2026");let u=await T(e,`/v1/editor/slots/${encodeURIComponent(s)}`,{kind:"arms",target:m,draftConfig:{arms:[{id:"a",ops:{}},{id:"b",ops:{[o]:i}}]}});u==="ok"&&(S=!1,O=null,W=null,st(!1),it(s)),U(u,"\u2713 Saved as a draft. Click \u201CPublish now\u201D to go live.")};let Ot=()=>{document.removeEventListener("mousemove",yt,!0),document.removeEventListener("click",kt,!0),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d),et(document),n.remove(),r.remove(),p.remove(),ut()};gt.onclick=Ot,document.addEventListener("mousemove",yt,!0),document.addEventListener("click",kt,!0),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d)}function g(e){return{display:"block",width:"100%",marginTop:"8px",padding:"8px 10px",borderRadius:"8px",border:"none",background:e,color:"#fff",font:"13px system-ui, sans-serif",cursor:"pointer",textAlign:"left"}}async function ie(){if(typeof document=="undefined")return;let e=ee();if(!e)return;let t=await ne(e);if(!t.ok){t.unauthorized?(ut(),Bt(Qt)):Bt(te);return}if(document.getElementById(B))return;Rt(e);let n=await oe(e);At(n,document)}ie();return Wt(se);})();
@@ -1,2 +1,2 @@
1
- "use strict";var SentientSnippet=(()=>{var pe=Object.defineProperty;var Ut=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames,He=Object.getOwnPropertySymbols;var Xe=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable;var Ye=(e,t,n)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ge=(e,t)=>{for(var n in t||(t={}))Xe.call(t,n)&&Ye(e,n,t[n]);if(He)for(var n of He(t))qt.call(t,n)&&Ye(e,n,t[n]);return e};var Ze=(e,t)=>()=>(e&&(t=e(e=0)),t);var Qe=(e,t)=>{for(var n in t)pe(e,n,{get:t[n],enumerable:!0})},Wt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Gt(t))!Xe.call(e,o)&&o!==n&&pe(e,o,{get:()=>t[o],enumerable:!(r=Ut(t,o))||r.enumerable});return e};var Jt=e=>Wt(pe({},"__esModule",{value:!0}),e);var zt,Vt,Ft,et,Ht,Yt,tt,x,ue,re=Ze(()=>{"use strict";zt=Object.defineProperty,Vt=Object.defineProperties,Ft=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,tt=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,x=(e,t)=>{for(var n in t||(t={}))Ht.call(t,n)&&tt(e,n,t[n]);if(et)for(var n of et(t))Yt.call(t,n)&&tt(e,n,t[n]);return e},ue=(e,t)=>Vt(e,Ft(t))});var st={};Qe(st,{LOCAL_ENGINE_AVAILABLE:()=>Xt,createLocalEngine:()=>Zt});function Zt(e){throw new Error("[sentient] createLocalEngine is not available in production builds. The local engine only exists under the `development` export condition.")}var Xt,at=Ze(()=>{"use strict";re();Xt=!1});var Wn={};Qe(Wn,{applyPersonaAttributes:()=>Ae,applyRegistrySlots:()=>Ee,applySlotArms:()=>Oe,applySlotAttributes:()=>Ie,parseEditorToken:()=>$t,parsePreview:()=>Kt,parseSnippetConfig:()=>xe,reapply:()=>ze,run:()=>Bt,version:()=>Nt});re();function me(e){return Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("|")}function nt(e){if(e.length===0)return null;let t={};for(let n of e.split("|")){let r=n.indexOf("=");if(r<=0||r!==n.lastIndexOf("=")||r===n.length-1)return null;let o=n.slice(0,r);if(o in t)return null;t[o]=n.slice(r+1)}return t}function Re(e){var t,n,r;if(e.arms)return typeof e.baseline=="string"?e.baseline:(t=e.arms[0])!=null?t:"";if(e.baseline!==void 0&&typeof e.baseline=="object")return me(e.baseline);if(typeof e.baseline=="string")return e.baseline;let o={};for(let[i,a]of Object.entries((n=e.dims)!=null?n:{}))o[i]=(r=a[0])!=null?r:"";return me(o)}function rt(e,t){var n,r;return e.dims!=null?(r=(n=nt(t))!=null?n:nt(Re(e)))!=null?r:{}:t}function Q(e){return e>=.3?e<.7?"medium":"high":"low"}var ot=["GPTBot","ChatGPT-User","OAI-SearchBot","ClaudeBot","Claude-User","Claude-SearchBot","PerplexityBot","Perplexity-User","Google-Extended","Applebot-Extended","Meta-ExternalAgent","Bytespider","CCBot","Amazonbot","cohere-ai","Diffbot"];function Le(e){return it(e)!==null}function it(e){var t;if(!e)return null;let n=e.toLowerCase();return(t=ot.find(r=>n.includes(r.toLowerCase())))!=null?t:null}function Te(e){let t=e.toLowerCase();return/ipad|tablet|playbook|kindle|silk/.test(t)?"tablet":/mobi|iphone|ipod|android.*mobile|phone/.test(t)?"mobile":"desktop"}function Pe(e,t){if(!e)return"direct";try{let n=new URL(e);if(t)try{if(new URL(t).host===n.host)return"direct"}catch(o){}let r=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(r)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(r)?"social":"referral"}catch(n){return"direct"}}function De(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}function je(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function he(e){return x(x(x({id:e.id},e.arms?{arms:[...e.arms]}:{}),e.dims?{dims:Object.fromEntries(Object.entries(e.dims).map(([t,n])=>[t,[...n]]))}:{}),e.baseline!==void 0?{baseline:e.baseline}:{})}function ye(e){let t=he(e);return rt(t,Re(t))}function Me(e){return typeof e=="string"?e:me(e)}re();var Qt="_snt_uid",oe="_snt_uid";function en(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(t){}let e=()=>Math.floor(Math.random()*4294967295).toString(16).padStart(8,"0");return`${e()}-${e()}-${e()}-${e()}`}function tn(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function nn(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=strict; path=/`}catch(r){}}function rn(e){try{return localStorage.getItem(e)}catch(t){return null}}function on(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function sn(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function an(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function ln(e){try{sessionStorage.removeItem(e)}catch(t){}}function cn(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=strict; path=/`,/(?:^|; )_snt_uid_probe=1/.test(document.cookie)||document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function un(e){try{localStorage.removeItem(e)}catch(t){}}function dn(e){try{document.cookie=`${e}=; max-age=0; SameSite=strict; path=/`}catch(t){}}var fn={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function ut(e){var t,n,r,o,i,a;if(typeof window=="undefined")return fn;let l=(t=e==null?void 0:e.cookieName)!=null?t:Qt,s=((n=e==null?void 0:e.cookieTTLDays)!=null?n:365)*24*60*60,c=(a=(i=(o=(r=tn(l))!=null?r:rn(oe))!=null?o:sn(oe))!=null?i:e==null?void 0:e.ssrSessionId)!=null?a:en();nn(l,c,s);let f=on(oe,c),d=cn(l),S=f?!1:an(oe,c),g=!f&&!d&&!S;return{getSessionId:()=>c,isEphemeral:()=>g,destroy:()=>{c=null,dn(l),un(oe),ln(oe)}}}function dt(e){return`_snt_retry_${e.slice(0,12)}`}var pn={push:()=>{},flush:()=>{},destroy:()=>{}};function gn(e,t){try{let n=localStorage.getItem(t);if(!n)return[];let r=JSON.parse(n);return Array.isArray(r)?(localStorage.removeItem(t),r.slice(-e)):[]}catch(n){return[]}}function Ne(e,t,n){try{let r=[...(()=>{try{let o=localStorage.getItem(n);if(!o)return[];let i=JSON.parse(o);return Array.isArray(i)?i:[]}catch(o){return[]}})(),...e].slice(-t);localStorage.setItem(n,JSON.stringify(r))}catch(r){}}function mn(e){var t,n,r;if(typeof window=="undefined")return pn;let o=(t=e.flushIntervalMs)!=null?t:5e3,i=(n=e.maxBatchSize)!=null?n:20,a=(r=e.maxRetrySize)!=null?r:100,l=e.ingestUrl,s=e.apiKey,c=dt(s),f=[],d=new Set,S=[],g=p=>{for(let v of p)m.delete(v),!d.has(v)&&(d.add(v),S.push(v));for(;S.length>500;){let v=S.shift();v&&d.delete(v)}},m=new Set,b=p=>{d.has(p.id)||m.has(p.id)||(m.add(p.id),f.push(p))},I=gn(a,c);for(let p of I)b(p);let O=0,E=0,N=p=>{if(p.length===0)return;let v=JSON.stringify(p),k=p.map(u=>u.id),$;try{$=fetch(l,{method:"POST",keepalive:!0,body:v,headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`}})}catch(u){Ne(p,a,c);for(let h of k)m.delete(h);E++,O=Date.now()+Math.min(6e4,1e3*2**Math.min(E,6));return}let W=u=>{if(u.ok||u.status>=400&&u.status<500&&u.status!==429){g(k),E=0,O=0;return}Ne(p,a,c);for(let h of k)m.delete(h);E++,O=Date.now()+Math.min(6e4,1e3*2**Math.min(E,6))};$ instanceof Promise?$.then(W).catch(()=>{Ne(p,a,c);for(let u of k)m.delete(u);E++,O=Date.now()+Math.min(6e4,1e3*2**Math.min(E,6))}):W($)},G=typeof TextEncoder!="undefined"?new TextEncoder:null,H=p=>G?G.encode(p).length:p.length,Y=p=>{let v=[],k=2;for(let $ of p){let W=H(JSON.stringify($))+1;if(v.length>0&&k+W>57344||v.length>=i)break;v.push($),k+=W}return v},C=()=>{try{if(Date.now()<O)return;for(;f.length>0;){let p=f.filter(k=>!d.has(k.id));if(f.length=0,p.length===0)break;let v=Y(p);if(v.length===0)break;v.length<p.length&&f.push(...p.slice(v.length)),N(v)}}catch(p){}},j=!0,R=null;R=setInterval(()=>{j&&C()},o);let y=()=>{document.visibilityState==="hidden"&&C()},w=()=>{C()};return document.addEventListener("visibilitychange",y),window.addEventListener("beforeunload",w),{push(p){b(p),f.length>=i&&C()},flush:C,destroy(){j=!1,R!==null&&(clearInterval(R),R=null),document.removeEventListener("visibilitychange",y),window.removeEventListener("beforeunload",w),C()}}}var Ue="_snt_asgn_";function ve(e,t){return`${e}:${t}`}function hn(e,t){return`${Ue}${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function lt(e){let t=e.slice(Ue.length),n=t.indexOf(":");if(n<0)return null;try{return{componentId:decodeURIComponent(t.slice(0,n)),segment:decodeURIComponent(t.slice(n+1))}}catch(r){return null}}function $e(){try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n!=null&&n.startsWith(Ue)&&e.push(n)}return e}catch(e){return[]}}function yn(e=18e5){let t=new Map,n=r=>r.assignedAt+e<Date.now();return typeof window!="undefined"&&(()=>{for(let r of $e())try{let o=localStorage.getItem(r);if(!o)continue;let i=JSON.parse(o);if(n(i)){localStorage.removeItem(r);continue}let a=lt(r);if(!a)continue;t.set(ve(a.componentId,a.segment),i)}catch(o){}})(),{get(r,o){let i=t.get(ve(r,o));return i?n(i)?(t.delete(ve(r,o)),null):i:null},set(r,o,i){let a=ve(r,o);t.set(a,i);try{localStorage.setItem(hn(r,o),JSON.stringify(i))}catch(l){}},invalidate(r){let o=`${r}:`;for(let i of[...t.keys()])i.startsWith(o)&&t.delete(i);for(let i of $e()){let a=lt(i);if((a==null?void 0:a.componentId)===r)try{localStorage.removeItem(i)}catch(l){}}},clear(){t.clear();for(let r of $e())try{localStorage.removeItem(r)}catch(o){}}}}var we="_snt_snap:",vn=["low","medium","high"];function Se(e){try{let t=localStorage.getItem(we+e);if(!t)return null;let n=JSON.parse(t);return!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!vn.includes(n.band)||typeof n.slots!="object"||n.slots===null||Array.isArray(n.slots)||!(n.layoutOrder===null||Array.isArray(n.layoutOrder))||typeof n.savedAt!="number"||!(n.slotConfig===void 0||typeof n.slotConfig=="object"&&n.slotConfig!==null&&!Array.isArray(n.slotConfig))?null:n}catch(t){return null}}function de(e,t){try{localStorage.setItem(we+e,JSON.stringify(t))}catch(n){}}var Be="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",ft="[sentient] Local mode \u2014 decisions are simulated on-device and nothing is sent over the network. Add an API key to learn from real traffic.",ct=!1,be=!1;function bn(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function wn(e){var t;let n=ut({ssrSessionId:e.ssrSessionId}),r=(t=n.getSessionId())!=null?t:"local",o=bn(),i=Promise.resolve().then(()=>(at(),st)).then(s=>{let c=s;return c.LOCAL_ENGINE_AVAILABLE?(ct||(ct=!0,console.info(ft)),c):(be||(be=!0,console.error(Be)),null)}).catch(()=>(be||(be=!0,console.error(Be)),null)),a=null;function l(s){let c=document.documentElement;c.dataset.sentientPersona===void 0&&(c.dataset.sentientPersona=s.persona,c.dataset.sentientConfidence=Q(s.confidence))}return{isLocal:!0,async decide(s){var c,f,d;let S=await i;if(!S)return null;let g=S.createLocalEngine({sessionId:r,forcedPersona:o}).decide(s);return a=ue(x({},g),{layoutOrder:(f=(c=g.layoutOrder)!=null?c:a==null?void 0:a.layoutOrder)!=null?f:null,slots:x(x({},(d=a==null?void 0:a.slots)!=null?d:{}),g.slots)}),de(e.apiKey||"local",{v:1,persona:a.persona,band:Q(a.confidence),slots:a.slots,layoutOrder:a.layoutOrder,savedAt:Date.now()}),l(g),g},getSlotResult(s){var c,f,d;return(d=(f=a==null?void 0:a.slots[s])!=null?f:(c=e.initialSlots)==null?void 0:c[s])!=null?d:null},getPersona(){return a?{persona:a.persona,confidence:a.confidence,band:Q(a.confidence)}:null},async assign(s,c){var f;let d=await i;return!d||!c||c.length===0?c!=null&&c[0]?{variantId:c[0],assignmentTtlMs:0}:null:{variantId:(f=d.createLocalEngine({sessionId:r,forcedPersona:o}).decide({components:[{id:s,variantIds:c}]}).assignments[s])!=null?f:c[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>n.destroy()}}function Ge(e,t,n){var r;let o=[];{let i=!1,a=[],l=()=>{if(i)return;let s=Date.now();for(a.push(s);a.length>0&&s-a[0]>500;)a.shift();a.length>=3&&(i=!0,e("rage_click"))};t.addEventListener("click",l),o.push(()=>t.removeEventListener("click",l))}{let i=!1,a=l=>{if(i||!(l.target instanceof Node)||!t.contains(l.target)&&t!==l.target)return;i=!0;let s=typeof window!="undefined"?window.getSelection():null,c=s?s.toString().length:0;e("text_copy",{selectionLength:c})};document.addEventListener("copy",a),o.push(()=>document.removeEventListener("copy",a))}{let i=!1,a=!1,l=null,s=()=>{l!==null&&(clearTimeout(l),l=null)},c=()=>{i||!a||(s(),l=setTimeout(()=>{!i&&a&&(i=!0,e("scroll_hesitation"))},3e3))},f=()=>{s(),c()},d=g=>{for(let m of g)a=m.intersectionRatio>.3,a?c():s()};typeof process!="undefined"&&((r=process.env)==null?void 0:r.NODE_ENV)!=="production"&&(window.__lastIOCallback=d);let S=new IntersectionObserver(d,{threshold:[.3]});S.observe(t),window.addEventListener("scroll",f,{passive:!0}),o.push(()=>{S.disconnect(),window.removeEventListener("scroll",f),s()})}{let i=!1,a=n!=null?n:Date.now(),l=()=>{if(i||document.visibilityState!=="hidden")return;let s=Date.now()-a;s<15e3&&(i=!0,e("tab_loss",{timeOnPage:s}))};document.addEventListener("visibilitychange",l),o.push(()=>document.removeEventListener("visibilitychange",l))}return()=>{for(let i of o)i()}}var pt="https://api.sentient-ui.com/v1/events",ee=new Map,gt=null;function Ke(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(e){}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var ie={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,assign:()=>Promise.resolve(null),decide:()=>Promise.resolve(null),getSlotResult:()=>null,getPersona:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>{}};function Sn(){try{let e={},t=new URLSearchParams(window.location.search);for(let[n,r]of t)n.startsWith("utm_")&&(e[n]=r);return e}catch(e){return{}}}function mt(e){return e.replace(/\/events\/?$/,"")}function te(){return typeof navigator!="undefined"&&navigator.globalPrivacyControl===!0?!0:[typeof navigator!="undefined"?navigator.doNotTrack:void 0,typeof window!="undefined"?window.doNotTrack:void 0,typeof navigator!="undefined"?navigator.msDoNotTrack:void 0].some(e=>e==="1"||e==="yes")}function qe(e){if(typeof window=="undefined")return;let t=e!=null?e:gt;if(!t){console.warn("[sentient] grantConsent() called before init()");return}let n=ee.get(t);if(!n){console.warn("[sentient] grantConsent() called before init()");return}let{config:r,upgrade:o}=n;if(!o||r.respectDoNotTrack!==!1&&te())return;let i=ke(ue(x({},r),{consent:!0}));o(i),ee.set(t,{config:ue(x({},r),{consent:!0}),upgrade:null})}function kn(e){var t;let n=mt((t=e.ingestUrl)!=null?t:pt),r={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},o={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),async assign(l,s,c){try{let f=new URLSearchParams({componentId:l});for(let S of s!=null?s:[])f.append("variantIds[]",S);let d=await fetch(`${n}/winner?${f.toString()}`,{headers:r});return d.ok?{variantId:(await d.json()).variantId,assignmentTtlMs:0}:s!=null&&s[0]?{variantId:s[0],assignmentTtlMs:0}:null}catch(f){return s!=null&&s[0]?{variantId:s[0],assignmentTtlMs:0}:null}},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getPersona:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>{}},i={track:l=>o.track(l),goal:(l,s,c,f)=>o.goal(l,s,c,f),componentGoal:(l,s,c)=>o.componentGoal(l,s,c),identify:l=>o.identify(l),getAssignment:(l,s)=>o.getAssignment(l,s),assign:(l,s,c,f)=>o.assign(l,s,c,f),decide:l=>o.decide(l),getSlotResult:l=>o.getSlotResult(l),getPersona:()=>o.getPersona(),fetchWeights:()=>o.fetchWeights(),getGraph:()=>o.getGraph(),dispose:()=>o.dispose(),destroy:()=>o.destroy()};function a(l){o=l}return{proxy:i,setInner:a}}function ke(e){var t,n,r,o,i,a,l,s,c;if(typeof window=="undefined")return ie;gt=e.apiKey;let f=e.respectDoNotTrack!==!1&&te(),d=e.consent===!1||f,S=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!S&&e.localMode!==!1)return d?(ee.set(e.apiKey||"local",{config:e,upgrade:null}),ie):(ee.set(e.apiKey||"local",{config:e,upgrade:null}),wn(e));if(d){if(e.preConsentBehavior==="statistical_winner"){if(!e.apiKey||!e.apiKey.startsWith("pk_"))return console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),ie;let{proxy:u,setInner:h}=kn(e);return ee.set(e.apiKey,{config:e,upgrade:f?null:h}),u}return ee.set(e.apiKey,{config:e,upgrade:null}),ie}if(!e.apiKey||!e.apiKey.startsWith("pk_"))return console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),ie;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),ie;let g=(t=e.ingestUrl)!=null?t:pt,m=Date.now(),b=ut({ssrSessionId:e.ssrSessionId}),I=yn(),O=mn({ingestUrl:g,apiKey:e.apiKey}),E=mt(g),N={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},G=Te((n=navigator.userAgent)!=null?n:""),H=typeof window!="undefined"?window.location.origin:void 0,Y=Pe((r=document.referrer)!=null?r:"",H),C=(o=e.sessionSegment)!=null?o:`${G}:${Y}`,j=new Map,R=new Map,y=null,w=u=>{for(let h of u)R.has(h.id)||R.set(h.id,ye(h))};if(e.initialSlots)for(let[u,h]of Object.entries(e.initialSlots))R.set(u,h);let p=Se(e.apiKey);if(p)for(let[u,h]of Object.entries(p.slots))R.has(u)||R.set(u,h);let v={low:.15,medium:.5,high:.85};if(e.initialPersona)y=x({},e.initialPersona);else{let u=document.documentElement.dataset;u.sentientPersona?y={persona:u.sentientPersona,confidence:(a=v[(i=u.sentientConfidence)!=null?i:"low"])!=null?a:.15}:p&&(y={persona:p.persona,confidence:(l=v[p.band])!=null?l:.15})}if(e.initialAssignments)for(let[u,h]of Object.entries(e.initialAssignments))I.set(u,C,{variantId:h,assignedAt:Date.now(),segment:C,confidence:1});let k=Promise.resolve(),$=b.getSessionId();if($){let u=De((s=document.referrer)!=null?s:""),h=x(x({sessionId:$,deviceClass:G,trafficSource:Y,referrerDomain:u,utmParams:Sn(),timeOfDay:je(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:b.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Le((c=navigator.userAgent)!=null?c:"")},e.userId?{userId:e.userId}:{}),e.country?{country:e.country}:{});try{k=fetch(`${E}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(h),headers:N}).then(_=>{_.status===402&&console.warn("[SentientUI] Session limit exceeded for this project. The bandit will stop learning until the limit resets. Upgrade at sentient-ui.com/pricing")}).catch(()=>{})}catch(_){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:O});let W={goal(u,h={},_=1,K=0){let M=b.getSessionId();if(!M)return;let P=Ke();k.then(()=>{fetch(`${E}/goals`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:M,name:u,metadata:h,weight:_,stepIndex:K,goalId:P}),headers:N}).catch(()=>{})})},componentGoal(u,h,_){var K,M,P;let J=b.getSessionId();if(!J)return;let B=I.get(u,C),U=B?null:(K=R.get(u))!=null?K:null;if(!B&&U===null){e.debug&&console.warn(`[sentient] componentGoal("${u}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}let X=B?B.variantId:Me(U),q={id:Ke(),sessionId:J,projectId:e.apiKey,componentId:u,variantId:X,eventType:"goal_achieved",goalType:h,payload:x({reward:(M=_==null?void 0:_.reward)!=null?M:1},(P=_==null?void 0:_.metadata)!=null?P:{}),timestamp:Date.now(),timeInSession:Date.now()-m};e.debug&&console.log("[sentient] componentGoal",q),k.then(()=>O.push(q))},identify(u){let h=b.getSessionId();h&&k.then(()=>{fetch(`${E}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:h,userId:u,ephemeral:b.isEphemeral()}),headers:N}).catch(()=>{})})},track(u){let h=b.getSessionId();if(!h)return;let _=ue(x({},u),{id:Ke(),sessionId:h,timestamp:Date.now(),timeInSession:Date.now()-m});e.debug&&console.log("[sentient] track",_),k.then(()=>O.push(_))},getAssignment(u,h){return I.get(u,h)},async assign(u,h,_,K){let M=b.getSessionId();if(!M)return null;let P=I.get(u,C);if(P&&(h!=null&&h.length||P.content!==void 0))return{variantId:P.variantId,assignmentTtlMs:0,content:P.content};let J=j.get(u);if(J)return J;let B=(async()=>{await k;try{let U={sessionId:M,componentId:u,variantIds:h};K!==void 0?U.agentDataByVariant=K:_!==void 0&&(U.agentData=_);let X=await fetch(`${E}/assign`,{method:"POST",body:JSON.stringify(U),headers:N});if(!X.ok)return null;let q=await X.json();return I.set(u,C,{variantId:q.variantId,assignedAt:Date.now(),segment:C,confidence:1,content:q.content}),q}catch(U){return null}finally{j.delete(u)}})();return j.set(u,B),B},async decide(u){var h,_,K,M,P,J,B,U,X,q;let Ve=b.getSessionId();if(!Ve)return null;let ae=(h=u.slots)!=null?h:[];await k;try{let Z={sessionId:Ve};u.sections&&u.sections.length>0&&(Z.sections=u.sections.map(D=>({id:D}))),Z.components=(_=u.components)!=null?_:[],ae.length>0&&(Z.slots=ae.map(he)),u.slotsFrom==="registry"&&(Z.slotsFrom="registry"),u.v&&(Z.v=u.v);let Fe=await fetch(`${E}/decide`,{method:"POST",body:JSON.stringify(Z),headers:N});if(!Fe.ok)return w(ae),null;let L=await Fe.json(),le={};for(let D of ae)le[D.id]=(M=(K=L.slots)==null?void 0:K[D.id])!=null?M:ye(D);if(L.slots)for(let[D,ce]of Object.entries(L.slots))D in le||(le[D]=ce);for(let[D,ce]of Object.entries(le))R.set(D,ce);y={persona:(P=L.persona)!=null?P:"unknown",confidence:(J=L.confidence)!=null?J:0};for(let[D,ce]of Object.entries((B=L.assignments)!=null?B:{}))I.set(D,C,{variantId:ce,assignedAt:Date.now(),segment:C,confidence:1});return de(e.apiKey,x({v:1,persona:y.persona,band:Q(y.confidence),slots:Object.fromEntries(R),layoutOrder:(U=L.layoutOrder)!=null?U:null,savedAt:Date.now()},L.slotConfig?{slotConfig:L.slotConfig}:{})),x(x({layoutOrder:(X=L.layoutOrder)!=null?X:null,assignments:(q=L.assignments)!=null?q:{},slots:le,persona:y.persona,confidence:y.confidence},L.slotConfig?{slotConfig:L.slotConfig}:{}),L.goals?{goals:L.goals}:{})}catch(Z){return w(ae),null}},getSlotResult(u){var h;return(h=R.get(u))!=null?h:null},getPersona(){return y?{persona:y.persona,confidence:y.confidence,band:Q(y.confidence)}:null},async fetchWeights(){var u;try{let h=await fetch(`${E}/weights`,{headers:N});return h.ok?(u=(await h.json()).components)!=null?u:[]:[]}catch(h){return[]}},getGraph(){return{pageNodes:[],capturedAt:0}},dispose(){O.destroy(),e.debug&&console.log("[sentient] disposed")},destroy(){O.destroy(),b.destroy();try{localStorage.removeItem(we+e.apiKey),localStorage.removeItem(dt(e.apiKey))}catch(u){}e.debug&&console.log("[sentient] destroyed")}};if(ee.set(e.apiKey,{config:e,upgrade:null}),e.debug){let u=window;u.__sentient&&(u.__sentient.client=W)}return W}re();var ht=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],xn=[["pricing",/\b(pricing|price|plans?|subscriptions?|per month|\/mo|tier)\b/i],["faq",/\b(faq|frequently asked|common questions?)\b/i],["comparison",/\b(compare|comparison|versus|vs\.)\b/i],["social_proof",/\b(testimonial|reviews?|trusted by|loved by|customers?|logos|rated|case stud)\b/i],["trust",/\b(security|guarantee|privacy|compliance|secure|gdpr|soc ?2|encrypt)\b/i],["features",/\b(features?|how it works|benefits?|capabilit|what you get)\b/i]],An=[["pricing",/(?:[$€£]\s?\d[\d,.]*\s*(?:\/|per\s)\s*(?:mo|month|yr|year|seat|user))|(?:\b(?:starter|basic|pro|growth|premium|enterprise)\b[^.]{0,60}[$€£]\s?\d)/i],["social_proof",/(?:★{2,})|(?:\b\d(?:\.\d)?\s*(?:out of|\/)\s*5\b)|(?:\brated\b)|(?:["“][^"”]{20,160}["”]\s*[—–-]\s*[A-Z][a-z]+)/],["trust",/\b(?:money[- ]back guarantee|refund(?:s)? within|encrypted|soc ?2|iso ?27001|gdpr[- ]compliant|cancel anytime)\b/i],["comparison",/\b(?:vs|versus)\b\.?[^.!?]{0,80}\b(?:compare|comparison|plans?|features?|alternative)\b|\bhow (?:we|it) compares?\b/i]];function In(e){var t;let n=e.querySelector("h1, h2, h3");return((t=n==null?void 0:n.textContent)!=null?t:"").slice(0,160)}function yt(e){if(e.tag==="nav"||e.tag==="footer")return{type:"navigation",strength:"weak"};let t=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[n,r]of xn)if(r.test(t))return{type:n,strength:"strong"};for(let[n,r]of An)if(r.test(e.bodyText))return{type:n,strength:"strong"};return e.actionCount>=1&&e.textLength>0&&e.textLength<200?{type:"cta",strength:"weak"}:e.tag==="header"?{type:"hero",strength:"weak"}:/\b(hero|headline|banner)\b/i.test(t)?{type:"hero",strength:"weak"}:{type:"generic",strength:"weak"}}function vt(e){var t,n;let r=((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim();return{tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((n=e.className)!=null?n:"")}`,headingText:In(e),bodyText:r.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:r.length}}function bt(e){return yt(vt(e)).type}re();var St="section, header, footer, nav, main > div, [data-sentient-section]";function On(e){var t;return((t=e.parentElement)==null?void 0:t.closest(St))!=null}function En(e,t,n,r){try{fetch(`${t}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({pageUrl:n,sections:r})}).catch(()=>{})}catch(o){}}var wt=()=>{};function kt(e,t){var n,r,o,i,a,l,s,c,f;let d=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!d||typeof IntersectionObserver=="undefined"||te()||!t.apiKey)return wt;let S=(r=t.apiBase)!=null?r:"https://api.sentient-ui.com",g=Array.from(d.querySelectorAll(St)).filter(y=>!On(y));if(g.length===0)return wt;let m=new Map,b=new Map,I=new Map;for(let y of g){let w=y.getAttribute("data-sentient-type"),p=w&&ht.includes(w)?w:null,v=(i=p!=null?p:(o=t.typeOf)==null?void 0:o.call(t,y))!=null?i:bt(y),k=`nc-${v}`;m.set(y,k),b.set(k,v),p?I.set(k,"markup"):I.has(k)||I.set(k,"auto")}let O=(c=(s=(l=(a=d.defaultView)!=null?a:typeof window!="undefined"?window:void 0)==null?void 0:l.location)==null?void 0:s.pathname)!=null?c:"/";En(t.apiKey,S,O,[...b.entries()].map(([y,w])=>{var p;return{componentId:y,semanticType:w,source:(p=I.get(y))!=null?p:"auto"}}));let E=new Map,N=y=>{let w=E.get(y);return w||(w={ms:0,scroll:0,enterAt:null,intersecting:!1},E.set(y,w)),w},G=new IntersectionObserver(y=>{for(let w of y){let p=m.get(w.target);if(!p)continue;let v=N(p);w.isIntersecting?(v.intersecting=!0,v.enterAt=Date.now(),w.intersectionRatio>v.scroll&&(v.scroll=w.intersectionRatio)):(v.intersecting=!1,v.enterAt!=null&&(v.ms+=Date.now()-v.enterAt,v.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let y of m.keys())G.observe(y);let H=()=>{let y=Date.now();for(let[w,p]of E)if(p.enterAt!=null&&(p.ms+=y-p.enterAt,p.enterAt=null),!(p.ms<=0)){try{e.track({projectId:t.apiKey,componentId:w,eventType:"dwell",payload:{dwell_time:Math.round(p.ms),scroll_depth:Number(p.scroll.toFixed(2))}})}catch(v){}p.ms=0}},Y=()=>{if(d.hidden)H();else{let y=Date.now();for(let w of E.values())w.intersecting&&(w.enterAt=y)}},C=()=>{H();try{G.disconnect()}catch(y){}};d.addEventListener("visibilitychange",Y);let j=(f=d.defaultView)!=null?f:typeof window!="undefined"?window:void 0;j==null||j.addEventListener("pagehide",C);let R=[];if(t.microSignals)for(let[y,w]of m)R.push(Ge((p,v={})=>{try{e.track({projectId:t.apiKey,componentId:w,eventType:"micro_signal",payload:x({signalType:p},v)})}catch(k){}},y));return()=>{H(),d.removeEventListener("visibilitychange",Y),j==null||j.removeEventListener("pagehide",C);for(let y of R)y();try{G.disconnect()}catch(y){}}}var Cn=["landing","ecommerce","saas","marketplace"];function _n(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=Object.entries(e);if(t.length<1||t.length>4)return null;let n={};for(let[r,o]of t){if(!Array.isArray(o)||o.length<2||o.length>6||!o.every(i=>typeof i=="string"))return null;n[r]=o}return n}function Rn(e){return!Array.isArray(e)||e.length<2||e.length>12||!e.every(t=>typeof t=="string")?null:e}function xe(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.apiKey!="string"||!t.apiKey.startsWith("pk_"))return null;let n=Cn.includes(t.context)?t.context:"landing",r={};if(typeof t.slots=="object"&&t.slots!==null&&!Array.isArray(t.slots))for(let[i,a]of Object.entries(t.slots)){if(typeof a!="object"||a===null)continue;let l=a,s=_n(l.dims);if(!s||l.target!==void 0&&typeof l.target!="string")continue;let c=l.arms!==void 0?Rn(l.arms):null,f={dims:s};typeof l.target=="string"&&(f.target=l.target),c&&(f.arms=c),r[i]=f}let o={apiKey:t.apiKey,context:n,personaAttributes:t.personaAttributes===!0,slots:r};return typeof t.consent=="boolean"&&(o.consent=t.consent),(t.preConsentBehavior==="statistical_winner"||t.preConsentBehavior==="control")&&(o.preConsentBehavior=t.preConsentBehavior),t.debug===!0&&(o.debug=!0),typeof t.registry=="boolean"&&(o.registry=t.registry),typeof t.editorSrc=="string"&&(o.editorSrc=t.editorSrc),typeof t.apiBase=="string"&&(o.apiBase=t.apiBase),typeof t.sectionCapture=="boolean"&&(o.sectionCapture=t.sectionCapture),o}function xt(e){var n,r,o;let t=(r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0)==null?void 0:r.location;return(o=t==null?void 0:t.pathname)!=null?o:""}function Ln(e,t){var n;if(t.tag&&e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;if(t.text){let r=((n=e.textContent)!=null?n:"").trim().toLowerCase(),o=t.text.trim().toLowerCase();if(!(r===o||r.startsWith(o)||o.startsWith(r)))return!1}return!0}function At(e,t){return!!(e!=null&&e.urlMatch)&&!xt(t).includes(e.urlMatch)}function z(e,t){var o;if(e.urlMatch&&!xt(t).includes(e.urlMatch))return null;let n=[];if(e.id){let i=t.getElementById(e.id);n=i?[i]:[]}if(n.length===0&&((o=e.dataAttr)!=null&&o.name))try{let i=e.dataAttr.value.replace(/["\\]/g,"\\$&");n=Array.from(t.querySelectorAll(`[${e.dataAttr.name}="${i}"]`))}catch(i){n=[]}if(n.length===0&&e.selector)try{n=Array.from(t.querySelectorAll(e.selector))}catch(i){n=[]}if(n.length!==1)return null;let r=n[0];return e.fingerprint&&!Ln(r,e.fingerprint)?null:r}var It=/^https:\/\//i,Tn={color:"color",background:"background",fontSize:"font-size",fontWeight:"font-weight",textAlign:"text-align",padding:"padding",margin:"margin",borderRadius:"border-radius",width:"width",height:"height",maxWidth:"max-width",border:"border",boxShadow:"box-shadow",opacity:"opacity",lineHeight:"line-height",letterSpacing:"letter-spacing",textTransform:"text-transform",gap:"gap"};function Pn(e){return!/[;{}<>]/.test(e)}var Ot=new Map,V=null;function Dn(e){return e.replace(/["\\]/g,"\\$&")}function jn(e){var t;(!V||!V.isConnected)&&(V=e.querySelector("style[data-sentient-ops]"),V||(V=e.createElement("style"),V.setAttribute("data-sentient-ops",""),((t=e.head)!=null?t:e.documentElement).appendChild(V))),V.textContent=[...Ot.entries()].map(([n,r])=>`[data-snt-e="${Dn(n)}"]{${r}}`).join(`
2
- `)}function Et(e,t,n,r){var l;let o=!1,i=(l=t.moveBefore)!=null?l:t.moveAfter;if(i){let s=z(i,r);!s||s===e||s.parentElement!==e.parentElement||!e.parentElement?o=!0:t.moveBefore?e.parentElement.insertBefore(e,s):e.parentElement.insertBefore(e,s.nextSibling)}typeof t.text=="string"&&(e.textContent=t.text),typeof t.href=="string"&&It.test(t.href)&&e.setAttribute("href",t.href),typeof t.imageSrc=="string"&&It.test(t.imageSrc)&&e.setAttribute("src",t.imageSrc),typeof t.imageAlt=="string"&&e.setAttribute("alt",t.imageAlt);let a=[];if(t.hidden&&a.push("display:none !important"),t.style)for(let[s,c]of Object.entries(t.style)){let f=Tn[s];f&&typeof c=="string"&&Pn(c)&&a.push(`${f}:${c.trim()} !important`)}return a.length>0&&(e.setAttribute("data-snt-e",n),Ot.set(n,a.join(";")),jn(r)),{anchorMiss:o}}function Ae(e,t,n){n.documentElement.setAttribute("data-sentient-persona",e),n.documentElement.setAttribute("data-sentient-confidence",t)}function Ie(e,t,n){var r;for(let[o,i]of Object.entries(t)){let a=e[o];if(!a||typeof a=="string")continue;let l=i.target?Array.from(n.querySelectorAll(i.target)):[n.documentElement];for(let s of l)for(let[c,f]of Object.entries(a))(r=i.dims[c])!=null&&r.includes(f)&&s.setAttribute(`data-${c}`,f)}}function Oe(e,t,n){for(let[r,o]of Object.entries(t)){let i=e[r];if(typeof i!="string"||!o.arms||!o.arms.includes(i))continue;let a=o.target?Array.from(n.querySelectorAll(o.target)):[n.documentElement];for(let l of a)l.setAttribute("data-sentient-arm",i)}}function Ee(e,t,n,r){var a;let o=(a=r==null?void 0:r.contentAndOps)!=null?a:!0,i=[];for(let[l,s]of Object.entries(t)){if(At(s.locator,n))continue;let c;if(s.locator){let d=z(s.locator,n);c=d?[d]:[]}else s.target?c=Array.from(n.querySelectorAll(s.target)):c=[n.documentElement];(s.locator||s.target)&&c.length===0&&i.push(l);let f=e[l];for(let d of c){if(f!==void 0)if(typeof f=="string")d.setAttribute("data-sentient-arm",f);else for(let[S,g]of Object.entries(f))d.setAttribute(`data-${S}`,g);o&&(typeof s.content=="string"&&(d.textContent=s.content),s.ops&&Et(d,s.ops,l,n).anchorMiss&&!i.includes(l)&&i.push(l))}}return i}function Mn(e){var n,r,o;let t=(r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0)==null?void 0:r.location;return(o=t==null?void 0:t.pathname)!=null?o:""}function Ct(e,t,n){var S;let r=new Set,o=g=>{if(!r.has(g.goalId)){r.add(g.goalId);try{g.slotId?t.componentGoal(g.slotId,g.goalId):t.goal(g.goalId)}catch(m){}}},i=e.filter(g=>g.event==="click"),a=e.filter(g=>g.event==="form_submit"),l=e.filter(g=>g.event==="url_reached"),s=(g,m)=>{if(!g.locator)return!1;let b=z(g.locator,n);return!!b&&(b===m||b.contains(m))},c=g=>{let m=g.target;if(!(!m||typeof m.closest!="function"))for(let b of i)s(b,m)&&o(b)},f=g=>{let m=g.target;if(m)for(let b of a)s(b,m)&&o(b)},d=()=>{if(l.length===0)return;let g=Mn(n);for(let m of l)m.urlPattern&&g.includes(m.urlPattern)&&o(m)};return n.addEventListener("click",c,!0),n.addEventListener("submit",f,!0),(S=n.defaultView)==null||S.addEventListener("popstate",d),d(),{checkUrl:d,teardown:()=>{var g;n.removeEventListener("click",c,!0),n.removeEventListener("submit",f,!0),(g=n.defaultView)==null||g.removeEventListener("popstate",d)}}}var _t="__snt_editor_token";function Rt(){try{return typeof sessionStorage!="undefined"?sessionStorage.getItem(_t):null}catch(e){return null}}function Lt(e){try{sessionStorage.setItem(_t,e)}catch(t){}}var Nt="0.8.1",Nn=5e3,$n=50,fe=null,T=null,F={},se=null,ne=null,A=null,Tt=!1,We=null;function Kn(e,t){return Promise.race([e,new Promise(n=>setTimeout(()=>n(null),t))])}function Ce(e,...t){e!=null&&e.debug&&console.log("[sentient-snippet]",...t)}function _e(e,t){return fe?(fe.personaAttributes&&A&&Ae(A.persona,A.band,e),Ie(F,fe.slots,e),Oe(F,fe.slots,e),se?Ee(F,se,e,t):[]):[]}function Bn(e,t){var n;if(t.length!==0)try{let r=(n=e.apiBase)!=null?n:"https://api.sentient-ui.com";fetch(`${r}/v1/locator-miss`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e.apiKey}`},body:JSON.stringify({slots:t})}).catch(()=>{})}catch(r){}}function ze(){try{_e(document)}catch(e){}}function Pt(){We===null&&(We=setTimeout(()=>{We=null,ze();try{ne==null||ne.checkUrl()}catch(e){}},$n))}function Dt(){if(!(Tt||typeof window=="undefined"||typeof history=="undefined")){Tt=!0;try{let e=t=>{let n=history[t];history[t]=function(r,o,i){let a=n.call(this,r,o,i!=null?i:null);return Pt(),a}};e("pushState"),e("replaceState"),window.addEventListener("popstate",Pt)}catch(e){}}}function Je(e){let t={};for(let[n,r]of Object.entries(e.slots))t[n]=r.target?document.querySelectorAll(r.target).length:1;return t}function $t(e){return new URLSearchParams(e).get("sentient_editor")}function Un(){try{let t=Array.from(document.getElementsByTagName("script")).find(n=>/snippet(\.global)?\.js/.test(n.src));if(t!=null&&t.src)return t.src.replace(/snippet(\.global)?\.js/,"editor.global.js")}catch(e){}return null}function Gn(e,t){var n,r,o,i;try{window.__sentientEditor={token:t,apiBase:(n=e.apiBase)!=null?n:"https://api.sentient-ui.com"};try{let s=document.createElement("meta");s.name="referrer",s.content="no-referrer",((r=document.head)!=null?r:document.documentElement).appendChild(s)}catch(s){}let a=(o=e.editorSrc)!=null?o:Un();if(!a){Mt();return}let l=document.createElement("script");l.src=a,l.async=!0,l.onerror=()=>Mt(),((i=document.head)!=null?i:document.documentElement).appendChild(l)}catch(a){}}var jt="sentient-editor-load-notice";function Mt(){var e;try{if(typeof document=="undefined"||document.getElementById(jt))return;let t=document.createElement("div");t.id=jt,t.textContent="Couldn\u2019t load the editor \u2014 check your connection and reopen it from your dashboard.",Object.assign(t.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483647",maxWidth:"320px",padding:"14px 16px",borderRadius:"14px",background:"#111827",color:"#fff",font:"13px/1.45 system-ui, sans-serif",border:"1px solid rgba(245,158,11,0.6)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)",cursor:"pointer"}),t.addEventListener("click",()=>t.remove()),((e=document.body)!=null?e:document.documentElement).appendChild(t),setTimeout(()=>t.remove(),1e4)}catch(t){}}function Kt(e){let t=new URLSearchParams(e).get("sentient_preview");if(!t)return null;let n={};for(let r of t.split("|")){let[o,i]=r.split(":");if(!(!o||!i))if(i.includes("=")){let a={};for(let l of i.split(",")){let[s,c]=l.split("=");s&&c&&(a[s]=c)}Object.keys(a).length&&(n[o]=a)}else n[o]=i}return Object.keys(n).length?n:null}function qn(e){let t={goal(n,r){try{T==null||T.goal(n,r)}catch(o){}},componentGoal(n,r){try{T==null||T.componentGoal(n,r)}catch(o){}},grantConsent(){try{qe(e.apiKey)}catch(n){}},revokeConsent(){try{T==null||T.destroy()}catch(n){}},reapply:ze,getState(){var n,r;return{apiKey:e.apiKey,persona:(n=A==null?void 0:A.persona)!=null?n:null,band:(r=A==null?void 0:A.band)!=null?r:null,slots:F,matchCounts:Je(e),consent:e.consent!==!1}}};window.SentientSnippet=t}async function Bt(){var e,t,n;try{let r=xe(window.sentient);if(!r)return;fe=r;let o=typeof window!="undefined"?$t(window.location.search):null;if(o){Lt(o);try{let m=new URL(window.location.href);m.searchParams.delete("sentient_editor"),window.history.replaceState(null,"",m.pathname+m.search+m.hash)}catch(m){}}let i=o!=null?o:Rt();if(i){Gn(r,i),Ce(r,"editor mode");return}let a=typeof window!="undefined"?Kt(window.location.search):null;if(a){F=a,A=null,_e(document),Dt(),Ce(r,"preview mode",a);return}let l=(e=r.registry)!=null?e:Object.keys(r.slots).length===0,s=Se(r.apiKey);s&&(A={persona:s.persona,band:s.band},F=s.slots,s.slotConfig&&(se=s.slotConfig),_e(document,{contentAndOps:!1}));let c=ke({apiKey:r.apiKey,context:r.context,consent:r.consent,preConsentBehavior:r.preConsentBehavior,debug:r.debug});T=c,qn(r),Dt();let f=Object.entries(r.slots).map(([m,b])=>({id:m,dims:b.dims})),d=await Kn(c.decide(ge({slots:f,v:Nt},l?{slotsFrom:"registry"}:{})),Nn);if(!d){Ce(r,"decide timeout/null \u2014 snapshot state stands",Je(r));return}let S=c.getPersona();if(S?A={persona:S.persona,band:S.band}:d.persona&&(A={persona:d.persona,band:"low"}),F=d.slots,d.slotConfig&&(se=d.slotConfig),Bn(r,_e(document)),d.goals&&d.goals.length>0&&r.consent!==!1&&T)try{ne==null||ne.teardown(),ne=Ct(d.goals,T,document)}catch(m){}let g;try{let m=d.sectionMap;if(m&&m.length>0){let b=new Map;for(let I of m){if(I.urlMatch!==window.location.pathname)continue;let O=z(I.locator,document);O&&b.set(O,I.type)}b.size>0&&(g=I=>{var O;return(O=b.get(I))!=null?O:null})}}catch(m){}if(r.sectionCapture!==!1&&r.consent!==!1&&T&&!te())try{kt(T,ge({apiKey:r.apiKey,apiBase:r.apiBase,doc:document,microSignals:!0},g?{typeOf:g}:{}))}catch(m){}Ce(r,"applied",{persona:A,slots:F,matches:Je(r)}),de(r.apiKey,ge({v:1,persona:(t=A==null?void 0:A.persona)!=null?t:d.persona,band:(n=A==null?void 0:A.band)!=null?n:"low",slots:d.slots,layoutOrder:d.layoutOrder,savedAt:Date.now()},se?{slotConfig:se}:{}))}catch(r){}}typeof window!="undefined"&&window.sentient&&Bt();return Jt(Wn);})();
1
+ "use strict";var SentientSnippet=(()=>{var me=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames,He=Object.getOwnPropertySymbols;var Xe=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable;var Ye=(e,t,n)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,he=(e,t)=>{for(var n in t||(t={}))Xe.call(t,n)&&Ye(e,n,t[n]);if(He)for(var n of He(t))Ft.call(t,n)&&Ye(e,n,t[n]);return e};var Ze=(e,t)=>()=>(e&&(t=e(e=0)),t);var Qe=(e,t)=>{for(var n in t)me(e,n,{get:t[n],enumerable:!0})},Ht=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vt(t))!Xe.call(e,o)&&o!==n&&me(e,o,{get:()=>t[o],enumerable:!(r=Jt(t,o))||r.enumerable});return e};var Yt=e=>Ht(me({},"__esModule",{value:!0}),e);var Xt,Zt,Qt,et,en,tn,tt,I,de,oe=Ze(()=>{"use strict";Xt=Object.defineProperty,Zt=Object.defineProperties,Qt=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,en=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable,tt=(e,t,n)=>t in e?Xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t)=>{for(var n in t||(t={}))en.call(t,n)&&tt(e,n,t[n]);if(et)for(var n of et(t))tn.call(t,n)&&tt(e,n,t[n]);return e},de=(e,t)=>Zt(e,Qt(t))});var st={};Qe(st,{LOCAL_ENGINE_AVAILABLE:()=>nn,createLocalEngine:()=>rn});function rn(e){throw new Error("[sentient] createLocalEngine is not available in production builds. The local engine only exists under the `development` export condition.")}var nn,at=Ze(()=>{"use strict";oe();nn=!1});var Fn={};Qe(Fn,{applyPersonaAttributes:()=>Oe,applyRegistrySlots:()=>_e,applySlotArms:()=>Ce,applySlotAttributes:()=>Ie,parseEditorToken:()=>Ut,parsePersonaPreview:()=>qt,parsePreview:()=>Gt,parseSnippetConfig:()=>Ee,reapply:()=>Je,run:()=>zt,version:()=>$t});oe();function ye(e){return Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("|")}function nt(e){if(e.length===0)return null;let t={};for(let n of e.split("|")){let r=n.indexOf("=");if(r<=0||r!==n.lastIndexOf("=")||r===n.length-1)return null;let o=n.slice(0,r);if(o in t)return null;t[o]=n.slice(r+1)}return t}function Pe(e){var t,n,r;if(e.arms)return typeof e.baseline=="string"?e.baseline:(t=e.arms[0])!=null?t:"";if(e.baseline!==void 0&&typeof e.baseline=="object")return ye(e.baseline);if(typeof e.baseline=="string")return e.baseline;let o={};for(let[i,s]of Object.entries((n=e.dims)!=null?n:{}))o[i]=(r=s[0])!=null?r:"";return ye(o)}function rt(e,t){var n,r;return e.dims!=null?(r=(n=nt(t))!=null?n:nt(Pe(e)))!=null?r:{}:t}function Q(e){return e>=.3?e<.7?"medium":"high":"low"}var ot=["GPTBot","ChatGPT-User","OAI-SearchBot","ClaudeBot","Claude-User","Claude-SearchBot","PerplexityBot","Perplexity-User","Google-Extended","Applebot-Extended","Meta-ExternalAgent","Bytespider","CCBot","Amazonbot","cohere-ai","Diffbot"];function Re(e){return it(e)!==null}function it(e){var t;if(!e)return null;let n=e.toLowerCase();return(t=ot.find(r=>n.includes(r.toLowerCase())))!=null?t:null}function Le(e){let t=e.toLowerCase();return/ipad|tablet|playbook|kindle|silk/.test(t)?"tablet":/mobi|iphone|ipod|android.*mobile|phone/.test(t)?"mobile":"desktop"}function Te(e,t){if(!e)return"direct";try{let n=new URL(e);if(t)try{if(new URL(t).host===n.host)return"direct"}catch(o){}let r=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(r)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(r)?"social":"referral"}catch(n){return"direct"}}function De(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}function je(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function be(e){return I(I(I({id:e.id},e.arms?{arms:[...e.arms]}:{}),e.dims?{dims:Object.fromEntries(Object.entries(e.dims).map(([t,n])=>[t,[...n]]))}:{}),e.baseline!==void 0?{baseline:e.baseline}:{})}function ve(e){let t=be(e);return rt(t,Pe(t))}function Ne(e){return typeof e=="string"?e:ye(e)}oe();var on="_snt_uid",ie="_snt_uid";function sn(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(t){}let e=()=>Math.floor(Math.random()*4294967295).toString(16).padStart(8,"0");return`${e()}-${e()}-${e()}-${e()}`}function an(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function ln(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=strict; path=/`}catch(r){}}function cn(e){try{return localStorage.getItem(e)}catch(t){return null}}function un(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function dn(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function fn(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function pn(e){try{sessionStorage.removeItem(e)}catch(t){}}function gn(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=strict; path=/`,/(?:^|; )_snt_uid_probe=1/.test(document.cookie)||document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function mn(e){try{localStorage.removeItem(e)}catch(t){}}function hn(e){try{document.cookie=`${e}=; max-age=0; SameSite=strict; path=/`}catch(t){}}var yn={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function ut(e){var t,n,r,o,i,s;if(typeof window=="undefined")return yn;let l=(t=e==null?void 0:e.cookieName)!=null?t:on,a=((n=e==null?void 0:e.cookieTTLDays)!=null?n:365)*24*60*60,c=(s=(i=(o=(r=an(l))!=null?r:cn(ie))!=null?o:dn(ie))!=null?i:e==null?void 0:e.ssrSessionId)!=null?s:sn();ln(l,c,a);let d=un(ie,c),p=gn(l),b=d?!1:fn(ie,c),g=!d&&!p&&!b;return{getSessionId:()=>c,isEphemeral:()=>g,destroy:()=>{c=null,hn(l),mn(ie),pn(ie)}}}function dt(e){return`_snt_retry_${e.slice(0,12)}`}var bn={push:()=>{},flush:()=>{},destroy:()=>{}};function vn(e,t){try{let n=localStorage.getItem(t);if(!n)return[];let r=JSON.parse(n);return Array.isArray(r)?(localStorage.removeItem(t),r.slice(-e)):[]}catch(n){return[]}}function Me(e,t,n){try{let r=[...(()=>{try{let o=localStorage.getItem(n);if(!o)return[];let i=JSON.parse(o);return Array.isArray(i)?i:[]}catch(o){return[]}})(),...e].slice(-t);localStorage.setItem(n,JSON.stringify(r))}catch(r){}}function wn(e){var t,n,r;if(typeof window=="undefined")return bn;let o=(t=e.flushIntervalMs)!=null?t:5e3,i=(n=e.maxBatchSize)!=null?n:20,s=(r=e.maxRetrySize)!=null?r:100,l=e.ingestUrl,a=e.apiKey,c=dt(a),d=[],p=new Set,b=[],g=f=>{for(let w of f)v.delete(w),!p.has(w)&&(p.add(w),b.push(w));for(;b.length>500;){let w=b.shift();w&&p.delete(w)}},v=new Set,m=f=>{p.has(f.id)||v.has(f.id)||(v.add(f.id),d.push(f))},A=vn(s,c);for(let f of A)m(f);let E=0,S=0,T=f=>{if(f.length===0)return;let w=JSON.stringify(f),k=f.map(u=>u.id),$;try{$=fetch(l,{method:"POST",keepalive:!0,body:w,headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`}})}catch(u){Me(f,s,c);for(let h of k)v.delete(h);S++,E=Date.now()+Math.min(6e4,1e3*2**Math.min(S,6));return}let z=u=>{if(u.ok||u.status>=400&&u.status<500&&u.status!==429){g(k),S=0,E=0;return}Me(f,s,c);for(let h of k)v.delete(h);S++,E=Date.now()+Math.min(6e4,1e3*2**Math.min(S,6))};$ instanceof Promise?$.then(z).catch(()=>{Me(f,s,c);for(let u of k)v.delete(u);S++,E=Date.now()+Math.min(6e4,1e3*2**Math.min(S,6))}):z($)},G=typeof TextEncoder!="undefined"?new TextEncoder:null,H=f=>G?G.encode(f).length:f.length,Y=f=>{let w=[],k=2;for(let $ of f){let z=H(JSON.stringify($))+1;if(w.length>0&&k+z>57344||w.length>=i)break;w.push($),k+=z}return w},C=()=>{try{if(Date.now()<E)return;for(;d.length>0;){let f=d.filter(k=>!p.has(k.id));if(d.length=0,f.length===0)break;let w=Y(f);if(w.length===0)break;w.length<f.length&&d.push(...f.slice(w.length)),T(w)}}catch(f){}},N=!0,P=null;P=setInterval(()=>{N&&C()},o);let y=()=>{document.visibilityState==="hidden"&&C()},x=()=>{C()};return document.addEventListener("visibilitychange",y),window.addEventListener("beforeunload",x),{push(f){m(f),d.length>=i&&C()},flush:C,destroy(){N=!1,P!==null&&(clearInterval(P),P=null),document.removeEventListener("visibilitychange",y),window.removeEventListener("beforeunload",x),C()}}}var Ue="_snt_asgn_";function we(e,t){return`${e}:${t}`}function Sn(e,t){return`${Ue}${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function lt(e){let t=e.slice(Ue.length),n=t.indexOf(":");if(n<0)return null;try{return{componentId:decodeURIComponent(t.slice(0,n)),segment:decodeURIComponent(t.slice(n+1))}}catch(r){return null}}function $e(){try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n!=null&&n.startsWith(Ue)&&e.push(n)}return e}catch(e){return[]}}function xn(e=18e5){let t=new Map,n=r=>r.assignedAt+e<Date.now();return typeof window!="undefined"&&(()=>{for(let r of $e())try{let o=localStorage.getItem(r);if(!o)continue;let i=JSON.parse(o);if(n(i)){localStorage.removeItem(r);continue}let s=lt(r);if(!s)continue;t.set(we(s.componentId,s.segment),i)}catch(o){}})(),{get(r,o){let i=t.get(we(r,o));return i?n(i)?(t.delete(we(r,o)),null):i:null},set(r,o,i){let s=we(r,o);t.set(s,i);try{localStorage.setItem(Sn(r,o),JSON.stringify(i))}catch(l){}},invalidate(r){let o=`${r}:`;for(let i of[...t.keys()])i.startsWith(o)&&t.delete(i);for(let i of $e()){let s=lt(i);if((s==null?void 0:s.componentId)===r)try{localStorage.removeItem(i)}catch(l){}}},clear(){t.clear();for(let r of $e())try{localStorage.removeItem(r)}catch(o){}}}}var xe="_snt_snap:",kn=["low","medium","high"];function ke(e){try{let t=localStorage.getItem(xe+e);if(!t)return null;let n=JSON.parse(t);return!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!kn.includes(n.band)||typeof n.slots!="object"||n.slots===null||Array.isArray(n.slots)||!(n.layoutOrder===null||Array.isArray(n.layoutOrder))||typeof n.savedAt!="number"||!(n.slotConfig===void 0||typeof n.slotConfig=="object"&&n.slotConfig!==null&&!Array.isArray(n.slotConfig))?null:n}catch(t){return null}}function fe(e,t){try{localStorage.setItem(xe+e,JSON.stringify(t))}catch(n){}}var Ke="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",ft="[sentient] Local mode \u2014 decisions are simulated on-device and nothing is sent over the network. Add an API key to learn from real traffic.",ct=!1,Se=!1;function An(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function En(e){var t;let n=ut({ssrSessionId:e.ssrSessionId}),r=(t=n.getSessionId())!=null?t:"local",o=An(),i=Promise.resolve().then(()=>(at(),st)).then(a=>{let c=a;return c.LOCAL_ENGINE_AVAILABLE?(ct||(ct=!0,console.info(ft)),c):(Se||(Se=!0,console.error(Ke)),null)}).catch(()=>(Se||(Se=!0,console.error(Ke)),null)),s=null;function l(a){let c=document.documentElement;c.dataset.sentientPersona===void 0&&(c.dataset.sentientPersona=a.persona,c.dataset.sentientConfidence=Q(a.confidence))}return{isLocal:!0,async decide(a){var c,d,p;let b=await i;if(!b)return null;let g=b.createLocalEngine({sessionId:r,forcedPersona:o}).decide(a);return s=de(I({},g),{layoutOrder:(d=(c=g.layoutOrder)!=null?c:s==null?void 0:s.layoutOrder)!=null?d:null,slots:I(I({},(p=s==null?void 0:s.slots)!=null?p:{}),g.slots)}),fe(e.apiKey||"local",{v:1,persona:s.persona,band:Q(s.confidence),slots:s.slots,layoutOrder:s.layoutOrder,savedAt:Date.now()}),l(g),g},getSlotResult(a){var c,d,p;return(p=(d=s==null?void 0:s.slots[a])!=null?d:(c=e.initialSlots)==null?void 0:c[a])!=null?p:null},getPersona(){return s?{persona:s.persona,confidence:s.confidence,band:Q(s.confidence)}:null},async assign(a,c){var d;let p=await i;return!p||!c||c.length===0?c!=null&&c[0]?{variantId:c[0],assignmentTtlMs:0}:null:{variantId:(d=p.createLocalEngine({sessionId:r,forcedPersona:o}).decide({components:[{id:a,variantIds:c}]}).assignments[a])!=null?d:c[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>n.destroy()}}function Ge(e,t,n){var r;let o=[];{let i=!1,s=[],l=()=>{if(i)return;let a=Date.now();for(s.push(a);s.length>0&&a-s[0]>500;)s.shift();s.length>=3&&(i=!0,e("rage_click"))};t.addEventListener("click",l),o.push(()=>t.removeEventListener("click",l))}{let i=!1,s=l=>{if(i||!(l.target instanceof Node)||!t.contains(l.target)&&t!==l.target)return;i=!0;let a=typeof window!="undefined"?window.getSelection():null,c=a?a.toString().length:0;e("text_copy",{selectionLength:c})};document.addEventListener("copy",s),o.push(()=>document.removeEventListener("copy",s))}{let i=!1,s=!1,l=null,a=()=>{l!==null&&(clearTimeout(l),l=null)},c=()=>{i||!s||(a(),l=setTimeout(()=>{!i&&s&&(i=!0,e("scroll_hesitation"))},3e3))},d=()=>{a(),c()},p=g=>{for(let v of g)s=v.intersectionRatio>.3,s?c():a()};typeof process!="undefined"&&((r=process.env)==null?void 0:r.NODE_ENV)!=="production"&&(window.__lastIOCallback=p);let b=new IntersectionObserver(p,{threshold:[.3]});b.observe(t),window.addEventListener("scroll",d,{passive:!0}),o.push(()=>{b.disconnect(),window.removeEventListener("scroll",d),a()})}{let i=!1,s=n!=null?n:Date.now(),l=()=>{if(i||document.visibilityState!=="hidden")return;let a=Date.now()-s;a<15e3&&(i=!0,e("tab_loss",{timeOnPage:a}))};document.addEventListener("visibilitychange",l),o.push(()=>document.removeEventListener("visibilitychange",l))}return()=>{for(let i of o)i()}}var pt="https://api.sentient-ui.com/v1/events",ee=new Map,gt=null;function Be(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(e){}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var se={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,assign:()=>Promise.resolve(null),decide:()=>Promise.resolve(null),getSlotResult:()=>null,getPersona:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>{}};function On(){try{let e={},t=new URLSearchParams(window.location.search);for(let[n,r]of t)n.startsWith("utm_")&&(e[n]=r);return e}catch(e){return{}}}function mt(e){return e.replace(/\/events\/?$/,"")}function te(){return typeof navigator!="undefined"&&navigator.globalPrivacyControl===!0?!0:[typeof navigator!="undefined"?navigator.doNotTrack:void 0,typeof window!="undefined"?window.doNotTrack:void 0,typeof navigator!="undefined"?navigator.msDoNotTrack:void 0].some(e=>e==="1"||e==="yes")}function qe(e){if(typeof window=="undefined")return;let t=e!=null?e:gt;if(!t){console.warn("[sentient] grantConsent() called before init()");return}let n=ee.get(t);if(!n){console.warn("[sentient] grantConsent() called before init()");return}let{config:r,upgrade:o}=n;if(!o||r.respectDoNotTrack!==!1&&te())return;let i=Ae(de(I({},r),{consent:!0}));o(i),ee.set(t,{config:de(I({},r),{consent:!0}),upgrade:null})}function In(e){var t;let n=mt((t=e.ingestUrl)!=null?t:pt),r={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},o={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),async assign(l,a,c){try{let d=new URLSearchParams({componentId:l});for(let b of a!=null?a:[])d.append("variantIds[]",b);let p=await fetch(`${n}/winner?${d.toString()}`,{headers:r});return p.ok?{variantId:(await p.json()).variantId,assignmentTtlMs:0}:a!=null&&a[0]?{variantId:a[0],assignmentTtlMs:0}:null}catch(d){return a!=null&&a[0]?{variantId:a[0],assignmentTtlMs:0}:null}},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getPersona:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),dispose:()=>{},destroy:()=>{}},i={track:l=>o.track(l),goal:(l,a,c,d)=>o.goal(l,a,c,d),componentGoal:(l,a,c)=>o.componentGoal(l,a,c),identify:l=>o.identify(l),getAssignment:(l,a)=>o.getAssignment(l,a),assign:(l,a,c,d)=>o.assign(l,a,c,d),decide:l=>o.decide(l),getSlotResult:l=>o.getSlotResult(l),getPersona:()=>o.getPersona(),fetchWeights:()=>o.fetchWeights(),getGraph:()=>o.getGraph(),dispose:()=>o.dispose(),destroy:()=>o.destroy()};function s(l){o=l}return{proxy:i,setInner:s}}function Ae(e){var t,n,r,o,i,s,l,a,c;if(typeof window=="undefined")return se;gt=e.apiKey;let d=e.respectDoNotTrack!==!1&&te(),p=e.consent===!1||d,b=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!b&&e.localMode!==!1)return p?(ee.set(e.apiKey||"local",{config:e,upgrade:null}),se):(ee.set(e.apiKey||"local",{config:e,upgrade:null}),En(e));if(p){if(e.preConsentBehavior==="statistical_winner"){if(!e.apiKey||!e.apiKey.startsWith("pk_"))return console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),se;let{proxy:u,setInner:h}=In(e);return ee.set(e.apiKey,{config:e,upgrade:d?null:h}),u}return ee.set(e.apiKey,{config:e,upgrade:null}),se}if(!e.apiKey||!e.apiKey.startsWith("pk_"))return console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),se;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),se;let g=(t=e.ingestUrl)!=null?t:pt,v=Date.now(),m=ut({ssrSessionId:e.ssrSessionId}),A=xn(),E=wn({ingestUrl:g,apiKey:e.apiKey}),S=mt(g),T={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},G=Le((n=navigator.userAgent)!=null?n:""),H=typeof window!="undefined"?window.location.origin:void 0,Y=Te((r=document.referrer)!=null?r:"",H),C=(o=e.sessionSegment)!=null?o:`${G}:${Y}`,N=new Map,P=new Map,y=null,x=u=>{for(let h of u)P.has(h.id)||P.set(h.id,ve(h))};if(e.initialSlots)for(let[u,h]of Object.entries(e.initialSlots))P.set(u,h);let f=ke(e.apiKey);if(f)for(let[u,h]of Object.entries(f.slots))P.has(u)||P.set(u,h);let w={low:.15,medium:.5,high:.85};if(e.initialPersona)y=I({},e.initialPersona);else{let u=document.documentElement.dataset;u.sentientPersona?y={persona:u.sentientPersona,confidence:(s=w[(i=u.sentientConfidence)!=null?i:"low"])!=null?s:.15}:f&&(y={persona:f.persona,confidence:(l=w[f.band])!=null?l:.15})}if(e.initialAssignments)for(let[u,h]of Object.entries(e.initialAssignments))A.set(u,C,{variantId:h,assignedAt:Date.now(),segment:C,confidence:1});let k=Promise.resolve(),$=m.getSessionId();if($){let u=De((a=document.referrer)!=null?a:""),h=I(I({sessionId:$,deviceClass:G,trafficSource:Y,referrerDomain:u,utmParams:On(),timeOfDay:je(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:m.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Re((c=navigator.userAgent)!=null?c:"")},e.userId?{userId:e.userId}:{}),e.country?{country:e.country}:{});try{k=fetch(`${S}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(h),headers:T}).then(_=>{_.status===402&&console.warn("[SentientUI] Session limit exceeded for this project. The bandit will stop learning until the limit resets. Upgrade at sentient-ui.com/pricing")}).catch(()=>{})}catch(_){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:E});let z={goal(u,h={},_=1,B=0){let M=m.getSessionId();if(!M)return;let D=Be();k.then(()=>{fetch(`${S}/goals`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:M,name:u,metadata:h,weight:_,stepIndex:B,goalId:D}),headers:T}).catch(()=>{})})},componentGoal(u,h,_){var B,M,D;let J=m.getSessionId();if(!J)return;let K=A.get(u,C),U=K?null:(B=P.get(u))!=null?B:null;if(!K&&U===null){e.debug&&console.warn(`[sentient] componentGoal("${u}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}let X=K?K.variantId:Ne(U),q={id:Be(),sessionId:J,projectId:e.apiKey,componentId:u,variantId:X,eventType:"goal_achieved",goalType:h,payload:I({reward:(M=_==null?void 0:_.reward)!=null?M:1},(D=_==null?void 0:_.metadata)!=null?D:{}),timestamp:Date.now(),timeInSession:Date.now()-v};e.debug&&console.log("[sentient] componentGoal",q),k.then(()=>E.push(q))},identify(u){let h=m.getSessionId();h&&k.then(()=>{fetch(`${S}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:h,userId:u,ephemeral:m.isEphemeral()}),headers:T}).catch(()=>{})})},track(u){let h=m.getSessionId();if(!h)return;let _=de(I({},u),{id:Be(),sessionId:h,timestamp:Date.now(),timeInSession:Date.now()-v});e.debug&&console.log("[sentient] track",_),k.then(()=>E.push(_))},getAssignment(u,h){return A.get(u,h)},async assign(u,h,_,B){let M=m.getSessionId();if(!M)return null;let D=A.get(u,C);if(D&&(h!=null&&h.length||D.content!==void 0))return{variantId:D.variantId,assignmentTtlMs:0,content:D.content};let J=N.get(u);if(J)return J;let K=(async()=>{await k;try{let U={sessionId:M,componentId:u,variantIds:h};B!==void 0?U.agentDataByVariant=B:_!==void 0&&(U.agentData=_);let X=await fetch(`${S}/assign`,{method:"POST",body:JSON.stringify(U),headers:T});if(!X.ok)return null;let q=await X.json();return A.set(u,C,{variantId:q.variantId,assignedAt:Date.now(),segment:C,confidence:1,content:q.content}),q}catch(U){return null}finally{N.delete(u)}})();return N.set(u,K),K},async decide(u){var h,_,B,M,D,J,K,U,X,q;let Ve=m.getSessionId();if(!Ve)return null;let le=(h=u.slots)!=null?h:[];await k;try{let Z={sessionId:Ve};u.sections&&u.sections.length>0&&(Z.sections=u.sections.map(j=>({id:j}))),Z.components=(_=u.components)!=null?_:[],le.length>0&&(Z.slots=le.map(be)),u.slotsFrom==="registry"&&(Z.slotsFrom="registry"),u.v&&(Z.v=u.v);let Fe=await fetch(`${S}/decide`,{method:"POST",body:JSON.stringify(Z),headers:T});if(!Fe.ok)return x(le),null;let R=await Fe.json(),ce={};for(let j of le)ce[j.id]=(M=(B=R.slots)==null?void 0:B[j.id])!=null?M:ve(j);if(R.slots)for(let[j,ue]of Object.entries(R.slots))j in ce||(ce[j]=ue);for(let[j,ue]of Object.entries(ce))P.set(j,ue);y={persona:(D=R.persona)!=null?D:"unknown",confidence:(J=R.confidence)!=null?J:0};for(let[j,ue]of Object.entries((K=R.assignments)!=null?K:{}))A.set(j,C,{variantId:ue,assignedAt:Date.now(),segment:C,confidence:1});return fe(e.apiKey,I({v:1,persona:y.persona,band:Q(y.confidence),slots:Object.fromEntries(P),layoutOrder:(U=R.layoutOrder)!=null?U:null,savedAt:Date.now()},R.slotConfig?{slotConfig:R.slotConfig}:{})),I(I({layoutOrder:(X=R.layoutOrder)!=null?X:null,assignments:(q=R.assignments)!=null?q:{},slots:ce,persona:y.persona,confidence:y.confidence},R.slotConfig?{slotConfig:R.slotConfig}:{}),R.goals?{goals:R.goals}:{})}catch(Z){return x(le),null}},getSlotResult(u){var h;return(h=P.get(u))!=null?h:null},getPersona(){return y?{persona:y.persona,confidence:y.confidence,band:Q(y.confidence)}:null},async fetchWeights(){var u;try{let h=await fetch(`${S}/weights`,{headers:T});return h.ok?(u=(await h.json()).components)!=null?u:[]:[]}catch(h){return[]}},getGraph(){return{pageNodes:[],capturedAt:0}},dispose(){E.destroy(),e.debug&&console.log("[sentient] disposed")},destroy(){E.destroy(),m.destroy();try{localStorage.removeItem(xe+e.apiKey),localStorage.removeItem(dt(e.apiKey))}catch(u){}e.debug&&console.log("[sentient] destroyed")}};if(ee.set(e.apiKey,{config:e,upgrade:null}),e.debug){let u=window;u.__sentient&&(u.__sentient.client=z)}return z}oe();var ht=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],Cn=[["pricing",/\b(pricing|price|plans?|subscriptions?|per month|\/mo|tier)\b/i],["faq",/\b(faq|frequently asked|common questions?)\b/i],["comparison",/\b(compare|comparison|versus|vs\.)\b/i],["social_proof",/\b(testimonial|reviews?|trusted by|loved by|customers?|logos|rated|case stud)\b/i],["trust",/\b(security|guarantee|privacy|compliance|secure|gdpr|soc ?2|encrypt)\b/i],["features",/\b(features?|how it works|benefits?|capabilit|what you get)\b/i]],_n=[["pricing",/(?:[$€£]\s?\d[\d,.]*\s*(?:\/|per\s)\s*(?:mo|month|yr|year|seat|user))|(?:\b(?:starter|basic|pro|growth|premium|enterprise)\b[^.]{0,60}[$€£]\s?\d)/i],["social_proof",/(?:★{2,})|(?:\b\d(?:\.\d)?\s*(?:out of|\/)\s*5\b)|(?:\brated\b)|(?:["“][^"”]{20,160}["”]\s*[—–-]\s*[A-Z][a-z]+)/],["trust",/\b(?:money[- ]back guarantee|refund(?:s)? within|encrypted|soc ?2|iso ?27001|gdpr[- ]compliant|cancel anytime)\b/i],["comparison",/\b(?:vs|versus)\b\.?[^.!?]{0,80}\b(?:compare|comparison|plans?|features?|alternative)\b|\bhow (?:we|it) compares?\b/i]];function Pn(e){var t;let n=e.querySelector("h1, h2, h3");return((t=n==null?void 0:n.textContent)!=null?t:"").slice(0,160)}function yt(e){if(e.tag==="nav"||e.tag==="footer")return{type:"navigation",strength:"weak"};let t=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[n,r]of Cn)if(r.test(t))return{type:n,strength:"strong"};for(let[n,r]of _n)if(r.test(e.bodyText))return{type:n,strength:"strong"};return e.actionCount>=1&&e.textLength>0&&e.textLength<200?{type:"cta",strength:"weak"}:e.tag==="header"?{type:"hero",strength:"weak"}:/\b(hero|headline|banner)\b/i.test(t)?{type:"hero",strength:"weak"}:{type:"generic",strength:"weak"}}function bt(e){var t,n;let r=((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim();return{tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((n=e.className)!=null?n:"")}`,headingText:Pn(e),bodyText:r.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:r.length}}function vt(e){return yt(bt(e)).type}oe();var St="section, header, footer, nav, main > div, [data-sentient-section]";function Rn(e){var t;return((t=e.parentElement)==null?void 0:t.closest(St))!=null}function Ln(e,t,n,r){try{fetch(`${t}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({pageUrl:n,sections:r})}).catch(()=>{})}catch(o){}}var wt=()=>{};function xt(e,t){var n,r,o,i,s,l,a,c,d;let p=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!p||typeof IntersectionObserver=="undefined"||te()||!t.apiKey)return wt;let b=(r=t.apiBase)!=null?r:"https://api.sentient-ui.com",g=Array.from(p.querySelectorAll(St)).filter(y=>!Rn(y));if(g.length===0)return wt;let v=new Map,m=new Map,A=new Map;for(let y of g){let x=y.getAttribute("data-sentient-type"),f=x&&ht.includes(x)?x:null,w=(i=f!=null?f:(o=t.typeOf)==null?void 0:o.call(t,y))!=null?i:vt(y),k=`nc-${w}`;v.set(y,k),m.set(k,w),f?A.set(k,"markup"):A.has(k)||A.set(k,"auto")}let E=(c=(a=(l=(s=p.defaultView)!=null?s:typeof window!="undefined"?window:void 0)==null?void 0:l.location)==null?void 0:a.pathname)!=null?c:"/";Ln(t.apiKey,b,E,[...m.entries()].map(([y,x])=>{var f;return{componentId:y,semanticType:x,source:(f=A.get(y))!=null?f:"auto"}}));let S=new Map,T=y=>{let x=S.get(y);return x||(x={ms:0,scroll:0,enterAt:null,intersecting:!1},S.set(y,x)),x},G=new IntersectionObserver(y=>{for(let x of y){let f=v.get(x.target);if(!f)continue;let w=T(f);x.isIntersecting?(w.intersecting=!0,w.enterAt=Date.now(),x.intersectionRatio>w.scroll&&(w.scroll=x.intersectionRatio)):(w.intersecting=!1,w.enterAt!=null&&(w.ms+=Date.now()-w.enterAt,w.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let y of v.keys())G.observe(y);let H=()=>{let y=Date.now();for(let[x,f]of S)if(f.enterAt!=null&&(f.ms+=y-f.enterAt,f.enterAt=null),!(f.ms<=0)){try{e.track({projectId:t.apiKey,componentId:x,eventType:"dwell",payload:{dwell_time:Math.round(f.ms),scroll_depth:Number(f.scroll.toFixed(2))}})}catch(w){}f.ms=0}},Y=()=>{if(p.hidden)H();else{let y=Date.now();for(let x of S.values())x.intersecting&&(x.enterAt=y)}},C=()=>{H();try{G.disconnect()}catch(y){}};p.addEventListener("visibilitychange",Y);let N=(d=p.defaultView)!=null?d:typeof window!="undefined"?window:void 0;N==null||N.addEventListener("pagehide",C);let P=[];if(t.microSignals)for(let[y,x]of v)P.push(Ge((f,w={})=>{try{e.track({projectId:t.apiKey,componentId:x,eventType:"micro_signal",payload:I({signalType:f},w)})}catch(k){}},y));return()=>{H(),p.removeEventListener("visibilitychange",Y),N==null||N.removeEventListener("pagehide",C);for(let y of P)y();try{G.disconnect()}catch(y){}}}var Tn=["landing","ecommerce","saas","marketplace"];function Dn(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=Object.entries(e);if(t.length<1||t.length>4)return null;let n={};for(let[r,o]of t){if(!Array.isArray(o)||o.length<2||o.length>6||!o.every(i=>typeof i=="string"))return null;n[r]=o}return n}function jn(e){return!Array.isArray(e)||e.length<2||e.length>12||!e.every(t=>typeof t=="string")?null:e}function Ee(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.apiKey!="string"||!t.apiKey.startsWith("pk_"))return null;let n=Tn.includes(t.context)?t.context:"landing",r={};if(typeof t.slots=="object"&&t.slots!==null&&!Array.isArray(t.slots))for(let[i,s]of Object.entries(t.slots)){if(typeof s!="object"||s===null)continue;let l=s,a=Dn(l.dims);if(!a||l.target!==void 0&&typeof l.target!="string")continue;let c=l.arms!==void 0?jn(l.arms):null,d={dims:a};typeof l.target=="string"&&(d.target=l.target),c&&(d.arms=c),r[i]=d}let o={apiKey:t.apiKey,context:n,personaAttributes:t.personaAttributes===!0,slots:r};return typeof t.consent=="boolean"&&(o.consent=t.consent),(t.preConsentBehavior==="statistical_winner"||t.preConsentBehavior==="control")&&(o.preConsentBehavior=t.preConsentBehavior),t.debug===!0&&(o.debug=!0),typeof t.registry=="boolean"&&(o.registry=t.registry),typeof t.editorSrc=="string"&&(o.editorSrc=t.editorSrc),typeof t.apiBase=="string"&&(o.apiBase=t.apiBase),typeof t.sectionCapture=="boolean"&&(o.sectionCapture=t.sectionCapture),o}function kt(e){var n,r,o;let t=(r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0)==null?void 0:r.location;return(o=t==null?void 0:t.pathname)!=null?o:""}function Nn(e,t){var n;if(t.tag&&e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;if(t.text){let r=((n=e.textContent)!=null?n:"").trim().toLowerCase(),o=t.text.trim().toLowerCase();if(!(r===o||r.startsWith(o)||o.startsWith(r)))return!1}return!0}function At(e,t){return!!(e!=null&&e.urlMatch)&&!kt(t).includes(e.urlMatch)}function V(e,t){var o;if(e.urlMatch&&!kt(t).includes(e.urlMatch))return null;let n=[];if(e.id){let i=t.getElementById(e.id);n=i?[i]:[]}if(n.length===0&&((o=e.dataAttr)!=null&&o.name))try{let i=e.dataAttr.value.replace(/["\\]/g,"\\$&");n=Array.from(t.querySelectorAll(`[${e.dataAttr.name}="${i}"]`))}catch(i){n=[]}if(n.length===0&&e.selector)try{n=Array.from(t.querySelectorAll(e.selector))}catch(i){n=[]}if(n.length!==1)return null;let r=n[0];return e.fingerprint&&!Nn(r,e.fingerprint)?null:r}var Et=/^https:\/\//i,Mn={color:"color",background:"background",fontSize:"font-size",fontWeight:"font-weight",textAlign:"text-align",padding:"padding",margin:"margin",borderRadius:"border-radius",width:"width",height:"height",maxWidth:"max-width",border:"border",boxShadow:"box-shadow",opacity:"opacity",lineHeight:"line-height",letterSpacing:"letter-spacing",textTransform:"text-transform",gap:"gap"};function $n(e){return!/[;{}<>]/.test(e)}var Ot=new Map,F=null;function Bn(e){return e.replace(/["\\]/g,"\\$&")}function Kn(e){var t;(!F||!F.isConnected)&&(F=e.querySelector("style[data-sentient-ops]"),F||(F=e.createElement("style"),F.setAttribute("data-sentient-ops",""),((t=e.head)!=null?t:e.documentElement).appendChild(F))),F.textContent=[...Ot.entries()].map(([n,r])=>`[data-snt-e="${Bn(n)}"]{${r}}`).join(`
2
+ `)}function It(e,t,n,r){var l;let o=!1,i=(l=t.moveBefore)!=null?l:t.moveAfter;if(i){let a=V(i,r);!a||a===e||a.parentElement!==e.parentElement||!e.parentElement?o=!0:t.moveBefore?e.parentElement.insertBefore(e,a):e.parentElement.insertBefore(e,a.nextSibling)}typeof t.text=="string"&&(e.textContent=t.text),typeof t.href=="string"&&Et.test(t.href)&&e.setAttribute("href",t.href),typeof t.imageSrc=="string"&&Et.test(t.imageSrc)&&e.setAttribute("src",t.imageSrc),typeof t.imageAlt=="string"&&e.setAttribute("alt",t.imageAlt);let s=[];if(t.hidden&&s.push("display:none !important"),t.style)for(let[a,c]of Object.entries(t.style)){let d=Mn[a];d&&typeof c=="string"&&$n(c)&&s.push(`${d}:${c.trim()} !important`)}return s.length>0&&(e.setAttribute("data-snt-e",n),Ot.set(n,s.join(";")),Kn(r)),{anchorMiss:o}}function Oe(e,t,n){n.documentElement.setAttribute("data-sentient-persona",e),n.documentElement.setAttribute("data-sentient-confidence",t)}function Ie(e,t,n){var r;for(let[o,i]of Object.entries(t)){let s=e[o];if(!s||typeof s=="string")continue;let l=i.target?Array.from(n.querySelectorAll(i.target)):[n.documentElement];for(let a of l)for(let[c,d]of Object.entries(s))(r=i.dims[c])!=null&&r.includes(d)&&a.setAttribute(`data-${c}`,d)}}function Ce(e,t,n){for(let[r,o]of Object.entries(t)){let i=e[r];if(typeof i!="string"||!o.arms||!o.arms.includes(i))continue;let s=o.target?Array.from(n.querySelectorAll(o.target)):[n.documentElement];for(let l of s)l.setAttribute("data-sentient-arm",i)}}function _e(e,t,n,r){var s;let o=(s=r==null?void 0:r.contentAndOps)!=null?s:!0,i=[];for(let[l,a]of Object.entries(t)){if(At(a.locator,n))continue;let c;if(a.locator){let p=V(a.locator,n);c=p?[p]:[]}else a.target?c=Array.from(n.querySelectorAll(a.target)):c=[n.documentElement];(a.locator||a.target)&&c.length===0&&i.push(l);let d=e[l];for(let p of c){if(d!==void 0)if(typeof d=="string")p.setAttribute("data-sentient-arm",d);else for(let[b,g]of Object.entries(d))p.setAttribute(`data-${b}`,g);o&&(typeof a.content=="string"&&(p.textContent=a.content),a.ops&&It(p,a.ops,l,n).anchorMiss&&!i.includes(l)&&i.push(l))}}return i}function Un(e){var n,r,o;let t=(r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0)==null?void 0:r.location;return(o=t==null?void 0:t.pathname)!=null?o:""}function Ct(e,t,n){var b;let r=new Set,o=g=>{if(!r.has(g.goalId)){r.add(g.goalId);try{g.slotId?t.componentGoal(g.slotId,g.goalId):t.goal(g.goalId)}catch(v){}}},i=e.filter(g=>g.event==="click"),s=e.filter(g=>g.event==="form_submit"),l=e.filter(g=>g.event==="url_reached"),a=(g,v)=>{if(!g.locator)return!1;let m=V(g.locator,n);return!!m&&(m===v||m.contains(v))},c=g=>{let v=g.target;if(!(!v||typeof v.closest!="function"))for(let m of i)a(m,v)&&o(m)},d=g=>{let v=g.target;if(v)for(let m of s)a(m,v)&&o(m)},p=()=>{if(l.length===0)return;let g=Un(n);for(let v of l)v.urlPattern&&g.includes(v.urlPattern)&&o(v)};return n.addEventListener("click",c,!0),n.addEventListener("submit",d,!0),(b=n.defaultView)==null||b.addEventListener("popstate",p),p(),{checkUrl:p,teardown:()=>{var g;n.removeEventListener("click",c,!0),n.removeEventListener("submit",d,!0),(g=n.defaultView)==null||g.removeEventListener("popstate",p)}}}var _t="__snt_editor_token";function Pt(){try{return typeof sessionStorage!="undefined"?sessionStorage.getItem(_t):null}catch(e){return null}}function Rt(e){try{sessionStorage.setItem(_t,e)}catch(t){}}var $t="0.10.0",Bt=5e3,Gn=50,pe=null,L=null,W={},ne=null,re=null,O=null,Lt=!1,We=null;function Kt(e,t){return Promise.race([e,new Promise(n=>setTimeout(()=>n(null),t))])}function ae(e,...t){e!=null&&e.debug&&console.log("[sentient-snippet]",...t)}function ge(e,t){return pe?(pe.personaAttributes&&O&&Oe(O.persona,O.band,e),Ie(W,pe.slots,e),Ce(W,pe.slots,e),ne?_e(W,ne,e,t):[]):[]}function qn(e,t){var n;if(t.length!==0)try{let r=(n=e.apiBase)!=null?n:"https://api.sentient-ui.com";fetch(`${r}/v1/locator-miss`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e.apiKey}`},body:JSON.stringify({slots:t})}).catch(()=>{})}catch(r){}}function Je(){try{ge(document)}catch(e){}}function Tt(){We===null&&(We=setTimeout(()=>{We=null,Je();try{re==null||re.checkUrl()}catch(e){}},Gn))}function Dt(){if(!(Lt||typeof window=="undefined"||typeof history=="undefined")){Lt=!0;try{let e=t=>{let n=history[t];history[t]=function(r,o,i){let s=n.call(this,r,o,i!=null?i:null);return Tt(),s}};e("pushState"),e("replaceState"),window.addEventListener("popstate",Tt)}catch(e){}}}function ze(e){let t={};for(let[n,r]of Object.entries(e.slots))t[n]=r.target?document.querySelectorAll(r.target).length:1;return t}function Ut(e){return new URLSearchParams(e).get("sentient_editor")}function Wn(){try{let t=Array.from(document.getElementsByTagName("script")).find(n=>/snippet(\.global)?\.js/.test(n.src));if(t!=null&&t.src)return t.src.replace(/snippet(\.global)?\.js/,"editor.global.js")}catch(e){}return null}function zn(e,t){var n,r,o,i;try{window.__sentientEditor={token:t,apiBase:(n=e.apiBase)!=null?n:"https://api.sentient-ui.com"};try{let a=document.createElement("meta");a.name="referrer",a.content="no-referrer",((r=document.head)!=null?r:document.documentElement).appendChild(a)}catch(a){}let s=(o=e.editorSrc)!=null?o:Wn();if(!s){Nt();return}let l=document.createElement("script");l.src=s,l.async=!0,l.onerror=()=>Nt(),((i=document.head)!=null?i:document.documentElement).appendChild(l)}catch(s){}}var jt="sentient-editor-load-notice";function Nt(){var e;try{if(typeof document=="undefined"||document.getElementById(jt))return;let t=document.createElement("div");t.id=jt,t.textContent="Couldn\u2019t load the editor \u2014 check your connection and reopen it from your dashboard.",Object.assign(t.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483647",maxWidth:"320px",padding:"14px 16px",borderRadius:"14px",background:"#111827",color:"#fff",font:"13px/1.45 system-ui, sans-serif",border:"1px solid rgba(245,158,11,0.6)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)",cursor:"pointer"}),t.addEventListener("click",()=>t.remove()),((e=document.body)!=null?e:document.documentElement).appendChild(t),setTimeout(()=>t.remove(),1e4)}catch(t){}}function Gt(e){let t=new URLSearchParams(e).get("sentient_preview");if(!t)return null;let n={};for(let r of t.split("|")){let[o,i]=r.split(":");if(!(!o||!i))if(i.includes("=")){let s={};for(let l of i.split(",")){let[a,c]=l.split("=");a&&c&&(s[a]=c)}Object.keys(s).length&&(n[o]=s)}else n[o]=i}return Object.keys(n).length?n:null}function qt(e){try{return new URLSearchParams(e).get("sentient_persona")||null}catch(t){return null}}var Mt="sentient-persona-preview-banner";function Jn(e){var t;try{if(typeof document=="undefined"||document.getElementById(Mt))return;let n=e.charAt(0).toUpperCase()+e.slice(1).replace(/[_-]+/g," "),r=document.createElement("div");r.id=Mt,r.setAttribute("role","status"),Object.assign(r.style,{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",zIndex:"2147483647",display:"flex",alignItems:"center",gap:"12px",padding:"10px 14px",borderRadius:"999px",background:"#111827",color:"#fff",font:"13px/1 system-ui, sans-serif",boxShadow:"0 10px 34px rgba(0,0,0,0.45)",border:"1px solid rgba(255,255,255,0.14)"});let o=document.createElement("span");o.textContent=`Previewing as ${n}`;let i=document.createElement("button");i.type="button",i.textContent="Exit preview",Object.assign(i.style,{cursor:"pointer",border:"1px solid rgba(255,255,255,0.3)",background:"transparent",color:"#fff",font:"inherit",padding:"4px 10px",borderRadius:"999px"}),i.addEventListener("click",()=>{try{let s=new URL(window.location.href);s.searchParams.delete("sentient_persona"),window.location.href=s.pathname+s.search+s.hash}catch(s){}}),r.appendChild(o),r.appendChild(i),((t=document.body)!=null?t:document.documentElement).appendChild(r)}catch(n){}}async function Vn(e,t){var c,d,p,b,g,v,m,A,E;let n=(c=e.apiBase)!=null?c:"https://api.sentient-ui.com",o=((d=e.registry)!=null?d:Object.keys(e.slots).length===0)?{persona:t,slotsFrom:"registry"}:{persona:t,slots:Object.entries(e.slots).map(([S,T])=>({id:S,dims:T.dims}))},i=await Kt(fetch(`${n}/v1/explain`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e.apiKey}`},body:JSON.stringify(o)}).then(S=>S.ok?S.json():null).catch(()=>null),Bt);if(!i){ae(e,"persona preview: explain unavailable \u2014 page left as-is");return}let s=i;W=(p=s.slots)!=null?p:{},ne=(b=s.slotConfig)!=null?b:null;let l=(m=(v=(g=s.personaAttributes)==null?void 0:g.persona)!=null?v:s.persona)!=null?m:t,a=(E=(A=s.personaAttributes)==null?void 0:A.confidence)!=null?E:"high";O={persona:l,band:a},ge(document),Wt(e),Jn(l)}function Wt(e){let t={goal(n,r){try{L==null||L.goal(n,r)}catch(o){}},componentGoal(n,r){try{L==null||L.componentGoal(n,r)}catch(o){}},grantConsent(){try{qe(e.apiKey)}catch(n){}},revokeConsent(){try{L==null||L.destroy()}catch(n){}},reapply:Je,getState(){var n,r;return{apiKey:e.apiKey,persona:(n=O==null?void 0:O.persona)!=null?n:null,band:(r=O==null?void 0:O.band)!=null?r:null,slots:W,matchCounts:ze(e),consent:e.consent!==!1}}};window.SentientSnippet=t}async function zt(){var e,t,n;try{let r=Ee(window.sentient);if(!r)return;pe=r;let o=typeof window!="undefined"?Ut(window.location.search):null;if(o){Rt(o);try{let m=new URL(window.location.href);m.searchParams.delete("sentient_editor"),window.history.replaceState(null,"",m.pathname+m.search+m.hash)}catch(m){}}let i=o!=null?o:Pt();if(i){zn(r,i),ae(r,"editor mode");return}let s=typeof window!="undefined"?Gt(window.location.search):null;if(s){W=s,O=null,ge(document),Dt(),ae(r,"preview mode",s);return}let l=typeof window!="undefined"?qt(window.location.search):null;if(l){await Vn(r,l),ae(r,"persona preview",l);return}let a=(e=r.registry)!=null?e:Object.keys(r.slots).length===0,c=ke(r.apiKey);c&&(O={persona:c.persona,band:c.band},W=c.slots,c.slotConfig&&(ne=c.slotConfig),ge(document,{contentAndOps:!1}));let d=Ae({apiKey:r.apiKey,context:r.context,consent:r.consent,preConsentBehavior:r.preConsentBehavior,debug:r.debug});L=d,Wt(r),Dt();let p=Object.entries(r.slots).map(([m,A])=>({id:m,dims:A.dims})),b=await Kt(d.decide(he({slots:p,v:$t},a?{slotsFrom:"registry"}:{})),Bt);if(!b){ae(r,"decide timeout/null \u2014 snapshot state stands",ze(r));return}let g=d.getPersona();if(g?O={persona:g.persona,band:g.band}:b.persona&&(O={persona:b.persona,band:"low"}),W=b.slots,b.slotConfig&&(ne=b.slotConfig),qn(r,ge(document)),b.goals&&b.goals.length>0&&r.consent!==!1&&L)try{re==null||re.teardown(),re=Ct(b.goals,L,document)}catch(m){}let v;try{let m=b.sectionMap;if(m&&m.length>0){let A=new Map;for(let E of m){if(E.urlMatch!==window.location.pathname)continue;let S=V(E.locator,document);S&&A.set(S,E.type)}A.size>0&&(v=E=>{var S;return(S=A.get(E))!=null?S:null})}}catch(m){}if(r.sectionCapture!==!1&&r.consent!==!1&&L&&!te())try{xt(L,he({apiKey:r.apiKey,apiBase:r.apiBase,doc:document,microSignals:!0},v?{typeOf:v}:{}))}catch(m){}ae(r,"applied",{persona:O,slots:W,matches:ze(r)}),fe(r.apiKey,he({v:1,persona:(t=O==null?void 0:O.persona)!=null?t:b.persona,band:(n=O==null?void 0:O.band)!=null?n:"low",slots:b.slots,layoutOrder:b.layoutOrder,savedAt:Date.now()},ne?{slotConfig:ne}:{}))}catch(r){}}typeof window!="undefined"&&window.sentient&&zt();return Yt(Fn);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentientui/snippet",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "private": false,
5
5
  "description": "SentientUI Style-rung snippet for non-React sites — persona attributes and adaptive style tokens from one script tag",
6
6
  "type": "module",