@sentientui/snippet 0.34.1 → 0.34.2
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 +1 @@
|
|
|
1
|
-
"use strict";var __sentientEngagement=(()=>{var q=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var ve=(e,t)=>()=>(e&&(t=e(e=0)),t);var ye=(e,t)=>{for(var n in t)q(e,n,{get:t[n],enumerable:!0})},be=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of me(t))!he.call(e,r)&&r!==n&&q(e,r,{get:()=>t[r],enumerable:!(l=ge(t,r))||l.enumerable});return e};var we=e=>be(q({},"__esModule",{value:!0}),e);var _e,xe,Ie,X,Ae,$e,ee,O,te,H=ve(()=>{"use strict";_e=Object.defineProperty,xe=Object.defineProperties,Ie=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,ee=(e,t,n)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||(t={}))Ae.call(t,n)&&ee(e,n,t[n]);if(X)for(var n of X(t))$e.call(t,n)&&ee(e,n,t[n]);return e},te=(e,t)=>xe(e,Ie(t))});var Ve={};ye(Ve,{startEngagementCapture:()=>pe});var Se=["data-sentient-id","data-testid","data-test","data-id","data-name","data-cy"];function G(e){var t;return((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim()}function ke(e){return{tag:e.tagName.toLowerCase(),text:G(e).slice(0,40)}}function J(e){return e.replace(/["\\\]]/g,"\\$&")}function F(e,t){try{return e.querySelectorAll(t).length===1}catch(n){return!1}}function Z(e,t){var n;let l=e.tagName.toLowerCase();if(!l)return null;let r=((n=e.getAttribute("class"))!=null?n:"").split(/\s+/).filter(u=>/^[a-zA-Z][\w-]*$/.test(u)),c=[l,...r.map(u=>`${l}.${u}`)];for(let u of c)if(F(t,u))return u;let i=e.parentElement;if(i&&i!==t){let u=Z(i,t);if(u){for(let m of c){let b=`${u} > ${m}`;if(F(t,b))return b}let d=Array.from(i.children).filter(m=>m.tagName.toLowerCase()===l),y=d.indexOf(e),S=d.some(m=>m!==e&&G(m)!==G(e));if(y>=0&&S){let m=`${u} > ${l}:nth-of-type(${y+1})`;if(F(t,m))return m}}}return null}function Q(e,t){let n=ke(e),l=e.getAttribute("id");if(l&&F(t,`#${J(l)}`))return{v:1,id:l,fingerprint:n};for(let c of Se){let i=e.getAttribute(c);if(i&&F(t,`[${c}="${J(i)}"]`))return{v:1,dataAttr:{name:c,value:i},fingerprint:n}}let r=Z(e,t);return r?{v:1,selector:r,fingerprint:n}:null}H();var re=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],Ce={banner:"hero",navigation:"navigation",contentinfo:"footer"};function Ee(e){let t=e.ariaRole?Ce[e.ariaRole.toLowerCase()]:void 0;if(t)return t;if(e.tag==="nav")return"navigation";if(e.tag==="footer")return"footer";if(e.tag==="header")return e.actionCount>=5?"navigation":"hero";let n=`${e.idClass} ${e.headingText}`.toLowerCase();return/\b(navbar|nav-bar|navigation|site-nav|main-nav|topbar|footer)\b/.test(n)?/footer/.test(n)?"footer":"navigation":/\b(hero|masthead|jumbotron)\b/i.test(e.idClass)?"hero":null}function Oe(e){return e.actionCount>=1&&e.textLength>0&&e.textLength<200?"cta":"generic"}var Le=[["pricing",/\b(pricing|price list|per month|\/mo|subscriptions?)\b|\bplans?\b(?=[^.]{0,40}(from|start|month|year|[$€£]))/i],["faq",/\bfaq\b|frequently asked|common questions?/i],["comparison",/\b(compare|comparison|versus)\b|\bvs\./i],["social_proof",/\b(reviews?|ratings?|testimonial|brands?|galler(y|ies)|logos)\b|trusted by|loved by|case stud|what our customers say/i],["trust",/\b(insurance|warrant(y|ies)|guarantees?|certifi|accredit|security|privacy|compliance|gdpr|encrypt)\b|why choose|about us|our team/i],["cta",/\b(book|booking|reserve|appointments?|newsletter|subscribe)\b|contact us|get in touch|opening hours/i],["features",/\b(features?|benefits?|capabilit|services?|repairs?|menus?|products?)\b|how it works|our process|what we (do|offer)|what you get/i]],Y=[["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|free returns?|returns? within|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]],ne={navigation:"navigation",footer:"navigation",hero:"hero",cta:"cta",generic:"generic"};function Me(e){var t;let n=e.querySelector("h1, h2, h3");return((t=n==null?void 0:n.textContent)!=null?t:"").slice(0,160)}function ae(e){var t,n;let l=Ee(e);if(l)return{type:(t=ne[l])!=null?t:"generic",strength:"strong"};let r=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[i,u]of Le)if(u.test(r))return{type:i,strength:"strong"};for(let[i,u]of Y)if(u.test(e.bodyText))return{type:i,strength:"strong"};let c=Oe(e);return{type:(n=ne[c])!=null?n:"generic",strength:"weak"}}function oe(e){var t,n;let l=((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim(),r=e.getAttribute("role");return O({tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((n=e.className)!=null?n:"")}`,headingText:Me(e),bodyText:l.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:l.length},r?{ariaRole:r}:{})}function le(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t}var Je=1800*1e3;function ie(e,t,n,l){let r=[];{let c=!1,i=[],u=()=>{if(c)return;let d=Date.now();for(i.push(d);i.length>0&&d-i[0]>500;)i.shift();i.length>=3&&(c=!0,e("rage_click"))};t.addEventListener("click",u),r.push(()=>t.removeEventListener("click",u))}{let c=!1,i=u=>{if(c||!(u.target instanceof Node)||!t.contains(u.target)&&t!==u.target)return;c=!0;let d=typeof window!="undefined"?window.getSelection():null,y=d?d.toString().length:0;e("text_copy",{selectionLength:y})};document.addEventListener("copy",i),r.push(()=>document.removeEventListener("copy",i))}{let c=!1,i=!1,u=null,d=()=>{u!==null&&(clearTimeout(u),u=null)},y=()=>{c||!i||(d(),u=setTimeout(()=>{!c&&i&&(c=!0,e("scroll_hesitation"))},3e3))},S=()=>{d(),y()},m=I=>{for(let A of I)i=A.intersectionRatio>.3,i?y():d()},b=new IntersectionObserver(m,{threshold:[.3]});b.observe(t),window.addEventListener("scroll",S,{passive:!0}),r.push(()=>{b.disconnect(),window.removeEventListener("scroll",S),d()})}if((l==null?void 0:l.tabLoss)!==!1){let c=!1,i=n!=null?n:Date.now(),u=()=>{if(c||document.visibilityState!=="hidden")return;let d=Date.now()-i;d<15e3&&(c=!0,e("tab_loss",{timeOnPage:d}))};document.addEventListener("visibilitychange",u),r.push(()=>document.removeEventListener("visibilitychange",u))}return()=>{for(let c of r)c()}}function se(){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")}H();var ue=[100,300,1e3,3e3,1e4],Pe=250,Te=1e3,Ne=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function ce(e,t){e.n++;let n=t-e.mean;e.mean+=n/e.n,e.m2+=n*(t-e.mean)}var de=e=>e.n>1?Math.sqrt(e.m2/e.n):0;function De(e){var t;try{let n=e.createElement("canvas"),l=n.getContext("webgl")||n.getContext("experimental-webgl");if(!l)return"unknown";let r=l.getExtension("WEBGL_debug_renderer_info"),c=r?String((t=l.getParameter(r.UNMASKED_RENDERER_WEBGL))!=null?t:""):"";return c?/swiftshader|llvmpipe|softpipe|software|mesa offscreen/i.test(c)?"sw":"hw":"unknown"}catch(n){return"unknown"}}function Ke(e,t=Date.now){var n,l;let r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0,c={n:0,mean:0,m2:0},i={n:0,mean:0,m2:0},u=[0,0,0,0,0,0],d=0,y=0,S=0,m=0,b=0,I=0,A=0,T=0,N=0,h=0,V=-1/0,D=-1/0,k=null,L=null,K=null,R=(l=r==null?void 0:r.scrollY)!=null?l:0,W=0,v=e.hidden?null:t(),M=()=>{let o=t();if(K!=null){let g=o-K,_=0;for(;_<ue.length&&g>=ue[_];)_++;u[_]++}K=o},P=()=>{d++,V=t()},$=()=>{y++,D=t()},j=()=>{k=t()},C=()=>{k!=null&&(ce(c,t()-k),k=null)},U=()=>{let o=t();S++,o-V>Pe&&o-D>Te&&m++,M()},E=()=>{b++},w=()=>{var o;let g=(o=r==null?void 0:r.scrollY)!=null?o:0;I+=Math.abs(g-R),R=g,M()},z=o=>{let g=t();A++,(o.key==="Backspace"||o.key==="Delete")&&N++,Ne.has(o.key)&&h++,L!=null&&ce(i,g-L),L=g,M()},B=o=>{let g=o.data;typeof g=="string"&&(T+=g.length),M()},s=()=>{let o=t();e.hidden?v!=null&&(W+=o-v,v=null):v==null&&(v=o)},a={passive:!0,capture:!0};e.addEventListener("mousemove",P,a),e.addEventListener("touchstart",$,a),e.addEventListener("touchmove",E,a),e.addEventListener("mousedown",j,a),e.addEventListener("mouseup",C,a),e.addEventListener("click",U,a),e.addEventListener("wheel",E,a),e.addEventListener("keydown",z,a),e.addEventListener("input",B,a),e.addEventListener("visibilitychange",s),r==null||r.addEventListener("scroll",w,a);let f=De(e),p=(()=>{var o;try{return((o=r==null?void 0:r.matchMedia)==null?void 0:o.call(r,"(prefers-reduced-motion: reduce)").matches)===!0}catch(g){return!1}})();return{snapshot(){var o,g;let _=t(),x=W+(v!=null?_-v:0);return{v:1,active_ms:Math.round(x),mm:d,mm_rate:x>0?Number((d*1e3/x).toFixed(2)):0,touches:y,clicks:S,hold_n:c.n,hold_mean:Math.round(c.mean),hold_std:Math.round(de(c)),teleport:m,wheel:b,scroll_px:Math.round(I),keydowns:A,input_chars:T,ik_cv:i.mean>0?Number((de(i)/i.mean).toFixed(2)):0,backspaces:N,gaps:[...u],reduced_motion:p,kb_nav:h,renderer:f,vp:[(o=r==null?void 0:r.innerWidth)!=null?o:0,(g=r==null?void 0:r.innerHeight)!=null?g:0],dpr:(r==null?void 0:r.devicePixelRatio)||1}},stop(){e.removeEventListener("mousemove",P,a),e.removeEventListener("touchstart",$,a),e.removeEventListener("touchmove",E,a),e.removeEventListener("mousedown",j,a),e.removeEventListener("mouseup",C,a),e.removeEventListener("click",U,a),e.removeEventListener("wheel",E,a),e.removeEventListener("keydown",z,a),e.removeEventListener("input",B,a),e.removeEventListener("visibilitychange",s),r==null||r.removeEventListener("scroll",w,a)}}}var Re="section, header, footer, nav, main > div, [data-sentient-section]",je=2e4,Ue="__session__";function Be(e){let t=Array.from(e.querySelectorAll(Re)),n=t.filter(l=>t.filter(r=>r!==l&&l.contains(r)).length<2);return n.filter(l=>!n.some(r=>r!==l&&r.contains(l)))}function Fe(e,t,n,l){try{fetch(`${t}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({pageUrl:n,sections:l})}).catch(()=>{})}catch(r){}}var fe=()=>{};function pe(e,t){var n,l,r,c,i,u,d,y,S,m,b,I,A,T,N;let h=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!h||typeof IntersectionObserver=="undefined"||se()||!t.apiKey||!t.apiKey.startsWith("pk_"))return fe;let V=((l=t.apiBase)!=null?l:"https://api.sentient-ui.com").replace(/\/+$/,"").replace(/\/v1$/,""),D=Be(h);if(D.length===0)return fe;let k=new Map,L=[];for(let s of D){let a=(i=[(c=t.sectionTypes)==null?void 0:c[(r=s.getAttribute("data-sentient-id"))!=null?r:""],s.getAttribute("data-sentient-type")].find(x=>re.includes(x)))!=null?i:null,f=oe(s),p=(d=a!=null?a:(u=t.typeOf)==null?void 0:u.call(t,s))!=null?d:ae(f).type,o=Q(s,h),g=o?`nc-${p}-${le(JSON.stringify({id:(y=o.id)!=null?y:null,dataAttr:(S=o.dataAttr)!=null?S:null,selector:(m=o.selector)!=null?m:null})).toString(36)}`:`nc-${p}`;k.set(s,g);let _=Y.filter(([,x])=>x.test(f.bodyText)).map(([x])=>x);L.push(te(O({componentId:g,semanticType:p,source:a?"markup":"auto"},o?{locator:o}:{}),{observation:O(O({tag:f.tag,idClass:f.idClass.slice(0,200),headingText:f.headingText,textLength:f.textLength,actionCount:f.actionCount},f.ariaRole?{ariaRole:f.ariaRole}:{}),_.length>0?{patternFlags:_}:{})}))}let K=(T=(A=(I=(b=h.defaultView)!=null?b:typeof window!="undefined"?window:void 0)==null?void 0:I.location)==null?void 0:A.pathname)!=null?T:"/";Fe(t.apiKey,V,K,L);let R=Ke(h),W=()=>{let s;try{s=R.snapshot()}catch(a){return}try{e.track({projectId:t.apiKey,componentId:Ue,eventType:"interaction_stats",payload:s})}catch(a){}},v=new Map,M=s=>{let a=v.get(s);return a||(a={ms:0,scroll:0,enterAt:null,intersecting:!1},v.set(s,a)),a},P=new IntersectionObserver(s=>{for(let a of s){let f=k.get(a.target);if(!f)continue;let p=M(f);a.isIntersecting?(p.intersecting=!0,p.enterAt=Date.now(),a.intersectionRatio>p.scroll&&(p.scroll=a.intersectionRatio)):(p.intersecting=!1,p.enterAt!=null&&(p.ms+=Date.now()-p.enterAt,p.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let s of k.keys())P.observe(s);let $=(s=!1)=>{var a;let f=Date.now();for(let[p,o]of v)if(o.enterAt!=null&&(o.ms+=f-o.enterAt,o.enterAt=null),!(o.ms<=0)){try{e.track({projectId:t.apiKey,componentId:p,eventType:"dwell",payload:{dwell_time:Math.round(o.ms),scroll_depth:Number(o.scroll.toFixed(2))}})}catch(g){}o.ms=0}if(W(),s)try{(a=e.flush)==null||a.call(e)}catch(p){}},j=()=>{if(h.hidden)$(!0);else{let s=Date.now();for(let a of v.values())a.intersecting&&(a.enterAt=s)}},C=!1,U=s=>{if($(!0),s!=null&&s.persisted){C=!0;return}try{P.disconnect()}catch(a){}},E=s=>{if(!(s!=null&&s.persisted)||!C)return;C=!1;let a=Date.now();for(let f of v.values())f.enterAt=f.intersecting&&!h.hidden?a:null};h.addEventListener("visibilitychange",j);let w=(N=h.defaultView)!=null?N:typeof window!="undefined"?window:void 0;w==null||w.addEventListener("pagehide",U),w==null||w.addEventListener("pageshow",E);let z=setInterval(()=>{if(h.hidden||C)return;$();let s=Date.now();for(let a of v.values())a.intersecting&&(a.enterAt=s)},je),B=[];return t.microSignals&&[...k.entries()].forEach(([s,a],f)=>{B.push(ie((p,o={})=>{try{e.track({projectId:t.apiKey,componentId:a,eventType:"micro_signal",payload:O({signalType:p},o)})}catch(g){}},s,void 0,{tabLoss:f===0}))}),()=>{$(!0),clearInterval(z),R.stop(),h.removeEventListener("visibilitychange",j),w==null||w.removeEventListener("pagehide",U),w==null||w.removeEventListener("pageshow",E);for(let s of B)s();try{P.disconnect()}catch(s){}}}return we(Ve);})();
|
|
1
|
+
"use strict";var __sentientEngagement=(()=>{var z=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var ve=(e,t)=>()=>(e&&(t=e(e=0)),t);var ye=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})},be=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of me(t))!he.call(e,r)&&r!==n&&z(e,r,{get:()=>t[r],enumerable:!(l=ge(t,r))||l.enumerable});return e};var we=e=>be(z({},"__esModule",{value:!0}),e);var _e,xe,Ie,Q,Ae,Ee,ee,O,te,H=ve(()=>{"use strict";_e=Object.defineProperty,xe=Object.defineProperties,Ie=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,ee=(e,t,n)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||(t={}))Ae.call(t,n)&&ee(e,n,t[n]);if(Q)for(var n of Q(t))Ee.call(t,n)&&ee(e,n,t[n]);return e},te=(e,t)=>xe(e,Ie(t))});var Ve={};ye(Ve,{startEngagementCapture:()=>pe});var Se=["data-sentient-id","data-testid","data-test","data-id","data-name","data-cy"];function G(e){var t;return((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim()}function ke(e){return{tag:e.tagName.toLowerCase(),text:G(e).slice(0,40)}}function Y(e){return e.replace(/["\\\]]/g,"\\$&")}function B(e,t){try{return e.querySelectorAll(t).length===1}catch(n){return!1}}function Z(e,t){var n;let l=e.tagName.toLowerCase();if(!l)return null;let r=((n=e.getAttribute("class"))!=null?n:"").split(/\s+/).filter(u=>/^[a-zA-Z][\w-]*$/.test(u)),c=[l,...r.map(u=>`${l}.${u}`)];for(let u of c)if(B(t,u))return u;let i=e.parentElement;if(i&&i!==t){let u=Z(i,t);if(u){for(let m of c){let b=`${u} > ${m}`;if(B(t,b))return b}let d=Array.from(i.children).filter(m=>m.tagName.toLowerCase()===l),y=d.indexOf(e),S=d.some(m=>m!==e&&G(m)!==G(e));if(y>=0&&S){let m=`${u} > ${l}:nth-of-type(${y+1})`;if(B(t,m))return m}}}return null}function X(e,t){let n=ke(e),l=e.getAttribute("id");if(l&&B(t,`#${Y(l)}`))return{v:1,id:l,fingerprint:n};for(let c of Se){let i=e.getAttribute(c);if(i&&B(t,`[${c}="${Y(i)}"]`))return{v:1,dataAttr:{name:c,value:i},fingerprint:n}}let r=Z(e,t);return r?{v:1,selector:r,fingerprint:n}:null}H();var re=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],$e={banner:"hero",navigation:"navigation",contentinfo:"footer"};function Ce(e){let t=e.ariaRole?$e[e.ariaRole.toLowerCase()]:void 0;if(t)return t;if(e.tag==="nav")return"navigation";if(e.tag==="footer")return"footer";if(e.tag==="header")return e.actionCount>=5?"navigation":"hero";let n=`${e.idClass} ${e.headingText}`.toLowerCase();return/\b(navbar|nav-bar|navigation|site-nav|main-nav|topbar|footer)\b/.test(n)?/footer/.test(n)?"footer":"navigation":/\b(hero|masthead|jumbotron)\b/i.test(e.idClass)?"hero":null}function Oe(e){return e.actionCount>=1&&e.textLength>0&&e.textLength<200?"cta":"generic"}var Pe=[["pricing",/\b(pricing|price list|per month|\/mo|subscriptions?)\b|\bplans?\b(?=[^.]{0,40}(from|start|month|year|[$€£]))/i],["faq",/\bfaq\b|frequently asked|common questions?/i],["comparison",/\b(compare|comparison|versus)\b|\bvs\./i],["social_proof",/\b(reviews?|ratings?|testimonial|brands?|galler(y|ies)|logos)\b|trusted by|loved by|case stud|what our customers say/i],["trust",/\b(insurance|warrant(y|ies)|guarantees?|certifi|accredit|security|privacy|compliance|gdpr|encrypt)\b|why choose|about us|our team/i],["cta",/\b(book|booking|reserve|appointments?|newsletter|subscribe)\b|contact us|get in touch|opening hours/i],["features",/\b(features?|benefits?|capabilit|services?|repairs?|menus?|products?)\b|how it works|our process|what we (do|offer)|what you get/i]],J=[["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|free returns?|returns? within|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]],ne={navigation:"navigation",footer:"navigation",hero:"hero",cta:"cta",generic:"generic"};function Le(e){var t;let n=e.querySelector("h1, h2, h3");return((t=n==null?void 0:n.textContent)!=null?t:"").slice(0,160)}function ae(e){var t,n;let l=Ce(e);if(l)return{type:(t=ne[l])!=null?t:"generic",strength:"strong"};let r=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[i,u]of Pe)if(u.test(r))return{type:i,strength:"strong"};for(let[i,u]of J)if(u.test(e.bodyText))return{type:i,strength:"strong"};let c=Oe(e);return{type:(n=ne[c])!=null?n:"generic",strength:"weak"}}function oe(e){var t,n;let l=((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim(),r=e.getAttribute("role");return O({tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((n=e.className)!=null?n:"")}`,headingText:Le(e),bodyText:l.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:l.length},r?{ariaRole:r}:{})}function le(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t}var Me={discovered:"d-",campaign:"c-",retargeting:"r-",arrival:"a-"},Ye=Object.values(Me);var Xe=1800*1e3;function ie(e,t,n,l){let r=[];{let c=!1,i=[],u=()=>{if(c)return;let d=Date.now();for(i.push(d);i.length>0&&d-i[0]>500;)i.shift();i.length>=3&&(c=!0,e("rage_click"))};t.addEventListener("click",u),r.push(()=>t.removeEventListener("click",u))}{let c=!1,i=u=>{if(c||!(u.target instanceof Node)||!t.contains(u.target)&&t!==u.target)return;c=!0;let d=typeof window!="undefined"?window.getSelection():null,y=d?d.toString().length:0;e("text_copy",{selectionLength:y})};document.addEventListener("copy",i),r.push(()=>document.removeEventListener("copy",i))}{let c=!1,i=!1,u=null,d=()=>{u!==null&&(clearTimeout(u),u=null)},y=()=>{c||!i||(d(),u=setTimeout(()=>{!c&&i&&(c=!0,e("scroll_hesitation"))},3e3))},S=()=>{d(),y()},m=I=>{for(let A of I)i=A.intersectionRatio>.3,i?y():d()},b=new IntersectionObserver(m,{threshold:[.3]});b.observe(t),window.addEventListener("scroll",S,{passive:!0}),r.push(()=>{b.disconnect(),window.removeEventListener("scroll",S),d()})}if((l==null?void 0:l.tabLoss)!==!1){let c=!1,i=n!=null?n:Date.now(),u=()=>{if(c||document.visibilityState!=="hidden")return;let d=Date.now()-i;d<15e3&&(c=!0,e("tab_loss",{timeOnPage:d}))};document.addEventListener("visibilitychange",u),r.push(()=>document.removeEventListener("visibilitychange",u))}return()=>{for(let c of r)c()}}function se(){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")}H();var ue=[100,300,1e3,3e3,1e4],Te=250,Ne=1e3,De=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function ce(e,t){e.n++;let n=t-e.mean;e.mean+=n/e.n,e.m2+=n*(t-e.mean)}var de=e=>e.n>1?Math.sqrt(e.m2/e.n):0;function Ke(e){var t;try{let n=e.createElement("canvas"),l=n.getContext("webgl")||n.getContext("experimental-webgl");if(!l)return"unknown";let r=l.getExtension("WEBGL_debug_renderer_info"),c=r?String((t=l.getParameter(r.UNMASKED_RENDERER_WEBGL))!=null?t:""):"";return c?/swiftshader|llvmpipe|softpipe|software|mesa offscreen/i.test(c)?"sw":"hw":"unknown"}catch(n){return"unknown"}}function Re(e,t=Date.now){var n,l;let r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0,c={n:0,mean:0,m2:0},i={n:0,mean:0,m2:0},u=[0,0,0,0,0,0],d=0,y=0,S=0,m=0,b=0,I=0,A=0,T=0,N=0,h=0,W=-1/0,D=-1/0,k=null,P=null,K=null,R=(l=r==null?void 0:r.scrollY)!=null?l:0,V=0,v=e.hidden?null:t(),L=()=>{let o=t();if(K!=null){let g=o-K,_=0;for(;_<ue.length&&g>=ue[_];)_++;u[_]++}K=o},M=()=>{d++,W=t()},E=()=>{y++,D=t()},j=()=>{k=t()},$=()=>{k!=null&&(ce(c,t()-k),k=null)},U=()=>{let o=t();S++,o-W>Te&&o-D>Ne&&m++,L()},C=()=>{b++},w=()=>{var o;let g=(o=r==null?void 0:r.scrollY)!=null?o:0;I+=Math.abs(g-R),R=g,L()},q=o=>{let g=t();A++,(o.key==="Backspace"||o.key==="Delete")&&N++,De.has(o.key)&&h++,P!=null&&ce(i,g-P),P=g,L()},F=o=>{let g=o.data;typeof g=="string"&&(T+=g.length),L()},s=()=>{let o=t();e.hidden?v!=null&&(V+=o-v,v=null):v==null&&(v=o)},a={passive:!0,capture:!0};e.addEventListener("mousemove",M,a),e.addEventListener("touchstart",E,a),e.addEventListener("touchmove",C,a),e.addEventListener("mousedown",j,a),e.addEventListener("mouseup",$,a),e.addEventListener("click",U,a),e.addEventListener("wheel",C,a),e.addEventListener("keydown",q,a),e.addEventListener("input",F,a),e.addEventListener("visibilitychange",s),r==null||r.addEventListener("scroll",w,a);let f=Ke(e),p=(()=>{var o;try{return((o=r==null?void 0:r.matchMedia)==null?void 0:o.call(r,"(prefers-reduced-motion: reduce)").matches)===!0}catch(g){return!1}})();return{snapshot(){var o,g;let _=t(),x=V+(v!=null?_-v:0);return{v:1,active_ms:Math.round(x),mm:d,mm_rate:x>0?Number((d*1e3/x).toFixed(2)):0,touches:y,clicks:S,hold_n:c.n,hold_mean:Math.round(c.mean),hold_std:Math.round(de(c)),teleport:m,wheel:b,scroll_px:Math.round(I),keydowns:A,input_chars:T,ik_cv:i.mean>0?Number((de(i)/i.mean).toFixed(2)):0,backspaces:N,gaps:[...u],reduced_motion:p,kb_nav:h,renderer:f,vp:[(o=r==null?void 0:r.innerWidth)!=null?o:0,(g=r==null?void 0:r.innerHeight)!=null?g:0],dpr:(r==null?void 0:r.devicePixelRatio)||1}},stop(){e.removeEventListener("mousemove",M,a),e.removeEventListener("touchstart",E,a),e.removeEventListener("touchmove",C,a),e.removeEventListener("mousedown",j,a),e.removeEventListener("mouseup",$,a),e.removeEventListener("click",U,a),e.removeEventListener("wheel",C,a),e.removeEventListener("keydown",q,a),e.removeEventListener("input",F,a),e.removeEventListener("visibilitychange",s),r==null||r.removeEventListener("scroll",w,a)}}}var je="section, header, footer, nav, main > div, [data-sentient-section]",Ue=2e4,Fe="__session__";function Be(e){let t=Array.from(e.querySelectorAll(je)),n=t.filter(l=>t.filter(r=>r!==l&&l.contains(r)).length<2);return n.filter(l=>!n.some(r=>r!==l&&r.contains(l)))}function We(e,t,n,l){try{fetch(`${t}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({pageUrl:n,sections:l})}).catch(()=>{})}catch(r){}}var fe=()=>{};function pe(e,t){var n,l,r,c,i,u,d,y,S,m,b,I,A,T,N;let h=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!h||typeof IntersectionObserver=="undefined"||se()||!t.apiKey||!t.apiKey.startsWith("pk_"))return fe;let W=((l=t.apiBase)!=null?l:"https://api.sentient-ui.com").replace(/\/+$/,"").replace(/\/v1$/,""),D=Be(h);if(D.length===0)return fe;let k=new Map,P=[];for(let s of D){let a=(i=[(c=t.sectionTypes)==null?void 0:c[(r=s.getAttribute("data-sentient-id"))!=null?r:""],s.getAttribute("data-sentient-type")].find(x=>re.includes(x)))!=null?i:null,f=oe(s),p=(d=a!=null?a:(u=t.typeOf)==null?void 0:u.call(t,s))!=null?d:ae(f).type,o=X(s,h),g=o?`nc-${p}-${le(JSON.stringify({id:(y=o.id)!=null?y:null,dataAttr:(S=o.dataAttr)!=null?S:null,selector:(m=o.selector)!=null?m:null})).toString(36)}`:`nc-${p}`;k.set(s,g);let _=J.filter(([,x])=>x.test(f.bodyText)).map(([x])=>x);P.push(te(O({componentId:g,semanticType:p,source:a?"markup":"auto"},o?{locator:o}:{}),{observation:O(O({tag:f.tag,idClass:f.idClass.slice(0,200),headingText:f.headingText,textLength:f.textLength,actionCount:f.actionCount},f.ariaRole?{ariaRole:f.ariaRole}:{}),_.length>0?{patternFlags:_}:{})}))}let K=(T=(A=(I=(b=h.defaultView)!=null?b:typeof window!="undefined"?window:void 0)==null?void 0:I.location)==null?void 0:A.pathname)!=null?T:"/";We(t.apiKey,W,K,P);let R=Re(h),V=()=>{let s;try{s=R.snapshot()}catch(a){return}try{e.track({projectId:t.apiKey,componentId:Fe,eventType:"interaction_stats",payload:s})}catch(a){}},v=new Map,L=s=>{let a=v.get(s);return a||(a={ms:0,scroll:0,enterAt:null,intersecting:!1},v.set(s,a)),a},M=new IntersectionObserver(s=>{for(let a of s){let f=k.get(a.target);if(!f)continue;let p=L(f);a.isIntersecting?(p.intersecting=!0,p.enterAt=Date.now(),a.intersectionRatio>p.scroll&&(p.scroll=a.intersectionRatio)):(p.intersecting=!1,p.enterAt!=null&&(p.ms+=Date.now()-p.enterAt,p.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let s of k.keys())M.observe(s);let E=(s=!1)=>{var a;let f=Date.now();for(let[p,o]of v)if(o.enterAt!=null&&(o.ms+=f-o.enterAt,o.enterAt=null),!(o.ms<=0)){try{e.track({projectId:t.apiKey,componentId:p,eventType:"dwell",payload:{dwell_time:Math.round(o.ms),scroll_depth:Number(o.scroll.toFixed(2))}})}catch(g){}o.ms=0}if(V(),s)try{(a=e.flush)==null||a.call(e)}catch(p){}},j=()=>{if(h.hidden)E(!0);else{let s=Date.now();for(let a of v.values())a.intersecting&&(a.enterAt=s)}},$=!1,U=s=>{if(E(!0),s!=null&&s.persisted){$=!0;return}try{M.disconnect()}catch(a){}},C=s=>{if(!(s!=null&&s.persisted)||!$)return;$=!1;let a=Date.now();for(let f of v.values())f.enterAt=f.intersecting&&!h.hidden?a:null};h.addEventListener("visibilitychange",j);let w=(N=h.defaultView)!=null?N:typeof window!="undefined"?window:void 0;w==null||w.addEventListener("pagehide",U),w==null||w.addEventListener("pageshow",C);let q=setInterval(()=>{if(h.hidden||$)return;E();let s=Date.now();for(let a of v.values())a.intersecting&&(a.enterAt=s)},Ue),F=[];return t.microSignals&&[...k.entries()].forEach(([s,a],f)=>{F.push(ie((p,o={})=>{try{e.track({projectId:t.apiKey,componentId:a,eventType:"micro_signal",payload:O({signalType:p},o)})}catch(g){}},s,void 0,{tabLoss:f===0}))}),()=>{E(!0),clearInterval(q),R.stop(),h.removeEventListener("visibilitychange",j),w==null||w.removeEventListener("pagehide",U),w==null||w.removeEventListener("pageshow",C);for(let s of F)s();try{M.disconnect()}catch(s){}}}return we(Ve);})();
|
package/dist/preview.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __sentientPreview=(()=>{var f=Object.defineProperty,U=Object.defineProperties,
|
|
1
|
+
"use strict";var __sentientPreview=(()=>{var f=Object.defineProperty,U=Object.defineProperties,F=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertyNames,I=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var E=(e,t,n)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d=(e,t)=>{for(var n in t||(t={}))C.call(t,n)&&E(e,n,t[n]);if(I)for(var n of I(t))W.call(t,n)&&E(e,n,t[n]);return e},A=(e,t)=>U(e,j(t));var H=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},V=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of G(t))!C.call(e,r)&&r!==n&&f(e,r,{get:()=>t[r],enumerable:!(a=F(t,r))||a.enumerable});return e};var z=e=>V(f({},"__esModule",{value:!0}),e);var ae={};H(ae,{parseContextPreview:()=>$,parsePersonaPreview:()=>K,parsePreview:()=>R,runPreview:()=>Q});var q={discovered:"d-",campaign:"c-",retargeting:"r-",arrival:"a-"},oe=Object.values(q);var O=["new","browsing","carted","customer","lapsed"];var le=1800*1e3;var p="data-sentient-stage";function g(e,t){return!t||typeof e!="string"||!(e==="returning"||O.includes(e))?null:t!=="detailed"&&(e==="customer"||e==="lapsed")?"returning":e}function m(e,t=document){try{e?t.documentElement.setAttribute(p,e):t.documentElement.removeAttribute(p)}catch(n){}}var X="__snt_editor_token";function P(){try{return typeof sessionStorage!="undefined"?sessionStorage.getItem(X):null}catch(e){return null}}function T(e){let t=null;try{let n=location.hash.slice(1),a=RegExp("(^|[?&])"+e+"=([^&]*)").exec(n);if(a){t=a[2];let r=n.slice(a.index+a[0].length);a[1]!="&"&&r[0]=="&"&&(r=a[1]+r.slice(1));let l=n.slice(0,a.index)+r;history.replaceState(history.state,"",l?"#"+l:location.pathname+location.search)}}catch(n){}return t}var Y=5e3;function J(e,t){let n,a=new Promise(r=>{n=setTimeout(()=>r(null),t)});return Promise.race([e,a]).then(r=>(clearTimeout(n),r),r=>{throw clearTimeout(n),r})}var Z={position:"fixed",bottom:"16px",zIndex:"2147483647",background:"#111827",color:"#fff",boxShadow:"0 10px 34px rgba(0,0,0,0.45)"};async function Q(e){let t=$(window.location.search),n=R(window.location.search),a=K(window.location.search);return n?(await te(e,n,t,a),!0):a||t?(await ne(e,a!=null?a:"",t),e.dbg("persona preview",a,t),!0):!1}function $(e){try{let t=new URLSearchParams(e).get("sentient_context");return t&&/^[a-z_]{1,40}$/.test(t)?t:null}catch(t){return null}}function R(e){let t=new URLSearchParams(e).get("sentient_preview");if(!t)return null;let n={};for(let a of t.split("|")){let r=a.indexOf(":"),l=r===-1?"":a.slice(0,r),s=r===-1?"":a.slice(r+1);if(!(!l||!s))if(s.includes("=")){let o={};for(let i of s.split(",")){let[u,c]=i.split("=");u&&c&&(o[u]=c)}Object.keys(o).length&&(n[l]=o)}else n[l]=s}return Object.keys(n).length?n:null}function K(e){try{return new URLSearchParams(e).get("sentient_persona")||null}catch(t){return null}}var M="sentient-persona-preview-banner";function L(e,t,n,a){var r;try{if(typeof document=="undefined"||document.getElementById(M))return;let l=e.charAt(0).toUpperCase()+e.slice(1).replace(/[_-]+/g," "),s=document.createElement("div");s.id=M,s.setAttribute("role","status"),Object.assign(s.style,Z,{left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:"12px",padding:"10px 14px",borderRadius:"999px",font:"13px/1 system-ui, sans-serif",border:"1px solid rgba(255,255,255,0.14)"});let o=document.createElement("span"),i=n?` \xB7 ${n.replace(/_/g," ")} visitors${a?" (not served until stage serving is on)":""}`:"";o.textContent=(t?`\u201C${e}\u201D isn\u2019t in your personas \u2014 showing the default experience`:e?`Previewing as ${l}`:"Previewing")+i;let u=document.createElement("button");u.type="button",u.textContent="Exit preview",Object.assign(u.style,{cursor:"pointer",border:"1px solid rgba(255,255,255,0.3)",background:"transparent",color:"#fff",font:"inherit",padding:"4px 10px",borderRadius:"999px"}),u.addEventListener("click",()=>{try{let c=new URL(window.location.href);c.searchParams.delete("sentient_persona"),c.searchParams.delete("sentient_context"),window.location.href=c.pathname+c.search+c.hash}catch(c){}}),s.appendChild(o),s.appendChild(u),((r=document.body)!=null?r:document.documentElement).appendChild(s)}catch(l){}}function ee(){var e;return(e=T("sentient_preview_token"))!=null?e:P()}function N(e,t){let n=e.cfg;return J(fetch(`${e.apiBase}/v1/explain`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${n.apiKey}`},body:JSON.stringify(t)}).then(a=>a.ok?a.json():null).catch(()=>null),Y)}async function te(e,t,n=null,a=null){var o;let r=e.cfg,l=(o=r.registry)!=null?o:Object.keys(r.slots).length===0,s=ee();if(l){let i=await N(e,A(d(d(d({slotsFrom:"registry",includeDrafts:!0},s?{previewToken:s}:{}),n?{context:n}:{}),a?{persona:a}:{}),{force:Object.fromEntries(Object.entries(t).filter(u=>typeof u[1]=="string"))}));if(!(i!=null&&i.slotConfig)){e.exposeGlobal(),e.dbg("preview mode: slot config unavailable \u2014 page left as-is");return}e.set({slotConfig:i.slotConfig,look:i})}e.set({slots:t,persona:null}),e.apply(),e.installSpaHooks(),e.exposeGlobal(),e.dbg("preview mode",t)}async function ne(e,t,n=null){var h,v,y,S,b,w,_,k,x;let a=e.cfg,r=(h=a.registry)!=null?h:Object.keys(a.slots).length===0,l=n?{context:n}:{},s=await N(e,d(r?{persona:t,slotsFrom:"registry"}:{persona:t,slots:Object.entries(a.slots).map(([D,B])=>({id:D,dims:B.dims}))},l));if(!s){e.exposeGlobal(),e.dbg("persona preview: explain unavailable \u2014 page left as-is");return}let o=s,i=(S=(y=(v=o.personaAttributes)==null?void 0:v.persona)!=null?y:o.persona)!=null?S:t,u=(w=(b=o.personaAttributes)==null?void 0:b.confidence)!=null?w:"high";e.set({slots:(_=o.slots)!=null?_:{},slotConfig:(k=o.slotConfig)!=null?k:null,look:o,persona:{persona:i,band:u},decided:!0}),e.apply(),e.installSpaHooks(),e.exposeGlobal(),n&&a.stageAttributes&&m(g(n,a.stageAttributes));let c=o.contextServing===!1;t&&o.recognized===!1?L(t,!0,n,c):L(t?(x=o.personaDisplay)!=null?x:i:"",!1,n,c)}return z(ae);})();
|
package/dist/snippet.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var SentientSnippet=(()=>{var Bt=Object.defineProperty,Zo=Object.defineProperties,Qo=Object.getOwnPropertyDescriptor,ei=Object.getOwnPropertyDescriptors,ti=Object.getOwnPropertyNames,Sr=Object.getOwnPropertySymbols;var _r=Object.prototype.hasOwnProperty,ni=Object.prototype.propertyIsEnumerable;var wr=(e,t,n)=>t in e?Bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))_r.call(t,n)&&wr(e,n,t[n]);if(Sr)for(var n of Sr(t))ni.call(t,n)&&wr(e,n,t[n]);return e},Ke=(e,t)=>Zo(e,ei(t));var kr=(e,t)=>()=>(e&&(t=e(e=0)),t);var Er=(e,t)=>{for(var n in t)Bt(e,n,{get:t[n],enumerable:!0})},ri=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ti(t))!_r.call(e,o)&&o!==n&&Bt(e,o,{get:()=>t[o],enumerable:!(r=Qo(t,o))||r.enumerable});return e};var oi=e=>ri(Bt({},"__esModule",{value:!0}),e);var fi,pi,gi,Or,mi,hi,Tr,j,qe,Pn=kr(()=>{"use strict";fi=Object.defineProperty,pi=Object.defineProperties,gi=Object.getOwnPropertyDescriptors,Or=Object.getOwnPropertySymbols,mi=Object.prototype.hasOwnProperty,hi=Object.prototype.propertyIsEnumerable,Tr=(e,t,n)=>t in e?fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j=(e,t)=>{for(var n in t||(t={}))mi.call(t,n)&&Tr(e,n,t[n]);if(Or)for(var n of Or(t))hi.call(t,n)&&Tr(e,n,t[n]);return e},qe=(e,t)=>pi(e,gi(t))});var Gr={};Er(Gr,{LOCAL_ENGINE_AVAILABLE:()=>Si,createLocalEngine:()=>wi});function wi(e){throw new Error("[sentient] createLocalEngine is not available in production builds. The local engine only exists under the `development` export condition.")}var Si,Fr=kr(()=>{"use strict";Si=!1});var Ds={};Er(Ds,{applyPersonaAttributes:()=>ln,applyRegistrySlots:()=>dn,applySlotArms:()=>cn,applySlotAttributes:()=>un,consentWatcher:()=>Xe,parseSnippetConfig:()=>nn,planReorder:()=>pn,reapply:()=>Rt,run:()=>qo,version:()=>It});function Ve(e){return e?`_${e.slice(0,12)}`:""}var We="_snt_uid";function yt(e){return`${We}${Ve(e)}`}var In="__sntForgetGen",ii=()=>{try{return window[In]}catch(e){return}};function Kt(e){var t,n;try{let r=window,o=(t=r[In])!=null?t:r[In]={};o[e]=((n=o[e])!=null?n:0)+1}catch(r){}}function fe(e){var t,n;return(n=(t=ii())==null?void 0:t[e])!=null?n:0}var ot="_snt_snap:",si=["low","medium","high"];function it(e){try{let t=localStorage.getItem(ot+e);if(!t)return null;let n=JSON.parse(t);if(!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!si.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"||!(Date.now()-n.savedAt<2592e6)||!(n.slotConfig===void 0||typeof n.slotConfig=="object"&&n.slotConfig!==null&&!Array.isArray(n.slotConfig)))return null;let r=n.vocabulary;return r!==void 0&&(typeof r!="object"||r===null||!Array.isArray(r.entries)||!Array.isArray(r.images))&&delete n.vocabulary,n.stage!==void 0&&typeof n.stage!="string"&&delete n.stage,n}catch(t){return null}}function He(e,t){try{localStorage.setItem(ot+e,JSON.stringify(t))}catch(n){}}function je(e){if(typeof AbortController!="function")return{clear:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function Tn(e,t){return new Promise(n=>{let r=setTimeout(()=>n(!1),t),o=()=>{clearTimeout(r),n(!0)};e.then(o,o)})}function ze(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function jt(e){if(e.ok===!0)return"delivered";let{status:t}=e;return typeof t!="number"?"retry":t>=200&&t<300?"delivered":t>=400&&t<500&&t!==429?"dropped":"retry"}function Ar(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let r=JSON.parse(n);return Array.isArray(r)?(localStorage.removeItem(e),r.slice(-t)):[]}catch(n){return[]}}function On(e,t,n){try{let r=(()=>{try{let s=localStorage.getItem(n);if(!s)return[];let a=JSON.parse(s);return Array.isArray(a)?a:[]}catch(s){return[]}})(),o=new Map;for(let s of r)o.set(s.id,s);for(let s of e)o.set(s.id,s);localStorage.setItem(n,JSON.stringify([...o.values()].slice(-t)))}catch(r){}}function xr(e,t){try{let n=localStorage.getItem(t);if(!n)return;let r=JSON.parse(n);if(!Array.isArray(r))return;let o=new Set(e),s=r.filter(a=>!o.has(a.id));if(s.length===r.length)return;s.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(s))}catch(n){}}var ai=500,li=56*1024;function Gt(e){return`_snt_retry_${e.slice(0,12)}`}var ui={push:()=>{},flush:()=>{},destroy:()=>{}};function Cr(e){var t,n,r;if(typeof window=="undefined")return ui;let o=(t=e.flushIntervalMs)!=null?t:5e3,s=(n=e.maxBatchSize)!=null?n:20,a=(r=e.maxRetrySize)!=null?r:100,l=e.ingestUrl,i=e.apiKey,u=Gt(i),c=!1,g=fe(i),y=(...k)=>{!c&&fe(i)===g&&On(...k)},S=[],w=new Set,b=[],B=k=>{for(let z of k)K.delete(z),!w.has(z)&&(w.add(z),b.push(z));for(;b.length>ai;){let z=b.shift();z&&w.delete(z)}xr(k,u)},K=new Set,_=()=>{for(;S.length>a;){let k=S.shift();k&&K.delete(k.id)}},C=k=>{w.has(k.id)||K.has(k.id)||(K.add(k.id),S.push(k),_())},I=k=>{for(let z of k)w.has(z.id)||(K.add(z.id),S.push(z));_()},M=Ar(u,a);for(let k of M)C(k);let O=0,m=0,v=(k,z=!0)=>{if(k.length===0)return;let _e=JSON.stringify(k),X=k.map(ge=>ge.id),ne,ce=je(15e3);try{ne=fetch(l,{method:"POST",keepalive:!0,signal:ce.signal,body:_e,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})}catch(ge){y(k,a,u),I(k),m++,O=Date.now()+ze(m);return}Promise.resolve(ne).then(ce.clear,ce.clear);let Ce=ge=>{if(jt(ge)!=="retry"){if(!ge.ok&&z){let Q=k.filter($e=>$e.eventType!=="pageview");if(Q.length>0&&Q.length<k.length){B(k.filter($e=>$e.eventType==="pageview").map($e=>$e.id)),v(Q,!1);return}}B(X),m=0,O=0;return}y(k,a,u),I(k),m++,O=Date.now()+ze(m)};ne&&typeof ne.then=="function"?ne.then(Ce).catch(()=>{y(k,a,u),I(k),m++,O=Date.now()+ze(m)}):Ce(ne)},f=typeof TextEncoder!="undefined"?new TextEncoder:null,p=k=>f?f.encode(k).length:k.length,E=k=>{let z=[],_e=2;for(let X of k){let ne=p(JSON.stringify(X))+1;if(z.length>0&&_e+ne>li||z.length>=s)break;z.push(X),_e+=ne}return z},D=()=>{try{if(Date.now()<O)return;for(;S.length>0&&!(Date.now()<O);){let k=S.filter(_e=>!w.has(_e.id));if(S.length=0,k.length===0)break;let z=E(k);if(z.length===0)break;z.length<k.length&&S.push(...k.slice(z.length)),v(z)}}catch(k){}},H=!0,Y=null;Y=setInterval(()=>{H&&D()},o);let le=()=>{document.visibilityState==="hidden"&&D()},we=()=>{D()};return document.addEventListener("visibilitychange",le),window.addEventListener("pagehide",we),{push(k){C(k),S.length>=s&&D()},flush:D,destroy(k){k!=null&&k.forget&&(c=!0),H=!1,Y!==null&&(clearInterval(Y),Y=null),document.removeEventListener("visibilitychange",le),window.removeEventListener("pagehide",we),D()}}}var ci=200;function Ft(e){return`_snt_goal_retry_${e.slice(0,12)}`}var di={send:()=>{},flush:()=>{},destroy:()=>{}};function Ir(e){var t,n,r;if(typeof window=="undefined")return di;let o=(t=e.flushIntervalMs)!=null?t:5e3,s=(n=e.maxRetrySize)!=null?n:100,a=(r=e.maxPerFlush)!=null?r:5,l=Ft(e.apiKey),i=!1,u=fe(e.apiKey),c=(...p)=>{!i&&fe(e.apiKey)===u&&On(...p)},g=[],y=new Set,S=new Set,w=[],b=0,B=0,K=!1,_=p=>{for(y.delete(p.id),S.has(p.id)||(S.add(p.id),w.push(p.id));w.length>ci;){let E=w.shift();E&&S.delete(E)}xr([p.id],l)},C=p=>{c([p],s,l),!S.has(p.id)&&!y.has(p.id)&&(y.add(p.id),g.push(p)),Date.now()>=b&&(B++,b=Date.now()+ze(B))},I=p=>{let E,D=je(15e3);try{E=fetch(e.url,{method:"POST",keepalive:!0,signal:D.signal,body:p.body,headers:e.headers})}catch(Y){C(p);return}let H=Y=>{var le;let we=jt(Y);if(we==="retry"){C(p);return}we==="dropped"&&((le=e.onDrop)==null||le.call(e,p,Y.status)),_(p),B=0,b=0};Promise.resolve(E).then(D.clear,D.clear),E&&typeof E.then=="function"?E.then(H).catch(()=>C(p)):H(E)},M=()=>{try{if(K||Date.now()<b)return;let p=0;for(;g.length>0&&p<a&&!(Date.now()<b);){let E=g.shift();y.delete(E.id),!S.has(E.id)&&(p++,I(E))}}catch(p){}},O=Ar(l,s);for(let p of O)y.has(p.id)||(y.add(p.id),g.push(p));O.length>0&&On(O,s,l);let m=setInterval(M,o),v=()=>{document.visibilityState==="hidden"&&M()},f=()=>M();return document.addEventListener("visibilitychange",v),window.addEventListener("pagehide",f),{send(p){if(K){S.has(p.id)||c([p],s,l);return}if(!(S.has(p.id)||y.has(p.id))){if(Date.now()<b){c([p],s,l),y.add(p.id),g.push(p);return}I(p)}},flush:M,destroy(p){p!=null&&p.forget&&(i=!0),clearInterval(m),document.removeEventListener("visibilitychange",v),window.removeEventListener("pagehide",f),M(),K=!0}}}function Ln(e){let t=(e||"").toLowerCase();if(!t.includes(".")||/^[\d.]+$|:/.test(t))return[];let n=t.split("."),r=[];for(let o=n.length-2;o>=0;o--)r.push(n.slice(o).join("."));return r}function st(e){if(typeof window=="undefined"||!e)return!1;Kt(e);let t=!1,n=yt(e);try{if(new RegExp(`(?:^|; )${n}=`).test(document.cookie)){let a=location.protocol==="https:"?"; Secure":"";for(let l of["",...Ln(location.hostname)])document.cookie=`${n}=; max-age=0; SameSite=lax; path=/${l?`; domain=${l}`:""}${a}`;t=!0}}catch(a){}let r=Ve(e),o=[n,"_snt_graph_edges",ot+e,Gt(e),Ft(e),`_snt_graph_nodes${r}`],s=[`_snt_asgn${r}_`];for(let a of["localStorage","sessionStorage"])try{let l=window[a];for(let i of o)l.getItem(i)!==null&&(l.removeItem(i),t=!0);for(let i=l.length-1;i>=0;i--){let u=l.key(i);u&&s.some(c=>u.startsWith(c))&&(l.removeItem(u),t=!0)}}catch(l){}try{(new RegExp(`(?:^|; )${We}=[^;]`).test(document.cookie)||localStorage.getItem(We)!==null||sessionStorage.getItem(We)!==null)&&localStorage.setItem(`${We}_tomb${r}`,"1")}catch(a){}return t}Pn();function Ut(e){return Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("|")}function Lr(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 Rn(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 Ut(e.baseline);if(typeof e.baseline=="string")return e.baseline;let o={};for(let[s,a]of Object.entries((n=e.dims)!=null?n:{}))o[s]=(r=a[0])!=null?r:"";return Ut(o)}function Pr(e,t){var n,r;return e.dims!=null?(r=(n=Lr(t))!=null?n:Lr(Rn(e)))!=null?r:{}:t}function Je(e){return e>=.3?e<.7?"medium":"high":"low"}var Rr=["new","browsing","carted","customer","lapsed"];var yi=["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 Nr(e){return vi(e)!==null}function vi(e){var t;if(!e)return null;let n=e.toLowerCase();return(t=yi.find(r=>n.includes(r.toLowerCase())))!=null?t:null}function Dr(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 Mr(e,t,n){if(!e)return"direct";try{let r=new URL(e);if(t)try{if(new URL(t).host===r.host)return"direct"}catch(s){}let o=r.hostname.toLowerCase();return n&&`.${o}`.endsWith(`.${n}`)?"direct":/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(o)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(o)?"social":"referral"}catch(r){return"direct"}}function $r(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var bi=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function Br(e){let t={},n={};try{let r=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([o,s])=>{let a=Array.isArray(s)?s[0]:s;return a===void 0?[]:[[o,a]]});for(let[o,s]of r)o.startsWith("utm_")?o in t||(t[o]=s):bi.includes(o)&&(o in n||(n[o]=s))}catch(r){}return{utmParams:t,clickIds:n}}function Kr(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function Nn(e){return j(j(j({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 Dn(e){let t=Nn(e);return Pr(t,Rn(t))}function jr(e){return typeof e=="string"?e:Ut(e)}Pn();var jn;function Yt(e){jn=typeof e=="string"&&e!==""?e:void 0}function Hr(e=document){if(jn)return jn;try{let t=e.querySelector("script[nonce]");return(t==null?void 0:t.nonce)||(t==null?void 0:t.getAttribute("nonce"))||void 0}catch(t){return}}function Ge(e,t=document){let n=Hr(t);return n&&e.setAttribute("nonce",n),e}function qr(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(e){}try{if(typeof crypto!="undefined"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0"),(n===3||n===5||n===7||n===9)&&(t+="-");return t}}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 Ur="_snt_uid",_i=365,at="_snt_uid";function ki(){return qr()}function lt(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function Jr(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function qt(e,t,n,r){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${r?`; domain=${r}`:""}${Jr()}`}catch(o){}}function Vt(e){try{return localStorage.getItem(e)}catch(t){return null}}function Vr(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function Mn(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function Ei(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function Ai(e){try{sessionStorage.removeItem(e)}catch(t){}}function xi(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=lax; path=/${Jr()}`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function Ci(e){try{localStorage.removeItem(e)}catch(t){}}function Ht(e,t){qt(e,"",0,t)}var Ii={getSessionId:()=>null,isEphemeral:()=>!1,domain:null,destroy:()=>{}};function Oi(e,t){if(e===!1)return null;if(typeof e=="string")return e.replace(/^\./,"");for(let n of Ln(location.hostname))if(qt(t,"1",10,n),lt(t)==="1")return Ht(t,n),n;return null}function Yr(e){var t,n,r,o,s,a,l;if(typeof window=="undefined")return Ii;let i=Ve(e==null?void 0:e.apiKey),u=(t=e==null?void 0:e.cookieName)!=null?t:yt(e==null?void 0:e.apiKey),c=`${at}${i}`,g=`${at}_tomb${i}`,y=((n=e==null?void 0:e.cookieTTLDays)!=null?n:_i)*24*60*60,S=m=>m&&m.length>0?m:null,w=()=>{var m,v;return i&&!(e!=null&&e.cookieName)&&Vt(g)===null?(v=(m=S(lt(Ur)))!=null?m:S(Vt(at)))!=null?v:S(Mn(at)):null},b=Oi(e==null?void 0:e.cookieDomain,`${u}_dom`),B=S(lt(u)),K=b?(Ht(u),S(lt(u))):null,_=(l=(a=(s=(o=(r=K!=null?K:B)!=null?r:S(Vt(c)))!=null?o:S(Mn(c)))!=null?s:w())!=null?a:S(e==null?void 0:e.ssrSessionId))!=null?l:ki();qt(u,_,y,b),b&<(u)!==_&&(b=null,qt(u,_,y));let C=Vr(c,_),I=xi(u),M=C?!1:Ei(c,_),O=!C&&!I&&!M;return{getSessionId:()=>_,isEphemeral:()=>O,domain:b,destroy:()=>{_=null,Ht(u),Ht(u,b),Ci(c),Ai(c),i&&!(e!=null&&e.cookieName)&&(lt(Ur)!==null||Vt(at)!==null||Mn(at)!==null)&&Vr(g,"1")}}}var Ti=1800*1e3;function Wt(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Li(e=Ti,t){let n=new Map,r=`_snt_asgn${Ve(t)}_`,o=(i,u)=>`${r}${encodeURIComponent(i)}:${encodeURIComponent(u)}`,s=i=>{let u=i.slice(r.length),c=u.indexOf(":");if(c<0)return null;try{return{componentId:decodeURIComponent(u.slice(0,c)),segment:decodeURIComponent(u.slice(c+1))}}catch(g){return null}},a=()=>{try{let i=[];for(let u=0;u<localStorage.length;u++){let c=localStorage.key(u);c!=null&&c.startsWith(r)&&i.push(c)}return i}catch(i){return[]}},l=i=>i.assignedAt+(i.ttlMs&&i.ttlMs>0?i.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let i of a())try{let u=localStorage.getItem(i);if(!u)continue;let c=JSON.parse(u);if(l(c)){localStorage.removeItem(i);continue}let g=s(i);if(!g)continue;n.set(Wt(g.componentId,g.segment),c)}catch(u){}})(),{get(i,u){let c=n.get(Wt(i,u));return c?l(c)?(n.delete(Wt(i,u)),null):c:null},set(i,u,c){let g=Wt(i,u);n.set(g,c);try{localStorage.setItem(o(i,u),JSON.stringify(c))}catch(y){}},clear(){n.clear();for(let i of a())try{localStorage.removeItem(i)}catch(u){}}}}var Gn="data-sentient-stage";function bt(e,t){return!t||typeof e!="string"||!(e==="returning"||Rr.includes(e))?null:t!=="detailed"&&(e==="customer"||e==="lapsed")?"returning":e}function Xt(e,t=document){try{e?t.documentElement.setAttribute(Gn,e):t.documentElement.removeAttribute(Gn)}catch(n){}}var Fn="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",Xr="[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.",Wr=!1,zt=!1;function Pi(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function Ri(e){var t;let n=Yr({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),r=(t=n.getSessionId())!=null?t:"local",o=Pi(),s=Promise.resolve().then(()=>(Fr(),Gr)).then(c=>{let g=c;return g.LOCAL_ENGINE_AVAILABLE?(Wr||(Wr=!0,console.info(Xr)),g):(zt||(zt=!0,console.error(Fn)),null)}).catch(()=>(zt||(zt=!0,console.error(Fn)),null)),a=null,l={low:.15,medium:.5,high:.85},i=(()=>{var c;if(e.initialPersona)return j({},e.initialPersona);let g=it(e.apiKey||"local");return g?{persona:g.persona,confidence:(c=l[g.band])!=null?c:.15}:null})();function u(c){let g=document.documentElement;g.dataset.sentientPersona===void 0&&(g.dataset.sentientPersona=c.persona,g.dataset.sentientConfidence=Je(c.confidence))}return{isLocal:!0,async decide(c){var g,y,S;let w=await s;if(!w)return null;let b=w.createLocalEngine({sessionId:r,forcedPersona:o}).decide(c);return a=qe(j({},b),{layoutOrder:(y=(g=b.layoutOrder)!=null?g:a==null?void 0:a.layoutOrder)!=null?y:null,slots:j(j({},(S=a==null?void 0:a.slots)!=null?S:{}),b.slots)}),He(e.apiKey||"local",{v:1,persona:a.persona,band:Je(a.confidence),slots:a.slots,layoutOrder:a.layoutOrder,savedAt:Date.now()}),u(b),b},getSlotResult(c){var g,y,S;return(S=(y=a==null?void 0:a.slots[c])!=null?y:(g=e.initialSlots)==null?void 0:g[c])!=null?S:null},getSlotConfig(c){var g,y;return(y=(g=e.initialSlotConfig)==null?void 0:g[c])!=null?y:null},getSitePalette(){var c;return(c=e.initialPalette)!=null?c:null},reportSlots(){},getVisitorId:()=>null,getPersona(){let c=a!=null?a:i;return c?{persona:c.persona,confidence:c.confidence,band:Je(c.confidence)}:null},async assign(c,g){var y;let S=await s;return!S||!g||g.length===0?g!=null&&g[0]?{variantId:g[0],assignmentTtlMs:0}:null:{variantId:(y=S.createLocalEngine({sessionId:r,forcedPersona:o}).decide({components:[{id:c,variantIds:g}]}).assignments[c])!=null?y:g[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>n.destroy()}}var Zt=/^(\*|\/[^\s?#*]*(\/\*)?)$/;function $n(e){let t=e.split(/[?#]/)[0]||"/";return t.length>1?t.replace(/\/+$/,"")||"/":t}function Vn(e,t){if(e===void 0||!Zt.test(e))return!1;if(e==="*")return!0;let n=$n(t);if(e.endsWith("/*")){let r=$n(e.slice(0,-2));return n.startsWith(r==="/"?"/":`${r}/`)&&n!==r}return n===$n(e)}function Wn(e,t){if(!e)return!1;if(e==="/")return t==="/";let n=e.endsWith("/")?e.slice(0,-1):e;return t===n||t.startsWith(`${n}/`)}function St(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="form"?!0:Array.isArray(t.children)?t.children.some(St):!1}var zr="sentient-reveal",ut="sentient-revealed",Zr=240,Bn=!1;function Ni(e){if(Bn||e.getElementById(zr)){Bn=!0;return}let t=Ge(e.createElement("style"),e);t.id=zr,t.textContent=`@media (prefers-reduced-motion: no-preference){@keyframes ${ut}{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:none}}.${ut}{animation:${ut} ${Zr}ms cubic-bezier(.2,.6,.2,1) both}}`,e.head.appendChild(t),Bn=!0}function zn(e,t={}){var n;let r=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!r||!(e instanceof Element)||(t.arm!==void 0&&e.setAttribute("data-sentient-arm",t.arm),t.persona!==void 0&&e.setAttribute("data-sentient-persona",t.persona),t.previous!==void 0&&t.previous===e.textContent))return!1;Ni(r),e.classList.remove(ut),e.offsetWidth,e.classList.add(ut);let o=()=>{e.classList.remove(ut),e.removeEventListener("animationend",o)};return e.addEventListener("animationend",o),!0}function Hn(e,t,n,r){let o=[];{let s=!1,a=[],l=()=>{if(s)return;let i=Date.now();for(a.push(i);a.length>0&&i-a[0]>500;)a.shift();a.length>=3&&(s=!0,e("rage_click"))};t.addEventListener("click",l),o.push(()=>t.removeEventListener("click",l))}{let s=!1,a=l=>{if(s||!(l.target instanceof Node)||!t.contains(l.target)&&t!==l.target)return;s=!0;let i=typeof window!="undefined"?window.getSelection():null,u=i?i.toString().length:0;e("text_copy",{selectionLength:u})};document.addEventListener("copy",a),o.push(()=>document.removeEventListener("copy",a))}{let s=!1,a=!1,l=null,i=()=>{l!==null&&(clearTimeout(l),l=null)},u=()=>{s||!a||(i(),l=setTimeout(()=>{!s&&a&&(s=!0,e("scroll_hesitation"))},3e3))},c=()=>{i(),u()},g=S=>{for(let w of S)a=w.intersectionRatio>.3,a?u():i()},y=new IntersectionObserver(g,{threshold:[.3]});y.observe(t),window.addEventListener("scroll",c,{passive:!0}),o.push(()=>{y.disconnect(),window.removeEventListener("scroll",c),i()})}if((r==null?void 0:r.tabLoss)!==!1){let s=!1,a=n!=null?n:Date.now(),l=()=>{if(s||document.visibilityState!=="hidden")return;let i=Date.now()-a;i<15e3&&(s=!0,e("tab_loss",{timeOnPage:i}))};document.addEventListener("visibilitychange",l),o.push(()=>document.removeEventListener("visibilitychange",l))}return()=>{for(let s of o)s()}}function Di(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var Qr="https://api.sentient-ui.com/v1/events",pe=new Map,eo=null;function Mi(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var $i=3;function Kn(){return qr()}function Jt(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function Bi(){let e=new WeakMap,t=new Map,n=!1,r=(l,i,u)=>{let c=l.get(i);return u===null?c?!0:(l.set(i,new Set),!1):c?c.has(u)?!0:(c.add(u),!1):(l.set(i,new Set([u])),!1)},o=typeof window!="undefined"&&"event"in window,s=()=>{if(!o)return;let l=window.event;return typeof Event=="function"&&l instanceof Event?l:void 0},a=()=>{if(o){Promise.resolve().then(()=>{n=!1,t.clear()});return}let l=!1,i=()=>{l||(l=!0,n=!1,t.clear())};if(setTimeout(i,0),typeof MessageChannel=="function"){let u=new MessageChannel;u.port1.onmessage=()=>{u.port1.close(),u.port2.close(),i()},u.port2.postMessage(0)}};return{firedBefore(l,i){let u=s();if(u){let g=e.get(u);return g||(g=new Map,e.set(u,g)),r(g,l,i)}let c=r(t,l,i);return!c&&!n&&(n=!0,a()),c}}}var to=new Set;function Ki(e,t,n){let r=typeof window=="undefined"?null:window.history;if(!r)return()=>{};let o=!1,s,a=()=>{if(o)return;let u=Jt();!u||u===s||(s=u,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${u}`))},l=[];for(let u of["pushState","replaceState"]){let c=r[u],g=function(...y){let S=c.apply(this,y);return a(),S};r[u]=g,l.push([u,c,g])}window.addEventListener("popstate",a);let i=Jt();return i&&to.has(`${t}:${i}`)?s=i:a(),()=>{if(!o){o=!0,window.removeEventListener("popstate",a);for(let[u,c,g]of l)r[u]===g&&(r[u]=c)}}}var vt={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,assign:()=>Promise.resolve(null),decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getVisitorId:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}};function ji(){try{return Br(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function no(e){return e.replace(/\/events\/?$/,"")}function Ye(){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 qn(e){var t;if(typeof window=="undefined")return;let n=e!=null?e:eo;if(!n){console.warn("[sentient] grantConsent() called before init()");return}let r=pe.get(n);if(!r){console.warn("[sentient] grantConsent() called before init()");return}let{config:o,upgrade:s,reinit:a}=r;if(!s){r.upgradeBlockedReason&&console.warn(r.upgradeBlockedReason);return}if(o.respectDoNotTrack!==!1&&Ye())return;let l=(a!=null?a:wt)(qe(j({},o),{consent:!0}));s(l);let i=(t=pe.get(n))==null?void 0:t.dispose;pe.set(n,{config:qe(j({},o),{consent:!0}),upgrade:null,dispose:i})}function Gi(e,t){var n;let r=e.preConsentBehavior==="statistical_winner",o=no((n=e.ingestUrl)!=null?n:Qr),s={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},a=new Map,l=new Map,i={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(m,v,f){if(!r)return Promise.resolve(null);let p=a.get(m);return p?Promise.resolve(p):Un(l,m,async()=>{try{let E=new URLSearchParams({componentId:m});for(let le of v!=null?v:[])E.append("variantIds[]",le);let D=je(5e3),H;try{let le=await fetch(`${o}/winner?${E.toString()}`,{headers:s,signal:D.signal});if(!le.ok)return v!=null&&v[0]?{variantId:v[0],assignmentTtlMs:0}:null;H=await le.json()}finally{D.clear()}let Y={variantId:H.variantId,assignmentTtlMs:0};return a.set(m,Y),Y}catch(E){return v!=null&&v[0]?{variantId:v[0],assignmentTtlMs:0}:null}})},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getVisitorId:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}},u=!1,c=new Set,g=[],y=[],S=[],w=()=>{for(let[,,m]of S.splice(0))m(null);b.length=0},b=[],B=!1,K=()=>{if(u)return;B=!0;let m=pe.get(e.apiKey);(m==null?void 0:m.upgrade)===O&&pe.set(e.apiKey,{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): client released before consent; call init() again"})},_=[],C=()=>{setTimeout(()=>{var m;try{(m=_.shift())==null||m(i)}catch(v){}_.length&&C()})},I=m=>{u?_.length?_.push(m):m(i):!t&&!B&&b.length<100?b.push(m):B&&e.debug&&console.warn("[sentient] goal dropped: client released")},M={get gated(){return!u&&!t},get released(){return B&&!u},takeHeld:()=>b.splice(0),track:m=>i.track(m),goal:((m,v,f,p)=>I(E=>E.goal(m,v,f,p))),componentGoal:(m,v,f)=>i.componentGoal(m,v,f),identify:(m,v)=>i.identify(m,v),getAssignment:(m,v)=>i.getAssignment(m,v),isUnified:m=>{var v,f;return(f=(v=i.isUnified)==null?void 0:v.call(i,m))!=null?f:!1},assign:(m,v,f,p,E)=>i.assign(m,v,f,p,E),decide:m=>u?i.decide(m):B||t?Promise.resolve(null):new Promise(v=>S.push([m,Le(),v])),getSlotResult:m=>i.getSlotResult(m),isSlotDecided:m=>{var v,f;return(f=(v=i.isSlotDecided)==null?void 0:v.call(i,m))!=null?f:!0},getSlotConfig:m=>i.getSlotConfig(m),getSitePalette:()=>i.getSitePalette(),getStyleVocabulary:()=>{var m,v;return(v=(m=i.getStyleVocabulary)==null?void 0:m.call(i))!=null?v:null},reportSlots:(m,v,f,p)=>i.reportSlots(m,v,f,p),reportSkeleton:(m,v)=>{var f;return(f=i.reportSkeleton)==null?void 0:f.call(i,m,v)},reportAgentData:(m,v,f)=>{var p;return(p=i.reportAgentData)==null?void 0:p.call(i,m,v,f)},reportDrift:(m,v,f,p)=>{var E;return(E=i.reportDrift)==null?void 0:E.call(i,m,v,f,p)},requestSlots:(m,v,f)=>{var p;return u?(p=i.requestSlots)==null?void 0:p.call(i,m,v,f):g.push([m,v,f])},decideSlots:m=>{var v;return u?(v=i.decideSlots)==null?void 0:v.call(i,m):y.push(...m)},cancelSlots:m=>{var v;if(u)return(v=i.cancelSlots)==null?void 0:v.call(i,m);let f=new Set(m);for(let p of g)p[0]=p[0].filter(E=>!f.has(E));y=y.filter(p=>!f.has(p.id))},onSlotsChanged:m=>(c.add(m),()=>{c.delete(m)}),getPersona:()=>i.getPersona(),getVisitorId:()=>{var m,v;return(v=(m=i.getVisitorId)==null?void 0:m.call(i))!=null?v:null},fetchWeights:()=>i.fetchWeights(),getGraph:()=>i.getGraph(),flush:()=>i.flush(),dispose:()=>(K(),w(),i.dispose()),destroy:()=>(K(),w(),u?i.destroy():st(e.apiKey))};function O(m){var v,f,p;i=m,u=!0,b.length&&(_.push(...b.splice(0)),C());let E=Le();for(let[D,H,Y]of S.splice(0))H!==E?Y(null):m.decide(D).then(Y,()=>Y(null));(v=m.onSlotsChanged)==null||v.call(m,()=>c.forEach(D=>D()));for(let[D,H,Y]of g.splice(0))D.length>0&&((f=m.requestSlots)==null||f.call(m,D,H,Y));y.length>0&&((p=m.decideSlots)==null||p.call(m,y.splice(0)))}return{proxy:M,setInner:O}}function Le(){return typeof location=="undefined"?"":location.pathname+(/^#!?\//.test(location.hash)?location.hash:"")}function Un(e,t,n){let r=e.get(t);if(r)return r;let o=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,o),o}function wt(e){var t,n,r,o,s,a,l,i,u,c,g;if(typeof window=="undefined")return vt;e.nonce&&Yt(e.nonce),eo=e.apiKey||"local";let y=pe.get(e.apiKey||"local");if(y!=null&&y.dispose)try{y.dispose()}catch(d){}let S=e.respectDoNotTrack!==!1&&Ye(),w=e.consent===!1||S,b=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!b&&e.localMode!==!1)return pe.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): this client is keyless/local \u2014 there is no hosted client to upgrade to. Configure a pk_ API key to enable tracking."}),w?vt:Ri(e);if(w){if(!e.apiKey||!e.apiKey.startsWith("pk_"))return e.preConsentBehavior==="statistical_winner"&&console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),pe.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): the client was initialized with an invalid apiKey (expected a pk_ public key) \u2014 consent cannot enable tracking."}),vt;let{proxy:d,setInner:h}=Gi(e,S);return pe.set(e.apiKey,{config:e,upgrade:S?null:h}),d}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."),vt;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),vt;let B=(t=e.ingestUrl)!=null?t:Qr,K=Date.now(),_=Yr({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey,cookieDomain:e.cookieDomain}),C=Li(void 0,e.apiKey),I=!1,M=fe(e.apiKey),O=()=>!I&&fe(e.apiKey)===M,m=new Set((n=e.initialUnified)!=null?n:[]),v=qe(j({},C),{get:(d,h)=>m.has(d)?null:C.get(d,h),set:(...d)=>{O()&&C.set(...d)}}),f=Cr({ingestUrl:B,apiKey:e.apiKey}),p=no(B),E={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},D=new Set,H=Ir({url:`${p}/goals`,apiKey:e.apiKey,headers:E,onDrop:(d,h)=>{if(!e.debug){if(D.has(h))return;D.add(h)}console.warn(`[sentient] goal dropped (HTTP ${h}) \u2014 this will not be retried. `+(h===400?"The session was not found: call init() and let the session upsert complete before firing goals.":h===401||h===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),d)}}),Y=Dr((r=navigator.userAgent)!=null?r:""),le=window.location.origin,we=Mr((o=document.referrer)!=null?o:"",le,_.domain),k=(s=e.sessionSegment)!=null?s:`${Y}:${we}`,z=new Map,_e=new Map,X=new Map,ne=new Set,ce=new Map,Ce=null,ge=null,Q=null,$e=new Set,Nt=new Set,wn=new Map,_n=new Map,ur=new Set,cr=new Set,dr=new Set,fr=new Set,kn=null,pt=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,pr=new Set,Dt=new Set,Mt=new Set,gt=new Map,En=null,$t=new Set,mt=new Map,An=null,Jo=2,gr=new Map,ke=!1,mr=(d,h,L)=>{var F;let G=new Set,A=1;for(let T of d){h.delete(T);let P=((F=gr.get(T))!=null?F:0)+1;gr.set(T,P),P<=Jo&&(G.add(T),P>A&&(A=P))}G.size>0&&setTimeout(()=>{ke||L(G)},ze(A))},xn=d=>{for(let h of d)X.has(h.id)||X.set(h.id,Dn(h))};if(e.initialSlots)for(let[d,h]of Object.entries(e.initialSlots))X.set(d,h),ne.add(d);if(e.initialSlotConfig)for(let[d,h]of Object.entries(e.initialSlotConfig))ce.set(d,h);e.initialPalette&&(Ce=e.initialPalette),e.initialVocabulary&&(ge=e.initialVocabulary);let Ie=it(e.apiKey);if(Ie){for(let[d,h]of Object.entries(Ie.slots))X.has(d)||X.set(d,h);for(let[d,h]of Object.entries((a=Ie.slotConfig)!=null?a:{}))ce.has(d)||ce.set(d,h);!Ce&&Ie.palette&&(Ce=Ie.palette),!ge&&Ie.vocabulary&&(ge=Ie.vocabulary)}let hr={low:.15,medium:.5,high:.85};if(e.initialPersona)Q=j({},e.initialPersona);else{let d=document.documentElement.dataset;d.sentientPersona?Q={persona:d.sentientPersona,confidence:(i=hr[(l=d.sentientConfidence)!=null?l:"low"])!=null?i:.15}:Ie&&(Q={persona:Ie.persona,confidence:(u=hr[Ie.band])!=null?u:.15})}if(e.initialAssignments)for(let[d,h]of Object.entries(e.initialAssignments))v.set(d,k,{variantId:h,assignedAt:Date.now(),segment:k,confidence:1});let Be=Promise.resolve(),yr=_.getSessionId();if(yr){let d=$r((c=document.referrer)!=null?c:""),{utmParams:h,clickIds:L}=ji(),F=j(j(j(j({sessionId:yr,deviceClass:Y,trafficSource:we,referrerDomain:d,utmParams:h,clickIds:L,landingPath:typeof location!="undefined"?location.pathname:void 0,timeOfDay:Kr(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:_.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Nr((g=navigator.userAgent)!=null?g:"")},e.userId?{userId:e.userId}:{}),e.persona?{persona:e.persona}:{}),e.country?{country:e.country}:{}),e.sdk?{sdk:e.sdk.name,sdkVersion:e.sdk.version}:{}),G=async()=>{for(let A=0;;A++){if(ke||!O())return;let T=je(5e3);try{let P=await fetch(`${p}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(F),headers:E,signal:T.signal});if(P.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");return}if(P.ok||jt(P)==="dropped")return}catch(P){}finally{T.clear()}if(A>=$i){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(P=>setTimeout(P,ze(A+1)))}};try{Be=G()}catch(A){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:f});let Yo=Bi(),ht=null,Cn=!1,ie={goal(d,h={},L=1,F=0){var G,A,T,P,V,W,q;let ee=_.getSessionId();if(!ee||ke||!O())return;let $=Mi(h)?h:{metadata:h},me=[d,(G=$.externalId)!=null?G:"",(A=$.stepIndex)!=null?A:F,(T=$.weight)!=null?T:L].join("\0"),Ee=$.value!==void 0?`${$.value}\0${(P=$.currency)!=null?P:""}`:null;if(Yo.firedBefore(me,Ee)){e.debug&&console.log(`[sentient] goal("${d}") already recorded for this action \u2014 not sent twice`);return}let de=Kn(),se={sessionId:ee,name:d,metadata:(V=$.metadata)!=null?V:{},weight:(W=$.weight)!=null?W:L,stepIndex:(q=$.stepIndex)!=null?q:F,goalId:de,value:$.value,currency:$.currency,externalId:$.externalId};e.debug&&console.log("[sentient] goal",se);let N={id:de,body:JSON.stringify(se)};Be.then(()=>H.send(N))},componentGoal(d,h,L){var F,G,A;let T=_.getSessionId();if(!T||ke||!O())return;let P=v.get(d,k),V=P?null:(F=X.get(d))!=null?F:null;if(!P&&V===null){e.debug&&console.warn(`[sentient] componentGoal("${d}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}if(!P&&!ne.has(d)){e.debug&&console.warn(`[sentient] componentGoal("${d}"): slot not decided this session \u2014 not attributed`);return}let W=P?P.variantId:jr(V),q={id:Kn(),sessionId:T,projectId:e.apiKey,componentId:d,variantId:W,eventType:"goal_achieved",goalType:h,payload:j({reward:(G=L==null?void 0:L.reward)!=null?G:1,goalValue:L==null?void 0:L.value,currency:L==null?void 0:L.currency},(A=L==null?void 0:L.metadata)!=null?A:{}),timestamp:Date.now(),timeInSession:Date.now()-K,path:Jt()};e.debug&&console.log("[sentient] componentGoal",q),Be.then(()=>{!ke&&O()&&f.push(q)})},identify(d,h){let L=_.getSessionId();!L||ke||!O()||Be.then(()=>{fetch(`${p}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:L,userId:d,userHash:h==null?void 0:h.userHash,ephemeral:_.isEphemeral()}),headers:E}).catch(()=>{})})},track(d){let h=_.getSessionId();if(!h||ke||!O()||d.eventType==="variant_assigned"&&X.get(d.componentId)!==void 0&&!ne.has(d.componentId)&&!v.get(d.componentId,k))return;let L=qe(j({path:Jt()},d),{id:Kn(),sessionId:h,timestamp:Date.now(),timeInSession:Date.now()-K});e.debug&&console.log("[sentient] track",L),Be.then(()=>f.push(L))},getAssignment(d,h){return v.get(d,h)},isUnified:d=>m.has(d),async assign(d,h,L,F,G){var A;let T=_.getSessionId();if(!T)return null;let P=(G==null?void 0:G.unified)===!0;if(P&&m.has(d))return{variantId:(A=h==null?void 0:h[0])!=null?A:"",assignmentTtlMs:0,unified:!0};let V=v.get(d,k);if(V&&(h!=null&&h.length||V.content!==void 0)){let W=V.ttlMs&&V.ttlMs>0?Math.max(0,V.assignedAt+V.ttlMs-Date.now()):0;return{variantId:V.variantId,assignmentTtlMs:W,content:V.content}}return Un(z,P?`${d}\0unified`:d,async()=>{if(!await Tn(Be,2500)||ke||!O())return null;let W=je(3e4);try{let q={sessionId:T,componentId:d,variantIds:h};F!==void 0?q.agentDataByVariant=F:L!==void 0&&(q.agentData=L),P&&(q.caps={unified:!0});let ee=await fetch(`${p}/assign`,{method:"POST",body:JSON.stringify(q),headers:E,signal:W.signal});if(!ee.ok)return null;let $=await ee.json();return $.unified===!0?P?(m.add(d),{variantId:$.variantId,assignmentTtlMs:0,unified:!0}):null:(v.set(d,k,j({variantId:$.variantId,assignedAt:Date.now(),segment:k,confidence:1,content:$.content},$.assignmentTtlMs&&$.assignmentTtlMs>0?{ttlMs:$.assignmentTtlMs}:{})),$)}catch(q){return null}finally{W.clear()}})},async decide(d){var h,L;let F=_.getSessionId();if(!F)return null;let G=(h=d.slots)!=null?h:[],A={sessionId:F};d.sections&&d.sections.length>0&&(A.sections=d.sections.map(P=>({id:P}))),A.components=(L=d.components)!=null?L:[],G.length>0&&(A.slots=G.map(Nn)),d.slotsFrom==="registry"&&(A.slotsFrom="registry",d.registrySlotIds&&(A.registrySlotIds=d.registrySlotIds),d.bootstrap===!1&&(A.bootstrap=!1),d.render&&Object.keys(d.render).length>0&&(A.render=d.render)),d.v&&(A.v=d.v),typeof d.pp=="number"&&(A.pp=d.pp),e.persona&&(A.persona=e.persona);let T=JSON.stringify(A);return Un(_e,T,async()=>{var P,V,W,q,ee,$,me,Ee;if(!await Tn(Be,2500)||ke||!O())return xn(G),null;let de=je(3e4);try{let se=await fetch(`${p}/decide`,{method:"POST",body:T,headers:E,signal:de.signal});if(!se.ok)return xn(G),null;let N=await se.json(),Oe=bt(N.stage,e.stageAttributes);e.stageAttributes&&Xt(Oe);let rt={};for(let Z of G){let Te=(P=N.slots)==null?void 0:P[Z.id];if(Te!==void 0){rt[Z.id]=Te,X.set(Z.id,Te),ne.add(Z.id);continue}let vr=X.get(Z.id);if(vr!==void 0)rt[Z.id]=vr;else{let br=Dn(Z);rt[Z.id]=br,X.set(Z.id,br)}}if(N.slots)for(let[Z,Te]of Object.entries(N.slots))Z in rt||(rt[Z]=Te,X.set(Z,Te),ne.add(Z));let Xo=Q!=null&&Q.persona!=="unknown";N.persona&&!(N.persona==="unknown"&&Xo)?Q={persona:N.persona,confidence:(V=N.confidence)!=null?V:0}:Q||(Q={persona:"unknown",confidence:0});for(let[Z,Te]of Object.entries((W=N.assignments)!=null?W:{}))v.set(Z,k,{variantId:Te,assignedAt:Date.now(),segment:k,confidence:1});if(N.slotConfig)for(let[Z,Te]of Object.entries(N.slotConfig))ce.set(Z,Te);N.palette&&(Ce=N.palette),N.vocabulary&&(ge=N.vocabulary);for(let Z of(q=d.registrySlotIds)!=null?q:[])(ee=N.slotConfig)!=null&&ee[Z]||(ce.delete(Z),X.delete(Z),ne.delete(Z));return O()&&He(e.apiKey,j(j(j(j({v:1,persona:Q.persona,band:Je(Q.confidence),slots:Object.fromEntries(X),layoutOrder:($=N.layoutOrder)!=null?$:null,savedAt:Date.now()},ce.size>0?{slotConfig:Object.fromEntries(ce)}:{}),Ce?{palette:Ce}:{}),ge?{vocabulary:ge}:{}),Oe?{stage:Oe}:{})),j(j(j(j(j(j(j({layoutOrder:(me=N.layoutOrder)!=null?me:null,assignments:(Ee=N.assignments)!=null?Ee:{},slots:rt,persona:Q.persona,confidence:Q.confidence},N.slotConfig?{slotConfig:N.slotConfig}:{}),N.goals?{goals:N.goals}:{}),N.sectionMap?{sectionMap:N.sectionMap}:{}),N.palette?{palette:N.palette}:{}),N.vocabulary?{vocabulary:N.vocabulary}:{}),N.stage?{stage:N.stage}:{}),N.context?{context:N.context}:{})}catch(se){return xn(G),null}finally{de.clear()}})},getSlotResult(d){var h;return(h=X.get(d))!=null?h:null},isSlotDecided(d){return ne.has(d)},getSlotConfig(d){var h;return(h=ce.get(d))!=null?h:null},reportSlots(d,h,L,F){var G;let A={};for(let[T,P]of Object.entries(F!=null?F:{}))for(let V of P){let W=`${T}|${V.key}`;!pt.test(T)||dr.has(W)||(dr.add(W),((G=A[T])!=null?G:A[T]=[]).push(V))}Object.keys(A).length>0&&fetch(`${p}/slots/observed`,{method:"POST",headers:E,body:JSON.stringify({slotIds:Object.keys(A),authoredArms:A})}).catch(()=>{});for(let T of d)if(!(typeof T!="string"||T.length===0)){if(!pt.test(T)){Di()&&!pr.has(T)&&(pr.add(T),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(T)} will not register \u2014 ids must start with a letter or digit and contain only letters, digits, '_' or '-' (max 128 chars): /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.`));continue}if(!$e.has(T)){$e.add(T),Nt.add(T);let P=h==null?void 0:h[T];if(typeof P=="string"){let W=P.replace(/\s+/g," ").trim().slice(0,400);W!==""&&wn.set(T,W)}let V=L==null?void 0:L[T];V!==void 0&&_n.set(T,V)}}Nt.size===0||kn!=null||(kn=setTimeout(()=>{kn=null;let T=[...Nt];Nt.clear();for(let P=0;P<T.length;P+=20){let V=T.slice(P,P+20),W={},q={};for(let ee of V){let $=wn.get(ee);$!==void 0&&(W[ee]=$,wn.delete(ee));let me=_n.get(ee);me!==void 0&&(q[ee]=me,_n.delete(ee))}fetch(`${p}/slots/observed`,{method:"POST",headers:E,body:JSON.stringify(j(qe(j(j({slotIds:V},Object.keys(W).length>0?{baselineTexts:W}:{}),Object.keys(q).length>0?{baselineSkeletons:q}:{}),{pagePaths:Object.fromEntries(V.map(ee=>[ee,location.pathname]))}),Object.keys(W).length>0&&_.getSessionId()?{sessionId:_.getSessionId()}:{}))}).catch(()=>{})}},1e3))},reportSkeleton(d,h){!pt.test(d)||ur.has(d)||(ur.add(d),fetch(`${p}/slots/observed`,{method:"POST",headers:E,body:JSON.stringify({slotIds:[d],baselineSkeletons:{[d]:h}})}).catch(()=>{}))},reportAgentData(d,h,L){let F=`${d}|${h}`;!pt.test(d)||fr.has(F)||(fr.add(F),fetch(`${p}/slots/observed`,{method:"POST",headers:E,body:JSON.stringify(j(j({slotIds:[d],agentData:{[d]:{[h]:L}}},h.startsWith("authored.")?{authoredArms:{[d]:[{key:h.slice(9)}]}}:{}),_.getSessionId()?{sessionId:_.getSessionId()}:{}))}).catch(()=>{}))},reportDrift(d,h,L,F){let G=`${d}|${h}`,A=_.getSessionId();!A||cr.has(G)||(cr.add(G),fetch(`${p}/slots/drift`,{method:"POST",headers:E,body:JSON.stringify({sessionId:A,reports:[{slotId:d,expectedFp:h,observedFp:L,reason:F}]})}).catch(()=>{}))},requestSlots(d,h,L){var F,G;for(let A of d)Mt.has(A)||(Mt.add(A),pt.test(A)?gt.set(A,{text:h==null?void 0:h[A],render:(F=L==null?void 0:L.render)==null?void 0:F[A],skeleton:(G=L==null?void 0:L.skeletons)==null?void 0:G[A]}):ie.reportSlots([A]));gt.size===0||En!=null||(En=setTimeout(()=>{En=null;let A=[...gt];gt.clear();for(let T=0;T<A.length;T+=50){let P=A.slice(T,T+50),V={};for(let[W,q]of P)q.render&&(V[W]=q.render);ie.decide({slotsFrom:"registry",registrySlotIds:P.map(([W])=>W),bootstrap:!1,render:V}).then(W=>{var q,ee;if(W){let $={},me={},Ee=[];for(let[de,se]of P){let N=(q=W.slotConfig)==null?void 0:q[de];if(N){N.needsSkeleton&&se.skeleton&&((ee=ie.reportSkeleton)==null||ee.call(ie,de,se.skeleton));continue}Ee.push(de),se.text&&($[de]=se.text),se.skeleton&&(me[de]=se.skeleton)}Ee.length>0&&ie.reportSlots(Ee,$,me)}else mr(P.map(([$])=>$),Mt,$=>{var me;let Ee={},de={},se={};for(let[N,Oe]of P)$.has(N)&&(Oe.text&&(Ee[N]=Oe.text),Oe.render&&(de[N]=Oe.render),Oe.skeleton&&(se[N]=Oe.skeleton));(me=ie.requestSlots)==null||me.call(ie,[...$],Ee,{render:de,skeletons:se})});Dt.forEach($=>$())})}},0))},decideSlots(d){for(let h of d)$t.has(h.id)||($t.add(h.id),mt.set(h.id,h));mt.size===0||An!=null||(An=setTimeout(()=>{An=null;let h=[...mt.values()];mt.clear();for(let L=0;L<h.length;L+=30){let F=h.slice(L,L+30);ie.decide({slots:F}).then(G=>{G||mr(F.map(A=>A.id),$t,A=>{var T;return(T=ie.decideSlots)==null?void 0:T.call(ie,F.filter(P=>A.has(P.id)))}),Dt.forEach(A=>A())})}},0))},cancelSlots(d){for(let h of d)gt.delete(h)&&Mt.delete(h),mt.delete(h)&&$t.delete(h)},onSlotsChanged(d){return Dt.add(d),()=>{Dt.delete(d)}},getStyleVocabulary(){return ge},getSitePalette(){return Ce},getVisitorId:()=>O()?_.getSessionId():null,getPersona(){return Q?{persona:Q.persona,confidence:Q.confidence,band:Je(Q.confidence)}:null},async fetchWeights(){var d;let h=je(5e3);try{let L=await fetch(`${p}/weights`,{headers:E,signal:h.signal});return L.ok?(d=(await L.json()).components)!=null?d:[]:[]}catch(L){return[]}finally{h.clear()}},getGraph(){return{pageNodes:[],capturedAt:0}},flush(){f.flush(),H.flush()},dispose(){var d;ht==null||ht(),Cn=!0,ke=!0,f.destroy(),H.destroy(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ie.dispose&&pe.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var d;ht==null||ht(),Cn=!0,ke=!0,I=!0,Kt(e.apiKey),f.destroy({forget:!0}),H.destroy({forget:!0}),_.destroy(),v.clear(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ie.dispose&&pe.delete(e.apiKey);try{localStorage.removeItem(ot+e.apiKey),localStorage.removeItem(Gt(e.apiKey)),localStorage.removeItem(Ft(e.apiKey)),localStorage.removeItem(`_snt_graph_nodes${Ve(e.apiKey)}`),localStorage.removeItem("_snt_graph_edges")}catch(h){}e.debug&&console.log("[sentient] destroyed")}};if(pe.set(e.apiKey,{config:e,upgrade:null,dispose:ie.dispose}),ht=Ki(ie,e.apiKey,d=>{Be.then(()=>{Cn||to.add(d)})}),e.debug){let d=window;d.__sentient&&(d.__sentient.client=ie)}return ie}var Jn=/(^|\/)snippet(\.global)?(\.min)?\.js(\?|$)/,Fi=(()=>{var e,t;try{return(t=(e=document.currentScript)==null?void 0:e.src)!=null?t:""}catch(n){return""}})(),Ui=/@\d+\.\d+\.\d+[^/]*\//;function Yn(e){var t;try{let n=Fi||((t=Array.from(document.getElementsByTagName("script")).find(r=>Jn.test(r.src)))==null?void 0:t.src);for(let r of n?[n]:[]){let o=Jn.test(r)?r.replace(Jn,`$1${e}$4`):r.replace(/[^/?#]*([?#].*)?$/,e),s=(e==="consent.global.js"?"sha384-+7/RqBOFLU5bMaQ6bcBAWzG589skmxN8tedG9hkoQQ6HaQkRRBJfoRVD94e/fJcM":e==="editor.global.js"?"sha384-COGG1Iazuy5juBm/L6OJ5qu1NGyy1IUqVqp/ajhN2TFAa7MzOj4zBg0H+JF4GqFo":e==="preview.global.js"?"sha384-kac/5o/TEvZmJvNoLaPhw/x3/L86ECVP1b1iSB/4wBeIuiJheesuYWb+om9R0hz9":"sha384-bznTrPA2oIOu78zjyDeiXeWHzjLj9u6wosKK2BgHq0RpPX0ew9kl3f88galPH+I6")||"";return Ui.test(o)&&s.indexOf("sha384-")===0?{src:o,integrity:s}:{src:o}}}catch(n){}return null}var Qt=new Map;function ct(e,t,n){let r=window[t];if(r)return Promise.resolve(r);let o=Qt.get(e);return o||(o=new Promise(s=>{var i;let a=n?{src:n}:Yn(e);if(!a)return s(null);let l=Ge(document.createElement("script"));Xn(l,a),l.async=!0,l.onload=()=>{var c;let u=(c=window[t])!=null?c:null;u||Qt.delete(e),s(u)},l.onerror=()=>{Qt.delete(e),s(null)},((i=document.head)!=null?i:document.documentElement).appendChild(l)}),Qt.set(e,o)),o}function Xn(e,t){t.integrity&&(e.integrity=t.integrity,e.crossOrigin="anonymous"),e.src=t.src}var ro="__sentientConsent",Re=null,Zn=!1,en=new Set,Qn=()=>{let e=window[ro];return typeof(e==null?void 0:e.consentWatcher)=="function"?e.consentWatcher:null},_t;function oo(e){_t=e}function Vi(){Re||(Re=Qn())||Zn||(Zn=!0,ct("consent.global.js",ro,_t).then(e=>{if(Zn=!1,!e)return Wi(_t!=null?_t:"consent.global.js");if(Re=Qn(),Re)for(let t of Array.from(en))t()}))}function Wi(e){console.warn(`[sentient] could not load ${e} \u2014 tracking stays off. Set window.sentient.consentSrc to its URL.`)}function Xe(e){Vi();let t=null,n=()=>(!t&&(Re!=null?Re:Re=Qn())&&(t=Re(e)),t);return{read:()=>{var r,o;return(o=(r=n())==null?void 0:r.read())!=null?o:null},refused:()=>{var r,o;return(o=(r=n())==null?void 0:r.refused())!=null?o:!1},subscribe(r){let o,s=!1,a=()=>{en.delete(a);let l=n();s||!l||(o=l.subscribe(r),r())};return n()?(o=t.subscribe(r),Promise.resolve().then(()=>{s||r()})):en.add(a),()=>{s=!0,en.delete(a),o==null||o()}}}}function zi(e){return e.replace(/\s+/g," ").trim().slice(0,300)}function io(e,t){let n=t>>>0;for(let r=0;r<e.length;r++)n^=e.charCodeAt(r),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function Hi(e){let t=e.join("");return io(t,2166136261)+io(t,1523705862)}var qi=new Set(["A","BUTTON"]),Ji=/^H([1-6])$/,Yi=new Set(["P","LI","LABEL","BLOCKQUOTE","FIGCAPTION","DT","DD","TD","TH"]);var Xi=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT"]);function Zi(e){return qi.has(e.tagName)||e.getAttribute("role")==="button"?!0:e.tagName==="INPUT"&&/^(submit|button)$/i.test(e.type)}function Qi(e){if(Ji.test(e.tagName)||Yi.has(e.tagName))return!0;let t=e.ownerDocument.defaultView,n=t?t.getComputedStyle(e).display:"";return n!==""&&n!=="inline"&&n!=="contents"}function es(e,t){let n=null;for(let r=e.parentElement;r&&r!==t.parentElement;r=r.parentElement){if(Zi(r)){n=r;break}if(r===t)break}if(n)return n;for(let r=e.parentElement;r;r=r.parentElement)if(r===t||Qi(r))return r;return t}function tn(e,t=40){var n,r,o;let s=e.ownerDocument.createTreeWalker(e,4),a=[];for(let c=s.nextNode();c;c=s.nextNode())if(((n=c.nodeValue)!=null?n:"").trim()!==""&&!Xi.has((o=(r=c.parentElement)==null?void 0:r.tagName)!=null?o:"")&&(a.push(c),a.length>120))return{reason:"too_large"};if(a.length===0)return{reason:"empty"};let l=[],i=[];for(let c of a){let g=es(c,e),y=l.indexOf(g);y===-1&&(l.push(g),y=l.length-1),i.push(y)}if(l.length>t)return{reason:"too_large"};let u=a.map(c=>{var g;return zi((g=c.nodeValue)!=null?g:"")});return{textNodes:a,ownerEls:l,leafToNode:i,leaves:u,fp:Hi(u)}}var so=["cookiebot","onetrust","cookieyes","tcf","google-consent-mode","shopify"];function ts(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(s=>typeof s=="string")||/[=|]/.test(r)||o.some(s=>/[=|]/.test(s)))return null;n[r]=o}return n}function ns(e){return!Array.isArray(e)||e.length<2||e.length>12||!e.every(t=>typeof t=="string")?null:e}function rs(e){try{return e()}catch(t){return}}function nn(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={};if(typeof t.slots=="object"&&t.slots!==null&&!Array.isArray(t.slots))for(let[l,i]of Object.entries(t.slots)){if(typeof i!="object"||i===null)continue;let u=i,c=ts(u.dims);if(!c||u.target!==void 0&&typeof u.target!="string")continue;let g=u.arms!==void 0?ns(u.arms):null,y={dims:c};typeof u.target=="string"&&(y.target=u.target),g&&(y.arms=g),n[l]=y}let r={apiKey:t.apiKey,personaAttributes:t.personaAttributes===!0,slots:n};typeof t.consent=="boolean"?r.consent=t.consent:t.consent!==void 0&&s("consent");let o=t.consentFrom;if(typeof o=="string"&&so.includes(o))r.consentFrom=o;else if(o&&typeof o=="object"&&!Array.isArray(o)){let l=o;typeof l.cmp=="string"&&so.includes(l.cmp)||l.cmp===void 0&&(typeof l.cookie=="string"||typeof l.check=="function")?r.consentFrom=l:s("consentFrom")}else o!==void 0&&s("consentFrom");function s(l){r.consent=!1,console.warn(`[sentient] invalid ${l} \u2014 tracking stays OFF until it is fixed (sentient-ui.com/docs#consent).`)}(t.preConsentBehavior==="statistical_winner"||t.preConsentBehavior==="control")&&(r.preConsentBehavior=t.preConsentBehavior),t.debug===!0&&(r.debug=!0),(t.stageAttributes===!0||t.stageAttributes==="detailed")&&(r.stageAttributes=t.stageAttributes),typeof t.registry=="boolean"&&(r.registry=t.registry),typeof t.editorSrc=="string"&&(r.editorSrc=t.editorSrc),typeof t.consentSrc=="string"&&(r.consentSrc=t.consentSrc),typeof t.nonce=="string"&&t.nonce!==""&&(r.nonce=t.nonce),typeof t.apiBase=="string"&&(r.apiBase=t.apiBase),typeof t.sectionCapture=="boolean"&&(r.sectionCapture=t.sectionCapture);let a=typeof t.persona=="function"?rs(t.persona):t.persona;if(typeof a=="string"&&a.trim()!==""&&(r.persona=a),Array.isArray(t.sections)){let l=t.sections.filter(i=>typeof i=="string"&&i.trim()!=="").slice(0,50);l.length>=2&&(r.sections=l)}return r}var ao=new WeakMap;function lo(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function uo(e,t,n){var s,a,l;let r=ao.get(e);if(r){if(r.fp!==n.fp||!lo(r.leafToNode,n.leafToNode))return"mismatch"}else{let i=tn(e);if(!("fp"in i)||(r={fp:i.fp,leafToNode:i.leafToNode,textNodes:i.textNodes,ownerEls:i.ownerEls,classes:i.ownerEls.map(u=>{var c;return(c=u.getAttribute("class"))!=null?c:""})},r.fp!==n.fp||!lo(r.leafToNode,n.leafToNode)))return"mismatch";ao.set(e,r)}let o=r;for(let[i,u]of Object.entries(t.nodes)){let c=Number(i),g=o.ownerEls[c];if(g){if(typeof u.text=="string"){let y=!0;o.leafToNode.forEach((S,w)=>{S===c&&(o.textNodes[w].nodeValue=y?u.text:"",y=!1)})}u.like!==void 0&&o.classes[u.like]!==void 0&&g.setAttribute("class",o.classes[u.like]),u.hidden&&((s=g.style)==null||s.setProperty("display","none","important"))}}for(let i of Object.values((a=t.order)!=null?a:{})){let u=i.map(w=>o.ownerEls[w]).filter(w=>!!w),c=(l=u[0])==null?void 0:l.parentElement;if(!c||u.length!==i.length||u.some(w=>w.parentElement!==c))continue;let g=new Set(u),y=0;Array.from(c.children).map(w=>g.has(w)?u[y++]:w).forEach((w,b)=>{var B;c.children[b]!==w&&c.insertBefore(w,(B=c.children[b])!=null?B:null)})}return"applied"}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 os(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:"").replace(/\s+/g," ").trim().toLowerCase(),o=t.text.replace(/\s+/g," ").trim().toLowerCase();if(!(r===o||r.startsWith(o)||o.startsWith(r)))return!1}return!0}function rn(e,t){return!!(e!=null&&e.urlMatch)&&!kt(t).includes(e.urlMatch)}var is=/^[a-zA-Z_][-a-zA-Z0-9_]*$/;function co(e,t){var r;let n=[];if(e.id){let o=t.getElementById(e.id);n=o?[o]:[]}if(n.length===0&&((r=e.dataAttr)!=null&&r.name)&&is.test(e.dataAttr.name))try{let o=e.dataAttr.value.replace(/["\\]/g,"\\$&");n=Array.from(t.querySelectorAll(`[${e.dataAttr.name}="${o}"]`))}catch(o){n=[]}if(n.length===0&&e.selector)try{n=Array.from(t.querySelectorAll(e.selector))}catch(o){n=[]}return n}function Pe(e,t){if(e.urlMatch&&!kt(t).includes(e.urlMatch))return null;let n=co(e,t);if(n.length!==1)return null;let r=n[0];return e.fingerprint&&!os(r,e.fingerprint)?null:r}function fo(e,t){return rn(e,t)?!1:!!e.selector&&!e.dataAttr&&!e.id&&!e.fingerprint&&e.page===void 0?po(e,t):Pe(e,t)!==null}function po(e,t){return co(e,t).length>0}function on(e,t){return rn(e,t)?!1:e.page!==void 0&&Zt.test(e.page)?Vn(e.page,kt(t)):po(e,t)}var go={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",fontFamily:"font-family"},ss=/^(rgb|rgba|hsl|hsla|calc|var|min|max|clamp)$/i;function mo(e){var r;if(e.trim().length===0||/[;{}<>]/.test(e))return!1;let t=/([A-Za-z-]*)\(/g,n;for(;(n=t.exec(e))!==null;)if(!ss.test((r=n[1])!=null?r:""))return!1;return!0}function as(e){var r,o;let t=e.ownerDocument.createTreeWalker(e,4),n=null;for(let s=t.nextNode();s!==null;s=t.nextNode()){if(((r=s.nodeValue)!=null?r:"").trim()==="")continue;let a=(o=s.parentElement)==null?void 0:o.tagName;if(!(a==="SCRIPT"||a==="STYLE"||a==="TEMPLATE")){if(n!==null)return null;n=s}}return n}function Et(e,t){let n=as(e);n!==null?n.nodeValue=t:e.textContent=t}var er=/^https:\/\//i;function sn(e){return typeof e=="string"&&!/[\s\x00-\x1f\\]/.test(e)&&(er.test(e)||e[0]==="/"&&e[1]!=="/")?e:null}var ho=new Map,Fe=null;function ls(e){return e.replace(/["\\]/g,"\\$&")}function us(e){var t;(!Fe||!Fe.isConnected)&&(Fe=e.querySelector("style[data-sentient-ops]"),Fe||(Fe=Ge(e.createElement("style"),e),Fe.setAttribute("data-sentient-ops",""),((t=e.head)!=null?t:e.documentElement).appendChild(Fe))),Fe.textContent=[...ho.entries()].map(([n,r])=>`[data-snt-e="${ls(n)}"]{${r}}`).join(`
|
|
2
|
-
`)}function yo(e,t,n,r){var l;let o=!1,s=(l=t.moveBefore)!=null?l:t.moveAfter;if(s){let i=Pe(s,r);!i||i===e||i.parentElement!==e.parentElement||!e.parentElement?o=!0:t.moveBefore?e.parentElement.insertBefore(e,i):e.parentElement.insertBefore(e,i.nextSibling)}typeof t.text=="string"&&Et(e,t.text),typeof t.href=="string"&&er.test(t.href)&&e.setAttribute("href",t.href),typeof t.imageSrc=="string"&&er.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[i,u]of Object.entries(t.style)){let c=go[i];c&&typeof u=="string"&&mo(u)&&a.push(`${c}:${u.trim()} !important`)}return a.length>0&&(e.setAttribute("data-snt-e",n),ho.set(n,a.join(";")),us(r)),{anchorMiss:o}}var At="data-sentient-block-arm",R=null;function xt(e){R=e!=null?e:null}var Ze=null;function Ct(e){Ze=e!=null?e:null}var wo=e=>{var t;return typeof e=="string"?(t=Ze==null?void 0:Ze.entries.find(n=>n.id===e))==null?void 0:t.classes:void 0},_o=e=>{let t=typeof e=="string"?Ze==null?void 0:Ze.entries.find(n=>n.id===e):void 0;return t!=null&&t.computed.inheritsColor?t.computed.color:void 0},Ne="data-sentient-blocks-hid",dt={none:"0",sm:"8px",md:"16px",lg:"24px"},tr={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",between:"space-between"},vo={sm:"0.875em",md:"1em",lg:"1.25em"},cs={sm:"1.25em",md:"1.5em",lg:"2em"},ds={sm:"6px 14px",md:"10px 20px",lg:"14px 28px"},bo={sm:"8px",md:"16px",lg:"32px"},fs={square:"1 / 1",landscape:"4 / 3",wide:"16 / 9"},ps={normal:"400",medium:"500",bold:"700"};function he(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&e.style.setProperty(n,r);return e}function So(e){return e==="muted"?R!=null&&R.muted?{color:R.muted}:{opacity:"0.7"}:e==="accent"?{"font-weight":"600",color:R==null?void 0:R.accent}:{}}function ko(e,t){let n=gs(e,t),r=_o(e.like);return n&&r&&(n.style.color=r),n}function gs(e,t){var n,r,o,s,a,l,i,u,c,g,y,S,w,b,B,K,_,C,I,M;try{let O=wo(e.like),m=e.maxWidth==="measure"?"65ch":void 0,v=f=>(f.className=O,he(f,{"max-width":m}));switch(e.type){case"stack":case"grid":{let f=t.createElement("div");if(e.type==="stack"){let D=e;he(f,{display:"flex","flex-direction":D.direction,gap:(r=dt[(n=D.gap)!=null?n:"md"])!=null?r:dt.md,"align-items":D.align?tr[D.align]:void 0,"justify-content":D.justify?tr[D.justify]:void 0,"flex-wrap":D.wrap?"wrap":void 0})}else{let D=e,H=(s=dt[(o=D.gap)!=null?o:"md"])!=null?s:dt.md;he(f,{display:"grid","grid-template-columns":`repeat(auto-fit, minmax(max(200px, calc((100% - ${D.columns-1} * ${H}) / ${D.columns})), 1fr))`,gap:H,"align-items":D.align?tr[D.align]:void 0})}O&&(f.className=O);let p=!O&&e.type==="stack"&&e.surface==="raised",E=(a=e.pad)!=null?a:p?"md":void 0;E&&he(f,{padding:(l=dt[E])!=null?l:dt.md}),p&&he(f,{background:R==null?void 0:R.surface,color:R!=null&&R.surface?R==null?void 0:R.surfaceText:void 0,border:`1px solid ${(i=R==null?void 0:R.border)!=null?i:"currentColor"}`,"border-radius":(u=R==null?void 0:R.radius)!=null?u:"8px"});for(let D of(c=e.children)!=null?c:[]){let H=ko(D,t);H&&f.appendChild(H)}return f}case"text":{let f=t.createElement("p");return f.textContent=e.value,O?v(f):he(f,Ke(U({margin:"0","font-size":e.size?vo[e.size]:void 0,"font-weight":e.weight?ps[e.weight]:void 0,"text-align":e.align},So(e.tone)),{"max-width":e.maxWidth==="measure"?"65ch":void 0}))}case"heading":{let f=t.createElement(`h${e.level}`);return f.textContent=e.value,O?v(f):he(f,{margin:"0","font-size":cs[(g=e.size)!=null?g:"md"],"text-align":e.align,"max-width":e.maxWidth==="measure"?"65ch":void 0})}case"button":{let f=t.createElement("a");f.textContent=e.label;let p=sn(e.href);if(p&&(f.href=p),e.tag&&f.setAttribute("data-sentient-tag",e.tag),O)return v(f);let E=(y=e.emphasis)!=null?y:"primary";return he(f,{display:"inline-block",padding:ds[(S=e.size)!=null?S:"md"],"border-radius":(w=R==null?void 0:R.radius)!=null?w:"8px",font:"inherit","font-size":e.size?vo[e.size]:void 0,"text-decoration":E==="ghost"?"underline":"none",cursor:"pointer",background:E==="primary"?(b=R==null?void 0:R.primaryBg)!=null?b:"#111827":"transparent",color:E==="primary"?(B=R==null?void 0:R.primaryText)!=null?B:"#ffffff":(K=R==null?void 0:R.accent)!=null?K:"inherit",border:E==="secondary"?`1px solid ${(_=R==null?void 0:R.accent)!=null?_:"currentColor"}`:"none"})}case"link":{let f=t.createElement("a");f.textContent=e.label;let p=sn(e.href);return p&&(f.href=p),e.tag&&f.setAttribute("data-sentient-tag",e.tag),O?v(f):he(f,{color:"inherit","text-decoration":"underline"})}case"image":{let f=t.createElement("img"),p=sn(e.src);return p&&(f.src=p),f.alt=e.alt,O&&(f.className=O),he(f,{display:"block","max-width":"100%","aspect-ratio":e.ratio&&e.ratio!=="auto"?fs[e.ratio]:void 0,"object-fit":e.fit,width:e.ratio&&e.ratio!=="auto"?"100%":void 0})}case"badge":{let f=t.createElement("span");return f.textContent=e.value,O?v(f):he(f,U({display:"inline-block",padding:"2px 10px","border-radius":"999px","font-size":"0.75em",border:`1px solid ${(C=R==null?void 0:R.border)!=null?C:"currentColor"}`},So(e.tone)))}case"spacer":return he(t.createElement("div"),{height:(I=bo[e.size])!=null?I:bo.md});case"divider":return he(t.createElement("hr"),{border:"none","border-top":`1px solid ${(M=R==null?void 0:R.border)!=null?M:"currentColor"}`,margin:"0",width:"100%"});default:return null}}catch(O){return null}}function Eo(e,t,n,r){var o,s;try{let a=new Set;for(let i of Array.from(e.children)){let u=i.getAttribute(At);u!==null&&(t[u]===void 0?i.remove():a.add(u))}for(let[i,u]of Object.entries(t)){if(a.has(i))continue;let c="tree"in u?u:null,g=ko(c?c.tree:u,r);if(!g)continue;let y=r.createElement("div");y.setAttribute(At,i),y.style.display="none";let S=c?wo((o=c.surface)==null?void 0:o.like):void 0;if(S){let w=r.createElement("div");w.className=S;let b=_o((s=c.surface)==null?void 0:s.like);b&&(w.style.color=b),w.appendChild(g),y.appendChild(w)}else y.appendChild(g);e.appendChild(y)}let l=n!==void 0&&t[n]!==void 0;for(let i of Array.from(e.children)){let u=i.getAttribute(At),c=i;u!==null?c.style.display=l&&u===n?"":"none":l?c.hasAttribute(Ne)||(c.setAttribute(Ne,c.style.display),c.style.display="none"):c.hasAttribute(Ne)&&(c.style.display=c.getAttribute(Ne),c.removeAttribute(Ne))}}catch(a){}}function ms(e){try{for(let t of Array.from(e.children)){let n=t;if(n.getAttribute(At)!==null){n.remove();continue}n.hasAttribute(Ne)&&(n.style.display=n.getAttribute(Ne),n.removeAttribute(Ne))}}catch(t){}}function an(e,t){try{let n=new Set;for(let r of Array.from(e.querySelectorAll(`[${At}]`)))r.parentElement&&n.add(r.parentElement);for(let r of Array.from(e.querySelectorAll(`[${Ne}]`)))r.parentElement&&n.add(r.parentElement);for(let r of n)t.has(r)||ms(r)}catch(n){}}function nr(e,t){if(!e)return[t.documentElement];try{return Array.from(t.querySelectorAll(e))}catch(n){return[]}}function ln(e,t,n,r){n.documentElement.setAttribute("data-sentient-persona",e),n.documentElement.setAttribute("data-sentient-confidence",t),r==null||r(n.documentElement,"data-sentient-persona"),r==null||r(n.documentElement,"data-sentient-confidence")}function un(e,t,n,r){var o;for(let[s,a]of Object.entries(t)){let l=e[s];if(!l||typeof l=="string")continue;let i=nr(a.target,n);for(let u of i)for(let[c,g]of Object.entries(l))(o=a.dims[c])!=null&&o.includes(g)&&(u.setAttribute(`data-${c}`,g),r==null||r(u,`data-${c}`))}}function cn(e,t,n,r){for(let[o,s]of Object.entries(t)){let a=e[o];if(typeof a!="string"||!s.arms||!s.arms.includes(a))continue;let l=nr(s.target,n);for(let i of l)i.setAttribute("data-sentient-arm",a),r==null||r(i,"data-sentient-arm")}}function dn(e,t,n,r){var l,i,u,c,g,y,S;let o=new Set,s=(l=r==null?void 0:r.contentAndOps)!=null?l:!0,a=[];for(let[w,b]of Object.entries(t)){if(rn(b.locator,n))continue;let B;if(b.locator){let _=Pe(b.locator,n);B=_?[_]:[],!_&&on(b.locator,n)&&a.push(w)}else B=nr(b.target,n);let K=e[w];for(let _ of B){if(K!==void 0)if(typeof K=="string")_.setAttribute("data-sentient-arm",K),(i=r==null?void 0:r.onAttr)==null||i.call(r,_,"data-sentient-arm"),s&&((u=r==null?void 0:r.onApplied)==null||u.call(r,w,K,_));else for(let[I,M]of Object.entries(K))_.setAttribute(`data-${I}`,M),(c=r==null?void 0:r.onAttr)==null||c.call(r,_,`data-${I}`);if((b.blocks||b.compose)&&!ys(n)){let I=Object.fromEntries([...Object.entries((g=b.blocks)!=null?g:{}).filter(([,M])=>!St(M)),...Object.entries((y=b.compose)!=null?y:{}).filter(([,M])=>!St(M.tree))]);Object.keys(I).length>0&&(Eo(_,I,typeof K=="string"?K:void 0,n),o.add(_))}if(!s)continue;let C=_.textContent;b.edits?uo(_,b.edits.edits,b.edits)==="mismatch"&&((S=r==null?void 0:r.onDrift)==null||S.call(r,w,b.edits.fp)):typeof b.content=="string"&&Et(_,b.content),b.ops&&yo(_,b.ops,w,n).anchorMiss&&!a.includes(w)&&a.push(w),zn(_,Ke(U(U({previous:C},typeof K=="string"?{arm:K}:{}),(r==null?void 0:r.persona)!==void 0?{persona:r.persona}:{}),{doc:n}))}}return an(n,o),a}var hs=/bot|crawler|spider|crawling|googlebot|bingbot|duckduckbot|baiduspider|yandexbot|slurp|gptbot|claudebot|anthropic|perplexity|ccbot|applebot|headlesschrome/i;function ys(e){var t,n,r;try{let o=(n=(t=e.defaultView)!=null?t:typeof window!="undefined"?window:void 0)==null?void 0:n.navigator;return o?o.webdriver===!0?!0:hs.test((r=o.userAgent)!=null?r:""):!1}catch(o){return!1}}var vs=800;function fn(e,t,n){let r=[];return n.forEach(({slotId:o,arm:s,el:a},l)=>{r.push(Hn((y,S={})=>{try{e.track({projectId:t,componentId:o,variantId:s,eventType:"micro_signal",payload:U({signalType:y},S)})}catch(w){}},a,void 0,{tabLoss:l===0}));let i=null,u=0,c=()=>{u=Date.now(),i=setTimeout(()=>{try{e.track({projectId:t,componentId:o,variantId:s,eventType:"cursor_signal",payload:{hoverDuration:Date.now()-u}})}catch(y){}i=null},vs)},g=()=>{i!==null&&(clearTimeout(i),i=null)};a.addEventListener("mouseenter",c),a.addEventListener("mouseleave",g),r.push(()=>{a.removeEventListener("mouseenter",c),a.removeEventListener("mouseleave",g),i!==null&&clearTimeout(i)})}),()=>{for(let o of r)o()}}function xo(e){return e?`_snt_fired_goals_${e.slice(0,12)}`:"_snt_fired_goals"}var bs="_snt_fired_goals";function rr(e,t){try{e==null||e.sessionStorage.removeItem(xo(t)),e==null||e.sessionStorage.removeItem(bs)}catch(n){}}function Ao(e){var t;return[(t=e.slotId)!=null?t:"",e.goalId,e.event,e.locator?JSON.stringify(e.locator):""].join("|")}function Ss(e,t){try{let n=e==null?void 0:e.sessionStorage.getItem(t);if(!n)return new Set;let r=JSON.parse(n);return Array.isArray(r)?new Set(r.filter(o=>typeof o=="string")):new Set}catch(n){return new Set}}function ws(e,t,n){try{e==null||e.sessionStorage.setItem(t,JSON.stringify([...n]))}catch(r){}}function Co(e,t,n,r){var K,_;let o=(K=n.defaultView)!=null?K:typeof window!="undefined"?window:null,s=xo(r),a=Ss(o,s),l=C=>{let I=Ao(C);if(!a.has(I))try{C.slotId?t.componentGoal(C.slotId,C.goalId):t.goal(C.goalId),a.add(I),ws(o,s,a)}catch(M){}},i=e.filter(C=>C.event==="click"),u=e.filter(C=>C.event==="form_submit"),c=e.filter(C=>C.event==="url_reached"),g=e.filter(C=>C.event==="scroll_depth"),y=(C,I)=>{if(!C.locator)return!1;let M=Pe(C.locator,n);return!!M&&(M===I||M.contains(I))},S=C=>{let I=C.target;if(!(!I||typeof I.closest!="function"))for(let M of i)y(M,I)&&l(M)},w=C=>{let I=C.target;if(I)for(let M of u)y(M,I)&&l(M)},b=()=>{if(c.length===0)return;let C=kt(n);for(let I of c)I.urlPattern&&Wn(I.urlPattern,C)&&l(I)},B=()=>{var M;let C=n.documentElement,I=C.scrollHeight>0?(C.scrollTop+C.clientHeight)/C.scrollHeight:0;for(let O of g)I>=((M=O.threshold)!=null?M:.75)&&l(O);g.every(O=>a.has(Ao(O)))&&n.removeEventListener("scroll",B)};return n.addEventListener("click",S,!0),n.addEventListener("submit",w,!0),(_=n.defaultView)==null||_.addEventListener("popstate",b),b(),g.length>0&&(n.addEventListener("scroll",B,{passive:!0}),B()),{checkUrl:b,teardown:()=>{var C;n.removeEventListener("click",S,!0),n.removeEventListener("submit",w,!0),(C=n.defaultView)==null||C.removeEventListener("popstate",b),g.length>0&&n.removeEventListener("scroll",B)}}}function pn(e,t){if(!e||e.length<2||t.size!==e.length)return null;let n=[];for(let a of e){let l=t.get(a);if(!l||n.includes(l))return null;n.push(l)}let r=n[0].parentNode;if(!r||!n.every(a=>a.parentNode===r))return null;let o=n.slice().sort((a,l)=>a.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),s=[];for(let a=0;a<n.length;a++){let l=n[a];o[a]!==l&&(s.push({el:l,before:o[a]}),o.splice(o.indexOf(l),1),o.splice(a,0,l))}return s}var _s="__snt_editor_token";function Io(){try{return typeof sessionStorage!="undefined"?sessionStorage.getItem(_s):null}catch(e){return null}}function Oo(e){let t=null;try{let n=location.hash.slice(1),r=RegExp("(^|[?&])"+e+"=([^&]*)").exec(n);if(r){t=r[2];let o=n.slice(r.index+r[0].length);r[1]!="&"&&o[0]=="&"&&(o=r[1]+o.slice(1));let s=n.slice(0,r.index)+o;history.replaceState(history.state,"",s?"#"+s:location.pathname+location.search)}}catch(n){}return t}var It="0.34.1",hn=It!=="0.0.0-dev"?{name:"snippet",version:It}:void 0,$o=It!=="0.0.0-dev"?{v:It}:{},To=5e3,ks=50,Bo=(()=>{try{if(typeof window=="undefined")return[];let e=window.SentientSnippet;return Array.isArray(e==null?void 0:e.q)?e.q:[]}catch(e){return[]}})(),te=null,x=null,be={},ve=null,Se=null,Ot=null,re=null,oe=null,Tt=0,J=null,Qe=null,Lo=!1,or=null,gn=null,Lt=null,Ae=!1,Ue=!1,yn=!1,vn=0,Ko=e=>fe(e)===vn,ft=null,ue=!1,Me=null,xe=[],et=null,tt=null,ye=null,Es=3e3,As=100;function Po(e,t){let n,r=new Promise(o=>{n=setTimeout(()=>o(null),t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}function De(e,...t){e!=null&&e.debug&&console.log("[sentient-snippet]",...t)}function Pt(e,t){return te?(te.personaAttributes&&J&&ln(J.persona,J.band,e,t==null?void 0:t.onAttr),un(be,te.slots,e,t==null?void 0:t.onAttr),cn(be,te.slots,e,t==null?void 0:t.onAttr),ve?dn(be,ve,e,U(Ke(U({},t),{onDrift:(n,r)=>{var o,s;return(s=x==null?void 0:x.reportDrift)==null?void 0:s.call(x,n,r,(o=Fo[n])!=null?o:null,"fp_mismatch")}}),J?{persona:J.persona}:{})):(an(e,new Set),[])):[]}function jo(e){var n;let t=new Map;for(let r of(n=te==null?void 0:te.sections)!=null?n:[])try{let o=e.querySelectorAll(r);o.length===1&&t.set(r,o[0])}catch(o){}return t}function ir(e,t){var n,r;try{if(!e||e.length<2)return;for(let o of(n=pn(e,jo(t)))!=null?n:[])(r=o.before.parentNode)==null||r.insertBefore(o.el,o.before)}catch(o){}}function xs(e,t,n){let r=(o,s)=>t.some(([a,l])=>a===o&&l===s);try{if(Array.isArray(e.stamped))for(let o of e.stamped){if(!Array.isArray(o))continue;let[s,a,l]=o;!s||typeof a!="string"||r(s,a)||(l==null?s.removeAttribute(a):s.setAttribute(a,l))}if(Array.isArray(e.html))for(let o of e.html)typeof o!="string"||r(n.documentElement,o)||n.documentElement.removeAttribute(o)}catch(o){}}function Cs(){try{let e=window.__sntPP;return e&&typeof e=="object"&&typeof e.v=="number"?e:null}catch(e){return null}}function Go(e){return e.apiBase?`${e.apiBase.replace(/\/+$/,"")}/v1/events`:void 0}function Sn(e){var t;return(t=e.apiBase)!=null?t:"https://api.sentient-ui.com"}function Is(e){return Promise.resolve().then(()=>fetch(`${Sn(e)}/v1/registry/locators`,{headers:{authorization:`Bearer ${e.apiKey}`}})).then(t=>t.ok?t.json():null).then(t=>Array.isArray(t==null?void 0:t.slots)?t.slots:null).catch(()=>null)}function sr(e,t){let n=[],r=[];for(let o of e)try{if(typeof(o==null?void 0:o.id)!="string")continue;!o.locator||fo(o.locator,t)?n.push(o.id):on(o.locator,t)&&r.push(o.id)}catch(s){}return[n,r]}var Fo={};function Uo(e,t){var r;let n={};for(let o of e){let s=(r=Me==null?void 0:Me.find(u=>u.id===o))==null?void 0:r.locator,a=s?Pe(s,t):null,l=a?tn(a):null,i=l&&"fp"in l?l.fp:void 0;i&&(Fo[o]=i),n[o]=Ke(U({},i?{fp:i}:{}),{forms:!1,compose:!0,content:!0})}return n}function Vo(e,t){let n=null;for(let r of t)e!=null&&e[r]&&((n!=null?n:n={})[r]=e[r]);return n}var ae=null;function Wo(){if(!Ae){ae&&et!==Le()&&ae(!0);return}!Me||et===Le()||(et=Le(),Os())}function Os(){ye==null||ye();let e=te,t=Me;if(!e||!t)return;let n,r,o=()=>{clearTimeout(n),clearTimeout(l),r==null||r.disconnect(),ye===o&&(ye=null)},s=null,a=i=>{let[u,c]=sr(t,document),g=u.filter(y=>!xe.includes(y));s!==null&&u.some(y=>!s.has(y)&&!g.includes(y))&&Rt(),s=new Set(u),g.length>0&&Ts(g).catch(()=>{}),(i||c.length===0&&!t.some(y=>!u.includes(y.id)&&!xe.includes(y.id)))&&(o(),zo(e,c))},l=setTimeout(()=>a(!0),Es);if(ye=o,a(),ye===o)try{r=new MutationObserver(()=>{clearTimeout(n),n=setTimeout(a,As)}),r.observe(document.documentElement,{childList:!0,subtree:!0})}catch(i){}}function bn(e,t){if(!(!e||e.length===0||!t||!te))try{Se==null||Se.teardown(),Se=Co(e,t,document,te.apiKey)}catch(n){}}async function Ts(e){let t=te,n=x;if(!t||!n)return;xe=xe.concat(e);let r=await n.decide(U({slotsFrom:"registry",registrySlotIds:e,render:Uo(e,document)},$o));if(r||(xe=xe.filter(s=>!e.includes(s))),!r||ue||x!==n)return;be=U(U({},be),r.slots),!Se&&r.goals&&(t.consent!==!1||Ue)&&bn(Ot=r.goals,n);let o=Vo(r.slotConfig,e);o&&(ve=U(U({},ve),o)),Rt(),De(t,"late decide",e),tt&&Ko(t.apiKey)&&He(t.apiKey,tt=U(Ke(U({},tt),{slots:be,savedAt:Date.now()}),ve?{slotConfig:ve}:{}))}function zo(e,t){if(t.length!==0)try{fetch(`${Sn(e)}/v1/locator-miss`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e.apiKey}`},body:JSON.stringify({slots:t})}).catch(()=>{})}catch(n){}}function nt(){return!!(te&&x&&te.sectionCapture!==!1&&(te.consent!==!1||Ue)&&!Ye())}function Ls(){if(!x||!te||!nt()||oe)return;let e=[];Pt(document,{contentAndOps:Ae,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),lr();try{re==null||re(),re=fn(x,te.apiKey,e)}catch(t){}}function lr(){if(typeof document=="undefined"||!nt())return;let e;try{if(gn&&gn.length>0){let r=new Map;for(let o of gn){if(o.urlMatch!==window.location.pathname)continue;let s=Pe(o.locator,document);s&&r.set(s,o.type)}r.size>0&&(e=o=>{var s;return(s=r.get(o))!=null?s:null})}}catch(r){}let t=x,n=++Tt;Lt=window.location.pathname,ct("engagement.global.js","__sentientEngagement").then(r=>{if(!(!r||n!==Tt||x!==t||!t||!nt()))try{oe==null||oe(),oe=r.startEngagementCapture(t,U({apiKey:te.apiKey,apiBase:te.apiBase,doc:document,microSignals:!0},e?{typeOf:e}:{}))}catch(o){}})}function Rt(){try{let e=[];if(re==null||re(),re=null,Pt(document,{contentAndOps:Ae,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),ir(Qe,document),e.length>0&&nt())try{re=fn(x,te.apiKey,e)}catch(t){}try{typeof window!="undefined"&&Lt!==null&&window.location.pathname!==Lt&&nt()&&(oe==null||oe(),oe=null,Tt++,lr())}catch(t){}}catch(e){}}function Ro(){or===null&&(or=setTimeout(()=>{or=null,Rt();try{Se==null||Se.checkUrl()}catch(e){}Wo()},ks))}function Ho(){if(!(Lo||typeof window=="undefined"||typeof history=="undefined")){Lo=!0;try{let e=t=>{let n=history[t];history[t]=function(r,o,s){let a=n.call(this,r,o,s!=null?s:null);return Ro(),a}};e("pushState"),e("replaceState"),window.addEventListener("popstate",Ro)}catch(e){}}}function mn(e){let t={};for(let[n,r]of Object.entries(e.slots))try{t[n]=r.target?document.querySelectorAll(r.target).length:1}catch(o){t[n]=0}return t}function Ps(e,t,n){var r;try{window.__sentientEditor={token:t,code:n,apiBase:Sn(e)};let o=e.editorSrc?{src:e.editorSrc}:Yn("editor.global.js");if(!o){Do();return}let s=Ge(document.createElement("script"));Xn(s,o),s.async=!0,s.onerror=()=>Do(),((r=document.head)!=null?r:document.documentElement).appendChild(s)}catch(o){}}var No="sentient-editor-load-notice";function Do(){var e;try{if(document.getElementById(No))return;let t=document.createElement("div");t.id=No,t.textContent="Couldn\u2019t load the editor \u2014 check your connection and reopen it from your dashboard.",t.style.cssText="position:fixed;bottom:16px;right:16px;z-index:2147483647;padding:12px;background:#111;color:#fff;font:13px system-ui",t.onclick=()=>t.remove(),((e=document.body)!=null?e:document.documentElement).appendChild(t),setTimeout(()=>t.remove(),1e4)}catch(t){}}function Rs(e){let t={cfg:e,apiBase:Sn(e),set(n){n.slots!==void 0&&(be=n.slots),n.slotConfig!==void 0&&(ve=n.slotConfig),n.persona!==void 0&&(J=n.persona),n.decided&&(Ae=!0),n.look&&(xt(n.look.palette),Ct(n.look.vocabulary))},apply:()=>Pt(document),installSpaHooks:Ho,exposeGlobal:()=>{yn=!0,ar(e)},dbg:(...n)=>De(e,...n)};return ct("preview.global.js","__sentientPreview").then(n=>n?n.runPreview(t):Promise.reject()).catch(()=>(t.exposeGlobal(),De(e,"preview chunk unavailable \u2014 page left as-is"),!0))}function ar(e){let t=r=>{try{oe==null||oe(),oe=null,Tt++,Lt=null,re==null||re(),re=null,ye==null||ye(),Se==null||Se.teardown(),Se=null,r&&rr(typeof window!="undefined"?window:null,e.apiKey),Ue=!1,ue=!0,r?(tt=null,J=null,x?x.destroy():st(e.apiKey)):x==null||x.dispose(),x=null}catch(o){}},n={consentWatcher:Xe,goal(r,o){try{x==null||x.goal(r,o)}catch(s){}},componentGoal(r,o){try{x==null||x.componentGoal(r,o)}catch(s){}},grantConsent(){try{if(!x&&ue||x!=null&&x.released)vn=fe(e.apiKey),x=wt(U({apiKey:e.apiKey,consent:!0,preConsentBehavior:e.preConsentBehavior,debug:e.debug,persona:e.persona,ingestUrl:Go(e)},hn?{sdk:hn}:{})),bn(Ot,x);else{let r=(x==null?void 0:x.gated)===!0;qn(e.apiKey),r&&(vn=fe(e.apiKey)),bn(Ot,x)}ue=!1,ae==null||ae()}catch(r){}Ue=!0;try{Ls()}catch(r){}},revokeConsent(){t(!0)},reapply:Rt,getState(){var r,o;try{return{apiKey:e.apiKey,persona:(r=J==null?void 0:J.persona)!=null?r:null,band:(o=J==null?void 0:J.band)!=null?o:null,slots:be,matchCounts:mn(e),consent:!ue&&(e.consent!==!1||Ue)}}catch(s){return{apiKey:e.apiKey,persona:null,band:null,slots:{},matchCounts:{},consent:!1}}}};if(window.SentientSnippet=n,window.__sentientApi=n,e.consentFrom&&!ft&&!yn)try{let r=Xe(e.consentFrom),o=!1,s=!1,a=()=>!!x&&!ue&&(x.gated===void 0?e.consent!==!1||Ue:!x.gated);ft=r.subscribe(()=>{try{let l=r.read();l!==null&&(s=!0);let i=l!=null?l:s?!1:null,u=a(),c=!u&&i!==!0&&r.refused();if(c&&!o&&(x!=null&&x.gated?x.destroy():st(e.apiKey),rr(window,e.apiKey),tt=null,J=null),o=c,i===!0&&!u)n.grantConsent();else if(i===!1&&u){let g=r.refused();t(g),g&&(o=!0)}}catch(l){}})}catch(r){}for(let r of Bo.splice(0))try{r[0]==="goal"?n.goal(r[1],r[2]):r[0]==="grantConsent"&&x?n.grantConsent():r[0]==="revokeConsent"&&x&&n.revokeConsent()}catch(o){}}function Mo(){var e;try{if(typeof window=="undefined")return;let t=window;if(typeof((e=t.SentientSnippet)==null?void 0:e.goal)=="function")return;let n=()=>{};t.SentientSnippet={goal:n,componentGoal:n,grantConsent:n,revokeConsent:n,reapply:n,consentWatcher:Xe,getState:()=>({apiKey:"",persona:null,band:null,slots:{},matchCounts:{},consent:!1})},Bo.length=0}catch(t){}}function Ns(){try{let e=window.Shopify;return typeof(e==null?void 0:e.shop)=="string"&&e.shop!==""}catch(e){return!1}}async function qo(){var e,t;try{let n=nn(window.sentient);if(!n){Mo();return}te=n,ft==null||ft(),ft=null,!n.consentFrom&&n.consent===void 0&&Ns()&&(n.consentFrom="shopify"),oo(n.consentSrc),Yt(n.nonce),yn=!1,Ae=!1,ae=null,Qe=null,be={},ve=null,xt(null),Ct(null),Ue=!1,ue=!1,Ot=null,Me=null,xe=[],et=null,tt=null,ye==null||ye(),oe==null||oe(),oe=null,Tt++,Lt=null;let r=Oo("sentient_editor_code"),o=r?null:Io();if(r||o){Ps(n,o,r),yn=!0,ar(n),De(n,"editor mode");return}if(typeof window!="undefined"&&/[?&]sentient_(preview|persona|context)=[^&]/.test(window.location.search)&&await Rs(n))return;if(n.consentFrom&&n.consent===void 0)try{n.consent=Xe(n.consentFrom).read()===!0}catch(f){n.consent=!1}n.consent!==!1&&n.sectionCapture!==!1&&!Ye()&&ct("engagement.global.js","__sentientEngagement");let s=(e=n.registry)!=null?e:Object.keys(n.slots).length===0;n.registry===void 0&&!s&&De(n,"slots declared without registry: true, so dashboard-published components are not applied");let a=s?Is(n):null,l=Cs();try{(t=l==null?void 0:l.stop)==null||t.call(l)}catch(f){}let i=n.consent!==!1&&!Ye()?it(n.apiKey):null,u=[];if(i){J={persona:i.persona,band:i.band},be=i.slots,i.slotConfig&&(ve=i.slotConfig),i.palette&&xt(i.palette),i.vocabulary&&Ct(i.vocabulary),Pt(document,U({contentAndOps:!1},l?{onAttr:(p,E)=>u.push([p,E])}:{})),i.layoutOrder&&(Qe=i.layoutOrder,ir(Qe,document));let f=bt(i.stage,n.stageAttributes);f&&(Xt(f),u.push([document.documentElement,"data-sentient-stage"]))}l&&xs(l,u,document);let c=wt(U({apiKey:n.apiKey,consent:n.consent,preConsentBehavior:n.preConsentBehavior,debug:n.debug,persona:n.persona,stageAttributes:n.stageAttributes,ingestUrl:Go(n)},hn?{sdk:hn}:{}));x=c,vn=fe(n.apiKey),ar(n),Ho();let g=Object.entries(n.slots).map(([f,p])=>({id:f,dims:p.dims})),y=$o,S={pp:l?l.v:0},w=[];if(a){let[f]=await Promise.all([Po(a,To),document.readyState==="loading"?new Promise(p=>document.addEventListener("DOMContentLoaded",p,{once:!0})):null]);Me=f,f&&(xe=w=sr(f,document)[0]),De(n,"registry scope",f&&w)}let b=(f=c)=>{let p=Array.from(jo(document).keys());return f.decide(U(U(U(U({slots:g},y),S),p.length>=2?{sections:p}:{}),s?{slotsFrom:"registry",registrySlotIds:w,render:Uo(w,document)}:{}))},B=Le(),K=c.gated===!0,_=!1,C=!1,I=!1,M=!1;ae=(f=!1)=>{let p=x;!_||C||M||Ae||ue||!p||p.gated||!f&&!I||(I=!1,M=!0,B=et=Le(),Me&&(xe=w=sr(Me,document)[0]),b(p).then(E=>{M=!1,E&&!Ae&&!ue&&x===p?v(E):(E||(xe=[]),!Ae&&(p.released||x!==p||ue)&&(I=!0))}).catch(()=>{M=!1}))};let O=b();O.then(()=>{_=!0},()=>{_=!0});let m=await Po(O,To),v=f=>{var D,H,Y,le,we;C=!0;let p=(x!=null?x:c).getPersona();p?J={persona:p.persona,band:p.band}:f.persona&&(J={persona:f.persona,band:"low"}),be=f.slots,s?ve=Vo(f.slotConfig,w):f.slotConfig&&(ve=f.slotConfig),f.palette&&xt(f.palette),f.vocabulary&&Ct(f.vocabulary),Qe=(D=f.layoutOrder)!=null?D:Qe;let E=()=>{var _e;let k=[],z=Pt(document,{onApplied:(X,ne,ce)=>k.push({slotId:X,arm:ne,el:ce})});s||zo(n,z),ir(Qe,document);try{(_e=l==null?void 0:l.reveal)==null||_e.call(l)}catch(X){}if(Ae=!0,nt())try{re==null||re(),re=fn(x,n.apiKey,k)}catch(X){}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",E,{once:!0}):E(),Ot=(H=f.goals)!=null?H:null,(n.consent!==!1||Ue)&&!ue&&bn(f.goals,x),gn=(Y=f.sectionMap)!=null?Y:null,nt()&&lr(),De(n,"applied",{persona:J,slots:be,matches:mn(n)}),!ue&&(Ko(n.apiKey)&&He(n.apiKey,tt=U(U(U(U({v:1,persona:(le=J==null?void 0:J.persona)!=null?le:f.persona,band:(we=J==null?void 0:J.band)!=null?we:"low",slots:f.slots,layoutOrder:f.layoutOrder,savedAt:Date.now()},ve?{slotConfig:ve}:{}),f.palette?{palette:f.palette}:{}),f.vocabulary?{vocabulary:f.vocabulary}:{}),(k=>k?{stage:k}:{})(bt(f.stage,n.stageAttributes)))),et=null,Wo())};if(!m){De(n,"decide timeout/null \u2014 snapshot state stands",mn(n)),O.then(f=>{if(!f){if(Ae)return;xe=[],c.released===!0||x!==c||ue||K&&Le()!==B?(I=!0,ae==null||ae()):et=B;return}if(!(!f||Ae||ue)){if(x!==c){I=!0,ae==null||ae();return}v(f),De(n,"late decide applied",mn(n))}}).catch(()=>{});return}if(ue||x!==c){I=!0,ae==null||ae();return}v(m)}catch(n){Mo()}}if(typeof window!="undefined"&&window.sentient){let e=window;if(!e.__sentientInitialized)e.__sentientInitialized=!0,Promise.resolve().then(()=>{qo()});else{let t=window.__sentientApi;t&&Promise.resolve().then(()=>{window.SentientSnippet=t})}}return oi(Ds);})();
|
|
1
|
+
"use strict";var SentientSnippet=(()=>{var Bt=Object.defineProperty,Zo=Object.defineProperties,Qo=Object.getOwnPropertyDescriptor,ei=Object.getOwnPropertyDescriptors,ti=Object.getOwnPropertyNames,Sr=Object.getOwnPropertySymbols;var _r=Object.prototype.hasOwnProperty,ni=Object.prototype.propertyIsEnumerable;var wr=(e,t,n)=>t in e?Bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))_r.call(t,n)&&wr(e,n,t[n]);if(Sr)for(var n of Sr(t))ni.call(t,n)&&wr(e,n,t[n]);return e},Ke=(e,t)=>Zo(e,ei(t));var kr=(e,t)=>()=>(e&&(t=e(e=0)),t);var Er=(e,t)=>{for(var n in t)Bt(e,n,{get:t[n],enumerable:!0})},ri=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ti(t))!_r.call(e,o)&&o!==n&&Bt(e,o,{get:()=>t[o],enumerable:!(r=Qo(t,o))||r.enumerable});return e};var oi=e=>ri(Bt({},"__esModule",{value:!0}),e);var fi,pi,gi,Or,mi,hi,Tr,j,qe,Ln=kr(()=>{"use strict";fi=Object.defineProperty,pi=Object.defineProperties,gi=Object.getOwnPropertyDescriptors,Or=Object.getOwnPropertySymbols,mi=Object.prototype.hasOwnProperty,hi=Object.prototype.propertyIsEnumerable,Tr=(e,t,n)=>t in e?fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j=(e,t)=>{for(var n in t||(t={}))mi.call(t,n)&&Tr(e,n,t[n]);if(Or)for(var n of Or(t))hi.call(t,n)&&Tr(e,n,t[n]);return e},qe=(e,t)=>pi(e,gi(t))});var Gr={};Er(Gr,{LOCAL_ENGINE_AVAILABLE:()=>wi,createLocalEngine:()=>_i});function _i(e){throw new Error("[sentient] createLocalEngine is not available in production builds. The local engine only exists under the `development` export condition.")}var wi,Fr=kr(()=>{"use strict";wi=!1});var Ma={};Er(Ma,{applyPersonaAttributes:()=>ln,applyRegistrySlots:()=>dn,applySlotArms:()=>cn,applySlotAttributes:()=>un,consentWatcher:()=>Xe,parseSnippetConfig:()=>nn,planReorder:()=>pn,reapply:()=>Rt,run:()=>qo,version:()=>It});function We(e){return e?`_${e.slice(0,12)}`:""}var Ve="_snt_uid";function yt(e){return`${Ve}${We(e)}`}var In="__sntForgetGen",ii=()=>{try{return window[In]}catch(e){return}};function Kt(e){var t,n;try{let r=window,o=(t=r[In])!=null?t:r[In]={};o[e]=((n=o[e])!=null?n:0)+1}catch(r){}}function fe(e){var t,n;return(n=(t=ii())==null?void 0:t[e])!=null?n:0}var ot="_snt_snap:",ai=["low","medium","high"];function it(e){try{let t=localStorage.getItem(ot+e);if(!t)return null;let n=JSON.parse(t);if(!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!ai.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"||!(Date.now()-n.savedAt<2592e6)||!(n.slotConfig===void 0||typeof n.slotConfig=="object"&&n.slotConfig!==null&&!Array.isArray(n.slotConfig)))return null;let r=n.vocabulary;return r!==void 0&&(typeof r!="object"||r===null||!Array.isArray(r.entries)||!Array.isArray(r.images))&&delete n.vocabulary,n.stage!==void 0&&typeof n.stage!="string"&&delete n.stage,n}catch(t){return null}}function He(e,t){try{localStorage.setItem(ot+e,JSON.stringify(t))}catch(n){}}function je(e){if(typeof AbortController!="function")return{clear:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function Tn(e,t){return new Promise(n=>{let r=setTimeout(()=>n(!1),t),o=()=>{clearTimeout(r),n(!0)};e.then(o,o)})}function ze(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function jt(e){if(e.ok===!0)return"delivered";let{status:t}=e;return typeof t!="number"?"retry":t>=200&&t<300?"delivered":t>=400&&t<500&&t!==429?"dropped":"retry"}function Ar(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let r=JSON.parse(n);return Array.isArray(r)?(localStorage.removeItem(e),r.slice(-t)):[]}catch(n){return[]}}function On(e,t,n){try{let r=(()=>{try{let a=localStorage.getItem(n);if(!a)return[];let s=JSON.parse(a);return Array.isArray(s)?s:[]}catch(a){return[]}})(),o=new Map;for(let a of r)o.set(a.id,a);for(let a of e)o.set(a.id,a);localStorage.setItem(n,JSON.stringify([...o.values()].slice(-t)))}catch(r){}}function xr(e,t){try{let n=localStorage.getItem(t);if(!n)return;let r=JSON.parse(n);if(!Array.isArray(r))return;let o=new Set(e),a=r.filter(s=>!o.has(s.id));if(a.length===r.length)return;a.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(a))}catch(n){}}var si=500,li=56*1024;function Gt(e){return`_snt_retry_${e.slice(0,12)}`}var ui={push:()=>{},flush:()=>{},destroy:()=>{}};function Cr(e){var t,n,r;if(typeof window=="undefined")return ui;let o=(t=e.flushIntervalMs)!=null?t:5e3,a=(n=e.maxBatchSize)!=null?n:20,s=(r=e.maxRetrySize)!=null?r:100,l=e.ingestUrl,i=e.apiKey,u=Gt(i),c=!1,g=fe(i),y=(...k)=>{!c&&fe(i)===g&&On(...k)},S=[],w=new Set,b=[],B=k=>{for(let z of k)K.delete(z),!w.has(z)&&(w.add(z),b.push(z));for(;b.length>si;){let z=b.shift();z&&w.delete(z)}xr(k,u)},K=new Set,_=()=>{for(;S.length>s;){let k=S.shift();k&&K.delete(k.id)}},C=k=>{w.has(k.id)||K.has(k.id)||(K.add(k.id),S.push(k),_())},I=k=>{for(let z of k)w.has(z.id)||(K.add(z.id),S.push(z));_()},M=Ar(u,s);for(let k of M)C(k);let O=0,m=0,v=(k,z=!0)=>{if(k.length===0)return;let _e=JSON.stringify(k),X=k.map(ge=>ge.id),ne,ce=je(15e3);try{ne=fetch(l,{method:"POST",keepalive:!0,signal:ce.signal,body:_e,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})}catch(ge){y(k,s,u),I(k),m++,O=Date.now()+ze(m);return}Promise.resolve(ne).then(ce.clear,ce.clear);let Ce=ge=>{if(jt(ge)!=="retry"){if(!ge.ok&&z){let Q=k.filter($e=>$e.eventType!=="pageview");if(Q.length>0&&Q.length<k.length){B(k.filter($e=>$e.eventType==="pageview").map($e=>$e.id)),v(Q,!1);return}}B(X),m=0,O=0;return}y(k,s,u),I(k),m++,O=Date.now()+ze(m)};ne&&typeof ne.then=="function"?ne.then(Ce).catch(()=>{y(k,s,u),I(k),m++,O=Date.now()+ze(m)}):Ce(ne)},f=typeof TextEncoder!="undefined"?new TextEncoder:null,p=k=>f?f.encode(k).length:k.length,E=k=>{let z=[],_e=2;for(let X of k){let ne=p(JSON.stringify(X))+1;if(z.length>0&&_e+ne>li||z.length>=a)break;z.push(X),_e+=ne}return z},D=()=>{try{if(Date.now()<O)return;for(;S.length>0&&!(Date.now()<O);){let k=S.filter(_e=>!w.has(_e.id));if(S.length=0,k.length===0)break;let z=E(k);if(z.length===0)break;z.length<k.length&&S.push(...k.slice(z.length)),v(z)}}catch(k){}},H=!0,Y=null;Y=setInterval(()=>{H&&D()},o);let le=()=>{document.visibilityState==="hidden"&&D()},we=()=>{D()};return document.addEventListener("visibilitychange",le),window.addEventListener("pagehide",we),{push(k){C(k),S.length>=a&&D()},flush:D,destroy(k){k!=null&&k.forget&&(c=!0),H=!1,Y!==null&&(clearInterval(Y),Y=null),document.removeEventListener("visibilitychange",le),window.removeEventListener("pagehide",we),D()}}}var ci=200;function Ft(e){return`_snt_goal_retry_${e.slice(0,12)}`}var di={send:()=>{},flush:()=>{},destroy:()=>{}};function Ir(e){var t,n,r;if(typeof window=="undefined")return di;let o=(t=e.flushIntervalMs)!=null?t:5e3,a=(n=e.maxRetrySize)!=null?n:100,s=(r=e.maxPerFlush)!=null?r:5,l=Ft(e.apiKey),i=!1,u=fe(e.apiKey),c=(...p)=>{!i&&fe(e.apiKey)===u&&On(...p)},g=[],y=new Set,S=new Set,w=[],b=0,B=0,K=!1,_=p=>{for(y.delete(p.id),S.has(p.id)||(S.add(p.id),w.push(p.id));w.length>ci;){let E=w.shift();E&&S.delete(E)}xr([p.id],l)},C=p=>{c([p],a,l),!S.has(p.id)&&!y.has(p.id)&&(y.add(p.id),g.push(p)),Date.now()>=b&&(B++,b=Date.now()+ze(B))},I=p=>{let E,D=je(15e3);try{E=fetch(e.url,{method:"POST",keepalive:!0,signal:D.signal,body:p.body,headers:e.headers})}catch(Y){C(p);return}let H=Y=>{var le;let we=jt(Y);if(we==="retry"){C(p);return}we==="dropped"&&((le=e.onDrop)==null||le.call(e,p,Y.status)),_(p),B=0,b=0};Promise.resolve(E).then(D.clear,D.clear),E&&typeof E.then=="function"?E.then(H).catch(()=>C(p)):H(E)},M=()=>{try{if(K||Date.now()<b)return;let p=0;for(;g.length>0&&p<s&&!(Date.now()<b);){let E=g.shift();y.delete(E.id),!S.has(E.id)&&(p++,I(E))}}catch(p){}},O=Ar(l,a);for(let p of O)y.has(p.id)||(y.add(p.id),g.push(p));O.length>0&&On(O,a,l);let m=setInterval(M,o),v=()=>{document.visibilityState==="hidden"&&M()},f=()=>M();return document.addEventListener("visibilitychange",v),window.addEventListener("pagehide",f),{send(p){if(K){S.has(p.id)||c([p],a,l);return}if(!(S.has(p.id)||y.has(p.id))){if(Date.now()<b){c([p],a,l),y.add(p.id),g.push(p);return}I(p)}},flush:M,destroy(p){p!=null&&p.forget&&(i=!0),clearInterval(m),document.removeEventListener("visibilitychange",v),window.removeEventListener("pagehide",f),M(),K=!0}}}function Pn(e){let t=(e||"").toLowerCase();if(!t.includes(".")||/^[\d.]+$|:/.test(t))return[];let n=t.split("."),r=[];for(let o=n.length-2;o>=0;o--)r.push(n.slice(o).join("."));return r}function at(e){if(typeof window=="undefined"||!e)return!1;Kt(e);let t=!1,n=yt(e);try{if(new RegExp(`(?:^|; )${n}=`).test(document.cookie)){let s=location.protocol==="https:"?"; Secure":"";for(let l of["",...Pn(location.hostname)])document.cookie=`${n}=; max-age=0; SameSite=lax; path=/${l?`; domain=${l}`:""}${s}`;t=!0}}catch(s){}let r=We(e),o=[n,"_snt_graph_edges",ot+e,Gt(e),Ft(e),`_snt_graph_nodes${r}`],a=[`_snt_asgn${r}_`];for(let s of["localStorage","sessionStorage"])try{let l=window[s];for(let i of o)l.getItem(i)!==null&&(l.removeItem(i),t=!0);for(let i=l.length-1;i>=0;i--){let u=l.key(i);u&&a.some(c=>u.startsWith(c))&&(l.removeItem(u),t=!0)}}catch(l){}try{(new RegExp(`(?:^|; )${Ve}=[^;]`).test(document.cookie)||localStorage.getItem(Ve)!==null||sessionStorage.getItem(Ve)!==null)&&localStorage.setItem(`${Ve}_tomb${r}`,"1")}catch(s){}return t}Ln();function Ut(e){return Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("|")}function Pr(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 Rn(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 Ut(e.baseline);if(typeof e.baseline=="string")return e.baseline;let o={};for(let[a,s]of Object.entries((n=e.dims)!=null?n:{}))o[a]=(r=s[0])!=null?r:"";return Ut(o)}function Lr(e,t){var n,r;return e.dims!=null?(r=(n=Pr(t))!=null?n:Pr(Rn(e)))!=null?r:{}:t}function Je(e){return e>=.3?e<.7?"medium":"high":"low"}var yi={discovered:"d-",campaign:"c-",retargeting:"r-",arrival:"a-"},Fa=Object.values(yi);var Rr=["new","browsing","carted","customer","lapsed"];var vi=["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 Nr(e){return bi(e)!==null}function bi(e){var t;if(!e)return null;let n=e.toLowerCase();return(t=vi.find(r=>n.includes(r.toLowerCase())))!=null?t:null}function Dr(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 Mr(e,t,n){if(!e)return"direct";try{let r=new URL(e);if(t)try{if(new URL(t).host===r.host)return"direct"}catch(a){}let o=r.hostname.toLowerCase();return n&&`.${o}`.endsWith(`.${n}`)?"direct":/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(o)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(o)?"social":"referral"}catch(r){return"direct"}}function $r(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var Si=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function Br(e){let t={},n={};try{let r=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([o,a])=>{let s=Array.isArray(a)?a[0]:a;return s===void 0?[]:[[o,s]]});for(let[o,a]of r)o.startsWith("utm_")?o in t||(t[o]=a):Si.includes(o)&&(o in n||(n[o]=a))}catch(r){}return{utmParams:t,clickIds:n}}function Kr(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function Nn(e){return j(j(j({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 Dn(e){let t=Nn(e);return Lr(t,Rn(t))}function jr(e){return typeof e=="string"?e:Ut(e)}Ln();var jn;function Yt(e){jn=typeof e=="string"&&e!==""?e:void 0}function Hr(e=document){if(jn)return jn;try{let t=e.querySelector("script[nonce]");return(t==null?void 0:t.nonce)||(t==null?void 0:t.getAttribute("nonce"))||void 0}catch(t){return}}function Ge(e,t=document){let n=Hr(t);return n&&e.setAttribute("nonce",n),e}function qr(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(e){}try{if(typeof crypto!="undefined"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0"),(n===3||n===5||n===7||n===9)&&(t+="-");return t}}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 Ur="_snt_uid",ki=365,st="_snt_uid";function Ei(){return qr()}function lt(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function Jr(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function qt(e,t,n,r){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${r?`; domain=${r}`:""}${Jr()}`}catch(o){}}function Wt(e){try{return localStorage.getItem(e)}catch(t){return null}}function Wr(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function Mn(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function Ai(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function xi(e){try{sessionStorage.removeItem(e)}catch(t){}}function Ci(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=lax; path=/${Jr()}`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function Ii(e){try{localStorage.removeItem(e)}catch(t){}}function Ht(e,t){qt(e,"",0,t)}var Oi={getSessionId:()=>null,isEphemeral:()=>!1,domain:null,destroy:()=>{}};function Ti(e,t){if(e===!1)return null;if(typeof e=="string")return e.replace(/^\./,"");for(let n of Pn(location.hostname))if(qt(t,"1",10,n),lt(t)==="1")return Ht(t,n),n;return null}function Yr(e){var t,n,r,o,a,s,l;if(typeof window=="undefined")return Oi;let i=We(e==null?void 0:e.apiKey),u=(t=e==null?void 0:e.cookieName)!=null?t:yt(e==null?void 0:e.apiKey),c=`${st}${i}`,g=`${st}_tomb${i}`,y=((n=e==null?void 0:e.cookieTTLDays)!=null?n:ki)*24*60*60,S=m=>m&&m.length>0?m:null,w=()=>{var m,v;return i&&!(e!=null&&e.cookieName)&&Wt(g)===null?(v=(m=S(lt(Ur)))!=null?m:S(Wt(st)))!=null?v:S(Mn(st)):null},b=Ti(e==null?void 0:e.cookieDomain,`${u}_dom`),B=S(lt(u)),K=b?(Ht(u),S(lt(u))):null,_=(l=(s=(a=(o=(r=K!=null?K:B)!=null?r:S(Wt(c)))!=null?o:S(Mn(c)))!=null?a:w())!=null?s:S(e==null?void 0:e.ssrSessionId))!=null?l:Ei();qt(u,_,y,b),b&<(u)!==_&&(b=null,qt(u,_,y));let C=Wr(c,_),I=Ci(u),M=C?!1:Ai(c,_),O=!C&&!I&&!M;return{getSessionId:()=>_,isEphemeral:()=>O,domain:b,destroy:()=>{_=null,Ht(u),Ht(u,b),Ii(c),xi(c),i&&!(e!=null&&e.cookieName)&&(lt(Ur)!==null||Wt(st)!==null||Mn(st)!==null)&&Wr(g,"1")}}}var Pi=1800*1e3;function Vt(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Li(e=Pi,t){let n=new Map,r=`_snt_asgn${We(t)}_`,o=(i,u)=>`${r}${encodeURIComponent(i)}:${encodeURIComponent(u)}`,a=i=>{let u=i.slice(r.length),c=u.indexOf(":");if(c<0)return null;try{return{componentId:decodeURIComponent(u.slice(0,c)),segment:decodeURIComponent(u.slice(c+1))}}catch(g){return null}},s=()=>{try{let i=[];for(let u=0;u<localStorage.length;u++){let c=localStorage.key(u);c!=null&&c.startsWith(r)&&i.push(c)}return i}catch(i){return[]}},l=i=>i.assignedAt+(i.ttlMs&&i.ttlMs>0?i.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let i of s())try{let u=localStorage.getItem(i);if(!u)continue;let c=JSON.parse(u);if(l(c)){localStorage.removeItem(i);continue}let g=a(i);if(!g)continue;n.set(Vt(g.componentId,g.segment),c)}catch(u){}})(),{get(i,u){let c=n.get(Vt(i,u));return c?l(c)?(n.delete(Vt(i,u)),null):c:null},set(i,u,c){let g=Vt(i,u);n.set(g,c);try{localStorage.setItem(o(i,u),JSON.stringify(c))}catch(y){}},clear(){n.clear();for(let i of s())try{localStorage.removeItem(i)}catch(u){}}}}var Gn="data-sentient-stage";function bt(e,t){return!t||typeof e!="string"||!(e==="returning"||Rr.includes(e))?null:t!=="detailed"&&(e==="customer"||e==="lapsed")?"returning":e}function Xt(e,t=document){try{e?t.documentElement.setAttribute(Gn,e):t.documentElement.removeAttribute(Gn)}catch(n){}}var Fn="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",Xr="[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.",Vr=!1,zt=!1;function Ri(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function Ni(e){var t;let n=Yr({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),r=(t=n.getSessionId())!=null?t:"local",o=Ri(),a=Promise.resolve().then(()=>(Fr(),Gr)).then(c=>{let g=c;return g.LOCAL_ENGINE_AVAILABLE?(Vr||(Vr=!0,console.info(Xr)),g):(zt||(zt=!0,console.error(Fn)),null)}).catch(()=>(zt||(zt=!0,console.error(Fn)),null)),s=null,l={low:.15,medium:.5,high:.85},i=(()=>{var c;if(e.initialPersona)return j({},e.initialPersona);let g=it(e.apiKey||"local");return g?{persona:g.persona,confidence:(c=l[g.band])!=null?c:.15}:null})();function u(c){let g=document.documentElement;g.dataset.sentientPersona===void 0&&(g.dataset.sentientPersona=c.persona,g.dataset.sentientConfidence=Je(c.confidence))}return{isLocal:!0,async decide(c){var g,y,S;let w=await a;if(!w)return null;let b=w.createLocalEngine({sessionId:r,forcedPersona:o}).decide(c);return s=qe(j({},b),{layoutOrder:(y=(g=b.layoutOrder)!=null?g:s==null?void 0:s.layoutOrder)!=null?y:null,slots:j(j({},(S=s==null?void 0:s.slots)!=null?S:{}),b.slots)}),He(e.apiKey||"local",{v:1,persona:s.persona,band:Je(s.confidence),slots:s.slots,layoutOrder:s.layoutOrder,savedAt:Date.now()}),u(b),b},getSlotResult(c){var g,y,S;return(S=(y=s==null?void 0:s.slots[c])!=null?y:(g=e.initialSlots)==null?void 0:g[c])!=null?S:null},getSlotConfig(c){var g,y;return(y=(g=e.initialSlotConfig)==null?void 0:g[c])!=null?y:null},getSitePalette(){var c;return(c=e.initialPalette)!=null?c:null},reportSlots(){},getVisitorId:()=>null,getPersona(){let c=s!=null?s:i;return c?{persona:c.persona,confidence:c.confidence,band:Je(c.confidence)}:null},async assign(c,g){var y;let S=await a;return!S||!g||g.length===0?g!=null&&g[0]?{variantId:g[0],assignmentTtlMs:0}:null:{variantId:(y=S.createLocalEngine({sessionId:r,forcedPersona:o}).decide({components:[{id:c,variantIds:g}]}).assignments[c])!=null?y:g[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>n.destroy()}}var Zt=/^(\*|\/[^\s?#*]*(\/\*)?)$/;function $n(e){let t=e.split(/[?#]/)[0]||"/";return t.length>1?t.replace(/\/+$/,"")||"/":t}function Wn(e,t){if(e===void 0||!Zt.test(e))return!1;if(e==="*")return!0;let n=$n(t);if(e.endsWith("/*")){let r=$n(e.slice(0,-2));return n.startsWith(r==="/"?"/":`${r}/`)&&n!==r}return n===$n(e)}function Vn(e,t){if(!e)return!1;if(e==="/")return t==="/";let n=e.endsWith("/")?e.slice(0,-1):e;return t===n||t.startsWith(`${n}/`)}function St(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="form"?!0:Array.isArray(t.children)?t.children.some(St):!1}var zr="sentient-reveal",ut="sentient-revealed",Zr=240,Bn=!1;function Di(e){if(Bn||e.getElementById(zr)){Bn=!0;return}let t=Ge(e.createElement("style"),e);t.id=zr,t.textContent=`@media (prefers-reduced-motion: no-preference){@keyframes ${ut}{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:none}}.${ut}{animation:${ut} ${Zr}ms cubic-bezier(.2,.6,.2,1) both}}`,e.head.appendChild(t),Bn=!0}function zn(e,t={}){var n;let r=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!r||!(e instanceof Element)||(t.arm!==void 0&&e.setAttribute("data-sentient-arm",t.arm),t.persona!==void 0&&e.setAttribute("data-sentient-persona",t.persona),t.previous!==void 0&&t.previous===e.textContent))return!1;Di(r),e.classList.remove(ut),e.offsetWidth,e.classList.add(ut);let o=()=>{e.classList.remove(ut),e.removeEventListener("animationend",o)};return e.addEventListener("animationend",o),!0}function Hn(e,t,n,r){let o=[];{let a=!1,s=[],l=()=>{if(a)return;let i=Date.now();for(s.push(i);s.length>0&&i-s[0]>500;)s.shift();s.length>=3&&(a=!0,e("rage_click"))};t.addEventListener("click",l),o.push(()=>t.removeEventListener("click",l))}{let a=!1,s=l=>{if(a||!(l.target instanceof Node)||!t.contains(l.target)&&t!==l.target)return;a=!0;let i=typeof window!="undefined"?window.getSelection():null,u=i?i.toString().length:0;e("text_copy",{selectionLength:u})};document.addEventListener("copy",s),o.push(()=>document.removeEventListener("copy",s))}{let a=!1,s=!1,l=null,i=()=>{l!==null&&(clearTimeout(l),l=null)},u=()=>{a||!s||(i(),l=setTimeout(()=>{!a&&s&&(a=!0,e("scroll_hesitation"))},3e3))},c=()=>{i(),u()},g=S=>{for(let w of S)s=w.intersectionRatio>.3,s?u():i()},y=new IntersectionObserver(g,{threshold:[.3]});y.observe(t),window.addEventListener("scroll",c,{passive:!0}),o.push(()=>{y.disconnect(),window.removeEventListener("scroll",c),i()})}if((r==null?void 0:r.tabLoss)!==!1){let a=!1,s=n!=null?n:Date.now(),l=()=>{if(a||document.visibilityState!=="hidden")return;let i=Date.now()-s;i<15e3&&(a=!0,e("tab_loss",{timeOnPage:i}))};document.addEventListener("visibilitychange",l),o.push(()=>document.removeEventListener("visibilitychange",l))}return()=>{for(let a of o)a()}}function Mi(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var Qr="https://api.sentient-ui.com/v1/events",pe=new Map,eo=null;function $i(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var Bi=3;function Kn(){return qr()}function Jt(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function Ki(){let e=new WeakMap,t=new Map,n=!1,r=(l,i,u)=>{let c=l.get(i);return u===null?c?!0:(l.set(i,new Set),!1):c?c.has(u)?!0:(c.add(u),!1):(l.set(i,new Set([u])),!1)},o=typeof window!="undefined"&&"event"in window,a=()=>{if(!o)return;let l=window.event;return typeof Event=="function"&&l instanceof Event?l:void 0},s=()=>{if(o){Promise.resolve().then(()=>{n=!1,t.clear()});return}let l=!1,i=()=>{l||(l=!0,n=!1,t.clear())};if(setTimeout(i,0),typeof MessageChannel=="function"){let u=new MessageChannel;u.port1.onmessage=()=>{u.port1.close(),u.port2.close(),i()},u.port2.postMessage(0)}};return{firedBefore(l,i){let u=a();if(u){let g=e.get(u);return g||(g=new Map,e.set(u,g)),r(g,l,i)}let c=r(t,l,i);return!c&&!n&&(n=!0,s()),c}}}var to=new Set;function ji(e,t,n){let r=typeof window=="undefined"?null:window.history;if(!r)return()=>{};let o=!1,a,s=()=>{if(o)return;let u=Jt();!u||u===a||(a=u,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${u}`))},l=[];for(let u of["pushState","replaceState"]){let c=r[u],g=function(...y){let S=c.apply(this,y);return s(),S};r[u]=g,l.push([u,c,g])}window.addEventListener("popstate",s);let i=Jt();return i&&to.has(`${t}:${i}`)?a=i:s(),()=>{if(!o){o=!0,window.removeEventListener("popstate",s);for(let[u,c,g]of l)r[u]===g&&(r[u]=c)}}}var vt={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,assign:()=>Promise.resolve(null),decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getVisitorId:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}};function Gi(){try{return Br(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function no(e){return e.replace(/\/events\/?$/,"")}function Ye(){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 qn(e){var t;if(typeof window=="undefined")return;let n=e!=null?e:eo;if(!n){console.warn("[sentient] grantConsent() called before init()");return}let r=pe.get(n);if(!r){console.warn("[sentient] grantConsent() called before init()");return}let{config:o,upgrade:a,reinit:s}=r;if(!a){r.upgradeBlockedReason&&console.warn(r.upgradeBlockedReason);return}if(o.respectDoNotTrack!==!1&&Ye())return;let l=(s!=null?s:wt)(qe(j({},o),{consent:!0}));a(l);let i=(t=pe.get(n))==null?void 0:t.dispose;pe.set(n,{config:qe(j({},o),{consent:!0}),upgrade:null,dispose:i})}function Fi(e,t){var n;let r=e.preConsentBehavior==="statistical_winner",o=no((n=e.ingestUrl)!=null?n:Qr),a={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},s=new Map,l=new Map,i={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(m,v,f){if(!r)return Promise.resolve(null);let p=s.get(m);return p?Promise.resolve(p):Un(l,m,async()=>{try{let E=new URLSearchParams({componentId:m});for(let le of v!=null?v:[])E.append("variantIds[]",le);let D=je(5e3),H;try{let le=await fetch(`${o}/winner?${E.toString()}`,{headers:a,signal:D.signal});if(!le.ok)return v!=null&&v[0]?{variantId:v[0],assignmentTtlMs:0}:null;H=await le.json()}finally{D.clear()}let Y={variantId:H.variantId,assignmentTtlMs:0};return s.set(m,Y),Y}catch(E){return v!=null&&v[0]?{variantId:v[0],assignmentTtlMs:0}:null}})},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getVisitorId:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}},u=!1,c=new Set,g=[],y=[],S=[],w=()=>{for(let[,,m]of S.splice(0))m(null);b.length=0},b=[],B=!1,K=()=>{if(u)return;B=!0;let m=pe.get(e.apiKey);(m==null?void 0:m.upgrade)===O&&pe.set(e.apiKey,{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): client released before consent; call init() again"})},_=[],C=()=>{setTimeout(()=>{var m;try{(m=_.shift())==null||m(i)}catch(v){}_.length&&C()})},I=m=>{u?_.length?_.push(m):m(i):!t&&!B&&b.length<100?b.push(m):B&&e.debug&&console.warn("[sentient] goal dropped: client released")},M={get gated(){return!u&&!t},get released(){return B&&!u},takeHeld:()=>b.splice(0),track:m=>i.track(m),goal:((m,v,f,p)=>I(E=>E.goal(m,v,f,p))),componentGoal:(m,v,f)=>i.componentGoal(m,v,f),identify:(m,v)=>i.identify(m,v),getAssignment:(m,v)=>i.getAssignment(m,v),isUnified:m=>{var v,f;return(f=(v=i.isUnified)==null?void 0:v.call(i,m))!=null?f:!1},assign:(m,v,f,p,E)=>i.assign(m,v,f,p,E),decide:m=>u?i.decide(m):B||t?Promise.resolve(null):new Promise(v=>S.push([m,Pe(),v])),getSlotResult:m=>i.getSlotResult(m),isSlotDecided:m=>{var v,f;return(f=(v=i.isSlotDecided)==null?void 0:v.call(i,m))!=null?f:!0},getSlotConfig:m=>i.getSlotConfig(m),getSitePalette:()=>i.getSitePalette(),getStyleVocabulary:()=>{var m,v;return(v=(m=i.getStyleVocabulary)==null?void 0:m.call(i))!=null?v:null},reportSlots:(m,v,f,p)=>i.reportSlots(m,v,f,p),reportSkeleton:(m,v)=>{var f;return(f=i.reportSkeleton)==null?void 0:f.call(i,m,v)},reportAgentData:(m,v,f)=>{var p;return(p=i.reportAgentData)==null?void 0:p.call(i,m,v,f)},reportDrift:(m,v,f,p)=>{var E;return(E=i.reportDrift)==null?void 0:E.call(i,m,v,f,p)},requestSlots:(m,v,f)=>{var p;return u?(p=i.requestSlots)==null?void 0:p.call(i,m,v,f):g.push([m,v,f])},decideSlots:m=>{var v;return u?(v=i.decideSlots)==null?void 0:v.call(i,m):y.push(...m)},cancelSlots:m=>{var v;if(u)return(v=i.cancelSlots)==null?void 0:v.call(i,m);let f=new Set(m);for(let p of g)p[0]=p[0].filter(E=>!f.has(E));y=y.filter(p=>!f.has(p.id))},onSlotsChanged:m=>(c.add(m),()=>{c.delete(m)}),getPersona:()=>i.getPersona(),getVisitorId:()=>{var m,v;return(v=(m=i.getVisitorId)==null?void 0:m.call(i))!=null?v:null},fetchWeights:()=>i.fetchWeights(),getGraph:()=>i.getGraph(),flush:()=>i.flush(),dispose:()=>(K(),w(),i.dispose()),destroy:()=>(K(),w(),u?i.destroy():at(e.apiKey))};function O(m){var v,f,p;i=m,u=!0,b.length&&(_.push(...b.splice(0)),C());let E=Pe();for(let[D,H,Y]of S.splice(0))H!==E?Y(null):m.decide(D).then(Y,()=>Y(null));(v=m.onSlotsChanged)==null||v.call(m,()=>c.forEach(D=>D()));for(let[D,H,Y]of g.splice(0))D.length>0&&((f=m.requestSlots)==null||f.call(m,D,H,Y));y.length>0&&((p=m.decideSlots)==null||p.call(m,y.splice(0)))}return{proxy:M,setInner:O}}function Pe(){return typeof location=="undefined"?"":location.pathname+(/^#!?\//.test(location.hash)?location.hash:"")}function Un(e,t,n){let r=e.get(t);if(r)return r;let o=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,o),o}function wt(e){var t,n,r,o,a,s,l,i,u,c,g;if(typeof window=="undefined")return vt;e.nonce&&Yt(e.nonce),eo=e.apiKey||"local";let y=pe.get(e.apiKey||"local");if(y!=null&&y.dispose)try{y.dispose()}catch(d){}let S=e.respectDoNotTrack!==!1&&Ye(),w=e.consent===!1||S,b=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!b&&e.localMode!==!1)return pe.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): this client is keyless/local \u2014 there is no hosted client to upgrade to. Configure a pk_ API key to enable tracking."}),w?vt:Ni(e);if(w){if(!e.apiKey||!e.apiKey.startsWith("pk_"))return e.preConsentBehavior==="statistical_winner"&&console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),pe.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): the client was initialized with an invalid apiKey (expected a pk_ public key) \u2014 consent cannot enable tracking."}),vt;let{proxy:d,setInner:h}=Fi(e,S);return pe.set(e.apiKey,{config:e,upgrade:S?null:h}),d}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."),vt;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),vt;let B=(t=e.ingestUrl)!=null?t:Qr,K=Date.now(),_=Yr({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey,cookieDomain:e.cookieDomain}),C=Li(void 0,e.apiKey),I=!1,M=fe(e.apiKey),O=()=>!I&&fe(e.apiKey)===M,m=new Set((n=e.initialUnified)!=null?n:[]),v=qe(j({},C),{get:(d,h)=>m.has(d)?null:C.get(d,h),set:(...d)=>{O()&&C.set(...d)}}),f=Cr({ingestUrl:B,apiKey:e.apiKey}),p=no(B),E={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},D=new Set,H=Ir({url:`${p}/goals`,apiKey:e.apiKey,headers:E,onDrop:(d,h)=>{if(!e.debug){if(D.has(h))return;D.add(h)}console.warn(`[sentient] goal dropped (HTTP ${h}) \u2014 this will not be retried. `+(h===400?"The session was not found: call init() and let the session upsert complete before firing goals.":h===401||h===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),d)}}),Y=Dr((r=navigator.userAgent)!=null?r:""),le=window.location.origin,we=Mr((o=document.referrer)!=null?o:"",le,_.domain),k=(a=e.sessionSegment)!=null?a:`${Y}:${we}`,z=new Map,_e=new Map,X=new Map,ne=new Set,ce=new Map,Ce=null,ge=null,Q=null,$e=new Set,Nt=new Set,wn=new Map,_n=new Map,ur=new Set,cr=new Set,dr=new Set,fr=new Set,kn=null,pt=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,pr=new Set,Dt=new Set,Mt=new Set,gt=new Map,En=null,$t=new Set,mt=new Map,An=null,Jo=2,gr=new Map,ke=!1,mr=(d,h,P)=>{var F;let G=new Set,A=1;for(let T of d){h.delete(T);let L=((F=gr.get(T))!=null?F:0)+1;gr.set(T,L),L<=Jo&&(G.add(T),L>A&&(A=L))}G.size>0&&setTimeout(()=>{ke||P(G)},ze(A))},xn=d=>{for(let h of d)X.has(h.id)||X.set(h.id,Dn(h))};if(e.initialSlots)for(let[d,h]of Object.entries(e.initialSlots))X.set(d,h),ne.add(d);if(e.initialSlotConfig)for(let[d,h]of Object.entries(e.initialSlotConfig))ce.set(d,h);e.initialPalette&&(Ce=e.initialPalette),e.initialVocabulary&&(ge=e.initialVocabulary);let Ie=it(e.apiKey);if(Ie){for(let[d,h]of Object.entries(Ie.slots))X.has(d)||X.set(d,h);for(let[d,h]of Object.entries((s=Ie.slotConfig)!=null?s:{}))ce.has(d)||ce.set(d,h);!Ce&&Ie.palette&&(Ce=Ie.palette),!ge&&Ie.vocabulary&&(ge=Ie.vocabulary)}let hr={low:.15,medium:.5,high:.85};if(e.initialPersona)Q=j({},e.initialPersona);else{let d=document.documentElement.dataset;d.sentientPersona?Q={persona:d.sentientPersona,confidence:(i=hr[(l=d.sentientConfidence)!=null?l:"low"])!=null?i:.15}:Ie&&(Q={persona:Ie.persona,confidence:(u=hr[Ie.band])!=null?u:.15})}if(e.initialAssignments)for(let[d,h]of Object.entries(e.initialAssignments))v.set(d,k,{variantId:h,assignedAt:Date.now(),segment:k,confidence:1});let Be=Promise.resolve(),yr=_.getSessionId();if(yr){let d=$r((c=document.referrer)!=null?c:""),{utmParams:h,clickIds:P}=Gi(),F=j(j(j(j({sessionId:yr,deviceClass:Y,trafficSource:we,referrerDomain:d,utmParams:h,clickIds:P,landingPath:typeof location!="undefined"?location.pathname:void 0,timeOfDay:Kr(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:_.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Nr((g=navigator.userAgent)!=null?g:"")},e.userId?{userId:e.userId}:{}),e.persona?{persona:e.persona}:{}),e.country?{country:e.country}:{}),e.sdk?{sdk:e.sdk.name,sdkVersion:e.sdk.version}:{}),G=async()=>{for(let A=0;;A++){if(ke||!O())return;let T=je(5e3);try{let L=await fetch(`${p}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(F),headers:E,signal:T.signal});if(L.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");return}if(L.ok||jt(L)==="dropped")return}catch(L){}finally{T.clear()}if(A>=Bi){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(L=>setTimeout(L,ze(A+1)))}};try{Be=G()}catch(A){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:f});let Yo=Ki(),ht=null,Cn=!1,ie={goal(d,h={},P=1,F=0){var G,A,T,L,W,V,q;let ee=_.getSessionId();if(!ee||ke||!O())return;let $=$i(h)?h:{metadata:h},me=[d,(G=$.externalId)!=null?G:"",(A=$.stepIndex)!=null?A:F,(T=$.weight)!=null?T:P].join("\0"),Ee=$.value!==void 0?`${$.value}\0${(L=$.currency)!=null?L:""}`:null;if(Yo.firedBefore(me,Ee)){e.debug&&console.log(`[sentient] goal("${d}") already recorded for this action \u2014 not sent twice`);return}let de=Kn(),ae={sessionId:ee,name:d,metadata:(W=$.metadata)!=null?W:{},weight:(V=$.weight)!=null?V:P,stepIndex:(q=$.stepIndex)!=null?q:F,goalId:de,value:$.value,currency:$.currency,externalId:$.externalId};e.debug&&console.log("[sentient] goal",ae);let N={id:de,body:JSON.stringify(ae)};Be.then(()=>H.send(N))},componentGoal(d,h,P){var F,G,A;let T=_.getSessionId();if(!T||ke||!O())return;let L=v.get(d,k),W=L?null:(F=X.get(d))!=null?F:null;if(!L&&W===null){e.debug&&console.warn(`[sentient] componentGoal("${d}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}if(!L&&!ne.has(d)){e.debug&&console.warn(`[sentient] componentGoal("${d}"): slot not decided this session \u2014 not attributed`);return}let V=L?L.variantId:jr(W),q={id:Kn(),sessionId:T,projectId:e.apiKey,componentId:d,variantId:V,eventType:"goal_achieved",goalType:h,payload:j({reward:(G=P==null?void 0:P.reward)!=null?G:1,goalValue:P==null?void 0:P.value,currency:P==null?void 0:P.currency},(A=P==null?void 0:P.metadata)!=null?A:{}),timestamp:Date.now(),timeInSession:Date.now()-K,path:Jt()};e.debug&&console.log("[sentient] componentGoal",q),Be.then(()=>{!ke&&O()&&f.push(q)})},identify(d,h){let P=_.getSessionId();!P||ke||!O()||Be.then(()=>{fetch(`${p}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:P,userId:d,userHash:h==null?void 0:h.userHash,ephemeral:_.isEphemeral()}),headers:E}).catch(()=>{})})},track(d){let h=_.getSessionId();if(!h||ke||!O()||d.eventType==="variant_assigned"&&X.get(d.componentId)!==void 0&&!ne.has(d.componentId)&&!v.get(d.componentId,k))return;let P=qe(j({path:Jt()},d),{id:Kn(),sessionId:h,timestamp:Date.now(),timeInSession:Date.now()-K});e.debug&&console.log("[sentient] track",P),Be.then(()=>f.push(P))},getAssignment(d,h){return v.get(d,h)},isUnified:d=>m.has(d),async assign(d,h,P,F,G){var A;let T=_.getSessionId();if(!T)return null;let L=(G==null?void 0:G.unified)===!0;if(L&&m.has(d))return{variantId:(A=h==null?void 0:h[0])!=null?A:"",assignmentTtlMs:0,unified:!0};let W=v.get(d,k);if(W&&(h!=null&&h.length||W.content!==void 0)){let V=W.ttlMs&&W.ttlMs>0?Math.max(0,W.assignedAt+W.ttlMs-Date.now()):0;return{variantId:W.variantId,assignmentTtlMs:V,content:W.content}}return Un(z,L?`${d}\0unified`:d,async()=>{if(!await Tn(Be,2500)||ke||!O())return null;let V=je(3e4);try{let q={sessionId:T,componentId:d,variantIds:h};F!==void 0?q.agentDataByVariant=F:P!==void 0&&(q.agentData=P),L&&(q.caps={unified:!0});let ee=await fetch(`${p}/assign`,{method:"POST",body:JSON.stringify(q),headers:E,signal:V.signal});if(!ee.ok)return null;let $=await ee.json();return $.unified===!0?L?(m.add(d),{variantId:$.variantId,assignmentTtlMs:0,unified:!0}):null:(v.set(d,k,j({variantId:$.variantId,assignedAt:Date.now(),segment:k,confidence:1,content:$.content},$.assignmentTtlMs&&$.assignmentTtlMs>0?{ttlMs:$.assignmentTtlMs}:{})),$)}catch(q){return null}finally{V.clear()}})},async decide(d){var h,P;let F=_.getSessionId();if(!F)return null;let G=(h=d.slots)!=null?h:[],A={sessionId:F};d.sections&&d.sections.length>0&&(A.sections=d.sections.map(L=>({id:L}))),A.components=(P=d.components)!=null?P:[],G.length>0&&(A.slots=G.map(Nn)),d.slotsFrom==="registry"&&(A.slotsFrom="registry",d.registrySlotIds&&(A.registrySlotIds=d.registrySlotIds),d.bootstrap===!1&&(A.bootstrap=!1),d.render&&Object.keys(d.render).length>0&&(A.render=d.render)),d.v&&(A.v=d.v),typeof d.pp=="number"&&(A.pp=d.pp),e.persona&&(A.persona=e.persona);let T=JSON.stringify(A);return Un(_e,T,async()=>{var L,W,V,q,ee,$,me,Ee;if(!await Tn(Be,2500)||ke||!O())return xn(G),null;let de=je(3e4);try{let ae=await fetch(`${p}/decide`,{method:"POST",body:T,headers:E,signal:de.signal});if(!ae.ok)return xn(G),null;let N=await ae.json(),Oe=bt(N.stage,e.stageAttributes);e.stageAttributes&&Xt(Oe);let rt={};for(let Z of G){let Te=(L=N.slots)==null?void 0:L[Z.id];if(Te!==void 0){rt[Z.id]=Te,X.set(Z.id,Te),ne.add(Z.id);continue}let vr=X.get(Z.id);if(vr!==void 0)rt[Z.id]=vr;else{let br=Dn(Z);rt[Z.id]=br,X.set(Z.id,br)}}if(N.slots)for(let[Z,Te]of Object.entries(N.slots))Z in rt||(rt[Z]=Te,X.set(Z,Te),ne.add(Z));let Xo=Q!=null&&Q.persona!=="unknown";N.persona&&!(N.persona==="unknown"&&Xo)?Q={persona:N.persona,confidence:(W=N.confidence)!=null?W:0}:Q||(Q={persona:"unknown",confidence:0});for(let[Z,Te]of Object.entries((V=N.assignments)!=null?V:{}))v.set(Z,k,{variantId:Te,assignedAt:Date.now(),segment:k,confidence:1});if(N.slotConfig)for(let[Z,Te]of Object.entries(N.slotConfig))ce.set(Z,Te);N.palette&&(Ce=N.palette),N.vocabulary&&(ge=N.vocabulary);for(let Z of(q=d.registrySlotIds)!=null?q:[])(ee=N.slotConfig)!=null&&ee[Z]||(ce.delete(Z),X.delete(Z),ne.delete(Z));return O()&&He(e.apiKey,j(j(j(j({v:1,persona:Q.persona,band:Je(Q.confidence),slots:Object.fromEntries(X),layoutOrder:($=N.layoutOrder)!=null?$:null,savedAt:Date.now()},ce.size>0?{slotConfig:Object.fromEntries(ce)}:{}),Ce?{palette:Ce}:{}),ge?{vocabulary:ge}:{}),Oe?{stage:Oe}:{})),j(j(j(j(j(j(j({layoutOrder:(me=N.layoutOrder)!=null?me:null,assignments:(Ee=N.assignments)!=null?Ee:{},slots:rt,persona:Q.persona,confidence:Q.confidence},N.slotConfig?{slotConfig:N.slotConfig}:{}),N.goals?{goals:N.goals}:{}),N.sectionMap?{sectionMap:N.sectionMap}:{}),N.palette?{palette:N.palette}:{}),N.vocabulary?{vocabulary:N.vocabulary}:{}),N.stage?{stage:N.stage}:{}),N.context?{context:N.context}:{})}catch(ae){return xn(G),null}finally{de.clear()}})},getSlotResult(d){var h;return(h=X.get(d))!=null?h:null},isSlotDecided(d){return ne.has(d)},getSlotConfig(d){var h;return(h=ce.get(d))!=null?h:null},reportSlots(d,h,P,F){var G;let A={};for(let[T,L]of Object.entries(F!=null?F:{}))for(let W of L){let V=`${T}|${W.key}`;!pt.test(T)||dr.has(V)||(dr.add(V),((G=A[T])!=null?G:A[T]=[]).push(W))}Object.keys(A).length>0&&fetch(`${p}/slots/observed`,{method:"POST",headers:E,body:JSON.stringify({slotIds:Object.keys(A),authoredArms:A})}).catch(()=>{});for(let T of d)if(!(typeof T!="string"||T.length===0)){if(!pt.test(T)){Mi()&&!pr.has(T)&&(pr.add(T),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(T)} will not register \u2014 ids must start with a letter or digit and contain only letters, digits, '_' or '-' (max 128 chars): /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.`));continue}if(!$e.has(T)){$e.add(T),Nt.add(T);let L=h==null?void 0:h[T];if(typeof L=="string"){let V=L.replace(/\s+/g," ").trim().slice(0,400);V!==""&&wn.set(T,V)}let W=P==null?void 0:P[T];W!==void 0&&_n.set(T,W)}}Nt.size===0||kn!=null||(kn=setTimeout(()=>{kn=null;let T=[...Nt];Nt.clear();for(let L=0;L<T.length;L+=20){let W=T.slice(L,L+20),V={},q={};for(let ee of W){let $=wn.get(ee);$!==void 0&&(V[ee]=$,wn.delete(ee));let me=_n.get(ee);me!==void 0&&(q[ee]=me,_n.delete(ee))}fetch(`${p}/slots/observed`,{method:"POST",headers:E,body:JSON.stringify(j(qe(j(j({slotIds:W},Object.keys(V).length>0?{baselineTexts:V}:{}),Object.keys(q).length>0?{baselineSkeletons:q}:{}),{pagePaths:Object.fromEntries(W.map(ee=>[ee,location.pathname]))}),Object.keys(V).length>0&&_.getSessionId()?{sessionId:_.getSessionId()}:{}))}).catch(()=>{})}},1e3))},reportSkeleton(d,h){!pt.test(d)||ur.has(d)||(ur.add(d),fetch(`${p}/slots/observed`,{method:"POST",headers:E,body:JSON.stringify({slotIds:[d],baselineSkeletons:{[d]:h}})}).catch(()=>{}))},reportAgentData(d,h,P){let F=`${d}|${h}`;!pt.test(d)||fr.has(F)||(fr.add(F),fetch(`${p}/slots/observed`,{method:"POST",headers:E,body:JSON.stringify(j(j({slotIds:[d],agentData:{[d]:{[h]:P}}},h.startsWith("authored.")?{authoredArms:{[d]:[{key:h.slice(9)}]}}:{}),_.getSessionId()?{sessionId:_.getSessionId()}:{}))}).catch(()=>{}))},reportDrift(d,h,P,F){let G=`${d}|${h}`,A=_.getSessionId();!A||cr.has(G)||(cr.add(G),fetch(`${p}/slots/drift`,{method:"POST",headers:E,body:JSON.stringify({sessionId:A,reports:[{slotId:d,expectedFp:h,observedFp:P,reason:F}]})}).catch(()=>{}))},requestSlots(d,h,P){var F,G;for(let A of d)Mt.has(A)||(Mt.add(A),pt.test(A)?gt.set(A,{text:h==null?void 0:h[A],render:(F=P==null?void 0:P.render)==null?void 0:F[A],skeleton:(G=P==null?void 0:P.skeletons)==null?void 0:G[A]}):ie.reportSlots([A]));gt.size===0||En!=null||(En=setTimeout(()=>{En=null;let A=[...gt];gt.clear();for(let T=0;T<A.length;T+=50){let L=A.slice(T,T+50),W={};for(let[V,q]of L)q.render&&(W[V]=q.render);ie.decide({slotsFrom:"registry",registrySlotIds:L.map(([V])=>V),bootstrap:!1,render:W}).then(V=>{var q,ee;if(V){let $={},me={},Ee=[];for(let[de,ae]of L){let N=(q=V.slotConfig)==null?void 0:q[de];if(N){N.needsSkeleton&&ae.skeleton&&((ee=ie.reportSkeleton)==null||ee.call(ie,de,ae.skeleton));continue}Ee.push(de),ae.text&&($[de]=ae.text),ae.skeleton&&(me[de]=ae.skeleton)}Ee.length>0&&ie.reportSlots(Ee,$,me)}else mr(L.map(([$])=>$),Mt,$=>{var me;let Ee={},de={},ae={};for(let[N,Oe]of L)$.has(N)&&(Oe.text&&(Ee[N]=Oe.text),Oe.render&&(de[N]=Oe.render),Oe.skeleton&&(ae[N]=Oe.skeleton));(me=ie.requestSlots)==null||me.call(ie,[...$],Ee,{render:de,skeletons:ae})});Dt.forEach($=>$())})}},0))},decideSlots(d){for(let h of d)$t.has(h.id)||($t.add(h.id),mt.set(h.id,h));mt.size===0||An!=null||(An=setTimeout(()=>{An=null;let h=[...mt.values()];mt.clear();for(let P=0;P<h.length;P+=30){let F=h.slice(P,P+30);ie.decide({slots:F}).then(G=>{G||mr(F.map(A=>A.id),$t,A=>{var T;return(T=ie.decideSlots)==null?void 0:T.call(ie,F.filter(L=>A.has(L.id)))}),Dt.forEach(A=>A())})}},0))},cancelSlots(d){for(let h of d)gt.delete(h)&&Mt.delete(h),mt.delete(h)&&$t.delete(h)},onSlotsChanged(d){return Dt.add(d),()=>{Dt.delete(d)}},getStyleVocabulary(){return ge},getSitePalette(){return Ce},getVisitorId:()=>O()?_.getSessionId():null,getPersona(){return Q?{persona:Q.persona,confidence:Q.confidence,band:Je(Q.confidence)}:null},async fetchWeights(){var d;let h=je(5e3);try{let P=await fetch(`${p}/weights`,{headers:E,signal:h.signal});return P.ok?(d=(await P.json()).components)!=null?d:[]:[]}catch(P){return[]}finally{h.clear()}},getGraph(){return{pageNodes:[],capturedAt:0}},flush(){f.flush(),H.flush()},dispose(){var d;ht==null||ht(),Cn=!0,ke=!0,f.destroy(),H.destroy(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ie.dispose&&pe.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var d;ht==null||ht(),Cn=!0,ke=!0,I=!0,Kt(e.apiKey),f.destroy({forget:!0}),H.destroy({forget:!0}),_.destroy(),v.clear(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ie.dispose&&pe.delete(e.apiKey);try{localStorage.removeItem(ot+e.apiKey),localStorage.removeItem(Gt(e.apiKey)),localStorage.removeItem(Ft(e.apiKey)),localStorage.removeItem(`_snt_graph_nodes${We(e.apiKey)}`),localStorage.removeItem("_snt_graph_edges")}catch(h){}e.debug&&console.log("[sentient] destroyed")}};if(pe.set(e.apiKey,{config:e,upgrade:null,dispose:ie.dispose}),ht=ji(ie,e.apiKey,d=>{Be.then(()=>{Cn||to.add(d)})}),e.debug){let d=window;d.__sentient&&(d.__sentient.client=ie)}return ie}var Jn=/(^|\/)snippet(\.global)?(\.min)?\.js(\?|$)/,Ui=(()=>{var e,t;try{return(t=(e=document.currentScript)==null?void 0:e.src)!=null?t:""}catch(n){return""}})(),Wi=/@\d+\.\d+\.\d+[^/]*\//;function Yn(e){var t;try{let n=Ui||((t=Array.from(document.getElementsByTagName("script")).find(r=>Jn.test(r.src)))==null?void 0:t.src);for(let r of n?[n]:[]){let o=Jn.test(r)?r.replace(Jn,`$1${e}$4`):r.replace(/[^/?#]*([?#].*)?$/,e),a=(e==="consent.global.js"?"sha384-+7/RqBOFLU5bMaQ6bcBAWzG589skmxN8tedG9hkoQQ6HaQkRRBJfoRVD94e/fJcM":e==="editor.global.js"?"sha384-COGG1Iazuy5juBm/L6OJ5qu1NGyy1IUqVqp/ajhN2TFAa7MzOj4zBg0H+JF4GqFo":e==="preview.global.js"?"sha384-VS2c+33iWtwl99AiRouSE1I/Jm+4BiTIoHvHMU5SBrfm0N4F7S8SlzcADHfPsMdh":"sha384-2YuP+/zs9mJ/xg+19frBFAbr1Lpmp/Fk4nIJPg9XFqdRKFuIXL6r0QO7GFiUm/3F")||"";return Wi.test(o)&&a.indexOf("sha384-")===0?{src:o,integrity:a}:{src:o}}}catch(n){}return null}var Qt=new Map;function ct(e,t,n){let r=window[t];if(r)return Promise.resolve(r);let o=Qt.get(e);return o||(o=new Promise(a=>{var i;let s=n?{src:n}:Yn(e);if(!s)return a(null);let l=Ge(document.createElement("script"));Xn(l,s),l.async=!0,l.onload=()=>{var c;let u=(c=window[t])!=null?c:null;u||Qt.delete(e),a(u)},l.onerror=()=>{Qt.delete(e),a(null)},((i=document.head)!=null?i:document.documentElement).appendChild(l)}),Qt.set(e,o)),o}function Xn(e,t){t.integrity&&(e.integrity=t.integrity,e.crossOrigin="anonymous"),e.src=t.src}var ro="__sentientConsent",Re=null,Zn=!1,en=new Set,Qn=()=>{let e=window[ro];return typeof(e==null?void 0:e.consentWatcher)=="function"?e.consentWatcher:null},_t;function oo(e){_t=e}function Vi(){Re||(Re=Qn())||Zn||(Zn=!0,ct("consent.global.js",ro,_t).then(e=>{if(Zn=!1,!e)return zi(_t!=null?_t:"consent.global.js");if(Re=Qn(),Re)for(let t of Array.from(en))t()}))}function zi(e){console.warn(`[sentient] could not load ${e} \u2014 tracking stays off. Set window.sentient.consentSrc to its URL.`)}function Xe(e){Vi();let t=null,n=()=>(!t&&(Re!=null?Re:Re=Qn())&&(t=Re(e)),t);return{read:()=>{var r,o;return(o=(r=n())==null?void 0:r.read())!=null?o:null},refused:()=>{var r,o;return(o=(r=n())==null?void 0:r.refused())!=null?o:!1},subscribe(r){let o,a=!1,s=()=>{en.delete(s);let l=n();a||!l||(o=l.subscribe(r),r())};return n()?(o=t.subscribe(r),Promise.resolve().then(()=>{a||r()})):en.add(s),()=>{a=!0,en.delete(s),o==null||o()}}}}function Hi(e){return e.replace(/\s+/g," ").trim().slice(0,300)}function io(e,t){let n=t>>>0;for(let r=0;r<e.length;r++)n^=e.charCodeAt(r),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function qi(e){let t=e.join("");return io(t,2166136261)+io(t,1523705862)}var Ji=new Set(["A","BUTTON"]),Yi=/^H([1-6])$/,Xi=new Set(["P","LI","LABEL","BLOCKQUOTE","FIGCAPTION","DT","DD","TD","TH"]);var Zi=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT"]);function Qi(e){return Ji.has(e.tagName)||e.getAttribute("role")==="button"?!0:e.tagName==="INPUT"&&/^(submit|button)$/i.test(e.type)}function ea(e){if(Yi.test(e.tagName)||Xi.has(e.tagName))return!0;let t=e.ownerDocument.defaultView,n=t?t.getComputedStyle(e).display:"";return n!==""&&n!=="inline"&&n!=="contents"}function ta(e,t){let n=null;for(let r=e.parentElement;r&&r!==t.parentElement;r=r.parentElement){if(Qi(r)){n=r;break}if(r===t)break}if(n)return n;for(let r=e.parentElement;r;r=r.parentElement)if(r===t||ea(r))return r;return t}function tn(e,t=40){var n,r,o;let a=e.ownerDocument.createTreeWalker(e,4),s=[];for(let c=a.nextNode();c;c=a.nextNode())if(((n=c.nodeValue)!=null?n:"").trim()!==""&&!Zi.has((o=(r=c.parentElement)==null?void 0:r.tagName)!=null?o:"")&&(s.push(c),s.length>120))return{reason:"too_large"};if(s.length===0)return{reason:"empty"};let l=[],i=[];for(let c of s){let g=ta(c,e),y=l.indexOf(g);y===-1&&(l.push(g),y=l.length-1),i.push(y)}if(l.length>t)return{reason:"too_large"};let u=s.map(c=>{var g;return Hi((g=c.nodeValue)!=null?g:"")});return{textNodes:s,ownerEls:l,leafToNode:i,leaves:u,fp:qi(u)}}var ao=["cookiebot","onetrust","cookieyes","tcf","google-consent-mode","shopify"];function na(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(a=>typeof a=="string")||/[=|]/.test(r)||o.some(a=>/[=|]/.test(a)))return null;n[r]=o}return n}function ra(e){return!Array.isArray(e)||e.length<2||e.length>12||!e.every(t=>typeof t=="string")?null:e}function oa(e){try{return e()}catch(t){return}}function nn(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={};if(typeof t.slots=="object"&&t.slots!==null&&!Array.isArray(t.slots))for(let[l,i]of Object.entries(t.slots)){if(typeof i!="object"||i===null)continue;let u=i,c=na(u.dims);if(!c||u.target!==void 0&&typeof u.target!="string")continue;let g=u.arms!==void 0?ra(u.arms):null,y={dims:c};typeof u.target=="string"&&(y.target=u.target),g&&(y.arms=g),n[l]=y}let r={apiKey:t.apiKey,personaAttributes:t.personaAttributes===!0,slots:n};typeof t.consent=="boolean"?r.consent=t.consent:t.consent!==void 0&&a("consent");let o=t.consentFrom;if(typeof o=="string"&&ao.includes(o))r.consentFrom=o;else if(o&&typeof o=="object"&&!Array.isArray(o)){let l=o;typeof l.cmp=="string"&&ao.includes(l.cmp)||l.cmp===void 0&&(typeof l.cookie=="string"||typeof l.check=="function")?r.consentFrom=l:a("consentFrom")}else o!==void 0&&a("consentFrom");function a(l){r.consent=!1,console.warn(`[sentient] invalid ${l} \u2014 tracking stays OFF until it is fixed (sentient-ui.com/docs#consent).`)}(t.preConsentBehavior==="statistical_winner"||t.preConsentBehavior==="control")&&(r.preConsentBehavior=t.preConsentBehavior),t.debug===!0&&(r.debug=!0),(t.stageAttributes===!0||t.stageAttributes==="detailed")&&(r.stageAttributes=t.stageAttributes),typeof t.registry=="boolean"&&(r.registry=t.registry),typeof t.editorSrc=="string"&&(r.editorSrc=t.editorSrc),typeof t.consentSrc=="string"&&(r.consentSrc=t.consentSrc),typeof t.nonce=="string"&&t.nonce!==""&&(r.nonce=t.nonce),typeof t.apiBase=="string"&&(r.apiBase=t.apiBase),typeof t.sectionCapture=="boolean"&&(r.sectionCapture=t.sectionCapture);let s=typeof t.persona=="function"?oa(t.persona):t.persona;if(typeof s=="string"&&s.trim()!==""&&(r.persona=s),Array.isArray(t.sections)){let l=t.sections.filter(i=>typeof i=="string"&&i.trim()!=="").slice(0,50);l.length>=2&&(r.sections=l)}return r}var so=new WeakMap;function lo(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function uo(e,t,n){var a,s,l;let r=so.get(e);if(r){if(r.fp!==n.fp||!lo(r.leafToNode,n.leafToNode))return"mismatch"}else{let i=tn(e);if(!("fp"in i)||(r={fp:i.fp,leafToNode:i.leafToNode,textNodes:i.textNodes,ownerEls:i.ownerEls,classes:i.ownerEls.map(u=>{var c;return(c=u.getAttribute("class"))!=null?c:""})},r.fp!==n.fp||!lo(r.leafToNode,n.leafToNode)))return"mismatch";so.set(e,r)}let o=r;for(let[i,u]of Object.entries(t.nodes)){let c=Number(i),g=o.ownerEls[c];if(g){if(typeof u.text=="string"){let y=!0;o.leafToNode.forEach((S,w)=>{S===c&&(o.textNodes[w].nodeValue=y?u.text:"",y=!1)})}u.like!==void 0&&o.classes[u.like]!==void 0&&g.setAttribute("class",o.classes[u.like]),u.hidden&&((a=g.style)==null||a.setProperty("display","none","important"))}}for(let i of Object.values((s=t.order)!=null?s:{})){let u=i.map(w=>o.ownerEls[w]).filter(w=>!!w),c=(l=u[0])==null?void 0:l.parentElement;if(!c||u.length!==i.length||u.some(w=>w.parentElement!==c))continue;let g=new Set(u),y=0;Array.from(c.children).map(w=>g.has(w)?u[y++]:w).forEach((w,b)=>{var B;c.children[b]!==w&&c.insertBefore(w,(B=c.children[b])!=null?B:null)})}return"applied"}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 ia(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:"").replace(/\s+/g," ").trim().toLowerCase(),o=t.text.replace(/\s+/g," ").trim().toLowerCase();if(!(r===o||r.startsWith(o)||o.startsWith(r)))return!1}return!0}function rn(e,t){return!!(e!=null&&e.urlMatch)&&!kt(t).includes(e.urlMatch)}var aa=/^[a-zA-Z_][-a-zA-Z0-9_]*$/;function co(e,t){var r;let n=[];if(e.id){let o=t.getElementById(e.id);n=o?[o]:[]}if(n.length===0&&((r=e.dataAttr)!=null&&r.name)&&aa.test(e.dataAttr.name))try{let o=e.dataAttr.value.replace(/["\\]/g,"\\$&");n=Array.from(t.querySelectorAll(`[${e.dataAttr.name}="${o}"]`))}catch(o){n=[]}if(n.length===0&&e.selector)try{n=Array.from(t.querySelectorAll(e.selector))}catch(o){n=[]}return n}function Le(e,t){if(e.urlMatch&&!kt(t).includes(e.urlMatch))return null;let n=co(e,t);if(n.length!==1)return null;let r=n[0];return e.fingerprint&&!ia(r,e.fingerprint)?null:r}function fo(e,t){return rn(e,t)?!1:!!e.selector&&!e.dataAttr&&!e.id&&!e.fingerprint&&e.page===void 0?po(e,t):Le(e,t)!==null}function po(e,t){return co(e,t).length>0}function on(e,t){return rn(e,t)?!1:e.page!==void 0&&Zt.test(e.page)?Wn(e.page,kt(t)):po(e,t)}var go={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",fontFamily:"font-family"},sa=/^(rgb|rgba|hsl|hsla|calc|var|min|max|clamp)$/i;function mo(e){var r;if(e.trim().length===0||/[;{}<>]/.test(e))return!1;let t=/([A-Za-z-]*)\(/g,n;for(;(n=t.exec(e))!==null;)if(!sa.test((r=n[1])!=null?r:""))return!1;return!0}function la(e){var r,o;let t=e.ownerDocument.createTreeWalker(e,4),n=null;for(let a=t.nextNode();a!==null;a=t.nextNode()){if(((r=a.nodeValue)!=null?r:"").trim()==="")continue;let s=(o=a.parentElement)==null?void 0:o.tagName;if(!(s==="SCRIPT"||s==="STYLE"||s==="TEMPLATE")){if(n!==null)return null;n=a}}return n}function Et(e,t){let n=la(e);n!==null?n.nodeValue=t:e.textContent=t}var er=/^https:\/\//i;function an(e){return typeof e=="string"&&!/[\s\x00-\x1f\\]/.test(e)&&(er.test(e)||e[0]==="/"&&e[1]!=="/")?e:null}var ho=new Map,Fe=null;function ua(e){return e.replace(/["\\]/g,"\\$&")}function ca(e){var t;(!Fe||!Fe.isConnected)&&(Fe=e.querySelector("style[data-sentient-ops]"),Fe||(Fe=Ge(e.createElement("style"),e),Fe.setAttribute("data-sentient-ops",""),((t=e.head)!=null?t:e.documentElement).appendChild(Fe))),Fe.textContent=[...ho.entries()].map(([n,r])=>`[data-snt-e="${ua(n)}"]{${r}}`).join(`
|
|
2
|
+
`)}function yo(e,t,n,r){var l;let o=!1,a=(l=t.moveBefore)!=null?l:t.moveAfter;if(a){let i=Le(a,r);!i||i===e||i.parentElement!==e.parentElement||!e.parentElement?o=!0:t.moveBefore?e.parentElement.insertBefore(e,i):e.parentElement.insertBefore(e,i.nextSibling)}typeof t.text=="string"&&Et(e,t.text),typeof t.href=="string"&&er.test(t.href)&&e.setAttribute("href",t.href),typeof t.imageSrc=="string"&&er.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[i,u]of Object.entries(t.style)){let c=go[i];c&&typeof u=="string"&&mo(u)&&s.push(`${c}:${u.trim()} !important`)}return s.length>0&&(e.setAttribute("data-snt-e",n),ho.set(n,s.join(";")),ca(r)),{anchorMiss:o}}var At="data-sentient-block-arm",R=null;function xt(e){R=e!=null?e:null}var Ze=null;function Ct(e){Ze=e!=null?e:null}var wo=e=>{var t;return typeof e=="string"?(t=Ze==null?void 0:Ze.entries.find(n=>n.id===e))==null?void 0:t.classes:void 0},_o=e=>{let t=typeof e=="string"?Ze==null?void 0:Ze.entries.find(n=>n.id===e):void 0;return t!=null&&t.computed.inheritsColor?t.computed.color:void 0},Ne="data-sentient-blocks-hid",dt={none:"0",sm:"8px",md:"16px",lg:"24px"},tr={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",between:"space-between"},vo={sm:"0.875em",md:"1em",lg:"1.25em"},da={sm:"1.25em",md:"1.5em",lg:"2em"},fa={sm:"6px 14px",md:"10px 20px",lg:"14px 28px"},bo={sm:"8px",md:"16px",lg:"32px"},pa={square:"1 / 1",landscape:"4 / 3",wide:"16 / 9"},ga={normal:"400",medium:"500",bold:"700"};function he(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&e.style.setProperty(n,r);return e}function So(e){return e==="muted"?R!=null&&R.muted?{color:R.muted}:{opacity:"0.7"}:e==="accent"?{"font-weight":"600",color:R==null?void 0:R.accent}:{}}function ko(e,t){let n=ma(e,t),r=_o(e.like);return n&&r&&(n.style.color=r),n}function ma(e,t){var n,r,o,a,s,l,i,u,c,g,y,S,w,b,B,K,_,C,I,M;try{let O=wo(e.like),m=e.maxWidth==="measure"?"65ch":void 0,v=f=>(f.className=O,he(f,{"max-width":m}));switch(e.type){case"stack":case"grid":{let f=t.createElement("div");if(e.type==="stack"){let D=e;he(f,{display:"flex","flex-direction":D.direction,gap:(r=dt[(n=D.gap)!=null?n:"md"])!=null?r:dt.md,"align-items":D.align?tr[D.align]:void 0,"justify-content":D.justify?tr[D.justify]:void 0,"flex-wrap":D.wrap?"wrap":void 0})}else{let D=e,H=(a=dt[(o=D.gap)!=null?o:"md"])!=null?a:dt.md;he(f,{display:"grid","grid-template-columns":`repeat(auto-fit, minmax(max(200px, calc((100% - ${D.columns-1} * ${H}) / ${D.columns})), 1fr))`,gap:H,"align-items":D.align?tr[D.align]:void 0})}O&&(f.className=O);let p=!O&&e.type==="stack"&&e.surface==="raised",E=(s=e.pad)!=null?s:p?"md":void 0;E&&he(f,{padding:(l=dt[E])!=null?l:dt.md}),p&&he(f,{background:R==null?void 0:R.surface,color:R!=null&&R.surface?R==null?void 0:R.surfaceText:void 0,border:`1px solid ${(i=R==null?void 0:R.border)!=null?i:"currentColor"}`,"border-radius":(u=R==null?void 0:R.radius)!=null?u:"8px"});for(let D of(c=e.children)!=null?c:[]){let H=ko(D,t);H&&f.appendChild(H)}return f}case"text":{let f=t.createElement("p");return f.textContent=e.value,O?v(f):he(f,Ke(U({margin:"0","font-size":e.size?vo[e.size]:void 0,"font-weight":e.weight?ga[e.weight]:void 0,"text-align":e.align},So(e.tone)),{"max-width":e.maxWidth==="measure"?"65ch":void 0}))}case"heading":{let f=t.createElement(`h${e.level}`);return f.textContent=e.value,O?v(f):he(f,{margin:"0","font-size":da[(g=e.size)!=null?g:"md"],"text-align":e.align,"max-width":e.maxWidth==="measure"?"65ch":void 0})}case"button":{let f=t.createElement("a");f.textContent=e.label;let p=an(e.href);if(p&&(f.href=p),e.tag&&f.setAttribute("data-sentient-tag",e.tag),O)return v(f);let E=(y=e.emphasis)!=null?y:"primary";return he(f,{display:"inline-block",padding:fa[(S=e.size)!=null?S:"md"],"border-radius":(w=R==null?void 0:R.radius)!=null?w:"8px",font:"inherit","font-size":e.size?vo[e.size]:void 0,"text-decoration":E==="ghost"?"underline":"none",cursor:"pointer",background:E==="primary"?(b=R==null?void 0:R.primaryBg)!=null?b:"#111827":"transparent",color:E==="primary"?(B=R==null?void 0:R.primaryText)!=null?B:"#ffffff":(K=R==null?void 0:R.accent)!=null?K:"inherit",border:E==="secondary"?`1px solid ${(_=R==null?void 0:R.accent)!=null?_:"currentColor"}`:"none"})}case"link":{let f=t.createElement("a");f.textContent=e.label;let p=an(e.href);return p&&(f.href=p),e.tag&&f.setAttribute("data-sentient-tag",e.tag),O?v(f):he(f,{color:"inherit","text-decoration":"underline"})}case"image":{let f=t.createElement("img"),p=an(e.src);return p&&(f.src=p),f.alt=e.alt,O&&(f.className=O),he(f,{display:"block","max-width":"100%","aspect-ratio":e.ratio&&e.ratio!=="auto"?pa[e.ratio]:void 0,"object-fit":e.fit,width:e.ratio&&e.ratio!=="auto"?"100%":void 0})}case"badge":{let f=t.createElement("span");return f.textContent=e.value,O?v(f):he(f,U({display:"inline-block",padding:"2px 10px","border-radius":"999px","font-size":"0.75em",border:`1px solid ${(C=R==null?void 0:R.border)!=null?C:"currentColor"}`},So(e.tone)))}case"spacer":return he(t.createElement("div"),{height:(I=bo[e.size])!=null?I:bo.md});case"divider":return he(t.createElement("hr"),{border:"none","border-top":`1px solid ${(M=R==null?void 0:R.border)!=null?M:"currentColor"}`,margin:"0",width:"100%"});default:return null}}catch(O){return null}}function Eo(e,t,n,r){var o,a;try{let s=new Set;for(let i of Array.from(e.children)){let u=i.getAttribute(At);u!==null&&(t[u]===void 0?i.remove():s.add(u))}for(let[i,u]of Object.entries(t)){if(s.has(i))continue;let c="tree"in u?u:null,g=ko(c?c.tree:u,r);if(!g)continue;let y=r.createElement("div");y.setAttribute(At,i),y.style.display="none";let S=c?wo((o=c.surface)==null?void 0:o.like):void 0;if(S){let w=r.createElement("div");w.className=S;let b=_o((a=c.surface)==null?void 0:a.like);b&&(w.style.color=b),w.appendChild(g),y.appendChild(w)}else y.appendChild(g);e.appendChild(y)}let l=n!==void 0&&t[n]!==void 0;for(let i of Array.from(e.children)){let u=i.getAttribute(At),c=i;u!==null?c.style.display=l&&u===n?"":"none":l?c.hasAttribute(Ne)||(c.setAttribute(Ne,c.style.display),c.style.display="none"):c.hasAttribute(Ne)&&(c.style.display=c.getAttribute(Ne),c.removeAttribute(Ne))}}catch(s){}}function ha(e){try{for(let t of Array.from(e.children)){let n=t;if(n.getAttribute(At)!==null){n.remove();continue}n.hasAttribute(Ne)&&(n.style.display=n.getAttribute(Ne),n.removeAttribute(Ne))}}catch(t){}}function sn(e,t){try{let n=new Set;for(let r of Array.from(e.querySelectorAll(`[${At}]`)))r.parentElement&&n.add(r.parentElement);for(let r of Array.from(e.querySelectorAll(`[${Ne}]`)))r.parentElement&&n.add(r.parentElement);for(let r of n)t.has(r)||ha(r)}catch(n){}}function nr(e,t){if(!e)return[t.documentElement];try{return Array.from(t.querySelectorAll(e))}catch(n){return[]}}function ln(e,t,n,r){n.documentElement.setAttribute("data-sentient-persona",e),n.documentElement.setAttribute("data-sentient-confidence",t),r==null||r(n.documentElement,"data-sentient-persona"),r==null||r(n.documentElement,"data-sentient-confidence")}function un(e,t,n,r){var o;for(let[a,s]of Object.entries(t)){let l=e[a];if(!l||typeof l=="string")continue;let i=nr(s.target,n);for(let u of i)for(let[c,g]of Object.entries(l))(o=s.dims[c])!=null&&o.includes(g)&&(u.setAttribute(`data-${c}`,g),r==null||r(u,`data-${c}`))}}function cn(e,t,n,r){for(let[o,a]of Object.entries(t)){let s=e[o];if(typeof s!="string"||!a.arms||!a.arms.includes(s))continue;let l=nr(a.target,n);for(let i of l)i.setAttribute("data-sentient-arm",s),r==null||r(i,"data-sentient-arm")}}function dn(e,t,n,r){var l,i,u,c,g,y,S;let o=new Set,a=(l=r==null?void 0:r.contentAndOps)!=null?l:!0,s=[];for(let[w,b]of Object.entries(t)){if(rn(b.locator,n))continue;let B;if(b.locator){let _=Le(b.locator,n);B=_?[_]:[],!_&&on(b.locator,n)&&s.push(w)}else B=nr(b.target,n);let K=e[w];for(let _ of B){if(K!==void 0)if(typeof K=="string")_.setAttribute("data-sentient-arm",K),(i=r==null?void 0:r.onAttr)==null||i.call(r,_,"data-sentient-arm"),a&&((u=r==null?void 0:r.onApplied)==null||u.call(r,w,K,_));else for(let[I,M]of Object.entries(K))_.setAttribute(`data-${I}`,M),(c=r==null?void 0:r.onAttr)==null||c.call(r,_,`data-${I}`);if((b.blocks||b.compose)&&!va(n)){let I=Object.fromEntries([...Object.entries((g=b.blocks)!=null?g:{}).filter(([,M])=>!St(M)),...Object.entries((y=b.compose)!=null?y:{}).filter(([,M])=>!St(M.tree))]);Object.keys(I).length>0&&(Eo(_,I,typeof K=="string"?K:void 0,n),o.add(_))}if(!a)continue;let C=_.textContent;b.edits?uo(_,b.edits.edits,b.edits)==="mismatch"&&((S=r==null?void 0:r.onDrift)==null||S.call(r,w,b.edits.fp)):typeof b.content=="string"&&Et(_,b.content),b.ops&&yo(_,b.ops,w,n).anchorMiss&&!s.includes(w)&&s.push(w),zn(_,Ke(U(U({previous:C},typeof K=="string"?{arm:K}:{}),(r==null?void 0:r.persona)!==void 0?{persona:r.persona}:{}),{doc:n}))}}return sn(n,o),s}var ya=/bot|crawler|spider|crawling|googlebot|bingbot|duckduckbot|baiduspider|yandexbot|slurp|gptbot|claudebot|anthropic|perplexity|ccbot|applebot|headlesschrome/i;function va(e){var t,n,r;try{let o=(n=(t=e.defaultView)!=null?t:typeof window!="undefined"?window:void 0)==null?void 0:n.navigator;return o?o.webdriver===!0?!0:ya.test((r=o.userAgent)!=null?r:""):!1}catch(o){return!1}}var ba=800;function fn(e,t,n){let r=[];return n.forEach(({slotId:o,arm:a,el:s},l)=>{r.push(Hn((y,S={})=>{try{e.track({projectId:t,componentId:o,variantId:a,eventType:"micro_signal",payload:U({signalType:y},S)})}catch(w){}},s,void 0,{tabLoss:l===0}));let i=null,u=0,c=()=>{u=Date.now(),i=setTimeout(()=>{try{e.track({projectId:t,componentId:o,variantId:a,eventType:"cursor_signal",payload:{hoverDuration:Date.now()-u}})}catch(y){}i=null},ba)},g=()=>{i!==null&&(clearTimeout(i),i=null)};s.addEventListener("mouseenter",c),s.addEventListener("mouseleave",g),r.push(()=>{s.removeEventListener("mouseenter",c),s.removeEventListener("mouseleave",g),i!==null&&clearTimeout(i)})}),()=>{for(let o of r)o()}}function xo(e){return e?`_snt_fired_goals_${e.slice(0,12)}`:"_snt_fired_goals"}var Sa="_snt_fired_goals";function rr(e,t){try{e==null||e.sessionStorage.removeItem(xo(t)),e==null||e.sessionStorage.removeItem(Sa)}catch(n){}}function Ao(e){var t;return[(t=e.slotId)!=null?t:"",e.goalId,e.event,e.locator?JSON.stringify(e.locator):""].join("|")}function wa(e,t){try{let n=e==null?void 0:e.sessionStorage.getItem(t);if(!n)return new Set;let r=JSON.parse(n);return Array.isArray(r)?new Set(r.filter(o=>typeof o=="string")):new Set}catch(n){return new Set}}function _a(e,t,n){try{e==null||e.sessionStorage.setItem(t,JSON.stringify([...n]))}catch(r){}}function Co(e,t,n,r){var K,_;let o=(K=n.defaultView)!=null?K:typeof window!="undefined"?window:null,a=xo(r),s=wa(o,a),l=C=>{let I=Ao(C);if(!s.has(I))try{C.slotId?t.componentGoal(C.slotId,C.goalId):t.goal(C.goalId),s.add(I),_a(o,a,s)}catch(M){}},i=e.filter(C=>C.event==="click"),u=e.filter(C=>C.event==="form_submit"),c=e.filter(C=>C.event==="url_reached"),g=e.filter(C=>C.event==="scroll_depth"),y=(C,I)=>{if(!C.locator)return!1;let M=Le(C.locator,n);return!!M&&(M===I||M.contains(I))},S=C=>{let I=C.target;if(!(!I||typeof I.closest!="function"))for(let M of i)y(M,I)&&l(M)},w=C=>{let I=C.target;if(I)for(let M of u)y(M,I)&&l(M)},b=()=>{if(c.length===0)return;let C=kt(n);for(let I of c)I.urlPattern&&Vn(I.urlPattern,C)&&l(I)},B=()=>{var M;let C=n.documentElement,I=C.scrollHeight>0?(C.scrollTop+C.clientHeight)/C.scrollHeight:0;for(let O of g)I>=((M=O.threshold)!=null?M:.75)&&l(O);g.every(O=>s.has(Ao(O)))&&n.removeEventListener("scroll",B)};return n.addEventListener("click",S,!0),n.addEventListener("submit",w,!0),(_=n.defaultView)==null||_.addEventListener("popstate",b),b(),g.length>0&&(n.addEventListener("scroll",B,{passive:!0}),B()),{checkUrl:b,teardown:()=>{var C;n.removeEventListener("click",S,!0),n.removeEventListener("submit",w,!0),(C=n.defaultView)==null||C.removeEventListener("popstate",b),g.length>0&&n.removeEventListener("scroll",B)}}}function pn(e,t){if(!e||e.length<2||t.size!==e.length)return null;let n=[];for(let s of e){let l=t.get(s);if(!l||n.includes(l))return null;n.push(l)}let r=n[0].parentNode;if(!r||!n.every(s=>s.parentNode===r))return null;let o=n.slice().sort((s,l)=>s.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),a=[];for(let s=0;s<n.length;s++){let l=n[s];o[s]!==l&&(a.push({el:l,before:o[s]}),o.splice(o.indexOf(l),1),o.splice(s,0,l))}return a}var ka="__snt_editor_token";function Io(){try{return typeof sessionStorage!="undefined"?sessionStorage.getItem(ka):null}catch(e){return null}}function Oo(e){let t=null;try{let n=location.hash.slice(1),r=RegExp("(^|[?&])"+e+"=([^&]*)").exec(n);if(r){t=r[2];let o=n.slice(r.index+r[0].length);r[1]!="&"&&o[0]=="&"&&(o=r[1]+o.slice(1));let a=n.slice(0,r.index)+o;history.replaceState(history.state,"",a?"#"+a:location.pathname+location.search)}}catch(n){}return t}var It="0.34.2",hn=It!=="0.0.0-dev"?{name:"snippet",version:It}:void 0,$o=It!=="0.0.0-dev"?{v:It}:{},To=5e3,Ea=50,Bo=(()=>{try{if(typeof window=="undefined")return[];let e=window.SentientSnippet;return Array.isArray(e==null?void 0:e.q)?e.q:[]}catch(e){return[]}})(),te=null,x=null,be={},ve=null,Se=null,Ot=null,re=null,oe=null,Tt=0,J=null,Qe=null,Po=!1,or=null,gn=null,Pt=null,Ae=!1,Ue=!1,yn=!1,vn=0,Ko=e=>fe(e)===vn,ft=null,ue=!1,Me=null,xe=[],et=null,tt=null,ye=null,Aa=3e3,xa=100;function Lo(e,t){let n,r=new Promise(o=>{n=setTimeout(()=>o(null),t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}function De(e,...t){e!=null&&e.debug&&console.log("[sentient-snippet]",...t)}function Lt(e,t){return te?(te.personaAttributes&&J&&ln(J.persona,J.band,e,t==null?void 0:t.onAttr),un(be,te.slots,e,t==null?void 0:t.onAttr),cn(be,te.slots,e,t==null?void 0:t.onAttr),ve?dn(be,ve,e,U(Ke(U({},t),{onDrift:(n,r)=>{var o,a;return(a=x==null?void 0:x.reportDrift)==null?void 0:a.call(x,n,r,(o=Fo[n])!=null?o:null,"fp_mismatch")}}),J?{persona:J.persona}:{})):(sn(e,new Set),[])):[]}function jo(e){var n;let t=new Map;for(let r of(n=te==null?void 0:te.sections)!=null?n:[])try{let o=e.querySelectorAll(r);o.length===1&&t.set(r,o[0])}catch(o){}return t}function ir(e,t){var n,r;try{if(!e||e.length<2)return;for(let o of(n=pn(e,jo(t)))!=null?n:[])(r=o.before.parentNode)==null||r.insertBefore(o.el,o.before)}catch(o){}}function Ca(e,t,n){let r=(o,a)=>t.some(([s,l])=>s===o&&l===a);try{if(Array.isArray(e.stamped))for(let o of e.stamped){if(!Array.isArray(o))continue;let[a,s,l]=o;!a||typeof s!="string"||r(a,s)||(l==null?a.removeAttribute(s):a.setAttribute(s,l))}if(Array.isArray(e.html))for(let o of e.html)typeof o!="string"||r(n.documentElement,o)||n.documentElement.removeAttribute(o)}catch(o){}}function Ia(){try{let e=window.__sntPP;return e&&typeof e=="object"&&typeof e.v=="number"?e:null}catch(e){return null}}function Go(e){return e.apiBase?`${e.apiBase.replace(/\/+$/,"")}/v1/events`:void 0}function Sn(e){var t;return(t=e.apiBase)!=null?t:"https://api.sentient-ui.com"}function Oa(e){return Promise.resolve().then(()=>fetch(`${Sn(e)}/v1/registry/locators`,{headers:{authorization:`Bearer ${e.apiKey}`}})).then(t=>t.ok?t.json():null).then(t=>Array.isArray(t==null?void 0:t.slots)?t.slots:null).catch(()=>null)}function ar(e,t){let n=[],r=[];for(let o of e)try{if(typeof(o==null?void 0:o.id)!="string")continue;!o.locator||fo(o.locator,t)?n.push(o.id):on(o.locator,t)&&r.push(o.id)}catch(a){}return[n,r]}var Fo={};function Uo(e,t){var r;let n={};for(let o of e){let a=(r=Me==null?void 0:Me.find(u=>u.id===o))==null?void 0:r.locator,s=a?Le(a,t):null,l=s?tn(s):null,i=l&&"fp"in l?l.fp:void 0;i&&(Fo[o]=i),n[o]=Ke(U({},i?{fp:i}:{}),{forms:!1,compose:!0,content:!0})}return n}function Wo(e,t){let n=null;for(let r of t)e!=null&&e[r]&&((n!=null?n:n={})[r]=e[r]);return n}var se=null;function Vo(){if(!Ae){se&&et!==Pe()&&se(!0);return}!Me||et===Pe()||(et=Pe(),Ta())}function Ta(){ye==null||ye();let e=te,t=Me;if(!e||!t)return;let n,r,o=()=>{clearTimeout(n),clearTimeout(l),r==null||r.disconnect(),ye===o&&(ye=null)},a=null,s=i=>{let[u,c]=ar(t,document),g=u.filter(y=>!xe.includes(y));a!==null&&u.some(y=>!a.has(y)&&!g.includes(y))&&Rt(),a=new Set(u),g.length>0&&Pa(g).catch(()=>{}),(i||c.length===0&&!t.some(y=>!u.includes(y.id)&&!xe.includes(y.id)))&&(o(),zo(e,c))},l=setTimeout(()=>s(!0),Aa);if(ye=o,s(),ye===o)try{r=new MutationObserver(()=>{clearTimeout(n),n=setTimeout(s,xa)}),r.observe(document.documentElement,{childList:!0,subtree:!0})}catch(i){}}function bn(e,t){if(!(!e||e.length===0||!t||!te))try{Se==null||Se.teardown(),Se=Co(e,t,document,te.apiKey)}catch(n){}}async function Pa(e){let t=te,n=x;if(!t||!n)return;xe=xe.concat(e);let r=await n.decide(U({slotsFrom:"registry",registrySlotIds:e,render:Uo(e,document)},$o));if(r||(xe=xe.filter(a=>!e.includes(a))),!r||ue||x!==n)return;be=U(U({},be),r.slots),!Se&&r.goals&&(t.consent!==!1||Ue)&&bn(Ot=r.goals,n);let o=Wo(r.slotConfig,e);o&&(ve=U(U({},ve),o)),Rt(),De(t,"late decide",e),tt&&Ko(t.apiKey)&&He(t.apiKey,tt=U(Ke(U({},tt),{slots:be,savedAt:Date.now()}),ve?{slotConfig:ve}:{}))}function zo(e,t){if(t.length!==0)try{fetch(`${Sn(e)}/v1/locator-miss`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e.apiKey}`},body:JSON.stringify({slots:t})}).catch(()=>{})}catch(n){}}function nt(){return!!(te&&x&&te.sectionCapture!==!1&&(te.consent!==!1||Ue)&&!Ye())}function La(){if(!x||!te||!nt()||oe)return;let e=[];Lt(document,{contentAndOps:Ae,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),lr();try{re==null||re(),re=fn(x,te.apiKey,e)}catch(t){}}function lr(){if(typeof document=="undefined"||!nt())return;let e;try{if(gn&&gn.length>0){let r=new Map;for(let o of gn){if(o.urlMatch!==window.location.pathname)continue;let a=Le(o.locator,document);a&&r.set(a,o.type)}r.size>0&&(e=o=>{var a;return(a=r.get(o))!=null?a:null})}}catch(r){}let t=x,n=++Tt;Pt=window.location.pathname,ct("engagement.global.js","__sentientEngagement").then(r=>{if(!(!r||n!==Tt||x!==t||!t||!nt()))try{oe==null||oe(),oe=r.startEngagementCapture(t,U({apiKey:te.apiKey,apiBase:te.apiBase,doc:document,microSignals:!0},e?{typeOf:e}:{}))}catch(o){}})}function Rt(){try{let e=[];if(re==null||re(),re=null,Lt(document,{contentAndOps:Ae,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),ir(Qe,document),e.length>0&&nt())try{re=fn(x,te.apiKey,e)}catch(t){}try{typeof window!="undefined"&&Pt!==null&&window.location.pathname!==Pt&&nt()&&(oe==null||oe(),oe=null,Tt++,lr())}catch(t){}}catch(e){}}function Ro(){or===null&&(or=setTimeout(()=>{or=null,Rt();try{Se==null||Se.checkUrl()}catch(e){}Vo()},Ea))}function Ho(){if(!(Po||typeof window=="undefined"||typeof history=="undefined")){Po=!0;try{let e=t=>{let n=history[t];history[t]=function(r,o,a){let s=n.call(this,r,o,a!=null?a:null);return Ro(),s}};e("pushState"),e("replaceState"),window.addEventListener("popstate",Ro)}catch(e){}}}function mn(e){let t={};for(let[n,r]of Object.entries(e.slots))try{t[n]=r.target?document.querySelectorAll(r.target).length:1}catch(o){t[n]=0}return t}function Ra(e,t,n){var r;try{window.__sentientEditor={token:t,code:n,apiBase:Sn(e)};let o=e.editorSrc?{src:e.editorSrc}:Yn("editor.global.js");if(!o){Do();return}let a=Ge(document.createElement("script"));Xn(a,o),a.async=!0,a.onerror=()=>Do(),((r=document.head)!=null?r:document.documentElement).appendChild(a)}catch(o){}}var No="sentient-editor-load-notice";function Do(){var e;try{if(document.getElementById(No))return;let t=document.createElement("div");t.id=No,t.textContent="Couldn\u2019t load the editor \u2014 check your connection and reopen it from your dashboard.",t.style.cssText="position:fixed;bottom:16px;right:16px;z-index:2147483647;padding:12px;background:#111;color:#fff;font:13px system-ui",t.onclick=()=>t.remove(),((e=document.body)!=null?e:document.documentElement).appendChild(t),setTimeout(()=>t.remove(),1e4)}catch(t){}}function Na(e){let t={cfg:e,apiBase:Sn(e),set(n){n.slots!==void 0&&(be=n.slots),n.slotConfig!==void 0&&(ve=n.slotConfig),n.persona!==void 0&&(J=n.persona),n.decided&&(Ae=!0),n.look&&(xt(n.look.palette),Ct(n.look.vocabulary))},apply:()=>Lt(document),installSpaHooks:Ho,exposeGlobal:()=>{yn=!0,sr(e)},dbg:(...n)=>De(e,...n)};return ct("preview.global.js","__sentientPreview").then(n=>n?n.runPreview(t):Promise.reject()).catch(()=>(t.exposeGlobal(),De(e,"preview chunk unavailable \u2014 page left as-is"),!0))}function sr(e){let t=r=>{try{oe==null||oe(),oe=null,Tt++,Pt=null,re==null||re(),re=null,ye==null||ye(),Se==null||Se.teardown(),Se=null,r&&rr(typeof window!="undefined"?window:null,e.apiKey),Ue=!1,ue=!0,r?(tt=null,J=null,x?x.destroy():at(e.apiKey)):x==null||x.dispose(),x=null}catch(o){}},n={consentWatcher:Xe,goal(r,o){try{x==null||x.goal(r,o)}catch(a){}},componentGoal(r,o){try{x==null||x.componentGoal(r,o)}catch(a){}},grantConsent(){try{if(!x&&ue||x!=null&&x.released)vn=fe(e.apiKey),x=wt(U({apiKey:e.apiKey,consent:!0,preConsentBehavior:e.preConsentBehavior,debug:e.debug,persona:e.persona,ingestUrl:Go(e)},hn?{sdk:hn}:{})),bn(Ot,x);else{let r=(x==null?void 0:x.gated)===!0;qn(e.apiKey),r&&(vn=fe(e.apiKey)),bn(Ot,x)}ue=!1,se==null||se()}catch(r){}Ue=!0;try{La()}catch(r){}},revokeConsent(){t(!0)},reapply:Rt,getState(){var r,o;try{return{apiKey:e.apiKey,persona:(r=J==null?void 0:J.persona)!=null?r:null,band:(o=J==null?void 0:J.band)!=null?o:null,slots:be,matchCounts:mn(e),consent:!ue&&(e.consent!==!1||Ue)}}catch(a){return{apiKey:e.apiKey,persona:null,band:null,slots:{},matchCounts:{},consent:!1}}}};if(window.SentientSnippet=n,window.__sentientApi=n,e.consentFrom&&!ft&&!yn)try{let r=Xe(e.consentFrom),o=!1,a=!1,s=()=>!!x&&!ue&&(x.gated===void 0?e.consent!==!1||Ue:!x.gated);ft=r.subscribe(()=>{try{let l=r.read();l!==null&&(a=!0);let i=l!=null?l:a?!1:null,u=s(),c=!u&&i!==!0&&r.refused();if(c&&!o&&(x!=null&&x.gated?x.destroy():at(e.apiKey),rr(window,e.apiKey),tt=null,J=null),o=c,i===!0&&!u)n.grantConsent();else if(i===!1&&u){let g=r.refused();t(g),g&&(o=!0)}}catch(l){}})}catch(r){}for(let r of Bo.splice(0))try{r[0]==="goal"?n.goal(r[1],r[2]):r[0]==="grantConsent"&&x?n.grantConsent():r[0]==="revokeConsent"&&x&&n.revokeConsent()}catch(o){}}function Mo(){var e;try{if(typeof window=="undefined")return;let t=window;if(typeof((e=t.SentientSnippet)==null?void 0:e.goal)=="function")return;let n=()=>{};t.SentientSnippet={goal:n,componentGoal:n,grantConsent:n,revokeConsent:n,reapply:n,consentWatcher:Xe,getState:()=>({apiKey:"",persona:null,band:null,slots:{},matchCounts:{},consent:!1})},Bo.length=0}catch(t){}}function Da(){try{let e=window.Shopify;return typeof(e==null?void 0:e.shop)=="string"&&e.shop!==""}catch(e){return!1}}async function qo(){var e,t;try{let n=nn(window.sentient);if(!n){Mo();return}te=n,ft==null||ft(),ft=null,!n.consentFrom&&n.consent===void 0&&Da()&&(n.consentFrom="shopify"),oo(n.consentSrc),Yt(n.nonce),yn=!1,Ae=!1,se=null,Qe=null,be={},ve=null,xt(null),Ct(null),Ue=!1,ue=!1,Ot=null,Me=null,xe=[],et=null,tt=null,ye==null||ye(),oe==null||oe(),oe=null,Tt++,Pt=null;let r=Oo("sentient_editor_code"),o=r?null:Io();if(r||o){Ra(n,o,r),yn=!0,sr(n),De(n,"editor mode");return}if(typeof window!="undefined"&&/[?&]sentient_(preview|persona|context)=[^&]/.test(window.location.search)&&await Na(n))return;if(n.consentFrom&&n.consent===void 0)try{n.consent=Xe(n.consentFrom).read()===!0}catch(f){n.consent=!1}n.consent!==!1&&n.sectionCapture!==!1&&!Ye()&&ct("engagement.global.js","__sentientEngagement");let a=(e=n.registry)!=null?e:Object.keys(n.slots).length===0;n.registry===void 0&&!a&&De(n,"slots declared without registry: true, so dashboard-published components are not applied");let s=a?Oa(n):null,l=Ia();try{(t=l==null?void 0:l.stop)==null||t.call(l)}catch(f){}let i=n.consent!==!1&&!Ye()?it(n.apiKey):null,u=[];if(i){J={persona:i.persona,band:i.band},be=i.slots,i.slotConfig&&(ve=i.slotConfig),i.palette&&xt(i.palette),i.vocabulary&&Ct(i.vocabulary),Lt(document,U({contentAndOps:!1},l?{onAttr:(p,E)=>u.push([p,E])}:{})),i.layoutOrder&&(Qe=i.layoutOrder,ir(Qe,document));let f=bt(i.stage,n.stageAttributes);f&&(Xt(f),u.push([document.documentElement,"data-sentient-stage"]))}l&&Ca(l,u,document);let c=wt(U({apiKey:n.apiKey,consent:n.consent,preConsentBehavior:n.preConsentBehavior,debug:n.debug,persona:n.persona,stageAttributes:n.stageAttributes,ingestUrl:Go(n)},hn?{sdk:hn}:{}));x=c,vn=fe(n.apiKey),sr(n),Ho();let g=Object.entries(n.slots).map(([f,p])=>({id:f,dims:p.dims})),y=$o,S={pp:l?l.v:0},w=[];if(s){let[f]=await Promise.all([Lo(s,To),document.readyState==="loading"?new Promise(p=>document.addEventListener("DOMContentLoaded",p,{once:!0})):null]);Me=f,f&&(xe=w=ar(f,document)[0]),De(n,"registry scope",f&&w)}let b=(f=c)=>{let p=Array.from(jo(document).keys());return f.decide(U(U(U(U({slots:g},y),S),p.length>=2?{sections:p}:{}),a?{slotsFrom:"registry",registrySlotIds:w,render:Uo(w,document)}:{}))},B=Pe(),K=c.gated===!0,_=!1,C=!1,I=!1,M=!1;se=(f=!1)=>{let p=x;!_||C||M||Ae||ue||!p||p.gated||!f&&!I||(I=!1,M=!0,B=et=Pe(),Me&&(xe=w=ar(Me,document)[0]),b(p).then(E=>{M=!1,E&&!Ae&&!ue&&x===p?v(E):(E||(xe=[]),!Ae&&(p.released||x!==p||ue)&&(I=!0))}).catch(()=>{M=!1}))};let O=b();O.then(()=>{_=!0},()=>{_=!0});let m=await Lo(O,To),v=f=>{var D,H,Y,le,we;C=!0;let p=(x!=null?x:c).getPersona();p?J={persona:p.persona,band:p.band}:f.persona&&(J={persona:f.persona,band:"low"}),be=f.slots,a?ve=Wo(f.slotConfig,w):f.slotConfig&&(ve=f.slotConfig),f.palette&&xt(f.palette),f.vocabulary&&Ct(f.vocabulary),Qe=(D=f.layoutOrder)!=null?D:Qe;let E=()=>{var _e;let k=[],z=Lt(document,{onApplied:(X,ne,ce)=>k.push({slotId:X,arm:ne,el:ce})});a||zo(n,z),ir(Qe,document);try{(_e=l==null?void 0:l.reveal)==null||_e.call(l)}catch(X){}if(Ae=!0,nt())try{re==null||re(),re=fn(x,n.apiKey,k)}catch(X){}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",E,{once:!0}):E(),Ot=(H=f.goals)!=null?H:null,(n.consent!==!1||Ue)&&!ue&&bn(f.goals,x),gn=(Y=f.sectionMap)!=null?Y:null,nt()&&lr(),De(n,"applied",{persona:J,slots:be,matches:mn(n)}),!ue&&(Ko(n.apiKey)&&He(n.apiKey,tt=U(U(U(U({v:1,persona:(le=J==null?void 0:J.persona)!=null?le:f.persona,band:(we=J==null?void 0:J.band)!=null?we:"low",slots:f.slots,layoutOrder:f.layoutOrder,savedAt:Date.now()},ve?{slotConfig:ve}:{}),f.palette?{palette:f.palette}:{}),f.vocabulary?{vocabulary:f.vocabulary}:{}),(k=>k?{stage:k}:{})(bt(f.stage,n.stageAttributes)))),et=null,Vo())};if(!m){De(n,"decide timeout/null \u2014 snapshot state stands",mn(n)),O.then(f=>{if(!f){if(Ae)return;xe=[],c.released===!0||x!==c||ue||K&&Pe()!==B?(I=!0,se==null||se()):et=B;return}if(!(!f||Ae||ue)){if(x!==c){I=!0,se==null||se();return}v(f),De(n,"late decide applied",mn(n))}}).catch(()=>{});return}if(ue||x!==c){I=!0,se==null||se();return}v(m)}catch(n){Mo()}}if(typeof window!="undefined"&&window.sentient){let e=window;if(!e.__sentientInitialized)e.__sentientInitialized=!0,Promise.resolve().then(()=>{qo()});else{let t=window.__sentientApi;t&&Promise.resolve().then(()=>{window.SentientSnippet=t})}}return oi(Ma);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentientui/snippet",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.2",
|
|
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
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"tsx": "^4.19.2",
|
|
42
42
|
"typescript": "^5.7.2",
|
|
43
43
|
"vitest": "^2.1.8",
|
|
44
|
-
"@sentientui/core": "0.
|
|
44
|
+
"@sentientui/core": "0.41.1"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsup && node scripts/stamp-chunk-sri.mjs",
|