kenobi-js 0.1.41 → 0.1.43

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,20 +1,168 @@
1
1
  /*!
2
- * Kenobi SDK v0.1.41
3
- * (c) 2025 Kenobi.ai
2
+ * Kenobi SDK v0.1.43
3
+ * (c) 2026 Kenobi.ai
4
4
  */
5
- "use strict";var KenobiLib=(()=>{var xe=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var er=Object.prototype.hasOwnProperty;var tr=(e,t,r)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var rr=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})},nr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zt(t))!er.call(e,i)&&i!==r&&xe(e,i,{get:()=>t[i],enumerable:!(n=Jt(t,i))||n.enumerable});return e};var ir=e=>nr(xe({},"__esModule",{value:!0}),e);var h=(e,t,r)=>tr(e,typeof t!="symbol"?t+"":t,r);var qr={};rr(qr,{CueCard:()=>_e,Kenobi:()=>Qe,TRANSFORMATION_ACTIONS:()=>jt});var tt=11;function or(e,t){var r=t.attributes,n,i,o,a,l;if(!(t.nodeType===tt||e.nodeType===tt)){for(var u=r.length-1;u>=0;u--)n=r[u],i=n.name,o=n.namespaceURI,a=n.value,o?(i=n.localName||i,l=e.getAttributeNS(o,i),l!==a&&(n.prefix==="xmlns"&&(i=n.name),e.setAttributeNS(o,i,a))):(l=e.getAttribute(i),l!==a&&e.setAttribute(i,a));for(var c=e.attributes,d=c.length-1;d>=0;d--)n=c[d],i=n.name,o=n.namespaceURI,o?(i=n.localName||i,t.hasAttributeNS(o,i)||e.removeAttributeNS(o,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var Ce,ar="http://www.w3.org/1999/xhtml",W=typeof document>"u"?void 0:document,sr=!!W&&"content"in W.createElement("template"),lr=!!W&&W.createRange&&"createContextualFragment"in W.createRange();function cr(e){var t=W.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function ur(e){Ce||(Ce=W.createRange(),Ce.selectNode(W.body));var t=Ce.createContextualFragment(e);return t.childNodes[0]}function dr(e){var t=W.createElement("body");return t.innerHTML=e,t.childNodes[0]}function pr(e){return e=e.trim(),sr?cr(e):lr?ur(e):dr(e)}function Te(e,t){var r=e.nodeName,n=t.nodeName,i,o;return r===n?!0:(i=r.charCodeAt(0),o=n.charCodeAt(0),i<=90&&o>=97?r===n.toUpperCase():o<=90&&i>=97?n===r.toUpperCase():!1)}function fr(e,t){return!t||t===ar?W.createElement(e):W.createElementNS(t,e)}function mr(e,t){for(var r=e.firstChild;r;){var n=r.nextSibling;t.appendChild(r),r=n}return t}function He(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var rt={OPTION:function(e,t){var r=e.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}He(e,t,"selected")},INPUT:function(e,t){He(e,t,"checked"),He(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var r=t.value;e.value!==r&&(e.value=r);var n=e.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==e.placeholder)return;n.nodeValue=r}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var r=-1,n=0,i=e.firstChild,o,a;i;)if(a=i.nodeName&&i.nodeName.toUpperCase(),a==="OPTGROUP")o=i,i=o.firstChild,i||(i=o.nextSibling,o=null);else{if(a==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&o&&(i=o.nextSibling,o=null)}e.selectedIndex=r}}},me=1,nt=11,it=3,ot=8;function ae(){}function hr(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function br(e){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var o=n;n=W.createElement("html"),n.innerHTML=o}else n=pr(n);else n.nodeType===nt&&(n=n.firstElementChild);var a=i.getNodeKey||hr,l=i.onBeforeNodeAdded||ae,u=i.onNodeAdded||ae,c=i.onBeforeElUpdated||ae,d=i.onElUpdated||ae,s=i.onBeforeNodeDiscarded||ae,m=i.onNodeDiscarded||ae,b=i.onBeforeElChildrenUpdated||ae,E=i.skipFromChildren||ae,L=i.addChild||function(y,v){return y.appendChild(v)},C=i.childrenOnly===!0,f=Object.create(null),k=[];function M(y){k.push(y)}function F(y,v){if(y.nodeType===me)for(var R=y.firstChild;R;){var x=void 0;v&&(x=a(R))?M(x):(m(R),R.firstChild&&F(R,v)),R=R.nextSibling}}function I(y,v,R){s(y)!==!1&&(v&&v.removeChild(y),m(y),F(y,R))}function _(y){if(y.nodeType===me||y.nodeType===nt)for(var v=y.firstChild;v;){var R=a(v);R&&(f[R]=v),_(v),v=v.nextSibling}}_(r);function D(y){u(y);for(var v=y.firstChild;v;){var R=v.nextSibling,x=a(v);if(x){var A=f[x];A&&Te(v,A)?(v.parentNode.replaceChild(A,v),U(A,v)):D(v)}else D(v);v=R}}function K(y,v,R){for(;v;){var x=v.nextSibling;(R=a(v))?M(R):I(v,y,!0),v=x}}function U(y,v,R){var x=a(v);if(x&&delete f[x],!R){var A=c(y,v);if(A===!1||(A instanceof HTMLElement&&(y=A,_(y)),e(y,v),d(y),b(y,v)===!1))return}y.nodeName!=="TEXTAREA"?V(y,v):rt.TEXTAREA(y,v)}function V(y,v){var R=E(y,v),x=v.firstChild,A=y.firstChild,ie,N,q,oe,Y;e:for(;x;){for(oe=x.nextSibling,ie=a(x);!R&&A;){if(q=A.nextSibling,x.isSameNode&&x.isSameNode(A)){x=oe,A=q;continue e}N=a(A);var B=A.nodeType,Z=void 0;if(B===x.nodeType&&(B===me?(ie?ie!==N&&((Y=f[ie])?q===Y?Z=!1:(y.insertBefore(Y,A),N?M(N):I(A,y,!0),A=Y,N=a(A)):Z=!1):N&&(Z=!1),Z=Z!==!1&&Te(A,x),Z&&U(A,x)):(B===it||B==ot)&&(Z=!0,A.nodeValue!==x.nodeValue&&(A.nodeValue=x.nodeValue))),Z){x=oe,A=q;continue e}N?M(N):I(A,y,!0),A=q}if(ie&&(Y=f[ie])&&Te(Y,x))R||L(y,Y),U(Y,x);else{var fe=l(x);fe!==!1&&(fe&&(x=fe),x.actualize&&(x=x.actualize(y.ownerDocument||W)),L(y,x),D(x))}x=oe,A=q}K(y,A,N);var ce=rt[y.nodeName];ce&&ce(y,v)}var S=r,j=S.nodeType,ye=n.nodeType;if(!C){if(j===me)ye===me?Te(r,n)||(m(r),S=mr(r,fr(n.nodeName,n.namespaceURI))):S=n;else if(j===it||j===ot){if(ye===j)return S.nodeValue!==n.nodeValue&&(S.nodeValue=n.nodeValue),S;S=n}}if(S===n)m(r);else{if(n.isSameNode&&n.isSameNode(S))return;if(U(S,n,C),k)for(var pe=0,ke=k.length;pe<ke;pe++){var Q=f[k[pe]];Q&&I(Q,Q.parentNode,!1)}}return!C&&S!==r&&r.parentNode&&(S.actualize&&(S=S.actualize(r.ownerDocument||W)),r.parentNode.replaceChild(S,r)),S}}var gr=br(or),Se=gr;var Le,P,ut,_r,se,at,dt,pt,ft,Ke,Fe,Oe,vr,he={},mt=[],yr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Re=Array.isArray;function ne(e,t){for(var r in t)e[r]=t[r];return e}function Ve(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function kr(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Le.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Ae(e,a,n,i,null)}function Ae(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ut,__i:-1,__u:0};return i==null&&P.vnode!=null&&P.vnode(o),o}function te(e){return e.children}function Me(e,t){this.props=e,this.context=t}function ue(e,t){if(t==null)return e.__?ue(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ue(e):null}function ht(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return ht(e)}}function st(e){(!e.__d&&(e.__d=!0)&&se.push(e)&&!Pe.__r++||at!=P.debounceRendering)&&((at=P.debounceRendering)||dt)(Pe)}function Pe(){for(var e,t,r,n,i,o,a,l=1;se.length;)se.length>l&&se.sort(pt),e=se.shift(),l=se.length,e.__d&&(r=void 0,n=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=ne({},n)).__v=n.__v+1,P.vnode&&P.vnode(r),$e(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i??ue(n),!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,_t(o,r,a),n.__e=n.__=null,r.__e!=i&&ht(r)));Pe.__r=0}function bt(e,t,r,n,i,o,a,l,u,c,d){var s,m,b,E,L,C,f,k=n&&n.__k||mt,M=t.length;for(u=wr(r,t,k,u,M),s=0;s<M;s++)(b=r.__k[s])!=null&&(m=b.__i==-1?he:k[b.__i]||he,b.__i=s,C=$e(e,b,m,i,o,a,l,u,c,d),E=b.__e,b.ref&&m.ref!=b.ref&&(m.ref&&je(m.ref,null,b),d.push(b.ref,b.__c||E,b)),L==null&&E!=null&&(L=E),(f=!!(4&b.__u))||m.__k===b.__k?u=gt(b,u,e,f):typeof b.type=="function"&&C!==void 0?u=C:E&&(u=E.nextSibling),b.__u&=-7);return r.__e=L,u}function wr(e,t,r,n,i){var o,a,l,u,c,d=r.length,s=d,m=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+m,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Ae(null,a,null,null,null):Re(a)?Ae(te,{children:a},null,null,null):a.constructor==null&&a.__b>0?Ae(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,l=null,(c=a.__i=xr(a,r,u,s))!=-1&&(s--,(l=r[c])&&(l.__u|=2)),l==null||l.__v==null?(c==-1&&(i>d?m--:i<d&&m++),typeof a.type!="function"&&(a.__u|=4)):c!=u&&(c==u-1?m--:c==u+1?m++:(c>u?m--:m++,a.__u|=4))):e.__k[o]=null;if(s)for(o=0;o<d;o++)(l=r[o])!=null&&(2&l.__u)==0&&(l.__e==n&&(n=ue(l)),yt(l,l));return n}function gt(e,t,r,n){var i,o;if(typeof e.type=="function"){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=gt(i[o],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=ue(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function xr(e,t,r,n){var i,o,a,l=e.key,u=e.type,c=t[r],d=c!=null&&(2&c.__u)==0;if(c===null&&e.key==null||d&&l==c.key&&u==c.type)return r;if(n>(d?1:0)){for(i=r-1,o=r+1;i>=0||o<t.length;)if((c=t[a=i>=0?i--:o++])!=null&&(2&c.__u)==0&&l==c.key&&u==c.type)return a}return-1}function lt(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||yr.test(t)?r:r+"px"}function Ee(e,t,r,n,i){var o,a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||lt(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||lt(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(ft,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=Ke,e.addEventListener(t,o?Oe:Fe,o)):e.removeEventListener(t,o?Oe:Fe,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ct(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Ke++;else if(t.t<r.u)return;return r(P.event?P.event(t):t)}}}function $e(e,t,r,n,i,o,a,l,u,c){var d,s,m,b,E,L,C,f,k,M,F,I,_,D,K,U,V,S=t.type;if(t.constructor!=null)return null;128&r.__u&&(u=!!(32&r.__u),o=[l=t.__e=r.__e]),(d=P.__b)&&d(t);e:if(typeof S=="function")try{if(f=t.props,k="prototype"in S&&S.prototype.render,M=(d=S.contextType)&&n[d.__c],F=d?M?M.props.value:d.__:n,r.__c?C=(s=t.__c=r.__c).__=s.__E:(k?t.__c=s=new S(f,F):(t.__c=s=new Me(f,F),s.constructor=S,s.render=Tr),M&&M.sub(s),s.props=f,s.state||(s.state={}),s.context=F,s.__n=n,m=s.__d=!0,s.__h=[],s._sb=[]),k&&s.__s==null&&(s.__s=s.state),k&&S.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=ne({},s.__s)),ne(s.__s,S.getDerivedStateFromProps(f,s.__s))),b=s.props,E=s.state,s.__v=t,m)k&&S.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),k&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(k&&S.getDerivedStateFromProps==null&&f!==b&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(f,F),!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(f,s.__s,F)===!1||t.__v==r.__v){for(t.__v!=r.__v&&(s.props=f,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(j){j&&(j.__=t)}),I=0;I<s._sb.length;I++)s.__h.push(s._sb[I]);s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(f,s.__s,F),k&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(b,E,L)})}if(s.context=F,s.props=f,s.__P=e,s.__e=!1,_=P.__r,D=0,k){for(s.state=s.__s,s.__d=!1,_&&_(t),d=s.render(s.props,s.state,s.context),K=0;K<s._sb.length;K++)s.__h.push(s._sb[K]);s._sb=[]}else do s.__d=!1,_&&_(t),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++D<25);s.state=s.__s,s.getChildContext!=null&&(n=ne(ne({},n),s.getChildContext())),k&&!m&&s.getSnapshotBeforeUpdate!=null&&(L=s.getSnapshotBeforeUpdate(b,E)),U=d,d!=null&&d.type===te&&d.key==null&&(U=vt(d.props.children)),l=bt(e,Re(U)?U:[U],t,r,n,i,o,a,l,u,c),s.base=t.__e,t.__u&=-161,s.__h.length&&a.push(s),C&&(s.__E=s.__=null)}catch(j){if(t.__v=null,u||o!=null)if(j.then){for(t.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,t.__e=l}else{for(V=o.length;V--;)Ve(o[V]);Ue(t)}else t.__e=r.__e,t.__k=r.__k,j.then||Ue(t);P.__e(j,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=Cr(r.__e,t,r,n,i,o,a,u,c);return(d=P.diffed)&&d(t),128&t.__u?void 0:l}function Ue(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Ue)}function _t(e,t,r){for(var n=0;n<r.length;n++)je(r[n],r[++n],r[++n]);P.__c&&P.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){P.__e(o,i.__v)}})}function vt(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Re(e)?e.map(vt):ne({},e)}function Cr(e,t,r,n,i,o,a,l,u){var c,d,s,m,b,E,L,C=r.props,f=t.props,k=t.type;if(k=="svg"?i="http://www.w3.org/2000/svg":k=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((b=o[c])&&"setAttribute"in b==!!k&&(k?b.localName==k:b.nodeType==3)){e=b,o[c]=null;break}}if(e==null){if(k==null)return document.createTextNode(f);e=document.createElementNS(i,k,f.is&&f),l&&(P.__m&&P.__m(t,o),l=!1),o=null}if(k==null)C===f||l&&e.data==f||(e.data=f);else{if(o=o&&Le.call(e.childNodes),C=r.props||he,!l&&o!=null)for(C={},c=0;c<e.attributes.length;c++)C[(b=e.attributes[c]).name]=b.value;for(c in C)if(b=C[c],c!="children"){if(c=="dangerouslySetInnerHTML")s=b;else if(!(c in f)){if(c=="value"&&"defaultValue"in f||c=="checked"&&"defaultChecked"in f)continue;Ee(e,c,null,b,i)}}for(c in f)b=f[c],c=="children"?m=b:c=="dangerouslySetInnerHTML"?d=b:c=="value"?E=b:c=="checked"?L=b:l&&typeof b!="function"||C[c]===b||Ee(e,c,b,C[c],i);if(d)l||s&&(d.__html==s.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(s&&(e.innerHTML=""),bt(t.type=="template"?e.content:e,Re(m)?m:[m],t,r,n,k=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&ue(r,0),l,u),o!=null)for(c=o.length;c--;)Ve(o[c]);l||(c="value",k=="progress"&&E==null?e.removeAttribute("value"):E!=null&&(E!==e[c]||k=="progress"&&!E||k=="option"&&E!=C[c])&&Ee(e,c,E,C[c],i),c="checked",L!=null&&L!=e[c]&&Ee(e,c,L,C[c],i))}return e}function je(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){P.__e(i,r)}}function yt(e,t,r){var n,i;if(P.unmount&&P.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||je(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){P.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&yt(n[i],t,r||typeof e.type!="function");r||Ve(e.__e),e.__c=e.__=e.__e=void 0}function Tr(e,t,r){return this.constructor(e,r)}function Be(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),P.__&&P.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],$e(t,e=(!n&&r||t).__k=kr(te,null,[e]),i||he,he,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?Le.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),_t(o,e,a)}Le=mt.slice,P={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(l){e=l}throw e}},ut=0,_r=function(e){return e!=null&&e.constructor==null},Me.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ne({},this.state),typeof e=="function"&&(e=e(ne({},r),this.props)),e&&ne(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),st(this))},Me.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),st(this))},Me.prototype.render=te,se=[],dt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pt=function(e,t){return e.__v.__b-t.__v.__b},Pe.__r=0,ft=/(PointerCapture)$|Capture$/i,Ke=0,Fe=ct(!1),Oe=ct(!0),vr=0;var be,z,qe,kt,ge=0,Mt=[],H=P,wt=H.__b,xt=H.__r,Ct=H.diffed,Tt=H.__c,St=H.unmount,Et=H.__;function Ge(e,t){H.__h&&H.__h(z,e,ge||t),ge=0;var r=z.__H||(z.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function le(e){return ge=1,Sr(Dt,e)}function Sr(e,t,r){var n=Ge(be++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Dt(void 0,t),function(l){var u=n.__N?n.__N[0]:n.__[0],c=n.t(u,l);u!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=z,!z.__f)){var i=function(l,u,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(m){return!!m.__c});if(d.every(function(m){return!m.__N}))return!o||o.call(this,l,u,c);var s=n.__c.props!==l;return d.forEach(function(m){if(m.__N){var b=m.__[0];m.__=m.__N,m.__N=void 0,b!==m.__[0]&&(s=!0)}}),o&&o.call(this,l,u,c)||s};z.__f=!0;var o=z.shouldComponentUpdate,a=z.componentWillUpdate;z.componentWillUpdate=function(l,u,c){if(this.__e){var d=o;o=void 0,i(l,u,c),o=d}a&&a.call(this,l,u,c)},z.shouldComponentUpdate=i}return n.__N||n.__}function X(e,t){var r=Ge(be++,3);!H.__s&&Rt(r.__H,t)&&(r.__=e,r.u=t,z.__H.__h.push(r))}function O(e){return ge=5,Pt(function(){return{current:e}},[])}function Pt(e,t){var r=Ge(be++,7);return Rt(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Lt(e,t){return ge=8,Pt(function(){return e},t)}function Er(){for(var e;e=Mt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(De),e.__H.__h.forEach(We),e.__H.__h=[]}catch(t){e.__H.__h=[],H.__e(t,e.__v)}}H.__b=function(e){z=null,wt&&wt(e)},H.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Et&&Et(e,t)},H.__r=function(e){xt&&xt(e),be=0;var t=(z=e.__c).__H;t&&(qe===z?(t.__h=[],z.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(De),t.__h.forEach(We),t.__h=[],be=0)),qe=z},H.diffed=function(e){Ct&&Ct(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Mt.push(t)!==1&&kt===H.requestAnimationFrame||((kt=H.requestAnimationFrame)||Ar)(Er)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),qe=z=null},H.__c=function(e,t){t.some(function(r){try{r.__h.forEach(De),r.__h=r.__h.filter(function(n){return!n.__||We(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],H.__e(n,r.__v)}}),Tt&&Tt(e,t)},H.unmount=function(e){St&&St(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{De(n)}catch(i){t=i}}),r.__H=void 0,t&&H.__e(t,r.__v))};var At=typeof requestAnimationFrame=="function";function Ar(e){var t,r=function(){clearTimeout(n),At&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);At&&(t=requestAnimationFrame(r))}function De(e){var t=z,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),z=t}function We(e){var t=z;e.__c=e.__(),z=t}function Rt(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Dt(e,t){return typeof t=="function"?t(e):t}var Mr=0;function p(e,t,r,n,i,o){t||(t={});var a,l,u=t;if("ref"in u)for(l in u={},t)l=="ref"?a=t[l]:u[l]=t[l];var c={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Mr,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)u[l]===void 0&&(u[l]=a[l]);return P.vnode&&P.vnode(c),c}var Nt=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M16.72 7.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1 0 1.06l-3.75 3.75a.75.75 0 1 1-1.06-1.06l2.47-2.47H3a.75.75 0 0 1 0-1.5h16.19l-2.47-2.47a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),Pr=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 0 1 1.04-.208Z",clipRule:"evenodd"})}),zt=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),Xe=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:p("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),It=()=>p("svg",{width:"32",height:"32",viewBox:"0 0 900 900",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("circle",{cx:"446",cy:"450",r:"424",fill:"black"}),p("circle",{cx:"450",cy:"450",r:"357",fill:"#E8E8E8"}),p("ellipse",{cx:"579.85",cy:"294.451",rx:"79.778",ry:"108.483",transform:"rotate(-46.2324 579.85 294.451)",fill:"black"})]}),Lr=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",width:"16",height:"16",children:p("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),Rr=`
6
- :host { --kb-font-family: system-ui, -apple-system, sans-serif; --kb-bg-container: rgba(255, 255, 255, 0.05); --kb-border-container: rgba(255, 255, 255, 0.2); --kb-shadow-container: 0 25px 50px -12px rgba(0, 0, 0, 0.25); --kb-backdrop-blur: 16px; --kb-text-title: #ffffff; --kb-text-subtitle: rgba(255, 255, 255, 0.7); --kb-btn-dismiss-bg: rgba(0, 0, 0, 0.7); --kb-btn-dismiss-border: rgba(255, 255, 255, 0.2); --kb-btn-dismiss-text: rgba(255, 255, 255, 0.8); --kb-btn-dismiss-hover-bg: rgba(0, 0, 0, 0.9); --kb-btn-dismiss-hover-text: #ffffff; --kb-btn-trigger-bg: #ffffff; --kb-btn-trigger-text: #000000; --kb-btn-trigger-hover-bg: rgba(255, 255, 255, 0.9); --kb-progress-track: rgba(255, 255, 255, 0.2); --kb-progress-indicator: #ffffff; --kb-popover-bg: rgba(255, 255, 255, 0.05); --kb-popover-border: rgba(255, 255, 255, 0.2); --kb-popover-text: #ffffff; --kb-input-bg: transparent; --kb-input-border: rgba(255, 255, 255, 0.3); --kb-input-text: #ffffff; --kb-input-placeholder: rgba(255, 255, 255, 0.6); --kb-form-label: #ffffff; --kb-success-color: #6ee7b7; --kb-error-text: #ef4444; --kb-focus-blur: 10px; --kb-kbd-bg: rgba(255, 255, 255, 0.1); --kb-kbd-border: rgba(255, 255, 255, 0.2); --kb-kbd-text: rgba(255, 255, 255, 0.6); --kb-watermark-text: rgba(255, 255, 255, 0.4); font-family: var(--kb-font-family); }
5
+ "use strict";var KenobiLib=(()=>{var Se=Object.defineProperty;var An=Object.getOwnPropertyDescriptor;var Mn=Object.getOwnPropertyNames;var Dn=Object.prototype.hasOwnProperty;var Ln=(t,e,n)=>e in t?Se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Rn=(t,e)=>{for(var n in e)Se(t,n,{get:e[n],enumerable:!0})},In=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Mn(e))!Dn.call(t,i)&&i!==n&&Se(t,i,{get:()=>e[i],enumerable:!(r=An(e,i))||r.enumerable});return t};var Nn=t=>In(Se({},"__esModule",{value:!0}),t);var f=(t,e,n)=>Ln(t,typeof e!="symbol"?e+"":e,n);var Pr={};Rn(Pr,{CueCard:()=>we,Kenobi:()=>ot,TRANSFORMATION_ACTIONS:()=>cn});var gt=11;function On(t,e){var n=e.attributes,r,i,o,a,s;if(!(e.nodeType===gt||t.nodeType===gt)){for(var u=n.length-1;u>=0;u--)r=n[u],i=r.name,o=r.namespaceURI,a=r.value,o?(i=r.localName||i,s=t.getAttributeNS(o,i),s!==a&&(r.prefix==="xmlns"&&(i=r.name),t.setAttributeNS(o,i,a))):(s=t.getAttribute(i),s!==a&&t.setAttribute(i,a));for(var c=t.attributes,m=c.length-1;m>=0;m--)r=c[m],i=r.name,o=r.namespaceURI,o?(i=r.localName||i,e.hasAttributeNS(o,i)||t.removeAttributeNS(o,i)):e.hasAttribute(i)||t.removeAttribute(i)}}var Ee,Hn="http://www.w3.org/1999/xhtml",Q=typeof document>"u"?void 0:document,Fn=!!Q&&"content"in Q.createElement("template"),Un=!!Q&&Q.createRange&&"createContextualFragment"in Q.createRange();function Kn(t){var e=Q.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function $n(t){Ee||(Ee=Q.createRange(),Ee.selectNode(Q.body));var e=Ee.createContextualFragment(t);return e.childNodes[0]}function Vn(t){var e=Q.createElement("body");return e.innerHTML=t,e.childNodes[0]}function jn(t){return t=t.trim(),Fn?Kn(t):Un?$n(t):Vn(t)}function ze(t,e){var n=t.nodeName,r=e.nodeName,i,o;return n===r?!0:(i=n.charCodeAt(0),o=r.charCodeAt(0),i<=90&&o>=97?n===r.toUpperCase():o<=90&&i>=97?r===n.toUpperCase():!1)}function Bn(t,e){return!e||e===Hn?Q.createElement(t):Q.createElementNS(e,t)}function qn(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function je(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n))}var yt={OPTION:function(t,e){var n=t.parentNode;if(n){var r=n.nodeName.toUpperCase();r==="OPTGROUP"&&(n=n.parentNode,r=n&&n.nodeName.toUpperCase()),r==="SELECT"&&!n.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),n.selectedIndex=-1)}je(t,e,"selected")},INPUT:function(t,e){je(t,e,"checked"),je(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;t.value!==n&&(t.value=n);var r=t.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==t.placeholder)return;r.nodeValue=n}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var n=-1,r=0,i=t.firstChild,o,a;i;)if(a=i.nodeName&&i.nodeName.toUpperCase(),a==="OPTGROUP")o=i,i=o.firstChild,i||(i=o.nextSibling,o=null);else{if(a==="OPTION"){if(i.hasAttribute("selected")){n=r;break}r++}i=i.nextSibling,!i&&o&&(i=o.nextSibling,o=null)}t.selectedIndex=n}}},ye=1,_t=11,vt=3,kt=8;function ce(){}function Wn(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function Xn(t){return function(n,r,i){if(i||(i={}),typeof r=="string")if(n.nodeName==="#document"||n.nodeName==="HTML"||n.nodeName==="BODY"){var o=r;r=Q.createElement("html"),r.innerHTML=o}else r=jn(r);else r.nodeType===_t&&(r=r.firstElementChild);var a=i.getNodeKey||Wn,s=i.onBeforeNodeAdded||ce,u=i.onNodeAdded||ce,c=i.onBeforeElUpdated||ce,m=i.onElUpdated||ce,l=i.onBeforeNodeDiscarded||ce,d=i.onNodeDiscarded||ce,h=i.onBeforeElChildrenUpdated||ce,E=i.skipFromChildren||ce,M=i.addChild||function(y,k){return y.appendChild(k)},T=i.childrenOnly===!0,g=Object.create(null),x=[];function P(y){x.push(y)}function O(y,k){if(y.nodeType===ye)for(var L=y.firstChild;L;){var S=void 0;k&&(S=a(L))?P(S):(d(L),L.firstChild&&O(L,k)),L=L.nextSibling}}function D(y,k,L){l(y)!==!1&&(k&&k.removeChild(y),d(y),O(y,L))}function v(y){if(y.nodeType===ye||y.nodeType===_t)for(var k=y.firstChild;k;){var L=a(k);L&&(g[L]=k),v(k),k=k.nextSibling}}v(n);function V(y){u(y);for(var k=y.firstChild;k;){var L=k.nextSibling,S=a(k);if(S){var z=g[S];z&&ze(k,z)?(k.parentNode.replaceChild(z,k),j(z,k)):V(k)}else V(k);k=L}}function J(y,k,L){for(;k;){var S=k.nextSibling;(L=a(k))?P(L):D(k,y,!0),k=S}}function j(y,k,L){var S=a(k);if(S&&delete g[S],!L){var z=c(y,k);if(z===!1||(z instanceof HTMLElement&&(y=z,v(y)),t(y,k),m(y),h(y,k)===!1))return}y.nodeName!=="TEXTAREA"?H(y,k):yt.TEXTAREA(y,k)}function H(y,k){var L=E(y,k),S=k.firstChild,z=y.firstChild,G,Z,F,te,ne;e:for(;S;){for(te=S.nextSibling,G=a(S);!L&&z;){if(F=z.nextSibling,S.isSameNode&&S.isSameNode(z)){S=te,z=F;continue e}Z=a(z);var ee=z.nodeType,q=void 0;if(ee===S.nodeType&&(ee===ye?(G?G!==Z&&((ne=g[G])?F===ne?q=!1:(y.insertBefore(ne,z),Z?P(Z):D(z,y,!0),z=ne,Z=a(z)):q=!1):Z&&(q=!1),q=q!==!1&&ze(z,S),q&&j(z,S)):(ee===vt||ee==kt)&&(q=!0,z.nodeValue!==S.nodeValue&&(z.nodeValue=S.nodeValue))),q){S=te,z=F;continue e}Z?P(Z):D(z,y,!0),z=F}if(G&&(ne=g[G])&&ze(ne,S))L||M(y,ne),j(ne,S);else{var $=s(S);$!==!1&&($&&(S=$),S.actualize&&(S=S.actualize(y.ownerDocument||Q)),M(y,S),V(S))}S=te,z=F}J(y,z,Z);var ae=yt[y.nodeName];ae&&ae(y,k)}var C=n,B=C.nodeType,ge=r.nodeType;if(!T){if(B===ye)ge===ye?ze(n,r)||(d(n),C=qn(n,Bn(r.nodeName,r.namespaceURI))):C=r;else if(B===vt||B===kt){if(ge===B)return C.nodeValue!==r.nodeValue&&(C.nodeValue=r.nodeValue),C;C=r}}if(C===r)d(n);else{if(r.isSameNode&&r.isSameNode(C))return;if(j(C,r,T),x)for(var ue=0,He=x.length;ue<He;ue++){var pe=g[x[ue]];pe&&D(pe,pe.parentNode,!1)}}return!T&&C!==n&&n.parentNode&&(C.actualize&&(C=C.actualize(n.ownerDocument||Q)),n.parentNode.replaceChild(C,n)),C}}var Yn=Xn(On),Pe=Yn;var Re,A,St,Gn,de,wt,Et,zt,Pt,Xe,Be,qe,Qn,_e={},At=[],Jn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ie=Array.isArray;function se(t,e){for(var n in e)t[n]=e[n];return t}function Ye(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Zn(t,e,n){var r,i,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Re.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return Me(t,a,r,i,null)}function Me(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++St,__i:-1,__u:0};return i==null&&A.vnode!=null&&A.vnode(o),o}function le(t){return t.children}function De(t,e){this.props=t,this.context=e}function he(t,e){if(e==null)return t.__?he(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?he(t):null}function Mt(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Mt(t)}}function xt(t){(!t.__d&&(t.__d=!0)&&de.push(t)&&!Le.__r++||wt!=A.debounceRendering)&&((wt=A.debounceRendering)||Et)(Le)}function Le(){for(var t,e,n,r,i,o,a,s=1;de.length;)de.length>s&&de.sort(zt),t=de.shift(),s=de.length,t.__d&&(n=void 0,r=void 0,i=(r=(e=t).__v).__e,o=[],a=[],e.__P&&((n=se({},r)).__v=r.__v+1,A.vnode&&A.vnode(n),Ge(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,o,i??he(r),!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,Rt(o,n,a),r.__e=r.__=null,n.__e!=i&&Mt(n)));Le.__r=0}function Dt(t,e,n,r,i,o,a,s,u,c,m){var l,d,h,E,M,T,g,x=r&&r.__k||At,P=e.length;for(u=er(n,e,x,u,P),l=0;l<P;l++)(h=n.__k[l])!=null&&(d=h.__i==-1?_e:x[h.__i]||_e,h.__i=l,T=Ge(t,h,d,i,o,a,s,u,c,m),E=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&Qe(d.ref,null,h),m.push(h.ref,h.__c||E,h)),M==null&&E!=null&&(M=E),(g=!!(4&h.__u))||d.__k===h.__k?u=Lt(h,u,t,g):typeof h.type=="function"&&T!==void 0?u=T:E&&(u=E.nextSibling),h.__u&=-7);return n.__e=M,u}function er(t,e,n,r,i){var o,a,s,u,c,m=n.length,l=m,d=0;for(t.__k=new Array(i),o=0;o<i;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+d,(a=t.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Me(null,a,null,null,null):Ie(a)?Me(le,{children:a},null,null,null):a.constructor==null&&a.__b>0?Me(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=t,a.__b=t.__b+1,s=null,(c=a.__i=tr(a,n,u,l))!=-1&&(l--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(i>m?d--:i<m&&d++),typeof a.type!="function"&&(a.__u|=4)):c!=u&&(c==u-1?d--:c==u+1?d++:(c>u?d--:d++,a.__u|=4))):t.__k[o]=null;if(l)for(o=0;o<m;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=he(s)),Nt(s,s));return r}function Lt(t,e,n,r){var i,o;if(typeof t.type=="function"){for(i=t.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=t,e=Lt(i[o],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=he(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function tr(t,e,n,r){var i,o,a,s=t.key,u=t.type,c=e[n],m=c!=null&&(2&c.__u)==0;if(c===null&&t.key==null||m&&s==c.key&&u==c.type)return n;if(r>(m?1:0)){for(i=n-1,o=n+1;i>=0||o<e.length;)if((c=e[a=i>=0?i--:o++])!=null&&(2&c.__u)==0&&s==c.key&&u==c.type)return a}return-1}function Ct(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Jn.test(e)?n:n+"px"}function Ae(t,e,n,r,i){var o,a;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||Ct(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||Ct(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Pt,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=Xe,t.addEventListener(e,o?qe:Be,o)):t.removeEventListener(e,o?qe:Be,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Tt(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Xe++;else if(e.t<n.u)return;return n(A.event?A.event(e):e)}}}function Ge(t,e,n,r,i,o,a,s,u,c){var m,l,d,h,E,M,T,g,x,P,O,D,v,V,J,j,H,C=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),o=[s=e.__e=n.__e]),(m=A.__b)&&m(e);e:if(typeof C=="function")try{if(g=e.props,x="prototype"in C&&C.prototype.render,P=(m=C.contextType)&&r[m.__c],O=m?P?P.props.value:m.__:r,n.__c?T=(l=e.__c=n.__c).__=l.__E:(x?e.__c=l=new C(g,O):(e.__c=l=new De(g,O),l.constructor=C,l.render=rr),P&&P.sub(l),l.props=g,l.state||(l.state={}),l.context=O,l.__n=r,d=l.__d=!0,l.__h=[],l._sb=[]),x&&l.__s==null&&(l.__s=l.state),x&&C.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=se({},l.__s)),se(l.__s,C.getDerivedStateFromProps(g,l.__s))),h=l.props,E=l.state,l.__v=e,d)x&&C.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),x&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(x&&C.getDerivedStateFromProps==null&&g!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,O),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,O)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(l.props=g,l.state=l.__s,l.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(B){B&&(B.__=e)}),D=0;D<l._sb.length;D++)l.__h.push(l._sb[D]);l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,O),x&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,E,M)})}if(l.context=O,l.props=g,l.__P=t,l.__e=!1,v=A.__r,V=0,x){for(l.state=l.__s,l.__d=!1,v&&v(e),m=l.render(l.props,l.state,l.context),J=0;J<l._sb.length;J++)l.__h.push(l._sb[J]);l._sb=[]}else do l.__d=!1,v&&v(e),m=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++V<25);l.state=l.__s,l.getChildContext!=null&&(r=se(se({},r),l.getChildContext())),x&&!d&&l.getSnapshotBeforeUpdate!=null&&(M=l.getSnapshotBeforeUpdate(h,E)),j=m,m!=null&&m.type===le&&m.key==null&&(j=It(m.props.children)),s=Dt(t,Ie(j)?j:[j],e,n,r,i,o,a,s,u,c),l.base=e.__e,e.__u&=-161,l.__h.length&&a.push(l),T&&(l.__E=l.__=null)}catch(B){if(e.__v=null,u||o!=null)if(B.then){for(e.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,e.__e=s}else{for(H=o.length;H--;)Ye(o[H]);We(e)}else e.__e=n.__e,e.__k=n.__k,B.then||We(e);A.__e(B,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=nr(n.__e,e,n,r,i,o,a,u,c);return(m=A.diffed)&&m(e),128&e.__u?void 0:s}function We(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(We)}function Rt(t,e,n){for(var r=0;r<n.length;r++)Qe(n[r],n[++r],n[++r]);A.__c&&A.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){A.__e(o,i.__v)}})}function It(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Ie(t)?t.map(It):se({},t)}function nr(t,e,n,r,i,o,a,s,u){var c,m,l,d,h,E,M,T=n.props,g=e.props,x=e.type;if(x=="svg"?i="http://www.w3.org/2000/svg":x=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((h=o[c])&&"setAttribute"in h==!!x&&(x?h.localName==x:h.nodeType==3)){t=h,o[c]=null;break}}if(t==null){if(x==null)return document.createTextNode(g);t=document.createElementNS(i,x,g.is&&g),s&&(A.__m&&A.__m(e,o),s=!1),o=null}if(x==null)T===g||s&&t.data==g||(t.data=g);else{if(o=o&&Re.call(t.childNodes),T=n.props||_e,!s&&o!=null)for(T={},c=0;c<t.attributes.length;c++)T[(h=t.attributes[c]).name]=h.value;for(c in T)if(h=T[c],c!="children"){if(c=="dangerouslySetInnerHTML")l=h;else if(!(c in g)){if(c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g)continue;Ae(t,c,null,h,i)}}for(c in g)h=g[c],c=="children"?d=h:c=="dangerouslySetInnerHTML"?m=h:c=="value"?E=h:c=="checked"?M=h:s&&typeof h!="function"||T[c]===h||Ae(t,c,h,T[c],i);if(m)s||l&&(m.__html==l.__html||m.__html==t.innerHTML)||(t.innerHTML=m.__html),e.__k=[];else if(l&&(t.innerHTML=""),Dt(e.type=="template"?t.content:t,Ie(d)?d:[d],e,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:n.__k&&he(n,0),s,u),o!=null)for(c=o.length;c--;)Ye(o[c]);s||(c="value",x=="progress"&&E==null?t.removeAttribute("value"):E!=null&&(E!==t[c]||x=="progress"&&!E||x=="option"&&E!=T[c])&&Ae(t,c,E,T[c],i),c="checked",M!=null&&M!=t[c]&&Ae(t,c,M,T[c],i))}return t}function Qe(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){A.__e(i,n)}}function Nt(t,e,n){var r,i;if(A.unmount&&A.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Qe(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){A.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&Nt(r[i],e,n||typeof t.type!="function");n||Ye(t.__e),t.__c=t.__=t.__e=void 0}function rr(t,e,n){return this.constructor(t,n)}function Je(t,e,n){var r,i,o,a;e==document&&(e=document.documentElement),A.__&&A.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,o=[],a=[],Ge(e,t=(!r&&n||e).__k=Zn(le,null,[t]),i||_e,_e,e.namespaceURI,!r&&n?[n]:i?null:e.firstChild?Re.call(e.childNodes):null,o,!r&&n?n:i?i.__e:e.firstChild,r,a),Rt(o,t,a)}Re=At.slice,A={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(s){t=s}throw t}},St=0,Gn=function(t){return t!=null&&t.constructor==null},De.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=se({},this.state),typeof t=="function"&&(t=t(se({},n),this.props)),t&&se(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),xt(this))},De.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),xt(this))},De.prototype.render=le,de=[],Et=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,zt=function(t,e){return t.__v.__b-e.__v.__b},Le.__r=0,Pt=/(PointerCapture)$|Capture$/i,Xe=0,Be=Tt(!1),qe=Tt(!0),Qn=0;var ve,N,Ze,Ot,ke=0,Bt=[],U=A,Ht=U.__b,Ft=U.__r,Ut=U.diffed,Kt=U.__c,$t=U.unmount,Vt=U.__;function tt(t,e){U.__h&&U.__h(N,t,ke||e),ke=0;var n=N.__H||(N.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function ie(t){return ke=1,ir(Yt,t)}function ir(t,e,n){var r=tt(ve++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Yt(void 0,e),function(s){var u=r.__N?r.__N[0]:r.__[0],c=r.t(u,s);u!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=N,!N.__f)){var i=function(s,u,c){if(!r.__c.__H)return!0;var m=r.__c.__H.__.filter(function(d){return!!d.__c});if(m.every(function(d){return!d.__N}))return!o||o.call(this,s,u,c);var l=r.__c.props!==s;return m.forEach(function(d){if(d.__N){var h=d.__[0];d.__=d.__N,d.__N=void 0,h!==d.__[0]&&(l=!0)}}),o&&o.call(this,s,u,c)||l};N.__f=!0;var o=N.shouldComponentUpdate,a=N.componentWillUpdate;N.componentWillUpdate=function(s,u,c){if(this.__e){var m=o;o=void 0,i(s,u,c),o=m}a&&a.call(this,s,u,c)},N.shouldComponentUpdate=i}return r.__N||r.__}function Y(t,e){var n=tt(ve++,3);!U.__s&&Xt(n.__H,e)&&(n.__=t,n.u=e,N.__H.__h.push(n))}function K(t){return ke=5,qt(function(){return{current:t}},[])}function qt(t,e){var n=tt(ve++,7);return Xt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Wt(t,e){return ke=8,qt(function(){return t},e)}function or(){for(var t;t=Bt.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ne),t.__H.__h.forEach(et),t.__H.__h=[]}catch(e){t.__H.__h=[],U.__e(e,t.__v)}}U.__b=function(t){N=null,Ht&&Ht(t)},U.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Vt&&Vt(t,e)},U.__r=function(t){Ft&&Ft(t),ve=0;var e=(N=t.__c).__H;e&&(Ze===N?(e.__h=[],N.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(Ne),e.__h.forEach(et),e.__h=[],ve=0)),Ze=N},U.diffed=function(t){Ut&&Ut(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Bt.push(e)!==1&&Ot===U.requestAnimationFrame||((Ot=U.requestAnimationFrame)||ar)(or)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Ze=N=null},U.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Ne),n.__h=n.__h.filter(function(r){return!r.__||et(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],U.__e(r,n.__v)}}),Kt&&Kt(t,e)},U.unmount=function(t){$t&&$t(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Ne(r)}catch(i){e=i}}),n.__H=void 0,e&&U.__e(e,n.__v))};var jt=typeof requestAnimationFrame=="function";function ar(t){var e,n=function(){clearTimeout(r),jt&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);jt&&(e=requestAnimationFrame(n))}function Ne(t){var e=N,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),N=e}function et(t){var e=N;t.__c=t.__(),N=e}function Xt(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Yt(t,e){return typeof e=="function"?e(t):e}var sr=0;function p(t,e,n,r,i,o){e||(e={});var a,s,u=e;if("ref"in u)for(s in u={},e)s=="ref"?a=e[s]:u[s]=e[s];var c={type:t,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--sr,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return A.vnode&&A.vnode(c),c}var Gt=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",width:"16",height:"16",children:p("path",{d:"M5 12h14M12 5l7 7-7 7"})}),lr=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 0 1 1.04-.208Z",clipRule:"evenodd"})}),Qt=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),nt=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:p("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),cr=()=>p("svg",{width:"32",height:"32",viewBox:"0 0 900 900",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("circle",{cx:"446",cy:"450",r:"424",fill:"black"}),p("circle",{cx:"450",cy:"450",r:"357",fill:"#E8E8E8"}),p("ellipse",{cx:"579.85",cy:"294.451",rx:"79.778",ry:"108.483",transform:"rotate(-46.2324 579.85 294.451)",fill:"black"})]}),ur=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",width:"16",height:"16",children:p("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),Oe="kenobi:identity-resolved",Jt="kenobi-snitcher",dr=1600,rt=(t,e)=>{typeof window>"u"||window.dispatchEvent(new CustomEvent(`kenobi:${t}`,{detail:e,bubbles:!0}))},pr=t=>{if(!t||t.type!=="business")return null;let e=t.company,n=e?.name||t.domain||void 0,r=e?.domain||t.domain||void 0;return n?{name:n,domain:r,logoUrl:e?.logoUrl||(r?`https://logo.clearbit.com/${r}`:void 0)}:null},Zt=t=>t?t.replace(/^https?:\/\//i,"").replace(/\/.*$/,"").replace(/:\d+$/,"").replace(/^www\./i,"").trim().toLowerCase():"",fr=t=>{if(typeof window>"u"||typeof document>"u"||window.__kenobiSnitcherLoaded||window.__kenobiSnitcherLoading)return;if(window.Snitcher||window.SpotterSettings){window.__kenobiSnitcherLoaded=!0;return}if(document.getElementById(Jt)){window.__kenobiSnitcherLoaded=!0;return}let e=t?.snitcher;if(!e?.spotterToken||!e.profileId)return;window.__kenobiSnitcherLoading=!0;let n=t?.logoUrlTemplate||"https://logo.clearbit.com/{domain}",r=e.apiEndpoint||`${window.location.origin}/api/snitcher-proxy/radar`,i=e.cdn||`${window.location.origin}/api/snitcher-proxy/cdn`,o=e.namespace||"Snitcher",a=`
6
+ (function () {
7
+ function spotterCb(response) {
8
+ var rawDomain = (response.company && response.company.domain) || response.domain || "";
9
+ var normalizedDomain = rawDomain
10
+ .replace(/^https?:\\/\\//i, "")
11
+ .replace(/\\/.*$/, "")
12
+ .replace(/:\\d+$/, "")
13
+ .replace(/^www\\./i, "");
14
+ var identity = {
15
+ provider: "snitcher",
16
+ type: response.type === "business" ? "business" : "unknown",
17
+ domain: response.domain || null,
18
+ ip: response.ip,
19
+ company: response.company
20
+ ? {
21
+ id: response.company.id,
22
+ name: response.company.name || response.domain,
23
+ domain: response.company.domain || response.domain,
24
+ logoUrl: "${n}".replace("{domain}", normalizedDomain),
25
+ industry: response.company.industry,
26
+ location: response.company.location,
27
+ employeeRange: response.company.employee_range,
28
+ foundedYear: response.company.founded_year,
29
+ description: response.company.description,
30
+ geo: response.company.geo
31
+ ? {
32
+ city: response.company.geo.city,
33
+ country: response.company.geo.country,
34
+ countryCode: response.company.geo.country_code,
35
+ region: response.company.geo.region,
36
+ postalCode: response.company.geo.postal_code,
37
+ address:
38
+ response.company.geo.full_address ||
39
+ response.company.geo.address,
40
+ }
41
+ : undefined,
42
+ profiles: response.company.profiles
43
+ ? {
44
+ linkedin: response.company.profiles.linkedin?.url,
45
+ twitter: response.company.profiles.twitter?.url,
46
+ facebook: response.company.profiles.facebook?.url,
47
+ crunchbase: response.company.profiles.crunchbase?.url,
48
+ }
49
+ : undefined,
50
+ }
51
+ : undefined,
52
+ raw: response,
53
+ };
54
+
55
+ window.__kenobiIdentityResolution = identity;
56
+ window.dispatchEvent(
57
+ new CustomEvent("${Oe}", {
58
+ detail: identity,
59
+ bubbles: true,
60
+ })
61
+ );
62
+ }
63
+
64
+ window.SpotterSettings = {
65
+ token: "${e.spotterToken}",
66
+ callback: spotterCb,
67
+ };
68
+
69
+ !(function (e) {
70
+ "use strict";
71
+ var t = e && e.namespace;
72
+ if (t && e.profileId && e.cdn) {
73
+ var i = window[t];
74
+ if (((i && Array.isArray(i)) || (i = window[t] = []), !i.initialized && !i._loaded))
75
+ if (i._loaded) console && console.warn("[Radar] Duplicate initialization attempted");
76
+ else {
77
+ i._loaded = !0;
78
+ [
79
+ "track",
80
+ "page",
81
+ "identify",
82
+ "group",
83
+ "alias",
84
+ "ready",
85
+ "debug",
86
+ "on",
87
+ "off",
88
+ "once",
89
+ "trackClick",
90
+ "trackSubmit",
91
+ "trackLink",
92
+ "trackForm",
93
+ "pageview",
94
+ "screen",
95
+ "reset",
96
+ "register",
97
+ "setAnonymousId",
98
+ "addSourceMiddleware",
99
+ "addIntegrationMiddleware",
100
+ "addDestinationMiddleware",
101
+ "giveCookieConsent",
102
+ ].forEach(function (e) {
103
+ var a;
104
+ i[e] =
105
+ ((a = e),
106
+ function () {
107
+ var e = window[t];
108
+ if (e.initialized) return e[a].apply(e, arguments);
109
+ var i = [].slice.call(arguments);
110
+ return i.unshift(a), e.push(i), e;
111
+ });
112
+ }),
113
+ -1 === e.apiEndpoint.indexOf("http") &&
114
+ (e.apiEndpoint = "https://" + e.apiEndpoint),
115
+ (i.bootstrap = function () {
116
+ var t,
117
+ i = document.createElement("script");
118
+ (i.async = !0),
119
+ (i.type = "text/javascript"),
120
+ (i.id = "__radar__"),
121
+ i.setAttribute("data-settings", JSON.stringify(e)),
122
+ (i.src = [
123
+ -1 !== (t = e.cdn).indexOf("http") ? "" : "https://",
124
+ t,
125
+ "/releases/latest/radar.min.js",
126
+ ].join(""));
127
+ var a = document.scripts[0];
128
+ a.parentNode.insertBefore(i, a);
129
+ }),
130
+ i.bootstrap();
131
+ }
132
+ } else
133
+ "undefined" != typeof console &&
134
+ console.error("[Radar] Configuration incomplete");
135
+ })({
136
+ apiEndpoint: "${r}",
137
+ cdn: "${i}",
138
+ namespace: "${o}",
139
+ profileId: "${e.profileId}",
140
+ });
141
+ })();
142
+ `,s=document.createElement("script");s.id=Jt,s.type="text/javascript",s.text=a,document.head?.appendChild(s),window.__kenobiSnitcherLoaded=!0,window.__kenobiSnitcherLoading=!1},mr=`
143
+ :host { --kb-font-family: system-ui, -apple-system, sans-serif; --kb-bg-container: rgba(255, 255, 255, 0.05); --kb-border-container: rgba(255, 255, 255, 0.2); --kb-shadow-container: 0 25px 50px -12px rgba(0, 0, 0, 0.25); --kb-backdrop-blur: 16px; --kb-text-title: #ffffff; --kb-text-subtitle: rgba(255, 255, 255, 0.7); --kb-btn-dismiss-bg: rgba(0, 0, 0, 0.7); --kb-btn-dismiss-border: rgba(255, 255, 255, 0.2); --kb-btn-dismiss-text: rgba(255, 255, 255, 0.8); --kb-btn-dismiss-hover-bg: rgba(0, 0, 0, 0.9); --kb-btn-dismiss-hover-text: #ffffff; --kb-btn-trigger-bg: #ffffff; --kb-btn-trigger-text: #000000; --kb-btn-trigger-hover-bg: rgba(255, 255, 255, 0.9); --kb-progress-track: rgba(255, 255, 255, 0.2); --kb-progress-indicator: #ffffff; --kb-popover-bg: rgba(255, 255, 255, 0.05); --kb-popover-border: rgba(255, 255, 255, 0.2); --kb-popover-text: #ffffff; --kb-input-bg: transparent; --kb-input-border: rgba(255, 255, 255, 0.3); --kb-input-text: #ffffff; --kb-input-placeholder: rgba(255, 255, 255, 0.6); --kb-form-label: #ffffff; --kb-success-color: #6ee7b7; --kb-error-text: #ef4444; --kb-focus-blur: 10px; --kb-kbd-bg: rgba(255, 255, 255, 0.15); --kb-kbd-border: rgba(255, 255, 255, 0.4); --kb-kbd-text: #ffffff; --kb-watermark-text: rgba(255, 255, 255, 0.4); font-family: var(--kb-font-family); }
7
144
  .theme-light { --kb-bg-container: #ffffff; --kb-border-container: #e2e8f0; --kb-shadow-container: 0 20px 25px -5px rgba(0, 0, 0, 0.1); --kb-backdrop-blur: 0px; --kb-text-title: #0f172a; --kb-text-subtitle: #475569; --kb-btn-dismiss-bg: #ffffff; --kb-btn-dismiss-border: #e2e8f0; --kb-btn-dismiss-text: #64748b; --kb-btn-dismiss-hover-bg: #f1f5f9; --kb-btn-dismiss-hover-text: #0f172a; --kb-btn-trigger-bg: #0f172a; --kb-btn-trigger-text: #ffffff; --kb-btn-trigger-hover-bg: #1e293b; --kb-progress-track: #e2e8f0; --kb-progress-indicator: #0f172a; --kb-popover-bg: #ffffff; --kb-popover-border: #e2e8f0; --kb-popover-text: #0f172a; --kb-input-bg: #ffffff; --kb-input-border: #cbd5e1; --kb-input-text: #0f172a; --kb-input-placeholder: #94a3b8; --kb-form-label: #334155; --kb-success-color: #059669; --kb-error-text: #ef4444; --kb-kbd-bg: #f1f5f9; --kb-kbd-border: #e2e8f0; --kb-kbd-text: #64748b; --kb-watermark-text: #94a3b8; }
8
145
  .theme-dark { --kb-bg-container: #0f172a; --kb-border-container: #334155; --kb-shadow-container: 0 25px 50px -12px rgba(0, 0, 0, 0.25); --kb-backdrop-blur: 0px; --kb-text-title: #f1f5f9; --kb-text-subtitle: #94a3b8; --kb-btn-dismiss-bg: #1e293b; --kb-btn-dismiss-border: #334155; --kb-btn-dismiss-text: #cbd5e1; --kb-btn-dismiss-hover-bg: #334155; --kb-btn-dismiss-hover-text: #ffffff; --kb-btn-trigger-bg: #ffffff; --kb-btn-trigger-text: #0f172a; --kb-btn-trigger-hover-bg: #f1f5f9; --kb-progress-track: #1e293b; --kb-progress-indicator: #ffffff; --kb-popover-bg: #0f172a; --kb-popover-border: #334155; --kb-popover-text: #f1f5f9; --kb-input-bg: #0f172a; --kb-input-border: #475569; --kb-input-text: #f1f5f9; --kb-input-placeholder: #94a3b8; --kb-form-label: #e2e8f0; --kb-success-color: #6ee7b7; --kb-error-text: #ef4444; --kb-kbd-bg: #1e293b; --kb-kbd-border: #334155; --kb-kbd-text: #94a3b8; --kb-watermark-text: #64748b; }
9
146
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
10
147
  #cue-card-root { position: fixed; z-index: 2147483647; pointer-events: none; width: 100%; height: 0; top: 0; left: 0; isolation: isolate; }
11
- .container { position: absolute; pointer-events: auto; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); border-radius: 0.25rem; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem; padding: 1rem; width: auto; min-width: 320px; max-width: 90vw; opacity: 0; z-index: 1; font-family: var(--kb-font-family); }
148
+ .container { position: absolute; pointer-events: auto; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); border-radius: 0.25rem; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem; padding: 1.25rem 1.5rem; width: auto; min-width: 400px; max-width: 90vw; opacity: 0; z-index: 1; font-family: var(--kb-font-family); }
12
149
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); transition: all 0.5s ease; z-index: 0; pointer-events: none; }
13
150
  .backdrop.active { background: rgba(0,0,0,0.1); backdrop-filter: blur(var(--kb-focus-blur)); -webkit-backdrop-filter: blur(var(--kb-focus-blur)); }
14
151
  .launcher { position: absolute; pointer-events: auto; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); border-radius: 9999px; padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.75rem; cursor: pointer; transition: transform 0.2s, opacity 0.3s; opacity: 0; z-index: 1; color: var(--kb-text-title); font-weight: 500; font-size: 0.875rem; font-family: var(--kb-font-family); }
15
152
  .launcher .kbd-hint .kbd { background: var(--kb-kbd-bg); border: 1px solid var(--kb-kbd-border); color: var(--kb-kbd-text); }
16
153
  .launcher .kbd-hint .kbd-text { color: var(--kb-kbd-text); }
17
154
  .launcher:hover { transform: scale(1.02); background-color: var(--kb-bg-container); }
155
+ .kb-chip-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
156
+ .kb-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.8rem; border-radius: 9999px; border: 1px solid rgba(255,255,255,0.85); background: linear-gradient(135deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08)); color: var(--kb-text-title); font-size: 0.8rem; font-weight: 600; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 8px 18px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.45); }
157
+ .kb-chip-logo { width: 18px; height: 18px; border-radius: 9999px; overflow: hidden; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; }
158
+ .kb-chip-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
159
+ .kb-chip-fallback { width: 18px; height: 18px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: var(--kb-text-title); background: rgba(255,255,255,0.25); }
160
+ .kb-chip-action { margin-left: 0.35rem; font-size: 0.7rem; color: var(--kb-text-subtitle); text-decoration: underline; background: none; border: none; padding: 0; cursor: pointer; }
161
+ .kb-chip-action:hover { color: var(--kb-text-title); }
162
+ .kb-chip--launcher { padding: 0.25rem 0.65rem; font-size: 0.7rem; }
163
+ .kb-chip-row.launcher-row { margin-bottom: 0; }
164
+ .launcher-label { display: inline-flex; align-items: center; gap: 0.5rem; }
165
+ .subtitle-chip { margin-top: 0.35rem; }
18
166
  .pos-top-center { left: 50%; translate: -50% 0; top: 1rem; }
19
167
  .pos-top-right { right: 1rem; top: 1rem; left: auto; }
20
168
  @media (max-width: 768px) { .pos-top-center, .pos-top-right { left: 0.5rem; right: 0.5rem; top: 0.5rem; translate: none; width: auto; max-width: none; } }
@@ -29,23 +177,33 @@
29
177
  .text-content { flex: 1; user-select: none; }
30
178
  .text-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
31
179
  .title { color: var(--kb-text-title); font-size: 1rem; font-weight: 600; line-height: 1.5; }
32
- .subtitle { color: var(--kb-text-title); font-size: 0.875rem; line-height: 1.25; opacity: 0.8; }
180
+ .subtitle-text { color: var(--kb-text-title); font-size: 0.875rem; line-height: 1.25; opacity: 0.8; }
33
181
  .btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 0.375rem; font-weight: 500; font-size: 0.875rem; line-height: 1.25rem; padding: 0.5rem 1rem; transition: all 0.2s; cursor: pointer; border: none; outline: none; }
34
- .btn-trigger { background-color: var(--kb-btn-trigger-bg); color: var(--kb-btn-trigger-text); min-width: 8rem; gap: 0.5rem; }
182
+ .btn-trigger { background-color: var(--kb-btn-trigger-bg); color: var(--kb-btn-trigger-text); min-width: 8rem; gap: 0.5rem; transition: opacity 0.2s ease-out, background-color 0.2s ease-out; }
183
+ .btn-trigger.hidden { opacity: 0; pointer-events: none; }
35
184
  .btn-trigger:not(:disabled):hover { background-color: var(--kb-btn-trigger-hover-bg); }
36
185
  .btn-trigger:disabled { opacity: 0.8; cursor: not-allowed; }
37
186
  .btn-trigger.success { background-color: transparent; color: var(--kb-success-color); padding-right: 0.75rem; cursor: default; }
187
+ .status-text { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--kb-text-subtitle); opacity: 0.8; }
38
188
  .btn-trigger.success:hover { background-color: transparent; }
39
189
  .animate-spin { animation: spin 1s linear infinite; }
40
190
  @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
191
+ @keyframes shine { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }
192
+ @keyframes sheen-flash { 0% { opacity: 0; transform: translateX(-100%) skewX(-15deg); } 50% { opacity: 0.6; } 100% { opacity: 0; transform: translateX(200%) skewX(-15deg); } }
193
+ .container-sheen { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
194
+ .container-sheen::after { content: ''; position: absolute; top: 0; left: 0; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); transform: translateX(-100%) skewX(-15deg); }
195
+ .container-sheen.active::after { animation: sheen-flash 0.6s ease-out forwards; }
196
+ .launcher-shine-border { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background-size: 300% 300%; animation: shine var(--shine-duration, 14s) linear infinite; mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; -webkit-mask-composite: xor; padding: var(--shine-border-width, 1px); }
41
197
  .btn-dismiss { position: absolute; top: -0.5rem; left: -0.5rem; width: 1.5rem; height: 1.5rem; padding: 0; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background-color: var(--kb-btn-dismiss-bg); border: 1px solid var(--kb-btn-dismiss-border); color: var(--kb-btn-dismiss-text); cursor: pointer; transition: all 0.3s ease-out; z-index: 10; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
42
198
  .btn-dismiss:hover { background-color: var(--kb-btn-dismiss-hover-bg); color: var(--kb-btn-dismiss-hover-text); }
43
- .progress-clip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
44
- .progress-container { position: absolute; bottom: 0; left: 0; right: 0; height: 0.25rem; background-color: var(--kb-progress-track); overflow: hidden; pointer-events: none; }
199
+ .progress-clip { position: absolute; inset: 0; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; overflow: hidden; pointer-events: none; }
200
+ .progress-container { position: absolute; bottom: 0; left: 0; right: 0; height: 0.25rem; background-color: var(--kb-progress-track); overflow: hidden; pointer-events: none; border-radius: 0; }
45
201
  .progress-bar { height: 100%; background-color: var(--kb-progress-indicator); width: 0%; transition: width 0.3s ease; }
46
- .popover { position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.375rem; background-color: var(--kb-popover-bg); border: 1px solid var(--kb-popover-border); border-radius: 0.25rem; border-top-left-radius: 0; border-top-right-radius: 0; padding: 1rem; color: var(--kb-popover-text); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); opacity: 0; transform: translateY(-10px); pointer-events: none; visibility: hidden; transition: all 0.2s ease-out; }
202
+ .popover { position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.375rem; background-color: var(--kb-popover-bg); border: 1px solid var(--kb-popover-border); border-radius: 0.25rem; border-top-left-radius: 0; border-top-right-radius: 0; padding: 1rem 1.5rem; color: var(--kb-popover-text); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); opacity: 0; transform: translateY(-10px); pointer-events: none; visibility: hidden; transition: all 0.2s ease-out; }
47
203
  .popover.open { opacity: 1; transform: translateY(0); pointer-events: auto; visibility: visible; }
48
- .form-group { margin-bottom: 1rem; }
204
+ .container.popover-open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
205
+ .container.popover-open .progress-clip { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
206
+ .form-group { margin-bottom: 0; }
49
207
  .form-label { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--kb-form-label); font-weight: 500; }
50
208
  .input-row { display: flex; gap: 0.5rem; }
51
209
  .form-input { flex: 1; background-color: var(--kb-input-bg); border: 1px solid var(--kb-input-border); color: var(--kb-input-text); border-radius: 0.375rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; outline: none; transition: border-color 0.2s; min-height: 44px; }
@@ -64,6 +222,9 @@
64
222
  .watermark { text-align: center; font-size: 0.625rem; color: var(--kb-watermark-text); opacity: 0.8; font-weight: 500; letter-spacing: 0.025em; }
65
223
  .watermark a { color: inherit; text-decoration: none; cursor: pointer; }
66
224
  .watermark a:hover { text-decoration: underline; text-decoration-color: var(--kb-watermark-text); }
225
+ .popover-watermark { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: 0.625rem; color: var(--kb-watermark-text); opacity: 0.6; font-weight: 500; letter-spacing: 0.025em; padding-top: 0.5rem; }
226
+ .popover-watermark a { color: inherit; text-decoration: none; cursor: pointer; }
227
+ .popover-watermark a:hover { text-decoration: underline; opacity: 1; }
67
228
  /* Launcher hint positioning */
68
229
  .launcher .kbd-hint { position: static; transform: none; opacity: 0.6; transition: opacity 0.2s; }
69
230
  .launcher:hover .kbd-hint { opacity: 1; }
@@ -86,7 +247,7 @@
86
247
  /* Custom tooltip for toggle button */
87
248
  .btn-toggle-personalization .toggle-tooltip { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); color: var(--kb-text-title); font-size: 0.7rem; font-weight: 500; padding: 0.25rem 0.5rem; border-radius: 4px; opacity: 0; visibility: hidden; transition: opacity 0.15s ease-out, visibility 0.15s ease-out; pointer-events: none; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
88
249
  .btn-toggle-personalization:hover .toggle-tooltip { opacity: 1; visibility: visible; }
89
- `,Ht=(e,t,r)=>{let n=O(!1);X(()=>{let i=e.current;if(!i)return;let o=r.direction==="top-to-bottom",a=o?"translateY(-60px)":"translateX(60px)",l=o?"translateY(-20px)":"translateX(20px)",u="translate(0, 0)";if(t){n.current=!0;let c=i.animate([{opacity:0,transform:a},{opacity:1,transform:u}],{duration:500,delay:r.entranceDelayMs,easing:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fill:"forwards"});c.onfinish=()=>r.onEntranceComplete?.()}else if(n.current){let c=i.animate([{opacity:1,transform:u},{opacity:0,transform:l}],{duration:350,delay:r.exitDelayMs,easing:"ease-in-out",fill:"forwards"});c.onfinish=()=>r.onExitComplete?.()}else i.style.opacity="0",i.style.transform=l},[t,r.direction])},Ft=e=>{if(!e)return{};let t={};return e.fontFamily&&(t["--kb-font-family"]=e.fontFamily),e.backgroundColor&&(t["--kb-bg-container"]=e.backgroundColor,t["--kb-popover-bg"]=e.backgroundColor),e.borderColor&&(t["--kb-border-container"]=e.borderColor,t["--kb-popover-border"]=e.borderColor),e.textColor&&(t["--kb-text-title"]=e.textColor,t["--kb-popover-text"]=e.textColor),e.subtitleColor&&(t["--kb-text-subtitle"]=e.subtitleColor),e.borderRadius&&(t["border-radius"]=e.borderRadius,t["border-bottom-left-radius"]=e.borderRadius,t["border-bottom-right-radius"]=e.borderRadius),e.primaryColor&&(t["--kb-btn-trigger-bg"]=e.primaryColor,t["--kb-progress-indicator"]=e.primaryColor,t["--kb-success-color"]=e.primaryColor),e.primaryTextColor&&(t["--kb-btn-trigger-text"]=e.primaryTextColor),t},Dr=({config:e,isOpen:t,skipFocus:r,setIsOpen:n})=>{let i=e.mountMode==="inline",o=O(null),a=O(null),l=O(null),u=O(null),c=O(null),[d,s]=le("card"),[m,b]=le(!1),[E,L]=le(!1),C=O(!1),f=O(!1),k=O(!1),M=O("card"),F=O(e.status),I=O(!!e.isVisible),_=O(null),D=O(null),K=O(!1),[U,V]=le(!1),[S,j]=le({}),[ye,pe]=le(0),ke=O(0),Q=e.enableTimer!==!1,y=Math.max(500,e.timerDurationMs??2e4),v=Lt(g=>{ke.current=g,pe(g)},[]);X(()=>{e.isVisible&&(s("card"),C.current=!1,b(!1))},[e.isVisible]),d==="card"&&M.current==="launcher"&&(f.current=!1),e.status==="success"&&F.current!=="success"?d==="card"&&(f.current=!0):e.status!=="success"&&(f.current=!1),F.current=e.status,X(()=>{let g=M.current==="launcher",w=d==="card";g&&w&&E&&(k.current=!0,setTimeout(()=>{k.current=!1},100)),d==="launcher"&&V(!1),g&&w&&Q&&(v(0),_.current=null,K.current=!1)},[d,v,Q]),X(()=>{if(e.status==="success"&&(L(!0),e.enableLauncher&&d==="card"&&f.current)){let g=setTimeout(()=>{s("launcher")},2e3);return()=>clearTimeout(g)}},[e.status,e.enableLauncher,d]),X(()=>{e.isVisible&&!I.current&&Q&&(v(0),_.current=null,K.current=!1),I.current=!!e.isVisible},[e.isVisible,v,Q]),X(()=>{M.current=d},[d]);let R=O(!1);r&&(R.current=!0),X(()=>{if(t){E&&c.current&&c.current.reset();let g=R.current;if(R.current=!1,!g){let w=setTimeout(()=>{u.current&&u.current.focus()},100);return()=>clearTimeout(w)}}},[t]);let x=O(t);X(()=>{let g=x.current;x.current=t,!g&&t&&d==="launcher"&&s("card")},[t,d]),i||(Ht(o,!!e.isVisible&&d==="card"&&!m,{direction:e.direction||"top-to-bottom",position:e.position||"top-center",entranceDelayMs:C.current?0:e.entranceDelayMs||0,exitDelayMs:75,onEntranceComplete:()=>{e.onEntranceComplete?.(),C.current=!0},onExitComplete:()=>{(!e.isVisible||m)&&e.onExitComplete?.()}}),Ht(a,!!e.isVisible&&d==="launcher"&&!m,{direction:e.direction||"top-to-bottom",position:e.position||"top-center",entranceDelayMs:0,exitDelayMs:75})),X(()=>{let g=l.current;if(!g)return;let w=e.status==="success";if(e.enableFocusMode&&d==="card"&&e.isVisible&&!w){let T=setTimeout(()=>{g.classList.add("active")},e.focusDelayMs||500);return()=>clearTimeout(T)}else g.classList.remove("active")},[e.enableFocusMode,d,e.isVisible,e.focusDelayMs,e.status]),X(()=>{if(!e.isVisible)return;let g=w=>{if(w.key==="Escape"){if(t){n(!1);return}d==="card"&&(e.enableLauncher?s("launcher"):e.onDismiss?.());return}(($,J)=>{let ee=J||{key:"p",modifiers:["meta","ctrl"]};if($.key.toLowerCase()!==ee.key.toLowerCase())return!1;let G=ee.modifiers||[];if(J){let ze=G.includes("meta")===$.metaKey,we=G.includes("ctrl")===$.ctrlKey,Ie=G.includes("alt")===$.altKey,Qt=G.includes("shift")===$.shiftKey;return ze&&we&&Ie&&Qt}return $.metaKey||$.ctrlKey})(w,e.keyboardShortcut)&&(w.preventDefault(),d==="launcher"?(s("card"),n(!0)):d==="card"&&(e.enableLauncher?s("launcher"):e.onDismiss?.()))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e.isVisible,t,d,e.enableLauncher,n,e.onDismiss]);let A=typeof navigator<"u"&&/Mac/.test(navigator.userAgent),ie=(()=>{if(e.keyboardShortcut){let g=e.keyboardShortcut.modifiers||[],w=[];return g.includes("meta")&&w.push(A?"\u2318":"Win"),g.includes("ctrl")&&w.push("Ctrl"),g.includes("alt")&&w.push(A?"Opt":"Alt"),g.includes("shift")&&w.push("Shift"),w.push(e.keyboardShortcut.key.toUpperCase()),w}return[A?"\u2318":"Ctrl","P"]})(),N=e.status==="starting",q=e.status==="success",oe=e.status==="error",Y=q&&f.current,B=e.textOverrides||{},Z=q?B.titleSuccess||"Personalization complete":N?"Starting personalization":oe?B.titleError||"Let's try that again":e.hasPersonalization?"Personalization ready":B.titleResting||"Personalization available",fe=q?B.subtitleSuccess||"Take a look":N?"Hang tight...":oe?B.subtitleError||"Something went wrong. Tap to retry.":B.subtitleResting||"This page can adapt to you",ce=N?B.btnLoading||"Starting...":oe?B.btnError||"Try again":q&&f.current?B.btnSuccess||"Personalised":E?"Show me again":B.btnResting||"Show me",Je=(g,w,T)=>{if(!T)return null;if(T.required&&!w.trim())return T.errorMessage||`${T.label} is required`;if(!w)return null;if(T.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(w))return T.errorMessage||"Please enter a valid email address";if(T.type==="url")try{new URL(w)}catch{return T.errorMessage||"Please enter a valid URL (e.g., https://example.com)"}return T.minLength&&w.length<T.minLength?T.errorMessage||`Must be at least ${T.minLength} characters`:T.maxLength&&w.length>T.maxLength?T.errorMessage||`Must be at most ${T.maxLength} characters`:T.pattern&&!new RegExp(T.pattern).test(w)?T.errorMessage||"Invalid format":null},qt=g=>{if(g.preventDefault(),N)return;let w=new FormData(g.target),T={},$={},J=!1;if(w.forEach((ee,G)=>{let Ne=ee.toString();T[G]=Ne;let ze=e.fields.find(Ie=>Ie.name===G),we=Je(G,Ne,ze);we&&($[G]=we,J=!0)}),J){j($);return}j({}),n(!1),e.onSubmitPersonalization?.(T)},Wt=g=>{let w=g.target,T=w.name;if(S[T]){let $=e.fields.find(ee=>ee.name===T),J=Je(T,w.value,$);j(ee=>{let G={...ee};return J?G[T]=J:delete G[T],G})}},Gt=g=>{g.stopPropagation(),!(N||q)&&n(!t)};X(()=>{if(!Q||K.current)return;if(!(e.isVisible&&d==="card"&&e.status==="resting"&&!t&&!U)){D.current!==null&&(cancelAnimationFrame(D.current),D.current=null),_.current=null;return}let w=T=>{_.current===null&&(_.current=T-ke.current/100*y);let $=T-_.current,J=Math.min(1,$/y),ee=J*100;if(v(ee),J>=1){K.current=!0,_.current=null,D.current=null,e.enableLauncher?(s("launcher"),n(!1)):e.onDismiss?.();return}D.current=requestAnimationFrame(w)};return D.current=requestAnimationFrame(w),()=>{D.current!==null&&(cancelAnimationFrame(D.current),D.current=null)}},[e.enableLauncher,e.isVisible,e.onDismiss,e.status,U,t,d,n,y,Q,v]),X(()=>()=>{D.current!==null&&cancelAnimationFrame(D.current)},[]);let Xt=Math.max(0,Math.min(100,e.progressPct??0)),Yt=Q?ye:Xt,Ze=!!e.isVisible&&d==="card"&&!m,et=!!e.isVisible&&d==="launcher"&&!m;return p(te,{children:[p("div",{ref:l,class:"backdrop",style:{display:Ze||et?"block":"none"}}),p("div",{ref:o,class:`container theme-${e.theme||"glass"} pos-${e.position||"top-center"}`,style:{...Ft(e.customTheme),pointerEvents:Ze?"auto":"none"},onClick:()=>!t&&!N&&!q&&n(!0),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),children:[p("button",{class:"btn-dismiss","aria-label":"Dismiss",onClick:g=>{g.stopPropagation(),K.current=!0,e.enableLauncher?s("launcher"):e.onDismiss?.()},children:p(zt,{})}),p("div",{class:"content-wrapper",children:[p("div",{class:"logo",children:p(It,{})}),p("div",{class:"text-content",children:p("div",{class:"text-row",children:[p("div",{children:[p("div",{class:"title",children:Z}),p("div",{class:"subtitle",children:fe})]}),p("button",{class:`btn btn-trigger ${Y?"success":""}`,disabled:N||Y,onClick:Gt,children:N?p(te,{children:[p(Xe,{})," ",ce]}):Y?p(te,{children:[p(Pr,{})," ",ce]}):ce})]})})]}),p("div",{class:"progress-clip",children:p("div",{class:"progress-container",children:p("div",{class:"progress-bar",style:{width:`${Yt}%`}})})}),p("div",{class:`popover ${t?"open":""}`,onClick:g=>g.stopPropagation(),children:[p("form",{onSubmit:qt,ref:c,children:[e.fields.map((g,w)=>p("div",{class:"form-group",children:[p("label",{class:`form-label ${S[g.name]?"error":""}`,children:g.label}),p("div",{class:"input-row",children:[p("input",{ref:w===0?u:void 0,class:`form-input ${S[g.name]?"error":""}`,name:g.name,type:g.type||"text",placeholder:g.placeholder,required:g.required,onInput:Wt}),e.fields.length===1&&p("button",{type:"submit",class:"btn btn-submit",disabled:N,children:N?p(Xe,{}):p(Nt,{})})]}),S[g.name]&&p("div",{class:"form-message",children:S[g.name]})]},g.name)),e.fields.length>1&&p("button",{type:"submit",class:"btn btn-submit",style:{width:"100%"},disabled:N,children:N?p(Xe,{}):p(Nt,{})})]}),e.showWatermark&&p("div",{class:"watermark",children:["Powered by"," ",p("a",{href:"https://kenobi.ai",target:"_blank",rel:"noopener noreferrer",children:"Kenobi"})]})]}),e.showKeyboardHints&&e.enableFocusMode&&p("div",{class:`kbd-hint ${!t&&!N&&!q?"visible":""}`,children:[p("div",{class:"kbd-group",children:p("div",{class:"kbd",children:"Esc"})}),p("span",{class:"kbd-text",children:"to dismiss"})]})]}),p("div",{ref:a,class:`launcher theme-${e.theme||"glass"} pos-${e.position||"top-center"}`,style:{...Ft(e.customTheme),pointerEvents:et?"auto":"none"},onClick:g=>{g.stopPropagation(),b(!1),s("card"),n(!0)},role:"button",tabIndex:0,children:[p("button",{class:"btn-dismiss launcher-dismiss","aria-label":"Dismiss",onClick:g=>{g.stopPropagation(),b(!0),e.onDismiss?.()},children:p(zt,{})}),p("div",{class:"launcher-logo",children:p(It,{})}),e.textOverrides?.launcherLabel||(E?"Personalize again":"Personalize"),e.enableUndoToggle&&E&&p("button",{class:"btn-toggle-personalization","aria-label":e.isPersonalized?"Show original":"Show personalized",onClick:g=>{g.stopPropagation(),e.onTogglePersonalization?.()},children:[p(Lr,{}),p("span",{class:"toggle-tooltip",children:e.isPersonalized?"Show original":"Show personalized"})]}),e.showKeyboardHints&&p("div",{class:"kbd-hint visible",children:p("div",{class:"kbd-group",children:ie.map((g,w)=>p("div",{class:"kbd",children:g},w))})})]})]})},_e=class{constructor(t){h(this,"host");h(this,"shadow");h(this,"config");h(this,"isOpen",!1);h(this,"skipFocus",!1);h(this,"mountTarget",null);this.config={position:"top-center",direction:"top-to-bottom",theme:"glass",entranceDelayMs:0,exitDelayMs:75,hasPersonalization:!1,isVisible:!1,progressPct:0,status:"resting",enableTimer:!0,timerDurationMs:2e4,enableLauncher:!0,enableFocusMode:!1,focusBlurIntensity:"10px",focusDelayMs:500,showKeyboardHints:!1,showWatermark:!0,mountMode:"overlay",...t},this.mountTarget=t.mountNode??null,this.host=document.createElement("div"),this.host.id="kenobi-cue-card-root",this.applyHostStyles(),this.shadow=this.host.attachShadow({mode:"open"});let r=document.createElement("style");r.textContent=Rr,this.shadow.appendChild(r);let n=document.createElement("div");this.shadow.appendChild(n)}applyHostStyles(){let t=this.config.mountMode==="inline";if(this.host.classList.toggle("kb-inline",t),t){this.host.style.cssText=`
250
+ `,en=(t,e,n)=>{let r=K(!1),i=K(null);Y(()=>{let o=t.current;if(!o)return;i.current&&(i.current.cancel(),i.current=null);let a=n.direction==="top-to-bottom",s=a?"translateY(-60px)":"translateX(60px)",u=a?"translateY(-20px)":"translateX(20px)",c="translate(0, 0)";if(e){o.style.visibility="visible",r.current=!0;let m=o.animate([{opacity:0,transform:s},{opacity:1,transform:c}],{duration:500,delay:n.entranceDelayMs,easing:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fill:"forwards"});i.current=m,m.onfinish=()=>{i.current=null,n.onEntranceComplete?.()}}else if(r.current){let m=o.animate([{opacity:1,transform:c},{opacity:0,transform:u}],{duration:350,delay:n.exitDelayMs,easing:"ease-in-out",fill:"forwards"});i.current=m,m.onfinish=()=>{o.style.visibility="hidden",i.current=null,n.onExitComplete?.()}}else o.style.opacity="0",o.style.transform=u,o.style.visibility="hidden"},[e,n.direction])},tn=t=>{if(!t)return{};let e={};return t.fontFamily&&(e["--kb-font-family"]=t.fontFamily),t.backgroundColor&&(e["--kb-bg-container"]=t.backgroundColor,e["--kb-popover-bg"]=t.backgroundColor),t.borderColor&&(e["--kb-border-container"]=t.borderColor,e["--kb-popover-border"]=t.borderColor),t.textColor&&(e["--kb-text-title"]=t.textColor,e["--kb-popover-text"]=t.textColor),t.subtitleColor&&(e["--kb-text-subtitle"]=t.subtitleColor),t.borderRadius&&(e["border-radius"]=t.borderRadius,e["border-bottom-left-radius"]=t.borderRadius,e["border-bottom-right-radius"]=t.borderRadius),t.primaryColor&&(e["--kb-btn-trigger-bg"]=t.primaryColor,e["--kb-progress-indicator"]=t.primaryColor,e["--kb-success-color"]=t.primaryColor),t.primaryTextColor&&(e["--kb-btn-trigger-text"]=t.primaryTextColor),e},hr=({config:t,isOpen:e,skipFocus:n,setIsOpen:r,deanonymizedCompany:i,onClearDeanonymizedCompany:o})=>{let a=t.mountMode==="inline",s=K(null),u=K(null),c=K(null),m=K(null),l=K(null),[d,h]=ie("card"),[E,M]=ie(!1),[T,g]=ie(!1),[x,P]=ie(!1),O=K(!1),D=K(!1),v=K(!1),V=K("card"),J=K(t.status),j=K(!!t.isVisible),H=K(null),C=K(null),B=K(!1),[ge,ue]=ie(!1),[He,pe]=ie(!1),[y,k]=ie({}),[L,S]=ie(0),z=K(0),G=t.enableTimer!==!1,Z=Math.max(500,t.timerDurationMs??2e4),F=t.status==="starting",te=t.status==="success",ne=t.status==="error",ee=!!i,q=!ee,$=q?e:!1,ae=i?.name||i?.domain||"",Ce=i?.domain,fe=Wt(b=>{z.current=b,S(b)},[]);Y(()=>{t.isVisible&&(h("card"),O.current=!1,M(!1))},[t.isVisible]),d==="card"&&V.current==="launcher"&&(D.current=!1),t.status==="success"&&J.current!=="success"?d==="card"&&(D.current=!0):t.status!=="success"&&(D.current=!1),J.current=t.status,Y(()=>{let b=V.current==="launcher",_=d==="card";b&&_&&T&&(v.current=!0,setTimeout(()=>{v.current=!1},100)),d==="launcher"&&ue(!1),b&&_&&G&&(fe(0),H.current=null,B.current=!1)},[d,fe,G]),Y(()=>{if(t.status==="success"&&(g(!0),t.enableLauncher&&d==="card"&&D.current)){let b=setTimeout(()=>{h("launcher")},2e3);return()=>clearTimeout(b)}},[t.status,t.enableLauncher,d]),Y(()=>{t.isVisible&&!j.current&&G&&(fe(0),H.current=null,B.current=!1),j.current=!!t.isVisible},[t.isVisible,fe,G]),Y(()=>{V.current=d},[d]);let Fe=K(!1);n&&(Fe.current=!0),Y(()=>{if($){T&&l.current&&l.current.reset();let b=Fe.current;if(Fe.current=!1,!b){let _=setTimeout(()=>{m.current&&m.current.focus()},100);return()=>clearTimeout(_)}}},[$]);let at=K($);Y(()=>{let b=at.current;at.current=$,!b&&$&&d==="launcher"&&h("card")},[$,d]);let dn=!O.current,pn=V.current==="launcher",fn=dn?t.entranceDelayMs||0:pn&&d==="card"?400:0;a||(en(s,!!t.isVisible&&d==="card"&&!E,{direction:t.direction||"top-to-bottom",position:t.position||"top-center",entranceDelayMs:fn,exitDelayMs:75,onEntranceComplete:()=>{t.onEntranceComplete?.(),O.current=!0},onExitComplete:()=>{(!t.isVisible||E)&&t.onExitComplete?.()}}),en(u,!!t.isVisible&&d==="launcher"&&!E,{direction:t.direction||"top-to-bottom",position:t.position||"top-center",entranceDelayMs:400,exitDelayMs:75})),Y(()=>{let b=c.current;if(!b)return;let _=t.status==="success"&&D.current;if(t.enableFocusMode&&d==="card"&&t.isVisible&&!_){let w=setTimeout(()=>{b.classList.add("active")},t.focusDelayMs||500);return()=>clearTimeout(w)}else b.classList.remove("active")},[t.enableFocusMode,d,t.isVisible,t.focusDelayMs,t.status]),Y(()=>{if(!t.isVisible)return;let b=_=>{if(_.key==="Escape"){d==="card"&&(t.enableLauncher?(P(!0),h("launcher"),setTimeout(()=>{r(!1),P(!1)},500)):(r(!1),t.onDismiss?.()));return}((R,I)=>{let X=I||{key:"p",modifiers:["meta","ctrl"]};if(R.key.toLowerCase()!==X.key.toLowerCase())return!1;let re=X.modifiers||[];if(I){let Sn=re.includes("meta")===R.metaKey,En=re.includes("ctrl")===R.ctrlKey,zn=re.includes("alt")===R.altKey,Pn=re.includes("shift")===R.shiftKey;return Sn&&En&&zn&&Pn}return R.metaKey||R.ctrlKey})(_,t.keyboardShortcut)&&(_.preventDefault(),d==="launcher"?(h("card"),r(q)):d==="card"&&(t.enableLauncher?h("launcher"):t.onDismiss?.()))};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[t.isVisible,$,d,t.enableLauncher,r,t.onDismiss,q]);let Ue=typeof navigator<"u"&&/Mac/.test(navigator.userAgent),mn=(()=>{if(t.keyboardShortcut){let b=t.keyboardShortcut.modifiers||[],_=[];return b.includes("meta")&&_.push(Ue?"\u2318":"Win"),b.includes("ctrl")&&_.push("Ctrl"),b.includes("alt")&&_.push(Ue?"Opt":"Alt"),b.includes("shift")&&_.push("Shift"),_.push(t.keyboardShortcut.key.toUpperCase()),_}return[Ue?"\u2318":"Ctrl","P"]})(),[hn,st]=ie(!1),[lt,ct]=ie("primary");Y(()=>{st(!1),ct("primary")},[i?.logoUrl,ae,Ce]),Y(()=>{!q&&e&&r(!1)},[q,e,r]);let ut=t.deanonymization?.logoUrlTemplate,Te=Zt(Ce),me=Te?`https://logo.clearbit.com/${Te}`:void 0,Ke=Te&&ut?ut.replace("{domain}",Te):i?.logoUrl||me,dt=lt==="fallback"&&me&&me!==Ke?me:Ke,$e=te&&D.current,W=t.textOverrides||{},bn=te?W.titleSuccess||"Personalization complete":F?"Starting personalization":ne?W.titleError||"Let's try that again":t.hasPersonalization?"Personalization ready":W.titleResting||"Personalization available",gn=te?W.subtitleSuccess||"Take a look":F?"Hang tight...":ne?W.subtitleError||"Something went wrong. Tap to retry.":W.subtitleResting||"This page can adapt to you",Ve=F?W.btnLoading||"Starting...":ne?W.btnError||"Try again":te&&D.current?W.btnSuccess||"Personalised":T?"Show me again":W.btnResting||"Show me",yn=ee?T?W.launcherLabelDeanonymizedSuccess||W.launcherLabelDeanonymized||"See it again for":W.launcherLabelDeanonymized||"See it in action for":T?W.launcherLabelSuccess||W.launcherLabel||"Personalize again":W.launcherLabel||"Personalize",pt=b=>{if(!i||!ae)return null;let _=b==="launcher",w=ae.trim().slice(0,1).toUpperCase();return p("div",{class:`kb-chip ${_?"kb-chip--launcher":""}`,children:[!!dt&&!hn?p("span",{class:"kb-chip-logo",children:p("img",{src:dt,alt:"",referrerPolicy:"no-referrer",onError:()=>{if(lt==="primary"&&me&&me!==Ke){ct("fallback");return}st(!0)}})}):p("span",{class:"kb-chip-fallback",children:w}),p("span",{children:ae}),o&&p("button",{class:"kb-chip-action",type:"button",onClick:I=>{I.stopPropagation(),o(),r(!0)},children:"Not you?"})]})},_n=()=>{let b=Zt(Ce),_=(b||Ce||ae||"").toString(),w={};return t.fields.forEach(R=>{let I=R.name,X=I.toLowerCase();if(X.includes("domain")){w[I]=b||_;return}if(X.includes("company")){w[I]=ae;return}w[I]=_}),w},ft=b=>{let _={},w=!1;if(t.fields.forEach(R=>{let I=b[R.name]??"",X=typeof I=="string"?I:String(I),re=mt(R.name,X,R);re&&(_[R.name]=re,w=!0)}),w){k(_);return}k({}),r(!1),t.onSubmitPersonalization?.(b)},mt=(b,_,w)=>{if(!w)return null;if(w.required&&!_.trim())return w.errorMessage||`${w.label} is required`;if(!_)return null;if(w.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(_))return w.errorMessage||"Please enter a valid email address";if(w.type==="url")try{new URL(_)}catch{return w.errorMessage||"Please enter a valid URL (e.g., https://example.com)"}return w.minLength&&_.length<w.minLength?w.errorMessage||`Must be at least ${w.minLength} characters`:w.maxLength&&_.length>w.maxLength?w.errorMessage||`Must be at most ${w.maxLength} characters`:w.pattern&&!new RegExp(w.pattern).test(_)?w.errorMessage||"Invalid format":null},vn=b=>{if(b.preventDefault(),F)return;let _=new FormData(b.target),w={};_.forEach((R,I)=>{let X=R.toString();w[I]=X}),ft(w)},kn=b=>{let _=b.target,w=_.name;if(y[w]){let R=t.fields.find(X=>X.name===w),I=mt(w,_.value,R);k(X=>{let re={...X};return I?re[w]=I:delete re[w],re})}},wn=()=>{F||!ee||ft(_n())},xn=b=>{if(b.stopPropagation(),ee||F||te)return;let _=!$;r(_),_&&t.enableClickSheen&&(pe(!0),setTimeout(()=>pe(!1),600))};Y(()=>{if(!G||B.current)return;if(!(t.isVisible&&d==="card"&&t.status==="resting"&&!$&&!ge)){C.current!==null&&(cancelAnimationFrame(C.current),C.current=null),H.current=null;return}let _=w=>{H.current===null&&(H.current=w-z.current/100*Z);let R=w-H.current,I=Math.min(1,R/Z),X=I*100;if(fe(X),I>=1){B.current=!0,H.current=null,C.current=null,t.enableLauncher?(h("launcher"),r(!1)):t.onDismiss?.();return}C.current=requestAnimationFrame(_)};return C.current=requestAnimationFrame(_),()=>{C.current!==null&&(cancelAnimationFrame(C.current),C.current=null)}},[t.enableLauncher,t.isVisible,t.onDismiss,t.status,ge,$,d,r,Z,G,fe]),Y(()=>()=>{C.current!==null&&cancelAnimationFrame(C.current)},[]);let Cn=Math.max(0,Math.min(100,t.progressPct??0)),Tn=G?L:Cn,ht=!!t.isVisible&&d==="card"&&!E,bt=!!t.isVisible&&d==="launcher"&&!E;return p(le,{children:[p("div",{ref:c,class:"backdrop",style:{display:ht||bt?"block":"none"}}),p("div",{ref:s,class:`container theme-${t.theme||"glass"} pos-${t.position||"top-center"}${$?" popover-open":""}`,style:{...tn(t.customTheme),pointerEvents:ht?"auto":"none"},onClick:()=>!$&&!F&&!te&&q&&r(!0),onMouseEnter:()=>ue(!0),onMouseLeave:()=>ue(!1),children:[t.enableClickSheen&&p("div",{class:`container-sheen${He?" active":""}`}),p("button",{class:"btn-dismiss","aria-label":"Dismiss",onClick:b=>{b.stopPropagation(),B.current=!0,t.enableLauncher?h("launcher"):t.onDismiss?.()},children:p(Qt,{})}),p("div",{class:"content-wrapper",children:p("div",{class:"text-content",children:p("div",{class:"text-row",children:[p("div",{children:[p("div",{class:"title",children:bn}),ee?p("div",{class:"subtitle-chip",children:pt("card")}):p("div",{class:"subtitle-text",children:gn})]}),F?p("span",{class:"status-text",children:[p(nt,{})," ",Ve]}):p("button",{class:`btn btn-trigger ${$e?"success":""}${$||x?" hidden":""}`,disabled:$e,onClick:ee?wn:xn,children:$e?p(le,{children:[p(lr,{})," ",Ve]}):Ve})]})})}),p("div",{class:"progress-clip",children:p("div",{class:"progress-container",children:p("div",{class:"progress-bar",style:{width:`${Tn}%`}})})}),!ee&&p("div",{class:`popover ${$?"open":""}`,onClick:b=>b.stopPropagation(),children:[p("form",{onSubmit:vn,ref:l,children:[t.fields.map((b,_)=>p("div",{class:"form-group",children:[p("label",{class:`form-label ${y[b.name]?"error":""}`,children:b.label}),p("div",{class:"input-row",children:[p("input",{ref:_===0?m:void 0,class:`form-input ${y[b.name]?"error":""}`,name:b.name,type:b.type||"text",placeholder:b.placeholder,required:b.required,onInput:kn}),t.fields.length===1&&p("button",{type:"submit",class:"btn btn-submit",disabled:F,children:F?p(nt,{}):p(Gt,{})})]}),y[b.name]&&p("div",{class:"form-message",children:y[b.name]})]},b.name)),t.fields.length>1&&p("button",{type:"submit",class:"btn btn-submit",style:{width:"100%"},disabled:F,children:F?p(nt,{}):p(Gt,{})})]}),t.showWatermark&&p("div",{class:"popover-watermark",children:["Powered by"," ",p("a",{href:"https://kenobi.ai",target:"_blank",rel:"noopener noreferrer",children:"Kenobi"})]})]}),t.showKeyboardHints&&t.enableFocusMode&&p("div",{class:`kbd-hint ${!$&&!F&&!te?"visible":""}`,children:[p("div",{class:"kbd-group",children:p("div",{class:"kbd",children:"Esc"})}),p("span",{class:"kbd-text",children:"to dismiss"})]})]}),p("div",{ref:u,class:`launcher theme-${t.theme||"glass"} pos-${t.position||"top-center"}`,style:{...tn(t.customTheme),...t.launcherStyles,pointerEvents:bt?"auto":"none"},onClick:b=>{b.stopPropagation(),M(!1),h("card"),r(q)},role:"button",tabIndex:0,children:[t.launcherShineBorder?.enabled&&p("div",{class:"launcher-shine-border",style:{"--shine-duration":`${t.launcherShineBorder.duration||14}s`,"--shine-border-width":`${t.launcherShineBorder.borderWidth||1}px`,backgroundImage:`radial-gradient(transparent, transparent, ${Array.isArray(t.launcherShineBorder.color)?t.launcherShineBorder.color.join(","):t.launcherShineBorder.color||"rgba(255,255,255,0.5)"}, transparent, transparent)`}}),p("button",{class:"btn-dismiss launcher-dismiss","aria-label":"Dismiss",onClick:b=>{b.stopPropagation(),M(!0),t.onDismiss?.()},children:p(Qt,{})}),t.showLauncherLogo!==!1&&p("div",{class:"launcher-logo",children:p(cr,{})}),p("div",{class:"launcher-label",children:[p("span",{children:yn}),ee&&pt("launcher")]}),t.enableUndoToggle&&T&&p("button",{class:"btn-toggle-personalization","aria-label":t.isPersonalized?"Show original":"Show personalized",onClick:b=>{b.stopPropagation(),t.onTogglePersonalization?.()},children:[p(ur,{}),p("span",{class:"toggle-tooltip",children:t.isPersonalized?"Show original":"Show personalized"})]}),t.showKeyboardHints&&p("div",{class:"kbd-hint visible",children:p("div",{class:"kbd-group",children:mn.map((b,_)=>p("div",{class:"kbd",children:b},_))})})]})]})},we=class{constructor(e){f(this,"host");f(this,"shadow");f(this,"config");f(this,"isOpen",!1);f(this,"skipFocus",!1);f(this,"mountTarget",null);f(this,"deanonymizedCompany",null);f(this,"deanonymizationStatus","idle");f(this,"deanonymizationCleanup",null);f(this,"hasStartedDeanonymization",!1);f(this,"clearDeanonymizedCompany",()=>{let e=this.deanonymizedCompany,n=this.config.status==="success"||this.config.isPersonalized;this.config.isPersonalized&&this.config.onTogglePersonalization?.(),this.deanonymizedCompany=null,this.deanonymizationStatus="failed",e&&rt("deanonymization:not-you",{company:e}),n&&(this.config={...this.config,status:"resting",progressPct:0,isPersonalized:!1}),this.render()});this.config={position:"top-center",direction:"top-to-bottom",theme:"glass",entranceDelayMs:0,exitDelayMs:75,hasPersonalization:!1,isVisible:!1,progressPct:0,status:"resting",enableTimer:!0,timerDurationMs:2e4,enableLauncher:!0,enableFocusMode:!1,focusBlurIntensity:"10px",focusDelayMs:500,showKeyboardHints:!1,showWatermark:!0,mountMode:"overlay",...e},this.mountTarget=e.mountNode??null,this.isDeanonymizationEnabled()&&(this.deanonymizationStatus="pending"),this.host=document.createElement("div"),this.host.id="kenobi-cue-card-root",this.applyHostStyles(),this.shadow=this.host.attachShadow({mode:"open"});let n=document.createElement("style");n.textContent=mr,this.shadow.appendChild(n);let r=document.createElement("div");this.shadow.appendChild(r)}applyHostStyles(){let e=this.config.mountMode==="inline";this.host.classList.toggle("kb-inline",e);let n=this.config.focusBlurIntensity??"10px";if(e){this.host.style.cssText=`
90
251
  position: relative !important;
91
252
  z-index: auto !important;
92
253
  top: auto !important;
@@ -96,6 +257,7 @@
96
257
  pointer-events: auto !important;
97
258
  isolation: auto !important;
98
259
  display: block !important;
260
+ --kb-focus-blur: ${n};
99
261
  `;return}this.host.style.cssText=`
100
262
  position: fixed !important;
101
263
  z-index: 2147483647 !important;
@@ -105,5 +267,6 @@
105
267
  height: 0 !important;
106
268
  pointer-events: none !important;
107
269
  isolation: isolate !important;
108
- `}mount(t){let r=t||this.config.mountNode||this.mountTarget||document.body;this.mountTarget=r,r.contains(this.host)||r.appendChild(this.host),this.applyHostStyles(),this.render()}unmount(){Be(null,this.shadow.lastElementChild),this.host.remove()}update(t){t.status==="starting"&&this.config.status!=="starting"&&(this.isOpen=!1),this.config={...this.config,...t},this.applyHostStyles(),this.render()}setTheme(t){this.update({theme:t})}openForm(t){this.isOpen=!0,this.skipFocus=t??!1,this.render()}render(){let t=this.shadow.lastElementChild,r=this.skipFocus;this.skipFocus=!1,Be(p(Dr,{config:this.config,isOpen:this.isOpen,skipFocus:r,setIsOpen:n=>{this.isOpen=n,this.config.onOpenChange?.(n),this.render()}}),t)}};var Ot="kfor",Ut="kenobi_visitor_key",re="data-kenobi-transformation-identifier",de={enabled:!1,durationMs:300,delayMs:0,easing:"ease",animateSize:!0,overflow:"hidden"},Nr=e=>({enabled:e?.enabled??de.enabled,durationMs:e?.durationMs??de.durationMs,delayMs:e?.delayMs??de.delayMs,easing:e?.easing??de.easing,animateSize:e?.animateSize??de.animateSize,overflow:e?.overflow??de.overflow,textAnimation:e?.textAnimation,enter:e?.enter,exit:e?.exit}),zr=(e,t)=>({enabled:t?.enabled??e.enabled,durationMs:t?.durationMs??e.durationMs,delayMs:t?.delayMs??e.delayMs,easing:t?.easing??e.easing,animateSize:t?.animateSize??e.animateSize,overflow:t?.overflow??e.overflow,textAnimation:t?.textAnimation??e.textAnimation,enter:t?.enter??e.enter,exit:t?.exit??e.exit}),Vt=e=>typeof e=="string",ve=e=>e instanceof HTMLElement||typeof SVGElement<"u"&&e instanceof SVGElement,Ir=e=>typeof e=="string",Hr=e=>e==="hidden"||e==="visible"||e==="clip",Fr=e=>e==="line"||e==="word"||e==="character",$t=e=>typeof e!="object"||e===null?!1:Array.isArray(e)?e.every(t=>typeof t=="object"&&t!==null):!0,Kt=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{animationName:r,keyframes:n,durationMs:i,delayMs:o}=t;return(r===void 0||Vt(r))&&(n===void 0||$t(n))&&(i===void 0||typeof i=="number")&&(o===void 0||typeof o=="number")},Or=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{by:r,staggerMs:n,animationName:i,keyframes:o,delayMs:a,durationMs:l}=t;return Fr(r)&&(a===void 0||typeof a=="number")&&(n===void 0||typeof n=="number")&&(l===void 0||typeof l=="number")&&(Vt(i)||o!==void 0)&&(o===void 0||$t(o))},Ur=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{enabled:r,durationMs:n,delayMs:i,easing:o,animateSize:a,overflow:l,textAnimation:u,enter:c,exit:d}=t;return(r===void 0||typeof r=="boolean")&&(n===void 0||typeof n=="number")&&(i===void 0||typeof i=="number")&&(o===void 0||Ir(o))&&(a===void 0||typeof a=="boolean")&&(l===void 0||Hr(l))&&(u===void 0||Or(u))&&(c===void 0||Kt(c))&&(d===void 0||Kt(d))},Ye=class{constructor(){h(this,"replaceWithTransition",async(t,r,n)=>{let i=document.createElement("div");i.style.position="relative",i.style.overflow=n.overflow;let o=t.getBoundingClientRect(),a=window.getComputedStyle(t);i.style.display=a.display,i.style.verticalAlign=a.verticalAlign,i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.style.margin=a.margin;let l=t.cloneNode(!0);if(!(l instanceof Element)||!ve(l))throw new Error("oldElClone is not an AnimatableElement");l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.width="100%",l.style.height="100%",l.style.margin="0",l.style.pointerEvents="none",i.appendChild(l);let u=document.createElement("div");u.innerHTML=r;let c=u.firstElementChild;if(!c||!(c instanceof HTMLElement||c instanceof SVGElement))return await this.exit(t,n).finished,t;let d=c.style.cssText,s=t.parentNode,m;if(s instanceof HTMLElement){let _=s.cloneNode(!1),D=window.getComputedStyle(s),K=D.cssText?D.cssText:Array.from(D).reduce((U,V)=>`${U}${V}:${D.getPropertyValue(V)};`,"");_.style.cssText=K,_.style.position="absolute",_.style.top="-9999px",_.style.left="-9999px",_.style.visibility="hidden",_.style.pointerEvents="none",_.appendChild(c),document.body.appendChild(_),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),m=c.getBoundingClientRect(),document.body.removeChild(_)}else{let _=document.createElement("div");_.style.position="absolute",_.style.top="-9999px",_.style.left="-9999px",_.style.visibility="hidden",_.appendChild(c),document.body.appendChild(_),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),m=c.getBoundingClientRect(),document.body.removeChild(_)}c.style.cssText=d,c.style.visibility="",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width=`${m.width}px`,c.style.height=`${m.height}px`,c.style.margin="0",c.style.opacity="0",i.appendChild(c),t.replaceWith(i);let b=n.exit?.delayMs??n.delayMs,E=n.exit?.durationMs??n.durationMs,L=n.enter?.delayMs??n.delayMs,C=n.enter?.durationMs??n.durationMs,f=[],k=this.resolveKeyframes(n.exit?.keyframes),M=l.animate(k,{duration:E,delay:b,easing:n.easing,fill:"forwards"});f.push(M);let F=this.resolveKeyframes(n.enter?.keyframes),I=c.animate(F,{duration:C,delay:L,easing:n.easing,fill:"forwards"});if(f.push(I),n.animateSize){let _=i.animate([{width:`${o.width}px`,height:`${o.height}px`},{width:`${m.width}px`,height:`${m.height}px`}],{duration:C,delay:L,easing:n.easing,fill:"forwards"});f.push(_)}return await Promise.all(f.map(_=>_.finished)),i.parentNode&&i.replaceWith(c),c.style.cssText=d,l.remove(),c});h(this,"enter",(t,r)=>{let n=r.enter?.delayMs??r.delayMs,i=r.enter?.durationMs??r.durationMs,o=this.resolveKeyframes(r.enter?.keyframes);return t.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});h(this,"exit",(t,r)=>{let n=r.exit?.delayMs??r.delayMs,i=r.exit?.durationMs??r.durationMs,o=this.resolveKeyframes(r.exit?.keyframes);return t.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});h(this,"resolveKeyframes",t=>t?Array.isArray(t)?t:[t]:[]);h(this,"applyTextAnimationToNode",(t,r,n)=>{let i=r.delayMs??0,o=window.getComputedStyle(t),a=o.getPropertyValue("background-clip")==="text"||o.getPropertyValue("-webkit-background-clip")==="text",l=(u,c,d)=>{if(u.nodeType===Node.TEXT_NODE){let s=u.textContent??"";if(s.trim().length===0)return c;if(r.by==="character"){let L=s.split(/(\s+)/),C=document.createDocumentFragment(),f=c;return L.forEach(k=>{if(k.length===0)return;if(k.trim().length===0){C.appendChild(document.createTextNode(k));return}let M=document.createElement("span");M.style.display="inline-block",M.style.whiteSpace="nowrap",d&&(M.style.setProperty("background","inherit"),M.style.setProperty("-webkit-background-clip","text"),M.style.setProperty("background-clip","text"),M.style.setProperty("color","transparent")),k.split("").forEach(I=>{let _=document.createElement("span");_.textContent=I,_.style.display="inline-block",_.style.opacity="0",d&&(_.style.setProperty("background","inherit"),_.style.setProperty("-webkit-background-clip","text"),_.style.setProperty("background-clip","text"),_.style.setProperty("color","transparent"),_.style.paddingBottom="0.1em",_.style.marginBottom="-0.1em");let D=this.resolveKeyframes(r.keyframes),K=r.durationMs??n.durationMs??300,U=n.easing??"ease",V=_.animate(D,{duration:K,easing:U,delay:f,fill:"forwards"});V.addEventListener("finish",()=>{V.commitStyles(),V.cancel()}),M.appendChild(_),f+=r.staggerMs??50}),C.appendChild(M)}),u.parentNode?.replaceChild(C,u),f}let m;switch(r.by){case"word":m=s.split(/(\s+)/);break;case"line":m=s.split(`
109
- `);break;default:m=s.split("")}let b=document.createDocumentFragment(),E=c;return m.forEach(L=>{if(L.length===0)return;if(L.trim().length===0){b.appendChild(document.createTextNode(L));return}let f=document.createElement("span");f.textContent=L,f.style.display="inline-block",f.style.opacity="0",d&&(f.style.setProperty("background","inherit"),f.style.setProperty("-webkit-background-clip","text"),f.style.setProperty("background-clip","text"),f.style.setProperty("color","transparent"),f.style.setProperty("will-change","opacity, transform"));let k=this.resolveKeyframes(r.keyframes),M=r.durationMs??n.durationMs??300,F=n.easing??"ease",I=f.animate(k,{duration:M,easing:F,delay:E,fill:"forwards"});I.addEventListener("finish",()=>{I.commitStyles(),I.cancel()}),b.appendChild(f),E+=r.staggerMs??50}),u.parentNode?.replaceChild(b,u),E}if(u.nodeType===Node.ELEMENT_NODE){let s=c,m=Array.from(u.childNodes);for(let b of m)s=l(b,s,d);return s}return c};l(t,i,a)})}},Kr=e=>typeof e!="object"||e===null?!1:typeof e.enabled=="boolean",jt=new Set(["Replace","InsertBefore","InsertAfter","Delete","SetFormField"]),Bt=e=>typeof e=="string",Vr=e=>Array.isArray(e)&&e.every(t=>Bt(t)),$r=e=>typeof e=="string"&&jt.has(e),jr=e=>{if(typeof e!="object"||e===null)return!1;let t=e;return Bt(t.identifier)&&typeof t.markup=="string"&&Vr(t.selectorGuesses)&&$r(t.action)&&(t.transition===void 0||Ur(t.transition))},Br=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid response: expected object with data array");let t=e.data;if(!Array.isArray(t))throw new Error("Invalid response: data must be an array");return t.forEach((r,n)=>{if(!jr(r))throw new Error(`Invalid transformation at index ${n}`)}),t},Qe=class{constructor(t){h(this,"config");h(this,"changeStack",new Map);h(this,"visitorKey",null);h(this,"orchestrator");h(this,"cueCardInstance",null);h(this,"currentPath");h(this,"currentUrl");h(this,"navTicking",!1);h(this,"transitionDefaults");h(this,"lastAppliedTransformations",[]);h(this,"isPersonalized",!1);h(this,"startAutoTransform",async()=>{try{this.syncChangeStack(),await this.waitForLoaded(),this.isFramer()&&(await this.waitForFrames(),await this.waitForIdle(),await this.waitForQuietDom(100,1e3)),await this.transform()}catch(t){this.log("error","Auto-transformation flow failed with error:",t)}});h(this,"transform",async()=>{try{let t=new Date;if(this.log("debug","Starting transform"),this.visitorKey===null){this.log("debug",`Couldn't find a visitor copy external ID with query param key "${Ot}"`,"Exiting...");return}let r=[];try{r=await this.getTransformations(this.currentPath,this.visitorKey)}catch(o){this.log("error_detailed","An error occurred _getting_ transformations",o)}try{await this.applyTransformations(r)}catch(o){this.log("error_detailed","An error occurred _applying_ transformations",o)}let n=new Date,i=this.getDurationInMilliseconds(t,n);this.log("debug",`Transformation complete, took ${this.formatThousands(i)} ms`)}catch(t){this.log("error","An unexpected, top-level error occurred during transformation",t)}});h(this,"log",(t,r,...n)=>{let a=`${`[Kenobi \u25D4] (v${typeof window.__KENOBI_VERSION__<"u"?window.__KENOBI_VERSION__:"dev"})`} [${t.toLocaleUpperCase()}] :: ${r}`;switch(t){case"debug":this.config.debug&&console.log(a,...n);break;case"info":console.log(a,...n);break;case"warn":console.warn(a,...n);break;case"error_detailed":console.trace(...n);case"error":console.error(a,...n);break}});h(this,"resolveTransitionConfig",t=>zr(this.transitionDefaults,t));h(this,"retrieveElement",t=>{if(!Array.isArray(t)||t.some(r=>typeof r!="string"))throw new Error(`Invalid selectorGuesses payload received: expected array of strings but got ${JSON.stringify(t)}`);for(let r of t){let n=document.querySelectorAll(r);if(n.length===0)continue;if(n.length===1)return n[0];let i=Array.from(n).filter(a=>{let l=a.getBoundingClientRect(),u=getComputedStyle(a);return u.display!=="none"&&u.visibility!=="hidden"&&l.width>0&&l.height>0});if(i.length===0)continue;let o=i.sort((a,l)=>a.getBoundingClientRect().top-l.getBoundingClientRect().top);return this.log("debug",`Selector "${r}" matched ${n.length} elements, selected topmost visible one at y=${o[0].getBoundingClientRect().top}`),o[0]}throw new Error(`Could not find an element in the document with any of these selector patterns: ${t.join(", ")}`)});h(this,"getQueryParam",t=>new URLSearchParams(window.location.search).get(t));h(this,"getCurrentPath",()=>window.location.pathname);h(this,"getCurrentUrl",()=>window.location.pathname+window.location.search+window.location.hash);h(this,"getDurationInMilliseconds",(t,r)=>+r-+t);h(this,"formatThousands",t=>new Intl.NumberFormat("en-US").format(t));h(this,"setDebug",t=>this.config.debug=t);h(this,"isInputElement",t=>!(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLSelectElement)));h(this,"waitForFrames",()=>new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t))));h(this,"waitForIdle",(t=1e3)=>new Promise(r=>"requestIdleCallback"in window?window.requestIdleCallback(()=>r(),{timeout:t}):setTimeout(r,50)));h(this,"waitForLoaded",()=>document.readyState==="complete"?Promise.resolve():new Promise(t=>window.addEventListener("load",()=>t(),{once:!0})));h(this,"waitForQuietDom",(t,r)=>new Promise(n=>{let i=performance.now(),o=new MutationObserver(()=>{i=performance.now()});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let a=performance.now()+t;(function l(){let u=performance.now();if(u-i>=r){o.disconnect(),n();return}if(u>=a){o.disconnect(),n();return}requestAnimationFrame(l)})()}));h(this,"isFramer",()=>{let t=Array.from(document.scripts).map(n=>n.src||"");return["__framer_events"in window,document.querySelector("[data-framer-root],[data-framer-component],[data-framer-page]"),t.some(n=>/framerusercontent\.com\/sites/i.test(n))].some(n=>!!n)});h(this,"syncVisitorKey",()=>{try{let t=this.getQueryParam(Ot);t?(this.log("debug",`Query param value found (${t}), pushing into session storage`),sessionStorage.setItem(Ut,t),this.visitorKey=t):this.visitorKey=sessionStorage.getItem(Ut)}catch(t){this.log("error","Failed to sync visitor key with error:",t)}});h(this,"initNavigationListener",()=>{if("__KENOBI_NAV_HOOKED__"in window)return;window.__KENOBI_NAV_HOOKED__=!0;let t=i=>{this.navTicking||(this.navTicking=!0,queueMicrotask(()=>{this.navTicking=!1;let o=this.getCurrentUrl();o!==this.currentUrl&&(this.currentUrl=o,this.currentPath=this.getCurrentPath(),this.log("debug",`URL changed (${i}) \u2192 ${location.href}`),this.config.autoTransform&&(this.undoAll(),this.startAutoTransform()),this.syncCueCardVisibility())}))};if("navigation"in window){let i=window.navigation;i&&"addEventListener"in i&&typeof i.addEventListener=="function"&&(i.addEventListener("navigate",()=>t("navigation:navigate")),i.addEventListener("currententrychange",()=>t("navigation:entrychange")),i.addEventListener?.("navigatesuccess",()=>t("navigation:success")))}let r=history.pushState.bind(history),n=history.replaceState.bind(history);history.pushState=((...i)=>{let o=r(...i);return t("pushState"),o}),history.replaceState=((...i)=>{let o=n(...i);return t("replaceState"),o}),window.addEventListener("popstate",()=>t("popstate")),window.addEventListener("hashchange",()=>t("hashchange")),document.addEventListener("click",i=>{let o=i.target,a=o&&o.closest?.("a[href]");!a||a.target&&a.target!=="_self"||new URL(a.href,location.href).origin!==location.origin||setTimeout(()=>t("click"),0)},!0),setInterval(()=>{this.getCurrentUrl()!==this.currentUrl&&t("poll")},1e3)});h(this,"getTransformations",async(t,r)=>{let n=new URLSearchParams({path:t}),i=await fetch(`${this.config.apiHost}/v1/visitor-copy-transformations/${r}?${n.toString()}`),o=await i.json();if(!i.ok)throw new Error(`Network error (status ${i.status}) with json body: ${JSON.stringify(o,null,2)}`);return Br(o)});h(this,"validateTransitionPreconditions",(t,r,n)=>{if(n.enabled){let i=document.createElement("div");i.innerHTML=r;let o=i.firstElementChild;if(!o||!ve(o))return this.log("warn",`Transformation "${t}" was skipped: A transition was requested, but the element is not animatable.`),!1}return!0});h(this,"applyTransformations",async(t,r)=>{this.log("debug",`Starting ${t.length} transformations`),r?.shouldConsolidate&&this.changeStack.forEach((n,i)=>{t.find(a=>a.identifier===i)&&this.undo(i)});for(let{identifier:n,...i}of t)try{if(this.changeStack.get(n))throw new Error("Transformation already exists in stack");let o=this.retrieveElement(i.selectorGuesses);switch(i.action){case"Replace":{let a=o.outerHTML,l=this.resolveTransitionConfig(i.transition);if(l.enabled&&ve(o)&&"animate"in o){let u=await this.orchestrator.replaceWithTransition(o,i.markup,l);this.setOrUpdateReplaceChangeRef(n,a,u)}else Se(o,i.markup,{}),this.setOrUpdateReplaceChangeRef(n,a,o);o.nodeName==="VIDEO"&&o.play();break}case"InsertBefore":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(n,i.markup,a))break;o.insertAdjacentHTML("beforebegin",i.markup);let l=o.previousElementSibling;if(l===null)throw new Error("Element wasn't created");if(l.setAttribute(re,n),a.enabled&&ve(l)){let u=l.style.cssText;l.style.opacity="0",this.orchestrator.enter(l,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{l.style.cssText=u},{once:!0})}this.changeStack.set(n,{undoOpts:{type:"Remove",ref:l}});break}case"InsertAfter":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(n,i.markup,a))break;o.insertAdjacentHTML("afterend",i.markup);let l=o.nextElementSibling;if(l===null)throw new Error("Element wasn't created");if(l.setAttribute(re,n),a.enabled&&ve(l)){let u=l.style.cssText;l.style.opacity="0",this.orchestrator.enter(l,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{l.style.cssText=u},{once:!0})}this.changeStack.set(n,{undoOpts:{type:"Remove",ref:l}});break}case"Delete":{let a=o.outerHTML;Se(o,'<div style="display: none;" data-kenobi-delete-marker="true"></div>',{}),o.setAttribute(re,n),this.changeStack.set(n,{undoOpts:{type:"Replace",ref:o,content:a}});break}case"SetFormField":{if(!this.isInputElement(o))throw new Error("Element targeted is not of a supported type");let a=o.value;this.setInputValue(o,i.markup),o.setAttribute(re,n),this.changeStack.set(n,{undoOpts:{type:"SetInput",ref:o,content:a}})}}}catch(o){this.log("warn",`Unable to apply transformation with identifier "${n}"`,o)}this.lastAppliedTransformations=t,this.isPersonalized=!0,this.updateCueCardPersonalizationState()});h(this,"setOrUpdateReplaceChangeRef",(t,r,n)=>{let i=this.changeStack.get(t);if(!i){n.setAttribute(re,t),this.changeStack.set(t,{undoOpts:{type:"Replace",ref:n,content:r}});return}let o=i.undoOpts.ref;o&&o!==n&&o.isConnected&&o.removeAttribute(re),n.setAttribute(re,t),i.undoOpts.ref=n});h(this,"syncChangeStack",()=>{let t=0;for(let[r,n]of this.changeStack){let i=n.undoOpts.ref;if(!(!!i&&(i.isConnected||document.contains(i)))){this.changeStack.delete(r),t++;continue}i.getAttribute(re)!==r&&(this.changeStack.delete(r),t++)}this.log("debug",`syncChangeStack pruned ${this.formatThousands(t)} stale entries`)});h(this,"undo",t=>{let r=this.changeStack.get(t);if(r===void 0)throw new Error(`Cannot undo stack item with identifier ${t} as it does not exist.`);let{undoOpts:n}=r;switch(n.type){case"Remove":{n.ref.remove();break}case"Replace":{Se(n.ref,n.content),n.ref.removeAttribute(re);break}case"SetInput":{if(!this.isInputElement(n.ref))throw new Error("Element targeted is not of a supported type");this.setInputValue(n.ref,n.content),n.ref.removeAttribute(re);break}}this.changeStack.delete(t)});h(this,"undoAll",()=>{this.changeStack.forEach((t,r)=>this.undo(r))});h(this,"toggleTransformations",async()=>{this.isPersonalized?(this.undoAll(),this.isPersonalized=!1,this.log("debug","Toggled to original content")):(this.lastAppliedTransformations.length>0&&await this.applyTransformations(this.lastAppliedTransformations,{shouldConsolidate:!0}),this.isPersonalized=!0,this.log("debug","Toggled to personalized content")),this.updateCueCardPersonalizationState()});h(this,"updateCueCardPersonalizationState",()=>{this.cueCardInstance&&this.cueCardInstance.update({isPersonalized:this.isPersonalized})});h(this,"setInputValue",(t,r)=>{let n=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:t instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(n,"value");if(!i?.set)throw new Error("No value setter found");i.set.call(t,r),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))});h(this,"fetchCueCardConfig",async t=>{if(!this.config.publicKey)return null;try{let r=new URLSearchParams({publicKey:this.config.publicKey,pagePath:t}),n=await fetch(`${this.config.apiHost}/v1/cue-card-config?${r.toString()}`);if(!n.ok)return this.log("warn",`CueCard config request failed with status ${n.status}`),null;let i=await n.json();return Kr(i)?i:(this.log("warn","Invalid CueCard config response format"),null)}catch(r){return this.log("error","Failed to fetch CueCard config:",r),null}});h(this,"initCueCard",async()=>{if(this.cueCardInstance){this.log("warn","CueCard already initialized, skipping...");return}let t=await this.fetchCueCardConfig(this.currentPath);if(!t||!t.enabled){this.log("debug",`CueCard not mounted: no active template for path "${this.currentPath}"`);return}this.log("debug","Active template found, mounting CueCard...");let r=t.config;this.cueCardInstance=new _e({theme:r?.theme??"light",position:r?.position??"top-center",direction:r?.direction??"top-to-bottom",fields:r?.fields??[{name:"companyDomain",label:"Company Name or Domain",placeholder:"example.com",required:!0,minLength:3,errorMessage:"Company name or domain is required"}],isVisible:!0,enableFocusMode:r?.enableFocusMode??!1,showWatermark:r?.showWatermark??!1,showKeyboardHints:r?.showKeyboardHints??!0,enableLauncher:r?.enableLauncher??!0,customTheme:r?.customTheme,textOverrides:r?.textOverrides,enableUndoToggle:r?.enableUndoToggle??!1,isPersonalized:this.isPersonalized,onDismiss:()=>{this.log("debug","CueCard dismissed by user")},onSubmitPersonalization:n=>{this.log("debug","CueCard submitted:",n),this.personalize(n)},onOpenChange:n=>{this.log("debug","CueCard open state changed:",n)},onTogglePersonalization:()=>{this.log("debug","CueCard toggle personalization"),this.toggleTransformations()}}),this.cueCardInstance.mount(),this.log("debug","CueCard mounted successfully")});h(this,"syncCueCardVisibility",async()=>{this.config.publicKey&&(this.cueCardInstance&&(this.log("debug","Navigation detected, unmounting CueCard"),this.cueCardInstance.unmount(),this.cueCardInstance=null),this.initCueCard())});h(this,"personalize",async t=>{if(!this.config.publicKey){this.log("error","Cannot personalize: publicKey not configured");return}let r=new Date;this.log("debug","Starting personalization with input:",t),this.cueCardInstance&&this.cueCardInstance.update({status:"starting",progressPct:10});try{let n=await fetch(`${this.config.apiHost}/v1/personalize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:this.config.publicKey,input:t,pagePath:this.currentPath})});if(this.cueCardInstance&&this.cueCardInstance.update({progressPct:50}),!n.ok){let l=await n.json().catch(()=>({}));throw new Error(l.error||`API error: ${n.status}`)}let i=await n.json();this.log("debug","Personalization API response:",i),this.cueCardInstance&&this.cueCardInstance.update({progressPct:80}),i.transformations&&Array.isArray(i.transformations)&&await this.applyTransformations(i.transformations,{shouldConsolidate:!0}),this.cueCardInstance&&this.cueCardInstance.update({status:"success",progressPct:100});let o=new Date,a=this.getDurationInMilliseconds(r,o);this.log("debug",`Personalization complete, took ${this.formatThousands(a)} ms`)}catch(n){this.log("error","Personalization failed:",n),this.cueCardInstance&&this.cueCardInstance.update({status:"error",progressPct:0})}});h(this,"getCueCard",()=>this.cueCardInstance);this.config={apiHost:"https://kenobi.ai/api",debug:!1,autoTransform:!0,...t},this.transitionDefaults=Nr(this.config.transitionDefaults),this.orchestrator=new Ye,this.syncVisitorKey(),this.currentPath=this.getCurrentPath(),this.currentUrl=this.getCurrentUrl();try{this.initNavigationListener()}catch(r){this.log("error","Failed to initialize navigation listener with error:",r)}this.log("debug","Kenobi initialized"),this.config.autoTransform&&(this.log("debug","Auto-transform is requested... Starting..."),this.startAutoTransform()),this.config.publicKey&&(this.log("debug","Public key provided, checking for active template..."),this.initCueCard())}};return ir(qr);})();
270
+ --kb-focus-blur: ${n};
271
+ `}mount(e){let n=e||this.config.mountNode||this.mountTarget||document.body;this.mountTarget=n,n.contains(this.host)||n.appendChild(this.host),this.applyHostStyles(),this.startDeanonymization(),this.render()}unmount(){Je(null,this.shadow.lastElementChild),this.host.remove(),this.deanonymizationCleanup?.(),this.deanonymizationCleanup=null}update(e){e.status==="starting"&&this.config.status!=="starting"&&(this.isOpen=!1);let n=this.isDeanonymizationEnabled();this.config={...this.config,...e};let r=this.isDeanonymizationEnabled();r&&!n&&(this.deanonymizationStatus="pending",this.startDeanonymization()),!r&&n&&(this.deanonymizedCompany=null,this.deanonymizationStatus="idle",this.deanonymizationCleanup?.(),this.deanonymizationCleanup=null,this.hasStartedDeanonymization=!1),this.applyHostStyles(),this.render()}isDeanonymizationEnabled(){return this.config.deanonymization?.provider==="Kenobi"}startDeanonymization(){if(!this.isDeanonymizationEnabled()||this.hasStartedDeanonymization||this.deanonymizationStatus!=="pending")return;if(this.hasStartedDeanonymization=!0,typeof window>"u"){this.deanonymizationStatus="failed",this.render();return}let e=window.__kenobiIdentityResolution;if(e){this.handleDeanonymizationResult(e);return}let n=o=>{let a=o.detail;this.handleDeanonymizationResult(a)};window.addEventListener(Oe,n),fr(this.config.deanonymization);let r=this.config.deanonymization?.timeoutMs??dr,i=window.setTimeout(()=>{window.removeEventListener(Oe,n),this.handleDeanonymizationResult(null)},r);this.deanonymizationCleanup=()=>{window.removeEventListener(Oe,n),window.clearTimeout(i)}}handleDeanonymizationResult(e){if(this.deanonymizationStatus!=="pending")return;this.deanonymizationCleanup?.(),this.deanonymizationCleanup=null;let n=pr(e);this.deanonymizedCompany=n,this.deanonymizationStatus=n?"resolved":"failed",n?rt("deanonymization:success",{company:n,detail:e}):rt("deanonymization:fail",{detail:e}),this.render()}getRenderConfig(){return this.deanonymizationStatus==="pending"?{...this.config,isVisible:!1}:this.config}setTheme(e){this.update({theme:e})}openForm(e){this.isOpen=!0,this.skipFocus=e??!1,this.render()}render(){let e=this.shadow.lastElementChild,n=this.skipFocus;this.skipFocus=!1,Je(p(hr,{config:this.getRenderConfig(),isOpen:this.isOpen,skipFocus:n,deanonymizedCompany:this.deanonymizedCompany,onClearDeanonymizedCompany:this.clearDeanonymizedCompany,setIsOpen:r=>{this.isOpen=r,this.config.onOpenChange?.(r),this.render()}}),e)}};var nn="kfor",rn="kenobi_visitor_key",oe="data-kenobi-transformation-identifier",be={enabled:!1,durationMs:300,delayMs:0,easing:"ease",animateSize:!0,overflow:"hidden"},br=t=>({enabled:t?.enabled??be.enabled,durationMs:t?.durationMs??be.durationMs,delayMs:t?.delayMs??be.delayMs,easing:t?.easing??be.easing,animateSize:t?.animateSize??be.animateSize,overflow:t?.overflow??be.overflow,textAnimation:t?.textAnimation,enter:t?.enter,exit:t?.exit}),gr=(t,e)=>({enabled:e?.enabled??t.enabled,durationMs:e?.durationMs??t.durationMs,delayMs:e?.delayMs??t.delayMs,easing:e?.easing??t.easing,animateSize:e?.animateSize??t.animateSize,overflow:e?.overflow??t.overflow,textAnimation:e?.textAnimation??t.textAnimation,enter:e?.enter??t.enter,exit:e?.exit??t.exit}),sn=t=>typeof t=="string",xe=t=>t instanceof HTMLElement||typeof SVGElement<"u"&&t instanceof SVGElement,yr=t=>typeof t=="string",_r=t=>t==="hidden"||t==="visible"||t==="clip",vr=t=>t==="line"||t==="word"||t==="character",ln=t=>typeof t!="object"||t===null?!1:Array.isArray(t)?t.every(e=>typeof e=="object"&&e!==null):!0,on=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{animationName:n,keyframes:r,durationMs:i,delayMs:o}=e;return(n===void 0||sn(n))&&(r===void 0||ln(r))&&(i===void 0||typeof i=="number")&&(o===void 0||typeof o=="number")},kr=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{by:n,staggerMs:r,animationName:i,keyframes:o,delayMs:a,durationMs:s}=e;return vr(n)&&(a===void 0||typeof a=="number")&&(r===void 0||typeof r=="number")&&(s===void 0||typeof s=="number")&&(sn(i)||o!==void 0)&&(o===void 0||ln(o))},wr=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{enabled:n,durationMs:r,delayMs:i,easing:o,animateSize:a,overflow:s,textAnimation:u,enter:c,exit:m}=e;return(n===void 0||typeof n=="boolean")&&(r===void 0||typeof r=="number")&&(i===void 0||typeof i=="number")&&(o===void 0||yr(o))&&(a===void 0||typeof a=="boolean")&&(s===void 0||_r(s))&&(u===void 0||kr(u))&&(c===void 0||on(c))&&(m===void 0||on(m))},it=class{constructor(){f(this,"replaceWithTransition",async(e,n,r)=>{let i=document.createElement("div");i.style.position="relative",i.style.overflow=r.overflow;let o=e.getBoundingClientRect(),a=window.getComputedStyle(e);i.style.display=a.display,i.style.verticalAlign=a.verticalAlign,i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.style.margin=a.margin;let s=e.cloneNode(!0);if(!(s instanceof Element)||!xe(s))throw new Error("oldElClone is not an AnimatableElement");s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.margin="0",s.style.pointerEvents="none",i.appendChild(s);let u=document.createElement("div");u.innerHTML=n;let c=u.firstElementChild;if(!c||!(c instanceof HTMLElement||c instanceof SVGElement))return await this.exit(e,r).finished,e;let m=c.style.cssText,l=e.parentNode,d;if(l instanceof HTMLElement){let v=l.cloneNode(!1),V=window.getComputedStyle(l),J=V.cssText?V.cssText:Array.from(V).reduce((j,H)=>`${j}${H}:${V.getPropertyValue(H)};`,"");v.style.cssText=J,v.style.position="absolute",v.style.top="-9999px",v.style.left="-9999px",v.style.visibility="hidden",v.style.pointerEvents="none",v.appendChild(c),document.body.appendChild(v),r.textAnimation&&this.applyTextAnimationToNode(c,r.textAnimation,r),d=c.getBoundingClientRect(),document.body.removeChild(v)}else{let v=document.createElement("div");v.style.position="absolute",v.style.top="-9999px",v.style.left="-9999px",v.style.visibility="hidden",v.appendChild(c),document.body.appendChild(v),r.textAnimation&&this.applyTextAnimationToNode(c,r.textAnimation,r),d=c.getBoundingClientRect(),document.body.removeChild(v)}c.style.cssText=m,c.style.visibility="",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width=`${d.width}px`,c.style.height=`${d.height}px`,c.style.margin="0",c.style.opacity="0",i.appendChild(c),e.replaceWith(i);let h=r.exit?.delayMs??r.delayMs,E=r.exit?.durationMs??r.durationMs,M=r.enter?.delayMs??r.delayMs,T=r.enter?.durationMs??r.durationMs,g=[],x=this.resolveKeyframes(r.exit?.keyframes),P=s.animate(x,{duration:E,delay:h,easing:r.easing,fill:"forwards"});g.push(P);let O=this.resolveKeyframes(r.enter?.keyframes),D=c.animate(O,{duration:T,delay:M,easing:r.easing,fill:"forwards"});if(g.push(D),r.animateSize){let v=i.animate([{width:`${o.width}px`,height:`${o.height}px`},{width:`${d.width}px`,height:`${d.height}px`}],{duration:T,delay:M,easing:r.easing,fill:"forwards"});g.push(v)}return await Promise.all(g.map(v=>v.finished)),i.parentNode&&i.replaceWith(c),c.style.cssText=m,s.remove(),c});f(this,"enter",(e,n)=>{let r=n.enter?.delayMs??n.delayMs,i=n.enter?.durationMs??n.durationMs,o=this.resolveKeyframes(n.enter?.keyframes);return e.animate(o,{duration:i,delay:r,easing:n.easing,fill:"forwards"})});f(this,"exit",(e,n)=>{let r=n.exit?.delayMs??n.delayMs,i=n.exit?.durationMs??n.durationMs,o=this.resolveKeyframes(n.exit?.keyframes);return e.animate(o,{duration:i,delay:r,easing:n.easing,fill:"forwards"})});f(this,"resolveKeyframes",e=>e?Array.isArray(e)?e:[e]:[]);f(this,"applyTextAnimationToNode",(e,n,r)=>{let i=n.delayMs??0,o=window.getComputedStyle(e),a=o.getPropertyValue("background-clip")==="text"||o.getPropertyValue("-webkit-background-clip")==="text",s=(u,c,m)=>{if(u.nodeType===Node.TEXT_NODE){let l=u.textContent??"";if(l.trim().length===0)return c;if(n.by==="character"){let M=l.split(/(\s+)/),T=document.createDocumentFragment(),g=c;return M.forEach(x=>{if(x.length===0)return;if(x.trim().length===0){T.appendChild(document.createTextNode(x));return}let P=document.createElement("span");P.style.display="inline-block",P.style.whiteSpace="nowrap",m&&(P.style.setProperty("background","inherit"),P.style.setProperty("-webkit-background-clip","text"),P.style.setProperty("background-clip","text"),P.style.setProperty("color","transparent")),x.split("").forEach(D=>{let v=document.createElement("span");v.textContent=D,v.style.display="inline-block",v.style.opacity="0",m&&(v.style.setProperty("background","inherit"),v.style.setProperty("-webkit-background-clip","text"),v.style.setProperty("background-clip","text"),v.style.setProperty("color","transparent"),v.style.paddingBottom="0.1em",v.style.marginBottom="-0.1em");let V=this.resolveKeyframes(n.keyframes),J=n.durationMs??r.durationMs??300,j=r.easing??"ease",H=v.animate(V,{duration:J,easing:j,delay:g,fill:"forwards"});H.addEventListener("finish",()=>{H.commitStyles(),H.cancel()}),P.appendChild(v),g+=n.staggerMs??50}),T.appendChild(P)}),u.parentNode?.replaceChild(T,u),g}let d;switch(n.by){case"word":d=l.split(/(\s+)/);break;case"line":d=l.split(`
272
+ `);break;default:d=l.split("")}let h=document.createDocumentFragment(),E=c;return d.forEach(M=>{if(M.length===0)return;if(M.trim().length===0){h.appendChild(document.createTextNode(M));return}let g=document.createElement("span");g.textContent=M,g.style.display="inline-block",g.style.opacity="0",m&&(g.style.setProperty("background","inherit"),g.style.setProperty("-webkit-background-clip","text"),g.style.setProperty("background-clip","text"),g.style.setProperty("color","transparent"),g.style.setProperty("will-change","opacity, transform"));let x=this.resolveKeyframes(n.keyframes),P=n.durationMs??r.durationMs??300,O=r.easing??"ease",D=g.animate(x,{duration:P,easing:O,delay:E,fill:"forwards"});D.addEventListener("finish",()=>{D.commitStyles(),D.cancel()}),h.appendChild(g),E+=n.staggerMs??50}),u.parentNode?.replaceChild(h,u),E}if(u.nodeType===Node.ELEMENT_NODE){let l=c,d=Array.from(u.childNodes);for(let h of d)l=s(h,l,m);return l}return c};s(e,i,a)})}},an="kenobi:identity-resolved",xr=1600,Cr=t=>typeof t!="object"||t===null?!1:typeof t.enabled=="boolean",cn=new Set(["Replace","InsertBefore","InsertAfter","Delete","SetFormField"]),un=t=>typeof t=="string",Tr=t=>Array.isArray(t)&&t.every(e=>un(e)),Sr=t=>typeof t=="string"&&cn.has(t),Er=t=>{if(typeof t!="object"||t===null)return!1;let e=t;return un(e.identifier)&&typeof e.markup=="string"&&Tr(e.selectorGuesses)&&Sr(e.action)&&(e.transition===void 0||wr(e.transition))},zr=t=>{if(typeof t!="object"||t===null)throw new Error("Invalid response: expected object with data array");let e=t.data;if(!Array.isArray(e))throw new Error("Invalid response: data must be an array");return e.forEach((n,r)=>{if(!Er(n))throw new Error(`Invalid transformation at index ${r}`)}),e},ot=class{constructor(e){f(this,"config");f(this,"changeStack",new Map);f(this,"visitorKey",null);f(this,"orchestrator");f(this,"cueCardInstance",null);f(this,"preparedPersonalization",null);f(this,"isPreparingPersonalization",!1);f(this,"preparePersonalizationPromise",null);f(this,"deanonymizationPrefetchCleanup",null);f(this,"currentPath");f(this,"currentUrl");f(this,"navTicking",!1);f(this,"transitionDefaults");f(this,"lastAppliedTransformations",[]);f(this,"isPersonalized",!1);f(this,"startAutoTransform",async()=>{try{this.syncChangeStack(),await this.waitForLoaded(),this.isFramer()&&(await this.waitForFrames(),await this.waitForIdle(),await this.waitForQuietDom(100,1e3)),await this.transform()}catch(e){this.log("error","Auto-transformation flow failed with error:",e)}});f(this,"transform",async()=>{try{let e=new Date;if(this.log("debug","Starting transform"),this.visitorKey===null){this.log("debug",`Couldn't find a visitor copy external ID with query param key "${nn}"`,"Exiting...");return}let n=[];try{n=await this.getTransformations(this.currentPath,this.visitorKey)}catch(o){this.log("error_detailed","An error occurred _getting_ transformations",o)}try{await this.applyTransformations(n)}catch(o){this.log("error_detailed","An error occurred _applying_ transformations",o)}let r=new Date,i=this.getDurationInMilliseconds(e,r);this.log("debug",`Transformation complete, took ${this.formatThousands(i)} ms`)}catch(e){this.log("error","An unexpected, top-level error occurred during transformation",e)}});f(this,"log",(e,n,...r)=>{let a=`${`[Kenobi \u25D4] (v${typeof window.__KENOBI_VERSION__<"u"?window.__KENOBI_VERSION__:"dev"})`} [${e.toLocaleUpperCase()}] :: ${n}`;switch(e){case"debug":this.config.debug&&console.log(a,...r);break;case"info":console.log(a,...r);break;case"warn":console.warn(a,...r);break;case"error_detailed":console.trace(...r);case"error":console.error(a,...r);break}});f(this,"resolveTransitionConfig",e=>gr(this.transitionDefaults,e));f(this,"retrieveElement",e=>{if(!Array.isArray(e)||e.some(n=>typeof n!="string"))throw new Error(`Invalid selectorGuesses payload received: expected array of strings but got ${JSON.stringify(e)}`);for(let n of e){let r=document.querySelectorAll(n);if(r.length===0)continue;if(r.length===1)return r[0];let i=Array.from(r).filter(a=>{let s=a.getBoundingClientRect(),u=getComputedStyle(a);return u.display!=="none"&&u.visibility!=="hidden"&&s.width>0&&s.height>0});if(i.length===0)continue;let o=i.sort((a,s)=>a.getBoundingClientRect().top-s.getBoundingClientRect().top);return this.log("debug",`Selector "${n}" matched ${r.length} elements, selected topmost visible one at y=${o[0].getBoundingClientRect().top}`),o[0]}throw new Error(`Could not find an element in the document with any of these selector patterns: ${e.join(", ")}`)});f(this,"getQueryParam",e=>new URLSearchParams(window.location.search).get(e));f(this,"getCurrentPath",()=>window.location.pathname);f(this,"getCurrentUrl",()=>window.location.pathname+window.location.search+window.location.hash);f(this,"getDurationInMilliseconds",(e,n)=>+n-+e);f(this,"formatThousands",e=>new Intl.NumberFormat("en-US").format(e));f(this,"setDebug",e=>this.config.debug=e);f(this,"isInputElement",e=>!(!(e instanceof HTMLInputElement)&&!(e instanceof HTMLTextAreaElement)&&!(e instanceof HTMLSelectElement)));f(this,"waitForFrames",()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e))));f(this,"waitForIdle",(e=1e3)=>new Promise(n=>"requestIdleCallback"in window?window.requestIdleCallback(()=>n(),{timeout:e}):setTimeout(n,50)));f(this,"waitForLoaded",()=>document.readyState==="complete"?Promise.resolve():new Promise(e=>window.addEventListener("load",()=>e(),{once:!0})));f(this,"waitForQuietDom",(e,n)=>new Promise(r=>{let i=performance.now(),o=new MutationObserver(()=>{i=performance.now()});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let a=performance.now()+e;(function s(){let u=performance.now();if(u-i>=n){o.disconnect(),r();return}if(u>=a){o.disconnect(),r();return}requestAnimationFrame(s)})()}));f(this,"isFramer",()=>{let e=Array.from(document.scripts).map(r=>r.src||"");return["__framer_events"in window,document.querySelector("[data-framer-root],[data-framer-component],[data-framer-page]"),e.some(r=>/framerusercontent\.com\/sites/i.test(r))].some(r=>!!r)});f(this,"syncVisitorKey",()=>{try{let e=this.getQueryParam(nn);e?(this.log("debug",`Query param value found (${e}), pushing into session storage`),sessionStorage.setItem(rn,e),this.visitorKey=e):this.visitorKey=sessionStorage.getItem(rn)}catch(e){this.log("error","Failed to sync visitor key with error:",e)}});f(this,"initNavigationListener",()=>{if("__KENOBI_NAV_HOOKED__"in window)return;window.__KENOBI_NAV_HOOKED__=!0;let e=i=>{this.navTicking||(this.navTicking=!0,queueMicrotask(()=>{this.navTicking=!1;let o=this.getCurrentUrl();o!==this.currentUrl&&(this.currentUrl=o,this.currentPath=this.getCurrentPath(),this.log("debug",`URL changed (${i}) \u2192 ${location.href}`),this.config.autoTransform&&(this.undoAll(),this.startAutoTransform()),this.syncCueCardVisibility())}))};if("navigation"in window){let i=window.navigation;i&&"addEventListener"in i&&typeof i.addEventListener=="function"&&(i.addEventListener("navigate",()=>e("navigation:navigate")),i.addEventListener("currententrychange",()=>e("navigation:entrychange")),i.addEventListener?.("navigatesuccess",()=>e("navigation:success")))}let n=history.pushState.bind(history),r=history.replaceState.bind(history);history.pushState=((...i)=>{let o=n(...i);return e("pushState"),o}),history.replaceState=((...i)=>{let o=r(...i);return e("replaceState"),o}),window.addEventListener("popstate",()=>e("popstate")),window.addEventListener("hashchange",()=>e("hashchange")),document.addEventListener("click",i=>{let o=i.target,a=o&&o.closest?.("a[href]");!a||a.target&&a.target!=="_self"||new URL(a.href,location.href).origin!==location.origin||setTimeout(()=>e("click"),0)},!0),setInterval(()=>{this.getCurrentUrl()!==this.currentUrl&&e("poll")},1e3)});f(this,"getTransformations",async(e,n)=>{let r=new URLSearchParams({path:e}),i=await fetch(`${this.config.apiHost}/v1/visitor-copy-transformations/${n}?${r.toString()}`),o=await i.json();if(!i.ok)throw new Error(`Network error (status ${i.status}) with json body: ${JSON.stringify(o,null,2)}`);return zr(o)});f(this,"validateTransitionPreconditions",(e,n,r)=>{if(r.enabled){let i=document.createElement("div");i.innerHTML=n;let o=i.firstElementChild;if(!o||!xe(o))return this.log("warn",`Transformation "${e}" was skipped: A transition was requested, but the element is not animatable.`),!1}return!0});f(this,"applyTransformations",async(e,n)=>{this.log("debug",`Starting ${e.length} transformations`),n?.shouldConsolidate&&this.changeStack.forEach((r,i)=>{e.find(a=>a.identifier===i)&&this.undo(i)});for(let{identifier:r,...i}of e)try{if(this.changeStack.get(r))throw new Error("Transformation already exists in stack");let o=this.retrieveElement(i.selectorGuesses);switch(i.action){case"Replace":{let a=o.outerHTML,s=this.resolveTransitionConfig(i.transition);if(s.enabled&&xe(o)&&"animate"in o){let u=await this.orchestrator.replaceWithTransition(o,i.markup,s);this.setOrUpdateReplaceChangeRef(r,a,u)}else Pe(o,i.markup,{}),this.setOrUpdateReplaceChangeRef(r,a,o);o.nodeName==="VIDEO"&&o.play();break}case"InsertBefore":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(r,i.markup,a))break;o.insertAdjacentHTML("beforebegin",i.markup);let s=o.previousElementSibling;if(s===null)throw new Error("Element wasn't created");if(s.setAttribute(oe,r),a.enabled&&xe(s)){let u=s.style.cssText;s.style.opacity="0",this.orchestrator.enter(s,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{s.style.cssText=u},{once:!0})}this.changeStack.set(r,{undoOpts:{type:"Remove",ref:s}});break}case"InsertAfter":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(r,i.markup,a))break;o.insertAdjacentHTML("afterend",i.markup);let s=o.nextElementSibling;if(s===null)throw new Error("Element wasn't created");if(s.setAttribute(oe,r),a.enabled&&xe(s)){let u=s.style.cssText;s.style.opacity="0",this.orchestrator.enter(s,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{s.style.cssText=u},{once:!0})}this.changeStack.set(r,{undoOpts:{type:"Remove",ref:s}});break}case"Delete":{let a=o.outerHTML;Pe(o,'<div style="display: none;" data-kenobi-delete-marker="true"></div>',{}),o.setAttribute(oe,r),this.changeStack.set(r,{undoOpts:{type:"Replace",ref:o,content:a}});break}case"SetFormField":{if(!this.isInputElement(o))throw new Error("Element targeted is not of a supported type");let a=o.value;this.setInputValue(o,i.markup),o.setAttribute(oe,r),this.changeStack.set(r,{undoOpts:{type:"SetInput",ref:o,content:a}})}}}catch(o){this.log("warn",`Unable to apply transformation with identifier "${r}"`,o)}this.lastAppliedTransformations=e,this.isPersonalized=!0,this.updateCueCardPersonalizationState()});f(this,"setOrUpdateReplaceChangeRef",(e,n,r)=>{let i=this.changeStack.get(e);if(!i){r.setAttribute(oe,e),this.changeStack.set(e,{undoOpts:{type:"Replace",ref:r,content:n}});return}let o=i.undoOpts.ref;o&&o!==r&&o.isConnected&&o.removeAttribute(oe),r.setAttribute(oe,e),i.undoOpts.ref=r});f(this,"syncChangeStack",()=>{let e=0;for(let[n,r]of this.changeStack){let i=r.undoOpts.ref;if(!(!!i&&(i.isConnected||document.contains(i)))){this.changeStack.delete(n),e++;continue}i.getAttribute(oe)!==n&&(this.changeStack.delete(n),e++)}this.log("debug",`syncChangeStack pruned ${this.formatThousands(e)} stale entries`)});f(this,"undo",e=>{let n=this.changeStack.get(e);if(n===void 0)throw new Error(`Cannot undo stack item with identifier ${e} as it does not exist.`);let{undoOpts:r}=n;switch(r.type){case"Remove":{r.ref.remove();break}case"Replace":{Pe(r.ref,r.content),r.ref.removeAttribute(oe);break}case"SetInput":{if(!this.isInputElement(r.ref))throw new Error("Element targeted is not of a supported type");this.setInputValue(r.ref,r.content),r.ref.removeAttribute(oe);break}}this.changeStack.delete(e)});f(this,"undoAll",()=>{this.changeStack.forEach((e,n)=>this.undo(n))});f(this,"toggleTransformations",async()=>{this.isPersonalized?(this.undoAll(),this.isPersonalized=!1,this.log("debug","Toggled to original content")):(this.lastAppliedTransformations.length>0&&await this.applyTransformations(this.lastAppliedTransformations,{shouldConsolidate:!0}),this.isPersonalized=!0,this.log("debug","Toggled to personalized content")),this.updateCueCardPersonalizationState()});f(this,"updateCueCardPersonalizationState",()=>{this.cueCardInstance&&this.cueCardInstance.update({isPersonalized:this.isPersonalized})});f(this,"setInputValue",(e,n)=>{let r=e instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,"value");if(!i?.set)throw new Error("No value setter found");i.set.call(e,n),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))});f(this,"fetchCueCardConfig",async e=>{if(!this.config.publicKey)return null;try{let n=new URLSearchParams({publicKey:this.config.publicKey,pagePath:e}),r=await fetch(`${this.config.apiHost}/v1/cue-card-config?${n.toString()}`);if(!r.ok)return this.log("warn",`CueCard config request failed with status ${r.status}`),null;let i=await r.json();return Cr(i)?i:(this.log("warn","Invalid CueCard config response format"),null)}catch(n){return this.log("error","Failed to fetch CueCard config:",n),null}});f(this,"initCueCard",async()=>{if(this.cueCardInstance){this.log("warn","CueCard already initialized, skipping...");return}let e=await this.fetchCueCardConfig(this.currentPath);if(!e||!e.enabled){this.log("debug",`CueCard not mounted: no active template for path "${this.currentPath}"`);return}this.log("debug","Active template found, mounting CueCard...");let n=e.config,r=n?.deanonymization,i=!!r?.provider;this.cueCardInstance=new we({theme:n?.theme??"light",position:n?.position??"top-center",direction:n?.direction??"top-to-bottom",fields:n?.fields??[{name:"companyDomain",label:"Company Name or Domain",placeholder:"example.com",required:!0,minLength:3,errorMessage:"Company name or domain is required"}],isVisible:!i,enableFocusMode:n?.enableFocusMode??!1,showWatermark:n?.showWatermark??!1,showKeyboardHints:n?.showKeyboardHints??!0,enableLauncher:n?.enableLauncher??!0,customTheme:n?.customTheme,textOverrides:n?.textOverrides,enableUndoToggle:n?.enableUndoToggle??!1,deanonymization:r,isPersonalized:this.isPersonalized,onDismiss:()=>{this.log("debug","CueCard dismissed by user"),this.dispatchKenobiEvent("cuecard:dismiss",{pagePath:this.currentPath})},onSubmitPersonalization:o=>{this.log("debug","CueCard submitted:",o),this.personalize(o)},onOpenChange:o=>{this.log("debug","CueCard open state changed:",o),this.dispatchKenobiEvent("cuecard:openchange",{isOpen:o,pagePath:this.currentPath})},onTogglePersonalization:()=>{this.log("debug","CueCard toggle personalization"),this.toggleTransformations(),this.dispatchKenobiEvent("cuecard:toggle",{isPersonalized:this.isPersonalized,pagePath:this.currentPath})}}),this.cueCardInstance.mount(),i&&this.setupDeanonymizationPrefetch(r,n?.fields),this.log("debug","CueCard mounted successfully")});f(this,"isSameInput",(e,n)=>{let r=Object.keys(e).sort(),i=Object.keys(n).sort();if(r.length!==i.length)return!1;for(let o=0;o<r.length;o+=1){let a=r[o];if(a!==i[o]||(e[a]??"")!==(n[a]??""))return!1}return!0});f(this,"buildInputFromFields",(e,n,r)=>{let i=r||n;if(!i)return null;let o={};return e.forEach(a=>{let s=a.name,u=s.toLowerCase();if(u.includes("domain")){o[s]=r||i;return}if(u.includes("company")){o[s]=n||i;return}o[s]=i}),o});f(this,"buildDeanonymizedInput",(e,n)=>{let r=e.company?.name||e.domain||"",i=e.company?.domain||e.domain||"";return!n||n.length===0?!r&&!i?null:{companyName:r||i,companyDomain:i||r}:this.buildInputFromFields(n,r,i)});f(this,"requestPersonalization",async(e,n)=>{let r={publicKey:this.config.publicKey,input:e,pagePath:this.currentPath};n?.notifySlack===!1&&(r.notifySlack=!1),n?.notifyOnly&&(r.notifyOnly=!0),n?.predictionSource&&(r.predictionSource=n.predictionSource),n?.prefetchedTransformations&&(r.prefetchedTransformations=n.prefetchedTransformations),n?.prefetchedMetadata&&(r.prefetchedMetadata=n.prefetchedMetadata);let i=await fetch(`${this.config.apiHost}/v1/personalize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){let a=await i.json().catch(()=>({}));throw new Error(a.error||`API error: ${i.status}`)}let o=await i.json();return this.log("debug","Personalization API response:",o),o});f(this,"preparePersonalization",async(e,n)=>this.config.publicKey?this.preparedPersonalization?.input&&this.isSameInput(this.preparedPersonalization.input,e)?(n?.source&&!this.preparedPersonalization.source&&(this.preparedPersonalization={...this.preparedPersonalization,source:n.source}),this.preparedPersonalization.result):this.preparePersonalizationPromise?this.preparePersonalizationPromise:(this.isPreparingPersonalization=!0,this.preparePersonalizationPromise=(async()=>{try{let r=await this.requestPersonalization(e,{notifySlack:!1,predictionSource:n?.source});return this.preparedPersonalization={input:e,result:r,source:n?.source},this.dispatchKenobiEvent("personalization:ready",{input:e,pagePath:this.currentPath,transformationsCount:r.transformations?.length??0,metadata:r.metadata,source:n?.source}),r}catch(r){return this.log("error","Personalization prefetch failed:",r),null}finally{this.isPreparingPersonalization=!1,this.preparePersonalizationPromise=null}})(),this.preparePersonalizationPromise):(this.log("error","Cannot prepare personalization: publicKey not configured"),null));f(this,"notifyPreparedPersonalization",async e=>{if(!e.result.transformations||!e.result.metadata){this.log("warn","Prepared personalization missing transformations or metadata for notify");return}try{await this.requestPersonalization(e.input,{notifySlack:!0,notifyOnly:!0,predictionSource:e.source,prefetchedTransformations:e.result.transformations,prefetchedMetadata:e.result.metadata})}catch(n){this.log("warn","Failed to send Slack notification for prepared personalization:",n)}});f(this,"setupDeanonymizationPrefetch",(e,n)=>{if(!this.cueCardInstance)return;if(typeof window>"u"){this.cueCardInstance.update({isVisible:!0});return}if(this.deanonymizationPrefetchCleanup)return;let r=!1,i=!1,o=!1,a=()=>{r||(r=!0,o?this.cueCardInstance?.update({deanonymization:void 0,isVisible:!0}):this.cueCardInstance?.update({isVisible:!0}),this.deanonymizationPrefetchCleanup?.(),this.deanonymizationPrefetchCleanup=null)},s=async l=>{if(r)return;let d=l.detail;if(i=!0,d?.type!=="business"){a();return}let h=this.buildDeanonymizedInput(d,n);if(!h){a();return}await this.preparePersonalization(h,{source:"deanonymized"})||(o=!0),a()},u=window.__kenobiIdentityResolution;u&&s({detail:u}),window.addEventListener(an,s);let c=e?.timeoutMs??xr,m=window.setTimeout(()=>{i||a()},c+50);this.deanonymizationPrefetchCleanup=()=>{window.removeEventListener(an,s),window.clearTimeout(m)}});f(this,"syncCueCardVisibility",async()=>{this.config.publicKey&&(this.cueCardInstance&&(this.log("debug","Navigation detected, unmounting CueCard"),this.cueCardInstance.unmount(),this.cueCardInstance=null),this.initCueCard())});f(this,"dispatchKenobiEvent",(e,n)=>{let r=new CustomEvent(`kenobi:${e}`,{detail:n,bubbles:!0});window.dispatchEvent(r),this.log("debug",`Dispatched event: kenobi:${e}`,n)});f(this,"personalize",async e=>{if(!this.config.publicKey){this.log("error","Cannot personalize: publicKey not configured");return}let n=new Date;this.log("debug","Starting personalization with input:",e);let r=this.preparedPersonalization?.input&&this.isSameInput(this.preparedPersonalization.input,e)?this.preparedPersonalization:null,i=r?.source==="deanonymized";this.dispatchKenobiEvent("personalization:start",{input:e,pagePath:this.currentPath,deanonymized:i});try{this.cueCardInstance&&this.cueCardInstance.update({status:"starting",progressPct:r?80:10}),r&&this.notifyPreparedPersonalization(r);let o=r?r.result:await this.requestPersonalization(e);o.transformations&&Array.isArray(o.transformations)&&await this.applyTransformations(o.transformations,{shouldConsolidate:!0}),r&&(this.preparedPersonalization=null),this.cueCardInstance&&this.cueCardInstance.update({status:"success",progressPct:100});let a=new Date,s=this.getDurationInMilliseconds(n,a);this.log("debug",`Personalization complete, took ${this.formatThousands(s)} ms`),this.dispatchKenobiEvent("personalization:complete",{input:e,pagePath:this.currentPath,durationMs:s,transformationsCount:o.transformations?.length??0,metadata:o.metadata,source:r?"prefetch":"api",deanonymized:i})}catch(o){this.log("error","Personalization failed:",o),this.cueCardInstance&&this.cueCardInstance.update({status:"error",progressPct:0}),this.dispatchKenobiEvent("personalization:error",{input:e,pagePath:this.currentPath,error:o instanceof Error?o.message:String(o),deanonymized:i})}});f(this,"getCueCard",()=>this.cueCardInstance);this.config={apiHost:"https://kenobi.ai/api",debug:!1,autoTransform:!0,...e},this.transitionDefaults=br(this.config.transitionDefaults),this.orchestrator=new it,this.syncVisitorKey(),this.currentPath=this.getCurrentPath(),this.currentUrl=this.getCurrentUrl();try{this.initNavigationListener()}catch(n){this.log("error","Failed to initialize navigation listener with error:",n)}this.log("debug","Kenobi initialized"),this.config.autoTransform&&(this.log("debug","Auto-transform is requested... Starting..."),this.startAutoTransform()),this.config.publicKey&&!this.config.skipCueCardAutoMount&&(this.log("debug","Public key provided, checking for active template..."),this.initCueCard())}};return Nn(Pr);})();