Files
CloudFlare-ImgBed/frontend-dist/js/253.8851e7fa.js
T

2 lines
114 KiB
JavaScript

(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[253],{213:function(e,t,o){"use strict";o(85331),o(19104)},732:function(e,t,o){"use strict";o.d(t,{A:function(){return p}});var a=o(56768),l=o(24232);const s=["href","target"],i=["alt","src"];function n(e,t,o,n,r,d){return(0,a.uX)(),(0,a.CE)("a",{href:d.logoHref,target:o.target,class:(0,l.C4)(e.logo-e.link)},[(0,a.Lk)("img",{class:(0,l.C4)(d.logoClasses),alt:o.alt,src:d.logoUrl},null,10,i)],10,s)}var r=o(60782),d={name:"Logo",props:{href:{type:String,default:"https://github.com/MarSeventh/CloudFlare-ImgBed"},target:{type:String,default:"_blank",validator:e=>["_blank","_self","_parent","_top"].includes(e)},alt:{type:String,default:"Sanyue logo"},customSrc:{type:String,default:""},position:{type:String,default:"fixed",validator:e=>["fixed","relative","absolute","static"].includes(e)},size:{type:String,default:"normal",validator:e=>["small","normal","large"].includes(e)},enableHover:{type:Boolean,default:!0},useConfigLink:{type:Boolean,default:!1}},computed:{...(0,r.L8)(["userConfig"]),logoUrl(){return this.customSrc||this.userConfig?.logoUrl||o(33153)},logoHref(){return this.useConfigLink&&this.userConfig?.logoLink?this.userConfig.logoLink:this.href},logoClasses(){return{logo:!0,[`logo--${this.position}`]:!0,[`logo--${this.size}`]:!0,"logo--hover-enabled":this.enableHover}}}},c=o(71241);const u=(0,c.A)(d,[["render",n],["__scopeId","data-v-17f54292"]]);var p=u},2253:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return Ho}});var a=o(78507),l=(o(85331),o(213),o(80047)),s=(o(99648),o(56768)),i=o(24232);const n={class:"history-header"},r={class:"header-left"},d={class:"record-count"},c={class:"header-right"},u={class:"timeline-header"},p={class:"date-label"},h={key:0,class:"grid-view"},m={class:"grid-preview"},f=["src"],g=["src"],y={key:2,class:"file-icon-wrapper"},b={class:"grid-overlay"},k={class:"grid-actions"},v={class:"grid-info"},C=["title"],w={class:"upload-time"},F={key:1,class:"list-view"},L={class:"list-preview"},U=["src"],$=["src"],S={key:2,class:"file-icon-wrapper-small"},T={class:"list-info"},_=["title"],x=["title"],A={class:"list-meta"},M={class:"upload-time"},R={class:"list-actions"},D={key:0,class:"load-more-container"},E={key:0,class:"loading-indicator"},I={key:1,class:"load-more-hint"},P={key:1,class:"no-more-hint"},N={key:1,class:"empty-state"};function z(e,t,o,z,W,V){const B=(0,s.g2)("font-awesome-icon"),H=l.S2,Q=a.R7;return(0,s.uX)(),(0,s.CE)("div",{class:(0,i.C4)(["history-container",{active:o.show}])},[(0,s.Lk)("div",n,[(0,s.Lk)("div",r,[(0,s.Lk)("h2",null,(0,i.v_)(e.$t("uploadHistory.title")),1),(0,s.Lk)("span",d,(0,i.v_)(e.$t("uploadHistory.totalRecords",{count:W.totalCount})),1)]),(0,s.Lk)("div",c,[(0,s.bF)(Q,{content:e.$t("uploadHistory.switchView"),placement:"bottom","show-after":1e3},{default:(0,s.k6)(()=>[(0,s.bF)(H,{circle:"",onClick:V.toggleViewMode},{default:(0,s.k6)(()=>[(0,s.bF)(B,{icon:"grid"===W.viewMode?"list":"th-large"},null,8,["icon"])]),_:1},8,["onClick"])]),_:1},8,["content"]),(0,s.bF)(Q,{content:e.$t("uploadHistory.clearRecords"),placement:"bottom","show-after":1e3},{default:(0,s.k6)(()=>[(0,s.bF)(H,{circle:"",type:"danger",onClick:V.clearHistory},{default:(0,s.k6)(()=>[(0,s.bF)(B,{icon:"trash-alt"})]),_:1},8,["onClick"])]),_:1},8,["content"]),(0,s.bF)(H,{circle:"",onClick:t[0]||(t[0]=t=>e.$emit("close"))},{default:(0,s.k6)(()=>[(0,s.bF)(B,{icon:"times"})]),_:1})])]),W.historyList.length>0?((0,s.uX)(),(0,s.CE)("div",{key:0,class:"history-content",ref:"historyContent",onScroll:t[3]||(t[3]=(...e)=>V.handleScroll&&V.handleScroll(...e))},[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(V.groupedHistory,e=>((0,s.uX)(),(0,s.CE)("div",{key:e.date,class:"history-group"},[(0,s.Lk)("div",u,[t[4]||(t[4]=(0,s.Lk)("div",{class:"timeline-dot"},null,-1)),(0,s.Lk)("span",p,(0,i.v_)(e.date),1)]),"grid"===W.viewMode?((0,s.uX)(),(0,s.CE)("div",h,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(e.items,e=>((0,s.uX)(),(0,s.CE)("div",{key:e.time,class:"grid-item"},[(0,s.Lk)("div",m,[V.isImage(e.name)?((0,s.uX)(),(0,s.CE)("img",{key:0,src:e.url,loading:"lazy",onError:t[1]||(t[1]=(...e)=>V.handleImageError&&V.handleImageError(...e))},null,40,f)):V.isVideo(e.name)?((0,s.uX)(),(0,s.CE)("video",{key:1,src:e.url,muted:""},null,8,g)):((0,s.uX)(),(0,s.CE)("div",y,[(0,s.bF)(B,{icon:"file",class:"file-icon"})])),(0,s.Lk)("div",b,[(0,s.Lk)("div",k,[(0,s.bF)(H,{circle:"",size:"default",type:"primary",onClick:t=>V.copyLink(e.url)},{default:(0,s.k6)(()=>[(0,s.bF)(B,{icon:"copy"})]),_:1},8,["onClick"]),(0,s.bF)(H,{circle:"",size:"default",class:"action-btn-view",onClick:t=>V.openLink(e.url)},{default:(0,s.k6)(()=>[(0,s.bF)(B,{icon:"external-link-alt"})]),_:1},8,["onClick"]),(0,s.bF)(H,{circle:"",size:"default",type:"danger",onClick:t=>V.deleteItem(e)},{default:(0,s.k6)(()=>[(0,s.bF)(B,{icon:"trash-alt"})]),_:1},8,["onClick"])])])]),(0,s.Lk)("div",v,[(0,s.Lk)("div",{class:"file-name",title:e.name},(0,i.v_)(e.name),9,C),(0,s.Lk)("div",w,(0,i.v_)(V.formatTime(e.time)),1)])]))),128))])):((0,s.uX)(),(0,s.CE)("div",F,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(e.items,e=>((0,s.uX)(),(0,s.CE)("div",{key:e.time,class:"list-item"},[(0,s.Lk)("div",L,[V.isImage(e.name)?((0,s.uX)(),(0,s.CE)("img",{key:0,src:e.url,loading:"lazy",onError:t[2]||(t[2]=(...e)=>V.handleImageError&&V.handleImageError(...e))},null,40,U)):V.isVideo(e.name)?((0,s.uX)(),(0,s.CE)("video",{key:1,src:e.url,muted:""},null,8,$)):((0,s.uX)(),(0,s.CE)("div",S,[(0,s.bF)(B,{icon:"file"})]))]),(0,s.Lk)("div",T,[(0,s.Lk)("div",{class:"file-name",title:e.name},(0,i.v_)(e.name),9,_),(0,s.Lk)("div",{class:"file-url",title:e.url},(0,i.v_)(e.url),9,x)]),(0,s.Lk)("div",A,[(0,s.Lk)("div",M,(0,i.v_)(V.formatTime(e.time)),1)]),(0,s.Lk)("div",R,[(0,s.bF)(H,{circle:"",size:"small",type:"primary",onClick:t=>V.copyLink(e.url)},{default:(0,s.k6)(()=>[(0,s.bF)(B,{icon:"copy"})]),_:1},8,["onClick"]),(0,s.bF)(H,{circle:"",size:"small",class:"action-btn-view",onClick:t=>V.openLink(e.url)},{default:(0,s.k6)(()=>[(0,s.bF)(B,{icon:"external-link-alt"})]),_:1},8,["onClick"]),(0,s.bF)(H,{circle:"",size:"small",type:"danger",onClick:t=>V.deleteItem(e)},{default:(0,s.k6)(()=>[(0,s.bF)(B,{icon:"trash-alt"})]),_:1},8,["onClick"])])]))),128))]))]))),128)),V.hasMore?((0,s.uX)(),(0,s.CE)("div",D,[W.loadingMore?((0,s.uX)(),(0,s.CE)("div",E,[(0,s.bF)(B,{icon:"spinner",spin:""}),(0,s.Lk)("span",null,(0,i.v_)(e.$t("uploadHistory.loading")),1)])):((0,s.uX)(),(0,s.CE)("div",I,(0,i.v_)(e.$t("uploadHistory.pullToLoadMore")),1))])):W.historyList.length>0?((0,s.uX)(),(0,s.CE)("div",P,(0,i.v_)(e.$t("uploadHistory.noMoreRecords")),1)):(0,s.Q3)("",!0)],544)):((0,s.uX)(),(0,s.CE)("div",N,[(0,s.bF)(B,{icon:"history",class:"empty-icon"}),(0,s.Lk)("p",null,(0,i.v_)(e.$t("uploadHistory.emptyHistory")),1)]))],2)}o(44114),o(18111),o(22489),o(7588),o(61701);var W={name:"UploadHistory",props:{show:{type:Boolean,default:!1}},data(){return{historyList:[],allHistory:[],viewMode:"grid",pageSize:30,currentPage:0,loadingMore:!1,totalCount:0}},watch:{show(e){e&&this.resetAndLoad()}},computed:{hasMore(){return this.historyList.length<this.totalCount},groupedHistory(){const e={};return this.historyList.forEach(t=>{const o=new Date(t.time),a=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")}`;e[a]||(e[a]=[]),e[a].push(t)}),Object.keys(e).sort((e,t)=>new Date(t)-new Date(e)).map(t=>({date:t,items:e[t]}))}},mounted(){const e=localStorage.getItem("historyViewMode");e&&(this.viewMode=e)},methods:{resetAndLoad(){this.historyList=[],this.currentPage=0,this.loadAllHistory(),this.loadMore()},loadAllHistory(){try{const e=JSON.parse(localStorage.getItem("uploadHistory")||"[]");this.allHistory=e.sort((e,t)=>t.time-e.time),this.totalCount=this.allHistory.length}catch(e){console.error("Failed to load history",e),this.allHistory=[],this.totalCount=0}},loadMore(){!this.loadingMore&&this.hasMore&&(this.loadingMore=!0,setTimeout(()=>{const e=this.currentPage*this.pageSize,t=e+this.pageSize,o=this.allHistory.slice(e,t);this.historyList=[...this.historyList,...o],this.currentPage++,this.loadingMore=!1},50))},handleScroll(e){const t=e.target,o=t.scrollTop,a=t.scrollHeight,l=t.clientHeight;a-o-l<100&&this.loadMore()},toggleViewMode(){this.viewMode="grid"===this.viewMode?"list":"grid",localStorage.setItem("historyViewMode",this.viewMode)},clearHistory(){this.$confirm(this.$t("uploadHistory.clearConfirmMessage"),this.$t("uploadHistory.clearConfirmTitle"),{confirmButtonText:this.$t("uploadHistory.clearConfirmOk"),cancelButtonText:this.$t("uploadHistory.clearConfirmCancel"),type:"warning"}).then(()=>{this.historyList=[],this.allHistory=[],this.totalCount=0,this.currentPage=0,localStorage.removeItem("uploadHistory"),this.$message.success(this.$t("uploadHistory.recordsCleared"))}).catch(()=>{})},deleteItem(e){this.$confirm(this.$t("uploadHistory.deleteConfirmMessage"),this.$t("uploadHistory.clearConfirmTitle"),{confirmButtonText:this.$t("uploadHistory.clearConfirmOk"),cancelButtonText:this.$t("uploadHistory.clearConfirmCancel"),type:"warning"}).then(()=>{this.historyList=this.historyList.filter(t=>t.time!==e.time),this.allHistory=this.allHistory.filter(t=>t.time!==e.time),this.totalCount=this.allHistory.length;try{localStorage.setItem("uploadHistory",JSON.stringify(this.allHistory)),this.$message.success(this.$t("uploadHistory.recordDeleted"))}catch(t){console.error("Failed to update history",t)}}).catch(()=>{})},isImage(e){const t=["jpg","jpeg","png","gif","bmp","webp","svg","tiff","ico","avif","heic","jfif","pjpeg","pjp"],o=e?e.split(".").pop().toLowerCase():"";return t.includes(o)},isVideo(e){const t=["mp4","webm","ogg","mkv"],o=e?e.split(".").pop().toLowerCase():"";return t.includes(o)},formatTime(e){const t=new Date(e),o=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0"),s=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),n=String(t.getSeconds()).padStart(2,"0");return`${o}-${a}-${l} ${s}:${i}:${n}`},copyLink(e){navigator.clipboard.writeText(e).then(()=>{this.$message.success(this.$t("uploadHistory.linkCopied"))}).catch(()=>{this.$message.error(this.$t("uploadHistory.copyFailed"))})},openLink(e){window.open(e,"_blank")},handleImageError(e){e.target.src=o(96682)}}},V=o(71241);const B=(0,V.A)(W,[["render",z],["__scopeId","data-v-7da2f8c2"]]);var H=B,Q=o(86975),X=o(9267),q=(o(15616),o(81418)),j=(o(50333),o(74757)),O=o(55558),G=(o(10456),o(39623)),K=(o(29092),o(76018)),J=(o(96808),o(67819),o(66810)),Y=(o(34396),o(4885),o(97769));const Z={class:"dialog-section"},ee={class:"section-header"},te={class:"section-title"},oe={class:"section-content"},ae={class:"setting-item"},le={class:"setting-label"},se={key:0,class:"setting-item"},ie={class:"setting-label"},ne={class:"setting-item"},re={class:"setting-label"},de={class:"setting-item"},ce={class:"setting-label"},ue={class:"dialog-section"},pe={class:"section-header"},he={class:"section-title"},me={class:"section-content"},fe={class:"dialog-section"},ge={class:"section-header"},ye={class:"section-title"},be={class:"section-content"},ke={class:"setting-item"},ve={class:"setting-label"},Ce={class:"setting-item"},we={class:"setting-label"},Fe={key:0,class:"setting-item slider-item"},Le={class:"setting-label"},Ue={class:"slider-wrapper"},$e={class:"slider-input-wrapper"},Se={key:1,class:"setting-item slider-item"},Te={class:"setting-label"},_e={class:"slider-wrapper"},xe={class:"slider-input-wrapper"},Ae={key:0,class:"dialog-section"},Me={class:"section-header"},Re={class:"section-title"},De={class:"section-content"},Ee={class:"setting-item"},Ie={class:"setting-label"},Pe={class:"dialog-action"};function Ne(e,t,o,n,r,d){const c=Y.A,u=J.ll,p=J.MQ,h=(0,s.g2)("font-awesome-icon"),m=a.R7,f=K.P9,g=K.AV,y=G.WK,b=O.qi,k=j.B8,v=q.lq,C=l.S2,w=X.kZ;return(0,s.uX)(),(0,s.Wv)(w,{title:e.$t("uploadSettings.title"),modelValue:d.visible,"onUpdate:modelValue":t[12]||(t[12]=e=>d.visible=e),width:d.dialogWidth,"show-close":!1,class:"settings-dialog settings-dialog-scope upload-settings-dialog"},{default:(0,s.k6)(()=>[(0,s.Lk)("div",Z,[(0,s.Lk)("div",ee,[(0,s.Lk)("span",te,(0,i.v_)(e.$t("uploadSettings.uploadChannel")),1)]),(0,s.Lk)("div",oe,[(0,s.Lk)("div",ae,[(0,s.Lk)("span",le,(0,i.v_)(e.$t("uploadSettings.channelType")),1),(0,s.bF)(p,{"model-value":o.uploadChannel,"onUpdate:modelValue":t[0]||(t[0]=t=>e.$emit("update:uploadChannel",t)),class:"radio-card-group compact"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{label:"telegram",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(c,{type:"telegram",class:"channel-icon"}),t[13]||(t[13]=(0,s.Lk)("span",null,"TG",-1))]),_:1}),(0,s.bF)(u,{label:"cfr2",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(c,{type:"cfr2",class:"channel-icon"}),t[14]||(t[14]=(0,s.Lk)("span",null,"R2",-1))]),_:1}),(0,s.bF)(u,{label:"s3",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(c,{type:"s3",class:"channel-icon"}),t[15]||(t[15]=(0,s.Lk)("span",null,"S3",-1))]),_:1}),(0,s.bF)(u,{label:"discord",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(c,{type:"discord",class:"channel-icon"}),t[16]||(t[16]=(0,s.Lk)("span",null,"DC",-1))]),_:1}),(0,s.bF)(u,{label:"huggingface",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(c,{type:"huggingface",class:"channel-icon"}),t[17]||(t[17]=(0,s.Lk)("span",null,"HF",-1))]),_:1}),(0,s.bF)(u,{label:"webdav",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(c,{type:"webdav",class:"channel-icon"}),t[18]||(t[18]=(0,s.Lk)("span",null,"WD",-1))]),_:1})]),_:1},8,["model-value"])]),o.currentChannelList.length>1?((0,s.uX)(),(0,s.CE)("div",se,[(0,s.Lk)("span",ie,[(0,s.eW)((0,i.v_)(e.$t("uploadSettings.channelName"))+" ",1),(0,s.bF)(m,{content:e.$t("uploadSettings.channelNameTooltip"),placement:"top"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,s.bF)(g,{"model-value":o.channelName,"onUpdate:modelValue":t[1]||(t[1]=t=>e.$emit("update:channelName",t)),placeholder:e.$t("uploadSettings.autoSelect"),clearable:"",class:"setting-input"},{default:(0,s.k6)(()=>[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(o.currentChannelList,e=>((0,s.uX)(),(0,s.Wv)(f,{key:e.name,label:e.name,value:e.name},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder"])])):(0,s.Q3)("",!0),(0,s.Lk)("div",ne,[(0,s.Lk)("span",re,(0,i.v_)(e.$t("uploadSettings.uploadDirectory")),1),(0,s.bF)(y,{"model-value":o.uploadFolder,"onUpdate:modelValue":d.handleUploadFolderInput,placeholder:e.$t("uploadSettings.uploadDirectoryPlaceholder"),class:"setting-input"},null,8,["model-value","onUpdate:modelValue","placeholder"])]),(0,s.Lk)("div",de,[(0,s.Lk)("span",ce,[(0,s.eW)((0,i.v_)(e.$t("uploadSettings.autoSwitch"))+" ",1),(0,s.bF)(m,{content:e.$t("uploadSettings.autoSwitchTooltip"),placement:"top"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,s.bF)(b,{"model-value":o.autoRetry,"onUpdate:modelValue":t[2]||(t[2]=t=>e.$emit("update:autoRetry",t))},null,8,["model-value"])])])]),(0,s.Lk)("div",ue,[(0,s.Lk)("div",pe,[(0,s.Lk)("span",he,(0,i.v_)(e.$t("uploadSettings.fileNaming")),1)]),(0,s.Lk)("div",me,[(0,s.bF)(p,{"model-value":o.uploadNameType,"onUpdate:modelValue":t[3]||(t[3]=t=>e.$emit("update:uploadNameType",t)),class:"radio-card-group grid-2x2"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{label:"default",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"cog",class:"radio-icon"}),(0,s.Lk)("span",null,(0,i.v_)(e.$t("uploadSettings.namingDefault")),1)]),_:1}),(0,s.bF)(u,{label:"index",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"hashtag",class:"radio-icon"}),(0,s.Lk)("span",null,(0,i.v_)(e.$t("uploadSettings.namingIndex")),1)]),_:1}),(0,s.bF)(u,{label:"origin",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"file-signature",class:"radio-icon"}),(0,s.Lk)("span",null,(0,i.v_)(e.$t("uploadSettings.namingOrigin")),1)]),_:1}),(0,s.bF)(u,{label:"short",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"compress-alt",class:"radio-icon"}),(0,s.Lk)("span",null,(0,i.v_)(e.$t("uploadSettings.namingShort")),1)]),_:1})]),_:1},8,["model-value"])])]),(0,s.Lk)("div",fe,[(0,s.Lk)("div",ge,[(0,s.Lk)("span",ye,(0,i.v_)(e.$t("uploadSettings.filePreprocess")),1),(0,s.bF)(m,{content:e.$t("uploadSettings.filePreprocessTooltip"),placement:"top"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"question-circle",class:"section-help-icon"})]),_:1},8,["content"])]),(0,s.Lk)("div",be,[(0,s.Lk)("div",ke,[(0,s.Lk)("span",ve,[(0,s.eW)((0,i.v_)(e.$t("uploadSettings.convertToWebp"))+" ",1),(0,s.bF)(m,{content:e.$t("uploadSettings.convertToWebpTooltip"),placement:"top"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,s.bF)(b,{"model-value":o.convertToWebp,"onUpdate:modelValue":t[4]||(t[4]=t=>e.$emit("update:convertToWebp",t))},null,8,["model-value"])]),(0,s.Lk)("div",Ce,[(0,s.Lk)("span",we,(0,i.v_)(e.$t("uploadSettings.fileCompress")),1),(0,s.bF)(b,{"model-value":o.customerCompress,"onUpdate:modelValue":t[5]||(t[5]=t=>e.$emit("update:customerCompress",t))},null,8,["model-value"])]),o.customerCompress?((0,s.uX)(),(0,s.CE)("div",Fe,[(0,s.Lk)("span",Le,[(0,s.eW)((0,i.v_)(e.$t("uploadSettings.compressThreshold"))+" ",1),(0,s.bF)(m,{content:e.$t("uploadSettings.compressThresholdTooltip"),placement:"top"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,s.Lk)("div",Ue,[(0,s.bF)(k,{"model-value":o.compressBar,"onUpdate:modelValue":t[6]||(t[6]=t=>e.$emit("update:compressBar",t)),min:1,max:20,"format-tooltip":e=>`${e} MB`},null,8,["model-value","format-tooltip"]),(0,s.Lk)("div",$e,[(0,s.bF)(v,{"model-value":o.compressBar,"onUpdate:modelValue":t[7]||(t[7]=t=>e.$emit("update:compressBar",t)),min:1,max:20,step:1,"value-on-clear":1,class:"slider-input","controls-position":"right"},null,8,["model-value"]),t[19]||(t[19]=(0,s.Lk)("span",{class:"slider-unit"},"MB",-1))])])])):(0,s.Q3)("",!0),o.customerCompress?((0,s.uX)(),(0,s.CE)("div",Se,[(0,s.Lk)("span",Te,[(0,s.eW)((0,i.v_)(e.$t("uploadSettings.expectedSize"))+" ",1),(0,s.bF)(m,{content:e.$t("uploadSettings.expectedSizeTooltip"),placement:"top"},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,s.Lk)("div",_e,[(0,s.bF)(k,{"model-value":o.compressQuality,"onUpdate:modelValue":t[8]||(t[8]=t=>e.$emit("update:compressQuality",t)),min:.5,max:o.compressBar,step:.1,"format-tooltip":e=>`${e} MB`},null,8,["model-value","max","format-tooltip"]),(0,s.Lk)("div",xe,[(0,s.bF)(v,{"model-value":o.compressQuality,"onUpdate:modelValue":t[9]||(t[9]=t=>e.$emit("update:compressQuality",t)),min:.5,max:o.compressBar,step:.1,precision:1,"value-on-clear":.5,class:"slider-input","controls-position":"right"},null,8,["model-value","max"]),t[20]||(t[20]=(0,s.Lk)("span",{class:"slider-unit"},"MB",-1))])])])):(0,s.Q3)("",!0)])]),"telegram"===o.uploadChannel?((0,s.uX)(),(0,s.CE)("div",Ae,[(0,s.Lk)("div",Me,[(0,s.Lk)("span",Re,(0,i.v_)(e.$t("uploadSettings.serverCompress")),1),(0,s.bF)(m,{content:e.$t("uploadSettings.serverCompressTooltip"),placement:"top","raw-content":""},{default:(0,s.k6)(()=>[(0,s.bF)(h,{icon:"question-circle",class:"section-help-icon"})]),_:1},8,["content"])]),(0,s.Lk)("div",De,[(0,s.Lk)("div",Ee,[(0,s.Lk)("span",Ie,(0,i.v_)(e.$t("uploadSettings.enableCompress")),1),(0,s.bF)(b,{"model-value":o.serverCompress,"onUpdate:modelValue":t[10]||(t[10]=t=>e.$emit("update:serverCompress",t))},null,8,["model-value"])])])])):(0,s.Q3)("",!0),(0,s.Lk)("div",Pe,[(0,s.bF)(C,{type:"primary",onClick:t[11]||(t[11]=e=>d.visible=!1),class:"confirm-btn"},{default:(0,s.k6)(()=>[(0,s.eW)((0,i.v_)(e.$t("uploadSettings.confirm")),1)]),_:1})])]),_:1},8,["title","modelValue","width"])}var ze={name:"UploadSettingsDialog",components:{ChannelIcon:Y.A},methods:{handleUploadFolderInput(e){e&&!e.startsWith("/")&&(e="/"+e),this.$emit("update:uploadFolder",e)}},props:{modelValue:{type:Boolean,default:!1},uploadChannel:{type:String,default:"telegram"},channelName:{type:String,default:""},currentChannelList:{type:Array,default:()=>[]},uploadFolder:{type:String,default:""},autoRetry:{type:Boolean,default:!0},uploadNameType:{type:String,default:"default"},convertToWebp:{type:Boolean,default:!1},customerCompress:{type:Boolean,default:!0},compressBar:{type:Number,default:5},compressQuality:{type:Number,default:4},serverCompress:{type:Boolean,default:!0}},emits:["update:modelValue","update:uploadChannel","update:channelName","update:uploadFolder","update:autoRetry","update:uploadNameType","update:convertToWebp","update:customerCompress","update:compressBar","update:compressQuality","update:serverCompress"],computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},dialogWidth(){return window.innerWidth>768?"50%":"90%"}}};const We=(0,V.A)(ze,[["render",Ne]]);var Ve=We,Be=o(88559),He=(o(85970),o(813)),Qe=(o(34896),o(69655)),Xe=(o(2893),o(74253));o(79899);const qe={class:"upload-list-item"},je=["href"],Oe={key:0,style:{width:"10vw","border-radius":"12px"},autoplay:"",muted:"",playsinline:"",loop:""},Ge=["src"],Ke=["src"],Je={key:2,style:{width:"10vw","border-radius":"12px"}},Ye={class:"upload-list-item-content"},Ze={class:"upload-list-item-name-wrapper"},et={key:0,class:"upload-list-item-url"},tt={class:"upload-list-item-url-row"},ot={class:"upload-list-item-url-row"},at={key:1,class:"upload-list-item-progress"},lt={class:"upload-list-item-action"};function st(e,t,o,a,l,n){const r=(0,s.g2)("font-awesome-icon"),d=Xe.$g,c=G.WK,u=Qe.ve,p=(0,s.g2)("Link"),h=He.tk,m=(0,s.g2)("Delete");return(0,s.uX)(),(0,s.CE)("div",qe,[(0,s.Lk)("a",{href:o.file.url,target:"_blank",class:"upload-list-item-preview"},[n.isVideo(o.file.name)?((0,s.uX)(),(0,s.CE)("video",Oe,[(0,s.Lk)("source",{src:o.file.url,type:"video/mp4"},null,8,Ge),t[7]||(t[7]=(0,s.eW)(" Your browser does not support the video tag. ",-1))])):n.isImage(o.file.name)?((0,s.uX)(),(0,s.CE)("img",{key:1,style:{width:"10vw","border-radius":"12px"},src:o.file.url,onError:t[0]||(t[0]=t=>e.$emit("preview-error",o.file))},null,40,Ke)):((0,s.uX)(),(0,s.CE)("div",Je,[(0,s.bF)(r,{icon:"file",class:"file-icon"})]))],8,je),(0,s.Lk)("div",Ye,[(0,s.Lk)("div",Ze,[(0,s.bF)(d,{class:"upload-list-item-name",truncated:""},{default:(0,s.k6)(()=>[(0,s.eW)((0,i.v_)(n.truncateFilename(o.file.name)),1)]),_:1})]),"done"===o.file.status?((0,s.uX)(),(0,s.CE)("div",et,[(0,s.Lk)("div",tt,[(0,s.bF)(c,{modelValue:o.file.finalURL,"onUpdate:modelValue":t[1]||(t[1]=e=>o.file.finalURL=e),readonly:"",onClick:n.selectAllText,size:n.urlSize},{prepend:(0,s.k6)(()=>[...t[8]||(t[8]=[(0,s.eW)("URL",-1)])]),_:1},8,["modelValue","onClick","size"]),(0,s.bF)(c,{modelValue:o.file.mdURL,"onUpdate:modelValue":t[2]||(t[2]=e=>o.file.mdURL=e),readonly:"",onClick:n.selectAllText,size:n.urlSize},{prepend:(0,s.k6)(()=>[...t[9]||(t[9]=[(0,s.eW)("MarkDown",-1)])]),_:1},8,["modelValue","onClick","size"])]),(0,s.Lk)("div",ot,[(0,s.bF)(c,{modelValue:o.file.htmlURL,"onUpdate:modelValue":t[3]||(t[3]=e=>o.file.htmlURL=e),readonly:"",onClick:n.selectAllText,size:n.urlSize},{prepend:(0,s.k6)(()=>[...t[10]||(t[10]=[(0,s.eW)("HTML",-1)])]),_:1},8,["modelValue","onClick","size"]),(0,s.bF)(c,{modelValue:o.file.ubbURL,"onUpdate:modelValue":t[4]||(t[4]=e=>o.file.ubbURL=e),readonly:"",onClick:n.selectAllText,size:n.urlSize},{prepend:(0,s.k6)(()=>[...t[11]||(t[11]=[(0,s.eW)("BBCode",-1)])]),_:1},8,["modelValue","onClick","size"])])])):((0,s.uX)(),(0,s.CE)("div",at,[(0,s.bF)(u,{percentage:o.file.progreess,status:o.file.status,"show-text":!1},null,8,["percentage","status"])]))]),(0,s.Lk)("div",lt,[(0,s.Lk)("button",{class:"modern-file-action-btn modern-file-action-btn-primary",onClick:t[5]||(t[5]=t=>e.$emit("copy",o.file))},[(0,s.bF)(h,null,{default:(0,s.k6)(()=>[(0,s.bF)(p)]),_:1})]),(0,s.Lk)("button",{class:"modern-file-action-btn modern-file-action-btn-danger",onClick:t[6]||(t[6]=t=>e.$emit("remove",o.file))},[(0,s.bF)(h,null,{default:(0,s.k6)(()=>[(0,s.bF)(m)]),_:1})])])])}var it=o(57477);const nt=["jpg","jpeg","png","gif","bmp","webp","svg","tiff","ico","avif","heic","jfif","pjpeg","pjp","raw","cr2","nef","dng","eps","ai","emf","wmf"],rt=["mp4","webm","ogg","mkv"];var dt={name:"UploadFileItem",components:{Link:it.Link,Delete:it.Delete},props:{file:{type:Object,required:!0}},emits:["copy","remove","preview-error"],computed:{urlSize(){return window.innerWidth<768?"small":"default"}},methods:{isImage(e){const t=e.split(".").pop().toLowerCase();return nt.includes(t)},isVideo(e){const t=e.split(".").pop().toLowerCase();return rt.includes(t)},truncateFilename(e,t=20){if(!e||e.length<=t)return e;const o=e.lastIndexOf(".");let a,l;o>0?(a=e.substring(0,o),l=e.substring(o)):(a=e,l="");const s=l.length+4,i=t-s-3;return i<=0?e.substring(0,t-3)+"...":a.substring(0,i)+"..."+a.slice(-4)+l},selectAllText(e){navigator.clipboard.writeText(e.target.value).then(()=>{this.$message({type:"success",message:this.$t("uploadForm.copySuccess")})}).catch(()=>{this.$message({type:"error",message:this.$t("uploadForm.copyFailed")})})}}};const ct=(0,V.A)(dt,[["render",st],["__scopeId","data-v-645a7810"]]);var ut=ct,pt=o(62086),ht=(o(40670),o(88830),o(23597),o(70683)),mt=(o(95385),o(47358)),ft=o(45130);const gt={class:"upload-form"},yt={class:"upload-card-glow",ref:"uploadCardGlow"},bt={class:"upload-prompt-row"},kt=["innerHTML"],vt=["aria-label"],Ct={key:0,class:"upload-card"},wt={class:"paste-card-actions"},Ft=["aria-label"],Lt=["aria-pressed"],Ut=["aria-pressed"],$t={class:"upload-list-container"},St={class:"upload-list-dashboard-action"},Tt={class:"modern-action-group"},_t={class:"modern-dropdown-item-content"},xt={class:"modern-action-btn modern-action-btn-danger"};function At(e,t,n,r,d,c){const u=He.tk,p=(0,s.g2)("font-awesome-icon"),h=a.R7,m=mt.j5,f=G.WK,g=l.S2,y=ht.Ik,b=(0,s.g2)("List"),k=(0,s.g2)("Checked"),v=(0,s.g2)("Failed"),C=Xe.$g,w=O.qi,F=pt.c6,L=pt.Iy,U=pt.dW,$=ut,S=Be.kA;return(0,s.uX)(),(0,s.CE)("div",gt,[(0,s.Lk)("div",{class:"upload-card-wrapper",onMousemove:t[2]||(t[2]=(...e)=>c.handleUploadCardMouseMove&&c.handleUploadCardMouseMove(...e)),onMouseleave:t[3]||(t[3]=(...e)=>c.handleUploadCardMouseLeave&&c.handleUploadCardMouseLeave(...e)),onDropCapture:t[4]||(t[4]=(0,ft.D$)((...e)=>c.handleDrop&&c.handleDrop(...e),["stop","prevent"]))},[(0,s.Lk)("div",yt,null,512),"default"===n.uploadMethod?((0,s.uX)(),(0,s.Wv)(m,{key:0,class:(0,i.C4)(["upload-card",{"is-uploading":d.uploading,"upload-card-busy":d.fileList.length}]),drag:"",multiple:"","http-request":c.uploadFile,onSuccess:c.handleSuccess,"on-error":c.handleError,"before-upload":c.beforeUpload,"on-progress":c.handleProgress,"file-list":d.fileList,"show-file-list":!1},{default:(0,s.k6)(()=>[(0,s.bF)(u,{class:(0,i.C4)(["el-icon--upload",{"upload-list-busy":d.fileList.length}])},{default:(0,s.k6)(()=>[...t[12]||(t[12]=[(0,s.Lk)("svg",{class:"upload-plus-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.25","stroke-linecap":"round","aria-hidden":"true"},[(0,s.Lk)("path",{d:"M12 7v10"}),(0,s.Lk)("path",{d:"M7 12h10"})],-1)])]),_:1},8,["class"]),(0,s.Lk)("div",bt,[(0,s.Lk)("div",{class:(0,i.C4)(["el-upload__text",{"upload-list-busy":d.fileList.length}]),innerHTML:e.$t("upload.dragUploadText")},null,10,kt),(0,s.bF)(h,{disabled:c.disableTooltip,content:e.$t("upload.selectFolderUpload"),placement:"top","show-after":1e3},{default:(0,s.k6)(()=>[(0,s.Lk)("button",{type:"button",class:(0,i.C4)(["folder-upload-icon-button",{"upload-list-busy":d.fileList.length}]),"aria-label":e.$t("upload.selectFolderUpload"),onClick:t[0]||(t[0]=(0,ft.D$)((...e)=>c.openFolderPicker&&c.openFolderPicker(...e),["stop","prevent"]))},[(0,s.bF)(p,{icon:"folder-open"})],10,vt)]),_:1},8,["disabled","content"])])]),_:1},8,["class","http-request","onSuccess","on-error","before-upload","on-progress","file-list"])):(0,s.Q3)("",!0),(0,s.Lk)("input",{ref:"folderInput",class:"folder-upload-input",type:"file",webkitdirectory:"",directory:"",multiple:"",onChange:t[1]||(t[1]=(...e)=>c.handleFolderSelection&&c.handleFolderSelection(...e))},null,544)],32),"paste"===n.uploadMethod?((0,s.uX)(),(0,s.CE)("div",Ct,[(0,s.bF)(y,{class:(0,i.C4)(["paste-card",{"is-uploading":d.uploading,"upload-card-busy":d.fileList.length}])},{default:(0,s.k6)(()=>[(0,s.bF)(f,{modelValue:d.pastedUrls,"onUpdate:modelValue":t[5]||(t[5]=e=>d.pastedUrls=e),class:"upload-card-textarea",placeholder:e.$t("upload.pasteUrlPlaceholder"),type:"textarea",rows:d.fileList.length?4:14},null,8,["modelValue","placeholder","rows"]),(0,s.Lk)("div",wt,[(0,s.bF)(g,{class:"paste-card-upload-button",type:"primary",size:c.pasteCardMethodButtonSize,onClick:c.handleUploadPasteUrls},{default:(0,s.k6)(()=>[(0,s.eW)((0,i.v_)(e.$t("upload.pasteUploadBtn")),1)]),_:1},8,["size","onClick"]),(0,s.Lk)("div",{class:(0,i.C4)(["paste-card-method-group",{"is-external":"external"===d.pasteUploadMethod}]),role:"group","aria-label":e.$t("upload.switchUploadMethod")},[(0,s.Lk)("button",{class:(0,i.C4)(["paste-card-method-button",{"is-active":"save"===d.pasteUploadMethod}]),type:"button","aria-pressed":"save"===d.pasteUploadMethod,onClick:t[6]||(t[6]=e=>d.pasteUploadMethod="save")},(0,i.v_)(e.$t("upload.pasteSave")),11,Lt),(0,s.Lk)("button",{class:(0,i.C4)(["paste-card-method-button",{"is-active":"external"===d.pasteUploadMethod}]),type:"button","aria-pressed":"external"===d.pasteUploadMethod,onClick:t[7]||(t[7]=e=>d.pasteUploadMethod="external")},(0,i.v_)(e.$t("upload.pasteExternal")),11,Ut)],10,Ft)])]),_:1},8,["class"])])):(0,s.Q3)("",!0),(0,s.bF)(y,{class:(0,i.C4)(["upload-list-card",{"upload-list-busy":d.fileList.length}])},{default:(0,s.k6)(()=>[(0,s.Lk)("div",$t,[(0,s.bF)(S,{onScroll:c.handleScroll,ref:"scrollContainer"},{default:(0,s.k6)(()=>[(0,s.Lk)("div",{class:(0,i.C4)(["upload-list-dashboard",{"list-scrolled":d.listScrolled}])},[(0,s.bF)(C,{class:"upload-list-dashboard-title"},{default:(0,s.k6)(()=>[(0,s.bF)(u,null,{default:(0,s.k6)(()=>[(0,s.bF)(b)]),_:1}),(0,s.eW)((0,i.v_)(c.uploadingCount+c.waitingCount)+" ",1),(0,s.bF)(u,null,{default:(0,s.k6)(()=>[(0,s.bF)(k)]),_:1}),(0,s.eW)((0,i.v_)(c.uploadSuccessCount)+" ",1),(0,s.bF)(u,null,{default:(0,s.k6)(()=>[(0,s.bF)(v)]),_:1}),(0,s.eW)((0,i.v_)(c.uploadErrorCount),1)]),_:1}),(0,s.Lk)("div",St,[(0,s.Lk)("div",Tt,[(0,s.bF)(h,{disabled:c.disableTooltip,content:e.$t("upload.copyAll"),placement:"top","show-after":1e3},{default:(0,s.k6)(()=>[(0,s.Lk)("button",{class:"modern-action-btn modern-action-btn-copy",onClick:t[8]||(t[8]=(...e)=>c.copyAll&&c.copyAll(...e))},[(0,s.bF)(p,{icon:"copy"})])]),_:1},8,["disabled","content"]),(0,s.bF)(h,{disabled:c.disableTooltip,content:e.$t("upload.retryFailed"),placement:"top","show-after":1e3},{default:(0,s.k6)(()=>[(0,s.bF)(U,null,{dropdown:(0,s.k6)(()=>[(0,s.bF)(L,{class:"modern-dropdown-menu"},{default:(0,s.k6)(()=>[(0,s.bF)(F,null,{default:(0,s.k6)(()=>[(0,s.Lk)("div",_t,[(0,s.Lk)("span",null,(0,i.v_)(e.$t("uploadForm.autoRetry")),1),(0,s.bF)(w,{modelValue:d.autoReUpload,"onUpdate:modelValue":t[10]||(t[10]=e=>d.autoReUpload=e),onChange:c.handleAutoRetryChange,size:"small"},null,8,["modelValue","onChange"])])]),_:1})]),_:1})]),default:(0,s.k6)(()=>[(0,s.Lk)("button",{class:"modern-action-btn modern-action-btn-retry",onClick:t[9]||(t[9]=(...e)=>c.retryError&&c.retryError(...e))},[(0,s.bF)(p,{icon:"redo"})])]),_:1})]),_:1},8,["disabled","content"]),(0,s.bF)(h,{disabled:c.disableTooltip,content:e.$t("upload.clearList"),placement:"top","show-after":1e3},{default:(0,s.k6)(()=>[(0,s.bF)(U,null,{dropdown:(0,s.k6)(()=>[(0,s.bF)(L,{class:"modern-dropdown-menu"},{default:(0,s.k6)(()=>[(0,s.bF)(F,{onClick:c.clearFileList},{default:(0,s.k6)(()=>[(0,s.eW)((0,i.v_)(e.$t("upload.clearAll")),1)]),_:1},8,["onClick"]),(0,s.bF)(F,{onClick:c.clearSuccessList},{default:(0,s.k6)(()=>[(0,s.eW)((0,i.v_)(e.$t("upload.clearUploaded")),1)]),_:1},8,["onClick"])]),_:1})]),default:(0,s.k6)(()=>[(0,s.Lk)("button",xt,[(0,s.bF)(p,{icon:"trash-alt"})])]),_:1})]),_:1},8,["disabled","content"])])])],2),((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(d.fileList.slice().reverse(),e=>((0,s.uX)(),(0,s.Wv)($,{key:e.uid,file:e,onCopy:c.handleCopy,onRemove:c.handleRemove,onPreviewError:t[11]||(t[11]=e=>e.url=o(96682))},null,8,["file","onCopy","onRemove"]))),128))]),_:1},8,["onScroll"])])]),_:1},8,["class"])])}o(20116),o(18237),o(79577),o(41549),o(49797),o(49631),o(35623),o(64979);var Mt=o(457),Rt=o(76334),Dt=o(60782);function Et(e,t,o){const a=o+e;return{finalURL:a,mdURL:`![${t}](${a})`,htmlURL:`<img src="${a}" alt="${t}" width=100% />`,ubbURL:`[img]${a}[/img]`}}function It(e,t){const o={url:e.finalURL,md:e.mdURL,html:e.htmlURL,ubb:e.ubbURL};return o[t]||e.finalURL}function Pt(e,t){e.forEach(e=>{if("external"===e.uploadChannel)return;const o=Et(e.srcID,e.name,t);Object.assign(e,o)})}const Nt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zt=(e,t)=>e>>>t|e<<32-t;function Wt(e,t){const o=new Uint32Array(64);for(let u=0;u<16;u++)o[u]=e[4*u]<<24|e[4*u+1]<<16|e[4*u+2]<<8|e[4*u+3];for(let u=16;u<64;u++){const e=zt(o[u-15],7)^zt(o[u-15],18)^o[u-15]>>>3,t=zt(o[u-2],17)^zt(o[u-2],19)^o[u-2]>>>10;o[u]=o[u-16]+e+o[u-7]+t>>>0}let[a,l,s,i,n,r,d,c]=t;for(let u=0;u<64;u++){const e=zt(n,6)^zt(n,11)^zt(n,25),t=n&r^~n&d,p=c+e+t+Nt[u]+o[u]>>>0,h=zt(a,2)^zt(a,13)^zt(a,22),m=a&l^a&s^l&s,f=h+m>>>0;c=d,d=r,r=n,n=i+p>>>0,i=s,s=l,l=a,a=p+f>>>0}t[0]=t[0]+a>>>0,t[1]=t[1]+l>>>0,t[2]=t[2]+s>>>0,t[3]=t[3]+i>>>0,t[4]=t[4]+n>>>0,t[5]=t[5]+r>>>0,t[6]=t[6]+d>>>0,t[7]=t[7]+c>>>0}function Vt(){let e=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),t=new Uint8Array(64),o=0,a=0;return{update(l){a+=l.length;let s=0;if(o>0){const a=64-o,i=Math.min(a,l.length);t.set(l.subarray(0,i),o),o+=i,s=i,64===o&&(Wt(t,e),o=0)}while(s+64<=l.length)Wt(l.subarray(s,s+64),e),s+=64;s<l.length&&(t.set(l.subarray(s),0),o=l.length-s)},digest(){const l=8*a;t[o++]=128,o>56&&(t.fill(0,o,64),Wt(t,e),o=0),t.fill(0,o,56);const s=new DataView(t.buffer);s.setUint32(56,Math.floor(l/4294967296),!1),s.setUint32(60,l>>>0,!1),Wt(t,e);let i="";for(let t=0;t<8;t++)i+=e[t].toString(16).padStart(8,"0");return i}}}async function Bt(e){const t=Vt(),o=4194304;let a=0;while(a<e.size){const l=e.slice(a,Math.min(a+o,e.size)),s=await l.arrayBuffer();t.update(new Uint8Array(s)),a+=o,a%20971520<o&&console.log(`SHA256 progress: ${Math.min(100,Math.round(a/e.size*100))}%`)}return t.digest()}function Ht(e=""){return String(e).replace(/\\/g,"/").split("/").filter(e=>e&&"."!==e).map(e=>".."===e?"_":e).join("/")}function Qt(e=""){const t=Ht(e),o=t.lastIndexOf("/");return-1===o?"":t.slice(0,o)}function Xt(e="",t=""){const o=/^[\\/]/.test(String(e).trim()),a=[Ht(e),Ht(t)].filter(Boolean).join("/");return a?o?`/${a}`:a:""}function qt(e=[]){return Array.from(e).map(e=>({file:e,relativePath:Ht(e.webkitRelativePath||e.relativePath||e.name)}))}function jt(e){return new Promise((t,o)=>e.file(t,o))}async function Ot(e){const t=e.createReader(),o=[];while(1){const e=await new Promise((e,o)=>t.readEntries(e,o));if(!e.length)break;o.push(...e)}return o}async function Gt(e,t,o){const a=Ht([t,e.name].filter(Boolean).join("/"));if(e.isFile){const t=await jt(e);return void o.push({file:t,relativePath:a})}if(e.isDirectory){const t=await Ot(e);for(const e of t)await Gt(e,a,o)}}async function Kt(e,t,o){const a=Ht([t,e.name].filter(Boolean).join("/"));if("file"!==e.kind){if("directory"===e.kind)for await(const l of e.values())await Kt(l,a,o)}else o.push({file:await e.getFile(),relativePath:a})}async function Jt(e=[]){const t=Array.from(e).filter(e=>"file"===e.kind),o=[],a=await Promise.all(t.map(async e=>{if("function"!==typeof e.getAsFileSystemHandle)return null;try{return await e.getAsFileSystemHandle()}catch{return null}}));for(let l=0;l<t.length;l++){const e=t[l],s=a[l];if(s){await Kt(s,"",o);continue}const i="function"===typeof e.webkitGetAsEntry?e.webkitGetAsEntry():null;if(i){await Gt(i,"",o);continue}const n=e.getAsFile?.();n&&o.push(...qt([n]))}return o}var Yt={name:"UploadForm",components:{UploadFileItem:ut},props:{selectedUrlForm:{type:String,default:"url",required:!1},customerCompress:{type:Boolean,default:!0,required:!1},compressQuality:{type:Number,default:4,required:!1},compressBar:{type:Number,default:5,required:!1},serverCompress:{type:Boolean,default:!0,required:!1},uploadChannel:{type:String,default:"telegram",required:!1},channelName:{type:String,default:"",required:!1},uploadNameType:{type:String,default:"default",required:!1},useCustomUrl:{type:String,default:"false",required:!1},customUrlPrefix:{type:String,default:"",required:!1},autoRetry:{type:Boolean,default:!0,required:!1},urlPrefix:{type:String,default:"",required:!1},uploadMethod:{type:String,default:"default",required:!1},uploadFolder:{type:String,default:"",required:!1},convertToWebp:{type:Boolean,default:!1,required:!1}},data(){return{fileList:[],uploading:!1,maxUploading:6,exceptionList:[],listScrolled:!1,fileListLength:0,localUidCounter:0,pastedUrls:"",pasteUploadMethod:"save",autoReUpload:!0,maxRetryCount:10,retryTimer:null,retryDelay:12e3,uploadQueue:[],activeUploads:0,maxConcurrentUploads:6,abortControllers:new Map}},watch:{fileList:{handler(){this.fileList.length>this.fileListLength&&this.$nextTick(()=>{setTimeout(()=>{this.$refs.scrollContainer&&this.$refs.scrollContainer.setScrollTop(0)},100)}),this.fileListLength=this.fileList.length},deep:!0},useCustomUrl:{handler(){Pt(this.fileList,this.rootUrl)},immediate:!0},customUrlPrefix:{handler(){"true"===this.useCustomUrl&&Pt(this.fileList,this.rootUrl)},immediate:!0},autoReUpload(e){this.$store.commit("setStoreAutoReUpload",e)}},computed:{...(0,Dt.L8)(["storeAutoReUpload"]),uploadSuccessCount(){return this.fileList.filter(e=>"done"===e.status||"success"===e.status).length},uploadErrorCount(){return this.fileList.filter(e=>"exception"===e.status).length},uploadingCount(){return this.fileList.filter(e=>"uploading"===e.status).length},waitingCount(){return this.uploadQueue.length},urlSize(){return window.innerWidth<768?"small":"default"},disableTooltip(){return window.innerWidth<768},rootUrl(){return"true"===this.useCustomUrl?this.customUrlPrefix:this.urlPrefix||`${window.location.protocol}//${window.location.host}/file/`},pasteCardMethodButtonSize(){return this.fileList.length||window.innerWidth<768?"small":"medium"}},mounted(){document.addEventListener("paste",this.handlePaste),this.autoReUpload=this.storeAutoReUpload},beforeUnmount(){document.removeEventListener("paste",this.handlePaste),this.uploadQueue=[],this.fileList=[],this.activeUploads=0},methods:{createLocalUid(){return this.localUidCounter+=1,`local-${Date.now()}-${this.localUidCounter}`},applyUploadPath(e,t=e.name){const o=String(t||e.name).replace(/\\/g,"/").replace(/^\/+/,"");return e.uploadRelativePath=o,e.uploadFolder=Xt(this.uploadFolder,Qt(o)),e},copyUploadPath(e,t){return t.uploadRelativePath=e.uploadRelativePath||e.name,t.uploadFolder=e.uploadFolder??this.uploadFolder,t},getFileUploadFolder(e){const t=this.fileList.find(t=>t.uid===e.file.uid);return t?.uploadFolder??e.file.uploadFolder??this.uploadFolder},createUploadRequest(e){return{file:e,onProgress:e=>this.handleProgress(e),onSuccess:(e,t)=>this.handleSuccess(e,t),onError:(e,t)=>this.handleError(e,t)}},async uploadLocalEntries(e){await Promise.allSettled(e.map(async({file:e,relativePath:t})=>{e.uid=this.createLocalUid(),this.applyUploadPath(e,t);const o=await this.beforeUpload(e);o instanceof File&&this.uploadFile(this.createUploadRequest(o))}))},openFolderPicker(){this.$refs.folderInput?.click()},async handleFolderSelection(e){const t=qt(e.target.files);e.target.value="",await this.uploadLocalEntries(t)},async handleDrop(e){const t=e.dataTransfer;if(!t)return;const o=t.items?.length?await Jt(t.items):qt(t.files);o.length&&await this.uploadLocalEntries(o)},truncateFilename(e,t=20){if(!e||e.length<=t)return e;const o=e.lastIndexOf(".");let a,l;o>0?(a=e.substring(0,o),l=e.substring(o)):(a=e,l="");const s=l.length+4,i=t-s-3;return i<=0?e.substring(0,t-3)+"...":a.substring(0,i)+"..."+a.slice(-4)+l},uploadFile(e){if(!this.fileList.find(t=>t.uid===e.file.uid))return;if(this.activeUploads>=this.maxConcurrentUploads){this.uploadQueue.push(e);const t=this.fileList.find(t=>t.uid===e.file.uid);return void(t&&(t.status="waiting"))}this.activeUploads++;const t=this.fileList.find(t=>t.uid===e.file.uid);t&&(t.status="uploading");const o=this.fileList.find(t=>t.uid===e.file.uid),a=o?.uploadChannel||this.uploadChannel;if("external"===a)return void this.uploadSingleFile(e);if("huggingface"===a){const t=20971520;return void(e.file.size>=t?this.uploadToHuggingFaceDirect(e):this.uploadSingleFile(e))}if("discord"===a){const t=9437184;return void(e.file.size>t?this.uploadFileInChunks(e):this.uploadSingleFile(e))}const l=20971520;e.file.size>l?this.uploadFileInChunks(e):this.uploadSingleFile(e)},processUploadQueue(){if(0===this.uploadQueue.length||this.activeUploads>=this.maxConcurrentUploads)return;const e=this.uploadQueue.shift();e&&this.fileList.find(t=>t.uid===e.file.uid)?this.uploadFile(e):this.processUploadQueue()},onUploadComplete(){this.activeUploads=Math.max(0,this.activeUploads-1),this.processUploadQueue(),0===this.activeUploads&&0===this.uploadQueue.length&&(this.uploading=!1)},async uploadSingleFile(e){const t=this.fileList.find(t=>t.uid===e.file.uid);if(!t)return;const o=t.serverCompress,a=t.uploadChannel||this.uploadChannel,l=this.autoRetry&&"external"!==a,s="external"===a?"default":this.uploadNameType,i=this.getFileUploadFolder(e),n=new AbortController;this.abortControllers.set(e.file.uid,n);const r=new FormData;if(r.append("file",e.file),"external"===a&&r.append("url",e.file.url),"huggingface"===a)try{console.log("Computing SHA256 for HuggingFace upload...");const t=await Bt(e.file);r.append("sha256",t),console.log("SHA256 computed:",t)}catch(d){console.error("Failed to compute SHA256:",d)}(0,Mt.A)({url:"/upload?serverCompress="+o+"&uploadChannel="+a+(this.channelName?"&channelName="+encodeURIComponent(this.channelName):"")+"&uploadNameType="+s+"&autoRetry="+l+"&uploadFolder="+encodeURIComponent(i),method:"post",data:r,withAuthCode:!0,signal:n.signal,onUploadProgress:t=>{const o=Math.round(t.loaded/t.total*100);e.onProgress({percent:o,file:e.file})}}).then(t=>{e.onSuccess(t,e.file)}).catch(t=>{"CanceledError"!==t.name&&"ERR_CANCELED"!==t.code?t.response&&401!==t.response.status?(this.exceptionList.push(e),e.onError(t,e.file)):t.response||(this.exceptionList.push(e),e.onError(t,e.file)):console.log("上传已取消:",e.file.name)}).finally(()=>{this.abortControllers.delete(e.file.uid),this.onUploadComplete()})},async uploadFileInChunks(e){const t=this.fileList.find(t=>t.uid===e.file.uid);if(!t)return;const o=t.uploadChannel||this.uploadChannel,a=new AbortController;this.abortControllers.set(e.file.uid,a);const l="discord"===o?9437184:16777216,s=e.file.size,i=e.file.type||"application/octet-stream",n=Math.ceil(s/l),r=t.serverCompress,d=this.autoRetry&&"external"!==o,c="external"===o?"default":this.uploadNameType,u=this.getFileUploadFolder(e);let p=null;if("huggingface"===o)try{console.log("Computing SHA256 for HuggingFace chunked upload..."),p=await Bt(e.file),console.log("SHA256 computed:",p)}catch(h){console.error("Failed to compute SHA256:",h)}try{const t=new FormData;t.append("originalFileName",e.file.name),t.append("originalFileType",i),t.append("totalChunks",n.toString());const m=await(0,Mt.A)({url:"/upload?serverCompress="+r+"&uploadChannel="+o+(this.channelName?"&channelName="+encodeURIComponent(this.channelName):"")+"&uploadNameType="+c+"&autoRetry="+d+"&uploadFolder="+encodeURIComponent(u)+"&initChunked=true",method:"post",data:t,withAuthCode:!0});if(!m.data.success)throw new Error(this.$t("uploadForm.chunkInitFailed")+": "+m.data.message);const f=m.data.uploadId;console.log("分块上传初始化成功,uploadId:",f);const g=this.fileList.find(t=>t.uid===e.file.uid);g&&(g.totalChunks=n,g.uploadId=f);const y=3,b=new Array(n).fill(0);let k=0,v=!1,C="",w=!1;const F=async t=>{if(v||w)return;const p=t*l,m=Math.min(p+l,s),g=e.file.slice(p,m),y=new FormData;y.append("file",g,`${e.file.name}.part${t.toString().padStart(3,"0")}`),y.append("chunkIndex",t.toString()),y.append("totalChunks",n.toString()),y.append("uploadId",f),y.append("originalFileName",e.file.name),y.append("originalFileType",i);let k=0;const F=3;while(k<F){if(v||w)return;try{return void await(0,Mt.A)({url:"/upload?serverCompress="+r+"&uploadChannel="+o+(this.channelName?"&channelName="+encodeURIComponent(this.channelName):"")+"&uploadNameType="+c+"&autoRetry="+d+"&uploadFolder="+encodeURIComponent(u)+"&chunked=true",method:"post",data:y,withAuthCode:!0,signal:a.signal,onUploadProgress:o=>{if(v||w)return;const a=Math.round(o.loaded/o.total*100);b[t]=a;const l=Math.round(b.reduce((e,t)=>e+t,0)/n);e.onProgress({percent:l,file:e.file})}})}catch(h){if("CanceledError"===h.name||"ERR_CANCELED"===h.code)return w=!0,void console.log("分块上传已取消:",e.file.name);if(k++,console.warn(`分块 ${t+1}/${n} 上传失败 (重试 ${k}/${F}):`,h),k>=F)throw v=!0,C=`分块 ${t+1}/${n} 上传失败: ${h.message}`,new Error(C);await new Promise(e=>setTimeout(e,2e3*k))}}},L=[];for(let e=0;e<y;e++)L.push((async()=>{while(k<n&&!v&&!w){const t=k++;try{await F(t)}catch(e){w||(v=!0,C=e.message);break}}})());if(await Promise.all(L),w)return void console.log("分块上传已取消,跳过合并步骤");if(v)throw new Error(C||this.$t("uploadForm.uploadError"));this.$message({type:"info",message:this.$t("uploadForm.chunkMerging"),duration:0});const U=new FormData;U.append("uploadId",f),U.append("totalChunks",n.toString()),U.append("originalFileName",e.file.name),U.append("originalFileType",i),p&&U.append("sha256",p);const $=await(0,Mt.A)({url:"/upload?serverCompress="+r+"&uploadChannel="+o+(this.channelName?"&channelName="+encodeURIComponent(this.channelName):"")+"&uploadNameType="+c+"&autoRetry="+d+"&uploadFolder="+encodeURIComponent(u)+"&chunked=true&merge=true",method:"post",data:U,withAuthCode:!0});this.$message.closeAll(),e.onSuccess($,e.file)}catch(h){if("CanceledError"===h.name||"ERR_CANCELED"===h.code)return void console.log("分块上传已取消:",e.file.name);console.error("分块上传失败:",h);const t=this.fileList.find(t=>t.uid===e.file.uid);t&&t.uploadId&&this.cleanupUploadResources(t.uploadId,t.totalChunks).then(()=>{console.log(`已清理分块上传失败的资源: ${t.uploadId}`)}).catch(e=>{console.warn("清理分块上传失败资源时出错:",e)}),h.response&&401!==h.response.status?(this.exceptionList.push(e),e.onError(h,e.file)):h.response||(this.exceptionList.push(e),e.onError(h,e.file))}finally{this.abortControllers.delete(e.file.uid),this.onUploadComplete()}},handleRemove(e){this.abortControllers.has(e.uid)&&(this.abortControllers.get(e.uid).abort(),this.abortControllers.delete(e.uid)),this.uploadQueue=this.uploadQueue.filter(t=>t.file.uid!==e.uid),this.fileList=this.fileList.filter(t=>t.uid!==e.uid),this.$message({type:"info",message:this.$t("uploadForm.deleted",{name:this.truncateFilename(e.name)})})},async cleanupUploadResources(e,t=0){try{await(0,Mt.A)({url:`/upload?cleanup=true&uploadId=${e}&totalChunks=${t}`,method:"get",withAuthCode:!0,timeout:5e3}),console.log(`清理上传资源成功: ${e}`)}catch(o){console.warn("清理上传资源失败:",o)}},handleSuccess(e,t){const o=this.fileList.find(e=>e.uid===t.uid);if(o)try{const a=o.uploadChannel||this.uploadChannel;if("external"!==a){const a=e.data[0].src.replace("/file/","");o.url=`${window.location.protocol}//${window.location.host}/file/`+a;const l=Et(a,t.name,this.rootUrl);Object.assign(o,l),o.srcID=a}o.progreess=100,o.status="success",this.saveToHistory(o),this.$message({type:"success",message:this.$t("uploadForm.uploadSuccess",{name:this.truncateFilename(t.name)})}),setTimeout(()=>{const e=this.fileList.find(e=>e.uid===t.uid);e&&(e.status="done")},1e3)}catch(a){this.$message.error(this.$t("uploadForm.uploadFailed",{name:this.truncateFilename(t.name)})),o.status="exception"}},saveToHistory(e){try{const t=JSON.parse(localStorage.getItem("uploadHistory")||"[]"),o={name:e.name,url:e.finalURL,time:Date.now(),type:e.name.split(".").pop().toLowerCase()};t.push(o),localStorage.setItem("uploadHistory",JSON.stringify(t))}catch(t){console.error("Failed to save history",t)}},handleError(e,t){const o=this.fileList.find(e=>e.uid===t.uid);o&&(this.$message.error(this.$t("uploadForm.uploadFailed",{name:this.truncateFilename(t.name)})),o.status="exception",this.autoReUpload&&this.scheduleAutoRetry())},handleCopy(e){const t=this.fileList.find(t=>t.uid===e.uid).status;"done"===t||"success"===t?(navigator.clipboard.writeText(It(e,this.selectedUrlForm)),this.$message({type:"success",message:this.$t("uploadForm.copySuccess")})):this.$message({type:"warning",message:this.$t("uploadForm.fileNotUploaded")})},beforeUpload(e){return new Promise(async(t,o)=>{let a=e;const l=this.convertToWebp&&e.type.includes("image")&&!e.type.includes("webp")&&!e.type.includes("gif")&&!e.type.includes("svg");if(l)try{const t=await this.convertImageToWebp(e);t&&(a=t,console.log(`WebP转换成功: ${e.name} -> ${t.name}, 大小: ${(e.size/1024).toFixed(1)}KB -> ${(t.size/1024).toFixed(1)}KB`))}catch(r){console.warn("WebP转换失败,使用原文件:",r)}const s=a.type.includes("image")&&this.customerCompress&&a.size/1024/1024>this.compressBar,i=a.size/1024/1024<=1024||"telegram"!==this.uploadChannel,n=(e,o)=>{const a=URL.createObjectURL(e);this.fileList.push({uid:e.uid,name:e.uploadRelativePath||e.name,url:a,finalURL:"",mdURL:"",htmlURL:"",ubbURL:"",srcID:"",status:"uploading",progreess:0,serverCompress:o,uploadFolder:e.uploadFolder??this.uploadFolder,retryCount:0}),t(e)};if(s)Rt.compressAccurately(a,1024*this.compressQuality).then(t=>{t.size/1024/1024>1024&&"telegram"===this.uploadChannel&&(this.$message.error(this.$t("uploadForm.compressedFileTooLarge",{name:a.name})),o(this.$t("uploadForm.fileSizeTooLarge"))),this.uploading=!0;const l=new File([t],a.name,{type:t.type});l.uid=e.uid,this.copyUploadPath(a,l);const s=this.serverCompress&&l.size/1024/1024<10&&"telegram"===this.uploadChannel;n(l,s)}).catch(e=>{this.$message.error(this.$t("uploadForm.compressFailedCannotUpload",{name:a.name})),o(e)});else if(i){this.uploading=!0;const e="telegram"===this.uploadChannel&&this.serverCompress&&(!a.type.includes("image")||a.size/1024/1024<10);n(a,e)}else this.$message.error(this.$t("uploadForm.fileTooLarge",{name:a.name})),o(this.$t("uploadForm.fileSizeTooLarge"))})},handleProgress(e){const t=this.fileList.find(t=>t.uid===e.file.uid);t&&(t.progreess=e.percent)},copyAll(){const e=this.fileList.filter(e=>"done"===e.status||"success"===e.status).map(e=>It(e,this.selectedUrlForm)).join("\n");navigator.clipboard.writeText(e),this.$message({type:"success",message:this.$t("uploadForm.copyAllSuccess")})},clearFileList(){this.fileList.length>0?(this.abortControllers.forEach((e,t)=>{e.abort()}),this.abortControllers.clear(),this.uploadQueue=[],this.fileList=[],this.$message({type:"success",message:this.$t("uploadForm.fileListCleared")})):this.$message({type:"info",message:this.$t("uploadForm.fileListEmpty")})},clearSuccessList(){this.uploadSuccessCount>0?(this.fileList=this.fileList.filter(e=>"done"!==e.status&&"success"!==e.status),this.$message({type:"success",message:this.$t("uploadForm.successFilesCleared")})):this.$message({type:"info",message:this.$t("uploadForm.successFilesEmpty")})},async handlePaste(e){if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName)return;const t=e.clipboardData;if(!t)return;const o=Array.from(t.items||[]),a=o.filter(e=>"file"===e.kind),l=o.filter(e=>"string"===e.kind);if(a.length>0){e.preventDefault();const t=await Jt(a);t.length&&await this.uploadLocalEntries(t)}else t.files?.length&&(e.preventDefault(),await this.uploadLocalEntries(qt(t.files)));l.length>0&&this.uploadFromUrl(l)},handleUploadPasteUrls(){const e=this.pastedUrls.split("\n"),t=e.map(e=>e.trim()).filter(e=>""!==e).filter(e=>/^(https?:\/\/[^\s$.?#].[^\s]*)$/.test(e));if("save"===this.pasteUploadMethod)this.uploadFromUrl(t.map(e=>({kind:"string",getAsString:t=>{t(e)}})));else if("external"===this.pasteUploadMethod)for(let o=0;o<t.length;o++){const e=t[o],a=e.split("/").pop(),l=`![${a}](${e})`,s=`<img src="${e}" alt="${a}" width=100% />`,i=`[img]${e}[/img]`,n=new File([],e.split("/").pop(),{type:"text/plain"});n.uid=Date.now()+o,n.url=e,this.fileList.push({uid:n.uid,name:n.name,url:e,finalURL:e,mdURL:l,htmlURL:s,ubbURL:i,srcID:e,status:"uploading",progreess:0,serverCompress:!1,uploadChannel:"external",retryCount:0}),this.uploadFile({file:n,onProgress:e=>this.handleProgress(e),onSuccess:(e,t)=>this.handleSuccess(e,t),onError:(e,t)=>this.handleError(e,t)})}},uploadFromUrl(e){for(let t=0;t<e.length;t++)"string"===e[t].kind&&e[t].getAsString(e=>{const o=/^(https?:\/\/[^\s$.?#].[^\s]*)$/;let a="";o.test(e)&&Mt.A.post("/api/fetchRes",{url:e},{responseType:"blob",withAuthCode:!0}).then(o=>{o.headers["content-type"];if(200!=o.status)throw new Error("URL地址请求失败");{const s=o.headers["content-disposition"];if(s){const e=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/,t=/filename\*\s*=\s*UTF-8''([^;\n]*)/;let o=e.exec(s);if(null!=o&&o[1]){a=o[1].replace(/['"]/g,"");try{a=decodeURIComponent(a)}catch(l){a=""}}""===a&&(o=t.exec(s),null!=o&&o[1]&&(a=decodeURIComponent(o[1])))}if(""===a){const t=new URL(e);a=t.pathname.split("/").pop()}if(""===a){const o=new URL(e);let l=o.pathname.split(".").pop();(!l||""===l||l.length>10)&&(l="bin"),a="PastedFile"+Date.now()+t+"."+l}const i=o.data,n=new File([i],a,{type:i.type});n.uid=Date.now()+t;const r=this.beforeUpload(n);r instanceof Promise&&r.then(e=>{e instanceof File&&this.uploadFile({file:e,onProgress:e=>this.handleProgress(e),onSuccess:(e,t)=>this.handleSuccess(e,t),onError:(e,t)=>this.handleError(e,t)})}).catch(e=>{console.log(e)})}}).catch(e=>{this.$message({type:"warning",message:this.$t("uploadForm.urlRequestFailed")})})})},handleScroll(e){this.listScrolled=e.scrollTop>0&&this.fileList.length>0},retryError(){this.exceptionList.length>0?(this.retryFailedFiles(this.exceptionList),this.exceptionList=[]):this.$message({type:"info",message:this.$t("uploadForm.noFailedFiles")})},handleAutoRetryChange(e){this.$message({type:e?"success":"info",message:e?this.$t("uploadForm.autoRetryOn"):this.$t("uploadForm.autoRetryOff")}),e&&this.exceptionList.length>0&&this.scheduleAutoRetry()},retryFailedFiles(e){e.forEach(e=>{const t=e.retryCount||0;t<this.maxRetryCount?(e.retryCount=t+1,this.uploadFile({file:e.file,onProgress:e=>this.handleProgress(e),onSuccess:(e,t)=>this.handleSuccess(e,t),onError:(e,t)=>this.handleError(e,t)})):this.$message({type:"warning",message:this.$t("uploadForm.maxRetryReached",{name:e.name,max:this.maxRetryCount})})})},scheduleAutoRetry(){this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{if(this.autoReUpload&&this.exceptionList.length>0){const e=[...this.exceptionList];this.exceptionList=[],this.retryFailedFiles(e)}},this.retryDelay)},async uploadToHuggingFaceDirect(e){const t=this.fileList.find(t=>t.uid===e.file.uid);if(!t)return;const o=new AbortController;this.abortControllers.set(e.file.uid,o);const a=this.getFileUploadFolder(e);try{console.log("=== HuggingFace Direct Upload ==="),console.log("File:",e.file.name,"Size:",e.file.size),e.onProgress({percent:5,file:e.file}),console.log("Computing SHA256...");const t=await Bt(e.file);if(console.log("SHA256:",t),o.signal.aborted)return void console.log("HuggingFace 上传已取消:",e.file.name);const l=new Uint8Array(await e.file.slice(0,512).arrayBuffer()),s=btoa(String.fromCharCode(...l));e.onProgress({percent:10,file:e.file}),console.log("Getting LFS upload URL...");const i=await(0,Mt.A)({url:"/upload/huggingface/getUploadUrl",method:"post",data:{fileSize:e.file.size,fileName:e.file.name,fileType:e.file.type,sha256:t,fileSample:s,channelName:this.channelName,uploadNameType:this.uploadNameType,uploadFolder:a},withAuthCode:!0,signal:o.signal});if(!i.data.success)throw new Error(i.data.error||"Failed to get upload URL");const n=i.data;if(console.log("Upload info:",n),n.alreadyExists)console.log("File already exists in LFS, skipping upload"),e.onProgress({percent:90,file:e.file});else if(n.needsLfs&&n.uploadAction){const{href:t,header:a}=n.uploadAction;if(a?.chunk_size)await this.uploadToHuggingFaceMultipart(e,n,o);else{console.log("Uploading to S3 (basic)...");const l=await fetch(t,{method:"PUT",headers:a||{},body:e.file,signal:o.signal});if(!l.ok){const e=await l.text();throw new Error(`S3 upload failed: ${l.status} - ${e}`)}console.log("S3 upload complete")}}if(o.signal.aborted)return void console.log("HuggingFace 上传已取消:",e.file.name);e.onProgress({percent:95,file:e.file}),console.log("Committing file...");const r=await(0,Mt.A)({url:"/upload/huggingface/commitUpload",method:"post",data:{fullId:n.fullId,filePath:n.filePath,sha256:t,fileSize:e.file.size,fileName:e.file.name,fileType:e.file.type,channelName:n.channelName},withAuthCode:!0,signal:o.signal});if(!r.data.success)throw new Error(r.data.error||"Failed to commit file");console.log("Upload complete:",r.data);const d={data:[{src:r.data.src}]};e.onSuccess(d,e.file)}catch(l){if("CanceledError"===l.name||"ERR_CANCELED"===l.code||"AbortError"===l.name)return void console.log("HuggingFace 上传已取消:",e.file.name);console.error("HuggingFace direct upload error:",l),this.exceptionList.push(e),e.onError(l,e.file)}finally{this.abortControllers.delete(e.file.uid),this.onUploadComplete()}},async uploadToHuggingFaceMultipart(e,t,o){const{uploadAction:a}=t,{href:l,header:s}=a,i=parseInt(s.chunk_size),n=Object.keys(s).filter(e=>/^[0-9]+$/.test(e));console.log(`Multipart upload: ${n.length} parts, chunk size: ${i}`);const r=[],d=n.length;for(const u of n){if(o&&o.signal.aborted)throw console.log("HuggingFace 分片上传已取消"),new DOMException("Upload cancelled","AbortError");const t=parseInt(u)-1,a=t*i,l=Math.min(a+i,e.file.size),n=e.file.slice(a,l);console.log(`Uploading part ${u}/${d}`);const c=await fetch(s[u],{method:"PUT",body:n,signal:o?o.signal:void 0});if(!c.ok)throw new Error(`Failed to upload part ${u}: ${c.status}`);const p=c.headers.get("ETag");if(!p)throw new Error(`No ETag for part ${u}`);r.push({partNumber:parseInt(u),etag:p});const h=10+Math.round(parseInt(u)/d*80);e.onProgress({percent:h,file:e.file})}if(o&&o.signal.aborted)throw console.log("HuggingFace 分片上传已取消"),new DOMException("Upload cancelled","AbortError");console.log("Completing multipart upload...");const c=await fetch(l,{method:"POST",headers:{Accept:"application/vnd.git-lfs+json","Content-Type":"application/vnd.git-lfs+json"},body:JSON.stringify({oid:t.oid,parts:r}),signal:o?o.signal:void 0});if(!c.ok){const e=await c.text();throw new Error(`Multipart complete failed: ${c.status} - ${e}`)}console.log("Multipart upload complete")},async convertImageToWebp(e){return new Promise((t,o)=>{if(e.type.includes("gif")||e.type.includes("svg")||e.type.includes("webp"))return void t(null);const a=new Image,l=document.createElement("canvas"),s=l.getContext("2d");a.onload=()=>{l.width=a.width,l.height=a.height,s.drawImage(a,0,0),l.toBlob(l=>{if(l){const o=e.name,a=o.lastIndexOf("."),s=a>0?o.substring(0,a)+".webp":o+".webp",i=new File([l],s,{type:"image/webp"});i.uid=e.uid,this.copyUploadPath(e,i),t(i)}else o(new Error("WebP 转换失败"));URL.revokeObjectURL(a.src)},"image/webp",.92)},a.onerror=()=>{URL.revokeObjectURL(a.src),o(new Error(this.$t("uploadForm.imageLoadFailed")))},a.src=URL.createObjectURL(e)})},handleUploadCardMouseMove(e){const t=this.$refs.uploadCardGlow;if(!t)return;const o=e.currentTarget.getBoundingClientRect(),a=e.clientX-o.left,l=e.clientY-o.top;t.style.opacity="1",t.style.left=a+"px",t.style.top=l+"px"},handleUploadCardMouseLeave(){const e=this.$refs.uploadCardGlow;e&&(e.style.opacity="0")}},beforeDestroy(){this.retryTimer&&clearTimeout(this.retryTimer)}};const Zt=(0,V.A)(Yt,[["render",At],["__scopeId","data-v-1090ec28"]]);var eo=Zt,to=o(732),oo=o(33892);const ao={class:"directory-suggestion-input",ref:"wrapperRef"},lo={class:"suggestion-dropdown"},so={class:"suggestion-list"},io=["title","onMousedown"];function no(e,t,o,a,l,n){const r=G.WK;return(0,s.uX)(),(0,s.CE)("div",ao,[(0,s.bF)(r,{ref:"inputRef",modelValue:n.inputValue,"onUpdate:modelValue":t[0]||(t[0]=e=>n.inputValue=e),placeholder:o.placeholder,onFocus:n.handleFocus,onBlur:n.handleBlur,onInput:n.handleInput},null,8,["modelValue","placeholder","onFocus","onBlur","onInput"]),(0,s.bo)((0,s.Lk)("div",lo,[(0,s.Lk)("ul",so,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(l.suggestions,(e,t)=>((0,s.uX)(),(0,s.CE)("li",{key:t,class:"suggestion-item",title:e.value,onMousedown:(0,ft.D$)(t=>n.selectItem(e),["prevent"])},(0,i.v_)(e.value),41,io))),128))])],512),[[ft.aG,l.dropdownVisible&&l.suggestions.length>0]])],512)}var ro={name:"DirectorySuggestionInput",props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""}},emits:["update:modelValue","focus","blur","select"],data(){return{directoryTreeRoot:null,directoryTreeLoaded:!1,directoryTreeLoading:!1,directoryChildrenMap:{},focusTime:null,dropdownVisible:!1,isFocused:!1,suggestions:[]}},computed:{inputValue:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}},watch:{modelValue(){this.isFocused&&this.refreshSuggestions()}},methods:{handleFocus(){this.isFocused=!0,this.focusTime=Date.now(),this.ensureDirectoryTreeLoaded(),this.$emit("focus"),setTimeout(()=>{this.isFocused&&(this.refreshSuggestions(),this.dropdownVisible=!0)},500)},handleBlur(){this.isFocused=!1,this.dropdownVisible=!1,this.$emit("blur")},handleInput(e){this.$nextTick(()=>{this.refreshSuggestions(),this.isFocused&&(this.dropdownVisible=!0)})},selectItem(e){const t=e.value;this.inputValue=t,this.$emit("select",t);const o=this.normalizeDirectoryPath(t),a=this.directoryChildrenMap[o];a&&a.length>0?this.$nextTick(()=>{this.refreshSuggestions(),this.dropdownVisible=!0,this.$refs.inputRef?.focus()}):this.dropdownVisible=!1},refreshSuggestions(){this.suggestions=this.getDirectorySuggestions(this.modelValue||"")},normalizeDirectoryPath(e){if(!e)return"/";let t=e;return t.startsWith("/")||(t="/"+t),"/"===t||t.endsWith("/")||(t+="/"),t},buildDirectoryChildrenMap(e){const t={},o=e=>{const a=this.normalizeDirectoryPath(e.path),l=Array.isArray(e.children)?e.children:[];t[a]=l.map(e=>({name:e.name,path:this.normalizeDirectoryPath(e.path)})),l.forEach(o)};o(e),this.directoryChildrenMap=t},async ensureDirectoryTreeLoaded(){if(!this.directoryTreeLoaded&&!this.directoryTreeLoading){this.directoryTreeLoading=!0;try{const e=await Mt.A.get("/api/directoryTree",{withAuthCode:!0}),t=e?.data?.tree;t&&(this.directoryTreeRoot=t,this.buildDirectoryChildrenMap(t),this.directoryTreeLoaded=!0)}catch(e){console.error("Failed to load directory tree for autocomplete:",e)}finally{this.directoryTreeLoading=!1}}},parseDirectoryQuery(e){const t=e&&e.startsWith("/")?e:`/${e||""}`,o=t.slice(1),a=o.split("/"),l=a[a.length-1]||"",s=a.slice(0,-1).filter(Boolean),i=s.length>0?`/${s.join("/")}/`:"/";return{segmentInput:l,parentPath:i}},getDirectorySuggestions(e){const{segmentInput:t,parentPath:o}=this.parseDirectoryQuery(e),a=this.directoryChildrenMap[o]||[];if(!t)return a.slice(0,10).map(e=>({value:e.path}));const l=t.toLowerCase();return a.filter(e=>e.name.toLowerCase().startsWith(l)).slice(0,10).map(e=>({value:e.path}))}}};const co=(0,V.A)(ro,[["render",no],["__scopeId","data-v-28b8eda7"]]);var uo=co,po=o(17879);const ho={class:"container"},mo={class:"upload-home"},fo={class:"quick-toolbar-actions"},go={class:"quick-toolbar-actions-inner"},yo={class:"header"},bo={class:"title"},ko={class:"title-crayon-text","aria-hidden":"true"},vo={class:"main-title",href:"https://github.com/MarSeventh/CloudFlare-ImgBed",target:"_blank"},Co={class:"dialog-section"},wo={class:"section-header"},Fo={class:"section-title"},Lo={class:"section-content"},Uo={class:"dialog-section"},$o={class:"section-header"},So={class:"section-title"},To={class:"section-content"},_o={class:"setting-item"},xo={class:"setting-label"},Ao={key:0,class:"setting-item"},Mo={class:"setting-label"},Ro={class:"dialog-action"},Do=["innerHTML"],Eo={class:"dialog-footer"};function Io(e,t,o,n,r,d){const c=po.A,u=(0,s.g2)("font-awesome-icon"),p=l.S2,h=pt.c6,m=pt.Iy,f=pt.dW,g=uo,y=G.WK,b=oo.A,k=a.R7,v=to.A,C=eo,w=J.ll,F=J.MQ,L=O.qi,U=X.kZ,$=Ve,S=Q.A,T=H;return(0,s.uX)(),(0,s.CE)("div",ho,[(0,s.Lk)("div",mo,[(0,s.bF)(c,{class:"toggle-dark-button desktop-only"}),(0,s.bF)(f,{class:"more-dropdown desktop-only",trigger:"click",onCommand:d.handleDesktopMenuCommand},{dropdown:(0,s.k6)(()=>[(0,s.bF)(m,null,{default:(0,s.k6)(()=>[(0,s.bF)(h,{command:"showHistory"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"history",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,s.eW)(" "+(0,i.v_)(e.$t("upload.history")),1)]),_:1}),(0,s.bF)(h,{command:"showAnnouncement",disabled:!d.announcementAvailable},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"bullhorn",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,s.eW)(" "+(0,i.v_)(e.$t("upload.announcement")),1)]),_:1},8,["disabled"]),(0,s.bF)(h,{command:"toggleLanguage"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"globe",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,s.eW)(" "+(0,i.v_)("zh-CN"===e.$i18n.locale?"English":"简体中文"),1)]),_:1}),(0,s.bF)(h,{command:"viewDocs"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"book",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,s.eW)(" "+(0,i.v_)(e.$t("upload.viewDocs")),1)]),_:1})]),_:1})]),default:(0,s.k6)(()=>[(0,s.bF)(p,{class:"more-button"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"ellipsis-v",size:"lg"})]),_:1})]),_:1},8,["onCommand"]),(0,s.Lk)("div",{class:(0,i.C4)(["upload-folder-container",{"no-announcement":!d.announcementAvailable}])},[(0,s.Lk)("div",{class:(0,i.C4)(["upload-folder",{active:r.isFolderInputActive}])},[d.showDirectorySuggestions?((0,s.uX)(),(0,s.Wv)(g,{key:0,modelValue:r.uploadFolder,"onUpdate:modelValue":t[0]||(t[0]=e=>r.uploadFolder=e),class:"inner-folder-input",placeholder:e.$t("upload.folderPlaceholder"),onFocus:d.handleFolderInputFocus,onBlur:d.handleFolderInputBlur,onSelect:d.handleDirectorySelect},null,8,["modelValue","placeholder","onFocus","onBlur","onSelect"])):((0,s.uX)(),(0,s.Wv)(y,{key:1,class:"inner-folder-input",modelValue:r.uploadFolder,"onUpdate:modelValue":t[1]||(t[1]=e=>r.uploadFolder=e),placeholder:e.$t("upload.folderPlaceholder"),onFocus:d.handleFolderInputFocus,onBlur:d.handleFolderInputBlur},null,8,["modelValue","placeholder","onFocus","onBlur"]))],2),d.showDirectorySuggestions?((0,s.uX)(),(0,s.Wv)(b,{key:0,"current-directory":r.uploadFolder,source:"upload",onSelect:d.handleDirectorySelect},{trigger:(0,s.k6)(()=>[(0,s.bF)(p,{class:"directory-tree-trigger"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"folder-tree"})]),_:1})]),_:1},8,["current-directory","onSelect"])):(0,s.Q3)("",!0)],2),(0,s.bF)(k,{content:e.$t("upload.switchUploadMethod"),placement:"bottom",disabled:d.disableTooltip,"show-after":1e3},{default:(0,s.k6)(()=>[(0,s.bF)(p,{class:"upload-method-button desktop-only",onClick:d.handleChangeUploadMethod},{default:(0,s.k6)(()=>["default"===r.uploadMethod?((0,s.uX)(),(0,s.Wv)(u,{key:0,icon:"folder-open",class:"upload-method-icon",size:"lg"})):"paste"===r.uploadMethod?((0,s.uX)(),(0,s.Wv)(u,{key:1,icon:"paste",class:"upload-method-icon",size:"lg"})):(0,s.Q3)("",!0)]),_:1},8,["onClick"])]),_:1},8,["content","disabled"]),(0,s.bF)(f,{class:"mobile-more-dropdown mobile-only",trigger:"click",onCommand:d.handleMobileMenuCommand},{dropdown:(0,s.k6)(()=>[(0,s.bF)(m,null,{default:(0,s.k6)(()=>[(0,s.bF)(h,{command:"toggleTheme"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:d.getThemeIcon(),style:{width:"16px","margin-right":"8px","text-align":"center"}},null,8,["icon"]),(0,s.eW)(" "+(0,i.v_)(d.getThemeText()),1)]),_:1}),(0,s.bF)(h,{command:"toggleUploadMethod"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"default"===r.uploadMethod?"paste":"folder-open",style:{width:"16px","margin-right":"8px","text-align":"center"}},null,8,["icon"]),(0,s.eW)(" "+(0,i.v_)("default"===r.uploadMethod?e.$t("upload.pasteUpload"):e.$t("upload.fileUpload")),1)]),_:1}),(0,s.bF)(h,{command:"showHistory"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"history",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,s.eW)(" "+(0,i.v_)(e.$t("upload.history")),1)]),_:1}),(0,s.bF)(h,{command:"showAnnouncement",disabled:!d.announcementAvailable},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"bullhorn",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,s.eW)(" "+(0,i.v_)(e.$t("upload.announcement")),1)]),_:1},8,["disabled"]),(0,s.bF)(h,{command:"toggleLanguage"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"globe",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,s.eW)(" "+(0,i.v_)("zh-CN"===e.$i18n.locale?"English":"简体中文"),1)]),_:1}),(0,s.bF)(h,{command:"viewDocs"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"book",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,s.eW)(" "+(0,i.v_)(e.$t("upload.viewDocs")),1)]),_:1})]),_:1})]),default:(0,s.k6)(()=>[(0,s.bF)(p,{class:"mobile-more-button"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"ellipsis-v",size:"lg"})]),_:1})]),_:1},8,["onCommand"]),(0,s.Lk)("div",{class:(0,i.C4)(["quick-toolbar",{"is-expanded":r.isQuickToolbarOpen}]),onMouseleave:t[5]||(t[5]=(...e)=>d.handleQuickToolbarLeave&&d.handleQuickToolbarLeave(...e))},[(0,s.Lk)("div",fo,[(0,s.Lk)("div",go,[(0,s.bF)(k,{disabled:d.disableTooltip||!r.isQuickToolbarOpen,content:e.$t("upload.logout"),placement:"left","hide-after":0,"show-after":1e3},{default:(0,s.k6)(()=>[(0,s.bF)(p,{class:"quick-toolbar-button",onClick:t[2]||(t[2]=e=>d.handleQuickToolbarCommand("logout"))},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"sign-out-alt",class:"quick-toolbar-icon"})]),_:1})]),_:1},8,["disabled","content"]),(0,s.bF)(k,{disabled:d.disableTooltip||!r.isQuickToolbarOpen,content:e.$t("upload.manage"),placement:"left","hide-after":0,"show-after":1e3},{default:(0,s.k6)(()=>[(0,s.bF)(p,{class:"quick-toolbar-button",onClick:t[3]||(t[3]=e=>d.handleQuickToolbarCommand("manage"))},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"cog",class:"quick-toolbar-icon"})]),_:1})]),_:1},8,["disabled","content"]),(0,s.bF)(k,{disabled:d.disableTooltip||!r.isQuickToolbarOpen,content:e.$t("upload.linkFormat"),placement:"left","hide-after":0,"show-after":1e3},{default:(0,s.k6)(()=>[(0,s.bF)(p,{class:"quick-toolbar-button",onClick:t[4]||(t[4]=e=>d.handleQuickToolbarCommand("linkFormat"))},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"link",class:"quick-toolbar-icon"})]),_:1})]),_:1},8,["disabled","content"])])]),(0,s.bF)(k,{disabled:d.disableTooltip,content:e.$t("upload.settings"),placement:"left","hide-after":0,"show-after":1e3},{default:(0,s.k6)(()=>[(0,s.bF)(p,{class:"quick-toolbar-button",onClick:d.openCompressDialog},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"cloud-upload",class:"quick-toolbar-icon"})]),_:1},8,["onClick"])]),_:1},8,["disabled","content"]),(0,s.bF)(p,{class:(0,i.C4)(["quick-toolbar-button quick-toolbar-more",{"is-active":r.isQuickToolbarOpen}]),"aria-expanded":r.isQuickToolbarOpen,onMouseenter:d.handleQuickToolbarMoreEnter,onClick:d.toggleQuickToolbar},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"chevron-down",class:"quick-toolbar-icon quick-toolbar-toggle-icon"})]),_:1},8,["class","aria-expanded","onMouseenter","onClick"])],34),(0,s.bF)(v,{useConfigLink:!0}),(0,s.Lk)("div",yo,[(0,s.Lk)("h1",bo,[(0,s.Lk)("span",ko,(0,i.v_)(d.ownerName)+" ImgHub",1),(0,s.Lk)("a",vo,(0,i.v_)(d.ownerName),1),t[24]||(t[24]=(0,s.eW)(" ImgHub ",-1))])]),(0,s.bF)(C,{selectedUrlForm:r.selectedUrlForm,customerCompress:r.customerCompress,compressQuality:r.compressQuality,compressBar:r.compressBar,serverCompress:r.serverCompress,uploadChannel:r.uploadChannel,channelName:r.channelName,uploadNameType:r.uploadNameType,useCustomUrl:r.useCustomUrl,customUrlPrefix:r.customUrlPrefix,autoRetry:r.autoRetry,urlPrefix:d.urlPrefix,uploadMethod:r.uploadMethod,uploadFolder:r.uploadFolder,convertToWebp:r.convertToWebp,class:"upload"},null,8,["selectedUrlForm","customerCompress","compressQuality","compressBar","serverCompress","uploadChannel","channelName","uploadNameType","useCustomUrl","customUrlPrefix","autoRetry","urlPrefix","uploadMethod","uploadFolder","convertToWebp"]),(0,s.bF)(U,{title:e.$t("settings.linkFormatTitle"),modelValue:r.showUrlDialog,"onUpdate:modelValue":t[10]||(t[10]=e=>r.showUrlDialog=e),width:d.dialogWidth,"show-close":!1,class:"settings-dialog settings-dialog-scope"},{default:(0,s.k6)(()=>[(0,s.Lk)("div",Co,[(0,s.Lk)("div",wo,[(0,s.Lk)("span",Fo,(0,i.v_)(e.$t("settings.defaultCopyLink")),1)]),(0,s.Lk)("div",Lo,[(0,s.bF)(F,{modelValue:r.selectedUrlForm,"onUpdate:modelValue":t[6]||(t[6]=e=>r.selectedUrlForm=e),onChange:d.changeUrlForm,class:"radio-card-group grid-2x2"},{default:(0,s.k6)(()=>[(0,s.bF)(w,{value:"url",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"link",class:"radio-icon"}),(0,s.Lk)("span",null,(0,i.v_)(e.$t("settings.rawLink")),1)]),_:1}),(0,s.bF)(w,{value:"md",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"code",class:"radio-icon"}),t[25]||(t[25]=(0,s.Lk)("span",null,"MarkDown",-1))]),_:1}),(0,s.bF)(w,{value:"html",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"code-branch",class:"radio-icon"}),t[26]||(t[26]=(0,s.Lk)("span",null,"HTML",-1))]),_:1}),(0,s.bF)(w,{value:"ubb",class:"radio-card"},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"quote-right",class:"radio-icon"}),t[27]||(t[27]=(0,s.Lk)("span",null,"BBCode",-1))]),_:1})]),_:1},8,["modelValue","onChange"])])]),(0,s.Lk)("div",Uo,[(0,s.Lk)("div",$o,[(0,s.Lk)("span",So,(0,i.v_)(e.$t("settings.customLink")),1),(0,s.bF)(k,{content:e.$t("settings.customLinkTooltip"),placement:"top","raw-content":""},{default:(0,s.k6)(()=>[(0,s.bF)(u,{icon:"question-circle",class:"section-help-icon"})]),_:1},8,["content"])]),(0,s.Lk)("div",To,[(0,s.Lk)("div",_o,[(0,s.Lk)("span",xo,(0,i.v_)(e.$t("settings.enableCustom")),1),(0,s.bF)(L,{modelValue:r.useCustomUrl,"onUpdate:modelValue":t[7]||(t[7]=e=>r.useCustomUrl=e),"active-value":"true","inactive-value":"false"},null,8,["modelValue"])]),"true"===r.useCustomUrl?((0,s.uX)(),(0,s.CE)("div",Ao,[(0,s.Lk)("span",Mo,(0,i.v_)(e.$t("settings.customPrefix")),1),(0,s.bF)(y,{modelValue:r.customUrlPrefix,"onUpdate:modelValue":t[8]||(t[8]=e=>r.customUrlPrefix=e),placeholder:e.$t("settings.customPrefixPlaceholder"),class:"setting-input"},null,8,["modelValue","placeholder"])])):(0,s.Q3)("",!0)])]),(0,s.Lk)("div",Ro,[(0,s.bF)(p,{type:"primary",onClick:t[9]||(t[9]=e=>r.showUrlDialog=!1),class:"confirm-btn"},{default:(0,s.k6)(()=>[(0,s.eW)((0,i.v_)(e.$t("settings.confirm")),1)]),_:1})])]),_:1},8,["title","modelValue","width"]),(0,s.bF)($,{modelValue:r.showCompressDialog,"onUpdate:modelValue":t[11]||(t[11]=e=>r.showCompressDialog=e),uploadChannel:r.uploadChannel,"onUpdate:uploadChannel":t[12]||(t[12]=e=>r.uploadChannel=e),channelName:r.channelName,"onUpdate:channelName":t[13]||(t[13]=e=>r.channelName=e),currentChannelList:d.currentChannelList,uploadFolder:r.uploadFolder,"onUpdate:uploadFolder":t[14]||(t[14]=e=>r.uploadFolder=e),autoRetry:r.autoRetry,"onUpdate:autoRetry":t[15]||(t[15]=e=>r.autoRetry=e),uploadNameType:r.uploadNameType,"onUpdate:uploadNameType":t[16]||(t[16]=e=>r.uploadNameType=e),convertToWebp:r.convertToWebp,"onUpdate:convertToWebp":t[17]||(t[17]=e=>r.convertToWebp=e),customerCompress:r.customerCompress,"onUpdate:customerCompress":t[18]||(t[18]=e=>r.customerCompress=e),compressBar:r.compressBar,"onUpdate:compressBar":t[19]||(t[19]=e=>r.compressBar=e),compressQuality:r.compressQuality,"onUpdate:compressQuality":t[20]||(t[20]=e=>r.compressQuality=e),serverCompress:r.serverCompress,"onUpdate:serverCompress":t[21]||(t[21]=e=>r.serverCompress=e)},null,8,["modelValue","uploadChannel","channelName","currentChannelList","uploadFolder","autoRetry","uploadNameType","convertToWebp","customerCompress","compressBar","compressQuality","serverCompress"])]),(0,s.bF)(S,{class:"footer"}),(0,s.bF)(U,{title:e.$t("upload.announcementTitle"),modelValue:r.showAnnouncementDialog,"onUpdate:modelValue":t[22]||(t[22]=e=>r.showAnnouncementDialog=e),width:d.dialogWidth,"show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1,center:""},{footer:(0,s.k6)(()=>[(0,s.Lk)("span",Eo,[(0,s.bF)(p,{type:"primary",onClick:d.acknowledgeAnnouncement},{default:(0,s.k6)(()=>[(0,s.eW)((0,i.v_)(e.$t("upload.announcementAck")),1)]),_:1},8,["onClick"])])]),default:(0,s.k6)(()=>[(0,s.Lk)("div",{innerHTML:r.announcementContent},null,8,Do)]),_:1},8,["title","modelValue","width"]),(0,s.bF)(T,{show:r.showHistory,onClose:t[23]||(t[23]=e=>r.showHistory=!1)},null,8,["show"])])}o(13579);var Po=o(46638),No=o(48903),zo=o(90144),Wo=o(62388),Vo={name:"UploadHome",mixins:[No.A],data(){return{selectedUrlForm:(0,zo.KR)(""),showUrlDialog:!1,showCompressDialog:!1,customerCompress:!0,compressQuality:4,compressBar:5,convertToWebp:!1,serverCompress:!0,uploadChannel:"",channelName:"",availableChannels:{},uploadNameType:"",customUrlPrefix:"",useCustomUrl:"false",autoRetry:!0,useDefaultWallPaper:!1,uploadMethod:"default",uploadFolder:"",isFolderInputActive:!1,isQuickToolbarOpen:!1,isQuickToolbarPinned:!1,showAnnouncementDialog:!1,announcementContent:"",displayedAnnouncementRefreshAt:null,showHistory:!1,themeMode:"auto"}},watch:{customerCompress(e){this.updateCompressConfig("customerCompress",e)},compressQuality(e){this.updateCompressConfig("compressQuality",e)},compressBar(e){null===e||void 0===e||e<1?this.compressBar=1:(this.compressQuality>e&&(this.compressQuality=e),this.updateCompressConfig("compressBar",e))},serverCompress(e){this.updateCompressConfig("serverCompress",e)},convertToWebp(e){this.updateCompressConfig("convertToWebp",e)},uploadChannel(e){this.updateStoreUploadChannel(e);const t=this.availableChannels[e]||[],o=this.storeChannelName;o&&t.some(e=>e.name===o)?this.channelName=o:this.channelName=""},channelName(e){this.$store.commit("setStoreChannelName",e||"")},uploadNameType(e){this.updateStoreUploadNameType(e)},customUrlPrefix(e){this.$store.commit("setCustomUrlSettings",{key:"customUrlPrefix",value:e})},useCustomUrl(e){this.$store.commit("setCustomUrlSettings",{key:"useCustomUrl",value:e})},autoRetry(e){this.$store.commit("setStoreAutoRetry",e)},uploadFolder(e){if(this.validateUploadFolder(e,!1)){const t=(0,Wo.G)(e,{strict:!0});t.valid&&this.$store.commit("setStoreUploadFolder",e)}else this.$nextTick(()=>{this.uploadFolder=this.storeUploadFolder})}},computed:{...(0,Dt.L8)(["userConfig","uploadCopyUrlForm","compressConfig","storeUploadChannel","storeChannelName","storeUploadNameType","customUrlSettings","storeAutoRetry","storeUploadMethod","storeUploadFolder"]),ownerName(){return this.userConfig?.ownerName||"Sanyue"},dialogWidth(){return window.innerWidth>768?"50%":"90%"},disableTooltip(){return window.innerWidth<768},urlPrefix(){return this.userConfig?.urlPrefix||`${window.location.protocol}//${window.location.host}/file/`},announcementAvailable(){return!!this.userConfig?.announcement},showDirectorySuggestions(){return this.userConfig?.showDirectorySuggestions??!1},currentChannelList(){return this.availableChannels[this.uploadChannel]||[]}},mounted(){this.initializeBackground("uploadBkImg",".container",!0,!0),this.selectedUrlForm=this.uploadCopyUrlForm||"url",this.customerCompress=this.compressConfig.customerCompress??this.parseBoolean(this.userConfig?.defaultCustomerCompress,!0),this.compressQuality=this.compressConfig.compressQuality??this.parseNumber(this.userConfig?.defaultCompressQuality,4),this.compressBar=this.compressConfig.compressBar??this.parseNumber(this.userConfig?.defaultCompressBar,5),this.serverCompress=this.compressConfig.serverCompress??!0,this.convertToWebp=this.compressConfig.convertToWebp??this.parseBoolean(this.userConfig?.defaultConvertToWebp,!1),this.uploadChannel=this.storeUploadChannel||this.userConfig?.defaultUploadChannel||"telegram",this.autoRetry=this.storeAutoRetry,this.uploadNameType=this.storeUploadNameType||this.userConfig?.defaultUploadNameType||"default",this.customUrlPrefix=this.customUrlSettings.customUrlPrefix,this.useCustomUrl=this.customUrlSettings.useCustomUrl,this.uploadMethod=this.storeUploadMethod,this.fetchAvailableChannels(),this.uploadFolder=this.storeUploadFolder||this.userConfig?.defaultUploadFolder||"";const e=this.$store.getters.cusDarkMode,t=this.$store.getters.useDarkMode;this.themeMode=e?t?"dark":"light":"auto",this.showAnnouncementIfNeeded()},components:{UploadForm:eo,Footer:Q.A,ToggleDark:po.A,Logo:to.A,UploadHistory:H,UploadSettingsDialog:Ve,DirectoryTreePicker:oo.A,DirectorySuggestionInput:uo},methods:{async fetchAvailableChannels(){try{const e=await Mt.A.get("/api/channels",{withAuthCode:!0});if(e.data){this.availableChannels=e.data;const t=this.storeChannelName,o=this.userConfig?.defaultChannelName,a=this.availableChannels[this.uploadChannel]||[];t&&a.some(e=>e.name===t)?this.channelName=t:""!==t&&null!==t&&void 0!==t||""!==t&&o&&a.some(e=>e.name===o)&&(this.channelName=o)}}catch(e){console.error("Failed to fetch available channels:",e)}},validateUploadFolder(e,t=!0){e&&!e.startsWith("/")&&(e="/"+e,this.uploadFolder=e);const o=(0,Wo.G)(e,{strict:t});return!!o.valid||(this.$message.error(o.error),!1)},handleFolderInputFocus(){this.isFolderInputActive=!0},handleFolderInputBlur(){this.isFolderInputActive=!1,this.uploadFolder&&!this.uploadFolder.startsWith("/")&&(this.uploadFolder="/"+this.uploadFolder),this.validateUploadFolder(this.uploadFolder,!0)||this.$nextTick(()=>{this.uploadFolder=this.storeUploadFolder})},handleManage(){this.$router.push("/dashboard")},parseBoolean(e,t){return void 0===e||null===e?t:"boolean"===typeof e?e:"string"===typeof e?"true"===e:t},parseNumber(e,t){if(void 0===e||null===e)return t;const o=parseFloat(e);return isNaN(o)?t:o},openUrlDialog(){this.showUrlDialog=!0},handleLogout(){Mt.A.post("/api/auth/logout",{authType:"user"},{withCredentials:!0}).finally(()=>{this.$store.commit("setUserLoggedIn",!1),this.$router.push("/login"),this.$message.success(this.$t("upload.logoutSuccess"))})},changeUrlForm(){this.$store.commit("setUploadCopyUrlForm",this.selectedUrlForm)},openCompressDialog(){this.showCompressDialog=!0},updateCompressConfig(e,t){this.$store.commit("setCompressConfig",{key:e,value:t})},updateStoreUploadChannel(e){this.$store.commit("setStoreUploadChannel",e)},updateStoreUploadNameType(e){this.$store.commit("setStoreUploadNameType",e)},handleQuickToolbarMoreEnter(){this.isQuickToolbarOpen=!0},handleQuickToolbarLeave(){this.isQuickToolbarPinned||(this.isQuickToolbarOpen=!1)},toggleQuickToolbar(){this.isQuickToolbarPinned=!this.isQuickToolbarPinned,this.isQuickToolbarOpen=this.isQuickToolbarPinned},closeQuickToolbar(){this.isQuickToolbarPinned=!1,this.isQuickToolbarOpen=!1},handleQuickToolbarCommand(e){this.closeQuickToolbar(),"linkFormat"===e?this.openUrlDialog():"manage"===e?this.handleManage():"logout"===e&&this.handleLogout()},handleChangeUploadMethod(){this.uploadMethod="default"===this.uploadMethod?"paste":"default",this.$store.commit("setUploadMethod",this.uploadMethod)},handleMobileMenuCommand(e){if("toggleTheme"===e)"auto"===this.themeMode?(this.themeMode="light",this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!1)):"light"===this.themeMode?(this.themeMode="dark",this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!0)):(this.themeMode="auto",this.$store.commit("setCusDarkMode",!1));else if("toggleUploadMethod"===e)this.handleChangeUploadMethod();else if("viewDocs"===e)window.open("https://cfbed.sanyue.de/qa/","_blank");else if("showHistory"===e)this.showHistory=!0;else if("showAnnouncement"===e)this.handleShowAnnouncement();else if("toggleLanguage"===e){const e="zh-CN"===this.$i18n.locale?"en":"zh-CN";(0,Po.xS)(e)}},handleDesktopMenuCommand(e){if("viewDocs"===e)window.open("https://cfbed.sanyue.de/qa/","_blank");else if("showHistory"===e)this.showHistory=!0;else if("showAnnouncement"===e)this.handleShowAnnouncement();else if("toggleLanguage"===e){const e="zh-CN"===this.$i18n.locale?"en":"zh-CN";(0,Po.xS)(e)}},getThemeIcon(){return"auto"===this.themeMode?"sun":"light"===this.themeMode?"moon":"adjust"},getThemeText(){return"auto"===this.themeMode?this.$t("theme.lightMode"):"light"===this.themeMode?this.$t("theme.darkMode"):this.$t("theme.autoMode")},handleShowAnnouncement(){const e=this.userConfig?.announcement;e?this.openAnnouncement(e):this.$message.info(this.$t("upload.noAnnouncement"))},getAnnouncementRefreshAt(){const e=Number(this.userConfig?.announcementRefreshAt);return Number.isFinite(e)&&e>0?e:null},openAnnouncement(e){this.announcementContent=e,this.displayedAnnouncementRefreshAt=this.getAnnouncementRefreshAt(),this.showAnnouncementDialog=!0},showAnnouncementIfNeeded(){const e=this.userConfig?.announcement;if(!e)return;const t=this.getAnnouncementRefreshAt();if(t){const o=Number(localStorage.getItem("announcementAcknowledgedRefreshAt"));return void((!Number.isFinite(o)||t>o)&&this.openAnnouncement(e))}localStorage.getItem("announcementAcknowledgedAt")||this.openAnnouncement(e)},acknowledgeAnnouncement(){localStorage.setItem("announcementAcknowledgedAt",String(Date.now())),this.displayedAnnouncementRefreshAt&&localStorage.setItem("announcementAcknowledgedRefreshAt",String(this.displayedAnnouncementRefreshAt)),this.showAnnouncementDialog=!1},handleDirectorySelect(e){this.uploadFolder=e,this.validateUploadFolder(e,!0)&&this.$store.commit("setStoreUploadFolder",e)}}};const Bo=(0,V.A)(Vo,[["render",Io],["__scopeId","data-v-5d2c3301"]]);var Ho=Bo},2893:function(e,t,o){"use strict";o(85331)},4885:function(e,t,o){"use strict";o(85331)},10456:function(e,t,o){"use strict";o(85331)},11393:function(e,t,o){o(79577),o(41549),o(49797),o(49631),o(35623),o(64979),function(t,o){e.exports=o()}(0,function(){return function(e){var t={};function o(a){if(t[a])return t[a].exports;var l=t[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)o.d(a,l,function(t){return e[t]}.bind(null,l));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";var a;function l(e){return["image/png","image/jpeg","image/gif"].some(t=>t===e)}o.r(t),o.d(t,"canvastoDataURL",function(){return i}),o.d(t,"canvastoFile",function(){return n}),o.d(t,"dataURLtoFile",function(){return d}),o.d(t,"dataURLtoImage",function(){return c}),o.d(t,"downloadFile",function(){return u}),o.d(t,"filetoDataURL",function(){return p}),o.d(t,"imagetoCanvas",function(){return m}),o.d(t,"urltoBlob",function(){return f}),o.d(t,"urltoImage",function(){return g}),o.d(t,"compress",function(){return b}),o.d(t,"compressAccurately",function(){return k}),o.d(t,"EImageType",function(){return a}),function(e){e.PNG="image/png",e.JPEG="image/jpeg",e.GIF="image/gif"}(a||(a={}));var s=function(e,t,o,a){return new(o||(o=Promise))(function(l,s){function i(e){try{r(a.next(e))}catch(e){s(e)}}function n(e){try{r(a.throw(e))}catch(e){s(e)}}function r(e){var t;e.done?l(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(i,n)}r((a=a.apply(e,t||[])).next())})};function i(e,t=.92,o=a.JPEG){return s(this,void 0,void 0,function*(){return l(o)||(o=a.JPEG),e.toDataURL(o,t)})}function n(e,t=.92,o=a.JPEG){return new Promise(a=>e.toBlob(e=>a(e),o,t))}var r=function(e,t,o,a){return new(o||(o=Promise))(function(l,s){function i(e){try{r(a.next(e))}catch(e){s(e)}}function n(e){try{r(a.throw(e))}catch(e){s(e)}}function r(e){var t;e.done?l(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(i,n)}r((a=a.apply(e,t||[])).next())})};function d(e,t){return r(this,void 0,void 0,function*(){const o=e.split(",");let a=o[0].match(/:(.*?);/)[1];const s=atob(o[1]);let i=s.length;const n=new Uint8Array(i);for(;i--;)n[i]=s.charCodeAt(i);return l(t)&&(a=t),new Blob([n],{type:a})})}function c(e){return new Promise((t,o)=>{const a=new Image;a.onload=()=>t(a),a.onerror=()=>o(new Error("dataURLtoImage(): dataURL is illegal")),a.src=e})}function u(e,t){const o=document.createElement("a");o.href=window.URL.createObjectURL(e),o.download=t||Date.now().toString(36),document.body.appendChild(o);const a=document.createEvent("MouseEvents");a.initEvent("click",!1,!1),o.dispatchEvent(a),document.body.removeChild(o)}function p(e){return new Promise(t=>{const o=new FileReader;o.onloadend=e=>t(e.target.result),o.readAsDataURL(e)})}var h=function(e,t,o,a){return new(o||(o=Promise))(function(l,s){function i(e){try{r(a.next(e))}catch(e){s(e)}}function n(e){try{r(a.throw(e))}catch(e){s(e)}}function r(e){var t;e.done?l(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(i,n)}r((a=a.apply(e,t||[])).next())})};function m(e,t={}){return h(this,void 0,void 0,function*(){const o=Object.assign({},t),a=document.createElement("canvas"),l=a.getContext("2d");let s,i;for(const e in o)Object.prototype.hasOwnProperty.call(o,e)&&(o[e]=Number(o[e]));if(o.scale){const t=o.scale>0&&o.scale<10?o.scale:1;i=e.width*t,s=e.height*t}else i=o.width||o.height*e.width/e.height||e.width,s=o.height||o.width*e.height/e.width||e.height;switch([5,6,7,8].some(e=>e===o.orientation)?(a.height=i,a.width=s):(a.height=s,a.width=i),o.orientation){case 3:l.rotate(180*Math.PI/180),l.drawImage(e,-a.width,-a.height,a.width,a.height);break;case 6:l.rotate(90*Math.PI/180),l.drawImage(e,0,-a.width,a.height,a.width);break;case 8:l.rotate(270*Math.PI/180),l.drawImage(e,-a.height,0,a.height,a.width);break;case 2:l.translate(a.width,0),l.scale(-1,1),l.drawImage(e,0,0,a.width,a.height);break;case 4:l.translate(a.width,0),l.scale(-1,1),l.rotate(180*Math.PI/180),l.drawImage(e,-a.width,-a.height,a.width,a.height);break;case 5:l.translate(a.width,0),l.scale(-1,1),l.rotate(90*Math.PI/180),l.drawImage(e,0,-a.width,a.height,a.width);break;case 7:l.translate(a.width,0),l.scale(-1,1),l.rotate(270*Math.PI/180),l.drawImage(e,-a.height,0,a.height,a.width);break;default:l.drawImage(e,0,0,a.width,a.height)}return a})}function f(e){return fetch(e).then(e=>e.blob())}function g(e){return new Promise((t,o)=>{const a=new Image;a.onload=()=>t(a),a.onerror=()=>o(new Error("urltoImage(): Image failed to load, please check the image URL")),a.src=e})}var y=function(e,t,o,a){return new(o||(o=Promise))(function(l,s){function i(e){try{r(a.next(e))}catch(e){s(e)}}function n(e){try{r(a.throw(e))}catch(e){s(e)}}function r(e){var t;e.done?l(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(i,n)}r((a=a.apply(e,t||[])).next())})};function b(e,t={}){return y(this,void 0,void 0,function*(){if(!(e instanceof Blob))throw new Error("compress(): First arg must be a Blob object or a File object.");if("object"!=typeof t&&(t=Object.assign({quality:t})),t.quality=Number(t.quality),Number.isNaN(t.quality))return e;const o=yield p(e);let s=o.split(",")[0].match(/:(.*?);/)[1],n=a.JPEG;l(t.type)&&(n=t.type,s=t.type);const r=yield c(o),u=yield m(r,Object.assign({},t)),h=yield i(u,t.quality,n),f=yield d(h,s);return f.size>e.size?e:f})}function k(e,t={}){return y(this,void 0,void 0,function*(){if(!(e instanceof Blob))throw new Error("compressAccurately(): First arg must be a Blob object or a File object.");if("object"!=typeof t&&(t=Object.assign({size:t})),t.size=Number(t.size),Number.isNaN(t.size))return e;if(1024*t.size>e.size)return e;t.accuracy=Number(t.accuracy),(!t.accuracy||t.accuracy<.8||t.accuracy>.99)&&(t.accuracy=.95);const o=t.size*(2-t.accuracy)*1024,s=1024*t.size,n=t.size*t.accuracy*1024,r=yield p(e);let u=r.split(",")[0].match(/:(.*?);/)[1],h=a.JPEG;l(t.type)&&(h=t.type,u=t.type);const f=yield c(r),g=yield m(f,Object.assign({},t));let y,b=.5;const k=[null,null];for(let e=1;e<=7;e++){y=yield i(g,b,h);const t=.75*y.length;if(7===e){(o<t||n>t)&&(y=[y,...k].filter(e=>e).sort((e,t)=>Math.abs(.75*e.length-s)-Math.abs(.75*t.length-s))[0]);break}if(o<t)k[1]=y,b-=Math.pow(.5,e+1);else{if(!(n>t))break;k[0]=y,b+=Math.pow(.5,e+1)}}const v=yield d(y,u);return v.size>e.size?e:v})}}])})},13378:function(e,t,o){"use strict";o(85331),o(38736),o(79899)},15616:function(e,t,o){"use strict";o(85331),o(97197)},17879:function(e,t,o){"use strict";o.d(t,{A:function(){return m}});var a=o(56768),l=o(45130),s=o(24232);const i={id:"themeMask"},n=["cx","cy","r"],r=["r"],d=["opacity"];function c(e,t,o,c,u,p){const h=(0,a.g2)("font-awesome-icon");return(0,a.uX)(),(0,a.CE)("div",{id:"themeToggle",onClick:t[0]||(t[0]=(...e)=>p.handleToggleClick&&p.handleToggleClick(...e))},[(0,a.bF)(l.eB,{name:"icon-fade",mode:"out-in"},{default:(0,a.k6)(()=>[u.isAuto?((0,a.uX)(),(0,a.Wv)(h,{key:"auto-mode",icon:"circle-half-stroke",class:"auto-icon",style:{"font-size":"1.5em",color:"var(--theme-toggle-color)"}})):((0,a.uX)(),(0,a.CE)("svg",{key:"sun-moon",class:(0,s.C4)(["theme_toggle_svg",{dark:u.isDark}]),width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",stroke:"currentColor"},[(0,a.Lk)("mask",i,[t[1]||(t[1]=(0,a.Lk)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"},null,-1)),(0,a.Lk)("circle",{class:"theme_toggle_circle1",fill:"black",cx:u.isDark?"50%":"100%",cy:u.isDark?"23%":"0%",r:u.isDark?"9":"5"},null,8,n)]),(0,a.Lk)("circle",{class:"theme_toggle_circle2",cx:"12",cy:"12",r:u.isDark?"9":"5",mask:"url(#themeMask)"},null,8,r),(0,a.Lk)("g",{class:"theme_toggle_g",stroke:"currentColor",opacity:u.isDark?0:1},[...t[2]||(t[2]=[(0,a.Lk)("line",{x1:"12",y1:"1",x2:"12",y2:"3"},null,-1),(0,a.Lk)("line",{x1:"12",y1:"21",x2:"12",y2:"23"},null,-1),(0,a.Lk)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"},null,-1),(0,a.Lk)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"},null,-1),(0,a.Lk)("line",{x1:"1",y1:"12",x2:"3",y2:"12"},null,-1),(0,a.Lk)("line",{x1:"21",y1:"12",x2:"23",y2:"12"},null,-1),(0,a.Lk)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"},null,-1),(0,a.Lk)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"},null,-1)])],8,d)],2))]),_:1})])}var u={name:"ToggleDark",data(){return{isDark:this.$store.getters.useDarkMode,isAuto:!this.$store.getters.cusDarkMode}},methods:{handleToggleClick(){this.isAuto?(this.isDark=!1,this.isAuto=!1,this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!1)):this.isDark?(this.isAuto=!0,this.$store.commit("setCusDarkMode",!1)):(this.isDark=!0,this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!0))}}},p=o(71241);const h=(0,p.A)(u,[["render",c],["__scopeId","data-v-2122c62a"]]);var m=h},18785:function(e,t,o){"use strict";o(85331)},19104:function(e,t,o){"use strict";o(85331)},23597:function(e,t,o){"use strict";o(85331)},30694:function(e,t,o){"use strict";o(85331)},33153:function(e,t,o){"use strict";e.exports=o.p+"img/logo.e8dbfa27.png"},33892:function(e,t,o){"use strict";o.d(t,{A:function(){return $}});var a=o(99114),l=(o(85331),o(30694),o(49385)),s=(o(37952),o(30650)),i=(o(19104),o(31802)),n=(o(13378),o(80047)),r=(o(99648),o(56768)),d=o(45130),c=o(24232);const u={class:"directory-tree-picker"},p={class:"tree-container"},h={key:0,class:"error-state"},m={class:"error-text"},f={class:"node-label"},g={class:"tree-container"},y={key:0,class:"error-state"},b={class:"error-text"},k={class:"node-label"};function v(e,t,o,v,C,w){const F=(0,r.g2)("font-awesome-icon"),L=n.S2,U=i.qk,$=s.Vc,S=l.pw,T=a.A;return(0,r.uX)(),(0,r.CE)("div",u,[w.isDesktop?((0,r.uX)(),(0,r.Wv)($,{key:0,visible:C.popoverVisible,"onUpdate:visible":t[1]||(t[1]=e=>C.popoverVisible=e),placement:"bottom-start",width:320,trigger:"click","popper-class":"directory-tree-popover","show-arrow":!0,"hide-after":0,"show-after":50,transition:"el-zoom-in-top"},{reference:(0,r.k6)(()=>[(0,r.Lk)("span",{class:"popover-trigger-wrapper",onClick:t[0]||(t[0]=(0,d.D$)(()=>{},["stop"]))},[(0,r.RG)(e.$slots,"trigger",{},void 0,!0)])]),default:(0,r.k6)(()=>[(0,r.bo)(((0,r.uX)(),(0,r.CE)("div",p,[C.error?((0,r.uX)(),(0,r.CE)("div",h,[(0,r.bF)(F,{icon:"exclamation-circle",class:"error-icon"}),(0,r.Lk)("span",m,(0,c.v_)(C.error),1),(0,r.bF)(L,{type:"primary",size:"small",onClick:w.fetchDirectoryTree},{default:(0,r.k6)(()=>[(0,r.eW)((0,c.v_)(e.$t("directoryTree.retry")),1)]),_:1},8,["onClick"])])):((0,r.uX)(),(0,r.Wv)(U,{key:1,ref:"treeRef",data:C.treeData,props:C.treeProps,"node-key":"path","default-expand-all":!1,"expand-on-click-node":!1,"highlight-current":!0,"current-node-key":o.currentDirectory,class:"directory-tree",onNodeClick:w.handleNodeClick},{default:(0,r.k6)(({node:e,data:t})=>[(0,r.Lk)("span",{class:(0,c.C4)(["tree-node",{"is-current":t.path===o.currentDirectory}])},[(0,r.bF)(F,{icon:e.expanded?"folder-open":"folder",class:"folder-icon"},null,8,["icon"]),(0,r.Lk)("span",f,(0,c.v_)(t.name),1)],2)]),_:1},8,["data","props","current-node-key","onNodeClick"]))])),[[T,C.loading]])]),_:3},8,["visible"])):((0,r.uX)(),(0,r.CE)(r.FK,{key:1},[(0,r.Lk)("span",{class:"drawer-trigger-wrapper",onClick:t[2]||(t[2]=(...e)=>w.openDrawer&&w.openDrawer(...e))},[(0,r.RG)(e.$slots,"trigger",{},void 0,!0)]),(0,r.bF)(S,{modelValue:C.drawerVisible,"onUpdate:modelValue":t[3]||(t[3]=e=>C.drawerVisible=e),direction:"btt",size:"60%","show-close":!0,"with-header":!0,"z-index":3e3,title:e.$t("directoryTree.selectDirectory"),class:"directory-tree-drawer"},{default:(0,r.k6)(()=>[(0,r.bo)(((0,r.uX)(),(0,r.CE)("div",g,[C.error?((0,r.uX)(),(0,r.CE)("div",y,[(0,r.bF)(F,{icon:"exclamation-circle",class:"error-icon"}),(0,r.Lk)("span",b,(0,c.v_)(C.error),1),(0,r.bF)(L,{type:"primary",size:"small",onClick:w.fetchDirectoryTree},{default:(0,r.k6)(()=>[(0,r.eW)((0,c.v_)(e.$t("directoryTree.retry")),1)]),_:1},8,["onClick"])])):((0,r.uX)(),(0,r.Wv)(U,{key:1,ref:"treeRefMobile",data:C.treeData,props:C.treeProps,"node-key":"path","default-expand-all":!1,"expand-on-click-node":!1,"highlight-current":!0,"current-node-key":o.currentDirectory,class:"directory-tree mobile-tree",onNodeClick:w.handleNodeClick},{default:(0,r.k6)(({node:e,data:t})=>[(0,r.Lk)("span",{class:(0,c.C4)(["tree-node",{"is-current":t.path===o.currentDirectory}])},[(0,r.bF)(F,{icon:e.expanded?"folder-open":"folder",class:"folder-icon"},null,8,["icon"]),(0,r.Lk)("span",k,(0,c.v_)(t.name),1)],2)]),_:1},8,["data","props","current-node-key","onNodeClick"]))])),[[T,C.loading]])]),_:1},8,["modelValue","title"])],64))])}var C=o(457),w=o(70797),F={name:"DirectoryTreePicker",props:{currentDirectory:{type:String,default:""},source:{type:String,default:"upload",validator:e=>["upload","admin"].includes(e)}},data(){return{popoverVisible:!1,drawerVisible:!1,treeData:[],loading:!1,error:"",treeProps:{children:"children",label:"name"},windowWidth:window.innerWidth}},computed:{isDesktop(){return this.windowWidth>=769}},watch:{popoverVisible(e){e?this.fetchDirectoryTree():setTimeout(()=>{if(!this.popoverVisible&&this.$refs.treeRef){const e=this.$refs.treeRef.store;for(const t in e.nodesMap)e.nodesMap[t].expanded=!1}},200)},drawerVisible(e){e?this.fetchDirectoryTree():setTimeout(()=>{if(!this.drawerVisible&&this.$refs.treeRefMobile){const e=this.$refs.treeRefMobile.store;for(const t in e.nodesMap)e.nodesMap[t].expanded=!1}},300)},currentDirectory(e){this.$nextTick(()=>{this.$refs.treeRef&&e&&this.$refs.treeRef.setCurrentKey(e),this.$refs.treeRefMobile&&e&&this.$refs.treeRefMobile.setCurrentKey(e)})}},mounted(){window.addEventListener("resize",this.handleResize)},beforeUnmount(){window.removeEventListener("resize",this.handleResize)},methods:{handleResize(){this.windowWidth=window.innerWidth},openDrawer(){this.drawerVisible=!0},async fetchDirectoryTree(){this.loading=!0,this.error="";try{let e;if("admin"===this.source){const t=await(0,w.A)("/api/directoryTree",{method:"GET"});if(!t.ok)return void(401===t.status?this.error=this.$t("directoryTree.authFailed"):this.error=this.$t("directoryTree.serverError"));e=await t.json()}else{const t=await C.A.get("/api/directoryTree",{withAuthCode:!0});e=t.data}e.tree?this.treeData=[e.tree]:this.treeData=[]}catch(e){console.error("Failed to fetch directory tree:",e),401===e.response?.status?this.error=this.$t("directoryTree.authFailed"):this.error=this.$t("directoryTree.loadFailed")}finally{this.loading=!1}},handleNodeClick(e){let t=e.path;t&&!t.startsWith("/")?t="/"+t:t||(t="/"),this.$emit("select",t),this.popoverVisible=!1,this.drawerVisible=!1}}},L=o(71241);const U=(0,L.A)(F,[["render",v],["__scopeId","data-v-62eab69a"]]);var $=U},34396:function(e,t,o){"use strict";o(85331),o(4885)},34896:function(e,t,o){"use strict";o(85331)},37952:function(e,t,o){"use strict";o(85331),o(97197)},38736:function(e,t,o){"use strict";o(85331)},40670:function(e,t,o){"use strict";o(85331),o(99648),o(19104),o(85970)},50333:function(e,t,o){"use strict";o(85331),o(29092)},62388:function(e,t,o){"use strict";o.d(t,{G:function(){return l}});var a=o(46638);function l(e,{strict:t=!0}={}){if(!e||""===e.trim())return{valid:!0};if("/"===e)return{valid:!0};if(!e.startsWith("/"))return{valid:!1,error:a.Ay.global.t("validation.pathMustStartWithSlash")};if(/(?:^|\/)\.\.(\/|$)/.test(e)||e.includes(".."))return{valid:!1,error:a.Ay.global.t("validation.pathTraversalNotAllowed")};const o=t?/\/\.(\/|$)/:/\/\.\//;if(o.test(e))return{valid:!1,error:a.Ay.global.t("validation.singleDotNotAllowed")};if(e.includes("//"))return{valid:!1,error:a.Ay.global.t("validation.consecutiveSlashNotAllowed")};const l=/[\\:\*\?"'<>\| \(\)\[\]\{\}#%\^`~;@&=\+\$,]/;return l.test(e)?{valid:!1,error:a.Ay.global.t("validation.invalidCharacters")}:{valid:!0}}},67819:function(e,t,o){"use strict";o(85331)},70797:function(e,t,o){"use strict";o.d(t,{A:function(){return i}});o(44114);var a=o(25507),l=o(16915);let s=!1;async function i(e,t={}){t.credentials="include",t.headers={...t.headers};const o=await fetch(e,t);return 401!==o.status||s||(s=!0,a.A.commit("setAdminLoggedIn",!1),l.A.push("/adminLogin").finally(()=>{s=!1})),o}},76334:function(e,t,o){e.exports=o(11393)},79899:function(e,t,o){"use strict";o(85331)},85970:function(e,t,o){"use strict";o(85331)},86975:function(e,t,o){"use strict";o.d(t,{A:function(){return p}});var a=o(56768),l=o(24232);const s={key:0,class:"page-footer"},i=["href"];function n(e,t,o,n,r,d){const c=(0,a.g2)("font-awesome-icon");return d.disableFooter?(0,a.Q3)("",!0):((0,a.uX)(),(0,a.CE)("div",s,[(0,a.Lk)("p",null,[(0,a.eW)("© 2024-"+(0,l.v_)(d.thisYear)+" Designed by ",1),t[0]||(t[0]=(0,a.Lk)("a",{class:"footer-name",href:"https://github.com/MarSeventh",target:"_blank"},"SanyueQi",-1)),t[1]||(t[1]=(0,a.eW)(" for You! ",-1)),(0,a.Lk)("a",{href:d.footerLink,target:"_blank"},[(0,a.bF)(c,{icon:"paper-plane",class:"footer-link-icon"})],8,i)])]))}var r=o(60782),d={name:"Footer",computed:{...(0,r.L8)(["userConfig"]),footerLink(){return this.userConfig?.footerLink||"https://github.com/MarSeventh"},thisYear(){return(new Date).getFullYear()},disableFooter(){return this.userConfig?.disableFooter||!1}}},c=o(71241);const u=(0,c.A)(d,[["render",n],["__scopeId","data-v-08acbaa9"]]);var p=u},88830:function(e,t,o){"use strict";o(85331)},95385:function(e,t,o){"use strict";o(85331)},96682:function(e,t,o){"use strict";e.exports=o.p+"img/404.8ed11fb3.png"},96808:function(e,t,o){"use strict";o(85331),o(18785),o(67819),o(85970),o(19104)},97769:function(e,t,o){"use strict";o.d(t,{A:function(){return u}});var a=o(56768);const l={key:0,class:"channel-svg-icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},s={key:1,class:"channel-svg-icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},i={key:2,class:"channel-svg-icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function n(e,t,o,n,r,d){const c=(0,a.g2)("font-awesome-icon");return(0,a.uX)(),(0,a.CE)("span",(0,a.v6)(e.$attrs,{class:["channel-icon-wrapper",`channel-brand-${o.type}`]}),["telegram"===o.type?((0,a.uX)(),(0,a.CE)("svg",l,[...t[0]||(t[0]=[(0,a.Lk)("path",{d:"M417.28 795.733333 429.226667 615.253333 756.906667 320C771.413333 306.773333 753.92 300.373333 734.72 311.893333L330.24 567.466667 155.306667 512C117.76 501.333333 117.333333 475.306667 163.84 456.533333L845.226667 193.706667C876.373333 179.626667 906.24 201.386667 894.293333 249.173333L778.24 795.733333C770.133333 834.56 746.666667 843.946667 714.24 826.026667L537.6 695.466667 452.693333 777.813333C442.88 787.626667 434.773333 795.733333 417.28 795.733333Z"},null,-1)])])):"huggingface"===o.type?((0,a.uX)(),(0,a.CE)("svg",s,[...t[1]||(t[1]=[(0,a.Fv)('<path d="M509.0304 870.656c94.6432 0 185.4464-37.3504 252.3904-103.8336a353.28 353.28 0 0 0 104.5504-250.6752 353.28 353.28 0 0 0-104.5504-250.6752 358.1952 358.1952 0 0 0-252.416-103.8336 358.1696 358.1696 0 0 0-252.3904 103.8336 353.28 353.28 0 0 0-104.5504 250.6752 353.28 353.28 0 0 0 104.5504 250.6752 358.1696 358.1696 0 0 0 252.416 103.8336z" fill="#FFD21E" data-v-ce6ff2ce></path><path d="M865.9712 516.1472a353.28 353.28 0 0 0-104.5504-250.6752 358.1952 358.1952 0 0 0-252.416-103.8336 358.1952 358.1952 0 0 0-252.3904 103.8336 353.28 353.28 0 0 0-104.5504 250.6752 353.28 353.28 0 0 0 104.5504 250.6752 358.1952 358.1952 0 0 0 252.416 103.8336c94.6432 0 185.4464-37.3504 252.3904-103.8336a353.28 353.28 0 0 0 104.5504-250.6752z m-754.9952 0c0-51.9168 10.3168-103.3216 30.3104-151.296a395.1616 395.1616 0 0 1 86.272-128.2304 398.208 398.208 0 0 1 129.152-85.6832 400.384 400.384 0 0 1 304.64 0c48.2816 19.8656 92.16 48.9728 129.1264 85.6832a395.1616 395.1616 0 0 1 86.272 128.256 392.96 392.96 0 0 1 30.2848 151.296c0 104.832-41.9328 205.3632-116.5568 279.5008a399.4112 399.4112 0 0 1-281.472 115.7888A399.4112 399.4112 0 0 1 227.584 795.6736a393.9584 393.9584 0 0 1-116.5824-279.5264z" fill="#FF9D0B" data-v-ce6ff2ce></path><path d="M624.9984 419.7376c13.1328 4.5056 18.2784 31.232 31.5136 24.2944a51.2 51.2 0 0 0 21.1456-20.8896 50.688 50.688 0 0 0-5.4272-56.4224 51.3792 51.3792 0 0 0-54.5792-16.5888c-9.728 2.8928-18.3552 8.6016-24.832 16.384a50.8416 50.8416 0 0 0-5.7344 56.3968c6.272 11.7248 26.1888-7.3472 38.016-3.2768l-0.1024 0.1024z m-241.92 0c-13.1328 4.5056-18.3808 31.232-31.5136 24.2944a51.2 51.2 0 0 1-21.1456-20.8896 50.688 50.688 0 0 1 5.4272-56.4224 51.4048 51.4048 0 0 1 54.5792-16.5888c9.728 2.8928 18.3808 8.6016 24.832 16.384a50.8416 50.8416 0 0 1 5.7344 56.3968c-6.272 11.7248-26.2912-7.3472-38.016-3.2768l0.1024 0.1024z" fill="#3A3B45" data-v-ce6ff2ce></path><path d="M506.4448 664.4736c100.9664 0 133.5296-89.344 133.5296-135.2704 0-23.8592-16.128-16.3072-41.984-3.6608-23.9616 11.7248-56.0896 27.9552-91.4432 27.9552-73.8304 0-133.5296-70.1952-133.5296-24.2944 0 45.9008 32.4608 135.2704 133.5296 135.2704h-0.1024z" fill="#FF323D" data-v-ce6ff2ce></path><path d="M429.1072 641.1264a88.8832 88.8832 0 0 1 54.4512-45.824c4.096-1.2032 8.32 5.8368 12.7232 13.056 4.096 6.9632 8.448 14.0032 12.7488 14.0032 4.608 0 9.216-6.9376 13.6448-13.7728 4.6336-7.168 9.1392-14.08 13.568-12.7488a88.32 88.32 0 0 1 51.3536 42.5216C625.92 608.384 640 559.4112 640 529.2032c0-23.8592-16.128-16.3072-42.0352-3.6608l-1.4336 0.7168c-23.7312 11.7248-55.3472 27.2384-90.0608 27.2384-34.7392 0-66.2528-15.5136-90.112-27.2384-26.7008-13.1584-43.4432-21.4272-43.4432 2.944 0 31.1296 15.0016 82.2272 56.192 111.9232z" fill="#3A3B45" data-v-ce6ff2ce></path><path d="M750.4128 467.712c8.8576 0 17.3312-3.5072 23.6032-9.728a33.024 33.024 0 0 0 0-46.8992 33.5104 33.5104 0 0 0-47.2064 0 33.024 33.024 0 0 0 0 46.8992c6.2464 6.2208 14.7456 9.728 23.6032 9.728z m-477.6448 0c8.8576 0 17.3568-3.5072 23.6032-9.728a33.024 33.024 0 0 0 0-46.8992 33.5104 33.5104 0 0 0-47.2064 0 33.024 33.024 0 0 0 0 46.8992c6.272 6.2208 14.7456 9.728 23.6032 9.728z m-68.7104 112.2048c-16.64 0-31.4368 6.7328-41.8048 19.072a60.6464 60.6464 0 0 0-13.6704 38.3488 73.472 73.472 0 0 0-19.9168-3.072c-15.9232 0-30.3104 6.0416-40.4736 16.9472a59.008 59.008 0 0 0-8.2176 71.424 54.016 54.016 0 0 0-18.3808 28.7744 59.3152 59.3152 0 0 0 8.192 48.3584 53.0176 53.0176 0 0 0-3.7888 51.2c10.496 23.68 36.6848 42.24 87.5264 62.2336 31.5392 12.4416 60.4928 20.4032 60.6976 20.5056a458.24 458.24 0 0 0 112.2816 16.3328c60.16 0 103.2192-18.3808 127.9744-54.4768 39.8592-58.0608 34.2016-111.2064-17.4592-162.432-28.4672-28.3648-47.4624-70.0672-51.3536-79.2576-8.0128-27.136-29.184-57.344-64.2048-57.344a58.88 58.88 0 0 0-47.2576 25.088c-10.2656-12.8256-20.3264-22.9376-29.3632-28.7488a76.3648 76.3648 0 0 0-40.7808-12.9536z m0 40.8064c5.2224 0 11.6992 2.2528 18.688 6.6304 21.9904 13.8752 64.2048 86.016 79.7184 114.048 5.12 9.3952 14.08 13.3632 21.9648 13.3632 15.9232 0 28.2624-15.616 1.536-35.5072-40.2432-29.8752-26.1888-78.7456-6.9632-81.7152 0.8192-0.2048 1.7408-0.2048 2.4576-0.2048 17.4592 0 25.1648 29.9008 25.1648 29.9008s22.6048 56.32 61.44 94.8736c38.7072 38.4768 40.7552 69.376 12.5184 110.4896-19.3024 28.0576-56.192 36.5312-94.08 36.5312-39.168 0-79.4112-9.216-101.888-14.8992-1.152-0.3072-138.1632-38.784-120.832-71.424 2.8928-5.504 7.7312-7.7568 13.7728-7.7568 24.448 0 68.8384 36.1216 88.0384 36.1216 4.1984 0 7.168-1.7408 8.5248-6.1184 8.1152-29.0816-123.8784-41.3184-112.7936-83.3536 2.048-7.424 7.296-10.3936 14.7968-10.3936 32.256 0 104.7808 56.3968 119.9872 56.3968 1.1264 0 2.048-0.2816 2.4576-1.024 7.6032-12.2368 3.3792-20.7872-50.3296-53.0432-53.504-32.2304-91.2128-51.6096-69.8624-74.752 2.4832-2.6624 5.9648-3.8912 10.2912-3.8912 32.5632 0 109.4912 69.5808 109.4912 69.5808s20.736 21.4272 33.3824 21.4272c2.8672 0 5.3504-1.024 6.9888-3.8912 8.832-14.8992-82.7904-83.8656-87.936-112.3072-3.4816-19.4048 2.4576-29.0816 13.4656-29.0816z" fill="#FF9D0B" data-v-ce6ff2ce></path><path d="M420.5824 872.6016c28.2368-41.216 26.1888-72.1152-12.544-110.592-38.8096-38.4512-61.4144-94.8736-61.4144-94.8736s-8.4224-32.64-27.648-29.5936c-19.2 3.072-33.28 51.84 7.0144 81.7152 40.1408 29.9008-8.0128 50.2016-23.552 22.144-15.3856-28.0576-57.7024-100.1728-79.6928-114.048-21.888-13.7728-37.2736-6.144-32.1536 22.4512 5.12 28.4416 96.8704 97.408 87.936 112.2048-8.96 15.0016-40.3712-17.4336-40.3712-17.4336s-98.304-88.8576-119.7568-65.7152c-21.376 23.168 16.3328 42.5472 69.8368 74.7776 53.7088 32.256 57.9328 40.8064 50.3296 53.0688-7.68 12.2368-126.1312-87.04-137.216-44.9024-11.1104 41.9328 120.8832 54.0672 112.768 83.1488-8.192 29.0816-93.056-54.8864-110.336-22.2464-17.4336 32.768 119.68 71.2192 120.832 71.5264 44.16 11.4176 156.6208 35.584 195.968-21.632z" fill="#FFD21E" data-v-ce6ff2ce></path><path d="M819.1232 579.9168c16.64 0 31.5392 6.7328 41.8048 19.072 8.8576 10.8544 13.6704 24.3968 13.6704 38.3488 6.5024-1.92 13.2352-2.9696 20.0192-3.072 15.9232 0 30.3104 6.0416 40.4736 16.9472a58.9824 58.9824 0 0 1 8.2176 71.424c9.0624 7.3728 15.4624 17.4592 18.2784 28.7744a59.2896 59.2896 0 0 1-8.192 48.3584 52.992 52.992 0 0 1 3.7888 51.2c-10.496 23.68-36.6848 42.24-87.424 62.208-31.6416 12.4672-60.5952 20.4288-60.8 20.5312-36.608 10.0608-74.3168 15.5392-112.2816 16.3328-60.1856 0-103.2192-18.3808-128-54.4768-39.8336-58.0608-34.176-111.2064 17.4848-162.432 28.544-28.3648 47.5648-70.0672 51.456-79.2576 8.0128-27.136 29.0816-57.344 64.1024-57.344a58.88 58.88 0 0 1 47.232 25.088c10.2912-12.8256 20.352-22.9376 29.4912-28.7488a76.3904 76.3904 0 0 1 40.6784-12.9536z m0 40.8064c-5.248 0-11.5968 2.2272-18.688 6.6304-21.888 13.8752-64.2048 86.016-79.7184 114.048a24.832 24.832 0 0 1-21.9648 13.3632c-15.8208 0-28.2624-15.616-1.4592-35.5072 40.192-29.8752 26.112-78.7456 6.912-81.7152a15.872 15.872 0 0 0-2.4832-0.2048c-17.4592 0-25.1648 29.9008-25.1648 29.9008s-22.6048 56.32-61.3376 94.8736c-38.8096 38.4512-40.8576 69.376-12.544 110.4896 19.2256 28.0576 56.2176 36.5312 94.0032 36.5312 39.2448 0 79.4112-9.216 102.016-14.8992 1.024-0.3072 138.1376-38.784 120.7808-71.424-2.9696-5.504-7.68-7.7568-13.7728-7.7568-24.4224 0-68.9152 36.1216-88.0128 36.1216-4.3264 0-7.296-1.7408-8.5248-6.144-8.2176-29.056 123.776-41.2928 112.6656-83.328-1.9456-7.424-7.168-10.3936-14.7712-10.3936-32.256 0-104.7808 56.3968-119.9872 56.3968-1.024 0-1.9456-0.3072-2.3552-1.024-7.6032-12.2368-3.5072-20.7872 50.1248-53.0432 53.7088-32.2304 91.392-51.6096 69.8368-74.752-2.3552-2.6624-5.8368-3.8912-10.0608-3.8912-32.6656 0-109.5936 69.5808-109.5936 69.5808s-20.736 21.4272-33.28 21.4272a7.6288 7.6288 0 0 1-6.9888-3.8912c-8.9344-14.8992 82.688-83.8656 87.808-112.3072 3.5072-19.4048-2.4576-29.0816-13.44-29.0816z" fill="#FF9D0B" data-v-ce6ff2ce></path><path d="M602.7008 872.6016c-28.2368-41.216-26.2912-72.1152 12.544-110.592 38.7072-38.4512 61.312-94.8736 61.312-94.8736s8.4224-32.64 27.7248-29.5936c19.1232 3.072 33.1776 51.84-6.9888 81.7152-40.2432 29.9008 8.0128 50.2016 23.424 22.144 15.5136-28.0576 57.856-100.1728 79.7184-114.048 21.8624-13.7728 37.376-6.144 32.1536 22.4512-5.12 28.4416-96.768 97.408-87.808 112.2048 8.8064 15.0016 40.2432-17.4336 40.2432-17.4336s98.4064-88.8576 119.7568-65.7152c21.376 23.168-16.2304 42.5472-69.8368 74.7776-53.7344 32.256-57.8304 40.8064-50.3296 53.0688 7.68 12.2368 126.1312-87.04 137.216-44.9024 11.1104 41.9328-120.7808 54.0672-112.6656 83.1488 8.192 29.0816 92.9536-54.8864 110.336-22.2464 17.3312 32.768-119.68 71.2192-120.832 71.5264-44.2624 11.4176-156.7232 35.584-195.968-21.632z" fill="#FFD21E" data-v-ce6ff2ce></path>',9)])])):"webdav"===o.type?((0,a.uX)(),(0,a.CE)("svg",i,[...t[2]||(t[2]=[(0,a.Lk)("path",{d:"M446.293333 810.666667C384 898.986667 262.4 921.173333 174.506667 859.733333c-87.466667-61.44-107.946667-183.893333-46.506667-273.066666a195.626667 195.626667 0 0 1 152.746667-84.48l2.133333 61.013333c-38.826667 2.986667-76.373333 23.04-100.693333 58.026667-42.666667 61.44-29.44 144.213333 29.013333 185.6 58.88 40.96 141.226667 25.173333 183.893333-35.84 13.226667-19.2 20.906667-40.106667 23.893334-61.44v-43.093334l238.08-1.706666 2.986666-4.693334c22.613333-39.253333 71.68-52.906667 110.08-30.72a81.066667 81.066667 0 0 1 29.013334 110.933334c-22.613333 38.826667-72.106667 52.48-110.506667 30.293333-17.493333-9.813333-29.866667-25.6-35.413333-43.52l-173.653334 0.853333a211.626667 211.626667 0 0 1-33.28 82.773334m310.613334-304.64c107.946667 13.226667 184.746667 110.08 171.52 216.32-13.226667 106.666667-111.36 182.186667-219.306667 168.96a197.504 197.504 0 0 1-146.346667-94.293334l52.906667-30.72a137.386667 137.386667 0 0 0 98.986667 61.866667c74.666667 8.96 140.8-41.813333 149.76-113.066667 8.96-71.253333-43.946667-136.533333-117.76-145.493333-23.04-2.56-45.226667 0.426667-65.28 7.68l-36.266667 18.773333-110.08-203.52h-9.386667a81.322667 81.322667 0 0 1-78.933333-83.2c1.28-44.373333 39.68-78.933333 84.48-77.226666 44.8 2.56 80.213333 38.826667 78.933333 83.2-0.853333 18.773333-8.106667 35.84-19.626666 49.066666l81.066666 149.76c26.453333-8.533333 55.466667-11.52 85.333334-8.106666M352 389.973333c-42.666667-100.266667 2.56-215.04 101.12-256.853333 98.986667-41.813333 213.333333 5.546667 256 105.813333 25.173333 58.453333 20.053333 122.453333-8.533333 173.653334l-52.906667-30.72c17.92-34.56 20.906667-76.8 3.84-116.48-29.013333-68.266667-106.24-101.12-172.373333-73.386667-66.56 28.16-96.426667 106.666667-67.413334 174.933333 11.946667 28.16 32 49.92 56.32 64.426667l16.64 8.96-130.986666 212.906667c1.28 2.133333 2.986667 4.693333 4.266666 8.106666 20.906667 38.826667 6.4 87.893333-32.853333 108.8-38.826667 20.906667-87.893333 5.546667-109.226667-34.56-20.906667-39.68-6.4-88.746667 32.853334-109.653333 16.64-8.96 34.986667-11.093333 52.48-7.253333l98.56-160.853334c-20.053333-18.346667-37.12-41.386667-47.786667-67.84z"},null,-1)])])):((0,a.uX)(),(0,a.Wv)(c,{key:3,icon:d.fontAwesomeIcon},null,8,["icon"]))],16)}var r={name:"ChannelIcon",inheritAttrs:!1,props:{type:{type:String,required:!0}},computed:{fontAwesomeIcon(){const e={cfr2:["fab","cloudflare"],s3:["fab","aws"],discord:["fab","discord"]};return e[this.type]||"server"}}},d=o(71241);const c=(0,d.A)(r,[["render",n],["__scopeId","data-v-ce6ff2ce"]]);var u=c}}]);
//# sourceMappingURL=253.8851e7fa.js.map