feat(desktop): compiled React Desktop 2.0 v0.2.1 renderer update (#787)
* fix(desktop): expose explicit backup capabilities * fix(desktop): align titlebar controls with native metrics * release(desktop): prepare portable v0.2.1 * build(desktop): rebuild compiled dist from source 4a67226 Rebuild the compiled-only React Desktop 2.0 renderer from abraxas914/GenericAgent main @4a67226, carrying the v0.2.1 iterations that PR #784 was closed to await: live turn-timer persistence across session switch, Mixin image-to-path fallback, folder drag-drop, per-turn duration, and image-thumbnail repair. - dist/**: regenerated 98 manifest assets + entry HTML - build-provenance.json: sourceCommit -> 4a67226, manifest sha256 recomputed - verify-compiled-dist.mjs: expectedSourceCommit -> 4a67226 - dist/README.md: provenance source commit updated - desktop_bridge.py, test_bridge_origin_security.py: synced to 4a67226 - core (agentmain.py, llmcore*, src/**, public/**) remains zero-diff vs upstream --------- Co-authored-by: abraxas914 <abraxas345589144233@outlook.com>
This commit is contained in:
1 parent
7ad2162f30
commit
efb3bc6ad1
45 files changed
+522
-197
No files matched your search
@@ -546,15 +546,24 @@ jobs:
|
||||
build-macos:
|
||||
name: macOS arm64 DMG
|
||||
if: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/desktop-portable-')) || (github.event_name == 'workflow_dispatch' && (github.event.inputs.target == 'all' || github.event.inputs.target == 'macos')) }}
|
||||
runs-on: macos-15
|
||||
runs-on: macos-26
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_26.5.app/Contents/Developer
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Verify pinned macOS build environment
|
||||
run: |
|
||||
test "$(uname -m)" = arm64
|
||||
test "$(xcodebuild -version | sed -n '1p')" = "Xcode 26.5"
|
||||
test "$(xcodebuild -version | sed -n '2p')" = "Build version 17F42"
|
||||
test "$(xcrun --sdk macosx --show-sdk-version)" = "26.5"
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
@@ -587,9 +596,6 @@ jobs:
|
||||
python3 -m pip install --require-hashes --only-binary=:all:
|
||||
--requirement frontends/desktop/packaging/dmg-build-requirements.txt
|
||||
|
||||
- name: Assert macOS runner architecture
|
||||
run: test "$(uname -m)" = arm64
|
||||
|
||||
- name: Verify tracked compiled renderer bytes
|
||||
working-directory: frontends/desktop
|
||||
run: npm run test:dist
|
||||
|
||||
@@ -69,7 +69,7 @@ existing core contracts.
|
||||
|
||||
## Version and release contract
|
||||
|
||||
Desktop package metadata is `0.2.0` across npm, Cargo, Tauri, and generated provenance. Upstream packages consume
|
||||
Desktop package metadata is `0.2.1` across npm, Cargo, Tauri, and generated provenance. Upstream packages consume
|
||||
the tracked `dist/**` tree, so an upstream maintainer can build official Windows, Linux, and macOS artifacts
|
||||
without the React source. A `desktop-portable-*` tag starts three read-only platform builders. One separate
|
||||
publisher receives write permission only after all three succeed, validates the six expected files and checksums,
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
# GenericAgent React Desktop 2.0 — compiled distribution
|
||||
|
||||
This directory contains generated HTML, JavaScript, CSS, fonts, images, and license notices for the
|
||||
This directory contains the v0.2.1 generated HTML, JavaScript, CSS, fonts, images, and license notices for the
|
||||
GenericAgent React Desktop 2.0 renderer. It is build output, not the React development tree.
|
||||
|
||||
## Source and contributions
|
||||
@@ -9,7 +9,7 @@ The public React source of truth and the place for renderer issues, pull request
|
||||
|
||||
- <https://github.com/abraxas914/GenericAgent>
|
||||
- Exact source used for this distribution:
|
||||
[`9fe5d69b85cfad8778ace84b6f69bc75f9e0d392`](https://github.com/abraxas914/GenericAgent/commit/9fe5d69b85cfad8778ace84b6f69bc75f9e0d392)
|
||||
[`4a67226e18cb003db1210357ea4a283774773acc`](https://github.com/abraxas914/GenericAgent/commit/4a67226e18cb003db1210357ea4a283774773acc)
|
||||
|
||||
Over the two-month React Desktop 2.0 development cycle, [abraxas914](https://github.com/abraxas914) led the new
|
||||
renderer architecture and UI, Desktop bridge and Tauri integration, startup and recovery surfaces, package
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{g as q}from"./tauri-compat-tfiFK9EG.js";var x,P;function Q(){if(P)return x;P=1;var i=4,t=.001,e=1e-7,s=10,n=11,a=1/(n-1),c=typeof Float32Array=="function";function l(u,o){return 1-3*o+3*u}function g(u,o){return 3*o-6*u}function T(u){return 3*u}function r(u,o,f){return((l(o,f)*u+g(o,f))*u+T(o))*u}function h(u,o,f){return 3*l(o,f)*u*u+2*g(o,f)*u+T(o)}function C(u,o,f,p,y){var m,_,F=0;do _=o+(f-o)/2,m=r(_,p,y)-u,m>0?f=_:o=_;while(Math.abs(m)>e&&++F<s);return _}function b(u,o,f,p){for(var y=0;y<i;++y){var m=h(o,f,p);if(m===0)return o;var _=r(o,f,p)-u;o-=_/m}return o}function d(u){return u}return x=function(o,f,p,y){if(!(0<=o&&o<=1&&0<=p&&p<=1))throw new Error("bezier x values must be in [0, 1] range");if(o===f&&p===y)return d;for(var m=c?new Float32Array(n):new Array(n),_=0;_<n;++_)m[_]=r(_*a,o,p);function F(v){for(var S=0,j=1,R=n-1;j!==R&&m[j]<=v;++j)S+=a;--j;var U=(v-m[j])/(m[j+1]-m[j]),A=S+U*a,k=h(A,o,p);return k>=t?b(v,A,o,p):k===0?A:C(v,S,S+a,o,p)}return function(S){return S===0?0:S===1?1:r(F(S),f,y)}},x}var K=Q();const z=q(K);function B(i,t,e){return Math.min(Math.max(i,t),e)}function W(i){const t=/\(([^)]+)\)/.exec(i);return t?t[1].split(",").map(e=>parseFloat(e)):[]}function V(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5;const e=B(i,1,10),s=B(t,.1,2);return n=>n===0||n===1?n:-e*Math.pow(2,10*(n-1))*Math.sin((n-1-s/(Math.PI*2)*Math.asin(1/e))*(Math.PI*2)/s)}const N=(()=>{const i=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],t={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],V],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],(s,n)=>a=>1-V(s,n)(1-a)],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],(s,n)=>a=>a<.5?V(s,n)(a*2)/2:1-V(s,n)(a*-2+2)/2]},e={linear:[.25,.25,.75,.75]};for(const s of Object.keys(t))t[s].forEach((n,a)=>{e["ease"+s+i[a]]=n});return e})();function D(i){if(typeof i=="function")return i;!i||typeof i!="string"?i="linear":i=i.trim();let t=i.split("(")[0];const e=W(i);let s;return t==="cubic-bezier"||t==="cubicBezier"?z(...e.length?e:N.linear):((!t||typeof t!="string"||typeof t=="string"&&N[t]==null)&&(t="linear"),s=N[t],typeof s=="function"?s(...e):e.length?z(...e):z(...s))}class Z{constructor(){this._eventMap=new Map}on(t,e){return t&&typeof e=="function"&&(this._eventMap.has(t)||this._eventMap.set(t,[]),this._eventMap.get(t).push(e)),this}once(t,e){var s=this;if(t&&typeof e=="function"){const n=function(){e(...arguments),s.off(t,n)};this.on(t,n)}}off(t,e){if(t)if(typeof e=="function"){const s=this._eventMap.get(t);if(Array.isArray(s)&&s.length){let n=-1;for(;(n=s.findIndex(a=>a===e))>-1;)s.splice(n,1)}}else e==null&&this._eventMap.delete(t);return this}emit(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this._eventMap.has(t)?(this._eventMap.get(t).forEach(a=>a(...s)),!0):!1}}function M(i){return!!(i&&typeof i=="object"&&(i.duration>0||typeof i.easing=="string"||typeof i.easing=="function"))}function H(i,t,e,s,n){for(const a of Object.keys(t)){const c=t[a],l=typeof c=="number"?c:c.val;if(!(typeof c=="object"&&c.done)){if(M(c)&&s&&n&&c.duration){if(c.duration+s<=n||l!==i[a])return!1}else if(typeof e[a]=="number"&&e[a]!==0)return!1;if(i[a]!==l)return!1}}return!0}function E(i){const t={};for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=typeof i[e]=="number"?i[e]:i[e].val);return t}const I=[0,0];function L(i,t,e,s,n,a,c){const l=-n*(t-s),g=-a*e,T=l+g,r=e+T*i,h=t+r*i;return Math.abs(r)<c&&Math.abs(h-s)<c?(I[0]=s,I[1]=0,I):(I[0]=h,I[1]=r,I)}function J(i){const t={},e=i&&Object.keys(i)||[];for(const s of e)t[s]=0;return t}const $={default:{tension:170,friction:26}},Y=Object.assign(Object.assign({},$.default),{precision:.01});function G(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M(t)){const s=D(t.easing),n=typeof t.duration=="number"&&t.duration>0?t.duration:1e3;t=Object.assign(Object.assign({},t),{easing:s,duration:n})}let e=Object.assign(Object.assign(Object.assign({},Y),t),{done:!1});if(i&&typeof i=="object"&&"val"in i){if(M(i)){const s=D(i.easing),n=typeof i.duration=="number"&&i.duration>0?i.duration:parseInt(t.duration)||1e3;i=Object.assign(Object.assign({},i),{easing:s,duration:n})}e=Object.assign(Object.assign({},e),i)}else e=Object.assign(Object.assign({},e),{val:i});return e}const w=()=>Date.now(),O=1e3/60;class tt extends Z{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),this._props=Object.assign({},t),this._config=Object.assign({},e),this.initStates()}_wrapConfig(t,e){e=e&&typeof e=="object"?Line truncated
|
||||
import{g as q}from"./tauri-compat-D_GD_wMe.js";var x,P;function Q(){if(P)return x;P=1;var i=4,t=.001,e=1e-7,s=10,n=11,a=1/(n-1),c=typeof Float32Array=="function";function l(u,o){return 1-3*o+3*u}function g(u,o){return 3*o-6*u}function T(u){return 3*u}function r(u,o,f){return((l(o,f)*u+g(o,f))*u+T(o))*u}function h(u,o,f){return 3*l(o,f)*u*u+2*g(o,f)*u+T(o)}function C(u,o,f,p,y){var m,_,F=0;do _=o+(f-o)/2,m=r(_,p,y)-u,m>0?f=_:o=_;while(Math.abs(m)>e&&++F<s);return _}function b(u,o,f,p){for(var y=0;y<i;++y){var m=h(o,f,p);if(m===0)return o;var _=r(o,f,p)-u;o-=_/m}return o}function d(u){return u}return x=function(o,f,p,y){if(!(0<=o&&o<=1&&0<=p&&p<=1))throw new Error("bezier x values must be in [0, 1] range");if(o===f&&p===y)return d;for(var m=c?new Float32Array(n):new Array(n),_=0;_<n;++_)m[_]=r(_*a,o,p);function F(v){for(var S=0,j=1,R=n-1;j!==R&&m[j]<=v;++j)S+=a;--j;var U=(v-m[j])/(m[j+1]-m[j]),A=S+U*a,k=h(A,o,p);return k>=t?b(v,A,o,p):k===0?A:C(v,S,S+a,o,p)}return function(S){return S===0?0:S===1?1:r(F(S),f,y)}},x}var K=Q();const z=q(K);function B(i,t,e){return Math.min(Math.max(i,t),e)}function W(i){const t=/\(([^)]+)\)/.exec(i);return t?t[1].split(",").map(e=>parseFloat(e)):[]}function V(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5;const e=B(i,1,10),s=B(t,.1,2);return n=>n===0||n===1?n:-e*Math.pow(2,10*(n-1))*Math.sin((n-1-s/(Math.PI*2)*Math.asin(1/e))*(Math.PI*2)/s)}const N=(()=>{const i=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],t={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],V],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],(s,n)=>a=>1-V(s,n)(1-a)],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],(s,n)=>a=>a<.5?V(s,n)(a*2)/2:1-V(s,n)(a*-2+2)/2]},e={linear:[.25,.25,.75,.75]};for(const s of Object.keys(t))t[s].forEach((n,a)=>{e["ease"+s+i[a]]=n});return e})();function D(i){if(typeof i=="function")return i;!i||typeof i!="string"?i="linear":i=i.trim();let t=i.split("(")[0];const e=W(i);let s;return t==="cubic-bezier"||t==="cubicBezier"?z(...e.length?e:N.linear):((!t||typeof t!="string"||typeof t=="string"&&N[t]==null)&&(t="linear"),s=N[t],typeof s=="function"?s(...e):e.length?z(...e):z(...s))}class Z{constructor(){this._eventMap=new Map}on(t,e){return t&&typeof e=="function"&&(this._eventMap.has(t)||this._eventMap.set(t,[]),this._eventMap.get(t).push(e)),this}once(t,e){var s=this;if(t&&typeof e=="function"){const n=function(){e(...arguments),s.off(t,n)};this.on(t,n)}}off(t,e){if(t)if(typeof e=="function"){const s=this._eventMap.get(t);if(Array.isArray(s)&&s.length){let n=-1;for(;(n=s.findIndex(a=>a===e))>-1;)s.splice(n,1)}}else e==null&&this._eventMap.delete(t);return this}emit(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this._eventMap.has(t)?(this._eventMap.get(t).forEach(a=>a(...s)),!0):!1}}function M(i){return!!(i&&typeof i=="object"&&(i.duration>0||typeof i.easing=="string"||typeof i.easing=="function"))}function H(i,t,e,s,n){for(const a of Object.keys(t)){const c=t[a],l=typeof c=="number"?c:c.val;if(!(typeof c=="object"&&c.done)){if(M(c)&&s&&n&&c.duration){if(c.duration+s<=n||l!==i[a])return!1}else if(typeof e[a]=="number"&&e[a]!==0)return!1;if(i[a]!==l)return!1}}return!0}function E(i){const t={};for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=typeof i[e]=="number"?i[e]:i[e].val);return t}const I=[0,0];function L(i,t,e,s,n,a,c){const l=-n*(t-s),g=-a*e,T=l+g,r=e+T*i,h=t+r*i;return Math.abs(r)<c&&Math.abs(h-s)<c?(I[0]=s,I[1]=0,I):(I[0]=h,I[1]=r,I)}function J(i){const t={},e=i&&Object.keys(i)||[];for(const s of e)t[s]=0;return t}const $={default:{tension:170,friction:26}},Y=Object.assign(Object.assign({},$.default),{precision:.01});function G(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M(t)){const s=D(t.easing),n=typeof t.duration=="number"&&t.duration>0?t.duration:1e3;t=Object.assign(Object.assign({},t),{easing:s,duration:n})}let e=Object.assign(Object.assign(Object.assign({},Y),t),{done:!1});if(i&&typeof i=="object"&&"val"in i){if(M(i)){const s=D(i.easing),n=typeof i.duration=="number"&&i.duration>0?i.duration:parseInt(t.duration)||1e3;i=Object.assign(Object.assign({},i),{easing:s,duration:n})}e=Object.assign(Object.assign({},e),i)}else e=Object.assign(Object.assign({},e),{val:i});return e}const w=()=>Date.now(),O=1e3/60;class tt extends Z{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),this._props=Object.assign({},t),this._config=Object.assign({},e),this.initStates()}_wrapConfig(t,e){e=e&&typeof e=="object"?Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
import{b as r,aj as l}from"./tauri-compat-tfiFK9EG.js";import{H as i,b as N,J as C,K as S,L as M,N as T,O as v,M as E,P as W}from"./main-BlLQtfpq.js";import{MarkdownPart as w}from"./MarkdownPart-B6YIH_Oj.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";import"./markdown-preprocess-6737_jWr.js";function R(e){const c=Math.floor(e/1e3);if(c<60)return`${c}s`;const a=Math.floor(c/60),n=c%60;return`${a}m ${n}s`}function $({since:e}){const[c,a]=r.useState(Date.now());return r.useEffect(()=>{const n=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(n)},[]),l.jsx(l.Fragment,{children:R(c-e)})}const D=200;function P({message:e}){const c=e.role==="user",a=e.role==="conductor";return l.jsx("div",{className:`collab-msg collab-msg--${e.role}`,"data-slot":"collab-msg",children:l.jsxs("div",{className:`collab-bubble ${c?"collab-bubble--user":a?"collab-bubble--conductor":"collab-bubble--system"}`,children:[e.images&&e.images.length>0&&l.jsx("div",{className:"collab-msg-images",children:e.images.map((n,s)=>l.jsx("img",{src:n.base64||n.path,alt:n.name,className:"collab-msg-img"},s))}),e.files&&e.files.length>0&&l.jsx("div",{className:"collab-msg-files",children:e.files.map((n,s)=>l.jsx("span",{className:"collab-msg-file-chip",children:n.name},s))}),a||e.role==="system"?l.jsx(w,{content:e.msg}):l.jsx("span",{className:"collab-msg-text",children:e.msg})]})})}function B({since:e}){const{t:c}=N();return l.jsx("div",{className:"collab-msg collab-msg--conductor","data-slot":"collab-typing",children:l.jsxs("div",{className:"collab-thinking-bar",children:[l.jsx("span",{className:"collab-thinking-dot"}),l.jsx("span",{className:"collab-thinking-label",children:c("collab.typing")}),l.jsx("span",{className:"collab-thinking-time",children:l.jsx($,{since:e})})]})})}function I(){const e=i(o=>o.messages),c=i(o=>o.conductorTyping),a=i(o=>o.connectionStatus),{t:n}=N(),{scrollRef:s}=C(),[u,x]=r.useState(1),d=r.useRef(null),p=r.useRef(0);r.useEffect(()=>{(a==="connecting"||e.length===0)&&x(1)},[a,e.length]);const b=D*u,m=Math.max(0,e.length-b),k=e.slice(m),t=m,g=r.useCallback(()=>{const o=s.current;o&&(d.current=o.scrollHeight-o.scrollTop),x(h=>h+1)},[s]);r.useLayoutEffect(()=>{if(d.current==null)return;if(m>=p.current){d.current=null,p.current=m;return}const o=s.current;o&&(o.scrollTop=o.scrollHeight-d.current),d.current=null,p.current=m},[m,s]),r.useEffect(()=>{p.current=m},[m]);const j=[...e].reverse().find(o=>o.role==="user"),y=o=>o>1e12?o:o*1e3,f=r.useRef(Date.now());return j!=null&&j.ts&&(f.current=y(j.ts)),a==="connecting"?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsxs("div",{className:"collab-connecting",children:[l.jsx("span",{className:"collab-connecting-dot"}),l.jsx("span",{children:n("status.connecting")})]})}):e.length===0?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsx("div",{className:"collab-empty",children:l.jsx("p",{children:n("collab.placeholder")})})}):l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",ref:s,children:l.jsxs("div",{className:"collab-messages-scroll",children:[t>0&&l.jsxs("button",{type:"button","data-slot":"show-earlier-btn",onClick:g,children:["Show ",t," earlier"]}),k.map((o,h)=>l.jsx(P,{message:o},o.id||m+h)),c&&l.jsx(B,{since:f.current})]})})}function F(){const e=i(t=>t.sendMessage),c=i(t=>t.conductorTyping),a=i(t=>t.connectionStatus),n=i(t=>t.modelConfig),s=i(t=>t.runtimeModel),u=i(t=>t.loadModel),x=i(t=>t.selectModel),d=S(t=>t.defaultModelNo);r.useEffect(()=>{u()},[u]);const p=r.useCallback((t,g)=>{var f,o;const j=(f=g==null?void 0:g.files)==null?void 0:f.map(h=>({name:h.name,path:h.path})),y=(o=g==null?void 0:g.images)==null?void 0:o.map(h=>({name:h.name,path:h.path,base64:h.base64}));e(t,j,y)},[e]),b=r.useCallback(()=>{},[]),m=a!=="ready",k=(n==null?void 0:n.effective)??(n==null?void 0:n.configured)??d;return l.jsx("div",{className:"collab-composer-wrap","data-slot":"collab-composer","data-disabled":m||void 0,children:l.jsx(M,{onSend:p,onStop:b,isGenerating:c,hideStatusStack:!0,modelControl:l.jsx(T,{selectedNo:k,runningNo:s!=null&&s.running?s.effective:null,isRunning:!!(s!=null&&s.running),onSelect:x})})})}const H=[{key:"1",icon:"comment"},{key:"2",icon:"symbol-misc"},{key:"3",icon:"graph"},{key:"4",icon:"edit"}],L=["collab.chipProgress","collab.chipPause","collab.chipSummary"];function O({onChipClick:e}){const{t:c}=N();return l.jsxs("div",{className:"collab-welcome","data-slot":"collab-welcome",children:[l.jsx("h2",{className:"collab-welcome-title",children:c("collab.guideTitle")}),l.jsx("p",{className:"collab-welcome-sub",children:c("collab.guideWhen")}),l.jsx("div",{className:"collab-welcome-steps",children:H.map(a=>l.jsxs("div",{className:"collab-welcome-step",children:[l.jsx("span",{className:"collab-welcome-step-icon",children:l.jsx(v,{name:a.icon,size:"1rem"})}),l.jsxs("span",{className:"collab-welcome-step-text",children:[l.jsx("span",{className:"collabLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{b as r,aj as l}from"./tauri-compat-D_GD_wMe.js";import{H as i,b as N,J as C,L as S,K as M,N as T,O as W,P as v,M as R,Q as E}from"./main-j7e_THPB.js";import{MarkdownPart as w}from"./MarkdownPart-ZJKeOipX.js";import"./index-9FI8Jlf5.js";import"./WindowsTitlebar-Byi-SYR_.js";import"./markdown-preprocess-Cc2i34eF.js";const $=200;function D({message:a}){const n=a.role==="user",e=a.role==="conductor";return l.jsx("div",{className:`collab-msg collab-msg--${a.role}`,"data-slot":"collab-msg",children:l.jsxs("div",{className:`collab-bubble ${n?"collab-bubble--user":e?"collab-bubble--conductor":"collab-bubble--system"}`,children:[a.images&&a.images.length>0&&l.jsx("div",{className:"collab-msg-images",children:a.images.map((c,s)=>l.jsx("img",{src:c.base64||c.path,alt:c.name,className:"collab-msg-img"},s))}),a.files&&a.files.length>0&&l.jsx("div",{className:"collab-msg-files",children:a.files.map((c,s)=>l.jsx("span",{className:"collab-msg-file-chip",children:c.name},s))}),e||a.role==="system"?l.jsx(w,{content:a.msg}):l.jsx("span",{className:"collab-msg-text",children:a.msg})]})})}function P({since:a}){const{t:n}=N();return l.jsx("div",{className:"collab-msg collab-msg--conductor","data-slot":"collab-typing",children:l.jsxs("div",{className:"collab-thinking-bar",children:[l.jsx("span",{className:"collab-thinking-dot"}),l.jsx("span",{className:"collab-thinking-label",children:n("collab.typing")}),l.jsx("span",{className:"collab-thinking-time",children:l.jsx(S,{since:a})})]})})}function B(){const a=i(o=>o.messages),n=i(o=>o.conductorTyping),e=i(o=>o.connectionStatus),{t:c}=N(),{scrollRef:s}=C(),[m,x]=r.useState(1),d=r.useRef(null),p=r.useRef(0);r.useEffect(()=>{(e==="connecting"||a.length===0)&&x(1)},[e,a.length]);const b=$*m,u=Math.max(0,a.length-b),k=a.slice(u),t=u,g=r.useCallback(()=>{const o=s.current;o&&(d.current=o.scrollHeight-o.scrollTop),x(h=>h+1)},[s]);r.useLayoutEffect(()=>{if(d.current==null)return;if(u>=p.current){d.current=null,p.current=u;return}const o=s.current;o&&(o.scrollTop=o.scrollHeight-d.current),d.current=null,p.current=u},[u,s]),r.useEffect(()=>{p.current=u},[u]);const j=[...a].reverse().find(o=>o.role==="user"),y=o=>o>1e12?o:o*1e3,f=r.useRef(Date.now());return j!=null&&j.ts&&(f.current=y(j.ts)),e==="connecting"?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsxs("div",{className:"collab-connecting",children:[l.jsx("span",{className:"collab-connecting-dot"}),l.jsx("span",{children:c("status.connecting")})]})}):a.length===0?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsx("div",{className:"collab-empty",children:l.jsx("p",{children:c("collab.placeholder")})})}):l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",ref:s,children:l.jsxs("div",{className:"collab-messages-scroll",children:[t>0&&l.jsxs("button",{type:"button","data-slot":"show-earlier-btn",onClick:g,children:["Show ",t," earlier"]}),k.map((o,h)=>l.jsx(D,{message:o},o.id||u+h)),n&&l.jsx(P,{since:f.current})]})})}function H(){const a=i(t=>t.sendMessage),n=i(t=>t.conductorTyping),e=i(t=>t.connectionStatus),c=i(t=>t.modelConfig),s=i(t=>t.runtimeModel),m=i(t=>t.loadModel),x=i(t=>t.selectModel),d=M(t=>t.defaultModelNo);r.useEffect(()=>{m()},[m]);const p=r.useCallback((t,g)=>{var f,o;const j=(f=g==null?void 0:g.files)==null?void 0:f.map(h=>({name:h.name,path:h.path})),y=(o=g==null?void 0:g.images)==null?void 0:o.map(h=>({name:h.name,path:h.path,base64:h.base64}));a(t,j,y)},[a]),b=r.useCallback(()=>{},[]),u=e!=="ready",k=(c==null?void 0:c.effective)??(c==null?void 0:c.configured)??d;return l.jsx("div",{className:"collab-composer-wrap","data-slot":"collab-composer","data-disabled":u||void 0,children:l.jsx(T,{onSend:p,onStop:b,isGenerating:n,hideStatusStack:!0,modelControl:l.jsx(W,{selectedNo:k,runningNo:s!=null&&s.running?s.effective:null,isRunning:!!(s!=null&&s.running),onSelect:x})})})}const L=[{key:"1",icon:"comment"},{key:"2",icon:"symbol-misc"},{key:"3",icon:"graph"},{key:"4",icon:"edit"}],F=["collab.chipProgress","collab.chipPause","collab.chipSummary"];function I({onChipClick:a}){const{t:n}=N();return l.jsxs("div",{className:"collab-welcome","data-slot":"collab-welcome",children:[l.jsx("h2",{className:"collab-welcome-title",children:n("collab.guideTitle")}),l.jsx("p",{className:"collab-welcome-sub",children:n("collab.guideWhen")}),l.jsx("div",{className:"collab-welcome-steps",children:L.map(e=>l.jsxs("div",{className:"collab-welcome-step",children:[l.jsx("span",{className:"collab-welcome-step-icon",children:l.jsx(v,{name:e.icon,size:"1rem"})}),l.jsxs("span",{className:"collab-welcome-step-text",children:[l.jsx("span",{className:"collab-welcome-step-label",children:n(`collab.guideStep${e.key}t`)}),l.jsx("span",{className:"collab-welcome-step-desc",children:n(`collab.guideStep${e.key}d`)})]})]},e.key))}),l.jsx("div",{className:"collab-welcome-chips",children:F.map(e=>l.jsx("button",{type:"button",className:"collab-welcome-chip",oLine truncated
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as t,b as e}from"./tauri-compat-tfiFK9EG.js";function n(a){return e.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},a),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2a1 1 0 0 0-1-1H6a2 2 0 0 0-2 2v18c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V10a1 1 0 0 0-1-1h-5a2 2 0 0 1-2-2V2ZM7 8a1 1 0 0 1 1-1h1a1 1 0 0 1 0 2H8a1 1 0 0 1-1-1Zm0 5a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Zm1 4a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Zm11.07-9.5H14.5a1 1 0 0 1-1-1V1.93a.8.8 0 0 1 1.37-.56l4.76 4.76a.8.8 0 0 1-.56 1.37Z",fill:"currentColor"}))}const l=t(n,"file");export{l as I};
|
||||
import{c as t,b as e}from"./tauri-compat-D_GD_wMe.js";function n(a){return e.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},a),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2a1 1 0 0 0-1-1H6a2 2 0 0 0-2 2v18c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V10a1 1 0 0 0-1-1h-5a2 2 0 0 1-2-2V2ZM7 8a1 1 0 0 1 1-1h1a1 1 0 0 1 0 2H8a1 1 0 0 1-1-1Zm0 5a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Zm1 4a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Zm11.07-9.5H14.5a1 1 0 0 1-1-1V1.93a.8.8 0 0 1 1.37-.56l4.76 4.76a.8.8 0 0 1-.56 1.37Z",fill:"currentColor"}))}const l=t(n,"file");export{l as I};
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
var an=Object.defineProperty;var nn=(r,e,t)=>e in r?an(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var nr=(r,e,t)=>nn(r,typeof e!="symbol"?e+"":e,t);import{bs as ir,g as sn,b as a0,aj as U}from"./tauri-compat-tfiFK9EG.js";import{M as ln,r as on,a as un,b as cn,p as hn,S as dn}from"./markdown-preprocess-6737_jWr.js";import{Q as sr,S as mn,U as pn}from"./main-BlLQtfpq.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";var at={exports:{}},lr;function fn(){return lr||(lr=1,(function(r){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
||||
var an=Object.defineProperty;var nn=(r,e,t)=>e in r?an(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var nr=(r,e,t)=>nn(r,typeof e!="symbol"?e+"":e,t);import{bs as ir,g as sn,b as a0,aj as U}from"./tauri-compat-D_GD_wMe.js";import{M as ln,r as on,a as un,b as cn,p as hn,S as dn}from"./markdown-preprocess-Cc2i34eF.js";import{S as sr,U as mn,V as pn}from"./main-j7e_THPB.js";import"./index-9FI8Jlf5.js";import"./WindowsTitlebar-Byi-SYR_.js";var at={exports:{}},lr;function fn(){return lr||(lr=1,(function(r){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
||||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||||
*
|
||||
* @license MIT <https://opensource.org/licenses/MIT>
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import{c as se,b as u,ax as Le,f as Ee,h as S,_ as K,i as oe,R as v,k as Te,ay as re,l as D,n as le,V as Oe,az as X,P as f,aj as i,ab as Me}from"./tauri-compat-tfiFK9EG.js";import{T as He,a as Ve,b as ce}from"./index-CPxjSju3.js";import{_ as de,t as Fe,c as Pe,I as Ie,a as Be,u as $e,b as q,d as z,M as fe,e as be,i as xe,f as Y,E as ye,T as ee,g as Ae,h as he}from"./main-BlLQtfpq.js";import{B as _,c as Q,I as Ke}from"./index-Bpi3BHKj.js";import{S as G}from"./index-D_sWIqse.js";import{I as ve}from"./IconFile-CgfQSwGI.js";import"./WindowsTitlebar-CrkUa1UM.js";function We(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M5 2.9a1 1 0 0 1 1.57-.82l13.23 9.1a1 1 0 0 1 0 1.64l-13.23 9.1A1 1 0 0 1 5 21.1V2.9Z",fill:"currentColor"}))}const we=se(We,"play");function Ue(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5.07c-.8.47-1.8.46-2.6 0l-.24-.15a1.4 1.4 0 0 0-1.82.29c-.64.82-1.16 1.73-1.55 2.7a1.4 1.4 0 0 0 .66 1.71l.24.14a2.57 2.57 0 0 1 0 4.48l-.24.14a1.4 1.4 0 0 0-.66 1.72 11.1 11.1 0 0 0 1.55 2.69 1.4 1.4 0 0 0 1.82.3l.25-.15a2.57 2.57 0 0 1 3.88 2.24v.28c-.01.7.46 1.33 1.16 1.43a11 11 0 0 0 3.1 0 1.4 1.4 0 0 0 1.17-1.43v-.28a2.57 2.57 0 0 1 3.87-2.24l.25.14c.6.36 1.38.26 1.82-.29.64-.82 1.16-1.73 1.55-2.7a1.4 1.4 0 0 0-.66-1.71l-.24-.14a2.57 2.57 0 0 1 0-4.48l.24-.14a1.4 1.4 0 0 0 .66-1.72 11.08 11.08 0 0 0-1.55-2.69 1.4 1.4 0 0 0-1.82-.3l-.25.15a2.57 2.57 0 0 1-3.88-2.24v-.28c.01-.7-.46-1.33-1.16-1.43a10.99 10.99 0 0 0-3.1 0c-.7.1-1.17.72-1.17 1.43v.28C9.3 3.75 8.8 4.61 8 5.07Zm6 10.4a4 4 0 1 0-4-6.93 4 4 0 0 0 4 6.92Z",fill:"currentColor"}))}const De=se(Ue,"setting");function qe(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Z",fill:"currentColor"}))}const Se=se(qe,"stop");let R=null;const ue={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},ge=s=>{Object.keys(ue).forEach(e=>{s.style.setProperty(e,ue[e],"important")})},pe=(s,e)=>{const t=s.scrollHeight;return e.sizingStyle.boxSizing==="border-box"?t+e.borderSize:t-e.paddingSize};function Ze(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1/0;R||(R=document.createElement("textarea"),R.setAttribute("tab-index","-1"),R.setAttribute("aria-hidden","true"),ge(R)),R.parentNode===null&&document.body.appendChild(R);const{paddingSize:a,borderSize:o,sizingStyle:r}=s,{boxSizing:l}=r;Object.keys(r).forEach(b=>{R.style[b]=r[b]}),ge(R),R.value=e;let c=pe(R,s);R.value="x";const g=pe(R,s)-a-o;let m=g*t;l==="border-box"&&(m=m+a+o),c=Math.max(m,c);let w=g*n;return l==="border-box"&&(w=w+a+o),c=Math.min(w,c),c}const Xe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],Ye=s=>{const e=window.getComputedStyle(s);if(e===null)return null;const t=Le(e,Xe),{boxSizing:n}=t;if(n==="")return null;const a=parseFloat(t.paddingBottom)+parseFloat(t.paddingTop),o=parseFloat(t.borderBottomWidth)+parseFloat(t.borderTopWidth);return{sizingStyle:t,paddingSize:a,borderSize:o}};class ne extends Ee{static get textAreaDefaultAdapter(){return{notifyChange:S,setValue:S,toggleFocusing:S,toggleHovering:S,notifyFocus:S,notifyBlur:S,notifyKeyDown:S,notifyEnterPress:S}}constructor(e){super(Object.assign(Object.assign({},ne.textAreaDefaultAdapter),e)),this.compositionEnter=!1,this._changeValue=(t,n)=>{this._isControlledComponent()?this._adapter.notifyChange(t,n):(this._adapter.setValue(t),this._adapter.notifyChange(t,n))},this.getNextValue=t=>{const{maxLength:n,minLength:a,getValueLength:o}=this._adapter.getProps();return K(o)?n?this.handleVisibleMaxLength(t):(a&&this.handleVisibleMinLength(t),t):t},this.handleCompositionStart=t=>{this.compositionEnter=!0,this._adapter.notifyCompositionStart(t)},this.handleCompositionEnd=t=>{const{composition:n}=this._adapter.getProps(),a=t.target.value;if(this.compositionEnter=!1,this._adapter.notifyCompositionEnd(t),n){const c=this.getNextValue(a);this._changeValue(c,t);return}const{getValueLength:o,maxLength:r,minLength:l}=this.getProps();if(K(o)){if(r){const c=this.handleVisibleMaxLength(a);c!==a&&this._changeValue(c,t)}l&&this.handleVisibleMinLength(a)}},this.handleCompositionUpdate=t=>{this._adapter.notifyCompLine truncated
|
||||
`):[""],m=D(`${y}-textarea-lineNumber`,n),w=c?this.getTextareaLineHeightPx(c):21,b=Object.assign(Object.assign({},a||{}),{height:l?`${l}px`:void 0,maxHeight:l?`${l}px`:void 0});return v.createElement("div",{ref:this.lineNumberRef,className:m,style:b},g.map((E,C)=>{const k=c?this.calculateWrappedLines(E,c):1;return v.createElement("div",{key:C,className:`${y}-textarea-lineNumber-item`,style:{minHeight:`${k*w}px`,lineHeight:`${w}px`}},t+C)}))}render(){const e=this.props,{autosize:t,placeholder:n,onEnterPress:a,onResize:o,resize:r,disabled:l,readonly:c,className:g,showCounter:m,validateStatus:w,maxCount:b,defaultValue:E,style:C,textareaStyle:k,forwardRef:T,getValueLength:H,maxLength:p,minLength:N,showClear:O,borderless:L,autoFocus:I,showLineNumber:d,lineNumberStart:h,lineNumberClassName:x,lineNumberStyle:M,composition:U}=e,B=Qe(e,["autosize","placeholder","onEnterPress","onResize","resize","disabled","readonly","className","showCounter","validateStatus","maxCount","defaultValue","style","textareaStyle","forwardRef","getValueLength","maxLength","minLength","showClear","borderless","autoFocus","showLineNumber","lineNumberStart","lineNumberClassName","lineNumberStyle","composition"]),{isFocus:Z,value:$,minLength:F}=this.state,A=!le(r),je=!t&&A&&["horizontal","both","inline"].includes(r),Re=!t&&A&&["vertical","both","block"].includes(r),_e=D(g,`${y}-textarea-wrapper`,{[`${y}-textarea-borderless`]:L,[`${y}-textarea-wrapper-disabled`]:l,[`${y}-textarea-wrapper-readonly`]:c,[`${y}-textarea-wrapper-${w}`]:!!w,[`${y}-textarea-wrapper-focus`]:Z,[`${y}-textarea-wrapper-withLineNumber`]:d,[`${y}-textarea-wrapper-resizeX`]:je,[`${y}-textarea-wrapper-resizeY`]:Re}),ke=D(`${y}-textarea`,{[`${y}-textarea-disabled`]:l,[`${y}-textarea-readonly`]:c,[`${y}-textarea-autosize`]:Be(t)?le(t==null?void 0:t.maxRows):t,[`${y}-textarea-showClear`]:O}),J=Object.assign({},k||{});t?J.resize="none":A&&(J.resize=r);const ie=!t&&A&&r&&r!=="none",V=Object.assign(Object.assign({},Oe(B,"insetLabel","insetLabelId","getValueLength","onClear","showClear","disabledEnterStartNewLine","composition")),{style:J,autoFocus:I||this.props.autofocus,className:ke,disabled:l,readOnly:c,placeholder:n||null,onChange:j=>this.foundation.handleChange(j.target.value,j),onFocus:j=>this.foundation.handleFocus(j),onBlur:j=>this.foundation.handleBlur(j.nativeEvent),onKeyDown:j=>this.foundation.handleKeyDown(j),onScroll:this.handleTextAreaScroll,value:$??"",onCompositionStart:this.foundation.handleCompositionStart,onCompositionEnd:this.foundation.handleCompositionEnd,onCompositionUpdate:this.foundation.handleCompositionUpdate});return K(H)||(V.maxLength=p),F&&(V.minLength=F),v.createElement("div",{className:_e,style:C,onMouseEnter:j=>this.foundation.handleMouseEnter(j),onMouseLeave:j=>this.foundation.handleMouseLeave(j),onClick:j=>this.handleClick(j)},this.renderLineNumbers(),d?v.createElement("div",{className:`${y}-textarea-content`},t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef})),this.renderClearBtn(),this.renderCounter())}}ae.propTypes={autosize:f.oneOfType([f.bool,f.object]),borderless:f.bool,placeholder:f.string,value:f.string,rows:f.number,cols:f.number,maxCount:f.number,onEnterPress:f.func,validateStatus:f.string,className:f.string,style:f.object,textareaStyle:f.object,showClear:f.bool,onClear:f.func,onResize:f.func,onCompositionStart:f.func,onCompositionEnd:f.func,onCompositionUpdate:f.func,getValueLength:f.func,disabledEnterStartNewLine:f.bool,composition:f.bool,showLineNumber:f.bool,lineNumberStart:f.number,lineNumberClassName:f.string,lineNumberStyle:f.object,resize:f.oneOf(["none","both","horizontal","vertical","block","inline"])};ae.defaultProps={autosize:!1,borderless:!1,rows:4,cols:20,showCounter:!1,showClear:!1,onEnterPress:S,onChange:S,onBlur:S,onFocus:S,onKeyDown:S,onResize:S,onClear:S,onCompositionStart:S,onCompositionEnd:S,onCompositionUpdate:S,composition:!1,showLineNumber:!1,lineNumberStart:1};const Ge=v.forwardRef((s,e)=>v.createElement(ae,Object.assign({},s,{forwardRef:e})));function Je({lines:s,emptyLabel:e="No logs",className:t}){const n=u.useRef(null),a=u.useRef(!0),[o,r]=u.useState(!1);u.useEffect(()=>{const g=n.current;g&&a.current&&(g.scrollTop=g.scrollHeight)},[s]);const l=u.useCallback(g=>{const m=g.currentTarget;a.current=m.scrollHeight-m.scrollTop-m.clientHeight<24},[]),c=u.useCallback(()=>{s!=null&&s.length&&navigator.clipboard.writeText(s.join(
Line truncated
|
||||
import{c as se,b as u,ax as Le,f as Ee,h as S,_ as K,i as oe,R as v,k as Te,ay as re,l as D,n as le,V as Oe,az as X,P as f,aj as i,ab as Me}from"./tauri-compat-D_GD_wMe.js";import{T as He,a as Ve,b as ce}from"./index-BkPDmlaQ.js";import{_ as he,t as Fe,c as Pe,I as Ie,a as $e,u as Be,b as q,d as z,M as fe,e as xe,i as be,f as Y,E as ye,T as ee,g as Ae,h as de}from"./main-j7e_THPB.js";import{B as _,c as Q,I as Ke}from"./index-9FI8Jlf5.js";import{S as G}from"./index-D9Nakaf3.js";import{I as ve}from"./IconFile-C8B3WX2U.js";import"./WindowsTitlebar-Byi-SYR_.js";function We(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M5 2.9a1 1 0 0 1 1.57-.82l13.23 9.1a1 1 0 0 1 0 1.64l-13.23 9.1A1 1 0 0 1 5 21.1V2.9Z",fill:"currentColor"}))}const we=se(We,"play");function Ue(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5.07c-.8.47-1.8.46-2.6 0l-.24-.15a1.4 1.4 0 0 0-1.82.29c-.64.82-1.16 1.73-1.55 2.7a1.4 1.4 0 0 0 .66 1.71l.24.14a2.57 2.57 0 0 1 0 4.48l-.24.14a1.4 1.4 0 0 0-.66 1.72 11.1 11.1 0 0 0 1.55 2.69 1.4 1.4 0 0 0 1.82.3l.25-.15a2.57 2.57 0 0 1 3.88 2.24v.28c-.01.7.46 1.33 1.16 1.43a11 11 0 0 0 3.1 0 1.4 1.4 0 0 0 1.17-1.43v-.28a2.57 2.57 0 0 1 3.87-2.24l.25.14c.6.36 1.38.26 1.82-.29.64-.82 1.16-1.73 1.55-2.7a1.4 1.4 0 0 0-.66-1.71l-.24-.14a2.57 2.57 0 0 1 0-4.48l.24-.14a1.4 1.4 0 0 0 .66-1.72 11.08 11.08 0 0 0-1.55-2.69 1.4 1.4 0 0 0-1.82-.3l-.25.15a2.57 2.57 0 0 1-3.88-2.24v-.28c.01-.7-.46-1.33-1.16-1.43a10.99 10.99 0 0 0-3.1 0c-.7.1-1.17.72-1.17 1.43v.28C9.3 3.75 8.8 4.61 8 5.07Zm6 10.4a4 4 0 1 0-4-6.93 4 4 0 0 0 4 6.92Z",fill:"currentColor"}))}const De=se(Ue,"setting");function qe(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Z",fill:"currentColor"}))}const Se=se(qe,"stop");let R=null;const ue={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},ge=s=>{Object.keys(ue).forEach(e=>{s.style.setProperty(e,ue[e],"important")})},pe=(s,e)=>{const t=s.scrollHeight;return e.sizingStyle.boxSizing==="border-box"?t+e.borderSize:t-e.paddingSize};function Ze(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1/0;R||(R=document.createElement("textarea"),R.setAttribute("tab-index","-1"),R.setAttribute("aria-hidden","true"),ge(R)),R.parentNode===null&&document.body.appendChild(R);const{paddingSize:a,borderSize:o,sizingStyle:r}=s,{boxSizing:l}=r;Object.keys(r).forEach(x=>{R.style[x]=r[x]}),ge(R),R.value=e;let c=pe(R,s);R.value="x";const g=pe(R,s)-a-o;let m=g*t;l==="border-box"&&(m=m+a+o),c=Math.max(m,c);let w=g*n;return l==="border-box"&&(w=w+a+o),c=Math.min(w,c),c}const Xe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],Ye=s=>{const e=window.getComputedStyle(s);if(e===null)return null;const t=Le(e,Xe),{boxSizing:n}=t;if(n==="")return null;const a=parseFloat(t.paddingBottom)+parseFloat(t.paddingTop),o=parseFloat(t.borderBottomWidth)+parseFloat(t.borderTopWidth);return{sizingStyle:t,paddingSize:a,borderSize:o}};class ne extends Ee{static get textAreaDefaultAdapter(){return{notifyChange:S,setValue:S,toggleFocusing:S,toggleHovering:S,notifyFocus:S,notifyBlur:S,notifyKeyDown:S,notifyEnterPress:S}}constructor(e){super(Object.assign(Object.assign({},ne.textAreaDefaultAdapter),e)),this.compositionEnter=!1,this._changeValue=(t,n)=>{this._isControlledComponent()?this._adapter.notifyChange(t,n):(this._adapter.setValue(t),this._adapter.notifyChange(t,n))},this.getNextValue=t=>{const{maxLength:n,minLength:a,getValueLength:o}=this._adapter.getProps();return K(o)?n?this.handleVisibleMaxLength(t):(a&&this.handleVisibleMinLength(t),t):t},this.handleCompositionStart=t=>{this.compositionEnter=!0,this._adapter.notifyCompositionStart(t)},this.handleCompositionEnd=t=>{const{composition:n}=this._adapter.getProps(),a=t.target.value;if(this.compositionEnter=!1,this._adapter.notifyCompositionEnd(t),n){const c=this.getNextValue(a);this._changeValue(c,t);return}const{getValueLength:o,maxLength:r,minLength:l}=this.getProps();if(K(o)){if(r){const c=this.handleVisibleMaxLength(a);c!==a&&this._changeValue(c,t)}l&&this.handleVisibleMinLength(a)}},this.handleCompositionUpdate=t=>{this._adapter.notifyCompLine truncated
|
||||
`):[""],m=D(`${y}-textarea-lineNumber`,n),w=c?this.getTextareaLineHeightPx(c):21,x=Object.assign(Object.assign({},a||{}),{height:l?`${l}px`:void 0,maxHeight:l?`${l}px`:void 0});return v.createElement("div",{ref:this.lineNumberRef,className:m,style:x},g.map((E,C)=>{const k=c?this.calculateWrappedLines(E,c):1;return v.createElement("div",{key:C,className:`${y}-textarea-lineNumber-item`,style:{minHeight:`${k*w}px`,lineHeight:`${w}px`}},t+C)}))}render(){const e=this.props,{autosize:t,placeholder:n,onEnterPress:a,onResize:o,resize:r,disabled:l,readonly:c,className:g,showCounter:m,validateStatus:w,maxCount:x,defaultValue:E,style:C,textareaStyle:k,forwardRef:T,getValueLength:H,maxLength:p,minLength:N,showClear:O,borderless:L,autoFocus:I,showLineNumber:h,lineNumberStart:d,lineNumberClassName:b,lineNumberStyle:M,composition:U}=e,$=Qe(e,["autosize","placeholder","onEnterPress","onResize","resize","disabled","readonly","className","showCounter","validateStatus","maxCount","defaultValue","style","textareaStyle","forwardRef","getValueLength","maxLength","minLength","showClear","borderless","autoFocus","showLineNumber","lineNumberStart","lineNumberClassName","lineNumberStyle","composition"]),{isFocus:Z,value:B,minLength:F}=this.state,A=!le(r),je=!t&&A&&["horizontal","both","inline"].includes(r),Re=!t&&A&&["vertical","both","block"].includes(r),_e=D(g,`${y}-textarea-wrapper`,{[`${y}-textarea-borderless`]:L,[`${y}-textarea-wrapper-disabled`]:l,[`${y}-textarea-wrapper-readonly`]:c,[`${y}-textarea-wrapper-${w}`]:!!w,[`${y}-textarea-wrapper-focus`]:Z,[`${y}-textarea-wrapper-withLineNumber`]:h,[`${y}-textarea-wrapper-resizeX`]:je,[`${y}-textarea-wrapper-resizeY`]:Re}),ke=D(`${y}-textarea`,{[`${y}-textarea-disabled`]:l,[`${y}-textarea-readonly`]:c,[`${y}-textarea-autosize`]:$e(t)?le(t==null?void 0:t.maxRows):t,[`${y}-textarea-showClear`]:O}),J=Object.assign({},k||{});t?J.resize="none":A&&(J.resize=r);const ie=!t&&A&&r&&r!=="none",V=Object.assign(Object.assign({},Oe($,"insetLabel","insetLabelId","getValueLength","onClear","showClear","disabledEnterStartNewLine","composition")),{style:J,autoFocus:I||this.props.autofocus,className:ke,disabled:l,readOnly:c,placeholder:n||null,onChange:j=>this.foundation.handleChange(j.target.value,j),onFocus:j=>this.foundation.handleFocus(j),onBlur:j=>this.foundation.handleBlur(j.nativeEvent),onKeyDown:j=>this.foundation.handleKeyDown(j),onScroll:this.handleTextAreaScroll,value:B??"",onCompositionStart:this.foundation.handleCompositionStart,onCompositionEnd:this.foundation.handleCompositionEnd,onCompositionUpdate:this.foundation.handleCompositionUpdate});return K(H)||(V.maxLength=p),F&&(V.minLength=F),v.createElement("div",{className:_e,style:C,onMouseEnter:j=>this.foundation.handleMouseEnter(j),onMouseLeave:j=>this.foundation.handleMouseLeave(j),onClick:j=>this.handleClick(j)},this.renderLineNumbers(),h?v.createElement("div",{className:`${y}-textarea-content`},t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef})),this.renderClearBtn(),this.renderCounter())}}ae.propTypes={autosize:f.oneOfType([f.bool,f.object]),borderless:f.bool,placeholder:f.string,value:f.string,rows:f.number,cols:f.number,maxCount:f.number,onEnterPress:f.func,validateStatus:f.string,className:f.string,style:f.object,textareaStyle:f.object,showClear:f.bool,onClear:f.func,onResize:f.func,onCompositionStart:f.func,onCompositionEnd:f.func,onCompositionUpdate:f.func,getValueLength:f.func,disabledEnterStartNewLine:f.bool,composition:f.bool,showLineNumber:f.bool,lineNumberStart:f.number,lineNumberClassName:f.string,lineNumberStyle:f.object,resize:f.oneOf(["none","both","horizontal","vertical","block","inline"])};ae.defaultProps={autosize:!1,borderless:!1,rows:4,cols:20,showCounter:!1,showClear:!1,onEnterPress:S,onChange:S,onBlur:S,onFocus:S,onKeyDown:S,onResize:S,onClear:S,onCompositionStart:S,onCompositionEnd:S,onCompositionUpdate:S,composition:!1,showLineNumber:!1,lineNumberStart:1};const Ge=v.forwardRef((s,e)=>v.createElement(ae,Object.assign({},s,{forwardRef:e})));function Je({lines:s,emptyLabel:e="No logs",className:t}){const n=u.useRef(null),a=u.useRef(!0),[o,r]=u.useState(!1);u.useEffect(()=>{const g=n.current;g&&a.current&&(g.scrollTop=g.scrollHeight)},[s]);const l=u.useCallback(g=>{const m=g.currentTarget;a.current=m.scrollHeight-m.scrollTop-m.clientHeight<24},[]),c=u.useCallback(()=>{s!=null&&s.length&&navigator.clipboard.writeText(s.join(
Line truncated
|
||||
`)).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[s]);return i.jsxs("div",{className:`ga-log-tail ${t??""}`,children:[i.jsx("button",{type:"button",className:`ga-log-tail-copy ${o?"copied":""}`,onClick:c,title:"Copy",children:o?"✓":"⎘"}),i.jsx("div",{ref:n,className:"ga-log-tail-scroll",onScroll:l,children:s===null?i.jsx("p",{className:"ga-log-tail-empty",children:"…"}):s.length===0?i.jsx("p",{className:"ga-log-tail-empty",children:e}):i.jsx("pre",{className:"ga-log-tail-pre",children:s.map((g,m)=>i.jsxs("span",{className:g.startsWith("=====")?"ga-log-separator":void 0,children:[g,`
|
||||
`]},m))})})]})}function Ce(s,e){$e.getState().notify({kind:e,message:s})}function W(s){Ce(s,"error")}function P(s){Ce(s,"success")}const et=3e3;function ze({serviceId:s,onClose:e}){const{t}=q(),n=z(c=>c.fetchLogs),[a,o]=u.useState(null),r=u.useRef(null),l=u.useCallback(async()=>{if(!s)return;const c=await n(s);o(c)},[s,n]);return u.useEffect(()=>(s&&(o(null),l(),r.current=setInterval(l,et)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[s,l]),i.jsx(fe,{title:t("modal.channelLogs"),visible:s!==null,onCancel:e,footer:null,width:870,centered:!0,closeOnEsc:!0,className:"ga-log-dialog",children:a===null?i.jsx("div",{className:"ga-services-loading",style:{padding:24},children:i.jsx(G,{})}):i.jsx(Je,{lines:a,emptyLabel:t("ch.logEmpty"),className:"ga-log-modal-body"})})}function tt({visible:s,onClose:e}){const{t}=q(),n=z(b=>b.fetchMykey),a=z(b=>b.saveMykey),o=z(b=>b.mykeyContent),r=z(b=>b.mykeyLoading),[l,c]=u.useState(""),[g,m]=u.useState(!1);u.useEffect(()=>{s&&n()},[s,n]),u.useEffect(()=>{c(o)},[o]);const w=async()=>{m(!0);const b=await a(l);m(!1),b?(P(t("sys.configSaved")),e()):W(t("err.mykeyExport"))};return i.jsx(fe,{title:t("modal.mykeyConfig"),visible:s,onCancel:e,width:870,centered:!0,closeOnEsc:!0,className:"ga-settings-dialog",footer:i.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",padding:"8px 0"},children:[i.jsx(_,{onClick:e,children:t("common.cancel")}),i.jsx(_,{type:"primary",loading:g,onClick:w,children:t("common.save")})]}),children:r?i.jsx("div",{className:"ga-services-loading",children:i.jsx(G,{})}):i.jsx(Ge,{value:l,onChange:b=>c(b),autosize:{minRows:16,maxRows:30},style:{fontFamily:"var(--font-mono)",fontSize:13}})})}const st="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eTencent%20QQ%3c/title%3e%3cpath%20d='M21.395%2015.035a40%2040%200%200%200-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526%204.632%2017.351%200%2012%200S4.474%204.632%204.474%209.241c0%20.274.013.804.014.836l-1.08%202.695a39%2039%200%200%200-.802%202.264c-1.021%203.283-.69%204.643-.438%204.673.54.065%202.103-2.472%202.103-2.472%200%201.469.756%203.387%202.394%204.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578%205.883.369%207.482.189%201.6.18%207.14.389%207.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836%201.637-1.384%202.393-3.302%202.393-4.771%200%200%201.563%202.537%202.103%202.472.251-.03.581-1.39-.438-4.673'/%3e%3c/svg%3e",nt="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeChat%3c/title%3e%3cpath%20d='M8.691%202.188C3.891%202.188%200%205.476%200%209.53c0%202.212%201.17%204.203%203.002%205.55a.59.59%200%200%201%20.213.665l-.39%201.48c-.019.07-.048.141-.048.213%200%20.163.13.295.29.295a.326.326%200%200%200%20.167-.054l1.903-1.114a.864.864%200%200%201%20.717-.098%2010.16%2010.16%200%200%200%202.837.403c.276%200%20.543-.027.811-.05-.857-2.578.157-4.972%201.932-6.446%201.703-1.415%203.882-1.98%205.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785%205.991c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178A1.17%201.17%200%200%201%204.623%207.17c0-.651.52-1.18%201.162-1.18zm5.813%200c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178%201.17%201.17%200%200%201-1.162-1.178c0-.651.52-1.18%201.162-1.18zm5.34%202.867c-1.797-.052-3.746.512-5.28%201.786-1.72%201.428-2.687%203.72-1.78%206.22.942%202.453%203.666%204.229%206.884%204.229.826%200%201.622-.12%202.361-.336a.722.722%200%200%201%20.598.082l1.584.926a.272.272%200%200%200%20.14.047c.134%200%20.24-.111.24-.247%200-.06-.023-.12-.038-.177l-.327-1.233a.582.582%200%200%201-.023-.156.49.49%200%200%201%20.201-.398C23.024%2018.48%2024%2016.82%2024%2014.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53%203.274c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.97-.982zm4.844%200c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.969-.982z'/%3e%3c/svg%3e",at="data:image/svg+xml,%3csvg%20width='46'%20height='46'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_338_13245)'%3e%3cpath%20d='M39.743%200H6.257A6.257%206.257%200%200%200%200%206.257v33.487A6.257%206.257%200%200%200%206.257%2046h33.487A6.257%206.257%200%200%200%2046%2039.743V6.257A6.257%206.257%200%200%200%2039.743%200'%20fill='%23fff'/%3e%3cmask%20id='mask0_338_13245'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='5'%20y='8'%20width='36'%20height='30'%3e%3cpath%20d='M40.514%208.373H5.484v29.262h35.03z'%20fill='%23fff'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_338_13245)'%3e%3cpath%20d='M28.856%2031.647a.483.483%200%200%200%20.06.738%206.2%206.2%200%200%201%201.911%203.725%202.02%202.02%200%201%200%202.16-2.54%206.2%206.2%200%200%201-3.448-1.922.483.483%200%200%200-.683-.001'%20fill='%23fb
Line truncated
|
||||
`]},m))})})]})}function Ce(s,e){Be.getState().notify({kind:e,message:s})}function W(s){Ce(s,"error")}function P(s){Ce(s,"success")}const et=3e3;function ze({serviceId:s,onClose:e}){const{t}=q(),n=z(c=>c.fetchLogs),[a,o]=u.useState(null),r=u.useRef(null),l=u.useCallback(async()=>{if(!s)return;const c=await n(s);o(c)},[s,n]);return u.useEffect(()=>(s&&(o(null),l(),r.current=setInterval(l,et)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[s,l]),i.jsx(fe,{title:t("modal.channelLogs"),visible:s!==null,onCancel:e,footer:null,width:870,centered:!0,closeOnEsc:!0,className:"ga-log-dialog",children:a===null?i.jsx("div",{className:"ga-services-loading",style:{padding:24},children:i.jsx(G,{})}):i.jsx(Je,{lines:a,emptyLabel:t("ch.logEmpty"),className:"ga-log-modal-body"})})}function tt({visible:s,onClose:e}){const{t}=q(),n=z(x=>x.fetchMykey),a=z(x=>x.saveMykey),o=z(x=>x.mykeyContent),r=z(x=>x.mykeyLoading),[l,c]=u.useState(""),[g,m]=u.useState(!1);u.useEffect(()=>{s&&n()},[s,n]),u.useEffect(()=>{c(o)},[o]);const w=async()=>{m(!0);const x=await a(l);m(!1),x?(P(t("sys.configSaved")),e()):W(t("err.mykeyExport"))};return i.jsx(fe,{title:t("modal.mykeyConfig"),visible:s,onCancel:e,width:870,centered:!0,closeOnEsc:!0,className:"ga-settings-dialog",footer:i.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",padding:"8px 0"},children:[i.jsx(_,{onClick:e,children:t("common.cancel")}),i.jsx(_,{type:"primary",loading:g,onClick:w,children:t("common.save")})]}),children:r?i.jsx("div",{className:"ga-services-loading",children:i.jsx(G,{})}):i.jsx(Ge,{value:l,onChange:x=>c(x),autosize:{minRows:16,maxRows:30},style:{fontFamily:"var(--font-mono)",fontSize:13}})})}const st="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eTencent%20QQ%3c/title%3e%3cpath%20d='M21.395%2015.035a40%2040%200%200%200-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526%204.632%2017.351%200%2012%200S4.474%204.632%204.474%209.241c0%20.274.013.804.014.836l-1.08%202.695a39%2039%200%200%200-.802%202.264c-1.021%203.283-.69%204.643-.438%204.673.54.065%202.103-2.472%202.103-2.472%200%201.469.756%203.387%202.394%204.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578%205.883.369%207.482.189%201.6.18%207.14.389%207.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836%201.637-1.384%202.393-3.302%202.393-4.771%200%200%201.563%202.537%202.103%202.472.251-.03.581-1.39-.438-4.673'/%3e%3c/svg%3e",nt="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeChat%3c/title%3e%3cpath%20d='M8.691%202.188C3.891%202.188%200%205.476%200%209.53c0%202.212%201.17%204.203%203.002%205.55a.59.59%200%200%201%20.213.665l-.39%201.48c-.019.07-.048.141-.048.213%200%20.163.13.295.29.295a.326.326%200%200%200%20.167-.054l1.903-1.114a.864.864%200%200%201%20.717-.098%2010.16%2010.16%200%200%200%202.837.403c.276%200%20.543-.027.811-.05-.857-2.578.157-4.972%201.932-6.446%201.703-1.415%203.882-1.98%205.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785%205.991c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178A1.17%201.17%200%200%201%204.623%207.17c0-.651.52-1.18%201.162-1.18zm5.813%200c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178%201.17%201.17%200%200%201-1.162-1.178c0-.651.52-1.18%201.162-1.18zm5.34%202.867c-1.797-.052-3.746.512-5.28%201.786-1.72%201.428-2.687%203.72-1.78%206.22.942%202.453%203.666%204.229%206.884%204.229.826%200%201.622-.12%202.361-.336a.722.722%200%200%201%20.598.082l1.584.926a.272.272%200%200%200%20.14.047c.134%200%20.24-.111.24-.247%200-.06-.023-.12-.038-.177l-.327-1.233a.582.582%200%200%201-.023-.156.49.49%200%200%201%20.201-.398C23.024%2018.48%2024%2016.82%2024%2014.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53%203.274c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.97-.982zm4.844%200c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.969-.982z'/%3e%3c/svg%3e",at="data:image/svg+xml,%3csvg%20width='46'%20height='46'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_338_13245)'%3e%3cpath%20d='M39.743%200H6.257A6.257%206.257%200%200%200%200%206.257v33.487A6.257%206.257%200%200%200%206.257%2046h33.487A6.257%206.257%200%200%200%2046%2039.743V6.257A6.257%206.257%200%200%200%2039.743%200'%20fill='%23fff'/%3e%3cmask%20id='mask0_338_13245'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='5'%20y='8'%20width='36'%20height='30'%3e%3cpath%20d='M40.514%208.373H5.484v29.262h35.03z'%20fill='%23fff'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_338_13245)'%3e%3cpath%20d='M28.856%2031.647a.483.483%200%200%200%20.06.738%206.2%206.2%200%200%201%201.911%203.725%202.02%202.02%200%201%200%202.16-2.54%206.2%206.2%200%200%201-3.448-1.922.483.483%200%200%200-.683-.001'%20fill='%23fb
Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
import{b as s,aj as r}from"./tauri-compat-tfiFK9EG.js";import{M as o,S as m,r as t,a as e,b as n,p}from"./markdown-preprocess-6737_jWr.js";import{S as i,U as c}from"./main-BlLQtfpq.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";const u={...c},O=s.memo(function({content:a}){return r.jsx("div",{"data-slot":"summary-block",children:r.jsx(o,{remarkPlugins:[e,n],rehypePlugins:[[t,u]],components:m,urlTransform:i,children:p(a)})})});export{O as SummaryPart};
|
||||
@@ -0,0 +1 @@
|
||||
import{b as s,aj as r}from"./tauri-compat-D_GD_wMe.js";import{M as o,S as m,r as t,a as e,b as n,p}from"./markdown-preprocess-Cc2i34eF.js";import{U as i,V as c}from"./main-j7e_THPB.js";import"./index-9FI8Jlf5.js";import"./WindowsTitlebar-Byi-SYR_.js";const u={...c},O=s.memo(function({content:a}){return r.jsx("div",{"data-slot":"summary-block",children:r.jsx(o,{remarkPlugins:[e,n],rehypePlugins:[[t,u]],components:m,urlTransform:i,children:p(a)})})});export{O as SummaryPart};
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
import{aA as F,aB as L,aC as ee,aD as ze,aE as Xe,aF as wt,aG as Vr,c as Dt,b as J,aH as Br,aI as Gr,B,d as Yi,e as Li,x as $i,aJ as Hi,g as ia,aK as Ui,_ as st,f as He,ae as Be,w as qi,i as Wi,aL as De,N as oe,j as ji,R as b,k as Ue,l as Y,P as p,q as We,h as Q,aM as Vi,aN as Bi,M as K,aO as Gi,aP as zi,ay as Xi,X as zr,T as Zi,O as Xr,s as Qi,aQ as Ki,ax as Ji,aj as A}from"./tauri-compat-tfiFK9EG.js";import{_ as es,c as M,V as ts,i as Sn,d as ns,e as Et,I as Zr,f as as,r as rs,g as rt,h as Un,j as Qn,k as is,l as ss,T as os,a as us,b as Ta}from"./index-CPxjSju3.js";import{s as Qr,a as Kr,F as gt,I as ls,j as cs,k as ds,B as Jr,C as fs,l as hs,m as wa,b as lt,n as ps,T as ms,E as ei,g as gs}from"./main-BlLQtfpq.js";import{a as pt,B as yt}from"./index-Bpi3BHKj.js";import{A as vs}from"./Animation-TKQfYYOo.js";import{B as Da}from"./index-DpGuh58E.js";import{S as ys}from"./index-D_sWIqse.js";import"./WindowsTitlebar-CrkUa1UM.js";function Le(s,e){F(2,arguments);var t=L(s),n=ee(e);if(isNaN(n))return new Date(NaN);if(!n)return t;var a=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+n+1,0);var r=i.getDate();return a>=r?i:(t.setFullYear(i.getFullYear(),i.getMonth(),a),t)}function Ts(s,e){F(2,arguments);var t=L(s).getTime(),n=ee(e);return new Date(t+n)}function ti(s){var e=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return e.setUTCFullYear(s.getFullYear()),s.getTime()-e.getTime()}function Kn(s){F(1,arguments);var e=L(s);return e.setHours(0,0,0,0),e}function xn(s,e){F(2,arguments);var t=ee(e);return Le(s,t*12)}var sa=6e4,oa=36e5,ws=1e3;function ua(s,e){F(2,arguments);var t=Kn(s),n=Kn(e);return t.getTime()===n.getTime()}function Jn(s){return F(1,arguments),s instanceof Date||ze(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Ce(s){if(F(1,arguments),!Jn(s)&&typeof s!="number")return!1;var e=L(s);return!isNaN(Number(e))}function je(s,e){F(2,arguments);var t=L(s),n=L(e),a=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth();return a*12+i}function Ds(s,e){F(2,arguments);var t=L(s),n=L(e);return t.getFullYear()-n.getFullYear()}function bs(s){F(1,arguments);var e=L(s);return e.setDate(1),e.setHours(0,0,0,0),e}function ni(s,e){F(2,arguments);var t=ee(e);return Ts(s,-t)}var _s=864e5;function Cs(s){F(1,arguments);var e=L(s),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),a=t-n;return Math.floor(a/_s)+1}function ot(s){F(1,arguments);var e=1,t=L(s),n=t.getUTCDay(),a=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function ai(s){F(1,arguments);var e=L(s),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var a=ot(n),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var r=ot(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=r.getTime()?t:t-1}function Is(s){F(1,arguments);var e=ai(s),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=ot(t);return n}var Rs=6048e5;function ri(s){F(1,arguments);var e=L(s),t=ot(e).getTime()-Is(e).getTime();return Math.round(t/Rs)+1}function la(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=L(s),d=c.getUTCFullYear(),f=wt(),h=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:f.firstWeekContainsDate)!==null&&n!==void 0?n:(o=f.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,h),v.setUTCHours(0,0,0,0);var w=Xe(v,e),m=new Date(0);m.setUTCFullYear(d,0,h),m.setUTCHours(0,0,0,0);var g=Xe(m,e);return c.getTime()>=w.getTime()?d+1:c.getTime()>=g.getTime()?d:d-1}function Ps(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=wt(),d=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:c.firstWeekContainsDate)!==null&&n!==void 0?n:(o=c.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1),f=la(s,e),h=new Date(0);h.setUTCFullYear(f,0,d),h.setUTCHours(0,0,0,0);var v=Xe(h,e);return v}var Es=6048e5;function ii(s,e){F(1,arguments);var t=L(s),n=Xe(t,e).getTime()-Ps(t,e).getTime();return Math.round(n/Es)+1}function z(s,e){for(var t=s<0?"-":"",n=Math.abs(s).toString();n.length<e;)n="0"+n;return t+n}var Fe={y:function(e,t){var n=e.getUTCFullYear(),a=n>0?n:1-n;return z(t==="yy"?a%100:a,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):z(n+1,2)},d:function(e,t){return z(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aLine truncated
|
||||
import{aA as F,aB as L,aC as ee,aD as ze,aE as Xe,aF as wt,aG as Vr,c as Dt,b as J,aH as Br,aI as Gr,B,d as Yi,e as Li,x as $i,aJ as Hi,g as ia,aK as Ui,_ as st,f as He,ae as Be,w as qi,i as Wi,aL as De,N as oe,j as ji,R as b,k as Ue,l as Y,P as p,q as We,h as Q,aM as Vi,aN as Bi,M as K,aO as Gi,aP as zi,ay as Xi,X as zr,T as Zi,O as Xr,s as Qi,aQ as Ki,ax as Ji,aj as A}from"./tauri-compat-D_GD_wMe.js";import{_ as es,c as M,V as ts,i as Sn,d as ns,e as Et,I as Zr,f as as,r as rs,g as rt,h as Un,j as Qn,k as is,l as ss,T as os,a as us,b as Ta}from"./index-BkPDmlaQ.js";import{s as Qr,a as Kr,F as gt,I as ls,j as cs,k as ds,B as Jr,C as fs,l as hs,m as wa,b as lt,n as ps,T as ms,E as ei,g as gs}from"./main-j7e_THPB.js";import{a as pt,B as yt}from"./index-9FI8Jlf5.js";import{A as vs}from"./Animation-DbFrgT1j.js";import{B as Da}from"./index-C-iCGtYr.js";import{S as ys}from"./index-D9Nakaf3.js";import"./WindowsTitlebar-Byi-SYR_.js";function Le(s,e){F(2,arguments);var t=L(s),n=ee(e);if(isNaN(n))return new Date(NaN);if(!n)return t;var a=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+n+1,0);var r=i.getDate();return a>=r?i:(t.setFullYear(i.getFullYear(),i.getMonth(),a),t)}function Ts(s,e){F(2,arguments);var t=L(s).getTime(),n=ee(e);return new Date(t+n)}function ti(s){var e=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return e.setUTCFullYear(s.getFullYear()),s.getTime()-e.getTime()}function Kn(s){F(1,arguments);var e=L(s);return e.setHours(0,0,0,0),e}function xn(s,e){F(2,arguments);var t=ee(e);return Le(s,t*12)}var sa=6e4,oa=36e5,ws=1e3;function ua(s,e){F(2,arguments);var t=Kn(s),n=Kn(e);return t.getTime()===n.getTime()}function Jn(s){return F(1,arguments),s instanceof Date||ze(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Ce(s){if(F(1,arguments),!Jn(s)&&typeof s!="number")return!1;var e=L(s);return!isNaN(Number(e))}function je(s,e){F(2,arguments);var t=L(s),n=L(e),a=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth();return a*12+i}function Ds(s,e){F(2,arguments);var t=L(s),n=L(e);return t.getFullYear()-n.getFullYear()}function bs(s){F(1,arguments);var e=L(s);return e.setDate(1),e.setHours(0,0,0,0),e}function ni(s,e){F(2,arguments);var t=ee(e);return Ts(s,-t)}var _s=864e5;function Cs(s){F(1,arguments);var e=L(s),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),a=t-n;return Math.floor(a/_s)+1}function ot(s){F(1,arguments);var e=1,t=L(s),n=t.getUTCDay(),a=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function ai(s){F(1,arguments);var e=L(s),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var a=ot(n),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var r=ot(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=r.getTime()?t:t-1}function Is(s){F(1,arguments);var e=ai(s),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=ot(t);return n}var Rs=6048e5;function ri(s){F(1,arguments);var e=L(s),t=ot(e).getTime()-Is(e).getTime();return Math.round(t/Rs)+1}function la(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=L(s),d=c.getUTCFullYear(),f=wt(),h=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:f.firstWeekContainsDate)!==null&&n!==void 0?n:(o=f.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,h),v.setUTCHours(0,0,0,0);var w=Xe(v,e),m=new Date(0);m.setUTCFullYear(d,0,h),m.setUTCHours(0,0,0,0);var g=Xe(m,e);return c.getTime()>=w.getTime()?d+1:c.getTime()>=g.getTime()?d:d-1}function Ps(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=wt(),d=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:c.firstWeekContainsDate)!==null&&n!==void 0?n:(o=c.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1),f=la(s,e),h=new Date(0);h.setUTCFullYear(f,0,d),h.setUTCHours(0,0,0,0);var v=Xe(h,e);return v}var Es=6048e5;function ii(s,e){F(1,arguments);var t=L(s),n=Xe(t,e).getTime()-Ps(t,e).getTime();return Math.round(n/Es)+1}function z(s,e){for(var t=s<0?"-":"",n=Math.abs(s).toString();n.length<e;)n="0"+n;return t+n}var Fe={y:function(e,t){var n=e.getUTCFullYear(),a=n>0?n:1-n;return z(t==="yy"?a%100:a,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):z(n+1,2)},d:function(e,t){return z(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,r=!0,u=!1;return{s:function(){t=t.call(s)},n:function(){var l=t.next();return r=l.done,l},e:function(l){u=!0,i=l},f:function(){try{r||t.return==null||t.return()}finally{if(u)throw i}}}}function q(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(e&&e.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),e&&es(s,e)}function Nn(s){return Nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nn(s)}function di(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(di=function(){return!!s})()}function Ws(s,e){if(e&&(ze(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M(s)}function W(s){var e=di();return function(){var t,n=Nn(s);if(e){var a=Nn(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return Ws(this,t)}}function $(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function js(s,e){if(ze(s)!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var n=t.call(s,e);if(ze(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function fi(s){var e=js(s,"string");return ze(e)=="symbol"?e:e+""}function Vs(s,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,fi(n.key),n)}}function H(s,e,t){return e&&Vs(s.prototype,e),Object.defineProperty(s,"prototype",{writable:!1}),s}function S(s,e,t){return(e=fi(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}var Bs=10,hi=(function(){function s(){$(this,s),S(this,"priority",void 0),S(this,"subPriority",0)}return H(s,[{key:"validate",value:function(t,n){return!0}}]),s})(),Gs=(function(s){q(t,s);var e=W(t);function t(n,a,i,r,u){var o;return $(this,t),o=e.call(this),o.value=n,o.validateValue=a,o.setValue=i,o.priority=r,u&&(o.subPriority=u),o}return H(t,[{key:"validate",value:function(a,i){return this.validateValue(a,this.value,i)}},{key:"set",value:function(a,i,r){return this.setValue(a,i,this.value,r)}}]),t})(hi),zs=(function(s){q(t,s);var e=W(t);function t(){var n;$(this,t);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return n=e.call.apply(e,[this].concat(i)),S(M(n),"priority",Bs),S(M(n),"subPriority",-1),n}return H(t,[{key:"set",value:function(a,i){if(i.timestampIsSet)return a;var r=new Date(0);return r.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),r.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),r}}]),t})(hi),j=(function(){function s(){$(this,s),S(this,"incompatibleTokens",void 0),S(this,"priority",void 0),S(this,"subPriority",void 0)}return H(s,[{key:"run",value:function(t,n,a,i){var r=this.parse(t,n,a,i);return r?{setter:new Gs(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}},{key:"validate",value:function(t,n,a){return!0}}]),s})(),Xs=(function(s){q(t,s);var e=W(t);function t(){var n;$(this,t);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return n=e.call.apply(e,[this].concat(i)),S(M(n),"priority",140),S(M(n),"incompatibleTokens",["R","u","t","T"]),n}return H(t,[{key:"parse",value:function(a,i,r){switch(i){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})||r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"})}}},{key:"set",value:function(a,i,r){return i.era=r,a.setUTCFullYear(r,0,1),a.setUTCHours(0,0,0,0),a}}]),t})(j),ue={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ee={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function le(s,e){return s&&{value:e(s.value),rest:s.rest}}function ae(s,e){var t=e.match(s);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function Oe(s,e){var t=e.match(s);if(!t)return null;if(t[0]==="Z")return{value:0,rest:
Line truncated
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{aj as t}from"./tauri-compat-tfiFK9EG.js";function d(){var n,e,o;const i=(o=(e=(n=window.__TAURI__)==null?void 0:n.window)==null?void 0:e.getCurrentWindow)==null?void 0:o.call(e);return i?t.jsxs("div",{className:"ga-win-controls","data-no-drag":!0,children:[t.jsx("button",{type:"button",className:"ga-win-btn",onClick:()=>i.minimize(),"aria-label":"Minimize",children:t.jsx("svg",{width:"10",height:"1",viewBox:"0 0 10 1",children:t.jsx("rect",{fill:"currentColor",width:"10",height:"1"})})}),t.jsx("button",{type:"button",className:"ga-win-btn",onClick:()=>i.toggleMaximize(),"aria-label":"Maximize",children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:t.jsx("rect",{x:"0.5",y:"0.5",width:"9",height:"9",stroke:"currentColor",strokeWidth:"1"})})}),t.jsx("button",{type:"button",className:"ga-win-btn ga-win-btn--close",onClick:()=>i.close(),"aria-label":"Close",children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:t.jsx("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.2"})})})]}):null}function c(){const i=n=>{var o,r,s,a,l;n.button!==0||n.target.closest("button, a, input, [data-no-drag]")||(n.preventDefault(),(l=(a=(s=(r=(o=window.__TAURI__)==null?void 0:o.window)==null?void 0:r.getCurrentWindow)==null?void 0:s.call(r))==null?void 0:a.startDragging)==null||l.call(a))};return t.jsx("div",{className:"ga-win-titlebar","data-testid":"windows-titlebar",onMouseDown:i,children:t.jsx(d,{})})}export{c as W};
|
||||
import{aj as t}from"./tauri-compat-D_GD_wMe.js";function d(){var n,e,o;const i=(o=(e=(n=window.__TAURI__)==null?void 0:n.window)==null?void 0:e.getCurrentWindow)==null?void 0:o.call(e);return i?t.jsxs("div",{className:"ga-win-controls","data-no-drag":!0,children:[t.jsx("button",{type:"button",className:"ga-win-btn",onClick:()=>i.minimize(),"aria-label":"Minimize",children:t.jsx("svg",{width:"10",height:"1",viewBox:"0 0 10 1",children:t.jsx("rect",{fill:"currentColor",width:"10",height:"1"})})}),t.jsx("button",{type:"button",className:"ga-win-btn",onClick:()=>i.toggleMaximize(),"aria-label":"Maximize",children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:t.jsx("rect",{x:"0.5",y:"0.5",width:"9",height:"9",stroke:"currentColor",strokeWidth:"1"})})}),t.jsx("button",{type:"button",className:"ga-win-btn ga-win-btn--close",onClick:()=>i.close(),"aria-label":"Close",children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:t.jsx("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.2"})})})]}):null}function c(){const i=n=>{var o,r,s,a,l;n.button!==0||n.target.closest("button, a, input, [data-no-drag]")||(n.preventDefault(),(l=(a=(s=(r=(o=window.__TAURI__)==null?void 0:o.window)==null?void 0:r.getCurrentWindow)==null?void 0:s.call(r))==null?void 0:a.startDragging)==null||l.call(a))};return t.jsx("div",{className:"ga-win-titlebar","data-testid":"windows-titlebar",onMouseDown:i,children:t.jsx(d,{})})}export{c as W};
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{c as I,b as a,B as R,V as F,l as j,R as i,q as $,P as n,aw as Z,h as N,s as D}from"./tauri-compat-tfiFK9EG.js";function U(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{prefix:o="",length:s=7}=t,e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ",l=e.length;let g="";for(let m=0;m<s;m++){const c=Math.floor(Math.random()*l);g+=e.charAt(c)}return o?`${o}-${g}`:g}function H(t,o){if(typeof t=="string")return new Array(o).fill(t);if(Array.isArray(t)){const s=t.length;let e=t;if(s<o){let l=0;for(e=[];l<o;)e.push(t[l%s]),l++;return e}else s>o&&(e=t.slice(0,o));return e.reverse()}return["rgba(233,69,255)","rgba(166,71,255)","rgba(107,97,255)","rgba(46,140,255)"]}var X=function(t,o){var s={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,e=Object.getOwnPropertySymbols(t);l<e.length;l++)o.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(s[e[l]]=t[e[l]]);return s};function G(t){const{fill:o}=t,s=X(t,["fill"]),e=U({prefix:"semi-ai-loading"}),[l,g,m,c]=H(o,4);return a.createElement("svg",Object.assign({viewBox:"0 0 16 16",width:"1em",height:"1em",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},s),a.createElement("path",{d:"M15.1112 7.99978C15.1112 4.07242 11.9275 0.888672 8.00009 0.888672C5.18219 0.888672 2.74711 2.52771 1.59619 4.90445",stroke:`url(#${e})`,strokeWidth:"1.77778",strokeLinecap:"round"}),a.createElement("defs",null,a.createElement("linearGradient",{id:e,x1:"16",y1:"8",x2:"2.68594",y2:"11.022",gradientUnits:"userSpaceOnUse"},a.createElement("stop",{stopColor:l}),a.createElement("stop",{offset:"0.3",stopColor:g}),a.createElement("stop",{offset:"0.6",stopColor:m}),a.createElement("stop",{offset:"1",stopColor:c,stopOpacity:"0"}))))}const V=I(G,"ai_loading");function q(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m10.23 2.4-8.7 16.67A2 2 0 0 0 3.3 22h17.4a2 2 0 0 0 1.77-2.93L13.77 2.4a2 2 0 0 0-3.54 0ZM13.14 14a1.15 1.15 0 0 1-2.28 0l-.58-4.03a1.73 1.73 0 1 1 3.44 0l-.58 4.03Zm.36 4.49a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",fill:"currentColor"}))}const se=I(q,"alert_triangle");function W(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),a.createElement("path",{d:"M17.66 19.78a1.5 1.5 0 0 0 2.12-2.12L14.12 12l5.66-5.66a1.5 1.5 0 0 0-2.12-2.12L12 9.88 6.34 4.22a1.5 1.5 0 1 0-2.12 2.12L9.88 12l-5.66 5.66a1.5 1.5 0 0 0 2.12 2.12L12 14.12l5.66 5.66Z",fill:"currentColor"}))}const re=I(W,"close");function K(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm2-16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-5 3.75c0-.41.34-.75.75-.75h2.75a1 1 0 0 1 1 1v5.5h.75a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5h.75v-5h-.75a.75.75 0 0 1-.75-.75Z",fill:"currentColor"}))}const ie=I(K,"info_circle"),B={PREFIX:`${R}-button`},w={sizes:["default","small","large"],iconPositions:["left","right"],htmlTypes:["button","reset","submit"],btnTypes:["primary","secondary","tertiary","warning","danger"],themes:["solid","borderless","light","outline"],DEFAULT_ICON_POSITION:"left"},Q={SIZE:["extra-small","small","default","large","extra-large","custom"]};var Y=function(t,o){var s={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,e=Object.getOwnPropertySymbols(t);l<e.length;l++)o.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(s[e[l]]=t[e[l]]);return s};const J=w.sizes,{htmlTypes:ee,btnTypes:te}=w;let E=class extends a.PureComponent{render(){const o=this.props,{children:s,block:e,htmlType:l,loading:g,circle:m,className:c,style:f,disabled:p,size:P,theme:u,type:h,colorful:C,prefixCls:r,iconPosition:T}=o,y=Y(o,["children","block","htmlType","loading","circle","className","style","disabled","size","theme","type","colorful","prefixCls","iconPosition"]),S=Object.assign(Object.assign({disabled:p},F(y,["x-semi-children-alias"])),{className:j(r,{[`${r}-${h}`]:!p&&h,[`${r}-disabled`]:p,[`${r}-size-large`]:P==="large",[`${r}-size-small`]:P==="small",[`${r}-block`]:e,[`${r}-circle`]:m,[`${r}-${u}`]:u,[`${r}-${h}-disabled`]:p&&h,[`${r}-colorful`]:C},c),type:l,"aria-disabled":p}),O={};return c&&c.includes("-with-icon")||(O["x-semi-prop"]=this.props["x-semi-children-alias"]||"children"),i.createElement("button",Object.assign({},S,{onClick:this.props.onClick,onMouseDown:this.props.onMouseDown,style:f}),i.creaLine truncated
|
||||
import{c as I,b as a,B as R,V as F,l as j,R as i,q as $,P as n,aw as Z,h as N,s as D}from"./tauri-compat-D_GD_wMe.js";function U(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{prefix:o="",length:s=7}=t,e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ",l=e.length;let g="";for(let m=0;m<s;m++){const c=Math.floor(Math.random()*l);g+=e.charAt(c)}return o?`${o}-${g}`:g}function H(t,o){if(typeof t=="string")return new Array(o).fill(t);if(Array.isArray(t)){const s=t.length;let e=t;if(s<o){let l=0;for(e=[];l<o;)e.push(t[l%s]),l++;return e}else s>o&&(e=t.slice(0,o));return e.reverse()}return["rgba(233,69,255)","rgba(166,71,255)","rgba(107,97,255)","rgba(46,140,255)"]}var X=function(t,o){var s={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,e=Object.getOwnPropertySymbols(t);l<e.length;l++)o.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(s[e[l]]=t[e[l]]);return s};function G(t){const{fill:o}=t,s=X(t,["fill"]),e=U({prefix:"semi-ai-loading"}),[l,g,m,c]=H(o,4);return a.createElement("svg",Object.assign({viewBox:"0 0 16 16",width:"1em",height:"1em",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},s),a.createElement("path",{d:"M15.1112 7.99978C15.1112 4.07242 11.9275 0.888672 8.00009 0.888672C5.18219 0.888672 2.74711 2.52771 1.59619 4.90445",stroke:`url(#${e})`,strokeWidth:"1.77778",strokeLinecap:"round"}),a.createElement("defs",null,a.createElement("linearGradient",{id:e,x1:"16",y1:"8",x2:"2.68594",y2:"11.022",gradientUnits:"userSpaceOnUse"},a.createElement("stop",{stopColor:l}),a.createElement("stop",{offset:"0.3",stopColor:g}),a.createElement("stop",{offset:"0.6",stopColor:m}),a.createElement("stop",{offset:"1",stopColor:c,stopOpacity:"0"}))))}const V=I(G,"ai_loading");function q(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m10.23 2.4-8.7 16.67A2 2 0 0 0 3.3 22h17.4a2 2 0 0 0 1.77-2.93L13.77 2.4a2 2 0 0 0-3.54 0ZM13.14 14a1.15 1.15 0 0 1-2.28 0l-.58-4.03a1.73 1.73 0 1 1 3.44 0l-.58 4.03Zm.36 4.49a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",fill:"currentColor"}))}const se=I(q,"alert_triangle");function W(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),a.createElement("path",{d:"M17.66 19.78a1.5 1.5 0 0 0 2.12-2.12L14.12 12l5.66-5.66a1.5 1.5 0 0 0-2.12-2.12L12 9.88 6.34 4.22a1.5 1.5 0 1 0-2.12 2.12L9.88 12l-5.66 5.66a1.5 1.5 0 0 0 2.12 2.12L12 14.12l5.66 5.66Z",fill:"currentColor"}))}const re=I(W,"close");function K(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm2-16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-5 3.75c0-.41.34-.75.75-.75h2.75a1 1 0 0 1 1 1v5.5h.75a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5h.75v-5h-.75a.75.75 0 0 1-.75-.75Z",fill:"currentColor"}))}const ie=I(K,"info_circle"),B={PREFIX:`${R}-button`},w={sizes:["default","small","large"],iconPositions:["left","right"],htmlTypes:["button","reset","submit"],btnTypes:["primary","secondary","tertiary","warning","danger"],themes:["solid","borderless","light","outline"],DEFAULT_ICON_POSITION:"left"},Q={SIZE:["extra-small","small","default","large","extra-large","custom"]};var Y=function(t,o){var s={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,e=Object.getOwnPropertySymbols(t);l<e.length;l++)o.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(s[e[l]]=t[e[l]]);return s};const J=w.sizes,{htmlTypes:ee,btnTypes:te}=w;let E=class extends a.PureComponent{render(){const o=this.props,{children:s,block:e,htmlType:l,loading:g,circle:m,className:c,style:f,disabled:p,size:P,theme:u,type:h,colorful:C,prefixCls:r,iconPosition:T}=o,y=Y(o,["children","block","htmlType","loading","circle","className","style","disabled","size","theme","type","colorful","prefixCls","iconPosition"]),S=Object.assign(Object.assign({disabled:p},F(y,["x-semi-children-alias"])),{className:j(r,{[`${r}-${h}`]:!p&&h,[`${r}-disabled`]:p,[`${r}-size-large`]:P==="large",[`${r}-size-small`]:P==="small",[`${r}-block`]:e,[`${r}-circle`]:m,[`${r}-${u}`]:u,[`${r}-${h}-disabled`]:p&&h,[`${r}-colorful`]:C},c),type:l,"aria-disabled":p}),O={};return c&&c.includes("-with-icon")||(O["x-semi-prop"]=this.props["x-semi-children-alias"]||"children"),i.createElement("button",Object.assign({},S,{onClick:this.props.onClick,onMouseDown:this.props.onMouseDown,style:f}),i.creaLine truncated
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
import{g as te,C as _t,c as Oe,b as L,R as b,P as a,B as X,f as ge,i as Ce,l as M,au as qt,aR as va,ad as Ca,aS as Gt,aT as Qo,aU as Jo,K as ei,L as _a,D as Oa,aV as ti,aW as Ra,aX as Ea,aY as ni,v as xa,y as Ta,N as x,aZ as Ps,n as ft,w as $e,a_ as Yt,h as H,k as he,o as jt,aL as re,a$ as Ia,b0 as As,a as Pa,u as si,b1 as Aa,b2 as Da,b3 as ri,G as oi,b4 as Na,b5 as Ds,t as ii,b6 as Ns,b7 as ai,b8 as ka,b9 as li,M as La,_ as ue,az as Pt,s as ks,a0 as Ma,V as ye,J as je,p as Et,E as ja,ae as Xt,aQ as yt,X as Ee,aa as za,ba as Fa,bb as Ka,bc as $a,bd as Ba,m as hr,O as Ls,aH as ci,ag as Ms,be as Ha,bf as Wa,bg as le,bh as Ua,x as di,A as Va,bi as Zt,ax as Ne,bj as qa,bk as we,ab as ui,Y as hi,j as Ae,bl as Ga,bm as Ya,d as Xa,e as Za,aJ as Qa,bn as Ja,H as el,bo as St,bp as pr,bq as zt,br as tl}from"./tauri-compat-tfiFK9EG.js";import{_ as gt,r as nl,o as pi,p as sl,q as rl,v as ol,w as il,x as fi,y as al,T as mt,z as gi,F as fr,I as ll,A as cl,D as gr,G as Fe,R as dl,a as Re,j as ul}from"./main-BlLQtfpq.js";import{S as mi}from"./index-D_sWIqse.js";import{B as Ft,I as hl}from"./index-Bpi3BHKj.js";const pl=["default","error","warning","success"];var fl=_t();const gl=te(fl);function mr(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function _s(i,e){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},_s(i,e)}function ml(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m17.55 15.66-4.8 5.48a1 1 0 0 1-1.5 0l-4.8-5.48A1 1 0 0 1 7.2 14h9.6a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}const bl=Oe(ml,"caretdown");function yl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m6.45 8.34 4.8-5.48a1 1 0 0 1 1.5 0l4.8 5.48A1 1 0 0 1 16.8 10H7.2a1 1 0 0 1-.75-1.66Z",fill:"currentColor"}))}const Sl=Oe(yl,"caretup");function wl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const vl=Oe(wl,"checkbox_indeterminate");function Cl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const _l=Oe(Cl,"checkbox_tick");function Ol(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.28 4.24a1.5 1.5 0 0 1 0 2.12l-5.66 5.66 5.66 5.65a1.5 1.5 0 1 1-2.12 2.13l-6.72-6.72a1.5 1.5 0 0 1 0-2.12l6.72-6.72a1.5 1.5 0 0 1 2.12 0Z",fill:"currentColor"}))}const bi=Oe(Ol,"chevron_left");function Rl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.44 19.8a1.5 1.5 0 0 1 0-2.13l5.66-5.65-5.66-5.66a1.5 1.5 0 1 1 2.12-2.12l6.72 6.72a1.5 1.5 0 0 1 0 2.12L9.56 19.8a1.5 1.5 0 0 1-2.12 0Z",fill:"currentColor"}))}const js=Oe(Rl,"chevron_right");function El(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.1 2.58A1 1 0 0 1 2 2h20a1 1 0 0 1 .76 1.65l-8.2 9.18V21a1 1 0 0 1-1.44.9l-3.07-2a1 1 0 0 1-.55-.9v-6.17L1.24 3.65a1 1 0 0 1-.15-1.07Z",fill:"currentColor"}))}const xl=Oe(El,"filter");function Tl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 2a8.5 8.5 0 1 0 4.86 15.48l4.08 4.08a1.5 1.5 0 1 0 2.12-2.12l-4.08-4.08A8.5 8.5 0 0 0 10.5 2ZM5 10.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",fill:"currentColor"}))}const Il=Oe(Tl,"search");function Pl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m20.56 9.66-7.8 8.97a1 1 0 0 1-1.51 0L3.44 9.66A1 1 0 0 1 4.19 8h15.62a1 1 0
Line truncated
|
||||
import{g as te,C as _t,c as Oe,b as L,R as b,P as a,B as X,f as ge,i as Ce,l as M,au as qt,aR as va,ad as Ca,aS as Gt,aT as Qo,aU as Jo,K as ei,L as _a,D as Oa,aV as ti,aW as Ra,aX as Ea,aY as ni,v as xa,y as Ta,N as x,aZ as Ps,n as ft,w as $e,a_ as Yt,h as H,k as he,o as jt,aL as re,a$ as Ia,b0 as As,a as Pa,u as si,b1 as Aa,b2 as Da,b3 as ri,G as oi,b4 as Na,b5 as Ds,t as ii,b6 as Ns,b7 as ai,b8 as ka,b9 as li,M as La,_ as ue,az as Pt,s as ks,a0 as Ma,V as ye,J as je,p as Et,E as ja,ae as Xt,aQ as yt,X as Ee,aa as za,ba as Fa,bb as Ka,bc as $a,bd as Ba,m as hr,O as Ls,aH as ci,ag as Ms,be as Ha,bf as Wa,bg as le,bh as Ua,x as di,A as Va,bi as Zt,ax as Ne,bj as qa,bk as we,ab as ui,Y as hi,j as Ae,bl as Ga,bm as Ya,d as Xa,e as Za,aJ as Qa,bn as Ja,H as el,bo as St,bp as pr,bq as zt,br as tl}from"./tauri-compat-D_GD_wMe.js";import{_ as gt,r as nl,o as pi,p as sl,q as rl,v as ol,w as il,x as fi,y as al,T as mt,z as gi,F as fr,I as ll,A as cl,D as gr,G as Fe,R as dl,a as Re,j as ul}from"./main-j7e_THPB.js";import{S as mi}from"./index-D9Nakaf3.js";import{B as Ft,I as hl}from"./index-9FI8Jlf5.js";const pl=["default","error","warning","success"];var fl=_t();const gl=te(fl);function mr(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function _s(i,e){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},_s(i,e)}function ml(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m17.55 15.66-4.8 5.48a1 1 0 0 1-1.5 0l-4.8-5.48A1 1 0 0 1 7.2 14h9.6a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}const bl=Oe(ml,"caretdown");function yl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m6.45 8.34 4.8-5.48a1 1 0 0 1 1.5 0l4.8 5.48A1 1 0 0 1 16.8 10H7.2a1 1 0 0 1-.75-1.66Z",fill:"currentColor"}))}const Sl=Oe(yl,"caretup");function wl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const vl=Oe(wl,"checkbox_indeterminate");function Cl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const _l=Oe(Cl,"checkbox_tick");function Ol(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.28 4.24a1.5 1.5 0 0 1 0 2.12l-5.66 5.66 5.66 5.65a1.5 1.5 0 1 1-2.12 2.13l-6.72-6.72a1.5 1.5 0 0 1 0-2.12l6.72-6.72a1.5 1.5 0 0 1 2.12 0Z",fill:"currentColor"}))}const bi=Oe(Ol,"chevron_left");function Rl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.44 19.8a1.5 1.5 0 0 1 0-2.13l5.66-5.65-5.66-5.66a1.5 1.5 0 1 1 2.12-2.12l6.72 6.72a1.5 1.5 0 0 1 0 2.12L9.56 19.8a1.5 1.5 0 0 1-2.12 0Z",fill:"currentColor"}))}const js=Oe(Rl,"chevron_right");function El(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.1 2.58A1 1 0 0 1 2 2h20a1 1 0 0 1 .76 1.65l-8.2 9.18V21a1 1 0 0 1-1.44.9l-3.07-2a1 1 0 0 1-.55-.9v-6.17L1.24 3.65a1 1 0 0 1-.15-1.07Z",fill:"currentColor"}))}const xl=Oe(El,"filter");function Tl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 2a8.5 8.5 0 1 0 4.86 15.48l4.08 4.08a1.5 1.5 0 1 0 2.12-2.12l-4.08-4.08A8.5 8.5 0 0 0 10.5 2ZM5 10.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",fill:"currentColor"}))}const Il=Oe(Tl,"search");function Pl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m20.56 9.66-7.8 8.97a1 1 0 0 1-1.51 0L3.44 9.66A1 1 0 0 1 4.19 8h15.62a1 1 0
Line truncated
|
||||
Please note that this is not a legal way to use it`);return}t?n=e:n=e.map(r=>r.value),this.handleValueChange(n),this._adapter.notifyChange(n)}checkMultipleProps(e){if(this._isMultiple()){const t=e||this.getProps(),{defaultValue:n,value:s}=t,r=s||n;!Xt(r)&&!Array.isArray(r)&&$e(!0,"[Semi Select] defaultValue/value should be array type in multiple mode")}}updateScrollTop(){this._adapter.updateScrollTop()}updateOverflowItemCount(e,t){const{maxTagCount:n,ellipsisTrigger:s}=this.getProps();s&&(t?this._adapter.updateOverflowItemCount(t):typeof n=="number"&&(e-n>0?this._adapter.updateOverflowItemCount(e-n):this._adapter.updateOverflowItemCount(0)))}updateIsFullTags(){const{isFullTags:e}=this.getStates();e||this._adapter.setState({isFullTags:!0})}handlePopoverClose(){this._adapter.emit("popoverClose")}handleSlotMouseEnter(){this._adapter.updateFocusIndex(-1)}}const lt=al.PREFIX,Ki=gi.TAG_SIZE,Rd=gi.AVATAR_SHAPE;class Ht extends L.PureComponent{renderNTag(e,t){const{size:n,showPopover:s,popoverProps:r,onPlusNMouseEnter:o}=this.props;let l=b.createElement(mt,{closable:!1,size:n,color:"grey",style:{backgroundColor:"transparent"},key:"_+n",onMouseEnter:o},"+",e);return s&&(l=b.createElement(yt,Object.assign({showArrow:!0,content:t,trigger:"hover",position:"top",autoAdjustOverflow:!0,className:`${lt}-rest-group-popover`},r,{key:"_+n_Popover"}),l)),l}renderMergeTags(e){const{maxTagCount:t,tagList:n,restCount:s}=this.props,r=s||n.length-t;let o=e;const l=e.slice(0,t),c=e.slice(t);let d=null;return r>0&&(d=this.renderNTag(r,c),l.push(d),o=l),o}renderAllTags(){const{tagList:e,size:t,mode:n,avatarShape:s,onTagClose:r}=this.props;return e.map(l=>{if(n==="custom")return l;const c=Object.assign({},l);return c.size||(c.size=t),c.avatarShape||(c.avatarShape=s),c.tagKey||(typeof c.children=="string"||typeof c.children=="number"?c.tagKey=c.children:c.tagKey=Math.random()),b.createElement(mt,Object.assign({},c,{key:c.tagKey,onClose:(d,u,h)=>{c.onClose&&c.onClose(d,u,h),r&&r(d,u,h)}}))})}render(){const{style:e,className:t,maxTagCount:n,size:s}=this.props,r=M({[`${lt}-group`]:!0,[`${lt}-group-max`]:n,[`${lt}-group-small`]:s==="small",[`${lt}-group-large`]:s==="large"},t),o=this.renderAllTags(),l=typeof n>"u"?o:this.renderMergeTags(o);return b.createElement("div",{style:e,className:r},l)}}Ht.defaultProps={style:{},className:"",size:Ki[0],avatarShape:"square",onTagClose:()=>{},onPlusNMouseEnter:()=>{}};Ht.propTypes={children:a.node,style:a.object,className:a.string,maxTagCount:a.number,restCount:a.number,tagList:a.array,size:a.oneOf(Ki),mode:a.string,onTagClose:a.func,showPopover:a.bool,popoverProps:a.object,avatarShape:a.oneOf(Rd)};var Ed=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const so=(i,e,t,n)=>{const s=i.props;if(!i||!s)return null;const r=Object.assign(Object.assign({value:s.value,label:s.label||s.children||s.value,_show:!0,_selected:!1,_scrollIndex:t},s),{_parentGroup:e});return r._keyInJsx=n||i.key,r},xd=i=>{let e=[],t=[];const n={label:"",children:[],_show:!1};let s=b.Children.toArray(i);s=s.filter(l=>l&&l.props);let r="",o=-1;return s.forEach(l=>{if(l.type.isSelectOption){r="option",o++;const c=so(l,void 0,o);n.children.push(c),t.push(c)}else if(l.type.isSelectOptionGroup){r="group";let c=l.props,{children:d}=c,u=Ed(c,["children"]);u.key=l.key;let h=[];Array.isArray(d)?h=d.map(y=>y.key):h.push(d.key),d=b.Children.toArray(d);const g=d.map((y,p)=>{let f=y.key;return h[p]===null&&(f=l.key+""+y.key),o++,so(y,u,o,f)}),m=Object.assign(Object.assign({},l.props),{children:g,key:l.key});e.push(m),t=t.concat(g)}else $e(!0,"[Semi Select] The children of `Select` should be `Select.Option` or `Select.OptionGroup`")}),r==="option"&&(e=[n]),{optionGroups:e,options:t}},Td=i=>{let{index:e,data:t,style:n}=i;const{visibleOptions:s,renderOption:r}=t,o=s[e];return r(o,e,n)};var ro=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};let He=class extends L.PureComponent{onClick(e,t){var{value:n,label:s,children:r}=e,o=ro(e,["value","label","children"]);const{props:l}=this;l.disabled||l.onSelect(Object.assign(Object.assign({},o),{value:n,label:s||r}),t)}renderOptionContent(e){let{config:t,children:n,inputValue:s,prefixCls:r}=e;return Ce(n)&&s?b.createElement(zs,{searchWords:t.searchWords,sourceString:t.sourceString,highlightClassName:t.highlightClassName}):n}render(){const e=this.props,{children:t,disabled:n,value:s,selected:r,label:o,empty:l,emptyContent:c,onSelect:d,focused:u,
Line truncated
|
||||
`,T.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
||||
`,C.getElementsByTagName("head")[0].appendChild(T)}C.body&&pa(C.body,"react-draggable-transparent-selection")}function or(C){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ir(C)}):ir(C)}function ir(C){if(C)try{C.body&&fa(C.body,"react-draggable-transparent-selection");const R=C.selection;if(R)R.empty();else{const T=(C.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function pa(C,R){C.classList?C.classList.add(R):C.className.match(new RegExp(`(?:^|\\s)${R}(?!\\S)`))||(C.className+=` ${R}`)}function fa(C,R){C.classList?C.classList.remove(R):C.className=C.className.replace(new RegExp(`(?:^|\\s)${R}(?!\\S)`,"g"),"")}function ga(C,R,T){if(!C.props.bounds)return[R,T];let{bounds:D}=C.props;D=typeof D=="string"?D:ya(D);const j=fn(C);if(typeof D=="string"){const{ownerDocument:J}=j,Y=J.defaultView;if(!Y)throw new Error("Cannot resolve the owner window of the draggable node.");let ee;if(D==="parent"?ee=j.parentNode:ee=j.getRootNode().querySelector(D),!(ee instanceof Y.HTMLElement))throw new Error('Bounds selector "'+D+'" could not find an element.');const fe=ee,Me=Y.getComputedStyle(j),Ue=Y.getComputedStyle(fe);D={left:-j.offsetLeft+w(Ue.paddingLeft)+w(Me.marginLeft),top:-j.offsetTop+w(Ue.paddingTop)+w(Me.marginTop),right:G(fe)-V(j)-j.offsetLeft+w(Ue.paddingRight)-w(Me.marginRight),bottom:W(fe)-q(j)-j.offsetTop+w(Ue.paddingBottom)-w(Me.marginBottom)}}return v(D.right)&&(R=Math.min(R,D.right)),v(D.bottom)&&(T=Math.min(T,D.bottom)),v(D.left)&&(R=Math.max(R,D.left)),v(D.top)&&(T=Math.max(T,D.top)),[R,T]}function ar(C,R,T){const D=Math.round(R/C[0])*C[0],j=Math.round(T/C[1])*C[1];return[D,j]}function ma(C){return C.props.axis==="both"||C.props.axis==="x"}function ba(C){return C.props.axis==="both"||C.props.axis==="y"}function un(C,R,T){const D=typeof R=="number"?de(C,R):null;if(typeof R=="number"&&!D)return null;const j=fn(T),J=T.props.offsetParent||j.offsetParent||j.ownerDocument.body;return se(D||C,J,T.props.scale)}function hn(C,R,T){const D=!v(C.lastX),j=fn(C);return D?{node:j,deltaX:0,deltaY:0,lastX:R,lastY:T,x:R,y:T}:{node:j,deltaX:R-C.lastX,deltaY:T-C.lastY,lastX:C.lastX,lastY:C.lastY,x:R,y:T}}function pn(C,R){const T=C.props.scale;return{node:R.node,x:C.state.x+R.deltaX/T,y:C.state.y+R.deltaY/T,deltaX:R.deltaX/T,deltaY:R.deltaY/T,lastX:C.state.x,lastY:C.state.y}}function ya(C){return{left:C.left,top:C.top,right:C.right,bottom:C.bottom}}function fn(C){const R=C.findDOMNode();if(!R)throw new Error("<DraggableCore>: Unmounted during event!");return R}var gn=d(St()),ae=d(zt()),Sa=d(pr());function Se(...C){i.DRAGGABLE_DEBUG&&console.log(...C)}var me={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Ie=me.mouse,Le=class extends gn.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=C=>{if(this.props.onMouseDown(C),!this.props.allowAnyClick&&(typeof C.button=="number"&&C.button!==0||C.ctrlKey))return!1;const R=this.findDOMNode();if(!R||!R.ownerDocument||!R.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:T}=R;if(this.props.disabled||!(C.target instanceof T.defaultView.Node)||this.props.handle&&!F(C.target,this.props.handle,R)||this.props.cancel&&F(C.target,this.props.cancel,R))return;C.type==="touchstart"&&!this.props.allowMobileScroll&&C.preventDefault();const D=ie(C);this.touchIdentifier=D;const j=un(C,D,this);if(j==null)return;const{x:J,y:Y}=j,ee=hn(this,J,Y);Se("DraggableCore: handleDragStart: %j",ee),Se("calling",this.props.onStart),!(this.props.onStart(C,ee)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ha(T,this.props.nonce),this.dragging=!0,this.lastX=J,this.lastY=Y,K(T,Ie.move,this.handleDrag),K(T,Ie.stop,this.handleDragStop))},this.handleDrag=C=>{const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let Y=T-this.lastX,ee=D-this.lastY;if([Y,ee]=ar(this.props.grid,Y,ee),!Y&&!ee)return;T=this.lastX+Y,D=this.lastY+ee}const j=hn(this,T,D);if(Se("DraggableCore: handleDrag: %j",j),this.props.onDrag(C,j)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const Y=document.createEvent("MouseEvents");Y.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(Y)}return}this.lastX=T,this.lastY=D},this.handleDragStop=C=>{if(!this.dragging)return;const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let ee=T-this.lastX||0,fe=D-this.lastY||0;[ee,fe]=ar(this.props.grid,ee,fe),T=this.lastX+ee,D=this.lastY+fe}const j=hn(this,T,D);if(this.props.onStop(C,j)===!1||this.mounted===!1)return!1;const Y=this.findDOMNode();Y&&this.props.enableUserSelectHack&&or(Y.ownerDocument),Se("DraggableCore: handleDragStop: %j",j),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,Y&&(Se("DraggableCore
Line truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{B as g,f as y,k as E,w as C,R as t,l as m,T as u,U as $,S as v,P as o}from"./tauri-compat-tfiFK9EG.js";import{a as I,I as N,b as x,c as B}from"./index-Bpi3BHKj.js";const P={PREFIX:`${g}-banner`},w={TYPE:["info","success","danger","warning"]};class l extends y{constructor(e){super(Object.assign(Object.assign({},l.defaultAdapter),e))}removeBanner(e){this._adapter.notifyClose(e),this._adapter.setVisible()}}const n=P.PREFIX,T=w.TYPE;class h extends E{constructor(e){super(e),this.remove=s=>{s&&s.stopPropagation(),this.foundation.removeBanner(s)},this.state={visible:!0},C("target"in this.props,"[Semi Banner] 'target' has been deprecated, please write JSX directly instead.")}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:()=>{this.setState({visible:!1})},notifyClose:e=>{const{onClose:s}=this.props;s(e)}})}componentDidMount(){this.foundation=new l(this.adapter),this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}renderCloser(){const{closeIcon:e}=this.props;return e===null?e:t.createElement(I,{className:`${n}-close`,onClick:this.remove,icon:e||t.createElement(N,{"x-semi-prop":"closeIcon","aria-hidden":!0}),theme:"borderless",size:"small",type:"tertiary","aria-label":"Close"})}renderIcon(){const{type:e,icon:s}=this.props;let a={warning:t.createElement(B,{size:"large","aria-label":"warning"}),success:t.createElement(v,{size:"large","aria-label":"success"}),info:t.createElement(x,{size:"large","aria-label":"info"}),danger:t.createElement($,{size:"large","aria-label":"danger"})}[e];const r=m({[`${n}-icon`]:!0});return typeof s<"u"&&(a=s),a?t.createElement("div",{className:r,"x-semi-prop":"icon"},a):null}render(){const{children:e,type:s,className:c,style:a,bordered:r,title:p,description:d,fullMode:i}=this.props,{visible:b}=this.state,f=m(n,c,{[`${n}-${s}`]:s,[`${n}-full`]:i,[`${n}-in-container`]:!i,[`${n}-bordered`]:!i&&r});return b?t.createElement("div",Object.assign({className:f,style:a,role:"alert"},this.getDataAttr(this.props)),t.createElement("div",{className:`${n}-content-wrapper`},t.createElement("div",{className:`${n}-content`},this.renderIcon(),t.createElement("div",{className:`${n}-content-body`},p?t.createElement(u.Title,{heading:5,className:`${n}-title`,component:"div","x-semi-prop":"title"},p):null,d?t.createElement(u.Paragraph,{className:`${n}-description`,component:"div","x-semi-prop":"description"},d):null)),this.renderCloser()),e?t.createElement("div",{className:`${n}-extra`,"x-semi-prop":"children"},e):null):null}}h.propTypes={fullMode:o.bool,type:o.oneOf(T),title:o.node,description:o.node,icon:o.node,closeIcon:o.node,children:o.node,style:o.object,className:o.string,onClose:o.func,bordered:o.bool};h.defaultProps={onClose:()=>{},type:"info",fullMode:!0};export{h as B};
|
||||
import{B as g,f as y,k as E,w as C,R as t,l as m,T as u,U as $,S as v,P as o}from"./tauri-compat-D_GD_wMe.js";import{a as I,I as N,b as x,c as B}from"./index-9FI8Jlf5.js";const P={PREFIX:`${g}-banner`},w={TYPE:["info","success","danger","warning"]};class l extends y{constructor(e){super(Object.assign(Object.assign({},l.defaultAdapter),e))}removeBanner(e){this._adapter.notifyClose(e),this._adapter.setVisible()}}const n=P.PREFIX,T=w.TYPE;class h extends E{constructor(e){super(e),this.remove=s=>{s&&s.stopPropagation(),this.foundation.removeBanner(s)},this.state={visible:!0},C("target"in this.props,"[Semi Banner] 'target' has been deprecated, please write JSX directly instead.")}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:()=>{this.setState({visible:!1})},notifyClose:e=>{const{onClose:s}=this.props;s(e)}})}componentDidMount(){this.foundation=new l(this.adapter),this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}renderCloser(){const{closeIcon:e}=this.props;return e===null?e:t.createElement(I,{className:`${n}-close`,onClick:this.remove,icon:e||t.createElement(N,{"x-semi-prop":"closeIcon","aria-hidden":!0}),theme:"borderless",size:"small",type:"tertiary","aria-label":"Close"})}renderIcon(){const{type:e,icon:s}=this.props;let a={warning:t.createElement(B,{size:"large","aria-label":"warning"}),success:t.createElement(v,{size:"large","aria-label":"success"}),info:t.createElement(x,{size:"large","aria-label":"info"}),danger:t.createElement($,{size:"large","aria-label":"danger"})}[e];const r=m({[`${n}-icon`]:!0});return typeof s<"u"&&(a=s),a?t.createElement("div",{className:r,"x-semi-prop":"icon"},a):null}render(){const{children:e,type:s,className:c,style:a,bordered:r,title:p,description:d,fullMode:i}=this.props,{visible:b}=this.state,f=m(n,c,{[`${n}-${s}`]:s,[`${n}-full`]:i,[`${n}-in-container`]:!i,[`${n}-bordered`]:!i&&r});return b?t.createElement("div",Object.assign({className:f,style:a,role:"alert"},this.getDataAttr(this.props)),t.createElement("div",{className:`${n}-content-wrapper`},t.createElement("div",{className:`${n}-content`},this.renderIcon(),t.createElement("div",{className:`${n}-content-body`},p?t.createElement(u.Title,{heading:5,className:`${n}-title`,component:"div","x-semi-prop":"title"},p):null,d?t.createElement(u.Paragraph,{className:`${n}-description`,component:"div","x-semi-prop":"description"},d):null)),this.renderCloser()),e?t.createElement("div",{className:`${n}-extra`,"x-semi-prop":"children"},e):null):null}}h.propTypes={fullMode:o.bool,type:o.oneOf(T),title:o.node,description:o.node,icon:o.node,closeIcon:o.node,children:o.node,style:o.object,className:o.string,onClose:o.func,bordered:o.bool};h.defaultProps={onClose:()=>{},type:"info",fullMode:!0};export{h as B};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{B as f,f as y,k as h,R as l,aw as S,l as _,P as a,s as b}from"./tauri-compat-tfiFK9EG.js";const O=`${f}-spin`,E={PREFIX:O},P={SIZE:["small","middle","large"]};class d extends y{static get spinDefaultAdapter(){return{getProp:()=>{},setLoading:e=>{}}}constructor(e){super(Object.assign(Object.assign({},d.spinDefaultAdapter),e))}updateLoadingIfNeedDelay(){const{spinning:e,delay:n}=this._adapter.getProps(),{delay:t}=this._adapter.getStates();if(t){const s=this;this._timer=setTimeout(()=>{s._adapter.setState({loading:e,delay:0})},n)}}destroy(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}var j=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(i);s<t.length;s++)e.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(i,t[s])&&(n[t[s]]=i[t[s]]);return n};const r=E.PREFIX;class o extends h{constructor(e){super(e),this.foundation=new d(this.adapter),this.state={delay:e.delay,loading:!0}}static getDerivedStateFromProps(e){return e.delay?e.spinning===!1?{delay:0,loading:!1}:{delay:e.delay}:{loading:e.spinning}}get adapter(){return Object.assign(Object.assign({},super.adapter),{setLoading:e=>{this.setState({loading:e})}})}componentWillUnmount(){this.foundation.destroy()}renderSpin(){const{indicator:e,tip:n}=this.props,{loading:t}=this.state;return t?l.createElement("div",{className:`${r}-wrapper`},e?l.createElement("div",{className:`${r}-animate`,"x-semi-prop":"indicator"},e):l.createElement(S,null),n?l.createElement("div",{"x-semi-prop":"tip"},n):null):null}render(){this.foundation.updateLoadingIfNeedDelay();const e=this.props,{children:n,style:t,wrapperClassName:s,childStyle:c,size:p}=e,m=j(e,["children","style","wrapperClassName","childStyle","size"]),{loading:u}=this.state,g=_(r,s,{[`${r}-${p}`]:p,[`${r}-block`]:n,[`${r}-hidden`]:!u});return l.createElement("div",Object.assign({className:g,style:t},this.getDataAttr(m)),this.renderSpin(),l.createElement("div",{className:`${r}-children`,style:c,"x-semi-prop":"children"},n))}}o.propTypes={size:a.oneOf(P.SIZE),spinning:a.bool,children:a.node,indicator:a.node,delay:a.number,tip:a.node,wrapperClassName:a.string,childStyle:a.object,style:a.object};o.__SemiComponentName__="Spin";o.defaultProps=b(o.__SemiComponentName__,{size:"middle",spinning:!0,children:null,indicator:null,delay:0});export{o as S};
|
||||
import{B as f,f as y,k as h,R as l,aw as S,l as _,P as a,s as b}from"./tauri-compat-D_GD_wMe.js";const O=`${f}-spin`,E={PREFIX:O},P={SIZE:["small","middle","large"]};class d extends y{static get spinDefaultAdapter(){return{getProp:()=>{},setLoading:e=>{}}}constructor(e){super(Object.assign(Object.assign({},d.spinDefaultAdapter),e))}updateLoadingIfNeedDelay(){const{spinning:e,delay:n}=this._adapter.getProps(),{delay:t}=this._adapter.getStates();if(t){const s=this;this._timer=setTimeout(()=>{s._adapter.setState({loading:e,delay:0})},n)}}destroy(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}var j=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(i);s<t.length;s++)e.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(i,t[s])&&(n[t[s]]=i[t[s]]);return n};const r=E.PREFIX;class o extends h{constructor(e){super(e),this.foundation=new d(this.adapter),this.state={delay:e.delay,loading:!0}}static getDerivedStateFromProps(e){return e.delay?e.spinning===!1?{delay:0,loading:!1}:{delay:e.delay}:{loading:e.spinning}}get adapter(){return Object.assign(Object.assign({},super.adapter),{setLoading:e=>{this.setState({loading:e})}})}componentWillUnmount(){this.foundation.destroy()}renderSpin(){const{indicator:e,tip:n}=this.props,{loading:t}=this.state;return t?l.createElement("div",{className:`${r}-wrapper`},e?l.createElement("div",{className:`${r}-animate`,"x-semi-prop":"indicator"},e):l.createElement(S,null),n?l.createElement("div",{"x-semi-prop":"tip"},n):null):null}render(){this.foundation.updateLoadingIfNeedDelay();const e=this.props,{children:n,style:t,wrapperClassName:s,childStyle:c,size:p}=e,m=j(e,["children","style","wrapperClassName","childStyle","size"]),{loading:u}=this.state,g=_(r,s,{[`${r}-${p}`]:p,[`${r}-block`]:n,[`${r}-hidden`]:!u});return l.createElement("div",Object.assign({className:g,style:t},this.getDataAttr(m)),this.renderSpin(),l.createElement("div",{className:`${r}-children`,style:c,"x-semi-prop":"children"},n))}}o.propTypes={size:a.oneOf(P.SIZE),spinning:a.bool,children:a.node,indicator:a.node,delay:a.number,tip:a.node,wrapperClassName:a.string,childStyle:a.object,style:a.object};o.__SemiComponentName__="Spin";o.defaultProps=b(o.__SemiComponentName__,{size:"middle",spinning:!0,children:null,indicator:null,delay:0});export{o as S};
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
import{c as ie,b as v,B as oe,l as A,R as x,au as Y,P as l,an as le,aj as o,T as j,ap as K,S as te,U as ce,ak as pe,at as de,aq as ue,as as ge,ar as he}from"./tauri-compat-tfiFK9EG.js";import{S as fe}from"./index-D_sWIqse.js";import{A as me}from"./Animation-TKQfYYOo.js";import{W as be}from"./WindowsTitlebar-CrkUa1UM.js";function ye(e){return v.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),v.createElement("g",{clipPath:"url(#clip_loading)"},v.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 0c.66 0 1.2.54 1.2 1.2v5.2a1.2 1.2 0 0 1-2.4 0V1.2c0-.66.54-1.2 1.2-1.2Zm7.05 2.3c.54.38.66 1.13.27 1.67l-3.06 4.2a1.2 1.2 0 0 1-1.94-1.4l3.06-4.21a1.2 1.2 0 0 1 1.67-.27Zm-14.1 0a1.2 1.2 0 0 1 1.67.26l3.06 4.2a1.2 1.2 0 1 1-1.94 1.41l-3.06-4.2a1.2 1.2 0 0 1 .27-1.68Zm-4.36 6c.2-.64.88-.98 1.5-.78l4.95 1.6a1.2 1.2 0 0 1-.74 2.3L1.36 9.8a1.2 1.2 0 0 1-.77-1.5Zm22.82 0c.2.62-.14 1.3-.77 1.5l-4.94 1.61a1.2 1.2 0 0 1-.74-2.28l4.94-1.6c.63-.21 1.3.13 1.51.76Zm-15.6 5.06c.21.63-.13 1.3-.77 1.51l-4.94 1.6a1.2 1.2 0 0 1-.74-2.27l4.94-1.61c.63-.2 1.31.14 1.52.77Zm8.37 0c.21-.63.89-.98 1.52-.77l4.94 1.6a1.2 1.2 0 0 1-.74 2.29l-4.94-1.6a1.2 1.2 0 0 1-.78-1.52Zm-6.77 2.2c.54.39.66 1.14.27 1.68l-3.06 4.2a1.2 1.2 0 1 1-1.94-1.4l3.06-4.21a1.2 1.2 0 0 1 1.67-.27Zm5.18 0a1.2 1.2 0 0 1 1.67.27l3.06 4.2a1.2 1.2 0 0 1-1.94 1.41l-3.06-4.2a1.2 1.2 0 0 1 .27-1.68ZM12 16.4c.66 0 1.2.54 1.2 1.2v5.2a1.2 1.2 0 0 1-2.4 0v-5.2c0-.66.54-1.2 1.2-1.2Z",fill:"currentColor"})),v.createElement("defs",null,v.createElement("clipPath",{id:"clip_loading"},v.createElement("rect",{width:24,height:24,fill:"currentColor"}))))}const Se=ie(ye,"loading"),ve={PREFIX:`${oe}-progress`},m={types:["line","circle"],DEFAULT_TYPE:"line",STROKE_DEFAULT:"var(--semi-color-success)",strokeLineCap:["square","round"],DEFAULT_LINECAP:"round",sizes:["default","small","large"],DEFAULT_SIZE:"default",directions:["vertical","horizontal"],DEFAULT_DIRECTION:"horizontal"};function ke(e,r,t){try{const n=xe(e,r,t);if(n.length!==0)return n}catch{return}}function xe(e,r,t){if(e.sort((s,i)=>s.percent-i.percent),e[0].percent>r)return m.STROKE_DEFAULT;const n=e[e.length-1];if(n.percent<r)return F(n.color);for(const[s,i]of e.entries()){if(i.percent===r)return F(i.color);if(r>i.percent)continue;const a=e[s-1];return t?Ee({startColor:F(a.color),endColor:F(i.color),size:i.percent-a.percent-1},r-a.percent-1):F(a.color)}}function Ee(e,r){const{startColor:t,endColor:n,size:s}=e,i=t.split(""),a=n.split(""),c=[parseInt(`${i[1]}${i[2]}`,16),parseInt(`${a[1]}${a[2]}`,16)],h=[parseInt(`${i[3]}${i[4]}`,16),parseInt(`${a[3]}${a[4]}`,16)],d=[parseInt(`${i[5]}${i[6]}`,16),parseInt(`${a[5]}${a[6]}`,16)],p=[parseInt(`${i[7]}${i[8]}`,16),parseInt(`${a[7]}${a[8]}`,16)],u=(c[0]-c[1])/(s+1),D=(h[0]-h[1])/(s+1),O=(d[0]-d[1])/(s+1),R=(p[0]-p[1])/(s+1);function $(g){const k=Math.round(c[0]-u*(g+1)).toString(16),_=Math.round(h[0]-D*(g+1)).toString(16),G=Math.round(d[0]-O*(g+1)).toString(16),w=`${N(k)}${N(_)}${N(G)}`,b=Math.floor(R*(g+1)+p[1]).toString(16);return S.Hex(`#${w}`,b)}function N(g){return g.length===1?`0${g}`:g.length===0?"00":g}if(typeof r>"u"){const g=[t];for(let k=0;k<s;k+=1)g.push($(k));return g}return $(r)}function F(e){if(e=e.trim().toLowerCase(),C.hex.test(e))return S.Hex(e,void 0);if(C.hslA.test(e))return S.Hex(S.HslA(e),void 0);if(C.rgbA.test(e))return S.Hex(S.RgbA(e),void 0);if(C.semiDesignTokens.test(e))return V.ALONG.indexOf(e)!==-1?S.SemiDesignToken(e):V.SEQUENCE.indexOf(e)!==-1?S.SemiDesignToken(`${e}-5`):S.SemiDesignToken(`${e}`)}const S={Hex(e,r){return e=e.replace("#",""),e.length===8?`#${e}`:e.length===6?`#${e}${r||"ff"}`:(e.length===3&&(e=e.split("").map(t=>t+t).join("")),`#${e}${r||"ff"}`)},SemiDesignToken(e){if(typeof window>"u")return;const r=getComputedStyle(document.body).getPropertyValue(`--semi-${e}`);if(r==="")return;const t=`rgba(${r}, 1)`;return S.RgbA(t)},HslA(e){const r=C.hslA.exec(e),t=parseInt(r[2]),n=parseInt(r[3])/100,s=parseInt(r[4])/100,i=r[5],a=(1-Math.abs(2*s-1))*n,c=a*(1-Math.abs(t/60%2-1)),h=s-a/2;let d=0,p=0,u=0;return 0<=t&&t<60?(d=a,p=c,u=0):60<=t&&t<120?(d=c,p=a,u=0):120<=t&&t<180?(d=0,p=a,u=c):180<=t&&t<240?(d=0,p=c,u=a):240<=t&&t<300?(d=c,p=0,u=a):300<=t&&t<360&&(d=a,p=0,u=c),d=Math.round((d+h)*255).toString(16),p=Math.round((p+h)*255).toString(16),u=Math.round((u+h)*255).toString(16),S.utils.pAL(d,p,u,i)},RgbA(e){const r=C.rgbA.exec(e),t=parseInt(r[2],10).toString(16),n=parseInt(r[3],10).toString(16),s=parseInt(r[4],10).toString(16),i=r[5];return S.utils.pAL(t,n,s,i)},utils:{pAL(e,r,t,n){return e.length==1&&(e="0"+e),r.length==1&&(r="0"+r),t.length==1&&(t="0"+t),typeof n<"u"?(n=Math.round(parseInt(n)*255).toString(16),n.length==1&&(n="0"+n),"#"+e+r+t+n):"#"+e+r+t}}},C={hex:/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,hslA:/(hsl)a?\(\s*?(\d+),?\s*?(\d+)%,?\s*?(\d+)%,?\s*?\/?(\s*?[\d.]+)?\s*?\)/,rgbA:/(rgb)a?\(\s*?(\d+),?\s*?(Line truncated
|
||||
import{c as ie,b as v,B as oe,l as A,R as k,au as Y,P as l,an as le,aj as o,T as j,ap as K,S as te,U as ce,al as pe,at as de,aq as ue,as as ge,ar as he}from"./tauri-compat-D_GD_wMe.js";import{S as fe}from"./index-D9Nakaf3.js";import{A as me}from"./Animation-DbFrgT1j.js";import{W as be}from"./WindowsTitlebar-Byi-SYR_.js";function ye(e){return v.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),v.createElement("g",{clipPath:"url(#clip_loading)"},v.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 0c.66 0 1.2.54 1.2 1.2v5.2a1.2 1.2 0 0 1-2.4 0V1.2c0-.66.54-1.2 1.2-1.2Zm7.05 2.3c.54.38.66 1.13.27 1.67l-3.06 4.2a1.2 1.2 0 0 1-1.94-1.4l3.06-4.21a1.2 1.2 0 0 1 1.67-.27Zm-14.1 0a1.2 1.2 0 0 1 1.67.26l3.06 4.2a1.2 1.2 0 1 1-1.94 1.41l-3.06-4.2a1.2 1.2 0 0 1 .27-1.68Zm-4.36 6c.2-.64.88-.98 1.5-.78l4.95 1.6a1.2 1.2 0 0 1-.74 2.3L1.36 9.8a1.2 1.2 0 0 1-.77-1.5Zm22.82 0c.2.62-.14 1.3-.77 1.5l-4.94 1.61a1.2 1.2 0 0 1-.74-2.28l4.94-1.6c.63-.21 1.3.13 1.51.76Zm-15.6 5.06c.21.63-.13 1.3-.77 1.51l-4.94 1.6a1.2 1.2 0 0 1-.74-2.27l4.94-1.61c.63-.2 1.31.14 1.52.77Zm8.37 0c.21-.63.89-.98 1.52-.77l4.94 1.6a1.2 1.2 0 0 1-.74 2.29l-4.94-1.6a1.2 1.2 0 0 1-.78-1.52Zm-6.77 2.2c.54.39.66 1.14.27 1.68l-3.06 4.2a1.2 1.2 0 1 1-1.94-1.4l3.06-4.21a1.2 1.2 0 0 1 1.67-.27Zm5.18 0a1.2 1.2 0 0 1 1.67.27l3.06 4.2a1.2 1.2 0 0 1-1.94 1.41l-3.06-4.2a1.2 1.2 0 0 1 .27-1.68ZM12 16.4c.66 0 1.2.54 1.2 1.2v5.2a1.2 1.2 0 0 1-2.4 0v-5.2c0-.66.54-1.2 1.2-1.2Z",fill:"currentColor"})),v.createElement("defs",null,v.createElement("clipPath",{id:"clip_loading"},v.createElement("rect",{width:24,height:24,fill:"currentColor"}))))}const Se=ie(ye,"loading"),ve={PREFIX:`${oe}-progress`},m={types:["line","circle"],DEFAULT_TYPE:"line",STROKE_DEFAULT:"var(--semi-color-success)",strokeLineCap:["square","round"],DEFAULT_LINECAP:"round",sizes:["default","small","large"],DEFAULT_SIZE:"default",directions:["vertical","horizontal"],DEFAULT_DIRECTION:"horizontal"};function xe(e,r,t){try{const n=ke(e,r,t);if(n.length!==0)return n}catch{return}}function ke(e,r,t){if(e.sort((s,i)=>s.percent-i.percent),e[0].percent>r)return m.STROKE_DEFAULT;const n=e[e.length-1];if(n.percent<r)return F(n.color);for(const[s,i]of e.entries()){if(i.percent===r)return F(i.color);if(r>i.percent)continue;const a=e[s-1];return t?Ee({startColor:F(a.color),endColor:F(i.color),size:i.percent-a.percent-1},r-a.percent-1):F(a.color)}}function Ee(e,r){const{startColor:t,endColor:n,size:s}=e,i=t.split(""),a=n.split(""),c=[parseInt(`${i[1]}${i[2]}`,16),parseInt(`${a[1]}${a[2]}`,16)],h=[parseInt(`${i[3]}${i[4]}`,16),parseInt(`${a[3]}${a[4]}`,16)],d=[parseInt(`${i[5]}${i[6]}`,16),parseInt(`${a[5]}${a[6]}`,16)],p=[parseInt(`${i[7]}${i[8]}`,16),parseInt(`${a[7]}${a[8]}`,16)],u=(c[0]-c[1])/(s+1),D=(h[0]-h[1])/(s+1),O=(d[0]-d[1])/(s+1),R=(p[0]-p[1])/(s+1);function $(g){const x=Math.round(c[0]-u*(g+1)).toString(16),_=Math.round(h[0]-D*(g+1)).toString(16),G=Math.round(d[0]-O*(g+1)).toString(16),w=`${N(x)}${N(_)}${N(G)}`,b=Math.floor(R*(g+1)+p[1]).toString(16);return S.Hex(`#${w}`,b)}function N(g){return g.length===1?`0${g}`:g.length===0?"00":g}if(typeof r>"u"){const g=[t];for(let x=0;x<s;x+=1)g.push($(x));return g}return $(r)}function F(e){if(e=e.trim().toLowerCase(),C.hex.test(e))return S.Hex(e,void 0);if(C.hslA.test(e))return S.Hex(S.HslA(e),void 0);if(C.rgbA.test(e))return S.Hex(S.RgbA(e),void 0);if(C.semiDesignTokens.test(e))return V.ALONG.indexOf(e)!==-1?S.SemiDesignToken(e):V.SEQUENCE.indexOf(e)!==-1?S.SemiDesignToken(`${e}-5`):S.SemiDesignToken(`${e}`)}const S={Hex(e,r){return e=e.replace("#",""),e.length===8?`#${e}`:e.length===6?`#${e}${r||"ff"}`:(e.length===3&&(e=e.split("").map(t=>t+t).join("")),`#${e}${r||"ff"}`)},SemiDesignToken(e){if(typeof window>"u")return;const r=getComputedStyle(document.body).getPropertyValue(`--semi-${e}`);if(r==="")return;const t=`rgba(${r}, 1)`;return S.RgbA(t)},HslA(e){const r=C.hslA.exec(e),t=parseInt(r[2]),n=parseInt(r[3])/100,s=parseInt(r[4])/100,i=r[5],a=(1-Math.abs(2*s-1))*n,c=a*(1-Math.abs(t/60%2-1)),h=s-a/2;let d=0,p=0,u=0;return 0<=t&&t<60?(d=a,p=c,u=0):60<=t&&t<120?(d=c,p=a,u=0):120<=t&&t<180?(d=0,p=a,u=c):180<=t&&t<240?(d=0,p=c,u=a):240<=t&&t<300?(d=c,p=0,u=a):300<=t&&t<360&&(d=a,p=0,u=c),d=Math.round((d+h)*255).toString(16),p=Math.round((p+h)*255).toString(16),u=Math.round((u+h)*255).toString(16),S.utils.pAL(d,p,u,i)},RgbA(e){const r=C.rgbA.exec(e),t=parseInt(r[2],10).toString(16),n=parseInt(r[3],10).toString(16),s=parseInt(r[4],10).toString(16),i=r[5];return S.utils.pAL(t,n,s,i)},utils:{pAL(e,r,t,n){return e.length==1&&(e="0"+e),r.length==1&&(r="0"+r),t.length==1&&(t="0"+t),typeof n<"u"?(n=Math.round(parseInt(n)*255).toString(16),n.length==1&&(n="0"+n),"#"+e+r+t+n):"#"+e+r+t}}},C={hex:/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,hslA:/(hsl)a?\(\s*?(\d+),?\s*?(\d+)%,?\s*?(\d+)%,?\s*?\/?(\s*?[\d.]+)?\s*?\)/,rgbA:/(rgb)a?\(\s*?(\d+),?\s*?(Line truncated
|
||||
`)})})})]})}function Me(){return o.jsxs("section",{className:"ga-bootstrap-screen ga-bootstrap-ready","aria-live":"polite",children:[o.jsx(te,{size:"extra-large",className:"ga-bootstrap-ready-icon","aria-hidden":"true"}),o.jsx(j.Title,{heading:5,className:"ga-bootstrap-title",children:E("ready")}),o.jsx(j.Text,{type:"tertiary",children:E("readyDetail")})]})}function Ue(){const[e,r]=v.useReducer(Ne,we);v.useEffect(()=>(je(r).catch(n=>{console.error("[bootstrap] failed to subscribe to startup state",n)}),()=>De()),[]);let t;switch(e.route){case"loading":t=o.jsx(Re,{mode:e.mode});break;case"progress":t=o.jsx(Fe,{stages:e.stages,overallPct:e.overallPct,logs:e.logs});break;case"ready":t=o.jsx(Me,{});break}return o.jsxs("div",{className:"ga-bootstrap-shell",children:[pe&&o.jsx(be,{}),o.jsx("main",{className:"ga-bootstrap-app","data-route":e.route,children:t})]})}function ne(e){e.matches?(document.documentElement.dataset.appearance="dark",document.body.setAttribute("theme-mode","dark")):(document.documentElement.dataset.appearance="light",document.body.removeAttribute("theme-mode"))}const M=window.matchMedia("(prefers-color-scheme: dark)");ne(M);var ee;(ee=M.addEventListener)==null||ee.call(M,"change",()=>ne(M));const J=document.getElementById("loading-root");J&&de.createRoot(J).render(o.jsx(v.StrictMode,{children:o.jsx(ue,{locale:f?ge:he,children:o.jsx(Ue,{})})}));
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPart-B6YIH_Oj.js","assets/tauri-compat-tfiFK9EG.js","assets/tauri-compat-BTcpEvqB.css","assets/markdown-preprocess-6737_jWr.js","assets/markdown-preprocess-Cp579UoJ.css","assets/index-Bpi3BHKj.js","assets/index-D0pGtk0y.css","assets/WindowsTitlebar-CrkUa1UM.js","assets/WindowsTitlebar-U0YG9JNA.css","assets/MarkdownPart-Cp90Gu77.css","assets/SummaryPart-Bg2rGJqh.js","assets/ServicesPage-oItXjdfv.js","assets/index-CPxjSju3.js","assets/index-D_sWIqse.js","assets/index-DkG9Cu-r.css","assets/index-gTPS8Hpa.css","assets/IconFile-CgfQSwGI.js","assets/ServicesPage-Cbm5nbW7.css","assets/TokenPage-C9YMDOM-.js","assets/Animation-TKQfYYOo.js","assets/index-DpGuh58E.js","assets/index-ClU1uQYs.css","assets/TokenPage-DwLDOw_j.css","assets/CollabPage-BSH3y36_.js","assets/CollabPage-CG38jm3S.css"])))=>i.map(i=>d[i]);
|
||||
var Mi=Object.defineProperty;var Li=(n,e,t)=>e in n?Mi(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var xt=(n,e,t)=>Li(n,typeof e!="symbol"?e+"":e,t);import{g as We,r as Ii,a as Ti,c as fe,b as a,d as As,e as Fs,B as Te,_ as Be,f as ge,h as $,i as De,j as Ri,E as Ni,R as g,k as de,l as I,m as Ge,n as zs,P as h,w as Bs,o as jo,p as Je,q as rn,s as cn,t as No,u as Di,v as $i,x as Ai,y as Fi,z as zi,A as Bi,C as Ui,D as Vi,F as Ki,G as Wi,H as Us,I as Hi,T as Do,J as sn,K as Zi,L as qi,M as Gi,N as Pt,O as Vs,Q as Ks,S as Ws,U as Hs,V as Qi,W as Zs,X as qs,Y as Eo,Z as Yi,$ as Xi,a0 as Ji,a1 as ea,a2 as ta,a3 as na,a4 as oa,a5 as ra,a6 as sa,a7 as ia,a8 as aa,a9 as la,aa as Go,ab as $e,ac as ca,ad as da,ae as Jt,af as ua,ag as pa,ah as Oo,ai as me,aj as i,ak as ha,al as ma,am as fa,an as ga,ao as Qo,ap as dt,aq as ya,ar as ba,as as va,at as xa}from"./tauri-compat-tfiFK9EG.js";import{I as dn,a as Gs,b as Qs,c as Ys,B as ie}from"./index-Bpi3BHKj.js";import{W as wa}from"./WindowsTitlebar-CrkUa1UM.js";const Ca="modulepreload",Sa=function(n){return"/"+n},Yo={},Gt=function(e,t,o){let r=Promise.resolve();if(t&&t.length>0){let l=function(p){return Promise.all(p.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(t.map(p=>{if(p=Sa(p),p in Yo)return;Yo[p]=!0;const d=p.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${m}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Ca,d||(f.as="script"),f.crossOrigin="",f.href=p,u&&f.setAttribute("nonce",u),document.head.appendChild(f),d)return new Promise((b,y)=>{f.addEventListener("load",b),f.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};function Xo(n,e){const t=e,o=new URL(t);if(o.protocol!=="http:"&&o.protocol!=="https:")throw new Error(`Service endpoint must use HTTP(S): ${t}`);return o.toString().replace(/\/+$/,"")}function Jo(n){const e=new URL(n);return e.protocol=e.protocol==="https:"?"wss:":"ws:",e.pathname=`${e.pathname.replace(/\/+$/,"")}/ws`,e.toString().replace(/\/$/,"")}function ka(n){const e=Xo(n.VITE_BRIDGE_BASE,"http://127.0.0.1:14168"),t=Xo(n.VITE_CONDUCTOR_BASE,"http://127.0.0.1:8900");return{bridgeBase:e,conductorBase:t,wsUrl:Jo(e),conductorWsUrl:Jo(t)}}const un=ka({VITE_BRIDGE_BASE:void 0,VITE_CONDUCTOR_BASE:void 0}),ee=un.bridgeBase,ja=un.conductorBase,Ea=un.wsUrl,Oa=un.conductorWsUrl,Pa=1e3,_a=3e4;let ke=null,Po=0,jn=null;const jt=new Map;let _o="offline";const Mo=new Set;let er=!1;const Ma=new Set;function En(n){n!==_o&&(_o=n,n==="ready"&&(er||(er=!0,Ma.forEach(e=>e()))),Mo.forEach(e=>e(n)))}function tr(){return _o}function Xs(n){return Mo.add(n),()=>{Mo.delete(n)}}function Js(){if(!(ke&&(ke.readyState===WebSocket.OPEN||ke.readyState===WebSocket.CONNECTING))){En("connecting");try{ke=new WebSocket(Ea)}catch{nr();return}ke.onopen=()=>{Po=0,En("ready")},ke.onmessage=n=>{try{const e=JSON.parse(n.data),t=e.type;if(!t)return;const o=jt.get(t);o&&o.forEach(r=>r(e))}catch{}},ke.onclose=()=>{ke=null,En("connecting"),nr()},ke.onerror=()=>{ke==null||ke.close()}}}function nr(){if(jn)return;const n=Math.min(Pa*2**Po,_a);Po++,jn=setTimeout(()=>{jn=null,Js()},n)}function Ve(n,e){return jt.has(n)||jt.set(n,new Set),jt.get(n).add(e),Js(),()=>{var t;(t=jt.get(n))==null||t.delete(e)}}let or=[];const La=new Set;let rr=!1;function Ia(){for(const n of La)n()}function On(n){or=[...or.slice(-39),n],Ia()}function Ta(){rr||(rr=!0,Ve("session-state",n=>{const e=n;if(!e.sessionId||!e.status)return;const t=e.status==="running"?"Turn started":e.status==="idle"?"Turn complete":e.status==="error"?"Turn error":`Session ${e.status}`;On(t)}),Ve("service.changed",n=>{const e=n;if(!e.service)return;const t=e.service.name??e.service.id??"service",o=e.service.status??"unknown";On(`${t}: ${o}`)}),Ve("token.changed",n=>{const e=n;!e.session_id||!e.total_output||On(`Token update: +${e.total_output} output`)}))}Ta();const ei=new Set(["http:","https:"]),Ra=new Set(["\\href","\\url"]),Na=/^data:image\/(?:avif|gif|jpeg|png|webp);base64,[a-z0-9+/]+={0,2}$/i,Da=/^(?:\/|\.\/)?assets\//,$a=/%(?:2e|2f|5c)/i,ti=/[\u0000-\u001f\u007f]/;function $o(n){const e=n.trim();if(!/^https?:\/\//i.test(e)||ti.test(e))return null;try{const t=new URL(e);return ei.has(t.protocol)?t.href:null}catch{return null}}function Aa(n){if(!Da.test(n)||n.startsWith("//")||n.includes("\\")||$a.test(n))return null;try{const e=new URL(n,"https://genericagent.invalid/");return e.origin==="https://genericagent.invalid"&&e.pathname.startsWith("/assets/")?n:null}catch{return null}Line truncated
|
||||
/new 新会话 /clear 清屏 /stop 停止 /settings 设置`,"slash.unknown":"未知命令","upload.hint":"上传文件:选择 / 拖拽 / 粘贴","upload.button":"上传文件","upload.tooLarge":"文件过大或数量超限","upload.empty":"跳过空文件","upload.failed":"上传失败","err.charLimit":"已达字数上限({n}),发送时将自动截断","err.charLimitReached":"已达字数上限({n})","err.numMax":"不能超过 {n}","file.openFailed":"无法打开文件","file.kindGeneric":"文件","file.kindDoc":"文档","file.kindSheet":"表格","file.kindSlide":"幻灯片","file.kindCode":"代码","file.kindArchive":"压缩包","file.kindAudio":"音频","file.kindVideo":"视频","upload.removeTitle":"移除","upload.dropHint":"松开以上传文件","lightbox.closeTitle":"关闭","fold.thinking":"思考","fold.tool":"工具调用","fold.toolResult":"工具结果","fold.llm":"LLM Running","fold.turn":"第 {n} 轮","plan.header":"计划 ({done}/{total})","plan.complete":"✓ 计划完成 ({n}/{n})","plan.running":"计划执行中","plan.completeTitle":"计划完成","plan.placeholder":"计划模式已激活","plan.waiting":"等待写入 {path} …","plan.overflow":"还有 {n} 项","plan.current":"当前","plan.collapse":"收起","plan.expand":"展开","plan.details":"详情","plan.capsuleRunning":"运行中","plan.capsuleComplete":"已完成","timing.elapsed":"已运行 {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"微信","ch.wecom":"企业微信","ch.lark":"飞书","ch.dingtalk":"钉钉","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"加载中…","ch.empty":"未发现 IM 进程脚本","ch.logEmpty":"暂无日志","err.channelLoad":"加载失败","err.channelStart":"启动失败","err.channelStop":"停止失败","err.mykeyImport":"导入模型配置失败","err.mykeyExport":"导出模型配置失败","err.channelNotConfigured":"请先在密钥配置中完成该平台设置","sys.channelStarted":"已启动","sys.channelStopped":"已停止","sys.bridgeDisconnecting":"正在断开本地连接","modal.channelLogs":"进程日志","modal.mykeyConfig":"密钥配置","sys.configSaved":"配置已保存","sys.mykeyImported":"模型配置已导入","sys.mykeyExported":"模型配置已导出","st.starting":"启动中…","st.stopping":"停止中…","st.online":"在线","st.offline":"离线","st.error":"错误","st.running":"运行中","st.stopped":"已停止","st.abnormal":"异常","st.warning":"警告","err.portBusy":"端口被占用,已自动重连","err.conductorCrash":"内部线程异常退出","err.missingModule":"缺少依赖模块","err.connRefused":"连接被拒绝,将自动重试","err.timeout":"连接超时","err.apiKeyInvalid":"API Key 无效或已过期","err.modelNotFound":"模型不存在或不可用","err.rateLimit":"请求频率超限,请稍后重试","err.quotaExceeded":"额度不足","err.processCrash":"后台进程异常退出","act.configure":"配置","act.logs":"日志","act.restart":"重启","act.stop":"停止","act.start":"启动","act.disconnect":"断开","act.copy":"复制","act.copied":"已复制","act.copyTex":"TeX","act.send":"发送","proc.imbotWechat":"imbot · 微信","proc.imbotDing":"imbot · 钉钉","proc.bridge":"本地连接","proc.bridgeSummary":"连接桌面应用与本地运行环境","proc.bridgeTip":"保持桌面应用与本地运行环境通信","proc.scheduler":"定时任务","proc.schedulerSummary":"按计划自动执行任务","proc.schedulerTip":"在设定时间自动触发并执行任务","proc.conductor":"指挥家","proc.conductorSummary":"异步处理多步骤任务","proc.conductorTip":"通过异步对话拆解任务、分派执行,并持续跟进进度","proc.runtimeComponent":"运行组件","proc.runtimeComponentSummary":"本地运行环境中持续工作的组件","proc.runtimeComponentTip":"查看该组件的状态、日志与控制项","cm.scheduling":"调度中","cm.running":"执行中","cm.idleSt":"空闲","cm.master":"已派 3 子任务","cm.w1":"子任务:抓取数据","cm.w2":"子任务:复核结果","cm.sub":"等待派单","tok.total":"累计","tok.cost":"缓存率","tok.today":"今日","tok.tabAll":"会话","tok.tabConductor":"指挥家","tok.condTotal":"指挥家累计","tok.condCurrent":"指挥家本次","tok.condTip":"指挥家消耗不计入会话累计","tok.condOffline":"指挥家服务离线","tok.disclaimer":"不同 API 网站的计费价格可能会有差异,请以实际网站为准。","tok.colSession":"会话","tok.colIn":"输入","tok.colOut":"输出","tok.colCacheW":"缓存写入","tok.colCache":"缓存读取","tok.colCost":"成本","tok.from":"从","tok.to":"到","tok.reset":"重置","tok.noData":"暂无记录","tok.deleted":"此会话已删除","tok.pricingUnknown":"⚠ 此模型计费规则尚未明确,按默认估算","tok.priceInput":"输入: $","tok.priceOutput":"输出: $","tok.priceCacheW":"缓存写入: $","tok.priceCacheR":"缓存读取: $","presetPrompt.goal":"Line truncated
|
||||
/new new chat /clear clear /stop stop /settings settings`,"slash.unknown":"Unknown command","upload.hint":"Upload file: pick / drag / paste","upload.button":"Upload file","upload.tooLarge":"File too large or limit reached","upload.empty":"Skipped empty file","upload.failed":"Upload failed","err.charLimit":"Character limit reached ({n}), text will be truncated on send","err.charLimitReached":"Character limit reached ({n})","err.numMax":"Cannot exceed {n}","file.openFailed":"Cannot open file","file.kindGeneric":"File","file.kindDoc":"Document","file.kindSheet":"Spreadsheet","file.kindSlide":"Slides","file.kindCode":"Code","file.kindArchive":"Archive","file.kindAudio":"Audio","file.kindVideo":"Video","upload.removeTitle":"Remove","upload.dropHint":"Drop to upload files","lightbox.closeTitle":"Close","fold.thinking":"Thinking","fold.tool":"Tool call","fold.toolResult":"Tool result","fold.llm":"LLM Running","fold.turn":"Turn {n}","plan.header":"Plan ({done}/{total})","plan.complete":"✓ Plan complete ({n}/{n})","plan.running":"Running plan","plan.completeTitle":"Plan complete","plan.placeholder":"Plan mode activated","plan.waiting":"waiting for {path} …","plan.overflow":"+{n} more","plan.current":"Now","plan.collapse":"Collapse","plan.expand":"Expand","plan.details":"Details","plan.capsuleRunning":"Running","plan.capsuleComplete":"Done","timing.elapsed":"Elapsed {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"WeChat","ch.wecom":"WeCom","ch.lark":"Lark","ch.dingtalk":"DingTalk","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"Loading…","ch.empty":"No IM process scripts found","ch.logEmpty":"No log output yet","err.channelLoad":"Failed to load","err.channelStart":"Start failed","err.channelStop":"Stop failed","err.mykeyImport":"Failed to import model config","err.mykeyExport":"Failed to export model config","err.channelNotConfigured":"Complete this platform setup in Key configuration first","sys.channelStarted":"Started","sys.channelStopped":"Stopped","sys.bridgeDisconnecting":"Disconnecting from the local runtime","modal.channelLogs":"Process logs","modal.mykeyConfig":"Key configuration","sys.configSaved":"Configuration saved","sys.mykeyImported":"Model config imported","sys.mykeyExported":"Model config exported","st.starting":"Starting…","st.stopping":"Stopping…","st.online":"Online","st.offline":"Offline","st.error":"Error","st.running":"Running","st.stopped":"Stopped","st.abnormal":"Error","st.warning":"Warning","err.portBusy":"Port was busy, reconnected","err.conductorCrash":"Internal thread crashed","err.missingModule":"Missing module","err.connRefused":"Connection refused, retrying","err.timeout":"Connection timed out","err.apiKeyInvalid":"API key invalid or expired","err.modelNotFound":"Model not found or unavailable","err.rateLimit":"Rate limited, try again later","err.quotaExceeded":"Quota exceeded","err.processCrash":"Background process crashed","act.configure":"Configure","act.logs":"Logs","act.restart":"Restart","act.stop":"Stop","act.start":"Start","act.disconnect":"Disconnect","act.copy":"Copy","act.copied":"Copied","act.copyTex":"TeX","act.send":"Send","proc.imbotWechat":"imbot · WeChat","proc.imbotDing":"imbot · DingTalk","proc.bridge":"Local connection","proc.bridgeSummary":"Connects the desktop app to the local runtime","proc.bridgeTip":"Keeps the desktop app and local runtime communicating","proc.scheduler":"Scheduled tasks","proc.schedulerSummary":"Runs tasks on schedule","proc.schedulerTip":"Triggers and runs tasks at configured times","proc.conductor":"Conductor","proc.conductorSummary":"Handles multi-step work asynchronously","proc.conductorTip":"Uses async conversations to break down, delegate, and follow through on tasks","proc.runtimeComponent":"Runtime component","proc.runtimeComponentSummary":"A component that runs in the local environment","proc.runtimeComponentTip":"View this component’s status, logs, and controls","cm.scheduling":"Scheduling","cm.running":"Running","cm.idleSt":"Idle","cm.master":"Dispatched 3 subtasks","cm.w1":"Subtask: fetch data","cm.w2":"Subtask: review results","cm.sub":"Waiting for tasks","tok.total":"Total","tok.cost":"Cache rate","tok.today":"Today","tok.tabAll":"Chat","tok.tabConductor":"Conductor","tok.condTotal":"Conductor Total","tok.condCurrent":"Conductor Current","tok.condTip":"Conductor usage is not included in chat totals","tok.condOffline":"Service offline","tok.disclaimer":"Pricing may vary by API provider. Please refer to the actual website.","tok.colSession":"Session","tok.colIn":"Input","tok.colOut":"Output","tok.colCacheW":"Cache write","tok.colCache":"Cache read","tok.colCost":"Cost","tok.from":"From","tok.to":"To","tok.reset":"Reset","tok.noData":"No records","tok.deleted":"Session deleted","tok.pricingUnknown":"⚠ Pricing not confirmed, using defaults","tok.priceInput":"Input: $","tok.priceOutput":"Output: $","tok.priceCacheW":"Cache write: $","tok.priceCacheR":"Cache read: $","presetPromptLine truncated
|
||||
`)}),i.jsxs("div",{className:"ga-bridge-panel-section-foot",children:[_&&i.jsx("span",{className:"ga-bridge-panel-truncated",children:e("bridge.logLineCount",{count:m})}),i.jsxs("button",{className:"ga-bridge-panel-link-btn",onClick:k,children:[e("bridge.viewAllLogs")," →"]})]})]})]})}const cu=[{key:"services",icon:"symbol-misc",textKey:"nav.services"},{key:"collab",icon:"robot",textKey:"nav.collab"},{key:"token",icon:"graph",textKey:"nav.token"}];function du(){const{activePage:n,setPage:e}=Ie(),t=H(E=>E.open),o=X(E=>E.newSession),r=X(E=>E.sessions),s=X(E=>E.activeSessionId),l=X(E=>E.setActiveSession),c=X(E=>E.runningSessions),{t:u}=ce(),[p,d]=a.useState(!0),[m,f]=a.useState(""),[b,y]=a.useState(!1),[S,w]=a.useState(!1),C=a.useCallback(()=>y(!1),[]),k=a.useCallback(()=>{C(),t()},[C,t]),_=a.useCallback(()=>{w(!1),y(E=>!E)},[]),x=[...r].sort((E,D)=>{if(E.pinned&&!D.pinned)return-1;if(!E.pinned&&D.pinned)return 1;const P=Number(E.updatedAt||E.createdAt||0);return Number(D.updatedAt||D.createdAt||0)-P}),j=m.trim()?x.filter(E=>E.title.toLowerCase().includes(m.trim().toLowerCase())):x;function v(){o(),e("chat")}function O(E){l(E),e("chat")}return i.jsxs("div",{className:"ga-left-sidebar",children:[i.jsxs("nav",{className:"ga-nav-rail","aria-label":"Main navigation",children:[i.jsxs("button",{type:"button",className:"ga-nav-btn",onClick:v,"aria-label":u("nav.chat"),children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Ee,{name:"comment",size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u("nav.chat")})]}),cu.map(E=>i.jsxs("button",{type:"button",className:`ga-nav-btn${n===E.key?" active":""}`,onClick:()=>e(E.key),"aria-label":u(E.textKey),"aria-current":n===E.key?"page":void 0,children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Ee,{name:E.icon,size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u(E.textKey)})]},E.key))]}),i.jsx("div",{className:"ga-sidebar-search",children:i.jsx(ut,{prefix:i.jsx(ni,{style:{fontSize:14}}),placeholder:u("search.placeholder"),size:"small",value:m,onChange:f})}),!m&&i.jsx(Bd,{label:u("section.sessions"),count:r.length,open:p,onToggle:d,onAction:v}),i.jsx("div",{className:"ga-session-section",children:(m||p)&&(j.length===0?i.jsx("div",{className:"ga-session-empty",children:i.jsx("p",{children:u(m?"search.noResults":"conv.emptyList")})}):i.jsx("div",{className:"ga-session-list",children:j.map(E=>i.jsx(Vd,{session:E,isActive:E.id===s,isWorking:c.has(E.id),onClick:()=>O(E.id)},E.id))}))}),i.jsxs("div",{className:"ga-sidebar-footer",children:[i.jsx($e,{content:u("foot.settings"),position:"top",clickToHide:!0,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:k,"aria-label":u("foot.settings"),children:i.jsx(Ee,{name:"settings-gear",size:"1rem"})})}),i.jsxs("div",{className:"ga-sidebar-footer-anchor",children:[i.jsx($e,{content:u("foot.runtimeManagement"),position:"top",visible:S&&!b,onVisibleChange:w,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:_,"aria-label":u("foot.runtimeManagement"),"aria-expanded":b,"aria-haspopup":"dialog","aria-controls":"ga-runtime-management-panel",children:i.jsx(Ee,{name:"server-process",size:"1rem"})})}),b&&i.jsx(lu,{onClose:C})]})]})]})}const uu=24;function pu(){const n=a.useRef(null),[e,t]=a.useState(!0),o=a.useRef(!0),r=a.useRef(0),s=a.useCallback(()=>{const u=n.current;if(!u)return;const p=u.scrollHeight-u.scrollTop-u.clientHeight<uu;t(p),o.current=p},[]),l=a.useCallback((u="instant")=>{const p=n.current;p&&(u==="instant"?p.scrollTop=p.scrollHeight:hu(p,p.scrollHeight-p.clientHeight,170),o.current=!0,t(!0))},[]),c=a.useCallback(()=>{o.current=!1},[]);return a.useEffect(()=>{const u=n.current;if(!u)return;const p=()=>s(),d=new MutationObserver(()=>{o.current&&(cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{u.scrollTop=u.scrollHeight}))});return u.addEventListener("scroll",p,{passive:!0}),d.observe(u,{childList:!0,subtree:!0,characterData:!0}),()=>{u.removeEventListener("scroll",p),d.disconnect(),cancelAnimationFrame(r.current)}},[s]),{scrollRef:n,isAtBottom:e,scrollToBottom:l,stopScroll:c}}function hu(n,e,t){const o=n.scrollTop,r=e-o,s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1),d=1-Math.pow(1-p,3);n.scrollTop=o+r*d,p<1&&requestAnimationFrame(l)}requestAnimationFrame(l)}function mu(n,e,t,o){a.useEffect(()=>{const r=n.current;if(!r||!o)return;t(),r.scrollTop=r.scrollHeight;let s=0,l=r.scrollHeight,c=0;function u(){if(r){if(c++,r.scrollHeight===l?s++:(s=0,l=r.scrollHeight,r.scrollTop=r.scrollHeight),s>=5||c>=90){e("instant");return}requestAnimationFrame(u)}}requestAnimationFrame(u)},[o,n,e,t])}function fu({children:n}){return i.jsx("div",{"data-slot":"aui_thread-content",children:n})}function yt(n){const e=/^[ \t]*(`{3,})([^\n`]*)[ \t]*$/.exec(n??"");return e?{ticks:e[1].length,tag:e[2]}:null}function vi(n,e){if(/^🛠️ Tool:/.test(n))return!0;if(!(e!=null&&e.forToolResult)){const t=yt(n);if(t&&t.ticks>=5&&t.
Line truncated
|
||||
`),nextLine:l+1}}function wi(n,e){const t=yt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=wn(n,o,{forToolResult:!0}),s=Cn(n,o,r,t.ticks);return s<0?null:{body:n.slice(o,s).join(`
|
||||
`),nextLine:s+1}}function gu(n,e){if(xi(n,e))return null;const t=/^🛠️ Tool: `([^`]+)`/.exec(n[e]||"");if(!t)return null;const o=yt(n[e+1]);let r,s;if(o&&o.tag==="text"){if(r=e+2,s=wn(n,r),Cn(n,r,s,o.ticks)>=0)return null}else{r=e+1,s=n.length;for(let l=e+1;l<n.length;l++)if(vi(n[l])){s=l;break}}return{name:t[1],body:n.slice(r,s).join(`
|
||||
`),nextLine:s,inFlight:!0}}function yu(n,e){if(wi(n,e))return null;const t=yt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=wn(n,o,{forToolResult:!0});return Cn(n,o,r,t.ticks)>=0?null:{body:n.slice(o,r).join(`
|
||||
`),nextLine:r,inFlight:!0}}function bu(n){return n.replace(/^\s*\**LLM Running \(Turn \d+\) \.\.\.\**\s*/i,"")}function vu(n,e){const t=String(n||"").split(`
|
||||
`),o=[];let r=0,s=0;const l=c=>{c<=r||(o.push(t.slice(r,c).join(`
|
||||
`)),r=c)};for(;s<t.length;){const c=xi(t,s);if(c){l(s),o.push(e.onTool(c.name,c.body)),s=c.nextLine,r=s;continue}const u=wi(t,s);if(u){l(s),o.push(e.onResult(u.body)),s=u.nextLine,r=s;continue}const p=gu(t,s);if(p){l(s),o.push(e.onTool(p.name,p.body,{inFlight:!0})),s=p.nextLine,r=s;continue}const d=yu(t,s);if(d){l(s),o.push(e.onResult(d.body,{inFlight:!0})),s=d.nextLine,r=s;continue}s++}return l(t.length),o.join("")}function xu(n){const e=n.split(`
|
||||
`),t=[];let o=!1;for(const r of e){if(/candidates:/i.test(r)){o=!0;continue}if(o){const s=/^\s*-\s*(.+)/.exec(r);s&&t.push(s[1].trim())}}if(t.length===0)try{const r=JSON.parse(n);if(Array.isArray(r==null?void 0:r.candidates))return r.candidates.map(String)}catch{}return t}function wu(n){const e=n.split(`
|
||||
`),t=[];for(const o of e){if(/candidates:/i.test(o))break;const r=o.replace(/^["{\s]*question[":\s]*/i,"").replace(/[",}\s]*$/,"");r&&t.push(r)}if(t.length>0)return t.join(`
|
||||
`);try{const o=JSON.parse(n);if(o!=null&&o.question)return String(o.question)}catch{}return n.trim()}function To(n){const e=[];let t=bu(n);const o=[];t=t.replace(/<thinking>([\s\S]*?)<\/thinking>/gi,(u,p)=>(o.push(p),`
|
||||
§§THINK:${o.length-1}§§
|
||||
`));const r=[];t=t.replace(/<summary>([\s\S]*?)<\/summary>/gi,(u,p)=>(r.push(p),`
|
||||
§§SUMMARY:${r.length-1}§§
|
||||
`));const s=[],l=[];t=vu(t,{onTool(u,p,d){return s.push({name:u,body:p,inFlight:d==null?void 0:d.inFlight}),`
|
||||
§§TOOL:${s.length-1}§§
|
||||
`},onResult(u,p){return l.push({body:u,inFlight:p==null?void 0:p.inFlight}),`
|
||||
§§RESULT:${l.length-1}§§
|
||||
`}}),t=t.replace(/<function_calls>[\s\S]*?<\/function_calls>/gi,u=>(s.push({name:"function_call",body:u}),`
|
||||
§§TOOL:${s.length-1}§§
|
||||
`)),t=t.replace(/<function_results>[\s\S]*?<\/function_results>/gi,u=>(l.push({body:u}),`
|
||||
§§RESULT:${l.length-1}§§
|
||||
`));const c=t.split(/\n?(§§(?:THINK|TOOL|RESULT|SUMMARY):\d+§§)\n?/);for(const u of c){const p=/^§§THINK:(\d+)§§$/.exec(u);if(p){e.push({type:"thinking",content:o[Number(p[1])]});continue}const d=/^§§TOOL:(\d+)§§$/.exec(u);if(d){const y=s[Number(d[1])];if(y.name==="ask_user"){const S=xu(y.body),w=wu(y.body);e.push({type:"approval",content:w,candidates:S})}else e.push({type:"tool",content:y.body,label:y.name,inFlight:y.inFlight});continue}const m=/^§§RESULT:(\d+)§§$/.exec(u);if(m){const y=l[Number(m[1])];e.push({type:"result",content:y.body,inFlight:y.inFlight});continue}const f=/^§§SUMMARY:(\d+)§§$/.exec(u);if(f){e.push({type:"summary",content:r[Number(f[1])]});continue}const b=u.trim();b&&e.push({type:"prose",content:b})}return e}function Hr(n){return n.map((e,t)=>{const o=To(e),r=o.reduce((s,l)=>s+l.content.length,0);return{index:t,segments:o,weight:r}})}function Cu(n){const e=[];let t=0;for(;t<n.length;){const o=n[t];if(o.role==="user"){const r=n[t+1];if(r&&r.role==="assistant"){const s=r.turn_segs??(r.content?[r.content]:[]),l=Hr(s);e.push({kind:"turn",userMsg:o,assistantMsg:r,turns:l}),t+=2}else e.push({kind:"standalone",msg:o}),t++}else{if(o.role==="assistant"){const r=o.turn_segs??(o.content?[o.content]:[]),s=Hr(r);e.push({kind:"turn",userMsg:{id:"__synthetic__",role:"user",content:"",status:"completed"},assistantMsg:o,turns:s})}else e.push({kind:"standalone",msg:o});t++}}return e}const Xe=[{id:"plan",title:"Plan",desc:{en:"Explore, plan, execute, verify",zh:"探索、规划、执行、验证"},prompt:"Enter Plan mode: read memory/plan_sop.md, follow Explore → Plan → Execute → Verify flow for the task I describe next."},{id:"goal",title:"Goal",desc:{en:"Achieve a specific objective autonomously",zh:"自主达成指定目标"},prompt:"Enter Goal mode: read L3 goal mode SOP, autonomously achieve the goal I describe next."},{id:"autonomous",title:"Autonomous",desc:{en:"Select tasks and execute independently",zh:"自主选取任务并独立执行"},prompt:"Enter autonomous mode: read memory/autonomous_operation_sop.md, select or plan tasks, execute independently and produce a report."},{id:"hive",title:"Hive",desc:{en:"Multi-agent parallel collaboration",zh:"多 agent 并行协作"},prompt:"Start Goal Hive mode: follow hive SOP, spawn multiple workers to collaboratively achieve my next goal."},{id:"review",title:"Review",desc:{en:"Critical review of latest output",zh:"对最近产出做严格复核"},prompt:"Enter reviewer mode: rigorously critique the latest output, check each item and report issues."},{id:"findwork",title:"Find Work",desc:{en:"Analyze context, suggest next tasks",zh:"分析当前情况,推荐下一步"},prompt:"Analyze my situation using the autonomous planning approach, generate a batch of TODOs that would interest me."}];function Su(n){for(const e of Xe)if(n.startsWith(e.prompt)){const t=n.slice(e.prompt.length).trimStart();return{id:e.id,rest:t}}return null}function ku(n){return n?n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`:""}function ju(n){var t;const e=((t=n.split(".").pop())==null?void 0:t.toLowerCase())||"";return["js","ts","tsx","jsx","py","rs","go","c","cpp","java"].includes(e)?"◇":["json","yaml","yml","toml","xml"].includes(e)?"{}":["md","txt","log","csv"].includes(e)?"¶":["pdf"].includes(e)?"⊞":"◎"}function Eu({text:n}){const[e,t]=a.useState(!1),o=a.useRef(),r=a.useCallback(s=>{s.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{t(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>t(!1),2e3)})},[n]);return typeof navigator>"u"||!navigator.clipboard?null:i.jsx("button",{"data-slot":"user-bubble-copy",onClick:r,title:e?"Copied":"Copy",children:e?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M3 8.5l3 3 7-7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"5.5",y:"5.5",width:"7",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M3.5 10.5v-7a1 1 0 011-1h7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})})}const Ci=a.memo(function({content:e,msgId:t,images:o,files:r}){const s=a.useRef(null),[l,c]=a.useState(!1),[u,p]=a.useState(!1),d=a.useRef(!1);if(d.current=u,a.useLayoutEffect(()=>{const f=s.current;if(!f)return;const b=new ResizeObserver(()=>{d.current||c(f.scrollHeight>f.clientHeight+2)});return b.observe(f),()=>b.disconnect()},[]),!e&&(!o||o.length===0)&&(!r||r.length===0))return null;const m=Su(e);return i.jsxs(i.Fragment,{children:[o&&o.length>0&&i.jsx("div",{"data-slot":"user-images",children:o.map((f,b)=>i.jsx("img",{"data-slot":"user-image-thumb",src:f.path.startsWith("data:")?f.path:`${ee}/upload/raw?path=${encodeURIComponent(f.path)}`,alt:f.name},b))}),r&&r.length>0&&i.jsx("div",{"data-slot":"user-files",children:r.map((f,b)=>i.jsxs("div
Line truncated
|
||||
|
||||
`)},[]);return i.jsxs("div",{"data-slot":"aui_assistant-message-root","data-role":"assistant","data-streaming":t||void 0,children:[i.jsx($u,{segments:o,isStreaming:t,messageId:String(e.id)}),i.jsx(Au,{getMessageText:s})]})}),zu=a.memo(function({userMsg:e,assistantMsg:t,isStreaming:o}){return i.jsxs("div",{"data-slot":"aui_turn-pair",children:[i.jsx(Ci,{content:e.content,msgId:e.id,images:e.images,files:e.files}),i.jsx(Fu,{message:t,isStreaming:o})]})}),Bu=[{pattern:/invalid.?api.?key|api.?key.?invalid|Incorrect API key/i,key:"err.apiKeyInvalid"},{pattern:/model.*not found|does not exist|model_not_found/i,key:"err.modelNotFound"},{pattern:/rate.?limit|429|Too Many Requests/i,key:"err.rateLimit"},{pattern:/quota|insufficient.?funds|balance|billing/i,key:"err.quotaExceeded"},{pattern:/timed?\s*out|TimeoutError/i,key:"err.timeout"},{pattern:/Connection\s*refused|ConnectionRefusedError/i,key:"err.connRefused"},{pattern:/errno 48|address already in use/i,key:"err.portBusy"},{pattern:/Traceback|Exception.*thread|exit code \d+/i,key:"err.processCrash"}];function Uu(n,e){if(!n)return"";for(const t of Bu)if(t.pattern.test(n))return e(t.key);return n.length<=80?n:n.slice(0,77)+"…"}const Vu=a.memo(function({error:e,msgId:t}){const{t:o}=ce(),r=Uu(e,o);return i.jsx("div",{className:"ga-inline-error",role:"alert",id:`msg-${t}`,children:i.jsx("span",{className:"ga-inline-error-text",children:r})})}),Ku=300;function Wu(n){return n.kind==="turn"?n.turns.reduce((e,t)=>e+t.segments.length,0):1}const Hu=a.memo(function({messages:e,isRunning:t,budgetMultiplier:o,onShowEarlier:r,scrollRef:s}){const l=a.useMemo(()=>Cu(e),[e]),c=a.useRef(null),u=a.useMemo(()=>{if(!isFinite(o))return 0;const f=Ku*o;let b=0;for(let y=l.length-1;y>=0;y--)if(b+=Wu(l[y]),b>f)return y+1;return 0},[l,o]),p=a.useMemo(()=>l.slice(u),[l,u]),d=u;a.useLayoutEffect(()=>{c.current!==null&&(s!=null&&s.current)&&(s.current.scrollTop=s.current.scrollHeight-c.current,c.current=null)});const m=()=>{const f=s==null?void 0:s.current;f&&(c.current=f.scrollHeight-f.scrollTop),r()};return e.length===0?i.jsx("div",{"data-slot":"thread-empty",children:i.jsx("p",{children:"Send a message to begin."})}):i.jsxs(i.Fragment,{children:[d>0&&i.jsxs("button",{"data-slot":"show-earlier-btn",onClick:m,children:["Show ",d," earlier messages"]}),p.map((f,b)=>{const y=u+b;return f.kind==="turn"?i.jsx(zu,{userMsg:f.userMsg,assistantMsg:f.assistantMsg,isStreaming:t&&y===l.length-1},f.assistantMsg.id):f.msg.role==="user"?i.jsx("div",{"data-slot":"aui_turn-pair",children:i.jsx(Ci,{content:f.msg.content,msgId:f.msg.id,images:f.msg.images,files:f.msg.files})},f.msg.id):f.msg.role==="error"?i.jsx(Vu,{error:f.msg.content,msgId:f.msg.id},f.msg.id):i.jsx("div",{"data-slot":"standalone-message","data-status":f.msg.status,children:f.msg.content},f.msg.id)})]})}),Qr=3,Yr=40,Zu=170,Xr=12;function Jr(n){const e=n.replace(/\s+/g," ").trim();return e.length<=Yr?e:e.slice(0,Yr)+"…"}function qu(n){return 1-Math.pow(1-n,3)}let to=0;function Gu(n,e,t){cancelAnimationFrame(to);const o=n.scrollTop,r=e-o;if(Math.abs(r)<1)return;const s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1);n.scrollTop=o+r*qu(p),p<1&&(to=requestAnimationFrame(l))}to=requestAnimationFrame(l)}const Qu=a.memo(function({messages:e,stopScroll:t,onJumpToCollapsed:o}){const r=a.useMemo(()=>e.filter(y=>y.role==="user").map(y=>({id:y.id,content:y.content})),[e]),[s,l]=a.useState(null),[c,u]=a.useState(!1),p=a.useRef(null),d=a.useRef(0),m=a.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),f=a.useCallback(()=>{p.current=setTimeout(()=>{u(!1),p.current=null},150)},[]);a.useEffect(()=>{if(r.length<Qr)return;const y=document.querySelector('[data-slot="aui_thread-viewport"]');if(!y)return;function S(){if(d.current=0,!y)return;const C=y.getBoundingClientRect().top;let k=null;for(const _ of r){const x=document.getElementById(`msg-${_.id}`);if(!x)continue;if(x.getBoundingClientRect().top-C<=Xr)k=_.id;else break}!k&&r.length>0&&(k=r[0].id),k&&l(k)}function w(){d.current||(d.current=requestAnimationFrame(S))}return y.addEventListener("scroll",w,{passive:!0}),S(),()=>{y.removeEventListener("scroll",w),cancelAnimationFrame(d.current)}},[r]);const b=a.useCallback(y=>{const S=document.querySelector('[data-slot="aui_thread-viewport"]'),w=document.getElementById(`msg-${y}`);if(!w){o(y);return}if(!S)return;t();const _=(w.closest('[data-slot="aui_turn-pair"]')||w).offsetTop-Xr;Gu(S,_,Zu)},[t,o]);return r.length<Qr?null:i.jsx("nav",{"data-slot":"user-turn-rail","data-expanded":c||void 0,"aria-label":"User message navigation",children:i.jsxs("div",{"data-slot":"rail-hitarea",onMouseEnter:m,onMouseLeave:f,children:[i.jsx("div",{"data-slot":"rail-panel","aria-hidden":!c,children:r.map(y=>i.jsx("button",{"data-slot":"rail-panel-item","data-active":y.id===s||void 0,onClick:()=>b(y.id),children:Jr(y.content)},y.id))}),i.jsx("div",{"data-slot":"rail-marks",children:r.map(y=>i.jsx("button",{"data-slot":"rail-mark","data-a
Line truncated
|
||||
`;else{const o=Ro(t);o&&(e+=`
|
||||
`+o)}return e}function Xu(n){const e=Array.from(n.childNodes);for(const t of e)if(t instanceof HTMLElement){if(t.dataset.refText||t.tagName==="BR")continue;if(t.tagName==="DIV"||t.tagName==="P"){const o=document.createElement("br");for(n.insertBefore(o,t);t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}}n.normalize()}function ji(n){const e=document.createRange();e.selectNodeContents(n),e.collapse(!1);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function es(n,e){n.focus();const t=window.getSelection();if(!t||t.rangeCount===0){n.appendChild(e);return}const o=t.getRangeAt(0);o.deleteContents(),o.insertNode(e),o.setStartAfter(e),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}function Ju(n,e){n.textContent=e,ji(n)}function e0(n,e,t){const o=document.createElement("span");return o.contentEditable="false",o.dataset.refText=`@${n}:\`${e}\``,o.dataset.refKind=n,o.className="ref-chip",o.innerHTML=`<span class="ref-chip-icon">${s0(n)}</span><span class="ref-chip-label">${r0(t||e)}</span>`,o}function t0(n,e,t,o){const r=e0(e,t,o);es(n,r);const s=document.createTextNode(" ");es(n,s)}function n0(n,e){const t=document.createElement("span");return t.contentEditable="false",t.dataset.refText=e,t.dataset.skillId=n,t.className="skill-chip",t.textContent=`/${n}`,t}function o0(n,e,t){n.textContent="";const o=n0(e,t);n.appendChild(o);const r=document.createTextNode(" ");n.appendChild(r),ji(n)}function r0(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function s0(n){switch(n){case"file":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z" stroke="currentColor" stroke-width="1.2"/><path d="M9 2v4h4" stroke="currentColor" stroke-width="1.2"/></svg>';case"url":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';case"image":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><rect x="2" y="2" width="12" height="12" rx="1" stroke="currentColor" stroke-width="1.2"/><circle cx="5.5" cy="5.5" r="1" fill="currentColor"/><path d="M2 11l3-3 2 2 3-3 4 4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';default:return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><circle cx="8" cy="8" r="5" stroke="currentColor" stroke-width="1.2"/></svg>'}}const i0=a.forwardRef(function({placeholder:e,disabled:t,onInput:o,onKeyDown:r,onSlashTrigger:s,onSlashDismiss:l,onAtTrigger:c,onAtDismiss:u,onPasteFiles:p},d){const m=a.useRef(null),f=a.useRef(!1),b=a.useRef("");a.useImperativeHandle(d,()=>({focus(){var x;(x=m.current)==null||x.focus()},clear(){m.current&&(m.current.textContent="",b.current="")},getText(){return m.current?Ro(m.current):""},setText(x){m.current&&(Ju(m.current,x),b.current=x,o(x))},insertChip(x,j,v){m.current&&(m.current.focus(),t0(m.current,x,j,v),y())},setSkillChip(x,j){m.current&&(o0(m.current,x,j),y())},getElement(){return m.current}}));const y=a.useCallback(()=>{if(!m.current)return;const x=Ro(m.current);b.current=x,o(x);const j=x.trimStart();j.startsWith("/")&&!j.includes(`
|
||||
`)?s==null||s(j.slice(1)):l==null||l();const v=x.match(/@([^\s@]*)$/);v?c==null||c(v[1]):u==null||u()},[o,s,l,c,u]),S=a.useCallback(()=>{f.current||(m.current&&Xu(m.current),y())},[y]),w=a.useCallback(()=>{f.current=!0},[]),C=a.useCallback(()=>{f.current=!1,S()},[S]),k=a.useCallback(x=>{f.current||x.nativeEvent.isComposing||x.keyCode===229||r(x)},[r]),_=a.useCallback(x=>{var E;const j=(E=x.clipboardData)==null?void 0:E.items;if(!j)return;const v=[];for(const D of Array.from(j))if(D.type.startsWith("image/")&&D.type!=="image/svg+xml"){const P=D.getAsFile();P&&v.push(P)}if(v.length>0){x.preventDefault(),p==null||p(v);return}const O=x.clipboardData.getData("text/plain");O&&(x.preventDefault(),document.execCommand("insertText",!1,O))},[p]);return a.useEffect(()=>{const x=m.current;if(!x)return;const j=new ResizeObserver(v=>{var E,D,P;const O=((P=(D=(E=v[0])==null?void 0:E.borderBoxSize)==null?void 0:D[0])==null?void 0:P.blockSize)??x.offsetHeight;x.style.setProperty("--editor-scroll-height",`${O}px`)});return j.observe(x),()=>j.disconnect()},[]),i.jsx("div",{ref:m,"data-slot":"composer-rich-input",contentEditable:!t,role:"textbox","aria-multiline":"true","aria-placeholder":e,"data-placeholder":e,suppressContentEditableWarning:!0,onInput:S,onKeyDown:k,onCompositionStart:w,onCompositionEnd:C,onPaste:_})});function a0(){try{const n=localStorage.getItem("ga_custom_presets");return n?JSON.parse(n):[]}catch{return[]}}function l0({visible:n,query:e,onSelect:t,onClose:o}){const r=H(m=>m.lang),[s,l]=a.useState(0),c=a.useRef(null),u=a0(),p=[...Xe,...u],d=e?p.filter(m=>m.id.startsWith(e.toLowerCase())||m.title.toLowerCase().includes(e.toLowerCase())):p;return a.useEffect(()=>{l(0)},[e]),a.useEffect(()=>{if(!n)return;function m(f){f.key==="ArrowDown"?(f.preventDefault(),l(b=>Math.min(b+1,d.length-1))):f.key==="ArrowUp"?(f.preventDefault(),l(b=>Math.max(b-1,0))):f.key==="Enter"?(f.preventDefault(),d[s]&&t(d[s].id,d[s].prompt)):f.key==="Escape"&&(f.preventDefault(),o())}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[n,s,d,t,o]),a.useEffect(()=>{if(!c.current)return;const m=c.current.querySelector("[data-focused]");m==null||m.scrollIntoView({block:"nearest"})},[s]),!n||d.length===0?null:i.jsx("div",{ref:c,"data-slot":"completion-drawer",children:d.map((m,f)=>i.jsx("button",{"data-slot":"completion-item","data-focused":f===s?"":void 0,onClick:()=>t(m.id,m.prompt),onMouseEnter:()=>l(f),children:i.jsxs("span",{"data-slot":"completion-info",children:[i.jsxs("span",{"data-slot":"completion-title",children:["/",m.id]}),i.jsx("span",{"data-slot":"completion-desc",children:m.desc[r]||m.desc.en})]})},m.id))})}const c0=[{id:"file",label:"file"},{id:"url",label:"url"},{id:"image",label:"image"}];function d0({visible:n,query:e,onConfirm:t,onClose:o}){const r=a.useRef(null),[s,l]=a.useState("file"),[c,u]=a.useState("");a.useEffect(()=>{n&&(u(e),l("file"),setTimeout(()=>{var d;return(d=r.current)==null?void 0:d.focus()},0))},[n,e]),a.useEffect(()=>{if(!n)return;function d(m){m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),o())}return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[n,o]);const p=a.useCallback(d=>{d.preventDefault();const m=c.trim();m&&t(s,m)},[s,c,t]);return n?i.jsx("div",{"data-slot":"at-ref-popover",children:i.jsxs("form",{onSubmit:p,"data-slot":"at-ref-form",children:[i.jsx("div",{"data-slot":"at-ref-kinds",children:c0.map(d=>i.jsx("button",{type:"button","data-slot":"at-ref-kind-btn","data-active":d.id===s?"":void 0,onClick:()=>l(d.id),title:d.label,children:i.jsx(u0,{kind:d.id})},d.id))}),i.jsx("input",{ref:r,"data-slot":"at-ref-input",type:"text",value:c,onChange:d=>u(d.target.value),placeholder:s==="url"?"https://...":"path/to/file"}),i.jsx("button",{type:"submit","data-slot":"at-ref-confirm",disabled:!c.trim(),children:"↵"})]})}):null}function u0({kind:n}){switch(n){case"file":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("path",{d:"M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M9 2v4h4",stroke:"currentColor",strokeWidth:"1.2"})]});case"url":return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})});case"image":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("circle",{cx:"5.5",cy:"5.5",r:"1",fill:"currentColor"}),i.jsx("path",{d:"M2 11l3-3 2 2 3-3 4 4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});default:return null}}const ts={title:{zh:"附加",en:"Attach"},file:{zh:"文件…",en:"File…"},image:{zh:"图片…",en:"Image…"},paste:
Line truncated
|
||||
|
||||
`)})]})})]})}return this.props.children}}async function bm(){const n=document.getElementById("app");xa.createRoot(n).render(i.jsx(ym,{children:i.jsx(gm,{})}))}bm();export{Zn as A,ee as B,ja as C,Re as D,li as E,ut as F,ae as G,bi as H,Za as I,pu as J,H as K,Ih as L,re as M,ph as N,Ee as O,G as P,za as Q,et as R,Sm as S,Ae as T,km as U,Fa as V,$o as W,Io as _,jm as a,ce as b,ri as c,Ts as d,Zo as e,_i as f,hl as g,Ie as h,Om as i,Lo as j,Xl as k,gt as l,Ve as m,X as n,Dl as o,Bl as p,Fl as q,Al as r,Qt as s,wl as t,_s as u,zl as v,Kl as w,Tl as x,Wl as y,hn as z};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
*{box-sizing:border-box;margin:0;padding:0}.no-transition,.no-transition *,.no-transition *:before,.no-transition *:after{transition:none!important;animation:none!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--semi-color-fill-2);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--semi-color-fill-1)}@font-face{font-family:codicon;src:url(/assets/codicon-DjkITdqj.ttf) format("truetype");font-weight:400;font-style:normal}.codicon{font-family:codicon;font-weight:400;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:root{--font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;--foreground: hsl(0 0% 8%);--background: hsl(0 0% 100%);--ui-text-secondary: hsl(0 0% 30%);--ui-text-tertiary: hsl(0 0% 48%);--ui-text-quaternary: hsl(0 0% 60%);--ui-icon-nav: hsl(0 0% 24%);--ui-icon-nav-active: hsl(0 0% 8%);--theme-primary: hsl(220 80% 50%);--ui-row-hover-background: hsl(0 0% 95%);--ui-row-active-background: hsl(0 0% 92%);--ui-control-hover-background: hsl(0 0% 95%);--ui-control-active-background: hsl(0 0% 90%);--ui-sidebar-surface-background: hsl(0 0% 100%);--ui-stroke-tertiary: hsl(0 0% 88%);--sidebar-edge-border: hsl(0 0% 86%);--ui-accent: hsl(220 80% 50%);--chrome-action-hover: hsl(0 0% 93%);--dt-card: hsl(0 0% 100%);--dt-background: hsl(0 0% 97%);--ui-chat-surface-background: hsl(0 0% 100%);--ui-chat-bubble-background: hsl(0 0% 96%);--ui-stroke-secondary: hsl(0 0% 78%);--ui-tooltip-surface: #17181b;--ui-tooltip-text: #fff}[data-appearance=dark]{--foreground: hsl(0 0% 95%);--background: hsl(240 3% 7.5%);--ui-text-secondary: hsl(0 0% 78%);--ui-text-tertiary: hsl(0 0% 60%);--ui-text-quaternary: hsl(0 0% 48%);--ui-icon-nav: hsl(0 0% 72%);--ui-icon-nav-active: hsl(0 0% 95%);--theme-primary: hsl(220 80% 68%);--ui-row-hover-background: hsl(220 3% 15%);--ui-row-active-background: hsl(220 3% 18%);--ui-control-hover-background: hsl(220 3% 16%);--ui-control-active-background: hsl(220 3% 22%);--ui-sidebar-surface-background: hsl(210 3% 12%);--ui-stroke-tertiary: hsl(220 3% 22%);--sidebar-edge-border: hsl(220 3% 20%);--ui-accent: hsl(220 80% 68%);--chrome-action-hover: hsl(220 3% 18%);--dt-card: hsl(220 3% 14%);--dt-background: hsl(240 3% 7.5%);--ui-chat-surface-background: hsl(240 3% 7.5%);--ui-chat-bubble-background: hsl(220 3% 14%);--ui-stroke-secondary: hsl(220 3% 32%)}html,body,#app{height:100%;width:100%;overflow:hidden;font-family:var(--font-sans)}body{background:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.semi-tooltip-wrapper{padding:5px 8px;background-color:var(--ui-tooltip-surface);color:var(--ui-tooltip-text);font-family:var(--font-sans);font-size:12px;line-height:18px}.semi-tooltip-wrapper .semi-tooltip-icon-arrow{color:var(--ui-tooltip-surface)}button,input,select,textarea{font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;color:inherit}[data-appearance=dark] body{color-scheme:dark}[data-slot=model-chip-label],[data-slot=model-menu-name],.ga-model-name,.ga-mixin-member-name{font-family:var(--font-mono)}.ga-root-error{width:min(100%,620px);min-height:100%;margin:0 auto;padding:48px 32px;overflow:auto;color:var(--semi-color-text-0)}.ga-root-error-result.semi-empty{padding:32px 0 18px}.ga-root-error-details{margin-top:18px;border-top:1px solid var(--semi-color-border)}.ga-root-error-details .semi-collapse-header{padding-inline:4px;color:var(--semi-color-text-2)}.ga-root-error-details .semi-typography{margin-top:0}.ga-root-error-details pre{max-height:280px;margin:0;padding:14px;overflow:auto;border:1px solid var(--semi-color-border);border-radius:var(--semi-border-radius-medium);outline:none;background:var(--semi-color-fill-0);color:var(--semi-color-text-1);font:12px/1.55 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text}.ga-root-error-details pre:focus-visible{border-color:var(--semi-color-primary);box-shadow:0 0 0 2px var(--semi-color-primary-light-default)}@keyframes semi-input-active{0%{transform:scale(1)}to{transform:scale(.97)}}@keyframes semi-input-inactive{0%{transform:scale(.97)}to{transform:scale(1)}}.semi-input{transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);transform:scale(var(--semi-transform_scale-none))}.semi-input-wrapper{display:inline-block;position:relative;vertical-align:middle;box-shadow:none;font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Segoe UI,Line truncated
|
||||
*{box-sizing:border-box;margin:0;padding:0}.no-transition,.no-transition *,.no-transition *:before,.no-transition *:after{transition:none!important;animation:none!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--semi-color-fill-2);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--semi-color-fill-1)}@font-face{font-family:codicon;src:url(/assets/codicon-DjkITdqj.ttf) format("truetype");font-weight:400;font-style:normal}.codicon{font-family:codicon;font-weight:400;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:root{--font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;--foreground: hsl(0 0% 8%);--background: hsl(0 0% 100%);--ui-text-secondary: hsl(0 0% 30%);--ui-text-tertiary: hsl(0 0% 48%);--ui-text-quaternary: hsl(0 0% 60%);--ui-icon-nav: hsl(0 0% 24%);--ui-icon-nav-active: hsl(0 0% 8%);--theme-primary: hsl(220 80% 50%);--ui-row-hover-background: hsl(0 0% 95%);--ui-row-active-background: hsl(0 0% 92%);--ui-control-hover-background: hsl(0 0% 95%);--ui-control-active-background: hsl(0 0% 90%);--ui-sidebar-surface-background: hsl(0 0% 100%);--ui-stroke-tertiary: hsl(0 0% 88%);--sidebar-edge-border: hsl(0 0% 86%);--ui-accent: hsl(220 80% 50%);--chrome-action-hover: hsl(0 0% 93%);--dt-card: hsl(0 0% 100%);--dt-background: hsl(0 0% 97%);--ui-chat-surface-background: hsl(0 0% 100%);--ui-chat-bubble-background: hsl(0 0% 96%);--ui-stroke-secondary: hsl(0 0% 78%);--ui-tooltip-surface: #17181b;--ui-tooltip-text: #fff}[data-appearance=dark]{--foreground: hsl(0 0% 95%);--background: hsl(240 3% 7.5%);--ui-text-secondary: hsl(0 0% 78%);--ui-text-tertiary: hsl(0 0% 60%);--ui-text-quaternary: hsl(0 0% 48%);--ui-icon-nav: hsl(0 0% 72%);--ui-icon-nav-active: hsl(0 0% 95%);--theme-primary: hsl(220 80% 68%);--ui-row-hover-background: hsl(220 3% 15%);--ui-row-active-background: hsl(220 3% 18%);--ui-control-hover-background: hsl(220 3% 16%);--ui-control-active-background: hsl(220 3% 22%);--ui-sidebar-surface-background: hsl(210 3% 12%);--ui-stroke-tertiary: hsl(220 3% 22%);--sidebar-edge-border: hsl(220 3% 20%);--ui-accent: hsl(220 80% 68%);--chrome-action-hover: hsl(220 3% 18%);--dt-card: hsl(220 3% 14%);--dt-background: hsl(240 3% 7.5%);--ui-chat-surface-background: hsl(240 3% 7.5%);--ui-chat-bubble-background: hsl(220 3% 14%);--ui-stroke-secondary: hsl(220 3% 32%)}html,body,#app{height:100%;width:100%;overflow:hidden;font-family:var(--font-sans)}body{background:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.semi-tooltip-wrapper{padding:5px 8px;background-color:var(--ui-tooltip-surface);color:var(--ui-tooltip-text);font-family:var(--font-sans);font-size:12px;line-height:18px}.semi-tooltip-wrapper .semi-tooltip-icon-arrow{color:var(--ui-tooltip-surface)}button,input,select,textarea{font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;color:inherit}[data-appearance=dark] body{color-scheme:dark}[data-slot=model-chip-label],[data-slot=model-menu-name],.ga-model-name,.ga-mixin-member-name{font-family:var(--font-mono)}.ga-root-error{width:min(100%,620px);min-height:100%;margin:0 auto;padding:48px 32px;overflow:auto;color:var(--semi-color-text-0)}.ga-root-error-result.semi-empty{padding:32px 0 18px}.ga-root-error-details{margin-top:18px;border-top:1px solid var(--semi-color-border)}.ga-root-error-details .semi-collapse-header{padding-inline:4px;color:var(--semi-color-text-2)}.ga-root-error-details .semi-typography{margin-top:0}.ga-root-error-details pre{max-height:280px;margin:0;padding:14px;overflow:auto;border:1px solid var(--semi-color-border);border-radius:var(--semi-border-radius-medium);outline:none;background:var(--semi-color-fill-0);color:var(--semi-color-text-1);font:12px/1.55 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text}.ga-root-error-details pre:focus-visible{border-color:var(--semi-color-primary);box-shadow:0 0 0 2px var(--semi-color-primary-light-default)}@keyframes semi-input-active{0%{transform:scale(1)}to{transform:scale(.97)}}@keyframes semi-input-inactive{0%{transform:scale(.97)}to{transform:scale(1)}}.semi-input{transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);transform:scale(var(--semi-transform_scale-none))}.semi-input-wrapper{display:inline-block;position:relative;vertical-align:middle;box-shadow:none;font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Segoe UI,Line truncated
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPart-ZJKeOipX.js","assets/tauri-compat-D_GD_wMe.js","assets/tauri-compat-BTcpEvqB.css","assets/markdown-preprocess-Cc2i34eF.js","assets/markdown-preprocess-Cp579UoJ.css","assets/index-9FI8Jlf5.js","assets/index-D0pGtk0y.css","assets/WindowsTitlebar-Byi-SYR_.js","assets/WindowsTitlebar-U0YG9JNA.css","assets/MarkdownPart-Cp90Gu77.css","assets/SummaryPart-zs-In9mf.js","assets/ServicesPage-9DKyWUIu.js","assets/index-BkPDmlaQ.js","assets/index-D9Nakaf3.js","assets/index-DkG9Cu-r.css","assets/index-gTPS8Hpa.css","assets/IconFile-C8B3WX2U.js","assets/ServicesPage-Cbm5nbW7.css","assets/TokenPage-8X0HZ3hU.js","assets/Animation-DbFrgT1j.js","assets/index-C-iCGtYr.js","assets/index-ClU1uQYs.css","assets/TokenPage-DwLDOw_j.css","assets/CollabPage-DD4zkzQv.js","assets/CollabPage-CG38jm3S.css"])))=>i.map(i=>d[i]);
|
||||
var Mi=Object.defineProperty;var Li=(n,e,t)=>e in n?Mi(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var bt=(n,e,t)=>Li(n,typeof e!="symbol"?e+"":e,t);import{g as We,r as Ii,a as Ti,c as be,b as a,d as Ds,e as As,B as Re,_ as Be,f as ve,h as A,i as De,j as Ri,E as Ni,R as g,k as me,l as I,m as Ge,n as zs,P as h,w as Fs,o as So,p as Je,q as nn,s as an,t as To,u as $i,v as Di,x as Ai,y as zi,z as Fi,A as Bi,C as Ui,D as Vi,F as Ki,G as Wi,H as Bs,I as Hi,T as Ro,J as on,K as Zi,L as qi,M as Gi,N as Et,O as Us,Q as Vs,S as Ks,U as Ws,V as Qi,W as Hs,X as Zs,Y as ko,Z as Yi,$ as Xi,a0 as Ji,a1 as ea,a2 as ta,a3 as na,a4 as oa,a5 as ra,a6 as sa,a7 as ia,a8 as aa,a9 as la,aa as Zo,ab as Ae,ac as ca,ad as da,ae as Yt,af as ua,ag as pa,ah as jo,ai as ye,aj as i,ak as qs,al as ha,am as ma,an as fa,ao as qo,ap as ct,aq as ga,ar as ya,as as ba,at as va}from"./tauri-compat-D_GD_wMe.js";import{I as ln,a as Gs,b as Qs,c as Ys,B as de}from"./index-9FI8Jlf5.js";import{W as xa}from"./WindowsTitlebar-Byi-SYR_.js";const wa="modulepreload",Ca=function(n){return"/"+n},Go={},Zt=function(e,t,o){let r=Promise.resolve();if(t&&t.length>0){let l=function(p){return Promise.all(p.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(t.map(p=>{if(p=Ca(p),p in Go)return;Go[p]=!0;const d=p.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${m}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":wa,d||(f.as="script"),f.crossOrigin="",f.href=p,u&&f.setAttribute("nonce",u),document.head.appendChild(f),d)return new Promise((y,b)=>{f.addEventListener("load",y),f.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};function Qo(n,e){const t=e,o=new URL(t);if(o.protocol!=="http:"&&o.protocol!=="https:")throw new Error(`Service endpoint must use HTTP(S): ${t}`);return o.toString().replace(/\/+$/,"")}function Yo(n){const e=new URL(n);return e.protocol=e.protocol==="https:"?"wss:":"ws:",e.pathname=`${e.pathname.replace(/\/+$/,"")}/ws`,e.toString().replace(/\/$/,"")}function Sa(n){const e=Qo(n.VITE_BRIDGE_BASE,"http://127.0.0.1:14168"),t=Qo(n.VITE_CONDUCTOR_BASE,"http://127.0.0.1:8900");return{bridgeBase:e,conductorBase:t,wsUrl:Yo(e),conductorWsUrl:Yo(t)}}const cn=Sa({VITE_BRIDGE_BASE:void 0,VITE_CONDUCTOR_BASE:void 0}),ne=cn.bridgeBase,ka=cn.conductorBase,ja=cn.wsUrl,Ea=cn.conductorWsUrl,Oa=1e3,Pa=3e4;let je=null,Eo=0,Sn=null;const St=new Map;let Oo="offline";const Po=new Set;let Xo=!1;const _a=new Set;function kn(n){n!==Oo&&(Oo=n,n==="ready"&&(Xo||(Xo=!0,_a.forEach(e=>e()))),Po.forEach(e=>e(n)))}function Jo(){return Oo}function Xs(n){return Po.add(n),()=>{Po.delete(n)}}function Js(){if(!(je&&(je.readyState===WebSocket.OPEN||je.readyState===WebSocket.CONNECTING))){kn("connecting");try{je=new WebSocket(ja)}catch{er();return}je.onopen=()=>{Eo=0,kn("ready")},je.onmessage=n=>{try{const e=JSON.parse(n.data),t=e.type;if(!t)return;const o=St.get(t);o&&o.forEach(r=>r(e))}catch{}},je.onclose=()=>{je=null,kn("connecting"),er()},je.onerror=()=>{je==null||je.close()}}}function er(){if(Sn)return;const n=Math.min(Oa*2**Eo,Pa);Eo++,Sn=setTimeout(()=>{Sn=null,Js()},n)}function Ve(n,e){return St.has(n)||St.set(n,new Set),St.get(n).add(e),Js(),()=>{var t;(t=St.get(n))==null||t.delete(e)}}let tr=[];const Ma=new Set;let nr=!1;function La(){for(const n of Ma)n()}function jn(n){tr=[...tr.slice(-39),n],La()}function Ia(){nr||(nr=!0,Ve("session-state",n=>{const e=n;if(!e.sessionId||!e.status)return;const t=e.status==="running"?"Turn started":e.status==="idle"?"Turn complete":e.status==="error"?"Turn error":`Session ${e.status}`;jn(t)}),Ve("service.changed",n=>{const e=n;if(!e.service)return;const t=e.service.name??e.service.id??"service",o=e.service.status??"unknown";jn(`${t}: ${o}`)}),Ve("token.changed",n=>{const e=n;!e.session_id||!e.total_output||jn(`Token update: +${e.total_output} output`)}))}Ia();const ei=new Set(["http:","https:"]),Ta=new Set(["\\href","\\url"]),Ra=/^data:image\/(?:avif|gif|jpeg|png|webp);base64,[a-z0-9+/]+={0,2}$/i,Na=/^(?:\/|\.\/)?assets\//,$a=/%(?:2e|2f|5c)/i,ti=/[\u0000-\u001f\u007f]/;function No(n){const e=n.trim();if(!/^https?:\/\//i.test(e)||ti.test(e))return null;try{const t=new URL(e);return ei.has(t.protocol)?t.href:null}catch{return null}}function Da(n){if(!Na.test(n)||n.startsWith("//")||n.includes("\\")||$a.test(n))return null;try{const e=new URL(n,"https://genericagent.invalid/");return e.origin==="https://genericagent.invalid"&&e.pathname.startsWith("/assets/")?n:null}catch{return null}Line truncated
|
||||
/new 新会话 /clear 清屏 /stop 停止 /settings 设置`,"slash.unknown":"未知命令","upload.hint":"上传文件:选择 / 拖拽 / 粘贴","upload.button":"上传文件","upload.tooLarge":"文件过大或数量超限","upload.empty":"跳过空文件","upload.failed":"上传失败","err.charLimit":"已达字数上限({n}),发送时将自动截断","err.charLimitReached":"已达字数上限({n})","err.numMax":"不能超过 {n}","file.openFailed":"无法打开文件","file.kindGeneric":"文件","file.kindDoc":"文档","file.kindSheet":"表格","file.kindSlide":"幻灯片","file.kindCode":"代码","file.kindArchive":"压缩包","file.kindAudio":"音频","file.kindVideo":"视频","upload.removeTitle":"移除","upload.dropHint":"松开以上传文件","lightbox.closeTitle":"关闭","fold.thinking":"思考","fold.tool":"工具调用","fold.toolResult":"工具结果","fold.llm":"LLM Running","fold.turn":"第 {n} 轮","plan.header":"计划 ({done}/{total})","plan.complete":"✓ 计划完成 ({n}/{n})","plan.running":"计划执行中","plan.completeTitle":"计划完成","plan.placeholder":"计划模式已激活","plan.waiting":"等待写入 {path} …","plan.overflow":"还有 {n} 项","plan.current":"当前","plan.collapse":"收起","plan.expand":"展开","plan.details":"详情","plan.capsuleRunning":"运行中","plan.capsuleComplete":"已完成","timing.elapsed":"已运行 {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"微信","ch.wecom":"企业微信","ch.lark":"飞书","ch.dingtalk":"钉钉","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"加载中…","ch.empty":"未发现 IM 进程脚本","ch.logEmpty":"暂无日志","err.channelLoad":"加载失败","err.channelStart":"启动失败","err.channelStop":"停止失败","err.mykeyImport":"导入模型配置失败","err.mykeyExport":"导出模型配置失败","err.channelNotConfigured":"请先在密钥配置中完成该平台设置","sys.channelStarted":"已启动","sys.channelStopped":"已停止","sys.bridgeDisconnecting":"正在断开本地连接","modal.channelLogs":"进程日志","modal.mykeyConfig":"密钥配置","sys.configSaved":"配置已保存","sys.mykeyImported":"模型配置已导入","sys.mykeyExported":"模型配置已导出","st.starting":"启动中…","st.stopping":"停止中…","st.online":"在线","st.offline":"离线","st.error":"错误","st.running":"运行中","st.stopped":"已停止","st.abnormal":"异常","st.warning":"警告","err.portBusy":"端口被占用,已自动重连","err.conductorCrash":"内部线程异常退出","err.missingModule":"缺少依赖模块","err.connRefused":"连接被拒绝,将自动重试","err.timeout":"连接超时","err.apiKeyInvalid":"API Key 无效或已过期","err.modelNotFound":"模型不存在或不可用","err.rateLimit":"请求频率超限,请稍后重试","err.quotaExceeded":"额度不足","err.processCrash":"后台进程异常退出","act.configure":"配置","act.logs":"日志","act.restart":"重启","act.stop":"停止","act.start":"启动","act.disconnect":"断开","act.copy":"复制","act.copied":"已复制","act.copyTex":"TeX","act.send":"发送","proc.imbotWechat":"imbot · 微信","proc.imbotDing":"imbot · 钉钉","proc.bridge":"本地连接","proc.bridgeSummary":"连接桌面应用与本地运行环境","proc.bridgeTip":"保持桌面应用与本地运行环境通信","proc.scheduler":"定时任务","proc.schedulerSummary":"按计划自动执行任务","proc.schedulerTip":"在设定时间自动触发并执行任务","proc.conductor":"指挥家","proc.conductorSummary":"异步处理多步骤任务","proc.conductorTip":"通过异步对话拆解任务、分派执行,并持续跟进进度","proc.runtimeComponent":"运行组件","proc.runtimeComponentSummary":"本地运行环境中持续工作的组件","proc.runtimeComponentTip":"查看该组件的状态、日志与控制项","cm.scheduling":"调度中","cm.running":"执行中","cm.idleSt":"空闲","cm.master":"已派 3 子任务","cm.w1":"子任务:抓取数据","cm.w2":"子任务:复核结果","cm.sub":"等待派单","tok.total":"累计","tok.cost":"缓存率","tok.today":"今日","tok.tabAll":"会话","tok.tabConductor":"指挥家","tok.condTotal":"指挥家累计","tok.condCurrent":"指挥家本次","tok.condTip":"指挥家消耗不计入会话累计","tok.condOffline":"指挥家服务离线","tok.disclaimer":"不同 API 网站的计费价格可能会有差异,请以实际网站为准。","tok.colSession":"会话","tok.colIn":"输入","tok.colOut":"输出","tok.colCacheW":"缓存写入","tok.colCache":"缓存读取","tok.colCost":"成本","tok.from":"从","tok.to":"到","tok.reset":"重置","tok.noData":"暂无记录","tok.deleted":"此会话已删除","tok.pricingUnknown":"⚠ 此模型计费规则尚未明确,按默认估算","tok.priceInput":"输入: $","tok.priceOutput":"输出: $","tok.priceCacheW":"缓存写入: $","tok.priceCacheR":"缓存读取: $","presetPrompt.goal":"Line truncated
|
||||
/new new chat /clear clear /stop stop /settings settings`,"slash.unknown":"Unknown command","upload.hint":"Upload file: pick / drag / paste","upload.button":"Upload file","upload.tooLarge":"File too large or limit reached","upload.empty":"Skipped empty file","upload.failed":"Upload failed","err.charLimit":"Character limit reached ({n}), text will be truncated on send","err.charLimitReached":"Character limit reached ({n})","err.numMax":"Cannot exceed {n}","file.openFailed":"Cannot open file","file.kindGeneric":"File","file.kindDoc":"Document","file.kindSheet":"Spreadsheet","file.kindSlide":"Slides","file.kindCode":"Code","file.kindArchive":"Archive","file.kindAudio":"Audio","file.kindVideo":"Video","upload.removeTitle":"Remove","upload.dropHint":"Drop to upload files","lightbox.closeTitle":"Close","fold.thinking":"Thinking","fold.tool":"Tool call","fold.toolResult":"Tool result","fold.llm":"LLM Running","fold.turn":"Turn {n}","plan.header":"Plan ({done}/{total})","plan.complete":"✓ Plan complete ({n}/{n})","plan.running":"Running plan","plan.completeTitle":"Plan complete","plan.placeholder":"Plan mode activated","plan.waiting":"waiting for {path} …","plan.overflow":"+{n} more","plan.current":"Now","plan.collapse":"Collapse","plan.expand":"Expand","plan.details":"Details","plan.capsuleRunning":"Running","plan.capsuleComplete":"Done","timing.elapsed":"Elapsed {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"WeChat","ch.wecom":"WeCom","ch.lark":"Lark","ch.dingtalk":"DingTalk","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"Loading…","ch.empty":"No IM process scripts found","ch.logEmpty":"No log output yet","err.channelLoad":"Failed to load","err.channelStart":"Start failed","err.channelStop":"Stop failed","err.mykeyImport":"Failed to import model config","err.mykeyExport":"Failed to export model config","err.channelNotConfigured":"Complete this platform setup in Key configuration first","sys.channelStarted":"Started","sys.channelStopped":"Stopped","sys.bridgeDisconnecting":"Disconnecting from the local runtime","modal.channelLogs":"Process logs","modal.mykeyConfig":"Key configuration","sys.configSaved":"Configuration saved","sys.mykeyImported":"Model config imported","sys.mykeyExported":"Model config exported","st.starting":"Starting…","st.stopping":"Stopping…","st.online":"Online","st.offline":"Offline","st.error":"Error","st.running":"Running","st.stopped":"Stopped","st.abnormal":"Error","st.warning":"Warning","err.portBusy":"Port was busy, reconnected","err.conductorCrash":"Internal thread crashed","err.missingModule":"Missing module","err.connRefused":"Connection refused, retrying","err.timeout":"Connection timed out","err.apiKeyInvalid":"API key invalid or expired","err.modelNotFound":"Model not found or unavailable","err.rateLimit":"Rate limited, try again later","err.quotaExceeded":"Quota exceeded","err.processCrash":"Background process crashed","act.configure":"Configure","act.logs":"Logs","act.restart":"Restart","act.stop":"Stop","act.start":"Start","act.disconnect":"Disconnect","act.copy":"Copy","act.copied":"Copied","act.copyTex":"TeX","act.send":"Send","proc.imbotWechat":"imbot · WeChat","proc.imbotDing":"imbot · DingTalk","proc.bridge":"Local connection","proc.bridgeSummary":"Connects the desktop app to the local runtime","proc.bridgeTip":"Keeps the desktop app and local runtime communicating","proc.scheduler":"Scheduled tasks","proc.schedulerSummary":"Runs tasks on schedule","proc.schedulerTip":"Triggers and runs tasks at configured times","proc.conductor":"Conductor","proc.conductorSummary":"Handles multi-step work asynchronously","proc.conductorTip":"Uses async conversations to break down, delegate, and follow through on tasks","proc.runtimeComponent":"Runtime component","proc.runtimeComponentSummary":"A component that runs in the local environment","proc.runtimeComponentTip":"View this component’s status, logs, and controls","cm.scheduling":"Scheduling","cm.running":"Running","cm.idleSt":"Idle","cm.master":"Dispatched 3 subtasks","cm.w1":"Subtask: fetch data","cm.w2":"Subtask: review results","cm.sub":"Waiting for tasks","tok.total":"Total","tok.cost":"Cache rate","tok.today":"Today","tok.tabAll":"Chat","tok.tabConductor":"Conductor","tok.condTotal":"Conductor Total","tok.condCurrent":"Conductor Current","tok.condTip":"Conductor usage is not included in chat totals","tok.condOffline":"Service offline","tok.disclaimer":"Pricing may vary by API provider. Please refer to the actual website.","tok.colSession":"Session","tok.colIn":"Input","tok.colOut":"Output","tok.colCacheW":"Cache write","tok.colCache":"Cache read","tok.colCost":"Cost","tok.from":"From","tok.to":"To","tok.reset":"Reset","tok.noData":"No records","tok.deleted":"Session deleted","tok.pricingUnknown":"⚠ Pricing not confirmed, using defaults","tok.priceInput":"Input: $","tok.priceOutput":"Output: $","tok.priceCacheW":"Cache write: $","tok.priceCacheR":"Cache read: $","presetPromptLine truncated
|
||||
`)}),i.jsxs("div",{className:"ga-bridge-panel-section-foot",children:[_&&i.jsx("span",{className:"ga-bridge-panel-truncated",children:e("bridge.logLineCount",{count:m})}),i.jsxs("button",{className:"ga-bridge-panel-link-btn",onClick:k,children:[e("bridge.viewAllLogs")," →"]})]})]})]})}const uu=[{key:"services",icon:"symbol-misc",textKey:"nav.services"},{key:"collab",icon:"robot",textKey:"nav.collab"},{key:"token",icon:"graph",textKey:"nav.token"}];function pu(){const{activePage:n,setPage:e}=Te(),t=Z(O=>O.open),o=G(O=>O.newSession),r=G(O=>O.sessions),s=G(O=>O.activeSessionId),l=G(O=>O.setActiveSession),c=G(O=>O.runningSessions),{t:u}=he(),[p,d]=a.useState(!0),[m,f]=a.useState(""),[y,b]=a.useState(!1),[x,C]=a.useState(!1),S=a.useCallback(()=>b(!1),[]),k=a.useCallback(()=>{S(),t()},[S,t]),_=a.useCallback(()=>{C(!1),b(O=>!O)},[]),v=[...r].sort((O,D)=>{if(O.pinned&&!D.pinned)return-1;if(!O.pinned&&D.pinned)return 1;const P=Number(O.updatedAt||O.createdAt||0);return Number(D.updatedAt||D.createdAt||0)-P}),j=m.trim()?v.filter(O=>O.title.toLowerCase().includes(m.trim().toLowerCase())):v;function w(){o(),e("chat")}function E(O){l(O),e("chat")}return i.jsxs("div",{className:"ga-left-sidebar",children:[i.jsxs("nav",{className:"ga-nav-rail","aria-label":"Main navigation",children:[i.jsxs("button",{type:"button",className:"ga-nav-btn",onClick:w,"aria-label":u("nav.chat"),children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Pe,{name:"comment",size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u("nav.chat")})]}),uu.map(O=>i.jsxs("button",{type:"button",className:`ga-nav-btn${n===O.key?" active":""}`,onClick:()=>e(O.key),"aria-label":u(O.textKey),"aria-current":n===O.key?"page":void 0,children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Pe,{name:O.icon,size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u(O.textKey)})]},O.key))]}),i.jsx("div",{className:"ga-sidebar-search",children:i.jsx(dt,{prefix:i.jsx(ni,{style:{fontSize:14}}),placeholder:u("search.placeholder"),size:"small",value:m,onChange:f})}),!m&&i.jsx(Bd,{label:u("section.sessions"),count:r.length,open:p,onToggle:d,onAction:w}),i.jsx("div",{className:"ga-session-section",children:(m||p)&&(j.length===0?i.jsx("div",{className:"ga-session-empty",children:i.jsx("p",{children:u(m?"search.noResults":"conv.emptyList")})}):i.jsx("div",{className:"ga-session-list",children:j.map(O=>i.jsx(Wd,{session:O,isActive:O.id===s,isWorking:c.has(O.id),onClick:()=>E(O.id)},O.id))}))}),i.jsxs("div",{className:"ga-sidebar-footer",children:[i.jsx(Ae,{content:u("foot.settings"),position:"top",clickToHide:!0,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:k,"aria-label":u("foot.settings"),children:i.jsx(Pe,{name:"settings-gear",size:"1rem"})})}),i.jsxs("div",{className:"ga-sidebar-footer-anchor",children:[i.jsx(Ae,{content:u("foot.runtimeManagement"),position:"top",visible:x&&!y,onVisibleChange:C,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:_,"aria-label":u("foot.runtimeManagement"),"aria-expanded":y,"aria-haspopup":"dialog","aria-controls":"ga-runtime-management-panel",children:i.jsx(Pe,{name:"server-process",size:"1rem"})})}),y&&i.jsx(du,{onClose:S})]})]})]})}const hu=24;function mu(){const n=a.useRef(null),[e,t]=a.useState(!0),o=a.useRef(!0),r=a.useRef(0),s=a.useCallback(()=>{const u=n.current;if(!u)return;const p=u.scrollHeight-u.scrollTop-u.clientHeight<hu;t(p),o.current=p},[]),l=a.useCallback((u="instant")=>{const p=n.current;p&&(u==="instant"?p.scrollTop=p.scrollHeight:fu(p,p.scrollHeight-p.clientHeight,170),o.current=!0,t(!0))},[]),c=a.useCallback(()=>{o.current=!1},[]);return a.useEffect(()=>{const u=n.current;if(!u)return;const p=()=>s(),d=new MutationObserver(()=>{o.current&&(cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{u.scrollTop=u.scrollHeight}))});return u.addEventListener("scroll",p,{passive:!0}),d.observe(u,{childList:!0,subtree:!0,characterData:!0}),()=>{u.removeEventListener("scroll",p),d.disconnect(),cancelAnimationFrame(r.current)}},[s]),{scrollRef:n,isAtBottom:e,scrollToBottom:l,stopScroll:c}}function fu(n,e,t){const o=n.scrollTop,r=e-o,s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1),d=1-Math.pow(1-p,3);n.scrollTop=o+r*d,p<1&&requestAnimationFrame(l)}requestAnimationFrame(l)}function gu(n,e,t,o){a.useEffect(()=>{const r=n.current;if(!r||!o)return;t(),r.scrollTop=r.scrollHeight;let s=0,l=r.scrollHeight,c=0;function u(){if(r){if(c++,r.scrollHeight===l?s++:(s=0,l=r.scrollHeight,r.scrollTop=r.scrollHeight),s>=5||c>=90){e("instant");return}requestAnimationFrame(u)}}requestAnimationFrame(u)},[o,n,e,t])}function yu({children:n}){return i.jsx("div",{"data-slot":"aui_thread-content",children:n})}function gt(n){const e=/^[ \t]*(`{3,})([^\n`]*)[ \t]*$/.exec(n??"");return e?{ticks:e[1].length,tag:e[2]}:null}function vi(n,e){if(/^🛠️ Tool:/.test(n))return!0;if(!(e!=null&&e.forToolResult)){const t=gt(n);if(t&&t.ticks>=5&&t.
Line truncated
|
||||
`),nextLine:l+1}}function wi(n,e){const t=gt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=vn(n,o,{forToolResult:!0}),s=xn(n,o,r,t.ticks);return s<0?null:{body:n.slice(o,s).join(`
|
||||
`),nextLine:s+1}}function bu(n,e){if(xi(n,e))return null;const t=/^🛠️ Tool: `([^`]+)`/.exec(n[e]||"");if(!t)return null;const o=gt(n[e+1]);let r,s;if(o&&o.tag==="text"){if(r=e+2,s=vn(n,r),xn(n,r,s,o.ticks)>=0)return null}else{r=e+1,s=n.length;for(let l=e+1;l<n.length;l++)if(vi(n[l])){s=l;break}}return{name:t[1],body:n.slice(r,s).join(`
|
||||
`),nextLine:s,inFlight:!0}}function vu(n,e){if(wi(n,e))return null;const t=gt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=vn(n,o,{forToolResult:!0});return xn(n,o,r,t.ticks)>=0?null:{body:n.slice(o,r).join(`
|
||||
`),nextLine:r,inFlight:!0}}function xu(n){return n.replace(/^\s*\**LLM Running \(Turn \d+\) \.\.\.\**\s*/i,"")}function wu(n,e){const t=String(n||"").split(`
|
||||
`),o=[];let r=0,s=0;const l=c=>{c<=r||(o.push(t.slice(r,c).join(`
|
||||
`)),r=c)};for(;s<t.length;){const c=xi(t,s);if(c){l(s),o.push(e.onTool(c.name,c.body)),s=c.nextLine,r=s;continue}const u=wi(t,s);if(u){l(s),o.push(e.onResult(u.body)),s=u.nextLine,r=s;continue}const p=bu(t,s);if(p){l(s),o.push(e.onTool(p.name,p.body,{inFlight:!0})),s=p.nextLine,r=s;continue}const d=vu(t,s);if(d){l(s),o.push(e.onResult(d.body,{inFlight:!0})),s=d.nextLine,r=s;continue}s++}return l(t.length),o.join("")}function Cu(n){const e=n.split(`
|
||||
`),t=[];let o=!1;for(const r of e){if(/candidates:/i.test(r)){o=!0;continue}if(o){const s=/^\s*-\s*(.+)/.exec(r);s&&t.push(s[1].trim())}}if(t.length===0)try{const r=JSON.parse(n);if(Array.isArray(r==null?void 0:r.candidates))return r.candidates.map(String)}catch{}return t}function Su(n){const e=n.split(`
|
||||
`),t=[];for(const o of e){if(/candidates:/i.test(o))break;const r=o.replace(/^["{\s]*question[":\s]*/i,"").replace(/[",}\s]*$/,"");r&&t.push(r)}if(t.length>0)return t.join(`
|
||||
`);try{const o=JSON.parse(n);if(o!=null&&o.question)return String(o.question)}catch{}return n.trim()}function Lo(n){const e=[];let t=xu(n);const o=[];t=t.replace(/<thinking>([\s\S]*?)<\/thinking>/gi,(u,p)=>(o.push(p),`
|
||||
§§THINK:${o.length-1}§§
|
||||
`));const r=[];t=t.replace(/<summary>([\s\S]*?)<\/summary>/gi,(u,p)=>(r.push(p),`
|
||||
§§SUMMARY:${r.length-1}§§
|
||||
`));const s=[],l=[];t=wu(t,{onTool(u,p,d){return s.push({name:u,body:p,inFlight:d==null?void 0:d.inFlight}),`
|
||||
§§TOOL:${s.length-1}§§
|
||||
`},onResult(u,p){return l.push({body:u,inFlight:p==null?void 0:p.inFlight}),`
|
||||
§§RESULT:${l.length-1}§§
|
||||
`}}),t=t.replace(/<function_calls>[\s\S]*?<\/function_calls>/gi,u=>(s.push({name:"function_call",body:u}),`
|
||||
§§TOOL:${s.length-1}§§
|
||||
`)),t=t.replace(/<function_results>[\s\S]*?<\/function_results>/gi,u=>(l.push({body:u}),`
|
||||
§§RESULT:${l.length-1}§§
|
||||
`));const c=t.split(/\n?(§§(?:THINK|TOOL|RESULT|SUMMARY):\d+§§)\n?/);for(const u of c){const p=/^§§THINK:(\d+)§§$/.exec(u);if(p){e.push({type:"thinking",content:o[Number(p[1])]});continue}const d=/^§§TOOL:(\d+)§§$/.exec(u);if(d){const b=s[Number(d[1])];if(b.name==="ask_user"){const x=Cu(b.body),C=Su(b.body);e.push({type:"approval",content:C,candidates:x})}else e.push({type:"tool",content:b.body,label:b.name,inFlight:b.inFlight});continue}const m=/^§§RESULT:(\d+)§§$/.exec(u);if(m){const b=l[Number(m[1])];e.push({type:"result",content:b.body,inFlight:b.inFlight});continue}const f=/^§§SUMMARY:(\d+)§§$/.exec(u);if(f){e.push({type:"summary",content:r[Number(f[1])]});continue}const y=u.trim();y&&e.push({type:"prose",content:y})}return e}function Kr(n){return n.map((e,t)=>{const o=Lo(e),r=o.reduce((s,l)=>s+l.content.length,0);return{index:t,segments:o,weight:r}})}function ku(n){const e=[];let t=0;for(;t<n.length;){const o=n[t];if(o.role==="user"){const r=n[t+1];if(r&&r.role==="assistant"){const s=r.turn_segs??(r.content?[r.content]:[]),l=Kr(s);e.push({kind:"turn",userMsg:o,assistantMsg:r,turns:l}),t+=2}else e.push({kind:"standalone",msg:o}),t++}else{if(o.role==="assistant"){const r=o.turn_segs??(o.content?[o.content]:[]),s=Kr(r);e.push({kind:"turn",userMsg:{id:"__synthetic__",role:"user",content:"",status:"completed"},assistantMsg:o,turns:s})}else e.push({kind:"standalone",msg:o});t++}}return e}const Xe=[{id:"plan",title:"Plan",desc:{en:"Explore, plan, execute, verify",zh:"探索、规划、执行、验证"},prompt:"Enter Plan mode: read memory/plan_sop.md, follow Explore → Plan → Execute → Verify flow for the task I describe next."},{id:"goal",title:"Goal",desc:{en:"Achieve a specific objective autonomously",zh:"自主达成指定目标"},prompt:"Enter Goal mode: read L3 goal mode SOP, autonomously achieve the goal I describe next."},{id:"autonomous",title:"Autonomous",desc:{en:"Select tasks and execute independently",zh:"自主选取任务并独立执行"},prompt:"Enter autonomous mode: read memory/autonomous_operation_sop.md, select or plan tasks, execute independently and produce a report."},{id:"hive",title:"Hive",desc:{en:"Multi-agent parallel collaboration",zh:"多 agent 并行协作"},prompt:"Start Goal Hive mode: follow hive SOP, spawn multiple workers to collaboratively achieve my next goal."},{id:"review",title:"Review",desc:{en:"Critical review of latest output",zh:"对最近产出做严格复核"},prompt:"Enter reviewer mode: rigorously critique the latest output, check each item and report issues."},{id:"findwork",title:"Find Work",desc:{en:"Analyze context, suggest next tasks",zh:"分析当前情况,推荐下一步"},prompt:"Analyze my situation using the autonomous planning approach, generate a batch of TODOs that would interest me."}];function ju(n){for(const e of Xe)if(n.startsWith(e.prompt)){const t=n.slice(e.prompt.length).trimStart();return{id:e.id,rest:t}}return null}function Eu(n){return n?n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`:""}function Ou(n){var t;const e=((t=n.split(".").pop())==null?void 0:t.toLowerCase())||"";return["js","ts","tsx","jsx","py","rs","go","c","cpp","java"].includes(e)?"◇":["json","yaml","yml","toml","xml"].includes(e)?"{}":["md","txt","log","csv"].includes(e)?"¶":["pdf"].includes(e)?"⊞":"◎"}function Pu({text:n}){const[e,t]=a.useState(!1),o=a.useRef(),r=a.useCallback(s=>{s.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{t(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>t(!1),2e3)})},[n]);return typeof navigator>"u"||!navigator.clipboard?null:i.jsx("button",{"data-slot":"user-bubble-copy",onClick:r,title:e?"Copied":"Copy",children:e?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M3 8.5l3 3 7-7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"5.5",y:"5.5",width:"7",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M3.5 10.5v-7a1 1 0 011-1h7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})})}const Ci=a.memo(function({content:e,msgId:t,images:o,files:r}){const s=a.useRef(null),[l,c]=a.useState(!1),[u,p]=a.useState(!1),d=a.useRef(!1);if(d.current=u,a.useLayoutEffect(()=>{const f=s.current;if(!f)return;const y=new ResizeObserver(()=>{d.current||c(f.scrollHeight>f.clientHeight+2)});return y.observe(f),()=>y.disconnect()},[]),!e&&(!o||o.length===0)&&(!r||r.length===0))return null;const m=ju(e);return i.jsxs(i.Fragment,{children:[o&&o.length>0&&i.jsx("div",{"data-slot":"user-images",children:o.map((f,y)=>i.jsx("img",{"data-slot":"user-image-thumb",src:f.path.startsWith("data:")?f.path:`${ne}/upload/raw?path=${encodeURIComponent(f.path)}`,alt:f.name},y))}),r&&r.length>0&&i.jsx("div",{"data-slot":"user-files",children:r.map((f,y)=>i.jsxs("div
Line truncated
|
||||
|
||||
`)},[]);return i.jsxs("div",{"data-slot":"aui_assistant-message-root","data-role":"assistant","data-streaming":t||void 0,children:[i.jsx(zu,{segments:o,isStreaming:t,messageId:String(e.id)}),i.jsx(Bu,{getMessageText:s,executionMs:e.executionMs})]})}),Vu=a.memo(function({userMsg:e,assistantMsg:t,isStreaming:o}){return i.jsxs("div",{"data-slot":"aui_turn-pair",children:[i.jsx(Ci,{content:e.content,msgId:e.id,images:e.images,files:e.files}),i.jsx(Uu,{message:t,isStreaming:o})]})}),Ku=[{pattern:/invalid.?api.?key|api.?key.?invalid|Incorrect API key/i,key:"err.apiKeyInvalid"},{pattern:/model.*not found|does not exist|model_not_found/i,key:"err.modelNotFound"},{pattern:/rate.?limit|429|Too Many Requests/i,key:"err.rateLimit"},{pattern:/quota|insufficient.?funds|balance|billing/i,key:"err.quotaExceeded"},{pattern:/timed?\s*out|TimeoutError/i,key:"err.timeout"},{pattern:/Connection\s*refused|ConnectionRefusedError/i,key:"err.connRefused"},{pattern:/errno 48|address already in use/i,key:"err.portBusy"},{pattern:/Traceback|Exception.*thread|exit code \d+/i,key:"err.processCrash"}];function Wu(n,e){if(!n)return"";for(const t of Ku)if(t.pattern.test(n))return e(t.key);return n.length<=80?n:n.slice(0,77)+"…"}const Hu=a.memo(function({error:e,msgId:t}){const{t:o}=he(),r=Wu(e,o);return i.jsx("div",{className:"ga-inline-error",role:"alert",id:`msg-${t}`,children:i.jsx("span",{className:"ga-inline-error-text",children:r})})}),Zu=300;function qu(n){return n.kind==="turn"?n.turns.reduce((e,t)=>e+t.segments.length,0):1}const Gu=a.memo(function({messages:e,isRunning:t,budgetMultiplier:o,onShowEarlier:r,scrollRef:s}){const l=a.useMemo(()=>ku(e),[e]),c=a.useRef(null),u=a.useMemo(()=>{if(!isFinite(o))return 0;const f=Zu*o;let y=0;for(let b=l.length-1;b>=0;b--)if(y+=qu(l[b]),y>f)return b+1;return 0},[l,o]),p=a.useMemo(()=>l.slice(u),[l,u]),d=u;a.useLayoutEffect(()=>{c.current!==null&&(s!=null&&s.current)&&(s.current.scrollTop=s.current.scrollHeight-c.current,c.current=null)});const m=()=>{const f=s==null?void 0:s.current;f&&(c.current=f.scrollHeight-f.scrollTop),r()};return e.length===0?i.jsx("div",{"data-slot":"thread-empty",children:i.jsx("p",{children:"Send a message to begin."})}):i.jsxs(i.Fragment,{children:[d>0&&i.jsxs("button",{"data-slot":"show-earlier-btn",onClick:m,children:["Show ",d," earlier messages"]}),p.map((f,y)=>{const b=u+y;return f.kind==="turn"?i.jsx(Vu,{userMsg:f.userMsg,assistantMsg:f.assistantMsg,isStreaming:t&&b===l.length-1},f.assistantMsg.id):f.msg.role==="user"?i.jsx("div",{"data-slot":"aui_turn-pair",children:i.jsx(Ci,{content:f.msg.content,msgId:f.msg.id,images:f.msg.images,files:f.msg.files})},f.msg.id):f.msg.role==="error"?i.jsx(Hu,{error:f.msg.content,msgId:f.msg.id},f.msg.id):i.jsx("div",{"data-slot":"standalone-message","data-status":f.msg.status,children:f.msg.content},f.msg.id)})]})}),qr=3,Gr=40,Qu=170,Qr=12;function Yr(n){const e=n.replace(/\s+/g," ").trim();return e.length<=Gr?e:e.slice(0,Gr)+"…"}function Yu(n){return 1-Math.pow(1-n,3)}let Jn=0;function Xu(n,e,t){cancelAnimationFrame(Jn);const o=n.scrollTop,r=e-o;if(Math.abs(r)<1)return;const s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1);n.scrollTop=o+r*Yu(p),p<1&&(Jn=requestAnimationFrame(l))}Jn=requestAnimationFrame(l)}const Ju=a.memo(function({messages:e,stopScroll:t,onJumpToCollapsed:o}){const r=a.useMemo(()=>e.filter(b=>b.role==="user").map(b=>({id:b.id,content:b.content})),[e]),[s,l]=a.useState(null),[c,u]=a.useState(!1),p=a.useRef(null),d=a.useRef(0),m=a.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),f=a.useCallback(()=>{p.current=setTimeout(()=>{u(!1),p.current=null},150)},[]);a.useEffect(()=>{if(r.length<qr)return;const b=document.querySelector('[data-slot="aui_thread-viewport"]');if(!b)return;function x(){if(d.current=0,!b)return;const S=b.getBoundingClientRect().top;let k=null;for(const _ of r){const v=document.getElementById(`msg-${_.id}`);if(!v)continue;if(v.getBoundingClientRect().top-S<=Qr)k=_.id;else break}!k&&r.length>0&&(k=r[0].id),k&&l(k)}function C(){d.current||(d.current=requestAnimationFrame(x))}return b.addEventListener("scroll",C,{passive:!0}),x(),()=>{b.removeEventListener("scroll",C),cancelAnimationFrame(d.current)}},[r]);const y=a.useCallback(b=>{const x=document.querySelector('[data-slot="aui_thread-viewport"]'),C=document.getElementById(`msg-${b}`);if(!C){o(b);return}if(!x)return;t();const _=(C.closest('[data-slot="aui_turn-pair"]')||C).offsetTop-Qr;Xu(x,_,Qu)},[t,o]);return r.length<qr?null:i.jsx("nav",{"data-slot":"user-turn-rail","data-expanded":c||void 0,"aria-label":"User message navigation",children:i.jsxs("div",{"data-slot":"rail-hitarea",onMouseEnter:m,onMouseLeave:f,children:[i.jsx("div",{"data-slot":"rail-panel","aria-hidden":!c,children:r.map(b=>i.jsx("button",{"data-slot":"rail-panel-item","data-active":b.id===s||void 0,onClick:()=>y(b.id),children:Yr(b.content)},b.id))}),i.jsx("div",{"data-slot":"rail-marks",children:r.map(b=>i.jsx("button",{"data
Line truncated
|
||||
`;else{const o=Io(t);o&&(e+=`
|
||||
`+o)}return e}function t0(n){const e=Array.from(n.childNodes);for(const t of e)if(t instanceof HTMLElement){if(t.dataset.refText||t.tagName==="BR")continue;if(t.tagName==="DIV"||t.tagName==="P"){const o=document.createElement("br");for(n.insertBefore(o,t);t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}}n.normalize()}function ji(n){const e=document.createRange();e.selectNodeContents(n),e.collapse(!1);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function Xr(n,e){n.focus();const t=window.getSelection();if(!t||t.rangeCount===0){n.appendChild(e);return}const o=t.getRangeAt(0);o.deleteContents(),o.insertNode(e),o.setStartAfter(e),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}function n0(n,e){n.textContent=e,ji(n)}function o0(n,e,t){const o=document.createElement("span");return o.contentEditable="false",o.dataset.refText=`@${n}:\`${e}\``,o.dataset.refKind=n,o.className="ref-chip",o.innerHTML=`<span class="ref-chip-icon">${l0(n)}</span><span class="ref-chip-label">${a0(t||e)}</span>`,o}function r0(n,e,t,o){const r=o0(e,t,o);Xr(n,r);const s=document.createTextNode(" ");Xr(n,s)}function s0(n,e){const t=document.createElement("span");return t.contentEditable="false",t.dataset.refText=e,t.dataset.skillId=n,t.className="skill-chip",t.textContent=`/${n}`,t}function i0(n,e,t){n.textContent="";const o=s0(e,t);n.appendChild(o);const r=document.createTextNode(" ");n.appendChild(r),ji(n)}function a0(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function l0(n){switch(n){case"file":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z" stroke="currentColor" stroke-width="1.2"/><path d="M9 2v4h4" stroke="currentColor" stroke-width="1.2"/></svg>';case"url":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';case"image":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><rect x="2" y="2" width="12" height="12" rx="1" stroke="currentColor" stroke-width="1.2"/><circle cx="5.5" cy="5.5" r="1" fill="currentColor"/><path d="M2 11l3-3 2 2 3-3 4 4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';default:return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><circle cx="8" cy="8" r="5" stroke="currentColor" stroke-width="1.2"/></svg>'}}const c0=a.forwardRef(function({placeholder:e,disabled:t,onInput:o,onKeyDown:r,onSlashTrigger:s,onSlashDismiss:l,onAtTrigger:c,onAtDismiss:u,onPasteFiles:p},d){const m=a.useRef(null),f=a.useRef(!1),y=a.useRef("");a.useImperativeHandle(d,()=>({focus(){var v;(v=m.current)==null||v.focus()},clear(){m.current&&(m.current.textContent="",y.current="")},getText(){return m.current?Io(m.current):""},setText(v){m.current&&(n0(m.current,v),y.current=v,o(v))},insertChip(v,j,w){m.current&&(m.current.focus(),r0(m.current,v,j,w),b())},setSkillChip(v,j){m.current&&(i0(m.current,v,j),b())},getElement(){return m.current}}));const b=a.useCallback(()=>{if(!m.current)return;const v=Io(m.current);y.current=v,o(v);const j=v.trimStart();j.startsWith("/")&&!j.includes(`
|
||||
`)?s==null||s(j.slice(1)):l==null||l();const w=v.match(/@([^\s@]*)$/);w?c==null||c(w[1]):u==null||u()},[o,s,l,c,u]),x=a.useCallback(()=>{f.current||(m.current&&t0(m.current),b())},[b]),C=a.useCallback(()=>{f.current=!0},[]),S=a.useCallback(()=>{f.current=!1,x()},[x]),k=a.useCallback(v=>{f.current||v.nativeEvent.isComposing||v.keyCode===229||r(v)},[r]),_=a.useCallback(v=>{var O;const j=(O=v.clipboardData)==null?void 0:O.items;if(!j)return;const w=[];for(const D of Array.from(j))if(D.type.startsWith("image/")&&D.type!=="image/svg+xml"){const P=D.getAsFile();P&&w.push(P)}if(w.length>0){v.preventDefault(),p==null||p(w);return}const E=v.clipboardData.getData("text/plain");E&&(v.preventDefault(),document.execCommand("insertText",!1,E))},[p]);return a.useEffect(()=>{const v=m.current;if(!v)return;const j=new ResizeObserver(w=>{var O,D,P;const E=((P=(D=(O=w[0])==null?void 0:O.borderBoxSize)==null?void 0:D[0])==null?void 0:P.blockSize)??v.offsetHeight;v.style.setProperty("--editor-scroll-height",`${E}px`)});return j.observe(v),()=>j.disconnect()},[]),i.jsx("div",{ref:m,"data-slot":"composer-rich-input",contentEditable:!t,role:"textbox","aria-multiline":"true","aria-placeholder":e,"data-placeholder":e,suppressContentEditableWarning:!0,onInput:x,onKeyDown:k,onCompositionStart:C,onCompositionEnd:S,onPaste:_})});function d0(){try{const n=localStorage.getItem("ga_custom_presets");return n?JSON.parse(n):[]}catch{return[]}}function u0({visible:n,query:e,onSelect:t,onClose:o}){const r=Z(m=>m.lang),[s,l]=a.useState(0),c=a.useRef(null),u=d0(),p=[...Xe,...u],d=e?p.filter(m=>m.id.startsWith(e.toLowerCase())||m.title.toLowerCase().includes(e.toLowerCase())):p;return a.useEffect(()=>{l(0)},[e]),a.useEffect(()=>{if(!n)return;function m(f){f.key==="ArrowDown"?(f.preventDefault(),l(y=>Math.min(y+1,d.length-1))):f.key==="ArrowUp"?(f.preventDefault(),l(y=>Math.max(y-1,0))):f.key==="Enter"?(f.preventDefault(),d[s]&&t(d[s].id,d[s].prompt)):f.key==="Escape"&&(f.preventDefault(),o())}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[n,s,d,t,o]),a.useEffect(()=>{if(!c.current)return;const m=c.current.querySelector("[data-focused]");m==null||m.scrollIntoView({block:"nearest"})},[s]),!n||d.length===0?null:i.jsx("div",{ref:c,"data-slot":"completion-drawer",children:d.map((m,f)=>i.jsx("button",{"data-slot":"completion-item","data-focused":f===s?"":void 0,onClick:()=>t(m.id,m.prompt),onMouseEnter:()=>l(f),children:i.jsxs("span",{"data-slot":"completion-info",children:[i.jsxs("span",{"data-slot":"completion-title",children:["/",m.id]}),i.jsx("span",{"data-slot":"completion-desc",children:m.desc[r]||m.desc.en})]})},m.id))})}const p0=[{id:"file",label:"file"},{id:"url",label:"url"},{id:"image",label:"image"}];function h0({visible:n,query:e,onConfirm:t,onClose:o}){const r=a.useRef(null),[s,l]=a.useState("file"),[c,u]=a.useState("");a.useEffect(()=>{n&&(u(e),l("file"),setTimeout(()=>{var d;return(d=r.current)==null?void 0:d.focus()},0))},[n,e]),a.useEffect(()=>{if(!n)return;function d(m){m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),o())}return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[n,o]);const p=a.useCallback(d=>{d.preventDefault();const m=c.trim();m&&t(s,m)},[s,c,t]);return n?i.jsx("div",{"data-slot":"at-ref-popover",children:i.jsxs("form",{onSubmit:p,"data-slot":"at-ref-form",children:[i.jsx("div",{"data-slot":"at-ref-kinds",children:p0.map(d=>i.jsx("button",{type:"button","data-slot":"at-ref-kind-btn","data-active":d.id===s?"":void 0,onClick:()=>l(d.id),title:d.label,children:i.jsx(m0,{kind:d.id})},d.id))}),i.jsx("input",{ref:r,"data-slot":"at-ref-input",type:"text",value:c,onChange:d=>u(d.target.value),placeholder:s==="url"?"https://...":"path/to/file"}),i.jsx("button",{type:"submit","data-slot":"at-ref-confirm",disabled:!c.trim(),children:"↵"})]})}):null}function m0({kind:n}){switch(n){case"file":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("path",{d:"M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M9 2v4h4",stroke:"currentColor",strokeWidth:"1.2"})]});case"url":return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})});case"image":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("circle",{cx:"5.5",cy:"5.5",r:"1",fill:"currentColor"}),i.jsx("path",{d:"M2 11l3-3 2 2 3-3 4 4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});default:return null}}const Jr={title:{zh:"附加",en:"Attach"},file:{zh:"文件…",en:"File…"},image:{zh:"图片…",en:"Image…"},paste:
Line truncated
|
||||
`);U&&(te=te?`${te}
|
||||
|
||||
${U}`:U)}else ee.images=V.map(U=>({name:U.name,path:U.path||U.name,base64:U.preview}));n(te||"",Object.keys(ee).length>0?ee:void 0),(Fe=c.current)==null||Fe.clear(),y(""),x([])},[f,b,n]),D=a.useCallback($=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),O())},[O]),P=a.useCallback($=>{y($)},[]),N=a.useCallback($=>{_($)},[]),L=a.useCallback(()=>{_(null)},[]),B=a.useCallback(($,V)=>{var q,R;(q=c.current)==null||q.setSkillChip($,V),(R=c.current)==null||R.focus(),_(null)},[]),Q=a.useCallback($=>{j($)},[]),z=a.useCallback(()=>{j(null)},[]),M=a.useCallback(($,V)=>{var oe,ee,se,te;const q=((oe=c.current)==null?void 0:oe.getText())||"",R=q.lastIndexOf("@");R>=0&&((ee=c.current)==null||ee.setText(q.slice(0,R))),(se=c.current)==null||se.insertChip($,V),(te=c.current)==null||te.focus(),j(null)},[]),Y=a.useCallback($=>{w($)},[w]),fe=a.useCallback($=>{x(V=>V.filter(q=>q.id!==$))},[]),Se=a.useCallback(($,V)=>{var q,R;(q=c.current)==null||q.setSkillChip($,V),(R=c.current)==null||R.focus()},[]),T=a.useCallback(()=>{var $;($=p.current)==null||$.click()},[]),F=a.useCallback(()=>{var $;($=d.current)==null||$.click()},[]),J=a.useCallback(async()=>{try{const $=await navigator.clipboard.read();for(const V of $){const q=V.types.find(R=>R.startsWith("image/"));if(q){const R=await V.getType(q),oe=new File([R],"clipboard-image.png",{type:q});w([oe]);return}}}catch{}},[w]),ce=a.useCallback($=>{$.target.files&&$.target.files.length>0&&w($.target.files),$.target.value=""},[w]);a.useEffect(()=>{var R,oe,ee;const $=(ee=(oe=(R=window.__TAURI__)==null?void 0:R.webview)==null?void 0:oe.getCurrentWebview)==null?void 0:ee.call(oe);if(!$)return;let V,q=!1;return $.onDragDropEvent(se=>{const te=se.payload.type;te==="enter"||te==="over"?S(!0):te==="leave"?S(!1):te==="drop"&&(S(!1),se.payload.paths&&se.payload.paths.length>0&&E(se.payload.paths))}).then(se=>{q?se():V=se}),()=>{q=!0,V==null||V()}},[E]);const ie=f.trim().length>0||b.length>0,ke=b.some($=>$.status==="uploading"),ge=Eh(t,ie,ke);return i.jsxs("div",{ref:u,"data-slot":"composer-root",children:[C&&i.jsx("div",{"data-slot":"composer-drop-overlay",children:"Drop files here"}),i.jsxs("div",{"data-slot":"composer-surface",children:[!r&&i.jsx(Lh,{}),i.jsx(wh,{files:b,onRemove:fe}),i.jsx(u0,{visible:k!==null,query:k||"",onSelect:B,onClose:L}),i.jsx(h0,{visible:v!==null,query:v||"",onConfirm:M,onClose:z}),i.jsx("div",{"data-slot":"composer-input-row",children:i.jsx(c0,{ref:c,placeholder:m,disabled:!1,onInput:P,onKeyDown:D,onSlashTrigger:N,onSlashDismiss:L,onAtTrigger:Q,onAtDismiss:z,onPasteFiles:Y})}),i.jsxs("div",{"data-slot":"composer-toolbar",children:[i.jsxs("div",{"data-slot":"composer-toolbar-left",children:[i.jsx(f0,{onUploadFile:T,onUploadImage:F,onPasteImage:J}),i.jsx(kh,{onSelect:Se})]}),i.jsxs("div",{"data-slot":"composer-toolbar-right",children:[s===void 0?i.jsx(fh,{}):s,i.jsx(Oh,{state:ge,onSend:O,onStop:e,onQueue:O})]})]})]}),i.jsx("input",{ref:p,type:"file",multiple:!0,style:{display:"none"},onChange:ce}),i.jsx("input",{ref:d,type:"file",multiple:!0,accept:"image/*",style:{display:"none"},onChange:ce})]})}const $h="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201099.5%20105'%20width='1099.5'%20height='105'%20fill='%23000000'%3e%3cg%20transform='translate(-5.6%2088.5)'%3e%3cpath%20d='M62.70%200L20.40%200Q16.40%200%2013-2Q9.60-4%207.60-7.40Q5.60-10.80%205.60-14.80L5.60-14.80L5.60-57.20Q5.60-61.30%207.60-64.65Q9.60-68%2013-70Q16.40-72%2020.40-72L20.40-72L62.70-72Q66.80-72%2070.15-70Q73.50-68%2075.55-64.65Q77.60-61.30%2077.60-57.20L77.60-57.20L77.60-50.40L61.90-50.40L61.90-56.40L21.10-56.40L21.10-15.60L61.90-15.60L61.90-26.40L46.30-26.40L46.30-42L77.60-42L77.60-14.80Q77.60-10.80%2075.55-7.40Q73.50-4%2070.15-2Q66.80%200%2062.70%200L62.70%200ZM161.30%200L94.80%200L94.80-72L161.30-72L161.30-56.40L110.50-56.40L110.50-43.80L151.40-43.80L151.40-28.20L110.50-28.20L110.50-15.60L161.30-15.60L161.30%200ZM192.70%200L177.20%200L177.20-72L193.20-72L233.50-24L233.50-72L249.20-72L249.20%200L233.20%200L192.70-48.20L192.70%200ZM333.10%200L266.60%200L266.60-72L333.10-72L333.10-56.40L282.30-56.40L282.30-43.80L323.20-43.80L323.20-28.20L282.30-28.20L282.30-15.60L333.10-15.60L333.10%200ZM420.90%200L404.90%200L385.00-23.60L364.50-23.60L364.50%200L349.00%200L349.00-71.90L406.10-71.90Q410.20-71.90%20413.55-69.90Q416.90-67.90%20418.95-64.50Q421.00-61.10%20421.00-57.10L421.00-57.10L421.00-38.50Q421.00-34.50%20418.95-31.10Q416.90-27.70%20413.55-25.70Q410.20-23.70%20406.10-23.70L406.10-23.70L405.30-23.70L420.90-5.30L420.90%200ZM364.50-56.40L364.50-39.30L405.30-39.30L405.30-56.40L364.50-56.40ZM450.30%200L435.00%200L435.00-72L450.30-72L450.30%200ZM536.70%200L479.70%200Q475.60%200%20472.25-2Q468.90-4%20466.90-7.35Q464.90-10.70%20464.90-14.80L464.90-14.80L464.90-57.20Q464.90-61.30%20466.90-64.65Q468.90-68%20472.25-70Q475.60-72%20479.70-72L479.70-72L536.70-72L536.70-56.40L483.70-56.40Q482.10-56.40%20481.25-55.60Q480.40-54.80%20480.40-53.10L480.40-53.10L480.40-18.90Q480.40-17.30%
Line truncated
|
||||
|
||||
`)})]})})]})}return this.props.children}}async function Cm(){const n=document.getElementById("app");va.createRoot(n).render(i.jsx(wm,{children:i.jsx(xm,{})}))}Cm();export{Wn as A,ne as B,ka as C,Ne as D,li as E,dt as F,ue as G,bi as H,Ha as I,mu as J,Z as K,Vd as L,le as M,Nh as N,fh as O,Pe as P,X as Q,et as R,za as S,ze as T,Om as U,Pm as V,Aa as W,No as X,Mo as _,_m as a,he as b,ri as c,Is as d,Wo as e,_i as f,pl as g,Te as h,Lm as i,_o as j,Yl as k,ft as l,Ve as m,G as n,Nl as o,Fl as p,Al as q,Dl as r,qt as s,xl as t,Ps as u,zl as v,Vl as w,Il as x,Kl as y,un as z};
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import{g as ml,aj as jt}from"./tauri-compat-tfiFK9EG.js";import{V as To,W as Co}from"./main-BlLQtfpq.js";function br(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ci(e.position):"start"in e||"end"in e?Ci(e):"line"in e||"column"in e?p0(e):""}function p0(e){return zi(e&&e.line)+":"+zi(e&&e.column)}function Ci(e){return p0(e&&e.start)+"-"+p0(e&&e.end)}function zi(e){return e&&typeof e=="number"?e:1}class Be extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},l=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof n=="string"){const o=n.indexOf(":");o===-1?a.ruleId=n:(a.source=n.slice(0,o),a.ruleId=n.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=br(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Be.prototype.file="";Be.prototype.name="";Be.prototype.reason="";Be.prototype.message="";Be.prototype.stack="";Be.prototype.column=void 0;Be.prototype.line=void 0;Be.prototype.ancestors=void 0;Be.prototype.cause=void 0;Be.prototype.fatal=void 0;Be.prototype.place=void 0;Be.prototype.ruleId=void 0;Be.prototype.source=void 0;const at={basename:zo,dirname:Mo,extname:Eo,join:Io,sep:"/"};function zo(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mr(e);let r=0,n=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else l<0&&(a=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(n=i):(s=-1,n=l));return r===n?n=l:n<0&&(n=e.length),e.slice(r,n)}function Mo(e){if(Mr(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Eo(e){Mr(e);let t=e.length,r=-1,n=0,i=-1,a=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){n=t+1;break}continue}r<0&&(l=!0,r=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function Io(...e){let t=-1,r;for(;++t<e.length;)Mr(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":Do(r)}function Do(e){Mr(e);const t=e.codePointAt(0)===47;let r=Bo(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function Bo(e,t){let r="",n=0,i=-1,a=0,l=-1,s,o;for(;++l<=e.length;){if(l<e.length)s=e.codePointAt(l);else{if(s===47)break;s=47}if(s===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(o=r.lastIndexOf("/"),o!==r.length-1){o<0?(r="",n=0):(r=r.slice(0,o),n=r.length-1-r.lastIndexOf("/")),i=l,a=0;continue}}else if(r.length>0){r="",n=0,i=l,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,l):r=e.slice(i+1,l),n=l-i-1;i=l,a=0}else s===46&&a>-1?a++:a=-1}return r}function Mr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Fo={cwd:Ro};function Ro(){return"/"}function d0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lo(e){if(typeof e=="string")e=new URL(e);else if(!d0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return No(e)}function No(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Rn=["history","path","basename","stem","extname","dirname"];class fl{constructor(t){let r;t?d0(t)?r={path:t}:typeof t=="string"||Po(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":Fo.cwd(),this.data={},thLine truncated
|
||||
import{g as ml,aj as jt}from"./tauri-compat-D_GD_wMe.js";import{W as To,X as Co}from"./main-j7e_THPB.js";function br(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ci(e.position):"start"in e||"end"in e?Ci(e):"line"in e||"column"in e?p0(e):""}function p0(e){return zi(e&&e.line)+":"+zi(e&&e.column)}function Ci(e){return p0(e&&e.start)+"-"+p0(e&&e.end)}function zi(e){return e&&typeof e=="number"?e:1}class Be extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},l=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof n=="string"){const o=n.indexOf(":");o===-1?a.ruleId=n:(a.source=n.slice(0,o),a.ruleId=n.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=br(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Be.prototype.file="";Be.prototype.name="";Be.prototype.reason="";Be.prototype.message="";Be.prototype.stack="";Be.prototype.column=void 0;Be.prototype.line=void 0;Be.prototype.ancestors=void 0;Be.prototype.cause=void 0;Be.prototype.fatal=void 0;Be.prototype.place=void 0;Be.prototype.ruleId=void 0;Be.prototype.source=void 0;const at={basename:zo,dirname:Mo,extname:Eo,join:Io,sep:"/"};function zo(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mr(e);let r=0,n=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else l<0&&(a=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(n=i):(s=-1,n=l));return r===n?n=l:n<0&&(n=e.length),e.slice(r,n)}function Mo(e){if(Mr(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Eo(e){Mr(e);let t=e.length,r=-1,n=0,i=-1,a=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){n=t+1;break}continue}r<0&&(l=!0,r=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function Io(...e){let t=-1,r;for(;++t<e.length;)Mr(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":Do(r)}function Do(e){Mr(e);const t=e.codePointAt(0)===47;let r=Bo(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function Bo(e,t){let r="",n=0,i=-1,a=0,l=-1,s,o;for(;++l<=e.length;){if(l<e.length)s=e.codePointAt(l);else{if(s===47)break;s=47}if(s===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(o=r.lastIndexOf("/"),o!==r.length-1){o<0?(r="",n=0):(r=r.slice(0,o),n=r.length-1-r.lastIndexOf("/")),i=l,a=0;continue}}else if(r.length>0){r="",n=0,i=l,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,l):r=e.slice(i+1,l),n=l-i-1;i=l,a=0}else s===46&&a>-1?a++:a=-1}return r}function Mr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Fo={cwd:Ro};function Ro(){return"/"}function d0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lo(e){if(typeof e=="string")e=new URL(e);else if(!d0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return No(e)}function No(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Rn=["history","path","basename","stem","extname","dirname"];class fl{constructor(t){let r;t?d0(t)?r={path:t}:typeof t=="string"||Po(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":Fo.cwd(),this.data={},thLine truncated
|
||||
`,u="/",h="*",m="",d="comment",p="declaration";function y(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var z=1,I=1;function q(Y){var H=Y.match(t);H&&(z+=H.length);var ae=Y.lastIndexOf(o);I=~ae?Y.length-ae:I+Y.length}function O(){var Y={line:z,column:I};return function(H){return H.position=new M(Y),U(),H}}function M(Y){this.start=Y,this.end={line:z,column:I},this.source=A.source}M.prototype.content=C;function G(Y){var H=new Error(A.source+":"+z+":"+I+": "+Y);if(H.reason=Y,H.filename=A.source,H.line=z,H.column=I,H.source=C,!A.silent)throw H}function X(Y){var H=Y.exec(C);if(H){var ae=H[0];return q(ae),C=C.slice(ae.length),H}}function U(){X(r)}function E(Y){var H;for(Y=Y||[];H=V();)H!==!1&&Y.push(H);return Y}function V(){var Y=O();if(!(u!=C.charAt(0)||h!=C.charAt(1))){for(var H=2;m!=C.charAt(H)&&(h!=C.charAt(H)||u!=C.charAt(H+1));)++H;if(H+=2,m===C.charAt(H-1))return G("End of comment missing");var ae=C.slice(2,H-2);return I+=2,q(ae),C=C.slice(H),I+=2,Y({type:d,comment:ae})}}function $(){var Y=O(),H=X(n);if(H){if(V(),!X(i))return G("property missing ':'");var ae=X(a),pe=Y({type:p,property:w(H[0].replace(e,m)),value:ae?w(ae[0].replace(e,m)):m});return X(l),pe}}function se(){var Y=[];E(Y);for(var H;H=$();)H!==!1&&(Y.push(H),E(Y));return Y}return U(),se()}function w(C){return C?C.replace(s,m):m}return On=y,On}var Li;function Qo(){if(Li)return Kt;Li=1;var e=Kt&&Kt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.default=r;const t=e(Zo());function r(n,i){let a=null;if(!n||typeof n!="string")return a;const l=(0,t.default)(n),s=typeof i=="function";return l.forEach(o=>{if(o.type!=="declaration")return;const{property:u,value:h}=o;s?i(u,h,o):h&&(a=a||{},a[u]=h)}),a}return Kt}var pr={},Ni;function Jo(){if(Ni)return pr;Ni=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(u){return!u||r.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},s=function(u,h){return"".concat(h,"-")},o=function(u,h){return h===void 0&&(h={}),a(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,s):u=u.replace(n,s),u.replace(t,l))};return pr.camelCase=o,pr}var dr,Pi;function eu(){if(Pi)return dr;Pi=1;var e=dr&&dr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Qo()),r=Jo();function n(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(s,o){s&&o&&(l[(0,r.camelCase)(s,a)]=o)}),l}return n.default=n,dr=n,dr}var tu=eu();const ru=ml(tu),nu=/[ \t\n\f\r]/g;function iu(e){return typeof e=="object"?e.type==="text"?Oi(e.value):!1:Oi(e)}function Oi(e){return e.replace(nu,"")===""}const Sl=Al("end"),G0=Al("start");function Al(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function au(e){const t=G0(e),r=Sl(e);if(t&&r)return{start:t,end:r}}function qi(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}const Hi=document.createElement("i");function W0(e){const t="&"+e+";";Hi.innerHTML=t;const r=Hi.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}const Ne=Dt(/[A-Za-z]/),Ie=Dt(/[\dA-Za-z]/),lu=Dt(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const y0=Dt(/\d/),su=Dt(/[\dA-Fa-f]/),ou=Dt(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function me(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}const dn=Dt(new RegExp("\\p{P}|\\p{S}","u")),Ut=Dt(/\s/);function Dt(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ie(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(o){return le(o)?(e.enter(r),s(o)):t(o)}function s(o){return le(o)&&a++<i?(e.consume(o),s):(e.exit(r),t(o))}}function Ge(e,t,r,n){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)l=Array.from(n),l.unshift(t,r),e.splice(...l);else for(r&&e.splice(t,r);a<n.length;)l=n.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Qe(e,t){return e.length>0?(Ge(e,e.length,0,t),e):t}function er(e){if(e===null||me(e)||Ut(e))return 1;if(dn(e))return 2}function gn(e,t,r){const n=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!n.includes(a)&&(t=a(t,r),n.push(a))}return t}const b0={name:"attention",resolveAll:uu,tokenize:cu};function uu(e,t){let r=-1,n,i,a,l,s,o,u,h;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){Line truncated
|
||||
`;break}case-3:{l=`\r
|
||||
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,n.push(l)}return n.join("")}function Q1(e){const n={constructs:Bl([X1,...(e||{}).extensions||[]]),content:i(M1),defined:[],document:i(I1),flow:i(F1),lazy:{},string:i(N1),text:i(P1)};return n;function i(a){return l;function l(s){return Y1(n,a,s)}}}function J1(e){for(;!Ml(e););return e}const Yi=/[\0\t\n\r]/g;function ec(){let e=1,t="",r=!0,n;return i;function i(a,l,s){const o=[];let u,h,m,d,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",r&&(a.charCodeAt(0)===65279&&m++,r=void 0);m<a.length;){if(Yi.lastIndex=m,u=Yi.exec(a),d=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(d),!u){t=a.slice(m);break}if(p===10&&m===d&&n)o.push(-3),n=void 0;else switch(n&&(o.push(-5),n=void 0),m<d&&(o.push(a.slice(m,d)),e+=d-m),p){case 0:{o.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,o.push(-2);e++<h;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:n=!0,e=1}m=d+1}return s&&(n&&o.push(-5),t&&o.push(t),o.push(null)),o}}const tc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rc(e){return e.replace(tc,nc)}function nc(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),a=i===120||i===88;return Rl(r.slice(a?2:1),a?16:10)}return W0(r)||e}const Pl={}.hasOwnProperty;function ic(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),ac(r)(J1(Q1(r).document().write(ec()(e,t,!0))))}function ac(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(cr),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(Lr),blockQuote:a(mt),characterEscape:U,characterReference:U,codeFenced:a(Ft),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ft,l),codeText:a(Rr,l),codeTextData:U,data:U,codeFlowValue:U,definition:a(Wt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Xt),hardBreakEscape:a(Nr),hardBreakTrailing:a(Nr),htmlFlow:a(Pr,l),htmlFlowData:U,htmlText:a(Pr,l),htmlTextData:U,image:a(Or),label:l,link:a(cr),listItem:a(Bn),listItemValue:d,listOrdered:a(Rt,m),listUnordered:a(Rt),paragraph:a(Fn),reference:S,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Lr),strong:a(hr),thematicBreak:a(Hr)},exit:{atxHeading:o(),atxHeadingSequence:O,autolink:o(),autolinkEmail:Ue,autolinkProtocol:tt,blockQuote:o(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:it,characterReferenceMarkerNumeric:it,characterReferenceValue:Te,characterReference:Ze,codeFenced:o(C),codeFencedFence:w,codeFencedFenceInfo:p,codeFencedFenceMeta:y,codeFlowValue:E,codeIndented:o(A),codeText:o(H),codeTextData:E,data:E,definition:o(),definitionDestinationString:q,definitionLabelString:z,definitionTitleString:I,emphasis:o(),hardBreakEscape:o($),hardBreakTrailing:o($),htmlFlow:o(se),htmlFlowData:E,htmlText:o(Y),htmlTextData:E,image:o(pe),label:$e,labelText:Me,lineEnding:V,link:o(ae),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:Ee,resourceDestinationString:k,resourceTitleString:xe,resource:Fe,setextHeading:o(X),setextHeadingLineSequence:G,setextHeadingText:M,strong:o(),thematicBreak:o()}};Ol(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(D){let j={type:"root",children:[]};const Q={stack:[j],tokenStack:[],config:t,enter:s,exit:u,buffer:l,resume:h,data:r},ne=[];let ce=-1;for(;++ce<D.length;)if(D[ce][1].type==="listOrdered"||D[ce][1].type==="listUnordered")if(D[ce][0]==="enter")ne.push(ce);else{const rt=ne.pop();ce=i(D,rt,ce)}for(ce=-1;++ce<D.length;){const rt=t[D[ce][0]];Pl.call(rt,D[ce][1].type)&&rt[D[ce][1].type].call(Object.assign({sliceSerialize:D[ce][2].sliceSerialize},Q),D[ce][1])}if(Q.tokenStack.length>0){const rt=Q.tokenStack[Q.tokenStack.length-1];(rt[1]||Ki).call(Q,void 0,rt[0])}for(j.position={start:St(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:St(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},ce=-1;++ce<t.transforms.length;)j=t.transforms[ce](j)||j;return j}function i(D,j,Q){let ne=j-1,ce=-1,rt=!1,Lt,ft,mr,fr;for(;++ne<=Q;){const Ve=D[ne];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?ce++:ce--,fr=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(Lt&&!fr&&!ce&&!mr&&(mr=ne),fr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fr=void 0}if(!ce&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||ce===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(Lt){let Yt=ne;for(ft=void 0;Yt--;){const pt=D[Yt];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;ft&&(D[ft][1].type="lineEndingBlank",rt=!0),pt[1].type="lineEnding",ft=Yt}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarkLine truncated
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
import{c as te,b as c,an as G,ao as oe,aj as r,T as f,ap as L,av as re,at as ne,aq as ae,as as ie,ar as ce}from"./tauri-compat-tfiFK9EG.js";import{B as F}from"./index-DpGuh58E.js";import{B as A}from"./index-Bpi3BHKj.js";import{I as se}from"./IconFile-CgfQSwGI.js";function le(t){return c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5a3 3 0 0 1 3-3h3.3a2 2 0 0 1 1.25.44l1.13.9a3 3 0 0 0 1.87.66H18c2 0 3 2 3 4H7.53A2 2 0 0 0 5.6 9.48L2.57 20.76C2.21 20.26 2 19.66 2 19V5Zm20.17 5H9.5a2 2 0 0 0-1.92 1.44l-2.7 9.28A1 1 0 0 0 5.82 22H18.5a2 2 0 0 0 1.92-1.44l2.7-9.28a1 1 0 0 0-.95-1.28Z",fill:"currentColor"}))}const pe=te(le,"folder_open");function C(){return window.__TAURI__}function de(t,e){return Number.isFinite(e.seq)?e.seq>t:!0}function O(t,e,n,i="prepare_failed"){const u=e==null?"":oe(e);return{seq:n,mode:"cold_start",phase:"failed",stage:null,progress:0,failure:{code:u?i:"unknown",detail:u},diagnostics:{buildId:"",platform:navigator.platform||"",projectDir:t[1]||"",pythonPath:t[0]||"",portState:"unknown",bridgeIdentity:null,recentLogs:[]}}}async function ue(t,e=0){const n=await t("get_config").catch(()=>["",""]);try{return{config:n,mode:"snapshot",snapshot:await t("get_bootstrap_snapshot")}}catch(i){if(!G(i,"get_bootstrap_snapshot"))throw i;const u=await t("get_prepare_error").catch(()=>null);return{config:n,mode:"legacy",snapshot:O(n,u,e)}}}async function he(t,e,n){if(n==="snapshot")try{return await t("retry_bootstrap",e),{mode:"snapshot"}}catch(i){if(!G(i,"retry_bootstrap"))return{mode:"snapshot",error:i}}try{return await t("start_bridge_with_config",e),{mode:"legacy"}}catch(i){return{mode:"legacy",error:i}}}async function ye(t,e,n){const i=await t("pick_directory",{title:n});if(!i)return null;const u=await t("discover_python_for_project",{projectDir:i,currentPython:e||null}).catch(()=>e);return{projectDir:i,pythonPath:u||""}}async function ge(t,e){return t("pick_python_interpreter",{title:e})}const H={config_unresolved:{zh:{title:"未找到应用文件",description:"请选择应用文件夹后继续。"},en:{title:"Application files not found",description:"Choose the application folder to continue."}},prepare_failed:{zh:{title:"运行环境尚未准备完成",description:"请检查所选应用文件夹和 Python 环境,然后继续启动。"},en:{title:"Environment setup is incomplete",description:"Check the application folder and Python environment, then continue startup."}},spawn_failed:{zh:{title:"本地连接未能启动",description:"请选择可用的应用文件夹和 Python 环境后继续。"},en:{title:"Local connection could not start",description:"Choose a usable application folder and Python environment to continue."}},bridge_shutdown_refused:{zh:{title:"本地连接暂时无法安全重启",description:"请等待当前操作完成后重试。"},en:{title:"Local connection cannot restart safely",description:"Wait for the current operation to finish, then retry."}},port_conflict:{zh:{title:"本地连接被占用",description:"另一个应用正在使用本地连接。关闭相关应用后继续启动。"},en:{title:"Local connection is in use",description:"Another app is using the local connection. Close it, then continue startup."}},service_timeout:{zh:{title:"本地连接启动时间过长",description:"请检查所选位置;诊断信息中包含最近的启动记录。"},en:{title:"Local connection is taking too long",description:"Check the selected locations. Diagnostics contain the latest startup records."}},service_exited:{zh:{title:"本地连接意外停止",description:"诊断信息中包含停止状态和最近的启动记录。"},en:{title:"Local connection stopped unexpectedly",description:"Diagnostics contain the stop status and latest startup records."}},ui_navigation_failed:{zh:{title:"主界面未能打开",description:"本地连接已经就绪,但界面加载失败。诊断信息中包含详细原因。"},en:{title:"Main window could not open",description:"The local connection is ready, but the interface failed to load. Diagnostics contain details."}},unknown:{zh:{title:"启动尚未完成",description:"请检查所选位置;需要协助时可复制诊断信息。"},en:{title:"Startup is not complete",description:"Check the selected locations. Copy diagnostics if you need support."}}},fe={zh:{pageTitle:"完成启动设置",intro:"选择应用运行所需的位置。你的记忆、会话和设置不会受到影响。",projectLabel:"应用文件夹",projectHint:"选择此前用于运行桌面版的应用文件夹。",projectPickerTitle:"选择应用文件夹",chooseProject:"选择文件夹",changeProject:"重新选择",projectEmpty:"尚未选择应用文件夹",pythonLabel:"Python 环境",pythonHint:"应用会自动选择可用环境;如有需要,可以重新选择。",pythonPickerTitlLine truncated
|
||||
import{c as te,b as c,an as G,ao as oe,aj as r,T as f,ap as L,av as re,at as ne,aq as ae,as as ie,ar as ce}from"./tauri-compat-D_GD_wMe.js";import{B as F}from"./index-C-iCGtYr.js";import{B as A}from"./index-9FI8Jlf5.js";import{I as se}from"./IconFile-C8B3WX2U.js";function le(t){return c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5a3 3 0 0 1 3-3h3.3a2 2 0 0 1 1.25.44l1.13.9a3 3 0 0 0 1.87.66H18c2 0 3 2 3 4H7.53A2 2 0 0 0 5.6 9.48L2.57 20.76C2.21 20.26 2 19.66 2 19V5Zm20.17 5H9.5a2 2 0 0 0-1.92 1.44l-2.7 9.28A1 1 0 0 0 5.82 22H18.5a2 2 0 0 0 1.92-1.44l2.7-9.28a1 1 0 0 0-.95-1.28Z",fill:"currentColor"}))}const pe=te(le,"folder_open");function C(){return window.__TAURI__}function de(t,e){return Number.isFinite(e.seq)?e.seq>t:!0}function O(t,e,n,i="prepare_failed"){const u=e==null?"":oe(e);return{seq:n,mode:"cold_start",phase:"failed",stage:null,progress:0,failure:{code:u?i:"unknown",detail:u},diagnostics:{buildId:"",platform:navigator.platform||"",projectDir:t[1]||"",pythonPath:t[0]||"",portState:"unknown",bridgeIdentity:null,recentLogs:[]}}}async function ue(t,e=0){const n=await t("get_config").catch(()=>["",""]);try{return{config:n,mode:"snapshot",snapshot:await t("get_bootstrap_snapshot")}}catch(i){if(!G(i,"get_bootstrap_snapshot"))throw i;const u=await t("get_prepare_error").catch(()=>null);return{config:n,mode:"legacy",snapshot:O(n,u,e)}}}async function he(t,e,n){if(n==="snapshot")try{return await t("retry_bootstrap",e),{mode:"snapshot"}}catch(i){if(!G(i,"retry_bootstrap"))return{mode:"snapshot",error:i}}try{return await t("start_bridge_with_config",e),{mode:"legacy"}}catch(i){return{mode:"legacy",error:i}}}async function ye(t,e,n){const i=await t("pick_directory",{title:n});if(!i)return null;const u=await t("discover_python_for_project",{projectDir:i,currentPython:e||null}).catch(()=>e);return{projectDir:i,pythonPath:u||""}}async function ge(t,e){return t("pick_python_interpreter",{title:e})}const H={config_unresolved:{zh:{title:"未找到应用文件",description:"请选择应用文件夹后继续。"},en:{title:"Application files not found",description:"Choose the application folder to continue."}},prepare_failed:{zh:{title:"运行环境尚未准备完成",description:"请检查所选应用文件夹和 Python 环境,然后继续启动。"},en:{title:"Environment setup is incomplete",description:"Check the application folder and Python environment, then continue startup."}},spawn_failed:{zh:{title:"本地连接未能启动",description:"请选择可用的应用文件夹和 Python 环境后继续。"},en:{title:"Local connection could not start",description:"Choose a usable application folder and Python environment to continue."}},bridge_shutdown_refused:{zh:{title:"本地连接暂时无法安全重启",description:"请等待当前操作完成后重试。"},en:{title:"Local connection cannot restart safely",description:"Wait for the current operation to finish, then retry."}},port_conflict:{zh:{title:"本地连接被占用",description:"另一个应用正在使用本地连接。关闭相关应用后继续启动。"},en:{title:"Local connection is in use",description:"Another app is using the local connection. Close it, then continue startup."}},service_timeout:{zh:{title:"本地连接启动时间过长",description:"请检查所选位置;诊断信息中包含最近的启动记录。"},en:{title:"Local connection is taking too long",description:"Check the selected locations. Diagnostics contain the latest startup records."}},service_exited:{zh:{title:"本地连接意外停止",description:"诊断信息中包含停止状态和最近的启动记录。"},en:{title:"Local connection stopped unexpectedly",description:"Diagnostics contain the stop status and latest startup records."}},ui_navigation_failed:{zh:{title:"主界面未能打开",description:"本地连接已经就绪,但界面加载失败。诊断信息中包含详细原因。"},en:{title:"Main window could not open",description:"The local connection is ready, but the interface failed to load. Diagnostics contain details."}},unknown:{zh:{title:"启动尚未完成",description:"请检查所选位置;需要协助时可复制诊断信息。"},en:{title:"Startup is not complete",description:"Check the selected locations. Copy diagnostics if you need support."}}},fe={zh:{pageTitle:"完成启动设置",intro:"选择应用运行所需的位置。你的记忆、会话和设置不会受到影响。",projectLabel:"应用文件夹",projectHint:"选择此前用于运行桌面版的应用文件夹。",projectPickerTitle:"选择应用文件夹",chooseProject:"选择文件夹",changeProject:"重新选择",projectEmpty:"尚未选择应用文件夹",pythonLabel:"Python 环境",pythonHint:"应用会自动选择可用环境;如有需要,可以重新选择。",pythonPickerTitlLine truncated
|
||||
`)}const B={projectDir:"",pythonPath:""};function q({label:t,hint:e,value:n,emptyText:i,buttonText:u,buttonLabel:l,loading:k,disabled:m,icon:j,onChoose:P}){return r.jsxs("section",{className:"ga-setup-location","aria-label":t,children:[r.jsxs("div",{className:"ga-setup-location-header",children:[r.jsx(f.Text,{strong:!0,children:t}),r.jsx(A,{size:"small",type:"tertiary",theme:"light",icon:j,loading:k,disabled:m,"aria-label":l,onClick:P,children:u})]}),r.jsx("div",{className:`ga-setup-path${n?"":" ga-setup-path--empty"}`,role:"textbox","aria-readonly":"true","aria-label":t,tabIndex:0,children:n?r.jsx("code",{children:n}):r.jsx("span",{children:i})}),r.jsx(f.Paragraph,{type:"tertiary",size:"small",className:"ga-setup-location-hint",children:e})]})}function S(t,e){return{seq:e,mode:"cold_start",phase:"failed",stage:null,progress:0,failure:{code:"unknown",detail:String(t)},diagnostics:{buildId:"",platform:navigator.platform||"",projectDir:"",pythonPath:"",portState:"unknown",bridgeIdentity:null,recentLogs:[]}}}function Pe(){var M;const t=V(),e=me(t),n=c.useRef(B),[i,u]=c.useState(B),[l,k]=c.useState(null),[m,j]=c.useState(!1),[P,N]=c.useState(!1),[T,z]=c.useState(!1),[R,b]=c.useState(""),[W,E]=c.useState(""),g=c.useRef(-1),w=c.useRef(null),D=c.useRef("snapshot"),h=c.useCallback(o=>{n.current=o,u(o)},[]),y=c.useCallback(o=>{var d,s,_,v;const a=w.current;if(!de(g.current,o))return;g.current=Number.isFinite(o.seq)?o.seq:g.current+1,w.current=o,k(o),o.phase==="failed"&&j(!1);const p={};(d=o.diagnostics)!=null&&d.projectDir&&(!n.current.projectDir||((s=a==null?void 0:a.diagnostics)==null?void 0:s.projectDir)===n.current.projectDir)&&(p.projectDir=o.diagnostics.projectDir),(_=o.diagnostics)!=null&&_.pythonPath&&(!n.current.pythonPath||((v=a==null?void 0:a.diagnostics)==null?void 0:v.pythonPath)===n.current.pythonPath)&&(p.pythonPath=o.diagnostics.pythonPath),Object.keys(p).length&&h({...n.current,...p})},[h]);c.useEffect(()=>{var o;(o=window.__GA_SETUP_MARK_READY__)==null||o.call(window)},[]),c.useEffect(()=>{const o=C();if(!(o!=null&&o.core.invoke)){y(S("Tauri bootstrap API is unavailable",0));return}let a=!0,p;return(async()=>{var v;if((v=o.event)!=null&&v.listen)try{const x=await o.event.listen("bootstrap",ee=>{a&&y(ee.payload)});if(!a){x();return}p=x}catch(x){console.warn("[setup] bootstrap events unavailable; using command compatibility mode",x)}const d=await ue(o.core.invoke,g.current+1);if(!a)return;D.current=d.mode;const s=d.config,_={pythonPath:(s==null?void 0:s[0])||"",projectDir:(s==null?void 0:s[1])||""};h({pythonPath:n.current.pythonPath||_.pythonPath,projectDir:n.current.projectDir||_.projectDir}),y(d.snapshot)})().catch(d=>{a&&y(S(d,g.current+1))}),()=>{a=!1,p==null||p()}},[h,y]);const $=c.useMemo(()=>{var o;return je((o=l==null?void 0:l.failure)==null?void 0:o.code,t)},[t,(M=l==null?void 0:l.failure)==null?void 0:M.code]),I=c.useMemo(()=>be(l),[l]),Z=c.useCallback(async()=>{const o=C();if(!(o!=null&&o.core.invoke)){b(e.pickerError);return}N(!0),b("");try{const a=await ye(o.core.invoke,n.current.pythonPath,e.projectPickerTitle);a&&h(a)}catch(a){console.error("[setup] application folder selection failed",a),b(e.pickerError)}finally{N(!1)}},[h,e]),J=c.useCallback(async()=>{const o=C();if(!(o!=null&&o.core.invoke)){b(e.pickerError);return}z(!0),b("");try{const a=await ge(o.core.invoke,e.pythonPickerTitle);a&&h({...n.current,pythonPath:a})}catch(a){console.error("[setup] Python environment selection failed",a),b(e.pickerError)}finally{z(!1)}},[h,e]),Q=c.useCallback(async()=>{const o=n.current.projectDir.trim(),a=n.current.pythonPath.trim();if(h({projectDir:o,pythonPath:a}),E(""),!o){const s=w.current??S("",g.current+1);y({...s,seq:g.current+1,phase:"failed",failure:{code:"config_unresolved",detail:""}});return}j(!0);const p=C();if(!(p!=null&&p.core.invoke)){y(S("Tauri bootstrap API is unavailable",g.current+1)),j(!1);return}const d=await he(p.core.invoke,{pythonPath:a,projectDir:o},D.current);if(D.current=d.mode,d.error){if(d.mode==="legacy")y(O([a,o],d.error,g.current+1,"spawn_failed"));else{const s=await p.core.invoke("get_bootstrap_snapshot").catch(()=>w.current);s&&y(s)}j(!1)}},[h,y]),X=c.useCallback(async()=>{var o;try{if(!((o=navigator.clipboard)!=null&&o.writeText))throw new Error("clipboard unavailable");await navigator.clipboard.writeText(I),E(e.copied)}catch{const p=document.getElementById("diagnostics");if(p){const d=document.createRange();d.selectNodeContents(p);const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(d),p.focus()}E(e.selectCopy)}},[e,I]);return r.jsx("main",{className:"ga-setup-page",children:r.jsxs("section",{className:"ga-setup-panel","aria-labelledby":"ga-setup-title",children:[r.jsxs("header",{className:"ga-setup-header",children:[r.jsx(f.Title,{id:"ga-setup-title",heading:3,children:e.pageTitle}),r.jsx(f.Paragraph,{type:"tertiary",children:e.intro})]}),(l==null?void 0:l.failure)&&r.jsx(F,{className:"ga-setup-banner",type:"danger",fullMode:!1,bordered
Line truncated
|
||||
+1
-1
@@ -44,4 +44,4 @@ function H_(s,i){for(var r=0;r<i.length;r++){const o=i[r];if(typeof o!="string"&
|
||||
`).replace(n_,"")}function go(e,t,n){if(t=Ep(t),Ep(e)!==t&&n)throw Error(r(425))}function mo(){}var as=null,ss=null;function ls(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var us=typeof setTimeout=="function"?setTimeout:void 0,r_=typeof clearTimeout=="function"?clearTimeout:void 0,Op=typeof Promise=="function"?Promise:void 0,i_=typeof queueMicrotask=="function"?queueMicrotask:typeof Op<"u"?function(e){return Op.resolve(null).then(e).catch(o_)}:us;function o_(e){setTimeout(function(){throw e})}function cs(e,t){var n=t,a=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"){if(a===0){e.removeChild(u),ni(t);return}a--}else n!=="$"&&n!=="$?"&&n!=="$!"||a++;n=u}while(n);ni(t)}function On(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Pp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var _r=Math.random().toString(36).slice(2),Yt="__reactFiber$"+_r,pi="__reactProps$"+_r,ln="__reactContainer$"+_r,fs="__reactEvents$"+_r,a_="__reactListeners$"+_r,s_="__reactHandles$"+_r;function Gn(e){var t=e[Yt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ln]||n[Yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Pp(e);e!==null;){if(n=e[Yt])return n;e=Pp(e)}return t}e=n,n=e.parentNode}return null}function hi(e){return e=e[Yt]||e[ln],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function wr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function vo(e){return e[pi]||null}var ds=[],Sr=-1;function Pn(e){return{current:e}}function ke(e){0>Sr||(e.current=ds[Sr],ds[Sr]=null,Sr--)}function xe(e,t){Sr++,ds[Sr]=e.current,e.current=t}var bn={},rt=Pn(bn),dt=Pn(!1),Xn=bn;function Cr(e,t){var n=e.type.contextTypes;if(!n)return bn;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var u={},c;for(c in n)u[c]=t[c];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function pt(e){return e=e.childContextTypes,e!=null}function yo(){ke(dt),ke(rt)}function bp(e,t,n){if(rt.current!==bn)throw Error(r(168));xe(rt,t),xe(dt,n)}function xp(e,t,n){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return n;a=a.getChildContext();for(var u in a)if(!(u in t))throw Error(r(108,he(e)||"Unknown",u));return G({},n,a)}function _o(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bn,Xn=rt.current,xe(rt,e),xe(dt,dt.current),!0}function Rp(e,t,n){var a=e.stateNode;if(!a)throw Error(r(169));n?(e=xp(e,t,Xn),a.__reactInternalMemoizedMergedChildContext=e,ke(dt),ke(rt),xe(rt,e)):ke(dt),xe(dt,n)}var un=null,wo=!1,ps=!1;function kp(e){un===null?un=[e]:un.push(e)}function l_(e){wo=!0,kp(e)}function xn(){if(!ps&&un!==null){ps=!0;var e=0,t=Oe;try{var n=un;for(Oe=1;e<n.length;e++){var a=n[e];do a=a(!0);while(a!==null)}un=null,wo=!1}catch(u){throw un!==null&&(un=un.slice(e+1)),Ad(Ma,xn),u}finally{Oe=t,ps=!1}}return null}var Tr=[],Er=0,So=null,Co=0,bt=[],xt=0,Qn=null,cn=1,fn="";function Yn(e,t){Tr[Er++]=Co,Tr[Er++]=So,So=e,Co=t}function Ip(e,t,n){bt[xt++]=cn,bt[xt++]=fn,bt[xt++]=Qn,Qn=e;var a=cn;e=fn;var u=32-qt(a)-1;a&=~(1<<u),n+=1;var c=32-qt(t)+u;if(30<c){var h=u-u%5;c=(a&(1<<h)-1).toString(32),a>>=h,u-=h,cn=1<<32-qt(t)+u|n<<u|a,fn=c+e}else cn=1<<c|n<<u|a,fn=e}function hs(e){e.return!==null&&(Yn(e,1),Ip(e,1,0))}function gs(e){for(;e===So;)So=Tr[--Er],Tr[Er]=null,Co=Tr[--Er],Tr[Er]=null;for(;e===Qn;)Qn=bt[--xt],bt[xt]=null,fn=bt[--xt],bt[xt]=null,cn=bt[--xt],bt[xt]=null}var St=null,Ct=null,Ie=!1,$t=null;function Ap(e,t){var n=At(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Np(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,St=e,Ct=On(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,St=e,Ct=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qn!==null?{id:cn,overflow:fn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=At(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,St=e,Ct=null,!0):!1;default:return!1}}function ms(e){return(e.mode&1)!==0&&(e.flags&128)===0}function vs(e){if(Ie){var t=Ct;if(t){var n=t;if(!Np(e,t)){if(ms(e))throw Error(r(418));t=On(n.nextSibling);var a=St;t&&Np(e,t)?Ap(a,n):(e.flags=e.flags&-4097|2,Ie=!1,St=e)}}else{if(ms(e))throw Error(r(418));e.flags=e.flags&-4097|2,Ie=!1,St=e}}}function jp(e){for(e=e.
Line truncated
|
||||
Error generating stack: `+c.message+`
|
||||
`+c.stack}return{value:e,source:t,stack:u,digest:null}}function qs(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function zs(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var v_=typeof WeakMap=="function"?WeakMap:Map;function hh(e,t,n){n=pn(-1,n),n.tag=3,n.payload={element:null};var a=t.value;return n.callback=function(){Bo||(Bo=!0,tl=a),zs(e,t)},n}function gh(e,t,n){n=pn(-1,n),n.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var u=t.value;n.payload=function(){return a(u)},n.callback=function(){zs(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){zs(e,t),typeof a!="function"&&(An===null?An=new Set([this]):An.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),n}function mh(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new v_;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(n)||(u.add(n),e=I_.bind(null,e,t,n),t.then(e,e))}function vh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function yh(e,t,n,a,u){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=pn(-1,1),t.tag=2,kn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=u,e)}var y_=$.ReactCurrentOwner,ht=!1;function ut(e,t,n,a){t.child=e===null?Fp(t,null,n,a):Pr(t,e.child,n,a)}function _h(e,t,n,a,u){n=n.render;var c=t.ref;return xr(t,u),a=Is(e,t,n,a,c,u),n=As(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,hn(e,t,u)):(Ie&&n&&hs(t),t.flags|=1,ut(e,t,a,u),t.child)}function wh(e,t,n,a,u){if(e===null){var c=n.type;return typeof c=="function"&&!ll(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,Sh(e,t,c,a,u)):(e=Go(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&u)===0){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:li,n(h,a)&&e.ref===t.ref)return hn(e,t,u)}return t.flags|=1,e=Dn(c,a),e.ref=t.ref,e.return=t,t.child=e}function Sh(e,t,n,a,u){if(e!==null){var c=e.memoizedProps;if(li(c,a)&&e.ref===t.ref)if(ht=!1,t.pendingProps=a=c,(e.lanes&u)!==0)(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,hn(e,t,u)}return $s(e,t,n,a,u)}function Ch(e,t,n){var a=t.pendingProps,u=a.children,c=e!==null?e.memoizedState:null;if(a.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},xe(Ar,Tt),Tt|=n;else{if((n&1073741824)===0)return e=c!==null?c.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,xe(Ar,Tt),Tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=c!==null?c.baseLanes:n,xe(Ar,Tt),Tt|=a}else c!==null?(a=c.baseLanes|n,t.memoizedState=null):a=n,xe(Ar,Tt),Tt|=a;return ut(e,t,u,n),t.child}function Th(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $s(e,t,n,a,u){var c=pt(n)?Xn:rt.current;return c=Cr(t,c),xr(t,u),n=Is(e,t,n,a,c,u),a=As(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,hn(e,t,u)):(Ie&&a&&hs(t),t.flags|=1,ut(e,t,n,u),t.child)}function Eh(e,t,n,a,u){if(pt(n)){var c=!0;_o(t)}else c=!1;if(xr(t,u),t.stateNode===null)Lo(e,t),dh(t,n,a),Fs(t,n,a,u),a=!0;else if(e===null){var h=t.stateNode,y=t.memoizedProps;h.props=y;var w=h.context,P=n.contextType;typeof P=="object"&&P!==null?P=Rt(P):(P=pt(n)?Xn:rt.current,P=Cr(t,P));var L=n.getDerivedStateFromProps,q=typeof L=="function"||typeof h.getSnapshotBeforeUpdate=="function";q||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==a||w!==P)&&ph(t,h,a,P),Rn=!1;var D=t.memoizedState;h.state=D,xo(t,a,h,u),w=t.memoizedState,y!==a||D!==w||dt.current||Rn?(typeof L=="function"&&(Ls(t,n,L,a),w=t.memoizedState),(y=Rn||fh(t,n,y,a,D,w,P))?(q||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=w),h.props=a,h.state=w,h.context=P,a=y):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{h=t.stateNode,zp(e,t),y=t.memoizedProps,P=t.type===t.elementType?y:Bt(t.type,y),h.props=P,q=t.pendingProps,D=h.context,w=n.contextType,typeof w=="object"&&w!==null?w=Rt(w):(w=pt(n)?Xn:rt.current,w=Cr(t,w));var Q=n.getDerivedStateFromProps;(L=typeof Q=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==q||D!==w)&&ph(t,h,a,w),Rn=!1,D=t.memoizedState,h.state=D,xo(t,a,h,u
Line truncated
|
||||
[Semi UI] createRoot 不可用。如果您正在使用 React 19,请在使用 Semi 组件前注入 createRoot。详情请参阅:https://semi.design/zh-CN/ecosystem/react19`))}const Di="__semi_react_root__";function OO(s,i){WC();const r=VC();if(r){Hy(!0);const o=i[Di]||r(i);Hy(!1),o.render(s),i[Di]=o}else qy?qy(s,i):KC()}function PO(s){s[Di]?(s[Di].unmount(),delete s[Di]):zy&&zy(s)}function GC(s){var i;try{const r=(i=s==null?void 0:s._reactInternals)!==null&&i!==void 0?i:s==null?void 0:s._reactInternalFiber;if(!r||typeof r!="object")return null;let o=r.child,l=0;const f=50;for(;o&&l<f;){if(l++,o.stateNode instanceof Element)return o.stateNode;if(o.child){o=o.child;continue}for(;o&&!o.sibling;){if(o===r)return null;o=o.return}if(o&&o!==r)o=o.sibling;else break}}catch{}return null}function ji(s){if(!s)return null;if(s instanceof Element)return s;if($y)try{const i=$y(s);return i instanceof Element?i:null}catch{return null}return GC(s)}function L1(s){var i,r,o;return s?D1>=19?(r=(i=s.props)===null||i===void 0?void 0:i.ref)!==null&&r!==void 0?r:null:(o=s.ref)!==null&&o!==void 0?o:null:null}const xa=I.createContext({}),XC=()=>document.body;class Ra extends Ee.PureComponent{constructor(i,r){var o;super(i),o=this,this.initContainer=function(l){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var d,p;try{let g;if(!o.el||!(!((d=o.state)===null||d===void 0)&&d.container)||!Array.from(o.state.container.childNodes).includes(o.el)){o.el=document.createElement("div");const _=(o.props.getPopupContainer||l.getPopupContainer||XC)();return _.appendChild(o.el),o.addStyle(o.props.style),o.addClass(o.props.prefixCls,l,o.props.className),g=_,g}}catch(g){if(!f)throw g}return(p=o.state)===null||p===void 0?void 0:p.container},this.addStyle=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(o.el)for(const f of Object.keys(l))o.el.style[f]=l[f]},this.addClass=function(l){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o.context;const{direction:d}=f;for(var p=arguments.length,g=new Array(p>2?p-2:0),m=2;m<p;m++)g[m-2]=arguments[m];const _=Le(l,...g,{[`${l}-rtl`]:d==="rtl"});o.el&&(o.el.className=_)},this.state={container:this.initContainer(r,!0)}}componentDidMount(){const i=this.initContainer(this.context);i!==this.state.container&&this.setState({container:i})}componentDidUpdate(i){const{didUpdate:r}=this.props;r&&r(i)}componentWillUnmount(){const{container:i}=this.state;i&&i.removeChild(this.el)}render(){const{state:i,props:r}=this;return i.container?_d.createPortal(r.children,this.el):null}}Ra.contextType=xa;Ra.defaultProps={prefixCls:`${qn}-portal`};Ra.propTypes={children:v.node,prefixCls:v.string,getPopupContainer:v.func,className:v.string,didUpdate:v.func};var QC=function(s,i){var r={};for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.indexOf(o)<0&&(r[o]=s[o]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(s);l<o.length;l++)i.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(s,o[l])&&(r[o[l]]=s[o[l]]);return r};const YC=s=>{const{className:i,style:r}=s,o=QC(s,["className","style"]);return I.createElement("svg",Object.assign({"aria-hidden":!0,className:i,style:r},o,{width:"24",height:"7",viewBox:"0 0 24 7",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"}),I.createElement("path",{d:"M24 0V1C20 1 18.5 2 16.5 4C14.5 6 14 7 12 7C10 7 9.5 6 7.5 4C5.5 2 4 1 0 1V0H24Z"}))};var ZC=function(s,i){var r={};for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.indexOf(o)<0&&(r[o]=s[o]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(s);l<o.length;l++)i.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(s,o[l])&&(r[o[l]]=s[o[l]]);return r};const JC=s=>{const{className:i,style:r}=s,o=ZC(s,["className","style"]);return I.createElement("svg",Object.assign({"aria-hidden":!0,className:i,style:r},o,{width:"7",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"}),I.createElement("path",{d:"M0 0L1 0C1 4, 2 5.5, 4 7.5S7,10 7,12S6 14.5, 4 16.5S1,20 1,24L0 24L0 0z"}))},eT=v.shape({offsetX:v.number,offsetY:v.number,width:v.number,height:v.number});class F1 extends I.Component{constructor(i){super(i),this.handleAnimationStart=()=>{var r,o;(o=(r=this.props).onAnimationStart)===null||o===void 0||o.call(r)},this.handleAnimationEnd=()=>{this.setState({currentClassName:this.props.endClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!1},()=>{var r,o;(o=(r=this.props).onAnimationEnd)===null||o===void 0||o.call(r,!1)})},this.state={currentClassName:this.props.startClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!0}}componentDidMount(){var i,r,o,l;(r=(i=this.props).onAnimationStart)===null||r===void 0||r.call(i),this.props.motion||((l=(o=this.props).onAnimationEnd)===null||l===void 0||l.call(o,!1),this.setState({isAnimating:!1}))}componentDidUpdate(i,r,o){const l=Object.keys(this.props).filter(f=>!
Line truncated
|
||||
[Semi UI] createRoot 不可用。如果您正在使用 React 19,请在使用 Semi 组件前注入 createRoot。详情请参阅:https://semi.design/zh-CN/ecosystem/react19`))}const Di="__semi_react_root__";function OO(s,i){WC();const r=VC();if(r){Hy(!0);const o=i[Di]||r(i);Hy(!1),o.render(s),i[Di]=o}else qy?qy(s,i):KC()}function PO(s){s[Di]?(s[Di].unmount(),delete s[Di]):zy&&zy(s)}function GC(s){var i;try{const r=(i=s==null?void 0:s._reactInternals)!==null&&i!==void 0?i:s==null?void 0:s._reactInternalFiber;if(!r||typeof r!="object")return null;let o=r.child,l=0;const f=50;for(;o&&l<f;){if(l++,o.stateNode instanceof Element)return o.stateNode;if(o.child){o=o.child;continue}for(;o&&!o.sibling;){if(o===r)return null;o=o.return}if(o&&o!==r)o=o.sibling;else break}}catch{}return null}function ji(s){if(!s)return null;if(s instanceof Element)return s;if($y)try{const i=$y(s);return i instanceof Element?i:null}catch{return null}return GC(s)}function L1(s){var i,r,o;return s?D1>=19?(r=(i=s.props)===null||i===void 0?void 0:i.ref)!==null&&r!==void 0?r:null:(o=s.ref)!==null&&o!==void 0?o:null:null}const xa=I.createContext({}),XC=()=>document.body;class Ra extends Ee.PureComponent{constructor(i,r){var o;super(i),o=this,this.initContainer=function(l){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var d,p;try{let g;if(!o.el||!(!((d=o.state)===null||d===void 0)&&d.container)||!Array.from(o.state.container.childNodes).includes(o.el)){o.el=document.createElement("div");const _=(o.props.getPopupContainer||l.getPopupContainer||XC)();return _.appendChild(o.el),o.addStyle(o.props.style),o.addClass(o.props.prefixCls,l,o.props.className),g=_,g}}catch(g){if(!f)throw g}return(p=o.state)===null||p===void 0?void 0:p.container},this.addStyle=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(o.el)for(const f of Object.keys(l))o.el.style[f]=l[f]},this.addClass=function(l){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o.context;const{direction:d}=f;for(var p=arguments.length,g=new Array(p>2?p-2:0),m=2;m<p;m++)g[m-2]=arguments[m];const _=Le(l,...g,{[`${l}-rtl`]:d==="rtl"});o.el&&(o.el.className=_)},this.state={container:this.initContainer(r,!0)}}componentDidMount(){const i=this.initContainer(this.context);i!==this.state.container&&this.setState({container:i})}componentDidUpdate(i){const{didUpdate:r}=this.props;r&&r(i)}componentWillUnmount(){const{container:i}=this.state;i&&i.removeChild(this.el)}render(){const{state:i,props:r}=this;return i.container?_d.createPortal(r.children,this.el):null}}Ra.contextType=xa;Ra.defaultProps={prefixCls:`${qn}-portal`};Ra.propTypes={children:v.node,prefixCls:v.string,getPopupContainer:v.func,className:v.string,didUpdate:v.func};var QC=function(s,i){var r={};for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.indexOf(o)<0&&(r[o]=s[o]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(s);l<o.length;l++)i.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(s,o[l])&&(r[o[l]]=s[o[l]]);return r};const YC=s=>{const{className:i,style:r}=s,o=QC(s,["className","style"]);return I.createElement("svg",Object.assign({"aria-hidden":!0,className:i,style:r},o,{width:"24",height:"7",viewBox:"0 0 24 7",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"}),I.createElement("path",{d:"M24 0V1C20 1 18.5 2 16.5 4C14.5 6 14 7 12 7C10 7 9.5 6 7.5 4C5.5 2 4 1 0 1V0H24Z"}))};var ZC=function(s,i){var r={};for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.indexOf(o)<0&&(r[o]=s[o]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(s);l<o.length;l++)i.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(s,o[l])&&(r[o[l]]=s[o[l]]);return r};const JC=s=>{const{className:i,style:r}=s,o=ZC(s,["className","style"]);return I.createElement("svg",Object.assign({"aria-hidden":!0,className:i,style:r},o,{width:"7",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"}),I.createElement("path",{d:"M0 0L1 0C1 4, 2 5.5, 4 7.5S7,10 7,12S6 14.5, 4 16.5S1,20 1,24L0 24L0 0z"}))},eT=v.shape({offsetX:v.number,offsetY:v.number,width:v.number,height:v.number});class F1 extends I.Component{constructor(i){super(i),this.handleAnimationStart=()=>{var r,o;(o=(r=this.props).onAnimationStart)===null||o===void 0||o.call(r)},this.handleAnimationEnd=()=>{this.setState({currentClassName:this.props.endClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!1},()=>{var r,o;(o=(r=this.props).onAnimationEnd)===null||o===void 0||o.call(r,!1)})},this.state={currentClassName:this.props.startClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!0}}componentDidMount(){var i,r,o,l;(r=(i=this.props).onAnimationStart)===null||r===void 0||r.call(i),this.props.motion||((l=(o=this.props).onAnimationEnd)===null||l===void 0||l.call(o,!1),this.setState({isAnimating:!1}))}componentDidUpdate(i,r,o){const l=Object.keys(this.props).filter(f=>!
Line truncated
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"product": "GenericAgent React Desktop 2.0",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"sourceRepository": "https://github.com/abraxas914/GenericAgent",
|
||||
"sourceCommit": "9fe5d69b85cfad8778ace84b6f69bc75f9e0d392",
|
||||
"sourceCommit": "4a67226e18cb003db1210357ea4a283774773acc",
|
||||
"generatedAssetCount": 98,
|
||||
"generatedManifestSha256": "bd1ee4cd8f0d3b8c00e8cf05a68af12d2ec0d6ff456212d2d5930e4ad6889ee2"
|
||||
"generatedManifestSha256": "06cbee59e1d232982095bb3966d7b23621b1aa785a6c7e90d82d66dedc5af7ed"
|
||||
}
|
||||
Vendored
+35
-35
@@ -1,38 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/svg+xml" href="/assets/ga-logo.svg">
|
||||
<title>GenericAgent</title>
|
||||
<script>
|
||||
// FOUC prevention: apply cached appearance before first paint
|
||||
(function(){
|
||||
var l=localStorage.getItem('ga_lang'); if(l==='en') document.documentElement.lang='en';
|
||||
var app=localStorage.getItem('ga_appearance')||'light';
|
||||
document.documentElement.dataset.appearance=app;
|
||||
var LEGACY_FONT={sm:12,md:14,lg:16};
|
||||
function chatFontPx(v){
|
||||
if(v&&LEGACY_FONT[v]) return LEGACY_FONT[v];
|
||||
var n=parseInt(v,10); if(!isNaN(n)&&n>=10&&n<=20) return n;
|
||||
return 14;
|
||||
}
|
||||
var fs=localStorage.getItem('ga_font_size');
|
||||
var cfp=chatFontPx(fs);
|
||||
document.documentElement.dataset.chatFont=String(cfp);
|
||||
document.documentElement.style.setProperty('--chat-font',cfp+'px');
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/main-BlLQtfpq.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/tauri-compat-tfiFK9EG.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index-Bpi3BHKj.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/WindowsTitlebar-CrkUa1UM.js">
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/svg+xml" href="/assets/ga-logo.svg">
|
||||
<title>GenericAgent</title>
|
||||
<script>
|
||||
// FOUC prevention: apply cached appearance before first paint
|
||||
(function(){
|
||||
var l=localStorage.getItem('ga_lang'); if(l==='en') document.documentElement.lang='en';
|
||||
var app=localStorage.getItem('ga_appearance')||'light';
|
||||
document.documentElement.dataset.appearance=app;
|
||||
var LEGACY_FONT={sm:12,md:14,lg:16};
|
||||
function chatFontPx(v){
|
||||
if(v&&LEGACY_FONT[v]) return LEGACY_FONT[v];
|
||||
var n=parseInt(v,10); if(!isNaN(n)&&n>=10&&n<=20) return n;
|
||||
return 14;
|
||||
}
|
||||
var fs=localStorage.getItem('ga_font_size');
|
||||
var cfp=chatFontPx(fs);
|
||||
document.documentElement.dataset.chatFont=String(cfp);
|
||||
document.documentElement.style.setProperty('--chat-font',cfp+'px');
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/main-j7e_THPB.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/tauri-compat-D_GD_wMe.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index-9FI8Jlf5.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/WindowsTitlebar-Byi-SYR_.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/tauri-compat-BTcpEvqB.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D0pGtk0y.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/WindowsTitlebar-U0YG9JNA.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/main-uLcKKTNv.css">
|
||||
</head>
|
||||
<body class="no-transition">
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
<link rel="stylesheet" crossorigin href="/assets/main-gzsbzrvY.css">
|
||||
</head>
|
||||
<body class="no-transition">
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+27
-27
@@ -1,36 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>GenericAgent</title>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>GenericAgent</title>
|
||||
<style>
|
||||
:root{color-scheme:light dark;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Microsoft YaHei UI",sans-serif;--ga-first-bg:#fff;--ga-first-text:#1c1f23;--ga-first-track:#e8e8e8;--ga-first-accent:#0064fa;background:var(--ga-first-bg);color:var(--ga-first-text)}
|
||||
@media(prefers-color-scheme:dark){:root{--ga-first-bg:#16161a;--ga-first-text:#f2f3f5;--ga-first-track:#34363c;--ga-first-accent:#54a9ff}}
|
||||
*{box-sizing:border-box}html,body,#loading-root{height:100%;margin:0}.ga-first-frame{height:100%;display:grid;place-items:center;background:var(--ga-first-bg)}.ga-first-spinner{width:28px;height:28px;border:3px solid var(--ga-first-track);border-top-color:var(--ga-first-accent);border-radius:50%;animation:ga-first-spin 1s linear infinite}@keyframes ga-first-spin{to{transform:rotate(360deg)}}
|
||||
@media(prefers-reduced-motion:reduce){.ga-first-spinner{animation-duration:1.8s}}
|
||||
</style>
|
||||
<script>
|
||||
window.__GA_LEGACY_PROGRESS__ = window.__GA_LEGACY_PROGRESS__ || [];
|
||||
window.gaProgress = function (pct, key) {
|
||||
window.__GA_LEGACY_PROGRESS__.push({ pct: pct, key: key });
|
||||
};
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/loading-VXGdS4iv.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/tauri-compat-tfiFK9EG.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index-D_sWIqse.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/Animation-TKQfYYOo.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/WindowsTitlebar-CrkUa1UM.js">
|
||||
</style>
|
||||
<script>
|
||||
window.__GA_LEGACY_PROGRESS__ = window.__GA_LEGACY_PROGRESS__ || [];
|
||||
window.gaProgress = function (pct, key) {
|
||||
window.__GA_LEGACY_PROGRESS__.push({ pct: pct, key: key });
|
||||
};
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/loading-C2VTZYXF.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/tauri-compat-D_GD_wMe.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index-D9Nakaf3.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/Animation-DbFrgT1j.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/WindowsTitlebar-Byi-SYR_.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/tauri-compat-BTcpEvqB.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DkG9Cu-r.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/WindowsTitlebar-U0YG9JNA.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/loading-6Qy4iUUr.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="loading-root">
|
||||
<div class="ga-first-frame" aria-label="GenericAgent is starting">
|
||||
<div class="ga-first-spinner" aria-hidden="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</head>
|
||||
<body>
|
||||
<div id="loading-root">
|
||||
<div class="ga-first-frame" aria-label="GenericAgent is starting">
|
||||
<div class="ga-first-spinner" aria-hidden="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+46
-46
@@ -1,54 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>GenericAgent — Fix startup</title>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>GenericAgent — Fix startup</title>
|
||||
<style>
|
||||
:root{color-scheme:light dark;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Microsoft YaHei UI",sans-serif;--ga-setup-first-bg:#fff;--ga-setup-first-track:#e8e8e8;--ga-setup-first-accent:#0064fa;background:var(--ga-setup-first-bg)}
|
||||
@media(prefers-color-scheme:dark){:root{--ga-setup-first-bg:#16161a;--ga-setup-first-track:#34363c;--ga-setup-first-accent:#54a9ff}}
|
||||
*{box-sizing:border-box}html,body,#setup-root{height:100%;margin:0}.ga-setup-first-frame{height:100%;display:grid;place-items:center;background:var(--ga-setup-first-bg)}.ga-setup-first-spinner{width:28px;height:28px;border:3px solid var(--ga-setup-first-track);border-top-color:var(--ga-setup-first-accent);border-radius:50%;animation:ga-setup-first-spin 1s linear infinite}@keyframes ga-setup-first-spin{to{transform:rotate(360deg)}}
|
||||
</style>
|
||||
<script>
|
||||
(function () {
|
||||
var ready = false;
|
||||
var timer = 0;
|
||||
function fallback(reason) {
|
||||
if (ready || window.__GA_SETUP_FALLBACK_STARTED__) return;
|
||||
window.__GA_SETUP_FALLBACK_STARTED__ = true;
|
||||
try { sessionStorage.setItem('ga-setup-fallback-reason', String(reason || 'setup_not_ready').slice(0, 120)); } catch (_) {}
|
||||
location.replace('fallback.html');
|
||||
}
|
||||
window.__GA_SETUP_MARK_READY__ = function () {
|
||||
ready = true;
|
||||
window.__GA_SETUP_READY__ = true;
|
||||
clearTimeout(timer);
|
||||
window.removeEventListener('error', onError);
|
||||
window.removeEventListener('unhandledrejection', onRejection);
|
||||
};
|
||||
function onError(event) { fallback(event && event.message ? event.message : 'setup_script_error'); }
|
||||
function onRejection() { fallback('setup_unhandled_rejection'); }
|
||||
window.addEventListener('error', onError);
|
||||
window.addEventListener('unhandledrejection', onRejection);
|
||||
timer = window.setTimeout(function () { fallback('setup_watchdog_timeout'); }, 8000);
|
||||
window.__GA_SETUP_FALLBACK__ = fallback;
|
||||
}());
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/setup-B0HJZv-E.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/tauri-compat-tfiFK9EG.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index-Bpi3BHKj.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index-DpGuh58E.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/IconFile-CgfQSwGI.js">
|
||||
</style>
|
||||
<script>
|
||||
(function () {
|
||||
var ready = false;
|
||||
var timer = 0;
|
||||
function fallback(reason) {
|
||||
if (ready || window.__GA_SETUP_FALLBACK_STARTED__) return;
|
||||
window.__GA_SETUP_FALLBACK_STARTED__ = true;
|
||||
try { sessionStorage.setItem('ga-setup-fallback-reason', String(reason || 'setup_not_ready').slice(0, 120)); } catch (_) {}
|
||||
location.replace('fallback.html');
|
||||
}
|
||||
window.__GA_SETUP_MARK_READY__ = function () {
|
||||
ready = true;
|
||||
window.__GA_SETUP_READY__ = true;
|
||||
clearTimeout(timer);
|
||||
window.removeEventListener('error', onError);
|
||||
window.removeEventListener('unhandledrejection', onRejection);
|
||||
};
|
||||
function onError(event) { fallback(event && event.message ? event.message : 'setup_script_error'); }
|
||||
function onRejection() { fallback('setup_unhandled_rejection'); }
|
||||
window.addEventListener('error', onError);
|
||||
window.addEventListener('unhandledrejection', onRejection);
|
||||
timer = window.setTimeout(function () { fallback('setup_watchdog_timeout'); }, 8000);
|
||||
window.__GA_SETUP_FALLBACK__ = fallback;
|
||||
}());
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/setup-BpPmqi-U.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/tauri-compat-D_GD_wMe.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index-9FI8Jlf5.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index-C-iCGtYr.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/IconFile-C8B3WX2U.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/tauri-compat-BTcpEvqB.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D0pGtk0y.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-ClU1uQYs.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/setup-D74O8rBf.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="setup-root">
|
||||
<div class="ga-setup-first-frame" aria-label="Loading startup recovery">
|
||||
<div class="ga-setup-first-spinner" aria-hidden="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</head>
|
||||
<body>
|
||||
<div id="setup-root">
|
||||
<div class="ga-setup-first-frame" aria-label="Loading startup recovery">
|
||||
<div class="ga-setup-first-spinner" aria-hidden="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "genericagent-web2",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"scripts": {
|
||||
"tauri": "tauri",
|
||||
"test:dist": "node scripts/verify-compiled-dist.mjs",
|
||||
|
||||
@@ -16,6 +16,8 @@ The React source, issue tracker, and contribution home is
|
||||
recorded in `dist/build-provenance.json`. `frontends/desktop/static/**` remains the independent Desktop v1 and is
|
||||
unchanged by Desktop 2.0 packaging.
|
||||
|
||||
The submitted package, bundle, qualification, and provenance version for this release is `0.2.1`.
|
||||
|
||||
The Semi Design MIT text is tracked as `dist/THIRD_PARTY_NOTICES.txt`. Root attributes force the source notice and
|
||||
compiled notice to LF on every platform, and all three package builders verify the locked notice SHA-256 before
|
||||
building.
|
||||
@@ -51,8 +53,10 @@ frontends/desktop/packaging/
|
||||
`2acf865e87e59090121369aac0575467067fdd7999923a70d785a46ceae3330f` and failing on any byte drift.
|
||||
- python-build-standalone is fixed at release `20260814`, CPython `3.12.14`, an explicit architecture, and an
|
||||
archive SHA-256 on each platform.
|
||||
- The macOS builder runs on the Apple-silicon `macos-15` host and uses host CPython `3.12.10` only for the
|
||||
hash-locked DMG layout tools. That host interpreter is separate from the embedded `3.12.14` runtime.
|
||||
- The macOS builder runs on the Apple-silicon `macos-26` host with
|
||||
`DEVELOPER_DIR=/Applications/Xcode_26.5.app/Contents/Developer` and hard-fails unless Xcode `26.5`
|
||||
(build `17F42`) and the macOS `26.5` SDK are active. Host CPython `3.12.10` is used only for the hash-locked
|
||||
DMG layout tools and remains separate from the embedded `3.12.14` runtime.
|
||||
- Windows converts `RUNNER_TEMP` with `cygpath -u` before passing its archive path to POSIX tools.
|
||||
- Linux builds on Ubuntu 22.04, uses a dedicated glibc-2.35 Rust cache prefix with target/bin caching disabled,
|
||||
and scans every packaged ELF to reject a maximum GLIBC requirement above 2.35.
|
||||
|
||||
@@ -39,7 +39,7 @@ BRIDGE_HOST = "127.0.0.1"
|
||||
DEFAULT_BRIDGE_PORT = 14168
|
||||
BRIDGE_PORT = DEFAULT_BRIDGE_PORT
|
||||
BRIDGE_BASE = f"http://{BRIDGE_HOST}:{BRIDGE_PORT}"
|
||||
RELEASE_VERSION = "0.2.0"
|
||||
RELEASE_VERSION = "0.2.1"
|
||||
CONDUCTOR_SERVICE_ID = "frontends/conductor.py"
|
||||
DEFAULT_CONDUCTOR_PORT = 8900
|
||||
E2E_CONDUCTOR_PORT_ENV = "GA_DESKTOP_E2E_CONDUCTOR_PORT"
|
||||
|
||||
@@ -56,8 +56,8 @@ def assert_report(name: str, report: dict[str, Any], expected_commit: str) -> li
|
||||
actual_commit = str(report.get("expectedCommit", "")).lower()
|
||||
if actual_commit != expected_commit.lower():
|
||||
failures.append(f"{name}: commit {actual_commit!r} != {expected_commit!r}")
|
||||
if report.get("releaseVersion") != "0.2.0":
|
||||
failures.append(f"{name}: release version is not 0.2.0")
|
||||
if report.get("releaseVersion") != "0.2.1":
|
||||
failures.append(f"{name}: release version is not 0.2.1")
|
||||
if report.get("success") is not True:
|
||||
failures.append(f"{name}: automated qualification did not pass")
|
||||
if not str(report.get("artifact", {}).get("sha256", "")):
|
||||
@@ -152,7 +152,7 @@ def main() -> int:
|
||||
manifest = {
|
||||
"schemaVersion": 1,
|
||||
"candidateCommit": args.expected_commit,
|
||||
"releaseVersion": "0.2.0",
|
||||
"releaseVersion": "0.2.1",
|
||||
"platforms": {
|
||||
name: {
|
||||
"report": report["_path"],
|
||||
|
||||
@@ -7,8 +7,8 @@ import { fileURLToPath } from 'node:url';
|
||||
const desktopDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const repoRoot = path.resolve(desktopDir, '..', '..');
|
||||
const distDir = path.join(desktopDir, 'dist');
|
||||
const expectedVersion = '0.2.0';
|
||||
const expectedSourceCommit = '9fe5d69b85cfad8778ace84b6f69bc75f9e0d392';
|
||||
const expectedVersion = '0.2.1';
|
||||
const expectedSourceCommit = '4a67226e18cb003db1210357ea4a283774773acc';
|
||||
const expectedNoticeSha256 = '2acf865e87e59090121369aac0575467067fdd7999923a70d785a46ceae3330f';
|
||||
const noticeAttributeRules = [
|
||||
'frontends/desktop/public/THIRD_PARTY_NOTICES.txt text eol=lf',
|
||||
@@ -141,10 +141,10 @@ async function verifyVersionsRendererAndEntry() {
|
||||
for (const sourceBuildKey of ['beforeBuildCommand', 'beforeDevCommand', 'devUrl']) {
|
||||
if (sourceBuildKey in tauriConfig.build) fail(`compiled-only Tauri config must not require ${sourceBuildKey}`);
|
||||
}
|
||||
if (!/^\[package\][\s\S]*?^name = "ga-desktop"$[\s\S]*?^version = "0\.2\.0"$/m.test(cargoToml)) {
|
||||
if (!/^\[package\][\s\S]*?^name = "ga-desktop"$[\s\S]*?^version = "0\.2\.1"$/m.test(cargoToml)) {
|
||||
fail(`Cargo.toml ga-desktop version must be ${expectedVersion}`);
|
||||
}
|
||||
if (!/^\[\[package\]\][\s\S]*?^name = "ga-desktop"$\nversion = "0\.2\.0"$/m.test(cargoLock)) {
|
||||
if (!/^\[\[package\]\][\s\S]*?^name = "ga-desktop"$\nversion = "0\.2\.1"$/m.test(cargoLock)) {
|
||||
fail(`Cargo.lock ga-desktop version must be ${expectedVersion}`);
|
||||
}
|
||||
|
||||
@@ -249,11 +249,15 @@ async function verifyReleaseContract() {
|
||||
fail('Windows packaging must convert RUNNER_TEMP with cygpath before POSIX tools use it');
|
||||
}
|
||||
const macos = workflowJob(workflow, 'build-macos');
|
||||
if (!macos.includes('runs-on: macos-15')
|
||||
if (!macos.includes('runs-on: macos-26')
|
||||
|| !macos.includes('DEVELOPER_DIR: /Applications/Xcode_26.5.app/Contents/Developer')
|
||||
|| !macos.includes('test "$(uname -m)" = arm64')
|
||||
|| !macos.includes('test "$(xcodebuild -version | sed -n \'1p\')" = "Xcode 26.5"')
|
||||
|| !macos.includes('test "$(xcodebuild -version | sed -n \'2p\')" = "Build version 17F42"')
|
||||
|| !macos.includes('test "$(xcrun --sdk macosx --show-sdk-version)" = "26.5"')
|
||||
|| !workflow.includes('MACOS_PACKAGING_PYTHON_VERSION: "3.12.10"')
|
||||
|| !workflow.includes('PBS_PYTHON_VERSION: "3.12.14"')) {
|
||||
fail('macOS packaging must use the pinned arm64 host and separate Python inputs');
|
||||
fail('macOS packaging must pin macos-26, Xcode 26.5 build 17F42, SDK 26.5, arm64, and separate Python inputs');
|
||||
}
|
||||
const linux = workflowJob(workflow, 'build-linux');
|
||||
if (!linux.includes('runs-on: ubuntu-22.04')
|
||||
@@ -347,12 +351,26 @@ async function main() {
|
||||
if (forbiddenSource.length > 0) fail(`compiled distribution contains source files: ${forbiddenSource.join(', ')}`);
|
||||
|
||||
const searchableFiles = files.filter((file) => /\.(?:html|js|css)$/i.test(file));
|
||||
const searchableContents = [];
|
||||
for (const file of searchableFiles) {
|
||||
const contents = await readFile(file, 'utf8');
|
||||
searchableContents.push(contents);
|
||||
if (/(?:webdriverio|__GA_E2E__|wdio:|sourceMappingURL|webpack:\/\/|\/Users\/)/i.test(contents)) {
|
||||
fail(`compiled distribution leaks source/E2E material: ${relativeToDist(file)}`);
|
||||
}
|
||||
}
|
||||
const compiledRenderer = searchableContents.join('\n');
|
||||
for (const marker of [
|
||||
'services/capabilities',
|
||||
'data-import-row',
|
||||
'data-export-row',
|
||||
'get_macos_titlebar_metrics',
|
||||
'titlebar-controls',
|
||||
]) {
|
||||
if (!compiledRenderer.includes(marker)) {
|
||||
fail(`compiled distribution is missing the v0.2.1 renderer contract: ${marker}`);
|
||||
}
|
||||
}
|
||||
|
||||
const notice = await readFile(path.join(distDir, 'THIRD_PARTY_NOTICES.txt'));
|
||||
if (sha256(notice) !== expectedNoticeSha256) fail('Semi Design third-party notice hash is incorrect');
|
||||
|
||||
Generated
+2
-1
@@ -1253,9 +1253,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ga-desktop"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
dependencies = [
|
||||
"dirs 5.0.1",
|
||||
"objc2-app-kit",
|
||||
"rfd",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ga-desktop"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
edition = "2021"
|
||||
|
||||
[build-dependencies]
|
||||
@@ -17,6 +17,9 @@ serde_json = "1"
|
||||
dirs = "5"
|
||||
rfd = "0.15"
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
objc2-app-kit = { version = "0.3.2", default-features = false, features = ["NSButton", "NSControl", "NSView", "NSWindow"] }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
e2e = ["dep:tauri-plugin-wdio", "dep:tauri-plugin-wdio-webdriver"]
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"allow-validate-ga-source",
|
||||
"allow-set-ga-source",
|
||||
"allow-clear-ga-source",
|
||||
"allow-get-macos-titlebar-metrics",
|
||||
"allow-shortcut-should-ask",
|
||||
"allow-shortcut-decide",
|
||||
"opener:allow-open-url",
|
||||
|
||||
@@ -78,6 +78,11 @@ identifier = "allow-clear-ga-source"
|
||||
description = "Clear the external GA source override and fall back to the bundled runtime."
|
||||
commands.allow = ["clear_ga_source"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-get-macos-titlebar-metrics"
|
||||
description = "Read native macOS traffic-light geometry for the main window."
|
||||
commands.allow = ["get_macos_titlebar_metrics"]
|
||||
|
||||
[[permission]]
|
||||
identifier = "allow-shortcut-should-ask"
|
||||
description = "Check whether to show the first-run desktop-shortcut prompt."
|
||||
|
||||
@@ -2729,6 +2729,101 @@ async fn clear_ga_source(app_handle: tauri::AppHandle) -> Result<String, String>
|
||||
apply_ga_source_with_rollback(app_handle, None, previous_override).await
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct MacosTitlebarMetrics {
|
||||
traffic_light_center_y: f64,
|
||||
traffic_light_right_x: f64,
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fn measure_macos_titlebar_metrics(
|
||||
webview: &tauri::webview::PlatformWebview,
|
||||
) -> Result<MacosTitlebarMetrics, String> {
|
||||
use objc2_app_kit::{NSView, NSWindow, NSWindowButton};
|
||||
|
||||
let ns_window = webview.ns_window();
|
||||
let webview_handle = webview.inner();
|
||||
if ns_window.is_null() || webview_handle.is_null() {
|
||||
return Err("macOS titlebar native handles are unavailable".to_string());
|
||||
}
|
||||
|
||||
// SAFETY: Tauri documents these handles as the NSWindow and WKWebView for
|
||||
// this callback. with_webview schedules the callback on the main thread.
|
||||
let window = unsafe { &*ns_window.cast::<NSWindow>() };
|
||||
let content_view = unsafe { &*webview_handle.cast::<NSView>() };
|
||||
let bounds = content_view.bounds();
|
||||
|
||||
let mut min_y = f64::INFINITY;
|
||||
let mut max_x = f64::NEG_INFINITY;
|
||||
let mut max_y = f64::NEG_INFINITY;
|
||||
for kind in [
|
||||
NSWindowButton::CloseButton,
|
||||
NSWindowButton::MiniaturizeButton,
|
||||
NSWindowButton::ZoomButton,
|
||||
] {
|
||||
let button = window
|
||||
.standardWindowButton(kind)
|
||||
.ok_or_else(|| "macOS titlebar button is unavailable".to_string())?;
|
||||
// SAFETY: AppKit owns the standard button and its superview for the
|
||||
// lifetime of this main-thread callback.
|
||||
let superview = unsafe { button.superview() }
|
||||
.ok_or_else(|| "macOS titlebar button has no superview".to_string())?;
|
||||
let rect = content_view.convertRect_fromView(button.frame(), Some(&superview));
|
||||
min_y = min_y.min(rect.origin.y);
|
||||
max_x = max_x.max(rect.origin.x + rect.size.width);
|
||||
max_y = max_y.max(rect.origin.y + rect.size.height);
|
||||
}
|
||||
|
||||
let appkit_center_y = min_y + (max_y - min_y) / 2.0;
|
||||
let traffic_light_center_y = if content_view.isFlipped() {
|
||||
appkit_center_y - bounds.origin.y
|
||||
} else {
|
||||
bounds.origin.y + bounds.size.height - appkit_center_y
|
||||
};
|
||||
let metrics = MacosTitlebarMetrics {
|
||||
traffic_light_center_y,
|
||||
traffic_light_right_x: max_x - bounds.origin.x,
|
||||
};
|
||||
if !metrics.traffic_light_center_y.is_finite()
|
||||
|| !metrics.traffic_light_right_x.is_finite()
|
||||
|| metrics.traffic_light_center_y < 0.0
|
||||
|| metrics.traffic_light_right_x < 0.0
|
||||
{
|
||||
return Err("macOS titlebar metrics are invalid".to_string());
|
||||
}
|
||||
Ok(metrics)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn get_macos_titlebar_metrics(
|
||||
window: tauri::WebviewWindow,
|
||||
) -> Result<Option<MacosTitlebarMetrics>, String> {
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
let (sender, receiver) = std::sync::mpsc::sync_channel(1);
|
||||
window
|
||||
.with_webview(move |webview| {
|
||||
let _ = sender.send(measure_macos_titlebar_metrics(&webview));
|
||||
})
|
||||
.map_err(|error| format!("cannot schedule macOS titlebar measurement: {error}"))?;
|
||||
return tauri::async_runtime::spawn_blocking(move || {
|
||||
receiver
|
||||
.recv_timeout(Duration::from_secs(1))
|
||||
.map_err(|_| "macOS titlebar measurement timed out".to_string())?
|
||||
.map(Some)
|
||||
})
|
||||
.await
|
||||
.map_err(|error| format!("macOS titlebar measurement task failed: {error}"))?;
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
{
|
||||
let _ = window;
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
@@ -2783,6 +2878,7 @@ pub fn run() {
|
||||
validate_ga_source,
|
||||
set_ga_source,
|
||||
clear_ga_source,
|
||||
get_macos_titlebar_metrics,
|
||||
shortcut_should_ask,
|
||||
shortcut_decide
|
||||
])
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"productName": "GenericAgent",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"identifier": "com.genericagent.app",
|
||||
"build": {
|
||||
"frontendDist": "../dist"
|
||||
|
||||
@@ -23,6 +23,7 @@ HTTP API:
|
||||
POST /services/stop body: {"id":"frontends/qqapp.py"}
|
||||
GET /services/logs?id=frontends/qqapp.py&tail=200
|
||||
GET /services/panel
|
||||
GET /services/capabilities
|
||||
GET /services/mykey
|
||||
POST /services/mykey body: {"content":"..."}
|
||||
POST /services/stop-extras stop conductor + scheduler (127.0.0.1 only)
|
||||
@@ -1021,7 +1022,9 @@ class AgentManager:
|
||||
sess.cancel_requested = False
|
||||
sess.active_turn_id = turn_id
|
||||
sess.last_error = ""
|
||||
sess.partial = {"id": sess.msg_seq + 1, "role": "assistant", "content": "", "ts": time.time(), "partial": True,
|
||||
_turn_start = time.time()
|
||||
sess.partial = {"id": sess.msg_seq + 1, "role": "assistant", "content": "", "ts": _turn_start, "partial": True,
|
||||
"turn_started": _turn_start, # stable turn-start clock (ts gets bumped on each stream chunk)
|
||||
"curr_turn": 0, "turn_segs": []} # turn_segs[i]=第i轮全文(权威结构化,前端按轮渲染);content保留双轮兜底
|
||||
image_paths = [m["path"] for m in (image_metas or []) if m.get("path")]
|
||||
t = threading.Thread(
|
||||
@@ -1211,16 +1214,19 @@ class AgentManager:
|
||||
with self.lock:
|
||||
if sess.active_turn_id != turn_id:
|
||||
return
|
||||
turn_started = sess.partial.get("turn_started") if sess.partial else None
|
||||
sess.partial = None
|
||||
full = strip_final_info_marker(full)
|
||||
import plan_state
|
||||
plan_state.sync_plan_path_from_text(sess, full, sess.cwd or self.ga_root)
|
||||
# 轨道2: 落库时带结构化全量轮(权威turn_segs),前端按轮渲染;content保留兜底
|
||||
_final_segs = normalize_final_turn_segs(full, done_outputs)
|
||||
msg_extra = {}
|
||||
if _final_segs:
|
||||
self.add_message(sess, "assistant", full, turn_segs=_final_segs)
|
||||
else:
|
||||
self.add_message(sess, "assistant", full)
|
||||
msg_extra["turn_segs"] = _final_segs
|
||||
if turn_started:
|
||||
msg_extra["executionMs"] = round((time.time() - turn_started) * 1000)
|
||||
self.add_message(sess, "assistant", full, **msg_extra)
|
||||
try: sess.llm_history = json.loads(json.dumps(agent.llmclient.backend.history, ensure_ascii=False, default=str))
|
||||
except Exception: pass
|
||||
sess.running_llm_no = None
|
||||
@@ -1956,6 +1962,29 @@ def _allowed_request_origins() -> Set[str]:
|
||||
return origins
|
||||
|
||||
|
||||
# Read-only GET endpoints that are meant to be loaded as browser subresources
|
||||
# (<img>/<video>/<audio>/font). Cross-origin resource loads never carry an
|
||||
# Origin header but do set Sec-Fetch-Site: cross-site, so the generic CSRF guard
|
||||
# below would 403 them. These endpoints have no side effects and are confined to
|
||||
# a whitelisted directory, so a cross-site *resource* GET/HEAD is safe to allow.
|
||||
_RESOURCE_GET_PATHS = frozenset({"/upload/raw"})
|
||||
_RESOURCE_FETCH_DESTS = frozenset({"image", "video", "audio", "font"})
|
||||
|
||||
|
||||
def _is_safe_cross_site_resource_get(request) -> bool:
|
||||
"""True for a no-side-effect subresource GET the desktop webview issues for
|
||||
a message-bubble thumbnail (bridge origin differs from the tauri app origin,
|
||||
so the <img> request is cross-site and carries no Origin header)."""
|
||||
if request.method not in ("GET", "HEAD"):
|
||||
return False
|
||||
if request.path not in _RESOURCE_GET_PATHS:
|
||||
return False
|
||||
dest = request.headers.get("Sec-Fetch-Dest", "").strip().lower()
|
||||
# Only genuine subresource loads — never a cross-site top-level navigation
|
||||
# (Sec-Fetch-Dest: document) — are exempted.
|
||||
return dest in _RESOURCE_FETCH_DESTS
|
||||
|
||||
|
||||
def _request_origin_error(request) -> Optional[str]:
|
||||
origin = request.headers.get("Origin")
|
||||
if origin is not None:
|
||||
@@ -1963,6 +1992,8 @@ def _request_origin_error(request) -> Optional[str]:
|
||||
return "request origin is not allowed"
|
||||
return None
|
||||
if request.headers.get("Sec-Fetch-Site", "").strip().lower() == "cross-site":
|
||||
if _is_safe_cross_site_resource_get(request):
|
||||
return None
|
||||
return "cross-site request without an Origin header is not allowed"
|
||||
return None
|
||||
|
||||
@@ -2414,6 +2445,49 @@ async def upload_handler(request):
|
||||
return json_ok({"ok": True, "path": str(fpath)})
|
||||
|
||||
|
||||
# Max bytes we will base64 back to the webview for an image preview. Larger
|
||||
# images (and all non-images) skip the read: the agent opens them by path.
|
||||
_DROP_PREVIEW_MAX = 50 * 1024 * 1024
|
||||
|
||||
|
||||
async def drop_stat_handler(request):
|
||||
"""Inspect a path dropped onto the window via Tauri's native drag-drop.
|
||||
|
||||
Body: {path: "<abs path>", preview: <bool>}
|
||||
Native drops give absolute paths (not File objects), so the client asks the
|
||||
bridge what the path is. Returns is_dir + size for every path; when preview
|
||||
is truthy and the target is a readable image under the size cap, also returns
|
||||
a base64 data payload so the composer can render a thumbnail. Files and
|
||||
folders otherwise travel to the agent by path alone (it reads via file_read
|
||||
/ os.walk), so no bytes cross the wire for them.
|
||||
"""
|
||||
import mimetypes
|
||||
data = await read_json(request)
|
||||
raw = (data.get("path") or "").strip()
|
||||
want_preview = bool(data.get("preview"))
|
||||
if not raw:
|
||||
return json_ok({"ok": False, "error": "missing path"})
|
||||
try:
|
||||
target = Path(raw)
|
||||
st = target.stat()
|
||||
except FileNotFoundError:
|
||||
return json_ok({"ok": False, "error": "not found"})
|
||||
except OSError as e:
|
||||
return json_ok({"ok": False, "error": str(e)})
|
||||
is_dir = target.is_dir()
|
||||
size = 0 if is_dir else st.st_size
|
||||
result = {"ok": True, "is_dir": is_dir, "size": size, "name": target.name}
|
||||
if want_preview and not is_dir and size <= _DROP_PREVIEW_MAX:
|
||||
ctype = mimetypes.guess_type(target.name)[0] or ""
|
||||
if ctype.startswith("image/") and ctype != "image/svg+xml":
|
||||
try:
|
||||
encoded = base64.b64encode(target.read_bytes()).decode("ascii")
|
||||
result["preview"] = f"data:{ctype};base64,{encoded}"
|
||||
except OSError:
|
||||
pass
|
||||
return json_ok(result)
|
||||
|
||||
|
||||
async def upload_delete_handler(request):
|
||||
"""Delete a previously-uploaded file. Path must live under _WEB_UPLOAD_DIR."""
|
||||
data = await read_json(request)
|
||||
@@ -2748,6 +2822,10 @@ async def identity_handler(request):
|
||||
"build_id": os.environ.get("GA_BUILD_ID", "")})
|
||||
|
||||
|
||||
async def service_capabilities_handler(request):
|
||||
return json_ok({"dataBackup": True})
|
||||
|
||||
|
||||
def _exit_bridge() -> None:
|
||||
with contextlib.suppress(Exception):
|
||||
services.stop_all_extras()
|
||||
@@ -2870,6 +2948,7 @@ def create_app():
|
||||
app.router.add_post("/upload", upload_handler)
|
||||
app.router.add_delete("/upload", upload_delete_handler)
|
||||
app.router.add_get("/upload/raw", upload_raw_handler)
|
||||
app.router.add_post("/drop/stat", drop_stat_handler)
|
||||
app.router.add_get("/token-stats", token_stats_handler)
|
||||
app.router.add_get("/token-history", get_token_history_handler)
|
||||
app.router.add_get("/subscription-portal", subscription_portal_handler)
|
||||
@@ -2887,6 +2966,7 @@ def create_app():
|
||||
app.router.add_post("/services/conductor/model", conductor_model_save_handler)
|
||||
app.router.add_post("/services/stop-extras", stop_extras_handler)
|
||||
app.router.add_post("/services/start-extras", start_extras_handler)
|
||||
app.router.add_get("/services/capabilities", service_capabilities_handler)
|
||||
app.router.add_get("/services/identity", identity_handler)
|
||||
app.router.add_post("/services/bridge/exit", bridge_exit_handler)
|
||||
if _e2e_control_token() is not None:
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
"""Regression coverage for explicit Desktop bridge capabilities."""
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
from aiohttp.test_utils import TestClient, TestServer
|
||||
|
||||
from frontends.tests.test_bridge_sessions import _mod as bridge
|
||||
|
||||
|
||||
def test_real_aiohttp_routes_expose_data_backup_capability(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
monkeypatch.setattr(bridge.services, "autostart_extras", lambda: None)
|
||||
monkeypatch.setattr(bridge.services, "stop_all_extras", lambda: None)
|
||||
|
||||
async def scenario() -> None:
|
||||
app = bridge.create_app()
|
||||
client = TestClient(TestServer(app))
|
||||
await client.start_server()
|
||||
try:
|
||||
inspect_head = await client.head("/memory/import/inspect")
|
||||
assert inspect_head.status == 404
|
||||
|
||||
capabilities = await client.get("/services/capabilities")
|
||||
assert capabilities.status == 200
|
||||
assert await capabilities.json() == {"dataBackup": True}
|
||||
|
||||
routes = {
|
||||
(route.method, route.resource.canonical)
|
||||
for route in app.router.routes()
|
||||
}
|
||||
assert ("POST", "/memory/import/inspect") in routes
|
||||
assert ("POST", "/memory/import") in routes
|
||||
assert ("POST", "/memory/export") in routes
|
||||
finally:
|
||||
await client.close()
|
||||
|
||||
asyncio.run(scenario())
|
||||
@@ -15,6 +15,7 @@ PROTECTED_PATHS = (
|
||||
"/status",
|
||||
"/memory/export",
|
||||
"/memory/import/inspect",
|
||||
"/services/capabilities",
|
||||
"/upload",
|
||||
"/upload/raw",
|
||||
)
|
||||
@@ -131,6 +132,58 @@ def test_no_origin_cli_is_allowed_but_cross_site_navigation_is_rejected(
|
||||
asyncio.run(_with_client(scenario, tmp_path))
|
||||
|
||||
|
||||
def test_cross_site_resource_get_is_allowed_for_upload_raw_only(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
):
|
||||
"""Subresource loads (<img>/<video>) from the webview must reach /upload/raw
|
||||
even though the bridge origin (127.0.0.1) differs from the app origin
|
||||
(tauri.localhost), causing browsers to send Sec-Fetch-Site: cross-site without
|
||||
an Origin header. Other paths and non-resource destinations remain blocked."""
|
||||
monkeypatch.delenv("GA_E2E", raising=False)
|
||||
|
||||
async def scenario(client: TestClient, side_effect: Path):
|
||||
# Real <img> load: cross-site, no Origin, Sec-Fetch-Dest: image → allowed
|
||||
response = await client.get(
|
||||
"/upload/raw",
|
||||
headers={"Sec-Fetch-Site": "cross-site", "Sec-Fetch-Dest": "image"},
|
||||
)
|
||||
assert response.status == 200
|
||||
assert await response.text() == "protected-secret"
|
||||
|
||||
# Also OK for video, audio, font
|
||||
for dest in ("video", "audio", "font"):
|
||||
side_effect.unlink()
|
||||
r = await client.get(
|
||||
"/upload/raw",
|
||||
headers={"Sec-Fetch-Site": "cross-site", "Sec-Fetch-Dest": dest},
|
||||
)
|
||||
assert r.status == 200
|
||||
|
||||
# But top-level cross-site navigation (Sec-Fetch-Dest: document) → blocked
|
||||
side_effect.unlink()
|
||||
nav = await client.get(
|
||||
"/upload/raw",
|
||||
headers={"Sec-Fetch-Site": "cross-site", "Sec-Fetch-Dest": "document"},
|
||||
)
|
||||
assert nav.status == 403
|
||||
assert not side_effect.exists()
|
||||
|
||||
# Evil Origin to /upload/raw still rejected (existing coverage)
|
||||
for origin in ("http://evil.example", "null"):
|
||||
rejected = await client.get("/upload/raw", headers={"Origin": origin})
|
||||
assert rejected.status == 403
|
||||
|
||||
# Other protected paths remain cross-site blocked
|
||||
for path in ("/status", "/upload", "/services/capabilities"):
|
||||
rejected = await client.get(
|
||||
path,
|
||||
headers={"Sec-Fetch-Site": "cross-site", "Sec-Fetch-Dest": "image"},
|
||||
)
|
||||
assert rejected.status == 403
|
||||
|
||||
asyncio.run(_with_client(scenario, tmp_path))
|
||||
|
||||
|
||||
def test_e2e_origin_requires_explicit_mode_and_a_strict_valid_port(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
):
|
||||
|
||||
@@ -64,7 +64,7 @@ def complete_report(platform: str = "linux"):
|
||||
}
|
||||
return {
|
||||
"expectedCommit": "abc1234",
|
||||
"releaseVersion": "0.2.0",
|
||||
"releaseVersion": "0.2.1",
|
||||
"artifact": {"sha256": "f" * 64},
|
||||
"environment": {"isolatedConductorPort": isolated_port},
|
||||
"success": True,
|
||||
@@ -180,8 +180,8 @@ def write_info_plist(root: Path, **overrides):
|
||||
contents = root / "Contents"
|
||||
contents.mkdir(parents=True, exist_ok=True)
|
||||
values = {
|
||||
"CFBundleShortVersionString": "0.2.0",
|
||||
"CFBundleVersion": "0.2.0",
|
||||
"CFBundleShortVersionString": "0.2.1",
|
||||
"CFBundleVersion": "0.2.1",
|
||||
**overrides,
|
||||
}
|
||||
with (contents / "Info.plist").open("wb") as stream:
|
||||
@@ -190,11 +190,11 @@ def write_info_plist(root: Path, **overrides):
|
||||
|
||||
def test_macos_package_version_comes_from_both_native_bundle_keys(tmp_path):
|
||||
write_info_plist(tmp_path)
|
||||
assert journey.read_macos_bundle_versions(tmp_path) == ("0.2.0", "0.2.0")
|
||||
assert journey.read_macos_bundle_versions(tmp_path) == ("0.2.1", "0.2.1")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("key", ["CFBundleShortVersionString", "CFBundleVersion"])
|
||||
@pytest.mark.parametrize("value", ["0.2.1", 200])
|
||||
@pytest.mark.parametrize("value", ["0.2.0", 200])
|
||||
def test_macos_package_version_rejects_wrong_or_non_string_keys(tmp_path, key, value):
|
||||
write_info_plist(tmp_path, **{key: value})
|
||||
with pytest.raises(journey.JourneyFailure, match=key):
|
||||
@@ -258,8 +258,8 @@ def test_package_shape_rejects_excluded_source_package_json(tmp_path):
|
||||
(runtime_root / "app" / "frontends" / "desktop" / "package.json").unlink()
|
||||
candidate.check_package_shape()
|
||||
assert candidate.report["checks"] == {
|
||||
"packagedVersion": "0.2.0",
|
||||
"packagedBundleVersion": "0.2.0",
|
||||
"packagedVersion": "0.2.1",
|
||||
"packagedBundleVersion": "0.2.1",
|
||||
"packageShape": True,
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ def test_main_and_setup_capabilities_are_window_scoped_without_remote_ipc_access
|
||||
"core:window:allow-start-dragging",
|
||||
"opener:allow-open-url",
|
||||
"opener:allow-default-urls",
|
||||
"allow-get-macos-titlebar-metrics",
|
||||
} <= main_permissions
|
||||
|
||||
assert {
|
||||
@@ -94,6 +95,7 @@ def test_main_and_setup_capabilities_are_window_scoped_without_remote_ipc_access
|
||||
"allow-reveal-in-file-manager",
|
||||
"allow-set-ga-source",
|
||||
"allow-clear-ga-source",
|
||||
"allow-get-macos-titlebar-metrics",
|
||||
"opener:allow-open-url",
|
||||
}
|
||||
)
|
||||
@@ -123,3 +125,16 @@ def test_e2e_config_only_adds_test_driver_and_dynamic_loopback_connectivity():
|
||||
"ws://127.0.0.1:*",
|
||||
}
|
||||
assert not any(source.startswith("https://") for source in connect_sources)
|
||||
|
||||
|
||||
def test_native_titlebar_metrics_command_is_main_window_only():
|
||||
main = _json(TAURI_ROOT / "capabilities" / "default.json")
|
||||
setup = _json(TAURI_ROOT / "capabilities" / "setup.json")
|
||||
permissions = (TAURI_ROOT / "permissions" / "bridge-commands.toml").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
assert "allow-get-macos-titlebar-metrics" in main["permissions"]
|
||||
assert "allow-get-macos-titlebar-metrics" not in setup["permissions"]
|
||||
assert 'identifier = "allow-get-macos-titlebar-metrics"' in permissions
|
||||
assert 'commands.allow = ["get_macos_titlebar_metrics"]' in permissions
|
||||
Reference in new issue
Block a user