1(this["webpackJsonpvectr-next"]=this["webpackJsonpvectr-next"]||[]).push([[37],{458:function(e,t,i){"use strict";var c=i(260),a=i(261);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(i(0)),s=(0,c(i(262)).default)(n.createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}),"Image");t.default=s},603:function(e,t,i){"use strict";var c=i(41),a=i(438),n=i(180),s=i(0),o=i(19),l=i(23),r=(i(604),i(552)),j=i(480),d=i(541),b=i(542),g=i(543),h=i(463),u=i(464),v=i(456),O=i(544),m=i(545),p=i(471),x=i(183),f=i(451),y=i(453),_=i(131),w=i.n(_),I=i(30),k=i(461),C=i(102),N=i(481),z=i(546),R=i(35),S=i(45),D=i(103),M=i(458),B=i.n(M),E=i(454),P=i(455),T=i(452),A=i(3);t.a=()=>{Object(o.d)(l.a);const e=Object(c.a)(),t=Object(o.d)(C.a),i=Object(s.useRef)(null),{enqueueSnackbar:_}=Object(x.b)(),[M,H]=Object(s.useState)(null),[F,U]=Object(s.useState)(null),[q,L]=Object(s.useState)(null),[J,K]=Object(s.useState)(!1),[W,V]=Object(s.useState)(!1),[Y,G]=Object(s.useState)(!1),Q=Object(T.f)(),X=Object(s.useMemo)((()=>[{name:"Standard",value:"1K"},{name:"High",value:"2K"}]),[]),[Z,$]=Object(s.useState)(X),[ee,te]=Object(s.useState)("1K"),ie=e=>{null===M||void 0===M||M.usePen(e),U(null===M||void 0===M?void 0:M.currentPen)},ce=async e=>{G(!0);const t=await Object(f.v)(e);if(!M){const i=document.getElementById("ai-inpainting-canvas"),c=new r.a(i);return c.run(),H(c),U(null===c||void 0===c?void 0:c.currentPen),void c.setImageUrl(t,e.type)}null===M||void 0===M||M.setImageUrl(t,e.type)},[ae,ne]=Object(s.useState)({width:0,height:0}),[se,oe]=Object(s.useState)({width:0,height:0}),le=Object(s.useRef)(null),re=Object(s.useRef)(null);Object(s.useEffect)((()=>{let e,t;return le.current&&(e=new ResizeObserver((t=>{const i=t[0].target.getBoundingClientRect();ne({width:Math.floor(i.width),height:Math.floor(i.height)}),e.disconnect()})),e.observe(le.current)),re.current&&(t=new ResizeObserver((e=>{const i=e[0].target.getBoundingClientRect();oe({width:Math.floor(i.width),height:Math.floor(i.height)}),t.disconnect()})),t.observe(re.current)),()=>{e.disconnect(),t.disconnect()}}),[]);const je=Object(T.g)((async()=>{if(!Object(D.a)("REMOVE_OBJECT"))return;const e=M.exportMark();if(""!==e.mask_b64)try{const n=await Object(f.H)([e.image_b64]);if(0===n.length)return;V(!0);try{var i;const c=J,a=null===M||void 0===M?void 0:M.stage.imageWidth,s=null===M||void 0===M?void 0:M.stage.imageHeight,{data:o}=await Object(z.a)(e.mask_b64,n[0],c,a,s);if(o.results.output.startsWith("http"))L(o.results.output);else{const t="data:".concat(e.imageType,";base64, ").concat(o.results.output);L(t)}null===(i=t.ornull)||void 0===i||i.merge((e=>({credits:e.credits-2})))}catch(s){var c,a;let e=null===s||void 0===s||null===(c=s.response)||void 0===c||null===(a=c.data)||void 0===a?void 0:a.message;e="Request Entity Too Large"===e?"Your image is too large for this AI tool to process.":Object(S.b)("components.notify.pixel_remove_object_unavailable_please_try_again_later"),_(e,{variant:"error"})}V(!1)}catch(o){var n;console.error("error",o.response),403===(null===(n=o.response)||void 0===n?void 0:n.status)?_(Object(S.b)("editor.insufficient_credits"),{variant:"error"}):_(Object(S.b)("components.notify.pixel_remove_object_unavailable_please_try_again_later"),{variant:"error"})}else _(Object(S.b)("remove_object.generate_error"),{variant:"info"})}),3e4);return Object(s.useEffect)((()=>(R.a.once("showRemoveObject",(e=>{let{InpaitingImageBase64:t,InpaitingImageType:i,InpaitingOpenFrom:c}=e;setTimeout((()=>{const e=document.getElementById("ai-inpainting-canvas"),a=new r.a(e);a.run(),H(a),U(null===a||void 0===a?void 0:a.currentPen),"canvas"===c&&K(!0),a.setImageUrl(t,i),G(!0)}),1)})),()=>{null===M||void 0===M||M.destroy()})),[]),Object(A.jsxs)(A.Fragment,{children:[Object(A.jsx)("style",{children:"\n .action-footer{\n .left{\n width:662px;\n }}\n "}),Object(A.jsxs)("div",{className:"inpainting-main",style:{height:"100%",overflow:"hidden"},children:[Object(A.jsxs)("div",{className:"left",children:[Object(A.jsxs)("div",{className:"tool ".concat(F==j.a.Brush?"selected":""),onClick:()=>ie(j.a.Brush),children:[Object(A.jsx)(d.a,{style:{width:e.spacing(3),height:e.spacing(3)}}),Object(S.b)("remove_object.erase")]}),Object(A.jsxs)("div",{className:"tool ".concat(F==j.a.Eraser?"selected":""),onClick:()=>ie(j.a.Eraser),children:[Object(A.jsx)(b.a,{style:{width:e.spacing(3),height:e.spacing(3)}}),Object(S.b)("remove_object.reveal")]}),Object(A.jsx)("div",{className:"tool",onClick:()=>{null===M||void 0===M||M.changePenSizeBigger()},children:Object(A.jsx)(a.a,{title:Object(S.b)("remove_object.bigger_tooltip"),children:Object(A.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[Object(A.jsx)(O.a,{style:{width:e.spacing(3),height:e.spacing(3)}}),Object(S.b)("remove_object.bigger")]})})}),Object(A.jsx)("div",{className:"tool",onClick:()=>{null===M||void 0===M||M.changePenSizeSmaller()},children:Object(A.jsx)(a.a,{title:Object(S.b)("remove_object.smaller_tooltip"),children:Object(A.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[Object(A.jsx)(m.a,{style:{width:e.spacing(3),height:e.spacing(3)}}),Object(S.b)("remove_object.smaller")]})})}),Object(A.jsx)("div",{className:"tool ".concat(F==j.a.Move?"selected":""),onClick:()=>ie(j.a.Move),children:Object(A.jsx)(a.a,{title:Object(S.b)("remove_object.move_tooltip"),children:Object(A.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[Object(A.jsx)(g.a,{style:{width:e.spacing(3),height:e.spacing(3)}}),Object(S.b)("remove_object.move")]})})}),Object(A.jsx)("div",{className:"tool",onClick:()=>{null===M||void 0===M||M.zoomIn()},children:Object(A.jsx)(a.a,{title:Object(S.b)("remove_object.zoom_in_tooltip"),children:Object(A.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[Object(A.jsx)(h.a,{style:{width:e.spacing(3),height:e.spacing(3)}}),Object(S.b)("remove_object.zoom_in")]})})}),Object(A.jsx)("div",{className:"tool",onClick:()=>{null===M||void 0===M||M.zoomOut()},children:Object(A.jsx)(a.a,{title:Object(S.b)("remove_object.zoom_out_tooltip"),children:Object(A.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[Object(A.jsx)(u.a,{style:{width:e.spacing(3),height:e.spacing(3)}}),Object(S.b)("remove_object.zoom_out")]})})})]}),Object(A.jsx)("div",{className:"canvas-container",children:Object(A.jsxs)("div",{className:"canvas",ref:le,style:{width:"450px"},onDragEnter:e=>{e.preventDefault(),e.stopPropagation()},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDragLeave:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{var t,i;(e.preventDefault(),e.stopPropagation(),null!==e&&void 0!==e&&null!==(t=e.dataTransfer)&&void 0!==t&&t.files)&&ce(null===e||void 0===e||null===(i=e.dataTransfer)||void 0===i?void 0:i.files[0])},children:[q&&Object(A.jsx)("div",{className:"orig-label",children:Object(S.b)("remove_object.original")}),Object(A.jsx)("canvas",{id:"ai-inpainting-canvas",width:ae.width,height:ae.height}),!Y&&Object(A.jsx)(A.Fragment,{children:Object(A.jsxs)("div",{style:{color:"rgba(255, 255, 255, 0.7)",width:ae.width,height:ae.height,position:"absolute",left:0,top:0,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[Object(A.jsx)(E.a,{style:{width:"32px",height:"32px"},onClick:async()=>{const e=await Object(y.a)({mimeTypes:["image/jpg","image/png"],extensions:[".jpg",".jpeg",".png"]});ce(e)}}),Object(A.jsx)("div",{style:{color:"rgba(255, 255, 255, 0.7)"},children:Object(S.b)("outpainting.upload_drag_label")})]})})]})}),Object(A.jsxs)("div",{ref:re,className:"generated",style:{width:"100%"},children:[!q&&Object(A.jsx)(B.a,{style:{width:"72px",height:"72px"}}),q&&Object(A.jsxs)(A.Fragment,{children:[Object(A.jsx)(N.a,{ref:i,imageUrl:q,canvasWidth:se.width,canvasHeight:se.height}),Object(A.jsxs)("div",{className:"footer-buttons",children:[Object(A.jsx)("div",{className:"button",children:Object(A.jsx)(a.a,{title:Object(S.b)("ai_face_swap.zoom_in"),children:Object(A.jsx)(h.a,{className:"icon",onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.zoomIn()},style:{color:"#45B017",width:"20px",height:"20px"}})})}),Object(A.jsx)("div",{className:"button",children:Object(A.jsx)(a.a,{title:Object(S.b)("ai_face_swap.zoom_out"),children:Object(A.jsx)(u.a,{className:"icon",onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.zoomOut()},style:{color:"#45B017",width:"20px",height:"20px"}})})})]}),Object(A.jsx)(a.a,{title:Object(S.b)("remove_object.update_original_tooltip"),children:Object(A.jsx)("div",{className:"transfer-button",onClick:()=>(e=>{const t=e.match(/^data:([^;]+);/),i=t?t[1]:"image/png";null===M||void 0===M||M.setImageUrl(e,i)})(q),children:Object(A.jsx)(p.a,{style:{color:"#45B017",width:"18px",height:"18px"}})})})]})]})]}),Object(A.jsxs)("div",{className:"action-footer",children:[Object(A.jsx)("div",{className:"left",style:{marginLeft:"72px",width:"450px"},children:!J&&Object(A.jsxs)(n.a,{variant:"outlined",color:"default",onClick:async()=>{const e=await Object(y.a)({mimeTypes:["image/jpg","image/png"],extensions:[".jpg",".jpeg",".png"]});ce(e)},disabled:W,children:[Object(A.jsx)(v.a,{style:{width:e.spacing(2.5),height:e.spacing(2.5),marginRight:"12px"}}),Object(S.b)("editor.upload")]})}),Object(A.jsxs)("div",{className:"right",style:{justifyContent:"flex-end"},children:[J&&q&&Object(A.jsx)(a.a,{title:Object(S.b)("remove_object.replace_artboard_
1image"),children:Object(A.jsx)(n.a,{variant:"outlined",color:"primary",onClick:async()=>{if(!q)return;const{activeObj:e}=Object(k.b)()||{};if(!e)return;I.a.requesting.set((e=>e+1));const t=setInterval((()=>{I.a.progress.set((e=>{return t=e,i=90,Math.floor(Math.random()*(i-t+1))+t;var t,i}))}),1e3),i=await Object(f.b)(q),c=await Object(f.I)(i);c&&(Object(k.d)(e,c),await new Promise((e=>setTimeout((()=>e()),3e3))),clearInterval(t),I.a.requesting.set((e=>e>0?e-1:0)),I.a.progress.set(0),l.a.showRemoveObject.set(!1))},disabled:W||!q,style:{marginRight:15},children:Object(S.b)("editor.replace")})}),q&&Object(A.jsxs)(A.Fragment,{children:[Object(A.jsx)(n.a,{style:{marginRight:"12px"},variant:"outlined",onClick:()=>(async e=>{try{const t=await Object(f.b)(e);w.a.saveAs(t,"image.png"),"dialog"===Q&&await Object(T.a)(t)}catch(t){_(Object(S.b)("components.notify.save_failed"),{variant:"error"})}})(q),children:Object(S.b)("editor.download")}),"page"===Q&&Object(A.jsx)(n.a,{style:{marginRight:"12px"},variant:"outlined",onClick:async()=>{Object(T.d)(q,"Remove Object")},children:Object(S.b)("editor.edit-image")})]}),Object(A.jsxs)(n.a,{variant:"outlined",color:"primary",onClick:je,disabled:W||!M,children:[Object(S.b)("components.button.generate"),Object(A.jsx)(P.a,{style:{width:e.spacing(2.5),height:e.spacing(2.5),margin:"0 8px"}}),2]})]})]})]})}},604:function(e,t,i){},886:function(e,t,i){"use strict";i.r(t);var c=i(36),a=i(452),n=i(603),s=i(3);t.default=()=>{const e=Object(c.g)();return Object(s.jsx)(a.c,{mode:"page",onClose:()=>e.push("/design"),children:Object(s.jsx)(n.a,{})})}}}]);
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.