PageSourceSearch

https://app.marketingtechai.com/_next/static/chunks/pages/ai-image-upscaler-6ae0ebab1710e28a.js

js marketingtechai.com collected 2026-10-07 16:51:19 UTC 6,728 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9908],{88546:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ai-image-upscaler",function(){return a(58544)}])},58544:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return k}});var n=a(28598),s=a(7866),o=a(8353),l=a(24123),i=a(82684),r=(a(24665),a(98968)),d=a(21737),c=a(35021),u=a(42957),m=a(66814),h=a(1887),g=a.n(h),p=a(83777),x=a(38178),w=a(68015),f=a(70),y=a(58035),b=a(23708),j=a(70942),v=a(40806),I=a(81955),N=a(81385);var k=!0;t.default=(0,w.Z)((()=>{const{t:e}=(0,N.$G)(),{hasAccess:t}=(0,f.Z)(x.pR),{isWhitelabel:a,whitelabelOverride:h}=(0,b.y)(),[w,k]=(0,i.useState)([]),[E,_]=(0,i.useState)(!1),[D,S]=(0,i.useState)(null),[C,U]=(0,i.useState)(0),[L,P]=(0,i.useState)(!1),{data:Z,isLoading:A,error:V,refetch:F}=(0,r.ZF)({},{skip:!t}),[O]=(0,r._Y)(),[B,{isLoading:H}]=(0,r.b2)(),{isDownloadPopupVisible:z,setIsDownloadPopupVisible:R,downloadingFileState:X,downloadImage:G}=(0,j.Z)(),W=(e,t)=>{S(t?e.editedUrl:e.originalUrl),_(!0)},M=async t=>{await O(t).unwrap(),(0,u.XA)({title:e("Image deleted")}),F(),P(!1)},T=async(t,a)=>{try{const e=a?t.editedUrl:t.originalUrl,n=new Image,s=document.createElement("canvas"),o=s.getContext("2d");n.crossOrigin="anonymous",n.onload=async()=>{s.width=n.naturalWidth,s.height=n.naturalHeight,o.drawImage(n,0,0);const e=await new Promise((e=>s.toBlob(e,n.type)));await navigator.clipboard.write([new ClipboardItem({[e.type]:e})])},n.onerror=e=>{throw new Error("Failed to load image: ".concat(e))},n.src=e}catch(V){console.error("Error copying image to clipboard:",V),alert(e("Failed to copy image to clipboard"))}},[$,J]=(0,i.useState)(!1),[Y]=(0,r.J4)(),{scaleUploadImage:q}=(0,v.Z)(J,F,k),[K,Q]=(0,i.useState)(null),ee=(0,i.useRef)(null),te=e=>{R(!z),Q(e)},ae=((e,t)=>{const a=Array.from({length:t},(()=>[]));return null===e||void 0===e||e.forEach(((e,n)=>{a[n%t].push(e)})),a})(Z,3),ne=e=>{const t=Z.findIndex((t=>t._id===e));t>=0&&(U(t),P(!0))},se=e=>{let t=C;"prev"===e?t=C-1<0?Z.length-1:C-1:"next"===e&&(t=(C+1)%Z.length),U(t);const a=Z[t];S(a.originalUrl||a.editedUrl)};(0,i.useEffect)((()=>{const e=e=>{E||("ArrowRight"===e.key?se("next"):"ArrowLeft"===e.key&&se("prev"))};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}}),[se,Z,C]);const[oe,le]=(0,i.useState)(!0);(0,i.useEffect)((()=>{const e=()=>{window.innerWidth<y.X?le(!1):le(!0)};return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)}),[]);const ie=(0,i.useMemo)((()=>X||H||$),[X,H,$]),re=async(e,t,a)=>{const{originalUrl:n,...s}=K;await G({url:n,...s},e,t,a)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(g(),{children:[(0,n.jsx)("title",{children:a?h?h.title||e("AI Image Upscaler"):"":e("AI Image Upscaler")}),(0,n.jsx)("style",{children:"\n            body {\n              background-color: white !important;\n            }\n          "})]}),(0,n.jsxs)("div",{className:"p-3",children:[(0,n.jsx)("div",{className:"absolute",children:(0,n.jsx)(p.Z,{})}),(0,n.jsx)(l.V,{open:E,onClose:()=>_(!1),className:"fixed inset-0 z-50 overflow-y-auto",children:(0,n.jsxs)("div",{className:"flex min-h-screen items-center justify-center",children:[(0,n.jsx)(l.V.Overlay,{className:"fixed inset-0 bg-black bg-opacity-50"}),(0,n.jsx)("div",{className:"relative mx-auto h-full w-full max-w-4xl rounded-lg bg-white p-6",style:{height:"70vh"},children:(0,n.jsx)(s.Z,{onEditComplete:async t=>{var a;_(!1),S(null);const n=t.dest;if(!(n instanceof Blob))return void console.error("Edited image is not a Blob");const s=new FormData;s.append("image",n);const o=null===(a=Z[C])||void 0===a?void 0:a._id;if(o)try{await B({id:o,formData:s}).unwrap(),F().unwrap(),(0,u.XA)({title:e("Image updated successfully")}),P(!0)}catch(V){console.error("Error updating edited image:",V)}else console.error("No current entry ID found for the edited image")},editableImage:D,setIsPinturaOpen:_})})]})}),(0,n.jsx)(l.V,{open:L,onClose:()=>P(!L),className:"fixed inset-0 z-10 overflow-y-auto",children:(0,n.jsxs)("div",{className:" min-h-screen items-center md:flex hidden justify-center p-2",children:[(0,n.jsx)(l.V.Overlay,{className:"fixed inset-0 bg-black bg-opacity-50"}),(0,n.jsxs)("div",{className:"relative mx-auto flex w-full max-w-4xl items-center justify-center rounded-lg bg-white bg-opacity-100 p-6",children:[(0,n.jsx)("button",{onClick:()=>P(!1),className:"absolute right-0 top-0 mr-2 mt-2 p-2 text-white hover:text-gray-200 focus:outline-none","aria-label":"Close",children:(0,n.jsx)(I.tHP,{})}),(0,n.jsx)("button",{onClick:()=>se("prev"),className:"absolute left-0 z-10 m-4 rounded-full bg-black bg-opacity-80",children:(0,n.jsx)(I.dh_,{})}),(0,n.jsx)("div",{className:"flex justify-center text-white",children:Z&&Z[C]&&(0,n.jsx)(c.Z,{generationName:"AI Upscaler",generations:[Z[
1C]],handleCopy:T,handleDownload:te,handleHookDeletionById:M,isDownloadPopupVisible:z,selectedHookForDownload:K,downloadButtonRef:ee,downloadImage:re,setIsDownloadPopupVisible:R,showGenerationId:!1,handleEdit:W,uploadImageLoading:ie})}),(0,n.jsx)("button",{onClick:()=>se("next"),className:"absolute right-0 z-10 m-4 rounded-full bg-black bg-opacity-80",children:(0,n.jsx)(I.$p_,{})})]})]})}),(0,n.jsx)("div",{className:"mb-4 flex justify-center",children:(0,n.jsx)(o.Z,{images:w,IS_LIGHT_MODE:true,setImages:k,refetchList:F,type:"ai-scaling"})}),A&&(0,n.jsx)(m.Z,{}),(0,n.jsx)("div",{className:"hidden w-full md:block",children:Z&&Z.length>0?(0,n.jsxs)("div",{className:"mt-20 text-center",children:[(0,n.jsx)("p",{className:"text-lg text-gray-700",children:"No Upscaled Images to display \ud83d\ude1e"}),(0,n.jsx)("p",{className:"text-md mt-2 text-gray-500",children:e("Start by uploading images to see them here!")})]}):(0,n.jsx)("div",{className:"-mx-2 flex",children:ae.map(((e,t)=>(0,n.jsx)(d.Z,{columnData:e,openModalWithImage:ne,uploadImageLoading:A},t)))})}),!oe&&(0,n.jsx)("div",{className:"w-full justify-center pt-2",children:Z&&0===Z.length?(0,n.jsxs)("div",{className:"mt-20 text-center",children:[(0,n.jsx)("p",{className:"text-lg text-gray-700",children:"No Upscaled Images to display \ud83d\ude1e"}),(0,n.jsx)("p",{className:"text-md mt-2 text-gray-500",children:e("Start by uploading images to see them here!")})]}):(0,n.jsx)(c.Z,{generationName:"AI Editor",generations:Z,handleCopy:T,handleDownload:te,handleHookDeletionById:M,isDownloadPopupVisible:z,selectedHookForDownload:K,downloadButtonRef:ee,downloadImage:re,setIsDownloadPopupVisible:R,showGenerationId:!1,handleEdit:W,uploadImageLoading:H})})]})]})}),x.pR,"ai-platform")}},function(e){e.O(0,[22884,62817,75785,68015,7866,41253,49774,92888,40179],(function(){return t=88546,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

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.