Files
llm-in-text/.build-check/assets/vendor-micromark-Dc687xHH.js
ydy0615 838eec30a8 feat: add theme management with light and dark modes
- Implemented a new composable `useTheme` for managing theme state.
- Added functions to read and write theme preference to local storage.
- Applied theme styles to the DOM based on user preference.
- Introduced a toggle function to switch between light and dark themes.

refactor: enhance copilot plugin functionality

- Improved request handling with sequence and document versioning.
- Refactored ghost text handling to improve clarity and efficiency.
- Updated markdown insertion logic to handle parsed content more robustly.
- Enhanced error handling and logging for better debugging.

style: update global styles for light and dark themes

- Defined CSS variables for light and dark themes to streamline styling.
- Improved overall styling consistency and responsiveness.
- Added transitions for smoother theme changes and interactions.
2026-02-15 15:44:09 +08:00

4 lines
9.9 KiB
JavaScript

import{c as fn}from"./vendor-micromark-util-combine-extensions-d8XJZrgA.js";import{f as K}from"./vendor-micromark-factory-space-BM4zcA-B.js";import{m as V}from"./vendor-micromark-util-character-Cn8n62xE.js";import{s as G,p as dn}from"./vendor-micromark-util-chunked-DrRIdSP-.js";import{b as hn,c as pn,a as xn,l as b,d as mn,e as H,f as Z,t as Q,s as nn,h as gn,g as kn,i as rn,j as on,k as wn,m as J,n as bn,o as Cn,p as _n,q as vn,r as In,u as yn,v as U}from"./vendor-micromark-core-commonmark-BEN53qso.js";import{r as Sn}from"./vendor-micromark-util-resolve-all-PQCKh0dx.js";import{s as Tn}from"./vendor-micromark-util-subtokenize-BF1Jf29a.js";const An={tokenize:zn};function zn(n){const t=n.attempt(this.parser.constructs.contentInitial,e,o);let r;return t;function e(l){if(l===null){n.consume(l);return}return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),K(n,t,"linePrefix")}function o(l){return n.enter("paragraph"),i(l)}function i(l){const d=n.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=d),r=d,u(l)}function u(l){if(l===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(l);return}return V(l)?(n.consume(l),n.exit("chunkText"),i):(n.consume(l),u)}}const Fn={tokenize:En},en={tokenize:Bn};function En(n){const t=this,r=[];let e=0,o,i,u;return l;function l(a){if(e<r.length){const k=r[e];return t.containerState=k[1],n.attempt(k[0].continuation,d,s)(a)}return s(a)}function d(a){if(e++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&F();const k=t.events.length;let w=k,m;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){m=t.events[w][1].end;break}S(e);let C=k;for(;C<t.events.length;)t.events[C][1].end={...m},C++;return G(t.events,w+1,0,t.events.slice(k)),t.events.length=C,s(a)}return l(a)}function s(a){if(e===r.length){if(!o)return x(a);if(o.currentConstruct&&o.currentConstruct.concrete)return y(a);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},n.check(en,h,p)(a)}function h(a){return o&&F(),S(e),x(a)}function p(a){return t.parser.lazy[t.now().line]=e!==r.length,u=t.now().offset,y(a)}function x(a){return t.containerState={},n.attempt(en,_,y)(a)}function _(a){return e++,r.push([t.currentConstruct,t.containerState]),x(a)}function y(a){if(a===null){o&&F(),S(0),n.consume(a);return}return o=o||t.parser.flow(t.now()),n.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),B(a)}function B(a){if(a===null){O(n.exit("chunkFlow"),!0),S(0),n.consume(a);return}return V(a)?(n.consume(a),O(n.exit("chunkFlow")),e=0,t.interrupt=void 0,l):(n.consume(a),B)}function O(a,k){const w=t.sliceStream(a);if(k&&w.push(null),a.previous=i,i&&(i.next=a),i=a,o.defineSkip(a.start),o.write(w),t.parser.lazy[a.start.line]){let m=o.events.length;for(;m--;)if(o.events[m][1].start.offset<u&&(!o.events[m][1].end||o.events[m][1].end.offset>u))return;const C=t.events.length;let T=C,P,A;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(P){A=t.events[T][1].end;break}P=!0}for(S(e),m=C;m<t.events.length;)t.events[m][1].end={...A},m++;G(t.events,T+1,0,t.events.slice(C)),t.events.length=m}}function S(a){let k=r.length;for(;k-- >a;){const w=r[k];t.containerState=w[1],w[0].exit.call(t,n)}r.length=a}function F(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Bn(n,t,r){return K(n,n.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const On={tokenize:Pn};function Pn(n){const t=this,r=n.attempt(hn,e,n.attempt(this.parser.constructs.flowInitial,o,K(n,n.attempt(this.parser.constructs.flow,o,n.attempt(pn,o)),"linePrefix")));return r;function e(i){if(i===null){n.consume(i);return}return n.enter("lineEndingBlank"),n.consume(i),n.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(i){if(i===null){n.consume(i);return}return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),t.currentConstruct=void 0,r}}const jn={resolveAll:un()},Ln=sn("string"),$n=sn("text");function sn(n){return{resolveAll:un(n==="text"?Mn:void 0),tokenize:t};function t(r){const e=this,o=this.parser.constructs[n],i=r.attempt(o,u,l);return u;function u(h){return s(h)?i(h):l(h)}function l(h){if(h===null){r.consume(h);return}return r.enter("data"),r.consume(h),d}function d(h){return s(h)?(r.exit("data"),i(h)):(r.consume(h),d)}function s(h){if(h===null)return!0;const p=o[h];let x=-1;if(p)for(;++x<p.length;){const _=p[x];if(!_.previous||_.previous.call(e,e.previous))return!0}return!1}}}function un(n){return t;function t(r,e){let o=-1,i;for(;++o<=r.length;)i===void 0?r[o]&&r[o][1].type==="data"&&(i=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==i+2&&(r[i][1].end=r[o-1][1].end,r.splice(i+2,o-i-2),o=i+2),i=void 0);return n?n(r,e):r}}function Mn(n,t){let r=0;for(;++r<=n.length;)if((r===n.length||n[r][1].type==="lineEnding")&&n[r-1][1].type==="data"){const e=n[r-1][1],o=t.sliceStream(e);let i=o.length,u=-1,l=0,d;for(;i--;){const s=o[i];if(typeof s=="string"){for(u=s.length;s.charCodeAt(u-1)===32;)l++,u--;if(u)break;u=-1}else if(s===-2)d=!0,l++;else if(s!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===n.length&&(l=0),l){const s={type:r===n.length||d||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?u:e.start._bufferIndex+u,_index:e.start._index+i,line:e.end.line,column:e.end.column-l,offset:e.end.offset-l},end:{...e.end}};e.end={...s.start},e.start.offset===e.end.offset?Object.assign(e,s):(n.splice(r,0,["enter",s,t],["exit",s,t]),r+=2)}r++}return n}const Nn={42:b,43:b,45:b,48:b,49:b,50:b,51:b,52:b,53:b,54:b,55:b,56:b,57:b,62:xn},Dn={91:mn},Rn={[-2]:H,[-1]:H,32:H},qn={35:kn,42:Q,45:[nn,Q],60:gn,61:nn,95:Q,96:Z,126:Z},Hn={38:on,92:rn},Qn={[-5]:U,[-4]:U,[-3]:U,33:yn,38:on,42:J,60:[vn,In],91:_n,92:[Cn,rn],93:bn,95:J,96:wn},Un={null:[J,jn]},Gn={null:[42,95]},Jn={null:[]},Kn=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Gn,contentInitial:Dn,disable:Jn,document:Nn,flow:qn,flowInitial:Rn,insideSpan:Un,string:Hn,text:Qn},Symbol.toStringTag,{value:"Module"}));function Vn(n,t,r){let e={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},i=[];let u=[],l=[];const d={attempt:C(w),check:C(m),consume:F,enter:a,exit:k,interrupt:C(m,{interrupt:!0})},s={code:null,containerState:{},defineSkip:B,events:[],now:y,parser:n,previous:null,sliceSerialize:x,sliceStream:_,write:p};let h=t.tokenize.call(s,d);return t.resolveAll&&i.push(t),s;function p(c){return u=dn(u,c),O(),u[u.length-1]!==null?[]:(T(t,0),s.events=Sn(i,s.events,s),s.events)}function x(c,f){return Xn(_(c),f)}function _(c){return Wn(u,c)}function y(){const{_bufferIndex:c,_index:f,line:v,column:I,offset:E}=e;return{_bufferIndex:c,_index:f,line:v,column:I,offset:E}}function B(c){o[c.line]=c.column,A()}function O(){let c;for(;e._index<u.length;){const f=u[e._index];if(typeof f=="string")for(c=e._index,e._bufferIndex<0&&(e._bufferIndex=0);e._index===c&&e._bufferIndex<f.length;)S(f.charCodeAt(e._bufferIndex));else S(f)}}function S(c){h=h(c)}function F(c){V(c)?(e.line++,e.column=1,e.offset+=c===-3?2:1,A()):c!==-1&&(e.column++,e.offset++),e._bufferIndex<0?e._index++:(e._bufferIndex++,e._bufferIndex===u[e._index].length&&(e._bufferIndex=-1,e._index++)),s.previous=c}function a(c,f){const v=f||{};return v.type=c,v.start=y(),s.events.push(["enter",v,s]),l.push(v),v}function k(c){const f=l.pop();return f.end=y(),s.events.push(["exit",f,s]),f}function w(c,f){T(c,f.from)}function m(c,f){f.restore()}function C(c,f){return v;function v(I,E,j){let N,L,W,D;return Array.isArray(I)?R(I):"tokenize"in I?R([I]):ln(I);function ln(g){return q;function q(z){const $=z!==null&&g[z],M=z!==null&&g.null,cn=[...Array.isArray($)?$:$?[$]:[],...Array.isArray(M)?M:M?[M]:[]];return R(cn)(z)}}function R(g){return N=g,L=0,g.length===0?j:X(g[L])}function X(g){return q;function q(z){return D=P(),W=g,g.partial||(s.currentConstruct=g),g.name&&s.parser.constructs.disable.null.includes(g.name)?Y():g.tokenize.call(f?Object.assign(Object.create(s),f):s,d,an,Y)(z)}}function an(g){return c(W,D),E}function Y(g){return D.restore(),++L<N.length?X(N[L]):j}}}function T(c,f){c.resolveAll&&!i.includes(c)&&i.push(c),c.resolve&&G(s.events,f,s.events.length-f,c.resolve(s.events.slice(f),s)),c.resolveTo&&(s.events=c.resolveTo(s.events,s))}function P(){const c=y(),f=s.previous,v=s.currentConstruct,I=s.events.length,E=Array.from(l);return{from:I,restore:j};function j(){e=c,s.previous=f,s.currentConstruct=v,s.events.length=I,l=E,A()}}function A(){e.line in o&&e.column<2&&(e.column=o[e.line],e.offset+=o[e.line]-1)}}function Wn(n,t){const r=t.start._index,e=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let u;if(r===o)u=[n[r].slice(e,i)];else{if(u=n.slice(r,o),e>-1){const l=u[0];typeof l=="string"?u[0]=l.slice(e):u.shift()}i>0&&u.push(n[o].slice(0,i))}return u}function Xn(n,t){let r=-1;const e=[];let o;for(;++r<n.length;){const i=n[r];let u;if(typeof i=="string")u=i;else switch(i){case-5:{u="\r";break}case-4:{u=`
`;break}case-3:{u=`\r
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(i)}o=i===-2,e.push(u)}return e.join("")}function oe(n){const e={constructs:fn([Kn,...(n||{}).extensions||[]]),content:o(An),defined:[],document:o(Fn),flow:o(On),lazy:{},string:o(Ln),text:o($n)};return e;function o(i){return u;function u(l){return Vn(e,i,l)}}}function se(n){for(;!Tn(n););return n}const tn=/[\0\t\n\r]/g;function ue(){let n=1,t="",r=!0,e;return o;function o(i,u,l){const d=[];let s,h,p,x,_;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(u||void 0).decode(i)),p=0,t="",r&&(i.charCodeAt(0)===65279&&p++,r=void 0);p<i.length;){if(tn.lastIndex=p,s=tn.exec(i),x=s&&s.index!==void 0?s.index:i.length,_=i.charCodeAt(x),!s){t=i.slice(p);break}if(_===10&&p===x&&e)d.push(-3),e=void 0;else switch(e&&(d.push(-5),e=void 0),p<x&&(d.push(i.slice(p,x)),n+=x-p),_){case 0:{d.push(65533),n++;break}case 9:{for(h=Math.ceil(n/4)*4,d.push(-2);n++<h;)d.push(-1);break}case 10:{d.push(-4),n=1;break}default:e=!0,n=1}p=x+1}return l&&(e&&d.push(-5),t&&d.push(t),d.push(null)),d}}export{oe as a,ue as b,se as p};