2026-07-24 21:11:06 +08:00
var ew = Object . defineProperty ; var lv = u => { throw TypeError ( u ) } ; var sw = ( u , t , e ) => t in u ? ew ( u , t , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : e } ) : u [ t ] = e ; var M = ( u , t , e ) => sw ( u , typeof t != "symbol" ? t + "" : t , e ) , Wp = ( u , t , e ) => t . has ( u ) || lv ( "Cannot " + e ) ; var n = ( u , t , e ) => ( Wp ( u , t , "read from private field" ) , e ? e . call ( u ) : t . get ( u ) ) , m = ( u , t , e ) => t . has ( u ) ? lv ( "Cannot add the same private member more than once" ) : t instanceof WeakSet ? t . add ( u ) : t . set ( u , e ) , p = ( u , t , e , s ) => ( Wp ( u , t , "write to private field" ) , s ? s . call ( u , e ) : t . set ( u , e ) , e ) , v = ( u , t , e ) => ( Wp ( u , t , "access private method" ) , e ) ; var qt = ( u , t , e , s ) => ( { set _ ( i ) { p ( u , t , i , e ) } , get _ ( ) { return n ( u , t , s ) } } ) ; import { E as Hu } from "./index-Cp3It01C.js" ; import { d as _i , o as O , c as V , q as C , s as U , n as we , aa as j , g as dt , j as lt , x as ft , w as tt , M as ye , ad as ni , e as $t , A as yt , y as rt , D as xi , H as jv , al as iw , aQ as nw , P as Wf , t as cv , aL as Xp , z as ig , ag as rw , aR as aw , G as ow , f as Ls , aB as lw , v as cw } from "./index-DMfSG-9l.js" ; import { A as hw } from "./AppConfirmDialog-io-Joa8G.js" ; import { E as Wv , a as Xv } from "./el-form-item-rY4vNiXx.js" ; import { E as bh } from "./index-DYpWD2QI.js" ; import { a as qv , E as Pp } from "./el-checkbox-U4Gmy-zV.js" ; import { E as zu } from "./el-input-number-12Fb-t8x.js" ; /* empty css */ import { _ as ki } from "./_plugin-vue_export-helper-DlAUqK2U.js" ; import { E as Mp , a as Ip } from "./el-select-C8XVvVg6.js" ; import { E as dw } from "./el-slider-Busp_4kQ.js" ; import { E as uw } from "./el-switch-CRgLvWkS.js" ; import "./el-popper-DAm2mVaB.js" ; import "./el-tooltip-l0sNRNKZ.js" ; import "./el-scrollbar-B3-sB_hq.js" ; import { E as fw } from "./el-tag-BhOuL4lf.js" ; import { E as Yv } from "./el-pagination-Dl141Xco.js" ; import { E as Kv } from "./el-progress-qjLucY-4.js" ; import { E as pw } from "./el-upload-DpR10Xny.js" ; import { a as gw , b as mw , s as vw , c as bw , r as yw , u as ww , e as Aw , f as hv , h as Sw , i as xw , j as Qv , k as Ew , l as Cw , m as _w , n as dv , t as kw , p as Tw , o as Pw , q as Mw , v as Iw } from "./dataProcess-CC1IQJjX.js" ; import { u as Dw } from "./models-BD0nM_P0.js" ; import "./castArray-qEIBurnE.js" ; import "./_baseClone-DE0sfIfI.js" ; import "./raf-Cz9mkNBb.js" ; import "./index-D3hDDBfW.js" ; import "./index-BqlQpMip.js" ; import "./omit-teeY8va1.js" ; import "./index-y5Ln8gqh.js" ; import "./index-CJA4tZk1.js" ; import "./vnode-DQ45xHFU.js" ; import "./index-YDvJ5KV2.js" ; import "./scroll-D2ojO4wB.js" ; import "./clamp-B9tkuT1F.js" ; import "./toNumber-COrtsVXo.js" ; import "./_baseIteratee-bMWfS5oT.js" ; import "./debounce-CVrTo2Ot.js" ; import "./validator-WVQr2HNG.js" ; import "./model-Bb43lCFu.js" ; const Lw = { class : "generation-option-row dataset-split-row" } , Fw = { class : "dataset-split-config" } , Ow = { class : "dataset-split-grid" } , Rw = { class : "dataset-split-field" } , Nw = { class : "dataset-split-input" } , Bw = { class : "dataset-split-field" } , $w = { class : "dataset-split-input" } , Uw = { class : "dataset-split-field" } , Hw = { class : "dataset-split-input" } , zw = { key : 0 , role : "alert" } , Vw = _i ( { _ _name : "DatasetSplitEditor" , props : { modelValue : { } , ariaLabelPrefix : { default : "" } } , emits : [ "update:modelValue" ] , setup ( u , { emit : t } ) { const e = u , s = t , i = lt ( ( ) => { const { train : o , validation : l , test : c } = e . modelValue ; return o + l + c } ) ; function r ( o , l ) { s ( "update:modelValue" , { ... e . modelValue , [ o ] : Math . min ( 100 , Math . max ( 0 , Number ( l ) || 0 ) ) } ) } function a ( o ) { return ` ${ e . ariaLabelPrefix } ${ o } 比例 ` } return ( o , l ) => { const c = zu ; return O ( ) , V ( "div" , Lw , [ l [ 9 ] || ( l [ 9 ] = C ( "div" , { class : "generation-option-copy" } , [ C ( "strong" , null , "数据集划分" ) , C ( "small" , null , "按比例将生成后的问答对随机划分为训练集、验证集和测试集" ) ] , - 1 ) ) , C ( "div" , Fw , [ C ( "div" , Ow , [ C ( "label" , Rw , [ l [ 4 ] || ( l [ 4 ] = C ( "span" , null , "训练集" , - 1 ) ) , C ( "span" , Nw , [ U ( c , { "model-value" : u . modelValue . train , min : 0 , max : 100 , step : 1 , precision : 0 , "controls-position" : "right" , "aria-label" : a ( "训练集" ) , "onUpdate:modelValue" : l [ 0 ] || ( l [ 0 ] = h => r ( "train" , h ) ) } , null , 8 , [ "model-value" , "aria-label" ] ) , l [ 3 ] || ( l [ 3 ] = C ( "span" , null , "%" , - 1 ) ) ] ) ] ) , C ( "label" , Bw , [ l [ 6 ] || ( l [ 6 ] = C ( "span" , null , "验证集" , - 1 ) ) , C ( "span" , $w , [ U ( c , { "model-value" : u . modelValue . validation , min : 0 , max : 100 , step : 1 , precision : 0 , "controls-position" : "right" , "aria-label" : a ( "验证集" ) , "onUpdate:modelValue" : l [ 1 ] || ( l [ 1 ] = h => r ( "validation" , h ) ) } , null , 8 , [ "model-value" , "aria-label" ] ) , l [ 5 ] || ( l [ 5 ] = C ( "span" , null , "%" , -
2026-07-24 16:31:38 +08:00
` ).join("")}}_r=new WeakMap;function Wh(u,t){const e=t?URL.parse(u,t):URL.parse(u);return/https?:/.test((e==null?void 0:e.protocol)??"")}function Ci(u){u.preventDefault()}function ie(u){u.preventDefault(),u.stopPropagation()}var ed;class qf{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;n(this,ed)||p(this,ed,new RegExp("^D:( \\ d{4})( \\ d{2})?( \\ d{2})?( \\ d{2})?( \\ d{2})?( \\ d{2})?([Z|+ \\ -])?( \\ d{2})?'?( \\ d{2})?'?"));const e=n(this,ed).exec(t);if(!e)return null;const s=parseInt(e[1],10);let i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(a+=h,o+=d):c==="+"&&(a-=h,o-=d),new Date(Date.UTC(s,i,r,a,o,l))}}ed=new WeakMap,m(qf,ed);function ju(u){if(u.startsWith("#")){const e=u.slice(1);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),e.length>=8?parseInt(e.slice(6,8),16)/255:1]}if(u.startsWith("rgb(")){const[e,s,i]=u.slice(4,-1).split(",").map(r=>parseInt(r,10));return[e,s,i,1]}if(u.startsWith("rgba(")){const e=u.slice(5,-1).split(",");return[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3])]}const t=u.match(/^color \( srgb \s +([ \d .]+) \s +([ \d .]+) \s +([ \d .]+)(?: \s * \/ \s *([ \d .]+|none))? \) $ /);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!=="none"?parseFloat(t[4]):1]:null}function Wu(u){const t=ju(u);return t?t.slice(0,3):(ct( ` Not a valid color format : "${u}" ` ),[0,0,0])}function LS(u){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of u.keys()){t.style.color=e;const s=window.getComputedStyle(t).color;u.set(e,Wu(s))}t.remove()}function Wt(u){const{a:t,b:e,c:s,d:i,e:r,f:a}=u.getTransform();return[t,e,s,i,r,a]}function Xi(u){const{a:t,b:e,c:s,d:i,e:r,f:a}=u.getTransform().invertSelf();return[t,e,s,i,r,a]}function xl(u,t,e=!1,s=!0){if(t instanceof Gu){const{pageWidth:i,pageHeight:r}=t.rawDims,{style:a}=u,o= ` round ( down , var ( -- total - scale - factor ) * $ { i } px , var ( -- scale - round - x ) ) ` ,l= ` round ( down , var ( -- total - scale - factor ) * $ { r } px , var ( -- scale - round - y ) ) ` ;!e||t.rotation%180===0?(a.width=o,a.height=l):(a.width=l,a.height=o)}s&&u.setAttribute("data-main-rotation",t.rotation)}class En{constructor(){const{pixelRatio:t}=En;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,s,i,r=-1){let a=1/0,o=1/0,l=1/0;s=En.capPixels(s,r),s>0&&(a=Math.sqrt(s/(t*e))),i!==-1&&(o=i/t,l=i/e);const c=Math.min(a,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const s=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,s):s}return t}}const hg=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class FS{static get isDarkMode(){var t;return at(this,"isDarkMode",!!((t=window==null?void 0:window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: dark)").matches))}}class OS{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:s}=window.getComputedStyle(t);return t.remove(),at(this,"commentForegroundColor",Wu(s))}}function RS(u,t){t=Qt(t??1,0,1);const e=255*(1-t);return u.map(s=>Math.round(s*t+e))}function pv(u,t){const e=u[0]/255,s=u[1]/255,i=u[2]/255,r=Math.max(e,s,i),a=Math.min(e,s,i),o=(r+a)/2;if(r===a)t[0]=t[1]=0;else{const l=r-a;switch(t[1]=o<.5?l/(r+a):l/(2-r-a),r){case e:t[0]=((s-i)/l+(s<i?6:0))*60;break;case s:t[0]=((i-e)/l+2)*60;break;case i:t
2026-07-24 11:28:14 +08:00
struct Uniforms {
offsetX : f32 ,
offsetY : f32 ,
scaleX : f32 ,
scaleY : f32 ,
paddedWidth : f32 ,
paddedHeight : f32 ,
borderSize : f32 ,
_pad : f32 ,
} ;
@ group ( 0 ) @ binding ( 0 ) var < uniform > u : Uniforms ;
struct VertexInput {
@ location ( 0 ) position : vec2 < f32 > ,
@ location ( 1 ) color : vec4 < f32 > ,
} ;
struct VertexOutput {
@ builtin ( position ) position : vec4 < f32 > ,
@ location ( 0 ) color : vec3 < f32 > ,
} ;
@ vertex
fn vs _main ( in : VertexInput ) - > VertexOutput {
var out : VertexOutput ;
let cx = ( in . position . x + u . offsetX ) * u . scaleX ;
let cy = ( in . position . y + u . offsetY ) * u . scaleY ;
out . position = vec4 < f32 > (
( ( cx + u . borderSize ) / u . paddedWidth ) * 2.0 - 1.0 ,
1.0 - ( ( cy + u . borderSize ) / u . paddedHeight ) * 2.0 ,
0.0 ,
1.0
) ;
out . color = in . color . rgb ;
return out ;
}
@ fragment
fn fs _main ( in : VertexOutput ) - > @ location ( 0 ) vec4 < f32 > {
return vec4 < f32 > ( in . color , 1.0 ) ;
}
2026-07-24 16:31:38 +08:00
` ;var pp,Xn,Co,wc,gp,Zb;class f1{constructor(){m(this,gp);m(this,pp,null);m(this,Xn,null);m(this,Co,null);m(this,wc,null)}init(){return n(this,pp)||p(this,pp,v(this,gp,Zb).call(this))}get isReady(){return n(this,Xn)!==null}loadMeshShader(){if(!n(this,Xn)||n(this,Co))return;const t=n(this,Xn).createShaderModule({code:u1});p(this,Co,n(this,Xn).createRenderPipeline({layout:"auto",vertex:{module:t,entryPoint:"vs_main",buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:"unorm8x4"}]}]},fragment:{module:t,entryPoint:"fs_main",targets:[{format:n(this,wc)}]},primitive:{topology:"triangle-list"}}))}draw(t,e,s,i,r,a,o,l){this.loadMeshShader();const c=n(this,Xn),{offsetX:h,offsetY:d,scaleX:f,scaleY:g}=i,y=c.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&c.queue.writeBuffer(y,0,t);const b=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(b,0,e);const S=c.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});c.queue.writeBuffer(S,0,new Float32Array([h,d,f,g,a,o,l,0]));const w=c.createBindGroup({layout:n(this,Co).getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:S}}]}),E=new OffscreenCanvas(a,o),A=E.getContext("webgpu");A.configure({device:c,format:n(this,wc),alphaMode:r?"opaque":"premultiplied"});const _=r?{r:r[0]/255,g:r[1]/255,b:r[2]/255,a:1}:{r:0,g:0,b:0,a:0},x=c.createCommandEncoder(),k=x.beginRenderPass({colorAttachments:[{view:A.getCurrentTexture().createView(),clearValue:_,loadOp:"clear",storeOp:"store"}]});return s>0&&(k.setPipeline(n(this,Co)),k.setBindGroup(0,w),k.setVertexBuffer(0,y),k.setVertexBuffer(1,b),k.draw(s)),k.end(),c.queue.submit([x.finish()]),y.destroy(),b.destroy(),S.destroy(),E.transferToImageBitmap()}}pp=new WeakMap,Xn=new WeakMap,Co=new WeakMap,wc=new WeakMap,gp=new WeakSet,Zb=async function(){var t;if(!((t=globalThis.navigator)!=null&&t.gpu))return!1;try{const e=await navigator.gpu.requestAdapter();return e?(p(this,wc,navigator.gpu.getPreferredCanvasFormat()),p(this,Xn,await e.requestDevice()),!0):!1}catch{return!1}};const Np=new f1;function p1(){return Np.init()}function g1(){return Np.isReady}function m1(){Np.loadMeshShader()}function v1(u,t,e,s,i,r,a,o){return Np.draw(u,t,e,s,i,r,a,o)}const We={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function vf(u,t){if(!t)return;const e=t[2]-t[0],s=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],e,s),u.clip(i)}class Wm{isModifyingCurrentTransform(){return!1}getPattern(){Ct("Abstract method ` getPattern ` called.")}}class b1 extends Wm{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type==="radial"}areConic(){if(!this.isRadial())return!1;const t=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return t+this._r1>this._r0&&t+this._r0>this._r1}_createGradient(t,e=null){let s,i=this._p0,r=this._p1;if(e&&(i=i.slice(),r=r.slice(),B.applyTransform(i,e),B.applyTransform(r,e)),this._type==="axial")s=t.createLinearGradient(i[0],i[1],r[0],r[1]);else if(this._type==="radial"){let a=this._r0,o=this._r1;if(e){const l=new Float32Array(2);B.singularValueDecompose2dScale(e,l),a*=l[0],o*=l[0]}s=t.createRadialGradient(i[0],i[1],a,r[0],r[1],o)}for(const a of this._colorStops)s.addColorStop(a[0],a[1]);return s}_createReversedGradient(t,e=null){let s=this._p1,i=this._p0;e&&(s=s.slice(),i=i.slice(),B.applyTransform(s,e),B.applyTransform(i,e));let r=this._r1,a=this._r0;if(e){const c=new Float32Array(2);B.singularValueDecompose2dScale(e,c),r*=c[0],a*=c[0]}const o=t.createRadialGradient(s[0],s[1],r,i[0],i[1],a),l=this._colorStops.map(([c,h])=>[1-c,h]).reverse();for(const[c,h]of l)o.addColorStop(c,h);return o}getPattern(t,e,s,i){let r;if(i===We.STROKE||i===We.FILL){if(this.isOriginBa
` ))||null;c&&this.data.comb&&(c=c.replaceAll(/ \s +/g,""));const h={userValue:o,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=c??o,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",c??o),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(this.container.classList.add("hasOwnCanvas"),t.has(e)&&this.container.classList.add("sandboxModified")),_l.add(s),this.contentElement=s,s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=0;const{datetimeFormat:d,datetimeType:f,timeStep:g}=this.data,y=!!f&&this.enableScripting;d&&(s.title=d),this._setRequired(s,this.data.required),l&&(s.maxLength=l),s.addEventListener("input",S=>{t.setValue(e,{value:S.target.value}),this.setPropertyOnSiblings(s,"value",S.target.value,"value"),h.formattedValue=null}),s.addEventListener("resetform",S=>{const w=this.data.defaultFieldValue??"";s.value=h.userValue=w,h.formattedValue=null});let b=S=>{const{formattedValue:w}=h;w!=null&&(S.target.value=w),S.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",w=>{var A;if(h.focused)return;const{target:E}=w;if(y&&(E.type=f,g&&(E.step=g)),h.userValue){const _=h.userValue;if(y)if(f==="time"){const x=new Date(_),k=[x.getHours(),x.getMinutes(),x.getSeconds()];E.value=k.map(I=>I.toString().padStart(2,"0")).join(":")}else E.value=new Date(_-sx).toISOString().split(f==="date"?"T":".",1)[0];else E.value=_}h.lastCommittedValue=E.value,h.commitKey=1,(A=this.data.actions)!=null&&A.Focus||(h.focused=!0)}),s.addEventListener("updatefromsandbox",w=>{this.container.classList.add("sandboxModified");const E={value(A){h.userValue=A.detail.value??"",y||t.setValue(e,{value:h.userValue.toString()}),A.target.value=h.userValue},formattedValue(A){const{formattedValue:_}=A.detail;h.formattedValue=_,_!=null&&A.target!==document.activeElement&&(A.target.value=_);const x={formattedValue:_};y&&(x.value=_),t.setValue(e,x)},selRange(A){A.target.setSelectionRange(...A.detail.selRange)},charLimit:A=>{var I;const{charLimit:_}=A.detail,{target:x}=A;if(_===0){x.removeAttribute("maxLength");return}x.setAttribute("maxLength",_);let k=h.userValue;!k||k.length<=_||(k=k.slice(0,_),x.value=h.userValue=k,t.setValue(e,{value:k}),(I=this.linkService.eventBus)==null||I.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:k,willCommit:!0,commitKey:1,selStart:x.selectionStart,selEnd:x.selectionEnd}}))}};this._dispatchEventFromSandbox(E,w)}),s.addEventListener("keydown",w=>{var _;h.commitKey=1;let E=-1;if(w.key==="Escape"?E=0:w.key==="Enter"&&!this.data.multiLine?E=2:w.key==="Tab"&&(h.commitKey=3),E===-1)return;const{value:A}=w.target;h.lastCommittedValue!==A&&(h.lastCommittedValue=A,h.userValue=A,(_=this.linkService.eventBus)==null||_.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:A,willCommit:!0,commitKey:E,selStart:w.target.selectionStart,selEnd:w.target.selectionEnd}}))});const S=b;b=null,s.addEventListener("blur",w=>{var _,x;if(!h.focused||!w.relatedTarget)return;(_=this.data.actions)!=null&&_.Blur||(h.focused=!1);const{target:E}=w;let{value:A}=E;if(y){if(A&&f==="time"){const k=A.split(":").map(I=>parseInt(I,10));A=new Date(2e3,0,1,k[0],k[1],k[2]||0).valueOf(),E.step=""}else A.includes("T")||(A= ` $ { A } T00 : 00 ` ),A=new Date(A).valueOf();E.type="text"}h.userValue=A,h.lastCommittedValue!==A&&((x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:A,willCommit:!0,commitKey:h.commitKey,selStart:w.target.selectionStart,selEnd:w.target.selectionEnd}})),S(w)}),(r=this.data.actions)!=null&&r.Keystroke&&s.addEventListener("beforeinput",w=>{var P;h.lastCommittedValue=null;const{data:E,target:A}=w,{value:_,selectionStart:x,selectionEnd:k}=A;let I=x,L=k;switch(w.inputType){case"deleteWordBackward":{const D=_.substring(0,x).match(/ \w * \W
` ))e.push({name:"span",value:r,attributes:i});return s},Iy=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&n(this,fn))&&v(this,mt,_f).call(this)},Dy=function(){if(n(this,sr)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:s,pageX:i,pageY:r}}}=n(this,Hc);let a=!!n(this,zc),o=a?n(this,zc):n(this,ou);for(const y of n(this,Qo))if(!o||B.intersect(y.data.rect,o)!==null){o=y.data.rect,a=!0;break}const l=B.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),h=a?o[2]-o[0]+5:0,d=l[0]+h,f=l[1];p(this,sr,[100*(d-i)/e,100*(f-r)/s]);const{style:g}=n(this,de);g.left= ` $ { n ( this , sr ) [ 0 ] } % ` ,g.top= ` $ { n ( this , sr ) [ 1 ] } % ` },_f=function(){if(n(this,Gs)){n(this,Gs).toggleCommentPopup(this,!1);return}p(this,fn,!n(this,fn)),n(this,fn)?(v(this,mt,kf).call(this),n(this,de).addEventListener("click",n(this, $ c)),n(this,de).addEventListener("keydown",n(this,ra))):(v(this,mt,am).call(this),n(this,de).removeEventListener("click",n(this, $ c)),n(this,de).removeEventListener("keydown",n(this,ra)))},kf=function(){n(this,js)||this.render(),this.isVisible?n(this,fn)&&n(this,de).classList.add("focused"):(v(this,mt,Dy).call(this),n(this,de).hidden=!1,n(this,de).style.zIndex=parseInt(n(this,de).style.zIndex,10)+1e3)},am=function(){n(this,de).classList.remove("focused"),!(n(this,fn)||!this.isVisible)&&(n(this,de).hidden=!0,n(this,de).style.zIndex=parseInt(n(this,de).style.zIndex,10)-1e3)};class Ly extends te{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=ot.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=this.contentElement=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const s=document.createElement("span");s.textContent=e,t.append(s)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}var lu;class ux extends te{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,lu,null)}render(){this.container.classList.add("lineAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=p(this,lu,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return n(this,lu)}addHighlightArea(){this.container.classList.add("highlightArea")}}lu=new WeakMap;var cu;class fx extends te{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,cu,null)}render(){this.container.classList.add("squareAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=e.borderStyle.width,o=p(this,cu,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",s-a),o.setAttribute("height",i-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),r.append(o),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return n(this,cu)}addHighlightArea(){this.container.classList.add("highlightArea")}}cu=new WeakMap;var hu;class px extends te{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});m(this,hu,null)}render(){this.container.classList.add("circleAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=e.borderStyle.width,o=p(this,hu,this.svgFactory.createElement("svg:ellipse"));retur
2026-07-24 11:28:14 +08:00
` );if(!r)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!r.includes( `
2026-07-24 16:31:38 +08:00
` )){o.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:c}=o,h=[],d=[];if(l.nodeType===Node.TEXT_NODE){const w=l.parentElement;if(d.push(l.nodeValue.slice(c).replaceAll(Zu,"")),w!==this.editorDiv){let E=h;for(const A of this.editorDiv.childNodes){if(A===w){E=d;continue}E.push(v(b=Yt,br,If).call(b,A))}}h.push(l.nodeValue.slice(0,c).replaceAll(Zu,""))}else if(l===this.editorDiv){let w=h,E=0;for(const A of this.editorDiv.childNodes)E++===c&&(w=d),w.push(v(S=Yt,br,If).call(S,A))}p(this,Ws, ` $ { h . join ( `
2026-07-24 11:28:14 +08:00
` )} ${ r } ${ d . join ( `
2026-07-24 16:31:38 +08:00
` )} ` ) , v ( this , Ae , Df ) . call ( this ) ; const f = new Range ; let g = Math . sumPrecise ( h . map ( w => w . length ) ) ; for ( const { firstChild : w } of this . editorDiv . childNodes ) if ( w . nodeType === Node . TEXT _NODE ) { const E = w . nodeValue . length ; if ( g <= E ) { f . setStart ( w , g ) , f . setEnd ( w , g ) ; break } g -= E } a . removeAllRanges ( ) , a . addRange ( f ) } get contentDiv ( ) { return this . editorDiv } getPDFRect ( ) { const e = Yt . _internalPadding * this . parentScale ; return this . getRect ( e , e ) } static async deserialize ( e , s , i ) { var o ; let r = null ; if ( e instanceof Ly ) { const { data : { defaultAppearanceData : { fontSize : l , fontColor : c } , rect : h , rotation : d , id : f , popupRef : g , richText : y , contentsObj : b , creationDate : S , modificationDate : w } , textContent : E , textPosition : A , parent : { page : { pageNumber : _ } } } = e ; if ( ! ( E != null && E . length ) ) return null ; r = e = { annotationType : ot . FREETEXT , color : Array . from ( c ) , fontSize : l , value : E . join ( `
` ),position:A,pageIndex:_-1,rect:h.slice(0),rotation:d,annotationElementId:f,id:f,deleted:!1,popupRef:g,comment:(b==null?void 0:b.str)||null,richText:y,creationDate:S,modificationDate:w}}const a=await super.deserialize(e,s,i);return p(a,Xs,e.fontSize),a.color=B.makeHexColor(...e.color),p(a,Ws,v(o=Yt,br,um).call(o,e.value)),a._initialData=r,e.comment&&a.setCommentData(e),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=Pt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(e),{color:s,fontSize:n(this,Xs),value:v(this,Ae,zy).call(this)});return this.addComment(i),e?(i.isCopy=!0,i):this.annotationElementId&&!v(this,Ae,Vy).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(e){const s=super.renderAnnotationElement(e);if(!s)return null;const{style:i}=s;i.fontSize= ` calc ( $ { n ( this , Xs ) } px * var ( -- total - scale - factor ) ) ` ,i.color=this.color,s.replaceChildren();for(const r of n(this,Ws).split( `
` )){const a=document.createElement("div");a.append(r?document.createTextNode(r):document.createElement("br")),s.append(a)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:n(this,Ws)}}),s}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};Ws=new WeakMap,bu=new WeakMap,il=new WeakMap,Xs=new WeakMap,Ae=new WeakSet, $ y=function(e){const s=r=>{this.editorDiv.style.fontSize= ` calc ( $ { r } px * var ( -- total - scale - factor ) ) ` ,this.translate(0,-(r-n(this,Xs))*this.parentScale),p(this,Xs,r),v(this,Ae,Mf).call(this)},i=n(this,Xs);this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Uy=function(e){const s=r=>{this.color=r,this.onUpdatedColor()},i=this.color;this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Hy=function(){var i;const e=[];this.editorDiv.normalize();let s=null;for(const r of this.editorDiv.childNodes)(s==null?void 0:s.nodeType)===Node.TEXT_NODE&&r.nodeName==="BR"||(e.push(v(i=Yt,br,If).call(i,r)),s=r);return e.join( `
2026-07-24 11:28:14 +08:00
` )},Mf=function(){const[e,s]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:r,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",r.div.append(this.div),i=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=i.width/e,this.height=i.height/s):(this.width=i.height/e,this.height=i.width/s),this.fixAndSetPosition()},br=new WeakSet,If=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Zu,"")},Df=function(){if(this.editorDiv.replaceChildren(),!!n(this,Ws))for(const e of n(this,Ws).split( `
2026-07-24 16:31:38 +08:00
` )){const s=document.createElement("div");s.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(s)}},zy=function(){return n(this,Ws).replaceAll(" "," ")},um=function(e){return e.replaceAll(" "," ")},Vy=function(e){const{value:s,fontSize:i,color:r,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==s||e.fontSize!==i||e.color.some((o,l)=>o!==r[l])||e.pageIndex!==a},m(Yt,br),M(Yt,"_freeTextDefaultContent",""),M(Yt,"_internalPadding",0),M(Yt,"_defaultColor",null),M(Yt,"_defaultFontSize",10),M(Yt,"_type","freetext"),M(Yt,"_editorType",ot.FREETEXT);let dm=Yt;class X{toSVGPath(){Ct("Abstract method ` toSVGPath ` must be implemented.")}get box(){Ct("Abstract getter ` box ` must be implemented.")}serialize(t,e){Ct("Abstract method ` serialize ` must be implemented.")}static _rescale(t,e,s,i,r,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o]*i,a[o+1]=s+t[o+1]*r;return a}static _rescaleAndSwap(t,e,s,i,r,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o+1]*i,a[o+1]=s+t[o]*r;return a}static _translate(t,e,s,i){i||(i=new Float32Array(t.length));for(let r=0,a=t.length;r<a;r+=2)i[r]=e+t[r],i[r+1]=s+t[r+1];return i}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,s,i,r){switch(r){case 90:return[1-e/s,t/i];case 180:return[1-t/s,1-e/i];case 270:return[e/s,1-t/i];default:return[t/s,e/i]}}static createBezierPoints(t,e,s,i,r,a){return[(t+5*s)/6,(e+5*i)/6,(5*s+r)/6,(5*i+a)/6,(s+r)/2,(i+a)/2]}}M(X,"PRECISION",1e-4);var qs,Hi,Wc,Xc,pn,bt,nl,rl,yu,wu,qc,Yc,da,Au,xp,Ep,Ce,Hh,Gy,jy,Wy,Xy,qy,Yy;const In=class In{constructor({x:t,y:e},s,i,r,a,o=0){m(this,Ce);m(this,qs);m(this,Hi,[]);m(this,Wc);m(this,Xc);m(this,pn,[]);m(this,bt,new Float32Array(18));m(this,nl);m(this,rl);m(this,yu);m(this,wu);m(this,qc);m(this,Yc);m(this,da,[]);p(this,qs,s),p(this,Yc,r*i),p(this,Xc,a),n(this,bt).set([NaN,NaN,NaN,NaN,t,e],6),p(this,Wc,o),p(this,wu,n(In,Au)*i),p(this,yu,n(In,Ep)*i),p(this,qc,i),n(this,da).push(t,e)}isEmpty(){return isNaN(n(this,bt)[8])}add({x:t,y:e}){var P;p(this,nl,t),p(this,rl,e);const[s,i,r,a]=n(this,qs);let[o,l,c,h]=n(this,bt).subarray(8,12);const d=t-c,f=e-h,g=Math.hypot(d,f);if(g<n(this,yu))return!1;const y=g-n(this,wu),b=y/g,S=b*d,w=b*f;let E=o,A=l;o=c,l=h,c+=S,h+=w,(P=n(this,da))==null||P.push(t,e);const _=-w/y,x=S/y,k=_*n(this,Yc),I=x*n(this,Yc);return n(this,bt).set(n(this,bt).subarray(2,8),0),n(this,bt).set([c+k,h+I],4),n(this,bt).set(n(this,bt).subarray(14,18),12),n(this,bt).set([c-k,h-I],16),isNaN(n(this,bt)[6])?(n(this,pn).length===0&&(n(this,bt).set([o+k,l+I],2),n(this,pn).push(NaN,NaN,NaN,NaN,(o+k-s)/r,(l+I-i)/a),n(this,bt).set([o-k,l-I],14),n(this,Hi).push(NaN,NaN,NaN,NaN,(o-k-s)/r,(l-I-i)/a)),n(this,bt).set([E,A,o,l,c,h],6),!this.isEmpty()):(n(this,bt).set([E,A,o,l,c,h],6),Math.abs(Math.atan2(A-l,E-o)-Math.atan2(w,S))<Math.PI/2?([o,l,c,h]=n(this,bt).subarray(2,6),n(this,pn).push(NaN,NaN,NaN,NaN,((o+c)/2-s)/r,((l+h)/2-i)/a),[o,l,E,A]=n(this,bt).subarray(14,18),n(this,Hi).push(NaN,NaN,NaN,NaN,((E+o)/2-s)/r,((A+l)/2-i)/a),!0):([E,A,o,l,c,h]=n(this,bt).subarray(0,6),n(this,pn).push(((E+5*o)/6-s)/r,((A+5*l)/6-i)/a,((5*o+c)/6-s)/r,((5*l+h)/6-i)/a,((o+c)/2-s)/r,((l+h)/2-i)/a),[c,h,o,l,E,A]=n(this,bt).subarray(12,18),n(this,Hi).push(((E+5*o)/6-s)/r,((A+5*l)/6-i)/a,((5*o+c)/6-s)/r,((5*l+h)/6-i)/a,((o+c)/2-s)/r,((l+h)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const t=n(this,pn),e=n(this,Hi);if(isNaN(n(this,bt)[6])&&!this.isEmpty())return v(this,Ce,Gy).call(this);const s=[];s.push( ` M$ { t [ 4 ] } $ { t [ 5 ] } ` );for(let i=6;i<t.length;i+=6)isNaN(t[i])?s.push( ` L$ { t [ i + 4 ] } $ { t [ i + 5 ] } ` ):s.push( ` C$ { t [ i ] } $ { t [ i + 1 ] } $ { t [ i + 2 ] } $ { t [ i + 3 ] } $ { t [ i + 4 ] } $ { t [ i + 5 ] } ` );v(this,Ce,Wy).call(this,s);for(let i=e.length-6;i>=6;i-=6)isNaN(e[i])?s.push( ` L$ { e [ i + 4 ] } $ { e [ i + 5 ] } ` ):s.push( ` C$ { e [ i ] } $ { e [ i + 1 ] } $ { e [ i + 2 ] } $ { e [ i + 3 ] } $ { e [ i + 4 ] } $ { e [ i + 5 ] } ` );return v(this,Ce,jy).call(this,s),s.join(" ")}newFreeDrawOutline(t,e,s,i,r,a){return new Ky(t,e,s,i,r,a)}getOutlines(){var d;const t=n(this,pn),e=n(this,Hi),s=n(this,bt),[i,r,a,o]=n
2026-07-24 11:28:14 +08:00
` );function Xx(u){const t=u.split( `
2026-07-24 16:31:38 +08:00
` );let e=0;return t.map((s,i)=>{const r=e,a=r+s.length;return e=a+(i<t.length-1?1:0),{number:i+1,content:s,start:r,end:a}})}function Uv(u){var t;return((t=u.match(/[ \u 3400- \u 4dbf \u 4e00- \u 9fff]|[A-Za-z0-9_]+|[^ \s ]/gu))==null?void 0:t.length)??0}const qx={class:"preview-step"},Yx={class:"preview-file-switcher"},Kx={class:"file-switcher-control"},Qx={class:"file-option"},Jx=["title"],Zx={key:0},tE={class:"file-switcher-summary"},eE={class:"preview-workspace"},sE={class:"source-pane"},iE={class:"pane-header"},nE=["data-source-start"],rE={class:"line-number"},aE={class:"line-content"},oE={class:"preview-pane"},lE={class:"pane-header"},cE={class:"pane-header-actions"},hE={class:"preview-toolbar"},dE={class:"preview-list","aria-label":"预览条目列表"},uE=["data-preview-id","aria-selected","onClick","onKeydown"],fE={class:"item-name"},pE={class:"item-source"},gE={class:"item-actions"},mE={key:0,class:"empty-result"},vE={key:1,class:"preview-editor"},bE={class:"editor-heading"},yE={class:"editor-actions"},xh=10,wE=_i({__name:"PreviewCompareStep",props:{sourceText:{},items:{},selectedId:{},processType:{},fileName:{},taskId:{},sourceFileId:{},files:{},selectedFileId:{}},emits:["update:selectedId","update:selectedFileId","update:item-content","restore:item","add:item","remove:item"],setup(u,{emit:t}){const e=u,s=t,i=rt(null),r=rt(""),a=rt(1),o=rt(null),l=rt(""),c=lt(()=>Xx(e.sourceText)),h=lt(()=>e.items.find(P=>P.id===e.selectedId)??e.items[0]),d=lt(()=>e.items.find(P=>P.id===o.value)),f=lt(()=>/ \. pdf $ /i.test(e.fileName)),g=lt(()=>e.items.filter((P,D)=>!r.value.trim()||P.editedContent.toLowerCase().includes(r.value.trim().toLowerCase())||String(D+1).includes(r.value.trim()))),y=lt(()=>{const P=(a.value-1)*xh;return g.value.slice(P,P+xh)});function b(P,D){const N=h.value;return!N||N.sourceStart==null||N.sourceEnd==null?!1:D>=N.sourceStart&&P<=N.sourceEnd}function S(P){s("update:selectedId",P)}function w(P){S(P.id),o.value=P.id,l.value=P.editedContent}function E(){o.value=null,l.value=""}function A(){d.value&&(s("update:item-content",d.value.id,l.value),E())}function _(){d.value&&(s("restore:item",d.value.id),E())}function x(P){S(P.id),s("remove:item",P.id)}function k(){E()}xi(r,()=>{a.value=1,E()}),xi(()=>e.selectedFileId,E),xi(h,async P=>{var K,W;if(!P)return;const D=g.value.findIndex(Q=>Q.id===P.id);if(D>=0&&(a.value=Math.floor(D/xh)+1),f.value||P.sourceStart==null)return;await Wf();const N=((K=i.value)==null?void 0:K.querySelector( ` [ data - source - start = "${P.sourceStart}" ] ` ))??((W=i.value)==null?void 0:W.querySelector(".source-line.is-highlighted"));N==null||N.scrollIntoView({block:"center",behavior:"smooth"})},{immediate:!0});function I(P){return e.items.findIndex(D=>D.id===P.id)+1}function L(P){return P.sourceStartLine==null||P.sourceEndLine==null?"手动新增,无源文件定位":P.sourceStartLine===P.sourceEndLine? ` 来源 : 第 $ { P . sourceStartLine } 行 ` : ` 来源 : 第 $ { P . sourceStartLine } – $ { P . sourceEndLine } 行 ` }return(P,D)=>{const N=Ip,K=Mp,W=Hu,Q=bh,ut=Yv;return O(),V("section",qx,[C("div",Yx,[C("div",Kx,[D[5]||(D[5]=C("span",null,"当前文件",-1)),U(K,{"model-value":u.selectedFileId,filterable:"",placeholder:"选择文件","aria-label":"选择当前预览文件","onUpdate:modelValue":D[0]||(D[0]=T=>s("update:selectedFileId",T))},{default:tt(()=>[(O(!0),V(ye,null,ni(u.files,T=>(O(), $ t(N,{key:T.id,label:T.name,value:T.id},{default:tt(()=>[C("div",Qx,[C("strong",{title:T.name},j(T.name),9,Jx),C("span",null,j(T.count.toLocaleString())+" "+j(u.processType==="unstructured"?"个切片":"条记录"),1),T.modifiedCount?(O(),V("em",Zx,j(T.modifiedCount)+" 处已修改",1)):dt("",!0)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["model-value"])]),C("span",tE,j(u.files.length)+" 个文件 · 当前文件 "+j(u.items.length.toLocaleString())+" "+j(u.processType==="unstructured"?"个切片":"条记录"),1)]),C("div",eE,[C("div",sE,[C("div",iE,[C("div",null,[C("strong",null,"源文件 · "+j(u.fileName),1)])]),f.value?(O(), $ t(jx,{key:0,"task-id":u.taskId,"source-file-id":u.sourceFileId,"file-name":u.fileName,"selected-item":