PageSourceSearch

https://1000tool.com/_nuxt/pageTemplate.5424d384.js

js 1000tool.com collected 2026-10-07 19:54:37 UTC 12,421 bytes, 2 lines download raw bytes

1import pe from"./index.e186ed89.js";import{_ as me}from"./c-layout.vue.5f8fd99a.js";import{a as fe,a4 as _e,W as ge,ad as he,k as we,r as v,G as ve,M as E,s as y,aa as ye,o as C,c as F,w as a,u as f,l as c,E as B,j as i,e as xe,h as M,P as W,Q as ke,t as Te,ab as Le,i as U,v as be,x as Ie,a9 as Se,q as Ce}from"./entry.d679e6c0.js";import{d as Me}from"./index.87e7e444.js";import{u as Pe,_ as Q}from"./sideBar.vue.2512cdef.js";import{c as Ae}from"./canvas.a35d6efb.js";import{u as N}from"./index.37adf04a.js";import{A as je}from"./index.dc79ce50.js";import{u as Ee}from"./account.b272236d.js";import{u as Fe}from"./download-modal.e31e2400.js";import{u as Re}from"./base-layout.vue.267ffe28.js";import{u as Oe}from"./sys.839487d8.js";import{_ as $e}from"./index.vue.710c8c65.js";import{P as ze}from"./point.8b4b6b46.js";import{i as Be}from"./img.dac40f50.js";import"./index.2218dfee.js";import"./nuxt-link.e820e068.js";import"./vue.f36acd1f.df9752c5.js";import"./combined-data.2297fb70.js";import"./module.ef62d7ab.js";import"./storage.63dc09c8.js";import"./sideBarAnchor.vue.e157893e.js";import"./ANALYSIS.fa12025c.js";import"./size-format.8417d15d.js";import"./index.c2694c41.js";import"./index.0d172a8f.js";const V=L=>(be("data-v-b5cfa9ae"),L=L(),Ie(),L),Ue={class:"max-w-[1200px] mx-auto"},Ne={key:0,class:"workbench-wrapper px-2 sm:px-4"},Ve={class:"flex flex-col"},Xe={class:"flex flex-col py-2"},De={class:"flex flex-col sm:flex-row justify-evenly"},Ze={class:"mb-2 sm:mb-0 flex justify-center sm:justify-start w-full sm:w-1/3"},He=V(()=>i("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[i("path",{d:"M262.29 192.31a64 64 0 1 0 57.4 57.4a64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22a155.3 155.3 0 0 1-21.46-12.57a16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22a155.3 155.3 0 0 1 21.46 12.57a16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1)),qe={class:"flex justify-center w-full sm:w-1/3"},Ge={class:"mt-2 sm:mt-0 w-full sm:w-1/3 flex justify-center sm:justify-end"},We=V(()=>i("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 262.62L256 342l80-79.38"}),i("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 330.97V170"}),i("path",{d:"M256 64C150 64 64 150 64 256s86 192 192 192s192-86 192-192S362 64 256 64z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"})],-1)),Qe={class:"img-info-box-container relative select-none"},Je={class:"flex justify-center items-center"},Ke={class:"flex justify-center items-center w-full h-[450px]"},Ye=["src"],et=V(()=>i("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[i("path",{d:"M289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34z",fill:"currentColor"})],-1)),T=3840,tt=fe({__name:"pageTemplate",props:{accept:{default:"*"},fileReg:{},makeFn:{},pageModule:{},pageTitle:{},showLang:{type:Boolean},makeButtonText:{default:"立即处理"}},setup(L,{expose:J}){const o=_e().$loading,_=ge(),m=Ee(),h=Fe(),X=Re(),K=Oe(),D=he(),Z=we(),P=Pe(),R=L;v(null);let Y=1;const A={FREE:{MAX_TOTAL_FILE_SIZE:1*1024*1024,MAX_TOTAL_FILE_SIZE_TXT:"1MB"},VIP:{MAX_TOTAL_FILE_SIZE:4*1024*1024,MAX_TOTAL_FILE_SIZE_TXT:"4MB"}};ve(()=>{window.onbeforeunload=function(){if(O)return"请确认操作"}});let n=v([]),O,x=v(""),b=v("");const w=v(!1),$=v(!1),k=v("source"),ee=E(()=>k.value==="source"?x.value:b.value),te=E(()=>({backgroundColor:"transparent"})),oe=E(()=>n.value.map(e=>e.file.size||0).reduce((e,t)=>
1e+t,0)),se=E(()=>{const e=m.__isVIP?A.VIP.MAX_TOTAL_FILE_SIZE:A.FREE.MAX_TOTAL_FILE_SIZE;return oe.value>e});let I=[];const H=Me(100,async e=>{var g;o.show("正在添加图片..."),b.value="";let t=(e==null?void 0:e[0])||I[0],s="";if(t.type?/image\/jpe?g/i.test(t.type)?s="jpg":/image\/png/i.test(t.type)&&(s="png"):/\.jpe?g$/i.test(t.name)?s="jpg":/\.png$/i.test(t.name)&&(s="png"),!s){_.warning({title:"文件格式不支持",content:"建议使用本站图片格式转换工具转换后使用",negativeText:"取 消",positiveText:"去转换格式",onPositiveClick:()=>{Z.push("/image/convert/img2jpg")}}),o.hide();return}let{dataURL:d="",width:l=0,height:r=0}=await Ae.getPreviewImg({file:t,width:400,height:400})||{};if(l>T||r>T||t.size>4*1024*1024){let u,p;l<=T&&r<=T?(u=l,p=r):l>=r?(u=T,p=~~(u/(l/r))):(p=T,u=~~(p*(l/r))),o.show("图片较大,自动压缩中..."),t=await Be.resizeAndMinImage({file:t,toWidth:u,toHeight:p,quality:95,type:s==="png"?"image/png":"image/jpeg"}),l=u,r=p,o.show("正在添加图片...")}if(t.size>4*1024*1024){_.warning({title:"文件过大",content:"请选择不超过4MB的图片,建议使用本站图片压缩工具压缩后使用",negativeText:"取 消",positiveText:"去压缩",onPositiveClick:()=>{Z.push(`/image/min/${s}Min`)}}),o.hide();return}n.value=[{file:t,fid:Y++,width:l,height:r,previewURL:d}],I=[],o.hide(),x.value&&URL.revokeObjectURL(x.value),n.value.length&&(x.value=URL.createObjectURL((g=n.value[0])==null?void 0:g.file),w.value=!1),k.value="source",Se(()=>{var u;(u=document.querySelector(".page-sketch-to-image .n-layout-header"))==null||u.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})})});J({debounceAddFile:H,LIMIT_CONFIG:A,fileList:n});async function ae(e){var t;try{let s=[...(t=e.target)==null?void 0:t.files].filter(d=>R.fileReg.test(d.name));if(!(s!=null&&s.length))return;I=[],I.push(...s.slice(0,1)),H(),e.target.value=""}catch(s){return Promise.reject(s)}}async function ie(){w.value&&!await q({title:"请确认此次操作",content:"即将清空图片与绘制结果,请确认"})||(I=[],n.value=[],x.value&&URL.revokeObjectURL(x.value),b.value&&URL.revokeObjectURL(b.value),w.value=!1)}function ne(){return m.__isVIP?!1:se.value?(X.messageList=["文件总大小超过限制",`开通 VIP 即可上传总计 ${A.VIP.MAX_TOTAL_FILE_SIZE_TXT} 的文件`],X.show=!0,!0):!1}async function le(){try{o.show("加载中..."),await m.getPointLeft()}catch(e){_.error({title:"出错了",content:e.message,negativeText:"好 的"})}finally{o.hide()}}function q(e){return new Promise(t=>{_.warning({title:e.title,content:e.content,closeOnEsc:!1,maskClosable:!1,positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{t(!0)},onNegativeClick:()=>{t(!1)}})})}function re(){let e="";for(let t in arguments){const s=String(arguments[t]).trim().replace(/[\r\n]/g,", ").replace(/\s*,\s*/g,", ").replace(/\s*,\s*/g,", ");s&&(e&&(e+=", "),e+=s)}return e.trim()}async function ce(){var e;try{if(o.show("加载中..."),await m.getAccountInfo(),!((e=m.account)!=null&&e.id)){_.error({title:"温馨提示",content:"请先登录",positiveText:"确定",closeOnEsc:!1,maskClosable:!1,onPositiveClick:()=>{setTimeout(()=>{K.loginModalShow=!0},500)},onNegativeClick:()=>{}}),o.hide();return}if(ne()){o.hide();return}await le();const t=ze[R.pageModule];if(t>m.point){_.warning({title:"温馨提示",content:"您的积分不足,请充值后重试。",positiveText:"确定",negativeText:"取消",closeOnEsc:!1,maskClosable:!1,onPositiveClick:()=>{},onNegativeClick:()=>{}});return}if(!await q({title:"请确认此次操作",content:`当前操作将消耗 ${t} 个积分,请确认。
2当前账户剩余 ${m.point||0} 个积分。`}))return;o.show("加载中..."),await N.doSleep(500);const d=re(P.promptMainObject,P.promptBgColor,P.promptColorStyle,P.promptOther);if(d.length>192){o.hide(),D.error("提示词过长,请减少提示词",{closable:!0,duration:3e3});return}const l=Date.now();o.show("正在处理,请耐心等待..."),await N.doSleep(500);const{id:r,format:g}=await R.makeFn({fileList:n.value,prompt:d});o.show("处理完成,图片加载中...");
2const u=await je.file.downloadImg({id:r},S=>{if(S.progress>0&&S.progress<=1){const z=+(S.progress*100).toFixed(0);o.show(`正在下载图片... (${z}%)`)}}),p=new Blob([u],{type:`image/${g}`});ue(p,g),h.taskCost=Date.now()-l,o.show("处理完成"),await N.sleep(1e3),o.hide(),D.success("处理完成",{closable:!0,duration:3e3}),m.getPointLeft(),G()}catch(t){o.hide(),_.error({title:"出错了",content:t.message,negativeText:"好 的"}),m.getPointLeft()}}function ue(e,t){var d,l;O=e,b.value=URL.createObjectURL(e),w.value=!0,k.value="processed";const s=((l=(d=n.value[0])==null?void 0:d.file)==null?void 0:l.name)||"";h.downloadFileName=s.replace(/\.\w+$/,`.${t||"jpg"}`),h.downloadFile=new File([e],h.downloadFileName)}async function G(){try{if(!h.downloadFile)return;o.show("加载中..."),h.downloadFile=O,h.show=!0,o.hide()}catch(e){o.hide(),_.error({title:"出错了",content:e.message,negativeText:"好 的"})}}return(e,t)=>{const s=y("n-drawer-content"),d=y("n-drawer"),l=y("n-icon"),r=y("n-button"),g=y("n-tab"),u=y("n-tabs"),p=pe,S=y("n-layout"),z=me,de=ye("tippy");return C(),F(z,{className:"page-sketch-to-image","has-sider":f(n).length>0,"has-download":!0,"absolute-content":!1,"sider-width":320,"sider-style":"padding: 0 12px 12px 12px;",pageModule:e.pageModule},{side:a(()=>[c(Q)]),ext:a(()=>[B(e.$slots,"ext",{},void 0,!0)]),default:a(()=>[c(d,{show:$.value,"onUpdate:show":t[0]||(t[0]=j=>$.value=j),width:320,placement:"left",class:"lg:hidden"},{default:a(()=>[c(s,{title:"设置",closable:""},{default:a(()=>[c(Q)]),_:1})]),_:1},8,["show"]),i("div",Ue,[c(S,{"has-sider":!1},{default:a(()=>[f(n).length?(C(),xe("div",Ne,[i("div",Ve,[i("div",Xe,[i("div",De,[i("div",Ze,[c(r,{class:"lg:hidden",type:"primary","icon-placement":"left",secondary:"",onClick:t[1]||(t[1]=j=>$.value=!0)},{icon:a(()=>[c(l,{size:"16"},{default:a(()=>[He]),_:1})]),default:a(()=>[M(" 设置 ")]),_:1})]),i("div",qe,[c(u,{value:k.value,"onUpdate:value":t[2]||(t[2]=j=>k.value=j),size:"small",type:"segment",class:"w-48"},{default:a(()=>[c(g,{name:"source"},{default:a(()=>[M("原始图片")]),_:1}),c(g,{name:"processed",disabled:!w.value},{default:a(()=>[M("智绘结果")]),_:1},8,["disabled"])]),_:1},8,["value"])]),i("div",Ge,[W(c(r,{class:"mr-2",secondary:"",type:"primary",disabled:!f(n).length||!w.value,onClick:G},{icon:a(()=>[c(l,null,{default:a(()=>[We]),_:1})]),default:a(()=>[M(" 下载成片 ")]),_:1},8,["disabled"]),[[ke,w.value]]),c(r,{type:"info",disabled:!f(n).length,onClick:ce},{default:a(()=>[M(Te(e.makeButtonText||"立即处理"),1)]),_:1},8,["disabled"])])])])]),i("div",Qe,[f(n).length?(C(),F(p,{key:0,class:"workbench h-[450px]",onFileDrop:ae},{default:a(()=>[i("div",Je,[i("div",Ke,[i("img",{class:"img-recognize max-w-full max-h-full",draggable:"false",src:ee.value,style:Le(te.value),alt:"source-img"},null,12,Ye),W((C(),F(r,{class:"btn-remove-file absolute z-10 top-2 right-4 opacity-70 hover:opacity-100",style:{},type:"error",size:"small",circle:"",onClick:ie},{icon:a(()=>[c(l,{size:"20"},{default:a(()=>[et]),_:1})]),_:1})),[[de,{content:"移除",placement:"top"}]]),f(n).length&&k.value==="source"?(C(),F($e,{key:0,file:f(n)[0].file,width:f(n)[0].width,height:f(n)[0].height},null,8,["file","width","height"])):U("",!0)])])]),_:1})):U("",!0)])])):U("",!0)]),_:1})]),B(e.$slots,"header",{},void 0,!0),B(e.$slots,"footer",{},void 0,!0)]),_:3},8,["has-sider","pageModule"])}}});const Ct=Ce(tt,[["__scopeId","data-v-b5cfa9ae"]]);export{Ct as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.