PageSourceSearch

https://www.evoto.ai/_nuxt-features/CBOPNr0V.js

js evoto.ai collected 2026-10-03 21:24:00 UTC 4,289 bytes, 1 lines download raw bytes

1import{e0 as A,J as x,E as y,F,aq as D,aV as I,e1 as N,e2 as E,ck as B}from"./BNqq9U_m.js";import{a as S}from"./DCNyZK4n.js";import{p as _}from"./D7CZk5nm.js";const H=new Set([E.BACKGROUND_REPLACER,E.AI_BACKGROUND_REMOVER,E.CLEAN_BACKGROUND,E.SHADOW_MAKER,E.SKY_REPLACEMENT]),O=Object.values(E),R=()=>{const t=I(),r=D(t.path),a=t.params.slug;return a||O.find(n=>r.includes(n))||""},V=()=>{const t=D(I().path),r=O.find(c=>t.includes(c));if(!r)return null;const a=H.has(r)?"Background":void 0,n=R();return N(r,a,n?{n}:void 0,{includeLocale:!0})},v=async t=>{if(!t)return null;try{if(A().length===0){const r=await S();r.length>0&&x(r)}}catch(r){return console.warn("[editorJump] Failed to fetch online tools:",r),null}return y(t)?F(t,R()):null},X=async t=>{const r=await v(t);if(!r){console.warn("[editorJump] navigateToOnlineToolDirect: cannot resolve url for tool:",t);return}window.location.href=r},P="evoto_external_editor_image_handoff",f="images",U=1,b="handoffId",L=30*60*1e3,T=()=>new Promise((t,r)=>{if(!window.indexedDB){r(new Error("IndexedDB is not available"));return}const a=window.indexedDB.open(P,U);a.onupgradeneeded=()=>{const n=a.result;n.objectStoreNames.contains(f)||n.createObjectStore(f,{keyPath:"id"})},a.onsuccess=()=>t(a.result),a.onerror=()=>r(a.error||new Error("Failed to open IndexedDB")),a.onblocked=()=>r(new Error("IndexedDB open blocked"))}),m=(t,r)=>new Promise((a,n)=>{T().then(i=>{const c=i.transaction(f,t),o=c.objectStore(f),e=r(o);let d;e.onsuccess=()=>{d=e.result},e.onerror=()=>n(e.error||new Error("IndexedDB request failed")),c.oncomplete=()=>{i.close(),a(d)},c.onerror=()=>{i.close(),n(c.error||new Error("IndexedDB transaction failed"))},c.onabort=()=>{i.close(),n(c.error||new Error("IndexedDB transaction aborted"))}}).catch(n)}),M=()=>{var t;return(t=window.crypto)!=null&&t.randomUUID?window.crypto.randomUUID():`${Date.now()}_${Math.random().toString(36).slice(2)}`},C=async()=>{try{const t=Date.now(),r=await T();await new Promise((a,n)=>{const i=r.transaction(f,"readwrite"),o=i.objectStore(f).openCursor();o.onsuccess=()=>{const e=o.result;if(!e)return;e.value.expiresAt<=t&&e.delete(),e.continue()},o.onerror=()=>n(o.error||new Error("Failed to prune image handoff records")),i.oncomplete=()=>{r.close(),a()},i.onerror=()=>{r.close(),n(i.error||new Error("Failed to prune image handoff records"))},i.onabort=()=>{r.close(),n(i.error||new Error("Failed to prune image handoff records"))}})}catch(t){console.warn("[ExternalEditorImageHandoff] Failed to prune expired records:",t)}},K=()=>{const t=async(n,i)=>{await C();const c=Date.now(),o={id:M(),file:n,...i!==void 0?{image_check:i}:{},fileName:n.name,fileType:n.type,fileSize:n.size,lastModified:n.lastModified,createdAt:c,expiresAt:c+L};return await m("readwrite",e=>e.put(o)),o.id},r=async n=>{if(!n)return null;const i=await m("readonly",c=>c.get(n));return i?i.expiresAt<=Date.now()?(await a(n),null):i:null},a=async n=>{n&&await m("readwrite",i=>i.delete(n))};return{saveImageHandoffFile:t,getImageHandoffFile:r,removeImageHandoffFile:a}},g=(t,r)=>{const a=r==null?void 0:r.replace(/^[?&]/,"");return a?`${t}${t.includes("?")?"&":"?"}${a}`:t},Y=()=>{const{saveImageHandoffFile:t}=K(),r=(c,o)=>{const e=g(c,new URLSearchParams(o).toString());return g(e,B().value.trackingLink)},a=async(c,o,e)=>{var u,l;const d=await t(c,e==null?void 0:e.imageCheck);(u=e==null?void 0:e.onProgress)==null||u.call(e,100),(l=e==null?void 0:e.onRedirect)==null||l.call(e),window.location.href=r(o,{[b]:d})},n=(c,o,e)=>new Promise(d=>{const u=`ai-tool/${Date.now()}_${c.name}`;_.uploadForBytesProgress(u,c,l=>{var s;return(s=e==null?void 0:e.onProgress)==null?void 0:s.call(e,l===100?99:l)},l=>{var s;(s=e==null?void 0:e.onError)==null||s.call(e,l),d()},async()=>{var l,s,p;try{const w=await _.getDownloadUrl(u);(l=e==null?void 0:e.onProgress)==null||l.call(e,100),(s=e==null?void 0:e.onRedirect)==null||s.call(e),window.location.href=r(o,{url:w})}catch(w){(p=e==null?void 0:e.onError)==null||p.call(e,w)}finally{d()}})});return{redirectToExternalEditor:async(c,o,e)=>{var d;(d=e==null?void 0:e.onProgress)==null||d.call(e,0);try{await a(c,o,e)}catch(u){console.warn("[ExternalEditorRedirect] IndexedDB handoff failed, fallback to S3 upload:",u),await n(c,o,e)}}}};export{V as a,X as n,v as r,Y as u};

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.