bilitoolkit-plugin-image-downloader 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{E as c,_ as u,c as i,g as p}from"./client-Ds0OqWOh.js";import{d as _,c as d,w as r,a as f,b as g,r as v,o as I}from"./index-Qez441I5.js";const $=_({__name:"CommentImages",setup(N){const m=v(""),l=async()=>{const o=await i.comment.resolveCommentItem(m.value)??void 0;if(!o)return[];const e=[],n=o.content.emote,a=`评论图片和表情包/${o.rpid_str}`;n&&e.push(...Object.values(n).map(t=>({url:t.gif_url??t.url,fileName:`${a}/${t.text}`})));const s=o.content.pictures;return s&&e.push(...Object.values(s).map(t=>({url:t.img_src,fileName:`${a}/${p(t.img_src)}`}))),e};return(o,e)=>{const n=c,a=u;return I(),d(a,{typeName:"表情包和图片",fetchImages:l},{default:r(()=>[f(n,{modelValue:m.value,"onUpdate:modelValue":e[0]||(e[0]=s=>m.value=s),modelModifiers:{trim:!0},placeholder:"请输入评论链接 / b23分享链接 (视频/动态/专栏底下的评论)"},{prepend:r(()=>[...e[1]||(e[1]=[g(" 评论链接 ",-1)])]),_:1},8,["modelValue"])]),_:1})}}});export{$ as default};
@@ -0,0 +1 @@
1
+ import{g as _,E as f,_ as y,c as E}from"./client-Ds0OqWOh.js";import{d as g,c as N,w as i,a as T,b as h,r as x,o as I,j as $}from"./index-Qez441I5.js";const r=(n,e)=>(e=e?`${e}/`:"",n.filter(o=>o.type==="RICH_TEXT_NODE_TYPE_EMOJI").map(o=>({url:o.emoji.gif_url??o.emoji.icon_url,fileName:`${e}${o.emoji.text}`}))),d=(n,e)=>(e=e?`${e}/`:"",n.filter(o=>o.type==="RICH_TEXT_NODE_TYPE_VIEW_PICTURE").map(o=>o.pics.map(m=>({url:m.src,fileName:`${e}/${_(m.src)}`}))).flat()),w=g({__name:"DynamicImages",setup(n){const e=x(""),o=async()=>{const m=await $(e.value),t=await E.dynamic.getDetail({id:m}),a=`动态图片和表情包/${t.id_str}`,s=[],l=t.modules.module_dynamic.desc?.rich_text_nodes??[];s.push(...r(l,a)),s.push(...d(l,a));const p=t.modules.module_dynamic.major?.opus?.pics??[];s.push(...p.map(c=>({url:c.url,fileName:`${a}/${_(c.url)}`})));const u=t.modules.module_dynamic.major?.opus?.summary.rich_text_nodes??[];return s.push(...r(u,a)),s.push(...d(u,a)),s};return(m,t)=>{const a=f,s=y;return I(),N(s,{typeName:"表情包和图片",fetchImages:o},{default:i(()=>[T(a,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),modelModifiers:{trim:!0},placeholder:"请输入动态链接 / b23分享链接 / 动态oid"},{prepend:i(()=>[...t[1]||(t[1]=[h(" 动态链接 ",-1)])]),_:1},8,["modelValue"])]),_:1})}}});export{w as default};
@@ -0,0 +1 @@
1
+ import{E as m,_ as i,c as p}from"./client-Ds0OqWOh.js";import{d as u,c as _,w as a,a as c,b as d,r as f,o as v,e as w,A as I,k as V}from"./index-Qez441I5.js";const N=u({__name:"LiveCover",setup(g){const o=f(""),n=async()=>{const t=await w(o.value),e=await p.live.getRoomInfo(t);if(e.live_status===0)throw new I("该用户未开播");return{url:e.cover,fileName:`直播封面/${e.roomid}_${e.title}_${V()}`}};return(t,e)=>{const r=m,s=i;return v(),_(s,{typeName:"直播封面",fetchImages:n},{default:a(()=>[c(r,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=l=>o.value=l),modelModifiers:{trim:!0},placeholder:"请输入用户链接 / b23分享链接 / 用户UID"},{prepend:a(()=>[...e[1]||(e[1]=[d(" 用户链接 ",-1)])]),_:1},8,["modelValue"])]),_:1})}}});export{N as default};
@@ -0,0 +1 @@
1
+ import{E as _,_ as d,c as f,g}from"./client-Ds0OqWOh.js";import{d as N,c as E,w as m,a as h,b as x,r as T,o as y,l as D}from"./index-Qez441I5.js";const V=N({__name:"OpusImages",setup($){const s=T(""),u=async()=>{const i=await D(s.value),t=await f.opus.getDetail({id:i}),n=t.item.modules??[],o=[];for(const l of n)if(l.module_type==="MODULE_TYPE_CONTENT"){const c=t.item.basic.title.split(" - 哔哩哔哩")[0],r=`专栏图片和表情包/${t?.item.id_str}_${c}`,p=l.module_content?.paragraphs??[];o.push(...p.filter(e=>e.para_type===2&&e.pic?.pics!=null).map(e=>[...e.pic.pics.map(a=>a.url)]).flat().map(e=>({url:e,fileName:`${r}/${g(e)}`}))),o.push(...p.filter(e=>e.para_type===1&&e.text?.nodes!=null).map(e=>[...e.text?.nodes.filter(a=>a.type==="TEXT_NODE_TYPE_RICH"&&a.rich&&a.rich.emoji!=null).map(a=>a.rich.emoji)]).flat().map(e=>({url:e.gif_url??e.icon_url,fileName:`${r}/${e.text}`})))}return o};return(i,t)=>{const n=_,o=d;return y(),E(o,{typeName:"表情包和图片",fetchImages:u},{default:m(()=>[h(n,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=l=>s.value=l),modelModifiers:{trim:!0},placeholder:"请输入专栏链接 / b23分享链接"},{prepend:m(()=>[...t[1]||(t[1]=[x(" 专栏链接 ",-1)])]),_:1},8,["modelValue"])]),_:1})}}});export{V as default};
@@ -0,0 +1 @@
1
+ import{E as m,_ as u,c as d}from"./client-Ds0OqWOh.js";import{d as c,c as p,w as o,a as i,b as _,r as f,o as w,e as V}from"./index-Qez441I5.js";const I=c({__name:"UserFace",setup(g){const a=f(""),n=async()=>{const t=await V(a.value),e=(await d.user.getUserCard({mid:t})).card;return{url:e.face,fileName:`用户头像/${e.mid}_${e.name}`}};return(t,e)=>{const r=m,s=u;return w(),p(s,{typeName:"用户头像",fetchImages:n},{default:o(()=>[i(r,{modelValue:a.value,"onUpdate:modelValue":e[0]||(e[0]=l=>a.value=l),modelModifiers:{trim:!0},placeholder:"请输入用户链接 / b23分享链接 / 用户UID"},{prepend:o(()=>[...e[1]||(e[1]=[_(" 用户链接 ",-1)])]),_:1},8,["modelValue"])]),_:1})}}});export{I as default};
@@ -0,0 +1 @@
1
+ import{E as d,_ as i,c as p}from"./client-Ds0OqWOh.js";import{d as m,c as u,w as a,a as c,b as _,r as f,o as v,z as I}from"./index-Qez441I5.js";const x=m({__name:"VideoCover",setup(V){const o=f(""),n=async()=>{const t=await I(o.value),e=await p.videoInfo.getInfo(t);return{url:e.pic,fileName:`视频封面/${e.bvid}_${e.title}`}};return(t,e)=>{const s=d,l=i;return v(),u(l,{typeName:"视频封面",fetchImages:n},{default:a(()=>[c(s,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=r=>o.value=r),modelModifiers:{trim:!0},placeholder:"请输入B站视频链接 / b23分享链接 / BV号 / av号"},{prepend:a(()=>[...e[1]||(e[1]=[_(" 视频链接 ",-1)])]),_:1},8,["modelValue"])]),_:1})}}});export{x as default};
@@ -0,0 +1 @@
1
+ import{f as xt,g as y,h as Kt,i as wt,m as ke,n as re,u as s,p as Be,s as Ce,q as nt,r as T,t as Wt,v as B,x as ce,y as Yt,B as Re,C as Ct,D as qt,E as D,F as Xt,G as Zt,H as Jt,I as It,J as ot,d as Ge,K as Qt,L as _t,M as ea,N as ta,O as aa,P as na,Q as st,R as oa,S as Z,T as sa,U as la,V as ia,o as g,W as L,X as x,Y as Ie,Z as C,_,$ as G,c as S,w as V,a0 as J,a1 as Q,a2 as lt,a3 as be,a4 as xe,a5 as ee,a6 as ra,a7 as ua,a8 as ca,a9 as da,aa as Ee,ab as fa,ac as ma,ad as va,ae as pa,af as le,ag as St,a as Et,ah as ga,ai as ha,aj as ya,ak as Ne,al as ie,am as it,an as ba,ao as xa,ap as Oe,aq as wa,ar as Ca,as as Ia,b as rt,at as Sa,au as Ea,av as Na,aw as ka,ax as Aa,ay as ut,A as La,az as Pa,aA as Ta,aB as za}from"./index-Qez441I5.js";const Se="update:modelValue",ct="change",De="input",Fa=["class","style"],Va=/^on[A-Z]/,$a=(e={})=>{const{excludeListeners:a=!1,excludeKeys:n}=e,t=y(()=>(n?.value||[]).concat(Fa)),o=wt();return o?y(()=>Kt(Object.entries(o.proxy?.$attrs).filter(([l])=>!t.value.includes(l)&&!(a&&Va.test(l))))):(xt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),y(()=>({})))},Ma=e=>ke?window.requestAnimationFrame(e):setTimeout(e,16),dt=e=>ke?window.cancelAnimationFrame(e):clearTimeout(e);function Ba(e){let a;function n(){if(e.value==null)return;const{selectionStart:o,selectionEnd:l,value:p}=e.value;o==null||l==null||(a={selectionStart:o,selectionEnd:l,value:p,beforeTxt:p.slice(0,Math.max(0,o)),afterTxt:p.slice(Math.max(0,l))})}function t(){if(e.value==null||a==null)return;const{value:o}=e.value,{beforeTxt:l,afterTxt:p,selectionStart:r}=a;if(l==null||p==null||r==null)return;let h=o.length;if(o.endsWith(p))h=o.length-p.length;else if(o.startsWith(l))h=l.length;else{const d=l[r-1],u=o.indexOf(d,r-1);u!==-1&&(h=u+1)}e.value.setSelectionRange(h,h)}return[n,t]}function Ra(e,{disabled:a,beforeFocus:n,afterFocus:t,beforeBlur:o,afterBlur:l}={}){const{emit:p}=wt(),r=Ce(),h=T(!1),d=m=>{const w=nt(n)?n(m):!1;s(a)||h.value||w||(h.value=!0,p("focus",m),t?.())},u=m=>{const w=nt(o)?o(m):!1;s(a)||m.relatedTarget&&r.value?.contains(m.relatedTarget)||w||(h.value=!1,p("blur",m),l?.())},b=m=>{s(a)||Wt(m.target)||r.value?.contains(document.activeElement)&&r.value!==document.activeElement||e.value?.focus()};return re([r,()=>s(a)],([m,w])=>{m&&(w?m.removeAttribute("tabindex"):m.setAttribute("tabindex","-1"))}),Be(r,"focus",d,!0),Be(r,"blur",u,!0),Be(r,"click",b,!0),{isFocused:h,wrapperRef:r,handleFocus:d,handleBlur:u}}function Oa({afterComposition:e,emit:a}){const n=T(!1),t=r=>{a?.("compositionstart",r),n.value=!0},o=r=>{a?.("compositionupdate",r),n.value=!0},l=r=>{a?.("compositionend",r),n.value&&(n.value=!1,B(()=>e(r)))};return{isComposing:n,handleComposition:r=>{r.type==="compositionend"?l(r):o(r)},handleCompositionStart:t,handleCompositionUpdate:o,handleCompositionEnd:l}}const Da=Yt({id:{type:String,default:void 0},size:qt,disabled:{type:Boolean,default:void 0},modelValue:{type:D([String,Number,Object]),default:""},modelModifiers:{type:D(Object),default:()=>({})},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:D(String),default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:D([Boolean,Object]),default:!1},autocomplete:{type:D(String),default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:Re,default:Ct},showPassword:Boolean,showWordLimit:Boolean,wordLimitPosition:{type:String,values:["inside","outside"],default:"inside"},suffixIcon:{type:Re},prefixIcon:{type:Re},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:D([Object,Array,String,Boolean]),default:()=>Zt({})},countGraphemes:{type:D(Function)},autofocus:Boolean,rows:{type:Number,default:2},...Xt(["ariaLabel"]),inputmode:{type:D(String),default:void 0},name:String}),Ga={[Se]:e=>ce(e),input:e=>ce(e),change:(e,a)=>ce(e)&&(a instanceof Event||a===void 0),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:e=>e===void 0||e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent};Jt(Ct);let A;const ja={height:"0",visibility:"hidden",overflow:It()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},Ha=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],ft=e=>{const a=Number.parseFloat(e);return Number.isNaN(a)?e:a};function Ua(e){const a=window.getComputedStyle(e),n=a.getPropertyValue("box-sizing"),t=Number.parseFloat(a.getPropertyValue("padding-bottom"))+Number.parseFloat(a.getPropertyValue("padding-top")),o=Number.parseFloat(a.getPropertyValue("border-bottom-width"))+Number.parseFloat(a.getPropertyValue("border-top-width"));return{contextStyle:Ha.map(l=>[l,a.getPropertyValue(l)]),paddingSize:t,borderSize:o,boxSizing:n}}function mt(e,a=1,n){if(!A){A=document.createElement("textarea");let u=document.body;!It()&&e.parentNode&&(u=e.parentNode),u.appendChild(A)}const{paddingSize:t,borderSize:o,boxSizing:l,contextStyle:p}=Ua(e);p.forEach(([u,b])=>A?.style.setProperty(u,b)),Object.entries(ja).forEach(([u,b])=>A?.style.setProperty(u,b,"important")),A.value=e.value||e.placeholder||"";let r=A.scrollHeight;const h={};l==="border-box"?r=r+o:l==="content-box"&&(r=r-t),A.value="";const d=A.scrollHeight-t;if(ot(a)){let u=d*a;l==="border-box"&&(u=u+t+o),r=Math.max(u,r),h.minHeight=`${u}px`}if(ot(n)){let u=d*n;l==="border-box"&&(u=u+t+o),r=Math.min(u,r)}return h.height=`${r}px`,A.parentNode?.removeChild(A),A=void 0,h}const Ka=["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode"],Wa=["id","name","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","inputmode"],vt="ElInput";var Ya=Ge({name:vt,inheritAttrs:!1,__name:"input",props:Da,emits:Ga,setup(e,{expose:a,emit:n}){const t=e,o=n,l=Qt(),p=_t(),r=y(()=>[t.type==="textarea"?j.b():f.b(),f.m(E.value),f.is("disabled",$.value),f.is("exceed",Lt.value),{[f.b("group")]:p.prepend||p.append,[f.m("prefix")]:p.prefix||t.prefixIcon,[f.m("suffix")]:p.suffix||t.suffixIcon||t.clearable||t.showPassword,[f.bm("suffix","password-clear")]:me.value&&Te.value,[f.b("hidden")]:t.type==="hidden"},l.class]),h=y(()=>[f.e("wrapper"),f.is("focus",Le.value)]),d=$a(),u=y(()=>t.maxlength?.toString()),{form:b,formItem:m}=ea(),{inputId:w}=ta(t,{formItemContext:m}),E=aa(),$=na(),f=st("input"),j=st("textarea"),U=Ce(),z=Ce(),Ae=T(!1),K=T(!1),Ue=T(),Ke=T(),de=Ce(t.inputStyle),te=T(""),fe=T(),N=y(()=>U.value||z.value),{wrapperRef:Nt,isFocused:Le,handleFocus:We,handleBlur:Ye}=Ra(N,{disabled:$,afterBlur(){t.validateEvent&&m?.validate?.("blur").catch(Z)}}),qe=y(()=>b?.statusIcon??!1),ae=y(()=>m?.validateState||""),Xe=y(()=>ae.value&&ra[ae.value]),kt=y(()=>K.value?ua:ca),At=y(()=>[l.style]),Ze=y(()=>[t.inputStyle,de.value,{resize:t.resize},fe.value?{height:fe.value}:void 0]),M=y(()=>da(t.modelValue)?"":String(t.modelValue)),Pe=y(()=>t.clearable&&!$.value&&!t.readonly),me=y(()=>Pe.value&&!!M.value&&(Le.value||Ae.value)),Te=y(()=>t.showPassword&&!$.value&&!!M.value),W=y(()=>t.showWordLimit&&!!u.value&&(t.type==="text"||t.type==="textarea")&&!$.value&&!t.readonly&&!t.showPassword),ze=y(()=>t.countGraphemes&&t.showWordLimit?t.countGraphemes(M.value):M.value.length),Lt=y(()=>!!W.value&&ze.value>Number(u.value)),Pt=y(()=>!!p.suffix||!!t.suffixIcon||t.clearable||t.showPassword||W.value||!!ae.value&&qe.value),Tt=y(()=>!!Object.keys(t.modelModifiers).length),[zt,Ft]=Ba(U);let Y;oa(z,i=>{if(Vt(),!W.value&&!Pe.value||t.resize!=="both"&&t.resize!=="horizontal")return;const{width:c}=i[0].target.getBoundingClientRect(),v=()=>{Y=void 0,Ue.value={right:`calc(100% - ${c-10}px)`},Ke.value={right:`calc(100% - ${c-11}px)`}};Y&&dt(Y),Y=Ma(v)});const ne=()=>{const{type:i,autosize:c}=t;if(!(!ke||i!=="textarea"||!z.value))if(c){const v=Ee(c)?c.minRows:void 0,F=Ee(c)?c.maxRows:void 0,k=mt(z.value,v,F);de.value={overflowY:"hidden",...k},B(()=>{z.value.offsetHeight,de.value=k})}else de.value={minHeight:mt(z.value).minHeight}},Vt=(i=>{let c=!1;return()=>{if(c||!t.autosize){t.resize!=="none"&&setTimeout(()=>{fe.value=z.value?.style.height});return}z.value?.offsetParent!==null&&(setTimeout(i),c=!0)}})(ne),q=()=>{const i=N.value,c=t.formatter?t.formatter(M.value):M.value;!i||i.value===c||t.type==="file"||(i.value=c)},Je=i=>{const{trim:c,number:v}=t.modelModifiers;return c&&(i=i.trim()),v&&(i=`${ft(i)}`),t.formatter&&t.parser&&(i=t.parser(i)),i},Fe=async i=>{if(_e.value)return;const{lazy:c}=t.modelModifiers;let{value:v}=i.target,F=!1;if(c){o(De,v);return}if(v=Je(v),t.countGraphemes&&u.value!=null){const k=Number(u.value),he=t.countGraphemes(v),X=t.countGraphemes(te.value);if(he>k&&he>X)if(X>k)v=te.value,F=!0;else{const R=te.value,P=v;let I=0;for(;I<R.length&&I<P.length&&R[I]===P[I];)I++;let O=R.length,oe=P.length;for(;O>I&&oe>I&&R[O-1]===P[oe-1];)O--,oe--;const Gt=P.slice(0,I),jt=R.slice(I,O),tt=P.slice(I,oe),Ht=P.slice(oe),Ut=X-t.countGraphemes(jt),$e=Math.max(0,k-Ut);let se="";if($e>0)if(typeof Intl<"u"&&"Segmenter"in Intl){const Me=new Intl.Segmenter(void 0,{granularity:"grapheme"});for(const{segment:ye}of Me.segment(tt)){const at=se+ye;if(t.countGraphemes(at)>$e)break;se=at}}else for(const Me of Array.from(tt)){const ye=se+Me;if(t.countGraphemes(ye)>$e)break;se=ye}v=Gt+se+Ht,F=!0}}if(String(v)===M.value){if(t.formatter||F){const k=i.target,he=k.value,X=k.selectionStart,R=k.selectionEnd;if(q(),F&&N.value&&X!=null&&R!=null){const P=N.value.value,I=he.slice(Math.max(0,R));let O=Math.min(X,P.length);I&&P.endsWith(I)&&(O=P.length-I.length),N.value.setSelectionRange(O,O)}}return}te.value=v,zt(),o(Se,v),o(De,v),await B(),(t.formatter&&t.parser||!Tt.value)&&q(),Ft()},Qe=async i=>{let{value:c}=i.target;c=Je(c),t.modelModifiers.lazy&&o(Se,c),o(ct,c,i),await B(),q()},{isComposing:_e,handleCompositionStart:ve,handleCompositionUpdate:pe,handleCompositionEnd:ge}=Oa({emit:o,afterComposition:Fe}),$t=()=>{K.value=!K.value},Mt=()=>N.value?.focus(),Bt=()=>N.value?.blur(),Rt=i=>{Ae.value=!1,o("mouseleave",i)},Ot=i=>{Ae.value=!0,o("mouseenter",i)},et=i=>{o("keydown",i)},Dt=()=>{N.value?.select()},Ve=i=>{o(Se,""),o(ct,""),o("clear",i),o(De,"")};return re(()=>t.modelValue,()=>{B(()=>{ne(),t.autosize&&(fe.value=void 0)}),t.validateEvent&&m?.validate?.("change").catch(Z)}),re(()=>M.value,i=>{te.value=i},{immediate:!0}),re(M,i=>{if(!N.value)return;const{trim:c,number:v}=t.modelModifiers,F=N.value.value,k=(v||t.type==="number")&&!/^0\d/.test(F)?`${ft(F)}`:F;k!==i&&(document.activeElement===N.value&&N.value.type!=="range"&&c&&k.trim()===i||q())}),re(()=>t.type,async()=>{await B(),q(),ne()}),sa(()=>{!t.formatter&&t.parser&&xt(vt,"If you set the parser, you also need to set the formatter."),q(),B(ne)}),la(()=>{Y&&dt(Y)}),a({input:U,textarea:z,ref:N,textareaStyle:Ze,autosize:ia(t,"autosize"),isComposing:_e,passwordVisible:K,focus:Mt,blur:Bt,select:Dt,clear:Ve,resizeTextarea:ne}),(i,c)=>(g(),L("div",{class:C([r.value,{[s(f).bm("group","append")]:i.$slots.append,[s(f).bm("group","prepend")]:i.$slots.prepend}]),style:xe(At.value),onMouseenter:Ot,onMouseleave:Rt},[x(" input "),e.type!=="textarea"?(g(),L(Ie,{key:0},[x(" prepend slot "),i.$slots.prepend?(g(),L("div",{key:0,class:C(s(f).be("group","prepend"))},[_(i.$slots,"prepend")],2)):x("v-if",!0),G("div",{ref_key:"wrapperRef",ref:Nt,class:C(h.value)},[x(" prefix slot "),i.$slots.prefix||e.prefixIcon?(g(),L("span",{key:0,class:C(s(f).e("prefix"))},[G("span",{class:C(s(f).e("prefix-inner"))},[_(i.$slots,"prefix"),e.prefixIcon?(g(),S(s(Q),{key:0,class:C(s(f).e("icon"))},{default:V(()=>[(g(),S(J(e.prefixIcon)))]),_:1},8,["class"])):x("v-if",!0)],2)],2)):x("v-if",!0),G("input",lt({id:s(w),ref_key:"input",ref:U,class:s(f).e("inner")},s(d),{name:e.name,minlength:e.countGraphemes?void 0:e.minlength,maxlength:e.countGraphemes?void 0:u.value,type:e.showPassword?K.value?"text":"password":e.type,disabled:s($),readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.ariaLabel,placeholder:e.placeholder,style:e.inputStyle,form:e.form,autofocus:e.autofocus,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:c[0]||(c[0]=(...v)=>s(ve)&&s(ve)(...v)),onCompositionupdate:c[1]||(c[1]=(...v)=>s(pe)&&s(pe)(...v)),onCompositionend:c[2]||(c[2]=(...v)=>s(ge)&&s(ge)(...v)),onInput:Fe,onChange:Qe,onKeydown:et}),null,16,Ka),x(" suffix slot "),Pt.value?(g(),L("span",{key:1,class:C(s(f).e("suffix"))},[G("span",{class:C(s(f).e("suffix-inner"))},[Pe.value?(g(),S(s(Q),{key:0,class:C([s(f).e("icon"),s(f).e("clear")]),style:xe({visibility:me.value?"visible":"hidden"}),onMousedown:be(s(Z),["prevent"]),onClick:Ve},{default:V(()=>[(g(),S(J(e.clearIcon)))]),_:1},8,["class","style","onMousedown"])):x("v-if",!0),!me.value||!Te.value||!W.value?(g(),L(Ie,{key:1},[_(i.$slots,"suffix"),e.suffixIcon?(g(),S(s(Q),{key:0,class:C(s(f).e("icon"))},{default:V(()=>[(g(),S(J(e.suffixIcon)))]),_:1},8,["class"])):x("v-if",!0)],64)):x("v-if",!0),Te.value?(g(),S(s(Q),{key:2,class:C([s(f).e("icon"),s(f).e("password")]),onClick:$t,onMousedown:be(s(Z),["prevent"]),onMouseup:be(s(Z),["prevent"])},{default:V(()=>[_(i.$slots,"password-icon",{visible:K.value},()=>[(g(),S(J(kt.value)))])]),_:3},8,["class","onMousedown","onMouseup"])):x("v-if",!0),W.value?(g(),L("span",{key:3,class:C([s(f).e("count"),s(f).is("outside",e.wordLimitPosition==="outside")])},[G("span",{class:C(s(f).e("count-inner"))},ee(ze.value)+" / "+ee(u.value),3)],2)):x("v-if",!0),ae.value&&Xe.value&&qe.value?(g(),S(s(Q),{key:4,class:C([s(f).e("icon"),s(f).e("validateIcon"),s(f).is("loading",ae.value==="validating")])},{default:V(()=>[(g(),S(J(Xe.value)))]),_:1},8,["class"])):x("v-if",!0)],2)],2)):x("v-if",!0)],2),x(" append slot "),i.$slots.append?(g(),L("div",{key:1,class:C(s(f).be("group","append"))},[_(i.$slots,"append")],2)):x("v-if",!0)],64)):(g(),L(Ie,{key:1},[x(" textarea "),G("textarea",lt({id:s(w),ref_key:"textarea",ref:z,class:[s(j).e("inner"),s(f).is("focus",s(Le)),s(j).is("clearable",e.clearable)]},s(d),{name:e.name,minlength:e.countGraphemes?void 0:e.minlength,maxlength:e.countGraphemes?void 0:u.value,tabindex:e.tabindex,disabled:s($),readonly:e.readonly,autocomplete:e.autocomplete,style:Ze.value,"aria-label":e.ariaLabel,placeholder:e.placeholder,form:e.form,autofocus:e.autofocus,rows:e.rows,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:c[3]||(c[3]=(...v)=>s(ve)&&s(ve)(...v)),onCompositionupdate:c[4]||(c[4]=(...v)=>s(pe)&&s(pe)(...v)),onCompositionend:c[5]||(c[5]=(...v)=>s(ge)&&s(ge)(...v)),onInput:Fe,onFocus:c[6]||(c[6]=(...v)=>s(We)&&s(We)(...v)),onBlur:c[7]||(c[7]=(...v)=>s(Ye)&&s(Ye)(...v)),onChange:Qe,onKeydown:et}),null,16,Wa),me.value?(g(),S(s(Q),{key:0,class:C([s(j).e("icon"),s(j).e("clear")]),style:xe(Ke.value),onMousedown:be(s(Z),["prevent"]),onClick:Ve},{default:V(()=>[(g(),S(J(e.clearIcon)))]),_:1},8,["class","style","onMousedown"])):x("v-if",!0),W.value?(g(),L("span",{key:1,style:xe(Ue.value),class:C([s(f).e("count"),s(f).is("outside",e.wordLimitPosition==="outside")])},ee(ze.value)+" / "+ee(u.value),7)):x("v-if",!0)],64))],38))}}),qa=Ya;const sn=fa(qa);function Xa(e,a){let n;const t=T(!1),o=ma({...e,originalPosition:"",originalOverflow:"",visible:!1});function l(m){o.text=m}function p(){const m=o.parent,w=b.ns;if(!m.vLoadingAddClassList){let E=m.getAttribute("loading-number");E=Number.parseInt(E)-1,E?m.setAttribute("loading-number",E.toString()):(Ne(m,w.bm("parent","relative")),m.removeAttribute("loading-number")),Ne(m,w.bm("parent","hidden"))}r(),u.unmount()}function r(){b.$el?.parentNode?.removeChild(b.$el)}function h(){e.beforeClose&&!e.beforeClose()||(t.value=!0,clearTimeout(n),n=setTimeout(d,400),o.visible=!1,e.closed?.())}function d(){if(!t.value)return;const m=o.parent;t.value=!1,m.vLoadingAddClassList=void 0,p()}const u=va(Ge({name:"ElLoading",setup(m,{expose:w}){const{ns:E,zIndex:$}=pa("loading");return w({ns:E,zIndex:$}),()=>{const f=o.spinner||o.svg,j=le("svg",{class:"circular",viewBox:o.svgViewBox?o.svgViewBox:"0 0 50 50",...f?{innerHTML:f}:{}},[le("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),U=o.text?le("p",{class:E.b("text")},[o.text]):void 0;return le(ha,{name:E.b("fade"),onAfterLeave:d},{default:V(()=>[St(Et("div",{style:{backgroundColor:o.background||""},class:[E.b("mask"),o.customClass,E.is("fullscreen",o.fullscreen)]},[le("div",{class:E.b("spinner")},[j,U])]),[[ga,o.visible]])])})}}}));Object.assign(u._context,a??{});const b=u.mount(document.createElement("div"));return{...ya(o),setText:l,removeElLoadingChild:r,close:h,handleAfterLeave:d,vm:b,get $el(){return b.$el}}}let we;const je=function(e={},a){if(!ke)return;const n=Za(e);if(n.fullscreen&&we)return we;const t=Xa({...n,closed:()=>{n.closed?.(),n.fullscreen&&(we=void 0)}},a??je._context);Ja(n,n.parent,t),pt(n,n.parent,t),n.parent.vLoadingAddClassList=()=>pt(n,n.parent,t);let o=n.parent.getAttribute("loading-number");return o?o=`${Number.parseInt(o)+1}`:o="1",n.parent.setAttribute("loading-number",o),n.parent.appendChild(t.$el),B(()=>t.visible.value=n.visible),n.fullscreen&&(we=t),t},Za=e=>{let a;return ce(e.target)?a=document.querySelector(e.target)??document.body:a=e.target||document.body,{parent:a===document.body||e.body?document.body:a,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:a===document.body&&(e.fullscreen??!0),lock:e.lock??!1,customClass:e.customClass||"",visible:e.visible??!0,beforeClose:e.beforeClose,closed:e.closed,target:a}},Ja=async(e,a,n)=>{const{nextZIndex:t}=n.vm.zIndex||n.vm._.exposed.zIndex,o={};if(e.fullscreen)n.originalPosition.value=ie(document.body,"position"),n.originalOverflow.value=ie(document.body,"overflow"),o.zIndex=t();else if(e.parent===document.body){n.originalPosition.value=ie(document.body,"position"),await B();for(const l of["top","left"]){const p=l==="top"?"scrollTop":"scrollLeft";o[l]=`${e.target.getBoundingClientRect()[l]+document.body[p]+document.documentElement[p]-Number.parseInt(ie(document.body,`margin-${l}`),10)}px`}for(const l of["height","width"])o[l]=`${e.target.getBoundingClientRect()[l]}px`}else n.originalPosition.value=ie(a,"position");for(const[l,p]of Object.entries(o))n.$el.style[l]=p},pt=(e,a,n)=>{const t=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?Ne(a,t.bm("parent","relative")):it(a,t.bm("parent","relative")),e.fullscreen&&e.lock?it(a,t.bm("parent","hidden")):Ne(a,t.bm("parent","hidden"))};je._context=null;const ue=Symbol("ElLoading"),H=e=>`element-loading-${xa(e)}`,gt=(e,a)=>{const n=a.instance,t=d=>Ee(a.value)?a.value[d]:void 0,o=d=>T(ce(d)&&n?.[d]||d),l=d=>o(t(d)||e.getAttribute(H(d))),p=t("fullscreen")??a.modifiers.fullscreen,r={text:l("text"),svg:l("svg"),svgViewBox:l("svgViewBox"),spinner:l("spinner"),background:l("background"),customClass:l("customClass"),fullscreen:p,target:t("target")??(p?void 0:e),body:t("body")??a.modifiers.body,lock:t("lock")??a.modifiers.lock},h=je(r);h._context=He._context,e[ue]={options:r,instance:h}},Qa=(e,a)=>{for(const n of Object.keys(e))ba(e[n])&&(e[n].value=a[n])},He={mounted(e,a){a.value&&gt(e,a)},updated(e,a){const n=e[ue];if(!a.value){n?.instance.close(),e[ue]=null;return}n?Qa(n.options,Ee(a.value)?a.value:{text:e.getAttribute(H("text")),svg:e.getAttribute(H("svg")),svgViewBox:e.getAttribute(H("svgViewBox")),spinner:e.getAttribute(H("spinner")),background:e.getAttribute(H("background")),customClass:e.getAttribute(H("customClass"))}):gt(e,a)},unmounted(e){e[ue]?.instance.close(),e[ue]=null}};He._context=null;function ht(e,a=255){if(!e)return e;const n=/[<>:"/\\|?*]/g;let t=e.replace(n,"_");return t=t.replace(/[\x00-\x1f\x7f]/g,"").trim(),t=t.replace(/[. ]$/,"_"),t.slice(0,a)}const yt=e=>{const a=e.lastIndexOf(".");return a>-1?e.slice(a):"png"},ln=e=>{try{const n=new URL(e).pathname.split("/").pop();if(!n)return"";const t=n.lastIndexOf(".");return t>0?n.slice(0,t):n}catch{return crypto.randomUUID()}},bt=(...e)=>e.filter(a=>!!a).join("/").replace(/\/+/g,"/"),_a=async e=>{if(!e||e.length===0)return;const a=await Oe.file.getRootDir();let n=null;for(const{complete:t,url:o,fileName:l}of e){const r=await(await fetch(o)).arrayBuffer(),h=new Uint8Array(r),d=l.split("/");let u;d.length===1?u=bt(a,ht(`${l}${yt(o)}`)):u=bt(a,...d.slice(0,-1),ht(`${d[d.length-1]}${yt(o)}`)),await Oe.file.write(u,h),t||await wa(500,777),n||(n=u)}await Oe.system.showItemInFolder(n),Ca("保存成功")},en={class:"action-section"},tn=["src","alt","data-file-name"],an=Ge({__name:"ImageDownload",props:{typeName:{},fetchImages:{type:Function}},setup(e){const a=e,n=T([]),{loading:t,loadingData:o}=ka(),{assertLoggedIn:l}=Ia(),p=Aa("imagesContainerRef"),r=o(async()=>{l();try{const d=await a.fetchImages()??[];Array.isArray(d)?n.value=d:n.value=[d],n.value.length===0&&ut(`${a.typeName}为空`)}catch(d){throw new La(`获取${a.typeName}失败:${Pa(d)}`)}}),h=o(async()=>{const d=p.value?.querySelectorAll("img");if(!d||!d.length){ut("图片为空");return}const u=[];for(let b=0;b<d.length;b++){const m=d[b];u.push({url:m.src,fileName:m.dataset.fileName??crypto.randomUUID(),complete:m.complete})}await _a(u)});return(d,u)=>{const b=Sa,m=He;return St((g(),S(s(Na),{class:"page"},{default:V(()=>[G("div",en,[_(d.$slots,"default",{},void 0,!0),Et(b,{type:"primary",onClick:s(r)},{default:V(()=>[rt("获取"+ee(e.typeName),1)]),_:1},8,["onClick"]),n.value.length>0?(g(),S(b,{key:0,type:"primary",onClick:u[0]||(u[0]=w=>s(h)())},{default:V(()=>[rt("保存"+ee(e.typeName),1)]),_:1})):x("",!0)]),G("div",{class:"images-container",ref_key:"imagesContainerRef",ref:p},[(g(!0),L(Ie,null,Ea(n.value,w=>(g(),L("img",{src:w.url,alt:w.fileName,key:w.url,"data-file-name":w.fileName,loading:"lazy"},null,8,tn))),128))],512)]),_:3})),[[m,s(t)]])}}}),rn=Ta(an,[["__scopeId","data-v-d6a10c2f"]]),un=new za;export{sn as E,rn as _,un as c,ln as g};
@@ -0,0 +1 @@
1
+ [data-v-d6a10c2f] .action-section{width:100%;display:flex;flex-direction:column;gap:10px}[data-v-d6a10c2f] .action-section .el-button+.el-button{margin-left:0!important}[data-v-d6a10c2f] .images-container{display:flex;flex-wrap:wrap;overflow-y:auto;gap:10px}[data-v-d6a10c2f] .images-container>img:only-child{max-width:100%}[data-v-d6a10c2f] .images-container>img{max-width:150px}