1(this["webpackJsonpvectr-next"]=this["webpackJsonpvectr-next"]||[]).push([[28],{454:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n,a=r(0);const o=["title","titleId"];function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function l(e,t){let{title:r,titleId:l}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,o);return a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",ref:t,"aria-labelledby":l},c),r?a.createElement("title",{id:l},r):null,n||(n=a.createElement("path",{fill:"currentColor",d:"M4,4H11V2H4A2,2 0 0,0 2,4V11H4V4M10,13L6,18H18L15,14L12.97,16.71L10,13M17,8.5A1.5,1.5 0 0,0 15.5,7A1.5,1.5 0 0,0 14,8.5A1.5,1.5 0 0,0 15.5,10A1.5,1.5 0 0,0 17,8.5M20,2H13V4H20V11H22V4A2,2 0 0,0 20,2M20,20H13V22H20A2,2 0 0,0 22,20V13H20V20M4,13H2V20A2,2 0 0,0 4,22H11V20H4V13Z"})))}const c=a.forwardRef(l);r.p},456:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n,a=r(0);const o=["title","titleId"];function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function l(e,t){let{title:r,titleId:l}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,o);return a.createElement("svg",i({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"25px",height:"25px",viewBox:"0 0 25 25",enableBackground:"new 0 0 25 25",xmlSpace:"preserve",ref:t,"aria-labelledby":l},c),r?a.createElement("title",{id:l},r):null,n||(n=a.createElement("path",{fill:"currentColor",d:"M25,16.071c0,2.959-2.398,5.357-5.357,5.357H14.87v-4.874h3.836l-5.992-5.992 c-0.118-0.118-0.309-0.118-0.427,0l-5.992,5.992h3.786v4.874H5.357C2.398,21.429,0,19.03,0,16.071s2.398-5.357,5.357-5.357 c0-3.945,3.198-7.143,7.143-7.143s7.143,3.198,7.143,7.143C22.602,10.714,25,13.113,25,16.071z"})))}const c=a.forwardRef(l);r.p},463:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n,a=r(0);const o=["title","titleId"];function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function l(e,t){let{title:r,titleId:l}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,o);return a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",ref:t,"aria-labelledby":l},c),r?a.createElement("title",{id:l},r):null,n||(n=a.createElement("path",{fill:"currentColor",d:"M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M8,5V8H5V10H8V13H10V10H13V8H10V5H8Z"})))}const c=a.forwardRef(l);r.p},464:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n,a=r(0);const o=["title","titleId"];function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}
1).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function l(e,t){let{title:r,titleId:l}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,o);return a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",ref:t,"aria-labelledby":l},c),r?a.createElement("title",{id:l},r):null,n||(n=a.createElement("path",{fill:"currentColor",d:"M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M5,8V10H13V8H5Z"})))}const c=a.forwardRef(l);r.p},623:function(e,t,r){},646:function(e,t,r){"use strict";var n=r(1),a=r(2),o=r(0),i=r(25),l=r(41),c=r(69),s=r(181),u=r(390),d=r(387),p=r(438),b=r(4),j=r(49),g=r(7),f=(r(12),r(6)),h=r(9),v=o.forwardRef((function(e,t){var r=e.classes,n=e.className,a=e.row,i=void 0!==a&&a,l=Object(g.a)(e,["classes","className","row"]);return o.createElement("div",Object(b.a)({className:Object(f.a)(r.root,n,i&&r.row),ref:t},l))})),m=Object(h.a)({root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}},{name:"MuiFormGroup"})(v),x=r(16),O=r(76);var _=o.createContext(),w=r(136),y=o.forwardRef((function(e,t){var r=e.actions,n=e.children,a=e.name,i=e.value,l=e.onChange,c=Object(g.a)(e,["actions","children","name","value","onChange"]),s=o.useRef(null),u=Object(O.a)({controlled:i,default:e.defaultValue,name:"RadioGroup"}),d=Object(j.a)(u,2),p=d[0],f=d[1];o.useImperativeHandle(r,(function(){return{focus:function(){var e=s.current.querySelector("input:not(:disabled):checked");e||(e=s.current.querySelector("input:not(:disabled)")),e&&e.focus()}}}),[]);var h=Object(x.a)(t,s),v=Object(w.a)(a);return o.createElement(_.Provider,{value:{name:v,onChange:function(e){f(e.target.value),l&&l(e,e.target.value)},value:p}},o.createElement(m,Object(b.a)({role:"radiogroup",ref:h},c),n))})),z=r(856),k=r(198),C=r(32),E=Object(C.a)(o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),R=Object(C.a)(o.createElement("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked");var S=Object(h.a)((function(e){return{root:{position:"relative",display:"flex","&$checked $layer":{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}},layer:{left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},checked:{}}}),{name:"PrivateRadioButtonIcon"})((function(e){var t=e.checked,r=e.classes,n=e.fontSize;return o.createElement("div",{className:Object(f.a)(r.root,t&&r.checked)},o.createElement(E,{fontSize:n}),o.createElement(R,{fontSize:n,className:r.layer}))})),I=r(15),P=r(14),L=r(78);var H=o.createElement(S,{checked:!0}),M=o.createElement(S,null),V=o.forwardRef((function(e,t){var r=e.checked,n=e.classes,a=e.color,i=void 0===a?"secondary":a,l=e.name,c=e.onChange,s=e.size,u=void 0===s?"medium":s,d=Object(g.a)(e,["checked","classes","color","name","onChange","size"]),p=o.useContext(_),j=r,h=Object(L.a)(c,p&&p.onChange),v=l;return p&&("undefined"===typeof j&&(j=p.value===e.value),"undefined"===typeof v&&(v=p.name)),o.createElement(k.a,Object(b.a)({color:i,type:"radio",icon:o.cloneElement(M,{fontSize:"small"===u?"small":"medium"}),checkedIcon:o.cloneElement(H,{fontSize:"small"===u?"small":"medium"}),classes:{root:Object(f.a)(n.root,n["color".concat(Object(P.a)(i))]),checked:n.checked,disabled:n.disabled},name:v,checked:j,onChange:h,ref:t},d))})),N=Object(h.a)((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(I.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(I.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiRadio"})(V),D=r(401),A=r(449),T=r(180),X=r(183),B=r(19),q=r(23),F=r(194),Y=r(451),U=r(30),Z=r(102),G=r(189),W=r(461),$=r(11),J=r(22),K=r(83),Q=r(61),ee=r(17),te=r(70),re=r(103),ne=r(48),ae=(r(623),r(3)),oe=Object(o.forwardRef)((function(e,t){var r=e.svgString,n=Object(o.useRef)(null),a=Object(o.useRef)(null),i=Object(o.useRef)({scale:1,x:0,y:0,isDragging:!1,startX:0,startY:0,startPanX:0,startPanY:0}),l=function(){if(a.current){var e=i.current,t=e.scale,r=e.x,n=e.y;a.current.style.transform="translate(".concat(r,"px, ").concat(n,"px) scale(").concat(t,")")}},c=function(){i.current.scale=1,i.current.x=0,i.current.y=0,l()},s=function(e){var t=i.current,r=Math.min(10,Math.max(.1,t.scale*e)),a=r/t.scale,o=n.current;if(o){var c=o.clientWidth/2,s=o.clientHeight/2;t.x=c-(c-t.x)*a,t.y=s-(s-t.y)*a,t.scale=r,l()}};Object(o.useImperativeHandle)(t,(function(){return{zoomIn:function(){return s(1.1)},zoomOut:function(){return s(1/1.1)},reset:c}})),Object(o.useEffect)((function(){c()}),[r]),Object(o.useEffect)((function(){var e=n.current;if(e){var t=function(t){if(0===t.button){var r=i.current;r.isDragging=!0,r.startX=t.clientX,r.startY=t.clientY,r.startPanX=r.x,r.startPanY=r.y,e.classList.add("grabbing"),e.style.cursor="grabbing"}},r=function(e){var t=i.current;t.isDragging&&(t.x=t.startPanX+(e.clientX-t.startX),t.y=t.startPanY+(e.clientY-t.startY),l(
1))},o=function(){var t=i.current;t.isDragging&&(t.isDragging=!1,e.classList.remove("grabbing"),e.style.cursor="grab")};return e.addEventListener("mousedown",t),window.addEventListener("mousemove",r),window.addEventListener("mouseup",o),a.current&&(a.current.style.willChange="transform",a.current.style.transformOrigin="0 0",a.current.style.transition="none"),function(){e.removeEventListener("mousedown",t),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",o),a.current&&(a.current.style.willChange="auto")}}}),[]);return Object(ae.jsx)("div",{ref:n,style:{width:"100%",height:"100%",overflow:"hidden",cursor:"grab",userSelect:"none",touchAction:"none",backgroundColor:"#fff",borderRadius:"8px"},children:Object(ae.jsx)("div",{ref:a,dangerouslySetInnerHTML:{__html:r},style:{display:"inline-block",minWidth:"100%",minHeight:"100%",transform:"translate(0,0) scale(1)",transformOrigin:"0 0",willChange:"transform"}})})})),ie=r(463),le=r(464),ce=r(456),se=r(453),ue=r(66),de=r(131),pe=r.n(de),be=r(912),je=r(454),ge=r(455),fe=r(452),he=r(5),ve=r(26),me=r(503);const xe={"output.draw_style":"fill_shapes","output.shape_stacking":"stacked","output.group_by":"color","output.parameterized_shapes.flatten":!0,"output.curves.allowed.circular_arc":!0,"output.curves.allowed.elliptical_arc":!0,"output.curves.allowed.quadratic_bezier":!0,"output.curves.allowed.cubic_bezier":!0,"output.curves.line_fit_tolerance":"0.1","output.gap_filler.enabled":!1,"output.gap_filler.clip":!1,"output.gap_filler.non_scaling_stroke":!0,"output.gap_filler.stroke_width":2,"output.strokes.non_scaling_stroke":!0,"output.strokes.use_override_color":!1,"output.strokes.override_color":"#000000","output.strokes.stroke_width":1,"processing.max_colors":0};t.a=()=>{var e;const{enqueueSnackbar:t}=Object(X.b)(),[r,b]=Object(o.useState)(xe),[j,g]=Object(o.useState)(""),f=Object(B.d)(q.a),{t:h}=Object(te.b)(),v=Object(fe.f)();Object(o.useEffect)((()=>{if(b(xe),Le([]),E([]),L([]),S.current=null,I.current=new Map,Re.current=null,Oe(!1),f.vectorizerDialog.value&&"dialog"===v){const e=sessionStorage.getItem("VectorizerImageURL");if(!e)return void console.error("No image url found.");g(e),O(void 0),sessionStorage.removeItem("VectorizerImageURL")}}),[f.vectorizerDialog.value]);const[x,O]=Object(o.useState)(void 0),[_,w]=Object(o.useState)([]),k=Object(o.useRef)([]);Object(o.useEffect)((()=>{k.current=_}),[_]);const[C,E]=Object(o.useState)([]),R=Object(o.useRef)([]);Object(o.useEffect)((()=>{R.current=C}),[C]);const S=Object(o.useRef)(null),I=Object(o.useRef)(new Map),[P,L]=Object(o.useState)([]),H=Object(o.useRef)([]),M=Object(o.useRef)(-1),V=Object(o.useRef)(!1),[de,Oe]=Object(o.useState)(!1),_e=Object(o.useRef)(0),[we,ye]=Object(o.useState)(null),ze=Object(o.useRef)(null),ke=Object(o.useRef)(!1),Ce=()=>{ze.current&&(clearTimeout(ze.current),ze.current=null)},Ee=()=>{Ce(),ze.current=window.setTimeout((()=>{ke.current||ye(null)}),300)};Object(o.useEffect)((()=>()=>{ze.current&&clearTimeout(ze.current)}),[]);const Re=Object(o.useRef)(null),Se=Object(l.a)(),Ie=Object(o.useRef)(null),Pe=["api-staging.vectr.com","localhost:4242"].includes(null!==(e="api.vectr.com")?e:""),Le=(e,t)=>{const n=null!==t&&void 0!==t?t:r["processing.max_colors"];_e.current=n,0===P.length?(L(e),E(e),w([...e])):(E(e),w([...e]))},He=e=>{const t=k.current;if(0===e){const e=[];P.forEach(((t,r)=>{const n=I.current.get(r);if(n&&n.length>0){const t=n[0].element.getAttribute("fill");e[r]=t?t.toUpperCase():P[r]}else e[r]=P[r]})),w(e)}else if(e>t.length){const r=[...t];for(let n=t.length;n<e;n++){const e=I.current.get(n);if(e&&e.length>0){const t=e[0].element.getAttribute("fill");t?r.push(t.toUpperCase()):n<P.length&&r.push(P[n])}else n<P.length&&r.push(P[n])}w(r)}else e<t.length&&w(t.slice(0,e))},Me=async e=>{const{width:t,height:r}=await(async e=>new Promise(((t,r)=>{const n=new Image;n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})},n.onerror=e=>{r(e)};const a=new FileReader;a.onloadend=()=>{null!==a.result?n.src=a.result:r("FileReader result is null.")},a.onerror=()=>{r("FileReader error.")},a.readAsDataURL(e)})))(e);let a=await Object(Y.I)(e);const o=14e5;if(e.size>o||t*r>3145820)try{a="https://cf-image-transformation.empatiohq.com/cdn-cgi/image/fit=scale-down,width=".concat(1700,",format=jpeg,quality=90/").concat(a);var i;if(await Object(Y.z)(a)>o)return null===(i=ue.b.current)||void 0===i?void 0:i.enqueueSnackbar(h("editor.import_failed_vectorizing_pixels"),{variant:"error"})}catch(l){console.error("Error getting remote file size:",l)}
1g(a),O(void 0),Le([]),E([]),L([]),S.current=null,I.current=new Map,Oe(!1),b((e=>{const t=Object(n.a)({},e);return t["processing.max_colors"]=0,t}))},Ve=e=>{const{name:t,value:a}=e.target;b(Object(n.a)(Object(n.a)({},r),{},{[t]:a}))},Ne=e=>{const{name:t,checked:a}=e.target;b(Object(n.a)(Object(n.a)({},r),{},{[t]:a}))},De=()=>ne.d.VECTORIZING_PIXELS,Ae=Object(fe.g)((async()=>{if(!Object(re.a)("VECTORIZING_PIXELS"))return;U.a.requesting.set((e=>e+1));const e=Object(n.a)(Object(n.a)({mode:Pe?"test":"production","output.file_format":"svg","output.svg.version":"svg_1_1","output.svg.fixed_size":"false","output.svg.adobe_compatibility_mode":"false"},r),{},{"policy.retention_days":1});e["image.url"]=j;let o=null,i=null,l=null;try{var c;if(G.a.vectorizer.value){const t=Object(W.b)();let r;if(t)i=t.activeObj,r=t.file,Re.current={width:r.width,height:r.height};else{if(!Re.current)return;{const e=he.b.fabricCanvas.getActiveObject();if(!e)return;i=e,r=Re.current}}if(l=i,Object(ee.m)(i.fill)){const{patternWorldMatrix:e}=Q.c.getObjPatternMatrix(i,i.fill);l=new a.t({width:r.width,height:r.height}),a.D.addTransformToObject(l,e)}const{file:c}=await Object(Y.g)(Object(n.a)(Object(n.a)({},e),{},{"output.size.width":r.width,"output.size.height":r.height,"output.size.unit":"px"}));o=c}else{const{file:t}=await Object(Y.g)(e);o=t}if(o){let e=await o.text();const t=(e=>{const t=(new DOMParser).parseFromString(e,"image/svg+xml");S.current=t;const r=[],n=new Set,a=new Map;return t.querySelectorAll("*").forEach((e=>{const t=e.getAttribute("fill");if(t&&"none"!==t&&"transparent"!==t){const o=t.toUpperCase();n.has(o)||(n.add(o),r.push(o));const i=r.indexOf(o);a.has(i)||a.set(i,[]),a.get(i).push({element:e,attr:"fill"})}})),I.current=a,r})(e);if(P.length>0&&(t.forEach(((e,t)=>{const r=k.current[t];r&&((e,t)=>{const r=S.current;if(!r)return;const n=I.current.get(e);if(!n||0===n.length)return;n.forEach((e=>{let{element:r,attr:n}=e;r.setAttribute(n,t)}));const a=(new XMLSerializer).serializeToString(r);O(a)})(t,r)})),e=S.current?(new XMLSerializer).serializeToString(S.current):"",o=new File([e],o.name,{type:"image/svg+xml"})),G.a.vectorizer.value){if(l&&i){const e=(await Object($.O)(o,!1)).objs;if(e.length){e[0].set({left:l.left||0,top:l.top||0,scaleX:l.scaleX||1,scaleY:l.scaleY||1,skewX:l.skewX||0,skewY:l.skewY||0,angle:l.angle||0});const t=he.b.fabricCanvas,r=J.a.fromObjects([i],"remove");let n=Object(ve.f)(i);const a=J.a.fromObjects(e,"add",!0,e.map(((e,t)=>({identity:Object(ve.a)(n,t)}))));let o=new K.a([r,a]);t.execute(o,{merge:!1})}}}else"dialog"===v&&await Object(Y.a)([o]);O(e),0===P.length?Le(t):E(C),Oe(!1),Object(me.a)(e).catch((e=>{console.error("Error uploading generated SVG:",e)}))}null===(c=Z.a.ornull)||void 0===c||c.merge((e=>({credits:e.credits-ne.d.VECTORIZING_PIXELS})))}catch(u){var s;console.error("error",u.response),403===(null===(s=u.response)||void 0===s?void 0:s.status)?t(h("editor.insufficient_credits"),{variant:"error"}):t(h("editor.pixel_vectorization_unavailable"),{variant:"error"})}finally{U.a.requesting.set(0)}}),6e4);return Object(ae.jsxs)(ae.Fragment,{children:[Object(ae.jsx)("style",{children:"\n\n.action-footer {\n width: 100%;\n\n .left {\n width: 450px !important;\n flex-shrink: 0;\n }\n}\n\n/* NOTE: Reset \u6309\u94ae\u901a\u8fc7 Portal \u6e32\u67d3\u5230 body\uff0c\u9700\u5168\u5c40\u6837\u5f0f */\n.vectorizer-reset-btn {\n display: inline-block;\n padding: 2px 8px;\n font-size: 11px;\n color: #fff;\n background-color: #45b017;\n border-radius: 3px;\n cursor: pointer;\n white-space: nowrap;\n user-select: none;\n}\n.vectorizer-reset-btn:hover {\n background-color: #3a9c12;\n}\n\n "}),Object(ae.jsx)(c.a,{container:!0,style:{height:"100%",overflow:"hidden"},children:Object(ae.jsxs)("div",{className:"vectorizer-main-area",children:[Object(ae.jsxs)("div",{className:"left",children:[_.length>0&&Object(ae.jsxs)(ae.Fragment,{children:[Object(ae.jsx)(c.a,{item:!0,container:!0,children:Object(ae.jsxs)(s.a,{focused:!1,style:{flexDirection:"row",alignItems:"center",gap:"8px"},children:[Object(ae.jsx)(u.a,{style:{marginBottom:0},children:h("vectorizing_pixels.number_colors","Number of Colors")}),Object(ae.jsx)(d.a,{type:"number",value:r["processing.max_colors"],onChange:e=>{let t=parseInt(e.target.value,10);isNaN(t)&&(t=0);const a=P.length;t>a&&(t=a),b(Object(n.a)(Object(n.a)({},r),{},{"processing.max_colors":t})),He(t)},onBlur:e=>{1===parseInt(e.target.value,10)&&(b(Object(n.a)(Object(n.a)({},r),{},{"processing.max_colors":2})),He(2))},inputProps:{min:0,max:P.length,style:{width:"48px",textAlign:"center"}},style:{width:"48px",margin:0}}),Object(ae.jsx)(u.a,{style:{marginBottom:0},children:"[0~".concat(P.length,"] ")+h("vectorizing_pixels.max_colors_hint","(0 for default)")})]})}),!de&&Object(ae.jsx)(c.a,{item:!0,container:!0,style:{overflow:"visible"},children:Object(ae.jsx)(s.a,{focused:!1,style:{overflow:"visible"},children:Object(ae.jsx)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",alignItems:"center",minHeight:"28px",paddingTop:"8px",paddingBottom:"8px",overflow:"visible"},children:_.map(((e,t)=>{const r=e,n=e.toUpperCase()!==(P[t]||"").toUpperCase();return Object(ae.jsx)("div",{className:"vectorizer-color-circle",onPointerDown:()=>{M.current=t,V.current=!0},ref:e=>{H.current[t]=e},onMouseEnter:e=>{if(!n)return;Ce();const r=e.currentTarget.getBoundingClientRect();
1ye({index:t,top:r.top-24,left:r.left+r.width/2})},onMouseLeave:Ee,style:{position:"relative",width:"24px",height:"24px"},children:Object(ae.jsx)(p.a,{title:n?"".concat(P[t]," \u2192 ").concat(e):e,arrow:!0,children:Object(ae.jsx)("div",{style:{width:"24px",height:"24px",borderRadius:"50%",backgroundColor:r,border:n?"2px solid #fff":"1px solid rgba(255,255,255,0.3)",cursor:"pointer",overflow:"hidden"},children:Object(ae.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0,display:"flex",alignItems:"center",justifyContent:"center"},children:Object(ae.jsx)(F.a,{color:r,disableOpacity:!0,style:{width:"100%",height:"100%",margin:0,boxSizing:"border-box"},onOpen:e=>{M.current=t,V.current=!1;const r=H.current[t];if(!r)return;const n=r.getBoundingClientRect(),a=()=>{const t=e._root.app;t&&(t.style.setProperty("right","auto","important"),t.style.setProperty("left","".concat(n.left,"px"),"important"),t.style.setProperty("top","".concat(n.bottom+10,"px"),"important"))};a(),requestAnimationFrame((()=>{a(),setTimeout(a,0)}))},onChange:e=>{if(V.current)return;const t=M.current;if(t<0)return;const r=[...k.current];r[t]=e,w(r)}})})})})},t)}))})})})]}),Object(ae.jsx)(c.a,{item:!0,container:!0,children:Object(ae.jsxs)(s.a,{focused:!1,children:[Object(ae.jsx)(u.a,{children:h("vectorizing_pixels.draw_style")}),Object(ae.jsx)(y,{name:"output.draw_style",onChange:Ve,value:r["output.draw_style"],children:[{value:"fill_shapes",label:h("vectorizing_pixels.fill_shapes")},{value:"stroke_shapes",label:h("vectorizing_pixels.stroke_shape")},{value:"stroke_edges",label:h("vectorizing_pixels.stroke_edge")}].map((e=>Object(ae.jsx)(z.a,{value:e.value,control:Object(ae.jsx)(N,{size:"small"}),label:e.label},e.value)))})]})}),Object(ae.jsxs)(c.a,{item:!0,container:!0,style:{flexDirection:"column"},children:[["fill_shapes","stroke_shapes"].includes(r["output.draw_style"])&&Object(ae.jsx)(c.a,{item:!0,container:!0,children:Object(ae.jsxs)(s.a,{focused:!1,children:[Object(ae.jsx)(u.a,{children:h("vectorizing_pixels.shape_stacking")}),Object(ae.jsxs)(y,{name:"output.shape_stacking",onChange:Ve,value:r["output.shape_stacking"],children:[Object(ae.jsx)(z.a,{value:"cutouts",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.shapes_below")}),Object(ae.jsx)(z.a,{value:"stacked",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.shapes_each_other")})]})]})}),["fill_shapes","stroke_shapes"].includes(r["output.draw_style"])&&Object(ae.jsx)(c.a,{item:!0,container:!0,children:Object(ae.jsxs)(s.a,{focused:!1,children:[Object(ae.jsx)(u.a,{children:h("vectorizing_pixels.group_by")}),Object(ae.jsxs)(y,{row:!0,name:"output.group_by",onChange:Ve,value:r["output.group_by"],children:[Object(ae.jsx)(z.a,{value:"none",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.group_none")}),Object(ae.jsx)(z.a,{value:"color",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.group_color")}),Object(ae.jsx)(z.a,{value:"parent",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.group_parent")}),Object(ae.jsx)(z.a,{value:"layer",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.group_layer")})]})]})}),["fill_shapes","stroke_shapes"].includes(r["output.draw_style"])&&Object(ae.jsx)(c.a,{item:!0,container:!0,children:Object(ae.jsxs)(s.a,{focused:!1,children:[Object(ae.jsx)(u.a,{children:h("vectorizing_pixels.parame_shapes")}),Object(ae.jsx)(m,{row:!0,children:Object(ae.jsx)(z.a,{control:Object(ae.jsx)(D.a,{size:"small",checked:r["output.parameterized_shapes.flatten"],onChange:Ne,name:"output.parameterized_shapes.flatten"}),label:h("vectorizing_pixels.parame_flatten")})})]})}),Object(ae.jsx)(c.a,{item:!0,container:!0,children:Object(ae.jsxs)(s.a,{focused:!1,children:[Object(ae.jsx)(u.a,{children:h("vectorizing_pixels.allow_type")}),Object(ae.jsxs)(m,{row:!0,children:[Object(ae.jsx)(z.a,{disabled:!0,control:Object(ae.jsx)(D.a,{size:"small",defaultChecked:!0}),label:h("vectorizing_pixels.allow_lines")}),Object(ae.jsx)(z.a,{control:Object(ae.jsx)(D.a,{size:"small",checked:r["output.curves.allowed.circular_arc"],onChange:Ne,name:"output.curves.allowed.circular_arc"}),label:h("vectorizing_pixels.allow_circular_arcs")}),Object(ae.jsx)(z.a,{control:Object(ae.jsx)(D.a,{size:"small",checked:r["output.curves.allowed.elliptical_arc"],onChange:Ne,name:"output.curves.allowed.elliptical_arc"}),label:h("vectorizing_pixels.allow_elliptical_arcs")}),Object(ae.jsx)(z.a,{control:Object(ae.jsx)(D.a,{size:"small",checked:r["output.curves.allowed.quadratic_bezier"],onChange:Ne,name:"output.curves.allowed.quadratic_bezier"}),label:h("vectorizing_pixels.allow_quadiatic_curves")}),Object(ae.jsx)(z.a,{control:Object(ae.jsx)(D.a,{size:"small",checked:r["output.curves.allowed.cubic_bezier"],onChange:Ne,name:"output.curves.allowed.cubic_bezier"}),label:h("vectorizing_pixels.allow_cubic_curves")})]})]})}),Object(ae.jsx)(c.a,{item:!0,container:!0,children:Object(ae.jsxs)(s.a,{focused:!1,children:[Object(ae.jsx)(u.a,{children:h("vectorizing_pixels.line_fit_tolerance")}),Object(ae.jsxs)(y,{row:!0,name:"output.curves.line_fit_tolerance",onChange:Ve,value:r["output.curves.line_fit_tolerance"],children:[Object(ae.jsx)(z.a,{value:"0.3",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.coarse")}),Object(ae.jsx)(z.a,{value:"0.1",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.medium")}),Object(ae.jsx)(z.a,{value:"0.03",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.fine")}),Object(ae.jsx)(z.a,{value:"0.01",control:Object(ae.jsx)(N,{size:"small"}),label:h("vectorizing_pixels.super_fine")})]})]})}),["fill_shapes"].includes(r["output.draw_style"])&&Object(ae.jsx)(c.a,{item:!0,container:!0,children:Object(ae.jsxs)(s.a,{focused:!1,children:[Object(ae.jsx)(u.a,{children:h("vectorizing_pixels.gap_filler")}),Object(ae.jsxs)(m,{row:!0,children:[Object(ae.jsx)(z.a,{control:Object(ae.jsx)(D.a,{size:"small",checked:r["output.gap_filler.enabled"],onChange:Ne,name:"output.gap_filler.enabled"}),label:h("vectorizing_pixels.fill_gaps")}),Object(ae.jsx)(z.a,{disabled:!r["output.gap_filler.enabled"],control:Object(ae.jsx)(D.a,{size:"small",onChange:Ne,name:"output.gap_filler.clip",checked:r["output.gap_filler.clip"]}),label:h("vectorizing_pixels.clip_overflow")}),Object(ae.jsx)(z.a,{disabled:!r["output.gap_filler.enabled"],control:Object(ae.jsx)(D.a,{size:"small",onChange:Ne,name:"output.gap_filler.non_scaling_stroke",checked:r["output.gap_filler.non_scaling_stroke"]}),label:h("vectorizing_pixels.non_scaling")}),Object(ae.jsx)(A.a,{disabled:!r["output.gap_filler.enabled"],min:0,max:5,step:.1,value:r["output.gap_filler.stroke_width"],onChange:(e,t)=>
1{b(Object(n.a)(Object(n.a)({},r),{},{"output.gap_filler.stroke_width":t}))},name:"output.gap_filler.stroke_width",valueLabelDisplay:"auto"})]})]})}),["stroke_shapes","stroke_edges"].includes(r["output.draw_style"])&&Object(ae.jsx)(c.a,{item:!0,container:!0,children:Object(ae.jsxs)(s.a,{focused:!1,children:[Object(ae.jsx)(u.a,{children:h("vectorizing_pixels.stroke_style")}),Object(ae.jsxs)(m,{row:!0,children:[Object(ae.jsx)(z.a,{control:Object(ae.jsx)(D.a,{size:"small",onChange:Ne,name:"output.strokes.non_scaling_stroke",checked:r["output.strokes.non_scaling_stroke"]}),label:h("vectorizing_pixels.non_scaling")}),Object(ae.jsx)(z.a,{control:Object(ae.jsx)(D.a,{size:"small",onChange:Ne,name:"output.strokes.use_override_color",checked:r["output.strokes.use_override_color"]}),label:h("vectorizing_pixels.override_color")}),Object(ae.jsx)(z.a,{control:Object(ae.jsx)("div",{style:{margin:"0 10px"},children:Object(ae.jsx)(F.a,{onChange:e=>{b(Object(n.a)(Object(n.a)({},r),{},{"output.strokes.override_color":e}))},disabled:!r["output.strokes.use_override_color"],color:r["output.strokes.override_color"]})}),label:r["output.strokes.override_color"]}),Object(ae.jsx)(A.a,{disabled:!r["output.strokes.use_override_color"],min:0,max:5,step:.1,value:r["output.strokes.stroke_width"],name:"output.strokes.stroke_width",valueLabelDisplay:"auto",onChange:(e,t)=>
1{b(Object(n.a)(Object(n.a)({},r),{},{"output.strokes.stroke_width":t}))}})]})]})})]}),(0===_.length||de)&&Object(ae.jsx)("div",{children:Object(ae.jsx)(p.a,{title:h("vectorizing_pixels.enable_color_simplify_tooltip","Limits the number of colors"),placement:"top",children:Object(ae.jsxs)(T.a,{variant:"outlined",disabled:!j,onClick:Ae,style:{textTransform:"none"},children:[h("vectorizing_pixels.enable_color_simplify","Simplify Colors"),Object(ae.jsx)(ge.a,{style:{width:Se.spacing(2.5),height:Se.spacing(2.5),margin:"0 8px"}}),De()]})})})]}),Object(ae.jsx)("div",{className:"right",children:Object(ae.jsxs)(c.a,{item:!0,style:{width:"100%",height:"100%",padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #4b5564",position:"relative",borderRadius:"8px"},children:[!x&&Object(ae.jsx)("div",{className:"image-container",onDragEnter:e=>{e.preventDefault(),e.stopPropagation()},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDragLeave:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{var t;if(e.preventDefault(),e.stopPropagation(),null!==e&&void 0!==e&&null!==(t=e.dataTransfer)&&void 0!==t&&t.files){var r;const t=null===e||void 0===e||null===(r=e.dataTransfer)||void 0===r?void 0:r.files[0];Me(t)}},children:j?Object(ae.jsx)("img",{src:j,alt:h("vectorizing_pixels.title"),loading:"lazy",style:{width:"100%",height:"100%",objectFit:"contain"}}):Object(ae.jsxs)("div",{style:{display:"flex",width:"100%",height:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[Object(ae.jsx)(je.a,{style:{width:"32px",height:"32px"},onClick:async()=>{const e=await Object(se.a)({mimeTypes:["image/jpg","image/png"],extensions:[".jpg",".jpeg",".png"]});Me(e)}}),Object(ae.jsx)("div",{style:{color:"rgba(255, 255, 255, 0.7)"},children:h("outpainting.upload_drag_label")})]})}),x&&Object(ae.jsx)(oe,{ref:Ie,svgString:x}),x&&Object(ae.jsxs)("div",{className:"footer-buttons",children:[Object(ae.jsx)("div",{className:"button",children:Object(ae.jsx)(p.a,{title:h("ai_face_swap.zoom_in"),children:Object(ae.jsx)(ie.a,{className:"icon",onClick:()=>{var e;return null===(e=Ie.current)||void 0===e?void 0:e.zoomIn()},style:{color:"#45B017",width:"20px",height:"20px"}})})}),Object(ae.jsx)("div",{className:"button",children:Object(ae.jsx)(p.a,{title:h("ai_face_swap.zoom_out"),children:Object(ae.jsx)(le.a,{className:"icon",onClick:()=>{var e;return null===(e=Ie.current)||void 0===e?void 0:e.zoomOut()},style:{color:"#45B017",width:"20px",height:"20px"}})})})]})]})})]})}),Object(ae.jsxs)("div",{className:"action-footer",children:[Object(ae.jsx)("div",{className:"left"}),Object(ae.jsxs)("div",{className:"right",style:{justifyContent:"space-between"},children:[Object(ae.jsxs)("div",{style:{display:"flex"},children:[Object(ae.jsxs)(T.a,{variant:"outlined",color:"default",onClick:async()=>{const e=await Object(se.a)({mimeTypes:["image/jpg","image/png"],extensions:[".jpg",".jpeg",".png"]});Me(e)},children:[Object(ae.jsx)(ce.a,{style:{width:Se.spacing(2.5),height:Se.spacing(2.5),marginRight:"16px"}}),h("crystal-upscaler.upload_label")]}),Object(ae.jsx)(T.a,{variant:"outlined",style:{marginLeft:"12px"},onClick:()=>{b(xe),P.length&&(w([...P]),E([...P]))},children:h("components.button.reset")})]}),Object(ae.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[x&&Object(ae.jsxs)(ae.Fragment,{children:[Object(ae.jsx)(T.a,{style:{marginRight:"12px"},variant:"outlined",onClick:async()=>{(async()=>{try{const e=(new TextEncoder).encode(x),t="".concat(Object(be.a)(),".svg"),r=new File([e],t,{type:"image/svg+xml"});pe.a.saveAs(r,t)}catch(e){t(h("components.notify.save_failed"),{variant:"error"})}})()},children:h("editor.download")}),"page"===v&&Object(ae.jsx)(T.a,{style:{marginRight:"12px"},variant:"outlined",onClick:async()=>{const e=(new TextEncoder).encode(x),t="".concat(Object(be.a)(),".svg"),r=new File([e],t,{type:"image/svg+xml"});Object(fe.e)(r,"Vectorizer")},children:h("editor.edit-vector")})]}),Object(ae.jsxs)(T.a,{variant:"outlined",disabled:!j,onClick:Ae,children:[h("ai_vector_generatot.vectorize"),Object(ae.jsx)(ge.a,{style:{width:Se.spacing(2.5),height:Se.spacing(2.5),margin:"0 8px"}}),De()]})]})]})]}),we&&Object(i.createPortal)(Object(ae.jsx)("span",{style:{position:"fixed",top:we.top,left
1:we.left,transform:"translateX(-50%)",zIndex:9999},className:"vectorizer-reset-btn",onMouseEnter:()=>{ke.current=!0,Ce()},onMouseLeave:()=>{ke.current=!1,Ee()},onClick:e=>{e.stopPropagation();const t=we.index,r=P[t]||"";if(r){const e=[...k.current];e[t]=r,w(e)}ye(null)},children:h("vectorizing_pixels.reset_color","Reset")}),document.body)]})}},891:function(e,t,r){"use strict";r.r(t);var n=r(36),a=r(452),o=r(646),i=r(3);t.default=function(){var e=Object(n.g)();return Object(i.jsx)(a.c,{mode:"page",onClose:function(){return e.push("/design")},children:Object(i.jsx)(o.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.