@ibiz-template-plugin/ai-chat 0.0.25 → 0.0.26

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.es.js CHANGED
@@ -2212,7 +2212,8 @@ const te = new M("markdown-message"), wi = (n) => {
2212
2212
  },
2213
2213
  themeSettings: {
2214
2214
  // 目前应用的主题
2215
- mainTheme: "dark"
2215
+ mainTheme: "dark",
2216
+ codeBlockTheme: "dark"
2216
2217
  },
2217
2218
  previewer: {
2218
2219
  // 默认禁用
@@ -2360,7 +2361,8 @@ const ie = new M("user-message-question"), Ci = (n) => {
2360
2361
  },
2361
2362
  themeSettings: {
2362
2363
  // 目前应用的主题
2363
- mainTheme: "dark"
2364
+ mainTheme: "dark",
2365
+ codeBlockTheme: "dark"
2364
2366
  },
2365
2367
  previewer: {
2366
2368
  // 默认禁用
@@ -1 +1 @@
1
- !function(){function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)}function t(e,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t(e,n)}function n(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return function(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)}(this,n)}}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function o(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,c=[],s=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=o.call(n)).done)&&(c.push(i.value),c.length!==t);s=!0);}catch(e){l=!0,r=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return c}}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),c=new L(i||[]);return r(a,"_invoke",{value:S(e,n,c)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",v="suspendedYield",m="executing",_="completed",g={};function y(){}function w(){}function b(){}var x={};l(x,a,(function(){return this}));var k=Object.getPrototypeOf,C=k&&k(k(I([])));C&&C!==n&&i.call(C,a)&&(x=C);var T=b.prototype=y.prototype=Object.create(x);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(r,o,a,c){var s=h(e[r],e,o);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"==f(u)&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,c)}))}c(s.arg)}var o;r(this,"_invoke",{value:function(e,i){function r(){return new t((function(t,r){n(e,i,t,r)}))}return o=o?o.then(r,r):r()}})}function S(t,n,i){var r=p;return function(o,a){if(r===m)throw new Error("Generator is already running");if(r===_){if("throw"===o)throw a;return{value:e,done:!0}}for(i.method=o,i.arg=a;;){var c=i.delegate;if(c){var s=A(c,i);if(s){if(s===g)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=m;var l=h(t,n,i);if("normal"===l.type){if(r=i.done?_:v,l.arg===g)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r=_,i.method="throw",i.arg=l.arg)}}}function A(t,n){var i=n.method,r=t.iterator[i];if(r===e)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),g;var o=h(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(f(t)+" is not iterable")}return w.prototype=b,r(T,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,s,"GeneratorFunction")),e.prototype=Object.create(T),e},t.awrap=function(e){return{__await:e}},N(E.prototype),l(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new E(u(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(T),l(T,s,"Generator"),l(T,a,(function(){return this})),l(T,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=I,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(i,r){return c.type="throw",c.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:I(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),g}},t}function h(e,t,n,i,r,o,a){try{var c=e[o](a),s=c.value}catch(l){return void n(l)}c.done?t(s):Promise.resolve(s).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){h(o,i,r,a,c,"next",e)}function c(e){h(o,i,r,a,c,"throw",e)}a(void 0)}))}}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function _(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==f(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===f(t)?t:String(t)}System.register(["interactjs","cherry-markdown"],(function(t,r){"use strict";var c,s;return{setters:[function(e){c=e.default},function(e){s=e.default}],execute:function(){var r,l,h,m,y,w,b,x,k,C={},T=[],N=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,E=Array.isArray;function S(e,t){for(var n in t)e[n]=t[n];return e}function A(e){var t=e.parentNode;t&&t.removeChild(e)}function M(e,t,n){var i,o,a,c={};for(a in t)"key"==a?i=t[a]:"ref"==a?o=t[a]:c[a]=t[a];if(arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===c[a]&&(c[a]=e.defaultProps[a]);return O(e,c,i,o,null)}function O(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++h:r};return null==r&&null!=l.vnode&&l.vnode(o),o}function L(e){return e.children}function I(e,t){this.props=e,this.context=t}function D(e,t){if(null==t)return e.__?D(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__d||n.__e;return"function"==typeof e.type?D(e):null}function z(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return z(e)}}function P(e){(!e.__d&&(e.__d=!0)&&y.push(e)&&!B.__r++||w!==l.debounceRendering)&&((w=l.debounceRendering)||b)(B)}function B(){var e,t,n,i,r,o,a,c,s;for(y.sort(x);e=y.shift();)e.__d&&(t=y.length,i=void 0,r=void 0,o=void 0,c=(a=(n=e).__v).__e,(s=n.__P)&&(i=[],r=[],(o=S({},a)).__v=a.__v+1,$(s,a,o,n.__n,void 0!==s.ownerSVGElement,null!=a.__h?[c]:null,i,null==c?D(a):c,a.__h,r),X(i,a,r),a.__e!=c&&z(a)),y.length>t&&y.sort(x));B.__r=0}function H(e,t,n,i,r,o,a,c,s,l,u){var d,h,p,f,v,m,_,g,y,w=0,b=i&&i.__k||T,x=b.length,k=x,N=t.length;for(n.__k=[],d=0;d<N;d++)null!=(f=n.__k[d]=null==(f=t[d])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?O(null,f,null,null,f):E(f)?O(L,{children:f},null,null,null):f.__b>0?O(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)?(f.__=n,f.__b=n.__b+1,-1===(g=V(f,b,_=d+w,k))?p=C:(p=b[g]||C,b[g]=void 0,k--),$(e,f,p,r,o,a,c,s,l,u),v=f.__e,(h=f.ref)&&p.ref!=h&&(p.ref&&Z(p.ref,null,f),u.push(h,f.__c||v,f)),null!=v&&(null==m&&(m=v),(y=p===C||null===p.__v)?-1==g&&w--:g!==_&&(g===_+1?w++:g>_?k>N-_?w+=g-_:w--:w=g<_&&g==_-1?g-_:0),_=d+w,"function"!=typeof f.type||g===_&&p.__k!==f.__k?"function"==typeof f.type||g===_&&!y?void 0!==f.__d?(s=f.__d,f.__d=void 0):s=v.nextSibling:s=R(e,v,s):s=j(f,s,e),"function"==typeof n.type&&(n.__d=s))):(p=b[d])&&null==p.key&&p.__e&&(p.__e==s&&(p.__=i,s=D(p)),G(p,p,!1),b[d]=null);for(n.__e=m,d=x;d--;)null!=b[d]&&("function"==typeof n.type&&null!=b[d].__e&&b[d].__e==n.__d&&(n.__d=b[d].__e.nextSibling),G(b[d],b[d]))}function j(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?j(i,t,n):R(n,i.__e,t));return t}function F(e,t){return t=t||[],null==e||"boolean"==typeof e||(E(e)?e.some((function(e){F(e,t)})):t.push(e)),t}function R(e,t,n){return null==n||n.parentNode!==e?e.insertBefore(t,null):t==n&&null!=t.parentNode||e.insertBefore(t,n),t.nextSibling}function V(e,t,n,i){var r=e.key,o=e.type,a=n-1,c=n+1,s=t[n];if(null===s||s&&r==s.key&&o===s.type)return n;if(i>(null!=s?1:0))for(;a>=0||c<t.length;){if(a>=0){if((s=t[a])&&r==s.key&&o===s.type)return a;a--}if(c<t.length){if((s=t[c])&&r==s.key&&o===s.type)return c;c++}}return-1}function W(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||N.test(t)?n:n+"px"}function U(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||W(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||W(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,o?Y:q,o)):e.removeEventListener(t,o?Y:q,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function q(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(l.event?l.event(e):e)}function Y(e){return this.l[e.type+!0](l.event?l.event(e):e)}function $(e,t,n,i,o,a,c,s,u,d){var h,p,f,v,m,_,g,y,w,b,x,k,T,N,M,O=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(u=n.__h,s=t.__e=n.__e,t.__h=null,a=[s]),(h=l.__b)&&h(t);e:if("function"==typeof O)try{if(y=t.props,w=(h=O.contextType)&&i[h.__c],b=h?w?w.props.value:h.__:i,n.__c?g=(p=t.__c=n.__c).__=p.__E:("prototype"in O&&O.prototype.render?t.__c=p=new O(y,b):(t.__c=p=new I(y,b),p.constructor=O,p.render=J),w&&w.sub(p),p.props=y,p.state||(p.state={}),p.context=b,p.__n=i,f=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=S({},p.__s)),S(p.__s,O.getDerivedStateFromProps(y,p.__s))),v=p.props,m=p.state,p.__v=t,f)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&y!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(y,b),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(y,p.__s,b)||t.__v===n.__v)){for(t.__v!==n.__v&&(p.props=y,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),x=0;x<p._sb.length;x++)p.__h.push(p._sb[x]);p._sb=[],p.__h.length&&c.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(y,p.__s,b),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(v,m,_)}))}if(p.context=b,p.props=y,p.__P=e,p.__e=!1,k=l.__r,T=0,"prototype"in O&&O.prototype.render){for(p.state=p.__s,p.__d=!1,k&&k(t),h=p.render(p.props,p.state,p.context),N=0;N<p._sb.length;N++)p.__h.push(p._sb[N]);p._sb=[]}else do{p.__d=!1,k&&k(t),h=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++T<25);p.state=p.__s,null!=p.getChildContext&&(i=S(S({},i),p.getChildContext())),f||null==p.getSnapshotBeforeUpdate||(_=p.getSnapshotBeforeUpdate(v,m)),H(e,E(M=null!=h&&h.type===L&&null==h.key?h.props.children:h)?M:[M],t,n,i,o,a,c,s,u,d),p.base=t.__e,t.__h=null,p.__h.length&&c.push(p),g&&(p.__E=p.__=null)}catch(e){t.__v=null,(u||null!=a)&&(t.__e=s,t.__h=!!u,a[a.indexOf(s)]=null),l.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,o,a,c,s,l){var u,d,h,p=n.props,f=t.props,v=t.type,m=0;if("svg"===v&&(o=!0),null!=a)for(;m<a.length;m++)if((u=a[m])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){e=u,a[m]=null;break}if(null==e){if(null===v)return document.createTextNode(f);e=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,f.is&&f),a=null,s=!1}if(null===v)p===f||s&&e.data===f||(e.data=f);else{if(a=a&&r.call(e.childNodes),d=(p=n.props||C).dangerouslySetInnerHTML,h=f.dangerouslySetInnerHTML,!s){if(null!=a)for(p={},m=0;m<e.attributes.length;m++)p[e.attributes[m].name]=e.attributes[m].value;(h||d)&&(h&&(d&&h.__html==d.__html||h.__html===e.innerHTML)||(e.innerHTML=h&&h.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||U(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||U(e,o,t[o],n[o],i)}(e,f,p,o,s),h)t.__k=[];else if(H(e,E(m=t.props.children)?m:[m],t,n,i,o&&"foreignObject"!==v,a,c,a?a[0]:n.__k&&D(n,0),s,l),null!=a)for(m=a.length;m--;)null!=a[m]&&A(a[m]);s||("value"in f&&void 0!==(m=f.value)&&(m!==e.value||"progress"===v&&!m||"option"===v&&m!==p.value)&&U(e,"value",m,p.value,!1),"checked"in f&&void 0!==(m=f.checked)&&m!==e.checked&&U(e,"checked",m,p.checked,!1))}return e}(n.__e,t,n,i,o,a,c,u,d);(h=l.diffed)&&h(t)}function X(e,t,n){for(var i=0;i<n.length;i++)Z(n[i],n[++i],n[++i]);l.__c&&l.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){l.__e(e,t.__v)}}))}function Z(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){l.__e(e,n)}}function G(e,t,n){var i,r;if(l.unmount&&l.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Z(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){l.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&G(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||A(e.__e),e.__=e.__e=e.__d=void 0}function J(e,t,n){return this.constructor(e,n)}function K(e,t,n){var i,o,a,c;l.__&&l.__(e,t),o=(i="function"==typeof n)?null:n&&n.__k||t.__k,a=[],c=[],$(t,e=(!i&&n||t).__k=M(L,null,[e]),o||C,C,void 0!==t.ownerSVGElement,!i&&n?[n]:o?null:t.firstChild?r.call(t.childNodes):null,a,!i&&n?n:o?o.__e:t.firstChild,i,c),X(a,e,c)}r=T.slice,l={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},h=0,m=function(e){return null!=e&&void 0===e.constructor},I.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=S({},this.state),"function"==typeof e&&(e=e(S({},n),this.props)),e&&S(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),P(this))},I.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),P(this))},I.prototype.render=L,y=[],b="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,x=function(e,t){return e.__v.__b-t.__v.__b},B.__r=0,k=0;function Q(e,t,n,i,r){var o="".concat(e,"-").concat(t);return n&&(o+="-".concat(n)),i&&(o+="__".concat(i)),r&&(o+="--".concat(r)),o}var ee=function(){function e(t,n){v(this,e),g(this,"namespace",void 0),this.block=t,this.namespace=n||"ibiz"}return _(e,[{key:"b",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Q(this.namespace,this.block,e,"","")}},{key:"e",value:function(e){return e?Q(this.namespace,this.block,"",e,""):""}},{key:"m",value:function(e){return e?Q(this.namespace,this.block,"","",e):""}},{key:"be",value:function(e,t){return e&&t?Q(this.namespace,this.block,e,t,""):""}},{key:"em",value:function(e,t){return e&&t?Q(this.namespace,this.block,"",e,t):""}},{key:"bm",value:function(e,t){return e&&t?Q(this.namespace,this.block,e,"",t):""}},{key:"bem",value:function(e,t,n){return e&&t&&n?Q(this.namespace,this.block,e,t,n):""}},{key:"is",value:function(e,t){return e&&t?"".concat("is-").concat(e):""}},{key:"cssVar",value:function(e){var t={};for(var n in e)e[n]&&(t[this.cssVarName(n)]=e[n]);return t}},{key:"cssVarBlock",value:function(e){var t={};for(var n in e)e[n]&&(t[this.cssVarBlockName(n)]=e[n]);return t}},{key:"cssVarName",value:function(e){return"--".concat(this.namespace,"-").concat(e)}},{key:"cssVarBlockName",value:function(e){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(e)}}]),e}();function te(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function ne(e,t){for(var n,i="",r=0,o=-1,a=0,c=0;c<=e.length;++c){if(c<e.length)n=e.charCodeAt(c);else{if(47===n)break;n=47}if(47===n){if(o===c-1||1===a);else if(o!==c-1&&2===a){if(i.length<2||2!==r||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var s=i.lastIndexOf("/");if(s!==i.length-1){-1===s?(i="",r=0):r=(i=i.slice(0,s)).length-1-i.lastIndexOf("/"),o=c,a=0;continue}}else if(2===i.length||1===i.length){i="",r=0,o=c,a=0;continue}t&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+e.slice(o+1,c):i=e.slice(o+1,c),r=c-o-1;o=c,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var ie={resolve:function(){for(var e,t="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===e&&(e=process.cwd()),r=e),te(r),0!==r.length&&(t=r+"/"+t,n=47===r.charCodeAt(0))}return t=ne(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(te(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=ne(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return te(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];te(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":ie.normalize(e)},relative:function(e,t){if(te(e),te(t),e===t)return"";if((e=ie.resolve(e))===(t=ie.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var i=e.length,r=i-n,o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var a=t.length-o,c=r<a?r:a,s=-1,l=0;l<=c;++l){if(l===c){if(a>c){if(47===t.charCodeAt(o+l))return t.slice(o+l+1);if(0===l)return t.slice(o+l)}else r>c&&(47===e.charCodeAt(n+l)?s=l:0===l&&(s=0));break}var u=e.charCodeAt(n+l);if(u!==t.charCodeAt(o+l))break;47===u&&(s=l)}var d="";for(l=n+s+1;l<=i;++l)l!==i&&47!==e.charCodeAt(l)||(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(o+s):(o+=s,47===t.charCodeAt(o)&&++o,t.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(te(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,i=-1,r=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');te(e);var n,i=0,r=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var s=e.charCodeAt(n);if(47===s){if(!o){i=n+1;break}}else-1===c&&(o=!1,c=n+1),a>=0&&(s===t.charCodeAt(a)?-1==--a&&(r=n):(a=-1,r=c))}return i===r?r=c:-1===r&&(r=e.length),e.slice(i,r)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":e.slice(i,r)},extname:function(e){te(e);for(var t=-1,n=0,i=-1,r=!0,o=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(r=!1,i=a+1),46===c?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!r){n=a+1;break}}return-1===t||-1===i||0===o||1===o&&t===i-1&&t===n+1?"":e.slice(t,i)},format:function(e){if(null===e||"object"!==f(e))throw new TypeError('The "pathObject" argument must be of type Object. Received type '+f(e));return function(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+e+i:i}("/",e)},parse:function(e){te(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,i=e.charCodeAt(0),r=47===i;r?(t.root="/",n=1):n=0;for(var o=-1,a=0,c=-1,s=!0,l=e.length-1,u=0;l>=n;--l)if(47!==(i=e.charCodeAt(l)))-1===c&&(s=!1,c=l+1),46===i?-1===o?o=l:1!==u&&(u=1):-1!==o&&(u=-1);else if(!s){a=l+1;break}return-1===o||-1===c||0===u||1===u&&o===c-1&&o===a+1?-1!==c&&(t.base=t.name=0===a&&r?e.slice(1,c):e.slice(a,c)):(0===a&&r?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(a,o),t.base=e.slice(a,c)),t.ext=e.slice(o,c)),a>0?t.dir=e.slice(0,a-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};function re(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function oe(){return"".concat(re()+re(),"-").concat(re(),"-").concat(re(),"-").concat(re(),"-").concat(re()).concat(re()).concat(re())}ie.posix=ie;var ae=/<svg\b[^>]*>[\s\S]*?<\/svg>/;function ce(e){return ae.test(e)}var se=function(){function e(){v(this,e)}return _(e,null,[{key:"copy",value:function(e){return this.inputElement||(this.inputElement=document.createElement("input"),this.inputElement.style.position="absolute",this.inputElement.style.left="-9999px",document.body.appendChild(this.inputElement)),this.inputElement.value=e,this.inputElement.select(),document.execCommand("copy")}}]),e}();g(se,"inputElement",null);var le=function(){function e(){v(this,e)}var t,n,i,r,o,a,c,s,l,u;return _(e,null,[{key:"checkDataBaseExists",value:(u=p(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,indexedDB.databases();case 3:return n=e.sent,e.abrupt("return",n.some((function(e){return e.name===t})));case 7:return e.prev=7,e.t0=e.catch(0),console.error("检查数据库是否存在时出错:",e.t0),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[0,7]])}))),function(e){return u.apply(this,arguments)})},{key:"deleteDatabase",value:(l=p(d().mark((function t(n){var i,r;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.lastLink&&(null===(i=(r=e.lastLink).close)||void 0===i||i.call(r)),t.abrupt("return",new Promise((function(e,t){var i=indexedDB.deleteDatabase(n);i.onsuccess=function(){e(!0)},i.onerror=function(){e(!1)},i.onblocked=function(){console.warn("删除数据库 ".concat(n," 被阻塞,可能有其他连接正在使用该数据库。")),t(new Error("删除数据库 ".concat(n," 被阻塞")))}})));case 2:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)})},{key:"checkTableExists",value:(s=p(d().mark((function t(n,i){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.checkDataBaseExists(n);case 2:if(t.sent){t.next=5;break}return t.abrupt("return",!1);case 5:return t.abrupt("return",new Promise((function(t,r){var o=indexedDB.open(n);o.onupgradeneeded=function(t){e.db=t.target.result,e.version=e.db.version},o.onsuccess=function(n){e.db=n.target.result,e.lastLink=o.result;var r=e.db.objectStoreNames.contains(i);o.result.close(),t(r)},o.onerror=function(e){r(e.target.error)}})));case 6:case"end":return t.stop()}}),t)}))),function(e,t){return s.apply(this,arguments)})},{key:"createTable",value:(c=p(d().mark((function t(n,i,r){var o,a=arguments;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=a.length>3&&void 0!==a[3]&&a[3],t.abrupt("return",new Promise((function(t){var a,c;e.version+=1,e.lastLink&&(null===(a=(c=e.lastLink).close)||void 0===a||a.call(c));var s=indexedDB.open(n,e.version);s.onupgradeneeded=function(t){if(e.db=t.target.result,!e.db.objectStoreNames.contains(i)){var n={};r?n.keyPath=r:o&&(n.autoIncrement=!0),e.db.createObjectStore(i,n)}},s.onsuccess=function(){e.lastLink=s.result,s.result.close(),t(!0)},s.onerror=function(){t(!1)}})));case 2:case"end":return t.stop()}}),t)}))),function(e,t,n){return c.apply(this,arguments)})},{key:"deleteTable",value:(a=p(d().mark((function t(n,i){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var r,o;e.version+=1,e.lastLink&&(null===(r=(o=e.lastLink).close)||void 0===r||r.call(o));var a=indexedDB.open(n,e.version);a.onupgradeneeded=function(t){e.db=t.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)&&e.db.deleteObjectStore(i)},a.onsuccess=function(n){e.db=n.target.result,e.lastLink=a.result,a.result.close(),t(!0)},a.onerror=function(){a.result.close(),t(!1)}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)})},{key:"addData",value:(o=p(d().mark((function t(n,i,r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)){var o=e.db.transaction([i],"readwrite").objectStore(i).add(r);o.onsuccess=function(e){t(r)},o.onerror=function(){t(null)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"deleteData",value:(r=p(d().mark((function t(n,i,r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)){var o=e.db.transaction([i],"readwrite").objectStore(i).delete(r);o.onsuccess=function(e){t(!0)},o.onerror=function(){t(!1)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"updateData",value:(i=p(d().mark((function t(n,i,r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)){var o=e.db.transaction([i],"readwrite").objectStore(i).put(r);o.onsuccess=function(e){t(r)},o.onerror=function(){t(r)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"getData",value:(n=p(d().mark((function t(n,i,r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)){var c=e.db.transaction([i],"readonly").objectStore(i).get(r);c.onsuccess=function(e){t(c.result)},c.onerror=function(){o(new Error("未找到数据".concat(r)))}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t,i){return n.apply(this,arguments)})},{key:"getAllData",value:(t=p(d().mark((function t(n,i){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,r){var o=indexedDB.open(n);o.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=o.result,e.db.objectStoreNames.contains(i)){var r=e.db.transaction([i],"readonly").objectStore(i).getAll();r.onsuccess=function(e){t(r.result)},r.onerror=function(){t([])}}o.result.close()},o.onerror=function(){o.result.close(),r()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})}]),e}();g(le,"version",1),g(le,"db",null),g(le,"lastLink",void 0);var ue=function(){function e(t){v(this,e),g(this,"options",void 0),this.options=u({multiple:!0,accept:"*/*",maxSize:5242880},t)}var t,n;return _(e,[{key:"openFilePicker",value:function(){var e=this,t=document.createElement("input");t.type="file",t.multiple=this.options.multiple,t.accept=this.options.accept||"",t.onchange=function(t){var n=Array.from(t.target.files||[]);e.handleFiles(n)},t.click()}},{key:"handleFiles",value:(n=p(d().mark((function e(t){var n,i,r,o=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.length){e.next=2;break}return e.abrupt("return");case 2:return r=t.filter((function(e){var t,n;return!(o.options.maxSize&&e.size>o.options.maxSize&&(null===(t=(n=o.options).onError)||void 0===t||t.call(n,new Error("文件大小超过限制 (".concat(o.formatSize(e.size)," > ").concat(o.formatSize(o.options.maxSize),")")),e),1))})),null===(n=(i=this.options).onSelect)||void 0===n||n.call(i,r),e.next=6,Promise.all(r.map((function(e){return o.processFile(e)})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"processFile",value:(t=p(d().mark((function e(t){var n,i,r,o,a,c,s,l,u=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a=function(e){var n,i;null===(n=(i=u.options).onProgress)||void 0===n||n.call(i,t,e)},e.next=4,this.options.onUpload(t,a);case 4:c=e.sent,null===(n=(i=this.options).onProgress)||void 0===n||n.call(i,t,100),null===(r=(o=this.options).onSuccess)||void 0===r||r.call(o,c,t),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),null===(s=(l=this.options).onError)||void 0===s||s.call(l,e.t0 instanceof Error?e.t0:new Error("上传失败"),t);case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e){return t.apply(this,arguments)})},{key:"formatSize",value:function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return"".concat((e/Math.pow(1024,t)).toFixed(2)," ").concat(["B","KB","MB","GB"][t])}}]),e}(),de=function(){function e(){v(this,e)}return _(e,null,[{key:"getCdataContent",value:function(e){if(!e)return null;var t=Array.from(e.childNodes).find((function(e){return e.nodeType===e.CDATA_SECTION_NODE}));return(null==t?void 0:t.nodeValue)||e.textContent}},{key:"parse",value:function(e){var t=this,n=(new DOMParser).parseFromString(e,"text/xml");return Array.from(n.querySelectorAll("resource")).map((function(e){var n=e.getAttribute("type")||"",i=e.querySelector("data"),r=e.querySelector("metadata");try{var o=t.getCdataContent(i),a=t.getCdataContent(r),c=o?JSON.parse(o):{},s=a?JSON.parse(a):{};return{id:c.id,type:n,data:c,metadata:s}}catch(Jn){throw new Error("XML 解析错误: ".concat(Jn.message))}}))}},{key:"parseMixedContent",value:function(e){var t=/<resources\b[^>]*>[\s\S]*?<\/resources>/i.exec(e);if(!t)return{resources:[],remainingText:e,hasResources:!1};var n=a(t,1)[0],i=t.index,r=i+n.length,o=(e.slice(0,i)+e.slice(r)).replace(/\n/g,"");try{return{resources:this.parse(n),remainingText:o,hasResources:!0}}catch(c){return{resources:[],remainingText:o,hasResources:!0,error:"资源解析失败: ".concat(c.message)}}}},{key:"stringify",value:function(e){var t=document.implementation.createDocument(null,null,null),n=t.createElement("resources");n.setAttribute("version","1.0");var i=function(e){return"\n".concat(" ".repeat(e))};return e.forEach((function(e){n.appendChild(t.createTextNode(i(1)));var r=t.createElement("resource");r.setAttribute("type",e.type),r.setAttribute("version","1.0");var o=function(e,n){var r=t.createElement(e);r.appendChild(t.createTextNode(i(2)));var o=t.createCDATASection(JSON.stringify(n));return r.appendChild(o),r.appendChild(t.createTextNode(i(1))),r};r.appendChild(t.createTextNode(i(2))),r.appendChild(o("data",e.data)),r.appendChild(t.createTextNode(i(2))),r.appendChild(o("metadata",e.metadata)),r.appendChild(t.createTextNode(i(1))),n.appendChild(r)})),n.appendChild(t.createTextNode("\n")),t.appendChild(n),(new XMLSerializer).serializeToString(t).replace(/></g,">\n<")}}]),e}(),he=function(){function e(){v(this,e)}return _(e,null,[{key:"getCdataContent",value:function(e){if(!e)return null;var t=Array.from(e.childNodes).find((function(e){return e.nodeType===e.CDATA_SECTION_NODE}));return(null==t?void 0:t.nodeValue)||e.textContent}},{key:"parse",value:function(e){var t=this,n=(new DOMParser).parseFromString(e,"text/xml");return Array.from(n.querySelectorAll("suggestion")).map((function(e){var n=e.getAttribute("type")||"",i=e.querySelector("data"),r=e.querySelector("metadata");try{var o=t.getCdataContent(i),a=t.getCdataContent(r);return{type:n,data:o?JSON.parse(o):{},metadata:a?JSON.parse(a):{}}}catch(Jn){throw new Error("XML 解析错误: ".concat(Jn.message))}}))}},{key:"parseMixedContent",value:function(e){var t=/<suggestions\b[^>]*>[\s\S]*?<\/suggestions>/i.exec(e);if(!t)return{suggestions:[],remainingText:e,hasSuggestions:!1};var n=a(t,1)[0],i=t.index,r=i+n.length,o=(e.slice(0,i)+e.slice(r)).replace(/\n/g,"");try{return{suggestions:this.parse(n),remainingText:o,hasSuggestions:!0}}catch(c){return{suggestions:[],remainingText:o,hasSuggestions:!0,error:"资源解析失败: ".concat(c.message)}}}},{key:"stringify",value:function(e){var t=document.implementation.createDocument(null,null,null),n=t.createElement("suggestions");n.setAttribute("version","1.0");var i=function(e){return"\n".concat(" ".repeat(e))};return e.forEach((function(e){n.appendChild(t.createTextNode(i(1)));var r=t.createElement("suggestion");r.setAttribute("type",e.type),r.setAttribute("version","1.0");var o=function(e,n){var r=t.createElement(e);r.appendChild(t.createTextNode(i(2)));var o=t.createCDATASection(JSON.stringify(n));return r.appendChild(o),r.appendChild(t.createTextNode(i(1))),r};r.appendChild(t.createTextNode(i(2))),r.appendChild(o("data",e.data)),r.appendChild(t.createTextNode(i(2))),r.appendChild(o("metadata",e.metadata)),r.appendChild(t.createTextNode(i(1))),n.appendChild(r)})),n.appendChild(t.createTextNode("\n")),t.appendChild(n),(new XMLSerializer).serializeToString(t).replace(/></g,">\n<")}}]),e}();function pe(e){return e.x>=0&&e.x<=1&&e.y>=0&&e.y<=1}function fe(e,t,n,i){var r=e/window.innerWidth,o=t/window.innerHeight;return{x:Math.max(0,Math.min(r,1-n)),y:Math.max(0,Math.min(o,1-i))}}var ve,me,_e,ge,ye=0,we=[],be=[],xe=l.__b,ke=l.__r,Ce=l.diffed,Te=l.__c,Ne=l.unmount;function Ee(e,t){l.__h&&l.__h(me,e,ye||t),ye=0;var n=me.__H||(me.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:be}),n.__[e]}function Se(e){return ye=1,function(e,t,n){var i=Ee(ve++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):Fe(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=me,!me.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&i.__c.props===e)&&(!o||o.call(this,e,t,n))};me.u=!0;var o=me.shouldComponentUpdate,a=me.componentWillUpdate;me.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}a&&a.call(this,e,t,n)},me.shouldComponentUpdate=r}return i.__N||i.__}(Fe,e)}function Ae(e,t){var n=Ee(ve++,3);!l.__s&&je(n.__H,t)&&(n.__=e,n.i=t,me.__H.__h.push(n))}function Me(e){return ye=5,Oe((function(){return{current:e}}),[])}function Oe(e,t){var n=Ee(ve++,7);return je(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Le(e,t){return ye=8,Oe((function(){return e}),t)}function Ie(e){var t=me.context[e.__c],n=Ee(ve++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(me)),t.props.value):e.__}function De(){for(var e;e=we.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Be),e.__H.__h.forEach(He),e.__H.__h=[]}catch(ei){e.__H.__h=[],l.__e(ei,e.__v)}}l.__b=function(e){me=null,xe&&xe(e)},l.__r=function(e){ke&&ke(e),ve=0;var t=(me=e.__c).__H;t&&(_e===me?(t.__h=[],me.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=be,e.__N=e.i=void 0}))):(t.__h.forEach(Be),t.__h.forEach(He),t.__h=[],ve=0)),_e=me},l.diffed=function(e){Ce&&Ce(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==we.push(t)&&ge===l.requestAnimationFrame||((ge=l.requestAnimationFrame)||Pe)(De)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==be&&(e.__=e.__V),e.i=void 0,e.__V=be}))),_e=me=null},l.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Be),e.__h=e.__h.filter((function(e){return!e.__||He(e)}))}catch(Ge){t.some((function(e){e.__h&&(e.__h=[])})),t=[],l.__e(Ge,e.__v)}})),Te&&Te(e,t)},l.unmount=function(e){Ne&&Ne(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Be(e)}catch(e){t=e}})),n.__H=void 0,t&&l.__e(t,n.__v))};var ze="function"==typeof requestAnimationFrame;function Pe(e){var t,n=function(){clearTimeout(i),ze&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);ze&&(t=requestAnimationFrame(n))}function Be(e){var t=me,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),me=t}function He(e){var t=me;e.__c=e.__(),me=t}function je(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Fe(e,t){return"function"==typeof t?t(e):t}function Re(){throw new Error("Cycle detected")}var Ve=Symbol.for("preact-signals");function We(){if(Xe>1)Xe--;else{for(var e,t=!1;void 0!==$e;){var n=$e;for($e=void 0,Ze++;void 0!==n;){var i=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&et(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=i}}if(Ze=0,Xe--,t)throw e}}var Ue,qe,Ye=void 0,$e=void 0,Xe=0,Ze=0,Ge=0;function Je(e){if(void 0!==Ye){var t=e.n;if(void 0===t||t.t!==Ye)return t={i:0,S:e,p:Ye.s,n:void 0,t:Ye,e:void 0,x:void 0,r:t},void 0!==Ye.s&&(Ye.s.n=t),Ye.s=t,e.n=t,32&Ye.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=Ye.s,t.n=void 0,Ye.s.n=t,Ye.s=t),t}}function Ke(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function Qe(e){return new Ke(e)}function et(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function tt(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function nt(e){for(var t=e.s,n=void 0;void 0!==t;){var i=t.p;-1===t.i?(t.S.U(t),void 0!==i&&(i.n=t.n),void 0!==t.n&&(t.n.p=i)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=i}e.s=n}function it(e){Ke.call(this,void 0),this.x=e,this.s=void 0,this.g=Ge-1,this.f=4}function rt(e){return new it(e)}function ot(e){var t=e.u;if(e.u=void 0,"function"==typeof t){Xe++;var n=Ye;Ye=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,at(e),t}finally{Ye=n,We()}}}function at(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ot(e)}function ct(e){if(Ye!==this)throw new Error("Out-of-order effect");nt(this),Ye=e,this.f&=-2,8&this.f&&at(this),We()}function st(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function lt(e){var t=new st(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function ut(e,t){l[e]=t.bind(null,l[e]||function(){})}function dt(e){qe&&qe(),qe=e&&e.S()}function ht(e){var t=this,n=e.data,i=ft(n);i.value=n;var r=Oe((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;m(r.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=r.peek()},rt((function(){var e=i.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return r.value}function pt(e,t,n,i){var r=t in e&&void 0===e.ownerSVGElement,o=Qe(n);return{o:function(e,t){o.value=e,i=t},d:lt((function(){var n=o.value.value;i[t]!==n&&(i[t]=n,r?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}function ft(e){return Oe((function(){return Qe(e)}),[])}function vt(e){var t=Me(e);return t.current=e,Ue.__$f|=4,Oe((function(){return rt((function(){return t.current()}))}),[])}Ke.prototype.brand=Ve,Ke.prototype.h=function(){return!0},Ke.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},Ke.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},Ke.prototype.subscribe=function(e){var t=this;return lt((function(){var n=t.value,i=32&this.f;this.f&=-33;try{e(n)}finally{this.f|=i}}))},Ke.prototype.valueOf=function(){return this.value},Ke.prototype.toString=function(){return this.value+""},Ke.prototype.toJSON=function(){return this.value},Ke.prototype.peek=function(){return this.v},Object.defineProperty(Ke.prototype,"value",{get:function(){var e=Je(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(Ye instanceof it&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){Ze>100&&Re(),this.v=e,this.i++,Ge++,Xe++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{We()}}}}),(it.prototype=new Ke).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===Ge)return!0;if(this.g=Ge,this.f|=1,this.i>0&&!et(this))return this.f&=-2,!0;var e=Ye;try{tt(this),Ye=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Ye=e,nt(this),this.f&=-2,!0},it.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Ke.prototype.S.call(this,e)},it.prototype.U=function(e){if(void 0!==this.t&&(Ke.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},it.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},it.prototype.peek=function(){if(this.h()||Re(),16&this.f)throw this.v;return this.v},Object.defineProperty(it.prototype,"value",{get:function(){1&this.f&&Re();var e=Je(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),st.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},st.prototype.S=function(){1&this.f&&Re(),this.f|=1,this.f&=-9,ot(this),tt(this),Xe++;var e=Ye;return Ye=this,ct.bind(this,e)},st.prototype.N=function(){2&this.f||(this.f|=2,this.o=$e,$e=this)},st.prototype.d=function(){this.f|=8,1&this.f||at(this)},ht.displayName="_st",Object.defineProperties(Ke.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ht},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ut("__b",(function(e,t){if("string"==typeof t.type){var n,i=t.props;for(var r in i)if("children"!==r){var o=i[r];o instanceof Ke&&(n||(t.__np=n={}),n[r]=o,i[r]=o.peek())}}e(t)})),ut("__r",(function(e,t){dt();var n,i=t.__c;i&&(i.__$f&=-2,void 0===(n=i.__$u)&&(i.__$u=n=function(e){var t;return lt((function(){t=this})),t.c=function(){i.__$f|=1,i.setState({})},t}())),Ue=i,dt(n),e(t)})),ut("__e",(function(e,t,n,i){dt(),Ue=void 0,e(t,n,i)})),ut("diffed",(function(e,t){var n;if(dt(),Ue=void 0,"string"==typeof t.type&&(n=t.__e)){var i=t.__np,r=t.props;if(i){var o=n.U;if(o)for(var a in o){var c=o[a];void 0===c||a in i||(c.d(),o[a]=void 0)}else n.U=o={};for(var s in i){var l=o[s],u=i[s];void 0===l?(l=pt(n,s,u,r),o[s]=l):l.o(u,r)}}}e(t)})),ut("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var i=n.U;if(i)for(var r in n.U=void 0,i){var o=i[r];o&&o.d()}}}else{var a=t.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}e(t)})),ut("__h",(function(e,t,n,i){(i<3||9===i)&&(t.__$f|=2),e(t,n,i)})),I.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var i in t)return!0;for(var r in e)if("__source"!==r&&e[r]!==this.props[r])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};var mt=0;function _t(e,t,n,i,r,o){var a,c,s={};for(c in t)"ref"==c?a=t[c]:s[c]=t[c];var u={type:e,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--mt,__source:r,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(c in a)void 0===s[c]&&(s[c]=a[c]);return l.vnode&&l.vnode(u),u}var gt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"})})},yt=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z"})})},wt=function(e){return _t("svg",{viewBox:"0 0 1024 1024",id:"send",className:e.className,version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-0.9 3.7-0.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 0.7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-0.8 4.2-2.6 5-5 1.4-4.2-0.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})},bt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M962 197.61H747v-60c0-55.14-44.86-100-100-100H377c-55.14 0-100 44.86-100 100v60H62c-11.05 0-20 8.95-20 20s8.95 20 20 20h60v630.57c0 66.17 53.83 120 120 120h540c66.17 0 120-53.83 120-120V237.61h60c11.05 0 20-8.95 20-20s-8.95-20-20-20zM637.34 457.66v260c0 12.01-10.72 21.63-23.06 19.77-9.84-1.48-16.94-10.25-16.94-20.2V458.09c0-9.95 7.1-18.72 16.94-20.2 12.34-1.86 23.06 7.76 23.06 19.77z m-210.68 0v260c0 11-9 20-20 20s-20-9-20-20v-260c0-11 9-20 20-20s20 9 20 20zM317 137.61c0-33.08 26.92-60 60-60h270c33.08 0 60 26.92 60 60v60H317v-60z"})})},xt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M511.582491 63.413262C265.134543 63.413262 64.62588 263.921925 64.62588 510.369873s200.508663 446.957635 446.957635 446.957635 446.957635-200.508663 446.957635-446.957635S758.031463 63.413262 511.582491 63.413262zM509.001713 751.859903c-98.517781 0-182.467775-62.623269-214.771505-150.056598l0.327458-0.134053c-2.007727-4.036943-3.38305-8.422833-3.38305-13.237489 0-16.647145 13.494339-30.142507 30.142507-30.142507 13.389962 0 24.358781 8.877181 28.2893 20.955264l0.422625-0.172939c23.269983 65.442478 85.645612 112.503307 158.972665 112.503307 93.106538 0 168.845523-75.738985 168.845523-168.845523s-75.738985-168.845523-168.845523-168.845523c-20.432355 0-39.874149 3.980661-58.013275 10.66899l21.248953 40.742936c2.486634 2.677992 4.0175 6.2831 4.0175 10.243295 0 8.417717-8.404414 14.921851-15.365966 15.07023-0.102331 0-0.206708 0-0.309038 0-0.220011 0-0.427742 0-0.647753-0.013303l-150.579507-6.463202c-5.372358-0.234337-10.229992-3.310396-12.716626-8.093329-2.486634-4.76963-2.236947-10.509355 0.647753-15.055904l80.890308-127.179564c2.8847-4.533246 8.006348-7.151887 13.365402-6.960529 5.372358 0.234337 10.227945 3.312442 12.71458 8.095375l18.580171 35.625382c26.629497-10.855232 55.683207-16.963347 86.168522-16.963347 126.338407 0 229.130537 102.791108 229.130537 229.130537S635.340119 751.859903 509.001713 751.859903z"})})},kt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M891.072 822.144V167.36a34.432 34.432 0 0 0-34.432-34.432H201.856C201.856 94.848 232.704 64 270.784 64h620.288C929.152 64 960 94.848 960 132.928v620.288c0 38.08-30.848 68.928-68.928 68.928z m-68.928-551.36v620.288c0 38.08-30.848 68.928-68.928 68.928H132.928A68.928 68.928 0 0 1 64 891.072V270.784c0-38.08 30.848-68.928 68.928-68.928h620.288c38.08 0 68.928 30.848 68.928 68.928z m-137.856 137.856H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z m0 206.72H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z"})})},Ct=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M547.4 197.4v46l200.3 0.1L546.1 444l32.4 32.6 201.9-200.7v200.9h46V197.5zM471.4 584.4l-32.6-32.6L243.6 747V547.9h-46v278.7h279v-46H275z"})})},Tt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M544 480V282.944h52.224l0.064 107.968L763.072 224l36.928 36.928-166.976 166.976 108.032-0.128V480H544zM260.928 800l-36.928-36.928 166.912-166.784-107.968-0.064V544H480v197.056h-52.224l0.064-107.968L260.928 800z"})})},Nt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"})})},Et=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[_t("path",{d:"M481.0752 263.3728l50.9952 1.024 1.8432-105.8816-50.9952-0.8192z"}),_t("path",{d:"M486.441426 180.895362a66.56 66.56 0 1 0 42.091944-126.290153 66.56 66.56 0 1 0-42.091944 126.290153Z"}),_t("path",{d:"M138.8544 664.3712c-52.8384 0-95.8464-43.008-95.8464-95.8464s43.008-95.8464 95.8464-95.8464M880.0256 472.6784c52.8384 0 95.8464 43.008 95.8464 95.8464s-43.008 95.8464-95.8464 95.8464"}),_t("path",{d:"M507.4944 220.5696c-220.16 0-398.7456 162.816-398.7456 363.7248s178.5856 363.7248 398.7456 363.7248 398.7456-162.816 398.7456-363.7248-178.5856-363.7248-398.7456-363.7248z m0 559.9232c-166.2976 0-301.2608-100.5568-301.2608-224.4608s134.9632-224.4608 301.2608-224.4608S808.7552 432.128 808.7552 556.032 673.792 780.4928 507.4944 780.4928z"}),_t("path",{d:"M319.6928 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"}),_t("path",{d:"M617.472 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"})]})},St=function(){return _t("svg",{viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_t("path",{d:"M5.856 17.121a.979.979 0 0 1-.327-.06.839.839 0 0 1-.283-.177.739.739 0 0 1-.187-.255.724.724 0 0 1-.07-.303l-.02-1.609a4.663 4.663 0 0 1-1.446-.455 4.252 4.252 0 0 1-.637-.401c-.199-.146-.385-.31-.553-.492a4.442 4.442 0 0 1-.45-.577 4.303 4.303 0 0 1-.327-.637 3.823 3.823 0 0 1-.206-.686 3.729 3.729 0 0 1-.064-.704V6.478c0-.261.025-.516.077-.771a4.43 4.43 0 0 1 .244-.747 4.062 4.062 0 0 1 .932-1.28c.2-.183.418-.347.65-.493.23-.145.482-.267.739-.364a4.21 4.21 0 0 1 .81-.225c.27-.054.553-.078.835-.078H8.55c.103 0 .2.018.29.054a.7.7 0 0 1 .411.376.667.667 0 0 1-.161.766.736.736 0 0 1-.25.151.764.764 0 0 1-.29.055H5.573c-.186 0-.366.012-.54.049-.18.03-.353.079-.52.145-.167.061-.328.14-.482.237-.148.091-.29.2-.418.316a2.897 2.897 0 0 0-.347.388c-.097.14-.187.286-.257.444a2.473 2.473 0 0 0-.206.977v4.287c0 .17.013.333.051.503a2.549 2.549 0 0 0 .772 1.33 2.721 2.721 0 0 0 .913.559c.167.066.347.115.527.152.18.03.36.048.546.048a.904.904 0 0 1 .61.23.848.848 0 0 1 .194.262.84.84 0 0 1 .07.303l.007.99 1.915-1.293a2.877 2.877 0 0 1 1.64-.492h2.372c.186 0 .366-.018.54-.048.18-.03.353-.08.52-.146.168-.067.329-.146.483-.237.148-.091.29-.2.418-.316.128-.121.244-.249.347-.388a2.8 2.8 0 0 0 .257-.444 2.47 2.47 0 0 0 .206-.977V8.585a.646.646 0 0 1 .225-.492.679.679 0 0 1 .244-.152.814.814 0 0 1 .585 0c.09.03.174.085.244.152a.657.657 0 0 1 .225.492V10.8c0 .261-.032.516-.083.771a4.192 4.192 0 0 1-.245.74c-.109.244-.244.468-.398.687a3.735 3.735 0 0 1-.534.6c-.2.183-.418.347-.65.493a4.134 4.134 0 0 1-.738.364 4.7 4.7 0 0 1-.81.225c-.27.054-.553.079-.836.079h-1.877c-.604 0-1.144.164-1.633.491l-2.54 1.713a.913.913 0 0 1-.514.157z",fill:"currentColor"}),_t("path",{d:"M15.866 4.125h-4.174c-.41 0-.741.313-.741.7 0 .387.332.7.741.7h4.174c.41 0 .742-.313.742-.7 0-.387-.332-.7-.742-.7z",fill:"currentColor"}),_t("path",{d:"M14.537 2.932c0-.396-.34-.717-.759-.717s-.758.32-.758.717v3.786c0 .396.34.717.758.717.42 0 .76-.321.76-.717V2.932z",fill:"currentColor"})]})},At=function(){return _t("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_t("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})})},Mt=function(){var e=1e3,t=140,n=250,i=.8;return _t("svg",{fill:"currentColor",viewBox:"0 0 ".concat(e," ").concat(e),xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Array.from({length:4}).map((function(e,r){return _t("rect",{fill:"currentColor",rx:70,ry:70,height:n,width:t,x:286.66666666666663*r,y:375,children:[_t("animate",{attributeName:"height",values:"".concat(n,"; ").concat(500,"; ").concat(n),keyTimes:"0; 0.5; 1",dur:"".concat(i,"s"),begin:"".concat(.2*r,"s"),repeatCount:"indefinite"}),_t("animate",{attributeName:"y",values:"".concat(375,"; ").concat(250,"; ").concat(375),keyTimes:"0; 0.5; 1",dur:"".concat(i,"s"),begin:"".concat(.2*r,"s"),repeatCount:"indefinite"})]},r)}))})},Ot=function(e){return _t("svg",{className:e.className,onClick:e.onClick,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M128 384a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m768 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m-372.4288 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z"})})},Lt=function(e){return _t("svg",{className:e.className,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M498.33984 607.8464c-10.99776-32.9728-50.09408-73.5232-82.6368-85.74976L150.9376 422.8096c-38.54336-14.4384-36.98688-69.46816 2.27328-81.73568L844.92288 124.90752c33.30048-10.40384 64.57344 20.8896 54.1696 54.1696L682.92608 870.78912a43.2128 43.2128 0 0 1-81.36704 3.25632 121682.5344 121682.5344 0 0 1-103.2192-266.19904z"})})},It=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M972.657609 209.348408C987.158609 209.36839 998.930114 197.571202 998.949999 182.99865 998.969882 168.426097 987.230618 156.59651 972.729617 156.576528L32.457975 155.280806C17.956974 155.260823 6.18547 167.058012 6.165585 181.630564 6.1457 196.203116 17.884965 208.032703 32.385966 208.052686L972.657609 209.348408ZM180.466902 992.356169 180.466902 1019.014859 206.993296 1018.74074 833.361858 1012.267947 859.348284 1011.999407 859.348284 985.883377 859.348284 289.397297C859.348284 274.824732 847.59289 263.011332 833.091874 263.011332 818.590859 263.011332 806.835465 274.824732 806.835465 289.397297L806.835465 985.883377 832.82189 959.498805 206.453329 965.971599 232.979723 992.356169 232.979723 282.67005C232.979723 268.097483 221.224329 256.284085 206.723313 256.284085 192.222298 256.284085 180.466902 268.097483 180.466902 282.67005L180.466902 992.356169ZM656.410257 847.079027C656.410257 861.651593 668.165651 873.464992 682.666667 873.464992 697.167682 873.464992 708.923076 861.651593 708.923076 847.079027L708.923076 372.131659C708.923076 357.559091 697.167682 345.745694 682.666667 345.745694 668.165651 345.745694 656.410257 357.559091 656.410257 372.131659L656.410257 847.079027ZM341.333333 847.079027C341.333333 861.651593 353.08873 873.464992 367.589743 873.464992 382.090758 873.464992 393.846155 861.651593 393.846155 847.079027L393.846155 372.131659C393.846155 357.559091 382.090758 345.745694 367.589743 345.745694 353.08873 345.745694 341.333333 357.559091 341.333333 372.131659L341.333333 847.079027ZM498.871795 847.079027C498.871795 861.651593 510.627189 873.464992 525.128205 873.464992 539.62922 873.464992 551.384614 861.651593 551.384614 847.079027L551.384614 372.131659C551.384614 357.559091 539.62922 345.745694 525.128205 345.745694 510.627189 345.745694 498.871795 357.559091 498.871795 372.131659L498.871795 847.079027ZM392.147755 116.721777C392.147755 102.063669 403.758665 90.363507 418.40134 90.363507L622.925796 90.363507C637.408947 90.363507 649.179381 102.1619 649.179381 116.549585L649.179381 171.644875 701.692203 171.644875 701.692203 116.549585C701.692203 72.986607 666.38105 37.591577 622.925796 37.591577L418.40134 37.591577C374.724427 37.591577 339.634933 72.950804 339.634933 116.721777L339.634933 165.310801 392.147755 165.310801 392.147755 116.721777Z"})})},Dt=function(e){return _t("svg",{xmlns:"http://www.w3.org/2000/svg",className:e.className,viewBox:"0 0 512 512",children:_t("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 184l144 144 144-144"})})},zt=function(e){return _t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"".concat(e.className," icon"),viewBox:"0 0 512 512",children:_t("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"})})},Pt=function(e){return _t("svg",{className:e.className,width:"16",height:"16",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",children:_t("circle",{cx:"25",cy:"25",r:"20",stroke:"currentColor",strokeWidth:"5",fill:"none",strokeDasharray:"31.415, 31.415",strokeLinecap:"round",children:_t("animateTransform",{attributeName:"transform",type:"rotate",from:"0 25 25",to:"360 25 25",dur:"1s",repeatCount:"indefinite"})})})},Bt=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:_t("path",{d:"M704 256v490.666667a170.666667 170.666667 0 0 1-170.666667 170.666666 170.666667 170.666667 0 0 1-170.666666-170.666666V213.333333A106.666667 106.666667 0 0 1 469.333333 106.666667 106.666667 106.666667 0 0 1 576 213.333333v448a42.666667 42.666667 0 0 1-42.666667 42.666667 42.666667 42.666667 0 0 1-42.666666-42.666667V256H426.666667v405.333333a106.666667 106.666667 0 0 0 106.666666 106.666667 106.666667 106.666667 0 0 0 106.666667-106.666667V213.333333a170.666667 170.666667 0 0 0-170.666667-170.666666 170.666667 170.666667 0 0 0-170.666666 170.666666v533.333334a234.666667 234.666667 0 0 0 234.666666 234.666666 234.666667 234.666667 0 0 0 234.666667-234.666666V256h-64z"})})},Ht=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:[_t("path",{d:"M842.666667 285.866667l-187.733334-187.733334c-14.933333-14.933333-32-21.333333-53.333333-21.333333H234.666667C194.133333 74.666667 160 108.8 160 149.333333v725.333334c0 40.533333 34.133333 74.666667 74.666667 74.666666h554.666666c40.533333 0 74.666667-34.133333 74.666667-74.666666V337.066667c0-19.2-8.533333-38.4-21.333333-51.2z m-44.8 44.8c-2.133333 2.133333-4.266667 0-8.533334 0h-170.666666c-6.4 0-10.666667-4.266667-10.666667-10.666667V149.333333c0-2.133333 0-6.4-2.133333-8.533333 0 0 2.133333 0 2.133333 2.133333l189.866667 187.733334z m-8.533334 554.666666H234.666667c-6.4 0-10.666667-4.266667-10.666667-10.666666V149.333333c0-6.4 4.266667-10.666667 10.666667-10.666666h311.466666c-2.133333 4.266667-2.133333 6.4-2.133333 10.666666v170.666667c0 40.533333 34.133333 74.666667 74.666667 74.666667h170.666666c4.266667 0 6.4 0 10.666667-2.133334V874.666667c0 6.4-4.266667 10.666667-10.666667 10.666666z",fill:"currentColor"}),_t("path",{d:"M640 693.333333H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM640 522.666667H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM341.333333 416h85.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-85.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32z",fill:"currentColor"})]})},jt=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:_t("path",{d:"M557.248 511.68l135.776-135.744-45.248-45.28L512 466.432l-135.776-135.776-45.248 45.28 135.776 135.744-135.776 135.776 45.248 45.248L512 556.928l135.776 135.776 45.248-45.248-135.776-135.776zM512 64c247.136 0 448 200.864 448 448s-200.864 448-448 448S64 759.136 64 512 264.864 64 512 64z",fill:"currentColor"})})},Ft=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:_t("path",{d:"M512.43945313 904.51953125c-6.06445313 0-12.12890625-1.58203125-17.57812501-4.74609375L136.70703125 689.71484375c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867188-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l76.37695313-44.91210938L136.97070312 540.125c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867187-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l73.38867187-43.15429688-73.125-42.890625C126.51171875 387.81054687 120.0078125 376.38476562 120.0078125 364.08007812c0-12.3046875 6.50390625-23.73046875 17.13867188-29.97070312L495.828125 122.99609375c10.8984375-6.41601563 24.34570313-6.41601563 35.24414063 0l358.15429687 210.05859375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-73.38867188 43.15429688 73.12500001 42.890625c10.63476563 6.24023438 17.13867188 17.66601563 17.13867187 29.97070312s-6.50390625 23.73046875-17.13867187 29.97070313L812.5859375 583.89453125l76.11328125 44.6484375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-358.59375 211.2890625c-5.44921875 3.1640625-11.6015625 4.74609375-17.66601563 4.74609375zM223.015625 659.65625l289.42382813 169.8046875 290.12695312-170.77148438-58.44726563-34.27734374L530.28125 750.18359375a34.67285156 34.67285156 0 0 1-35.24414063 0L281.7265625 625.02734375 223.015625 659.65625z m76.90429688-104.58984375l212.69531249 124.8046875 290.12695313-170.77148438-55.546875-32.60742187-216.65039063 127.6171875a34.67285156 34.67285156 0 0 1-35.24414062 0L279.00195312 477.28320312l-55.81054687 32.78320313 75.49804688 44.296875c0.43945313 0.26367188 0.79101563 0.52734375 1.23046874 0.703125z m-2.81250001-147.83203125l215.68359376 126.5625 216.12304687-127.17773438c0.3515625-0.26367188 0.703125-0.43945313 1.0546875-0.61523437l72.86132813-42.890625-289.33593751-169.8046875-290.12695312 170.68359375 72.59765625 42.62695313c0.43945313 0.17578125 0.79101563 0.43945313 1.14257813 0.61523437z"})})},Rt=function(e){return _t("svg",{className:e.className,id:"stop",viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:[_t("path",{d:"M512.268258 1022.835842c-68.658678 0-135.399619-13.564433-198.369591-40.316509-60.752236-25.809077-115.373446-62.712976-162.346233-109.685763-46.971763-46.971763-83.875662-101.592974-109.685763-162.346233C15.115619 647.517366 1.551186 580.777449 1.551186 512.118771S15.115619 376.719151 41.866671 313.74918c25.810101-60.752236 62.714-115.373446 109.685763-162.346233 46.972787-46.971763 101.593997-83.875662 162.346233-109.685763 62.969971-26.751052 129.710912-40.315485 198.369591-40.315485s135.398595 13.564433 198.368567 40.315485c60.752236 25.810101 115.373446 62.714 162.346233 109.685763 46.971763 46.972787 83.875662 101.593997 109.685763 162.346233 26.752076 62.969971 40.316509 129.710912 40.316509 198.369591s-13.564433 135.398595-40.316509 198.368567c-25.809077 60.75326-62.712976 115.37447-109.685763 162.346233-46.971763 46.972787-101.592974 83.876686-162.346233 109.685763C647.666853 1009.27141 580.925912 1022.835842 512.268258 1022.835842zM512.268258 50.548195c-62.018782 0-122.293887 12.247716-179.152287 36.403219-54.923257 23.333323-104.317532 56.709936-146.810821 99.204249s-75.870926 91.888588-99.204249 146.810821c-24.155503 56.8584-36.403219 117.133505-36.403219 179.152287 0 62.017758 12.247716 122.292863 36.403219 179.152287 23.333323 54.923257 56.709936 104.317532 99.204249 146.811845 42.493289 42.493289 91.888588 75.870926 146.810821 99.204249 56.8584 24.155503 117.133505 36.403219 179.152287 36.403219 62.017758 0 122.292863-12.247716 179.152287-36.403219 54.923257-23.333323 104.317532-56.71096 146.811845-99.204249 42.493289-42.494313 75.870926-91.888588 99.204249-146.811845 24.155503-56.8584 36.403219-117.133505 36.403219-179.152287s-12.247716-122.293887-36.403219-179.152287c-23.334347-54.923257-56.71096-104.317532-99.205273-146.810821-42.493289-42.493289-91.887565-75.870926-146.810821-99.204249C634.561121 62.795911 574.286016 50.548195 512.268258 50.548195z",fill:"currentColor"}),_t("path",{d:"M655.434047 694.244421 367.12637 694.244421c-21.046987 0-38.170445-17.123458-38.170445-38.170445L328.955925 367.766298c0-21.046987 17.123458-38.170445 38.170445-38.170445l288.307678 0c21.048011 0 38.170445 17.123458 38.170445 38.170445l0 288.307678C693.604492 677.120962 676.482058 694.244421 655.434047 694.244421zM380.150191 643.050154l262.260035 0L642.410226 380.79012 380.150191 380.79012 380.150191 643.050154z",fill:"currentColor"})]})},Vt=function(e){return _t("svg",{xmlns:"http://www.w3.org/2000/svg",className:e.className,viewBox:"0 0 512 512",children:_t("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})})},Wt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:[_t("path",{d:"M394.688 126.208a32 32 0 0 1 32-32h170.688a32 32 0 0 1 32 32v138.624h288a32 32 0 0 1 32 32v170.688a32 32 0 0 1-32 32H106.688a32 32 0 0 1-32-32V296.832a32 32 0 0 1 32-32h288V126.208z m64 32v138.624a32 32 0 0 1-32 32h-288v106.688h746.688V328.832h-288a32 32 0 0 1-32-32V158.208H458.688z"}),_t("path",{d:"M138.688 469.376a32 32 0 0 1 32-32h682.688a32 32 0 0 1 32 32v384a32 32 0 0 1-32 32H170.688a32 32 0 0 1-32-32v-384z m64 32v320h618.688v-320H202.688z"}),_t("path",{d:"M341.376 691.52a32 32 0 0 1 32 32V851.2a32 32 0 1 1-64 0v-127.68a32 32 0 0 1 32-32zM512 691.2a32 32 0 0 1 32 32v128a32 32 0 0 1-64 0v-128a32 32 0 0 1 32-32zM682.688 691.52a32 32 0 0 1 32 32V851.2a32 32 0 1 1-64 0v-127.68a32 32 0 0 1 32-32z"})]})},Ut=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:_t("path",{d:"M843.251 424.407l43.828-74.898c10.194-17.946 32.596-22.158 48.956-11.598 16.298 10.499 23.44 32.658 14.223 49.566l-113.11 195.212-61.164-40.044-126.418-82.285c-16.115-11.598-20.632-34.428-10.194-51.702 9.705-17.397 31.009-23.501 47.857-13.734l89.67 59.028C748.576 295.547 615.81 180.667 461.008 180.667c-177.387 0-320.042 148.758-320.042 331.335 0 183.613 143.692 331.334 319.981 331.334 107.861 0.184 208.58-56.158 268.034-149.858 1.099-1.038 1.099-2.075 2.075-2.075 6.348-9.949 17.092-15.871 28.568-15.81 19.35 0 35.648 16.848 35.648 36.93 0 7.508-2.137 14.833-6.104 21.059-72.823 114.698-196.066 183.675-328.099 183.614-216.088 0-391.4-181.478-391.4-405.195 0-223.718 175.312-405.195 391.339-405.195 183.125-0.427 342.016 131.606 382.243 317.601z"})})},qt=function(){return _t("svg",{version:"1.1",className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M627.498667 55.168l170.666666 170.666667a42.624 42.624 0 0 1 0 60.330666l-469.333333 469.333334A42.538667 42.538667 0 0 1 298.666667 768H128a42.666667 42.666667 0 0 1-42.666667-42.666667v-170.666666c0-11.306667 4.48-22.186667 12.501334-30.165334l469.333333-469.333333a42.624 42.624 0 0 1 60.330667 0zM896 896a42.666667 42.666667 0 0 1 0 85.333333H128a42.666667 42.666667 0 0 1 0-85.333333h768zM597.333333 145.664l-426.666666 426.666667V682.666667h110.336l426.666666-426.666667L597.333333 145.664z"})})},Yt=function(e){return _t("svg",{xmlns:"http://www.w3.org/2000/svg",className:e.className,viewBox:"0 0 512 512",children:_t("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M184 112l144 144-144 144"})})},$t=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M896 870.4l-128-128c55.467-68.267 89.6-149.333 89.6-238.933 0-98.134-38.4-192-110.933-264.534-149.334-149.333-384-149.333-533.334-4.266-145.066 145.066-145.066 384 0 529.066 72.534 72.534 166.4 110.934 264.534 110.934 89.6 0 174.933-29.867 238.933-89.6l128 128c4.267 4.266 12.8 8.533 21.333 8.533s17.067-4.267 21.334-8.533c17.066-8.534 17.066-29.867 8.533-42.667zM260.267 721.067c-119.467-123.734-119.467-320 0-439.467 59.733-59.733 140.8-89.6 217.6-89.6 81.066 0 157.866 29.867 217.6 89.6 59.733 59.733 89.6 136.533 89.6 217.6 0 81.067-34.134 162.133-89.6 217.6-55.467 59.733-132.267 93.867-217.6 93.867-81.067 0-157.867-34.134-217.6-89.6z"})})},Xt=function(e){var t=e.items,n=ft([]),i=new ee("chat-thought-chain"),r=ft([]);Ae((function(){r.value=t.filter((function(e){return e.description})),r.value.length>0&&r.value.forEach((function(e,t){e.done&&(n.value=[].concat(o(n.value),[t]))}))}),[t]);return 0===r.value.length?null:_t("div",{className:"".concat(i.b()," ").concat(i.is("single",1===r.value.length)),children:r.value.map((function(e,t){if(e.description){var r=n.value.includes(t);return _t("div",{className:"".concat(i.e("item")," ").concat(i.is("collapsed",r)),children:[_t("div",{className:i.e("item-icon"),children:e.icon||_t("span",{children:t})}),_t("div",{className:i.e("item-content"),children:[_t("div",{className:i.e("item-title"),onClick:function(){return function(e){n.value.includes(e)?n.value=n.value.filter((function(t){return t!==e})):n.value=[].concat(o(n.value),[e])}(t)},children:[e.title,_t(Dt,{className:i.e("icon")})]}),_t("div",{className:i.e("item-description"),children:e.description})]})]},t)}}))})},Zt=function(e){var t=e.items,n=e.onItemClick,i=new ee("chat-suggestions");return _t("div",{className:"".concat(i.b()),children:t.map((function(e,t){return _t("div",{className:"".concat(i.e("item")," ").concat(i.is("action","action"===e.type)),onClick:function(t){return function(e,t){null==n||n(e,t)}(e,t)},title:e.metadata.content_name,children:[e.metadata.content_name,_t(Yt,{className:"".concat(i.e("item-icon"))})]},t)}))})},Gt=new ee("markdown-message"),Jt=function(e){var t=e.message,n=e.size,i=ft(oe()),r=ft(null),o=Oe((function(){return 20===t.state&&!0!==t.completed}),[t.state,t.completed]),a=Oe((function(){return 20===t.state&&!0===t.completed}),[t.state,t.completed]),c=ft({title:"",description:"",icon:_t(Pt,{})}),l=ft({hasSuggestions:!1,suggestions:[]}),u=function(e){e&&e.length>0?l.value={hasSuggestions:!0,suggestions:e}:l.value={hasSuggestions:!1,suggestions:[]}},d=function(e){var t=e.indexOf("<think>"),n=e.indexOf("</think>"),i="",r="",o=!1;return-1===n?(o=!1,i=e.slice(t+7),r=""):(o=!0,i=e.slice(t+7,n),r=e.slice(n+8)),{isThoughtCompleted:o,thoughtContent:i,answerContent:r}};return Ae((function(){if(n>=0&&r.value){if(-1!==t.content.indexOf("<think>")){var e=d(t.content),i=e.isThoughtCompleted,o=e.thoughtContent,a=e.answerContent;i?(c.value.icon=_t(zt,{}),c.value.title="思考完成"):!0===t.completed?(c.value.icon=_t(zt,{}),c.value.title="思考已停止"):(c.value.icon=_t(Pt,{}),c.value.title="思考中..."),c.value.description=o||"",r.value.setMarkdown(a||"")}else r.value.setMarkdown(t.content||"");u(t.suggestions)}}),[t,n]),Ae((function(){var e="";if(-1!==t.content.indexOf("<think>")){var n=d(t.content),o=n.isThoughtCompleted,a=n.thoughtContent,l=n.answerContent;c.value={title:o?"思考完成":!0===t.completed?"思考已停止":"思考中...",description:a||"",icon:o||!0===t.completed?_t(zt,{}):_t(Pt,{})},l&&(e=l)}else e=t.content;u(t.suggestions),r.value=new s({id:i,value:e||"",editor:{defaultModel:"previewOnly"},themeSettings:{mainTheme:"dark"},previewer:{enablePreviewerBubble:!1}})}),[]),_t("div",{className:"".concat(Gt.b()," ").concat(Gt.is("loading",o)),children:[_t("div",{className:Gt.b("header"),children:[_t("div",{className:Gt.be("header","caption"),children:"AI "}),e.children,a?_t("div",{className:Gt.be("header","timeout"),children:"请求超时"}):null]}),_t("div",{className:"".concat(Gt.b("content")," pre-wrap-container"),children:[_t(Xt,{items:[c.value]}),_t("div",{id:i})]}),_t("div",{className:Gt.b("footer"),children:l.value.hasSuggestions?_t(Zt,{items:l.value.suggestions,onItemClick:function(t,n){!function(t,n){e.controller.handleSuggestionClick(e.message,t,n)}(t,n)}}):null})]})},Kt=new ee("ossfile-material"),Qt=function(e){var t=vt((function(){return e.material.data.name})),n=vt((function(){return e.material.metadata.size})),i=vt((function(){var t=e.material.metadata.state;return"successed"===t?"上传成功":"uploading"===t?"上传中":"failed"===t?"上传失败":"未知状态"})),r=vt((function(){switch(e.material.metadata.state){case"successed":return"#1890ff";case"uploading":return"#52c41a";default:return"#ff4d4f"}}));return _t("div",{className:Kt.b(),children:[_t("div",{className:Kt.b("left"),children:_t(Ht,{})}),_t("div",{className:Kt.b("right"),children:[_t("div",{className:Kt.e("name"),title:t,children:t}),_t("div",{className:Kt.e("metadata"),children:[_t("div",{children:[n,"B"]}),_t("div",{style:{color:r.value},children:i})]})]})]})},en=new ee("common-material"),tn=function(e){var t,n,i,r,o=null===(t=e.controller.opts.questionToolbarItems)||void 0===t?void 0:t.find((function(t){return t.id===e.material.metadata.actionId})),a=vt((function(){return e.material.metadata.name}));return _t("div",{className:en.b(),children:[_t("div",{className:en.b("left"),children:o&&o.icon?"function"==typeof o.icon?o.icon():(null===(n=o.icon)||void 0===n?void 0:n.showIcon)&&_t(L,{children:null!==(i=o.icon)&&void 0!==i&&i.cssClass?_t("i",{className:o.icon.cssClass}):null!==(r=o.icon)&&void 0!==r&&r.imagePath?ce(o.icon.imagePath)?_t("div",{dangerouslySetInnerHTML:{__html:o.icon.imagePath}}):_t("img",{src:o.icon.imagePath}):null}):_t(Ft,{})}),_t("div",{className:en.b("right"),children:[_t("div",{className:en.e("name"),title:a,children:a}),_t("div",{className:en.e("metadata"),children:_t("div",{children:(null==o?void 0:o.label)||"素材资源"})})]})]})},nn=new ee("chat-input-material-item"),rn=function(e){var t=e.material,n=null;if("ossfile"===t.type)n=Qt;else n=tn;return _t("div",{className:"".concat(nn.b()," ").concat(nn.is("disabled",e.disabled)),children:[_t("div",{className:nn.e("icon"),onClick:function(){e.controller.deleteMaterial(t)},children:_t(jt,{})}),M(n,{material:t,controller:e.controller})]})},on=new ee("user-message-question"),an=function(e){var t=ft(oe()),n=ft(null),i=vt((function(){return e.message.content})),r=vt((function(){return de.parseMixedContent(i.value)}));return Ae((function(){n.value=new s({id:t,value:r.value.remainingText||"",editor:{defaultModel:"previewOnly"},themeSettings:{mainTheme:"dark"},previewer:{enablePreviewerBubble:!1}})}),[r.value.remainingText]),_t("div",{className:on.b(),children:[_t("div",{className:on.e("user-header"),children:[e.children,_t("div",{className:on.e("user"),children:"我"})]}),_t("div",{className:on.e("content"),children:_t("div",{className:on.em("content","body"),children:[r.value.hasResources&&_t("div",{className:on.em("content","material"),children:r.value.resources.map((function(t){return _t(rn,{material:t,disabled:!0,controller:e.controller},t.id)}))}),_t("div",{className:"pre-wrap-container",children:_t("div",{id:t})})]})})]})},cn=new ee("error-message"),sn=function(e){var t=vt((function(){return e.message.content}));return _t("div",{className:cn.b(),children:[_t("div",{className:cn.b("header"),children:[_t("div",{className:cn.be("header","caption"),children:"AI "}),e.children]}),_t("div",{className:"".concat(cn.e("content")," pre-wrap-container"),children:_t("span",{children:t})})]})},ln=new ee("unknown-message"),un=function(e){return _t("div",{className:ln.b(),children:_t("div",{className:"".concat(ln.e("content")," pre-wrap-container"),children:["暂未支持的消息类型: ",e.message.type]})})},dn=new ee("chat-message-item"),hn=function(e){var t=e.message,n=e.size,i=null;switch(t.type){case"DEFAULT":i="ASSISTANT"===t.role?Jt:an;break;case"ERROR":i=sn;break;default:i=un}return _t("div",{className:dn.b(),children:M(i,{size:n,message:t,controller:e.controller,children:e.children})})},pn=function(){function e(t){v(this,e),this.msg=t}return _(e,[{key:"messageid",get:function(){return this.msg.messageid}},{key:"state",get:function(){return this.msg.state}},{key:"role",get:function(){return this.msg.role}},{key:"type",get:function(){return this.msg.type}},{key:"realcontent",get:function(){var e=this.msg.content;if(-1!==e.indexOf("<think>")&&-1===e.indexOf("</think>"))return"";if(-1!==(e=e.replace(/<think>[^]*?<\/think>/g,"").trim()).indexOf("<resources>")&&-1===e.indexOf("</resources>"))return"";var t=(e=e.replace(/<resources>[^]*?<\/resources>/g,"").trim()).indexOf("<suggestions>");return-1!==t&&(e=e.substring(0,t).trim()),e}},{key:"content",get:function(){return this.msg.content}},{key:"completed",get:function(){return this.msg.completed}},{key:"suggestions",get:function(){return this.msg.suggestions}},{key:"_origin",get:function(){return this.msg}},{key:"update",value:function(e){e.content||(e.content=""),-1!==e.content.indexOf("<think>")&&this.msg.content&&(this.msg.content=""),this.msg.content+=e.content}},{key:"updateCompleted",value:function(e){this.msg.completed=e}}]),e}(),fn=function(){function e(t){v(this,e),this.data=t}return _(e,[{key:"appid",get:function(){return this.data.appid}},{key:"id",get:function(){return this.data.id}},{key:"type",get:function(){return this.data.type}},{key:"caption",get:function(){return this.data.caption}},{key:"sourceCaption",get:function(){return this.data.sourceCaption||this.caption}},{key:"url",get:function(){return this.data.url}},{key:"aiChat",get:function(){return this.data.aiChat}}]),e}(),vn=function(){function e(t){v(this,e),this.material=t}return _(e,[{key:"id",get:function(){return this.material.id}},{key:"type",get:function(){return this.material.type}},{key:"metadata",get:function(){return this.material.metadata}},{key:"data",get:function(){return this.material.data}}]),e}(),mn=new ee("chat-toolbar-item"),_n=function(e){var t,n,i,r=e.model,o=e.data,c=e.className,s=e.disabled,l=void 0!==s&&s,u=e.buttonType,d=void 0===u?"default":u,h=e.onClick,p=a(Se(!1),2),f=p[0],v=p[1],m=Me(null),_=function(e){return"function"==typeof e.hidden?e.hidden(o):!0===e.hidden};if(_(r))return _t(L,{});var g=function(e){return!!l||("function"==typeof e.disabled?e.disabled(o):!0===e.disabled)},y=function(e){var t,n,i,r;return"function"==typeof e.icon?e.icon():null!==(t=e.icon)&&void 0!==t&&t.showIcon&&null!==(n=e.icon)&&void 0!==n&&n.cssClass?_t("i",{className:e.icon.cssClass}):null!==(i=e.icon)&&void 0!==i&&i.showIcon&&null!==(r=e.icon)&&void 0!==r&&r.imagePath?ce(e.icon.imagePath)?_t("div",{dangerouslySetInnerHTML:{__html:e.icon.imagePath}}):_t("img",{src:e.icon.imagePath}):void 0},w=function(e,t){g(t)||(v(!1),h(e,t))};return Ae((function(){var e=function(e){m.current&&m.current.contains(e.target)||v(!1)};return f&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[f]),_t("div",{className:"".concat(mn.b()," ").concat(mn.b(d)," ").concat(r.customClass||""," ").concat(c||""," ").concat(mn.is("disabled",g(r))," ").concat(mn.is("more",!(null===(t=r.children)||void 0===t||!t.length))),children:[_t("div",{title:r.title,className:mn.e("content"),onClick:function(e){return w(e,r)},children:[_t("div",{className:mn.em("content","icon"),children:y(r)}),_t("div",{className:mn.em("content","label"),children:r.label})]}),(null===(n=r.children)||void 0===n?void 0:n.length)&&_t("div",{title:"更多",className:mn.e("more"),onClick:function(e){g(r)||v(!0)},children:_t("i",{"aria-hidden":"true",className:"fa fa-angle-down ".concat(mn.em("more","icon"))})}),f&&_t("div",{ref:m,className:mn.b("dropdown"),children:null===(i=r.children)||void 0===i?void 0:i.map((function(e,t){if(!_(e))return _t("div",{title:e.title,onClick:function(t){return w(t,e)},className:"".concat(mn.be("dropdown","item")," ").concat(e.customClass||""," ").concat(mn.is("disabled",g(e))),children:[_t("div",{className:mn.bem("dropdown","item","icon"),children:y(e)}),_t("div",{className:mn.bem("dropdown","item","label"),children:e.label})]},t)}))})]})},gn=new ee("chat-toolbar"),yn=function(e){var t=e.controller,n=e.items,i=void 0===n?[]:n,r=e.data,a=e.type,c=e.className,s=e.mode,l=Ie(Ci),d=[],h=[{label:"重置对话",title:"重置对话",icon:function(){return _t(Ut,{})},onClick:function(){t.resetTopic()},children:[{label:"清空对话",title:"清空对话",icon:function(){return _t(Wt,{})},onClick:function(){t.clearTopic()}},{label:"新建对话",title:"新建对话",hidden:"TOPIC"!==s,icon:function(){return _t(St,{})},onClick:function(){l.newTopic&&l.newTopic()}}]}],p=[{label:"刷新",title:"刷新",icon:function(){return _t(xt,{})},onClick:function(){t.refreshMessage(r)}},{label:"删除",title:"删除",icon:function(){return _t(bt,{})},onClick:function(){t.deleteMessage(r)}},{label:"复制",title:"复制",icon:function(){return _t(kt,{})},onClick:function(){t.copyMessage(r)}}];l.enableBackFill&&p.unshift.apply(p,[{label:"回填",title:"回填",icon:function(){return _t(yt,{})},onClick:function(){t.backfill(r)}}]);var f=[{label:"刷新",title:"刷新",icon:function(){return _t(xt,{})},onClick:function(){t.refreshMessage(r,!0)}}];if("content"===a)switch(r.type){case"DEFAULT":d="ASSISTANT"===r.role?[].concat(p,o(i)):[].concat(f);break;case"ERROR":d=[].concat(p,o(i))}else d=[].concat(h,o(i));var v=function(n,i){var o=u({},r);if(r instanceof pn?(Object.assign(o,{topic:t.topic}),o.msg.realcontent=r.realcontent):(o.data||(o.data={}),Object.assign(o.data,{messages:t.messages.value})),i.onClick&&"function"==typeof i.onClick)i.onClick(n,i,t.context,t.params,o);else{var a=e.controller.opts.extendToolbarClick;a&&"function"==typeof a&&a(n,i,t.context,t.params,o)}},m=Oe((function(){return"content"===a&&20===(null==r?void 0:r.state)&&!0!==(null==r?void 0:r.completed)}),[null==r?void 0:r.state,null==r?void 0:r.completed]);return _t("div",{className:"".concat(gn.b()," ").concat(c||""),children:d.map((function(e,t){return _t(_n,{data:r,model:e,disabled:m,buttonType:"content"===a?"circle":"default",onClick:v.bind(void 0)},t)}))})};var wn=function(e){var t,n,i,r=ft(!1),o=ft({}),a=new ee("chat-back-bottom"),c=ft(null),s=function(){if(c.value){var t=e.visibilityHeight||200,n=c.value.scrollHeight-c.value.scrollTop-c.value.offsetHeight;r.value=n>=t}},l=(t=s,n=300,i=null,function(){for(var e=this,r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i||(i=setTimeout((function(){t.apply(e,o),i=null}),n))});return Oe((function(){o.value={right:"".concat(e.right,"px"),bottom:"".concat(e.bottom,"px")}}),[e.right,e.bottom]),Ae((function(){if(e.target){var t,n=null!==(t=document.querySelector(e.target))&&void 0!==t?t:void 0;n&&(c.value=n,n.addEventListener("scroll",l),s())}}),[]),_t("div",{className:"".concat(a.b()," ").concat(a.is("visible",r.value)),style:o.value,onClick:function(){var t;c.value&&(c.value.scrollTo({top:c.value.scrollHeight,behavior:"smooth"}),null===(t=e.onClick)||void 0===t||t.call(e))},children:_t(Vt,{className:a.e("icon")})})},bn=new ee("chat-messages"),xn=function(e){var t=Me(null),n=a(Se(!0),2),i=n[0],r=n[1],o=Me(!1),c=e.controller.messages;Ae((function(){var e;i&&((e=t.current)&&(o.current=!0,e.scrollTo({top:e.scrollHeight,behavior:"auto"}),setTimeout((function(){o.current=!1}),500)))}),[c.value]);return _t("div",{ref:t,className:bn.b(),onScroll:function(){if(!o.current&&t.current){var e=t.current,n=e.scrollTop,i=e.scrollHeight,a=e.clientHeight;r(i-(n+a)<50)}},children:[c.value.map((function(t){var n,i=(null===(n=t.content)||void 0===n?void 0:n.length)||0;return"SYSTEM"!==t.role?_t(hn,{size:i,message:t,controller:e.controller,children:_t(yn,{data:t,type:"content",items:e.toolbarItems,controller:e.controller})},t.messageid):null})),_t(wn,{right:20,bottom:14,target:".".concat(bn.b()),onClick:function(){o.current=!0,r(!0)}})]})};function kn(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var i in t)if("__source"!==i&&e[i]!==t[i])return!0;return!1}function Cn(e){this.props=e}(Cn.prototype=new I).isPureReactComponent=!0,Cn.prototype.shouldComponentUpdate=function(e,t){return kn(this.props,e)||kn(this.state,t)};var Tn=l.__b;l.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Tn&&Tn(e)};var Nn=l.__e;l.__e=function(e,t,n,i){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);Nn(e,t,n,i)};var En=l.unmount;function Sn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Sn(e,t,n)}))),e}function An(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return An(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Mn(){this.__u=0,this.t=null,this.__b=null}function On(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ln(){this.u=null,this.o=null}l.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),En&&En(e)},(Mn.prototype=new I).__c=function(e,t){var n=t.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var r=On(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,r?r(c):c())};n.__R=a;var c=function(){if(! --i.__u){if(i.state.__a){var e=i.state.__a;i.__v.__k[0]=An(e,e.__c.__P,e.__c.__O)}var t;for(i.setState({__a:i.__b=null});t=i.t.pop();)t.forceUpdate()}},s=!0===t.__h;i.__u++||s||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(a,a)},Mn.prototype.componentWillUnmount=function(){this.t=[]},Mn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=Sn(this.__b,n,i.__O=i.__P)}this.__b=null}var r=t.__a&&M(L,null,e.fallback);return r&&(r.__h=null),[M(L,null,t.__a?null:e.children),r]};var In=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Dn(e){return this.getChildContext=function(){return e.context},e.children}function zn(e){var t=this,n=e.i;t.componentWillUnmount=function(){K(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),K(M(Dn,{context:t.context},e.__v),t.l)}function Pn(e,t){var n=M(zn,{__v:e,i:t});return n.containerInfo=t,n}(Ln.prototype=new I).__a=function(e){var t=this,n=On(t.__v),i=t.o.get(e);return i[0]++,function(r){var o=function(){t.props.revealOrder?(i.push(r),In(t,e,i)):r()};n?n(o):o()}},Ln.prototype.render=function(e){this.u=null,this.o=new Map;var t=F(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Ln.prototype.componentDidUpdate=Ln.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){In(e,n,t)}))};var Bn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Hn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,jn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Fn=/[A-Z0-9]/g,Rn="undefined"!=typeof document,Vn=function(e){return("undefined"!=typeof Symbol&&"symbol"==f(Symbol())?/fil|che|rad/:/fil|che|ra/).test(e)};I.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(I.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Wn=l.event;function Un(){}function qn(){return this.cancelBubble}function Yn(){return this.defaultPrevented}l.event=function(e){return Wn&&(e=Wn(e)),e.persist=Un,e.isPropagationStopped=qn,e.isDefaultPrevented=Yn,e.nativeEvent=e};var $n={enumerable:!1,configurable:!0,get:function(){return this.class}},Xn=l.vnode;l.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,i={};for(var r in t){var o=t[r];if(!("value"===r&&"defaultValue"in t&&null==o||Rn&&"children"===r&&"noscript"===n||"class"===r||"className"===r)){var a=r.toLowerCase();"defaultValue"===r&&"value"in t&&null==t.value?r="value":"download"===r&&!0===o?o="":"ondoubleclick"===a?r="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Vn(t.type)?"onfocus"===a?r="onfocusin":"onblur"===a?r="onfocusout":jn.test(r)?r=a:-1===n.indexOf("-")&&Hn.test(r)?r=r.replace(Fn,"-$&").toLowerCase():null===o&&(o=void 0):a=r="oninput","oninput"===a&&i[r=a]&&(r="oninputCapture"),i[r]=o}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=F(t.children).forEach((function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=F(t.children).forEach((function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",$n)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=Bn,Xn&&Xn(e)};var Zn=l.__r;l.__r=function(e){Zn&&Zn(e),e.__c};var Gn=l.diffed;l.diffed=function(e){Gn&&Gn(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};var Jn=new Map;function Kn(e){var t=Jn.get(e);t&&t.destroy()}function Qn(e){var t=Jn.get(e);t&&t.update()}var ei=null;"undefined"==typeof window?((ei=function(e){return e}).destroy=function(e){return e},ei.update=function(e){return e}):((ei=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!Jn.has(e)){var t,n=null,i=window.getComputedStyle(e),r=(t=e.value,function(){a({testForHeightReduction:""===t||!e.value.startsWith(t),restoreTextAlign:null}),t=e.value}),o=function(t){e.removeEventListener("autosize:destroy",o),e.removeEventListener("autosize:update",c),e.removeEventListener("input",r),window.removeEventListener("resize",c),Object.keys(t).forEach((function(n){return e.style[n]=t[n]})),Jn.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,textAlign:e.style.textAlign,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",o),e.addEventListener("autosize:update",c),e.addEventListener("input",r),window.addEventListener("resize",c),e.style.overflowX="hidden",e.style.wordWrap="break-word",Jn.set(e,{destroy:o,update:c}),c()}function a(t){var r,o,c=t.restoreTextAlign,s=void 0===c?null:c,l=t.testForHeightReduction,u=void 0===l||l,d=i.overflowY;if(0!==e.scrollHeight&&("vertical"===i.resize?e.style.resize="none":"both"===i.resize&&(e.style.resize="horizontal"),u&&(r=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach((function(e){var t=e[0],n=e[1];t.style.scrollBehavior="auto",t.scrollTop=n,t.style.scrollBehavior=null}))}}(e),e.style.height=""),o="content-box"===i.boxSizing?e.scrollHeight-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)):e.scrollHeight+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),"none"!==i.maxHeight&&o>parseFloat(i.maxHeight)?("hidden"===i.overflowY&&(e.style.overflow="scroll"),o=parseFloat(i.maxHeight)):"hidden"!==i.overflowY&&(e.style.overflow="hidden"),e.style.height=o+"px",s&&(e.style.textAlign=s),r&&r(),n!==o&&(e.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=o),d!==i.overflow&&!s)){var h=i.textAlign;"hidden"===i.overflow&&(e.style.textAlign="start"===h?"end":"start"),a({restoreTextAlign:h,testForHeightReduction:!0})}}function c(){a({testForHeightReduction:!0,restoreTextAlign:null})}}(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Kn),e},ei.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Qn),e});var ti=ei,ni=function(e){return e.STYLE_CACHE="ai-chat-style-cache",e.MINIMIZE_STYLY_CHCHE="ai-chat-minimize-style-cache",e.DATA_BASE_NAME="ibiz-chat",e.DATA_TABLE_NAME="history-message",e.DATA_TABLE_KEY_NAME="id",e}(ni||{}),ii=function(){function e(t){v(this,e),g(this,"messages",Qe([])),g(this,"materials",Qe([])),g(this,"input",Qe("")),g(this,"isLoading",Qe(!1)),g(this,"context",void 0),g(this,"params",void 0),g(this,"appDataEntityId",void 0),g(this,"topicId",void 0),g(this,"topic",void 0),this.opts=t,this.context=t.context,this.params=t.params,this.appDataEntityId=t.appDataEntityId,this.topicId=t.topicId,this.topic=t.topic,this.fecthHistory()}var t,n,i,r,a,c,s,l,h,f;return _(e,[{key:"fecthHistory",value:(f=p(d().mark((function e(){var t,n=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.topicId){e.next=7;break}return e.next=3,le.getData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,this.topicId);case 3:if(!((t=e.sent)&&t.data&&t.data.length>0)){e.next=7;break}return t.data.forEach((function(e){var t={messageid:e.messageid,state:e.state,type:e.type,role:e.role,content:e.content,suggestions:e.suggestions,completed:!0};n.addMessage(t)})),e.abrupt("return",!0);case 7:return e.next=9,this.opts.history(this.context,this.params,{appDataEntityId:this.appDataEntityId,appendCurData:this.opts.appendCurData});case 9:return e.sent&&this.opts.appendCurContent&&this.addMessage({state:30,messageid:oe(),role:"USER",type:"DEFAULT",content:this.opts.appendCurContent,completed:!0}),e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"asyncToIndexDB",value:(h=p(d().mark((function e(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.topicId){e.next=2;break}return e.abrupt("return");case 2:return t={id:this.topicId,data:this.messages.value.map((function(e){return e._origin})),timestamp:(new Date).getTime()},e.next=5,le.updateData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,t);case 5:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"setInput",value:function(e){this.input.value=e||""}},{key:"addMessage",value:function(e){var t=this.messages.value.find((function(t){return t.messageid===e.messageid}));t?(t.update(e),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new pn(e)]),this.asyncToIndexDB()}},{key:"completeMessage",value:(l=p(d().mark((function e(t,n){var i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=this.messages.value.find((function(e){return e.messageid===t})))){e.next=6;break}return i.updateCompleted(n),this.messages.value=o(this.messages.value),e.next=6,this.asyncToIndexDB();case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"replaceMessage",value:function(e){var t=this,n=this.messages.value.findIndex((function(t){return t.messageid===e.messageid}));-1!==n?(this.messages.value[n]=new pn(e),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new pn(e)]),this.asyncToIndexDB(),"DEFAULT"===e.type&&this.opts.recommendPrompt&&this.opts.recommendPrompt(this.context,this.params,{appDataEntityId:this.appDataEntityId,message:{messages:[e]}}).then((function(n){n&&n.content&&t.updateRecommendPrompt(e,n.content)}))}},{key:"stopMessage",value:(s=p(d().mark((function e(t){var n,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return-1!==(n=this.messages.value.findIndex((function(e){return e.messageid===t.messageid})))?(i=this.messages.value[n],t.content=i.content,this.messages.value[n]=new pn(t),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new pn(t)]),e.next=4,this.asyncToIndexDB();case 4:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"stringlyMaterialResource",value:function(){var e="",t=[];return this.materials.value&&this.materials.value.length>0&&(this.materials.value.forEach((function(e){if("ossfile"===e.type){var n=e.metadata;n.state&&"successed"===n.state&&t.push(e)}else t.push(e)})),this.materials.value=[]),t&&t.length>0&&(e=de.stringify(t)),e}},{key:"question",value:(c=p(d().mark((function e(t){var n,i=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.isLoading.value=!0,this.messages.value.forEach((function(e,t){var n=e._origin;n.suggestions&&(n.suggestions=void 0,i.messages.value[t]=new pn(n))})),this.messages.value=o(this.messages.value),this.asyncToIndexDB(),(n=this.stringlyMaterialResource())?n+="\n".concat(t):n=t,this.addMessage({state:30,messageid:oe(),role:"USER",type:"DEFAULT",content:n}),e.next=10,this.opts.question(this,this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(e){return"ERROR"!==e.type})).map((function(e){return e._origin})));case 10:this.opts.action&&this.opts.action("question",t),this.isLoading.value=!1;case 12:return e.prev=12,this.isLoading.value=!1,e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[0,,12,15]])}))),function(e){return c.apply(this,arguments)})},{key:"abortQuestion",value:(a=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.opts.abortQuestion(this);case 3:return e.prev=3,this.isLoading.value=!1,e.finish(3);case 6:case"end":return e.stop()}}),e,this,[[0,,3,6]])}))),function(){return a.apply(this,arguments)})},{key:"backfill",value:function(e){this.opts.action&&this.opts.action("backfill",e)}},{key:"deleteMessage",value:function(e){var t=this.messages.value.findIndex((function(t){return t.messageid===e.messageid}));-1!==t&&(this.messages.value.splice(t,1),this.messages.value=o(this.messages.value)),this.asyncToIndexDB(),this.opts.action&&this.opts.action("deletemsg",e)}},{key:"refreshMessage",value:(r=p(d().mark((function e(t){var n,i,r,a=arguments;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],this.isLoading.value=!0,e.prev=2,i=this.messages.value.findIndex((function(e){return e.messageid===t.messageid})),!n){e.next=11;break}return this.messages.value.splice(i+1,this.messages.value.length-i-1),this.messages.value=o(this.messages.value),e.next=9,this.opts.question(this,this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(e){return"ERROR"!==e.type})).map((function(e){return e._origin})));case 9:e.next=21;break;case 11:if(i!==this.messages.value.length-1){e.next=18;break}return this.messages.value.pop(),this.messages.value=o(this.messages.value),e.next=16,this.opts.question(this,this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(e){return"ERROR"!==e.type})).map((function(e){return e._origin})));case 16:e.next=21;break;case 18:r=this.messages.value[i-1].content,this.messages.value.splice(i-1,2),this.question(r);case 21:this.asyncToIndexDB(),this.opts.action&&this.opts.action("refreshmsg",t);case 23:return e.prev=23,this.isLoading.value=!1,e.finish(23);case 26:case"end":return e.stop()}}),e,this,[[2,,23,26]])}))),function(e){return r.apply(this,arguments)})},{key:"copyMessage",value:function(e){var t=e.realcontent;se.copy(t),this.opts.action&&this.opts.action("copymsg",e)}},{key:"resetTopic",value:(i=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.abortQuestion();case 2:if(!this.topicId){e.next=5;break}return e.next=5,le.deleteData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,this.topicId);case 5:this.messages.value=[],this.opts.history(this.context,this.params,{appDataEntityId:this.appDataEntityId});case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"clearTopic",value:(n=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.abortQuestion();case 2:if(!this.topicId){e.next=5;break}return e.next=5,le.deleteData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,this.topicId);case 5:this.messages.value=[];case 6:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"addMaterial",value:function(e){var t=this.materials.value.find((function(t){return t.id===e.id}));this.materials.value=t?o(this.materials.value):[].concat(o(this.materials.value),[new vn(e)])}},{key:"replaceMaterial",value:function(e,t){var n=this.materials.value.findIndex((function(t){return t.id===e}));-1!==n?(this.materials.value[n]=new vn(t),this.materials.value=o(this.materials.value)):this.materials.value=[].concat(o(this.materials.value),[new vn(t)])}},{key:"deleteMaterial",value:function(e){var t=this.materials.value.findIndex((function(t){return t.id===e.id}));-1!==t&&(this.materials.value.splice(t,1),this.materials.value=o(this.materials.value))}},{key:"updateRecommendPrompt",value:function(e,t){if(t){var n=this.messages.value.findIndex((function(t){return t.messageid===e.messageid})),i=he.parseMixedContent(t).suggestions;i&&i.length>0&&(e.suggestions=i,-1!==n?(this.messages.value[n]=new pn(e),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new pn(e)]),this.asyncToIndexDB())}}},{key:"handleSuggestionClick",value:(t=p(d().mark((function e(t,n,i){var r,a,c,s,l;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:-1!==(r=this.messages.value.findIndex((function(e){return e.messageid===t.messageid})))&&((a=this.messages.value[r]._origin).suggestions=void 0,this.messages.value[r]=new pn(a),this.messages.value=o(this.messages.value)),this.asyncToIndexDB(),c=n.type,e.t0=c,e.next="action"===e.t0?7:"raw"===e.t0?17:20;break;case 7:if(!this.opts.extendToolbarClick){e.next=16;break}if(s=n.data.actionid){e.next=11;break}throw new Error("actionid不能为空");case 11:return l=u({},t),Object.assign(l,{topic:this.topic}),l.msg.realcontent=t.realcontent,e.next=16,this.opts.extendToolbarClick(i,{id:s,appId:this.context.srfappid},this.context,this.params,l);case 16:case 19:return e.abrupt("break",21);case 17:return e.next=19,this.question(n.data.content);case 20:throw new Error("不支持".concat(c,"推荐类型"));case 21:case"end":return e.stop()}}),e,this)}))),function(e,n,i){return t.apply(this,arguments)})}]),e}(),ri=function(){function e(t){v(this,e),g(this,"topics",Qe([])),g(this,"activedTopic",Qe(void 0)),g(this,"currentTopicOptions",void 0),this.chat=t}var t,n,i,r,a,c,s;return _(e,[{key:"fetchHistory",value:(s=p(d().mark((function e(t){var n,i,r=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.configService(t.appid,"aitopics",t.type),e.next=3,n.load();case 3:(i=e.sent)&&i.length>0&&i.forEach((function(e){r.topics.value=[].concat(o(r.topics.value),[new fn(e)])}));case 5:case"end":return e.stop()}}),e)}))),function(e){return s.apply(this,arguments)})},{key:"updateCurrentTopic",value:(c=p(d().mark((function e(t){var n,i,r,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.currentTopicOptions=t,n=this.topics.value.findIndex((function(e){return e.id===t.id})),i=new fn(t),-1!==n?this.topics.value.splice(n,1,new fn(t)):this.topics.value=[].concat(o(this.topics.value),[new fn(t)]),r=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),a=t.configService(t.appid,"aitopics",t.type),e.next=8,null==a?void 0:a.save(r);case 8:this.activedTopic.value=i;case 9:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"removeTopic",value:(a=p(d().mark((function e(t,n,i,r,a){var c,s,l,u,h;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=!0,!t.beforeDelete){e.next=5;break}return e.next=4,t.beforeDelete(n,i,r,a);case 4:s=e.sent;case 5:if(s){e.next=7;break}return e.abrupt("return");case 7:return-1!==(l=this.topics.value.findIndex((function(e){return e.id===r.id})))&&(this.topics.value.splice(l,1),this.topics.value=o(this.topics.value)),u=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),h=t.configService(t.appid,"aitopics",t.type),e.next=13,null==h?void 0:h.save(u);case 13:return e.next=15,le.deleteData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,r.id);case 15:this.topics.value.length>0&&r.id===(null===(c=this.activedTopic.value)||void 0===c?void 0:c.id)&&this.handleTopicChange(this.topics.value[0]);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i,r){return a.apply(this,arguments)})},{key:"updateTopic",value:(r=p(d().mark((function e(t,n){var i,r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),r=t.configService(t.appid,"aitopics",t.type),e.next=4,null==r?void 0:r.save(i);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"handleTopicChange",value:function(e){var t;(null===(t=this.activedTopic.value)||void 0===t?void 0:t.id)!==e.id&&(this.activedTopic.value=e,this.chat.switchAiChatController(e))}},{key:"handleTopicAction",value:(i=p(d().mark((function e(t,n,i){var r,o,a,c,s,l;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.topics.value.find((function(e){return e.id===n.id})),!(this.currentTopicOptions&&r&&r.aiChat)){e.next=12;break}if(c=r.aiChat,s=c.context,l=c.params,"DELETE"!==t){e.next=8;break}return e.next=6,this.removeTopic(this.currentTopicOptions,s,l,r,i);case 6:e.next=11;break;case 8:if("RENAME"!==t){e.next=11;break}return e.next=11,this.updateTopic(this.currentTopicOptions,n);case 11:null===(o=(a=this.currentTopicOptions).action)||void 0===o||o.call(a,t,s,l,n,i);case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"newTopic",value:(n=p(d().mark((function e(){var t,n,i,r,a,c,s,l,u;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.activedTopic.value){e.next=3;break}return e.abrupt("return");case 3:return r=i.id.split("@")[0],a=this.topics.value.filter((function(e){return e.id.startsWith(r)})),c={appid:i.appid,id:"".concat(r,"@").concat(Date.now()),type:i.type,caption:"".concat(null===(t=i.sourceCaption)||void 0===t?void 0:t.split("_")[0],"_").concat(a.length),sourceCaption:i.sourceCaption,url:i.url,aiChat:i.aiChat},s=new fn(c),this.topics.value=[].concat(o(this.topics.value),[s]),l=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),u=null===(n=this.currentTopicOptions)||void 0===n?void 0:n.configService(c.appid,"aitopics",c.type),e.next=12,null==u?void 0:u.save(l);case 12:this.handleTopicChange(s);case 13:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"clearTopic",value:(t=p(d().mark((function e(){var t,n,i,r,o,a=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.topics.value.find((function(e){var t;return e.id===(null===(t=a.activedTopic.value)||void 0===t?void 0:t.id)})),this.currentTopicOptions&&n){e.next=3;break}return e.abrupt("return");case 3:if(i=!0,!this.currentTopicOptions.beforeDelete){e.next=8;break}return e.next=7,this.currentTopicOptions.beforeDelete(n.aiChat.context,n.aiChat.params,n,void 0,!0);case 7:i=e.sent;case 8:if(i){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,Promise.all(this.topics.value.map((function(e){if(e.id!==(null==n?void 0:n.id))return le.deleteData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,e.id)})));case 12:return this.topics.value=n?[n]:[],r=null===(t=this.currentTopicOptions)||void 0===t?void 0:t.configService(this.currentTopicOptions.appid,"aitopics",this.currentTopicOptions.type),o=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),e.next=17,null==r?void 0:r.save(o);case 17:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),oi=_((function e(t){v(this,e),this.aiChat=t})),ai=function(t){e(o,t);var i,r=n(o);function o(){return v(this,o),r.apply(this,arguments)}return _(o,[{key:"excuteAction",value:(i=p(d().mark((function e(t,n){var i,r,o,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.onClick||"function"!=typeof n.onClick){e.next=6;break}return e.next=3,n.onClick(t,n,this.aiChat.context,this.aiChat.params);case 3:i=e.sent,e.next=14;break;case 6:if(!(r=this.aiChat.opts.extendToolbarClick)){e.next=13;break}return e.next=10,r(t,n,this.aiChat.context,this.aiChat.params,{});case 10:i=e.sent,e.next=14;break;case 13:console.error("未找到扩展工具栏点击事件");case 14:i&&i.data&&i.data.length>0&&(o=i.data[0],a={id:o.id,type:o.type,data:o.data||{},metadata:o.metadata||{}},n.id&&Object.assign(a.metadata,{actionId:n.id}),this.aiChat.addMaterial(a));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})}]),o}(oi),ci=function(t){e(o,t);var i,r=n(o);function o(){return v(this,o),r.apply(this,arguments)}return _(o,[{key:"excuteAction",value:(i=p(d().mark((function e(t,n){var i,r,o,a,c,s,l,u,h,f,v=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this.aiChat.opts.uploader,r=i.multiple,o=i.accept,a=i.maxSize,c=i.onSelect,s=i.onUpload,l=i.onSuccess,u=i.onError,h=i.onProgress,f={multiple:r||!0,accept:o||"*/*",maxSize:a||5242880,onSelect:function(e){null==c||c(e),e.length>0&&e.forEach((function(e){var t=v.buildMaterialObject(e);Object.assign(t.metadata,{state:"uploading"}),v.aiChat.addMaterial(t)}))},onUpload:function(){var e=p(d().mark((function e(t,n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s(t,n,{context:v.aiChat.context,params:v.aiChat.params}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),onSuccess:function(e,t){var n={id:e.id,type:"ossfile",data:{id:e.id,name:e.name},metadata:{ext:e.ext,fileext:e.fileext,fileid:e.fileid,filename:e.filename,size:e.size,filesize:e.filesize,state:"successed"}};v.aiChat.replaceMaterial(t.name,n),null==l||l(e,t)},onError:function(e,t){var n=v.buildMaterialObject(t);Object.assign(n.metadata,{state:"failed"}),v.aiChat.replaceMaterial(t.name,n),null==u||u(e,t)},onProgress:function(e,t){null==h||h(e,t)}},new ue(f).openFilePicker();case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"buildMaterialObject",value:function(e){return{id:e.name,type:"ossfile",data:{name:e.name,id:e.name},metadata:{size:e.size,type:e.type,lastModified:e.lastModified}}}}]),o}(oi),si=function(){function e(){v(this,e)}return _(e,null,[{key:"getMaterialHelper",value:function(e,t){return"ossfile"===e?new ci(t):new ai(t)}}]),e}(),li=function(){function e(){v(this,e),g(this,"container",void 0),g(this,"mode","DEFAULT"),g(this,"isMountedAiTopic",!1),g(this,"backupChatOptions",void 0),g(this,"aiTopic",void 0),g(this,"aiTopicMap",new Map),this.aiTopic=new ri(this)}var t,n;return _(e,[{key:"aiChat",get:function(){var e;return this.aiTopicMap.get("".concat(null===(e=this.aiTopic.activedTopic.value)||void 0===e?void 0:e.id))}},{key:"initIndexDB",value:(n=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,le.checkTableExists(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME);case 2:if(e.sent){e.next=6;break}return e.next=6,le.createTable(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,ni.DATA_TABLE_KEY_NAME,!1);case 6:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"create",value:(t=p(d().mark((function e(t){var n,i,r,o,a,c,s=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initIndexDB();case 2:if(this.backupChatOptions=t,this.close(),this.container=document.createElement("div"),this.container.classList.add("ibiz-ai-chat"),document.body.appendChild(this.container),o=t.chatOptions,!t.mode||"TOPIC"!==t.mode){e.next=19;break}if(this.isMountedAiTopic){e.next=13;break}return e.next=12,this.aiTopic.fetchHistory(t.topicOptions);case 12:this.isMountedAiTopic=!0;case 13:return a=t.topicOptions,Object.assign(a,{aiChat:{caption:o.caption,context:o.context,params:o.params,appDataEntityId:o.appDataEntityId,contentToolbarItems:o.contentToolbarItems,footerToolbarItems:o.footerToolbarItems,questionToolbarItems:o.questionToolbarItems,otherToolbarItems:o.otherToolbarItems,appendCurData:o.appendCurData,appendCurContent:o.appendCurContent}}),e.next=17,this.aiTopic.updateCurrentTopic(a);case 17:e.next=20;break;case 19:this.aiTopic.activedTopic.value=void 0;case 20:return Object.assign(o,{topicId:null===(n=a)||void 0===n?void 0:n.id,topic:a}),c=new ii(o),this.aiTopicMap.set("".concat(null===(i=a)||void 0===i?void 0:i.id),c),K(M(Ti,{aiChat:c,aiTopic:this.aiTopic,mode:t.mode?t.mode:"DEFAULT",containerOptions:t.containerOptions,caption:t.mode&&"TOPIC"===t.mode?"AI助手":o.caption,enableBackFill:null===(r=t.containerOptions)||void 0===r?void 0:r.enableBackFill,contentToolbarItems:o.contentToolbarItems,footerToolbarItems:o.footerToolbarItems,questionToolbarItems:o.questionToolbarItems,close:function(){s.close(),o.closed&&o.closed(o.context,o.params)},fullscreen:function(e){o.fullscreen&&o.fullscreen(e,o.context,o.params)},minimize:function(e){o.minimize&&o.minimize(e,o.context,o.params)}}),this.container),e.abrupt("return",c);case 25:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"switchAiChatController",value:function(e){var t,n,i,r,o,a=this,c=u({},this.backupChatOptions.chatOptions);(e.aiChat&&Object.assign(c,{caption:e.aiChat.caption,context:e.aiChat.context,params:e.aiChat.params,contentToolbarItems:e.aiChat.contentToolbarItems,footerToolbarItems:e.aiChat.footerToolbarItems,questionToolbarItems:e.aiChat.questionToolbarItems,otherToolbarItems:e.aiChat.otherToolbarItems,appendCurData:e.aiChat.appendCurData,appendCurContent:e.aiChat.appendCurContent,appDataEntityId:e.aiChat.appDataEntityId,topicId:e.id,topic:e,extendToolbarClick:this.backupChatOptions.chatOptions.extendToolbarClick,recommendPrompt:this.backupChatOptions.chatOptions.recommendPrompt}),this.aiTopicMap.has("".concat(e.id))?t=this.aiTopicMap.get("".concat(e.id)):(t=new ii(c),this.aiTopicMap.set("".concat(e.id),t)),this.container)&&(K(null,this.container),K(M(Ti,{aiChat:t,aiTopic:this.aiTopic,mode:null!==(n=this.backupChatOptions)&&void 0!==n&&n.mode?this.backupChatOptions.mode:"DEFAULT",containerOptions:null===(i=this.backupChatOptions)||void 0===i?void 0:i.containerOptions,caption:null!==(r=this.backupChatOptions)&&void 0!==r&&r.mode&&"TOPIC"===this.backupChatOptions.mode?"AI助手":c.caption,enableBackFill:null===(o=this.backupChatOptions)||void 0===o||null===(o=o.containerOptions)||void 0===o?void 0:o.enableBackFill,contentToolbarItems:c.contentToolbarItems,footerToolbarItems:c.footerToolbarItems,questionToolbarItems:c.questionToolbarItems,close:function(){a.close(),c.closed&&c.closed(c.context,c.params)},fullscreen:function(e){c.fullscreen&&c.fullscreen(e,c.context,c.params)},minimize:function(e){c.minimize&&c.minimize(e,c.context,c.params)}}),this.container))}},{key:"hidden",value:function(){this.container&&(this.container.style.display="none")}},{key:"show",value:function(){this.container&&(this.container.style.display="flex")}},{key:"close",value:function(){this.container&&(K(null,this.container),this.container.remove(),this.container=void 0)}}]),e}(),ui=(t("chat",new li),new ee("chat-input-material")),di=function(e){var t=e.controller.materials;return _t("div",{className:ui.b(),children:t.value.map((function(t){return _t(rn,{material:t,disabled:!1,controller:e.controller},t.id)}))})},hi=function(e){var t=e.children,n=e.actions,i=e.content,r=e.position,o=void 0===r?"bottom":r,c=e.isOpen,s=e.onToggleOpen,l=e.onAction,d=new ee("pop"),h=Ie(Ci),p=a(Se(c||!1),2),f=p[0],v=p[1],m=Me(null),_=Me(null);Ae((function(){void 0!==c&&v(c)}),[c]),Ae((function(){return _.current||(_.current=document.createElement("div"),_.current.className=d.b("content-container"),document.body.appendChild(_.current)),function(){_.current&&document.body.removeChild(_.current)}}),[]),Ae((function(){var e=function(e){!m.current||m.current.contains(e.target)||e.target.closest(".".concat(d.b()))||e.target.closest(".ibiz-quick-edit")||e.target.closest(".ibiz-picker__transfer")||(v(!1),null==s||s(!1))};return f&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[f,s]);return _t("span",{className:"".concat(d.b("trigger-container")),children:[_t("span",{className:"".concat(d.b("trigger-element")),ref:m,onClick:function(e){e.stopPropagation();var t=!f;v(t),null==s||s(t)},children:t}),f&&_.current&&Pn(_t("div",{className:"".concat(d.b()," pop-").concat(o),style:function(){if(!m.current)return{};var e=m.current.getBoundingClientRect(),t={position:"absolute",zIndex:h.zIndex+1},n={bottom:{top:e.bottom+window.scrollY,left:e.left+window.scrollX},top:{bottom:window.innerHeight-e.top+window.scrollY,left:e.left+window.scrollX},left:{top:e.top+window.scrollY,right:window.innerWidth-e.left+window.scrollX},right:{top:e.top+window.scrollY,left:e.right+window.scrollX},"top-left":{bottom:window.innerHeight-e.top+window.scrollY,right:window.innerWidth-e.left+window.scrollX}};return u(u({},t),n[o])}(),children:i||(null==n?void 0:n.map((function(e){return _t("div",{title:e.caption,className:d.e("item"),onMouseDown:function(t){t.stopPropagation(),null==l||l(e.id,t)},children:[e.icon,_t("div",{className:d.em("item","caption"),children:e.caption})]},e.id)})))}),_.current)]})},pi=new ee("chat-input"),fi=window.SpeechRecognition||window.webkitSpeechRecognition,vi=function(e){var t,n=a(Se(!1),2),i=n[0],r=n[1],o=Me(null),c=e.controller.input,s=ft(!1),l=Me();fi&&!l.current&&(l.current=new fi,l.current.onstart=function(){s.value=!0},l.current.onend=function(){s.value=!1},l.current.onresult=function(e){var t,n=null===(t=e.results)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t[0])||void 0===t?void 0:t.transcript;n&&(c.value="".concat(c.value).concat(n))});var u=Le((function(e){c.value=e.target.value}),[c]),h=vt((function(){return c.value.length<=0}));Ae((function(){return o.current&&ti(o.current),function(){o.current&&ti.destroy(o.current)}}),[o]);var f=Le(p(d().mark((function t(){var n;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=c.value,c.value="",t.next=5,e.controller.question(n);case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.error(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])}))),[c]),v=Le(p(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{e.controller.abortQuestion()}catch(n){console.error(n)}case 1:case"end":return t.stop()}}),t)}))),[c]),m=function(){var t=p(d().mark((function t(n){var i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=si.getMaterialHelper("ossfile",e.controller),t.next=3,i.excuteAction(n);case 3:r(!1);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),_=function(){var t=p(d().mark((function t(n,i){var o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=si.getMaterialHelper("common",e.controller),t.next=3,o.excuteAction(n,i);case 3:r(!1);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();return _t("div",{className:pi.b("wrapper"),children:[_t("div",{className:pi.b("material-wrapper"),children:_t(di,{controller:e.controller})}),_t("div",{className:pi.b("main-wrapper"),children:[_t("textarea",{className:pi.e("textarea"),type:"text",rows:6,autoCorrect:"off",autoCapitalize:"off",autoComplete:"off",value:c,onInput:u,onKeyDown:function(e){"Enter"!==e.code||e.isComposing||(e.stopPropagation(),!1===e.shiftKey&&f())},ref:o,disabled:e.controller.isLoading.value}),_t("div",{className:pi.b("action-wrapper"),children:[_t("div",{className:"".concat(pi.be("action-wrapper","action-item")," ").concat(pi.is("disabled",e.controller.isLoading.value)),title:"上传资料",children:_t(hi,{content:_t("div",{className:pi.b("pop-actions"),children:[_t("div",{className:pi.b("pop-action-item"),onClick:function(e){m(e)},children:[_t("span",{className:pi.b("pop-action-item-icon"),children:_t(Ht,{})}),_t("span",{className:pi.b("pop-action-item-title"),children:"文件资料"})]}),null===(t=e.questionToolbarItems)||void 0===t?void 0:t.map((function(e){var t,n,i;return _t("div",{className:pi.b("pop-action-item"),onClick:function(t){_(t,e)},children:[_t("span",{className:pi.b("pop-action-item-icon"),children:"function"==typeof e.icon?e.icon():(null===(t=e.icon)||void 0===t?void 0:t.showIcon)&&_t(L,{children:null!==(n=e.icon)&&void 0!==n&&n.cssClass?_t("i",{className:e.icon.cssClass}):null!==(i=e.icon)&&void 0!==i&&i.imagePath?ce(e.icon.imagePath)?_t("div",{dangerouslySetInnerHTML:{__html:e.icon.imagePath}}):_t("img",{src:e.icon.imagePath}):null})}),_t("span",{className:pi.b("pop-action-item-title"),children:e.label})]},e.id)}))]}),position:"top-left",isOpen:i,onToggleOpen:r,children:_t(Bt,{})})}),_t("div",{title:s.value?"语音输入中...":"语音输入",className:"".concat(pi.be("action-wrapper","action-item")," ").concat(pi.is("disabled",e.controller.isLoading.value)),onClick:function(){l.current&&!s.value&&l.current.start()},children:s.value?_t(Mt,{}):_t(At,{})}),e.controller.isLoading.value?_t("div",{title:"停止生成",className:"".concat(pi.be("action-wrapper","action-item")),onClick:v,children:_t(Rt,{})}):_t("div",{title:"发送消息",className:"".concat(pi.be("action-wrapper","action-item")," ").concat(pi.is("disabled",h.value)),onClick:f,children:_t(wt,{})})]})]})]})},mi=new ee("chat-topic-item"),_i=function(e){var t=e.controller,n=e.topic,i=e.onClick,r=e.onAction,o=Me(null),c=vt((function(){var e;return(null===(e=t.activedTopic.value)||void 0===e?void 0:e.id)===n.id})),s=a(Se(!1),2),l=s[0],u=s[1],d=ft(!1);return _t("div",{className:"".concat(mi.b()," ").concat(mi.is("active",c.value)," ").concat(mi.is("edit",d.value)),onClick:i.bind(void 0),children:[_t("div",{className:mi.e("caption"),title:n.caption,children:d.value?_t("input",{ref:o,value:n.caption,onBlur:function(e){e.stopPropagation(),d.value=!1,r("RENAME",e)},onKeyDown:function(e){e.stopPropagation(),"Enter"===e.key&&(d.value=!1)},onClick:function(e){return e.stopPropagation()},onChange:function(e){return(t=e).stopPropagation(),void(n.data.caption=null===(i=t.target)||void 0===i?void 0:i.value);var t,i},className:mi.em("caption","editor")}):_t("span",{className:mi.em("caption","text"),children:n.caption})}),!d.value&&_t("div",{className:mi.e("icon"),children:[_t("span",{title:"跳转主视图",className:mi.em("icon","item"),onClick:function(e){e.stopPropagation(),r("LINK",e)}.bind(void 0),children:_t(Lt,{className:mi.b("link-icon")})}),c.value?null:_t(hi,{actions:[{id:"RENAME",caption:"重命名",icon:_t(qt,{})},{id:"DELETE",caption:"删除话题",icon:_t(It,{})}],position:"bottom",isOpen:l,onToggleOpen:u,onAction:function(e,t){"DELETE"===e?r("DELETE",t):"RENAME"===e&&(d.value=!0,setTimeout((function(){var e;null===(e=o.current)||void 0===e||e.focus()}),100)),u(!1)}.bind(void 0),children:_t("span",{className:mi.em("icon","item"),title:"更多",children:_t(Ot,{className:mi.e("more-icon")})})})]})]})},gi=new ee("chat-search"),yi=function(e){var t=e.className,n=e.value,i=e.placeholder,r=e.onChange,o=a(Se(!1),2),c=o[0],s=o[1],l=function(e){var t;e.stopPropagation(),null==r||r(null===(t=e.target)||void 0===t?void 0:t.value)};return _t("div",{className:"".concat(gi.b()," ").concat(gi.is("focus",c)," ").concat(t||""),children:[_t("div",{className:gi.e("prefix"),children:_t($t,{})}),_t("input",{value:n,className:gi.e("inner"),placeholder:i,onFocus:function(){return s(!0)},onBlur:function(){return s(!1)},onChange:function(e){return l(e)}})]})},wi=new ee("chat-topics"),bi=function(e){var t=Me(null),n=ft(void 0),i=ft([]);Ae((function(){i.value=e.controller.topics.value.filter((function(e){var t,i;return null===(t=e.caption)||void 0===t?void 0:t.toLowerCase().includes((null===(i=n.value)||void 0===i?void 0:i.trim().toLowerCase())||"")}))}),[e.controller.topics.value]);return Ae((function(){var e=t.current;if(e){var n=e.querySelector(".ibiz-chat-topic-item.is-active");null==n||n.scrollIntoView({behavior:"smooth",block:"nearest"})}}),[e.controller.activedTopic.value]),_t("div",{className:wi.b(),children:[_t("div",{className:wi.e("header"),children:_t(yi,{value:n.value,placeholder:"搜索话题",onChange:function(t){n.value=t,i.value=e.controller.topics.value.filter((function(e){var t,i;return null===(t=e.caption)||void 0===t?void 0:t.toLowerCase().includes((null===(i=n.value)||void 0===i?void 0:i.trim().toLowerCase())||"")}))}.bind(void 0)})}),_t("div",{ref:t,className:wi.e("main"),children:i.value&&i.value.length>0?i.value.map((function(t){return _t(_i,{topic:t,controller:e.controller,onClick:function(){return function(t){e.controller.handleTopicChange(t)}(t)},onAction:function(n,i){return function(t,n,i){e.controller.handleTopicAction(t,n,i)}(n,t,i)}},t.id)})):_t("div",{className:wi.e("empty"),children:"暂无话题"})}),_t("div",{className:wi.e("footer"),children:_t("div",{title:"清空会话",className:wi.e("action"),onClick:function(){return e.controller.clearTopic()},children:[_t(It,{}),_t("span",{children:"清空会话"})]})})]})},xi=new ee("chat-minimize"),ki=function(e){var t=Me(null),n=a(Se(""),2),i=n[0],r=n[1],o=a(Se(0),2),c=o[0],s=o[1],l=Me(!1),u={x:(window.innerWidth-86)/window.innerWidth,y:(window.innerHeight-86)/window.innerHeight},d=vt((function(){var t=e.controller.messages.value[e.controller.messages.value.length-1];return!!t&&("ASSISTANT"===t.role&&20===t.state&&!0!==t.completed)})),h=vt((function(){var t="";if(!d.value)return r(""),s(0),t;var n=e.controller.messages.value[e.controller.messages.value.length-1];if(t=n.content,-1!==n.content.indexOf("<think>")){var i=function(e){var t=e.indexOf("<think>"),n=e.indexOf("</think>"),i="",r="";return-1===n?(i=e.slice(t+7),r=""):(i=e.slice(t+7,n),r=e.slice(n+8)),{thoughtContent:i,answerContent:r}}(n.content);t=i.thoughtContent+i.answerContent}return t})),p=function(){Object.assign(t.current.style,{left:"".concat(100*u.x,"%"),top:"".concat(100*u.y,"%")}),localStorage.setItem(ni.MINIMIZE_STYLY_CHCHE,JSON.stringify(u))};return Ae((function(){var e,n=localStorage.getItem(ni.MINIMIZE_STYLY_CHCHE);if(n){var i=JSON.parse(n);pe(i)&&Object.assign(u,i)}p(),(e=t.current)&&(e.onmousedown=function(t){document.body.style.userSelect="none";var n=t.clientX-e.offsetLeft,i=t.clientY-e.offsetTop,r=Date.now(),o=function(e){var t=56/window.innerWidth,r=56/window.innerHeight,o=fe(e.clientX-n,e.clientY-i,t,r),a=o.x,c=o.y;Object.assign(u,{x:a,y:c}),requestAnimationFrame((function(){p()}))};document.addEventListener("mousemove",o),document.addEventListener("mouseup",(function e(){var t=Date.now();l.current=t-r>300,document.body.style.userSelect="",document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",e)}))})}),[]),Ae((function(){if(c<h.value.length){var e=setTimeout((function(){r((function(e){return e+h.value[c]})),s((function(e){return e+1}))}),100);return function(){return clearTimeout(e)}}}),[c,h.value]),_t("div",{ref:t,title:e.title,className:"".concat(xi.b()," ").concat(xi.is("hidden",!e.isMinimize)," ").concat(xi.is("show-halo",d.value)),onClick:function(){l.current||e.onClick()},children:_t("div",{className:"".concat(xi.e("content")," ").concat(xi.is("show-border",!d.value)),children:[i&&_t("div",{className:"".concat(xi.em("content","popover")),children:_t("div",{className:"typewriter",children:i})}),_t(Et,{})]})})},Ci=function(e,t){var n={__c:t="__cC"+k++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,P(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({zIndex:10,enableBackFill:!0,newTopic:function(){}}),Ti=function(t){e(o,t);var r=n(o);function o(e){var t,n,a,c,s;return v(this,o),g(i(s=r.call(this,e)),"ns",new ee("chat-container")),g(i(s),"containerRef",{current:null}),g(i(s),"dragHandle",{current:null}),g(i(s),"data",{side:{y:0,height:1,width:750/window.innerWidth,x:(window.innerWidth-750)/window.innerWidth},window:{y:0,width:750/window.innerWidth,height:750/window.innerHeight,x:(window.innerWidth-750)/window.innerWidth},minWidth:500,minHeight:300,showMode:"side"}),g(i(s),"disabled",!1),g(i(s),"isDragging",!1),g(i(s),"containerContext",{zIndex:(null===(t=s.props.containerOptions)||void 0===t?void 0:t.zIndex)||10,enableBackFill:void 0===(null===(n=s.props)||void 0===n?void 0:n.enableBackFill)||null===(null===(a=s.props)||void 0===a?void 0:a.enableBackFill)||(null===(c=s.props)||void 0===c?void 0:c.enableBackFill),newTopic:function(){s.props.aiTopic.newTopic()}}),s.state={isFullScreen:!1,isMinimize:!1},s}return _(o,[{key:"calcWindowStyle",value:function(){var e,t="window"===this.data.showMode?this.data.window:this.data.side;return{left:"".concat(100*t.x,"%"),top:"".concat(100*t.y,"%"),width:"".concat(100*t.width,"%"),height:"".concat(100*t.height,"%"),minWidth:"".concat(this.data.minWidth,"px"),minHeight:"".concat(this.data.minHeight,"px"),"z-index":(null===(e=this.props.containerOptions)||void 0===e||null===(e=e.zIndex)||void 0===e?void 0:e.toString())||"10"}}},{key:"calcSideModeStyle",value:function(e){Object.assign(this.data,{side:{y:0,x:"left"===e?0:(window.innerWidth-750)/window.innerWidth,height:1,width:750/window.innerWidth},showMode:"side"})}},{key:"setStyle",value:function(){Object.assign(this.containerRef.current.style,this.calcWindowStyle()),localStorage.setItem(ni.STYLE_CACHE,JSON.stringify(this.data))}},{key:"snapToEdge",value:function(){var e=20/window.innerWidth,t=20/window.innerHeight,n=this.data.window,i=n.x,r=n.y,o=n.width,a=n.height;i<e||i+o>1-e?this.calcSideModeStyle(i<e?"left":"right"):(r<t&&(this.data.window.y=0),r+a>1-t&&(this.data.window.y=1-a)),this.setStyle()}},{key:"registerDragDialog",value:function(){var e=this;this.dragHandle.current.onmousedown=function(t){if(!e.state.isFullScreen){document.body.style.userSelect="none";var n=t.clientX-e.containerRef.current.offsetLeft,i=t.clientY-e.containerRef.current.offsetTop,r=function(t){if(!e.disabled){e.data.showMode="window";var r=fe(t.clientX-n,t.clientY-i,e.data.window.width,e.data.window.height),o=r.x,a=r.y;Object.assign(e.data.window,{x:o,y:a}),e.setStyle()}};document.addEventListener("mousemove",r),document.addEventListener("mouseup",(function t(){document.body.style.userSelect="",document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",t),e.disabled||e.snapToEdge()}))}}}},{key:"registerDragDialogBorder",value:function(){var e=this;c(this.containerRef.current).resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},margin:6,modifiers:[c.modifiers.restrictEdges({outer:document.body}),c.modifiers.restrictSize({min:{width:this.data.minWidth,height:this.data.minHeight}})],inertia:!0,listeners:{move:function(t){if(!e.state.isFullScreen){var n="side"===e.data.showMode?e.data.side:e.data.window;n.x=t.rect.left/window.innerWidth,n.y=t.rect.top/window.innerHeight,n.width=t.rect.width/window.innerWidth,n.height=t.rect.height/window.innerHeight,e.setStyle()}},start:function(){e.disabled=!0,document.body.style.userSelect="none"},end:function(){e.disabled=!1,document.body.style.userSelect=""}}})}},{key:"handleFullScreenChange",value:function(){this.setState({isFullScreen:null!==document.fullscreenElement})}},{key:"componentDidMount",value:function(){this.handleFullScreenChange=this.handleFullScreenChange.bind(this);var e=localStorage.getItem(ni.STYLE_CACHE);if(e){var t=JSON.parse(e);t.side&&pe(t.side)&&t.window&&pe(t.window)&&Object.assign(this.data,t)}this.setStyle(),this.registerDragDialog(),this.registerDragDialogBorder(),document.addEventListener("fullscreenchange",this.handleFullScreenChange)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("fullscreenchange",this.handleFullScreenChange)}},{key:"close",value:function(){this.props.close()}},{key:"fullScreen",value:function(){var e=this.containerRef.current;e&&(e.requestFullscreen(),this.props.fullscreen(!0))}},{key:"closeFullScreen",value:function(){var e;this.state.isFullScreen&&(null===(e=document)||void 0===e||e.exitFullscreen(),this.props.fullscreen(!1),this.setStyle())}},{key:"minimize",value:function(){this.closeFullScreen(),this.setState({isMinimize:!0}),this.props.minimize(!0)}},{key:"exitMinimize",value:function(){this.setState({isMinimize:!1}),this.props.minimize(!1)}},{key:"stopPropagation",value:function(e){e.stopPropagation()}},{key:"render",value:function(){return _t(Ci.Provider,{value:this.containerContext,children:_t("div",{className:"".concat(this.ns.b()),children:[_t("div",{className:"".concat(this.ns.e("dialog")," ").concat(this.ns.is("full-screen",this.state.isFullScreen)," ").concat(this.ns.is("hidden",this.state.isMinimize)),ref:this.containerRef,children:[_t("div",{ref:this.dragHandle,className:this.ns.b("header"),children:[_t("div",{className:this.ns.b("header-caption"),children:this.props.caption||"AI助手"}),_t("div",{className:this.ns.b("header-action-wrapper"),children:[_t("div",{title:"最小化",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","minimize")),onMouseDown:this.stopPropagation.bind(this),onClick:this.minimize.bind(this),children:_t(Nt,{})}),this.state.isFullScreen?_t("div",{title:"退出全屏",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","close-full-screen")),onMouseDown:this.stopPropagation.bind(this),onClick:this.closeFullScreen.bind(this),children:_t(Tt,{})}):_t("div",{title:"全屏",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","full-screen")),onMouseDown:this.stopPropagation.bind(this),onClick:this.fullScreen.bind(this),children:_t(Ct,{})}),_t("div",{title:"关闭",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","action-close")),onMouseDown:this.stopPropagation.bind(this),onClick:this.close.bind(this),children:_t(gt,{})})]})]}),"TOPIC"===this.props.mode?_t("div",{className:"".concat(this.ns.b("main")),children:[_t("div",{className:"".concat(this.ns.be("main","left")),children:_t(bi,{controller:this.props.aiTopic})}),_t("div",{className:"".concat(this.ns.be("main","right")),children:[_t("div",{className:this.ns.b("content"),children:_t(xn,{controller:this.props.aiChat,toolbarItems:this.props.contentToolbarItems})}),_t(yn,{type:"footer",mode:this.props.mode,data:this.props.aiTopic.activedTopic.value,className:"".concat(this.ns.e("toolbar")," ").concat(this.ns.is("has-materials",this.props.aiChat.materials.value.length>0)),controller:this.props.aiChat,items:this.props.footerToolbarItems}),_t("div",{className:this.ns.b("footer"),children:_t(vi,{controller:this.props.aiChat,questionToolbarItems:this.props.questionToolbarItems})})]})]}):_t("div",{className:"".concat(this.ns.be("main","default")),children:[_t("div",{className:this.ns.b("content"),children:_t(xn,{controller:this.props.aiChat,toolbarItems:this.props.contentToolbarItems})}),_t(yn,{type:"footer",mode:this.props.mode,data:this.props.aiTopic.activedTopic.value,className:"".concat(this.ns.e("toolbar")," ").concat(this.ns.is("has-materials",this.props.aiChat.materials.value.length>0)),controller:this.props.aiChat,items:this.props.footerToolbarItems}),_t("div",{className:this.ns.b("footer"),children:_t(vi,{controller:this.props.aiChat,questionToolbarItems:this.props.questionToolbarItems})})]})]}),_t(ki,{title:this.props.caption||"AI助手",controller:this.props.aiChat,isMinimize:this.state.isMinimize,onClick:this.exitMinimize.bind(this)})]})})}}]),o}(I);t("ChatContainer",Ti)}}}))}();
1
+ !function(){function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)}function t(e,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t(e,n)}function n(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return function(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)}(this,n)}}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function o(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,c=[],s=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=o.call(n)).done)&&(c.push(i.value),c.length!==t);s=!0);}catch(e){l=!0,r=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return c}}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),c=new L(i||[]);return r(a,"_invoke",{value:S(e,n,c)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",v="suspendedYield",m="executing",_="completed",g={};function y(){}function w(){}function b(){}var x={};l(x,a,(function(){return this}));var k=Object.getPrototypeOf,C=k&&k(k(I([])));C&&C!==n&&i.call(C,a)&&(x=C);var T=b.prototype=y.prototype=Object.create(x);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(r,o,a,c){var s=h(e[r],e,o);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"==f(u)&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,c)}))}c(s.arg)}var o;r(this,"_invoke",{value:function(e,i){function r(){return new t((function(t,r){n(e,i,t,r)}))}return o=o?o.then(r,r):r()}})}function S(t,n,i){var r=p;return function(o,a){if(r===m)throw new Error("Generator is already running");if(r===_){if("throw"===o)throw a;return{value:e,done:!0}}for(i.method=o,i.arg=a;;){var c=i.delegate;if(c){var s=A(c,i);if(s){if(s===g)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=m;var l=h(t,n,i);if("normal"===l.type){if(r=i.done?_:v,l.arg===g)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r=_,i.method="throw",i.arg=l.arg)}}}function A(t,n){var i=n.method,r=t.iterator[i];if(r===e)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),g;var o=h(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(f(t)+" is not iterable")}return w.prototype=b,r(T,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,s,"GeneratorFunction")),e.prototype=Object.create(T),e},t.awrap=function(e){return{__await:e}},N(E.prototype),l(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new E(u(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(T),l(T,s,"Generator"),l(T,a,(function(){return this})),l(T,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=I,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(i,r){return c.type="throw",c.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:I(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),g}},t}function h(e,t,n,i,r,o,a){try{var c=e[o](a),s=c.value}catch(l){return void n(l)}c.done?t(s):Promise.resolve(s).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){h(o,i,r,a,c,"next",e)}function c(e){h(o,i,r,a,c,"throw",e)}a(void 0)}))}}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function _(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==f(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===f(t)?t:String(t)}System.register(["interactjs","cherry-markdown"],(function(t,r){"use strict";var c,s;return{setters:[function(e){c=e.default},function(e){s=e.default}],execute:function(){var r,l,h,m,y,w,b,x,k,C={},T=[],N=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,E=Array.isArray;function S(e,t){for(var n in t)e[n]=t[n];return e}function A(e){var t=e.parentNode;t&&t.removeChild(e)}function M(e,t,n){var i,o,a,c={};for(a in t)"key"==a?i=t[a]:"ref"==a?o=t[a]:c[a]=t[a];if(arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===c[a]&&(c[a]=e.defaultProps[a]);return O(e,c,i,o,null)}function O(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++h:r};return null==r&&null!=l.vnode&&l.vnode(o),o}function L(e){return e.children}function I(e,t){this.props=e,this.context=t}function D(e,t){if(null==t)return e.__?D(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__d||n.__e;return"function"==typeof e.type?D(e):null}function z(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return z(e)}}function P(e){(!e.__d&&(e.__d=!0)&&y.push(e)&&!B.__r++||w!==l.debounceRendering)&&((w=l.debounceRendering)||b)(B)}function B(){var e,t,n,i,r,o,a,c,s;for(y.sort(x);e=y.shift();)e.__d&&(t=y.length,i=void 0,r=void 0,o=void 0,c=(a=(n=e).__v).__e,(s=n.__P)&&(i=[],r=[],(o=S({},a)).__v=a.__v+1,$(s,a,o,n.__n,void 0!==s.ownerSVGElement,null!=a.__h?[c]:null,i,null==c?D(a):c,a.__h,r),X(i,a,r),a.__e!=c&&z(a)),y.length>t&&y.sort(x));B.__r=0}function H(e,t,n,i,r,o,a,c,s,l,u){var d,h,p,f,v,m,_,g,y,w=0,b=i&&i.__k||T,x=b.length,k=x,N=t.length;for(n.__k=[],d=0;d<N;d++)null!=(f=n.__k[d]=null==(f=t[d])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?O(null,f,null,null,f):E(f)?O(L,{children:f},null,null,null):f.__b>0?O(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)?(f.__=n,f.__b=n.__b+1,-1===(g=V(f,b,_=d+w,k))?p=C:(p=b[g]||C,b[g]=void 0,k--),$(e,f,p,r,o,a,c,s,l,u),v=f.__e,(h=f.ref)&&p.ref!=h&&(p.ref&&Z(p.ref,null,f),u.push(h,f.__c||v,f)),null!=v&&(null==m&&(m=v),(y=p===C||null===p.__v)?-1==g&&w--:g!==_&&(g===_+1?w++:g>_?k>N-_?w+=g-_:w--:w=g<_&&g==_-1?g-_:0),_=d+w,"function"!=typeof f.type||g===_&&p.__k!==f.__k?"function"==typeof f.type||g===_&&!y?void 0!==f.__d?(s=f.__d,f.__d=void 0):s=v.nextSibling:s=R(e,v,s):s=j(f,s,e),"function"==typeof n.type&&(n.__d=s))):(p=b[d])&&null==p.key&&p.__e&&(p.__e==s&&(p.__=i,s=D(p)),G(p,p,!1),b[d]=null);for(n.__e=m,d=x;d--;)null!=b[d]&&("function"==typeof n.type&&null!=b[d].__e&&b[d].__e==n.__d&&(n.__d=b[d].__e.nextSibling),G(b[d],b[d]))}function j(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?j(i,t,n):R(n,i.__e,t));return t}function F(e,t){return t=t||[],null==e||"boolean"==typeof e||(E(e)?e.some((function(e){F(e,t)})):t.push(e)),t}function R(e,t,n){return null==n||n.parentNode!==e?e.insertBefore(t,null):t==n&&null!=t.parentNode||e.insertBefore(t,n),t.nextSibling}function V(e,t,n,i){var r=e.key,o=e.type,a=n-1,c=n+1,s=t[n];if(null===s||s&&r==s.key&&o===s.type)return n;if(i>(null!=s?1:0))for(;a>=0||c<t.length;){if(a>=0){if((s=t[a])&&r==s.key&&o===s.type)return a;a--}if(c<t.length){if((s=t[c])&&r==s.key&&o===s.type)return c;c++}}return-1}function W(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||N.test(t)?n:n+"px"}function U(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||W(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||W(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,o?Y:q,o)):e.removeEventListener(t,o?Y:q,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function q(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(l.event?l.event(e):e)}function Y(e){return this.l[e.type+!0](l.event?l.event(e):e)}function $(e,t,n,i,o,a,c,s,u,d){var h,p,f,v,m,_,g,y,w,b,x,k,T,N,M,O=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(u=n.__h,s=t.__e=n.__e,t.__h=null,a=[s]),(h=l.__b)&&h(t);e:if("function"==typeof O)try{if(y=t.props,w=(h=O.contextType)&&i[h.__c],b=h?w?w.props.value:h.__:i,n.__c?g=(p=t.__c=n.__c).__=p.__E:("prototype"in O&&O.prototype.render?t.__c=p=new O(y,b):(t.__c=p=new I(y,b),p.constructor=O,p.render=J),w&&w.sub(p),p.props=y,p.state||(p.state={}),p.context=b,p.__n=i,f=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=S({},p.__s)),S(p.__s,O.getDerivedStateFromProps(y,p.__s))),v=p.props,m=p.state,p.__v=t,f)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&y!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(y,b),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(y,p.__s,b)||t.__v===n.__v)){for(t.__v!==n.__v&&(p.props=y,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),x=0;x<p._sb.length;x++)p.__h.push(p._sb[x]);p._sb=[],p.__h.length&&c.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(y,p.__s,b),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(v,m,_)}))}if(p.context=b,p.props=y,p.__P=e,p.__e=!1,k=l.__r,T=0,"prototype"in O&&O.prototype.render){for(p.state=p.__s,p.__d=!1,k&&k(t),h=p.render(p.props,p.state,p.context),N=0;N<p._sb.length;N++)p.__h.push(p._sb[N]);p._sb=[]}else do{p.__d=!1,k&&k(t),h=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++T<25);p.state=p.__s,null!=p.getChildContext&&(i=S(S({},i),p.getChildContext())),f||null==p.getSnapshotBeforeUpdate||(_=p.getSnapshotBeforeUpdate(v,m)),H(e,E(M=null!=h&&h.type===L&&null==h.key?h.props.children:h)?M:[M],t,n,i,o,a,c,s,u,d),p.base=t.__e,t.__h=null,p.__h.length&&c.push(p),g&&(p.__E=p.__=null)}catch(e){t.__v=null,(u||null!=a)&&(t.__e=s,t.__h=!!u,a[a.indexOf(s)]=null),l.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,o,a,c,s,l){var u,d,h,p=n.props,f=t.props,v=t.type,m=0;if("svg"===v&&(o=!0),null!=a)for(;m<a.length;m++)if((u=a[m])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){e=u,a[m]=null;break}if(null==e){if(null===v)return document.createTextNode(f);e=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,f.is&&f),a=null,s=!1}if(null===v)p===f||s&&e.data===f||(e.data=f);else{if(a=a&&r.call(e.childNodes),d=(p=n.props||C).dangerouslySetInnerHTML,h=f.dangerouslySetInnerHTML,!s){if(null!=a)for(p={},m=0;m<e.attributes.length;m++)p[e.attributes[m].name]=e.attributes[m].value;(h||d)&&(h&&(d&&h.__html==d.__html||h.__html===e.innerHTML)||(e.innerHTML=h&&h.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||U(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||U(e,o,t[o],n[o],i)}(e,f,p,o,s),h)t.__k=[];else if(H(e,E(m=t.props.children)?m:[m],t,n,i,o&&"foreignObject"!==v,a,c,a?a[0]:n.__k&&D(n,0),s,l),null!=a)for(m=a.length;m--;)null!=a[m]&&A(a[m]);s||("value"in f&&void 0!==(m=f.value)&&(m!==e.value||"progress"===v&&!m||"option"===v&&m!==p.value)&&U(e,"value",m,p.value,!1),"checked"in f&&void 0!==(m=f.checked)&&m!==e.checked&&U(e,"checked",m,p.checked,!1))}return e}(n.__e,t,n,i,o,a,c,u,d);(h=l.diffed)&&h(t)}function X(e,t,n){for(var i=0;i<n.length;i++)Z(n[i],n[++i],n[++i]);l.__c&&l.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){l.__e(e,t.__v)}}))}function Z(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){l.__e(e,n)}}function G(e,t,n){var i,r;if(l.unmount&&l.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Z(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){l.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&G(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||A(e.__e),e.__=e.__e=e.__d=void 0}function J(e,t,n){return this.constructor(e,n)}function K(e,t,n){var i,o,a,c;l.__&&l.__(e,t),o=(i="function"==typeof n)?null:n&&n.__k||t.__k,a=[],c=[],$(t,e=(!i&&n||t).__k=M(L,null,[e]),o||C,C,void 0!==t.ownerSVGElement,!i&&n?[n]:o?null:t.firstChild?r.call(t.childNodes):null,a,!i&&n?n:o?o.__e:t.firstChild,i,c),X(a,e,c)}r=T.slice,l={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},h=0,m=function(e){return null!=e&&void 0===e.constructor},I.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=S({},this.state),"function"==typeof e&&(e=e(S({},n),this.props)),e&&S(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),P(this))},I.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),P(this))},I.prototype.render=L,y=[],b="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,x=function(e,t){return e.__v.__b-t.__v.__b},B.__r=0,k=0;function Q(e,t,n,i,r){var o="".concat(e,"-").concat(t);return n&&(o+="-".concat(n)),i&&(o+="__".concat(i)),r&&(o+="--".concat(r)),o}var ee=function(){function e(t,n){v(this,e),g(this,"namespace",void 0),this.block=t,this.namespace=n||"ibiz"}return _(e,[{key:"b",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Q(this.namespace,this.block,e,"","")}},{key:"e",value:function(e){return e?Q(this.namespace,this.block,"",e,""):""}},{key:"m",value:function(e){return e?Q(this.namespace,this.block,"","",e):""}},{key:"be",value:function(e,t){return e&&t?Q(this.namespace,this.block,e,t,""):""}},{key:"em",value:function(e,t){return e&&t?Q(this.namespace,this.block,"",e,t):""}},{key:"bm",value:function(e,t){return e&&t?Q(this.namespace,this.block,e,"",t):""}},{key:"bem",value:function(e,t,n){return e&&t&&n?Q(this.namespace,this.block,e,t,n):""}},{key:"is",value:function(e,t){return e&&t?"".concat("is-").concat(e):""}},{key:"cssVar",value:function(e){var t={};for(var n in e)e[n]&&(t[this.cssVarName(n)]=e[n]);return t}},{key:"cssVarBlock",value:function(e){var t={};for(var n in e)e[n]&&(t[this.cssVarBlockName(n)]=e[n]);return t}},{key:"cssVarName",value:function(e){return"--".concat(this.namespace,"-").concat(e)}},{key:"cssVarBlockName",value:function(e){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(e)}}]),e}();function te(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function ne(e,t){for(var n,i="",r=0,o=-1,a=0,c=0;c<=e.length;++c){if(c<e.length)n=e.charCodeAt(c);else{if(47===n)break;n=47}if(47===n){if(o===c-1||1===a);else if(o!==c-1&&2===a){if(i.length<2||2!==r||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var s=i.lastIndexOf("/");if(s!==i.length-1){-1===s?(i="",r=0):r=(i=i.slice(0,s)).length-1-i.lastIndexOf("/"),o=c,a=0;continue}}else if(2===i.length||1===i.length){i="",r=0,o=c,a=0;continue}t&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+e.slice(o+1,c):i=e.slice(o+1,c),r=c-o-1;o=c,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var ie={resolve:function(){for(var e,t="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===e&&(e=process.cwd()),r=e),te(r),0!==r.length&&(t=r+"/"+t,n=47===r.charCodeAt(0))}return t=ne(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(te(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=ne(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return te(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];te(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":ie.normalize(e)},relative:function(e,t){if(te(e),te(t),e===t)return"";if((e=ie.resolve(e))===(t=ie.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var i=e.length,r=i-n,o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var a=t.length-o,c=r<a?r:a,s=-1,l=0;l<=c;++l){if(l===c){if(a>c){if(47===t.charCodeAt(o+l))return t.slice(o+l+1);if(0===l)return t.slice(o+l)}else r>c&&(47===e.charCodeAt(n+l)?s=l:0===l&&(s=0));break}var u=e.charCodeAt(n+l);if(u!==t.charCodeAt(o+l))break;47===u&&(s=l)}var d="";for(l=n+s+1;l<=i;++l)l!==i&&47!==e.charCodeAt(l)||(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(o+s):(o+=s,47===t.charCodeAt(o)&&++o,t.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(te(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,i=-1,r=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');te(e);var n,i=0,r=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var s=e.charCodeAt(n);if(47===s){if(!o){i=n+1;break}}else-1===c&&(o=!1,c=n+1),a>=0&&(s===t.charCodeAt(a)?-1==--a&&(r=n):(a=-1,r=c))}return i===r?r=c:-1===r&&(r=e.length),e.slice(i,r)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":e.slice(i,r)},extname:function(e){te(e);for(var t=-1,n=0,i=-1,r=!0,o=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(r=!1,i=a+1),46===c?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!r){n=a+1;break}}return-1===t||-1===i||0===o||1===o&&t===i-1&&t===n+1?"":e.slice(t,i)},format:function(e){if(null===e||"object"!==f(e))throw new TypeError('The "pathObject" argument must be of type Object. Received type '+f(e));return function(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+e+i:i}("/",e)},parse:function(e){te(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,i=e.charCodeAt(0),r=47===i;r?(t.root="/",n=1):n=0;for(var o=-1,a=0,c=-1,s=!0,l=e.length-1,u=0;l>=n;--l)if(47!==(i=e.charCodeAt(l)))-1===c&&(s=!1,c=l+1),46===i?-1===o?o=l:1!==u&&(u=1):-1!==o&&(u=-1);else if(!s){a=l+1;break}return-1===o||-1===c||0===u||1===u&&o===c-1&&o===a+1?-1!==c&&(t.base=t.name=0===a&&r?e.slice(1,c):e.slice(a,c)):(0===a&&r?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(a,o),t.base=e.slice(a,c)),t.ext=e.slice(o,c)),a>0?t.dir=e.slice(0,a-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};function re(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function oe(){return"".concat(re()+re(),"-").concat(re(),"-").concat(re(),"-").concat(re(),"-").concat(re()).concat(re()).concat(re())}ie.posix=ie;var ae=/<svg\b[^>]*>[\s\S]*?<\/svg>/;function ce(e){return ae.test(e)}var se=function(){function e(){v(this,e)}return _(e,null,[{key:"copy",value:function(e){return this.inputElement||(this.inputElement=document.createElement("input"),this.inputElement.style.position="absolute",this.inputElement.style.left="-9999px",document.body.appendChild(this.inputElement)),this.inputElement.value=e,this.inputElement.select(),document.execCommand("copy")}}]),e}();g(se,"inputElement",null);var le=function(){function e(){v(this,e)}var t,n,i,r,o,a,c,s,l,u;return _(e,null,[{key:"checkDataBaseExists",value:(u=p(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,indexedDB.databases();case 3:return n=e.sent,e.abrupt("return",n.some((function(e){return e.name===t})));case 7:return e.prev=7,e.t0=e.catch(0),console.error("检查数据库是否存在时出错:",e.t0),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[0,7]])}))),function(e){return u.apply(this,arguments)})},{key:"deleteDatabase",value:(l=p(d().mark((function t(n){var i,r;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.lastLink&&(null===(i=(r=e.lastLink).close)||void 0===i||i.call(r)),t.abrupt("return",new Promise((function(e,t){var i=indexedDB.deleteDatabase(n);i.onsuccess=function(){e(!0)},i.onerror=function(){e(!1)},i.onblocked=function(){console.warn("删除数据库 ".concat(n," 被阻塞,可能有其他连接正在使用该数据库。")),t(new Error("删除数据库 ".concat(n," 被阻塞")))}})));case 2:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)})},{key:"checkTableExists",value:(s=p(d().mark((function t(n,i){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.checkDataBaseExists(n);case 2:if(t.sent){t.next=5;break}return t.abrupt("return",!1);case 5:return t.abrupt("return",new Promise((function(t,r){var o=indexedDB.open(n);o.onupgradeneeded=function(t){e.db=t.target.result,e.version=e.db.version},o.onsuccess=function(n){e.db=n.target.result,e.lastLink=o.result;var r=e.db.objectStoreNames.contains(i);o.result.close(),t(r)},o.onerror=function(e){r(e.target.error)}})));case 6:case"end":return t.stop()}}),t)}))),function(e,t){return s.apply(this,arguments)})},{key:"createTable",value:(c=p(d().mark((function t(n,i,r){var o,a=arguments;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=a.length>3&&void 0!==a[3]&&a[3],t.abrupt("return",new Promise((function(t){var a,c;e.version+=1,e.lastLink&&(null===(a=(c=e.lastLink).close)||void 0===a||a.call(c));var s=indexedDB.open(n,e.version);s.onupgradeneeded=function(t){if(e.db=t.target.result,!e.db.objectStoreNames.contains(i)){var n={};r?n.keyPath=r:o&&(n.autoIncrement=!0),e.db.createObjectStore(i,n)}},s.onsuccess=function(){e.lastLink=s.result,s.result.close(),t(!0)},s.onerror=function(){t(!1)}})));case 2:case"end":return t.stop()}}),t)}))),function(e,t,n){return c.apply(this,arguments)})},{key:"deleteTable",value:(a=p(d().mark((function t(n,i){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var r,o;e.version+=1,e.lastLink&&(null===(r=(o=e.lastLink).close)||void 0===r||r.call(o));var a=indexedDB.open(n,e.version);a.onupgradeneeded=function(t){e.db=t.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)&&e.db.deleteObjectStore(i)},a.onsuccess=function(n){e.db=n.target.result,e.lastLink=a.result,a.result.close(),t(!0)},a.onerror=function(){a.result.close(),t(!1)}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)})},{key:"addData",value:(o=p(d().mark((function t(n,i,r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)){var o=e.db.transaction([i],"readwrite").objectStore(i).add(r);o.onsuccess=function(e){t(r)},o.onerror=function(){t(null)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"deleteData",value:(r=p(d().mark((function t(n,i,r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)){var o=e.db.transaction([i],"readwrite").objectStore(i).delete(r);o.onsuccess=function(e){t(!0)},o.onerror=function(){t(!1)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"updateData",value:(i=p(d().mark((function t(n,i,r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)){var o=e.db.transaction([i],"readwrite").objectStore(i).put(r);o.onsuccess=function(e){t(r)},o.onerror=function(){t(r)}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"getData",value:(n=p(d().mark((function t(n,i,r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){var a=indexedDB.open(n);a.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=a.result,e.db.objectStoreNames.contains(i)){var c=e.db.transaction([i],"readonly").objectStore(i).get(r);c.onsuccess=function(e){t(c.result)},c.onerror=function(){o(new Error("未找到数据".concat(r)))}}a.result.close()},a.onerror=function(){a.result.close(),o()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,t,i){return n.apply(this,arguments)})},{key:"getAllData",value:(t=p(d().mark((function t(n,i){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,r){var o=indexedDB.open(n);o.onsuccess=function(n){if(e.db=n.target.result,e.lastLink=o.result,e.db.objectStoreNames.contains(i)){var r=e.db.transaction([i],"readonly").objectStore(i).getAll();r.onsuccess=function(e){t(r.result)},r.onerror=function(){t([])}}o.result.close()},o.onerror=function(){o.result.close(),r()}})));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})}]),e}();g(le,"version",1),g(le,"db",null),g(le,"lastLink",void 0);var ue=function(){function e(t){v(this,e),g(this,"options",void 0),this.options=u({multiple:!0,accept:"*/*",maxSize:5242880},t)}var t,n;return _(e,[{key:"openFilePicker",value:function(){var e=this,t=document.createElement("input");t.type="file",t.multiple=this.options.multiple,t.accept=this.options.accept||"",t.onchange=function(t){var n=Array.from(t.target.files||[]);e.handleFiles(n)},t.click()}},{key:"handleFiles",value:(n=p(d().mark((function e(t){var n,i,r,o=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.length){e.next=2;break}return e.abrupt("return");case 2:return r=t.filter((function(e){var t,n;return!(o.options.maxSize&&e.size>o.options.maxSize&&(null===(t=(n=o.options).onError)||void 0===t||t.call(n,new Error("文件大小超过限制 (".concat(o.formatSize(e.size)," > ").concat(o.formatSize(o.options.maxSize),")")),e),1))})),null===(n=(i=this.options).onSelect)||void 0===n||n.call(i,r),e.next=6,Promise.all(r.map((function(e){return o.processFile(e)})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"processFile",value:(t=p(d().mark((function e(t){var n,i,r,o,a,c,s,l,u=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a=function(e){var n,i;null===(n=(i=u.options).onProgress)||void 0===n||n.call(i,t,e)},e.next=4,this.options.onUpload(t,a);case 4:c=e.sent,null===(n=(i=this.options).onProgress)||void 0===n||n.call(i,t,100),null===(r=(o=this.options).onSuccess)||void 0===r||r.call(o,c,t),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),null===(s=(l=this.options).onError)||void 0===s||s.call(l,e.t0 instanceof Error?e.t0:new Error("上传失败"),t);case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e){return t.apply(this,arguments)})},{key:"formatSize",value:function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return"".concat((e/Math.pow(1024,t)).toFixed(2)," ").concat(["B","KB","MB","GB"][t])}}]),e}(),de=function(){function e(){v(this,e)}return _(e,null,[{key:"getCdataContent",value:function(e){if(!e)return null;var t=Array.from(e.childNodes).find((function(e){return e.nodeType===e.CDATA_SECTION_NODE}));return(null==t?void 0:t.nodeValue)||e.textContent}},{key:"parse",value:function(e){var t=this,n=(new DOMParser).parseFromString(e,"text/xml");return Array.from(n.querySelectorAll("resource")).map((function(e){var n=e.getAttribute("type")||"",i=e.querySelector("data"),r=e.querySelector("metadata");try{var o=t.getCdataContent(i),a=t.getCdataContent(r),c=o?JSON.parse(o):{},s=a?JSON.parse(a):{};return{id:c.id,type:n,data:c,metadata:s}}catch(Jn){throw new Error("XML 解析错误: ".concat(Jn.message))}}))}},{key:"parseMixedContent",value:function(e){var t=/<resources\b[^>]*>[\s\S]*?<\/resources>/i.exec(e);if(!t)return{resources:[],remainingText:e,hasResources:!1};var n=a(t,1)[0],i=t.index,r=i+n.length,o=(e.slice(0,i)+e.slice(r)).replace(/\n/g,"");try{return{resources:this.parse(n),remainingText:o,hasResources:!0}}catch(c){return{resources:[],remainingText:o,hasResources:!0,error:"资源解析失败: ".concat(c.message)}}}},{key:"stringify",value:function(e){var t=document.implementation.createDocument(null,null,null),n=t.createElement("resources");n.setAttribute("version","1.0");var i=function(e){return"\n".concat(" ".repeat(e))};return e.forEach((function(e){n.appendChild(t.createTextNode(i(1)));var r=t.createElement("resource");r.setAttribute("type",e.type),r.setAttribute("version","1.0");var o=function(e,n){var r=t.createElement(e);r.appendChild(t.createTextNode(i(2)));var o=t.createCDATASection(JSON.stringify(n));return r.appendChild(o),r.appendChild(t.createTextNode(i(1))),r};r.appendChild(t.createTextNode(i(2))),r.appendChild(o("data",e.data)),r.appendChild(t.createTextNode(i(2))),r.appendChild(o("metadata",e.metadata)),r.appendChild(t.createTextNode(i(1))),n.appendChild(r)})),n.appendChild(t.createTextNode("\n")),t.appendChild(n),(new XMLSerializer).serializeToString(t).replace(/></g,">\n<")}}]),e}(),he=function(){function e(){v(this,e)}return _(e,null,[{key:"getCdataContent",value:function(e){if(!e)return null;var t=Array.from(e.childNodes).find((function(e){return e.nodeType===e.CDATA_SECTION_NODE}));return(null==t?void 0:t.nodeValue)||e.textContent}},{key:"parse",value:function(e){var t=this,n=(new DOMParser).parseFromString(e,"text/xml");return Array.from(n.querySelectorAll("suggestion")).map((function(e){var n=e.getAttribute("type")||"",i=e.querySelector("data"),r=e.querySelector("metadata");try{var o=t.getCdataContent(i),a=t.getCdataContent(r);return{type:n,data:o?JSON.parse(o):{},metadata:a?JSON.parse(a):{}}}catch(Jn){throw new Error("XML 解析错误: ".concat(Jn.message))}}))}},{key:"parseMixedContent",value:function(e){var t=/<suggestions\b[^>]*>[\s\S]*?<\/suggestions>/i.exec(e);if(!t)return{suggestions:[],remainingText:e,hasSuggestions:!1};var n=a(t,1)[0],i=t.index,r=i+n.length,o=(e.slice(0,i)+e.slice(r)).replace(/\n/g,"");try{return{suggestions:this.parse(n),remainingText:o,hasSuggestions:!0}}catch(c){return{suggestions:[],remainingText:o,hasSuggestions:!0,error:"资源解析失败: ".concat(c.message)}}}},{key:"stringify",value:function(e){var t=document.implementation.createDocument(null,null,null),n=t.createElement("suggestions");n.setAttribute("version","1.0");var i=function(e){return"\n".concat(" ".repeat(e))};return e.forEach((function(e){n.appendChild(t.createTextNode(i(1)));var r=t.createElement("suggestion");r.setAttribute("type",e.type),r.setAttribute("version","1.0");var o=function(e,n){var r=t.createElement(e);r.appendChild(t.createTextNode(i(2)));var o=t.createCDATASection(JSON.stringify(n));return r.appendChild(o),r.appendChild(t.createTextNode(i(1))),r};r.appendChild(t.createTextNode(i(2))),r.appendChild(o("data",e.data)),r.appendChild(t.createTextNode(i(2))),r.appendChild(o("metadata",e.metadata)),r.appendChild(t.createTextNode(i(1))),n.appendChild(r)})),n.appendChild(t.createTextNode("\n")),t.appendChild(n),(new XMLSerializer).serializeToString(t).replace(/></g,">\n<")}}]),e}();function pe(e){return e.x>=0&&e.x<=1&&e.y>=0&&e.y<=1}function fe(e,t,n,i){var r=e/window.innerWidth,o=t/window.innerHeight;return{x:Math.max(0,Math.min(r,1-n)),y:Math.max(0,Math.min(o,1-i))}}var ve,me,_e,ge,ye=0,we=[],be=[],xe=l.__b,ke=l.__r,Ce=l.diffed,Te=l.__c,Ne=l.unmount;function Ee(e,t){l.__h&&l.__h(me,e,ye||t),ye=0;var n=me.__H||(me.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:be}),n.__[e]}function Se(e){return ye=1,function(e,t,n){var i=Ee(ve++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):Fe(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=me,!me.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&i.__c.props===e)&&(!o||o.call(this,e,t,n))};me.u=!0;var o=me.shouldComponentUpdate,a=me.componentWillUpdate;me.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}a&&a.call(this,e,t,n)},me.shouldComponentUpdate=r}return i.__N||i.__}(Fe,e)}function Ae(e,t){var n=Ee(ve++,3);!l.__s&&je(n.__H,t)&&(n.__=e,n.i=t,me.__H.__h.push(n))}function Me(e){return ye=5,Oe((function(){return{current:e}}),[])}function Oe(e,t){var n=Ee(ve++,7);return je(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Le(e,t){return ye=8,Oe((function(){return e}),t)}function Ie(e){var t=me.context[e.__c],n=Ee(ve++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(me)),t.props.value):e.__}function De(){for(var e;e=we.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Be),e.__H.__h.forEach(He),e.__H.__h=[]}catch(ei){e.__H.__h=[],l.__e(ei,e.__v)}}l.__b=function(e){me=null,xe&&xe(e)},l.__r=function(e){ke&&ke(e),ve=0;var t=(me=e.__c).__H;t&&(_e===me?(t.__h=[],me.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=be,e.__N=e.i=void 0}))):(t.__h.forEach(Be),t.__h.forEach(He),t.__h=[],ve=0)),_e=me},l.diffed=function(e){Ce&&Ce(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==we.push(t)&&ge===l.requestAnimationFrame||((ge=l.requestAnimationFrame)||Pe)(De)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==be&&(e.__=e.__V),e.i=void 0,e.__V=be}))),_e=me=null},l.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Be),e.__h=e.__h.filter((function(e){return!e.__||He(e)}))}catch(Ge){t.some((function(e){e.__h&&(e.__h=[])})),t=[],l.__e(Ge,e.__v)}})),Te&&Te(e,t)},l.unmount=function(e){Ne&&Ne(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Be(e)}catch(e){t=e}})),n.__H=void 0,t&&l.__e(t,n.__v))};var ze="function"==typeof requestAnimationFrame;function Pe(e){var t,n=function(){clearTimeout(i),ze&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);ze&&(t=requestAnimationFrame(n))}function Be(e){var t=me,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),me=t}function He(e){var t=me;e.__c=e.__(),me=t}function je(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Fe(e,t){return"function"==typeof t?t(e):t}function Re(){throw new Error("Cycle detected")}var Ve=Symbol.for("preact-signals");function We(){if(Xe>1)Xe--;else{for(var e,t=!1;void 0!==$e;){var n=$e;for($e=void 0,Ze++;void 0!==n;){var i=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&et(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=i}}if(Ze=0,Xe--,t)throw e}}var Ue,qe,Ye=void 0,$e=void 0,Xe=0,Ze=0,Ge=0;function Je(e){if(void 0!==Ye){var t=e.n;if(void 0===t||t.t!==Ye)return t={i:0,S:e,p:Ye.s,n:void 0,t:Ye,e:void 0,x:void 0,r:t},void 0!==Ye.s&&(Ye.s.n=t),Ye.s=t,e.n=t,32&Ye.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=Ye.s,t.n=void 0,Ye.s.n=t,Ye.s=t),t}}function Ke(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function Qe(e){return new Ke(e)}function et(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function tt(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function nt(e){for(var t=e.s,n=void 0;void 0!==t;){var i=t.p;-1===t.i?(t.S.U(t),void 0!==i&&(i.n=t.n),void 0!==t.n&&(t.n.p=i)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=i}e.s=n}function it(e){Ke.call(this,void 0),this.x=e,this.s=void 0,this.g=Ge-1,this.f=4}function rt(e){return new it(e)}function ot(e){var t=e.u;if(e.u=void 0,"function"==typeof t){Xe++;var n=Ye;Ye=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,at(e),t}finally{Ye=n,We()}}}function at(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ot(e)}function ct(e){if(Ye!==this)throw new Error("Out-of-order effect");nt(this),Ye=e,this.f&=-2,8&this.f&&at(this),We()}function st(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function lt(e){var t=new st(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function ut(e,t){l[e]=t.bind(null,l[e]||function(){})}function dt(e){qe&&qe(),qe=e&&e.S()}function ht(e){var t=this,n=e.data,i=ft(n);i.value=n;var r=Oe((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;m(r.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=r.peek()},rt((function(){var e=i.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return r.value}function pt(e,t,n,i){var r=t in e&&void 0===e.ownerSVGElement,o=Qe(n);return{o:function(e,t){o.value=e,i=t},d:lt((function(){var n=o.value.value;i[t]!==n&&(i[t]=n,r?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}function ft(e){return Oe((function(){return Qe(e)}),[])}function vt(e){var t=Me(e);return t.current=e,Ue.__$f|=4,Oe((function(){return rt((function(){return t.current()}))}),[])}Ke.prototype.brand=Ve,Ke.prototype.h=function(){return!0},Ke.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},Ke.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},Ke.prototype.subscribe=function(e){var t=this;return lt((function(){var n=t.value,i=32&this.f;this.f&=-33;try{e(n)}finally{this.f|=i}}))},Ke.prototype.valueOf=function(){return this.value},Ke.prototype.toString=function(){return this.value+""},Ke.prototype.toJSON=function(){return this.value},Ke.prototype.peek=function(){return this.v},Object.defineProperty(Ke.prototype,"value",{get:function(){var e=Je(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(Ye instanceof it&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){Ze>100&&Re(),this.v=e,this.i++,Ge++,Xe++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{We()}}}}),(it.prototype=new Ke).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===Ge)return!0;if(this.g=Ge,this.f|=1,this.i>0&&!et(this))return this.f&=-2,!0;var e=Ye;try{tt(this),Ye=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Ye=e,nt(this),this.f&=-2,!0},it.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Ke.prototype.S.call(this,e)},it.prototype.U=function(e){if(void 0!==this.t&&(Ke.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},it.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},it.prototype.peek=function(){if(this.h()||Re(),16&this.f)throw this.v;return this.v},Object.defineProperty(it.prototype,"value",{get:function(){1&this.f&&Re();var e=Je(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),st.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},st.prototype.S=function(){1&this.f&&Re(),this.f|=1,this.f&=-9,ot(this),tt(this),Xe++;var e=Ye;return Ye=this,ct.bind(this,e)},st.prototype.N=function(){2&this.f||(this.f|=2,this.o=$e,$e=this)},st.prototype.d=function(){this.f|=8,1&this.f||at(this)},ht.displayName="_st",Object.defineProperties(Ke.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ht},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ut("__b",(function(e,t){if("string"==typeof t.type){var n,i=t.props;for(var r in i)if("children"!==r){var o=i[r];o instanceof Ke&&(n||(t.__np=n={}),n[r]=o,i[r]=o.peek())}}e(t)})),ut("__r",(function(e,t){dt();var n,i=t.__c;i&&(i.__$f&=-2,void 0===(n=i.__$u)&&(i.__$u=n=function(e){var t;return lt((function(){t=this})),t.c=function(){i.__$f|=1,i.setState({})},t}())),Ue=i,dt(n),e(t)})),ut("__e",(function(e,t,n,i){dt(),Ue=void 0,e(t,n,i)})),ut("diffed",(function(e,t){var n;if(dt(),Ue=void 0,"string"==typeof t.type&&(n=t.__e)){var i=t.__np,r=t.props;if(i){var o=n.U;if(o)for(var a in o){var c=o[a];void 0===c||a in i||(c.d(),o[a]=void 0)}else n.U=o={};for(var s in i){var l=o[s],u=i[s];void 0===l?(l=pt(n,s,u,r),o[s]=l):l.o(u,r)}}}e(t)})),ut("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var i=n.U;if(i)for(var r in n.U=void 0,i){var o=i[r];o&&o.d()}}}else{var a=t.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}e(t)})),ut("__h",(function(e,t,n,i){(i<3||9===i)&&(t.__$f|=2),e(t,n,i)})),I.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var i in t)return!0;for(var r in e)if("__source"!==r&&e[r]!==this.props[r])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};var mt=0;function _t(e,t,n,i,r,o){var a,c,s={};for(c in t)"ref"==c?a=t[c]:s[c]=t[c];var u={type:e,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--mt,__source:r,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(c in a)void 0===s[c]&&(s[c]=a[c]);return l.vnode&&l.vnode(u),u}var gt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"})})},yt=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z"})})},wt=function(e){return _t("svg",{viewBox:"0 0 1024 1024",id:"send",className:e.className,version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-0.9 3.7-0.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 0.7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-0.8 4.2-2.6 5-5 1.4-4.2-0.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})},bt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M962 197.61H747v-60c0-55.14-44.86-100-100-100H377c-55.14 0-100 44.86-100 100v60H62c-11.05 0-20 8.95-20 20s8.95 20 20 20h60v630.57c0 66.17 53.83 120 120 120h540c66.17 0 120-53.83 120-120V237.61h60c11.05 0 20-8.95 20-20s-8.95-20-20-20zM637.34 457.66v260c0 12.01-10.72 21.63-23.06 19.77-9.84-1.48-16.94-10.25-16.94-20.2V458.09c0-9.95 7.1-18.72 16.94-20.2 12.34-1.86 23.06 7.76 23.06 19.77z m-210.68 0v260c0 11-9 20-20 20s-20-9-20-20v-260c0-11 9-20 20-20s20 9 20 20zM317 137.61c0-33.08 26.92-60 60-60h270c33.08 0 60 26.92 60 60v60H317v-60z"})})},xt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M511.582491 63.413262C265.134543 63.413262 64.62588 263.921925 64.62588 510.369873s200.508663 446.957635 446.957635 446.957635 446.957635-200.508663 446.957635-446.957635S758.031463 63.413262 511.582491 63.413262zM509.001713 751.859903c-98.517781 0-182.467775-62.623269-214.771505-150.056598l0.327458-0.134053c-2.007727-4.036943-3.38305-8.422833-3.38305-13.237489 0-16.647145 13.494339-30.142507 30.142507-30.142507 13.389962 0 24.358781 8.877181 28.2893 20.955264l0.422625-0.172939c23.269983 65.442478 85.645612 112.503307 158.972665 112.503307 93.106538 0 168.845523-75.738985 168.845523-168.845523s-75.738985-168.845523-168.845523-168.845523c-20.432355 0-39.874149 3.980661-58.013275 10.66899l21.248953 40.742936c2.486634 2.677992 4.0175 6.2831 4.0175 10.243295 0 8.417717-8.404414 14.921851-15.365966 15.07023-0.102331 0-0.206708 0-0.309038 0-0.220011 0-0.427742 0-0.647753-0.013303l-150.579507-6.463202c-5.372358-0.234337-10.229992-3.310396-12.716626-8.093329-2.486634-4.76963-2.236947-10.509355 0.647753-15.055904l80.890308-127.179564c2.8847-4.533246 8.006348-7.151887 13.365402-6.960529 5.372358 0.234337 10.227945 3.312442 12.71458 8.095375l18.580171 35.625382c26.629497-10.855232 55.683207-16.963347 86.168522-16.963347 126.338407 0 229.130537 102.791108 229.130537 229.130537S635.340119 751.859903 509.001713 751.859903z"})})},kt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M891.072 822.144V167.36a34.432 34.432 0 0 0-34.432-34.432H201.856C201.856 94.848 232.704 64 270.784 64h620.288C929.152 64 960 94.848 960 132.928v620.288c0 38.08-30.848 68.928-68.928 68.928z m-68.928-551.36v620.288c0 38.08-30.848 68.928-68.928 68.928H132.928A68.928 68.928 0 0 1 64 891.072V270.784c0-38.08 30.848-68.928 68.928-68.928h620.288c38.08 0 68.928 30.848 68.928 68.928z m-137.856 137.856H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z m0 206.72H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z"})})},Ct=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M547.4 197.4v46l200.3 0.1L546.1 444l32.4 32.6 201.9-200.7v200.9h46V197.5zM471.4 584.4l-32.6-32.6L243.6 747V547.9h-46v278.7h279v-46H275z"})})},Tt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M544 480V282.944h52.224l0.064 107.968L763.072 224l36.928 36.928-166.976 166.976 108.032-0.128V480H544zM260.928 800l-36.928-36.928 166.912-166.784-107.968-0.064V544H480v197.056h-52.224l0.064-107.968L260.928 800z"})})},Nt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"})})},Et=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[_t("path",{d:"M481.0752 263.3728l50.9952 1.024 1.8432-105.8816-50.9952-0.8192z"}),_t("path",{d:"M486.441426 180.895362a66.56 66.56 0 1 0 42.091944-126.290153 66.56 66.56 0 1 0-42.091944 126.290153Z"}),_t("path",{d:"M138.8544 664.3712c-52.8384 0-95.8464-43.008-95.8464-95.8464s43.008-95.8464 95.8464-95.8464M880.0256 472.6784c52.8384 0 95.8464 43.008 95.8464 95.8464s-43.008 95.8464-95.8464 95.8464"}),_t("path",{d:"M507.4944 220.5696c-220.16 0-398.7456 162.816-398.7456 363.7248s178.5856 363.7248 398.7456 363.7248 398.7456-162.816 398.7456-363.7248-178.5856-363.7248-398.7456-363.7248z m0 559.9232c-166.2976 0-301.2608-100.5568-301.2608-224.4608s134.9632-224.4608 301.2608-224.4608S808.7552 432.128 808.7552 556.032 673.792 780.4928 507.4944 780.4928z"}),_t("path",{d:"M319.6928 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"}),_t("path",{d:"M617.472 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"})]})},St=function(){return _t("svg",{viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_t("path",{d:"M5.856 17.121a.979.979 0 0 1-.327-.06.839.839 0 0 1-.283-.177.739.739 0 0 1-.187-.255.724.724 0 0 1-.07-.303l-.02-1.609a4.663 4.663 0 0 1-1.446-.455 4.252 4.252 0 0 1-.637-.401c-.199-.146-.385-.31-.553-.492a4.442 4.442 0 0 1-.45-.577 4.303 4.303 0 0 1-.327-.637 3.823 3.823 0 0 1-.206-.686 3.729 3.729 0 0 1-.064-.704V6.478c0-.261.025-.516.077-.771a4.43 4.43 0 0 1 .244-.747 4.062 4.062 0 0 1 .932-1.28c.2-.183.418-.347.65-.493.23-.145.482-.267.739-.364a4.21 4.21 0 0 1 .81-.225c.27-.054.553-.078.835-.078H8.55c.103 0 .2.018.29.054a.7.7 0 0 1 .411.376.667.667 0 0 1-.161.766.736.736 0 0 1-.25.151.764.764 0 0 1-.29.055H5.573c-.186 0-.366.012-.54.049-.18.03-.353.079-.52.145-.167.061-.328.14-.482.237-.148.091-.29.2-.418.316a2.897 2.897 0 0 0-.347.388c-.097.14-.187.286-.257.444a2.473 2.473 0 0 0-.206.977v4.287c0 .17.013.333.051.503a2.549 2.549 0 0 0 .772 1.33 2.721 2.721 0 0 0 .913.559c.167.066.347.115.527.152.18.03.36.048.546.048a.904.904 0 0 1 .61.23.848.848 0 0 1 .194.262.84.84 0 0 1 .07.303l.007.99 1.915-1.293a2.877 2.877 0 0 1 1.64-.492h2.372c.186 0 .366-.018.54-.048.18-.03.353-.08.52-.146.168-.067.329-.146.483-.237.148-.091.29-.2.418-.316.128-.121.244-.249.347-.388a2.8 2.8 0 0 0 .257-.444 2.47 2.47 0 0 0 .206-.977V8.585a.646.646 0 0 1 .225-.492.679.679 0 0 1 .244-.152.814.814 0 0 1 .585 0c.09.03.174.085.244.152a.657.657 0 0 1 .225.492V10.8c0 .261-.032.516-.083.771a4.192 4.192 0 0 1-.245.74c-.109.244-.244.468-.398.687a3.735 3.735 0 0 1-.534.6c-.2.183-.418.347-.65.493a4.134 4.134 0 0 1-.738.364 4.7 4.7 0 0 1-.81.225c-.27.054-.553.079-.836.079h-1.877c-.604 0-1.144.164-1.633.491l-2.54 1.713a.913.913 0 0 1-.514.157z",fill:"currentColor"}),_t("path",{d:"M15.866 4.125h-4.174c-.41 0-.741.313-.741.7 0 .387.332.7.741.7h4.174c.41 0 .742-.313.742-.7 0-.387-.332-.7-.742-.7z",fill:"currentColor"}),_t("path",{d:"M14.537 2.932c0-.396-.34-.717-.759-.717s-.758.32-.758.717v3.786c0 .396.34.717.758.717.42 0 .76-.321.76-.717V2.932z",fill:"currentColor"})]})},At=function(){return _t("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:_t("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})})},Mt=function(){var e=1e3,t=140,n=250,i=.8;return _t("svg",{fill:"currentColor",viewBox:"0 0 ".concat(e," ").concat(e),xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Array.from({length:4}).map((function(e,r){return _t("rect",{fill:"currentColor",rx:70,ry:70,height:n,width:t,x:286.66666666666663*r,y:375,children:[_t("animate",{attributeName:"height",values:"".concat(n,"; ").concat(500,"; ").concat(n),keyTimes:"0; 0.5; 1",dur:"".concat(i,"s"),begin:"".concat(.2*r,"s"),repeatCount:"indefinite"}),_t("animate",{attributeName:"y",values:"".concat(375,"; ").concat(250,"; ").concat(375),keyTimes:"0; 0.5; 1",dur:"".concat(i,"s"),begin:"".concat(.2*r,"s"),repeatCount:"indefinite"})]},r)}))})},Ot=function(e){return _t("svg",{className:e.className,onClick:e.onClick,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M128 384a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m768 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m-372.4288 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z"})})},Lt=function(e){return _t("svg",{className:e.className,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M498.33984 607.8464c-10.99776-32.9728-50.09408-73.5232-82.6368-85.74976L150.9376 422.8096c-38.54336-14.4384-36.98688-69.46816 2.27328-81.73568L844.92288 124.90752c33.30048-10.40384 64.57344 20.8896 54.1696 54.1696L682.92608 870.78912a43.2128 43.2128 0 0 1-81.36704 3.25632 121682.5344 121682.5344 0 0 1-103.2192-266.19904z"})})},It=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M972.657609 209.348408C987.158609 209.36839 998.930114 197.571202 998.949999 182.99865 998.969882 168.426097 987.230618 156.59651 972.729617 156.576528L32.457975 155.280806C17.956974 155.260823 6.18547 167.058012 6.165585 181.630564 6.1457 196.203116 17.884965 208.032703 32.385966 208.052686L972.657609 209.348408ZM180.466902 992.356169 180.466902 1019.014859 206.993296 1018.74074 833.361858 1012.267947 859.348284 1011.999407 859.348284 985.883377 859.348284 289.397297C859.348284 274.824732 847.59289 263.011332 833.091874 263.011332 818.590859 263.011332 806.835465 274.824732 806.835465 289.397297L806.835465 985.883377 832.82189 959.498805 206.453329 965.971599 232.979723 992.356169 232.979723 282.67005C232.979723 268.097483 221.224329 256.284085 206.723313 256.284085 192.222298 256.284085 180.466902 268.097483 180.466902 282.67005L180.466902 992.356169ZM656.410257 847.079027C656.410257 861.651593 668.165651 873.464992 682.666667 873.464992 697.167682 873.464992 708.923076 861.651593 708.923076 847.079027L708.923076 372.131659C708.923076 357.559091 697.167682 345.745694 682.666667 345.745694 668.165651 345.745694 656.410257 357.559091 656.410257 372.131659L656.410257 847.079027ZM341.333333 847.079027C341.333333 861.651593 353.08873 873.464992 367.589743 873.464992 382.090758 873.464992 393.846155 861.651593 393.846155 847.079027L393.846155 372.131659C393.846155 357.559091 382.090758 345.745694 367.589743 345.745694 353.08873 345.745694 341.333333 357.559091 341.333333 372.131659L341.333333 847.079027ZM498.871795 847.079027C498.871795 861.651593 510.627189 873.464992 525.128205 873.464992 539.62922 873.464992 551.384614 861.651593 551.384614 847.079027L551.384614 372.131659C551.384614 357.559091 539.62922 345.745694 525.128205 345.745694 510.627189 345.745694 498.871795 357.559091 498.871795 372.131659L498.871795 847.079027ZM392.147755 116.721777C392.147755 102.063669 403.758665 90.363507 418.40134 90.363507L622.925796 90.363507C637.408947 90.363507 649.179381 102.1619 649.179381 116.549585L649.179381 171.644875 701.692203 171.644875 701.692203 116.549585C701.692203 72.986607 666.38105 37.591577 622.925796 37.591577L418.40134 37.591577C374.724427 37.591577 339.634933 72.950804 339.634933 116.721777L339.634933 165.310801 392.147755 165.310801 392.147755 116.721777Z"})})},Dt=function(e){return _t("svg",{xmlns:"http://www.w3.org/2000/svg",className:e.className,viewBox:"0 0 512 512",children:_t("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 184l144 144 144-144"})})},zt=function(e){return _t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"".concat(e.className," icon"),viewBox:"0 0 512 512",children:_t("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"})})},Pt=function(e){return _t("svg",{className:e.className,width:"16",height:"16",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",children:_t("circle",{cx:"25",cy:"25",r:"20",stroke:"currentColor",strokeWidth:"5",fill:"none",strokeDasharray:"31.415, 31.415",strokeLinecap:"round",children:_t("animateTransform",{attributeName:"transform",type:"rotate",from:"0 25 25",to:"360 25 25",dur:"1s",repeatCount:"indefinite"})})})},Bt=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:_t("path",{d:"M704 256v490.666667a170.666667 170.666667 0 0 1-170.666667 170.666666 170.666667 170.666667 0 0 1-170.666666-170.666666V213.333333A106.666667 106.666667 0 0 1 469.333333 106.666667 106.666667 106.666667 0 0 1 576 213.333333v448a42.666667 42.666667 0 0 1-42.666667 42.666667 42.666667 42.666667 0 0 1-42.666666-42.666667V256H426.666667v405.333333a106.666667 106.666667 0 0 0 106.666666 106.666667 106.666667 106.666667 0 0 0 106.666667-106.666667V213.333333a170.666667 170.666667 0 0 0-170.666667-170.666666 170.666667 170.666667 0 0 0-170.666666 170.666666v533.333334a234.666667 234.666667 0 0 0 234.666666 234.666666 234.666667 234.666667 0 0 0 234.666667-234.666666V256h-64z"})})},Ht=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:[_t("path",{d:"M842.666667 285.866667l-187.733334-187.733334c-14.933333-14.933333-32-21.333333-53.333333-21.333333H234.666667C194.133333 74.666667 160 108.8 160 149.333333v725.333334c0 40.533333 34.133333 74.666667 74.666667 74.666666h554.666666c40.533333 0 74.666667-34.133333 74.666667-74.666666V337.066667c0-19.2-8.533333-38.4-21.333333-51.2z m-44.8 44.8c-2.133333 2.133333-4.266667 0-8.533334 0h-170.666666c-6.4 0-10.666667-4.266667-10.666667-10.666667V149.333333c0-2.133333 0-6.4-2.133333-8.533333 0 0 2.133333 0 2.133333 2.133333l189.866667 187.733334z m-8.533334 554.666666H234.666667c-6.4 0-10.666667-4.266667-10.666667-10.666666V149.333333c0-6.4 4.266667-10.666667 10.666667-10.666666h311.466666c-2.133333 4.266667-2.133333 6.4-2.133333 10.666666v170.666667c0 40.533333 34.133333 74.666667 74.666667 74.666667h170.666666c4.266667 0 6.4 0 10.666667-2.133334V874.666667c0 6.4-4.266667 10.666667-10.666667 10.666666z",fill:"currentColor"}),_t("path",{d:"M640 693.333333H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM640 522.666667H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM341.333333 416h85.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-85.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32z",fill:"currentColor"})]})},jt=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:_t("path",{d:"M557.248 511.68l135.776-135.744-45.248-45.28L512 466.432l-135.776-135.776-45.248 45.28 135.776 135.744-135.776 135.776 45.248 45.248L512 556.928l135.776 135.776 45.248-45.248-135.776-135.776zM512 64c247.136 0 448 200.864 448 448s-200.864 448-448 448S64 759.136 64 512 264.864 64 512 64z",fill:"currentColor"})})},Ft=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:_t("path",{d:"M512.43945313 904.51953125c-6.06445313 0-12.12890625-1.58203125-17.57812501-4.74609375L136.70703125 689.71484375c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867188-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l76.37695313-44.91210938L136.97070312 540.125c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867187-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l73.38867187-43.15429688-73.125-42.890625C126.51171875 387.81054687 120.0078125 376.38476562 120.0078125 364.08007812c0-12.3046875 6.50390625-23.73046875 17.13867188-29.97070312L495.828125 122.99609375c10.8984375-6.41601563 24.34570313-6.41601563 35.24414063 0l358.15429687 210.05859375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-73.38867188 43.15429688 73.12500001 42.890625c10.63476563 6.24023438 17.13867188 17.66601563 17.13867187 29.97070312s-6.50390625 23.73046875-17.13867187 29.97070313L812.5859375 583.89453125l76.11328125 44.6484375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-358.59375 211.2890625c-5.44921875 3.1640625-11.6015625 4.74609375-17.66601563 4.74609375zM223.015625 659.65625l289.42382813 169.8046875 290.12695312-170.77148438-58.44726563-34.27734374L530.28125 750.18359375a34.67285156 34.67285156 0 0 1-35.24414063 0L281.7265625 625.02734375 223.015625 659.65625z m76.90429688-104.58984375l212.69531249 124.8046875 290.12695313-170.77148438-55.546875-32.60742187-216.65039063 127.6171875a34.67285156 34.67285156 0 0 1-35.24414062 0L279.00195312 477.28320312l-55.81054687 32.78320313 75.49804688 44.296875c0.43945313 0.26367188 0.79101563 0.52734375 1.23046874 0.703125z m-2.81250001-147.83203125l215.68359376 126.5625 216.12304687-127.17773438c0.3515625-0.26367188 0.703125-0.43945313 1.0546875-0.61523437l72.86132813-42.890625-289.33593751-169.8046875-290.12695312 170.68359375 72.59765625 42.62695313c0.43945313 0.17578125 0.79101563 0.43945313 1.14257813 0.61523437z"})})},Rt=function(e){return _t("svg",{className:e.className,id:"stop",viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:[_t("path",{d:"M512.268258 1022.835842c-68.658678 0-135.399619-13.564433-198.369591-40.316509-60.752236-25.809077-115.373446-62.712976-162.346233-109.685763-46.971763-46.971763-83.875662-101.592974-109.685763-162.346233C15.115619 647.517366 1.551186 580.777449 1.551186 512.118771S15.115619 376.719151 41.866671 313.74918c25.810101-60.752236 62.714-115.373446 109.685763-162.346233 46.972787-46.971763 101.593997-83.875662 162.346233-109.685763 62.969971-26.751052 129.710912-40.315485 198.369591-40.315485s135.398595 13.564433 198.368567 40.315485c60.752236 25.810101 115.373446 62.714 162.346233 109.685763 46.971763 46.972787 83.875662 101.593997 109.685763 162.346233 26.752076 62.969971 40.316509 129.710912 40.316509 198.369591s-13.564433 135.398595-40.316509 198.368567c-25.809077 60.75326-62.712976 115.37447-109.685763 162.346233-46.971763 46.972787-101.592974 83.876686-162.346233 109.685763C647.666853 1009.27141 580.925912 1022.835842 512.268258 1022.835842zM512.268258 50.548195c-62.018782 0-122.293887 12.247716-179.152287 36.403219-54.923257 23.333323-104.317532 56.709936-146.810821 99.204249s-75.870926 91.888588-99.204249 146.810821c-24.155503 56.8584-36.403219 117.133505-36.403219 179.152287 0 62.017758 12.247716 122.292863 36.403219 179.152287 23.333323 54.923257 56.709936 104.317532 99.204249 146.811845 42.493289 42.493289 91.888588 75.870926 146.810821 99.204249 56.8584 24.155503 117.133505 36.403219 179.152287 36.403219 62.017758 0 122.292863-12.247716 179.152287-36.403219 54.923257-23.333323 104.317532-56.71096 146.811845-99.204249 42.493289-42.494313 75.870926-91.888588 99.204249-146.811845 24.155503-56.8584 36.403219-117.133505 36.403219-179.152287s-12.247716-122.293887-36.403219-179.152287c-23.334347-54.923257-56.71096-104.317532-99.205273-146.810821-42.493289-42.493289-91.887565-75.870926-146.810821-99.204249C634.561121 62.795911 574.286016 50.548195 512.268258 50.548195z",fill:"currentColor"}),_t("path",{d:"M655.434047 694.244421 367.12637 694.244421c-21.046987 0-38.170445-17.123458-38.170445-38.170445L328.955925 367.766298c0-21.046987 17.123458-38.170445 38.170445-38.170445l288.307678 0c21.048011 0 38.170445 17.123458 38.170445 38.170445l0 288.307678C693.604492 677.120962 676.482058 694.244421 655.434047 694.244421zM380.150191 643.050154l262.260035 0L642.410226 380.79012 380.150191 380.79012 380.150191 643.050154z",fill:"currentColor"})]})},Vt=function(e){return _t("svg",{xmlns:"http://www.w3.org/2000/svg",className:e.className,viewBox:"0 0 512 512",children:_t("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})})},Wt=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:[_t("path",{d:"M394.688 126.208a32 32 0 0 1 32-32h170.688a32 32 0 0 1 32 32v138.624h288a32 32 0 0 1 32 32v170.688a32 32 0 0 1-32 32H106.688a32 32 0 0 1-32-32V296.832a32 32 0 0 1 32-32h288V126.208z m64 32v138.624a32 32 0 0 1-32 32h-288v106.688h746.688V328.832h-288a32 32 0 0 1-32-32V158.208H458.688z"}),_t("path",{d:"M138.688 469.376a32 32 0 0 1 32-32h682.688a32 32 0 0 1 32 32v384a32 32 0 0 1-32 32H170.688a32 32 0 0 1-32-32v-384z m64 32v320h618.688v-320H202.688z"}),_t("path",{d:"M341.376 691.52a32 32 0 0 1 32 32V851.2a32 32 0 1 1-64 0v-127.68a32 32 0 0 1 32-32zM512 691.2a32 32 0 0 1 32 32v128a32 32 0 0 1-64 0v-128a32 32 0 0 1 32-32zM682.688 691.52a32 32 0 0 1 32 32V851.2a32 32 0 1 1-64 0v-127.68a32 32 0 0 1 32-32z"})]})},Ut=function(){return _t("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",children:_t("path",{d:"M843.251 424.407l43.828-74.898c10.194-17.946 32.596-22.158 48.956-11.598 16.298 10.499 23.44 32.658 14.223 49.566l-113.11 195.212-61.164-40.044-126.418-82.285c-16.115-11.598-20.632-34.428-10.194-51.702 9.705-17.397 31.009-23.501 47.857-13.734l89.67 59.028C748.576 295.547 615.81 180.667 461.008 180.667c-177.387 0-320.042 148.758-320.042 331.335 0 183.613 143.692 331.334 319.981 331.334 107.861 0.184 208.58-56.158 268.034-149.858 1.099-1.038 1.099-2.075 2.075-2.075 6.348-9.949 17.092-15.871 28.568-15.81 19.35 0 35.648 16.848 35.648 36.93 0 7.508-2.137 14.833-6.104 21.059-72.823 114.698-196.066 183.675-328.099 183.614-216.088 0-391.4-181.478-391.4-405.195 0-223.718 175.312-405.195 391.339-405.195 183.125-0.427 342.016 131.606 382.243 317.601z"})})},qt=function(){return _t("svg",{version:"1.1",className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M627.498667 55.168l170.666666 170.666667a42.624 42.624 0 0 1 0 60.330666l-469.333333 469.333334A42.538667 42.538667 0 0 1 298.666667 768H128a42.666667 42.666667 0 0 1-42.666667-42.666667v-170.666666c0-11.306667 4.48-22.186667 12.501334-30.165334l469.333333-469.333333a42.624 42.624 0 0 1 60.330667 0zM896 896a42.666667 42.666667 0 0 1 0 85.333333H128a42.666667 42.666667 0 0 1 0-85.333333h768zM597.333333 145.664l-426.666666 426.666667V682.666667h110.336l426.666666-426.666667L597.333333 145.664z"})})},Yt=function(e){return _t("svg",{xmlns:"http://www.w3.org/2000/svg",className:e.className,viewBox:"0 0 512 512",children:_t("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M184 112l144 144-144 144"})})},$t=function(){return _t("svg",{className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:_t("path",{d:"M896 870.4l-128-128c55.467-68.267 89.6-149.333 89.6-238.933 0-98.134-38.4-192-110.933-264.534-149.334-149.333-384-149.333-533.334-4.266-145.066 145.066-145.066 384 0 529.066 72.534 72.534 166.4 110.934 264.534 110.934 89.6 0 174.933-29.867 238.933-89.6l128 128c4.267 4.266 12.8 8.533 21.333 8.533s17.067-4.267 21.334-8.533c17.066-8.534 17.066-29.867 8.533-42.667zM260.267 721.067c-119.467-123.734-119.467-320 0-439.467 59.733-59.733 140.8-89.6 217.6-89.6 81.066 0 157.866 29.867 217.6 89.6 59.733 59.733 89.6 136.533 89.6 217.6 0 81.067-34.134 162.133-89.6 217.6-55.467 59.733-132.267 93.867-217.6 93.867-81.067 0-157.867-34.134-217.6-89.6z"})})},Xt=function(e){var t=e.items,n=ft([]),i=new ee("chat-thought-chain"),r=ft([]);Ae((function(){r.value=t.filter((function(e){return e.description})),r.value.length>0&&r.value.forEach((function(e,t){e.done&&(n.value=[].concat(o(n.value),[t]))}))}),[t]);return 0===r.value.length?null:_t("div",{className:"".concat(i.b()," ").concat(i.is("single",1===r.value.length)),children:r.value.map((function(e,t){if(e.description){var r=n.value.includes(t);return _t("div",{className:"".concat(i.e("item")," ").concat(i.is("collapsed",r)),children:[_t("div",{className:i.e("item-icon"),children:e.icon||_t("span",{children:t})}),_t("div",{className:i.e("item-content"),children:[_t("div",{className:i.e("item-title"),onClick:function(){return function(e){n.value.includes(e)?n.value=n.value.filter((function(t){return t!==e})):n.value=[].concat(o(n.value),[e])}(t)},children:[e.title,_t(Dt,{className:i.e("icon")})]}),_t("div",{className:i.e("item-description"),children:e.description})]})]},t)}}))})},Zt=function(e){var t=e.items,n=e.onItemClick,i=new ee("chat-suggestions");return _t("div",{className:"".concat(i.b()),children:t.map((function(e,t){return _t("div",{className:"".concat(i.e("item")," ").concat(i.is("action","action"===e.type)),onClick:function(t){return function(e,t){null==n||n(e,t)}(e,t)},title:e.metadata.content_name,children:[e.metadata.content_name,_t(Yt,{className:"".concat(i.e("item-icon"))})]},t)}))})},Gt=new ee("markdown-message"),Jt=function(e){var t=e.message,n=e.size,i=ft(oe()),r=ft(null),o=Oe((function(){return 20===t.state&&!0!==t.completed}),[t.state,t.completed]),a=Oe((function(){return 20===t.state&&!0===t.completed}),[t.state,t.completed]),c=ft({title:"",description:"",icon:_t(Pt,{})}),l=ft({hasSuggestions:!1,suggestions:[]}),u=function(e){e&&e.length>0?l.value={hasSuggestions:!0,suggestions:e}:l.value={hasSuggestions:!1,suggestions:[]}},d=function(e){var t=e.indexOf("<think>"),n=e.indexOf("</think>"),i="",r="",o=!1;return-1===n?(o=!1,i=e.slice(t+7),r=""):(o=!0,i=e.slice(t+7,n),r=e.slice(n+8)),{isThoughtCompleted:o,thoughtContent:i,answerContent:r}};return Ae((function(){if(n>=0&&r.value){if(-1!==t.content.indexOf("<think>")){var e=d(t.content),i=e.isThoughtCompleted,o=e.thoughtContent,a=e.answerContent;i?(c.value.icon=_t(zt,{}),c.value.title="思考完成"):!0===t.completed?(c.value.icon=_t(zt,{}),c.value.title="思考已停止"):(c.value.icon=_t(Pt,{}),c.value.title="思考中..."),c.value.description=o||"",r.value.setMarkdown(a||"")}else r.value.setMarkdown(t.content||"");u(t.suggestions)}}),[t,n]),Ae((function(){var e="";if(-1!==t.content.indexOf("<think>")){var n=d(t.content),o=n.isThoughtCompleted,a=n.thoughtContent,l=n.answerContent;c.value={title:o?"思考完成":!0===t.completed?"思考已停止":"思考中...",description:a||"",icon:o||!0===t.completed?_t(zt,{}):_t(Pt,{})},l&&(e=l)}else e=t.content;u(t.suggestions),r.value=new s({id:i,value:e||"",editor:{defaultModel:"previewOnly"},themeSettings:{mainTheme:"dark",codeBlockTheme:"dark"},previewer:{enablePreviewerBubble:!1}})}),[]),_t("div",{className:"".concat(Gt.b()," ").concat(Gt.is("loading",o)),children:[_t("div",{className:Gt.b("header"),children:[_t("div",{className:Gt.be("header","caption"),children:"AI "}),e.children,a?_t("div",{className:Gt.be("header","timeout"),children:"请求超时"}):null]}),_t("div",{className:"".concat(Gt.b("content")," pre-wrap-container"),children:[_t(Xt,{items:[c.value]}),_t("div",{id:i})]}),_t("div",{className:Gt.b("footer"),children:l.value.hasSuggestions?_t(Zt,{items:l.value.suggestions,onItemClick:function(t,n){!function(t,n){e.controller.handleSuggestionClick(e.message,t,n)}(t,n)}}):null})]})},Kt=new ee("ossfile-material"),Qt=function(e){var t=vt((function(){return e.material.data.name})),n=vt((function(){return e.material.metadata.size})),i=vt((function(){var t=e.material.metadata.state;return"successed"===t?"上传成功":"uploading"===t?"上传中":"failed"===t?"上传失败":"未知状态"})),r=vt((function(){switch(e.material.metadata.state){case"successed":return"#1890ff";case"uploading":return"#52c41a";default:return"#ff4d4f"}}));return _t("div",{className:Kt.b(),children:[_t("div",{className:Kt.b("left"),children:_t(Ht,{})}),_t("div",{className:Kt.b("right"),children:[_t("div",{className:Kt.e("name"),title:t,children:t}),_t("div",{className:Kt.e("metadata"),children:[_t("div",{children:[n,"B"]}),_t("div",{style:{color:r.value},children:i})]})]})]})},en=new ee("common-material"),tn=function(e){var t,n,i,r,o=null===(t=e.controller.opts.questionToolbarItems)||void 0===t?void 0:t.find((function(t){return t.id===e.material.metadata.actionId})),a=vt((function(){return e.material.metadata.name}));return _t("div",{className:en.b(),children:[_t("div",{className:en.b("left"),children:o&&o.icon?"function"==typeof o.icon?o.icon():(null===(n=o.icon)||void 0===n?void 0:n.showIcon)&&_t(L,{children:null!==(i=o.icon)&&void 0!==i&&i.cssClass?_t("i",{className:o.icon.cssClass}):null!==(r=o.icon)&&void 0!==r&&r.imagePath?ce(o.icon.imagePath)?_t("div",{dangerouslySetInnerHTML:{__html:o.icon.imagePath}}):_t("img",{src:o.icon.imagePath}):null}):_t(Ft,{})}),_t("div",{className:en.b("right"),children:[_t("div",{className:en.e("name"),title:a,children:a}),_t("div",{className:en.e("metadata"),children:_t("div",{children:(null==o?void 0:o.label)||"素材资源"})})]})]})},nn=new ee("chat-input-material-item"),rn=function(e){var t=e.material,n=null;if("ossfile"===t.type)n=Qt;else n=tn;return _t("div",{className:"".concat(nn.b()," ").concat(nn.is("disabled",e.disabled)),children:[_t("div",{className:nn.e("icon"),onClick:function(){e.controller.deleteMaterial(t)},children:_t(jt,{})}),M(n,{material:t,controller:e.controller})]})},on=new ee("user-message-question"),an=function(e){var t=ft(oe()),n=ft(null),i=vt((function(){return e.message.content})),r=vt((function(){return de.parseMixedContent(i.value)}));return Ae((function(){n.value=new s({id:t,value:r.value.remainingText||"",editor:{defaultModel:"previewOnly"},themeSettings:{mainTheme:"dark",codeBlockTheme:"dark"},previewer:{enablePreviewerBubble:!1}})}),[r.value.remainingText]),_t("div",{className:on.b(),children:[_t("div",{className:on.e("user-header"),children:[e.children,_t("div",{className:on.e("user"),children:"我"})]}),_t("div",{className:on.e("content"),children:_t("div",{className:on.em("content","body"),children:[r.value.hasResources&&_t("div",{className:on.em("content","material"),children:r.value.resources.map((function(t){return _t(rn,{material:t,disabled:!0,controller:e.controller},t.id)}))}),_t("div",{className:"pre-wrap-container",children:_t("div",{id:t})})]})})]})},cn=new ee("error-message"),sn=function(e){var t=vt((function(){return e.message.content}));return _t("div",{className:cn.b(),children:[_t("div",{className:cn.b("header"),children:[_t("div",{className:cn.be("header","caption"),children:"AI "}),e.children]}),_t("div",{className:"".concat(cn.e("content")," pre-wrap-container"),children:_t("span",{children:t})})]})},ln=new ee("unknown-message"),un=function(e){return _t("div",{className:ln.b(),children:_t("div",{className:"".concat(ln.e("content")," pre-wrap-container"),children:["暂未支持的消息类型: ",e.message.type]})})},dn=new ee("chat-message-item"),hn=function(e){var t=e.message,n=e.size,i=null;switch(t.type){case"DEFAULT":i="ASSISTANT"===t.role?Jt:an;break;case"ERROR":i=sn;break;default:i=un}return _t("div",{className:dn.b(),children:M(i,{size:n,message:t,controller:e.controller,children:e.children})})},pn=function(){function e(t){v(this,e),this.msg=t}return _(e,[{key:"messageid",get:function(){return this.msg.messageid}},{key:"state",get:function(){return this.msg.state}},{key:"role",get:function(){return this.msg.role}},{key:"type",get:function(){return this.msg.type}},{key:"realcontent",get:function(){var e=this.msg.content;if(-1!==e.indexOf("<think>")&&-1===e.indexOf("</think>"))return"";if(-1!==(e=e.replace(/<think>[^]*?<\/think>/g,"").trim()).indexOf("<resources>")&&-1===e.indexOf("</resources>"))return"";var t=(e=e.replace(/<resources>[^]*?<\/resources>/g,"").trim()).indexOf("<suggestions>");return-1!==t&&(e=e.substring(0,t).trim()),e}},{key:"content",get:function(){return this.msg.content}},{key:"completed",get:function(){return this.msg.completed}},{key:"suggestions",get:function(){return this.msg.suggestions}},{key:"_origin",get:function(){return this.msg}},{key:"update",value:function(e){e.content||(e.content=""),-1!==e.content.indexOf("<think>")&&this.msg.content&&(this.msg.content=""),this.msg.content+=e.content}},{key:"updateCompleted",value:function(e){this.msg.completed=e}}]),e}(),fn=function(){function e(t){v(this,e),this.data=t}return _(e,[{key:"appid",get:function(){return this.data.appid}},{key:"id",get:function(){return this.data.id}},{key:"type",get:function(){return this.data.type}},{key:"caption",get:function(){return this.data.caption}},{key:"sourceCaption",get:function(){return this.data.sourceCaption||this.caption}},{key:"url",get:function(){return this.data.url}},{key:"aiChat",get:function(){return this.data.aiChat}}]),e}(),vn=function(){function e(t){v(this,e),this.material=t}return _(e,[{key:"id",get:function(){return this.material.id}},{key:"type",get:function(){return this.material.type}},{key:"metadata",get:function(){return this.material.metadata}},{key:"data",get:function(){return this.material.data}}]),e}(),mn=new ee("chat-toolbar-item"),_n=function(e){var t,n,i,r=e.model,o=e.data,c=e.className,s=e.disabled,l=void 0!==s&&s,u=e.buttonType,d=void 0===u?"default":u,h=e.onClick,p=a(Se(!1),2),f=p[0],v=p[1],m=Me(null),_=function(e){return"function"==typeof e.hidden?e.hidden(o):!0===e.hidden};if(_(r))return _t(L,{});var g=function(e){return!!l||("function"==typeof e.disabled?e.disabled(o):!0===e.disabled)},y=function(e){var t,n,i,r;return"function"==typeof e.icon?e.icon():null!==(t=e.icon)&&void 0!==t&&t.showIcon&&null!==(n=e.icon)&&void 0!==n&&n.cssClass?_t("i",{className:e.icon.cssClass}):null!==(i=e.icon)&&void 0!==i&&i.showIcon&&null!==(r=e.icon)&&void 0!==r&&r.imagePath?ce(e.icon.imagePath)?_t("div",{dangerouslySetInnerHTML:{__html:e.icon.imagePath}}):_t("img",{src:e.icon.imagePath}):void 0},w=function(e,t){g(t)||(v(!1),h(e,t))};return Ae((function(){var e=function(e){m.current&&m.current.contains(e.target)||v(!1)};return f&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[f]),_t("div",{className:"".concat(mn.b()," ").concat(mn.b(d)," ").concat(r.customClass||""," ").concat(c||""," ").concat(mn.is("disabled",g(r))," ").concat(mn.is("more",!(null===(t=r.children)||void 0===t||!t.length))),children:[_t("div",{title:r.title,className:mn.e("content"),onClick:function(e){return w(e,r)},children:[_t("div",{className:mn.em("content","icon"),children:y(r)}),_t("div",{className:mn.em("content","label"),children:r.label})]}),(null===(n=r.children)||void 0===n?void 0:n.length)&&_t("div",{title:"更多",className:mn.e("more"),onClick:function(e){g(r)||v(!0)},children:_t("i",{"aria-hidden":"true",className:"fa fa-angle-down ".concat(mn.em("more","icon"))})}),f&&_t("div",{ref:m,className:mn.b("dropdown"),children:null===(i=r.children)||void 0===i?void 0:i.map((function(e,t){if(!_(e))return _t("div",{title:e.title,onClick:function(t){return w(t,e)},className:"".concat(mn.be("dropdown","item")," ").concat(e.customClass||""," ").concat(mn.is("disabled",g(e))),children:[_t("div",{className:mn.bem("dropdown","item","icon"),children:y(e)}),_t("div",{className:mn.bem("dropdown","item","label"),children:e.label})]},t)}))})]})},gn=new ee("chat-toolbar"),yn=function(e){var t=e.controller,n=e.items,i=void 0===n?[]:n,r=e.data,a=e.type,c=e.className,s=e.mode,l=Ie(Ci),d=[],h=[{label:"重置对话",title:"重置对话",icon:function(){return _t(Ut,{})},onClick:function(){t.resetTopic()},children:[{label:"清空对话",title:"清空对话",icon:function(){return _t(Wt,{})},onClick:function(){t.clearTopic()}},{label:"新建对话",title:"新建对话",hidden:"TOPIC"!==s,icon:function(){return _t(St,{})},onClick:function(){l.newTopic&&l.newTopic()}}]}],p=[{label:"刷新",title:"刷新",icon:function(){return _t(xt,{})},onClick:function(){t.refreshMessage(r)}},{label:"删除",title:"删除",icon:function(){return _t(bt,{})},onClick:function(){t.deleteMessage(r)}},{label:"复制",title:"复制",icon:function(){return _t(kt,{})},onClick:function(){t.copyMessage(r)}}];l.enableBackFill&&p.unshift.apply(p,[{label:"回填",title:"回填",icon:function(){return _t(yt,{})},onClick:function(){t.backfill(r)}}]);var f=[{label:"刷新",title:"刷新",icon:function(){return _t(xt,{})},onClick:function(){t.refreshMessage(r,!0)}}];if("content"===a)switch(r.type){case"DEFAULT":d="ASSISTANT"===r.role?[].concat(p,o(i)):[].concat(f);break;case"ERROR":d=[].concat(p,o(i))}else d=[].concat(h,o(i));var v=function(n,i){var o=u({},r);if(r instanceof pn?(Object.assign(o,{topic:t.topic}),o.msg.realcontent=r.realcontent):(o.data||(o.data={}),Object.assign(o.data,{messages:t.messages.value})),i.onClick&&"function"==typeof i.onClick)i.onClick(n,i,t.context,t.params,o);else{var a=e.controller.opts.extendToolbarClick;a&&"function"==typeof a&&a(n,i,t.context,t.params,o)}},m=Oe((function(){return"content"===a&&20===(null==r?void 0:r.state)&&!0!==(null==r?void 0:r.completed)}),[null==r?void 0:r.state,null==r?void 0:r.completed]);return _t("div",{className:"".concat(gn.b()," ").concat(c||""),children:d.map((function(e,t){return _t(_n,{data:r,model:e,disabled:m,buttonType:"content"===a?"circle":"default",onClick:v.bind(void 0)},t)}))})};var wn=function(e){var t,n,i,r=ft(!1),o=ft({}),a=new ee("chat-back-bottom"),c=ft(null),s=function(){if(c.value){var t=e.visibilityHeight||200,n=c.value.scrollHeight-c.value.scrollTop-c.value.offsetHeight;r.value=n>=t}},l=(t=s,n=300,i=null,function(){for(var e=this,r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];i||(i=setTimeout((function(){t.apply(e,o),i=null}),n))});return Oe((function(){o.value={right:"".concat(e.right,"px"),bottom:"".concat(e.bottom,"px")}}),[e.right,e.bottom]),Ae((function(){if(e.target){var t,n=null!==(t=document.querySelector(e.target))&&void 0!==t?t:void 0;n&&(c.value=n,n.addEventListener("scroll",l),s())}}),[]),_t("div",{className:"".concat(a.b()," ").concat(a.is("visible",r.value)),style:o.value,onClick:function(){var t;c.value&&(c.value.scrollTo({top:c.value.scrollHeight,behavior:"smooth"}),null===(t=e.onClick)||void 0===t||t.call(e))},children:_t(Vt,{className:a.e("icon")})})},bn=new ee("chat-messages"),xn=function(e){var t=Me(null),n=a(Se(!0),2),i=n[0],r=n[1],o=Me(!1),c=e.controller.messages;Ae((function(){var e;i&&((e=t.current)&&(o.current=!0,e.scrollTo({top:e.scrollHeight,behavior:"auto"}),setTimeout((function(){o.current=!1}),500)))}),[c.value]);return _t("div",{ref:t,className:bn.b(),onScroll:function(){if(!o.current&&t.current){var e=t.current,n=e.scrollTop,i=e.scrollHeight,a=e.clientHeight;r(i-(n+a)<50)}},children:[c.value.map((function(t){var n,i=(null===(n=t.content)||void 0===n?void 0:n.length)||0;return"SYSTEM"!==t.role?_t(hn,{size:i,message:t,controller:e.controller,children:_t(yn,{data:t,type:"content",items:e.toolbarItems,controller:e.controller})},t.messageid):null})),_t(wn,{right:20,bottom:14,target:".".concat(bn.b()),onClick:function(){o.current=!0,r(!0)}})]})};function kn(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var i in t)if("__source"!==i&&e[i]!==t[i])return!0;return!1}function Cn(e){this.props=e}(Cn.prototype=new I).isPureReactComponent=!0,Cn.prototype.shouldComponentUpdate=function(e,t){return kn(this.props,e)||kn(this.state,t)};var Tn=l.__b;l.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Tn&&Tn(e)};var Nn=l.__e;l.__e=function(e,t,n,i){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);Nn(e,t,n,i)};var En=l.unmount;function Sn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Sn(e,t,n)}))),e}function An(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return An(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Mn(){this.__u=0,this.t=null,this.__b=null}function On(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ln(){this.u=null,this.o=null}l.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),En&&En(e)},(Mn.prototype=new I).__c=function(e,t){var n=t.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var r=On(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,r?r(c):c())};n.__R=a;var c=function(){if(! --i.__u){if(i.state.__a){var e=i.state.__a;i.__v.__k[0]=An(e,e.__c.__P,e.__c.__O)}var t;for(i.setState({__a:i.__b=null});t=i.t.pop();)t.forceUpdate()}},s=!0===t.__h;i.__u++||s||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(a,a)},Mn.prototype.componentWillUnmount=function(){this.t=[]},Mn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=Sn(this.__b,n,i.__O=i.__P)}this.__b=null}var r=t.__a&&M(L,null,e.fallback);return r&&(r.__h=null),[M(L,null,t.__a?null:e.children),r]};var In=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Dn(e){return this.getChildContext=function(){return e.context},e.children}function zn(e){var t=this,n=e.i;t.componentWillUnmount=function(){K(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),K(M(Dn,{context:t.context},e.__v),t.l)}function Pn(e,t){var n=M(zn,{__v:e,i:t});return n.containerInfo=t,n}(Ln.prototype=new I).__a=function(e){var t=this,n=On(t.__v),i=t.o.get(e);return i[0]++,function(r){var o=function(){t.props.revealOrder?(i.push(r),In(t,e,i)):r()};n?n(o):o()}},Ln.prototype.render=function(e){this.u=null,this.o=new Map;var t=F(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Ln.prototype.componentDidUpdate=Ln.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){In(e,n,t)}))};var Bn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Hn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,jn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Fn=/[A-Z0-9]/g,Rn="undefined"!=typeof document,Vn=function(e){return("undefined"!=typeof Symbol&&"symbol"==f(Symbol())?/fil|che|rad/:/fil|che|ra/).test(e)};I.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(I.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Wn=l.event;function Un(){}function qn(){return this.cancelBubble}function Yn(){return this.defaultPrevented}l.event=function(e){return Wn&&(e=Wn(e)),e.persist=Un,e.isPropagationStopped=qn,e.isDefaultPrevented=Yn,e.nativeEvent=e};var $n={enumerable:!1,configurable:!0,get:function(){return this.class}},Xn=l.vnode;l.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,i={};for(var r in t){var o=t[r];if(!("value"===r&&"defaultValue"in t&&null==o||Rn&&"children"===r&&"noscript"===n||"class"===r||"className"===r)){var a=r.toLowerCase();"defaultValue"===r&&"value"in t&&null==t.value?r="value":"download"===r&&!0===o?o="":"ondoubleclick"===a?r="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Vn(t.type)?"onfocus"===a?r="onfocusin":"onblur"===a?r="onfocusout":jn.test(r)?r=a:-1===n.indexOf("-")&&Hn.test(r)?r=r.replace(Fn,"-$&").toLowerCase():null===o&&(o=void 0):a=r="oninput","oninput"===a&&i[r=a]&&(r="oninputCapture"),i[r]=o}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=F(t.children).forEach((function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=F(t.children).forEach((function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",$n)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=Bn,Xn&&Xn(e)};var Zn=l.__r;l.__r=function(e){Zn&&Zn(e),e.__c};var Gn=l.diffed;l.diffed=function(e){Gn&&Gn(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};var Jn=new Map;function Kn(e){var t=Jn.get(e);t&&t.destroy()}function Qn(e){var t=Jn.get(e);t&&t.update()}var ei=null;"undefined"==typeof window?((ei=function(e){return e}).destroy=function(e){return e},ei.update=function(e){return e}):((ei=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!Jn.has(e)){var t,n=null,i=window.getComputedStyle(e),r=(t=e.value,function(){a({testForHeightReduction:""===t||!e.value.startsWith(t),restoreTextAlign:null}),t=e.value}),o=function(t){e.removeEventListener("autosize:destroy",o),e.removeEventListener("autosize:update",c),e.removeEventListener("input",r),window.removeEventListener("resize",c),Object.keys(t).forEach((function(n){return e.style[n]=t[n]})),Jn.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,textAlign:e.style.textAlign,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",o),e.addEventListener("autosize:update",c),e.addEventListener("input",r),window.addEventListener("resize",c),e.style.overflowX="hidden",e.style.wordWrap="break-word",Jn.set(e,{destroy:o,update:c}),c()}function a(t){var r,o,c=t.restoreTextAlign,s=void 0===c?null:c,l=t.testForHeightReduction,u=void 0===l||l,d=i.overflowY;if(0!==e.scrollHeight&&("vertical"===i.resize?e.style.resize="none":"both"===i.resize&&(e.style.resize="horizontal"),u&&(r=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach((function(e){var t=e[0],n=e[1];t.style.scrollBehavior="auto",t.scrollTop=n,t.style.scrollBehavior=null}))}}(e),e.style.height=""),o="content-box"===i.boxSizing?e.scrollHeight-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)):e.scrollHeight+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),"none"!==i.maxHeight&&o>parseFloat(i.maxHeight)?("hidden"===i.overflowY&&(e.style.overflow="scroll"),o=parseFloat(i.maxHeight)):"hidden"!==i.overflowY&&(e.style.overflow="hidden"),e.style.height=o+"px",s&&(e.style.textAlign=s),r&&r(),n!==o&&(e.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=o),d!==i.overflow&&!s)){var h=i.textAlign;"hidden"===i.overflow&&(e.style.textAlign="start"===h?"end":"start"),a({restoreTextAlign:h,testForHeightReduction:!0})}}function c(){a({testForHeightReduction:!0,restoreTextAlign:null})}}(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Kn),e},ei.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Qn),e});var ti=ei,ni=function(e){return e.STYLE_CACHE="ai-chat-style-cache",e.MINIMIZE_STYLY_CHCHE="ai-chat-minimize-style-cache",e.DATA_BASE_NAME="ibiz-chat",e.DATA_TABLE_NAME="history-message",e.DATA_TABLE_KEY_NAME="id",e}(ni||{}),ii=function(){function e(t){v(this,e),g(this,"messages",Qe([])),g(this,"materials",Qe([])),g(this,"input",Qe("")),g(this,"isLoading",Qe(!1)),g(this,"context",void 0),g(this,"params",void 0),g(this,"appDataEntityId",void 0),g(this,"topicId",void 0),g(this,"topic",void 0),this.opts=t,this.context=t.context,this.params=t.params,this.appDataEntityId=t.appDataEntityId,this.topicId=t.topicId,this.topic=t.topic,this.fecthHistory()}var t,n,i,r,a,c,s,l,h,f;return _(e,[{key:"fecthHistory",value:(f=p(d().mark((function e(){var t,n=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.topicId){e.next=7;break}return e.next=3,le.getData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,this.topicId);case 3:if(!((t=e.sent)&&t.data&&t.data.length>0)){e.next=7;break}return t.data.forEach((function(e){var t={messageid:e.messageid,state:e.state,type:e.type,role:e.role,content:e.content,suggestions:e.suggestions,completed:!0};n.addMessage(t)})),e.abrupt("return",!0);case 7:return e.next=9,this.opts.history(this.context,this.params,{appDataEntityId:this.appDataEntityId,appendCurData:this.opts.appendCurData});case 9:return e.sent&&this.opts.appendCurContent&&this.addMessage({state:30,messageid:oe(),role:"USER",type:"DEFAULT",content:this.opts.appendCurContent,completed:!0}),e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"asyncToIndexDB",value:(h=p(d().mark((function e(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.topicId){e.next=2;break}return e.abrupt("return");case 2:return t={id:this.topicId,data:this.messages.value.map((function(e){return e._origin})),timestamp:(new Date).getTime()},e.next=5,le.updateData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,t);case 5:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"setInput",value:function(e){this.input.value=e||""}},{key:"addMessage",value:function(e){var t=this.messages.value.find((function(t){return t.messageid===e.messageid}));t?(t.update(e),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new pn(e)]),this.asyncToIndexDB()}},{key:"completeMessage",value:(l=p(d().mark((function e(t,n){var i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=this.messages.value.find((function(e){return e.messageid===t})))){e.next=6;break}return i.updateCompleted(n),this.messages.value=o(this.messages.value),e.next=6,this.asyncToIndexDB();case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"replaceMessage",value:function(e){var t=this,n=this.messages.value.findIndex((function(t){return t.messageid===e.messageid}));-1!==n?(this.messages.value[n]=new pn(e),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new pn(e)]),this.asyncToIndexDB(),"DEFAULT"===e.type&&this.opts.recommendPrompt&&this.opts.recommendPrompt(this.context,this.params,{appDataEntityId:this.appDataEntityId,message:{messages:[e]}}).then((function(n){n&&n.content&&t.updateRecommendPrompt(e,n.content)}))}},{key:"stopMessage",value:(s=p(d().mark((function e(t){var n,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return-1!==(n=this.messages.value.findIndex((function(e){return e.messageid===t.messageid})))?(i=this.messages.value[n],t.content=i.content,this.messages.value[n]=new pn(t),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new pn(t)]),e.next=4,this.asyncToIndexDB();case 4:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"stringlyMaterialResource",value:function(){var e="",t=[];return this.materials.value&&this.materials.value.length>0&&(this.materials.value.forEach((function(e){if("ossfile"===e.type){var n=e.metadata;n.state&&"successed"===n.state&&t.push(e)}else t.push(e)})),this.materials.value=[]),t&&t.length>0&&(e=de.stringify(t)),e}},{key:"question",value:(c=p(d().mark((function e(t){var n,i=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.isLoading.value=!0,this.messages.value.forEach((function(e,t){var n=e._origin;n.suggestions&&(n.suggestions=void 0,i.messages.value[t]=new pn(n))})),this.messages.value=o(this.messages.value),this.asyncToIndexDB(),(n=this.stringlyMaterialResource())?n+="\n".concat(t):n=t,this.addMessage({state:30,messageid:oe(),role:"USER",type:"DEFAULT",content:n}),e.next=10,this.opts.question(this,this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(e){return"ERROR"!==e.type})).map((function(e){return e._origin})));case 10:this.opts.action&&this.opts.action("question",t),this.isLoading.value=!1;case 12:return e.prev=12,this.isLoading.value=!1,e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[0,,12,15]])}))),function(e){return c.apply(this,arguments)})},{key:"abortQuestion",value:(a=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.opts.abortQuestion(this);case 3:return e.prev=3,this.isLoading.value=!1,e.finish(3);case 6:case"end":return e.stop()}}),e,this,[[0,,3,6]])}))),function(){return a.apply(this,arguments)})},{key:"backfill",value:function(e){this.opts.action&&this.opts.action("backfill",e)}},{key:"deleteMessage",value:function(e){var t=this.messages.value.findIndex((function(t){return t.messageid===e.messageid}));-1!==t&&(this.messages.value.splice(t,1),this.messages.value=o(this.messages.value)),this.asyncToIndexDB(),this.opts.action&&this.opts.action("deletemsg",e)}},{key:"refreshMessage",value:(r=p(d().mark((function e(t){var n,i,r,a=arguments;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],this.isLoading.value=!0,e.prev=2,i=this.messages.value.findIndex((function(e){return e.messageid===t.messageid})),!n){e.next=11;break}return this.messages.value.splice(i+1,this.messages.value.length-i-1),this.messages.value=o(this.messages.value),e.next=9,this.opts.question(this,this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(e){return"ERROR"!==e.type})).map((function(e){return e._origin})));case 9:e.next=21;break;case 11:if(i!==this.messages.value.length-1){e.next=18;break}return this.messages.value.pop(),this.messages.value=o(this.messages.value),e.next=16,this.opts.question(this,this.context,this.params,{appDataEntityId:this.appDataEntityId},this.messages.value.filter((function(e){return"ERROR"!==e.type})).map((function(e){return e._origin})));case 16:e.next=21;break;case 18:r=this.messages.value[i-1].content,this.messages.value.splice(i-1,2),this.question(r);case 21:this.asyncToIndexDB(),this.opts.action&&this.opts.action("refreshmsg",t);case 23:return e.prev=23,this.isLoading.value=!1,e.finish(23);case 26:case"end":return e.stop()}}),e,this,[[2,,23,26]])}))),function(e){return r.apply(this,arguments)})},{key:"copyMessage",value:function(e){var t=e.realcontent;se.copy(t),this.opts.action&&this.opts.action("copymsg",e)}},{key:"resetTopic",value:(i=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.abortQuestion();case 2:if(!this.topicId){e.next=5;break}return e.next=5,le.deleteData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,this.topicId);case 5:this.messages.value=[],this.opts.history(this.context,this.params,{appDataEntityId:this.appDataEntityId});case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"clearTopic",value:(n=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.abortQuestion();case 2:if(!this.topicId){e.next=5;break}return e.next=5,le.deleteData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,this.topicId);case 5:this.messages.value=[];case 6:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"addMaterial",value:function(e){var t=this.materials.value.find((function(t){return t.id===e.id}));this.materials.value=t?o(this.materials.value):[].concat(o(this.materials.value),[new vn(e)])}},{key:"replaceMaterial",value:function(e,t){var n=this.materials.value.findIndex((function(t){return t.id===e}));-1!==n?(this.materials.value[n]=new vn(t),this.materials.value=o(this.materials.value)):this.materials.value=[].concat(o(this.materials.value),[new vn(t)])}},{key:"deleteMaterial",value:function(e){var t=this.materials.value.findIndex((function(t){return t.id===e.id}));-1!==t&&(this.materials.value.splice(t,1),this.materials.value=o(this.materials.value))}},{key:"updateRecommendPrompt",value:function(e,t){if(t){var n=this.messages.value.findIndex((function(t){return t.messageid===e.messageid})),i=he.parseMixedContent(t).suggestions;i&&i.length>0&&(e.suggestions=i,-1!==n?(this.messages.value[n]=new pn(e),this.messages.value=o(this.messages.value)):this.messages.value=[].concat(o(this.messages.value),[new pn(e)]),this.asyncToIndexDB())}}},{key:"handleSuggestionClick",value:(t=p(d().mark((function e(t,n,i){var r,a,c,s,l;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:-1!==(r=this.messages.value.findIndex((function(e){return e.messageid===t.messageid})))&&((a=this.messages.value[r]._origin).suggestions=void 0,this.messages.value[r]=new pn(a),this.messages.value=o(this.messages.value)),this.asyncToIndexDB(),c=n.type,e.t0=c,e.next="action"===e.t0?7:"raw"===e.t0?17:20;break;case 7:if(!this.opts.extendToolbarClick){e.next=16;break}if(s=n.data.actionid){e.next=11;break}throw new Error("actionid不能为空");case 11:return l=u({},t),Object.assign(l,{topic:this.topic}),l.msg.realcontent=t.realcontent,e.next=16,this.opts.extendToolbarClick(i,{id:s,appId:this.context.srfappid},this.context,this.params,l);case 16:case 19:return e.abrupt("break",21);case 17:return e.next=19,this.question(n.data.content);case 20:throw new Error("不支持".concat(c,"推荐类型"));case 21:case"end":return e.stop()}}),e,this)}))),function(e,n,i){return t.apply(this,arguments)})}]),e}(),ri=function(){function e(t){v(this,e),g(this,"topics",Qe([])),g(this,"activedTopic",Qe(void 0)),g(this,"currentTopicOptions",void 0),this.chat=t}var t,n,i,r,a,c,s;return _(e,[{key:"fetchHistory",value:(s=p(d().mark((function e(t){var n,i,r=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.configService(t.appid,"aitopics",t.type),e.next=3,n.load();case 3:(i=e.sent)&&i.length>0&&i.forEach((function(e){r.topics.value=[].concat(o(r.topics.value),[new fn(e)])}));case 5:case"end":return e.stop()}}),e)}))),function(e){return s.apply(this,arguments)})},{key:"updateCurrentTopic",value:(c=p(d().mark((function e(t){var n,i,r,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.currentTopicOptions=t,n=this.topics.value.findIndex((function(e){return e.id===t.id})),i=new fn(t),-1!==n?this.topics.value.splice(n,1,new fn(t)):this.topics.value=[].concat(o(this.topics.value),[new fn(t)]),r=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),a=t.configService(t.appid,"aitopics",t.type),e.next=8,null==a?void 0:a.save(r);case 8:this.activedTopic.value=i;case 9:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"removeTopic",value:(a=p(d().mark((function e(t,n,i,r,a){var c,s,l,u,h;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=!0,!t.beforeDelete){e.next=5;break}return e.next=4,t.beforeDelete(n,i,r,a);case 4:s=e.sent;case 5:if(s){e.next=7;break}return e.abrupt("return");case 7:return-1!==(l=this.topics.value.findIndex((function(e){return e.id===r.id})))&&(this.topics.value.splice(l,1),this.topics.value=o(this.topics.value)),u=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),h=t.configService(t.appid,"aitopics",t.type),e.next=13,null==h?void 0:h.save(u);case 13:return e.next=15,le.deleteData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,r.id);case 15:this.topics.value.length>0&&r.id===(null===(c=this.activedTopic.value)||void 0===c?void 0:c.id)&&this.handleTopicChange(this.topics.value[0]);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i,r){return a.apply(this,arguments)})},{key:"updateTopic",value:(r=p(d().mark((function e(t,n){var i,r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),r=t.configService(t.appid,"aitopics",t.type),e.next=4,null==r?void 0:r.save(i);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"handleTopicChange",value:function(e){var t;(null===(t=this.activedTopic.value)||void 0===t?void 0:t.id)!==e.id&&(this.activedTopic.value=e,this.chat.switchAiChatController(e))}},{key:"handleTopicAction",value:(i=p(d().mark((function e(t,n,i){var r,o,a,c,s,l;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.topics.value.find((function(e){return e.id===n.id})),!(this.currentTopicOptions&&r&&r.aiChat)){e.next=12;break}if(c=r.aiChat,s=c.context,l=c.params,"DELETE"!==t){e.next=8;break}return e.next=6,this.removeTopic(this.currentTopicOptions,s,l,r,i);case 6:e.next=11;break;case 8:if("RENAME"!==t){e.next=11;break}return e.next=11,this.updateTopic(this.currentTopicOptions,n);case 11:null===(o=(a=this.currentTopicOptions).action)||void 0===o||o.call(a,t,s,l,n,i);case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"newTopic",value:(n=p(d().mark((function e(){var t,n,i,r,a,c,s,l,u;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.activedTopic.value){e.next=3;break}return e.abrupt("return");case 3:return r=i.id.split("@")[0],a=this.topics.value.filter((function(e){return e.id.startsWith(r)})),c={appid:i.appid,id:"".concat(r,"@").concat(Date.now()),type:i.type,caption:"".concat(null===(t=i.sourceCaption)||void 0===t?void 0:t.split("_")[0],"_").concat(a.length),sourceCaption:i.sourceCaption,url:i.url,aiChat:i.aiChat},s=new fn(c),this.topics.value=[].concat(o(this.topics.value),[s]),l=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),u=null===(n=this.currentTopicOptions)||void 0===n?void 0:n.configService(c.appid,"aitopics",c.type),e.next=12,null==u?void 0:u.save(l);case 12:this.handleTopicChange(s);case 13:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"clearTopic",value:(t=p(d().mark((function e(){var t,n,i,r,o,a=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.topics.value.find((function(e){var t;return e.id===(null===(t=a.activedTopic.value)||void 0===t?void 0:t.id)})),this.currentTopicOptions&&n){e.next=3;break}return e.abrupt("return");case 3:if(i=!0,!this.currentTopicOptions.beforeDelete){e.next=8;break}return e.next=7,this.currentTopicOptions.beforeDelete(n.aiChat.context,n.aiChat.params,n,void 0,!0);case 7:i=e.sent;case 8:if(i){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,Promise.all(this.topics.value.map((function(e){if(e.id!==(null==n?void 0:n.id))return le.deleteData(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,e.id)})));case 12:return this.topics.value=n?[n]:[],r=null===(t=this.currentTopicOptions)||void 0===t?void 0:t.configService(this.currentTopicOptions.appid,"aitopics",this.currentTopicOptions.type),o=this.topics.value.map((function(e){return{appid:e.appid,id:e.id,type:e.type,caption:e.caption,sourceCaption:e.sourceCaption,url:e.url,aiChat:e.aiChat}})),e.next=17,null==r?void 0:r.save(o);case 17:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),oi=_((function e(t){v(this,e),this.aiChat=t})),ai=function(t){e(o,t);var i,r=n(o);function o(){return v(this,o),r.apply(this,arguments)}return _(o,[{key:"excuteAction",value:(i=p(d().mark((function e(t,n){var i,r,o,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.onClick||"function"!=typeof n.onClick){e.next=6;break}return e.next=3,n.onClick(t,n,this.aiChat.context,this.aiChat.params);case 3:i=e.sent,e.next=14;break;case 6:if(!(r=this.aiChat.opts.extendToolbarClick)){e.next=13;break}return e.next=10,r(t,n,this.aiChat.context,this.aiChat.params,{});case 10:i=e.sent,e.next=14;break;case 13:console.error("未找到扩展工具栏点击事件");case 14:i&&i.data&&i.data.length>0&&(o=i.data[0],a={id:o.id,type:o.type,data:o.data||{},metadata:o.metadata||{}},n.id&&Object.assign(a.metadata,{actionId:n.id}),this.aiChat.addMaterial(a));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})}]),o}(oi),ci=function(t){e(o,t);var i,r=n(o);function o(){return v(this,o),r.apply(this,arguments)}return _(o,[{key:"excuteAction",value:(i=p(d().mark((function e(t,n){var i,r,o,a,c,s,l,u,h,f,v=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this.aiChat.opts.uploader,r=i.multiple,o=i.accept,a=i.maxSize,c=i.onSelect,s=i.onUpload,l=i.onSuccess,u=i.onError,h=i.onProgress,f={multiple:r||!0,accept:o||"*/*",maxSize:a||5242880,onSelect:function(e){null==c||c(e),e.length>0&&e.forEach((function(e){var t=v.buildMaterialObject(e);Object.assign(t.metadata,{state:"uploading"}),v.aiChat.addMaterial(t)}))},onUpload:function(){var e=p(d().mark((function e(t,n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s(t,n,{context:v.aiChat.context,params:v.aiChat.params}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),onSuccess:function(e,t){var n={id:e.id,type:"ossfile",data:{id:e.id,name:e.name},metadata:{ext:e.ext,fileext:e.fileext,fileid:e.fileid,filename:e.filename,size:e.size,filesize:e.filesize,state:"successed"}};v.aiChat.replaceMaterial(t.name,n),null==l||l(e,t)},onError:function(e,t){var n=v.buildMaterialObject(t);Object.assign(n.metadata,{state:"failed"}),v.aiChat.replaceMaterial(t.name,n),null==u||u(e,t)},onProgress:function(e,t){null==h||h(e,t)}},new ue(f).openFilePicker();case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"buildMaterialObject",value:function(e){return{id:e.name,type:"ossfile",data:{name:e.name,id:e.name},metadata:{size:e.size,type:e.type,lastModified:e.lastModified}}}}]),o}(oi),si=function(){function e(){v(this,e)}return _(e,null,[{key:"getMaterialHelper",value:function(e,t){return"ossfile"===e?new ci(t):new ai(t)}}]),e}(),li=function(){function e(){v(this,e),g(this,"container",void 0),g(this,"mode","DEFAULT"),g(this,"isMountedAiTopic",!1),g(this,"backupChatOptions",void 0),g(this,"aiTopic",void 0),g(this,"aiTopicMap",new Map),this.aiTopic=new ri(this)}var t,n;return _(e,[{key:"aiChat",get:function(){var e;return this.aiTopicMap.get("".concat(null===(e=this.aiTopic.activedTopic.value)||void 0===e?void 0:e.id))}},{key:"initIndexDB",value:(n=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,le.checkTableExists(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME);case 2:if(e.sent){e.next=6;break}return e.next=6,le.createTable(ni.DATA_BASE_NAME,ni.DATA_TABLE_NAME,ni.DATA_TABLE_KEY_NAME,!1);case 6:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"create",value:(t=p(d().mark((function e(t){var n,i,r,o,a,c,s=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initIndexDB();case 2:if(this.backupChatOptions=t,this.close(),this.container=document.createElement("div"),this.container.classList.add("ibiz-ai-chat"),document.body.appendChild(this.container),o=t.chatOptions,!t.mode||"TOPIC"!==t.mode){e.next=19;break}if(this.isMountedAiTopic){e.next=13;break}return e.next=12,this.aiTopic.fetchHistory(t.topicOptions);case 12:this.isMountedAiTopic=!0;case 13:return a=t.topicOptions,Object.assign(a,{aiChat:{caption:o.caption,context:o.context,params:o.params,appDataEntityId:o.appDataEntityId,contentToolbarItems:o.contentToolbarItems,footerToolbarItems:o.footerToolbarItems,questionToolbarItems:o.questionToolbarItems,otherToolbarItems:o.otherToolbarItems,appendCurData:o.appendCurData,appendCurContent:o.appendCurContent}}),e.next=17,this.aiTopic.updateCurrentTopic(a);case 17:e.next=20;break;case 19:this.aiTopic.activedTopic.value=void 0;case 20:return Object.assign(o,{topicId:null===(n=a)||void 0===n?void 0:n.id,topic:a}),c=new ii(o),this.aiTopicMap.set("".concat(null===(i=a)||void 0===i?void 0:i.id),c),K(M(Ti,{aiChat:c,aiTopic:this.aiTopic,mode:t.mode?t.mode:"DEFAULT",containerOptions:t.containerOptions,caption:t.mode&&"TOPIC"===t.mode?"AI助手":o.caption,enableBackFill:null===(r=t.containerOptions)||void 0===r?void 0:r.enableBackFill,contentToolbarItems:o.contentToolbarItems,footerToolbarItems:o.footerToolbarItems,questionToolbarItems:o.questionToolbarItems,close:function(){s.close(),o.closed&&o.closed(o.context,o.params)},fullscreen:function(e){o.fullscreen&&o.fullscreen(e,o.context,o.params)},minimize:function(e){o.minimize&&o.minimize(e,o.context,o.params)}}),this.container),e.abrupt("return",c);case 25:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"switchAiChatController",value:function(e){var t,n,i,r,o,a=this,c=u({},this.backupChatOptions.chatOptions);(e.aiChat&&Object.assign(c,{caption:e.aiChat.caption,context:e.aiChat.context,params:e.aiChat.params,contentToolbarItems:e.aiChat.contentToolbarItems,footerToolbarItems:e.aiChat.footerToolbarItems,questionToolbarItems:e.aiChat.questionToolbarItems,otherToolbarItems:e.aiChat.otherToolbarItems,appendCurData:e.aiChat.appendCurData,appendCurContent:e.aiChat.appendCurContent,appDataEntityId:e.aiChat.appDataEntityId,topicId:e.id,topic:e,extendToolbarClick:this.backupChatOptions.chatOptions.extendToolbarClick,recommendPrompt:this.backupChatOptions.chatOptions.recommendPrompt}),this.aiTopicMap.has("".concat(e.id))?t=this.aiTopicMap.get("".concat(e.id)):(t=new ii(c),this.aiTopicMap.set("".concat(e.id),t)),this.container)&&(K(null,this.container),K(M(Ti,{aiChat:t,aiTopic:this.aiTopic,mode:null!==(n=this.backupChatOptions)&&void 0!==n&&n.mode?this.backupChatOptions.mode:"DEFAULT",containerOptions:null===(i=this.backupChatOptions)||void 0===i?void 0:i.containerOptions,caption:null!==(r=this.backupChatOptions)&&void 0!==r&&r.mode&&"TOPIC"===this.backupChatOptions.mode?"AI助手":c.caption,enableBackFill:null===(o=this.backupChatOptions)||void 0===o||null===(o=o.containerOptions)||void 0===o?void 0:o.enableBackFill,contentToolbarItems:c.contentToolbarItems,footerToolbarItems:c.footerToolbarItems,questionToolbarItems:c.questionToolbarItems,close:function(){a.close(),c.closed&&c.closed(c.context,c.params)},fullscreen:function(e){c.fullscreen&&c.fullscreen(e,c.context,c.params)},minimize:function(e){c.minimize&&c.minimize(e,c.context,c.params)}}),this.container))}},{key:"hidden",value:function(){this.container&&(this.container.style.display="none")}},{key:"show",value:function(){this.container&&(this.container.style.display="flex")}},{key:"close",value:function(){this.container&&(K(null,this.container),this.container.remove(),this.container=void 0)}}]),e}(),ui=(t("chat",new li),new ee("chat-input-material")),di=function(e){var t=e.controller.materials;return _t("div",{className:ui.b(),children:t.value.map((function(t){return _t(rn,{material:t,disabled:!1,controller:e.controller},t.id)}))})},hi=function(e){var t=e.children,n=e.actions,i=e.content,r=e.position,o=void 0===r?"bottom":r,c=e.isOpen,s=e.onToggleOpen,l=e.onAction,d=new ee("pop"),h=Ie(Ci),p=a(Se(c||!1),2),f=p[0],v=p[1],m=Me(null),_=Me(null);Ae((function(){void 0!==c&&v(c)}),[c]),Ae((function(){return _.current||(_.current=document.createElement("div"),_.current.className=d.b("content-container"),document.body.appendChild(_.current)),function(){_.current&&document.body.removeChild(_.current)}}),[]),Ae((function(){var e=function(e){!m.current||m.current.contains(e.target)||e.target.closest(".".concat(d.b()))||e.target.closest(".ibiz-quick-edit")||e.target.closest(".ibiz-picker__transfer")||(v(!1),null==s||s(!1))};return f&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[f,s]);return _t("span",{className:"".concat(d.b("trigger-container")),children:[_t("span",{className:"".concat(d.b("trigger-element")),ref:m,onClick:function(e){e.stopPropagation();var t=!f;v(t),null==s||s(t)},children:t}),f&&_.current&&Pn(_t("div",{className:"".concat(d.b()," pop-").concat(o),style:function(){if(!m.current)return{};var e=m.current.getBoundingClientRect(),t={position:"absolute",zIndex:h.zIndex+1},n={bottom:{top:e.bottom+window.scrollY,left:e.left+window.scrollX},top:{bottom:window.innerHeight-e.top+window.scrollY,left:e.left+window.scrollX},left:{top:e.top+window.scrollY,right:window.innerWidth-e.left+window.scrollX},right:{top:e.top+window.scrollY,left:e.right+window.scrollX},"top-left":{bottom:window.innerHeight-e.top+window.scrollY,right:window.innerWidth-e.left+window.scrollX}};return u(u({},t),n[o])}(),children:i||(null==n?void 0:n.map((function(e){return _t("div",{title:e.caption,className:d.e("item"),onMouseDown:function(t){t.stopPropagation(),null==l||l(e.id,t)},children:[e.icon,_t("div",{className:d.em("item","caption"),children:e.caption})]},e.id)})))}),_.current)]})},pi=new ee("chat-input"),fi=window.SpeechRecognition||window.webkitSpeechRecognition,vi=function(e){var t,n=a(Se(!1),2),i=n[0],r=n[1],o=Me(null),c=e.controller.input,s=ft(!1),l=Me();fi&&!l.current&&(l.current=new fi,l.current.onstart=function(){s.value=!0},l.current.onend=function(){s.value=!1},l.current.onresult=function(e){var t,n=null===(t=e.results)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t[0])||void 0===t?void 0:t.transcript;n&&(c.value="".concat(c.value).concat(n))});var u=Le((function(e){c.value=e.target.value}),[c]),h=vt((function(){return c.value.length<=0}));Ae((function(){return o.current&&ti(o.current),function(){o.current&&ti.destroy(o.current)}}),[o]);var f=Le(p(d().mark((function t(){var n;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=c.value,c.value="",t.next=5,e.controller.question(n);case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.error(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])}))),[c]),v=Le(p(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{e.controller.abortQuestion()}catch(n){console.error(n)}case 1:case"end":return t.stop()}}),t)}))),[c]),m=function(){var t=p(d().mark((function t(n){var i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=si.getMaterialHelper("ossfile",e.controller),t.next=3,i.excuteAction(n);case 3:r(!1);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),_=function(){var t=p(d().mark((function t(n,i){var o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=si.getMaterialHelper("common",e.controller),t.next=3,o.excuteAction(n,i);case 3:r(!1);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();return _t("div",{className:pi.b("wrapper"),children:[_t("div",{className:pi.b("material-wrapper"),children:_t(di,{controller:e.controller})}),_t("div",{className:pi.b("main-wrapper"),children:[_t("textarea",{className:pi.e("textarea"),type:"text",rows:6,autoCorrect:"off",autoCapitalize:"off",autoComplete:"off",value:c,onInput:u,onKeyDown:function(e){"Enter"!==e.code||e.isComposing||(e.stopPropagation(),!1===e.shiftKey&&f())},ref:o,disabled:e.controller.isLoading.value}),_t("div",{className:pi.b("action-wrapper"),children:[_t("div",{className:"".concat(pi.be("action-wrapper","action-item")," ").concat(pi.is("disabled",e.controller.isLoading.value)),title:"上传资料",children:_t(hi,{content:_t("div",{className:pi.b("pop-actions"),children:[_t("div",{className:pi.b("pop-action-item"),onClick:function(e){m(e)},children:[_t("span",{className:pi.b("pop-action-item-icon"),children:_t(Ht,{})}),_t("span",{className:pi.b("pop-action-item-title"),children:"文件资料"})]}),null===(t=e.questionToolbarItems)||void 0===t?void 0:t.map((function(e){var t,n,i;return _t("div",{className:pi.b("pop-action-item"),onClick:function(t){_(t,e)},children:[_t("span",{className:pi.b("pop-action-item-icon"),children:"function"==typeof e.icon?e.icon():(null===(t=e.icon)||void 0===t?void 0:t.showIcon)&&_t(L,{children:null!==(n=e.icon)&&void 0!==n&&n.cssClass?_t("i",{className:e.icon.cssClass}):null!==(i=e.icon)&&void 0!==i&&i.imagePath?ce(e.icon.imagePath)?_t("div",{dangerouslySetInnerHTML:{__html:e.icon.imagePath}}):_t("img",{src:e.icon.imagePath}):null})}),_t("span",{className:pi.b("pop-action-item-title"),children:e.label})]},e.id)}))]}),position:"top-left",isOpen:i,onToggleOpen:r,children:_t(Bt,{})})}),_t("div",{title:s.value?"语音输入中...":"语音输入",className:"".concat(pi.be("action-wrapper","action-item")," ").concat(pi.is("disabled",e.controller.isLoading.value)),onClick:function(){l.current&&!s.value&&l.current.start()},children:s.value?_t(Mt,{}):_t(At,{})}),e.controller.isLoading.value?_t("div",{title:"停止生成",className:"".concat(pi.be("action-wrapper","action-item")),onClick:v,children:_t(Rt,{})}):_t("div",{title:"发送消息",className:"".concat(pi.be("action-wrapper","action-item")," ").concat(pi.is("disabled",h.value)),onClick:f,children:_t(wt,{})})]})]})]})},mi=new ee("chat-topic-item"),_i=function(e){var t=e.controller,n=e.topic,i=e.onClick,r=e.onAction,o=Me(null),c=vt((function(){var e;return(null===(e=t.activedTopic.value)||void 0===e?void 0:e.id)===n.id})),s=a(Se(!1),2),l=s[0],u=s[1],d=ft(!1);return _t("div",{className:"".concat(mi.b()," ").concat(mi.is("active",c.value)," ").concat(mi.is("edit",d.value)),onClick:i.bind(void 0),children:[_t("div",{className:mi.e("caption"),title:n.caption,children:d.value?_t("input",{ref:o,value:n.caption,onBlur:function(e){e.stopPropagation(),d.value=!1,r("RENAME",e)},onKeyDown:function(e){e.stopPropagation(),"Enter"===e.key&&(d.value=!1)},onClick:function(e){return e.stopPropagation()},onChange:function(e){return(t=e).stopPropagation(),void(n.data.caption=null===(i=t.target)||void 0===i?void 0:i.value);var t,i},className:mi.em("caption","editor")}):_t("span",{className:mi.em("caption","text"),children:n.caption})}),!d.value&&_t("div",{className:mi.e("icon"),children:[_t("span",{title:"跳转主视图",className:mi.em("icon","item"),onClick:function(e){e.stopPropagation(),r("LINK",e)}.bind(void 0),children:_t(Lt,{className:mi.b("link-icon")})}),c.value?null:_t(hi,{actions:[{id:"RENAME",caption:"重命名",icon:_t(qt,{})},{id:"DELETE",caption:"删除话题",icon:_t(It,{})}],position:"bottom",isOpen:l,onToggleOpen:u,onAction:function(e,t){"DELETE"===e?r("DELETE",t):"RENAME"===e&&(d.value=!0,setTimeout((function(){var e;null===(e=o.current)||void 0===e||e.focus()}),100)),u(!1)}.bind(void 0),children:_t("span",{className:mi.em("icon","item"),title:"更多",children:_t(Ot,{className:mi.e("more-icon")})})})]})]})},gi=new ee("chat-search"),yi=function(e){var t=e.className,n=e.value,i=e.placeholder,r=e.onChange,o=a(Se(!1),2),c=o[0],s=o[1],l=function(e){var t;e.stopPropagation(),null==r||r(null===(t=e.target)||void 0===t?void 0:t.value)};return _t("div",{className:"".concat(gi.b()," ").concat(gi.is("focus",c)," ").concat(t||""),children:[_t("div",{className:gi.e("prefix"),children:_t($t,{})}),_t("input",{value:n,className:gi.e("inner"),placeholder:i,onFocus:function(){return s(!0)},onBlur:function(){return s(!1)},onChange:function(e){return l(e)}})]})},wi=new ee("chat-topics"),bi=function(e){var t=Me(null),n=ft(void 0),i=ft([]);Ae((function(){i.value=e.controller.topics.value.filter((function(e){var t,i;return null===(t=e.caption)||void 0===t?void 0:t.toLowerCase().includes((null===(i=n.value)||void 0===i?void 0:i.trim().toLowerCase())||"")}))}),[e.controller.topics.value]);return Ae((function(){var e=t.current;if(e){var n=e.querySelector(".ibiz-chat-topic-item.is-active");null==n||n.scrollIntoView({behavior:"smooth",block:"nearest"})}}),[e.controller.activedTopic.value]),_t("div",{className:wi.b(),children:[_t("div",{className:wi.e("header"),children:_t(yi,{value:n.value,placeholder:"搜索话题",onChange:function(t){n.value=t,i.value=e.controller.topics.value.filter((function(e){var t,i;return null===(t=e.caption)||void 0===t?void 0:t.toLowerCase().includes((null===(i=n.value)||void 0===i?void 0:i.trim().toLowerCase())||"")}))}.bind(void 0)})}),_t("div",{ref:t,className:wi.e("main"),children:i.value&&i.value.length>0?i.value.map((function(t){return _t(_i,{topic:t,controller:e.controller,onClick:function(){return function(t){e.controller.handleTopicChange(t)}(t)},onAction:function(n,i){return function(t,n,i){e.controller.handleTopicAction(t,n,i)}(n,t,i)}},t.id)})):_t("div",{className:wi.e("empty"),children:"暂无话题"})}),_t("div",{className:wi.e("footer"),children:_t("div",{title:"清空会话",className:wi.e("action"),onClick:function(){return e.controller.clearTopic()},children:[_t(It,{}),_t("span",{children:"清空会话"})]})})]})},xi=new ee("chat-minimize"),ki=function(e){var t=Me(null),n=a(Se(""),2),i=n[0],r=n[1],o=a(Se(0),2),c=o[0],s=o[1],l=Me(!1),u={x:(window.innerWidth-86)/window.innerWidth,y:(window.innerHeight-86)/window.innerHeight},d=vt((function(){var t=e.controller.messages.value[e.controller.messages.value.length-1];return!!t&&("ASSISTANT"===t.role&&20===t.state&&!0!==t.completed)})),h=vt((function(){var t="";if(!d.value)return r(""),s(0),t;var n=e.controller.messages.value[e.controller.messages.value.length-1];if(t=n.content,-1!==n.content.indexOf("<think>")){var i=function(e){var t=e.indexOf("<think>"),n=e.indexOf("</think>"),i="",r="";return-1===n?(i=e.slice(t+7),r=""):(i=e.slice(t+7,n),r=e.slice(n+8)),{thoughtContent:i,answerContent:r}}(n.content);t=i.thoughtContent+i.answerContent}return t})),p=function(){Object.assign(t.current.style,{left:"".concat(100*u.x,"%"),top:"".concat(100*u.y,"%")}),localStorage.setItem(ni.MINIMIZE_STYLY_CHCHE,JSON.stringify(u))};return Ae((function(){var e,n=localStorage.getItem(ni.MINIMIZE_STYLY_CHCHE);if(n){var i=JSON.parse(n);pe(i)&&Object.assign(u,i)}p(),(e=t.current)&&(e.onmousedown=function(t){document.body.style.userSelect="none";var n=t.clientX-e.offsetLeft,i=t.clientY-e.offsetTop,r=Date.now(),o=function(e){var t=56/window.innerWidth,r=56/window.innerHeight,o=fe(e.clientX-n,e.clientY-i,t,r),a=o.x,c=o.y;Object.assign(u,{x:a,y:c}),requestAnimationFrame((function(){p()}))};document.addEventListener("mousemove",o),document.addEventListener("mouseup",(function e(){var t=Date.now();l.current=t-r>300,document.body.style.userSelect="",document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",e)}))})}),[]),Ae((function(){if(c<h.value.length){var e=setTimeout((function(){r((function(e){return e+h.value[c]})),s((function(e){return e+1}))}),100);return function(){return clearTimeout(e)}}}),[c,h.value]),_t("div",{ref:t,title:e.title,className:"".concat(xi.b()," ").concat(xi.is("hidden",!e.isMinimize)," ").concat(xi.is("show-halo",d.value)),onClick:function(){l.current||e.onClick()},children:_t("div",{className:"".concat(xi.e("content")," ").concat(xi.is("show-border",!d.value)),children:[i&&_t("div",{className:"".concat(xi.em("content","popover")),children:_t("div",{className:"typewriter",children:i})}),_t(Et,{})]})})},Ci=function(e,t){var n={__c:t="__cC"+k++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,P(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({zIndex:10,enableBackFill:!0,newTopic:function(){}}),Ti=function(t){e(o,t);var r=n(o);function o(e){var t,n,a,c,s;return v(this,o),g(i(s=r.call(this,e)),"ns",new ee("chat-container")),g(i(s),"containerRef",{current:null}),g(i(s),"dragHandle",{current:null}),g(i(s),"data",{side:{y:0,height:1,width:750/window.innerWidth,x:(window.innerWidth-750)/window.innerWidth},window:{y:0,width:750/window.innerWidth,height:750/window.innerHeight,x:(window.innerWidth-750)/window.innerWidth},minWidth:500,minHeight:300,showMode:"side"}),g(i(s),"disabled",!1),g(i(s),"isDragging",!1),g(i(s),"containerContext",{zIndex:(null===(t=s.props.containerOptions)||void 0===t?void 0:t.zIndex)||10,enableBackFill:void 0===(null===(n=s.props)||void 0===n?void 0:n.enableBackFill)||null===(null===(a=s.props)||void 0===a?void 0:a.enableBackFill)||(null===(c=s.props)||void 0===c?void 0:c.enableBackFill),newTopic:function(){s.props.aiTopic.newTopic()}}),s.state={isFullScreen:!1,isMinimize:!1},s}return _(o,[{key:"calcWindowStyle",value:function(){var e,t="window"===this.data.showMode?this.data.window:this.data.side;return{left:"".concat(100*t.x,"%"),top:"".concat(100*t.y,"%"),width:"".concat(100*t.width,"%"),height:"".concat(100*t.height,"%"),minWidth:"".concat(this.data.minWidth,"px"),minHeight:"".concat(this.data.minHeight,"px"),"z-index":(null===(e=this.props.containerOptions)||void 0===e||null===(e=e.zIndex)||void 0===e?void 0:e.toString())||"10"}}},{key:"calcSideModeStyle",value:function(e){Object.assign(this.data,{side:{y:0,x:"left"===e?0:(window.innerWidth-750)/window.innerWidth,height:1,width:750/window.innerWidth},showMode:"side"})}},{key:"setStyle",value:function(){Object.assign(this.containerRef.current.style,this.calcWindowStyle()),localStorage.setItem(ni.STYLE_CACHE,JSON.stringify(this.data))}},{key:"snapToEdge",value:function(){var e=20/window.innerWidth,t=20/window.innerHeight,n=this.data.window,i=n.x,r=n.y,o=n.width,a=n.height;i<e||i+o>1-e?this.calcSideModeStyle(i<e?"left":"right"):(r<t&&(this.data.window.y=0),r+a>1-t&&(this.data.window.y=1-a)),this.setStyle()}},{key:"registerDragDialog",value:function(){var e=this;this.dragHandle.current.onmousedown=function(t){if(!e.state.isFullScreen){document.body.style.userSelect="none";var n=t.clientX-e.containerRef.current.offsetLeft,i=t.clientY-e.containerRef.current.offsetTop,r=function(t){if(!e.disabled){e.data.showMode="window";var r=fe(t.clientX-n,t.clientY-i,e.data.window.width,e.data.window.height),o=r.x,a=r.y;Object.assign(e.data.window,{x:o,y:a}),e.setStyle()}};document.addEventListener("mousemove",r),document.addEventListener("mouseup",(function t(){document.body.style.userSelect="",document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",t),e.disabled||e.snapToEdge()}))}}}},{key:"registerDragDialogBorder",value:function(){var e=this;c(this.containerRef.current).resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},margin:6,modifiers:[c.modifiers.restrictEdges({outer:document.body}),c.modifiers.restrictSize({min:{width:this.data.minWidth,height:this.data.minHeight}})],inertia:!0,listeners:{move:function(t){if(!e.state.isFullScreen){var n="side"===e.data.showMode?e.data.side:e.data.window;n.x=t.rect.left/window.innerWidth,n.y=t.rect.top/window.innerHeight,n.width=t.rect.width/window.innerWidth,n.height=t.rect.height/window.innerHeight,e.setStyle()}},start:function(){e.disabled=!0,document.body.style.userSelect="none"},end:function(){e.disabled=!1,document.body.style.userSelect=""}}})}},{key:"handleFullScreenChange",value:function(){this.setState({isFullScreen:null!==document.fullscreenElement})}},{key:"componentDidMount",value:function(){this.handleFullScreenChange=this.handleFullScreenChange.bind(this);var e=localStorage.getItem(ni.STYLE_CACHE);if(e){var t=JSON.parse(e);t.side&&pe(t.side)&&t.window&&pe(t.window)&&Object.assign(this.data,t)}this.setStyle(),this.registerDragDialog(),this.registerDragDialogBorder(),document.addEventListener("fullscreenchange",this.handleFullScreenChange)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("fullscreenchange",this.handleFullScreenChange)}},{key:"close",value:function(){this.props.close()}},{key:"fullScreen",value:function(){var e=this.containerRef.current;e&&(e.requestFullscreen(),this.props.fullscreen(!0))}},{key:"closeFullScreen",value:function(){var e;this.state.isFullScreen&&(null===(e=document)||void 0===e||e.exitFullscreen(),this.props.fullscreen(!1),this.setStyle())}},{key:"minimize",value:function(){this.closeFullScreen(),this.setState({isMinimize:!0}),this.props.minimize(!0)}},{key:"exitMinimize",value:function(){this.setState({isMinimize:!1}),this.props.minimize(!1)}},{key:"stopPropagation",value:function(e){e.stopPropagation()}},{key:"render",value:function(){return _t(Ci.Provider,{value:this.containerContext,children:_t("div",{className:"".concat(this.ns.b()),children:[_t("div",{className:"".concat(this.ns.e("dialog")," ").concat(this.ns.is("full-screen",this.state.isFullScreen)," ").concat(this.ns.is("hidden",this.state.isMinimize)),ref:this.containerRef,children:[_t("div",{ref:this.dragHandle,className:this.ns.b("header"),children:[_t("div",{className:this.ns.b("header-caption"),children:this.props.caption||"AI助手"}),_t("div",{className:this.ns.b("header-action-wrapper"),children:[_t("div",{title:"最小化",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","minimize")),onMouseDown:this.stopPropagation.bind(this),onClick:this.minimize.bind(this),children:_t(Nt,{})}),this.state.isFullScreen?_t("div",{title:"退出全屏",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","close-full-screen")),onMouseDown:this.stopPropagation.bind(this),onClick:this.closeFullScreen.bind(this),children:_t(Tt,{})}):_t("div",{title:"全屏",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","full-screen")),onMouseDown:this.stopPropagation.bind(this),onClick:this.fullScreen.bind(this),children:_t(Ct,{})}),_t("div",{title:"关闭",className:"".concat(this.ns.be("header-action-wrapper","action-item")," ").concat(this.ns.be("header-action-wrapper","action-close")),onMouseDown:this.stopPropagation.bind(this),onClick:this.close.bind(this),children:_t(gt,{})})]})]}),"TOPIC"===this.props.mode?_t("div",{className:"".concat(this.ns.b("main")),children:[_t("div",{className:"".concat(this.ns.be("main","left")),children:_t(bi,{controller:this.props.aiTopic})}),_t("div",{className:"".concat(this.ns.be("main","right")),children:[_t("div",{className:this.ns.b("content"),children:_t(xn,{controller:this.props.aiChat,toolbarItems:this.props.contentToolbarItems})}),_t(yn,{type:"footer",mode:this.props.mode,data:this.props.aiTopic.activedTopic.value,className:"".concat(this.ns.e("toolbar")," ").concat(this.ns.is("has-materials",this.props.aiChat.materials.value.length>0)),controller:this.props.aiChat,items:this.props.footerToolbarItems}),_t("div",{className:this.ns.b("footer"),children:_t(vi,{controller:this.props.aiChat,questionToolbarItems:this.props.questionToolbarItems})})]})]}):_t("div",{className:"".concat(this.ns.be("main","default")),children:[_t("div",{className:this.ns.b("content"),children:_t(xn,{controller:this.props.aiChat,toolbarItems:this.props.contentToolbarItems})}),_t(yn,{type:"footer",mode:this.props.mode,data:this.props.aiTopic.activedTopic.value,className:"".concat(this.ns.e("toolbar")," ").concat(this.ns.is("has-materials",this.props.aiChat.materials.value.length>0)),controller:this.props.aiChat,items:this.props.footerToolbarItems}),_t("div",{className:this.ns.b("footer"),children:_t(vi,{controller:this.props.aiChat,questionToolbarItems:this.props.questionToolbarItems})})]})]}),_t(ki,{title:this.props.caption||"AI助手",controller:this.props.aiChat,isMinimize:this.state.isMinimize,onClick:this.exitMinimize.bind(this)})]})})}}]),o}(I);t("ChatContainer",Ti)}}}))}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template-plugin/ai-chat",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "iBiz AI交互框插件",
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",