ordify-chat-widget 1.0.21 → 1.0.22
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.cjs.js +56 -115
- package/dist/index.esm.js +1051 -2133
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Er=Object.defineProperty;var jr=(t,n,o)=>n in t?Er(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var yt=(t,n,o)=>jr(t,typeof n!="symbol"?n+"":n,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),K=require("styled-components");function Cr(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const c=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,c.get?c:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Mt=Cr(S);var Ye={exports:{}},xe={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var bt;function Rr(){if(bt)return xe;bt=1;var t=S,n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,h=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function g(l,p,w){var v,m={},P=null,k=null;w!==void 0&&(P=""+w),p.key!==void 0&&(P=""+p.key),p.ref!==void 0&&(k=p.ref);for(v in p)c.call(p,v)&&!y.hasOwnProperty(v)&&(m[v]=p[v]);if(l&&l.defaultProps)for(v in p=l.defaultProps,p)m[v]===void 0&&(m[v]=p[v]);return{$$typeof:n,type:l,key:P,ref:k,props:m,_owner:h.current}}return xe.Fragment=o,xe.jsx=g,xe.jsxs=g,xe}var ye={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,96 +14,37 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
17
|
+
*/var vt;function _r(){return vt||(vt=1,process.env.NODE_ENV!=="production"&&function(){var t=S,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),l=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),z=Symbol.iterator,T="@@iterator";function B(e){if(e===null||typeof e!="object")return null;var s=z&&e[z]||e[T];return typeof s=="function"?s:null}var r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function i(e){{for(var s=arguments.length,d=new Array(s>1?s-1:0),b=1;b<s;b++)d[b-1]=arguments[b];a("error",e,d)}}function a(e,s,d){{var b=r.ReactDebugCurrentFrame,_=b.getStackAddendum();_!==""&&(s+="%s",d=d.concat([_]));var $=d.map(function(C){return String(C)});$.unshift("Warning: "+s),Function.prototype.apply.call(console[e],console,$)}}var x=!1,f=!1,j=!1,O=!1,A=!1,D;D=Symbol.for("react.module.reference");function U(e){return!!(typeof e=="string"||typeof e=="function"||e===c||e===y||A||e===h||e===w||e===v||O||e===k||x||f||j||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===p||e.$$typeof===D||e.getModuleId!==void 0))}function I(e,s,d){var b=e.displayName;if(b)return b;var _=s.displayName||s.name||"";return _!==""?d+"("+_+")":d}function F(e){return e.displayName||"Context"}function R(e){if(e==null)return null;if(typeof e.tag=="number"&&i("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case c:return"Fragment";case o:return"Portal";case y:return"Profiler";case h:return"StrictMode";case w:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l:var s=e;return F(s)+".Consumer";case g:var d=e;return F(d._context)+".Provider";case p:return I(e,e.render,"ForwardRef");case m:var b=e.displayName||null;return b!==null?b:R(e.type)||"Memo";case P:{var _=e,$=_._payload,C=_._init;try{return R(C($))}catch{return null}}}return null}var H=Object.assign,L=0,J,G,Z,ae,le,oe,X;function V(){}V.__reactDisabledLog=!0;function te(){{if(L===0){J=console.log,G=console.info,Z=console.warn,ae=console.error,le=console.group,oe=console.groupCollapsed,X=console.groupEnd;var e={configurable:!0,enumerable:!0,value:V,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}L++}}function pe(){{if(L--,L===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},e,{value:J}),info:H({},e,{value:G}),warn:H({},e,{value:Z}),error:H({},e,{value:ae}),group:H({},e,{value:le}),groupCollapsed:H({},e,{value:oe}),groupEnd:H({},e,{value:X})})}L<0&&i("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=r.ReactCurrentDispatcher,me;function ke(e,s,d){{if(me===void 0)try{throw Error()}catch(_){var b=_.stack.trim().match(/\n( *(at )?)/);me=b&&b[1]||""}return`
|
|
18
|
+
`+me+e}}var Pe=!1,we;{var Xt=typeof WeakMap=="function"?WeakMap:Map;we=new Xt}function nt(e,s){if(!e||Pe)return"";{var d=we.get(e);if(d!==void 0)return d}var b;Pe=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $;$=he.current,he.current=null,te();try{if(s){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(Y){b=Y}Reflect.construct(e,[],C)}else{try{C.call()}catch(Y){b=Y}e.call(C.prototype)}}else{try{throw Error()}catch(Y){b=Y}e()}}catch(Y){if(Y&&b&&typeof Y.stack=="string"){for(var E=Y.stack.split(`
|
|
19
|
+
`),W=b.stack.split(`
|
|
20
|
+
`),M=E.length-1,N=W.length-1;M>=1&&N>=0&&E[M]!==W[N];)N--;for(;M>=1&&N>=0;M--,N--)if(E[M]!==W[N]){if(M!==1||N!==1)do if(M--,N--,N<0||E[M]!==W[N]){var q=`
|
|
21
|
+
`+E[M].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),typeof e=="function"&&we.set(e,q),q}while(M>=1&&N>=0);break}}}finally{Pe=!1,he.current=$,pe(),Error.prepareStackTrace=_}var ue=e?e.displayName||e.name:"",ie=ue?ke(ue):"";return typeof e=="function"&&we.set(e,ie),ie}function Qt(e,s,d){return nt(e,!1)}function er(e){var s=e.prototype;return!!(s&&s.isReactComponent)}function Ee(e,s,d){if(e==null)return"";if(typeof e=="function")return nt(e,er(e));if(typeof e=="string")return ke(e);switch(e){case w:return ke("Suspense");case v:return ke("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return Qt(e.render);case m:return Ee(e.type,s,d);case P:{var b=e,_=b._payload,$=b._init;try{return Ee($(_),s,d)}catch{}}}return""}var ge=Object.prototype.hasOwnProperty,at={},ot=r.ReactDebugCurrentFrame;function je(e){if(e){var s=e._owner,d=Ee(e.type,e._source,s?s.type:null);ot.setExtraStackFrame(d)}else ot.setExtraStackFrame(null)}function tr(e,s,d,b,_){{var $=Function.call.bind(ge);for(var C in e)if($(e,C)){var E=void 0;try{if(typeof e[C]!="function"){var W=Error((b||"React class")+": "+d+" type `"+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[C]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw W.name="Invariant Violation",W}E=e[C](s,C,b,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(M){E=M}E&&!(E instanceof Error)&&(je(_),i("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",b||"React class",d,C,typeof E),je(null)),E instanceof Error&&!(E.message in at)&&(at[E.message]=!0,je(_),i("Failed %s type: %s",d,E.message),je(null))}}}var rr=Array.isArray;function Ie(e){return rr(e)}function nr(e){{var s=typeof Symbol=="function"&&Symbol.toStringTag,d=s&&e[Symbol.toStringTag]||e.constructor.name||"Object";return d}}function ar(e){try{return it(e),!1}catch{return!0}}function it(e){return""+e}function st(e){if(ar(e))return i("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nr(e)),it(e)}var lt=r.ReactCurrentOwner,or={key:!0,ref:!0,__self:!0,__source:!0},ct,ut;function ir(e){if(ge.call(e,"ref")){var s=Object.getOwnPropertyDescriptor(e,"ref").get;if(s&&s.isReactWarning)return!1}return e.ref!==void 0}function sr(e){if(ge.call(e,"key")){var s=Object.getOwnPropertyDescriptor(e,"key").get;if(s&&s.isReactWarning)return!1}return e.key!==void 0}function lr(e,s){typeof e.ref=="string"&<.current}function cr(e,s){{var d=function(){ct||(ct=!0,i("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",s))};d.isReactWarning=!0,Object.defineProperty(e,"key",{get:d,configurable:!0})}}function ur(e,s){{var d=function(){ut||(ut=!0,i("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",s))};d.isReactWarning=!0,Object.defineProperty(e,"ref",{get:d,configurable:!0})}}var dr=function(e,s,d,b,_,$,C){var E={$$typeof:n,type:e,key:s,ref:d,props:C,_owner:$};return E._store={},Object.defineProperty(E._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(E,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(E,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.freeze&&(Object.freeze(E.props),Object.freeze(E)),E};function fr(e,s,d,b,_){{var $,C={},E=null,W=null;d!==void 0&&(st(d),E=""+d),sr(s)&&(st(s.key),E=""+s.key),ir(s)&&(W=s.ref,lr(s,_));for($ in s)ge.call(s,$)&&!or.hasOwnProperty($)&&(C[$]=s[$]);if(e&&e.defaultProps){var M=e.defaultProps;for($ in M)C[$]===void 0&&(C[$]=M[$])}if(E||W){var N=typeof e=="function"?e.displayName||e.name||"Unknown":e;E&&cr(C,N),W&&ur(C,N)}return dr(e,E,W,_,b,lt.current,C)}}var Ae=r.ReactCurrentOwner,dt=r.ReactDebugCurrentFrame;function ce(e){if(e){var s=e._owner,d=Ee(e.type,e._source,s?s.type:null);dt.setExtraStackFrame(d)}else dt.setExtraStackFrame(null)}var Me;Me=!1;function De(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function ft(){{if(Ae.current){var e=R(Ae.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function pr(e){return""}var pt={};function hr(e){{var s=ft();if(!s){var d=typeof e=="string"?e:e.displayName||e.name;d&&(s=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+d+">.")}return s}}function ht(e,s){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var d=hr(s);if(pt[d])return;pt[d]=!0;var b="";e&&e._owner&&e._owner!==Ae.current&&(b=" It was passed a child from "+R(e._owner.type)+"."),ce(e),i('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',d,b),ce(null)}}function mt(e,s){{if(typeof e!="object")return;if(Ie(e))for(var d=0;d<e.length;d++){var b=e[d];De(b)&&ht(b,s)}else if(De(e))e._store&&(e._store.validated=!0);else if(e){var _=B(e);if(typeof _=="function"&&_!==e.entries)for(var $=_.call(e),C;!(C=$.next()).done;)De(C.value)&&ht(C.value,s)}}}function mr(e){{var s=e.type;if(s==null||typeof s=="string")return;var d;if(typeof s=="function")d=s.propTypes;else if(typeof s=="object"&&(s.$$typeof===p||s.$$typeof===m))d=s.propTypes;else return;if(d){var b=R(s);tr(d,e.props,"prop",b,e)}else if(s.PropTypes!==void 0&&!Me){Me=!0;var _=R(s);i("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_||"Unknown")}typeof s.getDefaultProps=="function"&&!s.getDefaultProps.isReactClassApproved&&i("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gr(e){{for(var s=Object.keys(e.props),d=0;d<s.length;d++){var b=s[d];if(b!=="children"&&b!=="key"){ce(e),i("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),ce(null);break}}e.ref!==null&&(ce(e),i("Invalid attribute `ref` supplied to `React.Fragment`."),ce(null))}}var gt={};function xt(e,s,d,b,_,$){{var C=U(e);if(!C){var E="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(E+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var W=pr();W?E+=W:E+=ft();var M;e===null?M="null":Ie(e)?M="array":e!==void 0&&e.$$typeof===n?(M="<"+(R(e.type)||"Unknown")+" />",E=" Did you accidentally export a JSX literal instead of a component?"):M=typeof e,i("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",M,E)}var N=fr(e,s,d,_,$);if(N==null)return N;if(C){var q=s.children;if(q!==void 0)if(b)if(Ie(q)){for(var ue=0;ue<q.length;ue++)mt(q[ue],e);Object.freeze&&Object.freeze(q)}else i("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else mt(q,e)}if(ge.call(s,"key")){var ie=R(e),Y=Object.keys(s).filter(function(wr){return wr!=="key"}),Ne=Y.length>0?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}";if(!gt[ie+Ne]){var kr=Y.length>0?"{"+Y.join(": ..., ")+": ...}":"{}";i(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
31
|
-
`);for(const
|
|
32
|
-
`).match(
|
|
30
|
+
<%s key={someKey} {...props} />`,Ne,ie,kr,ie),gt[ie+Ne]=!0}}return e===c?gr(N):mr(N),N}}function xr(e,s,d){return xt(e,s,d,!0)}function yr(e,s,d){return xt(e,s,d,!1)}var br=yr,vr=xr;ye.Fragment=c,ye.jsx=br,ye.jsxs=vr}()),ye}process.env.NODE_ENV==="production"?Ye.exports=Rr():Ye.exports=_r();var u=Ye.exports;function Ke(){return Math.random().toString(36).substr(2,9)}function Se(t){return new Intl.DateTimeFormat("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).format(t)}function Sr(t,n){let o;return(...c)=>{clearTimeout(o),o=setTimeout(()=>t(...c),n)}}function Or(t,n){let o;return(...c)=>{o||(t(...c),o=!0,setTimeout(()=>o=!1,n))}}class Dt{constructor(n){yt(this,"config");this.config=n}async sendMessage(n,o){const c=`${this.config.apiBaseUrl}/chat/agents/${this.config.agentId}`,h={message:n,sessionId:o},y=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json","api-key":this.config.apiKey,accept:"application/json"},body:JSON.stringify(h)});if(!y.ok){const g=await y.json();throw new Error(`API Error: ${g.detail}`)}if(!y.body)throw new Error("No response body");return y.body}async createSession(){const n=`${this.config.apiBaseUrl}/sessions`,o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","api-key":this.config.apiKey,accept:"application/json"},body:JSON.stringify({name:"Chat Session",agentConfig:{type:"chat",settings:null}})});if(!o.ok){const c=await o.json();throw new Error(`API Error: ${c.detail}`)}return o.json()}async getAgents(){const n=`${this.config.apiBaseUrl}/chat/agents`,o=await fetch(n,{method:"GET",headers:{"api-key":this.config.apiKey,accept:"application/json"}});if(!o.ok){const h=await o.json();throw new Error(`API Error: ${h.detail}`)}return(await o.json()).agents||[]}async getSessions(){const n=`${this.config.apiBaseUrl}/sessions`,o=await fetch(n,{method:"GET",headers:{"api-key":this.config.apiKey,accept:"application/json"}});if(!o.ok){const c=await o.json();throw new Error(`API Error: ${c.detail}`)}return o.json()}}function Nt(t){try{if(t.startsWith("data: ")){const n=t.slice(6);return n==="[DONE]"?{text:"",sessionId:"",type:"done"}:JSON.parse(n)}}catch(n){console.warn("Failed to parse streaming response:",n)}return null}function Ut(t){const[n,o]=S.useState([]),[c,h]=S.useState(!1),[y,g]=S.useState(null),[l,p]=S.useState(null),[w,v]=S.useState(!1),[m,P]=S.useState(!1),k=S.useRef(null),z=S.useRef(!1);k.current||(k.current=new Dt({apiKey:t.apiKey,apiBaseUrl:t.apiBaseUrl||"https://api.ordify.ai",agentId:t.agentId}));const T=S.useCallback(()=>{g(null)},[]),B=S.useCallback(async r=>{if(!(!r.trim()||c)){h(!0),g(null);try{const i={id:Ke(),content:r.trim(),role:"user",timestamp:new Date,sessionId:l||void 0};o(A=>[...A,i]);let a=l;a||(a=(await k.current.createSession()).id,p(a),t.onSessionCreated&&t.onSessionCreated(a));const f=(await k.current.sendMessage(r.trim(),a)).getReader(),j=new TextDecoder;let O={id:Ke(),content:"",role:"assistant",timestamp:new Date,sessionId:a};for(o(A=>[...A,O]);;){const{done:A,value:D}=await f.read();if(A)break;const I=j.decode(D,{stream:!0}).split(`
|
|
31
|
+
`);for(const F of I){const R=Nt(F);if(R){if(R.type==="stream"&&R.text)o(H=>H.map(L=>L.id===O.id?{...L,content:L.content+R.text}:L));else if(R.type==="done")break}}}t.onMessage&&t.onMessage(O)}catch(i){const a=i instanceof Error?i.message:"Failed to send message";g(a),t.onError&&t.onError(i instanceof Error?i:new Error(a))}finally{h(!1)}}},[t.onSessionCreated,t.onMessage,t.onError,c,l]);return S.useEffect(()=>{t.initialMessage&&!m&&!c&&!z.current&&(P(!0),z.current=!0,setTimeout(()=>{B(t.initialMessage)},0))},[t.initialMessage,m,c,B]),{messages:n,sendMessage:B,isLoading:c,error:y,clearError:T,sessionId:l,isOpen:w,setIsOpen:v}}function Ft(t){return S.useMemo(()=>{const n=t.agentId||process.env.ORDIFY_AGENT_ID,o=t.apiKey||process.env.ORDIFY_API_KEY,c=t.apiBaseUrl||process.env.ORDIFY_API_BASE_URL||"https://r.ordify.ai";if(!n)throw new Error("Ordify agent ID is required. Provide agentId prop or set ORDIFY_AGENT_ID environment variable.");if(!o)throw new Error("Ordify API key is required. Provide apiKey prop or set ORDIFY_API_KEY environment variable.");return{agentId:n,apiKey:o,apiBaseUrl:c,mode:t.mode||"floating",position:t.position||"bottom-right",theme:t.theme||"light",placeholder:t.placeholder||"Type a message...",height:t.height||"500px",className:t.className||"",buttonStyle:t.buttonStyle||{},chatWindowStyle:t.chatWindowStyle||{},showHeader:t.showHeader!==!1,onMessage:t.onMessage,onError:t.onError,onClose:t.onClose,onSessionCreated:t.onSessionCreated,initialMessage:t.initialMessage}},[t])}function se(){return se=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(t[c]=o[c])}return t},se.apply(this,arguments)}const Tr=["children","options"],kt=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((t,n)=>(t[n.toLowerCase()]=n,t),{class:"className",for:"htmlFor"}),wt={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},$r=["style","script","pre"],Pr=["src","href","data","formAction","srcDoc","action"],Ir=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,Ar=/mailto:/i,Mr=/\n{2,}$/,Et=/^(\s*>[\s\S]*?)(?=\n\n|$)/,Dr=/^ *> ?/gm,Nr=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,Ur=/^ {2,}\n/,Fr=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,jt=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,Ct=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Lr=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,zr=/^(?:\n *)*\n/,Wr=/\r\n?/g,Br=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,Yr=/^\[\^([^\]]+)]/,Kr=/\f/g,Vr=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,Hr=/^\s*?\[(x|\s)\]/,Rt=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,_t=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,St=/^([^\n]+)\n *(=|-){3,} *\n/,Ue=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,qr=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,Ot=/^<!--[\s\S]*?(?:-->)/,Jr=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,Fe=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,Gr=/^\{.*\}$/,Zr=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,Xr=/^<([^ >]+@[^ >]+)>/,Qr=/^<([^ >]+:\/[^ >]+)>/,en=/-([a-z])?/gi,Tt=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,tn=/^[^\n]+(?: \n|\n{2,})/,rn=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,nn=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,an=/^\[([^\]]*)\] ?\[([^\]]*)\]/,on=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,sn=/\t/g,ln=/(^ *\||\| *$)/g,cn=/^ *:-+: *$/,un=/^ *:-+ *$/,dn=/^ *-+: *$/,Oe=t=>`(?=[\\s\\S]+?\\1${t?"\\1":""})`,Te="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",fn=RegExp(`^([*_])\\1${Oe(1)}${Te}\\1\\1(?!\\1)`),pn=RegExp(`^([*_])${Oe(0)}${Te}\\1(?!\\1)`),hn=RegExp(`^(==)${Oe(0)}${Te}\\1`),mn=RegExp(`^(~~)${Oe(0)}${Te}\\1`),gn=/^(:[a-zA-Z0-9-_]+:)/,xn=/^\\([^0-9A-Za-z\s])/,yn=/\\([^0-9A-Za-z\s])/g,bn=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,vn=/^\n+/,kn=/^([ \t]*)/,wn=/(?:^|\n)( *)$/,He="(?:\\d+\\.)",qe="(?:[*+-])";function Lt(t){return"( *)("+(t===1?He:qe)+") +"}const zt=Lt(1),Wt=Lt(2);function Bt(t){return RegExp("^"+(t===1?zt:Wt))}const En=Bt(1),jn=Bt(2);function Yt(t){return RegExp("^"+(t===1?zt:Wt)+"[^\\n]*(?:\\n(?!\\1"+(t===1?He:qe)+" )[^\\n]*)*(\\n|$)","gm")}const Cn=Yt(1),Rn=Yt(2);function Kt(t){const n=t===1?He:qe;return RegExp("^( *)("+n+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+n+" (?!"+n+" ))\\n*|\\s*\\n*$)")}const Vt=Kt(1),Ht=Kt(2);function $t(t,n){const o=n===1,c=o?Vt:Ht,h=o?Cn:Rn,y=o?En:jn;return{t:g=>y.test(g),o:de(function(g,l){const p=wn.exec(l.prevCapture);return p&&(l.list||!l.inline&&!l.simple)?c.exec(g=p[1]+g):null}),i:1,u(g,l,p){const w=o?+g[2]:void 0,v=g[0].replace(Mr,`
|
|
32
|
+
`).match(h);let m=!1;return{items:v.map(function(P,k){const z=y.exec(P)[0].length,T=RegExp("^ {1,"+z+"}","gm"),B=P.replace(T,"").replace(y,""),r=k===v.length-1,i=B.indexOf(`
|
|
33
33
|
|
|
34
|
-
`)!==-1||
|
|
34
|
+
`)!==-1||r&&m;m=i;const a=p.inline,x=p.list;let f;p.list=!0,i?(p.inline=!1,f=ve(B)+`
|
|
35
35
|
|
|
36
|
-
`):(p.inline=!0,
|
|
37
|
-
`).map(function(
|
|
36
|
+
`):(p.inline=!0,f=ve(B));const j=l(f,p);return p.inline=a,p.list=x,j}),ordered:o,start:w}},l:(g,l,p)=>t(g.ordered?"ol":"ul",{key:p.key,start:g.type==="20"?g.start:void 0},g.items.map(function(w,v){return t("li",{key:v},l(w,p))}))}}const _n=RegExp(`^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`),Sn=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;function ve(t){let n=t.length;for(;n>0&&t[n-1]<=" ";)n--;return t.slice(0,n)}function Re(t,n){return t.startsWith(n)}function On(t,n,o){if(Array.isArray(o)){for(let c=0;c<o.length;c++)if(Re(t,o[c]))return!0;return!1}return o(t,n)}function be(t){return t.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function Tn(t){return dn.test(t)?"right":cn.test(t)?"center":un.test(t)?"left":null}function Pt(t,n,o,c){const h=o.inTable;o.inTable=!0;let y=[[]],g="";function l(){if(!g)return;const p=y[y.length-1];p.push.apply(p,n(g,o)),g=""}return t.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach((p,w,v)=>{p.trim()==="|"&&(l(),c)?w!==0&&w!==v.length-1&&y.push([]):g+=p}),l(),o.inTable=h,y}function $n(t,n,o){o.inline=!0;const c=t[2]?t[2].replace(ln,"").split("|").map(Tn):[],h=t[3]?function(g,l,p){return g.trim().split(`
|
|
37
|
+
`).map(function(w){return Pt(w,l,p,!0)})}(t[3],n,o):[],y=Pt(t[1],n,o,!!h.length);return o.inline=!1,h.length?{align:c,cells:h,header:y,type:"25"}:{children:y,type:"21"}}function It(t,n){return t.align[n]==null?{}:{textAlign:t.align[n]}}function de(t){return t.inline=1,t}function re(t){return de(function(n,o){return o.inline?t.exec(n):null})}function ne(t){return de(function(n,o){return o.inline||o.simple?t.exec(n):null})}function ee(t){return function(n,o){return o.inline||o.simple?null:t.exec(n)}}function Ce(t){return de(function(n){return t.exec(n)})}const Pn=/(javascript|vbscript|data(?!:image)):/i;function In(t){try{const n=decodeURIComponent(t).replace(/[^A-Za-z0-9/:]/g,"");if(Pn.test(n))return null}catch{return null}return t}function Q(t){return t&&t.replace(yn,"$1")}function _e(t,n,o){const c=o.inline||!1,h=o.simple||!1;o.inline=!0,o.simple=!0;const y=t(n,o);return o.inline=c,o.simple=h,y}function An(t,n,o){const c=o.inline||!1,h=o.simple||!1;o.inline=!1,o.simple=!0;const y=t(n,o);return o.inline=c,o.simple=h,y}function Mn(t,n,o){const c=o.inline||!1;o.inline=!1;const h=t(n,o);return o.inline=c,h}const Le=(t,n,o)=>({children:_e(n,t[2],o)});function ze(){return{}}function We(){return null}function Dn(...t){return t.filter(Boolean).join(" ")}function Be(t,n,o){let c=t;const h=n.split(".");for(;h.length&&(c=c[h[0]],c!==void 0);)h.shift();return c||o}function Nn(t="",n={}){n.overrides=n.overrides||{},n.namedCodesToUnicode=n.namedCodesToUnicode?se({},wt,n.namedCodesToUnicode):wt;const o=n.slugify||be,c=n.sanitizer||In,h=n.createElement||Mt.createElement,y=[Et,jt,Ct,n.enforceAtxHeadings?_t:Rt,St,Tt,Vt,Ht],g=[...y,tn,Ue,Ot,Fe];function l(r,i,...a){const x=Be(n.overrides,r+".props",{});return h(function(f,j){const O=Be(j,f);return O?typeof O=="function"||typeof O=="object"&&"render"in O?O:Be(j,f+".component",f):f}(r,n.overrides),se({},i,x,{className:Dn(i==null?void 0:i.className,x.className)||void 0}),...a)}function p(r){r=r.replace(Vr,"");let i=!1;n.forceInline?i=!0:n.forceBlock||(i=on.test(r)===!1);const a=z(k(i?r:ve(r).replace(vn,"")+`
|
|
38
38
|
|
|
39
|
-
`,{inline:
|
|
40
|
-
`},21:{o:
|
|
39
|
+
`,{inline:i}));for(;typeof a[a.length-1]=="string"&&!a[a.length-1].trim();)a.pop();if(n.wrapper===null)return a;const x=n.wrapper||(i?"span":"div");let f;if(a.length>1||n.forceWrapper)f=a;else{if(a.length===1)return f=a[0],typeof f=="string"?l("span",{key:"outer"},f):f;f=null}return h(x,{key:"outer"},f)}function w(r,i){if(!i||!i.trim())return null;const a=i.match(Ir);return a?a.reduce(function(x,f){const j=f.indexOf("=");if(j!==-1){const O=function(I){return I.indexOf("-")!==-1&&I.match(Jr)===null&&(I=I.replace(en,function(F,R){return R.toUpperCase()})),I}(f.slice(0,j)).trim(),A=function(I){const F=I[0];return(F==='"'||F==="'")&&I.length>=2&&I[I.length-1]===F?I.slice(1,-1):I}(f.slice(j+1).trim()),D=kt[O]||O;if(D==="ref")return x;const U=x[D]=function(I,F,R,H){return F==="style"?function(L){const J=[];let G="",Z=!1,ae=!1,le="";if(!L)return J;for(let X=0;X<L.length;X++){const V=L[X];if(V!=='"'&&V!=="'"||Z||(ae?V===le&&(ae=!1,le=""):(ae=!0,le=V)),V==="("&&G.endsWith("url")?Z=!0:V===")"&&Z&&(Z=!1),V!==";"||ae||Z)G+=V;else{const te=G.trim();if(te){const pe=te.indexOf(":");if(pe>0){const he=te.slice(0,pe).trim(),me=te.slice(pe+1).trim();J.push([he,me])}}G=""}}const oe=G.trim();if(oe){const X=oe.indexOf(":");if(X>0){const V=oe.slice(0,X).trim(),te=oe.slice(X+1).trim();J.push([V,te])}}return J}(R).reduce(function(L,[J,G]){return L[J.replace(/(-[a-z])/g,Z=>Z[1].toUpperCase())]=H(G,I,J),L},{}):Pr.indexOf(F)!==-1?H(Q(R),I,F):(R.match(Gr)&&(R=Q(R.slice(1,R.length-1))),R==="true"||R!=="false"&&R)}(r,O,A,c);typeof U=="string"&&(Ue.test(U)||Fe.test(U))&&(x[D]=p(U.trim()))}else f!=="style"&&(x[kt[f]||f]=!0);return x},{}):null}const v=[],m={},P={0:{t:[">"],o:ee(Et),i:1,u(r,i,a){const[,x,f]=r[0].replace(Dr,"").match(Nr);return{alert:x,children:i(f,a)}},l(r,i,a){const x={key:a.key};return r.alert&&(x.className="markdown-alert-"+o(r.alert.toLowerCase(),be),r.children.unshift({attrs:{},children:[{type:"27",text:r.alert}],noInnerParse:!0,type:"11",tag:"header"})),l("blockquote",x,i(r.children,a))}},1:{o:Ce(Ur),i:1,u:ze,l:(r,i,a)=>l("br",{key:a.key})},2:{t:r=>{const i=r[0];return i==="-"||i==="*"||i==="_"},o:ee(Fr),i:1,u:ze,l:(r,i,a)=>l("hr",{key:a.key})},3:{t:[" "],o:ee(Ct),i:0,u:r=>({lang:void 0,text:Q(ve(r[0].replace(/^ {4}/gm,"")))}),l:(r,i,a)=>l("pre",{key:a.key},l("code",se({},r.attrs,{className:r.lang?"lang-"+r.lang:""}),r.text))},4:{t:["```","~~~"],o:ee(jt),i:0,u:r=>({attrs:w("code",r[3]||""),lang:r[2]||void 0,text:r[4],type:"3"})},5:{t:["`"],o:ne(Lr),i:3,u:r=>({text:Q(r[2])}),l:(r,i,a)=>l("code",{key:a.key},r.text)},6:{t:["[^"],o:ee(Br),i:0,u:r=>(v.push({footnote:r[2],identifier:r[1]}),{}),l:We},7:{t:["[^"],o:re(Yr),i:1,u:r=>({target:"#"+o(r[1],be),text:r[1]}),l:(r,i,a)=>l("a",{key:a.key,href:c(r.target,"a","href")},l("sup",{key:a.key},r.text))},8:{t:["[ ]","[x]"],o:re(Hr),i:1,u:r=>({completed:r[1].toLowerCase()==="x"}),l:(r,i,a)=>l("input",{checked:r.completed,key:a.key,readOnly:!0,type:"checkbox"})},9:{t:["#"],o:ee(n.enforceAtxHeadings?_t:Rt),i:1,u:(r,i,a)=>({children:_e(i,r[2],a),id:o(r[2],be),level:r[1].length}),l:(r,i,a)=>l("h"+r.level,{id:r.id,key:a.key},i(r.children,a))},10:{o:ee(St),i:0,u:(r,i,a)=>({children:_e(i,r[1],a),level:r[2]==="="?1:2,type:"9"})},11:{t:["<"],o:Ce(Ue),i:1,u(r,i,a){const[,x]=r[3].match(kn),f=RegExp("^"+x,"gm"),j=r[3].replace(f,""),O=(A=j,g.some(R=>R.test(A))?Mn:_e);var A;const D=r[1].toLowerCase(),U=$r.indexOf(D)!==-1,I=(U?D:r[1]).trim(),F={attrs:w(I,r[2]),noInnerParse:U,tag:I};if(a.inAnchor=a.inAnchor||D==="a",U)F.text=r[3];else{const R=a.inHTML;a.inHTML=!0,F.children=O(i,j,a),a.inHTML=R}return a.inAnchor=!1,F},l:(r,i,a)=>l(r.tag,se({key:a.key},r.attrs),r.text||(r.children?i(r.children,a):""))},13:{t:["<"],o:Ce(Fe),i:1,u(r){const i=r[1].trim();return{attrs:w(i,r[2]||""),tag:i}},l:(r,i,a)=>l(r.tag,se({},r.attrs,{key:a.key}))},12:{t:["<!--"],o:Ce(Ot),i:1,u:()=>({}),l:We},14:{t:["!["],o:ne(Sn),i:1,u:r=>({alt:Q(r[1]),target:Q(r[2]),title:Q(r[3])}),l:(r,i,a)=>l("img",{key:a.key,alt:r.alt||void 0,title:r.title||void 0,src:c(r.target,"img","src")})},15:{t:["["],o:re(_n),i:3,u:(r,i,a)=>({children:An(i,r[1],a),target:Q(r[2]),title:Q(r[3])}),l:(r,i,a)=>l("a",{key:a.key,href:c(r.target,"a","href"),title:r.title},i(r.children,a))},16:{t:["<"],o:re(Qr),i:0,u:r=>({children:[{text:r[1],type:"27"}],target:r[1],type:"15"})},17:{t:(r,i)=>!i.inAnchor&&!n.disableAutoLink&&(Re(r,"http://")||Re(r,"https://")),o:re(Zr),i:0,u:r=>({children:[{text:r[1],type:"27"}],target:r[1],title:void 0,type:"15"})},18:{t:["<"],o:re(Xr),i:0,u(r){let i=r[1],a=r[1];return Ar.test(a)||(a="mailto:"+a),{children:[{text:i.replace("mailto:",""),type:"27"}],target:a,type:"15"}}},20:$t(l,1),33:$t(l,2),19:{o:ee(zr),i:3,u:ze,l:()=>`
|
|
40
|
+
`},21:{o:de(function(r,i){if(i.inline||i.simple||i.inHTML&&r.indexOf(`
|
|
41
41
|
|
|
42
|
-
`)===-1&&
|
|
42
|
+
`)===-1&&i.prevCapture.indexOf(`
|
|
43
43
|
|
|
44
|
-
`)===-1)return null;let
|
|
45
|
-
`).every(
|
|
46
|
-
`,!
|
|
47
|
-
`).replace(Vo,"").replace(oa," ")}(g),h)}}(E),j=(C=function(o,c){return function(i,g,h){const b=o[i.type].l;return c?c(()=>b(i,g,h),i,g,h):b(i,g,h)}}(E,t.renderRule),function o(c,i={}){if(Array.isArray(c)){const g=i.key,h=[];let b=!1;for(let x=0;x<c.length;x++){i.key=x;const P=o(c[x],i),z=typeof P=="string";z&&b?h[h.length-1]+=P:P!==null&&h.push(P),b=z}return i.key=g,h}return C(c,o,i)});var C;const D=p(e);return v.length?u("div",null,D,u("footer",{key:"footer"},v.map(function(o){return u("div",{id:r(o.identifier,qe),key:o.identifier},o.identifier,j(w(o.footnote,{inline:!0})))}))):D}const Na=e=>{let{children:t="",options:r}=e,n=function(s,l){if(s==null)return{};var d,u,p={},S=Object.keys(s);for(u=0;u<S.length;u++)l.indexOf(d=S[u])>=0||(p[d]=s[d]);return p}(e,_o);return ln.cloneElement(Ia(t,r),n)};function bt({content:e,className:t}){return y.jsx("div",{className:t,children:y.jsx(Na,{options:{overrides:{p:{props:{className:"mb-3 last:mb-0 leading-relaxed text-gray-900 dark:text-gray-100"}},strong:{props:{className:"font-semibold text-gray-900 dark:text-white dark:font-bold"}},em:{props:{className:"italic text-gray-700"}},code:{props:{className:"bg-gray-100 px-1.5 py-0.5 rounded text-sm font-mono text-gray-800"}},pre:{props:{className:"bg-gray-100 p-3 rounded-md text-sm font-mono text-gray-800 overflow-x-auto mb-3"}},ul:{props:{className:"list-disc list-inside mb-3 space-y-1 ml-2"}},ol:{props:{className:"list-decimal list-inside mb-3 space-y-1 ml-2"}},li:{props:{className:"leading-relaxed"}},blockquote:{props:{className:"border-l-4 border-blue-300 pl-4 italic mb-3 text-gray-700 bg-blue-50 py-2 rounded-r"}},h1:{props:{className:"text-xl font-bold mb-3 text-gray-900"}},h2:{props:{className:"text-lg font-bold mb-2 text-gray-900"}},h3:{props:{className:"text-base font-bold mb-2 text-gray-900"}},h4:{props:{className:"text-sm font-bold mb-2 text-gray-900"}},h5:{props:{className:"text-sm font-bold mb-2 text-gray-900"}},h6:{props:{className:"text-sm font-bold mb-2 text-gray-900"}},hr:{props:{className:"my-4 border-gray-200"}},a:{props:{className:"text-blue-600 hover:text-blue-800 underline",target:"_blank",rel:"noopener noreferrer"}}}},children:e})})}var re=function(){return re=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(t[l]=r[l])}return t},re.apply(this,arguments)};function Me(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,l;n<s;n++)(l||!(n in t))&&(l||(l=Array.prototype.slice.call(t,0,n)),l[n]=t[n]);return e.concat(l||Array.prototype.slice.call(t))}function Da(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Ma=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,za=Da(function(e){return Ma.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),L="-ms-",Ze="-moz-",N="-webkit-",kn="comm",xt="rule",er="decl",Fa="@import",Sn="@keyframes",La="@layer",En=Math.abs,tr=String.fromCharCode,Vt=Object.assign;function Ua(e,t){return G(e,0)^45?(((t<<2^G(e,0))<<2^G(e,1))<<2^G(e,2))<<2^G(e,3):0}function Cn(e){return e.trim()}function xe(e,t){return(e=t.exec(e))?e[0]:e}function R(e,t,r){return e.replace(t,r)}function ct(e,t,r){return e.indexOf(t,r)}function G(e,t){return e.charCodeAt(t)|0}function ze(e,t,r){return e.slice(t,r)}function ve(e){return e.length}function $n(e){return e.length}function Je(e,t){return t.push(e),e}function Ba(e,t){return e.map(t).join("")}function Vr(e,t){return e.filter(function(r){return!xe(r,t)})}var wt=1,Fe=1,Rn=0,le=0,W=0,We="";function kt(e,t,r,n,s,l,d,u){return{value:e,root:t,parent:r,type:n,props:s,children:l,line:wt,column:Fe,length:d,return:"",siblings:u}}function Ee(e,t){return Vt(kt("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Ne(e){for(;e.root;)e=Ee(e.root,{children:[e]});Je(e,e.siblings)}function Va(){return W}function Wa(){return W=le>0?G(We,--le):0,Fe--,W===10&&(Fe=1,wt--),W}function he(){return W=le<Rn?G(We,le++):0,Fe++,W===10&&(Fe=1,wt++),W}function je(){return G(We,le)}function lt(){return le}function St(e,t){return ze(We,e,t)}function Wt(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ya(e){return wt=Fe=1,Rn=ve(We=e),le=0,[]}function Ha(e){return We="",e}function Mt(e){return Cn(St(le-1,Yt(e===91?e+2:e===40?e+1:e)))}function Ka(e){for(;(W=je())&&W<33;)he();return Wt(e)>2||Wt(W)>3?"":" "}function Ga(e,t){for(;--t&&he()&&!(W<48||W>102||W>57&&W<65||W>70&&W<97););return St(e,lt()+(t<6&&je()==32&&he()==32))}function Yt(e){for(;he();)switch(W){case e:return le;case 34:case 39:e!==34&&e!==39&&Yt(W);break;case 40:e===41&&Yt(e);break;case 92:he();break}return le}function qa(e,t){for(;he()&&e+W!==57;)if(e+W===84&&je()===47)break;return"/*"+St(t,le-1)+"*"+tr(e===47?e:he())}function Ja(e){for(;!Wt(je());)he();return St(e,le)}function Xa(e){return Ha(ut("",null,null,null,[""],e=Ya(e),0,[0],e))}function ut(e,t,r,n,s,l,d,u,p){for(var S=0,v=0,m=d,E=0,w=0,j=0,C=1,D=1,o=1,c=0,i="",g=s,h=l,b=n,x=i;D;)switch(j=c,c=he()){case 40:if(j!=108&&G(x,m-1)==58){ct(x+=R(Mt(c),"&","&\f"),"&\f",En(S?u[S-1]:0))!=-1&&(o=-1);break}case 34:case 39:case 91:x+=Mt(c);break;case 9:case 10:case 13:case 32:x+=Ka(j);break;case 92:x+=Ga(lt()-1,7);continue;case 47:switch(je()){case 42:case 47:Je(Za(qa(he(),lt()),t,r,p),p);break;default:x+="/"}break;case 123*C:u[S++]=ve(x)*o;case 125*C:case 59:case 0:switch(c){case 0:case 125:D=0;case 59+v:o==-1&&(x=R(x,/\f/g,"")),w>0&&ve(x)-m&&Je(w>32?Yr(x+";",n,r,m-1,p):Yr(R(x," ","")+";",n,r,m-2,p),p);break;case 59:x+=";";default:if(Je(b=Wr(x,t,r,S,v,s,u,i,g=[],h=[],m,l),l),c===123)if(v===0)ut(x,t,b,b,g,l,m,u,h);else switch(E===99&&G(x,3)===110?100:E){case 100:case 108:case 109:case 115:ut(e,b,b,n&&Je(Wr(e,b,b,0,0,s,u,i,s,g=[],m,h),h),s,h,m,u,n?g:h);break;default:ut(x,b,b,b,[""],h,0,u,h)}}S=v=w=0,C=o=1,i=x="",m=d;break;case 58:m=1+ve(x),w=j;default:if(C<1){if(c==123)--C;else if(c==125&&C++==0&&Wa()==125)continue}switch(x+=tr(c),c*C){case 38:o=v>0?1:(x+="\f",-1);break;case 44:u[S++]=(ve(x)-1)*o,o=1;break;case 64:je()===45&&(x+=Mt(he())),E=je(),v=m=ve(i=x+=Ja(lt())),c++;break;case 45:j===45&&ve(x)==2&&(C=0)}}return l}function Wr(e,t,r,n,s,l,d,u,p,S,v,m){for(var E=s-1,w=s===0?l:[""],j=$n(w),C=0,D=0,o=0;C<n;++C)for(var c=0,i=ze(e,E+1,E=En(D=d[C])),g=e;c<j;++c)(g=Cn(D>0?w[c]+" "+i:R(i,/&\f/g,w[c])))&&(p[o++]=g);return kt(e,t,r,s===0?xt:u,p,S,v,m)}function Za(e,t,r,n){return kt(e,t,r,kn,tr(Va()),ze(e,2,-2),0,n)}function Yr(e,t,r,n,s){return kt(e,t,r,er,ze(e,0,n),ze(e,n+1,-1),n,s)}function _n(e,t,r){switch(Ua(e,t)){case 5103:return N+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return N+e+e;case 4789:return Ze+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return N+e+Ze+e+L+e+e;case 5936:switch(G(e,t+11)){case 114:return N+e+L+R(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return N+e+L+R(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return N+e+L+R(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return N+e+L+e+e;case 6165:return N+e+L+"flex-"+e+e;case 5187:return N+e+R(e,/(\w+).+(:[^]+)/,N+"box-$1$2"+L+"flex-$1$2")+e;case 5443:return N+e+L+"flex-item-"+R(e,/flex-|-self/g,"")+(xe(e,/flex-|baseline/)?"":L+"grid-row-"+R(e,/flex-|-self/g,""))+e;case 4675:return N+e+L+"flex-line-pack"+R(e,/align-content|flex-|-self/g,"")+e;case 5548:return N+e+L+R(e,"shrink","negative")+e;case 5292:return N+e+L+R(e,"basis","preferred-size")+e;case 6060:return N+"box-"+R(e,"-grow","")+N+e+L+R(e,"grow","positive")+e;case 4554:return N+R(e,/([^-])(transform)/g,"$1"+N+"$2")+e;case 6187:return R(R(R(e,/(zoom-|grab)/,N+"$1"),/(image-set)/,N+"$1"),e,"")+e;case 5495:case 3959:return R(e,/(image-set\([^]*)/,N+"$1$`$1");case 4968:return R(R(e,/(.+:)(flex-)?(.*)/,N+"box-pack:$3"+L+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+N+e+e;case 4200:if(!xe(e,/flex-|baseline/))return L+"grid-column-align"+ze(e,t)+e;break;case 2592:case 3360:return L+R(e,"template-","")+e;case 4384:case 3616:return r&&r.some(function(n,s){return t=s,xe(n.props,/grid-\w+-end/)})?~ct(e+(r=r[t].value),"span",0)?e:L+R(e,"-start","")+e+L+"grid-row-span:"+(~ct(r,"span",0)?xe(r,/\d+/):+xe(r,/\d+/)-+xe(e,/\d+/))+";":L+R(e,"-start","")+e;case 4896:case 4128:return r&&r.some(function(n){return xe(n.props,/grid-\w+-start/)})?e:L+R(R(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return R(e,/(.+)-inline(.+)/,N+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ve(e)-1-t>6)switch(G(e,t+1)){case 109:if(G(e,t+4)!==45)break;case 102:return R(e,/(.+:)(.+)-([^]+)/,"$1"+N+"$2-$3$1"+Ze+(G(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ct(e,"stretch",0)?_n(R(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return R(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,s,l,d,u,p,S){return L+s+":"+l+S+(d?L+s+"-span:"+(u?p:+p-+l)+S:"")+e});case 4949:if(G(e,t+6)===121)return R(e,":",":"+N)+e;break;case 6444:switch(G(e,G(e,14)===45?18:11)){case 120:return R(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+N+(G(e,14)===45?"inline-":"")+"box$3$1"+N+"$2$3$1"+L+"$2box$3")+e;case 100:return R(e,":",":"+L)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return R(e,"scroll-","scroll-snap-")+e}return e}function ft(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function Qa(e,t,r,n){switch(e.type){case La:if(e.children.length)break;case Fa:case er:return e.return=e.return||e.value;case kn:return"";case Sn:return e.return=e.value+"{"+ft(e.children,n)+"}";case xt:if(!ve(e.value=e.props.join(",")))return""}return ve(r=ft(e.children,n))?e.return=e.value+"{"+r+"}":""}function es(e){var t=$n(e);return function(r,n,s,l){for(var d="",u=0;u<t;u++)d+=e[u](r,n,s,l)||"";return d}}function ts(e){return function(t){t.root||(t=t.return)&&e(t)}}function rs(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case er:e.return=_n(e.value,e.length,r);return;case Sn:return ft([Ee(e,{value:R(e.value,"@","@"+N)})],n);case xt:if(e.length)return Ba(r=e.props,function(s){switch(xe(s,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Ne(Ee(e,{props:[R(s,/:(read-\w+)/,":"+Ze+"$1")]})),Ne(Ee(e,{props:[s]})),Vt(e,{props:Vr(r,n)});break;case"::placeholder":Ne(Ee(e,{props:[R(s,/:(plac\w+)/,":"+N+"input-$1")]})),Ne(Ee(e,{props:[R(s,/:(plac\w+)/,":"+Ze+"$1")]})),Ne(Ee(e,{props:[R(s,/:(plac\w+)/,L+"input-$1")]})),Ne(Ee(e,{props:[s]})),Vt(e,{props:Vr(r,n)});break}return""})}}var ns={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Te=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",jn="active",On="data-styled-version",Et="6.1.19",rr=`/*!sc*/
|
|
48
|
-
`,ht=typeof window<"u"&&typeof document<"u",os=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),Hr=/invalid hook call/i,rt=new Set,as=function(e,t){if(process.env.NODE_ENV!=="production"){var r=t?' with the id of "'.concat(t,'"'):"",n="The component ".concat(e).concat(r,` has been created dynamically.
|
|
49
|
-
`)+`You may see this warning because you've called styled inside another component.
|
|
50
|
-
To resolve this only create new StyledComponents outside of any render method and function component.
|
|
51
|
-
See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
|
|
52
|
-
`,s=console.error;try{var l=!0;console.error=function(d){for(var u=[],p=1;p<arguments.length;p++)u[p-1]=arguments[p];Hr.test(d)?(l=!1,rt.delete(n)):s.apply(void 0,Me([d],u,!1))},_.useRef(),l&&!rt.has(n)&&(console.warn(n),rt.add(n))}catch(d){Hr.test(d.message)&&rt.delete(n)}finally{console.error=s}}},Ct=Object.freeze([]),Le=Object.freeze({});function ss(e,t,r){return r===void 0&&(r=Le),e.theme!==r.theme&&e.theme||t||r.theme}var Ht=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),is=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,cs=/(^-|-$)/g;function Kr(e){return e.replace(is,"-").replace(cs,"")}var ls=/(a)(d)/gi,nt=52,Gr=function(e){return String.fromCharCode(e+(e>25?39:97))};function Kt(e){var t,r="";for(t=Math.abs(e);t>nt;t=t/nt|0)r=Gr(t%nt)+r;return(Gr(t%nt)+r).replace(ls,"$1-$2")}var zt,Tn=5381,Re=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},Pn=function(e){return Re(Tn,e)};function us(e){return Kt(Pn(e)>>>0)}function An(e){return process.env.NODE_ENV!=="production"&&typeof e=="string"&&e||e.displayName||e.name||"Component"}function Ft(e){return typeof e=="string"&&(process.env.NODE_ENV==="production"||e.charAt(0)===e.charAt(0).toLowerCase())}var In=typeof Symbol=="function"&&Symbol.for,Nn=In?Symbol.for("react.memo"):60115,ds=In?Symbol.for("react.forward_ref"):60112,ps={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},fs={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Dn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},hs=((zt={})[ds]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},zt[Nn]=Dn,zt);function qr(e){return("type"in(t=e)&&t.type.$$typeof)===Nn?Dn:"$$typeof"in e?hs[e.$$typeof]:ps;var t}var ms=Object.defineProperty,gs=Object.getOwnPropertyNames,Jr=Object.getOwnPropertySymbols,ys=Object.getOwnPropertyDescriptor,vs=Object.getPrototypeOf,Xr=Object.prototype;function Mn(e,t,r){if(typeof t!="string"){if(Xr){var n=vs(t);n&&n!==Xr&&Mn(e,n,r)}var s=gs(t);Jr&&(s=s.concat(Jr(t)));for(var l=qr(e),d=qr(t),u=0;u<s.length;++u){var p=s[u];if(!(p in fs||r&&r[p]||d&&p in d||l&&p in l)){var S=ys(t,p);try{ms(e,p,S)}catch{}}}}return e}function Ue(e){return typeof e=="function"}function nr(e){return typeof e=="object"&&"styledComponentId"in e}function _e(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function Zr(e,t){if(e.length===0)return"";for(var r=e[0],n=1;n<e.length;n++)r+=e[n];return r}function Be(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Gt(e,t,r){if(r===void 0&&(r=!1),!r&&!Be(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var n=0;n<t.length;n++)e[n]=Gt(e[n],t[n]);else if(Be(t))for(var n in t)e[n]=Gt(e[n],t[n]);return e}function or(e,t){Object.defineProperty(e,"toString",{value:t})}var bs=process.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
|
|
53
|
-
|
|
54
|
-
`,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
|
|
55
|
-
|
|
56
|
-
- Are you trying to reuse it across renders?
|
|
57
|
-
- Are you accidentally calling collectStyles twice?
|
|
58
|
-
|
|
59
|
-
`,3:`Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
|
|
60
|
-
|
|
61
|
-
`,4:`The \`StyleSheetManager\` expects a valid target or sheet prop!
|
|
62
|
-
|
|
63
|
-
- Does this error occur on the client and is your target falsy?
|
|
64
|
-
- Does this error occur on the server and is the sheet falsy?
|
|
65
|
-
|
|
66
|
-
`,5:`The clone method cannot be used on the client!
|
|
67
|
-
|
|
68
|
-
- Are you running in a client-like environment on the server?
|
|
69
|
-
- Are you trying to run SSR on the client?
|
|
70
|
-
|
|
71
|
-
`,6:`Trying to insert a new style tag, but the given Node is unmounted!
|
|
72
|
-
|
|
73
|
-
- Are you using a custom target that isn't mounted?
|
|
74
|
-
- Does your document not have a valid head element?
|
|
75
|
-
- Have you accidentally removed a style tag manually?
|
|
76
|
-
|
|
77
|
-
`,7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:`ThemeProvider: Please make your "theme" prop an object.
|
|
78
|
-
|
|
79
|
-
`,9:"Missing document `<head>`\n\n",10:`Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
|
|
80
|
-
|
|
81
|
-
`,11:`_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
|
|
82
|
-
|
|
83
|
-
`,12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:`%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.
|
|
84
|
-
|
|
85
|
-
`,14:`ThemeProvider: "theme" prop is required.
|
|
86
|
-
|
|
87
|
-
`,15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:`Reached the limit of how many styled components may be created at group %s.
|
|
88
|
-
You may only create up to 1,073,741,824 components. If you're creating components dynamically,
|
|
89
|
-
as for instance in your render method then you may be running into this limitation.
|
|
90
|
-
|
|
91
|
-
`,17:`CSSStyleSheet could not be found on HTMLStyleElement.
|
|
92
|
-
Has styled-components' style tag been unmounted or altered by another script?
|
|
93
|
-
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function xs(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=e[0],n=[],s=1,l=e.length;s<l;s+=1)n.push(e[s]);return n.forEach(function(d){r=r.replace(/%[a-z]/,d)}),r}function Ye(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(xs.apply(void 0,Me([bs[e]],t,!1)).trim())}var ws=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var r=0,n=0;n<t;n++)r+=this.groupSizes[n];return r},e.prototype.insertRules=function(t,r){if(t>=this.groupSizes.length){for(var n=this.groupSizes,s=n.length,l=s;t>=l;)if((l<<=1)<0)throw Ye(16,"".concat(t));this.groupSizes=new Uint32Array(l),this.groupSizes.set(n),this.length=l;for(var d=s;d<l;d++)this.groupSizes[d]=0}for(var u=this.indexOfGroup(t+1),p=(d=0,r.length);d<p;d++)this.tag.insertRule(u,r[d])&&(this.groupSizes[t]++,u++)},e.prototype.clearGroup=function(t){if(t<this.length){var r=this.groupSizes[t],n=this.indexOfGroup(t),s=n+r;this.groupSizes[t]=0;for(var l=n;l<s;l++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(t){var r="";if(t>=this.length||this.groupSizes[t]===0)return r;for(var n=this.groupSizes[t],s=this.indexOfGroup(t),l=s+n,d=s;d<l;d++)r+="".concat(this.tag.getRule(d)).concat(rr);return r},e}(),ks=1<<30,dt=new Map,mt=new Map,pt=1,ot=function(e){if(dt.has(e))return dt.get(e);for(;mt.has(pt);)pt++;var t=pt++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>ks))throw Ye(16,"".concat(t));return dt.set(e,t),mt.set(t,e),t},Ss=function(e,t){pt=t+1,dt.set(e,t),mt.set(t,e)},Es="style[".concat(Te,"][").concat(On,'="').concat(Et,'"]'),Cs=new RegExp("^".concat(Te,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),$s=function(e,t,r){for(var n,s=r.split(","),l=0,d=s.length;l<d;l++)(n=s[l])&&e.registerName(t,n)},Rs=function(e,t){for(var r,n=((r=t.textContent)!==null&&r!==void 0?r:"").split(rr),s=[],l=0,d=n.length;l<d;l++){var u=n[l].trim();if(u){var p=u.match(Cs);if(p){var S=0|parseInt(p[1],10),v=p[2];S!==0&&(Ss(v,S),$s(e,v,p[3]),e.getTag().insertRules(S,s)),s.length=0}else s.push(u)}}},Qr=function(e){for(var t=document.querySelectorAll(Es),r=0,n=t.length;r<n;r++){var s=t[r];s&&s.getAttribute(Te)!==jn&&(Rs(e,s),s.parentNode&&s.parentNode.removeChild(s))}};function _s(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var zn=function(e){var t=document.head,r=e||t,n=document.createElement("style"),s=function(u){var p=Array.from(u.querySelectorAll("style[".concat(Te,"]")));return p[p.length-1]}(r),l=s!==void 0?s.nextSibling:null;n.setAttribute(Te,jn),n.setAttribute(On,Et);var d=_s();return d&&n.setAttribute("nonce",d),r.insertBefore(n,l),n},js=function(){function e(t){this.element=zn(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(r){if(r.sheet)return r.sheet;for(var n=document.styleSheets,s=0,l=n.length;s<l;s++){var d=n[s];if(d.ownerNode===r)return d}throw Ye(17)}(this.element),this.length=0}return e.prototype.insertRule=function(t,r){try{return this.sheet.insertRule(r,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var r=this.sheet.cssRules[t];return r&&r.cssText?r.cssText:""},e}(),Os=function(){function e(t){this.element=zn(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,r){if(t<=this.length&&t>=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),Ts=function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,r){return t<=this.length&&(this.rules.splice(t,0,r),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),en=ht,Ps={isServer:!ht,useCSSOMInjection:!os},Fn=function(){function e(t,r,n){t===void 0&&(t=Le),r===void 0&&(r={});var s=this;this.options=re(re({},Ps),t),this.gs=r,this.names=new Map(n),this.server=!!t.isServer,!this.server&&ht&&en&&(en=!1,Qr(this)),or(this,function(){return function(l){for(var d=l.getTag(),u=d.length,p="",S=function(m){var E=function(o){return mt.get(o)}(m);if(E===void 0)return"continue";var w=l.names.get(E),j=d.getGroup(m);if(w===void 0||!w.size||j.length===0)return"continue";var C="".concat(Te,".g").concat(m,'[id="').concat(E,'"]'),D="";w!==void 0&&w.forEach(function(o){o.length>0&&(D+="".concat(o,","))}),p+="".concat(j).concat(C,'{content:"').concat(D,'"}').concat(rr)},v=0;v<u;v++)S(v);return p}(s)})}return e.registerId=function(t){return ot(t)},e.prototype.rehydrate=function(){!this.server&&ht&&Qr(this)},e.prototype.reconstructWithOptions=function(t,r){return r===void 0&&(r=!0),new e(re(re({},this.options),t),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(r){var n=r.useCSSOMInjection,s=r.target;return r.isServer?new Ts(s):n?new js(s):new Os(s)}(this.options),new ws(t)));var t},e.prototype.hasNameForId=function(t,r){return this.names.has(t)&&this.names.get(t).has(r)},e.prototype.registerName=function(t,r){if(ot(t),this.names.has(t))this.names.get(t).add(r);else{var n=new Set;n.add(r),this.names.set(t,n)}},e.prototype.insertRules=function(t,r,n){this.registerName(t,r),this.getTag().insertRules(ot(t),n)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(ot(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),As=/&/g,Is=/^\s*\/\/.*$/gm;function Ln(e,t){return e.map(function(r){return r.type==="rule"&&(r.value="".concat(t," ").concat(r.value),r.value=r.value.replaceAll(",",",".concat(t," ")),r.props=r.props.map(function(n){return"".concat(t," ").concat(n)})),Array.isArray(r.children)&&r.type!=="@keyframes"&&(r.children=Ln(r.children,t)),r})}function Ns(e){var t,r,n,s=Le,l=s.options,d=l===void 0?Le:l,u=s.plugins,p=u===void 0?Ct:u,S=function(E,w,j){return j.startsWith(r)&&j.endsWith(r)&&j.replaceAll(r,"").length>0?".".concat(t):E},v=p.slice();v.push(function(E){E.type===xt&&E.value.includes("&")&&(E.props[0]=E.props[0].replace(As,r).replace(n,S))}),d.prefix&&v.push(rs),v.push(Qa);var m=function(E,w,j,C){w===void 0&&(w=""),j===void 0&&(j=""),C===void 0&&(C="&"),t=C,r=w,n=new RegExp("\\".concat(r,"\\b"),"g");var D=E.replace(Is,""),o=Xa(j||w?"".concat(j," ").concat(w," { ").concat(D," }"):D);d.namespace&&(o=Ln(o,d.namespace));var c=[];return ft(o,es(v.concat(ts(function(i){return c.push(i)})))),c};return m.hash=p.length?p.reduce(function(E,w){return w.name||Ye(15),Re(E,w.name)},Tn).toString():"",m}var Ds=new Fn,qt=Ns(),Un=_.createContext({shouldForwardProp:void 0,styleSheet:Ds,stylis:qt});Un.Consumer;_.createContext(void 0);function tn(){return _.useContext(Un)}var rn=function(){function e(t,r){var n=this;this.inject=function(s,l){l===void 0&&(l=qt);var d=n.name+l.hash;s.hasNameForId(n.id,d)||s.insertRules(n.id,d,l(n.rules,d,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=r,or(this,function(){throw Ye(12,String(n.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=qt),this.name+t.hash},e}(),Ms=function(e){return e>="A"&&e<="Z"};function nn(e){for(var t="",r=0;r<e.length;r++){var n=e[r];if(r===1&&n==="-"&&e[0]==="-")return e;Ms(n)?t+="-"+n.toLowerCase():t+=n}return t.startsWith("ms-")?"-"+t:t}var Bn=function(e){return e==null||e===!1||e===""},Vn=function(e){var t,r,n=[];for(var s in e){var l=e[s];e.hasOwnProperty(s)&&!Bn(l)&&(Array.isArray(l)&&l.isCss||Ue(l)?n.push("".concat(nn(s),":"),l,";"):Be(l)?n.push.apply(n,Me(Me(["".concat(s," {")],Vn(l),!1),["}"],!1)):n.push("".concat(nn(s),": ").concat((t=s,(r=l)==null||typeof r=="boolean"||r===""?"":typeof r!="number"||r===0||t in ns||t.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return n};function Oe(e,t,r,n){if(Bn(e))return[];if(nr(e))return[".".concat(e.styledComponentId)];if(Ue(e)){if(!Ue(l=e)||l.prototype&&l.prototype.isReactComponent||!t)return[e];var s=e(t);return process.env.NODE_ENV==="production"||typeof s!="object"||Array.isArray(s)||s instanceof rn||Be(s)||s===null||console.error("".concat(An(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Oe(s,t,r,n)}var l;return e instanceof rn?r?(e.inject(r,n),[e.getName(n)]):[e]:Be(e)?Vn(e):Array.isArray(e)?Array.prototype.concat.apply(Ct,e.map(function(d){return Oe(d,t,r,n)})):[e.toString()]}function zs(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(Ue(r)&&!nr(r))return!1}return!0}var Fs=Pn(Et),Ls=function(){function e(t,r,n){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(n===void 0||n.isStatic)&&zs(t),this.componentId=r,this.baseHash=Re(Fs,r),this.baseStyle=n,Fn.registerId(r)}return e.prototype.generateAndInjectStyles=function(t,r,n){var s=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,r,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(this.componentId,this.staticRulesId))s=_e(s,this.staticRulesId);else{var l=Zr(Oe(this.rules,t,r,n)),d=Kt(Re(this.baseHash,l)>>>0);if(!r.hasNameForId(this.componentId,d)){var u=n(l,".".concat(d),void 0,this.componentId);r.insertRules(this.componentId,d,u)}s=_e(s,d),this.staticRulesId=d}else{for(var p=Re(this.baseHash,n.hash),S="",v=0;v<this.rules.length;v++){var m=this.rules[v];if(typeof m=="string")S+=m,process.env.NODE_ENV!=="production"&&(p=Re(p,m));else if(m){var E=Zr(Oe(m,t,r,n));p=Re(p,E+v),S+=E}}if(S){var w=Kt(p>>>0);r.hasNameForId(this.componentId,w)||r.insertRules(this.componentId,w,n(S,".".concat(w),void 0,this.componentId)),s=_e(s,w)}}return s},e}(),Wn=_.createContext(void 0);Wn.Consumer;var Lt={},on=new Set;function Us(e,t,r){var n=nr(e),s=e,l=!Ft(e),d=t.attrs,u=d===void 0?Ct:d,p=t.componentId,S=p===void 0?function(g,h){var b=typeof g!="string"?"sc":Kr(g);Lt[b]=(Lt[b]||0)+1;var x="".concat(b,"-").concat(us(Et+b+Lt[b]));return h?"".concat(h,"-").concat(x):x}(t.displayName,t.parentComponentId):p,v=t.displayName,m=v===void 0?function(g){return Ft(g)?"styled.".concat(g):"Styled(".concat(An(g),")")}(e):v,E=t.displayName&&t.componentId?"".concat(Kr(t.displayName),"-").concat(t.componentId):t.componentId||S,w=n&&s.attrs?s.attrs.concat(u).filter(Boolean):u,j=t.shouldForwardProp;if(n&&s.shouldForwardProp){var C=s.shouldForwardProp;if(t.shouldForwardProp){var D=t.shouldForwardProp;j=function(g,h){return C(g,h)&&D(g,h)}}else j=C}var o=new Ls(r,E,n?s.componentStyle:void 0);function c(g,h){return function(b,x,P){var z=b.attrs,Y=b.componentStyle,M=b.defaultProps,H=b.foldedComponentIds,A=b.styledComponentId,Q=b.target,K=_.useContext(Wn),ae=tn(),ee=b.shouldForwardProp||ae.shouldForwardProp;process.env.NODE_ENV!=="production"&&_.useDebugValue(A);var ne=ss(x,K,M)||Le,q=function(me,ue,ge){for(var de,pe=re(re({},ue),{className:void 0,theme:ge}),we=0;we<me.length;we+=1){var Pe=Ue(de=me[we])?de(pe):de;for(var fe in Pe)pe[fe]=fe==="className"?_e(pe[fe],Pe[fe]):fe==="style"?re(re({},pe[fe]),Pe[fe]):Pe[fe]}return ue.className&&(pe.className=_e(pe.className,ue.className)),pe}(z,x,ne),se=q.as||Q,oe={};for(var U in q)q[U]===void 0||U[0]==="$"||U==="as"||U==="theme"&&q.theme===ne||(U==="forwardedAs"?oe.as=q.forwardedAs:ee&&!ee(U,se)||(oe[U]=q[U],ee||process.env.NODE_ENV!=="development"||za(U)||on.has(U)||!Ht.has(se)||(on.add(U),console.warn('styled-components: it looks like an unknown prop "'.concat(U,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var J=function(me,ue){var ge=tn(),de=me.generateAndInjectStyles(ue,ge.styleSheet,ge.stylis);return process.env.NODE_ENV!=="production"&&_.useDebugValue(de),de}(Y,q);process.env.NODE_ENV!=="production"&&b.warnTooManyClasses&&b.warnTooManyClasses(J);var ie=_e(H,A);return J&&(ie+=" "+J),q.className&&(ie+=" "+q.className),oe[Ft(se)&&!Ht.has(se)?"class":"className"]=ie,P&&(oe.ref=P),_.createElement(se,oe)}(i,g,h)}c.displayName=m;var i=_.forwardRef(c);return i.attrs=w,i.componentStyle=o,i.displayName=m,i.shouldForwardProp=j,i.foldedComponentIds=n?_e(s.foldedComponentIds,s.styledComponentId):"",i.styledComponentId=E,i.target=n?s.target:e,Object.defineProperty(i,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(g){this._foldedDefaultProps=n?function(h){for(var b=[],x=1;x<arguments.length;x++)b[x-1]=arguments[x];for(var P=0,z=b;P<z.length;P++)Gt(h,z[P],!0);return h}({},s.defaultProps,g):g}}),process.env.NODE_ENV!=="production"&&(as(m,E),i.warnTooManyClasses=function(g,h){var b={},x=!1;return function(P){if(!x&&(b[P]=!0,Object.keys(b).length>=200)){var z=h?' with the id of "'.concat(h,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(g).concat(z,`.
|
|
94
|
-
`)+`Consider using the attrs method, together with a style object for frequently changed styles.
|
|
95
|
-
Example:
|
|
96
|
-
const Component = styled.div.attrs(props => ({
|
|
97
|
-
style: {
|
|
98
|
-
background: props.background,
|
|
99
|
-
},
|
|
100
|
-
}))\`width: 100%;\`
|
|
101
|
-
|
|
102
|
-
<Component />`),x=!0,b={}}}}(m,E)),or(i,function(){return".".concat(i.styledComponentId)}),l&&Mn(i,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),i}function an(e,t){for(var r=[e[0]],n=0,s=t.length;n<s;n+=1)r.push(t[n],e[n+1]);return r}var sn=function(e){return Object.assign(e,{isCss:!0})};function Bs(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(Ue(e)||Be(e))return sn(Oe(an(Ct,Me([e],t,!0))));var n=e;return t.length===0&&n.length===1&&typeof n[0]=="string"?Oe(n):sn(Oe(an(n,t)))}function Jt(e,t,r){if(r===void 0&&(r=Le),!t)throw Ye(1,t);var n=function(s){for(var l=[],d=1;d<arguments.length;d++)l[d-1]=arguments[d];return e(t,r,Bs.apply(void 0,Me([s],l,!1)))};return n.attrs=function(s){return Jt(e,t,re(re({},r),{attrs:Array.prototype.concat(r.attrs,s).filter(Boolean)}))},n.withConfig=function(s){return Jt(e,t,re(re({},r),s))},n}var Yn=function(e){return Jt(Us,e)},Z=Yn;Ht.forEach(function(e){Z[e]=Yn(e)});process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn(`It looks like you've imported 'styled-components' on React Native.
|
|
103
|
-
Perhaps you're looking to import 'styled-components/native'?
|
|
104
|
-
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var at="__sc-".concat(Te,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[at]||(window[at]=0),window[at]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
|
|
105
|
-
|
|
106
|
-
See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
44
|
+
`)===-1)return null;let a="";r.split(`
|
|
45
|
+
`).every(f=>(f+=`
|
|
46
|
+
`,!y.some(j=>j.test(f))&&(a+=f,!!f.trim())));const x=ve(a);return x===""?null:[a,,x]}),i:3,u:Le,l:(r,i,a)=>l("p",{key:a.key},i(r.children,a))},22:{t:["["],o:re(rn),i:0,u:r=>(m[r[1]]={target:r[2],title:r[4]},{}),l:We},23:{t:["!["],o:ne(nn),i:0,u:r=>({alt:r[1]?Q(r[1]):void 0,ref:r[2]}),l:(r,i,a)=>m[r.ref]?l("img",{key:a.key,alt:r.alt,src:c(m[r.ref].target,"img","src"),title:m[r.ref].title}):null},24:{t:r=>r[0]==="["&&r.indexOf("](")===-1,o:re(an),i:0,u:(r,i,a)=>({children:i(r[1],a),fallbackChildren:r[0],ref:r[2]}),l:(r,i,a)=>m[r.ref]?l("a",{key:a.key,href:c(m[r.ref].target,"a","href"),title:m[r.ref].title},i(r.children,a)):l("span",{key:a.key},r.fallbackChildren)},25:{t:["|"],o:ee(Tt),i:1,u:$n,l(r,i,a){const x=r;return l("table",{key:a.key},l("thead",null,l("tr",null,x.header.map(function(f,j){return l("th",{key:j,style:It(x,j)},i(f,a))}))),l("tbody",null,x.cells.map(function(f,j){return l("tr",{key:j},f.map(function(O,A){return l("td",{key:A,style:It(x,A)},i(O,a))}))})))}},27:{o:de(function(r,i){let a;return Re(r,":")&&(a=gn.exec(r)),a||bn.exec(r)}),i:4,u(r){const i=r[0];return{text:i.indexOf("&")===-1?i:i.replace(qr,(a,x)=>n.namedCodesToUnicode[x]||a)}},l:r=>r.text},28:{t:["**","__"],o:ne(fn),i:2,u:(r,i,a)=>({children:i(r[2],a)}),l:(r,i,a)=>l("strong",{key:a.key},i(r.children,a))},29:{t:r=>{const i=r[0];return(i==="*"||i==="_")&&r[1]!==i},o:ne(pn),i:3,u:(r,i,a)=>({children:i(r[2],a)}),l:(r,i,a)=>l("em",{key:a.key},i(r.children,a))},30:{t:["\\"],o:ne(xn),i:1,u:r=>({text:r[1],type:"27"})},31:{t:["=="],o:ne(hn),i:3,u:Le,l:(r,i,a)=>l("mark",{key:a.key},i(r.children,a))},32:{t:["~~"],o:ne(mn),i:3,u:Le,l:(r,i,a)=>l("del",{key:a.key},i(r.children,a))}};n.disableParsingRawHTML===!0&&(delete P[11],delete P[13]);const k=function(r){var i=Object.keys(r);function a(x,f){var j=[];if(f.prevCapture=f.prevCapture||"",x.trim())for(;x;)for(var O=0;O<i.length;){var A=i[O],D=r[A];if(!D.t||On(x,f,D.t)){var U=D.o(x,f);if(U&&U[0]){x=x.substring(U[0].length);var I=D.u(U,a,f);f.prevCapture+=U[0],I.type||(I.type=A),j.push(I);break}O++}else O++}return f.prevCapture="",j}return i.sort(function(x,f){return r[x].i-r[f].i||(x<f?-1:1)}),function(x,f){return a(function(j){return j.replace(Wr,`
|
|
47
|
+
`).replace(Kr,"").replace(sn," ")}(x),f)}}(P),z=(T=function(r,i){return function(a,x,f){const j=r[a.type].l;return i?i(()=>j(a,x,f),a,x,f):j(a,x,f)}}(P,n.renderRule),function r(i,a={}){if(Array.isArray(i)){const x=a.key,f=[];let j=!1;for(let O=0;O<i.length;O++){a.key=O;const A=r(i[O],a),D=typeof A=="string";D&&j?f[f.length-1]+=A:A!==null&&f.push(A),j=D}return a.key=x,f}return T(i,r,a)});var T;const B=p(t);return v.length?l("div",null,B,l("footer",{key:"footer"},v.map(function(r){return l("div",{id:o(r.identifier,be),key:r.identifier},r.identifier,z(k(r.footnote,{inline:!0})))}))):B}const Un=t=>{let{children:n="",options:o}=t,c=function(h,y){if(h==null)return{};var g,l,p={},w=Object.keys(h);for(l=0;l<w.length;l++)y.indexOf(g=w[l])>=0||(p[g]=h[g]);return p}(t,Tr);return Mt.cloneElement(Nn(n,o),c)};function $e({content:t,className:n}){return u.jsx("div",{className:n,children:u.jsx(Un,{options:{overrides:{p:{props:{className:"mb-3 last:mb-0 leading-relaxed text-gray-900 dark:text-gray-100"}},strong:{props:{className:"font-semibold text-gray-900 dark:text-white dark:font-bold"}},em:{props:{className:"italic text-gray-700"}},code:{props:{className:"bg-gray-100 px-1.5 py-0.5 rounded text-sm font-mono text-gray-800"}},pre:{props:{className:"bg-gray-100 p-3 rounded-md text-sm font-mono text-gray-800 overflow-x-auto mb-3"}},ul:{props:{className:"list-disc list-inside mb-3 space-y-1 ml-2"}},ol:{props:{className:"list-decimal list-inside mb-3 space-y-1 ml-2"}},li:{props:{className:"leading-relaxed"}},blockquote:{props:{className:"border-l-4 border-blue-300 pl-4 italic mb-3 text-gray-700 bg-blue-50 py-2 rounded-r"}},h1:{props:{className:"text-xl font-bold mb-3 text-gray-900"}},h2:{props:{className:"text-lg font-bold mb-2 text-gray-900"}},h3:{props:{className:"text-base font-bold mb-2 text-gray-900"}},h4:{props:{className:"text-sm font-bold mb-2 text-gray-900"}},h5:{props:{className:"text-sm font-bold mb-2 text-gray-900"}},h6:{props:{className:"text-sm font-bold mb-2 text-gray-900"}},hr:{props:{className:"my-4 border-gray-200"}},a:{props:{className:"text-blue-600 hover:text-blue-800 underline",target:"_blank",rel:"noopener noreferrer"}}}},children:t})})}const qt=K.div`
|
|
107
48
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
108
49
|
background-color: white;
|
|
109
50
|
border: 1px solid #e5e7eb;
|
|
@@ -119,19 +60,19 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
119
60
|
background-color: #1f2937;
|
|
120
61
|
border-color: #374151;
|
|
121
62
|
}
|
|
122
|
-
`,
|
|
63
|
+
`,fe=K.div`
|
|
123
64
|
max-width: 80%;
|
|
124
65
|
padding: 12px;
|
|
125
66
|
border-radius: 8px;
|
|
126
67
|
font-size: 14px;
|
|
127
68
|
word-break: break-word;
|
|
128
|
-
margin-left: ${
|
|
129
|
-
margin-right: ${
|
|
69
|
+
margin-left: ${t=>t.$isUser?"auto":"0"};
|
|
70
|
+
margin-right: ${t=>t.$isUser?"0":"auto"};
|
|
130
71
|
line-height: 1.5;
|
|
131
72
|
|
|
132
73
|
/* User message styles */
|
|
133
|
-
background-color: ${
|
|
134
|
-
color: ${
|
|
74
|
+
background-color: ${t=>t.$isUser?"#e5e7eb":"transparent"};
|
|
75
|
+
color: ${t=>(t.$isUser,"#111827")};
|
|
135
76
|
|
|
136
77
|
/* Ensure bold text has proper contrast */
|
|
137
78
|
strong, b {
|
|
@@ -141,15 +82,15 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
141
82
|
|
|
142
83
|
/* Dark mode support */
|
|
143
84
|
@media (prefers-color-scheme: dark) {
|
|
144
|
-
background-color: ${
|
|
145
|
-
color: ${
|
|
85
|
+
background-color: ${t=>t.$isUser?"#374151":"transparent"};
|
|
86
|
+
color: ${t=>(t.$isUser,"#f9fafb")};
|
|
146
87
|
|
|
147
88
|
strong, b {
|
|
148
89
|
color: #ffffff;
|
|
149
90
|
font-weight: 700;
|
|
150
91
|
}
|
|
151
92
|
}
|
|
152
|
-
`,
|
|
93
|
+
`,Je=K.div`
|
|
153
94
|
display: flex;
|
|
154
95
|
align-items: center;
|
|
155
96
|
gap: 8px;
|
|
@@ -161,7 +102,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
161
102
|
background-color: #1f2937;
|
|
162
103
|
border-top-color: #374151;
|
|
163
104
|
}
|
|
164
|
-
`,
|
|
105
|
+
`,Fn=K.textarea`
|
|
165
106
|
flex: 1;
|
|
166
107
|
width: 100%;
|
|
167
108
|
min-height: 40px;
|
|
@@ -205,7 +146,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
205
146
|
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
|
206
147
|
}
|
|
207
148
|
}
|
|
208
|
-
`,
|
|
149
|
+
`,Ge=K.button`
|
|
209
150
|
width: 32px;
|
|
210
151
|
height: 32px;
|
|
211
152
|
min-width: 32px;
|
|
@@ -237,7 +178,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
237
178
|
width: 16px;
|
|
238
179
|
height: 16px;
|
|
239
180
|
}
|
|
240
|
-
`,
|
|
181
|
+
`,Ln=K.button`
|
|
241
182
|
position: fixed;
|
|
242
183
|
z-index: 50;
|
|
243
184
|
height: 48px;
|
|
@@ -256,7 +197,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
256
197
|
transition: all 0.2s ease;
|
|
257
198
|
|
|
258
199
|
/* Responsive positioning */
|
|
259
|
-
${
|
|
200
|
+
${t=>{switch(t.$position){case"bottom-left":return`
|
|
260
201
|
bottom: max(12px, 1vw);
|
|
261
202
|
left: max(12px, 1vw);
|
|
262
203
|
`;case"top-right":return`
|
|
@@ -310,7 +251,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
310
251
|
align-items: center;
|
|
311
252
|
justify-content: center;
|
|
312
253
|
}
|
|
313
|
-
`,
|
|
254
|
+
`,zn=K.div`
|
|
314
255
|
position: fixed;
|
|
315
256
|
z-index: 50;
|
|
316
257
|
width: 320px;
|
|
@@ -322,7 +263,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
322
263
|
flex-direction: column;
|
|
323
264
|
|
|
324
265
|
/* Responsive positioning */
|
|
325
|
-
${
|
|
266
|
+
${t=>{switch(t.$position){case"bottom-left":return`
|
|
326
267
|
bottom: max(12px, 1vw);
|
|
327
268
|
left: max(12px, 1vw);
|
|
328
269
|
`;case"top-right":return`
|
|
@@ -355,9 +296,9 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
355
296
|
@media (min-width: 640px) {
|
|
356
297
|
width: 384px;
|
|
357
298
|
}
|
|
358
|
-
`,
|
|
299
|
+
`,Wn=K.div`
|
|
359
300
|
padding: 12px 16px;
|
|
360
|
-
background: ${
|
|
301
|
+
background: ${t=>t.primaryColor||"#3b82f6"};
|
|
361
302
|
color: white;
|
|
362
303
|
border-radius: 8px 8px 0 0;
|
|
363
304
|
display: flex;
|
|
@@ -376,7 +317,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
376
317
|
align-items: center;
|
|
377
318
|
gap: 4px;
|
|
378
319
|
}
|
|
379
|
-
`;
|
|
320
|
+
`;K.button`
|
|
380
321
|
width: 24px;
|
|
381
322
|
height: 24px;
|
|
382
323
|
background: transparent;
|
|
@@ -397,7 +338,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
397
338
|
width: 16px;
|
|
398
339
|
height: 16px;
|
|
399
340
|
}
|
|
400
|
-
`;const
|
|
341
|
+
`;const Ze=K.div`
|
|
401
342
|
flex: 1;
|
|
402
343
|
overflow-y: auto;
|
|
403
344
|
padding: 16px;
|
|
@@ -436,7 +377,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
436
377
|
background: #9ca3af;
|
|
437
378
|
}
|
|
438
379
|
}
|
|
439
|
-
`,
|
|
380
|
+
`,Xe=K.div`
|
|
440
381
|
display: flex;
|
|
441
382
|
gap: 4px;
|
|
442
383
|
align-items: center;
|
|
@@ -467,15 +408,15 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
467
408
|
background: #9ca3af;
|
|
468
409
|
}
|
|
469
410
|
}
|
|
470
|
-
`,
|
|
411
|
+
`,Qe=K.div`
|
|
471
412
|
font-size: 12px;
|
|
472
413
|
margin-top: 4px;
|
|
473
|
-
color: ${
|
|
414
|
+
color: ${t=>(t.$isUser,"#6b7280")};
|
|
474
415
|
|
|
475
416
|
@media (prefers-color-scheme: dark) {
|
|
476
|
-
color: ${
|
|
417
|
+
color: ${t=>(t.$isUser,"#9ca3af")};
|
|
477
418
|
}
|
|
478
|
-
`,
|
|
419
|
+
`,et=K.div`
|
|
479
420
|
font-size: 14px;
|
|
480
421
|
color: #dc2626;
|
|
481
422
|
text-align: center;
|
|
@@ -485,15 +426,15 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
485
426
|
@media (prefers-color-scheme: dark) {
|
|
486
427
|
color: #f87171;
|
|
487
428
|
}
|
|
488
|
-
`,
|
|
429
|
+
`,Bn=K.div`
|
|
489
430
|
position: absolute;
|
|
490
|
-
${
|
|
431
|
+
${t=>t.$position==="top"?"top: 0;":"bottom: 0;"}
|
|
491
432
|
left: 0;
|
|
492
433
|
right: 0;
|
|
493
434
|
height: 6px;
|
|
494
435
|
background: linear-gradient(90deg, #e5e7eb 0%, #3b82f6 50%, #e5e7eb 100%);
|
|
495
|
-
cursor: ${
|
|
496
|
-
border-radius: ${
|
|
436
|
+
cursor: ${t=>(t.$position==="top","ns-resize")};
|
|
437
|
+
border-radius: ${t=>t.$position==="top"?"8px 8px 0 0":"0 0 8px 8px"};
|
|
497
438
|
opacity: 0.7;
|
|
498
439
|
transition: opacity 0.2s ease;
|
|
499
440
|
|
|
@@ -509,34 +450,34 @@ See https://s-c.sh/2BAXzed for more info.`),window[at]+=1);const Hn=Z.div`
|
|
|
509
450
|
background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 50%, #3b82f6 100%);
|
|
510
451
|
}
|
|
511
452
|
}
|
|
512
|
-
`,
|
|
453
|
+
`,tt=S.forwardRef(function({value:n,onChange:o,onKeyDown:c,placeholder:h="Type a message...",disabled:y=!1,className:g,maxLength:l=2e3},p){const w=m=>{o(m.target.value)},v=m=>{m.key==="Enter"&&!m.shiftKey&&m.preventDefault(),c(m)};return u.jsx(Fn,{ref:p,value:n,onChange:w,onKeyDown:v,placeholder:h,disabled:y,maxLength:l,className:g,onInput:m=>{const P=m.target;P.style.height="auto",P.style.height=`${Math.min(P.scrollHeight,120)}px`}})});/**
|
|
513
454
|
* @license lucide-react v0.544.0 - ISC
|
|
514
455
|
*
|
|
515
456
|
* This source code is licensed under the ISC license.
|
|
516
457
|
* See the LICENSE file in the root directory of this source tree.
|
|
517
|
-
*/const
|
|
458
|
+
*/const Yn=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Kn=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,c)=>c?c.toUpperCase():o.toLowerCase()),At=t=>{const n=Kn(t);return n.charAt(0).toUpperCase()+n.slice(1)},Jt=(...t)=>t.filter((n,o,c)=>!!n&&n.trim()!==""&&c.indexOf(n)===o).join(" ").trim(),Vn=t=>{for(const n in t)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};/**
|
|
518
459
|
* @license lucide-react v0.544.0 - ISC
|
|
519
460
|
*
|
|
520
461
|
* This source code is licensed under the ISC license.
|
|
521
462
|
* See the LICENSE file in the root directory of this source tree.
|
|
522
|
-
*/var
|
|
463
|
+
*/var Hn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
523
464
|
* @license lucide-react v0.544.0 - ISC
|
|
524
465
|
*
|
|
525
466
|
* This source code is licensed under the ISC license.
|
|
526
467
|
* See the LICENSE file in the root directory of this source tree.
|
|
527
|
-
*/const
|
|
468
|
+
*/const qn=S.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:h="",children:y,iconNode:g,...l},p)=>S.createElement("svg",{ref:p,...Hn,width:n,height:n,stroke:t,strokeWidth:c?Number(o)*24/Number(n):o,className:Jt("lucide",h),...!y&&!Vn(l)&&{"aria-hidden":"true"},...l},[...g.map(([w,v])=>S.createElement(w,v)),...Array.isArray(y)?y:[y]]));/**
|
|
528
469
|
* @license lucide-react v0.544.0 - ISC
|
|
529
470
|
*
|
|
530
471
|
* This source code is licensed under the ISC license.
|
|
531
472
|
* See the LICENSE file in the root directory of this source tree.
|
|
532
|
-
*/const
|
|
473
|
+
*/const Gt=(t,n)=>{const o=S.forwardRef(({className:c,...h},y)=>S.createElement(qn,{ref:y,iconNode:n,className:Jt(`lucide-${Yn(At(t))}`,`lucide-${t}`,c),...h}));return o.displayName=At(t),o};/**
|
|
533
474
|
* @license lucide-react v0.544.0 - ISC
|
|
534
475
|
*
|
|
535
476
|
* This source code is licensed under the ISC license.
|
|
536
477
|
* See the LICENSE file in the root directory of this source tree.
|
|
537
|
-
*/const
|
|
478
|
+
*/const Jn=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Gn=Gt("message-square",Jn);/**
|
|
538
479
|
* @license lucide-react v0.544.0 - ISC
|
|
539
480
|
*
|
|
540
481
|
* This source code is licensed under the ISC license.
|
|
541
482
|
* See the LICENSE file in the root directory of this source tree.
|
|
542
|
-
*/const
|
|
483
|
+
*/const Zn=[["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"}]],rt=Gt("send",Zn);function Zt({config:t,chat:n}){const{messages:o,sendMessage:c,isLoading:h,error:y}=n,[g,l]=S.useState(""),[p,w]=S.useState(!1),v=S.useRef(null);S.useEffect(()=>{const k=()=>{w(window.matchMedia("(prefers-color-scheme: dark)").matches)};k();const z=window.matchMedia("(prefers-color-scheme: dark)");return z.addEventListener("change",k),()=>z.removeEventListener("change",k)},[]);const m=async()=>{!g.trim()||h||(await c(g.trim()),l(""),setTimeout(()=>{var k;(k=v.current)==null||k.focus()},100))},P=k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),m())};return u.jsxs(qt,{"data-theme":p?"dark":"light",style:{height:t.height,display:"flex",flexDirection:"column",borderRadius:"8px"},children:[u.jsxs(Ze,{style:{flex:1,padding:"16px"},children:[o.map(k=>u.jsx("div",{style:{display:"flex",marginBottom:"16px",justifyContent:k.role==="user"?"flex-end":"flex-start"},children:u.jsxs(fe,{$isUser:k.role==="user",children:[k.role==="assistant"?u.jsx($e,{content:k.content}):k.content,u.jsx(Qe,{$isUser:k.role==="user",children:Se(k.timestamp)})]})},k.id)),h&&u.jsx("div",{style:{display:"flex",justifyContent:"flex-start",marginBottom:"16px"},children:u.jsx(fe,{$isUser:!1,children:u.jsxs(Xe,{children:[u.jsx("div",{className:"dot"}),u.jsx("div",{className:"dot"}),u.jsx("div",{className:"dot"})]})})}),y&&u.jsx(et,{children:y})]}),u.jsxs(Je,{children:[u.jsx(tt,{ref:v,value:g,onChange:l,onKeyDown:P,placeholder:t.placeholder,disabled:h}),u.jsx(Ge,{onClick:m,disabled:h||!g.trim(),children:u.jsx(rt,{size:16})})]})]})}function Ve({config:t,chat:n}){const{messages:o,sendMessage:c,isLoading:h,error:y,isOpen:g,setIsOpen:l}=n,[p,w]=S.useState(""),[v,m]=S.useState(t.height||400),P=S.useRef(null),k=async()=>{!p.trim()||h||(await c(p.trim()),w(""),setTimeout(()=>{var T;(T=P.current)==null||T.focus()},100))},z=T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),k())};return g?u.jsxs(zn,{$position:t.position||"bottom-right",style:{height:v,...t.chatWindowStyle},children:[t.resizable!==!1&&u.jsx(Bn,{$position:"top",onMouseDown:T=>{T.preventDefault();const B=T.clientY,r=typeof v=="number"?v:400,i=x=>{const f=x.clientY-B,j=r-f;m(Math.max(200,Math.min(600,j)))},a=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",a)}}),t.showHeader!==!1&&u.jsxs(Wn,{primaryColor:t.primaryColor,children:[u.jsx("div",{className:"header-content",children:u.jsx("div",{className:"font-medium",children:t.chatName||"Chat Assistant"})}),u.jsx("div",{className:"header-actions",children:u.jsx("button",{onClick:()=>l(!1),className:"hover:bg-white/10 p-1 rounded",children:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[u.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]}),u.jsxs(Ze,{children:[o.map(T=>u.jsx("div",{style:{display:"flex",marginBottom:"16px",justifyContent:T.role==="user"?"flex-end":"flex-start"},children:u.jsxs(fe,{$isUser:T.role==="user",children:[T.role==="assistant"?u.jsx($e,{content:T.content}):T.content,u.jsx(Qe,{$isUser:T.role==="user",children:Se(T.timestamp)})]})},T.id)),h&&u.jsx("div",{style:{display:"flex",justifyContent:"flex-start",marginBottom:"16px"},children:u.jsx(fe,{$isUser:!1,children:u.jsxs(Xe,{children:[u.jsx("div",{className:"dot"}),u.jsx("div",{className:"dot"}),u.jsx("div",{className:"dot"})]})})}),y&&u.jsx(et,{children:y})]}),u.jsxs(Je,{children:[u.jsx(tt,{ref:P,value:p,onChange:w,onKeyDown:z,placeholder:t.placeholder,disabled:h}),u.jsx(Ge,{onClick:k,disabled:h||!p.trim(),children:u.jsx(rt,{size:16})})]})]}):u.jsxs(Ln,{$position:t.position||"bottom-right",onClick:()=>l(!0),style:t.buttonStyle,"aria-label":"Open chat",children:[u.jsx("div",{className:"icon-container",children:u.jsx(Gn,{size:16})}),u.jsx("span",{children:t.buttonText||t.chatName||"AI Chat"})]})}function Xn(t){const n=Ft(t),o=Ut(n);switch(n.mode){case"floating":return u.jsx(Ve,{config:n,chat:o});case"embedded":return u.jsx(Zt,{config:n,chat:o});default:return u.jsx(Ve,{config:n,chat:o})}}function Qn({config:t,chat:n}){const{messages:o,sendMessage:c,isLoading:h,error:y}=n,[g,l]=S.useState(""),p=S.useRef(null),w=async()=>{!g.trim()||h||(await c(g.trim()),l(""),setTimeout(()=>{var m;(m=p.current)==null||m.focus()},100))},v=m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),w())};return u.jsxs(qt,{style:{height:t.height,display:"flex",flexDirection:"column",backgroundColor:"white",border:"1px solid #e5e7eb",borderRadius:"8px"},children:[u.jsxs(Ze,{style:{flex:1,padding:"12px"},children:[o.map(m=>u.jsx("div",{style:{display:"flex",marginBottom:"12px",justifyContent:m.role==="user"?"flex-end":"flex-start"},children:u.jsxs(fe,{$isUser:m.role==="user",children:[m.role==="assistant"?u.jsx($e,{content:m.content}):m.content,u.jsx(Qe,{$isUser:m.role==="user",children:Se(m.timestamp)})]})},m.id)),h&&u.jsx("div",{style:{display:"flex",justifyContent:"flex-start",marginBottom:"12px"},children:u.jsx(fe,{$isUser:!1,children:u.jsxs(Xe,{children:[u.jsx("div",{className:"dot"}),u.jsx("div",{className:"dot"}),u.jsx("div",{className:"dot"})]})})}),y&&u.jsx(et,{children:y})]}),u.jsxs(Je,{children:[u.jsx(tt,{ref:p,value:g,onChange:l,onKeyDown:v,placeholder:t.placeholder,disabled:h}),u.jsx(Ge,{onClick:w,disabled:h||!g.trim(),children:u.jsx(rt,{size:16})})]})]})}exports.EmbeddedChat=Zt;exports.FloatingChat=Ve;exports.InlineChat=Qn;exports.MarkdownRenderer=$e;exports.OrdifyApiClient=Dt;exports.OrdifyChat=Xn;exports.debounce=Sr;exports.formatTime=Se;exports.generateId=Ke;exports.parseStreamingResponse=Nt;exports.throttle=Or;exports.useOrdifyChat=Ut;exports.useOrdifyConfig=Ft;
|