IOPaint/lama_cleaner/app/build/static/js/main.924b1592.chunk.js

1 line
65 KiB
JavaScript
Raw Normal View History

2022-11-08 01:36:33 +01:00
(this["webpackJsonplama-cleaner"]=this["webpackJsonplama-cleaner"]||[]).push([[0],{65:function(e,t,n){},72:function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),c=n(12),i=n.n(c),o=(n(65),n(6)),s=n(3),l=n(56),u=n(9),d=n.n(u),b=n(13);var j=n(16),h=n(1),f=Object(o.b)({key:"themeState",default:"dark"}),p=function(){var e=Object(o.d)(f),t=Object(s.a)(e,2),n=t[0],a=t[1];return Object(h.jsx)("div",{className:"theme-toggle-ui",children:Object(h.jsx)("div",{className:"theme-btn",onClick:function(){a("light"===n?"dark":"light")},role:"button",tabIndex:0,"aria-hidden":"true",children:"light"===n?Object(h.jsx)(j.h,{}):Object(h.jsx)(j.i,{style:{color:"#ffcc00"}})})})},O=n(2),g=n(8),v=n(51),m=n(81),x=n(54),w=n(82),y=n(7);function S(e){for(var t=e.split(",")[0].split(":")[1].split(";")[0],n=atob(e.split(",")[1]),a=[],r=0;r<n.length;r+=1)a.push(n.charCodeAt(r));return new Blob([new Uint8Array(a)],{type:t})}function k(e,t){return new Promise((function(n,a){var r=e.src,c=e;c.onload=n,c.onerror=function(e){c.src=r,a(e)},c.src=t}))}function C(e){return 1===e.nativeEvent.button}function L(e,t,n){return fetch(e).then((function(e){return e.arrayBuffer()})).then((function(e){return new File([e],t,{type:n})}))}function M(){return N.apply(this,arguments)}function N(){return(N=Object(b.a)(d.a.mark((function e(){var t,n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.permissions.query({name:"clipboard-write"});case 3:return t=e.sent,n=t.state,e.abrupt("return","granted"===n);case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}function I(e,t){return new Promise((function(n,a){return e.toBlob(function(){var e=Object(b.a)(d.a.mark((function e(t){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t?n(t):a(new Error("Expected toBlob() to be defined"));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t)}))}var z=function(){var e=Object(b.a)(d.a.mark((function e(t){var n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[new ClipboardItem(Object(y.a)({},t.type,t))],e.next=3,navigator.clipboard.write(n);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function E(e){return D.apply(this,arguments)}function D(){return(D=Object(b.a)(d.a.mark((function e(t){var n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I(t,"image/png");case 2:return n=e.sent,e.prev=3,e.next=6,z(n);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.log("Copy image failed!");case 11:case"end":return e.stop()}}),e,null,[[3,8]])})))).apply(this,arguments)}var T="".concat("");function R(e,t,n,a,r,c,i){return F.apply(this,arguments)}function F(){return(F=Object(b.a)(d.a.mark((function e(t,n,a,r,c,i,o){var s,l,u,b,j,h;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(s=new FormData).append("image",t),l=S(n),s.append("mask",l),u=a.hdSettings[a.model],s.append("ldmSteps",a.ldmSteps.toString()),s.append("ldmSampler",a.ldmSampler.toString()),s.append("zitsWireframe",a.zitsWireframe.toString()),s.append("hdStrategy",u.hdStrategy),s.append("hdStrategyCropMargin",u.hdStrategyCropMargin.toString()),s.append("hdStrategyCropTrigerSize",u.hdStrategyCropTrigerSize.toString()),s.append("hdStrategyResizeLimit",u.hdStrategyResizeLimit.toString()),s.append("prompt",void 0===c?"":c),s.append("croperX",r.x.toString()),s.append("croperY",r.y.toString()),s.append("croperHeight",r.height.toString()),s.append("croperWidth",r.width.toString()),s.append("useCroper",a.showCroper?"true":"false"),s.append("sdMaskBlur",a.sdMaskBlur.toString()),s.append("sdStrength",a.sdStrength.toString()),s.append("sdSteps",a.sdSteps.toString()),s.append("sdGuidanceScale",a.sdGuidanceScale.toString()),s.append("sdSampler",a.sdSampler.toString()),s.append("sdSeed",o?o.toString():"-1"),s.append("cv2Radius",a.cv2Radius.toString()),s.append("cv2Flag",a.cv2Flag.toString()),void 0===i?s.append("sizeLimit