kenobi-js 0.1.32 → 0.1.33

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,5 +1,5 @@
1
1
  /*!
2
- * Kenobi SDK v0.1.32
2
+ * Kenobi SDK v0.1.33
3
3
  * (c) 2025 Kenobi.ai
4
4
  */
5
5
  "use strict";var KenobiLib=(()=>{var xe=Object.defineProperty;var qt=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var Gt=Object.prototype.hasOwnProperty;var Xt=(t,e,r)=>e in t?xe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Yt=(t,e)=>{for(var r in e)xe(t,r,{get:e[r],enumerable:!0})},Qt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Wt(e))!Gt.call(t,i)&&i!==r&&xe(t,i,{get:()=>e[i],enumerable:!(n=qt(e,i))||n.enumerable});return t};var Jt=t=>Qt(xe({},"__esModule",{value:!0}),t);var b=(t,e,r)=>Xt(t,typeof e!="symbol"?e+"":e,r);var zr={};Yt(zr,{CueCard:()=>ye,Kenobi:()=>Qe,TRANSFORMATION_ACTIONS:()=>Ut});var Je=11;function Zt(t,e){var r=e.attributes,n,i,o,a,l;if(!(e.nodeType===Je||t.nodeType===Je)){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=t.getAttributeNS(o,i),l!==a&&(n.prefix==="xmlns"&&(i=n.name),t.setAttributeNS(o,i,a))):(l=t.getAttribute(i),l!==a&&t.setAttribute(i,a));for(var c=t.attributes,d=c.length-1;d>=0;d--)n=c[d],i=n.name,o=n.namespaceURI,o?(i=n.localName||i,e.hasAttributeNS(o,i)||t.removeAttributeNS(o,i)):e.hasAttribute(i)||t.removeAttribute(i)}}var Ce,er="http://www.w3.org/1999/xhtml",j=typeof document>"u"?void 0:document,tr=!!j&&"content"in j.createElement("template"),rr=!!j&&j.createRange&&"createContextualFragment"in j.createRange();function nr(t){var e=j.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function ir(t){Ce||(Ce=j.createRange(),Ce.selectNode(j.body));var e=Ce.createContextualFragment(t);return e.childNodes[0]}function or(t){var e=j.createElement("body");return e.innerHTML=t,e.childNodes[0]}function ar(t){return t=t.trim(),tr?nr(t):rr?ir(t):or(t)}function Te(t,e){var r=t.nodeName,n=e.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 sr(t,e){return!e||e===er?j.createElement(t):j.createElementNS(e,t)}function lr(t,e){for(var r=t.firstChild;r;){var n=r.nextSibling;e.appendChild(r),r=n}return e}function Fe(t,e,r){t[r]!==e[r]&&(t[r]=e[r],t[r]?t.setAttribute(r,""):t.removeAttribute(r))}var Ze={OPTION:function(t,e){var r=t.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),r.selectedIndex=-1)}Fe(t,e,"selected")},INPUT:function(t,e){Fe(t,e,"checked"),Fe(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var r=e.value;t.value!==r&&(t.value=r);var n=t.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==t.placeholder)return;n.nodeValue=r}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var r=-1,n=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")){r=n;break}n++}i=i.nextSibling,!i&&o&&(i=o.nextSibling,o=null)}t.selectedIndex=r}}},me=1,et=11,tt=3,rt=8;function ae(){}function cr(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function ur(t){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=j.createElement("html"),n.innerHTML=o}else n=ar(n);else n.nodeType===et&&(n=n.firstElementChild);var a=i.getNodeKey||cr,l=i.onBeforeNodeAdded||ae,u=i.onNodeAdded||ae,c=i.onBeforeElUpdated||ae,d=i.onElUpdated||ae,s=i.onBeforeNodeDiscarded||ae,m=i.onNodeDiscarded||ae,f=i.onBeforeElChildrenUpdated||ae,A=i.skipFromChildren||ae,R=i.addChild||function(k,v){return k.appendChild(v)},T=i.childrenOnly===!0,h=Object.create(null),w=[];function S(k){w.push(k)}function L(k,v){if(k.nodeType===me)for(var D=k.firstChild;D;){var y=void 0;v&&(y=a(D))?S(y):(m(D),D.firstChild&&L(D,v)),D=D.nextSibling}}function N(k,v,D){s(k)!==!1&&(v&&v.removeChild(k),m(k),L(k,D))}function g(k){if(k.nodeType===me||k.nodeType===et)for(var v=k.firstChild;v;){var D=a(v);D&&(h[D]=v),g(v),v=v.nextSibling}}g(r);function z(k){u(k);for(var v=k.firstChild;v;){var D=v.nextSibling,y=a(v);if(y){var C=h[y];C&&Te(v,C)?(v.parentNode.replaceChild(C,v),O(C,v)):z(v)}else z(v);v=D}}function K(k,v,D){for(;v;){var y=v.nextSibling;(D=a(v))?S(D):N(v,k,!0),v=y}}function O(k,v,D){var y=a(v);if(y&&delete h[y],!D){var C=c(k,v);if(C===!1||(C instanceof HTMLElement&&(k=C,g(k)),t(k,v),d(k),f(k,v)===!1))return}k.nodeName!=="TEXTAREA"?V(k,v):Ze.TEXTAREA(k,v)}function V(k,v){var D=A(k,v),y=v.firstChild,C=k.firstChild,J,q,U,ue,Z;e:for(;y;){for(ue=y.nextSibling,J=a(y);!D&&C;){if(U=C.nextSibling,y.isSameNode&&y.isSameNode(C)){y=ue,C=U;continue e}q=a(C);var oe=C.nodeType,X=void 0;if(oe===y.nodeType&&(oe===me?(J?J!==q&&((Z=h[J])?U===Z?X=!1:(k.insertBefore(Z,C),q?S(q):N(C,k,!0),C=Z,q=a(C)):X=!1):q&&(X=!1),X=X!==!1&&Te(C,y),X&&O(C,y)):(oe===tt||oe==rt)&&(X=!0,C.nodeValue!==y.nodeValue&&(C.nodeValue=y.nodeValue))),X){y=ue,C=U;continue e}q?S(q):N(C,k,!0),C=U}if(J&&(Z=h[J])&&Te(Z,y))D||R(k,Z),O(Z,y);else{var fe=l(y);fe!==!1&&(fe&&(y=fe),y.actualize&&(y=y.actualize(k.ownerDocument||j)),R(k,y),z(y))}y=ue,C=U}K(k,C,q);var ke=Ze[k.nodeName];ke&&ke(k,v)}var M=r,B=M.nodeType,Q=n.nodeType;if(!T){if(B===me)Q===me?Te(r,n)||(m(r),M=lr(r,sr(n.nodeName,n.namespaceURI))):M=n;else if(B===tt||B===rt){if(Q===B)return M.nodeValue!==n.nodeValue&&(M.nodeValue=n.nodeValue),M;M=n}}if(M===n)m(r);else{if(n.isSameNode&&n.isSameNode(M))return;if(O(M,n,T),w)for(var se=0,ie=w.length;se<ie;se++){var le=h[w[se]];le&&N(le,le.parentNode,!1)}}return!T&&M!==r&&r.parentNode&&(M.actualize&&(M=M.actualize(r.ownerDocument||j)),r.parentNode.replaceChild(M,r)),M}}var dr=ur(Zt),Se=dr;var Le,P,st,pr,ce,nt,lt,ct,ut,Ke,Oe,ze,fr,he={},dt=[],mr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Re=Array.isArray;function ne(t,e){for(var r in e)t[r]=e[r];return t}function $e(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function hr(t,e,r){var n,i,o,a={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Le.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return Ae(t,a,n,i,null)}function Ae(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++st,__i:-1,__u:0};return i==null&&P.vnode!=null&&P.vnode(o),o}function te(t){return t.children}function Me(t,e){this.props=t,this.context=e}function de(t,e){if(e==null)return t.__?de(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?de(t):null}function pt(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return pt(t)}}function it(t){(!t.__d&&(t.__d=!0)&&ce.push(t)&&!Pe.__r++||nt!=P.debounceRendering)&&((nt=P.debounceRendering)||lt)(Pe)}function Pe(){for(var t,e,r,n,i,o,a,l=1;ce.length;)ce.length>l&&ce.sort(ct),t=ce.shift(),l=ce.length,t.__d&&(r=void 0,n=void 0,i=(n=(e=t).__v).__e,o=[],a=[],e.__P&&((r=ne({},n)).__v=n.__v+1,P.vnode&&P.vnode(r),Ve(e.__P,r,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,o,i??de(n),!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,ht(o,r,a),n.__e=n.__=null,r.__e!=i&&pt(r)));Pe.__r=0}function ft(t,e,r,n,i,o,a,l,u,c,d){var s,m,f,A,R,T,h,w=n&&n.__k||dt,S=e.length;for(u=br(r,e,w,u,S),s=0;s<S;s++)(f=r.__k[s])!=null&&(m=f.__i==-1?he:w[f.__i]||he,f.__i=s,T=Ve(t,f,m,i,o,a,l,u,c,d),A=f.__e,f.ref&&m.ref!=f.ref&&(m.ref&&Be(m.ref,null,f),d.push(f.ref,f.__c||A,f)),R==null&&A!=null&&(R=A),(h=!!(4&f.__u))||m.__k===f.__k?u=mt(f,u,t,h):typeof f.type=="function"&&T!==void 0?u=T:A&&(u=A.nextSibling),f.__u&=-7);return r.__e=R,u}function br(t,e,r,n,i){var o,a,l,u,c,d=r.length,s=d,m=0;for(t.__k=new Array(i),o=0;o<i;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+m,(a=t.__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).__=t,a.__b=t.__b+1,l=null,(c=a.__i=_r(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))):t.__k[o]=null;if(s)for(o=0;o<d;o++)(l=r[o])!=null&&(2&l.__u)==0&&(l.__e==n&&(n=de(l)),_t(l,l));return n}function mt(t,e,r,n){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=mt(i[o],e,r,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=de(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function _r(t,e,r,n){var i,o,a,l=t.key,u=t.type,c=e[r],d=c!=null&&(2&c.__u)==0;if(c===null&&t.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<e.length;)if((c=e[a=i>=0?i--:o++])!=null&&(2&c.__u)==0&&l==c.key&&u==c.type)return a}return-1}function ot(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||mr.test(e)?r:r+"px"}function Ee(t,e,r,n,i){var o,a;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||ot(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||ot(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(ut,"$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]=r,r?n?r.u=n.u:(r.u=Ke,t.addEventListener(e,o?ze:Oe,o)):t.removeEventListener(e,o?ze:Oe,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]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function at(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Ke++;else if(e.t<r.u)return;return r(P.event?P.event(e):e)}}}function Ve(t,e,r,n,i,o,a,l,u,c){var d,s,m,f,A,R,T,h,w,S,L,N,g,z,K,O,V,M=e.type;if(e.constructor!=null)return null;128&r.__u&&(u=!!(32&r.__u),o=[l=e.__e=r.__e]),(d=P.__b)&&d(e);e:if(typeof M=="function")try{if(h=e.props,w="prototype"in M&&M.prototype.render,S=(d=M.contextType)&&n[d.__c],L=d?S?S.props.value:d.__:n,r.__c?T=(s=e.__c=r.__c).__=s.__E:(w?e.__c=s=new M(h,L):(e.__c=s=new Me(h,L),s.constructor=M,s.render=yr),S&&S.sub(s),s.props=h,s.state||(s.state={}),s.context=L,s.__n=n,m=s.__d=!0,s.__h=[],s._sb=[]),w&&s.__s==null&&(s.__s=s.state),w&&M.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=ne({},s.__s)),ne(s.__s,M.getDerivedStateFromProps(h,s.__s))),f=s.props,A=s.state,s.__v=e,m)w&&M.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),w&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(w&&M.getDerivedStateFromProps==null&&h!==f&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(h,L),!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(h,s.__s,L)===!1||e.__v==r.__v){for(e.__v!=r.__v&&(s.props=h,s.state=s.__s,s.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(B){B&&(B.__=e)}),N=0;N<s._sb.length;N++)s.__h.push(s._sb[N]);s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(h,s.__s,L),w&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(f,A,R)})}if(s.context=L,s.props=h,s.__P=t,s.__e=!1,g=P.__r,z=0,w){for(s.state=s.__s,s.__d=!1,g&&g(e),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,g&&g(e),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++z<25);s.state=s.__s,s.getChildContext!=null&&(n=ne(ne({},n),s.getChildContext())),w&&!m&&s.getSnapshotBeforeUpdate!=null&&(R=s.getSnapshotBeforeUpdate(f,A)),O=d,d!=null&&d.type===te&&d.key==null&&(O=bt(d.props.children)),l=ft(t,Re(O)?O:[O],e,r,n,i,o,a,l,u,c),s.base=e.__e,e.__u&=-161,s.__h.length&&a.push(s),T&&(s.__E=s.__=null)}catch(B){if(e.__v=null,u||o!=null)if(B.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,e.__e=l}else{for(V=o.length;V--;)$e(o[V]);Ue(e)}else e.__e=r.__e,e.__k=r.__k,B.then||Ue(e);P.__e(B,e,r)}else o==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):l=e.__e=gr(r.__e,e,r,n,i,o,a,u,c);return(d=P.diffed)&&d(e),128&e.__u?void 0:l}function Ue(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Ue)}function ht(t,e,r){for(var n=0;n<r.length;n++)Be(r[n],r[++n],r[++n]);P.__c&&P.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){P.__e(o,i.__v)}})}function bt(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Re(t)?t.map(bt):ne({},t)}function gr(t,e,r,n,i,o,a,l,u){var c,d,s,m,f,A,R,T=r.props,h=e.props,w=e.type;if(w=="svg"?i="http://www.w3.org/2000/svg":w=="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((f=o[c])&&"setAttribute"in f==!!w&&(w?f.localName==w:f.nodeType==3)){t=f,o[c]=null;break}}if(t==null){if(w==null)return document.createTextNode(h);t=document.createElementNS(i,w,h.is&&h),l&&(P.__m&&P.__m(e,o),l=!1),o=null}if(w==null)T===h||l&&t.data==h||(t.data=h);else{if(o=o&&Le.call(t.childNodes),T=r.props||he,!l&&o!=null)for(T={},c=0;c<t.attributes.length;c++)T[(f=t.attributes[c]).name]=f.value;for(c in T)if(f=T[c],c!="children"){if(c=="dangerouslySetInnerHTML")s=f;else if(!(c in h)){if(c=="value"&&"defaultValue"in h||c=="checked"&&"defaultChecked"in h)continue;Ee(t,c,null,f,i)}}for(c in h)f=h[c],c=="children"?m=f:c=="dangerouslySetInnerHTML"?d=f:c=="value"?A=f:c=="checked"?R=f:l&&typeof f!="function"||T[c]===f||Ee(t,c,f,T[c],i);if(d)l||s&&(d.__html==s.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(s&&(t.innerHTML=""),ft(e.type=="template"?t.content:t,Re(m)?m:[m],e,r,n,w=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&de(r,0),l,u),o!=null)for(c=o.length;c--;)$e(o[c]);l||(c="value",w=="progress"&&A==null?t.removeAttribute("value"):A!=null&&(A!==t[c]||w=="progress"&&!A||w=="option"&&A!=T[c])&&Ee(t,c,A,T[c],i),c="checked",R!=null&&R!=t[c]&&Ee(t,c,R,T[c],i))}return t}function Be(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){P.__e(i,r)}}function _t(t,e,r){var n,i;if(P.unmount&&P.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||Be(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){P.__e(o,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&_t(n[i],e,r||typeof t.type!="function");r||$e(t.__e),t.__c=t.__=t.__e=void 0}function yr(t,e,r){return this.constructor(t,r)}function je(t,e,r){var n,i,o,a;e==document&&(e=document.documentElement),P.__&&P.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,o=[],a=[],Ve(e,t=(!n&&r||e).__k=hr(te,null,[t]),i||he,he,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?Le.call(e.childNodes):null,o,!n&&r?r:i?i.__e:e.firstChild,n,a),ht(o,t,a)}Le=dt.slice,P={__e:function(t,e,r,n){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,n||{}),a=i.__d),a)return i.__E=i}catch(l){t=l}throw t}},st=0,pr=function(t){return t!=null&&t.constructor==null},Me.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ne({},this.state),typeof t=="function"&&(t=t(ne({},r),this.props)),t&&ne(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),it(this))},Me.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),it(this))},Me.prototype.render=te,ce=[],lt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ct=function(t,e){return t.__v.__b-e.__v.__b},Pe.__r=0,ut=/(PointerCapture)$|Capture$/i,Ke=0,Oe=at(!1),ze=at(!0),fr=0;var be,H,qe,gt,_e=0,St=[],I=P,yt=I.__b,vt=I.__r,kt=I.diffed,wt=I.__c,xt=I.unmount,Ct=I.__;function Ge(t,e){I.__h&&I.__h(H,t,_e||e),_e=0;var r=H.__H||(H.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ge(t){return _e=1,vr(Pt,t)}function vr(t,e,r){var n=Ge(be++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):Pt(void 0,e),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=H,!H.__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 f=m.__[0];m.__=m.__N,m.__N=void 0,f!==m.__[0]&&(s=!0)}}),o&&o.call(this,l,u,c)||s};H.__f=!0;var o=H.shouldComponentUpdate,a=H.componentWillUpdate;H.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)},H.shouldComponentUpdate=i}return n.__N||n.__}function G(t,e){var r=Ge(be++,3);!I.__s&&Mt(r.__H,e)&&(r.__=t,r.u=e,H.__H.__h.push(r))}function F(t){return _e=5,Et(function(){return{current:t}},[])}function Et(t,e){var r=Ge(be++,7);return Mt(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function At(t,e){return _e=8,Et(function(){return t},e)}function kr(){for(var t;t=St.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(De),t.__H.__h.forEach(We),t.__H.__h=[]}catch(e){t.__H.__h=[],I.__e(e,t.__v)}}I.__b=function(t){H=null,yt&&yt(t)},I.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ct&&Ct(t,e)},I.__r=function(t){vt&&vt(t),be=0;var e=(H=t.__c).__H;e&&(qe===H?(e.__h=[],H.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.forEach(De),e.__h.forEach(We),e.__h=[],be=0)),qe=H},I.diffed=function(t){kt&&kt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(St.push(e)!==1&&gt===I.requestAnimationFrame||((gt=I.requestAnimationFrame)||wr)(kr)),e.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),qe=H=null},I.__c=function(t,e){e.some(function(r){try{r.__h.forEach(De),r.__h=r.__h.filter(function(n){return!n.__||We(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],I.__e(n,r.__v)}}),wt&&wt(t,e)},I.unmount=function(t){xt&&xt(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{De(n)}catch(i){e=i}}),r.__H=void 0,e&&I.__e(e,r.__v))};var Tt=typeof requestAnimationFrame=="function";function wr(t){var e,r=function(){clearTimeout(n),Tt&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);Tt&&(e=requestAnimationFrame(r))}function De(t){var e=H,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),H=e}function We(t){var e=H;t.__c=t.__(),H=e}function Mt(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function Pt(t,e){return typeof e=="function"?e(t):e}var xr=0;function p(t,e,r,n,i,o){e||(e={});var a,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?a=e[l]:u[l]=e[l];var c={type:t,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--xr,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(l in a)u[l]===void 0&&(u[l]=a[l]);return P.vnode&&P.vnode(c),c}var Lt=()=>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"})}),Cr=()=>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"})}),Tr=()=>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"})}),Rt=()=>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:"url(#paint0_linear_1_41)"}),p("ellipse",{cx:"579.85",cy:"294.451",rx:"79.778",ry:"108.483",transform:"rotate(-46.2324 579.85 294.451)",fill:"black"}),p("defs",{children:p("linearGradient",{id:"paint0_linear_1_41",x1:"807",y1:"93",x2:"93",y2:"807",gradientUnits:"userSpaceOnUse",children:[p("stop",{"stop-color":"#FAFAFA"}),p("stop",{offset:"1","stop-color":"#CACACA"})]})})]}),Sr=`
@@ -87,5 +87,5 @@
87
87
  height: 0 !important;
88
88
  pointer-events: none !important;
89
89
  isolation: isolate !important;
90
- `}mount(e){let r=e||this.config.mountNode||this.mountTarget||document.body;this.mountTarget=r,r.contains(this.host)||r.appendChild(this.host),this.applyHostStyles(),this.render()}unmount(){je(null,this.shadow.lastElementChild),this.host.remove()}update(e){this.config={...this.config,...e},this.applyHostStyles(),this.render()}setTheme(e){this.update({theme:e})}openForm(e){this.isOpen=!0,this.skipFocus=e??!1,this.render()}render(){let e=this.shadow.lastElementChild,r=this.skipFocus;this.skipFocus=!1,je(p(Er,{config:this.config,isOpen:this.isOpen,skipFocus:r,setIsOpen:n=>{this.isOpen=n,this.config.onOpenChange?.(n),this.render()}}),e)}};var Ht="kfor",It="kenobi_visitor_key",re="data-kenobi-transformation-identifier",pe={enabled:!1,durationMs:300,delayMs:0,easing:"ease",animateSize:!0,overflow:"hidden"},Ar=t=>({enabled:t?.enabled??pe.enabled,durationMs:t?.durationMs??pe.durationMs,delayMs:t?.delayMs??pe.delayMs,easing:t?.easing??pe.easing,animateSize:t?.animateSize??pe.animateSize,overflow:t?.overflow??pe.overflow,textAnimation:t?.textAnimation,enter:t?.enter,exit:t?.exit}),Mr=(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}),Ot=t=>typeof t=="string",ve=t=>t instanceof HTMLElement||typeof SVGElement<"u"&&t instanceof SVGElement,Pr=t=>typeof t=="string",Lr=t=>t==="hidden"||t==="visible"||t==="clip",Rr=t=>t==="line"||t==="word"||t==="character",zt=t=>typeof t!="object"||t===null?!1:Array.isArray(t)?t.every(e=>typeof e=="object"&&e!==null):!0,Ft=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{animationName:r,keyframes:n,durationMs:i,delayMs:o}=e;return(r===void 0||Ot(r))&&(n===void 0||zt(n))&&(i===void 0||typeof i=="number")&&(o===void 0||typeof o=="number")},Dr=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{by:r,staggerMs:n,animationName:i,keyframes:o,delayMs:a,durationMs:l}=e;return Rr(r)&&(a===void 0||typeof a=="number")&&(n===void 0||typeof n=="number")&&(l===void 0||typeof l=="number")&&(Ot(i)||o!==void 0)&&(o===void 0||zt(o))},Nr=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{enabled:r,durationMs:n,delayMs:i,easing:o,animateSize:a,overflow:l,textAnimation:u,enter:c,exit:d}=e;return(r===void 0||typeof r=="boolean")&&(n===void 0||typeof n=="number")&&(i===void 0||typeof i=="number")&&(o===void 0||Pr(o))&&(a===void 0||typeof a=="boolean")&&(l===void 0||Lr(l))&&(u===void 0||Dr(u))&&(c===void 0||Ft(c))&&(d===void 0||Ft(d))},Ye=class{constructor(){b(this,"replaceWithTransition",async(e,r,n)=>{let i=document.createElement("div");i.style.position="relative",i.style.overflow=n.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 l=e.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(e,n).finished,e;let d=c.style.cssText,s=e.parentNode,m;if(s instanceof HTMLElement){let g=s.cloneNode(!1),z=window.getComputedStyle(s),K=z.cssText?z.cssText:Array.from(z).reduce((O,V)=>`${O}${V}:${z.getPropertyValue(V)};`,"");g.style.cssText=K,g.style.position="absolute",g.style.top="-9999px",g.style.left="-9999px",g.style.visibility="hidden",g.style.pointerEvents="none",g.appendChild(c),document.body.appendChild(g),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),m=c.getBoundingClientRect(),document.body.removeChild(g)}else{let g=document.createElement("div");g.style.position="absolute",g.style.top="-9999px",g.style.left="-9999px",g.style.visibility="hidden",g.appendChild(c),document.body.appendChild(g),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),m=c.getBoundingClientRect(),document.body.removeChild(g)}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),e.replaceWith(i);let f=n.exit?.delayMs??n.delayMs,A=n.exit?.durationMs??n.durationMs,R=n.enter?.delayMs??n.delayMs,T=n.enter?.durationMs??n.durationMs,h=[],w=this.resolveKeyframes(n.exit?.keyframes),S=l.animate(w,{duration:A,delay:f,easing:n.easing,fill:"forwards"});h.push(S);let L=this.resolveKeyframes(n.enter?.keyframes),N=c.animate(L,{duration:T,delay:R,easing:n.easing,fill:"forwards"});if(h.push(N),n.animateSize){let g=i.animate([{width:`${o.width}px`,height:`${o.height}px`},{width:`${m.width}px`,height:`${m.height}px`}],{duration:T,delay:R,easing:n.easing,fill:"forwards"});h.push(g)}return await Promise.all(h.map(g=>g.finished)),i.parentNode&&i.replaceWith(c),c.style.cssText=d,l.remove(),c});b(this,"enter",(e,r)=>{let n=r.enter?.delayMs??r.delayMs,i=r.enter?.durationMs??r.durationMs,o=this.resolveKeyframes(r.enter?.keyframes);return e.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});b(this,"exit",(e,r)=>{let n=r.exit?.delayMs??r.delayMs,i=r.exit?.durationMs??r.durationMs,o=this.resolveKeyframes(r.exit?.keyframes);return e.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});b(this,"resolveKeyframes",e=>e?Array.isArray(e)?e:[e]:[]);b(this,"applyTextAnimationToNode",(e,r,n)=>{let i=r.delayMs??0,o=window.getComputedStyle(e),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 R=s.split(/(\s+)/),T=document.createDocumentFragment(),h=c;return R.forEach(w=>{if(w.length===0)return;if(w.trim().length===0){T.appendChild(document.createTextNode(w));return}let S=document.createElement("span");S.style.display="inline-block",S.style.whiteSpace="nowrap",d&&(S.style.setProperty("background","inherit"),S.style.setProperty("-webkit-background-clip","text"),S.style.setProperty("background-clip","text"),S.style.setProperty("color","transparent")),w.split("").forEach(N=>{let g=document.createElement("span");g.textContent=N,g.style.display="inline-block",g.style.opacity="0",d&&(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.paddingBottom="0.1em",g.style.marginBottom="-0.1em");let z=this.resolveKeyframes(r.keyframes),K=r.durationMs??n.durationMs??300,O=n.easing??"ease",V=g.animate(z,{duration:K,easing:O,delay:h,fill:"forwards"});V.addEventListener("finish",()=>{V.commitStyles(),V.cancel()}),S.appendChild(g),h+=r.staggerMs??50}),T.appendChild(S)}),u.parentNode?.replaceChild(T,u),h}let m;switch(r.by){case"word":m=s.split(/(\s+)/);break;case"line":m=s.split(`
90
+ `}mount(e){let r=e||this.config.mountNode||this.mountTarget||document.body;this.mountTarget=r,r.contains(this.host)||r.appendChild(this.host),this.applyHostStyles(),this.render()}unmount(){je(null,this.shadow.lastElementChild),this.host.remove()}update(e){e.status==="starting"&&this.config.status!=="starting"&&(this.isOpen=!1),this.config={...this.config,...e},this.applyHostStyles(),this.render()}setTheme(e){this.update({theme:e})}openForm(e){this.isOpen=!0,this.skipFocus=e??!1,this.render()}render(){let e=this.shadow.lastElementChild,r=this.skipFocus;this.skipFocus=!1,je(p(Er,{config:this.config,isOpen:this.isOpen,skipFocus:r,setIsOpen:n=>{this.isOpen=n,this.config.onOpenChange?.(n),this.render()}}),e)}};var Ht="kfor",It="kenobi_visitor_key",re="data-kenobi-transformation-identifier",pe={enabled:!1,durationMs:300,delayMs:0,easing:"ease",animateSize:!0,overflow:"hidden"},Ar=t=>({enabled:t?.enabled??pe.enabled,durationMs:t?.durationMs??pe.durationMs,delayMs:t?.delayMs??pe.delayMs,easing:t?.easing??pe.easing,animateSize:t?.animateSize??pe.animateSize,overflow:t?.overflow??pe.overflow,textAnimation:t?.textAnimation,enter:t?.enter,exit:t?.exit}),Mr=(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}),Ot=t=>typeof t=="string",ve=t=>t instanceof HTMLElement||typeof SVGElement<"u"&&t instanceof SVGElement,Pr=t=>typeof t=="string",Lr=t=>t==="hidden"||t==="visible"||t==="clip",Rr=t=>t==="line"||t==="word"||t==="character",zt=t=>typeof t!="object"||t===null?!1:Array.isArray(t)?t.every(e=>typeof e=="object"&&e!==null):!0,Ft=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{animationName:r,keyframes:n,durationMs:i,delayMs:o}=e;return(r===void 0||Ot(r))&&(n===void 0||zt(n))&&(i===void 0||typeof i=="number")&&(o===void 0||typeof o=="number")},Dr=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{by:r,staggerMs:n,animationName:i,keyframes:o,delayMs:a,durationMs:l}=e;return Rr(r)&&(a===void 0||typeof a=="number")&&(n===void 0||typeof n=="number")&&(l===void 0||typeof l=="number")&&(Ot(i)||o!==void 0)&&(o===void 0||zt(o))},Nr=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{enabled:r,durationMs:n,delayMs:i,easing:o,animateSize:a,overflow:l,textAnimation:u,enter:c,exit:d}=e;return(r===void 0||typeof r=="boolean")&&(n===void 0||typeof n=="number")&&(i===void 0||typeof i=="number")&&(o===void 0||Pr(o))&&(a===void 0||typeof a=="boolean")&&(l===void 0||Lr(l))&&(u===void 0||Dr(u))&&(c===void 0||Ft(c))&&(d===void 0||Ft(d))},Ye=class{constructor(){b(this,"replaceWithTransition",async(e,r,n)=>{let i=document.createElement("div");i.style.position="relative",i.style.overflow=n.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 l=e.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(e,n).finished,e;let d=c.style.cssText,s=e.parentNode,m;if(s instanceof HTMLElement){let g=s.cloneNode(!1),z=window.getComputedStyle(s),K=z.cssText?z.cssText:Array.from(z).reduce((O,V)=>`${O}${V}:${z.getPropertyValue(V)};`,"");g.style.cssText=K,g.style.position="absolute",g.style.top="-9999px",g.style.left="-9999px",g.style.visibility="hidden",g.style.pointerEvents="none",g.appendChild(c),document.body.appendChild(g),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),m=c.getBoundingClientRect(),document.body.removeChild(g)}else{let g=document.createElement("div");g.style.position="absolute",g.style.top="-9999px",g.style.left="-9999px",g.style.visibility="hidden",g.appendChild(c),document.body.appendChild(g),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),m=c.getBoundingClientRect(),document.body.removeChild(g)}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),e.replaceWith(i);let f=n.exit?.delayMs??n.delayMs,A=n.exit?.durationMs??n.durationMs,R=n.enter?.delayMs??n.delayMs,T=n.enter?.durationMs??n.durationMs,h=[],w=this.resolveKeyframes(n.exit?.keyframes),S=l.animate(w,{duration:A,delay:f,easing:n.easing,fill:"forwards"});h.push(S);let L=this.resolveKeyframes(n.enter?.keyframes),N=c.animate(L,{duration:T,delay:R,easing:n.easing,fill:"forwards"});if(h.push(N),n.animateSize){let g=i.animate([{width:`${o.width}px`,height:`${o.height}px`},{width:`${m.width}px`,height:`${m.height}px`}],{duration:T,delay:R,easing:n.easing,fill:"forwards"});h.push(g)}return await Promise.all(h.map(g=>g.finished)),i.parentNode&&i.replaceWith(c),c.style.cssText=d,l.remove(),c});b(this,"enter",(e,r)=>{let n=r.enter?.delayMs??r.delayMs,i=r.enter?.durationMs??r.durationMs,o=this.resolveKeyframes(r.enter?.keyframes);return e.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});b(this,"exit",(e,r)=>{let n=r.exit?.delayMs??r.delayMs,i=r.exit?.durationMs??r.durationMs,o=this.resolveKeyframes(r.exit?.keyframes);return e.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});b(this,"resolveKeyframes",e=>e?Array.isArray(e)?e:[e]:[]);b(this,"applyTextAnimationToNode",(e,r,n)=>{let i=r.delayMs??0,o=window.getComputedStyle(e),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 R=s.split(/(\s+)/),T=document.createDocumentFragment(),h=c;return R.forEach(w=>{if(w.length===0)return;if(w.trim().length===0){T.appendChild(document.createTextNode(w));return}let S=document.createElement("span");S.style.display="inline-block",S.style.whiteSpace="nowrap",d&&(S.style.setProperty("background","inherit"),S.style.setProperty("-webkit-background-clip","text"),S.style.setProperty("background-clip","text"),S.style.setProperty("color","transparent")),w.split("").forEach(N=>{let g=document.createElement("span");g.textContent=N,g.style.display="inline-block",g.style.opacity="0",d&&(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.paddingBottom="0.1em",g.style.marginBottom="-0.1em");let z=this.resolveKeyframes(r.keyframes),K=r.durationMs??n.durationMs??300,O=n.easing??"ease",V=g.animate(z,{duration:K,easing:O,delay:h,fill:"forwards"});V.addEventListener("finish",()=>{V.commitStyles(),V.cancel()}),S.appendChild(g),h+=r.staggerMs??50}),T.appendChild(S)}),u.parentNode?.replaceChild(T,u),h}let m;switch(r.by){case"word":m=s.split(/(\s+)/);break;case"line":m=s.split(`
91
91
  `);break;default:m=s.split("")}let f=document.createDocumentFragment(),A=c;return m.forEach(R=>{if(R.length===0)return;if(R.trim().length===0){f.appendChild(document.createTextNode(R));return}let h=document.createElement("span");h.textContent=R,h.style.display="inline-block",h.style.opacity="0",d&&(h.style.setProperty("background","inherit"),h.style.setProperty("-webkit-background-clip","text"),h.style.setProperty("background-clip","text"),h.style.setProperty("color","transparent"),h.style.setProperty("will-change","opacity, transform"));let w=this.resolveKeyframes(r.keyframes),S=r.durationMs??n.durationMs??300,L=n.easing??"ease",N=h.animate(w,{duration:S,easing:L,delay:A,fill:"forwards"});N.addEventListener("finish",()=>{N.commitStyles(),N.cancel()}),f.appendChild(h),A+=r.staggerMs??50}),u.parentNode?.replaceChild(f,u),A}if(u.nodeType===Node.ELEMENT_NODE){let s=c,m=Array.from(u.childNodes);for(let f of m)s=l(f,s,d);return s}return c};l(e,i,a)})}},Ut=new Set(["Replace","InsertBefore","InsertAfter","Delete","SetFormField"]),Kt=t=>typeof t=="string",Hr=t=>Array.isArray(t)&&t.every(e=>Kt(e)),Ir=t=>typeof t=="string"&&Ut.has(t),Fr=t=>{if(typeof t!="object"||t===null)return!1;let e=t;return Kt(e.identifier)&&typeof e.markup=="string"&&Hr(e.selectorGuesses)&&Ir(e.action)&&(e.transition===void 0||Nr(e.transition))},Or=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((r,n)=>{if(!Fr(r))throw new Error(`Invalid transformation at index ${n}`)}),e},Qe=class{constructor(e){b(this,"config");b(this,"changeStack",new Map);b(this,"visitorKey",null);b(this,"orchestrator");b(this,"cueCardInstance",null);b(this,"currentPath");b(this,"currentUrl");b(this,"navTicking",!1);b(this,"transitionDefaults");b(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)}});b(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 "${Ht}"`,"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(e,n);this.log("debug",`Transformation complete, took ${this.formatThousands(i)} ms`)}catch(e){this.log("error","An unexpected, top-level error occurred during transformation",e)}});b(this,"log",(e,r,...n)=>{let a=`${`[Kenobi \u25D4] (v${typeof window.__KENOBI_VERSION__<"u"?window.__KENOBI_VERSION__:"dev"})`} [${e.toLocaleUpperCase()}] :: ${r}`;switch(e){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}});b(this,"resolveTransitionConfig",e=>Mr(this.transitionDefaults,e));b(this,"retrieveElement",e=>{if(!Array.isArray(e)||e.some(r=>typeof r!="string"))throw new Error(`Invalid selectorGuesses payload received: expected array of strings but got ${JSON.stringify(e)}`);for(let r of e){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: ${e.join(", ")}`)});b(this,"getQueryParam",e=>new URLSearchParams(window.location.search).get(e));b(this,"getCurrentPath",()=>window.location.pathname);b(this,"getCurrentUrl",()=>window.location.pathname+window.location.search+window.location.hash);b(this,"getDurationInMilliseconds",(e,r)=>+r-+e);b(this,"formatThousands",e=>new Intl.NumberFormat("en-US").format(e));b(this,"setDebug",e=>this.config.debug=e);b(this,"isInputElement",e=>!(!(e instanceof HTMLInputElement)&&!(e instanceof HTMLTextAreaElement)&&!(e instanceof HTMLSelectElement)));b(this,"waitForFrames",()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e))));b(this,"waitForIdle",(e=1e3)=>new Promise(r=>"requestIdleCallback"in window?window.requestIdleCallback(()=>r(),{timeout:e}):setTimeout(r,50)));b(this,"waitForLoaded",()=>document.readyState==="complete"?Promise.resolve():new Promise(e=>window.addEventListener("load",()=>e(),{once:!0})));b(this,"waitForQuietDom",(e,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()+e;(function l(){let u=performance.now();if(u-i>=r){o.disconnect(),n();return}if(u>=a){o.disconnect(),n();return}requestAnimationFrame(l)})()}));b(this,"isFramer",()=>{let e=Array.from(document.scripts).map(n=>n.src||"");return["__framer_events"in window,document.querySelector("[data-framer-root],[data-framer-component],[data-framer-page]"),e.some(n=>/framerusercontent\.com\/sites/i.test(n))].some(n=>!!n)});b(this,"syncVisitorKey",()=>{try{let e=this.getQueryParam(Ht);e?(this.log("debug",`Query param value found (${e}), pushing into session storage`),sessionStorage.setItem(It,e),this.visitorKey=e):this.visitorKey=sessionStorage.getItem(It)}catch(e){this.log("error","Failed to sync visitor key with error:",e)}});b(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()))}))};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 r=history.pushState.bind(history),n=history.replaceState.bind(history);history.pushState=((...i)=>{let o=r(...i);return e("pushState"),o}),history.replaceState=((...i)=>{let o=n(...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)});b(this,"getTransformations",async(e,r)=>{let n=new URLSearchParams({path:e}),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 Or(o)});b(this,"validateTransitionPreconditions",(e,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 "${e}" was skipped: A transition was requested, but the element is not animatable.`),!1}return!0});b(this,"applyTransformations",async(e,r)=>{this.log("debug",`Starting ${e.length} transformations`),r?.shouldConsolidate&&this.changeStack.forEach((n,i)=>{e.find(a=>a.identifier===i)&&this.undo(i)});for(let{identifier:n,...i}of e)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)}});b(this,"setOrUpdateReplaceChangeRef",(e,r,n)=>{let i=this.changeStack.get(e);if(!i){n.setAttribute(re,e),this.changeStack.set(e,{undoOpts:{type:"Replace",ref:n,content:r}});return}let o=i.undoOpts.ref;o&&o!==n&&o.isConnected&&o.removeAttribute(re),n.setAttribute(re,e),i.undoOpts.ref=n});b(this,"syncChangeStack",()=>{let e=0;for(let[r,n]of this.changeStack){let i=n.undoOpts.ref;if(!(!!i&&(i.isConnected||document.contains(i)))){this.changeStack.delete(r),e++;continue}i.getAttribute(re)!==r&&(this.changeStack.delete(r),e++)}this.log("debug",`syncChangeStack pruned ${this.formatThousands(e)} stale entries`)});b(this,"undo",e=>{let r=this.changeStack.get(e);if(r===void 0)throw new Error(`Cannot undo stack item with identifier ${e} 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(e)});b(this,"undoAll",()=>{this.changeStack.forEach((e,r)=>this.undo(r))});b(this,"setInputValue",(e,r)=>{let n=e instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(n,"value");if(!i?.set)throw new Error("No value setter found");i.set.call(e,r),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))});b(this,"initCueCard",()=>{if(this.cueCardInstance){this.log("warn","CueCard already initialized, skipping...");return}this.cueCardInstance=new ye({theme:"light",position:"top-center",fields:[{name:"companyDomain",label:"Company Name or Domain",placeholder:"example.com",required:!0,minLength:3,errorMessage:"Company name or domain is required"}],hasPersonalization:!0,isVisible:!0,enableFocusMode:!0,showKeyboardHints:!0,focusBlurIntensity:"8px",focusDelayMs:2e3,enableLauncher:!0,onSubmitPersonalization:e=>{this.log("debug","CueCard submitted:",e),this.personalize(e)},onOpenChange:e=>{this.log("debug","CueCard open state changed:",e)}}),this.cueCardInstance.mount(),this.log("debug","CueCard mounted successfully")});b(this,"personalize",async e=>{if(!this.config.publicKey){this.log("error","Cannot personalize: publicKey not configured");return}let r=new Date;this.log("debug","Starting personalization with input:",e),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:e,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})}});b(this,"getCueCard",()=>this.cueCardInstance);this.config={apiHost:"https://kenobi.ai/api",debug:!1,autoTransform:!0,...e},this.transitionDefaults=Ar(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, auto-mounting CueCard..."),this.initCueCard())}};return Jt(zr);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kenobi-js",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "Kenobi JavaScript SDK",
5
5
  "main": "browser/dist.min.js",
6
6
  "exports": {