27 lines
27 KiB
Python
27 lines
27 KiB
Python
import{c as L,d as N,u as Q,a as T,o as F,b as s,n,e,i as J,t as k,r as $,f as me,w as ze,_ as te,g as G,h as O,j as q,k as m,l as Ae,m as E,T as K,p as de,F as X,v as $e,q as Ie,s as ce,x as ue,y as Y,z as Pe,X as pe,A as Ve,B as Re,C as H}from"./index-BQT7CCpA.js";import{u as Ue,P as je,S as ge,C as Be,c as Ee,a as He,Q as Le,b as Z,E as Ne}from"./PageHeader-D2CW9nSY.js";import{F as he}from"./file-C3_XlMB5.js";import{T as We}from"./trash-DFHGA4Wo.js";import"./box-DhNypZwK.js";/**
|
||
* @license lucide-vue-next v0.535.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ee=L("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);/**
|
||
* @license lucide-vue-next v0.535.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qe=L("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
||
* @license lucide-vue-next v0.535.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ge=L("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
|
||
* @license lucide-vue-next v0.535.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Oe=L("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
||
* @license lucide-vue-next v0.535.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qe=L("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),fe=A=>A>=1024*1024*1024?Math.round(A/(1024*1024*1024))+"GB":A>=1024*1024?Math.round(A/(1024*1024))+"MB":Math.round(A/1024)+"KB",Je={class:"flex justify-center space-x-4 mb-6"},Ke=N({__name:"SendTypeSelector",props:{selectedType:{}},emits:["update:selectedType"],setup(A,{emit:_}){const{t:z}=Q(),o=_,f=J("isDarkMode"),b=y=>{o("update:selectedType",y)};return(y,u)=>(F(),T("div",Je,[s("button",{type:"button",onClick:u[0]||(u[0]=l=>b("file")),class:n(["px-4 py-2 rounded-lg transition-colors duration-300",y.selectedType==="file"?"bg-indigo-600 text-white":e(f)?"bg-gray-700 text-gray-300 hover:bg-gray-600":"bg-gray-200 text-gray-700 hover:bg-gray-300"])},k(e(z)("nav.sendFile")),3),s("button",{type:"button",onClick:u[1]||(u[1]=l=>b("text")),class:n(["px-4 py-2 rounded-lg transition-colors duration-300",y.selectedType==="text"?"bg-indigo-600 text-white":e(f)?"bg-gray-700 text-gray-300 hover:bg-gray-600":"bg-gray-200 text-gray-700 hover:bg-gray-300"])},k(e(z)("send.sendText")),3)]))}}),Xe=N({__name:"BorderProgressBar",props:{progress:{}},setup(A){const _=A,z=$(null),o=$(null);let f=null;const b=()=>{if(!f||!o.value||!z.value)return;const u=z.value.clientWidth,l=z.value.clientHeight;o.value.width=u,o.value.height=l;const g=4,i=8;f.lineWidth=g;const C=f.createLinearGradient(0,0,u,l);C.addColorStop(0,"#4f46e5"),C.addColorStop(.5,"#7c3aed"),C.addColorStop(1,"#db2777"),f.strokeStyle="rgba(229, 231, 235, 0.2)",y(f,g/2,g/2,u-g,l-g,i),f.stroke();const d=((u+l)*2-8*i+2*Math.PI*i)*_.progress/100;f.strokeStyle=C,f.lineCap="round",f.lineJoin="round",f.beginPath();let p=d;const w=g/2,P=u-g,R=l-g;if(p>0){const x=Math.min(P-2*i,p);f.moveTo(i+w,w),f.lineTo(x+i+w,w),p-=x}if(p>0){const x=Math.min(Math.PI/2,p/i);f.arc(P-i+w,i+w,i,-Math.PI/2,x-Math.PI/2,!1),p-=x*i}if(p>0){const x=Math.min(R-2*i,p);f.lineTo(P+w,x+i+w),p-=x}if(p>0){const x=Math.min(Math.PI/2,p/i);f.arc(P-i+w,R-i+w,i,0,x,!1),p-=x*i}if(p>0){const x=Math.min(P-2*i,p);f.lineTo(P-x-i+w,R+w),p-=x}if(p>0){const x=Math.min(Math.PI/2,p/i);f.arc(i+w,R-i+w,i,Math.PI/2,Math.PI/2+x,!1),p-=x*i}if(p>0){const x=Math.min(R-2*i,p);f.lineTo(w,R-x-i+w),p-=x}if(p>0){const x=Math.min(Math.PI/2,p/i);f.arc(i+w,i+w,i,Math.PI,Math.PI+x,!1)}f.stroke()};function y(u,l,g,i,C,h){u.beginPath(),u.moveTo(l+h,g),u.lineTo(l+i-h,g),u.arcTo(l+i,g,l+i,g+h,h),u.lineTo(l+i,g+C-h),u.arcTo(l+i,g+C,l+i-h,g+C,h),u.lineTo(l+h,g+C),u.arcTo(l,g+C,l,g+C-h,h),u.lineTo(l,g+h),u.arcTo(l,g,l+h,g,h),u.closePath()}return me(()=>{o.value&&(f=o.value.getContext("2d"),b())}),ze(()=>_.progress,b),(u,l)=>(F(),T("div",{class:"border-progress-container",ref_key:"container",ref:z},[s("canvas",{ref_key:"canvas",ref:o,class:"border-progress-canvas"},null,512)],512))}}),Ye=te(Xe,[["__scopeId","data-v-2fbf5085"]]),Ze=["accept"],et={key:0,class:"absolute inset-0 w-full h-full"},tt={class:"block truncate"},st=N({__name:"FileUploadArea",props:{selectedFile:{default:null},progress:{default:0},placeholder:{default:""},description:{default:""},acceptedTypes:{default:"*"}},emits:["fileSelected","fileDrop"],setup(A,{emit:_}){const{t:z}=Q(),o=A,f=_,b=J("isDarkMode"),y=G(()=>o.placeholder||z("send.uploadArea.placeholder")),u=G(()=>o.description||z("send.uploadArea.description")),l=$(null),g=()=>{l.value?.click()},i=h=>{const p=h.target.files?.[0];p&&f("fileSelected",p)},C=h=>{f("fileDrop",h)};return(h,d)=>(F(),T("div",{class:n(["rounded-xl p-8 flex flex-col items-center justify-center border-2 border-dashed transition-all duration-300 group cursor-pointer relative",[e(b)?"bg-gray-800 bg-opacity-50 border-gray-600 hover:border-indigo-500":"bg-gray-100 border-gray-300 hover:border-indigo-500"]]),onClick:g,onDragover:d[0]||(d[0]=O(()=>{},["prevent"])),onDrop:O(C,["prevent"])},[s("input",{ref_key:"fileInput",ref:l,type:"file",class:"hidden",onChange:i,accept:h.acceptedTypes},null,40,Ze),h.progress>0?(F(),T("div",et,[m(Ye,{progress:h.progress},null,8,["progress"])])):q("",!0),m(e(Ge),{class:n(["w-16 h-16 transition-colors duration-300",e(b)?"text-gray-400 group-hover:text-indigo-400":"text-gray-600 group-hover:text-indigo-600"])},null,8,["class"]),s("p",{class:n(["mt-4 text-sm transition-colors duration-300 w-full text-center",e(b)?"text-gray-400 group-hover:text-indigo-400":"text-gray-600 group-hover:text-indigo-600"])},[s("span",tt,k(h.selectedFile?h.selectedFile.name:y.value),1)],2),s("p",{class:n(["mt-2 text-xs",e(b)?"text-gray-500":"text-gray-400"])},k(u.value),3)],34))}}),rt={class:"flex flex-col"},ot=["value","rows","placeholder"],at=N({__name:"TextInputArea",props:{modelValue:{},rows:{default:7},placeholder:{default:"在此输入要发送的文本..."}},emits:["update:modelValue"],setup(A,{emit:_}){const{t:z}=Q(),o=A,f=_,b=J("isDarkMode"),y=G(()=>o.placeholder||z("send.uploadArea.textInput")),u=l=>{const g=l.target;f("update:modelValue",g.value)};return(l,g)=>(F(),T("div",rt,[s("textarea",{value:l.modelValue,onInput:u,rows:l.rows,placeholder:y.value,class:n(["flex-grow px-4 py-3 rounded-xl placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 resize-none custom-scrollbar",e(b)?"bg-gray-800 bg-opacity-50 text-white":"bg-white text-gray-900 border border-gray-300"])},null,42,ot)]))}}),nt=te(at,[["__scopeId","data-v-bebdfe92"]]),lt={class:"p-8"},it={key:"file",class:"grid grid-cols-1 gap-8"},dt={key:"text",class:"grid grid-cols-1 gap-8"},ct={class:"flex flex-col space-y-3"},ut={class:"relative flex-grow group"},pt=["placeholder"],gt=["value"],ht={type:"submit",class:"w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-4 px-6 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition-all duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group"},ft={class:"relative z-10 flex items-center justify-center text-lg"},mt={class:"mt-6 text-center"},xt={class:"flex-grow overflow-y-auto p-6"},vt={class:"flex-shrink-0 mr-4"},yt={class:"flex-grow min-w-0 mr-4"},bt={class:"flex-shrink-0 flex space-x-2"},wt=["onClick"],kt=["onClick"],_t=["onClick"],St={key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-3 sm:p-4 overflow-y-auto"},Ct={class:"flex items-center justify-between"},Mt={class:"p-4 sm:p-6"},Tt={class:"flex items-center mb-3 sm:mb-4"},Ft={class:"ml-3 sm:ml-4 min-w-0 flex-1"},Dt={class:"grid grid-cols-2 gap-3 sm:gap-4"},zt={class:"flex items-center min-w-0"},At={class:"flex items-center min-w-0"},$t={class:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6"},It={class:"space-y-3 sm:space-y-4"},Pt={class:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl p-4 sm:p-5 text-white"},Vt={class:"flex items-center justify-between mb-3 sm:mb-4"},Rt={class:"text-2xl sm:text-3xl font-bold tracking-wider text-center break-all"},Ut={class:"flex items-center justify-between mb-2 sm:mb-3"},jt={class:"bg-white p-3 sm:p-4 rounded-lg shadow-sm mb-3 sm:mb-4"},Bt=N({__name:"SendFileView",setup(A){const _=JSON.parse(localStorage.getItem("config")||"{}"),z=Re(),o=J("isDarkMode"),f=Ue(),b=$("file"),y=$(null),u=$(""),l=$(_.expireStyle?.[0]||"day"),g=$("1"),i=$(0),C=$(!1),h=$(null),{t:d}=Q(),p=Ae(),w=G(()=>f.shareData),P=$(""),R=r=>{y.value=r},x=async r=>{if(r.dataTransfer?.files&&r.dataTransfer.files.length>0){const t=r.dataTransfer.files[0];if(y.value=t,!ne())return;P.value=await se(t)}},xe=async r=>{const t=r.clipboardData?.items;if(t)for(let c=0;c<t.length;c++){const a=t[c];if(a.kind==="file"){const v=a.getAsFile();if(v){if(v.size===0){p.showAlert(d("send.messages.emptyFileError"),"error");return}if(y.value=v,!ne())return;try{P.value=await se(v),p.showAlert(d("send.messages.fileAddedFromClipboard",{filename:v.name}),"success")}catch(M){p.showAlert(d("send.messages.fileProcessingFailed"),"error"),console.error("File hash calculation failed:",M)}break}}else b.value="text",t[0].getAsString(v=>{const M=v.trim();if(!M)return;const S=document.getElementById("text-content");if(!S){u.value+=M;return}const D=S.selectionStart,V=S.selectionEnd;if(D!==V){const I=u.value.substring(0,D),B=u.value.substring(V);u.value=I+M+B,setTimeout(()=>{const j=D+M.length;S.setSelectionRange(j,j),S.focus()},0)}else{const I=D,B=u.value.substring(0,I),j=u.value.substring(I);u.value=B+M+j,setTimeout(()=>{const W=I+M.length;S.setSelectionRange(W,W),S.focus()},0)}})}},se=async r=>new Promise(t=>{const a=new FileReader;let v=0;const M=Math.ceil(r.size/2097152);a.onload=async D=>{const V=new Uint8Array(D.target.result);try{if(window.isSecureContext){const U=await crypto.subtle.digest("SHA-256",V),B=Array.from(new Uint8Array(U)).map(j=>j.toString(16).padStart(2,"0")).join("");v++,v<M?S():t(B)}else{const U=re(r);t(U)}}catch(U){const I=re(r);console.error("File hash calculation failed:",U),t(I)}};const S=()=>{const D=v*2097152,V=D+2097152>=r.size?r.size:D+2097152;a.readAsArrayBuffer(r.slice(D,V))};S()}),re=r=>{const t=`${r.name}-${r.size}-${r.lastModified}`;let c=0;for(let a=0;a<t.length;a++){const v=t.charCodeAt(a);c=(c<<5)-c+v,c=c&c}return Math.abs(c).toString(16).padStart(64,"0")},ve=(r=l.value)=>{switch(r){case"day":return d("send.expiration.placeholders.days");case"hour":return d("send.expiration.placeholders.hours");case"minute":return d("send.expiration.placeholders.minutes");case"count":return d("send.expiration.placeholders.count");case"forever":return d("send.expiration.placeholders.forever");default:return d("send.expiration.placeholders.default")}},oe=(r=l.value)=>{switch(r){case"day":return d("send.expiration.units.days");case"hour":return d("send.expiration.units.hours");case"minute":return d("send.expiration.units.minutes");case"count":return d("send.expiration.units.times");case"forever":return d("send.expiration.units.forever");default:return""}},ye=(r,t)=>{if(r==="forever")return d("send.expiration.units.forever");if(r==="count")return d("send.messages.expiresAfterCount",{count:t});const c=new Date,a=parseInt(t);switch(r){case"minute":c.setMinutes(c.getMinutes()+a);break;case"hour":c.setHours(c.getHours()+a);break;case"day":c.setDate(c.getDate()+a);break;default:return d("send.messages.expiresAfter",{value:t,unit:oe(r)})}const v=c.getFullYear(),M=(c.getMonth()+1).toString().padStart(2,"0"),S=c.getDate().toString().padStart(2,"0"),D=c.getHours().toString().padStart(2,"0"),V=c.getMinutes().toString().padStart(2,"0");return d("send.messages.expiresAt",{date:`${v}-${M}-${S} ${D}:${V}`})},be=async r=>{try{const c=Math.ceil(r.size/5242880),a=await H.post("chunk/upload/init/",{file_name:r.name,file_size:r.size,chunk_size:5242880,file_hash:P.value});if(a.code!==200)throw new Error(d("send.messages.initChunkUploadFailed"));if(a.detail?.existed)return a;const v=a.detail?.upload_id;for(let S=0;S<c;S++){const D=S*5242880,V=Math.min(D+5242880,r.size),U=r.slice(D,V),I=new FormData;if(I.append("chunk",new Blob([U],{type:r.type})),(await H.post(`chunk/upload/chunk/${v}/${S}`,I,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:j=>{const W=Math.round((S*5242880+j.loaded)*100/r.size);i.value=W}})).code!==200)throw new Error(d("send.messages.chunkUploadFailed",{index:S}))}const M=await H.post(`chunk/upload/complete/${v}`,{expire_value:g.value?parseInt(g.value):1,expire_style:l.value});if(M.code!==200)throw new Error(d("send.messages.completeUploadFailed"));return M}catch(t){if(console.error("切片上传失败:",t),t&&typeof t=="object"&&"response"in t){const c=t;c.response?.data?.detail&&p.showAlert(c.response.data.detail,"error")}else p.showAlert(d("send.messages.uploadFailed"),"error");throw t}},we=async r=>{const t=new FormData,c={headers:{"Content-Type":"multipart/form-data"},onUploadProgress:v=>{const M=Math.round(v.loaded*100/(v.total||1));i.value=M}};return t.append("file",r),t.append("expire_value",g.value),t.append("expire_style",l.value),await H.post("share/file/",t,c)},ke=()=>_.openUpload===0&&localStorage.getItem("token")===null?(p.showAlert(d("send.messages.guestUploadDisabled"),"error"),!1):!0,_e=r=>r.size>_.uploadSize?(p.showAlert(d("send.messages.fileSizeExceeded",{size:fe(_.uploadSize)}),"error"),y.value=null,!1):!0,ae=(r,t)=>{if(r==="forever"||r==="count")return!0;const c=_.max_save_seconds||0;if(c===0)return!0;let a=0;switch(r){case"minute":a=parseInt(t)*60;break;case"hour":a=parseInt(t)*3600;break;case"day":a=parseInt(t)*86400;break;default:return!1}return a<=c},ne=()=>!(!ke()||!_e(y.value)||!ae(l.value,g.value)),Se=async()=>{if(b.value==="file"&&!y.value){p.showAlert(d("send.messages.selectFile"),"error");return}if(b.value==="text"&&!u.value.trim()){p.showAlert(d("send.messages.enterText"),"error");return}if(l.value!=="forever"&&!g.value){p.showAlert(d("send.messages.enterExpirationValue"),"error");return}if(!ae(l.value,g.value)){const r=Math.floor(_.max_save_seconds/86400);p.showAlert(d("send.messages.expirationTooLong",{days:r}),"error");return}try{let r;if(b.value==="file")_.enableChunk?r=await be(y.value):r=await we(y.value);else{const t=new FormData;t.append("text",u.value),t.append("expire_value",g.value),t.append("expire_style",l.value),r=await H.post("share/text/",t,{headers:{"Content-Type":"multipart/form-data"}})}if(r&&r.code===200){const t=r.detail?.code||"",c=r.detail?.name||"",a={id:Date.now(),filename:c,date:new Date().toISOString().split("T")[0],size:b.value==="text"?`${(u.value.length/1024).toFixed(2)} KB`:`${(y.value.size/(1024*1024)).toFixed(1)} MB`,expiration:l.value==="forever"?d("send.expiration.forever"):ye(l.value,g.value),retrieveCode:t};f.addShareDataRecord(a),p.showAlert(d("send.messages.sendSuccess",{code:t}),"success"),y.value=null,u.value="",i.value=0,h.value=a,await Z(t)}else throw new Error(d("send.messages.serverError"))}catch(r){if(r&&typeof r=="object"&&"response"in r){const t=r;t.response?.data?.detail&&p.showAlert(t.response.data.detail,"error")}else p.showAlert(d("send.messages.sendFailed"),"error")}finally{i.value=0}},Ce=()=>{z.push("/")},le=()=>{C.value=!C.value},Me=r=>{h.value=r},Te=r=>{const t=f.shareData.findIndex(c=>c.id===r);t!==-1&&f.deleteShareData(t)},Fe=window.location.origin+"/#/",De=r=>`${Fe}?code=${r.retrieveCode}`,ie=r=>{const c=(parseInt(g.value)||0)+r;c>=1&&(g.value=c.toString())};return me(()=>{console.log("SendFileView mounted")}),(r,t)=>{const c=Pe("router-link");return F(),T("div",{class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300",onPaste:O(xe,["prevent"])},[s("div",{class:n(["rounded-3xl shadow-2xl overflow-hidden border w-full max-w-md transition-colors duration-300",[e(o)?"bg-white bg-opacity-10 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200"]])},[s("div",lt,[m(je,{title:e(_).name,onTitleClick:Ce},null,8,["title"]),s("form",{onSubmit:O(Se,["prevent"]),class:"space-y-8"},[m(Ke,{"selected-type":b.value,"onUpdate:selectedType":t[0]||(t[0]=a=>b.value=a)},null,8,["selected-type"]),m(K,{name:"fade",mode:"out-in"},{default:E(()=>[b.value==="file"?(F(),T("div",it,[m(st,{"selected-file":y.value,progress:i.value,description:`支持各种常见格式,最大${e(fe)(e(_).uploadSize)}`,onFileSelected:R,onFileDrop:x},null,8,["selected-file","progress","description"])])):(F(),T("div",dt,[m(nt,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=a=>u.value=a),placeholder:e(d)("send.uploadArea.textInput")},null,8,["modelValue","placeholder"])]))]),_:1}),s("div",ct,[s("label",{class:n(["text-sm font-medium",e(o)?"text-gray-300":"text-gray-700"])},k(e(d)("send.expiration.label")),3),s("div",ut,[s("div",{class:n(["relative h-12 rounded-2xl border transition-all duration-300 shadow-sm",e(o)?"bg-gray-800/60 border-gray-700/60 group-hover:border-gray-600/80 group-hover:shadow-lg group-hover:shadow-gray-900/20":"bg-white border-gray-200 group-hover:border-gray-300 group-hover:shadow-md group-hover:shadow-gray-200/50"])},[l.value!=="forever"?(F(),T(X,{key:0},[de(s("input",{"onUpdate:modelValue":t[2]||(t[2]=a=>g.value=a),type:"number",placeholder:ve(),min:"1",class:n(["w-full h-full px-5 pr-32 rounded-2xl placeholder-gray-400 transition-all duration-300","focus:outline-none focus:ring-2 focus:ring-offset-0","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none","bg-transparent",e(o)?"text-gray-100 focus:ring-indigo-500/80 placeholder-gray-500":"text-gray-900 focus:ring-indigo-500/60 placeholder-gray-400"])},null,10,pt),[[$e,g.value]]),s("div",{class:n(["absolute right-28 top-0 h-full flex flex-col border-l",[e(o)?"border-gray-700/60":"border-gray-200"]])},[s("button",{type:"button",onClick:t[3]||(t[3]=a=>ie(1)),class:n(["flex-1 px-2 flex items-center justify-center transition-all duration-200",[e(o)?"hover:bg-gray-700/60 text-gray-400 hover:text-gray-200":"hover:bg-gray-50 text-gray-500 hover:text-gray-700"]])},[...t[10]||(t[10]=[s("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"})],-1)])],2),s("button",{type:"button",onClick:t[4]||(t[4]=a=>ie(-1)),class:n(["flex-1 px-2 flex items-center justify-center transition-all duration-200",[e(o)?"hover:bg-gray-700/60 text-gray-400 hover:text-gray-200":"hover:bg-gray-50 text-gray-500 hover:text-gray-700"]])},[...t[11]||(t[11]=[s("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)])],2)],2)],64)):q("",!0),de(s("select",{"onUpdate:modelValue":t[5]||(t[5]=a=>l.value=a),class:n(["absolute right-0 top-0 h-full appearance-none cursor-pointer transition-all duration-300","focus:outline-none focus:ring-2 focus:ring-offset-0",l.value==="forever"?"w-full px-5 rounded-2xl":"w-28 pl-4 pr-9 border-l rounded-r-2xl",e(o)?"text-gray-100 border-gray-700/60 focus:ring-indigo-500/80 bg-gray-800/60":"text-gray-900 border-gray-200 focus:ring-indigo-500/60 bg-white"]),style:ce({color:e(o)?"#f3f4f6":"#111827",backgroundColor:e(o)?"rgba(31, 41, 55, 0.5)":"#ffffff"})},[(F(!0),T(X,null,ue(e(_).expireStyle,a=>(F(),T("option",{value:a,key:a,class:n([e(o)?"bg-gray-800 text-gray-100":"bg-white text-gray-900"]),style:ce({color:e(o)?"#f3f4f6":"#111827",backgroundColor:e(o)?"#1f2937":"#ffffff"})},k(oe(a)),15,gt))),128))],6),[[Ie,l.value]]),s("div",{class:n(["absolute pointer-events-none",[l.value==="forever"?"right-3":"right-2","top-1/2 -translate-y-1/2"]])},[(F(),T("svg",{class:n(["w-4 h-4 transition-colors duration-300",[e(o)?"text-gray-400":"text-gray-500"]]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[12]||(t[12]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],2)],2)])]),s("button",ht,[t[13]||(t[13]=s("span",{class:"absolute top-0 left-0 w-full h-full bg-white opacity-0 group-hover:opacity-20 transition-opacity duration-300"},null,-1)),s("span",ft,[m(e(Oe),{class:"w-6 h-6 mr-2"}),s("span",null,k(e(d)("send.submit")),1)])])],32),s("div",mt,[m(c,{to:"/",class:"text-indigo-400 hover:text-indigo-300 transition duration-300"},{default:E(()=>[Y(k(e(d)("send.needRetrieveFile")),1)]),_:1})])]),s("div",{class:n(["px-8 py-4 bg-opacity-50 flex justify-between items-center",[e(o)?"bg-gray-800":"bg-gray-100"]])},[s("span",{class:n(["text-sm flex items-center",[e(o)?"text-gray-300":"text-gray-800"]])},[m(e(ge),{class:"w-4 h-4 mr-1 text-green-400"}),Y(" "+k(e(d)("send.secureEncryption")),1)],2),s("button",{onClick:le,class:n(["text-sm hover:text-indigo-300 transition duration-300 flex items-center",[e(o)?"text-indigo-400":"text-indigo-600"]])},[Y(k(e(d)("send.sendRecords"))+" ",1),m(e(Be),{class:"w-4 h-4 ml-1"})],2)],2)],2),m(K,{name:"drawer"},{default:E(()=>[C.value?(F(),T("div",{key:0,class:n(["fixed inset-y-0 right-0 w-full sm:w-120 bg-opacity-70 backdrop-filter backdrop-blur-xl shadow-2xl z-50 overflow-hidden flex flex-col",[e(o)?"bg-gray-900":"bg-white"]])},[s("div",{class:n(["flex justify-between items-center p-6 border-b",[e(o)?"border-gray-700":"border-gray-200"]])},[s("h3",{class:n(["text-2xl font-bold",[e(o)?"text-white":"text-gray-800"]])},k(e(d)("send.sendRecords")),3),s("button",{onClick:le,class:n(["hover:text-white transition duration-300",[e(o)?"text-gray-400":"text-gray-800"]])},[m(e(pe),{class:"w-6 h-6"})],2)],2),s("div",xt,[m(Ve,{name:"list",tag:"div",class:"space-y-4"},{default:E(()=>[(F(!0),T(X,null,ue(w.value,a=>(F(),T("div",{key:a.id,class:n(["bg-opacity-50 rounded-lg p-4 flex items-center shadow-md hover:shadow-lg transition duration-300 transform hover:scale-102",[e(o)?"bg-gray-800 hover:bg-gray-700":"bg-gray-100 hover:bg-white"]])},[s("div",vt,[m(e(he),{class:n(["w-10 h-10",[e(o)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])]),s("div",yt,[s("p",{class:n(["font-medium text-lg truncate",[e(o)?"text-white":"text-gray-800"]])},k(a.filename?a.filename:"Text"),3),s("p",{class:n(["text-sm truncate",[e(o)?"text-gray-400":"text-gray-600"]])},k(a.date)+" · "+k(a.size),3)]),s("div",bt,[s("button",{onClick:v=>e(Z)(a.retrieveCode),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[e(o)?"hover:bg-blue-400 text-blue-400":"hover:bg-blue-100 text-blue-600"]])},[m(e(ee),{class:"w-5 h-5"})],10,wt),s("button",{onClick:v=>Me(a),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[e(o)?"hover:bg-green-400 text-green-400":"hover:bg-green-100 text-green-600"]])},[m(e(Ne),{class:"w-5 h-5"})],10,kt),s("button",{onClick:v=>Te(a.id),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[e(o)?"hover:bg-red-400 text-red-400":"hover:bg-red-100 text-red-600"]])},[m(e(We),{class:"w-5 h-5"})],10,_t)])],2))),128))]),_:1})])],2)):q("",!0)]),_:1}),m(K,{name:"fade"},{default:E(()=>[h.value?(F(),T("div",St,[s("div",{class:n(["w-full max-w-2xl rounded-2xl shadow-2xl transform transition-all duration-300 ease-out overflow-hidden",[e(o)?"bg-gray-900 bg-opacity-70":"bg-white bg-opacity-95"]])},[s("div",{class:n(["px-4 sm:px-6 py-3 sm:py-4 border-b",[e(o)?"border-gray-800":"border-gray-100"]])},[s("div",Ct,[s("h3",{class:n(["text-lg sm:text-xl font-semibold",[e(o)?"text-white":"text-gray-900"]])},k(e(d)("send.fileDetails")),3),s("button",{onClick:t[6]||(t[6]=a=>h.value=null),class:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"},[m(e(pe),{class:n(["w-4 h-4 sm:w-5 sm:h-5",[e(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])])],2),s("div",Mt,[s("div",{class:n(["rounded-xl p-3 sm:p-4 mb-4 sm:mb-6",[e(o)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[s("div",Tt,[s("div",{class:n(["p-2 sm:p-3 rounded-lg",[e(o)?"bg-gray-800":"bg-white"]])},[m(e(he),{class:n(["w-5 h-5 sm:w-6 sm:h-6",[e(o)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2),s("div",Ft,[s("h4",{class:n(["font-medium text-sm sm:text-base truncate",[e(o)?"text-white":"text-gray-900"]])},k(h.value.filename),3),s("p",{class:n(["text-xs sm:text-sm truncate",[e(o)?"text-gray-400":"text-gray-500"]])},k(h.value.size)+" · "+k(h.value.date),3)])]),s("div",Dt,[s("div",zt,[m(e(qe),{class:n(["w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2 flex-shrink-0",[e(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"]),s("span",{class:n(["text-xs sm:text-sm truncate",[e(o)?"text-gray-300":"text-gray-600"]])},k(h.value.expiration),3)]),s("div",At,[m(e(ge),{class:n(["w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2 flex-shrink-0",[e(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"]),s("span",{class:n(["text-xs sm:text-sm truncate",[e(o)?"text-gray-300":"text-gray-600"]])}," 安全加密 ",2)])])],2),s("div",$t,[s("div",It,[s("div",Pt,[s("div",Vt,[t[14]||(t[14]=s("h4",{class:"font-medium text-sm sm:text-base"},"取件码",-1)),s("button",{onClick:t[7]||(t[7]=a=>e(Ee)(h.value.retrieveCode)),class:"p-1.5 sm:p-2 rounded-full hover:bg-white/10 transition-colors"},[m(e(ee),{class:"w-4 h-4 sm:w-5 sm:h-5"})])]),s("p",Rt,k(h.value.retrieveCode),1)]),s("div",{class:n(["rounded-xl p-3 sm:p-4",[e(o)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[s("div",Ut,[s("h4",{class:n(["font-medium text-sm sm:text-base flex items-center min-w-0",[e(o)?"text-white":"text-gray-900"]])},[m(e(Qe),{class:"w-4 h-4 sm:w-5 sm:h-5 mr-1.5 sm:mr-2 text-indigo-500 flex-shrink-0"}),t[15]||(t[15]=s("span",{class:"truncate"},"wget下载",-1))],2),s("button",{onClick:t[8]||(t[8]=a=>e(He)(h.value.retrieveCode,h.value.filename)),class:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors flex-shrink-0"},[m(e(ee),{class:n(["w-4 h-4 sm:w-5 sm:h-5",[e(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])]),s("p",{class:n(["text-xs sm:text-sm font-mono break-all line-clamp-2",[e(o)?"text-gray-300":"text-gray-600"]])}," 点击复制wget命令 ",2)],2)]),s("div",{class:n(["rounded-xl p-4 sm:p-5 flex flex-col items-center",[e(o)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[s("div",jt,[m(Le,{value:De(h.value),size:140,level:"M",class:"sm:w-[160px] sm:h-[160px]"},null,8,["value"])]),s("p",{class:n(["text-xs sm:text-sm truncate max-w-full",[e(o)?"text-gray-400":"text-gray-500"]])}," 扫描二维码快速取件 ",2)],2)])]),s("div",{class:n(["px-4 sm:px-6 py-3 sm:py-4 border-t",[e(o)?"border-gray-800":"border-gray-100"]])},[s("button",{onClick:t[9]||(t[9]=a=>e(Z)(h.value.retrieveCode)),class:"w-full bg-indigo-600 hover:bg-indigo-700 text-white px-4 sm:px-6 py-2 sm:py-3 rounded-lg text-sm sm:text-base font-medium transition-colors"}," 复制取件链接 ")],2)],2)])):q("",!0)]),_:1})],32)}}}),qt=te(Bt,[["__scopeId","data-v-a7f6997f"]]);export{qt as default};
|