bioinfoark commited on
Commit
fb49c8e
1 Parent(s): 3538e6d

Upload 26 files

Browse files
LICENSE.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 方糖气球🎈Chat酱定制版授权,可用于任意域名、供任意位用户使用。授权编号 CU.LICENSE.18608100
asset-manifest.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "files": {
3
+ "main.css": "./static/css/main.34bf5f7b.chunk.css",
4
+ "main.js": "./static/js/main.618390d8.chunk.js",
5
+ "runtime-main.js": "./static/js/runtime-main.6a483d65.js",
6
+ "static/css/2.c412fb8a.chunk.css": "./static/css/2.c412fb8a.chunk.css",
7
+ "static/js/2.3db8346d.chunk.js": "./static/js/2.3db8346d.chunk.js",
8
+ "static/js/3.753cf703.chunk.js": "./static/js/3.753cf703.chunk.js",
9
+ "d032240921e3b8f45d06.module.wasm": "./d032240921e3b8f45d06.module.wasm",
10
+ "index.html": "./index.html",
11
+ "precache-manifest.7478bb08b739d1094cd5ec8bf6ec0033.js": "./precache-manifest.7478bb08b739d1094cd5ec8bf6ec0033.js",
12
+ "service-worker.js": "./service-worker.js",
13
+ "static/media/index.scss": "./static/media/icons-20.cef8cdbb.woff"
14
+ },
15
+ "entrypoints": [
16
+ "static/js/runtime-main.6a483d65.js",
17
+ "static/css/2.c412fb8a.chunk.css",
18
+ "static/js/2.3db8346d.chunk.js",
19
+ "static/css/main.34bf5f7b.chunk.css",
20
+ "static/js/main.618390d8.chunk.js"
21
+ ]
22
+ }
char.png ADDED
d032240921e3b8f45d06.module.wasm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c64f96f7838699d1e88ace1140ebe243de91ba5e8dcd1839815a8eebc7b4bacb
3
+ size 2981407
default.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "app_name": "",
3
+ "api_key": "",
4
+ "api_url": "",
5
+ "chat_model": "",
6
+ "chat_max_tokens": "",
7
+ "chat_temperature": "",
8
+ "chat_timeout": "",
9
+ "chat_system_prompt": "",
10
+ "chat_user_prompt": "",
11
+ "chat_character_url": "",
12
+ "chat_character_opacity": 80,
13
+ "chat_moderation": "off"
14
+ }
favicon.ico ADDED
index.html CHANGED
@@ -1,19 +1 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
1
+ <!doctype html><html lang="zh-cn"><head><meta charset="utf-8"/><link rel="icon" href="./logo512.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Chat app support openai and api2d key"/><link rel="apple-touch-icon" href="logo192.png"/><link rel="manifest" href="./manifest.json"/><link rel="stylesheet" href="./tailwind.min.css"><title>...</title><link href="./static/css/2.c412fb8a.chunk.css" rel="stylesheet"><link href="./static/css/main.34bf5f7b.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(s){function e(e){for(var t,n,r=e[0],o=e[1],i=e[2],u=0,a=[];u<r.length;u++)n=r[u],Object.prototype.hasOwnProperty.call(f,n)&&f[n]&&a.push(f[n][0]),f[n]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(s[t]=o[t]);for(h&&h(e);a.length;)a.shift()();return l.push.apply(l,i||[]),c()}function c(){for(var e,t=0;t<l.length;t++){for(var n=l[t],r=!0,o=1;o<n.length;o++){var i=n[o];0!==f[i]&&(r=!1)}r&&(l.splice(t--,1),e=d(d.s=n[0]))}return e}var n={},f={1:0},l=[],p={},b={1508:function(){return{"./tiktoken_bg.js":{__wbindgen_object_drop_ref:function(e){return n[1507].exports.g(e)},__wbindgen_is_undefined:function(e){return n[1507].exports.f(e)},__wbg_stringify_029a979dfb73aa17:function(e){return n[1507].exports.d(e)},__wbindgen_string_get:function(e,t){return n[1507].exports.h(e,t)},__wbindgen_error_new:function(e,t){return n[1507].exports.e(e,t)},__wbg_parse_3ac95b51fc312db8:function(e,t){return n[1507].exports.b(e,t)},__wbindgen_throw:function(e,t){return n[1507].exports.i(e,t)}}}}};function d(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return s[e].call(t.exports,t,t.exports,d),t.l=!0,t.exports}d.e=function(o){var i=[],n=f[o];if(0!==n)if(n)i.push(n[2]);else{var e=new Promise(function(e,t){n=f[o]=[e,t]});i.push(n[2]=e);var t,u=document.createElement("script");u.charset="utf-8",u.timeout=120,d.nc&&u.setAttribute("nonce",d.nc),u.src=d.p+"static/js/"+({}[o]||o)+"."+{3:"753cf703"}[o]+".chunk.js";var a=new Error;t=function(e){u.onerror=u.onload=null,clearTimeout(s);var t=f[o];if(0!==t){if(t){var n=e&&("load"===e.type?"missing":e.type),r=e&&e.target&&e.target.src;a.message="Loading chunk "+o+" failed.\n("+n+": "+r+")",a.name="ChunkLoadError",a.type=n,a.request=r,t[1](a)}f[o]=void 0}};var s=setTimeout(function(){t({type:"timeout",target:u})},12e4);u.onerror=u.onload=t,document.head.appendChild(u)}return({3:[1508]}[o]||[]).forEach(function(t){var e=p[t];if(e)i.push(e);else{var n,r=b[t](),o=fetch(d.p+""+{1508:"d032240921e3b8f45d06"}[t]+".module.wasm");n=r instanceof Promise&&"function"==typeof WebAssembly.compileStreaming?Promise.all([WebAssembly.compileStreaming(o),r]).then(function(e){return WebAssembly.instantiate(e[0],e[1])}):"function"==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(o,r):o.then(function(e){return e.arrayBuffer()}).then(function(e){return WebAssembly.instantiate(e,r)}),i.push(p[t]=n.then(function(e){return d.w[t]=(e.instance||e).exports}))}}),Promise.all(i)},d.m=s,d.c=n,d.d=function(e,t,n){d.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.t=function(t,e){if(1&e&&(t=d(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(d.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)d.d(n,r,function(e){return t[e]}.bind(null,r));return n},d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,"a",t),t},d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d.p="./",d.oe=function(e){throw console.error(e),e},d.w={};var t=this.webpackJsonpchatchan=this.webpackJsonpchatchan||[],r=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var h=r;c()}([])</script><script src="./static/js/2.3db8346d.chunk.js"></script><script src="./static/js/main.618390d8.chunk.js"></script></body></html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
logo192.png ADDED
logo512.png ADDED
manifest.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "short_name": "BioinfoArk",
3
+ "name": "BioinfoArk",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
precache-manifest.7478bb08b739d1094cd5ec8bf6ec0033.js ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ self.__precacheManifest = (self.__precacheManifest || []).concat([
2
+ {
3
+ "revision": "5fa5b7471597b4dc3853",
4
+ "url": "./d032240921e3b8f45d06.module.wasm"
5
+ },
6
+ {
7
+ "revision": "bf4ca7bf61b7c729a75882ca9cf79228",
8
+ "url": "./index.html"
9
+ },
10
+ {
11
+ "revision": "44aac19c9eb2b9932617",
12
+ "url": "./static/css/2.c412fb8a.chunk.css"
13
+ },
14
+ {
15
+ "revision": "4ce65e1260db989a7e5d",
16
+ "url": "./static/css/main.34bf5f7b.chunk.css"
17
+ },
18
+ {
19
+ "revision": "44aac19c9eb2b9932617",
20
+ "url": "./static/js/2.3db8346d.chunk.js"
21
+ },
22
+ {
23
+ "revision": "5fa5b7471597b4dc3853",
24
+ "url": "./static/js/3.753cf703.chunk.js"
25
+ },
26
+ {
27
+ "revision": "4ce65e1260db989a7e5d",
28
+ "url": "./static/js/main.618390d8.chunk.js"
29
+ },
30
+ {
31
+ "revision": "061a04ec949471f55ade",
32
+ "url": "./static/js/runtime-main.6a483d65.js"
33
+ },
34
+ {
35
+ "revision": "05f1cdadfe476395f60e233b15c22155",
36
+ "url": "./static/media/icons-16.05f1cdad.eot"
37
+ },
38
+ {
39
+ "revision": "3c1c220e7a18286503fb431c7a7fe183",
40
+ "url": "./static/media/icons-16.3c1c220e.woff"
41
+ },
42
+ {
43
+ "revision": "3cde8748332d1de6b1ae1c2dc5850754",
44
+ "url": "./static/media/icons-16.3cde8748.ttf"
45
+ },
46
+ {
47
+ "revision": "0a5c76518a68c185baa2c6744456918c",
48
+ "url": "./static/media/icons-20.0a5c7651.eot"
49
+ },
50
+ {
51
+ "revision": "51ec31f302d0072808e1f83f85fea4cd",
52
+ "url": "./static/media/icons-20.51ec31f3.ttf"
53
+ },
54
+ {
55
+ "revision": "cef8cdbb9d0ba82e6e19fb0eeba2ac3d",
56
+ "url": "./static/media/icons-20.cef8cdbb.woff"
57
+ }
58
+ ]);
robots.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
service-worker.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Welcome to your Workbox-powered service worker!
3
+ *
4
+ * You'll need to register this file in your web app and you should
5
+ * disable HTTP caching for this file too.
6
+ * See https://goo.gl/nhQhGp
7
+ *
8
+ * The rest of the code is auto-generated. Please don't update this file
9
+ * directly; instead, make changes to your Workbox build configuration
10
+ * and re-run your build process.
11
+ * See https://goo.gl/2aRDsh
12
+ */
13
+
14
+ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
15
+
16
+ importScripts(
17
+ "./precache-manifest.7478bb08b739d1094cd5ec8bf6ec0033.js"
18
+ );
19
+
20
+ self.addEventListener('message', (event) => {
21
+ if (event.data && event.data.type === 'SKIP_WAITING') {
22
+ self.skipWaiting();
23
+ }
24
+ });
25
+
26
+ workbox.core.clientsClaim();
27
+
28
+ /**
29
+ * The workboxSW.precacheAndRoute() method efficiently caches and responds to
30
+ * requests for URLs in the manifest.
31
+ * See https://goo.gl/S9QRab
32
+ */
33
+ self.__precacheManifest = [].concat(self.__precacheManifest || []);
34
+ workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
35
+
36
+ workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("./index.html"), {
37
+
38
+ blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/],
39
+ });
static/css/2.c412fb8a.chunk.css ADDED
The diff for this file is too large to render. See raw diff
 
static/css/main.34bf5f7b.chunk.css ADDED
@@ -0,0 +1 @@
 
 
1
+ body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;background-color:hsla(0,0%,100%,.7)}body:hover{background-color:#fff}#root,body,html{min-height:100vh}.header{z-index:9;position:fixed;background-color:hsla(0,0%,100%,.95);left:0;right:0;margin-left:auto;margin-right:auto;height:50px;box-shadow:0 0 1px 0 rgba(0,0,0,.3),0 0 6px 2px rgba(0,0,0,.15)}.header,.header .container{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.header .container{padding:.5rem}.header .container .right{display:flex;flex-direction:row;align-items:center}.body{overflow:hidden}.footer{padding:.5rem;text-align:center;color:#ccc}.center-box{left:0;right:0;margin:10% auto;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;flex-direction:column}.center-box,.user-span{display:flex;align-items:center}.user-span{flex-direction:row}.user-span img.avatar{max-width:24px;max-height:24px;margin-right:.5rem;border-radius:50%}.user-span span.coin{margin-left:.2rem;padding-left:5px;padding-right:5px;border-radius:.2rem}.recharge-page .price{font-family:Georgia,Times,Times New Roman,serif;font-size:36px}.profile-page .profile{text-align:center}.profile-page .profile .avatar{display:flex;flex-direction:column;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:auto}.profile-page .profile .avatar img{border-radius:50%;margin:10px;max-width:100px}.profile-page .detail .row{width:50%;margin:20px auto 0;text-align:center;display:flex;flex-direction:row;justify-content:space-between;padding:10px;border-bottom:1px solid #eee}.nav-menu{padding-left:1rem;padding-right:1rem;display:flex;align-items:center;height:50px}.nav-menu.active{background-color:#eee}.chat-box{margin-top:10px;width:100%}.chat-box .input-box{min-height:100px;max-height:400px;background-color:hsla(0,0%,100%,.6)}.chat-box .input-box:hover{background-color:hsla(0,0%,100%,.8)}.chat-list{background-color:hsla(0,0%,100%,.6);margin-top:20px;overflow-y:auto;border:1px solid #eee;padding:20px 10px;border-radius:2px;flex:1 1}.chat-list:hover{background-color:hsla(0,0%,100%,.8)}.chat-item{display:flex;flex-direction:row;align-items:center;margin-bottom:10px;margin-left:10px;margin-right:10px}.chat-item .avatar{width:40px;height:40px;border-radius:50%;margin-right:10px}.chat-item .content{display:flex;flex-direction:row;align-items:center;line-height:1.8;background-color:#fff;border-radius:5px;padding:10px;margin-right:10px;max-width:calc(100% - 100px);overflow-x:auto;position:relative}.chat-item .content .float-icons{display:none;position:absolute;right:2px;bottom:2px}.chat-item .content:hover .float-icons{display:block;opacity:.5}.chat-item .content p{margin:0}.chat-item .content pre{overflow-x:auto;word-break:break-all}.chat-item .content pre code{white-space:pre-wrap!important}.chat-item .content .name{font-size:12px;color:#ccc}.chat-item .content .text{font-size:14px}.chat-item.me{flex-direction:row-reverse}.chat-item.me .content{align-items:center;background-color:#faebd7;margin-left:50px}.chat-item.robot .content{background-color:#eee;margin-right:50px}.chat-page{padding-left:5px;padding-right:5px;margin-top:20px;height:calc(100vh - 20px)}.chat-page .left-box{padding-right:30px;display:flex;flex-direction:column;align-items:end;justify-content:space-between}.chat-page .right-box{width:720px;display:flex;flex-direction:column}.char-box{width:200px;position:fixed;bottom:0}.char-box .slider{display:none;position:absolute;width:100%;bottom:0}.char-box:hover .slider{display:block}@media screen and (max-width:1024px){.chat-page{padding:10px}.chat-page .left-box{display:none}.chat-page .right-box{width:100%}}pre{white-space:pre-wrap;word-wrap:break-word}.xs-btn svg{color:#ccc;width:12px}.xs-btn .bp3-button-text{color:#ccc;font-size:12px}.gray-btn .bp3-button-text,.gray-btn svg{color:#ccc}.gray-btn:hover .bp3-button-text,.gray-btn:hover svg{color:#000}.history-list,.prompt-list{max-height:calc(100vh - 320px);overflow-y:auto;padding-left:5px;padding-right:5px;position:relative}.history-list .bottom-effect,.prompt-list .bottom-effect{display:block;position:-webkit-sticky;position:sticky;bottom:0;left:0;right:0;height:32px;background:linear-gradient(180deg,hsla(0,0%,100%,0) 0,#fff);border-bottom-left-radius:5px;border-bottom-right-radius:5px}.history-list:hover,.prompt-list:hover{z-index:2}.history-list:hover .bottom-effect,.prompt-list:hover .bottom-effect{display:none}.history-list .history-item,.history-list .prompt-item,.prompt-list .history-item,.prompt-list .prompt-item{background-color:hsla(0,0%,100%,.6);color:#000}.history-list .history-item .action-icon,.history-list .prompt-item .action-icon,.prompt-list .history-item .action-icon,.prompt-list .prompt-item .action-icon{visibility:hidden}.history-list .history-item:hover,.history-list .prompt-item:hover,.prompt-list .history-item:hover,.prompt-list .prompt-item:hover{background-color:hsla(0,0%,100%,.95)}.history-list .history-item:hover .action-icon,.history-list .prompt-item:hover .action-icon,.prompt-list .history-item:hover .action-icon,.prompt-list .prompt-item:hover .action-icon{visibility:visible}::-webkit-scrollbar-thumb{background-color:hsla(0,0%,80%,.2);border-radius:3px}::-webkit-scrollbar{width:3px;height:3px}.container{max-width:1000px!important}.box-footer{border-top:1px dotted #ccc;margin-top:30px;padding-top:20px}.markdown-text ol{margin-left:18px}.markdown-text ol li{list-style:decimal}.markdown-text ul{margin-left:18px}.markdown-text ul li{list-style:disc}.drag-handle{-webkit-app-region:drag}.chat-bg{position:fixed;top:0;left:0;z-index:-1}.chat-bg,.chat-bg img{height:100%;width:100%}.chat-bg img{object-fit:cover}.no-margin .bp3-control{margin-bottom:0!important}:focus{outline:none!important}
static/js/2.3db8346d.chunk.js ADDED
The diff for this file is too large to render. See raw diff
 
static/js/3.753cf703.chunk.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (this.webpackJsonpchatchan=this.webpackJsonpchatchan||[]).push([[3],{1466:function(n,e,t){"use strict";t.r(e);var r=t(1508),i=t(1507);t.d(e,"__wbg_set_wasm",(function(){return i.c})),t.d(e,"get_encoding",(function(){return i.k})),t.d(e,"encoding_for_model",(function(){return i.j})),t.d(e,"Tiktoken",(function(){return i.a})),t.d(e,"__wbindgen_object_drop_ref",(function(){return i.g})),t.d(e,"__wbindgen_is_undefined",(function(){return i.f})),t.d(e,"__wbg_stringify_029a979dfb73aa17",(function(){return i.d})),t.d(e,"__wbindgen_string_get",(function(){return i.h})),t.d(e,"__wbindgen_error_new",(function(){return i.e})),t.d(e,"__wbg_parse_3ac95b51fc312db8",(function(){return i.b})),t.d(e,"__wbindgen_throw",(function(){return i.i})),Object(i.c)(r)},1507:function(n,e,t){"use strict";(function(n){t.d(e,"c",(function(){return o})),t.d(e,"k",(function(){return q})),t.d(e,"j",(function(){return S})),t.d(e,"a",(function(){return z})),t.d(e,"g",(function(){return W})),t.d(e,"f",(function(){return j})),t.d(e,"d",(function(){return O})),t.d(e,"h",(function(){return T})),t.d(e,"e",(function(){return P})),t.d(e,"b",(function(){return J})),t.d(e,"i",(function(){return D}));var r,i=t(10),_=t(12);function o(n){r=n}var d=new Array(128).fill(void 0);function a(n){return d[n]}d.push(void 0,null,!0,!1);var u=d.length;function c(n){var e=a(n);return function(n){n<132||(d[n]=u,u=n)}(n),e}var f=0,l=null;function b(){return null!==l&&0!==l.byteLength||(l=new Uint8Array(r.memory.buffer)),l}var w=new("undefined"===typeof TextEncoder?(0,n.require)("util").TextEncoder:TextEncoder)("utf-8"),p="function"===typeof w.encodeInto?function(n,e){return w.encodeInto(n,e)}:function(n,e){var t=w.encode(n);return e.set(t),{read:n.length,written:t.length}};function s(n,e,t){if(void 0===t){var r=w.encode(n),i=e(r.length);return b().subarray(i,i+r.length).set(r),f=r.length,i}for(var _=n.length,o=e(_),d=b(),a=0;a<_;a++){var u=n.charCodeAt(a);if(u>127)break;d[o+a]=u}if(a!==_){0!==a&&(n=n.slice(a)),o=t(o,_,_=a+3*n.length);var c=b().subarray(o+a,o+_);a+=p(n,c).written}return f=a,o}var k=null;function y(){return null!==k&&0!==k.byteLength||(k=new Int32Array(r.memory.buffer)),k}var g=new("undefined"===typeof TextDecoder?(0,n.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});function h(n,e){return g.decode(b().subarray(n,n+e))}function v(n){u===d.length&&d.push(d.length+1);var e=u;return u=d[e],d[e]=n,e}g.decode();var x=null;function A(){return null!==x&&0!==x.byteLength||(x=new Uint32Array(r.memory.buffer)),x}function E(n,e){return A().subarray(n/4,n/4+e)}function m(n,e){return b().subarray(n/1,n/1+e)}function q(n,e){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");try{var t=r.__wbindgen_add_to_stack_pointer(-16),i=s(n,r.__wbindgen_export_0,r.__wbindgen_export_1),_=f;r.get_encoding(t,i,_,v(e));var o=y()[t/4+0],d=y()[t/4+1];if(y()[t/4+2])throw c(d);return z.__wrap(o)}finally{r.__wbindgen_add_to_stack_pointer(16)}}function S(n,e){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");try{var t=r.__wbindgen_add_to_stack_pointer(-16),i=s(n,r.__wbindgen_export_0,r.__wbindgen_export_1),_=f;r.encoding_for_model(t,i,_,v(e));var o=y()[t/4+0],d=y()[t/4+1];if(y()[t/4+2])throw c(d);return z.__wrap(o)}finally{r.__wbindgen_add_to_stack_pointer(16)}}function M(n,e){try{return n.apply(this,e)}catch(t){r.__wbindgen_export_3(v(t))}}var z=function(){function n(e,t,_){if(Object(i.a)(this,n),null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");var o=s(e,r.__wbindgen_export_0,r.__wbindgen_export_1),d=f,a=s(_,r.__wbindgen_export_0,r.__wbindgen_export_1),u=f,c=r.tiktoken_new(o,d,v(t),a,u);return n.__wrap(c)}return Object(_.a)(n,[{key:"__destroy_into_raw",value:function(){var n=this.ptr;return this.ptr=0,n}},{key:"free",value:function(){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");var n=this.__destroy_into_raw();r.__wbg_tiktoken_free(n)}},{key:"name",get:function(){try{var n=r.__wbindgen_add_to_stack_pointer(-16);r.tiktoken_name(n,this.ptr);var e,t=y()[n/4+0],i=y()[n/4+1];return 0!==t&&(e=h(t,i).slice(),r.__wbindgen_export_2(t,1*i)),e}finally{r.__wbindgen_add_to_stack_pointer(16)}}},{key:"encode",value:function(n,e,t){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");try{var i=r.__wbindgen_add_to_stack_pointer(-16),_=s(n,r.__wbindgen_export_0,r.__wbindgen_export_1),o=f;r.tiktoken_encode(i,this.ptr,_,o,v(e),v(t));var d=y()[i/4+0],a=y()[i/4+1],u=y()[i/4+2];if(y()[i/4+3])throw c(u);var l=E(d,a).slice();return r.__wbindgen_export_2(d,4*a),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}},{key:"encode_ordinary",value:function(n){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");try{var e=r.__wbindgen_add_to_stack_pointer(-16),t=s(n,r.__wbindgen_export_0,r.__wbindgen_export_1),i=f;r.tiktoken_encode_ordinary(e,this.ptr,t,i);var _=y()[e/4+0],o=y()[e/4+1],d=E(_,o).slice();return r.__wbindgen_export_2(_,4*o),d}finally{r.__wbindgen_add_to_stack_pointer(16)}}},{key:"encode_with_unstable",value:function(n,e,t){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");try{var i=r.__wbindgen_add_to_stack_pointer(-16),_=s(n,r.__wbindgen_export_0,r.__wbindgen_export_1),o=f;r.tiktoken_encode_with_unstable(i,this.ptr,_,o,v(e),v(t));var d=y()[i/4+0],a=y()[i/4+1];if(y()[i/4+2])throw c(a);return c(d)}finally{r.__wbindgen_add_to_stack_pointer(16)}}},{key:"encode_single_token",value:function(n){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");var e=function(n,e){var t=e(1*n.length);return b().set(n,t/1),f=n.length,t}(n,r.__wbindgen_export_0),t=f;return r.tiktoken_encode_single_token(this.ptr,e,t)>>>0}},{key:"decode",value:function(n){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");try{var e=r.__wbindgen_add_to_stack_pointer(-16),t=function(n,e){var t=e(4*n.length);return A().set(n,t/4),f=n.length,t}(n,r.__wbindgen_export_0),i=f;r.tiktoken_decode(e,this.ptr,t,i);var _=y()[e/4+0],o=y()[e/4+1],d=m(_,o).slice();return r.__wbindgen_export_2(_,1*o),d}finally{r.__wbindgen_add_to_stack_pointer(16)}}},{key:"decode_single_token_bytes",value:function(n){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");try{var e=r.__wbindgen_add_to_stack_pointer(-16);r.tiktoken_decode_single_token_bytes(e,this.ptr,n);var t=y()[e/4+0],i=y()[e/4+1],_=m(t,i).slice();return r.__wbindgen_export_2(t,1*i),_}finally{r.__wbindgen_add_to_stack_pointer(16)}}},{key:"token_byte_values",value:function(){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");return c(r.tiktoken_token_byte_values(this.ptr))}}],[{key:"__wrap",value:function(e){var t=Object.create(n.prototype);return t.ptr=e,t}}]),n}();function W(n){c(n)}function j(n){return void 0===a(n)}function O(){return M((function(n){return v(JSON.stringify(a(n)))}),arguments)}function T(n,e){if(null==r)throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");var t,i=a(e),_="string"===typeof i?i:void 0,o=void 0===(t=_)||null===t?0:s(_,r.__wbindgen_export_0,r.__wbindgen_export_1),d=f;y()[n/4+1]=d,y()[n/4+0]=o}function P(n,e){return v(new Error(h(n,e)))}function J(){return M((function(n,e){return v(JSON.parse(h(n,e)))}),arguments)}function D(n,e){throw new Error(h(n,e))}}).call(this,t(1509)(n))},1508:function(n,e,t){"use strict";var r=t.w[n.i];for(var i in t.r(e),r)"__webpack_init__"!=i&&(e[i]=r[i]);t(1507);r.__webpack_init__()},1509:function(n,e){n.exports=function(n){if(!n.webpackPolyfill){var e=Object.create(n);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}}}]);
static/js/main.618390d8.chunk.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (this.webpackJsonpchatchan=this.webpackJsonpchatchan||[]).push([[0],{1051:function(e,t){},1053:function(e,t){},1063:function(e,t){},1065:function(e,t){},1092:function(e,t){},1093:function(e,t){},1098:function(e,t){},1100:function(e,t){},1107:function(e,t){},1126:function(e,t){},144:function(e,t,a){"use strict";a.d(t,"a",(function(){return b}));var r,n,s=a(10),o=a(12),i=a(15),c=a(16),l=a(0),p=a.n(l),u=a(8),h=a(41),m=a(18),_=a(100),b=(r=Object(u.b)("store"),Object(h.f)(n=r(n=Object(u.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.a)(a,[{key:"render",value:function(){var e=this;return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{className:"std-hr form-div"}),p.a.createElement(m.g,null,p.a.createElement("div",{className:"flex flex-row justify-between"},p.a.createElement("div",{className:"left"},p.a.createElement(m.b,{large:"true",intent:_.a.PRIMARY,onClick:function(){return e.props.onSubmit()}},"\u63d0\u4ea4")),p.a.createElement("div",{className:"right"},this.props.cancel||p.a.createElement(m.b,{large:"true",onClick:function(){return e.props.history.goBack()},className:"right-20"},"\u53d6\u6d88")))))}}]),a}(l.Component))||n)||n)||n)},1462:function(e,t,a){"use strict";a.r(t);var r,n,s,o,i,c,l,p,u,h,m,_,b,f,d,v,y,g,k,j,O,x,w,E=a(0),N=a.n(E),S=a(38),C=a.n(S),q=(a(605),a(10)),A=a(12),z=a(15),I=a(16),T=a(29),P=a(41),W=a(8),M=Object(W.b)("store")(r=Object(W.c)(r=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"render",value:function(){return N.a.createElement("div",{className:"title"},N.a.createElement("h1",null,"Hello\uff0c",this.props.store.appname))}}]),a}(E.Component))||r)||r,D=a(18),U=(n=Object(W.b)("store"),Object(P.f)(s=n(s=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"render",value:function(){var e=this;return N.a.createElement("div",null,N.a.createElement("h1",null,N.a.createElement(M,null)),N.a.createElement("div",null,N.a.createElement(D.b,{onClick:function(){return e.props.store.appname+="\ud83c\udf88"}},"change")),N.a.createElement("div",null,N.a.createElement("span",{onClick:function(){return e.props.history.push("/login")}},"Login")))}}]),a}(E.Component))||s)||s),B=a(52),L=a(169),R=(o=Object(W.b)("store"),Object(P.f)(i=o(i=Object(W.c)(i=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"render",value:function(){var e=N.a.createElement("div",{className:"p-32 "},"FrontPage");return N.a.createElement(B.a,{title:this.props.store.appname,main:e})}}]),a}(E.Component))||i)||i),a(3)),F=a.n(R),J=a(6),H=a(27),K=(c=Object(W.b)("store"),Object(P.f)(l=c(l=Object(W.c)(l=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"componentDidMount",value:function(){var e=Object(J.a)(F.a.mark((function e(){var t,a,r,n;return F.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new URLSearchParams(this.props.location.search),a=t.get("code"),r=t.get("session"),e.next=5,this.props.store.get_token_by_code(a,r);case 5:(null===(n=e.sent)||void 0===n?void 0:n.token)&&this.props.store.set_user(n.user),Object(H.a)()?this.props.history.push("/after/login"):this.props.history.push("/home");case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){return N.a.createElement("div",{className:"flex flex-row pt-20 items-center justify-center"},N.a.createElement(D.n,null))}}]),a}(E.Component))||l)||l)||l),G=a(62),Y=a(57),V=a(219),$=(p=Object(W.b)("store"),Object(P.f)(u=p(u=Object(W.c)(u=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){var e;Object(q.a)(this,a);for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return(e=t.call.apply(t,[this].concat(n))).state={qrcode_url:!1},e}return Object(A.a)(a,[{key:"go",value:function(){if(Object(H.a)())this.props.onClick&&this.props.onClick();else{var e=window.location.origin+"/login/auto/"+this.props.store.token+"?redirect="+encodeURIComponent(window.location.pathname+"?amount="+this.props.amount||100);this.setState({qrcode_url:e})}}},{key:"render",value:function(){var e=this,t=this.props,a=(t.staticContext,t.onClick,Object(Y.a)(t,["staticContext","onClick"]));return N.a.createElement(N.a.Fragment,null,N.a.createElement(D.b,Object.assign({onClick:function(){return e.go()}},a)),this.state.qrcode_url&&N.a.createElement(D.l,{isOpen:this.state.qrcode_url,onClose:function(){return e.setState({qrcode_url:!1})}},N.a.createElement("div",{className:"center-box bg-white p-10 rounded"},N.a.createElement(V.a,{value:this.state.qrcode_url}),N.a.createElement("div",{className:"mt-2"},"\u8bf7\u7528\u5fae\u4fe1\u626b\u7801\u652f\u4ed8"))))}}]),a}(E.Component))||u)||u)||u),X=(h=Object(W.b)("store"),Object(P.f)(m=h(m=Object(W.c)(m=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){var e;Object(q.a)(this,a);for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return(e=t.call.apply(t,[this].concat(n))).state={jsinfo:!1},e}return Object(A.a)(a,[{key:"componentDidMount",value:function(){var e=parseInt(new URLSearchParams(this.props.location.search).get("amount"));function t(){}this.props.store.recharge_input_coin||(this.props.store.recharge_input_coin=e),"undefined"==typeof WeixinJSBridge&&(document.addEventListener?document.addEventListener("WeixinJSBridgeReady",t,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",t),document.attachEvent("onWeixinJSBridgeReady",t)))}},{key:"launch",value:function(){var e=this;WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:this.state.jsinfo.appId,timeStamp:this.state.jsinfo.timestamp,nonceStr:this.state.jsinfo.nonceStr,package:this.state.jsinfo.package,signType:this.state.jsinfo.signType,paySign:this.state.jsinfo.paySign},(function(t){"get_brand_wcpay_request:ok"==t.err_msg&&(Object(H.b)("\u652f\u4ed8\u6570\u636e\u5904\u7406\u4e2d..."),e.props.history.push("/profile"))})),console.log("launch")}},{key:"recharge",value:function(){var e=Object(J.a)(F.a.mark((function e(){var t,a=this;return F.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.store.preorder(this.props.store.recharge_input_coin);case 2:(t=e.sent)&&(t.result&&(this.setState({jsinfo:t.result}),window.setTimeout((function(){return a.launch()}),600)),t.error&&Object(H.b)(t.error.err_code_des));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=N.a.createElement("div",{className:"p-2 recharge-page"},N.a.createElement("div",{className:"price"},(this.props.store.recharge_input_coin/100).toFixed(2)),N.a.createElement(G.a,{field:"recharge_input_coin",type:"number",placeholder:"\u8bf7\u8f93\u5165\u8981\u8d2d\u4e70\u7684"+this.props.store.coin_name+"\u6570\u91cf"}),N.a.createElement($,{amount:this.props.store.recharge_input_coin,large:!0,onClick:function(){return e.recharge()}},"\u5145\u503c"));return N.a.createElement(B.a,{title:this.props.store.appname,main:t})}}]),a}(E.Component))||m)||m)||m),Z=(_=Object(W.b)("store"),Object(P.f)(b=_(b=Object(W.c)(b=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"componentDidMount",value:function(){var e=Object(J.a)(F.a.mark((function e(){return F.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.store.logout();case 2:this.props.history.replace("/");case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=N.a.createElement("div",{className:"flex flex-row pt-20 items-center justify-center"},N.a.createElement(D.n,null));return N.a.createElement(B.a,{title:this.props.store.appname,main:e})}}]),a}(E.Component))||b)||b)||b),Q=(f=Object(W.b)("store"),Object(P.f)(d=f(d=Object(W.c)(d=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){var e;Object(q.a)(this,a);for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return(e=t.call.apply(t,[this].concat(n))).state={user:!1},e}return Object(A.a)(a,[{key:"componentDidMount",value:function(){var e=Object(J.a)(F.a.mark((function e(){var t;return F.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.store.get_user_profile();case 2:(t=e.sent)&&t.user&&(this.setState({user:t.user}),this.props.store.set_user(t.user));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this.state.user;if(!e)return null;var t=N.a.createElement("div",{className:"p-2 flex flex-col profile-page"},N.a.createElement("div",{className:"profile"},N.a.createElement("div",{className:"avatar"},N.a.createElement("img",{src:e.avatar_url,alt:""}),N.a.createElement("div",{className:"explain"},e.name))),N.a.createElement("div",{className:"detail"},N.a.createElement("div",{className:"row"},N.a.createElement("div",{className:"left"},"Level"),N.a.createElement("div",{className:"right"},e.level)),N.a.createElement("div",{className:"row"},N.a.createElement("div",{className:"left"},"Coin"),N.a.createElement("div",{className:"right"},e.coin))));return N.a.createElement(B.a,{title:this.props.store.appname,main:t})}}]),a}(E.Component))||d)||d)||d),ee=(v=Object(W.b)("store"),Object(P.f)(y=v(y=Object(W.c)(y=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"componentDidMount",value:function(){document.querySelector("#wechat-login-btn").click()}},{key:"render",value:function(){var e=N.a.createElement("div",{className:"flex flex-row pt-12 items-center justify-center"},N.a.createElement(L.a,{large:!0}));return N.a.createElement(B.a,{title:this.props.store.appname,main:e})}}]),a}(E.Component))||y)||y)||y),te=(g=Object(W.b)("store"),Object(P.f)(k=g(k=Object(W.c)(k=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"render",value:function(){var e=N.a.createElement("div",{className:"py-5 px-5 md:px-0 text-xl"},"\u767b\u5165\u6210\u529f\uff0c\u8bf7\u56de\u5230\u7535\u8111\u70b9\u51fb\u6309\u94ae\u7ee7\u7eed\u3002\u6216\u8005\u70b9\u51fb\u53f3\u4e0a\u89d2\u83dc\u5355\u8fdb\u884c\u64cd\u4f5c\u3002");return N.a.createElement(B.a,{title:this.props.store.appname,main:e})}}]),a}(E.Component))||k)||k)||k),ae=(j=Object(W.b)("store"),Object(P.f)(O=j(O=Object(W.c)(O=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"componentDidMount",value:function(){var e=Object(J.a)(F.a.mark((function e(){var t,a,r,n;return F.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.match.params.token,e.next=3,this.props.store.check_user_info(t);case 3:a=e.sent,console.log(a),a&&a.user&&(this.props.store.set_user(a.user),r=new URLSearchParams(this.props.location.search),(n=r.get("redirect"))||(n="/recharge"),this.props.history.push(n));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=N.a.createElement("div",{className:"py-5 px-5 md:px-0"},N.a.createElement("div",{className:"p-5 flex justify-center"},N.a.createElement(D.n,null)));return N.a.createElement(B.a,{title:this.props.store.appname,main:e})}}]),a}(E.Component))||O)||O)||O),re=a(304),ne=a(482),se=a(144),oe=(x=Object(W.b)("store"),Object(P.f)(w=x(w=Object(W.c)(w=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"submit",value:function(){var e=Object(J.a)(F.a.mark((function e(){var t,a,r,n,s,o;return F.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.props.store._donate_keys.trim().split("\n"),a=[],Object(H.b)("\u6b63\u5728\u9a8c\u8bc1KEY\uff0c\u8bf7\u7a0d\u5019"),r=Object(ne.a)(t),e.prev=4,r.s();case 6:if((n=r.n()).done){e.next=14;break}return s=n.value,e.next=10,this.props.store.api.rawPost("".concat(this.props.store.local_apibase,"/chat/verify"),{key:s});case 10:(o=e.sent)&&"done"==o.message&&a.push(s);case 12:e.next=6;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(4),r.e(e.t0);case 19:return e.prev=19,r.f(),e.finish(19);case 22:if(!(a.length<1)){e.next=27;break}return Object(H.b)("\u6ca1\u6709\u662f\u6709\u6548\u7684KEY"),e.abrupt("return");case 27:Object(H.b)("".concat(a.length,"\u4e2aKEY\u901a\u8fc7\u6821\u9a8c\uff0c\u6b63\u5728\u63d0\u4ea4\u6570\u636e"));case 28:case"end":return e.stop()}}),e,this,[[4,16,19,22]])})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=N.a.createElement("div",{className:"p-12"},N.a.createElement("div",{className:"text-center text-2xl"},"\u8d5e\u52a9OpenAI KEY"),N.a.createElement(G.a,{type:"textarea",fill:!0,label:"OpenAI KEY",field:"_donate_keys",placeholder:"\u4e00\u884c\u4e00\u4e2aKey\uff0c\u5f62\u5982 sk... "}),N.a.createElement(G.a,{label:"\u6587\u5b57\u5e7f\u544a\u6587\u6848",field:"_donate_title",placeholder:"30\u5b57\u7b26\u5185\uff0c\u4f1a\u4eba\u5de5\u5ba1\u6838\uff0c\u8fdd\u53cd\u5185\u5730\u6cd5\u5f8b\u6cd5\u89c4\u548c\u4e0d\u771f\u5b9e\u5185\u5bb9\u5c06\u4e0d\u4f1a\u901a\u8fc7"}),N.a.createElement(G.a,{label:"\u6587\u5b57\u5e7f\u544a\u94fe\u63a5",field:"_donate_link",placeholder:"https://... \u53ef\u586b\u5165\u4e2a\u4eba\u7f51\u7ad9\u3001\u7f51\u5e97\u3001\u535a\u5ba2\u4e4b\u7c7b"}),N.a.createElement(se.a,{label:"\u63d0\u4ea4",onSubmit:function(){return e.submit()}}),N.a.createElement("div",{className:"text-lg mt-8"},"\u6548\u679c\u9884\u89c8"),N.a.createElement("div",{className:"preview border rounded p-5 mt-5"},N.a.createElement("div",{className:"line-1"},"\u60a8\u4f7f\u7528\u7684 Key \u7531 ",N.a.createElement("span",{className:"text-blue-500"},this.props.store.user.name)," \u53cb\u60c5\u63d0\u4f9b"),N.a.createElement("div",{className:"line-2 mt-3 flex flex-row item-center"},N.a.createElement("span",{className:"text-white bg-gray-300 rounded px-1 mr-2"},"\u5e7f\u544a"),N.a.createElement("a",{href:this.props.store._donate_link||"https://stack.ftqq.com/subscribe",target:"_blank"},this.props.store._donate_title||"\u65b9\u7cd6\u8d85\u7ea7\u4f1a\u5458\xb7\u52a9\u529b\u4ece\u87ba\u4e1d\u9489\u5230\u4e00\u4eba\u4f01\u4e1a"))));return N.a.createElement(B.a,{title:this.props.store.appname,main:t})}}]),a}(E.Component))||w)||w)||w),ie=a(483),ce=function(e){Object(z.a)(a,e);var t=Object(I.a)(a);function a(){return Object(q.a)(this,a),t.apply(this,arguments)}return Object(A.a)(a,[{key:"render",value:function(){return N.a.createElement(T.a,null,N.a.createElement(P.c,null,N.a.createElement(P.a,{path:"/donate",component:oe}),N.a.createElement(P.a,{path:"/chat",component:re.a}),N.a.createElement(P.a,{path:"/login/auto/:token",component:ae}),N.a.createElement(P.a,{path:"/after/login",component:te}),N.a.createElement(P.a,{path:"/profile",component:Q}),N.a.createElement(P.a,{path:"/recharge",component:X}),N.a.createElement(P.a,{path:"/logout",component:Z}),N.a.createElement(P.a,{path:"/logback",component:K}),N.a.createElement(P.a,{path:"/login",component:ee}),N.a.createElement(P.a,{path:"/index",component:U}),N.a.createElement(P.a,{path:"/share/:info",component:ie.a}),N.a.createElement(P.a,{path:"/",component:re.a})))}}]),a}(E.Component);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var le=a(232);console.log("Welcome to ".concat(le.a.appname)),console.log=function(){},C.a.render(N.a.createElement(W.a,{store:le.a},N.a.createElement(ce,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},169:function(e,t,a){"use strict";a.d(t,"a",(function(){return j}));var r,n,s=a(57),o=a(3),i=a.n(o),c=a(6),l=a(10),p=a(12),u=a(15),h=a(16),m=a(0),_=a.n(m),b=a(8),f=a(41),d=a(18),v=a(27),y=a(219),g=a(468),k=a.n(g),j=(r=Object(b.b)("store"),Object(f.f)(n=r(n=Object(b.c)(n=function(e){Object(u.a)(a,e);var t=Object(h.a)(a);function a(){var e;Object(l.a)(this,a);for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return(e=t.call.apply(t,[this].concat(n))).state={qrcode_url:!1},e}return Object(p.a)(a,[{key:"go",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.props.store.session=k()({length:32}),e.next=3,this.props.store.get_wechat_login_url();case 3:(t=e.sent)&&t.url&&(Object(v.a)()?window.location=t.url:(this.setState({qrcode_url:t.url}),console.log(t.url)));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"check",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.store.session,e.next=3,this.props.store.check_user_info(t);case 3:(a=e.sent)&&a.code>0?Object(v.b)("\u8bf7\u626b\u7801\u540e\u518d\u70b9\u51fb\u6b64\u6309\u94ae"):a&&a.user&&(this.props.store.set_user(a.user),this.setState({qrcode_url:!1}),Object(v.a)()?this.props.history.push("/after/login"):this.props.history.push("/home"));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=this.props,a=(t.staticContext,t.onClick,Object(s.a)(t,["staticContext","onClick"]));return _.a.createElement(_.a.Fragment,null,_.a.createElement(d.b,Object.assign({id:"wechat-login-btn",text:"\u5fae\u4fe1\u767b\u5165",onClick:function(){return e.go()}},a)),this.state.qrcode_url&&_.a.createElement(d.l,{isOpen:this.state.qrcode_url,canOutsideClickClose:!1,onClose:function(){return e.setState({qrcode_url:!1})}},_.a.createElement("div",{className:"center-box bg-white p-10 rounded"},_.a.createElement(y.a,{value:this.state.qrcode_url}),_.a.createElement("div",{className:"mt-2"},_.a.createElement(d.b,{large:!0,onClick:function(){return e.check()}},"\u5fae\u4fe1\u626b\u7801\u540e\u70b9\u6b64\u7ee7\u7eed")))))}}]),a}(m.Component))||n)||n)||n)},177:function(e,t,a){"use strict";a.d(t,"a",(function(){return _}));var r,n,s=a(10),o=a(12),i=a(15),c=a(16),l=a(0),p=a.n(l),u=a(8),h=a(41),m=a(18),_=(r=Object(u.b)("store"),Object(h.f)(n=r(n=Object(u.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.a)(a,[{key:"change",value:function(e){this.props.store[this.props.field]=e.target.checked?"yes":"no",this.props.onUpdate&&this.props.onUpdate(this.props.store[this.props.field])}},{key:"render",value:function(){var e=this,t=1,a=Date.now(),r=this.props.field;return p.a.createElement("div",{className:"my-2 "+this.props.className||!1},p.a.createElement(m.d,{key:a+t++,checked:"yes"==this.props.store[r],label:this.props.label,onChange:function(t){return e.change(t)},inline:!0}))}}]),a}(l.Component))||n)||n)||n)},219:function(e,t,a){"use strict";a.d(t,"a",(function(){return _}));var r,n=a(14),s=a(10),o=a(12),i=a(15),c=a(16),l=a(0),p=a.n(l),u=a(41),h=a(467),m=a.n(h),_=Object(u.f)(r=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){var e;Object(s.a)(this,a);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))).state={value:e.props.value,img_url:""},e}return Object(o.a)(a,[{key:"componentDidMount",value:function(){var e=this;this.ck=setInterval((function(){return e.check()}),500)}},{key:"componentWillUnmount",value:function(){this.ck&&clearInterval(this.ck)}},{key:"check",value:function(){var e=document.getElementById("theqr__inbox");e&&(this.setState({img_url:e.toDataURL("image/png")}),clearInterval(this.ck))}},{key:"render",value:function(){return p.a.createElement("div",{className:this.props.className},this.state.img_url.length>0?p.a.createElement("img",{style:{maxWidth:200},src:this.state.img_url}):p.a.createElement(m.a,Object(n.a)({size:200,value:this.state.value,includeMargin:!0,id:"theqr__inbox"},"includeMargin",!0)))}}]),a}(l.Component))||r},232:function(e,t,a){"use strict";var r,n,s,o,i,c,l,p,u,h,m,_,b,f,d,v,y,g,k,j,O,x,w,E,N,S,C,q,A,z,I,T,P,W,M,D,U,B,L=a(3),R=a.n(L),F=a(6),J=a(33),H=a(10),K=a(12),G=a(30),Y=(a(634),a(11)),V=a(27),$=a(234),X=a.n($),Z=function(){function e(t){Object(H.a)(this,e),this.store=t}return Object(K.a)(e,[{key:"get",value:function(){var e=Object(F.a)(R.a.mark((function e(t){var a,r,n=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.length>1&&void 0!==n[1]?n[1]:null,r=null==a?this.store.apibase+t:this.store.apibase+t+ds+new URLSearchParams(a).toString(),e.abrupt("return",this.rawGet(r));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rawGet",value:function(){var e=Object(F.a)(R.a.mark((function e(t){return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.next=3,X.a.get(t);case 3:return e.t1=e.sent,e.abrupt("return",e.t0.return_data.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"post",value:function(){var e=Object(F.a)(R.a.mark((function e(t){var a,r,n,s,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:null,r=!(o.length>2&&void 0!==o[2])||o[2],n=!(o.length>3&&void 0!==o[3])||o[3],s=this.store.apibase+t,e.abrupt("return",this.rawPost(s,a,r,n));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rawPost",value:function(){var e=Object(F.a)(R.a.mark((function e(t){var a,r,n,s,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:null,r=!(o.length>2&&void 0!==o[2])||o[2],n=!(o.length>3&&void 0!==o[3])||o[3],e.prev=3,s=new URLSearchParams,a&&Object.keys(a).forEach((function(e){return s.append(e,a[e])})),r&&this.store.token&&s.append("token",this.store.token),e.t0=this,e.next=10,X.a.post(t,s);case 10:return e.t1=e.sent,e.t2=n,e.abrupt("return",e.t0.return_data.call(e.t0,e.t1,e.t2));case 15:return e.prev=15,e.t3=e.catch(3),console.log(e.t3),e.abrupt("return",!1);case 19:case"end":return e.stop()}}),e,this,[[3,15]])})));return function(t){return e.apply(this,arguments)}}()},{key:"upload",value:function(){var e=Object(F.a)(R.a.mark((function e(t){var a,r,n,s,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:null,r=!(o.length>2&&void 0!==o[2])||o[2],n=!(o.length>3&&void 0!==o[3])||o[3],s=new FormData,a&&Object.keys(a).forEach((function(e){return s.append(e,a[e])})),r&&this.store.token&&s.append("token",this.store.token),e.t0=this,e.next=9,X.a.post(this.store.apibase+t,s);case 9:return e.t1=e.sent,e.t2=n,e.next=13,e.t0.return_data.call(e.t0,e.t1,e.t2);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"return_data",value:function(){var e=Object(F.a)(R.a.mark((function e(t){var a=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(a.length>1&&void 0!==a[1])||a[1],200!=parseInt(t.status)){e.next=8;break}if(!t.data){e.next=5;break}return 80403==t.data.code&&(Object(V.b)("\u8bf7\u767b\u5165\u540e\u7ee7\u7eed"),window.location="/login"),e.abrupt("return",t.data);case 5:return e.abrupt("return",!1);case 8:console.log(t);case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),Q=(r=function(){function e(){Object(H.a)(this,e),Object(J.a)(this,"appname",n,this),Object(J.a)(this,"apibase",s,this),Object(J.a)(this,"local_apibase",o,this),Object(J.a)(this,"session",i,this),Object(J.a)(this,"token",c,this),Object(J.a)(this,"user",l,this),Object(J.a)(this,"api_endpoints",p,this),this.version="3.0.1",this.endpoint_count=0,this.ftopenapp_id="26",this.to_save_vars=["user","token","_chat_saved_list","_chat_model","_chat_key","_chat_api_url","_chat_avatar_url","_chat_max_tokens","_chat_temperature","_chat_timeout","_chat_char_opacity","_chat_system_prompt","_chat_user_prompt","_chat_last","_chat_history_count","_chat_auto_save","_chat_summarize_content","_chat_auto_audio","_chat_bg_url","_chat_pin_window","_preset_saved_list"],Object(J.a)(this,"menu",u,this),Object(J.a)(this,"coin_name",h,this),Object(J.a)(this,"recharge_input_coin",m,this),Object(J.a)(this,"_donate_keys",_,this),Object(J.a)(this,"_donate_title",b,this),Object(J.a)(this,"_donate_link",f,this),Object(J.a)(this,"_chat_model",d,this),Object(J.a)(this,"_chat_saved_list",v,this),Object(J.a)(this,"_preset_saved_list",y,this),Object(J.a)(this,"_chat_key",g,this),Object(J.a)(this,"_chat_api_url",k,this),Object(J.a)(this,"_chat_avatar_url",j,this),Object(J.a)(this,"_chat_bg_url",O,this),Object(J.a)(this,"_chat_max_tokens",x,this),Object(J.a)(this,"_chat_temperature",w,this),Object(J.a)(this,"_chat_timeout",E,this),Object(J.a)(this,"_chat_system_prompt",N,this),Object(J.a)(this,"_chat_user_prompt",S,this),Object(J.a)(this,"_chat_char_opacity",C,this),Object(J.a)(this,"_chat_history_count",q,this),Object(J.a)(this,"_chat_last",A,this),Object(J.a)(this,"_chat_auto_save",z,this),Object(J.a)(this,"_chat_summarize_content",I,this),Object(J.a)(this,"_chat_auto_audio",T,this),Object(J.a)(this,"_chat_pin_window",P,this),Object(J.a)(this,"_preset_system_prompt",W,this),Object(J.a)(this,"_preset_user_prompt",M,this),Object(J.a)(this,"_preset_prompt_title",D,this),Object(J.a)(this,"_preset_prompt_id",U,this),Object(J.a)(this,"_chat_moderation_on",B,this),this._chat_stream=!0,this.api=new Z(this),this.load_vars(),this.load_api_endpoints()}return Object(K.a)(e,[{key:"load_api_endpoints",value:function(){var e=Object(F.a)(R.a.mark((function e(){var t,a;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("https://domain.api2d.org/");case 2:return t=e.sent,e.next=5,t.json();case 5:(a=e.sent)&&a.length>0&&(this.api_endpoints=a);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"load_default",value:function(){var e=Object(F.a)(R.a.mark((function e(){var t,a;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("default.json");case 3:return t=e.sent,e.next=6,t.json();case 6:(a=e.sent).app_name&&(this.appname=a.app_name),a.api_key&&(this._chat_key=a.api_key),a.api_url&&(this._chat_api_url=a.api_url),a.chat_model&&(this._chat_model=a.chat_model),a.chat_max_tokens&&(this._chat_max_tokens=a.chat_max_tokens),a.chat_temperature&&(this._chat_temperature=a.chat_temperature),a.chat_timeout&&(this._chat_timeout=a.chat_timeout),a.chat_system_prompt&&(this._chat_system_prompt=a.chat_system_prompt),a.chat_user_prompt&&(this._chat_user_prompt=a.chat_user_prompt),a.chat_character_url&&(this._chat_avatar_url=a.chat_character_url),a.chat_character_opacity&&(this._chat_opacity=a.chat_character_opacity),a.chat_moderation&&(this._chat_moderation_on="on"==a.chat_moderation),e.next=23;break;case 21:e.prev=21,e.t0=e.catch(0);case 23:case"end":return e.stop()}}),e,this,[[0,21]])})));return function(){return e.apply(this,arguments)}}()},{key:"load_vars",value:function(){var e=Object(F.a)(R.a.mark((function e(){var t=this;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.load_default();case 2:this.to_save_vars.forEach((function(e){var a=window.localStorage.getItem("FT_CHATCHAN_VAR_"+e);a&&(t[e]=JSON.parse(a))}));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"save_vars",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=null===t?this.to_save_vars:[t];a.forEach((function(t){window.localStorage.setItem("FT_CHATCHAN_VAR_"+t,JSON.stringify(e[t]))}))}},{key:"get_wechat_login_url",value:function(){var e=Object(F.a)(R.a.mark((function e(){var t,a,r,n=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.ftopenapp_id,a=n.length>1&&void 0!==n[1]?n[1]:this.session,e.next=4,this.api.get("global/user/get_wx_sns_login_url?id="+t+"&session="+a);case 4:return r=e.sent,e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"get_token_by_code",value:function(){var e=Object(F.a)(R.a.mark((function e(t){var a,r,n=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.length>1&&void 0!==n[1]?n[1]:"",e.next=3,this.api.post("global/user/get_token_by_wx_code",{code:t,session:a});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"preorder",value:function(){var e=Object(F.a)(R.a.mark((function e(t){var a;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.api.post("global/pay/order",{amount_cent:t});case 2:return a=e.sent,e.abrupt("return",a);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"logout",value:function(){this.user=null,this.token=null,window.localStorage.clear()}},{key:"set_user",value:function(e){this.user=e,this.token=e.session_id,this.save_vars()}},{key:"check_user_info",value:function(){var e=Object(F.a)(R.a.mark((function e(){var t,a,r,n=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=n.length>0&&void 0!==n[0]?n[0]:null)){e.next=8;break}return e.next=4,this.api.post("global/user/get_user_session",{token:t},!1);case 4:return a=e.sent,e.abrupt("return",a);case 8:return e.next=10,this.api.post("global/user/get_user_session");case 10:return r=e.sent,e.abrupt("return",r);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"get_user_profile",value:function(){var e=Object(F.a)(R.a.mark((function e(){var t;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.api.post("global/user/profile");case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),n=Object(G.a)(r.prototype,"appname",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"BioinfoArk"}}),s=Object(G.a)(r.prototype,"apibase",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"https://openapi.ftqq.com/"}}),o=Object(G.a)(r.prototype,"local_apibase",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),i=Object(G.a)(r.prototype,"session",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),c=Object(G.a)(r.prototype,"token",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),l=Object(G.a)(r.prototype,"user",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),p=Object(G.a)(r.prototype,"api_endpoints",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),u=Object(G.a)(r.prototype,"menu",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[{id:8001,text:"\u9996\u9875",link:"/home",member_only:!1}]}}),Object(G.a)(r.prototype,"logout",[Y.f],Object.getOwnPropertyDescriptor(r.prototype,"logout"),r.prototype),Object(G.a)(r.prototype,"set_user",[Y.f],Object.getOwnPropertyDescriptor(r.prototype,"set_user"),r.prototype),h=Object(G.a)(r.prototype,"coin_name",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"\u91d1\u5e01"}}),m=Object(G.a)(r.prototype,"recharge_input_coin",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),_=Object(G.a)(r.prototype,"_donate_keys",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),b=Object(G.a)(r.prototype,"_donate_title",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),f=Object(G.a)(r.prototype,"_donate_link",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),d=Object(G.a)(r.prototype,"_chat_model",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"gpt-3.5-turbo"}}),v=Object(G.a)(r.prototype,"_chat_saved_list",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),y=Object(G.a)(r.prototype,"_preset_saved_list",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),g=Object(G.a)(r.prototype,"_chat_key",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),k=Object(G.a)(r.prototype,"_chat_api_url",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"https://openai.api2d.net"}}),j=Object(G.a)(r.prototype,"_chat_avatar_url",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),O=Object(G.a)(r.prototype,"_chat_bg_url",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),x=Object(G.a)(r.prototype,"_chat_max_tokens",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1e3}}),w=Object(G.a)(r.prototype,"_chat_temperature",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return.1}}),E=Object(G.a)(r.prototype,"_chat_timeout",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 60}}),N=Object(G.a)(r.prototype,"_chat_system_prompt",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),S=Object(G.a)(r.prototype,"_chat_user_prompt",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),C=Object(G.a)(r.prototype,"_chat_char_opacity",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 80}}),q=Object(G.a)(r.prototype,"_chat_history_count",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 6}}),A=Object(G.a)(r.prototype,"_chat_last",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),z=Object(G.a)(r.prototype,"_chat_auto_save",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),I=Object(G.a)(r.prototype,"_chat_summarize_content",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),T=Object(G.a)(r.prototype,"_chat_auto_audio",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"no"}}),P=Object(G.a)(r.prototype,"_chat_pin_window",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"no"}}),W=Object(G.a)(r.prototype,"_preset_system_prompt",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),M=Object(G.a)(r.prototype,"_preset_user_prompt",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),D=Object(G.a)(r.prototype,"_preset_prompt_title",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),U=Object(G.a)(r.prototype,"_preset_prompt_id",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),B=Object(G.a)(r.prototype,"_chat_moderation_on",[Y.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),r);t.a=new Q},27:function(e,t,a){"use strict";a(232);var r=a(18),n=a(53),s=r.r.create({className:"lm-toaster",position:n.a.TOP});a(652),a(653);function o(){return"micromessenger"==navigator.userAgent.toLowerCase().match(/MicroMessenger/i)}function i(e){s.show({message:e})}a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return i}))},304:function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return I}));var r,n,s=a(14),o=a(3),i=a.n(o),c=a(6),l=a(10),p=a(12),u=a(15),h=a(16),m=a(0),_=a.n(m),b=a(8),f=a(41),d=a(52),v=a(18),y=a(27),g=(a(1143),a(488)),k=a(471),j=a(62),O=a(144),x=a(305),w=a(480),E=a(177),N=a(221),S=a(481),C=a.n(S),q=a(235),A=a(485),z=a(224),I=(r=Object(b.b)("store"),Object(f.f)(n=r(n=Object(b.c)(n=function(t){Object(u.a)(n,t);var r=Object(h.a)(n);function n(){var e;Object(l.a)(this,n);for(var t=arguments.length,a=new Array(t),s=0;s<t;s++)a[s]=arguments[s];return(e=r.call.apply(r,[this].concat(a))).state={actions:{},list:[],text:"",last:!1,loading:!1,typing:"",force_cn:!1,connect:!1,show_tips:!1,in:!1,saved_list:{},settings_open:!1,avatar_open:!1,show_undo:!1,point:"-",show_extend_settings:!1,snap:!1,tab_selected:"history",prompt_box:!1},e.handleFile=function(t){var a=t.target.files[0];if("application/json"===a.type){var r=new FileReader;r.onload=function(t){var a=JSON.parse(t.target.result);if(a&&a.chat_list){for(var r=e.props.store._chat_saved_list,n=a.chat_list,s=[],o=0;o<n.length;o++){for(var i=!1,c=0;c<r.length;c++)if(r[c].id==n[o].id){i=!0;break}i||s.push(n[o])}e.props.store._chat_saved_list=r.concat(s),e.props.store.save_vars("_chat_saved_list")}if(a&&a.preset_list){for(var l=e.props.store._preset_saved_list,p=a.preset_list,u=[],h=0;h<p.length;h++){for(var m=!1,_=0;_<l.length;_++)if(l[_].id==p[h].id){m=!0;break}m||u.push(p[h])}e.props.store._preset_saved_list=l.concat(u),e.props.store.save_vars("_preset_saved_list")}},r.readAsText(a)}else alert("Please select a JSON file")},e}return Object(p.a)(n,[{key:"componentDidMount",value:function(){var e=this;this.init(),this.audio_to_play=[],window.location.hostname.match(/ftqq.com$/)&&this.setState({in:!0}),document.addEventListener("keydown",(function(t){var a;13===t.keyCode&&(t.metaKey||t.ctrlKey)&&e.send(null===(a=e.state.text)||void 0===a?void 0:a.trim())})),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,window.setTimeout((function(){var t;(e.props.store._chat_key&&e.props.store._chat_key.length>10&&e.refresh_point(),e.state.list.length<1&&e.props.store._chat_last&&e.props.store._chat_last.length>0&&e.setState({list:e.props.store._chat_last}),"yes"==e.props.store._chat_pin_window)&&(window&&window.electronAPI&&(null===(t=window.electronAPI)||void 0===t?void 0:t.pinWindow)&&(window.electronAPI.pinWindow(!0),console.log("set window float")));e.check_bottom_effect()}),1e3),document.addEventListener("visibilitychange",(function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()}))}},{key:"init",value:function(){var e=Object(c.a)(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a.e(3).then(a.bind(null,1466));case 3:this.tiktoken=e.sent,e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),console.log("wasm\u8f7d\u5165\u9519\u8bef",e.t0),Object(y.b)("wasm\u8f7d\u5165\u5931\u8d25\uff0c\u8fdb\u5165\u517c\u5bb9\u6a21\u5f0f\uff0c\u5982\u9047400\u9519\u8bef\uff0c\u8bf7\u6e05\u7406\u5bf9\u8bdd\u8bb0\u5f55");case 10:case"end":return e.stop()}}),e,this,[[0,6]])})));return function(){return e.apply(this,arguments)}}()},{key:"onChange",value:function(e,t){this.setState(Object(s.a)({},t,e.target.value))}},{key:"save_key",value:function(){var e=Object(c.a)(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.props.store._chat_key.length<10)){e.next=3;break}return Object(y.b)("\u8bf7\u8f93\u5165\u6b63\u786e\u7684OpenAPI/API2D Key"),e.abrupt("return",!1);case 3:this.props.store.save_vars(),this.api2d_instance=null,Object(y.b)("\u4fdd\u5b58\u6210\u529f");case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"clean_conversation",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(a.length>0&&void 0!==a[0])||a[0],"yes"!=this.props.store._chat_auto_save||!t){e.next=4;break}return e.next=4,this.save_conversation();case 4:this.old_list=this.state.list.slice(),this.setState({last:!1,list:[],loading:!1,show_undo:!0}),this.props.store._chat_last=[],this.props.store.save_vars("_chat_last"),Object(y.b)("\u5bf9\u8bdd\u5df2\u6e05\u9664\uff0c\u53ef\u70b9\u6062\u590d\u6309\u94ae\u64a4\u9500");case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"undo_conversation",value:function(){var e=Object(c.a)(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.old_list&&(this.setState({last:!1,list:this.old_list,loading:!1,show_undo:!1}),window.setTimeout((function(){document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight}),300));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"remove_list",value:function(){var e=Object(c.a)(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.store._chat_saved_list=this.props.store._chat_saved_list.filter((function(e){return e.id!=t})),this.props.store.save_vars(),this.check_bottom_effect();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rename_conversation",value:function(){var e=Object(c.a)(i.a.mark((function e(t,a){var r,n,s,o;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getApiInstance(),e.prev=1,e.next=4,r.completion({messages:[{role:"system",content:"\u4f60\u662f\u4e00\u4e2a\u7ecf\u9a8c\u4e30\u5bcc\u7684\u8bb0\u5f55\u5458\uff0c\u64c5\u957f\u4ece\u5bf9\u8bdd\u4e2d\u63d0\u53d6\u5173\u952e\u4fe1\u606f\uff0c\u5e76\u4e3a\u5bf9\u8bdd\u547d\u540d\u3002"},{role:"user",content:"\u8bf7\u4e3a\u4ee5\u4e0b\u5bf9\u8bdd\u547d\u540d\uff0c\u4f18\u5148\u4f7f\u7528\u4e2d\u6587\uff0c\u76f4\u63a5\u8fd4\u56de\u540d\u79f0\uff0c\u957f\u5ea6\u5c3d\u91cf\u572830\u4e2a\u5b57\u4ee5\u5185\u3002\u5bf9\u8bdd\u5185\u5bb9\uff1a"+a}],temperature:0,max_tokens:50,model:"gpt-3.5-turbo",stream:!1});case 4:n=e.sent,console.log(n),n&&n.choices&&n.choices.length>0&&((o=null===(s=n.choices[0].message)||void 0===s?void 0:s.content).length>30&&(o=o.substring(0,30)),this.props.store._chat_saved_list=this.props.store._chat_saved_list.map((function(e){return e.id==t&&(e.name=o),e})),this.props.store.save_vars("_chat_saved_list")),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),console.log(e.t0);case 12:case"end":return e.stop()}}),e,this,[[1,9]])})));return function(t,a){return e.apply(this,arguments)}}()},{key:"save_conversation",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a,r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.state.list.length<1)){e.next=2;break}return e.abrupt("return",!1);case 2:t=this.state.list[0].text.substring(0,10)+"-"+(new Date).getTime(),a=(new Date).getTime(),console.log("conversation_id",a),r=this.state.list.map((function(e){return e.text})).join("\n"),this.props.store._chat_saved_list.length>100&&this.props.store._chat_saved_list.shift(),this.props.store._chat_saved_list.push({name:t,list:this.state.list,id:a}),this.props.store.save_vars(),this.check_bottom_effect(),"yes"==this.props.store._chat_summarize_content&&this.rename_conversation(a,r.substring(0,800));case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getApiInstance",value:function(){return this.api2d_instance||(this.api2d_instance=new g.a(this.props.store._chat_key)),this.api2d_instance}},{key:"regen_conversation",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a,r,n,s,o,c,l,p,u,h,m,_,b,f,d,v,g,k=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({list:this.state.list.slice(0,-1)}),t=[],a=0,r=this.state.list.length-2;case 4:if(!(r>=0)){e.next=12;break}if(t.unshift(this.state.list[r]),!(++a>=this.props.store._chat_history_count)){e.next=9;break}return e.abrupt("break",12);case 9:r--,e.next=4;break;case 12:console.log("new_list",JSON.stringify(t)),n=[],s=0,o=0;case 16:if(!(o<t.length)){e.next=27;break}if(!(s+t[o].text.length>this.props.store._chat_max_tokens)){e.next=19;break}return e.abrupt("break",27);case 19:"me"==(c=t[o].role)&&(c="user"),"robot"==c&&(c="assistant"),l={role:c,content:t[o].text},n.push(l);case 24:o++,e.next=16;break;case 27:return console.log("history",JSON.stringify(n)),e.prev=28,h=this.getApiInstance(),e.next=32,h.completion({messages:n,temperature:null!==(p=parseFloat(this.props.store._chat_temperature))&&void 0!==p?p:0,max_tokens:null!==(u=parseInt(this.props.store._chat_max_tokens))&&void 0!==u?u:1e3,model:this.props.store._chat_model||"gpt-3.5-turbo",stream:this.props.store._chat_stream,moderation:this.props.store._chat_key.startsWith("fk")&&this.props.store._chat_moderation,moderation_stop:!0,noCache:this.props.store._chat_key.startsWith("fk"),onMessage:function(e){console.log("onMessage",e),k.setState({typing:e}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight},onEnd:function(e){k.setState({typing:""}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight}});case 32:m=e.sent,console.log("ret",m),m&&(this.setState({list:this.state.list.concat({text:this.props.store._chat_stream?m.trim():null===(_=m.choices[0])||void 0===_||null===(b=_.message)||void 0===b?void 0:b.content.trim(),role:"robot"}),text:"",loading:!1}),this.props.store._chat_last=this.state.list,this.props.store.save_vars("_chat_last")),e.next=58;break;case 37:e.prev=37,e.t0=e.catch(28),d=e.t0.message,v=null===(f=d.match(/\[(\d+)\]/))||void 0===f?void 0:f[1],g="\u5bc6\u94a5",e.t1=v,e.next="400"===e.t1?45:"401"===e.t1?46:"402"===e.t1?48:"403"===e.t1?50:"408"===e.t1?52:"429"===e.t1?54:56;break;case 45:d="\u8bf7\u6c42\u53c2\u6570\u9519\u8bef\uff0c\u5386\u53f2\u8bb0\u5f55\u53ef\u80fd\u8fc7\u957f\uff0c\u8bf7\u6e05\u7406\u540e\u518d\u8bd5";case 46:return d="".concat(g,"\u9519\u8bef\u6216\u8005\u8d26\u6237\u72b6\u6001\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5\uff1a").concat(g,"\u662f\u5426\u6b63\u786e\u3001").concat(g,"\u662f\u5426\u88ab\u7981\u7528"),e.abrupt("break",56);case 48:return d="\u8d26\u6237\u70b9\u6570\u4e0d\u8db3\uff0c\u8bf7\u5145\u503c\u3002BioinfoArk\u6309\u8bbe\u7f6e\u4e2d\u7684 Max token \u8fdb\u884c\u9884\u6263\uff0c\u56e0\u6b64\u5e76\u4e0d\u662f\u70b9\u6570\u5927\u4e8e\u96f6\u5c31\u53ef\u4ee5\u4f7f\u7528\u54e6~",e.abrupt("break",56);case 50:return d="\u8bf7\u6c42\u7684\u6a21\u578b\u6216\u8005\u8def\u5f84\u4e0d\u53ef\u7528\u6216\u672a\u5f00\u653e\uff0c\u8bf7\u68c0\u67e5\uff1a\u6a21\u578b\u662f\u5426\u5b58\u5728\u3001\u6a21\u578b\u662f\u5426\u88ab\u7981\u7528",e.abrupt("break",56);case 52:return d="\u8bf7\u6c42\u8d85\u65f6\uff0c\u53ef\u8c03\u6574\u5ba2\u6237\u7aef\u8bbe\u7f6e\uff1b\u670d\u52a1\u5668\u7aef\u6700\u957f\u54cd\u5e94\u65f6\u95f4\u4e3a180\u79d2",e.abrupt("break",56);case 54:return d="\u8bf7\u6c42\u8fc7\u4e8e\u9891\u7e41\uff0c\u6216\u8005\u670d\u52a1\u5668\u8fde\u63a5\u8fc7\u591a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5",e.abrupt("break",56);case 56:Object(y.b)("\u9519\u8bef\uff1a"+d),this.setState({loading:!1,typing:""});case 58:this.refresh_point();case 59:case"end":return e.stop()}}),e,this,[[28,37]])})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=Object(c.a)(i.a.mark((function e(t){var a,r,n,s,o,c,l,p,u,h,m,_,b,f,d,v,g,k,j,O,x,w,E,N,S,C,q,A=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.props.store._chat_key.length<10)){e.next=3;break}return Object(y.b)("\u8bf7\u5148\u70b9\u51fb\u53f3\u4e0a\u89d2\u6309\u94ae\u8bbe\u7f6e".concat("\u5bc6\u94a5","\u4ee5\u540e\u518d\u4f7f\u7528")),e.abrupt("return",!1);case 3:0,a="CK208".split("|"),r=!1,n=0;case 7:if(!(n<a.length)){e.next=14;break}if(!(this.props.store._chat_key.indexOf("|".concat(a[n].toLowerCase()))>0)){e.next=11;break}return r=!0,e.abrupt("break",14);case 11:n++,e.next=7;break;case 14:if(r){e.next=17;break}return Object(y.b)("\u60a8\u7684Key\u4e0d\u80fd\u5728\u6b64\u4f7f\u7528\uff0c\u8bf7\u54a8\u8be2Key\u7684\u4f9b\u5e94\u5546"),e.abrupt("return",!1);case 17:if(console.log("on send"),!(t.length<1)){e.next=20;break}return e.abrupt("return",!1);case 20:if(!this.state.loading){e.next=22;break}return e.abrupt("return",!1);case 22:for(document.querySelector(".input-box").style.height="100px",s=this.state.list.concat({text:t,role:"me"}),this.setState({loading:!0,typing:"\u6b63\u5728\u601d\u8003\u4e2d...",list:s,show_undo:!1}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,e.prev=26,(o=this.getApiInstance()).setApiBaseUrl(this.props.store._chat_api_url),parseInt(this.props.store._chat_timeout)>0&&(o.timeout=1e3*parseInt(this.props.store._chat_timeout)),c=-2-parseInt(this.props.store._chat_history_count||6),l=c<0?s.slice(c):[],console.log("old",l),p=[],this.props.store._chat_system_prompt&&p.push({role:"system",content:this.props.store._chat_system_prompt}),this.props.store._chat_user_prompt&&p.push({role:"user",content:this.props.store._chat_user_prompt}),u=0;u<l.length;u++)"me"==l[u].role?p.push({role:"user",content:l[u].text}):p.push({role:"assistant",content:l[u].text});if(0!=p.length){e.next=40;break}return Object(y.b)("\u8bb0\u5f55\u4e3a\u7a7a"),e.abrupt("return",!1);case 40:if(!this.tiktoken){e.next=85;break}if(!(h=this.tiktoken.encoding_for_model)||"object"!==typeof WebAssembly||"function"!==typeof WebAssembly.instantiate){e.next=84;break}console.log("encoding_for_model & wasm enabled"),m=this.props.store._chat_model,e.t0=m,e.next="gpt-3.5-turbo-16k"===e.t0||"gtp-3.5-turbo-0613"===e.t0?48:"gpt-4-0613"===e.t0?50:52;break;case 48:return m="gpt-3.5-turbo",e.abrupt("break",52);case 50:return m="gpt-4",e.abrupt("break",52);case 52:_=h(m),b=p,f=0;case 55:if(!(f<b.length)){e.next=63;break}if(!(!b[f]||"object"!==typeof b[f]||!b[f].content||b[f].content.length<1||!b[f].role||b[f].role.length<1)){e.next=59;break}return Object(y.b)("\u8bb0\u5f55\u683c\u5f0f\u9519\u8bef"),e.abrupt("return",!1);case 59:case 60:f++,e.next=55;break;case 63:d=b.map((function(e){return"<|im_start|>".concat(e.role," \n").concat(e.content,"<|im_end|>\n")})).join("")+"<|im_start|>assistant \n",console.log("wrapped",d),d=d.replaceAll("<|im_start|>"," , ").replaceAll("<|im_end|>"," , ").trim(),v=_.encode(d).length,console.log("message_tokens",v),g=4096,e.t1=this.props.store._chat_model,e.next="gpt-3.5-turbo"===e.t1?72:"gpt-4"===e.t1?74:"gpt-3.5-turbo-16k"===e.t1?76:78;break;case 72:return g=4096,e.abrupt("break",78);case 74:return g=8192,e.abrupt("break",78);case 76:return g=16384,e.abrupt("break",78);case 78:if(!(v+parseInt(this.props.store._chat_max_tokens)>=g)){e.next=82;break}return Object(y.b)("\u8f93\u5165\u5185\u5bb9\u8fc7\u957f\uff0c\u8bf7\u6e05\u7406\u5bf9\u8bdd\u5386\u53f2\u6216\u8005\u51cf\u5c11\u6700\u5927token"),this.setState({loading:!1,typing:""}),e.abrupt("return",!1);case 82:e.next=85;break;case 84:console.log("load encoding fail");case 85:return e.prev=85,O="",e.next=89,o.completion({messages:p,temperature:null!==(k=parseFloat(this.props.store._chat_temperature))&&void 0!==k?k:0,max_tokens:null!==(j=parseInt(this.props.store._chat_max_tokens))&&void 0!==j?j:1e3,model:this.props.store._chat_model||"gpt-3.5-turbo",stream:this.props.store._chat_stream,moderation:this.props.store._chat_key.startsWith("fk")&&this.props.store._chat_moderation_on,moderation_stop:!0,onMessage:function(e,t){if(e.length<1)return!1;if(t&&(O+=t,"\u3002"===t||"\uff01"===t||"\uff1f"===t)){var a=O;O="","yes"==A.props.store._chat_auto_audio&&a.length>1&&A.audio(a)}A.setState({typing:e}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight},onEnd:function(e){A.setState({typing:""}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,"yes"==A.props.store._chat_auto_audio&&O.length>1&&A.audio(O)}});case 89:(x=e.sent)&&(this.setState({list:this.state.list.concat({text:this.props.store._chat_stream?x.trim():null===(w=x.choices[0])||void 0===w||null===(E=w.message)||void 0===E?void 0:E.content.trim(),role:"robot"}),text:"",loading:!1}),this.props.store._chat_last=this.state.list,this.props.store.save_vars("_chat_last")),e.next=114;break;case 93:e.prev=93,e.t2=e.catch(85),S=e.t2.message,C=null===(N=S.match(/\[(\d+)\]/))||void 0===N?void 0:N[1],q="\u5bc6\u94a5",e.t3=C,e.next="400"===e.t3?101:"401"===e.t3?102:"402"===e.t3?104:"403"===e.t3?106:"408"===e.t3?108:"429"===e.t3?110:112;break;case 101:S="\u8bf7\u6c42\u53c2\u6570\u9519\u8bef\uff0c\u5386\u53f2\u8bb0\u5f55\u53ef\u80fd\u8fc7\u957f\uff0c\u8bf7\u6e05\u7406\u540e\u518d\u8bd5";case 102:return S="".concat(q,"\u9519\u8bef\u6216\u8005\u8d26\u6237\u72b6\u6001\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5\uff1a").concat(q,"\u662f\u5426\u6b63\u786e\u3001").concat(q,"\u662f\u5426\u88ab\u7981\u7528"),e.abrupt("break",112);case 104:return S="\u8d26\u6237\u70b9\u6570\u4e0d\u8db3\uff0c\u8bf7\u5145\u503c\u3002BioinfoArk\u6309\u8bbe\u7f6e\u4e2d\u7684 Max token \u8fdb\u884c\u9884\u6263\uff0c\u56e0\u6b64\u5e76\u4e0d\u662f\u70b9\u6570\u5927\u4e8e\u96f6\u5c31\u53ef\u4ee5\u4f7f\u7528\u54e6~",e.abrupt("break",112);case 106:return S="\u8bf7\u6c42\u7684\u6a21\u578b\u6216\u8005\u8def\u5f84\u4e0d\u53ef\u7528\u6216\u672a\u5f00\u653e\uff0c\u8bf7\u68c0\u67e5\uff1a\u6a21\u578b\u662f\u5426\u5b58\u5728\u3001\u6a21\u578b\u662f\u5426\u88ab\u7981\u7528",e.abrupt("break",112);case 108:return S="\u8bf7\u6c42\u8d85\u65f6\uff0c\u53ef\u8c03\u6574\u5ba2\u6237\u7aef\u8bbe\u7f6e\uff1b\u670d\u52a1\u5668\u7aef\u6700\u957f\u54cd\u5e94\u65f6\u95f4\u4e3a180\u79d2",e.abrupt("break",112);case 110:return S="\u8bf7\u6c42\u8fc7\u4e8e\u9891\u7e41\uff0c\u6216\u8005\u670d\u52a1\u5668\u8fde\u63a5\u8fc7\u591a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5",e.abrupt("break",112);case 112:Object(y.b)("\u9519\u8bef\uff1a"+S),this.setState({loading:!1,typing:""});case 114:document.querySelector(".input-box").focus(),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,window.setTimeout((function(){A.refresh_point()}),1e3),e.next=124;break;case 119:e.prev=119,e.t4=e.catch(26),console.log("error",e.t4),Object(y.b)("\u53d1\u9001\u8bf7\u6c42\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5".concat("\u5bc6\u94a5","\u548cAPI\u8bf7\u6c42\u5730\u5740\u662f\u5426\u6b63\u786e\u6216\u91cd\u8bd5\u3002")+JSON.stringify(e.t4)),this.setState({loading:!1});case 124:case"end":return e.stop()}}),e,this,[[26,119],[85,93]])})));return function(t){return e.apply(this,arguments)}}()},{key:"warning",value:function(e){"gpt-4"==e&&Object(y.b)("4\u6a21\u578b\u4ef7\u683c\u662f3.5\u768415~30\u500d\uff0c\u4e14\u8fd4\u56de\u8f83\u6162\u5bb9\u6613\u8d85\u65f6\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528\u3002"),this.props.store.save_vars("_chat_model")}},{key:"select_action",value:function(){var e=Object(c.a)(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.state.actions[t.target.value]&&this.send(this.state.actions[t.target.value]);case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"export",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a,r,n,s=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"history"==(s.length>0&&void 0!==s[0]?s[0]:"history")?(t=JSON.stringify({chat_list:this.props.store._chat_saved_list}),a=new Blob([t],{type:"application/json"}),Object(q.saveAs)(a,"".concat("BioinfoArk",".\u5bf9\u8bdd\u8bb0\u5f55.json"))):(r=JSON.stringify({preset_list:this.props.store._preset_saved_list}),n=new Blob([r],{type:"application/json"}),Object(q.saveAs)(n,"".concat("BioinfoArk",".\u5e38\u7528\u63d0\u793a\u8bcd.json")));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"check_bottom_effect",value:function(){if(!document.querySelector(".history-list"))return!1;console.log("check_bottom_effect"),document.querySelector(".history-list").scrollHeight>document.querySelector(".history-list").clientHeight?(console.log("\u6709\u6eda\u52a8\u6761"),document.querySelector(".bottom-effect").style.display="block",document.querySelector(".bottom-effect").style.bottom="0"):(document.querySelector(".bottom-effect").style.display="none",console.log("\u6ca1\u6709\u6eda\u52a8\u6761"))}},{key:"set_text",value:function(){var e=Object(c.a)(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({text:this.state.text+" "+t});case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"donate",value:function(){var e=Object(c.a)(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.history.push("/donate");case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"load_list",value:function(){var e=Object(c.a)(i.a.mark((function e(t){var a;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.old_list=this.state.list,a=JSON.parse(t),this.setState({list:a,show_undo:!0}),this.props.store.save_vars("_chat_last"),Object(y.b)("\u5df2\u8f7d\u5165\u5386\u53f2\u4f1a\u8bdd\u8bb0\u5f55\uff0c\u53ef\u70b9\u51fb\u5bf9\u8bdd\u6700\u4e0a\u65b9\u7684\u64a4\u9500\u6309\u94ae\u6062\u590d\u539f\u6709\u5bf9\u8bdd");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"refresh_point",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a,r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.store._chat_api_url&&this.props.store._chat_key&&this.props.store._chat_key.startsWith("fk")){e.next=2;break}return e.abrupt("return",!1);case 2:return e.prev=2,(t=this.getApiInstance()).setApiBaseUrl(this.props.store._chat_api_url),e.next=7,t.billing();case 7:(a=e.sent)&&(a.object&&"error"==a.object&&Object(y.b)("\u83b7\u53d6\u70b9\u6570\u5931\u8d25\uff1a"+a.message),a.total_available&&(r=(r=a.total_available*(parseFloat("1")||1)).toFixed(parseInt("0")||0),this.setState({point:r}))),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),console.log("error",e.t0),this.api2d_instance=null,Object(y.b)("\u83b7\u53d6\u70b9\u6570\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8bf7\u6c42\u5730\u5740\u548cKey\uff1a"+e.t0.message);case 16:case"end":return e.stop()}}),e,this,[[2,11]])})));return function(){return e.apply(this,arguments)}}()},{key:"save",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.store._chat_key=this.props.store._chat_key.trim(),this.props.store._chat_api_url=this.props.store._chat_api_url.trim(),(!this.props.store._chat_api_url||this.props.store._chat_key.startsWith("fk")&&this.props.store._chat_api_url.startsWith("https://api.openai.com"))&&(this.props.store._chat_api_url="https://oa.api2d.net",Object(y.b)("\u68c0\u6d4b\u5230\u60a8\u4f7f\u7528\u7684\u662fForward Key\uff0c\u5df2\u81ea\u52a8\u5207\u6362API\u5730\u5740")),t=4096,e.t0=this.props.store._chat_model,e.next="gpt-3.5-turbo"===e.t0?7:"gpt-4"===e.t0?9:"gpt-3.5-turbo-16k"===e.t0?11:13;break;case 7:return t=4096,e.abrupt("break",13);case 9:return t=8192,e.abrupt("break",13);case 11:return t=16384,e.abrupt("break",13);case 13:if(!(this.props.store._chat_max_tokens>t-10)){e.next=16;break}return Object(y.b)("\u5f53\u524d\u6a21\u578b\u6700\u5927tokens\u4e3a"+t+"\uff0c\u60a8\u8bbe\u7f6e\u7684max tokens\u592a\u5927\uff0c\u65e0\u6cd5\u6b63\u5e38\u804a\u5929\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e"),e.abrupt("return",!1);case 16:return this.props.store.save_vars(),this.api2d_instance=null,e.next=20,this.refresh_point();case 20:this.setState({settings_open:!1});case 21:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"avatar_save",value:function(){var e=Object(c.a)(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.store.save_vars(),this.setState({avatar_open:!1});case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"abort",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.getApiInstance().abort(),this.api2d_instance=null,t=this.state.typing,this.setState({loading:!1,typing:"",list:this.state.list.concat({text:t+"...",role:"robot"})});case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"export_conversation",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a,r,n=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({snap:!0}),(t=document.querySelector("#snap_tmp"))||(t=document.createElement("div"),a=document.querySelector(".chat-list"),r=a.offsetWidth||720,t.style.width="".concat(r,"px"),t.style.padding="20px",t.setAttribute("id","snap_tmp"),t.classList.add("snap-chat-list"),document.body.appendChild(t)),window.setTimeout(Object(c.a)(i.a.mark((function e(){var a,r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.innerHTML=document.querySelector(".chat-list").innerHTML,e.next=3,C()(document.querySelector("#snap_tmp"),{scale:2});case 3:a=e.sent,n.setState({snap:!1}),r=Date.now(),Object(q.saveAs)(a.toDataURL(),"".concat(n.props.store.appname||"Chat\u9171","-")+r+".png"),document.querySelector("#snap_tmp").remove();case 8:case"end":return e.stop()}}),e)}))),500);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"prompt_add",value:function(){var e=Object(c.a)(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({prompt_box:!0});case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"prompt_save",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a,r=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.store._preset_prompt_title){e.next=3;break}return Object(y.b)("\u6807\u9898\u4e0d\u80fd\u4e3a\u7a7a"),e.abrupt("return",!1);case 3:if(this.props.store._preset_system_prompt||this.props.store._preset_user_prompt){e.next=6;break}return Object(y.b)("\u63d0\u793a\u8bcd\u4e0d\u80fd\u90fd\u4e3a\u7a7a"),e.abrupt("return",!1);case 6:this.props.store._preset_prompt_id?((a=this.props.store._preset_saved_list.find((function(e){return e.id==r.props.store._preset_prompt_id}))).title=this.props.store._preset_prompt_title,a.system=this.props.store._preset_system_prompt,a.user=this.props.store._preset_user_prompt,this.props.store.save_vars("_preset_saved_list"),this.prompt_box_clean(!0)):(t={id:Date.now(),title:this.props.store._preset_prompt_title,system:this.props.store._preset_system_prompt,user:this.props.store._preset_user_prompt},this.props.store._preset_saved_list.push(t),this.props.store.save_vars("_preset_saved_list"),this.prompt_box_clean(!0));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"prompt_box_clean",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.props.store._preset_prompt_title="",this.props.store._preset_system_prompt="",this.props.store._preset_user_prompt="",this.props.store._preset_prompt_id="",e&&this.setState({prompt_box:!1})}},{key:"load_prompt",value:function(e){var t=this.props.store._preset_saved_list.find((function(t){return t.id==e}));this.setState({text:this.state.text+t.user}),document.querySelector(".input-box").focus()}},{key:"edit_prompt",value:function(e){var t=this.props.store._preset_saved_list.find((function(t){return t.id==e}));this.props.store._preset_prompt_id=e,this.props.store._preset_prompt_title=t.title,this.props.store._preset_system_prompt=t.system,this.props.store._preset_user_prompt=t.user,this.setState({prompt_box:!0})}},{key:"remove_prompt",value:function(e){var t=this.props.store._preset_saved_list.findIndex((function(t){return t.id==e}));this.props.store._preset_saved_list.splice(t,1),this.props.store.save_vars("_preset_saved_list")}},{key:"remove_chat_line",value:function(e){var t=this;this.old_list=this.state.list;var a=this.state.list.filter((function(t,a){return a!=e}));this.setState({list:a,show_undo:!0}),window.setTimeout((function(){t.props.store._chat_last=t.state.list,t.props.store.save_vars("_chat_last")}),1e3)}},{key:"audio_play",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a,r,n,s,o=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.playing){e.next=2;break}return e.abrupt("return",!1);case 2:if(this.audio_to_play.length){e.next=4;break}return e.abrupt("return",!1);case 4:return this.playing=!0,t=this.audio_to_play.shift(),a=t.text,r=this.getApiInstance(),e.next=9,r.textToSpeech({text:a,voiceName:"zh-CN-XiaoxiaoNeural",responseType:"blob-url",speed:1.2});case 9:n=e.sent,s=n,console.log("shift",s,a),this.audio_dom||(this.audio_dom=new Audio),this.audio_dom.src=s,this.audio_dom.play(),this.audio_dom.addEventListener("ended",(function(){URL.revokeObjectURL(s),o.playing=!1,o.audio_play()}),{once:!0});case 16:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"audio",value:function(){var e=Object(c.a)(i.a.mark((function e(t){var a,r,n;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0==this.props.store._chat_key.indexOf("fk")){e.next=3;break}return Object(y.b)("\u53ea\u6709API2D\u7684Key\u53ef\u652f\u6301\u8bed\u97f3"),e.abrupt("return",!1);case 3:return e.t0=String,e.next=6,Object(A.a)().process(t);case 6:e.t1=e.sent,a=(0,e.t0)(e.t1),(r=document.createElement("div")).innerHTML=a,n=r.innerText,r.remove(),console.log("markdown to text",t,n),n.length>1&&(this.audio_to_play.push({text:n}),this.audio_play());case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toggle_version",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="gpt-3.5-turbo","gpt-3.5-turbo"==this.props.store._chat_model&&(t="gpt-3.5-turbo-16k"),"gpt-3.5-turbo-16k"==this.props.store._chat_model&&(t="gpt-4"),"gpt-4"==this.props.store._chat_model&&(t="gpt-3.5-turbo"),this.props.store._chat_model=t,this.props.store.save_vars("_chat_model");case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"changeApiEndpoint",value:function(){var e=Object(c.a)(i.a.mark((function e(){var t,a;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.store.api_endpoints&&this.props.store.api_endpoints.length>0&&(this.props.store.endpoint_count++,t=this.props.store.endpoint_count%this.props.store.api_endpoints.length,a="https://"+(a=this.props.store.api_endpoints[t]),console.log("next_endpoint",a),this.props.store._chat_api_url=a);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var t,a,r,n,s,o=this,i=_.a.createElement("div",{className:"right-box"},_.a.createElement("div",{className:"row flex md:flex-row flex-col"},_.a.createElement("div",{className:"left flex-1"}),_.a.createElement("div",{className:"right"},_.a.createElement(v.e,{vertical:window.innerWidth<600},window.innerWidth>=600&&window.electronAPI&&(null===(t=window.electronAPI)||void 0===t?void 0:t.pinWindow)&&_.a.createElement(v.b,{active:"yes"==this.props.store._chat_pin_window,icon:"pin",onClick:function(){var e;o.props.store._chat_pin_window="yes"==o.props.store._chat_pin_window?"no":"yes";var t="yes"==o.props.store._chat_pin_window;null===(e=window.electronAPI)||void 0===e||e.pinWindow(t),o.props.store.save_vars("_chat_pin_window"),t&&Object(y.b)("\u5df2\u5c06\u7a97\u53e3\u7f6e\u4e8e\u6700\u4e0a\u65b9")},large:!0}),this.props.store._chat_key&&this.props.store._chat_key.startsWith("fk")&&_.a.createElement(v.h,{className:"md:w-40 w-full",large:!0,rightElement:_.a.createElement(v.b,{icon:"refresh",minimal:!0,onClick:function(){return o.refresh_point()},large:!0}),value:this.state.point+"P",title:"\u4f59\u989d",readOnly:!0}),_.a.createElement(v.b,{icon:"key",onClick:function(){return o.setState({settings_open:!0})},large:!0},"\u70b9\u6b64\u8f93\u5165\u5bc6\u94a5"),window.innerWidth>=600&&null))),_.a.createElement("div",{className:"chat-list"},this.state.show_undo?_.a.createElement("div",{className:"text-center gray-btn gray-text"},_.a.createElement(v.c,null,_.a.createElement(v.b,{icon:"undo",minimal:!0,onClick:function(){return o.undo_conversation()}},"\u64a4\u9500"))):null,this.state.list&&this.state.list.map((function(e,t){var a,r;return _.a.createElement("div",{className:"chat-item ".concat(e.role),key:t},_.a.createElement("div",{className:"chat-text content"},_.a.createElement(x.a,{markdown:null===(a=e.text)||void 0===a?void 0:a.trim()}),_.a.createElement("div",{className:"flex flex-row float-icons"},_.a.createElement("span",{className:"remove"},_.a.createElement(v.b,{icon:"trash",small:!0,minimal:!0,title:"\u5220\u9664",onClick:function(){return o.remove_chat_line(t)}})),_.a.createElement("span",{className:"copy"},_.a.createElement(N.CopyToClipboard,{text:null===(r=e.text)||void 0===r?void 0:r.trim(),onCopy:function(){return Object(y.b)("Markdown\u5df2\u590d\u5236\u5230\u526a\u8d34\u677f")}},_.a.createElement(v.b,{icon:"duplicate",small:!0,minimal:!0,title:"\u590d\u5236markdown"}))),_.a.createElement("span",{className:"audio"},_.a.createElement(v.b,{icon:"volume-up",onClick:function(){return o.audio(e.text)},small:!0,minimal:!0,title:"\u8bed\u97f3"})))))})),this.state.typing&&_.a.createElement("div",{className:"chat-item robot"},_.a.createElement("div",{className:"chat-text content"},_.a.createElement(v.n,{size:12,className:"mr-2"}),_.a.createElement(x.a,{markdown:null===(a=this.state.typing)||void 0===a?void 0:a.trim()}),_.a.createElement(v.b,{icon:"cross",minimal:!0,onClick:function(){return o.abort()}}))),this.state.list&&this.state.list.length>0&&_.a.createElement("div",{className:"text-center gray-btn xs-btn gray-text"},this.state.snap?_.a.createElement("div",{className:"text-center mt-2"},_.a.createElement("span",{className:"text-gray-400 p-2 px-3 "},"- By ".concat("BioinfoArk").concat(" \xb7 http://www.bioinfoark.com/"," -"))):_.a.createElement(v.c,null,_.a.createElement(v.b,{icon:"refresh",small:!0,minimal:!0,onClick:function(){return o.regen_conversation()}},"\u91cd\u65b0\u751f\u6210"),_.a.createElement(v.b,{icon:"eraser",small:!0,minimal:!0,onClick:function(){return o.clean_conversation(!1)}},"\u6e05\u7a7a\u8bb0\u5f55"),_.a.createElement(v.b,{icon:"download",small:!0,minimal:!0,onClick:function(){return o.export_conversation()}},"\u5bfc\u51fa\u622a\u56fe")))),_.a.createElement("div",{className:"chat-box"},_.a.createElement("form",{action:"post",id:"chat-form",className:"flex flex-col",onSubmit:function(e){var t;e.preventDefault(),o.send(null===(t=o.state.text)||void 0===t?void 0:t.trim())}},_.a.createElement(v.q,{growVertically:!0,large:!0,rows:4,disabled:this.state.loading,placeholder:"\u8f93\u5165\u4f60\u7684\u95ee\u9898",autoFocus:!0,className:"input-box",onChange:function(e){return o.onChange(e,"text")},value:this.state.text}),_.a.createElement("div",{className:"flex md:flex-row md:justify-between flex-col items-center mb-2"},_.a.createElement("div",{className:"left flex flex-row items-center"},_.a.createElement(k.a,{onUpdate:function(e){return o.warning(e)},className:"mt-2 mb-2 md:mb-0 md:block hidden",field:"_chat_model",options:[{label:"GPT3.5",value:"gpt-3.5-turbo"},{label:"GPT3.5-16K",value:"gpt-3.5-turbo-16k"},{label:"GPT4",value:"gpt-4"}]}),_.a.createElement("div",{className:"mt-2 md:hidden block mr-1"},_.a.createElement(v.b,{onClick:function(){return o.toggle_version()},large:!0},"gpt-4"==this.props.store._chat_model?"4":"gpt-3.5-turbo-16k"==this.props.store._chat_model?"3.5+":"3.5")),_.a.createElement(v.c,{className:"mt-2 md:mt-0"},_.a.createElement(v.b,{large:!0,className:"md:mt-2 md:ml-1",icon:this.state.loading?_.a.createElement(v.n,{size:12}):"send-message",type:"submit",disabled:this.state.loading},this.state.loading?"\u8bf7\u7a0d\u5019":"\u53d1\u9001(cmd/ctrl+enter)"),_.a.createElement(v.b,{large:!0,className:"md:mt-2 ",icon:"clean",onClick:function(){return o.clean_conversation()}},"\u65b0\u5bf9\u8bdd"))),_.a.createElement("div",{className:"right hidden md:block flex flex-row items-center justify-center"},"yes"!=this.props.store._chat_auto_save?_.a.createElement(v.b,{large:!0,className:"mt-2 ml-2",icon:"floppy-disk",onClick:function(){return o.save_conversation()}},"\u4fdd\u5b58\u5bf9\u8bdd"):_.a.createElement(E.a,{onUpdate:function(){return o.props.store.save_vars()},field:"_chat_auto_save",label:"\u81ea\u52a8\u4fdd\u5b58\u4f1a\u8bdd",className:"no-margin",options:[{label:"\u662f",value:"yes"},{label:"\u5426",value:"no"}]}))))));(this.state.actions?Object.keys(this.state.actions).map((function(e){if(e.trim().length>0)return{label:e,value:e}})):[]).unshift({label:"\u8bf7\u9009\u62e9",value:""});var c=_.a.createElement("div",{className:"prompt-tab"},_.a.createElement("div",{className:"prompt-list"},this.props.store._preset_saved_list&&(null===(r=this.props.store._preset_saved_list)||void 0===r?void 0:r.slice().reverse().map((function(e,t){return _.a.createElement("div",{key:t,className:"prompt-item mb-2 border rounded mb-2 p-2 text-sm text-gray-400 hover:text-blue-400 flex flex-row justify-between cursor-pointer",onClick:function(){return o.load_prompt(e.id)}},_.a.createElement("div",{className:"left flex flex-row items-center"},e.title.substring(0,30)),_.a.createElement("div",{className:"right action-icon ml-2 gray-btn"},_.a.createElement(v.b,{small:!0,minimal:!0,icon:"edit",title:"\u7f16\u8f91",onClick:function(t){o.edit_prompt(e.id),t.preventDefault(),t.stopPropagation()}}),_.a.createElement(v.b,{small:!0,minimal:!0,icon:"cross",title:"\u5220\u9664",onClick:function(t){o.remove_prompt(e.id),t.preventDefault(),t.stopPropagation()}})))}))),_.a.createElement("div",{className:"bottom-effect"}))),l=_.a.createElement("div",{className:"history-tab"},_.a.createElement("div",{className:"history-list"},this.props.store._chat_saved_list&&(null===(n=this.props.store._chat_saved_list)||void 0===n?void 0:n.slice().reverse().map((function(e,t){return _.a.createElement("div",{key:t,className:"history-item mb-2 border rounded mb-2 p-2 text-sm text-gray-400 hover:text-blue-400 flex flex-row justify-between"},_.a.createElement("div",{className:"left flex flex-row items-center"},e.name.substring(0,30)),_.a.createElement("div",{className:"right action-icon ml-2 gray-btn"},_.a.createElement(v.b,{small:!0,minimal:!0,icon:"history",title:"\u8f7d\u5165",onClick:function(){return o.load_list(JSON.stringify(e.list))}}),_.a.createElement(v.b,{small:!0,minimal:!0,icon:"cross",title:"\u5220\u9664",onClick:function(){return o.remove_list(e.id)}})))}))),_.a.createElement("div",{className:"bottom-effect"}))),p=_.a.createElement("div",{className:"left-box flex-1"},_.a.createElement("div",null,_.a.createElement("div",{className:"text-lg mb-2 text-gray-300 mt-6 mr-2 flex flex-row w-48"},_.a.createElement(v.p,{id:"left-tab",onChange:function(e){o.setState({tab_selected:e})},selectedTabId:this.state.tab_selected,className:"w-full"},_.a.createElement(v.o,{id:"prompt",title:"\u63d0\u793a\u8bcd",panel:c}),_.a.createElement(v.o,{id:"history",title:"\u5bf9\u8bdd\u8bb0\u5f55",panel:l}),_.a.createElement(v.p.Expander,null),_.a.createElement(v.c,null,"prompt"==this.state.tab_selected&&_.a.createElement(v.b,{onClick:function(){return o.prompt_add()},icon:"plus",className:"gray-btn",minimal:!0,title:"\u6dfb\u52a0\u9884\u7f6e\u63d0\u793a\u8bcd"}),_.a.createElement(v.b,{onClick:function(){return o.fileInput.click()},icon:"circle-arrow-up",className:"gray-btn",minimal:!0,title:"\u5bfc\u5165"}),_.a.createElement("input",{type:"file",accept:".json",ref:function(e){o.fileInput=e},style:{display:"none"},onChange:this.handleFile}),_.a.createElement(v.b,{icon:"circle-arrow-down",className:"gray-btn",minimal:!0,onClick:function(){return o.export(o.state.tab_selected)},title:"\u5bfc\u51fa"}))))),_.a.createElement("div",{className:null!==(s="char-box opacity-"+this.props.store._chat_char_opacity)&&void 0!==s?s:80},_.a.createElement("img",{src:this.props.store._chat_avatar_url||"http://mymdimg.oss-cn-hangzhou.aliyuncs.com/bioinfoark.jpeg",onError:function(){o.props.store._chat_avatar_url&&(o.props.store._chat_avatar_url=null)},className:"char",onClick:function(){return o.setState({avatar_open:!0})},style:Object(z.a)("width: 160px;")}),_.a.createElement(w.a,{className:"slider",field:"_chat_char_opacity",min:10,stepSize:10,labelStepSize:10,onUpdate:function(){return o.props.store.save_vars()}}))),u=(window.origin,encodeURIComponent(e.from(JSON.stringify({_chat_key:this.props.store._chat_key,_chat_api_url:this.props.store._chat_api_url})).toString("base64")),_.a.createElement(v.a,{large:!0,icon:"key",href:"http://www.bioinfoark.com".replaceAll("{{key}}",encodeURIComponent(e.from(this.props.store._chat_key).toString("base64"))),target:"_blank"},"\u70b9\u6b64\u83b7\u5f97key")),h="c.level06.com"==window.location.hostname||"dd.ftqq.com"==window.location.hostname?_.a.createElement(v.a,{large:!0,icon:"cog",className:"ml-2",href:"https://a.ftqq.com/2023/04/24/chatyou-custom-platform",target:"_blank"},"\u5b9a\u5236Chat\u9171"):null,m=_.a.createElement("div",{className:"flex flex-row chat-page"},p,i,_.a.createElement(v.f,{isOpen:this.state.settings_open,title:"\u8bbe\u7f6e",icon:"info-sign",onClose:function(){return o.setState({settings_open:!1})}},_.a.createElement("div",{className:"p-5 mt-2"},_.a.createElement(_.a.Fragment,null,_.a.createElement(j.a,{field:"_chat_key",label:"\u5bc6\u94a5",placeholder:"\u8bf7\u8f93\u5165fk\u5f00\u5934\u7684\u90a3\u4e32\u957f\u957f\u7684\u5bc6\u94a5\u54e6~"})),null,_.a.createElement("div",{className:"flex flex-row mb-5 items-center"},_.a.createElement(v.b,{icon:this.state.show_extend_settings?"chevron-up":"chevron-down",className:"mr-2",large:!0,onClick:function(){return o.setState({show_extend_settings:!o.state.show_extend_settings})}},"\u9ad8\u7ea7\u8bbe\u7f6e"),null,h),this.state.show_extend_settings?_.a.createElement(_.a.Fragment,null,_.a.createElement("div",{className:"flex flex-row"},_.a.createElement(j.a,{field:"_chat_max_tokens",label:"Max Tokens",placeholder:"\u6700\u5927 token \u6570\u91cf\uff0c\u4e00\u822c\u804a\u59291000\u5373\u53ef\uff0c3.5\u6700\u5927\u4e3a4000,4\u4e3a8000\uff0c\u5426\u5219\u5bb9\u6613\u51fa\u9519",className:"mr-2 flex-1"}),_.a.createElement(j.a,{field:"_chat_temperature",label:"\u53d1\u6563\u5ea6",placeholder:"Temperature\uff0c\u53d1\u6563\u7a0b\u5ea6\uff0c0~2\u4e4b\u95f4\uff0c\u8d8a\u5927\u8d8a\u53d1\u6563",className:"flex-1 mr-2"}),_.a.createElement(j.a,{field:"_chat_timeout",label:"\u8d85\u65f6\u65f6\u95f4\xb7\u79d2",placeholder:"\u8d85\u65f6\u4f1a\u81ea\u52a8\u7ec8\u6b62\u8bf7\u6c42",className:"mr-2 flex-1"}),_.a.createElement(j.a,{field:"_chat_history_count",label:"\u5386\u53f2\u4e0a\u4e0b\u6587\u6570\u91cf",placeholder:"\u6bcf\u6b21\u9644\u5e26\u7684\u4e0a\u4e0b\u6587\u6761\u6570\uff0c\u4f1a\u53d7 Max tokens\u9650\u5236",className:"flex-1"})),_.a.createElement("div",{className:"flex flex-row"},_.a.createElement(E.a,{field:"_chat_auto_save",label:"\u81ea\u52a8\u4fdd\u5b58\u4f1a\u8bdd",className:"mr-2",options:[{label:"\u662f",value:"yes"},{label:"\u5426",value:"no"}]}),_.a.createElement(E.a,{field:"_chat_summarize_content",label:"\u4f7f\u7528GPT\u751f\u6210\u4f1a\u8bdd\u6807\u9898"}),this.props.store._chat_key.startsWith("fk")?_.a.createElement(E.a,{field:"_chat_auto_audio",label:"\u81ea\u52a8\u6717\u8bfb\u56de\u7b54"}):null),_.a.createElement(j.a,{field:"_chat_system_prompt",label:"\u7cfb\u7edf\u63d0\u793a\u8bcd",placeholder:"system prompt"}),_.a.createElement(j.a,{field:"_chat_user_prompt",label:"\u7528\u6237\u63d0\u793a\u8bcd",placeholder:"user prompt"})):null,_.a.createElement(O.a,{onSubmit:function(){return o.save()},cancel:_.a.createElement("div",{className:"flex flex-row"},u)}),_.a.createElement("div",{className:"text-center box-footer text-gray-400"},"- ","BioinfoArk "+"".concat(this.props.store.version)," -"))),_.a.createElement(v.f,{isOpen:this.state.avatar_open,title:"\u8bbe\u7f6e\u804a\u5929\u52a9\u7406\u548c\u80cc\u666f",icon:"info-sign",onClose:function(){return o.setState({avatar_open:!1})}},_.a.createElement("div",{className:"p-5 mt-2"},_.a.createElement(j.a,{field:"_chat_avatar_url",placeholder:"\u8bf7\u7c98\u8d34\u4e00\u4e2a\u53ef\u4ee5\u8bbf\u95ee\u7684\u56fe\u7247URL\uff0c\u6700\u597d\u80cc\u666f\u900f\u660e\uff0c\u5982https://..."}),_.a.createElement(j.a,{field:"_chat_bg_url",placeholder:"\u80cc\u666f\u56fe\u7247URL\uff0c\u5982https://..."}),_.a.createElement(O.a,{onSubmit:function(){return o.avatar_save()},cancel:_.a.createElement(v.b,{onClick:function(){return o.setState({avatar_open:!1})},large:!0},"\u5173\u95ed")}))),_.a.createElement(v.f,{isOpen:this.state.prompt_box,title:"\u5e38\u7528\u63d0\u793a\u8bcd",icon:"info-sign",onClose:function(){return o.prompt_box_clean(!0)}},_.a.createElement("div",{className:"p-5 mt-2"},_.a.createElement(j.a,{field:"_preset_prompt_title",placeholder:"\u63d0\u793a\u8bcd\u6807\u9898"}),_.a.createElement(j.a,{type:"textarea",field:"_preset_user_prompt",placeholder:"user prompt",fill:!0}),_.a.createElement(O.a,{onSubmit:function(){return o.prompt_save()},cancel:_.a.createElement(v.b,{onClick:function(){return o.prompt_box_clean(!0)},large:!0},"\u5173\u95ed")}))));return _.a.createElement(d.a,{title:this.props.store.appname,main:m})}}]),n}(m.Component))||n)||n)||n)}).call(this,a(56).Buffer)},305:function(e,t,a){"use strict";a.d(t,"a",(function(){return j}));var r,n,s=a(57),o=a(10),i=a(12),c=a(15),l=a(16),p=a(0),u=a.n(p),h=a(8),m=a(41),_=a(1464),b=a(487),f=a(1465),d=a(1463),v=a(486),y=a(221),g=a(18),k=a(27),j=(r=Object(h.b)("store"),Object(m.f)(n=r(n=Object(h.c)(n=function(e){Object(c.a)(a,e);var t=Object(l.a)(a);function a(){return Object(o.a)(this,a),t.apply(this,arguments)}return Object(i.a)(a,[{key:"render",value:function(){return u.a.createElement(_.a,{remarkPlugins:[v.a],className:"markdown-text toastui-editor-contents",children:this.props.markdown,linkTarget:"_blank",components:{code:function(e){e.node;var t=e.inline,a=e.className,r=e.children,n=Object(s.a)(e,["node","inline","className","children"]);if(a&&a.indexOf("hljs")>-1)return u.a.createElement("code",Object.assign({},n,{className:a}),r);var o=/language-(\w+)/.exec(a||"");return t?u.a.createElement("code",Object.assign({className:a},n),r):u.a.createElement("div",{className:"code-box my-2"},u.a.createElement(f.a,Object.assign({children:String(r).replace(/\n$/,""),style:d.a,language:o&&o[1]?o[1]:"bash",PreTag:"div"},n)),u.a.createElement(y.CopyToClipboard,{className:"code-copy",text:String(r),onCopy:function(){return Object(k.b)("\u4ee3\u7801\u5df2\u590d\u5236")}},u.a.createElement(g.b,{icon:"code"},"\u590d\u5236\u4ee3\u7801")))},img:function(e){var t=e.src,a=e.alt;return u.a.createElement(b.a,{showDownload:!0,showRotation:!0,showZoom:!0,small:t,large:t,alt:a})}}})}}]),a}(p.Component))||n)||n)||n)},471:function(e,t,a){"use strict";a.d(t,"a",(function(){return _}));var r,n,s=a(10),o=a(12),i=a(15),c=a(16),l=a(0),p=a.n(l),u=a(8),h=a(41),m=a(484),_=(r=Object(u.b)("store"),Object(h.f)(n=r(n=Object(u.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.a)(a,[{key:"render",value:function(){var e=this,t=this.props.store[this.props.field]||"",a=this.props.options.filter((function(e){return t==e.value}));Date.now();return p.a.createElement("div",{className:"lossline "+this.props.className||!1},p.a.createElement("div",{className:"lossline"},this.props.label),p.a.createElement(m.a,{menuPlacement:this.props.menuPosition||"auto",placeholder:this.props.placeholder||"\u8bf7\u9009\u62e9",value:a,isMulti:!1,onChange:function(t){e.props.store[e.props.field]=t?t.value:"",e.props.onUpdate&&e.props.onUpdate(t.value)},options:this.props.options||[]}))}}]),a}(l.Component))||n)||n)||n)},480:function(e,t,a){"use strict";a.d(t,"a",(function(){return _}));var r,n,s=a(10),o=a(12),i=a(15),c=a(16),l=a(0),p=a.n(l),u=a(8),h=a(41),m=a(18),_=(r=Object(u.b)("store"),Object(h.f)(n=r(n=Object(u.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.a)(a,[{key:"render",value:function(){var e,t,a,r,n,s=this,o=null!==(e=this.props.store[this.props.field])&&void 0!==e?e:0;return p.a.createElement(m.m,{className:this.props.className||"",stepSize:null!==(t=this.props.stepSize)&&void 0!==t?t:10,labelStepSize:null!==(a=this.props.labelStepSize)&&void 0!==a?a:10,min:null!==(r=this.props.min)&&void 0!==r?r:0,max:null!==(n=this.props.max)&&void 0!==n?n:100,value:o,onChange:function(e){s.props.store[s.props.field]=e,s.props.onUpdate&&s.props.onUpdate(e)}})}}]),a}(l.Component))||n)||n)||n)},483:function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return b}));var r,n,s=a(10),o=a(12),i=a(15),c=a(16),l=a(0),p=a.n(l),u=a(8),h=a(41),m=a(52),_=a(18),b=(r=Object(u.b)("store"),Object(h.f)(n=r(n=Object(u.c)(n=function(t){Object(i.a)(r,t);var a=Object(c.a)(r);function r(){return Object(s.a)(this,r),a.apply(this,arguments)}return Object(o.a)(r,[{key:"componentDidMount",value:function(){var t=decodeURIComponent(this.props.match.params.info),a=e.from(t,"base64").toString();this.props.store.share_info=a;var r=JSON.parse(a);for(var n in r)this.props.store.hasOwnProperty(n)&&(this.props.store[n]=r[n]);this.props.store.save_vars(),this.props.history.push("/")}},{key:"render",value:function(){var e=p.a.createElement("div",{className:"flex justify-center items-center h-screen"},p.a.createElement("div",{className:"text-center"},p.a.createElement(_.n,null)));return p.a.createElement(m.a,{title:this.props.store.appname,main:e})}}]),r}(l.Component))||n)||n)||n)}).call(this,a(56).Buffer)},52:function(e,t,a){"use strict";var r,n,s,o,i,c,l,p,u,h,m,_,b=a(10),f=a(12),d=a(15),v=a(16),y=a(0),g=a.n(y),k=a(8),j=a(41),O=a(466),x=a.n(O),w=a(29),E=(r=Object(k.b)("store"),Object(j.f)(n=r(n=Object(k.c)(n=function(e){Object(d.a)(a,e);var t=Object(v.a)(a);function a(){return Object(b.a)(this,a),t.apply(this,arguments)}return Object(f.a)(a,[{key:"render",value:function(){var e=this.props.data;return e?g.a.createElement("div",{className:"user-span"},g.a.createElement("img",{src:e.avatar_url,className:"avatar"}),e.name,e.coin>=0&&g.a.createElement("span",{className:"coin bg-blue-500 text-white font-mono text-xs"},e.coin)):null}}]),a}(y.Component))||n)||n),a(57)),N=a(18),S=a(53),C=a(1504),q=a(169),A=(s=Object(k.b)("store"),Object(j.f)(o=s(o=Object(k.c)(o=function(e){Object(d.a)(a,e);var t=Object(v.a)(a);function a(){return Object(b.a)(this,a),t.apply(this,arguments)}return Object(f.a)(a,[{key:"render",value:function(){var e=this,t=g.a.createElement(N.i,{className:"border"},g.a.createElement(N.k,{icon:"person",text:"\u6211\u7684",onClick:function(){return e.props.history.push("/profile")}}),g.a.createElement(N.k,{icon:"dollar",text:"\u5145\u503c",onClick:function(){return e.props.history.push("/recharge")}}),g.a.createElement(N.j,null),g.a.createElement(N.k,{icon:"log-out",text:"\u9000\u51fa",onClick:function(){return e.props.history.push("/logout")}})),a=this.props,r=(a.staticContext,Object(E.a)(a,["staticContext"]));return g.a.createElement("div",r,this.props.store.user?g.a.createElement(C.a,{autoFocus:!1,content:t,position:S.a.BOTTOM_RIGHT},g.a.createElement(N.b,{rightIcon:"caret-down",minimal:!0})):g.a.createElement(q.a,{minimal:!0}))}}]),a}(y.Component))||o)||o),i=Object(k.b)("store"),Object(j.f)(c=i(c=Object(k.c)(c=function(e){Object(d.a)(a,e);var t=Object(v.a)(a);function a(){return Object(b.a)(this,a),t.apply(this,arguments)}return Object(f.a)(a,[{key:"render",value:function(){var e=this,t=this.props,a=(t.staticContext,Object(E.a)(t,["staticContext"]));return g.a.createElement("div",a,g.a.createElement("div",{className:"flex flex-row items-center"},this.props.store.menu&&g.a.createElement(g.a.Fragment,null," ",g.a.createElement("svg",{className:"w-3 h-3 mr-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},g.a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"}))," "),this.props.store.menu&&this.props.store.menu.map((function(t){var a,r=!0;(t.member_only&&(e.props.store.token||(r=!1)),t.admin_only)&&((null===(a=e.props.store.user)||void 0===a?void 0:a.level)<9&&(r=!1));return r?g.a.createElement(w.c,{className:"nav-menu text-black text-lg hover:text-gray-500 hover:no-underline ",key:t.id,to:t.link},t.text):null}))))}}]),a}(y.Component))||c)||c)||c);l=Object(k.b)("store"),Object(j.f)(p=l(p=Object(k.c)(p=function(e){Object(d.a)(a,e);var t=Object(v.a)(a);function a(){return Object(b.a)(this,a),t.apply(this,arguments)}return Object(f.a)(a,[{key:"render",value:function(){this.props.store.user;return g.a.createElement("div",{className:(this.props.className||"")+" header"},g.a.createElement("div",{className:"container mx-auto"},g.a.createElement("div",{className:"left flex flex-row items-center"},g.a.createElement(w.b,{to:"/"},this.props.store.appname),g.a.createElement(A,{className:"ml-5 hidden md:block"})),g.a.createElement("div",{className:"right"})))}}]),a}(y.Component))||p)||p),u=Object(k.b)("store"),Object(j.f)(h=u(h=Object(k.c)(h=function(e){Object(d.a)(a,e);var t=Object(v.a)(a);function a(){return Object(b.a)(this,a),t.apply(this,arguments)}return Object(f.a)(a,[{key:"render",value:function(){return g.a.createElement("div",{className:(this.props.className||"")+" footer"},"\u65b9\u7cd6\u6c14\u7403 \ud83c\udf88 ftqq.com")}}]),a}(y.Component))||h)||h);a.d(t,"a",(function(){return z}));var z=(m=Object(k.b)("store"),Object(j.f)(_=m(_=Object(k.c)(_=function(e){Object(d.a)(a,e);var t=Object(v.a)(a);function a(){return Object(b.a)(this,a),t.apply(this,arguments)}return Object(f.a)(a,[{key:"render",value:function(){return g.a.createElement(x.a,{title:this.props.title||this.props.store.appname},g.a.createElement(g.a.Fragment,null,this.props.store._chat_bg_url?g.a.createElement("div",{className:"chat-bg"}," ",g.a.createElement("img",{src:this.props.store._chat_bg_url,onError:function(e){return e.target.style.display="none"},referrerPolicy:"no-referrer"})):null,g.a.createElement("div",{className:""},g.a.createElement("div",{className:"body container mx-auto"},this.props.main)),g.a.createElement("div",{className:"drag-handle w-full h-5 fixed top-0 "})))}}]),a}(y.Component))||_)||_)||_)},600:function(e,t,a){e.exports=a(1462)},605:function(e,t,a){},62:function(e,t,a){"use strict";a.d(t,"a",(function(){return _}));var r,n,s=a(10),o=a(12),i=a(15),c=a(16),l=a(0),p=a.n(l),u=a(8),h=a(41),m=a(18),_=(r=Object(u.b)("store"),Object(h.f)(n=r(n=Object(u.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.a)(a,[{key:"render",value:function(){var e=this,t=this.props.store[this.props.field]||"";return p.a.createElement(m.g,{label:this.props.label,className:this.props.lineClass||""},"textarea"==this.props.type?p.a.createElement(m.q,{fill:this.props.fill||!1,growVertically:!0,large:!0,placeholder:this.props.placeholder,onChange:function(t){return e.props.store[e.props.field]=t.target.value},value:t,className:this.props.className||""}):p.a.createElement(m.h,{type:this.props.type,large:"true",placeholder:this.props.placeholder,onChange:function(t){return e.props.store[e.props.field]=t.target.value},rightElement:this.props.rightElement||null,value:t,className:this.props.className||"",disabled:this.props.disabled||null}),parseInt(this.props.max_count)>0&&p.a.createElement("div",{className:"text-count"},t.length,"/",this.props.max_count))}}]),a}(l.Component))||n)||n)||n)}},[[600,1,2]]]);
static/js/runtime-main.6a483d65.js ADDED
@@ -0,0 +1 @@
 
 
1
+ !function(e){function n(n){for(var r,u,a=n[0],s=n[1],c=n[2],f=0,l=[];f<a.length;f++)u=a[f],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&l.push(o[u][0]),o[u]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(p&&p(n);l.length;)l.shift()();return i.push.apply(i,c||[]),t()}function t(){for(var e,n=0;n<i.length;n++){for(var t=i[n],r=!0,u=1;u<t.length;u++){var a=t[u];0!==o[a]&&(r=!1)}r&&(i.splice(n--,1),e=s(s.s=t[0]))}return e}var r={},o={1:0},i=[];var u={};var a={1508:function(){return{"./tiktoken_bg.js":{__wbindgen_object_drop_ref:function(e){return r[1507].exports.g(e)},__wbindgen_is_undefined:function(e){return r[1507].exports.f(e)},__wbg_stringify_029a979dfb73aa17:function(e){return r[1507].exports.d(e)},__wbindgen_string_get:function(e,n){return r[1507].exports.h(e,n)},__wbindgen_error_new:function(e,n){return r[1507].exports.e(e,n)},__wbg_parse_3ac95b51fc312db8:function(e,n){return r[1507].exports.b(e,n)},__wbindgen_throw:function(e,n){return r[1507].exports.i(e,n)}}}}};function s(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,s),t.l=!0,t.exports}s.e=function(e){var n=[],t=o[e];if(0!==t)if(t)n.push(t[2]);else{var r=new Promise((function(n,r){t=o[e]=[n,r]}));n.push(t[2]=r);var i,c=document.createElement("script");c.charset="utf-8",c.timeout=120,s.nc&&c.setAttribute("nonce",s.nc),c.src=function(e){return s.p+"static/js/"+({}[e]||e)+"."+{3:"753cf703"}[e]+".chunk.js"}(e);var f=new Error;i=function(n){c.onerror=c.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;f.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",f.name="ChunkLoadError",f.type=r,f.request=i,t[1](f)}o[e]=void 0}};var l=setTimeout((function(){i({type:"timeout",target:c})}),12e4);c.onerror=c.onload=i,document.head.appendChild(c)}return({3:[1508]}[e]||[]).forEach((function(e){var t=u[e];if(t)n.push(t);else{var r,o=a[e](),i=fetch(s.p+""+{1508:"d032240921e3b8f45d06"}[e]+".module.wasm");if(o instanceof Promise&&"function"===typeof WebAssembly.compileStreaming)r=Promise.all([WebAssembly.compileStreaming(i),o]).then((function(e){return WebAssembly.instantiate(e[0],e[1])}));else if("function"===typeof WebAssembly.instantiateStreaming)r=WebAssembly.instantiateStreaming(i,o);else{r=i.then((function(e){return e.arrayBuffer()})).then((function(e){return WebAssembly.instantiate(e,o)}))}n.push(u[e]=r.then((function(n){return s.w[e]=(n.instance||n).exports})))}})),Promise.all(n)},s.m=e,s.c=r,s.d=function(e,n,t){s.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,n){if(1&n&&(e=s(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(s.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)s.d(t,r,function(n){return e[n]}.bind(null,r));return t},s.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(n,"a",n),n},s.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},s.p="./",s.oe=function(e){throw console.error(e),e},s.w={};var c=this.webpackJsonpchatchan=this.webpackJsonpchatchan||[],f=c.push.bind(c);c.push=n,c=c.slice();for(var l=0;l<c.length;l++)n(c[l]);var p=f;t()}([]);
static/media/icons-16.05f1cdad.eot ADDED
Binary file (99 kB). View file
 
static/media/icons-16.3c1c220e.woff ADDED
Binary file (98.9 kB). View file
 
static/media/icons-16.3cde8748.ttf ADDED
Binary file (98.8 kB). View file
 
static/media/icons-20.0a5c7651.eot ADDED
Binary file (102 kB). View file
 
static/media/icons-20.51ec31f3.ttf ADDED
Binary file (102 kB). View file
 
static/media/icons-20.cef8cdbb.woff ADDED
Binary file (102 kB). View file
 
tailwind.min.css ADDED
The diff for this file is too large to render. See raw diff