@evelan/jexity-widget 0.0.1 → 0.2.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +574 -429
- package/dist/index.mjs.map +1 -1
- package/dist/types/app.d.ts.map +1 -1
- package/dist/types/i18n/index.d.ts +18 -0
- package/dist/types/i18n/index.d.ts.map +1 -0
- package/dist/types/i18n/locales/de.d.ts +3 -0
- package/dist/types/i18n/locales/de.d.ts.map +1 -0
- package/dist/types/i18n/locales/en.d.ts +14 -0
- package/dist/types/i18n/locales/en.d.ts.map +1 -0
- package/dist/types/i18n/resolve-widget-locale.d.ts +13 -0
- package/dist/types/i18n/resolve-widget-locale.d.ts.map +1 -0
- package/dist/types/types.d.ts +57 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/widget-state.d.ts +5 -0
- package/dist/types/widget-state.d.ts.map +1 -1
- package/dist/widget.js +2 -2
- package/dist/widget.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAA;IACzC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE;QACH,wCAAwC;QACxC,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,iCAAiC;QACjC,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,qCAAqC;QACrC,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,oCAAoC;QACpC,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,6BAA6B;QAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,6BAA6B;QAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,IAAI,CAAC,EAAE;QACL,iCAAiC;QACjC,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,8BAA8B;QAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,6BAA6B;QAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,8BAA8B;QAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,iCAAiC;QACjC,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,MAAM,CAAC,EAAE;QACP,+BAA+B;QAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,+BAA+B;QAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAA;IACzC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;CACzD"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const isOpen: import("@preact/signals").Signal<boolean>;
|
|
2
|
+
/**
|
|
3
|
+
* Active locale for the widget UI.
|
|
4
|
+
* Initialised to 'de' (default); overridden in App's useEffect via resolveWidgetLocale.
|
|
5
|
+
*/
|
|
6
|
+
export declare const locale: import("@preact/signals").Signal<"en" | "de">;
|
|
2
7
|
//# sourceMappingURL=widget-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-state.d.ts","sourceRoot":"","sources":["../../src/widget-state.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,2CAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"widget-state.d.ts","sourceRoot":"","sources":["../../src/widget-state.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,2CAAgB,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,MAAM,+CAA4B,CAAA"}
|
package/dist/widget.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.jex-widget{--jex-primary: #
|
|
2
|
-
(function(){"use strict";var Z,d,we,$e,U,ke,xe,Se,Ce,se,ue,le,I={},Ne=[],ht=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,L=Array.isArray;function N(t,e){for(var i in e)t[i]=e[i];return t}function ae(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function O(t,e,i){var n,o,r,s={};for(r in e)r=="key"?n=e[r]:r=="ref"?o=e[r]:s[r]=e[r];if(arguments.length>2&&(s.children=arguments.length>3?Z.call(arguments,2):i),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)s[r]===void 0&&(s[r]=t.defaultProps[r]);return G(t,s,n,o,null)}function G(t,e,i,n,o){var r={type:t,props:e,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++we,__i:-1,__u:0};return o==null&&d.vnode!=null&&d.vnode(r),r}function F(t){return t.children}function W(t,e){this.props=t,this.context=e}function T(t,e){if(e==null)return t.__?T(t.__,t.__i+1):null;for(var i;e<t.__k.length;e++)if((i=t.__k[e])!=null&&i.__e!=null)return i.__e;return typeof t.type=="function"?T(t):null}function Ae(t){var e,i;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((i=t.__k[e])!=null&&i.__e!=null){t.__e=t.__c.base=i.__e;break}return Ae(t)}}function Ee(t){(!t.__d&&(t.__d=!0)&&U.push(t)&&!K.__r++||ke!=d.debounceRendering)&&((ke=d.debounceRendering)||xe)(K)}function K(){for(var t,e,i,n,o,r,s,l=1;U.length;)U.length>l&&U.sort(Se),t=U.shift(),l=U.length,t.__d&&(i=void 0,n=void 0,o=(n=(e=t).__v).__e,r=[],s=[],e.__P&&((i=N({},n)).__v=n.__v+1,d.vnode&&d.vnode(i),fe(e.__P,i,n,e.__n,e.__P.namespaceURI,32&n.__u?[o]:null,r,o??T(n),!!(32&n.__u),s),i.__v=n.__v,i.__.__k[i.__i]=i,je(r,i,s),n.__e=n.__=null,i.__e!=o&&Ae(i)));K.__r=0}function He(t,e,i,n,o,r,s,l,a,u,c){var _,h,f,b,S,w,p,y=n&&n.__k||Ne,E=e.length;for(a=dt(i,e,y,a,E),_=0;_<E;_++)(f=i.__k[_])!=null&&(h=f.__i==-1?I:y[f.__i]||I,f.__i=_,w=fe(t,f,h,o,r,s,l,a,u,c),b=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&he(h.ref,null,f),c.push(f.ref,f.__c||b,f)),S==null&&b!=null&&(S=b),(p=!!(4&f.__u))||h.__k===f.__k?a=Ue(f,a,t,p):typeof f.type=="function"&&w!==void 0?a=w:b&&(a=b.nextSibling),f.__u&=-7);return i.__e=S,a}function dt(t,e,i,n,o){var r,s,l,a,u,c=i.length,_=c,h=0;for(t.__k=new Array(o),r=0;r<o;r++)(s=e[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(a=r+h,(s=t.__k[r]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?G(null,s,null,null,null):L(s)?G(F,{children:s},null,null,null):s.constructor==null&&s.__b>0?G(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,l=null,(u=s.__i=vt(s,i,a,_))!=-1&&(_--,(l=i[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(o>c?h--:o<c&&h++),typeof s.type!="function"&&(s.__u|=4)):u!=a&&(u==a-1?h--:u==a+1?h++:(u>a?h--:h++,s.__u|=4))):t.__k[r]=null;if(_)for(r=0;r<c;r++)(l=i[r])!=null&&(2&l.__u)==0&&(l.__e==n&&(n=T(l)),Ie(l,l));return n}function Ue(t,e,i,n){var o,r;if(typeof t.type=="function"){for(o=t.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=t,e=Ue(o[r],e,i,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=T(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Pe(t,e){return e=e||[],t==null||typeof t=="boolean"||(L(t)?t.some(function(i){Pe(i,e)}):e.push(t)),e}function vt(t,e,i,n){var o,r,s,l=t.key,a=t.type,u=e[i],c=u!=null&&(2&u.__u)==0;if(u===null&&t.key==null||c&&l==u.key&&a==u.type)return i;if(n>(c?1:0)){for(o=i-1,r=i+1;o>=0||r<e.length;)if((u=e[s=o>=0?o--:r++])!=null&&(2&u.__u)==0&&l==u.key&&a==u.type)return s}return-1}function Te(t,e,i){e[0]=="-"?t.setProperty(e,i??""):t[e]=i==null?"":typeof i!="number"||ht.test(e)?i:i+"px"}function X(t,e,i,n,o){var r,s;e:if(e=="style")if(typeof i=="string")t.style.cssText=i;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)i&&e in i||Te(t.style,e,"");if(i)for(e in i)n&&i[e]==n[e]||Te(t.style,e,i[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(Ce,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=i,i?n?i.u=n.u:(i.u=se,t.addEventListener(e,r?le:ue,r)):t.removeEventListener(e,r?le:ue,r);else{if(o=="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]=i??"";break e}catch{}typeof i=="function"||(i==null||i===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&i==1?"":i))}}function Me(t){return function(e){if(this.l){var i=this.l[e.type+t];if(e.t==null)e.t=se++;else if(e.t<i.u)return;return i(d.event?d.event(e):e)}}}function fe(t,e,i,n,o,r,s,l,a,u){var c,_,h,f,b,S,w,p,y,E,H,oe,J,ct,_e,V,be,C=e.type;if(e.constructor!=null)return null;128&i.__u&&(a=!!(32&i.__u),r=[l=e.__e=i.__e]),(c=d.__b)&&c(e);e:if(typeof C=="function")try{if(p=e.props,y="prototype"in C&&C.prototype.render,E=(c=C.contextType)&&n[c.__c],H=c?E?E.props.value:c.__:n,i.__c?w=(_=e.__c=i.__c).__=_.__E:(y?e.__c=_=new C(p,H):(e.__c=_=new W(p,H),_.constructor=C,_.render=yt),E&&E.sub(_),_.props=p,_.state||(_.state={}),_.context=H,_.__n=n,h=_.__d=!0,_.__h=[],_._sb=[]),y&&_.__s==null&&(_.__s=_.state),y&&C.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=N({},_.__s)),N(_.__s,C.getDerivedStateFromProps(p,_.__s))),f=_.props,b=_.state,_.__v=e,h)y&&C.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),y&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(y&&C.getDerivedStateFromProps==null&&p!==f&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(p,H),!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(p,_.__s,H)===!1||e.__v==i.__v){for(e.__v!=i.__v&&(_.props=p,_.state=_.__s,_.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some(function(D){D&&(D.__=e)}),oe=0;oe<_._sb.length;oe++)_.__h.push(_._sb[oe]);_._sb=[],_.__h.length&&s.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(p,_.__s,H),y&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(f,b,S)})}if(_.context=H,_.props=p,_.__P=t,_.__e=!1,J=d.__r,ct=0,y){for(_.state=_.__s,_.__d=!1,J&&J(e),c=_.render(_.props,_.state,_.context),_e=0;_e<_._sb.length;_e++)_.__h.push(_._sb[_e]);_._sb=[]}else do _.__d=!1,J&&J(e),c=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++ct<25);_.state=_.__s,_.getChildContext!=null&&(n=N(N({},n),_.getChildContext())),y&&!h&&_.getSnapshotBeforeUpdate!=null&&(S=_.getSnapshotBeforeUpdate(f,b)),V=c,c!=null&&c.type===F&&c.key==null&&(V=De(c.props.children)),l=He(t,L(V)?V:[V],e,i,n,o,r,s,l,a,u),_.base=e.__e,e.__u&=-161,_.__h.length&&s.push(_),w&&(_.__E=_.__=null)}catch(D){if(e.__v=null,a||r!=null)if(D.then){for(e.__u|=a?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;r[r.indexOf(l)]=null,e.__e=l}else{for(be=r.length;be--;)ae(r[be]);ce(e)}else e.__e=i.__e,e.__k=i.__k,D.then||ce(e);d.__e(D,e,i)}else r==null&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):l=e.__e=pt(i.__e,e,i,n,o,r,s,a,u);return(c=d.diffed)&&c(e),128&e.__u?void 0:l}function ce(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(ce)}function je(t,e,i){for(var n=0;n<i.length;n++)he(i[n],i[++n],i[++n]);d.__c&&d.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(r){r.call(o)})}catch(r){d.__e(r,o.__v)}})}function De(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:L(t)?t.map(De):N({},t)}function pt(t,e,i,n,o,r,s,l,a){var u,c,_,h,f,b,S,w=i.props,p=e.props,y=e.type;if(y=="svg"?o="http://www.w3.org/2000/svg":y=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),r!=null){for(u=0;u<r.length;u++)if((f=r[u])&&"setAttribute"in f==!!y&&(y?f.localName==y:f.nodeType==3)){t=f,r[u]=null;break}}if(t==null){if(y==null)return document.createTextNode(p);t=document.createElementNS(o,y,p.is&&p),l&&(d.__m&&d.__m(e,r),l=!1),r=null}if(y==null)w===p||l&&t.data==p||(t.data=p);else{if(r=r&&Z.call(t.childNodes),w=i.props||I,!l&&r!=null)for(w={},u=0;u<t.attributes.length;u++)w[(f=t.attributes[u]).name]=f.value;for(u in w)if(f=w[u],u!="children"){if(u=="dangerouslySetInnerHTML")_=f;else if(!(u in p)){if(u=="value"&&"defaultValue"in p||u=="checked"&&"defaultChecked"in p)continue;X(t,u,null,f,o)}}for(u in p)f=p[u],u=="children"?h=f:u=="dangerouslySetInnerHTML"?c=f:u=="value"?b=f:u=="checked"?S=f:l&&typeof f!="function"||w[u]===f||X(t,u,f,w[u],o);if(c)l||_&&(c.__html==_.__html||c.__html==t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(_&&(t.innerHTML=""),He(e.type=="template"?t.content:t,L(h)?h:[h],e,i,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":o,r,s,r?r[0]:i.__k&&T(i,0),l,a),r!=null)for(u=r.length;u--;)ae(r[u]);l||(u="value",y=="progress"&&b==null?t.removeAttribute("value"):b!=null&&(b!==t[u]||y=="progress"&&!b||y=="option"&&b!=w[u])&&X(t,u,b,w[u],o),u="checked",S!=null&&S!=t[u]&&X(t,u,S,w[u],o))}return t}function he(t,e,i){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(o){d.__e(o,i)}}function Ie(t,e,i){var n,o;if(d.unmount&&d.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||he(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){d.__e(r,e)}n.base=n.__P=null}if(n=t.__k)for(o=0;o<n.length;o++)n[o]&&Ie(n[o],e,i||typeof t.type!="function");i||ae(t.__e),t.__c=t.__=t.__e=void 0}function yt(t,e,i){return this.constructor(t,i)}function Le(t,e,i){var n,o,r,s;e==document&&(e=document.documentElement),d.__&&d.__(t,e),o=(n=!1)?null:e.__k,r=[],s=[],fe(e,t=e.__k=O(F,null,[t]),o||I,I,e.namespaceURI,o?null:e.firstChild?Z.call(e.childNodes):null,r,o?o.__e:e.firstChild,n,s),je(r,t,s)}Z=Ne.slice,d={__e:function(t,e,i,n){for(var o,r,s;e=e.__;)if((o=e.__c)&&!o.__)try{if((r=o.constructor)&&r.getDerivedStateFromError!=null&&(o.setState(r.getDerivedStateFromError(t)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,n||{}),s=o.__d),s)return o.__E=o}catch(l){t=l}throw t}},we=0,$e=function(t){return t!=null&&t.constructor==null},W.prototype.setState=function(t,e){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=N({},this.state),typeof t=="function"&&(t=t(N({},i),this.props)),t&&N(i,t),t!=null&&this.__v&&(e&&this._sb.push(e),Ee(this))},W.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ee(this))},W.prototype.render=F,U=[],xe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Se=function(t,e){return t.__v.__b-e.__v.__b},K.__r=0,Ce=/(PointerCapture)$|Capture$/i,se=0,ue=Me(!1),le=Me(!0);var mt=0;function $(t,e,i,n,o,r){e||(e={});var s,l,a=e;if("ref"in a)for(l in a={},e)l=="ref"?s=e[l]:a[l]=e[l];var u={type:t,props:a,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mt,__i:-1,__u:0,__source:o,__self:r};if(typeof t=="function"&&(s=t.defaultProps))for(l in s)a[l]===void 0&&(a[l]=s[l]);return d.vnode&&d.vnode(u),u}var Y,m,de,Oe,ve=0,Fe=[],g=d,We=g.__b,qe=g.__r,Re=g.diffed,ze=g.__c,Be=g.unmount,Je=g.__;function Ve(t,e){g.__h&&g.__h(m,t,ve||e),ve=0;var i=m.__H||(m.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Ze(t){return ve=1,gt(Xe,t)}function gt(t,e,i){var n=Ve(Y++,2);if(n.t=t,!n.__c&&(n.__=[Xe(void 0,e),function(l){var a=n.__N?n.__N[0]:n.__[0],u=n.t(a,l);a!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=m,!m.__f)){var o=function(l,a,u){if(!n.__c.__H)return!0;var c=n.__c.__H.__.filter(function(h){return!!h.__c});if(c.every(function(h){return!h.__N}))return!r||r.call(this,l,a,u);var _=n.__c.props!==l;return c.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(_=!0)}}),r&&r.call(this,l,a,u)||_};m.__f=!0;var r=m.shouldComponentUpdate,s=m.componentWillUpdate;m.componentWillUpdate=function(l,a,u){if(this.__e){var c=r;r=void 0,o(l,a,u),r=c}s&&s.call(this,l,a,u)},m.shouldComponentUpdate=o}return n.__N||n.__}function Ge(t,e){var i=Ve(Y++,7);return $t(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function bt(){for(var t;t=Fe.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Q),t.__H.__h.forEach(pe),t.__H.__h=[]}catch(e){t.__H.__h=[],g.__e(e,t.__v)}}g.__b=function(t){m=null,We&&We(t)},g.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Je&&Je(t,e)},g.__r=function(t){qe&&qe(t),Y=0;var e=(m=t.__c).__H;e&&(de===m?(e.__h=[],m.__h=[],e.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(e.__h.forEach(Q),e.__h.forEach(pe),e.__h=[],Y=0)),de=m},g.diffed=function(t){Re&&Re(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Fe.push(e)!==1&&Oe===g.requestAnimationFrame||((Oe=g.requestAnimationFrame)||wt)(bt)),e.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),de=m=null},g.__c=function(t,e){e.some(function(i){try{i.__h.forEach(Q),i.__h=i.__h.filter(function(n){return!n.__||pe(n)})}catch(n){e.some(function(o){o.__h&&(o.__h=[])}),e=[],g.__e(n,i.__v)}}),ze&&ze(t,e)},g.unmount=function(t){Be&&Be(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach(function(n){try{Q(n)}catch(o){e=o}}),i.__H=void 0,e&&g.__e(e,i.__v))};var Ke=typeof requestAnimationFrame=="function";function wt(t){var e,i=function(){clearTimeout(n),Ke&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(i,35);Ke&&(e=requestAnimationFrame(i))}function Q(t){var e=m,i=t.__c;typeof i=="function"&&(t.__c=void 0,i()),m=e}function pe(t){var e=m;t.__c=t.__(),m=e}function $t(t,e){return!t||t.length!==e.length||e.some(function(i,n){return i!==t[n]})}function Xe(t,e){return typeof e=="function"?e(t):e}const kt=(...t)=>t.filter((e,i,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===i).join(" ").trim();const Ye=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const xt=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,i,n)=>n?n.toUpperCase():i.toLowerCase());const Qe=t=>{const e=xt(t);return e.charAt(0).toUpperCase()+e.slice(1)};var St={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};const Ct=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const Nt=({color:t="currentColor",size:e=24,strokeWidth:i=2,absoluteStrokeWidth:n,children:o,iconNode:r,class:s="",...l})=>O("svg",{...St,width:String(e),height:e,stroke:t,"stroke-width":n?Number(i)*24/Number(e):i,class:["lucide",s].join(" "),...!o&&!Ct(l)&&{"aria-hidden":"true"},...l},[...r.map(([a,u])=>O(a,u)),...Pe(o)]);const ee=(t,e)=>{const i=({class:n="",className:o="",children:r,...s})=>O(Nt,{...s,iconNode:e,class:kt(`lucide-${Ye(Qe(t))}`,`lucide-${Ye(t)}`,n,o)},r);return i.displayName=Qe(t),i};const At=ee("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const Et=ee("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]);const Ht=ee("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Ut=ee("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Pt=Symbol.for("preact-signals");function te(){if(A>1)A--;else{for(var t,e=!1;q!==void 0;){var i=q;for(q=void 0,ye++;i!==void 0;){var n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&it(i))try{i.c()}catch(o){e||(t=o,e=!0)}i=n}}if(ye=0,A--,e)throw t}}function Tt(t){if(A>0)return t();A++;try{return t()}finally{te()}}var v=void 0;function et(t){var e=v;v=void 0;try{return t()}finally{v=e}}var q=void 0,A=0,ye=0,ie=0;function tt(t){if(v!==void 0){var e=t.n;if(e===void 0||e.t!==v)return e={i:0,S:t,p:v.s,n:void 0,t:v,e:void 0,x:void 0,r:e},v.s!==void 0&&(v.s.n=e),v.s=e,t.n=e,32&v.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=v.s,e.n=void 0,v.s.n=e,v.s=e),e}}function k(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}k.prototype.brand=Pt,k.prototype.h=function(){return!0},k.prototype.S=function(t){var e=this,i=this.t;i!==t&&t.e===void 0&&(t.x=i,this.t=t,i!==void 0?i.e=t:et(function(){var n;(n=e.W)==null||n.call(e)}))},k.prototype.U=function(t){var e=this;if(this.t!==void 0){var i=t.e,n=t.x;i!==void 0&&(i.x=n,t.e=void 0),n!==void 0&&(n.e=i,t.x=void 0),t===this.t&&(this.t=n,n===void 0&&et(function(){var o;(o=e.Z)==null||o.call(e)}))}},k.prototype.subscribe=function(t){var e=this;return R(function(){var i=e.value,n=v;v=void 0;try{t(i)}finally{v=n}},{name:"sub"})},k.prototype.valueOf=function(){return this.value},k.prototype.toString=function(){return this.value+""},k.prototype.toJSON=function(){return this.value},k.prototype.peek=function(){var t=v;v=void 0;try{return this.value}finally{v=t}},Object.defineProperty(k.prototype,"value",{get:function(){var t=tt(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(ye>100)throw new Error("Cycle detected");this.v=t,this.i++,ie++,A++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{te()}}}});function me(t,e){return new k(t,e)}function it(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function nt(t){for(var e=t.s;e!==void 0;e=e.n){var i=e.S.n;if(i!==void 0&&(e.r=i),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function rt(t){for(var e=t.s,i=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):i=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=i}function P(t,e){k.call(this,void 0),this.x=t,this.s=void 0,this.g=ie-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}P.prototype=new k,P.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ie))return!0;if(this.g=ie,this.f|=1,this.i>0&&!it(this))return this.f&=-2,!0;var t=v;try{nt(this),v=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return v=t,rt(this),this.f&=-2,!0},P.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}k.prototype.S.call(this,t)},P.prototype.U=function(t){if(this.t!==void 0&&(k.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},P.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}},Object.defineProperty(P.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=tt(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function ot(t,e){return new P(t,e)}function _t(t){var e=t.u;if(t.u=void 0,typeof e=="function"){A++;var i=v;v=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,ge(t),n}finally{v=i,te()}}}function ge(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,_t(t)}function Mt(t){if(v!==this)throw new Error("Out-of-order effect");rt(this),v=t,this.f&=-2,8&this.f&&ge(this),te()}function M(t,e){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}M.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}},M.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,_t(this),nt(this),A++;var t=v;return v=this,Mt.bind(this,t)},M.prototype.N=function(){2&this.f||(this.f|=2,this.o=q,q=this)},M.prototype.d=function(){this.f|=8,1&this.f||ge(this)},M.prototype.dispose=function(){this.d()};function R(t,e){var i=new M(t,e);try{i.c()}catch(o){throw i.d(),o}var n=i.d.bind(i);return n[Symbol.dispose]=n,n}var st,ne,jt=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,ut=[];R(function(){st=this.N})();function j(t,e){d[t]=e.bind(null,d[t]||function(){})}function re(t){if(ne){var e=ne;ne=void 0,e()}ne=t&&t.S()}function lt(t){var e=this,i=t.data,n=It(i);n.value=i;var o=Ge(function(){for(var l=e,a=e.__v;a=a.__;)if(a.__c){a.__c.__$f|=4;break}var u=ot(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),c=ot(function(){return!Array.isArray(u.value)&&!$e(u.value)}),_=R(function(){if(this.N=at,c.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),h=e.__$u.d;return e.__$u.d=function(){_(),h.call(this)},[c,u]},[]),r=o[0],s=o[1];return r.value?s.peek():s.value}lt.displayName="ReactiveTextNode",Object.defineProperties(k.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:lt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),j("__b",function(t,e){if(typeof e.type=="string"){var i,n=e.props;for(var o in n)if(o!=="children"){var r=n[o];r instanceof k&&(i||(e.__np=i={}),i[o]=r,n[o]=r.peek())}}t(e)}),j("__r",function(t,e){if(t(e),e.type!==F){re();var i,n=e.__c;n&&(n.__$f&=-2,(i=n.__$u)===void 0&&(n.__$u=i=(function(o,r){var s;return R(function(){s=this},{name:r}),s.c=o,s})(function(){var o;jt&&((o=i.y)==null||o.call(i)),n.__$f|=1,n.setState({})},typeof e.type=="function"?e.type.displayName||e.type.name:""))),re(i)}}),j("__e",function(t,e,i,n){re(),t(e,i,n)}),j("diffed",function(t,e){re();var i;if(typeof e.type=="string"&&(i=e.__e)){var n=e.__np,o=e.props;if(n){var r=i.U;if(r)for(var s in r){var l=r[s];l!==void 0&&!(s in n)&&(l.d(),r[s]=void 0)}else r={},i.U=r;for(var a in n){var u=r[a],c=n[a];u===void 0?(u=Dt(i,a,c,o),r[a]=u):u.o(c,o)}}}t(e)});function Dt(t,e,i,n){var o=e in t&&t.ownerSVGElement===void 0,r=me(i);return{o:function(s,l){r.value=s,n=l},d:R(function(){this.N=at;var s=r.value.value;n[e]!==s&&(n[e]=s,o?t[e]=s:s!=null&&(s!==!1||e[4]==="-")?t.setAttribute(e,s):t.removeAttribute(e))})}}j("unmount",function(t,e){if(typeof e.type=="string"){var i=e.__e;if(i){var n=i.U;if(n){i.U=void 0;for(var o in n){var r=n[o];r&&r.d()}}}}else{var s=e.__c;if(s){var l=s.__$u;l&&(s.__$u=void 0,l.d())}}t(e)}),j("__h",function(t,e,i,n){(n<3||n===9)&&(e.__$f|=2),t(e,i,n)}),W.prototype.shouldComponentUpdate=function(t,e){if(this.__R)return!0;var i=this.__$u,n=i&&i.s!==void 0;for(var o in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var r=2&this.__$f;if(!(n||r||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var s in t)if(s!=="__source"&&t[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in t))return!0;return!1};function It(t,e){return Ge(function(){return me(t,e)},[])}var Lt=function(t){queueMicrotask(function(){queueMicrotask(t)})};function Ot(){Tt(function(){for(var t;t=ut.shift();)st.call(t)})}function at(){ut.push(this)===1&&(d.requestAnimationFrame||Lt)(Ot)}const x=me(!1);function Ft({options:t}){const[e,i]=Ze(""),[n,o]=Ze([{id:1,text:t.greeting??`Hi there! This is ${t.orgId} assistant. How can I help you today?`,sender:"bot"}]),r=t.title??"Jexity Assistant",s=t.position==="bottom-left",l=()=>{if(!e.trim())return;const u={id:Date.now(),text:e,sender:"user"};o([...n,u]),i(""),setTimeout(()=>{o(c=>[...c,{id:Date.now()+1,text:`You said: "${e}". This is a demo of the Jexity Chat Widget!`,sender:"bot"}])},1e3)},a=t.primaryColor?{"--jex-primary":t.primaryColor}:void 0;return $("div",{className:"jex-widget",style:a,children:$("div",{className:`jex-container${s?" jex-pos-left":""}`,children:[x.value&&$("div",{className:"jex-chat-window",children:[$("header",{className:"jex-chat-header",children:[$(At,{size:24}),$("div",{className:"jex-header-info",children:[$("h3",{children:r}),$("p",{children:"Online | Typically replies in seconds"})]})]}),$("div",{className:"jex-chat-messages",children:n.map(u=>$("div",{className:`jex-message ${u.sender}`,children:u.text},u.id))}),$("div",{className:"jex-chat-input",children:[$("input",{type:"text",placeholder:"Type a message...",value:e,onInput:u=>i(u.currentTarget.value),onKeyDown:u=>u.key==="Enter"&&l()}),$("button",{className:"jex-send-btn",onClick:l,children:$(Ht,{size:18})})]})]}),$("button",{className:"jex-floating-button",onClick:()=>x.value=!x.value,"aria-label":x.value?"Close chat":"Open chat",children:x.value?$(Ut,{size:28}):$(Et,{size:28})})]})})}let z=null;function Wt(t){z&&z.shutdown();let e;t.container?e=typeof t.container=="string"?document.querySelector(t.container):t.container:(e=document.createElement("div"),e.id="jexity-chat-widget",document.body.appendChild(e)),Le(O(Ft,{options:t}),e);const i=new Set,n=x.subscribe(r=>{for(const s of i)s(r)}),o={shutdown(){n(),i.clear(),Le(null,e),t.container||e.remove(),z===o&&(z=null)},open(){x.value=!0},close(){x.value=!1},toggle(){x.value=!x.value},get isOpen(){return x.value},subscribe(r){return i.add(r),()=>i.delete(r)}};return z=o,o}function B(t,e){return t.getAttribute(e)??void 0}function ft(){const t=document.currentScript??document.querySelector("script[data-org-id]")??document.querySelector("script[org_id]");if(!t)return;const i={orgId:t.getAttribute("data-org-id")??t.getAttribute("org_id")??"default-org",position:B(t,"data-position")??void 0,theme:B(t,"data-theme")??void 0,greeting:B(t,"data-greeting"),title:B(t,"data-title"),primaryColor:B(t,"data-primary-color")};window.JexityChat=Wt(i)}document.readyState==="complete"?ft():window.addEventListener("load",ft)})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.jex-widget{--jex-primary: #115A62;--jex-primary-hover: #0e4e55;--jex-radius: .75rem;--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;--jex-shadow: 0 16px 48px -12px rgba(13, 127, 138, .25), 0 4px 16px rgba(0, 0, 0, .08);pointer-events:auto;--jex-bg-trigger: var(--jex-primary);--jex-bg-header: var(--jex-primary);--jex-bg-msg-user: var(--jex-primary);--jex-bg-send-btn: var(--jex-primary);--jex-bg-window: rgba(255, 255, 255, .95);--jex-bg-msg-bot: #f1f5f9;--jex-bg-input: rgba(247, 253, 253, .6);--jex-text-header: #ffffff;--jex-text-msg-user: #ffffff;--jex-text-msg-bot: #0f172a;--jex-text-main: #0f172a;--jex-text-muted: #64748b;--jex-border-window: rgba(226, 232, 240, .8);--jex-border-input: rgba(203, 213, 225, .8);--jex-bg-glass: var(--jex-bg-window);--jex-border-glass: var(--jex-border-window);font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}.dark .jex-widget,.jex-widget.dark{--jex-primary: #1cb0bf;--jex-primary-hover: #1693a0;--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9)}@media(prefers-color-scheme:dark){:root:not(.light) .jex-widget:not(.light){--jex-primary: #1cb0bf;--jex-primary-hover: #1693a0;--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9)}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}.jex-floating-button{width:56px;height:56px;border-radius:28px;background:var(--jex-bg-trigger);color:var(--jex-text-header);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:380px;height:600px;max-height:calc(100vh - 120px);background:var(--jex-bg-window);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--jex-border-window);border-radius:24px;box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-bg-header);color:var(--jex-text-header);display:flex;align-items:center;gap:12px}.jex-header-info h3{font-size:16px;font-weight:600;color:var(--jex-text-header);margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:var(--jex-text-header);margin:0}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message{max-width:80%;padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{align-self:flex-start;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);color:var(--jex-text-msg-bot);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;background:var(--jex-bg-msg-user);color:var(--jex-text-msg-user);border-bottom-right-radius:4px}.jex-chat-input{padding:16px;border-top:1px solid var(--jex-border-window);display:flex;gap:8px}.jex-chat-input input{flex:1;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.175,.885,.32,1.275)}.jex-send-btn:hover{transform:scale(1.05);background:var(--jex-primary-hover)}.jex-send-btn:active{transform:scale(.95)}.jex-widget-footer{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-top:1px solid var(--jex-border-glass);background:#00000005}.dark .jex-widget .jex-widget-footer,.jex-widget.dark .jex-widget-footer{background:#ffffff05}@media(prefers-color-scheme:dark){:root:not(.light) .jex-widget:not(.light) .jex-widget-footer{background:#ffffff05}}.jex-branding{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--jex-text-muted);font-size:11px;font-weight:500;transition:color .2s}.jex-branding:hover{color:var(--jex-text-main)}.jex-branding-icon{color:var(--jex-primary)}.jex-branding span strong{font-weight:700;color:var(--jex-text-main)}.jex-locale-select-wrapper{position:relative;display:flex;align-items:center}.jex-locale-select{appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;padding:4px 20px 4px 6px;border-radius:6px;font-family:inherit;font-size:11px;font-weight:600;color:var(--jex-text-muted);background-color:transparent;cursor:pointer;outline:none;transition:all .2s ease}.jex-locale-select option{background-color:#fff;color:#0f172a}.jex-locale-select:hover,.jex-locale-select:focus-visible{color:var(--jex-text-main);background:#0000000a}.dark .jex-widget .jex-locale-select:hover,.dark .jex-widget .jex-locale-select:focus-visible,.jex-widget.dark .jex-locale-select:hover,.jex-widget.dark .jex-locale-select:focus-visible{background:#ffffff0d}.dark .jex-widget .jex-locale-select option,.jex-widget.dark .jex-locale-select option{background-color:#0f172a;color:#f8fafc}@media(prefers-color-scheme:dark){:root:not(.light) .jex-widget:not(.light) .jex-locale-select:hover,:root:not(.light) .jex-widget:not(.light) .jex-locale-select:focus-visible{background:#ffffff0d}:root:not(.light) .jex-widget:not(.light) .jex-locale-select option{background-color:#0f172a;color:#f8fafc}}.jex-locale-select:focus-visible{border-color:var(--jex-primary)}.jex-locale-chevron{position:absolute;right:4px;pointer-events:none;color:var(--jex-text-muted);transition:color .2s ease}.jex-locale-select-wrapper:hover .jex-locale-chevron{color:var(--jex-text-main)}')),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
(function(){"use strict";var Q,d,$e,Se,L,Ce,Ne,je,Ae,le,ue,ce,I={},Ee=[],mt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,F=Array.isArray;function N(t,e){for(var n in e)t[n]=e[n];return t}function fe(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function W(t,e,n){var i,r,o,s={};for(o in e)o=="key"?i=e[o]:o=="ref"?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?Q.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return Y(t,s,i,r,null)}function Y(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++$e,__i:-1,__u:0};return r==null&&d.vnode!=null&&d.vnode(o),o}function B(t){return t.children}function q(t,e){this.props=t,this.context=e}function T(t,e){if(e==null)return t.__?T(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"?T(t):null}function Le(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 Le(t)}}function Pe(t){(!t.__d&&(t.__d=!0)&&L.push(t)&&!X.__r++||Ce!=d.debounceRendering)&&((Ce=d.debounceRendering)||Ne)(X)}function X(){for(var t,e,n,i,r,o,s,l=1;L.length;)L.length>l&&L.sort(je),t=L.shift(),l=L.length,t.__d&&(n=void 0,i=void 0,r=(i=(e=t).__v).__e,o=[],s=[],e.__P&&((n=N({},i)).__v=i.__v+1,d.vnode&&d.vnode(n),he(e.__P,n,i,e.__n,e.__P.namespaceURI,32&i.__u?[r]:null,o,r??T(i),!!(32&i.__u),s),n.__v=i.__v,n.__.__k[n.__i]=n,De(o,n,s),i.__e=i.__=null,n.__e!=r&&Le(n)));X.__r=0}function Te(t,e,n,i,r,o,s,l,u,a,h){var _,f,c,w,$,x,y,m=i&&i.__k||Ee,A=e.length;for(u=gt(n,e,m,u,A),_=0;_<A;_++)(c=n.__k[_])!=null&&(f=c.__i==-1?I:m[c.__i]||I,c.__i=_,x=he(t,c,f,r,o,s,l,u,a,h),w=c.__e,c.ref&&f.ref!=c.ref&&(f.ref&&ve(f.ref,null,c),h.push(c.ref,c.__c||w,c)),$==null&&w!=null&&($=w),(y=!!(4&c.__u))||f.__k===c.__k?u=Ue(c,u,t,y):typeof c.type=="function"&&x!==void 0?u=x:w&&(u=w.nextSibling),c.__u&=-7);return n.__e=$,u}function gt(t,e,n,i,r){var o,s,l,u,a,h=n.length,_=h,f=0;for(t.__k=new Array(r),o=0;o<r;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(u=o+f,(s=t.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Y(null,s,null,null,null):F(s)?Y(B,{children:s},null,null,null):s.constructor==null&&s.__b>0?Y(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,l=null,(a=s.__i=bt(s,n,u,_))!=-1&&(_--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(r>h?f--:r<h&&f++),typeof s.type!="function"&&(s.__u|=4)):a!=u&&(a==u-1?f--:a==u+1?f++:(a>u?f--:f++,s.__u|=4))):t.__k[o]=null;if(_)for(o=0;o<h;o++)(l=n[o])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=T(l)),Fe(l,l));return i}function Ue(t,e,n,i){var r,o;if(typeof t.type=="function"){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=Ue(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=T(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function He(t,e){return e=e||[],t==null||typeof t=="boolean"||(F(t)?t.some(function(n){He(n,e)}):e.push(t)),e}function bt(t,e,n,i){var r,o,s,l=t.key,u=t.type,a=e[n],h=a!=null&&(2&a.__u)==0;if(a===null&&t.key==null||h&&l==a.key&&u==a.type)return n;if(i>(h?1:0)){for(r=n-1,o=n+1;r>=0||o<e.length;)if((a=e[s=r>=0?r--:o++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return s}return-1}function Me(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||mt.test(e)?n:n+"px"}function ee(t,e,n,i,r){var o,s;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Me(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Me(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Ae,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n.u=i.u:(n.u=le,t.addEventListener(e,o?ce:ue,o)):t.removeEventListener(e,o?ce:ue,o);else{if(r=="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 Oe(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=le++;else if(e.t<n.u)return;return n(d.event?d.event(e):e)}}}function he(t,e,n,i,r,o,s,l,u,a){var h,_,f,c,w,$,x,y,m,A,E,se,J,yt,ae,K,ke,C=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),o=[l=e.__e=n.__e]),(h=d.__b)&&h(e);e:if(typeof C=="function")try{if(y=e.props,m="prototype"in C&&C.prototype.render,A=(h=C.contextType)&&i[h.__c],E=h?A?A.props.value:h.__:i,n.__c?x=(_=e.__c=n.__c).__=_.__E:(m?e.__c=_=new C(y,E):(e.__c=_=new q(y,E),_.constructor=C,_.render=xt),A&&A.sub(_),_.props=y,_.state||(_.state={}),_.context=E,_.__n=i,f=_.__d=!0,_.__h=[],_._sb=[]),m&&_.__s==null&&(_.__s=_.state),m&&C.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=N({},_.__s)),N(_.__s,C.getDerivedStateFromProps(y,_.__s))),c=_.props,w=_.state,_.__v=e,f)m&&C.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),m&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(m&&C.getDerivedStateFromProps==null&&y!==c&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(y,E),!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(y,_.__s,E)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(_.props=y,_.state=_.__s,_.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(D){D&&(D.__=e)}),se=0;se<_._sb.length;se++)_.__h.push(_._sb[se]);_._sb=[],_.__h.length&&s.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(y,_.__s,E),m&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(c,w,$)})}if(_.context=E,_.props=y,_.__P=t,_.__e=!1,J=d.__r,yt=0,m){for(_.state=_.__s,_.__d=!1,J&&J(e),h=_.render(_.props,_.state,_.context),ae=0;ae<_._sb.length;ae++)_.__h.push(_._sb[ae]);_._sb=[]}else do _.__d=!1,J&&J(e),h=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++yt<25);_.state=_.__s,_.getChildContext!=null&&(i=N(N({},i),_.getChildContext())),m&&!f&&_.getSnapshotBeforeUpdate!=null&&($=_.getSnapshotBeforeUpdate(c,w)),K=h,h!=null&&h.type===B&&h.key==null&&(K=Ie(h.props.children)),l=Te(t,F(K)?K:[K],e,n,i,r,o,s,l,u,a),_.base=e.__e,e.__u&=-161,_.__h.length&&s.push(_),x&&(_.__E=_.__=null)}catch(D){if(e.__v=null,u||o!=null)if(D.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(ke=o.length;ke--;)fe(o[ke]);de(e)}else e.__e=n.__e,e.__k=n.__k,D.then||de(e);d.__e(D,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=wt(n.__e,e,n,i,r,o,s,u,a);return(h=d.diffed)&&h(e),128&e.__u?void 0:l}function de(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(de)}function De(t,e,n){for(var i=0;i<n.length;i++)ve(n[i],n[++i],n[++i]);d.__c&&d.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(o){o.call(r)})}catch(o){d.__e(o,r.__v)}})}function Ie(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:F(t)?t.map(Ie):N({},t)}function wt(t,e,n,i,r,o,s,l,u){var a,h,_,f,c,w,$,x=n.props,y=e.props,m=e.type;if(m=="svg"?r="http://www.w3.org/2000/svg":m=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(a=0;a<o.length;a++)if((c=o[a])&&"setAttribute"in c==!!m&&(m?c.localName==m:c.nodeType==3)){t=c,o[a]=null;break}}if(t==null){if(m==null)return document.createTextNode(y);t=document.createElementNS(r,m,y.is&&y),l&&(d.__m&&d.__m(e,o),l=!1),o=null}if(m==null)x===y||l&&t.data==y||(t.data=y);else{if(o=o&&Q.call(t.childNodes),x=n.props||I,!l&&o!=null)for(x={},a=0;a<t.attributes.length;a++)x[(c=t.attributes[a]).name]=c.value;for(a in x)if(c=x[a],a!="children"){if(a=="dangerouslySetInnerHTML")_=c;else if(!(a in y)){if(a=="value"&&"defaultValue"in y||a=="checked"&&"defaultChecked"in y)continue;ee(t,a,null,c,r)}}for(a in y)c=y[a],a=="children"?f=c:a=="dangerouslySetInnerHTML"?h=c:a=="value"?w=c:a=="checked"?$=c:l&&typeof c!="function"||x[a]===c||ee(t,a,c,x[a],r);if(h)l||_&&(h.__html==_.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(_&&(t.innerHTML=""),Te(e.type=="template"?t.content:t,F(f)?f:[f],e,n,i,m=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&T(n,0),l,u),o!=null)for(a=o.length;a--;)fe(o[a]);l||(a="value",m=="progress"&&w==null?t.removeAttribute("value"):w!=null&&(w!==t[a]||m=="progress"&&!w||m=="option"&&w!=x[a])&&ee(t,a,w,x[a],r),a="checked",$!=null&&$!=t[a]&&ee(t,a,$,x[a],r))}return t}function ve(t,e,n){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(r){d.__e(r,n)}}function Fe(t,e,n){var i,r;if(d.unmount&&d.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||ve(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){d.__e(o,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&Fe(i[r],e,n||typeof t.type!="function");n||fe(t.__e),t.__c=t.__=t.__e=void 0}function xt(t,e,n){return this.constructor(t,n)}function We(t,e,n){var i,r,o,s;e==document&&(e=document.documentElement),d.__&&d.__(t,e),r=(i=!1)?null:e.__k,o=[],s=[],he(e,t=e.__k=W(B,null,[t]),r||I,I,e.namespaceURI,r?null:e.firstChild?Q.call(e.childNodes):null,o,r?r.__e:e.firstChild,i,s),De(o,t,s)}Q=Ee.slice,d={__e:function(t,e,n,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),s=r.__d),s)return r.__E=r}catch(l){t=l}throw t}},$e=0,Se=function(t){return t!=null&&t.constructor==null},q.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=N({},this.state),typeof t=="function"&&(t=t(N({},n),this.props)),t&&N(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Pe(this))},q.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Pe(this))},q.prototype.render=B,L=[],Ne=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,je=function(t,e){return t.__v.__b-e.__v.__b},X.__r=0,Ae=/(PointerCapture)$|Capture$/i,le=0,ue=Oe(!1),ce=Oe(!0);var kt=0;function p(t,e,n,i,r,o){e||(e={});var s,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?s=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--kt,__i:-1,__u:0,__source:r,__self:o};if(typeof t=="function"&&(s=t.defaultProps))for(l in s)u[l]===void 0&&(u[l]=s[l]);return d.vnode&&d.vnode(a),a}var z,g,pe,Be,ye=0,qe=[],b=d,ze=b.__b,Re=b.__r,Ge=b.diffed,Ve=b.__c,Ze=b.unmount,Je=b.__;function me(t,e){b.__h&&b.__h(g,t,ye||e),ye=0;var n=g.__H||(g.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Ke(t){return ye=1,$t(tt,t)}function $t(t,e,n){var i=me(z++,2);if(i.t=t,!i.__c&&(i.__=[tt(void 0,e),function(l){var u=i.__N?i.__N[0]:i.__[0],a=i.t(u,l);u!==a&&(i.__N=[a,i.__[1]],i.__c.setState({}))}],i.__c=g,!g.__f)){var r=function(l,u,a){if(!i.__c.__H)return!0;var h=i.__c.__H.__.filter(function(f){return!!f.__c});if(h.every(function(f){return!f.__N}))return!o||o.call(this,l,u,a);var _=i.__c.props!==l;return h.forEach(function(f){if(f.__N){var c=f.__[0];f.__=f.__N,f.__N=void 0,c!==f.__[0]&&(_=!0)}}),o&&o.call(this,l,u,a)||_};g.__f=!0;var o=g.shouldComponentUpdate,s=g.componentWillUpdate;g.componentWillUpdate=function(l,u,a){if(this.__e){var h=o;o=void 0,r(l,u,a),o=h}s&&s.call(this,l,u,a)},g.shouldComponentUpdate=r}return i.__N||i.__}function Qe(t,e){var n=me(z++,3);!b.__s&&et(n.__H,e)&&(n.__=t,n.u=e,g.__H.__h.push(n))}function Ye(t,e){var n=me(z++,7);return et(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function St(){for(var t;t=qe.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(te),t.__H.__h.forEach(ge),t.__H.__h=[]}catch(e){t.__H.__h=[],b.__e(e,t.__v)}}b.__b=function(t){g=null,ze&&ze(t)},b.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Je&&Je(t,e)},b.__r=function(t){Re&&Re(t),z=0;var e=(g=t.__c).__H;e&&(pe===g?(e.__h=[],g.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(te),e.__h.forEach(ge),e.__h=[],z=0)),pe=g},b.diffed=function(t){Ge&&Ge(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(qe.push(e)!==1&&Be===b.requestAnimationFrame||((Be=b.requestAnimationFrame)||Ct)(St)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),pe=g=null},b.__c=function(t,e){e.some(function(n){try{n.__h.forEach(te),n.__h=n.__h.filter(function(i){return!i.__||ge(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],b.__e(i,n.__v)}}),Ve&&Ve(t,e)},b.unmount=function(t){Ze&&Ze(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{te(i)}catch(r){e=r}}),n.__H=void 0,e&&b.__e(e,n.__v))};var Xe=typeof requestAnimationFrame=="function";function Ct(t){var e,n=function(){clearTimeout(i),Xe&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);Xe&&(e=requestAnimationFrame(n))}function te(t){var e=g,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),g=e}function ge(t){var e=g;t.__c=t.__(),g=e}function et(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function tt(t,e){return typeof e=="function"?e(t):e}const Nt=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim();const nt=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const jt=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase());const it=t=>{const e=jt(t);return e.charAt(0).toUpperCase()+e.slice(1)};var At={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};const Et=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const Lt=({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:i,children:r,iconNode:o,class:s="",...l})=>W("svg",{...At,width:String(e),height:e,stroke:t,"stroke-width":i?Number(n)*24/Number(e):n,class:["lucide",s].join(" "),...!r&&!Et(l)&&{"aria-hidden":"true"},...l},[...o.map(([u,a])=>W(u,a)),...He(r)]);const U=(t,e)=>{const n=({class:i="",className:r="",children:o,...s})=>W(Lt,{...s,iconNode:e,class:Nt(`lucide-${nt(it(t))}`,`lucide-${nt(t)}`,i,r)},o);return n.displayName=it(t),n};const Pt=U("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const Tt=U("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Ut=U("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]);const Ht=U("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Mt=U("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const Ot=U("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var Dt=Symbol.for("preact-signals");function ne(){if(j>1)j--;else{for(var t,e=!1;R!==void 0;){var n=R;for(R=void 0,be++;n!==void 0;){var i=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&_t(n))try{n.c()}catch(r){e||(t=r,e=!0)}n=i}}if(be=0,j--,e)throw t}}function It(t){if(j>0)return t();j++;try{return t()}finally{ne()}}var v=void 0;function rt(t){var e=v;v=void 0;try{return t()}finally{v=e}}var R=void 0,j=0,be=0,ie=0;function ot(t){if(v!==void 0){var e=t.n;if(e===void 0||e.t!==v)return e={i:0,S:t,p:v.s,n:void 0,t:v,e:void 0,x:void 0,r:e},v.s!==void 0&&(v.s.n=e),v.s=e,t.n=e,32&v.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=v.s,e.n=void 0,v.s.n=e,v.s=e),e}}function k(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}k.prototype.brand=Dt,k.prototype.h=function(){return!0},k.prototype.S=function(t){var e=this,n=this.t;n!==t&&t.e===void 0&&(t.x=n,this.t=t,n!==void 0?n.e=t:rt(function(){var i;(i=e.W)==null||i.call(e)}))},k.prototype.U=function(t){var e=this;if(this.t!==void 0){var n=t.e,i=t.x;n!==void 0&&(n.x=i,t.e=void 0),i!==void 0&&(i.e=n,t.x=void 0),t===this.t&&(this.t=i,i===void 0&&rt(function(){var r;(r=e.Z)==null||r.call(e)}))}},k.prototype.subscribe=function(t){var e=this;return G(function(){var n=e.value,i=v;v=void 0;try{t(n)}finally{v=i}},{name:"sub"})},k.prototype.valueOf=function(){return this.value},k.prototype.toString=function(){return this.value+""},k.prototype.toJSON=function(){return this.value},k.prototype.peek=function(){var t=v;v=void 0;try{return this.value}finally{v=t}},Object.defineProperty(k.prototype,"value",{get:function(){var t=ot(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(be>100)throw new Error("Cycle detected");this.v=t,this.i++,ie++,j++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{ne()}}}});function re(t,e){return new k(t,e)}function _t(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function st(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function at(t){for(var e=t.s,n=void 0;e!==void 0;){var i=e.p;e.i===-1?(e.S.U(e),i!==void 0&&(i.n=e.n),e.n!==void 0&&(e.n.p=i)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=i}t.s=n}function P(t,e){k.call(this,void 0),this.x=t,this.s=void 0,this.g=ie-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}P.prototype=new k,P.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ie))return!0;if(this.g=ie,this.f|=1,this.i>0&&!_t(this))return this.f&=-2,!0;var t=v;try{st(this),v=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return v=t,at(this),this.f&=-2,!0},P.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}k.prototype.S.call(this,t)},P.prototype.U=function(t){if(this.t!==void 0&&(k.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},P.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}},Object.defineProperty(P.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=ot(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function lt(t,e){return new P(t,e)}function ut(t){var e=t.u;if(t.u=void 0,typeof e=="function"){j++;var n=v;v=void 0;try{e()}catch(i){throw t.f&=-2,t.f|=8,we(t),i}finally{v=n,ne()}}}function we(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,ut(t)}function Ft(t){if(v!==this)throw new Error("Out-of-order effect");at(this),v=t,this.f&=-2,8&this.f&&we(this),ne()}function H(t,e){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}H.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}},H.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ut(this),st(this),j++;var t=v;return v=this,Ft.bind(this,t)},H.prototype.N=function(){2&this.f||(this.f|=2,this.o=R,R=this)},H.prototype.d=function(){this.f|=8,1&this.f||we(this)},H.prototype.dispose=function(){this.d()};function G(t,e){var n=new H(t,e);try{n.c()}catch(r){throw n.d(),r}var i=n.d.bind(n);return i[Symbol.dispose]=i,i}var ct,oe,Wt=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,ft=[];G(function(){ct=this.N})();function M(t,e){d[t]=e.bind(null,d[t]||function(){})}function _e(t){if(oe){var e=oe;oe=void 0,e()}oe=t&&t.S()}function ht(t){var e=this,n=t.data,i=qt(n);i.value=n;var r=Ye(function(){for(var l=e,u=e.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var a=lt(function(){var c=i.value.value;return c===0?0:c===!0?"":c||""}),h=lt(function(){return!Array.isArray(a.value)&&!Se(a.value)}),_=G(function(){if(this.N=dt,h.value){var c=a.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=c)}}),f=e.__$u.d;return e.__$u.d=function(){_(),f.call(this)},[h,a]},[]),o=r[0],s=r[1];return o.value?s.peek():s.value}ht.displayName="ReactiveTextNode",Object.defineProperties(k.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ht},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),M("__b",function(t,e){if(typeof e.type=="string"){var n,i=e.props;for(var r in i)if(r!=="children"){var o=i[r];o instanceof k&&(n||(e.__np=n={}),n[r]=o,i[r]=o.peek())}}t(e)}),M("__r",function(t,e){if(t(e),e.type!==B){_e();var n,i=e.__c;i&&(i.__$f&=-2,(n=i.__$u)===void 0&&(i.__$u=n=(function(r,o){var s;return G(function(){s=this},{name:o}),s.c=r,s})(function(){var r;Wt&&((r=n.y)==null||r.call(n)),i.__$f|=1,i.setState({})},typeof e.type=="function"?e.type.displayName||e.type.name:""))),_e(n)}}),M("__e",function(t,e,n,i){_e(),t(e,n,i)}),M("diffed",function(t,e){_e();var n;if(typeof e.type=="string"&&(n=e.__e)){var i=e.__np,r=e.props;if(i){var o=n.U;if(o)for(var s in o){var l=o[s];l!==void 0&&!(s in i)&&(l.d(),o[s]=void 0)}else o={},n.U=o;for(var u in i){var a=o[u],h=i[u];a===void 0?(a=Bt(n,u,h,r),o[u]=a):a.o(h,r)}}}t(e)});function Bt(t,e,n,i){var r=e in t&&t.ownerSVGElement===void 0,o=re(n);return{o:function(s,l){o.value=s,i=l},d:G(function(){this.N=dt;var s=o.value.value;i[e]!==s&&(i[e]=s,r?t[e]=s:s!=null&&(s!==!1||e[4]==="-")?t.setAttribute(e,s):t.removeAttribute(e))})}}M("unmount",function(t,e){if(typeof e.type=="string"){var n=e.__e;if(n){var i=n.U;if(i){n.U=void 0;for(var r in i){var o=i[r];o&&o.d()}}}}else{var s=e.__c;if(s){var l=s.__$u;l&&(s.__$u=void 0,l.d())}}t(e)}),M("__h",function(t,e,n,i){(i<3||i===9)&&(e.__$f|=2),t(e,n,i)}),q.prototype.shouldComponentUpdate=function(t,e){if(this.__R)return!0;var n=this.__$u,i=n&&n.s!==void 0;for(var r in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(i||o||4&this.__$f)||1&this.__$f)return!0}else if(!(i||4&this.__$f)||3&this.__$f)return!0;for(var s in t)if(s!=="__source"&&t[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in t))return!0;return!1};function qt(t,e){return Ye(function(){return re(t,e)},[])}var zt=function(t){queueMicrotask(function(){queueMicrotask(t)})};function Rt(){It(function(){for(var t;t=ft.shift();)ct.call(t)})}function dt(){ft.push(this)===1&&(d.requestAnimationFrame||zt)(Rt)}const S=re(!1),V=re("de"),Gt=["en","de"],Vt="de",Zt="jex-locale";function xe(t){if(!t)return null;const e=(t.split("-")[0]??"").toLowerCase();return Gt.includes(e)?e:null}function Jt(t){try{const n=xe(localStorage.getItem(Zt));if(n)return n}catch{}if(typeof navigator<"u"){const n=xe(navigator.language);if(n)return n}const e=xe(t);return e||Vt}const vt={title:"Assistant",statusOnline:"Online · Responds in seconds",inputPlaceholder:"Type a message…",sendAriaLabel:"Send message",openChatAriaLabel:"Open chat",closeChatAriaLabel:"Close chat",errorNetwork:"Network error. Please try again.",errorQuota:"Message limit reached. Please try again later.",localeLabelDe:"DE",localeLabelEn:"EN"},Kt={en:vt,de:{title:"Assistent",statusOnline:"Online · Antwortet in Sekunden",inputPlaceholder:"Nachricht eingeben…",sendAriaLabel:"Nachricht senden",openChatAriaLabel:"Chat öffnen",closeChatAriaLabel:"Chat schließen",errorNetwork:"Netzwerkfehler. Bitte versuche es erneut.",errorQuota:"Nachrichtenlimit erreicht. Bitte versuche es später erneut.",localeLabelDe:"DE",localeLabelEn:"EN"}};function Qt(){return Kt[V.value]??vt}function Yt(t){V.value=t;try{localStorage.setItem("jex-locale",t)}catch{}}function Xt(t){const e={},{primaryColor:n,theme:i}=t;if(n&&(e["--jex-primary"]=n,e["--jex-bg-trigger"]=n,e["--jex-bg-header"]=n,e["--jex-bg-msg-user"]=n,e["--jex-bg-send-btn"]=n),i?.bg){const r=i.bg;r.trigger&&(e["--jex-bg-trigger"]=r.trigger),r.header&&(e["--jex-bg-header"]=r.header),r.msgUser&&(e["--jex-bg-msg-user"]=r.msgUser),r.msgBot&&(e["--jex-bg-msg-bot"]=r.msgBot),r.window&&(e["--jex-bg-window"]=r.window),r.sendBtn&&(e["--jex-bg-send-btn"]=r.sendBtn)}if(i?.text){const r=i.text;r.header&&(e["--jex-text-header"]=r.header),r.msgUser&&(e["--jex-text-msg-user"]=r.msgUser),r.msgBot&&(e["--jex-text-msg-bot"]=r.msgBot),r.main&&(e["--jex-text-main"]=r.main),r.muted&&(e["--jex-text-muted"]=r.muted)}if(i?.border){const r=i.border;r.window&&(e["--jex-border-window"]=r.window),r.input&&(e["--jex-border-input"]=r.input)}return Object.keys(e).length>0?e:void 0}function en(){return p("div",{className:"jex-widget-footer",children:[p("a",{href:"https://jexity.com",target:"_blank",rel:"noopener noreferrer",className:"jex-branding",children:[p(Ot,{size:14,className:"jex-branding-icon"}),p("span",{children:["Powered by ",p("strong",{children:"Jexity"})]})]}),p("div",{className:"jex-locale-select-wrapper",children:[p("select",{className:"jex-locale-select",value:V.value,onChange:t=>Yt(t.currentTarget.value),"aria-label":"Select language",children:[p("option",{value:"de",children:"🇩🇪 Deutsch"}),p("option",{value:"en",children:"🇬🇧 English"})]}),p(Tt,{size:14,className:"jex-locale-chevron"})]})]})}function tn({options:t}){const e=Qt(),[n,i]=Ke(""),[r,o]=Ke([{id:1,text:t.greeting??`Hi there! This is ${t.orgId} assistant. How can I help you today?`,sender:"bot"}]),s=t.position==="bottom-left",l=t.locale;Qe(()=>{V.value=Jt(l)},[l]),Qe(()=>{function f(c){const w=t.parentOrigin??window.location.origin;if(c.origin!==w||c.data?.type!=="jexity:config")return;const{locale:$}=c.data.payload;($==="en"||$==="de")&&(V.value=$)}return window.addEventListener("message",f),()=>window.removeEventListener("message",f)},[t.parentOrigin]);const u=()=>{if(!n.trim())return;const f={id:Date.now(),text:n,sender:"user"};o([...r,f]),i(""),setTimeout(()=>{o(c=>[...c,{id:Date.now()+1,text:`You said: "${n}". This is a demo of the Jexity Chat Widget!`,sender:"bot"}])},1e3)},a=Xt(t),h=t.colorScheme;return p("div",{className:`jex-widget ${h==="dark"||h==="light"?h:""}`.trim(),style:a,children:p("div",{className:`jex-container${s?" jex-pos-left":""}`,children:[S.value&&p("div",{className:"jex-chat-window",children:[p("header",{className:"jex-chat-header",children:[p(Pt,{size:24}),p("div",{className:"jex-header-info",children:[p("h3",{children:t.title??e.title}),p("p",{children:e.statusOnline})]})]}),p("div",{className:"jex-chat-messages",children:r.map(f=>p("div",{className:`jex-message ${f.sender}`,children:f.text},f.id))}),p("div",{className:"jex-chat-input",children:[p("input",{type:"text",placeholder:e.inputPlaceholder,value:n,onInput:f=>i(f.currentTarget.value),onKeyDown:f=>f.key==="Enter"&&u()}),p("button",{className:"jex-send-btn",onClick:u,"aria-label":e.sendAriaLabel,children:p(Ht,{size:18})})]}),p(en,{})]}),p("button",{className:"jex-floating-button",onClick:()=>S.value=!S.value,"aria-label":S.value?e.closeChatAriaLabel:e.openChatAriaLabel,children:S.value?p(Mt,{size:28}):p(Ut,{size:28})})]})})}let Z=null;function nn(t){Z&&Z.shutdown();let e;t.container?e=typeof t.container=="string"?document.querySelector(t.container):t.container:(e=document.createElement("div"),e.id="jexity-chat-widget",document.body.appendChild(e)),We(W(tn,{options:t}),e);const n=new Set,i=S.subscribe(o=>{for(const s of n)s(o)}),r={shutdown(){i(),n.clear(),We(null,e),t.container||e.remove(),Z===r&&(Z=null)},open(){S.value=!0},close(){S.value=!1},toggle(){S.value=!S.value},get isOpen(){return S.value},subscribe(o){return n.add(o),()=>n.delete(o)}};return Z=r,r}function O(t,e){return t.getAttribute(e)??void 0}function pt(){const t=document.currentScript??document.querySelector("script[data-org-id]")??document.querySelector("script[org_id]");if(!t)return;const n={orgId:t.getAttribute("data-org-id")??t.getAttribute("org_id")??"default-org",position:O(t,"data-position")??void 0,theme:O(t,"data-theme")??void 0,greeting:O(t,"data-greeting"),title:O(t,"data-title"),primaryColor:O(t,"data-primary-color"),locale:O(t,"data-locale")};window.JexityChat=nn(n)}document.readyState==="complete"?pt():window.addEventListener("load",pt)})();
|
|
3
3
|
//# sourceMappingURL=widget.js.map
|