27 lines
28 KiB
Python
27 lines
28 KiB
Python
import{c as H,d as N,u as Q,a as A,o as F,b as s,n as a,e,i as J,t as k,r as z,f as ve,w as Ve,_ as re,g as G,h as O,j as q,k as y,l as je,m as E,T as Y,p as pe,F as Z,v as Re,q as Ee,s as ge,x as he,y as ee,z as Le,X as fe,A as He,B as Ne,C as L}from"./index-14Tp7zPK.js";import{u as We,P as qe,S as me,C as Ge,c as Oe,a as Qe,Q as Je,b as te,E as Ke}from"./PageHeader-BDzp_ji4.js";import{F as ye}from"./file-CN_5aebv.js";import{T as Xe}from"./trash-BTMfj7si.js";import"./box-CiSQlKtb.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 se=H("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 Ye=H("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 Ze=H("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 et=H("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 tt=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),xe=$=>$>=1024*1024*1024?Math.round($/(1024*1024*1024))+"GB":$>=1024*1024?Math.round($/(1024*1024))+"MB":Math.round($/1024)+"KB",st={class:"flex justify-center space-x-4 mb-6"},rt=N({__name:"SendTypeSelector",props:{selectedType:{}},emits:["update:selectedType"],setup($,{emit:_}){const{t:D}=Q(),o=_,f=J("isDarkMode"),b=v=>{o("update:selectedType",v)};return(v,u)=>(F(),A("div",st,[s("button",{type:"button",onClick:u[0]||(u[0]=i=>b("file")),class:a(["px-4 py-2 rounded-lg transition-colors duration-300",v.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(D)("nav.sendFile")),3),s("button",{type:"button",onClick:u[1]||(u[1]=i=>b("text")),class:a(["px-4 py-2 rounded-lg transition-colors duration-300",v.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(D)("send.sendText")),3)]))}}),ot=N({__name:"BorderProgressBar",props:{progress:{}},setup($){const _=$,D=z(null),o=z(null);let f=null;const b=()=>{if(!f||!o.value||!D.value)return;const u=D.value.clientWidth,i=D.value.clientHeight;o.value.width=u,o.value.height=i;const g=4,d=8;f.lineWidth=g;const C=f.createLinearGradient(0,0,u,i);C.addColorStop(0,"#4f46e5"),C.addColorStop(.5,"#7c3aed"),C.addColorStop(1,"#db2777"),f.strokeStyle="rgba(229, 231, 235, 0.2)",v(f,g/2,g/2,u-g,i-g,d),f.stroke();const c=((u+i)*2-8*d+2*Math.PI*d)*_.progress/100;f.strokeStyle=C,f.lineCap="round",f.lineJoin="round",f.beginPath();let p=c;const w=g/2,I=u-g,U=i-g;if(p>0){const x=Math.min(I-2*d,p);f.moveTo(d+w,w),f.lineTo(x+d+w,w),p-=x}if(p>0){const x=Math.min(Math.PI/2,p/d);f.arc(I-d+w,d+w,d,-Math.PI/2,x-Math.PI/2,!1),p-=x*d}if(p>0){const x=Math.min(U-2*d,p);f.lineTo(I+w,x+d+w),p-=x}if(p>0){const x=Math.min(Math.PI/2,p/d);f.arc(I-d+w,U-d+w,d,0,x,!1),p-=x*d}if(p>0){const x=Math.min(I-2*d,p);f.lineTo(I-x-d+w,U+w),p-=x}if(p>0){const x=Math.min(Math.PI/2,p/d);f.arc(d+w,U-d+w,d,Math.PI/2,Math.PI/2+x,!1),p-=x*d}if(p>0){const x=Math.min(U-2*d,p);f.lineTo(w,U-x-d+w),p-=x}if(p>0){const x=Math.min(Math.PI/2,p/d);f.arc(d+w,d+w,d,Math.PI,Math.PI+x,!1)}f.stroke()};function v(u,i,g,d,C,h){u.beginPath(),u.moveTo(i+h,g),u.lineTo(i+d-h,g),u.arcTo(i+d,g,i+d,g+h,h),u.lineTo(i+d,g+C-h),u.arcTo(i+d,g+C,i+d-h,g+C,h),u.lineTo(i+h,g+C),u.arcTo(i,g+C,i,g+C-h,h),u.lineTo(i,g+h),u.arcTo(i,g,i+h,g,h),u.closePath()}return ve(()=>{o.value&&(f=o.value.getContext("2d"),b())}),Ve(()=>_.progress,b),(u,i)=>(F(),A("div",{class:"border-progress-container",ref_key:"container",ref:D},[s("canvas",{ref_key:"canvas",ref:o,class:"border-progress-canvas"},null,512)],512))}}),at=re(ot,[["__scopeId","data-v-2fbf5085"]]),nt=["accept"],lt={key:0,class:"absolute inset-0 w-full h-full"},it={class:"block truncate"},dt=N({__name:"FileUploadArea",props:{selectedFile:{default:null},progress:{default:0},placeholder:{default:""},description:{default:""},acceptedTypes:{default:"*"}},emits:["fileSelected","fileDrop"],setup($,{emit:_}){const{t:D}=Q(),o=$,f=_,b=J("isDarkMode"),v=G(()=>o.placeholder||D("send.uploadArea.placeholder")),u=G(()=>o.description||D("send.uploadArea.description")),i=z(null),g=()=>{i.value?.click()},d=h=>{const p=h.target.files?.[0];p&&f("fileSelected",p)},C=h=>{f("fileDrop",h)};return(h,c)=>(F(),A("div",{class:a(["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:c[0]||(c[0]=O(()=>{},["prevent"])),onDrop:O(C,["prevent"])},[s("input",{ref_key:"fileInput",ref:i,type:"file",class:"hidden",onChange:d,accept:h.acceptedTypes},null,40,nt),h.progress>0?(F(),A("div",lt,[y(at,{progress:h.progress},null,8,["progress"])])):q("",!0),y(e(Ze),{class:a(["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:a(["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",it,k(h.selectedFile?h.selectedFile.name:v.value),1)],2),s("p",{class:a(["mt-2 text-xs",e(b)?"text-gray-500":"text-gray-400"])},k(u.value),3)],34))}}),ct={class:"flex flex-col"},ut=["value","rows","placeholder"],pt=N({__name:"TextInputArea",props:{modelValue:{},rows:{default:7},placeholder:{default:"在此输入要发送的文本..."}},emits:["update:modelValue"],setup($,{emit:_}){const{t:D}=Q(),o=$,f=_,b=J("isDarkMode"),v=G(()=>o.placeholder||D("send.uploadArea.textInput")),u=i=>{const g=i.target;f("update:modelValue",g.value)};return(i,g)=>(F(),A("div",ct,[s("textarea",{value:i.modelValue,onInput:u,rows:i.rows,placeholder:v.value,class:a(["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,ut)]))}}),gt=re(pt,[["__scopeId","data-v-bebdfe92"]]),ht={class:"p-8"},ft={key:"file",class:"grid grid-cols-1 gap-8"},mt={key:"text",class:"grid grid-cols-1 gap-8"},yt={class:"flex flex-col space-y-3"},xt={class:"relative flex-grow group"},vt=["placeholder"],bt=["value"],wt={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"},kt={class:"relative z-10 flex items-center justify-center text-lg"},_t={class:"mt-6 text-center"},St={class:"flex-grow overflow-y-auto p-6"},Ct={class:"flex-shrink-0 mr-4"},Mt={class:"flex-grow min-w-0 mr-4"},Tt={class:"flex-shrink-0 flex space-x-2"},At=["onClick"],Ft=["onClick"],Dt=["onClick"],$t={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"},It={class:"flex items-center justify-between"},zt={class:"p-4 sm:p-6"},Pt={class:"flex items-center mb-3 sm:mb-4"},Bt={class:"ml-3 sm:ml-4 min-w-0 flex-1"},Ut={class:"grid grid-cols-2 gap-3 sm:gap-4"},Vt={class:"flex items-center min-w-0"},jt={class:"flex items-center min-w-0"},Rt={class:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6"},Et={class:"space-y-3 sm:space-y-4"},Lt={class:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl p-4 sm:p-5 text-white"},Ht={class:"flex items-center justify-between mb-3 sm:mb-4"},Nt={class:"text-2xl sm:text-3xl font-bold tracking-wider text-center break-all"},Wt={class:"flex items-center justify-between mb-2 sm:mb-3"},qt={class:"bg-white p-3 sm:p-4 rounded-lg shadow-sm mb-3 sm:mb-4"},Gt=N({__name:"SendFileView",setup($){const _=JSON.parse(localStorage.getItem("config")||"{}"),D=Ne(),o=J("isDarkMode"),f=We(),b=z("file"),v=z(null),u=z(""),i=z(_.expireStyle?.[0]||"day"),g=z("1"),d=z(0),C=z(!1),h=z(null),{t:c}=Q(),p=je(),w=G(()=>f.shareData),I=z(""),U=async r=>{v.value=r,ae()&&ne(r)&&(I.value=await W(r))},x=async r=>{if(r.dataTransfer?.files&&r.dataTransfer.files.length>0){const t=r.dataTransfer.files[0];if(v.value=t,!ie())return;I.value=await W(t)}},be=async r=>{const t=r.clipboardData?.items;if(t)for(let n=0;n<t.length;n++){const l=t[n];if(l.kind==="file"){const m=l.getAsFile();if(m){if(m.size===0){p.showAlert(c("send.messages.emptyFileError"),"error");return}if(v.value=m,!ie())return;try{I.value=await W(m),p.showAlert(c("send.messages.fileAddedFromClipboard",{filename:m.name}),"success")}catch(S){p.showAlert(c("send.messages.fileProcessingFailed"),"error"),console.error("File hash calculation failed:",S)}break}}else b.value="text",t[0].getAsString(m=>{const S=m.trim();if(!S)return;const M=document.getElementById("text-content");if(!M){u.value+=S;return}const P=M.selectionStart,T=M.selectionEnd;if(P!==T){const B=u.value.substring(0,P),V=u.value.substring(T);u.value=B+S+V,setTimeout(()=>{const j=P+S.length;M.setSelectionRange(j,j),M.focus()},0)}else{const B=P,V=u.value.substring(0,B),j=u.value.substring(B);u.value=V+S+j,setTimeout(()=>{const X=B+S.length;M.setSelectionRange(X,X),M.focus()},0)}})}},W=async r=>{try{if(r.size<=10*1024*1024){const T=await r.arrayBuffer();if(window.isSecureContext){const R=await crypto.subtle.digest("SHA-256",T);return Array.from(new Uint8Array(R)).map(V=>V.toString(16).padStart(2,"0")).join("")}return K(r)}const t=5*1024*1024,n=r.slice(0,t),l=r.slice(-t),[m,S]=await Promise.all([n.arrayBuffer(),l.arrayBuffer()]),M=new Uint8Array(m.byteLength+S.byteLength+16);M.set(new Uint8Array(m),0),M.set(new Uint8Array(S),m.byteLength);const P=new TextEncoder().encode(r.size.toString());if(M.set(P,m.byteLength+S.byteLength),window.isSecureContext){const T=await crypto.subtle.digest("SHA-256",M);return Array.from(new Uint8Array(T)).map(B=>B.toString(16).padStart(2,"0")).join("")}return K(r)}catch(t){return console.error("File hash calculation failed:",t),K(r)}},K=r=>{const t=`${r.name}-${r.size}-${r.lastModified}`;let n=0;for(let l=0;l<t.length;l++){const m=t.charCodeAt(l);n=(n<<5)-n+m,n=n&n}return Math.abs(n).toString(16).padStart(64,"0")},we=(r=i.value)=>{switch(r){case"day":return c("send.expiration.placeholders.days");case"hour":return c("send.expiration.placeholders.hours");case"minute":return c("send.expiration.placeholders.minutes");case"count":return c("send.expiration.placeholders.count");case"forever":return c("send.expiration.placeholders.forever");default:return c("send.expiration.placeholders.default")}},oe=(r=i.value)=>{switch(r){case"day":return c("send.expiration.units.days");case"hour":return c("send.expiration.units.hours");case"minute":return c("send.expiration.units.minutes");case"count":return c("send.expiration.units.times");case"forever":return c("send.expiration.units.forever");default:return""}},ke=(r,t)=>{if(r==="forever")return c("send.expiration.units.forever");if(r==="count")return c("send.messages.expiresAfterCount",{count:t});const n=new Date,l=parseInt(t);switch(r){case"minute":n.setMinutes(n.getMinutes()+l);break;case"hour":n.setHours(n.getHours()+l);break;case"day":n.setDate(n.getDate()+l);break;default:return c("send.messages.expiresAfter",{value:t,unit:oe(r)})}const m=n.getFullYear(),S=(n.getMonth()+1).toString().padStart(2,"0"),M=n.getDate().toString().padStart(2,"0"),P=n.getHours().toString().padStart(2,"0"),T=n.getMinutes().toString().padStart(2,"0");return c("send.messages.expiresAt",{date:`${m}-${S}-${M} ${P}:${T}`})},_e=async r=>{try{const t=await W(r);I.value=t,console.log("Calculated file hash:",t);const n=5*1024*1024,l=Math.ceil(r.size/n),m=await L.post("chunk/upload/init/",{file_name:r.name,file_size:r.size,chunk_size:n,file_hash:I.value});if(m.code!==200)throw new Error(c("send.messages.initChunkUploadFailed"));if(m.detail?.existed)return m;const S=m.detail?.upload_id,M=new Set(m.detail?.uploaded_chunks||[]);for(let T=0;T<l;T++){if(M.has(T))continue;const R=T*n,B=Math.min(R+n,r.size),V=r.slice(R,B),j=new FormData;if(j.append("chunk",new Blob([V],{type:r.type})),(await L.post(`chunk/upload/chunk/${S}/${T}`,j,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:$e=>{const Ie=Array.from(M).reduce((Pe,ue)=>{const Be=Math.min((ue+1)*n,r.size),Ue=ue*n;return Pe+(Be-Ue)},0),ze=Math.round((Ie+T*n+$e.loaded)*100/r.size);d.value=Math.min(ze,99)}})).code!==200)throw new Error(c("send.messages.chunkUploadFailed",{index:T}))}const P=await L.post(`chunk/upload/complete/${S}`,{expire_value:g.value?parseInt(g.value):1,expire_style:i.value});if(P.code!==200)throw new Error(c("send.messages.completeUploadFailed"));return P}catch(t){if(console.error("切片上传失败:",t),t&&typeof t=="object"&&"response"in t){const n=t;n.response?.data?.detail&&p.showAlert(n.response.data.detail,"error")}else p.showAlert(c("send.messages.uploadFailed"),"error");throw t}},Se=async r=>{const t=new FormData,n={headers:{"Content-Type":"multipart/form-data"},onUploadProgress:m=>{const S=Math.round(m.loaded*100/(m.total||1));d.value=S}};return t.append("file",r),t.append("expire_value",g.value),t.append("expire_style",i.value),await L.post("share/file/",t,n)},ae=()=>_.openUpload===0&&localStorage.getItem("token")===null?(p.showAlert(c("send.messages.guestUploadDisabled"),"error"),!1):!0,ne=r=>r.size>_.uploadSize?(p.showAlert(c("send.messages.fileSizeExceeded",{size:xe(_.uploadSize)}),"error"),v.value=null,!1):!0,le=(r,t)=>{if(r==="forever"||r==="count")return!0;const n=_.max_save_seconds||0;if(n===0)return!0;let l=0;switch(r){case"minute":l=parseInt(t)*60;break;case"hour":l=parseInt(t)*3600;break;case"day":l=parseInt(t)*86400;break;default:return!1}return l<=n},ie=()=>!(!ae()||!ne(v.value)||!le(i.value,g.value)),Ce=async()=>{if(b.value==="file"&&!v.value){p.showAlert(c("send.messages.selectFile"),"error");return}if(b.value==="text"&&!u.value.trim()){p.showAlert(c("send.messages.enterText"),"error");return}if(i.value!=="forever"&&!g.value){p.showAlert(c("send.messages.enterExpirationValue"),"error");return}if(!le(i.value,g.value)){const r=Math.floor(_.max_save_seconds/86400);p.showAlert(c("send.messages.expirationTooLong",{days:r}),"error");return}try{let r;if(b.value==="file")_.enableChunk?r=await _e(v.value):r=await Se(v.value);else{const t=new FormData;t.append("text",u.value),t.append("expire_value",g.value),t.append("expire_style",i.value),r=await L.post("share/text/",t,{headers:{"Content-Type":"multipart/form-data"}})}if(r&&r.code===200){const t=r.detail?.code||"",n=r.detail?.name||"",l={id:Date.now(),filename:n,date:new Date().toISOString().split("T")[0],size:b.value==="text"?`${(u.value.length/1024).toFixed(2)} KB`:`${(v.value.size/(1024*1024)).toFixed(1)} MB`,expiration:i.value==="forever"?c("send.expiration.forever"):ke(i.value,g.value),retrieveCode:t};f.addShareDataRecord(l),p.showAlert(c("send.messages.sendSuccess",{code:t}),"success"),v.value=null,u.value="",d.value=0,h.value=l,await te(t)}else throw new Error(c("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(c("send.messages.sendFailed"),"error")}finally{d.value=0}},Me=()=>{D.push("/")},de=()=>{C.value=!C.value},Te=r=>{h.value=r},Ae=r=>{const t=f.shareData.findIndex(n=>n.id===r);t!==-1&&f.deleteShareData(t)},Fe=window.location.origin+"/#/",De=r=>`${Fe}?code=${r.retrieveCode}`,ce=r=>{const n=(parseInt(g.value)||0)+r;n>=1&&(g.value=n.toString())};return ve(()=>{console.log("SendFileView mounted")}),(r,t)=>{const n=Le("router-link");return F(),A("div",{class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300",onPaste:O(be,["prevent"])},[s("div",{class:a(["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",ht,[y(qe,{title:e(_).name,onTitleClick:Me},null,8,["title"]),s("form",{onSubmit:O(Ce,["prevent"]),class:"space-y-8"},[y(rt,{"selected-type":b.value,"onUpdate:selectedType":t[0]||(t[0]=l=>b.value=l)},null,8,["selected-type"]),y(Y,{name:"fade",mode:"out-in"},{default:E(()=>[b.value==="file"?(F(),A("div",ft,[y(dt,{"selected-file":v.value,progress:d.value,description:`支持各种常见格式,最大${e(xe)(e(_).uploadSize)}`,onFileSelected:U,onFileDrop:x},null,8,["selected-file","progress","description"])])):(F(),A("div",mt,[y(gt,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=l=>u.value=l),placeholder:e(c)("send.uploadArea.textInput")},null,8,["modelValue","placeholder"])]))]),_:1}),s("div",yt,[s("label",{class:a(["text-sm font-medium",e(o)?"text-gray-300":"text-gray-700"])},k(e(c)("send.expiration.label")),3),s("div",xt,[s("div",{class:a(["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"])},[i.value!=="forever"?(F(),A(Z,{key:0},[pe(s("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>g.value=l),type:"number",placeholder:we(),min:"1",class:a(["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,vt),[[Re,g.value]]),s("div",{class:a(["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]=l=>ce(1)),class:a(["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]=l=>ce(-1)),class:a(["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),pe(s("select",{"onUpdate:modelValue":t[5]||(t[5]=l=>i.value=l),class:a(["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",i.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:ge({color:e(o)?"#f3f4f6":"#111827",backgroundColor:e(o)?"rgba(31, 41, 55, 0.5)":"#ffffff"})},[(F(!0),A(Z,null,he(e(_).expireStyle,l=>(F(),A("option",{value:l,key:l,class:a([e(o)?"bg-gray-800 text-gray-100":"bg-white text-gray-900"]),style:ge({color:e(o)?"#f3f4f6":"#111827",backgroundColor:e(o)?"#1f2937":"#ffffff"})},k(oe(l)),15,bt))),128))],6),[[Ee,i.value]]),s("div",{class:a(["absolute pointer-events-none",[i.value==="forever"?"right-3":"right-2","top-1/2 -translate-y-1/2"]])},[(F(),A("svg",{class:a(["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",wt,[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",kt,[y(e(et),{class:"w-6 h-6 mr-2"}),s("span",null,k(e(c)("send.submit")),1)])])],32),s("div",_t,[y(n,{to:"/",class:"text-indigo-400 hover:text-indigo-300 transition duration-300"},{default:E(()=>[ee(k(e(c)("send.needRetrieveFile")),1)]),_:1})])]),s("div",{class:a(["px-8 py-4 bg-opacity-50 flex justify-between items-center",[e(o)?"bg-gray-800":"bg-gray-100"]])},[s("span",{class:a(["text-sm flex items-center",[e(o)?"text-gray-300":"text-gray-800"]])},[y(e(me),{class:"w-4 h-4 mr-1 text-green-400"}),ee(" "+k(e(c)("send.secureEncryption")),1)],2),s("button",{onClick:de,class:a(["text-sm hover:text-indigo-300 transition duration-300 flex items-center",[e(o)?"text-indigo-400":"text-indigo-600"]])},[ee(k(e(c)("send.sendRecords"))+" ",1),y(e(Ge),{class:"w-4 h-4 ml-1"})],2)],2)],2),y(Y,{name:"drawer"},{default:E(()=>[C.value?(F(),A("div",{key:0,class:a(["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:a(["flex justify-between items-center p-6 border-b",[e(o)?"border-gray-700":"border-gray-200"]])},[s("h3",{class:a(["text-2xl font-bold",[e(o)?"text-white":"text-gray-800"]])},k(e(c)("send.sendRecords")),3),s("button",{onClick:de,class:a(["hover:text-white transition duration-300",[e(o)?"text-gray-400":"text-gray-800"]])},[y(e(fe),{class:"w-6 h-6"})],2)],2),s("div",St,[y(He,{name:"list",tag:"div",class:"space-y-4"},{default:E(()=>[(F(!0),A(Z,null,he(w.value,l=>(F(),A("div",{key:l.id,class:a(["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",Ct,[y(e(ye),{class:a(["w-10 h-10",[e(o)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])]),s("div",Mt,[s("p",{class:a(["font-medium text-lg truncate",[e(o)?"text-white":"text-gray-800"]])},k(l.filename?l.filename:"Text"),3),s("p",{class:a(["text-sm truncate",[e(o)?"text-gray-400":"text-gray-600"]])},k(l.date)+" · "+k(l.size),3)]),s("div",Tt,[s("button",{onClick:m=>e(te)(l.retrieveCode),class:a(["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"]])},[y(e(se),{class:"w-5 h-5"})],10,At),s("button",{onClick:m=>Te(l),class:a(["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"]])},[y(e(Ke),{class:"w-5 h-5"})],10,Ft),s("button",{onClick:m=>Ae(l.id),class:a(["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"]])},[y(e(Xe),{class:"w-5 h-5"})],10,Dt)])],2))),128))]),_:1})])],2)):q("",!0)]),_:1}),y(Y,{name:"fade"},{default:E(()=>[h.value?(F(),A("div",$t,[s("div",{class:a(["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:a(["px-4 sm:px-6 py-3 sm:py-4 border-b",[e(o)?"border-gray-800":"border-gray-100"]])},[s("div",It,[s("h3",{class:a(["text-lg sm:text-xl font-semibold",[e(o)?"text-white":"text-gray-900"]])},k(e(c)("send.fileDetails")),3),s("button",{onClick:t[6]||(t[6]=l=>h.value=null),class:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"},[y(e(fe),{class:a(["w-4 h-4 sm:w-5 sm:h-5",[e(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])])],2),s("div",zt,[s("div",{class:a(["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",Pt,[s("div",{class:a(["p-2 sm:p-3 rounded-lg",[e(o)?"bg-gray-800":"bg-white"]])},[y(e(ye),{class:a(["w-5 h-5 sm:w-6 sm:h-6",[e(o)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2),s("div",Bt,[s("h4",{class:a(["font-medium text-sm sm:text-base truncate",[e(o)?"text-white":"text-gray-900"]])},k(h.value.filename),3),s("p",{class:a(["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",Ut,[s("div",Vt,[y(e(Ye),{class:a(["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:a(["text-xs sm:text-sm truncate",[e(o)?"text-gray-300":"text-gray-600"]])},k(h.value.expiration),3)]),s("div",jt,[y(e(me),{class:a(["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:a(["text-xs sm:text-sm truncate",[e(o)?"text-gray-300":"text-gray-600"]])}," 安全加密 ",2)])])],2),s("div",Rt,[s("div",Et,[s("div",Lt,[s("div",Ht,[t[14]||(t[14]=s("h4",{class:"font-medium text-sm sm:text-base"},"取件码",-1)),s("button",{onClick:t[7]||(t[7]=l=>e(Oe)(h.value.retrieveCode)),class:"p-1.5 sm:p-2 rounded-full hover:bg-white/10 transition-colors"},[y(e(se),{class:"w-4 h-4 sm:w-5 sm:h-5"})])]),s("p",Nt,k(h.value.retrieveCode),1)]),s("div",{class:a(["rounded-xl p-3 sm:p-4",[e(o)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[s("div",Wt,[s("h4",{class:a(["font-medium text-sm sm:text-base flex items-center min-w-0",[e(o)?"text-white":"text-gray-900"]])},[y(e(tt),{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]=l=>e(Qe)(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"},[y(e(se),{class:a(["w-4 h-4 sm:w-5 sm:h-5",[e(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])]),s("p",{class:a(["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:a(["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",qt,[y(Je,{value:De(h.value),size:140,level:"M",class:"sm:w-[160px] sm:h-[160px]"},null,8,["value"])]),s("p",{class:a(["text-xs sm:text-sm truncate max-w-full",[e(o)?"text-gray-400":"text-gray-500"]])}," 扫描二维码快速取件 ",2)],2)])]),s("div",{class:a(["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]=l=>e(te)(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)}}}),Yt=re(Gt,[["__scopeId","data-v-ebff2eb6"]]);export{Yt as default};
|