From 31a25ba21713e97e4ac0df689f18deaf7496bfcc Mon Sep 17 00:00:00 2001 From: Ahmed Khallaf Date: Mon, 4 Jan 2021 10:52:05 +0200 Subject: [PATCH] =?UTF-8?q?Chore:=20Release=20a=20new=20version=20v3.12.10?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ README.md | 4 ++-- build/{3.12.9 => 3.12.10}/filerobot-image-editor.min.js | 8 ++++---- build/3/filerobot-image-editor.min.js | 8 ++++---- examples/js/src/index.html | 2 +- package.json | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) rename build/{3.12.9 => 3.12.10}/filerobot-image-editor.min.js (59%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cd58b13..a4e201ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,10 @@ Types of changes: - ... ------------- +## 3.12.10 - 2020-1-4 +### Added +- Close button (x) at the top left of the editor. + ## 3.12.9 - 2020-12-23 ### Fixed - Watermark's text font selection is now updated with the chosen text font. diff --git a/README.md b/README.md index c3493fdb..e2354116 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ > Repository includes React version and Vanilla JS adapter for standalone usage -[![Release](https://img.shields.io/badge/release-v3.12.9-blue.svg)](https://github.com/scaleflex/filerobot-image-editor/releases) +[![Release](https://img.shields.io/badge/release-v3.12.10-blue.svg)](https://github.com/scaleflex/filerobot-image-editor/releases) [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](#contributing) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Scaleflex team](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-the%20Scaleflex%20team-6986fa.svg)](https://www.scaleflex.it/en/home) @@ -140,7 +140,7 @@ or use your custom color scheme Use the latest CDNized plugin version: ```html - + ``` ### Quick start diff --git a/build/3.12.9/filerobot-image-editor.min.js b/build/3.12.10/filerobot-image-editor.min.js similarity index 59% rename from build/3.12.9/filerobot-image-editor.min.js rename to build/3.12.10/filerobot-image-editor.min.js index 9eaa4bf9..23094c3b 100644 --- a/build/3.12.9/filerobot-image-editor.min.js +++ b/build/3.12.10/filerobot-image-editor.min.js @@ -1,14 +1,14 @@ /*! * - * filerobot-image-editor v3.12.9 + * filerobot-image-editor v3.12.10 * https://github.com/scaleflex/filerobot-image-editor * * Copyright (c) 2019 scaleflex * Released under the MIT license * - * Date: 2020-12-23T06:54:55.099Z + * Date: 2021-01-04T08:51:05.866Z * - */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="https://cdn.scaleflex.it/plugins/filerobot-image-editor/3.12.9/",n(n.s=71)}([function(e,t,n){"use strict";e.exports=n(24)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Ve}));var r=n(7),o=n.n(r),i=n(14),a=n.n(i),l=n(0),c=n.n(l),s=n(15),u=n(8),f=n(9),p=(n(28),n(21)),d=n(22),h=function(e,t){for(var n=[e[0]],r=0,o=t.length;r1?r-1:0),i=1;i0?" Additional arguments: "+o.join(", "):"")));return w(a)}return y(t,e),t}(Error),R=/^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,D=function(e){var t=""+(e||""),n=[];return t.replace(R,(function(e,t,r){return n.push({componentId:t,matchIndex:r}),e})),n.map((function(e,r){var o=e.componentId,i=e.matchIndex,a=n[r+1];return{componentId:o,cssFromDOM:a?t.slice(i,a.matchIndex):t.slice(i)}}))},M=/^\s*\/\/.*$/gm,A=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!1,compress:!1,semicolon:!0}),I=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!1}),z=[],B=function(e){if(-2===e){var t=z;return z=[],t}},L=a()((function(e){z.push(e)})),N=void 0,F=void 0,U=void 0,H=function(e,t,n){return t>0&&-1!==n.slice(0,t).indexOf(F)&&n.slice(t-F.length,t)!==F?"."+N:e};I.use([function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(F)>0&&(n[0]=n[0].replace(U,H))},L,B]),A.use([L,B]);var W=function(e){return A("",e)};function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(M,""),i=t&&n?n+" "+t+" { "+o+" }":o;return N=r,F=t,U=new RegExp("\\"+F+"\\b","g"),I(n||!t?"":t,i)}var V=function(){return n.nc},X=function(e,t,n){n&&((e[t]||(e[t]=Object.create(null)))[n]=!0)},q=function(e,t){e[t]=Object.create(null)},$=function(e){return function(t,n){return void 0!==e[t]&&e[t][n]}},Q=function(e){var t="";for(var n in e)t+=Object.keys(e[n]).join(" ")+" ";return t.trim()},K=function(e){if(e.sheet)return e.sheet;for(var t=e.ownerDocument.styleSheets.length,n=0;n"+e()+""}},te=function(e,t){return function(){var n,r=((n={})[_]=Q(t),n["data-styled-version"]="4.4.1",n),o=V();return o&&(r.nonce=o),c.a.createElement("style",v({},r,{dangerouslySetInnerHTML:{__html:e()}}))}},ne=function(e){return function(){return Object.keys(e)}},re=function(e,t){return e.createTextNode(G(t))},oe=function e(t,n){var r=void 0===t?Object.create(null):t,o=void 0===n?Object.create(null):n,i=function(e){var t=o[e];return void 0!==t?t:o[e]=[""]},a=function(){var e="";for(var t in o){var n=o[t][0];n&&(e+=G(t)+n)}return e};return{clone:function(){var t=function(e){var t=Object.create(null);for(var n in e)t[n]=v({},e[n]);return t}(r),n=Object.create(null);for(var i in o)n[i]=[o[i][0]];return e(t,n)},css:a,getIds:ne(o),hasNameForId:$(r),insertMarker:i,insertRules:function(e,t,n){i(e)[0]+=t.join(" "),X(r,e,n)},removeRules:function(e){var t=o[e];void 0!==t&&(t[0]="",q(r,e))},sealed:!1,styleTag:null,toElement:te(a,r),toHTML:ee(a,r)}},ie=function(e,t,n,r,o){if(P&&!n){var i=function(e,t,n){var r=document;e?r=e.ownerDocument:t&&(r=t.ownerDocument);var o=r.createElement("style");o.setAttribute(_,""),o.setAttribute("data-styled-version","4.4.1");var i=V();if(i&&o.setAttribute("nonce",i),o.appendChild(r.createTextNode("")),e&&!t)e.appendChild(o);else{if(!t||!e||!t.parentNode)throw new j(6);t.parentNode.insertBefore(o,n?t:t.nextSibling)}return o}(e,t,r);return T?function(e,t){var n=Object.create(null),r=Object.create(null),o=void 0!==t,i=!1,a=function(t){var o=r[t];return void 0!==o?o:(r[t]=re(e.ownerDocument,t),e.appendChild(r[t]),n[t]=Object.create(null),r[t])},l=function(){var e="";for(var t in r)e+=r[t].data;return e};return{clone:function(){throw new j(5)},css:l,getIds:ne(r),hasNameForId:$(n),insertMarker:a,insertRules:function(e,r,l){for(var c=a(e),s=[],u=r.length,f=0;f0&&(i=!0,t().insertRules(e+"-import",s))},removeRules:function(a){var l=r[a];if(void 0!==l){var c=re(e.ownerDocument,a);e.replaceChild(c,l),r[a]=c,q(n,a),o&&i&&t().removeRules(a+"-import")}},sealed:!1,styleTag:e,toElement:te(l,n),toHTML:ee(l,n)}}(i,o):function(e,t){var n=Object.create(null),r=Object.create(null),o=[],i=void 0!==t,a=!1,l=function(e){var t=r[e];return void 0!==t?t:(r[e]=o.length,o.push(0),q(n,e),r[e])},c=function(){var t=K(e).cssRules,n="";for(var i in r){n+=G(i);for(var a=r[i],l=J(o,a),c=l-o[a];c0&&(a=!0,t().insertRules(r+"-import",h)),o[u]+=d,X(n,r,s)},removeRules:function(l){var c=r[l];if(void 0!==c&&!1!==e.isConnected){var s=o[c];!function(e,t,n){for(var r=t-n,o=t;o>r;o-=1)e.deleteRule(o)}(K(e),J(o,c)-1,s),o[c]=0,q(n,l),i&&a&&t().removeRules(l+"-import")}},sealed:!1,styleTag:e,toElement:te(c,n),toHTML:ee(c,n)}}(i,o)}return oe()},ae=/\s+/,le=void 0;le=P?T?40:1e3:-1;var ce=0,se=void 0,ue=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P?document.head:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g(this,e),this.getImportRuleTag=function(){var e=t.importRuleTag;if(void 0!==e)return e;var n=t.tags[0];return t.importRuleTag=ie(t.target,n?n.styleTag:null,t.forceServer,!0)},ce+=1,this.id=ce,this.forceServer=r,this.target=r?null:n,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!P||this.forceServer)return this;var e=[],t=[],n=!1,r=document.querySelectorAll("style["+_+'][data-styled-version="4.4.1"]'),o=r.length;if(!o)return this;for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];se=new e(void 0,t).rehydrate()},e.prototype.clone=function(){var t=new e(this.target,this.forceServer);return this.clones.push(t),t.tags=this.tags.map((function(e){for(var n=e.getIds(),r=e.clone(),o=0;o1?t-1:0),r=1;r=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return((r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16))^r>>>15)>>>0}var we=function(e){return String.fromCharCode(e+(e>25?39:97))};function xe(e){var t="",n=void 0;for(n=e;n>52;n=Math.floor(n/52))t=we(n%52)+t;return we(n%52)+t}function ke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:S,r=!!n&&e.theme===n.theme,o=e.theme&&!r?e.theme:t||n.theme;return o},_e=/[[\].#*$><+~=|^:(),"'`-]+/g,Pe=/(^-|-$)/g;function Te(e){return e.replace(_e,"-").replace(Pe,"")}function je(e){return"string"==typeof e&&!0}var Re={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},De={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Me=((Se={})[u.ForwardRef]={$$typeof:!0,render:!0},Se),Ae=Object.defineProperty,Ie=Object.getOwnPropertyNames,ze=Object.getOwnPropertySymbols,Be=void 0===ze?function(){return[]}:ze,Le=Object.getOwnPropertyDescriptor,Ne=Object.getPrototypeOf,Fe=Object.prototype,Ue=Array.prototype;function He(e,t,n){if("string"!=typeof t){var r=Ne(t);r&&r!==Fe&&He(e,r,n);for(var o=Ue.concat(Ie(t),Be(t)),i=Me[e.$$typeof]||Re,a=Me[t.$$typeof]||Re,l=o.length,c=void 0,s=void 0;l--;)if(s=o[l],!(De[s]||n&&n[s]||a&&a[s]||i&&i[s])&&(c=Le(t,s)))try{Ae(e,s,c)}catch(e){}return e}return e}var We=Object(l.createContext)(),Ye=We.Consumer,Ve=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext.bind(r)),r.renderInner=r.renderInner.bind(r),r}return y(t,e),t.prototype.render=function(){return this.props.children?c.a.createElement(We.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(e){var t=this.getContext(this.props.theme,e);return c.a.createElement(We.Provider,{value:t},this.props.children)},t.prototype.getTheme=function(e,t){if(C(e))return e(t);if(null===e||Array.isArray(e)||"object"!==(void 0===e?"undefined":m(e)))throw new j(8);return v({},t,e)},t.prototype.getContext=function(e,t){return this.getTheme(e,t)},t}(l.Component),Xe=(function(){function e(){g(this,e),this.masterSheet=ue.master,this.instance=this.masterSheet.clone(),this.sealed=!1}e.prototype.seal=function(){if(!this.sealed){var e=this.masterSheet.clones.indexOf(this.instance);this.masterSheet.clones.splice(e,1),this.sealed=!0}},e.prototype.collectStyles=function(e){if(this.sealed)throw new j(2);return c.a.createElement($e,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.seal(),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.seal(),this.instance.toReactElements()},e.prototype.interleaveWithNodeStream=function(e){throw new j(3)}}(),Object(l.createContext)()),qe=Xe.Consumer,$e=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext),r}return y(t,e),t.prototype.getContext=function(e,t){if(e)return e;if(t)return new ue(t);throw new j(4)},t.prototype.render=function(){var e=this.props,t=e.children,n=e.sheet,r=e.target;return c.a.createElement(Xe.Provider,{value:this.getContext(n,r)},t)},t}(l.Component),Qe={};var Ke=function(e){function t(){g(this,t);var n=w(this,e.call(this));return n.attrs={},n.renderOuter=n.renderOuter.bind(n),n.renderInner=n.renderInner.bind(n),n}return y(t,e),t.prototype.render=function(){return c.a.createElement(qe,null,this.renderOuter)},t.prototype.renderOuter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue.master;return this.styleSheet=e,this.props.forwardedComponent.componentStyle.isStatic?this.renderInner():c.a.createElement(Ye,null,this.renderInner)},t.prototype.renderInner=function(e){var t=this.props.forwardedComponent,n=t.componentStyle,r=t.defaultProps,o=(t.displayName,t.foldedComponentIds),i=t.styledComponentId,a=t.target,c=void 0;c=n.isStatic?this.generateAndInjectStyles(S,this.props):this.generateAndInjectStyles(Oe(this.props,e,r)||S,this.props);var s=this.props.as||this.attrs.as||a,u=je(s),f={},d=v({},this.props,this.attrs),h=void 0;for(h in d)"forwardedComponent"!==h&&"as"!==h&&("forwardedRef"===h?f.ref=d[h]:"forwardedAs"===h?f.as=d[h]:u&&!Object(p.a)(h)||(f[h]=d[h]));return this.props.style&&this.attrs.style&&(f.style=v({},this.attrs.style,this.props.style)),f.className=Array.prototype.concat(o,i,c!==i?c:null,this.props.className,this.attrs.className).filter(Boolean).join(" "),Object(l.createElement)(s,f)},t.prototype.buildExecutionContext=function(e,t,n){var r=this,o=v({},t,{theme:e});return n.length?(this.attrs={},n.forEach((function(e){var t,n=e,i=!1,a=void 0,l=void 0;for(l in C(n)&&(n=n(o),i=!0),n)a=n[l],i||!C(a)||(t=a)&&t.prototype&&t.prototype.isReactComponent||O(a)||(a=a(o)),r.attrs[l]=a,o[l]=a})),o):o},t.prototype.generateAndInjectStyles=function(e,t){var n=t.forwardedComponent,r=n.attrs,o=n.componentStyle;n.warnTooManyClasses;return o.isStatic&&!r.length?o.generateAndInjectStyles(S,this.styleSheet):o.generateAndInjectStyles(this.buildExecutionContext(e,t,r),this.styleSheet)},t}(l.Component);function Ze(e,t,n){var r=O(e),o=!je(e),i=t.displayName,a=void 0===i?function(e){return je(e)?"styled."+e:"Styled("+E(e)+")"}(e):i,l=t.componentId,s=void 0===l?function(e,t,n){var r="string"!=typeof t?"sc":Te(t),o=(Qe[r]||0)+1;Qe[r]=o;var i=r+"-"+e.generateName(r+o);return n?n+"-"+i:i}(Ee,t.displayName,t.parentComponentId):l,u=t.ParentComponent,f=void 0===u?Ke:u,p=t.attrs,h=void 0===p?k:p,m=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||s,g=r&&e.attrs?Array.prototype.concat(e.attrs,h).filter(Boolean):h,b=new Ee(r?e.componentStyle.rules.concat(n):n,g,m),y=void 0,w=function(e,t){return c.a.createElement(f,v({},e,{forwardedComponent:y,forwardedRef:t}))};return w.displayName=a,(y=c.a.forwardRef(w)).displayName=a,y.attrs=g,y.componentStyle=b,y.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):k,y.styledComponentId=m,y.target=r?e.target:e,y.withComponent=function(e){var r=t.componentId,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["componentId"]),i=r&&r+"-"+(je(e)?e:Te(E(e)));return Ze(e,v({},o,{attrs:g,componentId:i,ParentComponent:f}),n)},Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Object(d.a)(e.defaultProps,t):t}}),y.toString=function(){return"."+y.styledComponentId},o&&He(y,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,styledComponentId:!0,target:!0,withComponent:!0}),y}var Ge=function(e){return function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;if(!Object(u.isValidElementType)(n))throw new j(1,String(n));var o=function(){return t(n,r,ve.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,v({},r,o))},o.attrs=function(o){return e(t,n,v({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Ge[e]=Ge(e)}));!function(){function e(t,n){g(this,e),this.rules=t,this.componentId=n,this.isStatic=ke(t,k),ue.master.hasId(n)||ue.master.deferredInject(n,[])}e.prototype.createStyles=function(e,t){var n=Y(be(this.rules,e,t),"");t.inject(this.componentId,n)},e.prototype.removeStyles=function(e){var t=this.componentId;e.hasId(t)&&e.remove(t)},e.prototype.renderStyles=function(e,t){this.removeStyles(t),this.createStyles(e,t)}}();P&&(window.scCGSHMRCache={});t.b=Ge}).call(this,n(12))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1?n-1:0),o=1;o255?255:e}},{key:"copyAttributes",value:function(e,t,n){return null==n&&(n={}),function(){for(var r=[],o=0,i=Array.from(e.attributes);oe?d():!0!==t&&(o=setTimeout(r?h:d,void 0===r?e-p:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),c.cancel=function(){l(),i=!0},c}e.debounce=function(e,n,r){return void 0===r?t(e,n,!1):t(e,r,!1!==n)},e.throttle=t,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(23)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n])/g,v=/([[}=:>])\s+/g,y=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,x=/([^\(])(:+) */g,k=/[svh]\w+-[tblr]{2}/,S=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,E=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,T="-webkit-",j="-moz-",R="-ms-",D=59,M=125,A=123,I=40,z=41,B=10,L=13,N=32,F=45,U=42,H=44,W=58,Y=47,V=1,X=1,q=0,$=1,Q=1,K=1,Z=0,G=0,J=0,ee=[],te=[],ne=0,re=null,oe=0,ie=1,ae="",le="",ce="";function se(e,t,o,i,a){for(var l,c,u=0,f=0,p=0,d=0,b=0,v=0,y=0,w=0,k=0,C=0,E=0,O=0,_=0,P=0,j=0,R=0,Z=0,te=0,re=0,fe=o.length,be=fe-1,ve="",ye="",we="",xe="",ke="",Se="";j0&&(ye=ye.replace(r,"")),ye.trim().length>0)){switch(y){case N:case 9:case D:case L:case B:break;default:ye+=o.charAt(j)}y=D}if(1===Z)switch(y){case A:case M:case D:case 34:case 39:case I:case z:case H:Z=0;case 9:case L:case B:case N:break;default:for(Z=0,re=j,b=y,j--,y=D;re0&&(++j,y=b);case A:re=fe}}switch(y){case A:for(b=(ye=ye.trim()).charCodeAt(0),E=1,re=++j;j0&&(ye=ye.replace(r,"")),v=ye.charCodeAt(1)){case 100:case 109:case 115:case F:l=t;break;default:l=ee}if(re=(we=se(t,l,we,v,a+1)).length,J>0&&0===re&&(re=ye.length),ne>0&&(c=me(3,we,l=ue(ee,ye,te),t,X,V,re,v,a,i),ye=l.join(""),void 0!==c&&0===(re=(we=c.trim()).length)&&(v=0,we="")),re>0)switch(v){case 115:ye=ye.replace(S,he);case 100:case 109:case F:we=ye+"{"+we+"}";break;case 107:we=(ye=ye.replace(h,"$1 $2"+(ie>0?ae:"")))+"{"+we+"}",we=1===Q||2===Q&&de("@"+we,3)?"@"+T+we+"@"+we:"@"+we;break;default:we=ye+we,112===i&&(xe+=we,we="")}else we="";break;default:we=se(t,ue(t,ye,te),we,i,a+1)}ke+=we,O=0,Z=0,P=0,R=0,te=0,_=0,ye="",we="",y=o.charCodeAt(++j);break;case M:case D:if((re=(ye=(R>0?ye.replace(r,""):ye).trim()).length)>1)switch(0===P&&((b=ye.charCodeAt(0))===F||b>96&&b<123)&&(re=(ye=ye.replace(" ",":")).length),ne>0&&void 0!==(c=me(1,ye,t,e,X,V,xe.length,i,a,i))&&0===(re=(ye=c.trim()).length)&&(ye="\0\0"),b=ye.charCodeAt(0),v=ye.charCodeAt(1),b){case 0:break;case 64:if(105===v||99===v){Se+=ye+o.charAt(j);break}default:if(ye.charCodeAt(re-1)===W)break;xe+=pe(ye,b,v,ye.charCodeAt(2))}O=0,Z=0,P=0,R=0,te=0,ye="",y=o.charCodeAt(++j)}}switch(y){case L:case B:if(f+d+p+u+G===0)switch(C){case z:case 39:case 34:case 64:case 126:case 62:case U:case 43:case Y:case F:case W:case H:case D:case A:case M:break;default:P>0&&(Z=1)}f===Y?f=0:$+O===0&&107!==i&&ye.length>0&&(R=1,ye+="\0"),ne*oe>0&&me(0,ye,t,e,X,V,xe.length,i,a,i),V=1,X++;break;case D:case M:if(f+d+p+u===0){V++;break}default:switch(V++,ve=o.charAt(j),y){case 9:case N:if(d+u+f===0)switch(w){case H:case W:case 9:case N:ve="";break;default:y!==N&&(ve=" ")}break;case 0:ve="\\0";break;case 12:ve="\\f";break;case 11:ve="\\v";break;case 38:d+f+u===0&&$>0&&(te=1,R=1,ve="\f"+ve);break;case 108:if(d+f+u+q===0&&P>0)switch(j-P){case 2:112===w&&o.charCodeAt(j-3)===W&&(q=w);case 8:111===k&&(q=k)}break;case W:d+f+u===0&&(P=j);break;case H:f+p+d+u===0&&(R=1,ve+="\r");break;case 34:case 39:0===f&&(d=d===y?0:0===d?y:d);break;case 91:d+f+p===0&&u++;break;case 93:d+f+p===0&&u--;break;case z:d+f+u===0&&p--;break;case I:if(d+f+u===0){if(0===O)switch(2*w+3*k){case 533:break;default:E=0,O=1}p++}break;case 64:f+p+d+u+P+_===0&&(_=1);break;case U:case Y:if(d+u+p>0)break;switch(f){case 0:switch(2*y+3*o.charCodeAt(j+1)){case 235:f=Y;break;case 220:re=j,f=U}break;case U:y===Y&&w===U&&re+2!==j&&(33===o.charCodeAt(re+2)&&(xe+=o.substring(re,j+1)),ve="",f=0)}}if(0===f){if($+d+u+_===0&&107!==i&&y!==D)switch(y){case H:case 126:case 62:case 43:case z:case I:if(0===O){switch(w){case 9:case N:case B:case L:ve+="\0";break;default:ve="\0"+ve+(y===H?"":"\0")}R=1}else switch(y){case I:P+7===j&&108===w&&(P=0),O=++E;break;case z:0==(O=--E)&&(R=1,ve+="\0")}break;case 9:case N:switch(w){case 0:case A:case M:case D:case H:case 12:case 9:case N:case B:case L:break;default:0===O&&(R=1,ve+="\0")}}ye+=ve,y!==N&&9!==y&&(C=y)}}k=w,w=y,j++}if(re=xe.length,J>0&&0===re&&0===ke.length&&0===t[0].length==0&&(109!==i||1===t.length&&($>0?le:ce)===t[0])&&(re=t.join(",").length+2),re>0){if(l=0===$&&107!==i?function(e){for(var t,n,o=0,i=e.length,a=Array(i);o1)){if(p=c.charCodeAt(c.length-1),d=n.charCodeAt(0),t="",0!==u)switch(p){case U:case 126:case 62:case 43:case N:case I:break;default:t=" "}switch(d){case 38:n=t+le;case 126:case 62:case 43:case N:case z:case I:break;case 91:n=t+n+le;break;case W:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(K>0){n=t+n.substring(8,f-1);break}default:(u<1||l[u-1].length<1)&&(n=t+le+n)}break;case H:t="";default:n=f>1&&n.indexOf(":")>0?t+n.replace(x,"$1"+le+"$2"):t+n+le}c+=n}a[o]=c.replace(r,"").trim()}return a}(t):t,ne>0&&void 0!==(c=me(2,xe,l,e,X,V,re,i,a,i))&&0===(xe=c).length)return Se+xe+ke;if(xe=l.join(",")+"{"+xe+"}",Q*q!=0){switch(2!==Q||de(xe,2)||(q=0),q){case 111:xe=xe.replace(g,":-moz-$1")+xe;break;case 112:xe=xe.replace(m,"::"+T+"input-$1")+xe.replace(m,"::-moz-$1")+xe.replace(m,":-ms-input-$1")+xe}q=0}}return Se+xe+ke}function ue(e,t,n){var r=t.trim().split(u),o=r,i=r.length,a=e.length;switch(a){case 0:case 1:for(var l=0,c=0===a?"":e[0]+" ";l0&&$>0)return o.replace(p,"$1").replace(f,"$1"+ce);break;default:return e.trim()+o.replace(f,"$1"+e.trim())}default:if(n*$>0&&o.indexOf("\f")>0)return o.replace(f,(e.charCodeAt(0)===W?"":"$1")+e.trim())}return e+o}function pe(e,t,n,r){var s,u=0,f=e+";",p=2*t+3*n+4*r;if(944===p)return function(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim();switch(e.charCodeAt(9)*ie){case 0:break;case F:if(110!==e.charCodeAt(10))break;default:var i=o.split((o="",l)),a=0;for(n=0,t=i.length;a64&&f<90||f>96&&f<123||95===f||f===F&&s.charCodeAt(1)!==F))switch(isNaN(parseFloat(s))+(-1!==s.indexOf("("))){case 1:switch(s){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:s+=ae}}u[n++]=s}o+=(0===a?"":",")+u.join(" ")}}return o=r+o+";",1===Q||2===Q&&de(o,1)?T+o+o:o}(f);if(0===Q||2===Q&&!de(f,1))return f;switch(p){case 1015:return 97===f.charCodeAt(10)?T+f+f:f;case 951:return 116===f.charCodeAt(3)?T+f+f:f;case 963:return 110===f.charCodeAt(5)?T+f+f:f;case 1009:if(100!==f.charCodeAt(4))break;case 969:case 942:return T+f+f;case 978:return T+f+j+f+f;case 1019:case 983:return T+f+j+f+R+f+f;case 883:return f.charCodeAt(8)===F?T+f+f:f.indexOf("image-set(",11)>0?f.replace(P,"$1"+T+"$2")+f:f;case 932:if(f.charCodeAt(4)===F)switch(f.charCodeAt(5)){case 103:return T+"box-"+f.replace("-grow","")+T+f+R+f.replace("grow","positive")+f;case 115:return T+f+R+f.replace("shrink","negative")+f;case 98:return T+f+R+f.replace("basis","preferred-size")+f}return T+f+R+f+f;case 964:return T+f+R+"flex-"+f+f;case 1023:if(99!==f.charCodeAt(8))break;return s=f.substring(f.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),T+"box-pack"+s+T+f+R+"flex-pack"+s+f;case 1005:return i.test(f)?f.replace(o,":"+T)+f.replace(o,":"+j)+f:f;case 1e3:switch(u=(s=f.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(u)){case 226:s=f.replace(k,"tb");break;case 232:s=f.replace(k,"tb-rl");break;case 220:s=f.replace(k,"lr");break;default:return f}return T+f+R+s+f;case 1017:if(-1===f.indexOf("sticky",9))return f;case 975:switch(u=(f=e).length-10,p=(s=(33===f.charCodeAt(u)?f.substring(0,u):f).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(s.charCodeAt(8)<111)break;case 115:f=f.replace(s,T+s)+";"+f;break;case 207:case 102:f=f.replace(s,T+(p>102?"inline-":"")+"box")+";"+f.replace(s,T+s)+";"+f.replace(s,R+s+"box")+";"+f}return f+";";case 938:if(f.charCodeAt(5)===F)switch(f.charCodeAt(6)){case 105:return s=f.replace("-items",""),T+f+T+"box-"+s+R+"flex-"+s+f;case 115:return T+f+R+"flex-item-"+f.replace(E,"")+f;default:return T+f+R+"flex-line-pack"+f.replace("align-content","").replace(E,"")+f}break;case 973:case 989:if(f.charCodeAt(3)!==F||122===f.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?pe(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):f.replace(s,T+s)+f.replace(s,j+s.replace("fill-",""))+f;break;case 962:if(f=T+f+(102===f.charCodeAt(5)?R+f:"")+f,n+r===211&&105===f.charCodeAt(13)&&f.indexOf("transform",10)>0)return f.substring(0,f.indexOf(";",27)+1).replace(a,"$1"+T+"$2")+f}return f}function de(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10),o=e.substring(n+1,e.length-1);return re(2!==t?r:r.replace(O,"$1"),o,t)}function he(e,t){var n=pe(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(C," or ($1)").substring(4):"("+t+")"}function me(e,t,n,r,o,i,a,l,c,s){for(var u,f=0,p=t;f0&&(ae=o.replace(d,91===i?"":"-")),i=1,1===$?ce=o:le=o;var a,l=[ce];ne>0&&void 0!==(a=me(-1,n,l,l,X,V,0,0,0,0))&&"string"==typeof a&&(n=a);var c=se(ee,l,n,0,0);return ne>0&&void 0!==(a=me(-2,c,l,l,X,V,c.length,0,0,0))&&"string"!=typeof(c=a)&&(i=0),ae="",ce="",le="",q=0,X=1,V=1,Z*i==0?c:c.replace(r,"").replace(b,"").replace(v,"$1").replace(y,"$1").replace(w," ")}return ve.use=function e(t){switch(t){case void 0:case null:ne=te.length=0;break;default:if("function"==typeof t)te[ne++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n1?r-1:0),i=1;i0?" Additional arguments: "+o.join(", "):"")));return w(a)}return y(t,e),t}(Error),R=/^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,D=function(e){var t=""+(e||""),n=[];return t.replace(R,(function(e,t,r){return n.push({componentId:t,matchIndex:r}),e})),n.map((function(e,r){var o=e.componentId,i=e.matchIndex,a=n[r+1];return{componentId:o,cssFromDOM:a?t.slice(i,a.matchIndex):t.slice(i)}}))},M=/^\s*\/\/.*$/gm,A=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!1,compress:!1,semicolon:!0}),I=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!1}),z=[],B=function(e){if(-2===e){var t=z;return z=[],t}},L=a()((function(e){z.push(e)})),N=void 0,F=void 0,U=void 0,H=function(e,t,n){return t>0&&-1!==n.slice(0,t).indexOf(F)&&n.slice(t-F.length,t)!==F?"."+N:e};I.use([function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(F)>0&&(n[0]=n[0].replace(U,H))},L,B]),A.use([L,B]);var W=function(e){return A("",e)};function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(M,""),i=t&&n?n+" "+t+" { "+o+" }":o;return N=r,F=t,U=new RegExp("\\"+F+"\\b","g"),I(n||!t?"":t,i)}var V=function(){return n.nc},X=function(e,t,n){n&&((e[t]||(e[t]=Object.create(null)))[n]=!0)},q=function(e,t){e[t]=Object.create(null)},$=function(e){return function(t,n){return void 0!==e[t]&&e[t][n]}},Q=function(e){var t="";for(var n in e)t+=Object.keys(e[n]).join(" ")+" ";return t.trim()},K=function(e){if(e.sheet)return e.sheet;for(var t=e.ownerDocument.styleSheets.length,n=0;n"+e()+""}},te=function(e,t){return function(){var n,r=((n={})[_]=Q(t),n["data-styled-version"]="4.4.1",n),o=V();return o&&(r.nonce=o),c.a.createElement("style",v({},r,{dangerouslySetInnerHTML:{__html:e()}}))}},ne=function(e){return function(){return Object.keys(e)}},re=function(e,t){return e.createTextNode(G(t))},oe=function e(t,n){var r=void 0===t?Object.create(null):t,o=void 0===n?Object.create(null):n,i=function(e){var t=o[e];return void 0!==t?t:o[e]=[""]},a=function(){var e="";for(var t in o){var n=o[t][0];n&&(e+=G(t)+n)}return e};return{clone:function(){var t=function(e){var t=Object.create(null);for(var n in e)t[n]=v({},e[n]);return t}(r),n=Object.create(null);for(var i in o)n[i]=[o[i][0]];return e(t,n)},css:a,getIds:ne(o),hasNameForId:$(r),insertMarker:i,insertRules:function(e,t,n){i(e)[0]+=t.join(" "),X(r,e,n)},removeRules:function(e){var t=o[e];void 0!==t&&(t[0]="",q(r,e))},sealed:!1,styleTag:null,toElement:te(a,r),toHTML:ee(a,r)}},ie=function(e,t,n,r,o){if(P&&!n){var i=function(e,t,n){var r=document;e?r=e.ownerDocument:t&&(r=t.ownerDocument);var o=r.createElement("style");o.setAttribute(_,""),o.setAttribute("data-styled-version","4.4.1");var i=V();if(i&&o.setAttribute("nonce",i),o.appendChild(r.createTextNode("")),e&&!t)e.appendChild(o);else{if(!t||!e||!t.parentNode)throw new j(6);t.parentNode.insertBefore(o,n?t:t.nextSibling)}return o}(e,t,r);return T?function(e,t){var n=Object.create(null),r=Object.create(null),o=void 0!==t,i=!1,a=function(t){var o=r[t];return void 0!==o?o:(r[t]=re(e.ownerDocument,t),e.appendChild(r[t]),n[t]=Object.create(null),r[t])},l=function(){var e="";for(var t in r)e+=r[t].data;return e};return{clone:function(){throw new j(5)},css:l,getIds:ne(r),hasNameForId:$(n),insertMarker:a,insertRules:function(e,r,l){for(var c=a(e),s=[],u=r.length,f=0;f0&&(i=!0,t().insertRules(e+"-import",s))},removeRules:function(a){var l=r[a];if(void 0!==l){var c=re(e.ownerDocument,a);e.replaceChild(c,l),r[a]=c,q(n,a),o&&i&&t().removeRules(a+"-import")}},sealed:!1,styleTag:e,toElement:te(l,n),toHTML:ee(l,n)}}(i,o):function(e,t){var n=Object.create(null),r=Object.create(null),o=[],i=void 0!==t,a=!1,l=function(e){var t=r[e];return void 0!==t?t:(r[e]=o.length,o.push(0),q(n,e),r[e])},c=function(){var t=K(e).cssRules,n="";for(var i in r){n+=G(i);for(var a=r[i],l=J(o,a),c=l-o[a];c0&&(a=!0,t().insertRules(r+"-import",h)),o[u]+=d,X(n,r,s)},removeRules:function(l){var c=r[l];if(void 0!==c&&!1!==e.isConnected){var s=o[c];!function(e,t,n){for(var r=t-n,o=t;o>r;o-=1)e.deleteRule(o)}(K(e),J(o,c)-1,s),o[c]=0,q(n,l),i&&a&&t().removeRules(l+"-import")}},sealed:!1,styleTag:e,toElement:te(c,n),toHTML:ee(c,n)}}(i,o)}return oe()},ae=/\s+/,le=void 0;le=P?T?40:1e3:-1;var ce=0,se=void 0,ue=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P?document.head:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g(this,e),this.getImportRuleTag=function(){var e=t.importRuleTag;if(void 0!==e)return e;var n=t.tags[0];return t.importRuleTag=ie(t.target,n?n.styleTag:null,t.forceServer,!0)},ce+=1,this.id=ce,this.forceServer=r,this.target=r?null:n,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!P||this.forceServer)return this;var e=[],t=[],n=!1,r=document.querySelectorAll("style["+_+'][data-styled-version="4.4.1"]'),o=r.length;if(!o)return this;for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];se=new e(void 0,t).rehydrate()},e.prototype.clone=function(){var t=new e(this.target,this.forceServer);return this.clones.push(t),t.tags=this.tags.map((function(e){for(var n=e.getIds(),r=e.clone(),o=0;o1?t-1:0),r=1;r=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return((r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16))^r>>>15)>>>0}var we=function(e){return String.fromCharCode(e+(e>25?39:97))};function xe(e){var t="",n=void 0;for(n=e;n>52;n=Math.floor(n/52))t=we(n%52)+t;return we(n%52)+t}function ke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:S,r=!!n&&e.theme===n.theme,o=e.theme&&!r?e.theme:t||n.theme;return o},_e=/[[\].#*$><+~=|^:(),"'`-]+/g,Pe=/(^-|-$)/g;function Te(e){return e.replace(_e,"-").replace(Pe,"")}function je(e){return"string"==typeof e&&!0}var Re={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},De={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Me=((Se={})[u.ForwardRef]={$$typeof:!0,render:!0},Se),Ae=Object.defineProperty,Ie=Object.getOwnPropertyNames,ze=Object.getOwnPropertySymbols,Be=void 0===ze?function(){return[]}:ze,Le=Object.getOwnPropertyDescriptor,Ne=Object.getPrototypeOf,Fe=Object.prototype,Ue=Array.prototype;function He(e,t,n){if("string"!=typeof t){var r=Ne(t);r&&r!==Fe&&He(e,r,n);for(var o=Ue.concat(Ie(t),Be(t)),i=Me[e.$$typeof]||Re,a=Me[t.$$typeof]||Re,l=o.length,c=void 0,s=void 0;l--;)if(s=o[l],!(De[s]||n&&n[s]||a&&a[s]||i&&i[s])&&(c=Le(t,s)))try{Ae(e,s,c)}catch(e){}return e}return e}var We=Object(l.createContext)(),Ye=We.Consumer,Ve=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext.bind(r)),r.renderInner=r.renderInner.bind(r),r}return y(t,e),t.prototype.render=function(){return this.props.children?c.a.createElement(We.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(e){var t=this.getContext(this.props.theme,e);return c.a.createElement(We.Provider,{value:t},this.props.children)},t.prototype.getTheme=function(e,t){if(C(e))return e(t);if(null===e||Array.isArray(e)||"object"!==(void 0===e?"undefined":m(e)))throw new j(8);return v({},t,e)},t.prototype.getContext=function(e,t){return this.getTheme(e,t)},t}(l.Component),Xe=(function(){function e(){g(this,e),this.masterSheet=ue.master,this.instance=this.masterSheet.clone(),this.sealed=!1}e.prototype.seal=function(){if(!this.sealed){var e=this.masterSheet.clones.indexOf(this.instance);this.masterSheet.clones.splice(e,1),this.sealed=!0}},e.prototype.collectStyles=function(e){if(this.sealed)throw new j(2);return c.a.createElement($e,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.seal(),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.seal(),this.instance.toReactElements()},e.prototype.interleaveWithNodeStream=function(e){throw new j(3)}}(),Object(l.createContext)()),qe=Xe.Consumer,$e=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext),r}return y(t,e),t.prototype.getContext=function(e,t){if(e)return e;if(t)return new ue(t);throw new j(4)},t.prototype.render=function(){var e=this.props,t=e.children,n=e.sheet,r=e.target;return c.a.createElement(Xe.Provider,{value:this.getContext(n,r)},t)},t}(l.Component),Qe={};var Ke=function(e){function t(){g(this,t);var n=w(this,e.call(this));return n.attrs={},n.renderOuter=n.renderOuter.bind(n),n.renderInner=n.renderInner.bind(n),n}return y(t,e),t.prototype.render=function(){return c.a.createElement(qe,null,this.renderOuter)},t.prototype.renderOuter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue.master;return this.styleSheet=e,this.props.forwardedComponent.componentStyle.isStatic?this.renderInner():c.a.createElement(Ye,null,this.renderInner)},t.prototype.renderInner=function(e){var t=this.props.forwardedComponent,n=t.componentStyle,r=t.defaultProps,o=(t.displayName,t.foldedComponentIds),i=t.styledComponentId,a=t.target,c=void 0;c=n.isStatic?this.generateAndInjectStyles(S,this.props):this.generateAndInjectStyles(Oe(this.props,e,r)||S,this.props);var s=this.props.as||this.attrs.as||a,u=je(s),f={},d=v({},this.props,this.attrs),h=void 0;for(h in d)"forwardedComponent"!==h&&"as"!==h&&("forwardedRef"===h?f.ref=d[h]:"forwardedAs"===h?f.as=d[h]:u&&!Object(p.a)(h)||(f[h]=d[h]));return this.props.style&&this.attrs.style&&(f.style=v({},this.attrs.style,this.props.style)),f.className=Array.prototype.concat(o,i,c!==i?c:null,this.props.className,this.attrs.className).filter(Boolean).join(" "),Object(l.createElement)(s,f)},t.prototype.buildExecutionContext=function(e,t,n){var r=this,o=v({},t,{theme:e});return n.length?(this.attrs={},n.forEach((function(e){var t,n=e,i=!1,a=void 0,l=void 0;for(l in C(n)&&(n=n(o),i=!0),n)a=n[l],i||!C(a)||(t=a)&&t.prototype&&t.prototype.isReactComponent||O(a)||(a=a(o)),r.attrs[l]=a,o[l]=a})),o):o},t.prototype.generateAndInjectStyles=function(e,t){var n=t.forwardedComponent,r=n.attrs,o=n.componentStyle;n.warnTooManyClasses;return o.isStatic&&!r.length?o.generateAndInjectStyles(S,this.styleSheet):o.generateAndInjectStyles(this.buildExecutionContext(e,t,r),this.styleSheet)},t}(l.Component);function Ze(e,t,n){var r=O(e),o=!je(e),i=t.displayName,a=void 0===i?function(e){return je(e)?"styled."+e:"Styled("+E(e)+")"}(e):i,l=t.componentId,s=void 0===l?function(e,t,n){var r="string"!=typeof t?"sc":Te(t),o=(Qe[r]||0)+1;Qe[r]=o;var i=r+"-"+e.generateName(r+o);return n?n+"-"+i:i}(Ee,t.displayName,t.parentComponentId):l,u=t.ParentComponent,f=void 0===u?Ke:u,p=t.attrs,h=void 0===p?k:p,m=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||s,g=r&&e.attrs?Array.prototype.concat(e.attrs,h).filter(Boolean):h,b=new Ee(r?e.componentStyle.rules.concat(n):n,g,m),y=void 0,w=function(e,t){return c.a.createElement(f,v({},e,{forwardedComponent:y,forwardedRef:t}))};return w.displayName=a,(y=c.a.forwardRef(w)).displayName=a,y.attrs=g,y.componentStyle=b,y.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):k,y.styledComponentId=m,y.target=r?e.target:e,y.withComponent=function(e){var r=t.componentId,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["componentId"]),i=r&&r+"-"+(je(e)?e:Te(E(e)));return Ze(e,v({},o,{attrs:g,componentId:i,ParentComponent:f}),n)},Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Object(d.a)(e.defaultProps,t):t}}),y.toString=function(){return"."+y.styledComponentId},o&&He(y,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,styledComponentId:!0,target:!0,withComponent:!0}),y}var Ge=function(e){return function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;if(!Object(u.isValidElementType)(n))throw new j(1,String(n));var o=function(){return t(n,r,ve.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,v({},r,o))},o.attrs=function(o){return e(t,n,v({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Ge[e]=Ge(e)}));!function(){function e(t,n){g(this,e),this.rules=t,this.componentId=n,this.isStatic=ke(t,k),ue.master.hasId(n)||ue.master.deferredInject(n,[])}e.prototype.createStyles=function(e,t){var n=Y(be(this.rules,e,t),"");t.inject(this.componentId,n)},e.prototype.removeStyles=function(e){var t=this.componentId;e.hasId(t)&&e.remove(t)},e.prototype.renderStyles=function(e,t){this.removeStyles(t),this.createStyles(e,t)}}();P&&(window.scCGSHMRCache={});t.b=Ge}).call(this,n(12))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1?n-1:0),o=1;o255?255:e}},{key:"copyAttributes",value:function(e,t,n){return null==n&&(n={}),function(){for(var r=[],o=0,i=Array.from(e.attributes);oe?d():!0!==t&&(o=setTimeout(r?h:d,void 0===r?e-p:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),c.cancel=function(){l(),i=!0},c}e.debounce=function(e,n,r){return void 0===r?t(e,n,!1):t(e,r,!1!==n)},e.throttle=t,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(23)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n])/g,v=/([[}=:>])\s+/g,y=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,x=/([^\(])(:+) */g,k=/[svh]\w+-[tblr]{2}/,S=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,E=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,T="-webkit-",j="-moz-",R="-ms-",D=59,M=125,A=123,I=40,z=41,B=10,L=13,N=32,F=45,U=42,H=44,W=58,Y=47,V=1,X=1,q=0,$=1,Q=1,K=1,Z=0,G=0,J=0,ee=[],te=[],ne=0,re=null,oe=0,ie=1,ae="",le="",ce="";function se(e,t,o,i,a){for(var l,c,u=0,f=0,p=0,d=0,b=0,v=0,y=0,w=0,k=0,C=0,E=0,O=0,_=0,P=0,j=0,R=0,Z=0,te=0,re=0,fe=o.length,be=fe-1,ve="",ye="",we="",xe="",ke="",Se="";j0&&(ye=ye.replace(r,"")),ye.trim().length>0)){switch(y){case N:case 9:case D:case L:case B:break;default:ye+=o.charAt(j)}y=D}if(1===Z)switch(y){case A:case M:case D:case 34:case 39:case I:case z:case H:Z=0;case 9:case L:case B:case N:break;default:for(Z=0,re=j,b=y,j--,y=D;re0&&(++j,y=b);case A:re=fe}}switch(y){case A:for(b=(ye=ye.trim()).charCodeAt(0),E=1,re=++j;j0&&(ye=ye.replace(r,"")),v=ye.charCodeAt(1)){case 100:case 109:case 115:case F:l=t;break;default:l=ee}if(re=(we=se(t,l,we,v,a+1)).length,J>0&&0===re&&(re=ye.length),ne>0&&(c=me(3,we,l=ue(ee,ye,te),t,X,V,re,v,a,i),ye=l.join(""),void 0!==c&&0===(re=(we=c.trim()).length)&&(v=0,we="")),re>0)switch(v){case 115:ye=ye.replace(S,he);case 100:case 109:case F:we=ye+"{"+we+"}";break;case 107:we=(ye=ye.replace(h,"$1 $2"+(ie>0?ae:"")))+"{"+we+"}",we=1===Q||2===Q&&de("@"+we,3)?"@"+T+we+"@"+we:"@"+we;break;default:we=ye+we,112===i&&(xe+=we,we="")}else we="";break;default:we=se(t,ue(t,ye,te),we,i,a+1)}ke+=we,O=0,Z=0,P=0,R=0,te=0,_=0,ye="",we="",y=o.charCodeAt(++j);break;case M:case D:if((re=(ye=(R>0?ye.replace(r,""):ye).trim()).length)>1)switch(0===P&&((b=ye.charCodeAt(0))===F||b>96&&b<123)&&(re=(ye=ye.replace(" ",":")).length),ne>0&&void 0!==(c=me(1,ye,t,e,X,V,xe.length,i,a,i))&&0===(re=(ye=c.trim()).length)&&(ye="\0\0"),b=ye.charCodeAt(0),v=ye.charCodeAt(1),b){case 0:break;case 64:if(105===v||99===v){Se+=ye+o.charAt(j);break}default:if(ye.charCodeAt(re-1)===W)break;xe+=pe(ye,b,v,ye.charCodeAt(2))}O=0,Z=0,P=0,R=0,te=0,ye="",y=o.charCodeAt(++j)}}switch(y){case L:case B:if(f+d+p+u+G===0)switch(C){case z:case 39:case 34:case 64:case 126:case 62:case U:case 43:case Y:case F:case W:case H:case D:case A:case M:break;default:P>0&&(Z=1)}f===Y?f=0:$+O===0&&107!==i&&ye.length>0&&(R=1,ye+="\0"),ne*oe>0&&me(0,ye,t,e,X,V,xe.length,i,a,i),V=1,X++;break;case D:case M:if(f+d+p+u===0){V++;break}default:switch(V++,ve=o.charAt(j),y){case 9:case N:if(d+u+f===0)switch(w){case H:case W:case 9:case N:ve="";break;default:y!==N&&(ve=" ")}break;case 0:ve="\\0";break;case 12:ve="\\f";break;case 11:ve="\\v";break;case 38:d+f+u===0&&$>0&&(te=1,R=1,ve="\f"+ve);break;case 108:if(d+f+u+q===0&&P>0)switch(j-P){case 2:112===w&&o.charCodeAt(j-3)===W&&(q=w);case 8:111===k&&(q=k)}break;case W:d+f+u===0&&(P=j);break;case H:f+p+d+u===0&&(R=1,ve+="\r");break;case 34:case 39:0===f&&(d=d===y?0:0===d?y:d);break;case 91:d+f+p===0&&u++;break;case 93:d+f+p===0&&u--;break;case z:d+f+u===0&&p--;break;case I:if(d+f+u===0){if(0===O)switch(2*w+3*k){case 533:break;default:E=0,O=1}p++}break;case 64:f+p+d+u+P+_===0&&(_=1);break;case U:case Y:if(d+u+p>0)break;switch(f){case 0:switch(2*y+3*o.charCodeAt(j+1)){case 235:f=Y;break;case 220:re=j,f=U}break;case U:y===Y&&w===U&&re+2!==j&&(33===o.charCodeAt(re+2)&&(xe+=o.substring(re,j+1)),ve="",f=0)}}if(0===f){if($+d+u+_===0&&107!==i&&y!==D)switch(y){case H:case 126:case 62:case 43:case z:case I:if(0===O){switch(w){case 9:case N:case B:case L:ve+="\0";break;default:ve="\0"+ve+(y===H?"":"\0")}R=1}else switch(y){case I:P+7===j&&108===w&&(P=0),O=++E;break;case z:0==(O=--E)&&(R=1,ve+="\0")}break;case 9:case N:switch(w){case 0:case A:case M:case D:case H:case 12:case 9:case N:case B:case L:break;default:0===O&&(R=1,ve+="\0")}}ye+=ve,y!==N&&9!==y&&(C=y)}}k=w,w=y,j++}if(re=xe.length,J>0&&0===re&&0===ke.length&&0===t[0].length==0&&(109!==i||1===t.length&&($>0?le:ce)===t[0])&&(re=t.join(",").length+2),re>0){if(l=0===$&&107!==i?function(e){for(var t,n,o=0,i=e.length,a=Array(i);o1)){if(p=c.charCodeAt(c.length-1),d=n.charCodeAt(0),t="",0!==u)switch(p){case U:case 126:case 62:case 43:case N:case I:break;default:t=" "}switch(d){case 38:n=t+le;case 126:case 62:case 43:case N:case z:case I:break;case 91:n=t+n+le;break;case W:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(K>0){n=t+n.substring(8,f-1);break}default:(u<1||l[u-1].length<1)&&(n=t+le+n)}break;case H:t="";default:n=f>1&&n.indexOf(":")>0?t+n.replace(x,"$1"+le+"$2"):t+n+le}c+=n}a[o]=c.replace(r,"").trim()}return a}(t):t,ne>0&&void 0!==(c=me(2,xe,l,e,X,V,re,i,a,i))&&0===(xe=c).length)return Se+xe+ke;if(xe=l.join(",")+"{"+xe+"}",Q*q!=0){switch(2!==Q||de(xe,2)||(q=0),q){case 111:xe=xe.replace(g,":-moz-$1")+xe;break;case 112:xe=xe.replace(m,"::"+T+"input-$1")+xe.replace(m,"::-moz-$1")+xe.replace(m,":-ms-input-$1")+xe}q=0}}return Se+xe+ke}function ue(e,t,n){var r=t.trim().split(u),o=r,i=r.length,a=e.length;switch(a){case 0:case 1:for(var l=0,c=0===a?"":e[0]+" ";l0&&$>0)return o.replace(p,"$1").replace(f,"$1"+ce);break;default:return e.trim()+o.replace(f,"$1"+e.trim())}default:if(n*$>0&&o.indexOf("\f")>0)return o.replace(f,(e.charCodeAt(0)===W?"":"$1")+e.trim())}return e+o}function pe(e,t,n,r){var s,u=0,f=e+";",p=2*t+3*n+4*r;if(944===p)return function(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim();switch(e.charCodeAt(9)*ie){case 0:break;case F:if(110!==e.charCodeAt(10))break;default:var i=o.split((o="",l)),a=0;for(n=0,t=i.length;a64&&f<90||f>96&&f<123||95===f||f===F&&s.charCodeAt(1)!==F))switch(isNaN(parseFloat(s))+(-1!==s.indexOf("("))){case 1:switch(s){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:s+=ae}}u[n++]=s}o+=(0===a?"":",")+u.join(" ")}}return o=r+o+";",1===Q||2===Q&&de(o,1)?T+o+o:o}(f);if(0===Q||2===Q&&!de(f,1))return f;switch(p){case 1015:return 97===f.charCodeAt(10)?T+f+f:f;case 951:return 116===f.charCodeAt(3)?T+f+f:f;case 963:return 110===f.charCodeAt(5)?T+f+f:f;case 1009:if(100!==f.charCodeAt(4))break;case 969:case 942:return T+f+f;case 978:return T+f+j+f+f;case 1019:case 983:return T+f+j+f+R+f+f;case 883:return f.charCodeAt(8)===F?T+f+f:f.indexOf("image-set(",11)>0?f.replace(P,"$1"+T+"$2")+f:f;case 932:if(f.charCodeAt(4)===F)switch(f.charCodeAt(5)){case 103:return T+"box-"+f.replace("-grow","")+T+f+R+f.replace("grow","positive")+f;case 115:return T+f+R+f.replace("shrink","negative")+f;case 98:return T+f+R+f.replace("basis","preferred-size")+f}return T+f+R+f+f;case 964:return T+f+R+"flex-"+f+f;case 1023:if(99!==f.charCodeAt(8))break;return s=f.substring(f.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),T+"box-pack"+s+T+f+R+"flex-pack"+s+f;case 1005:return i.test(f)?f.replace(o,":"+T)+f.replace(o,":"+j)+f:f;case 1e3:switch(u=(s=f.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(u)){case 226:s=f.replace(k,"tb");break;case 232:s=f.replace(k,"tb-rl");break;case 220:s=f.replace(k,"lr");break;default:return f}return T+f+R+s+f;case 1017:if(-1===f.indexOf("sticky",9))return f;case 975:switch(u=(f=e).length-10,p=(s=(33===f.charCodeAt(u)?f.substring(0,u):f).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(s.charCodeAt(8)<111)break;case 115:f=f.replace(s,T+s)+";"+f;break;case 207:case 102:f=f.replace(s,T+(p>102?"inline-":"")+"box")+";"+f.replace(s,T+s)+";"+f.replace(s,R+s+"box")+";"+f}return f+";";case 938:if(f.charCodeAt(5)===F)switch(f.charCodeAt(6)){case 105:return s=f.replace("-items",""),T+f+T+"box-"+s+R+"flex-"+s+f;case 115:return T+f+R+"flex-item-"+f.replace(E,"")+f;default:return T+f+R+"flex-line-pack"+f.replace("align-content","").replace(E,"")+f}break;case 973:case 989:if(f.charCodeAt(3)!==F||122===f.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?pe(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):f.replace(s,T+s)+f.replace(s,j+s.replace("fill-",""))+f;break;case 962:if(f=T+f+(102===f.charCodeAt(5)?R+f:"")+f,n+r===211&&105===f.charCodeAt(13)&&f.indexOf("transform",10)>0)return f.substring(0,f.indexOf(";",27)+1).replace(a,"$1"+T+"$2")+f}return f}function de(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10),o=e.substring(n+1,e.length-1);return re(2!==t?r:r.replace(O,"$1"),o,t)}function he(e,t){var n=pe(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(C," or ($1)").substring(4):"("+t+")"}function me(e,t,n,r,o,i,a,l,c,s){for(var u,f=0,p=t;f0&&(ae=o.replace(d,91===i?"":"-")),i=1,1===$?ce=o:le=o;var a,l=[ce];ne>0&&void 0!==(a=me(-1,n,l,l,X,V,0,0,0,0))&&"string"==typeof a&&(n=a);var c=se(ee,l,n,0,0);return ne>0&&void 0!==(a=me(-2,c,l,l,X,V,c.length,0,0,0))&&"string"!=typeof(c=a)&&(i=0),ae="",ce="",le="",q=0,X=1,V=1,Z*i==0?c:c.replace(r,"").replace(b,"").replace(v,"$1").replace(y,"$1").replace(w," ")}return ve.use=function e(t){switch(t){case void 0:case null:ne=te.length=0;break;default:if("function"==typeof t)te[ne++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n * @license MIT */ -var r=n(36),o=n(37),i=n(38);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return _(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,a=1,l=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,l/=2,c/=2,n/=2}function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;il&&(n=l-c),i=n;i>=0;i--){for(var f=!0,p=0;po&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:s>223?3:s>191?2:1;if(o+f<=n)switch(f){case 1:s<128&&(u=s);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&s)<<6|63&i)>127&&(u=c);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(c=(15&s)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=e[o+1],a=e[o+2],l=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&l)&&(c=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&l)>65535&&c<1114112&&(u=c)}null===u?(u=65533,f=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),l=Math.min(i,a),s=this.slice(r,o),u=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return k(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function A(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function I(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,i){return i||I(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||I(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):A(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=0,a=1,l=0;for(this[t]=255&e;++i>0)-l&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/a>>0)-l&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):A(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(13))},function(e,t,n){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=s(e),a=r[0],l=r[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,l)),u=0,f=l>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===l&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===l&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,l=n-o;al?l:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,c=a.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var o,i,a=[],l=t;l>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,l=8*o-r-1,c=(1<>1,u=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-u)-1,d>>=-u,u+=l;u>0;i=256*i+e[t+f],f+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+f],f+=p,u-=8);if(0===i)i=1-s;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=s}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,l,c,s=8*i-o-1,u=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(t*c-1)*Math.pow(2,o),a+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&l,d+=h,l/=256,o-=8);for(a=a<0;e[n+d]=255&a,d+=h,a/=256,s-=8);e[n+d-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(module,__webpack_exports__,__webpack_require__){"use strict";var _module__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(19),_core_util__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2),_logger__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3),_store__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6),_renderer__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(20);function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n",this.hiDPIReplacement()),this.swapped=!0,this.image.src=this.hiDPIReplacement()),Caman.IO.isRemote(this.image))return this.image.src=Caman.IO.proxyUrl(this.image.src),_logger__WEBPACK_IMPORTED_MODULE_2__.a.debug("Remote image detected, using URL = ".concat(this.image.src))}},{key:"waitForImageLoaded",value:function(){return this.isImageLoaded()?this.imageLoaded():this.image.onload=this.imageLoaded}},{key:"isImageLoaded",value:function(){return!!this.image.complete&&(null==this.image.naturalWidth||0!==this.image.naturalWidth)}},{key:"imageWidth",value:function(){return this.image.width||this.image.naturalWidth}},{key:"imageHeight",value:function(){return this.image.height||this.image.naturalHeight}},{key:"imageLoaded",value:function(){return _logger__WEBPACK_IMPORTED_MODULE_2__.a.debug("Image loaded. Width = ".concat(this.imageWidth(),", Height = ").concat(this.imageHeight())),this.swapped?(this.canvas.width=this.imageWidth()/this.hiDPIRatio(),this.canvas.height=this.imageHeight()/this.hiDPIRatio()):(this.canvas.width=this.imageWidth(),this.canvas.height=this.imageHeight()),this.finishInit()}},{key:"finishInit",value:function(){if(null==this.context&&(this.context=this.canvas.getContext("2d")),this.originalWidth=this.preScaledWidth=this.width=this.canvas.width,this.originalHeight=this.preScaledHeight=this.height=this.canvas.height,this.hiDPIAdjustments(),this.hasId()||this.assignId(),null!=this.image&&this.context.drawImage(this.image,0,0,this.imageWidth(),this.imageHeight(),0,0,this.preScaledWidth,this.preScaledHeight),this.imageData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),this.pixelData=this.imageData.data,Caman.allowRevert){this.initializedPixelData=_core_util__WEBPACK_IMPORTED_MODULE_1__.b.dataArray(this.pixelData.length),this.originalPixelData=_core_util__WEBPACK_IMPORTED_MODULE_1__.b.dataArray(this.pixelData.length);for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;if(null==r&&(r=0),null==n){n=0;for(var o=0,i=t.length,a=0<=i;a?oi;a?o++:o--)n+=t[o]}return this.renderer.add({type:Caman.Filter.Type.Kernel,name:e,adjust:t,divisor:n,bias:r}),this}},{key:"processPlugin",value:function(e,t){return this.renderer.add({type:Caman.Filter.Type.Plugin,plugin:e,args:t}),this}},{key:"newLayer",value:function(e){var t=new Caman.Layer(this);return this.canvasQueue.push(t),this.renderer.add({type:Caman.Filter.Type.LayerDequeue}),e.call(t),this.renderer.add({type:Caman.Filter.Type.LayerFinished}),this}},{key:"executeLayer",value:function(e){return this.pushContext(e)}},{key:"pushContext",value:function(e){return this.layerStack.push(this.currentLayer),this.pixelStack.push(this.pixelData),this.currentLayer=e,this.pixelData=e.pixelData}},{key:"popContext",value:function(){return this.pixelData=this.pixelStack.pop(),this.currentLayer=this.layerStack.pop()}},{key:"applyCurrentLayer",value:function(){return this.currentLayer.applyToParent()}},{key:"save",value:function(){return this.browserSave.apply(this,arguments)}},{key:"browserSave",value:function(e){null==e&&(e="png"),e=e.toLowerCase();var t=this.toBase64(e).replace("image/".concat(e),"image/octet-stream");return document.location.href=t}},{key:"toImage",value:function(e){var t=new Image;return t.src=this.toBase64(e),t.width=this.dimensions.width,t.height=this.dimensions.height,window.devicePixelRatio&&(t.width/=window.devicePixelRatio,t.height/=window.devicePixelRatio),t}},{key:"toBase64",value:function(e){return null==e&&(e="png"),e=e.toLowerCase(),this.canvas.toDataURL("image/".concat(e))}}]),Caman}(_module__WEBPACK_IMPORTED_MODULE_0__.a);Caman.initClass(),window.Caman=Caman;var _unused_webpack_default_export=Caman},function(e,t){function n(e,t){for(var n=0;n1;){for(var m=[],g=0,b=h.length-2,v=0<=b;v?g<=b:g>=b;v?g++:g--)m.push([f(h[g][0],h[g+1][0],d),f(h[g][1],h[g+1][1],d)]);h=m}u[Math.round(h[0][0])]=Math.round((l=h[0][1],c=o,s=i,Math.min(Math.max(l,c),s)))}var y=a[a.length-1][0];return u=Caman.Calculate.missingValues(u,y),null==u[y]&&(u[y]=u[y-1]),u}},{key:"hermite",value:function(e,t,n){if(e.length<2)throw"Invalid number of arguments to hermite";for(var r,o,i,a,l={},c=function(e,t){return[e[0]*t[0],e[1]*t[1]]},s=function(e,t){return[e[0]-t[0],e[1]-t[1]]},u=function(e,t,n){return Math.min(Math.max(e,t),n)},f=0,p=e.length-2,d=0<=p;d?f<=p:f>=p;d?f++:f--){var h=e[f],m=e[f+1],g=m[0]-h[0],b=1/g;f===e.length-2&&(b=1/(g-1));for(var v=f>0?e[f-1]:h,y=c(s(m,v),[.5,.5]),w=c(s(v=f=k;S?x++:x--){var C=x*b,E=2*C*C*C-3*C*C+1,O=C*C*C-2*C*C+C,_=-2*C*C*C+3*C*C,P=C*C*C-C*C,T=(r=c(h,[E,E]),o=c(y,[O,O]),i=c(m,[_,_]),a=c(w,[P,P]),[r[0]+o[0]+i[0]+a[0],r[1]+o[1]+i[1]+a[1]]);l[Math.round(T[0])]=Math.round(u(T[1],t,n))}}var j=e[e.length-1][0];return l=Caman.Calculate.missingValues(l,j)}},{key:"missingValues",value:function(e,t){var n,r,o,i,a,l,c;if(Object.keys(e).length=t;n=0<=t?++l:--l)if(null!=e[n])i[n]=e[n];else{for(o=[n-1,i[n-1]],r=c=n;n<=t?c<=t:c>=t;r=n<=t?++c:--c)if(null!=e[r]){a=[r,e[r]];break}a||(a=[0,0]),i[n]=o[1]+(a[1]-o[1])/(a[0]-o[0])*(n-o[0])}return i}return e}}],(r=null)&&n(t.prototype,r),o&&n(t,o),e}();Caman.Calculate=r},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n.5?s/(2-a-l):s/(a+l),o=function(){switch(a){case e:return(t-r)/s+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}},{key:"rgbToHSV",value:function(e,t,n){var r;e/=255,t/=255,n/=255;var o=Math.max(e,t,n),i=Math.min(e,t,n),a=o,l=o-i,c=0===o?0:l/o;return o===i?r=0:(r=function(){switch(o){case e:return(t-n)/l+(t.04045?e=Math.pow((e+.055)/1.055,2.4):e/=12.92,t>.04045?t=Math.pow((t+.055)/1.055,2.4):t/=12.92,n>.04045?n=Math.pow((n+.055)/1.055,2.4):n/=12.92,{x:100*(.4124*e+.3576*t+.1805*n),y:100*(.2126*e+.7152*t+.0722*n),z:100*(.0193*e+.1192*t+.9505*n)}}},{key:"xyzToRGB",value:function(e,t,n){var r=3.2406*(e/=100)+-1.5372*(t/=100)+-.4986*(n/=100),o=-.9689*e+1.8758*t+.0415*n,i=.0557*e+-.204*t+1.057*n;return r>.0031308?r=1.055*Math.pow(r,.4166666667)-.055:r*=12.92,o>.0031308?o=1.055*Math.pow(o,.4166666667)-.055:o*=12.92,i>.0031308?i=1.055*Math.pow(i,.4166666667)-.055:i*=12.92,{r:255*r,g:255*o,b:255*i}}},{key:"xyzToLab",value:function(e,t,r){return"object"===n(e)&&(t=e.y,r=e.z,e=e.x),t/=100,r/=108.883,e=(e/=95.047)>.008856451679?Math.pow(e,.3333333333):7.787037037*e+.1379310345,{l:116*(t=t>.008856451679?Math.pow(t,.3333333333):7.787037037*t+.1379310345)-16,a:500*(e-t),b:200*(t-(r=r>.008856451679?Math.pow(r,.3333333333):7.787037037*r+.1379310345))}}},{key:"labToXYZ",value:function(e,t,r){"object"===n(e)&&(t=e.a,r=e.b,e=e.l);var o=(e+16)/116,i=o+t/500,a=o-r/200;return i>.2068965517?i*=i*i:i=.1284185493*(i-.1379310345),o>.2068965517?o*=o*o:o=.1284185493*(o-.1379310345),a>.2068965517?a*=a*a:a=.1284185493*(a-.1379310345),{x:95.047*i,y:100*o,z:108.883*a}}},{key:"rgbToLab",value:function(e,t,r){"object"===n(e)&&(t=e.g,r=e.b,e=e.r);var o=this.rgbToXYZ(e,t,r);return this.xyzToLab(o)}},{key:"labToRGB",value:function(e,t,n){}}],(o=null)&&r(t.prototype,o),i&&r(t,i),e}();Caman.Convert=o},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null;if(this.events[t]&&this.events[t].length)return function(){for(var o=[],i=0,a=Array.from(n.events[t]);i4&&void 0!==arguments[4]?arguments[4]:null;n(this,e),null==t&&(t=0),this.r=t,null==r&&(r=0),this.g=r,null==o&&(o=0),this.b=o,null==i&&(i=255),this.a=i,this.c=a,this.loc=0}return o(e,null,[{key:"coordinatesToLocation",value:function(e,t,n){return 4*(t*n+e)}},{key:"locationToCoordinates",value:function(e,t){return{x:e%(4*t)/4,y:Math.floor(e/(4*t))}}}]),o(e,[{key:"setContext",value:function(e){return this.c=e}},{key:"locationXY",value:function(){if(null==this.c)throw"Requires a CamanJS context";var e=this.c.dimensions.height-Math.floor(this.loc/(4*this.c.dimensions.width));return{x:this.loc%(4*this.c.dimensions.width)/4,y:e}}},{key:"pixelAtLocation",value:function(t){if(null==this.c)throw"Requires a CamanJS context";return new e(this.c.pixelData[t],this.c.pixelData[t+1],this.c.pixelData[t+2],this.c.pixelData[t+3],this.c)}},{key:"getPixelRelative",value:function(t,n){if(null==this.c)throw"Requires a CamanJS context";var r=this.loc+4*this.c.dimensions.width*(-1*n)+4*t;return r>this.c.pixelData.length||r<0?new e(0,0,0,255,this.c):this.pixelAtLocation(r)}},{key:"putPixelRelative",value:function(e,t,n){if(null==this.c)throw"Requires a CamanJS context";this.loc,this.c.dimensions.width;if(!(newLoc>this.c.pixelData.length||newLoc<0))return this.c.pixelData[newLoc]=n.r,this.c.pixelData[newLoc+1]=n.g,this.c.pixelData[newLoc+2]=n.b,this.c.pixelData[newLoc+3]=n.a,!0}},{key:"getPixel",value:function(e,t){if(null==this.c)throw"Requires a CamanJS context";var n=this.coordinatesToLocation(e,t,this.width);return this.pixelAtLocation(n)}},{key:"putPixel",value:function(e,t,n){if(null==this.c)throw"Requires a CamanJS context";var r=this.coordinatesToLocation(e,t,this.width);return this.c.pixelData[r]=n.r,this.c.pixelData[r+1]=n.g,this.c.pixelData[r+2]=n.b,this.c.pixelData[r+3]=n.a}},{key:"toString",value:function(){return this.toKey()}},{key:"toHex",value:function(e){null==e&&(e=!1);var t="#"+this.r.toString(16)+this.g.toString(16)+this.b.toString(16);return e?t+this.a.toString(16):t}}]),e}();Caman.Pixel=i},function(e,t){function n(e,t){for(var n=0;n255-e?t.r=255:t.r255-e?t.g=255:t.g255-e?t.b=255:t.b0?t.r+=(255-t.r)*e.red:t.r-=t.r*Math.abs(e.red)),null!=e.green&&(e.green>0?t.g+=(255-t.g)*e.green:t.g-=t.g*Math.abs(e.green)),null!=e.blue&&(e.blue>0?t.b+=(255-t.b)*e.blue:t.b-=t.b*Math.abs(e.blue)),t}))})),Caman.Filter.register("curves",(function(){var e,t,n,r,o,i,a,l,c,s,u,f;if(n=arguments[0],"function"==typeof(a=(r=2<=arguments.length?[].slice.call(arguments,1):[])[r.length-1])?(e=a,r.pop()):"string"==typeof a?(e=Caman.Calculate[a],r.pop()):e=Caman.Calculate.bezier,"string"==typeof n&&(n=n.split("")),"v"===n[0]&&(n=["r","g","b"]),r.length<2)throw"Invalid number of arguments to curves filter";if(t=e(r,0,255),(l=r[0])[0]>0)for(i=c=0,u=l[0];0<=u?cu;i=0<=u?++c:--c)t[i]=l[1];if((o=r[r.length-1])[0]<255)for(i=s=f=o[0];f<=255?s<=255:s>=255;i=f<=255?++s:--s)t[i]=o[1];return this.process("curves",(function(e){var r,o;for(i=r=0,o=n.length;0<=o?ro;i=0<=o?++r:--r)e[n[i]]=t[e[n[i]]];return e}))})),Caman.Filter.register("exposure",(function(e){var t,n,r;return t=[0,255*(r=Math.abs(e)/100)],n=[255-255*r,255],e<0&&(t=t.reverse(),n=n.reverse()),this.curves("rgb",[0,0],t,n,[255,255])}))},function(e,t){Caman.Filter.register("boxBlur",(function(){return this.processKernel("Box Blur",[1,1,1,1,1,1,1,1,1])})),Caman.Filter.register("heavyRadialBlur",(function(){return this.processKernel("Heavy Radial Blur",[0,0,1,0,0,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,0,0,1,0,0])})),Caman.Filter.register("gaussianBlur",(function(){return this.processKernel("Gaussian Blur",[1,4,6,4,1,4,16,24,16,4,6,24,36,24,6,4,16,24,16,4,1,4,6,4,1])})),Caman.Filter.register("motionBlur",(function(e){var t;return t=0===e||180===e?[0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0]:e>0&&e<90||e>180&&e<270?[0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0]:90===e||270===e?[0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0]:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],this.processKernel("Motion Blur",t)})),Caman.Filter.register("sharpen",(function(e){return null==e&&(e=100),e/=100,this.processKernel("Sharpen",[0,-e,0,-e,4*e+1,-e,0,-e,0])}))},function(e,t){Caman.Filter.register("vignette",(function(e,t){var n,r,o,i;return null==t&&(t=60),"string"==typeof e&&"%"===e.substr(-1)&&(e=this.dimensions.height>this.dimensions.width?this.dimensions.width*(parseInt(e.substr(0,e.length-1),10)/100):this.dimensions.height*(parseInt(e.substr(0,e.length-1),10)/100)),t/=100,r=[this.dimensions.width/2,this.dimensions.height/2],i=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)),o=i-e,n=Caman.Calculate.bezier([0,1],[30,30],[70,60],[100,80]),this.process("vignette",(function(i){var a,l,c;return c=i.locationXY(),(a=Caman.Calculate.distance(c.x,c.y,r[0],r[1]))>o&&(l=Math.max(1,n[Math.round((a-o)/e*100)]/10*t),i.r=255*Math.pow(i.r/255,l),i.g=255*Math.pow(i.g/255,l),i.b=255*Math.pow(i.b/255,l)),i}))}))},function(e,t){Caman.Filter.register("posterize",(function(e){var t,n;return t=256/e,n=255/(e-1),this.process("posterize",(function(e){return e.r=Math.floor(Math.floor(e.r/t)*n),e.g=Math.floor(Math.floor(e.g/t)*n),e.b=Math.floor(Math.floor(e.b/t)*n),e}))}))},function(e,t){Caman.Filter.register("edgeEnhance",(function(){return this.processKernel("Edge Enhance",[0,0,0,-1,1,0,0,0,0])})),Caman.Filter.register("edgeDetect",(function(){return this.processKernel("Edge Detect",[-1,-1,-1,-1,8,-1,-1,-1,-1])})),Caman.Filter.register("emboss",(function(){return this.processKernel("Emboss",[-2,-1,0,-1,1,1,0,1,2])}))},function(e,t){Caman.Filter.register("grungy",(function(){return this.gamma(1.5),this.clip(25),this.saturation(-60),this.contrast(5),this.noise(5),this.vignette("50%",30)}))},function(e,t){Caman.Filter.register("hazyDays",(function(){return this.gamma(1.2),this.newLayer((function(){return this.setBlendingMode("overlay"),this.opacity(60),this.copyParent(),this.filter.channels({red:5}),this.filter.stackBlur(15)})),this.newLayer((function(){return this.setBlendingMode("addition"),this.opacity(40),this.fillColor("#6899ba")})),this.newLayer((function(){return this.setBlendingMode("multiply"),this.opacity(35),this.copyParent(),this.filter.brightness(40),this.filter.vibrance(40),this.filter.exposure(30),this.filter.contrast(15),this.filter.curves("r",[0,40],[128,128],[128,128],[255,215]),this.filter.curves("g",[0,40],[128,128],[128,128],[255,215]),this.filter.curves("b",[0,40],[128,128],[128,128],[255,215]),this.filter.stackBlur(5)})),this.curves("r",[20,0],[128,158],[128,128],[235,255]),this.curves("g",[20,0],[128,128],[128,128],[235,255]),this.curves("b",[20,0],[128,108],[128,128],[235,255]),this.vignette("45%",20)}))},function(e,t){Caman.Filter.register("lomo",(function(e){return null==e&&(e=!0),this.brightness(15),this.exposure(15),this.curves("rgb",[0,0],[200,0],[155,255],[255,255]),this.saturation(-20),this.gamma(1.8),e&&this.vignette("50%",60),this.brightness(5)}))},function(e,t){Caman.Filter.register("sinCity",(function(){return this.contrast(100),this.brightness(15),this.exposure(10),this.posterize(80),this.clip(30),this.greyscale()}))},function(e,t){Caman.Filter.register("crossProcess",(function(){return this.exposure(5),this.colorize("#e87b22",4),this.sepia(20),this.channels({blue:8,red:3}),this.curves("b",[0,0],[100,150],[180,180],[255,255]),this.contrast(15),this.vibrance(75),this.gamma(1.6)}))},function(e,t){Caman.Filter.register("glowingSun",(function(e){if(null==e&&(e=!0),this.brightness(10),this.newLayer((function(){return this.setBlendingMode("multiply"),this.opacity(80),this.copyParent(),this.filter.gamma(.8),this.filter.contrast(50),this.filter.exposure(10)})),this.newLayer((function(){return this.setBlendingMode("softLight"),this.opacity(80),this.fillColor("#f49600")})),this.exposure(20),this.gamma(.8),e)return this.vignette("45%",20)}))},function(e,t){Caman.Filter.register("jarques",(function(){return this.saturation(-35),this.curves("b",[20,0],[90,120],[186,144],[255,230]),this.curves("r",[0,0],[144,90],[138,120],[255,255]),this.curves("g",[10,0],[115,105],[148,100],[255,248]),this.curves("rgb",[0,0],[120,100],[128,140],[255,255]),this.sharpen(20)}))},function(e,t){Caman.Filter.register("love",(function(){return this.brightness(5),this.exposure(8),this.contrast(4),this.colorize("#c42007",30),this.vibrance(50),this.gamma(1.3)}))},function(e,t){Caman.Filter.register("oldBoot",(function(){return this.saturation(-20),this.vibrance(-50),this.gamma(1.1),this.sepia(30),this.channels({red:-10,blue:5}),this.curves("rgb",[0,0],[80,50],[128,230],[255,255]),this.vignette("60%",30)}))},function(e,t){Caman.Filter.register("orangePeel",(function(){return this.curves("rgb",[0,0],[100,50],[140,200],[255,255]),this.vibrance(-30),this.saturation(-30),this.colorize("#ff9000",30),this.contrast(-5),this.gamma(1.4)}))},function(e,t){Caman.Filter.register("pinhole",(function(){return this.greyscale(),this.sepia(10),this.exposure(10),this.contrast(15),this.vignette("60%",35)}))},function(e,t){Caman.Filter.register("sunrise",(function(){return this.exposure(3.5),this.saturation(-5),this.vibrance(50),this.sepia(60),this.colorize("#e87b22",10),this.channels({red:8,blue:8}),this.contrast(5),this.gamma(1.2),this.vignette("55%",25)}))},function(e,t){Caman.Filter.register("vintage",(function(e){if(null==e&&(e=!0),this.greyscale(),this.contrast(5),this.noise(3),this.sepia(100),this.channels({red:8,blue:2,green:4}),this.gamma(.87),e)return this.vignette("40%",30)}))},function(e,t){var n,r,o;r=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],n=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},Caman.Plugin.register("stackBlur",(function(e){var t,i,a,l,c,s,u,f,p,d,h,m,g,b,v,y,w,x,k,S,C,E,O,_,P,T,j,R,D,M,A,I,z,B,L,N,F,U,H,W,Y,V,X,q;if(!(isNaN(e)||e<1)){for(e|=0,v=this.pixelData,l=e+e+1,(D=this.dimensions.width)<<2,M=D-1,p=(f=this.dimensions.height)-1,R=(S=e+1)*(S+1)/2,O=j=new n,d=N=1;1<=l?Nl;d=1<=l?++N:--N)O=O.next=new n,d===S&&(_=O);for(O.next=j,P=null,T=null,L=z=0,h=r[e],E=o[e],I=F=0;0<=f?Ff;I=0<=f?++F:--F){for(w=c=t=k=u=a=0,x=S*(y=v[z]),s=S*(b=v[z+1]),i=S*(g=v[z+2]),k+=R*y,u+=R*b,a+=R*g,O=j,d=U=0;0<=S?US;d=0<=S?++U:--U)O.r=y,O.g=b,O.b=g,O=O.next;for(d=H=1;1<=S?HS;d=1<=S?++H:--H)m=z+((MD;A=0<=D?++W:--W)v[z]=k*h>>E,v[z+1]=u*h>>E,v[z+2]=a*h>>E,k-=x,u-=s,a-=i,x-=P.r,s-=P.g,i-=P.b,m=L+((m=A+e+1)D;A=0<=D?++Y:--Y){for(c=t=w=u=a=k=0,x=S*(y=v[z=A<<2]),s=S*(b=v[z+1]),i=S*(g=v[z+2]),k+=R*y,u+=R*b,a+=R*g,O=j,d=V=0;0<=S?VS;d=0<=S?++V:--V)O.r=y,O.g=b,O.b=g,O=O.next;for(B=D,d=X=1;1<=e?X<=e:X>=e;d=1<=e?++X:--X)z=B+A<<2,k+=(O.r=y=v[z])*(C=S-d),u+=(O.g=b=v[z+1])*C,a+=(O.b=g=v[z+2])*C,w+=y,c+=b,t+=g,O=O.next,df;I=0<=f?++q:--q)v[m=z<<2]=k*h>>E,v[m+1]=u*h>>E,v[m+2]=a*h>>E,k-=x,u-=s,a-=i,x-=P.r,s-=P.g,i-=P.b,m=A+((m=I+S)=0&&u.splice(t,1)}function g(e){var t=document.createElement("style");return e.attrs.type="text/css",b(t,e.attrs),h(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function v(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var a=s++;n=c||(c=g(t)),r=x.bind(null,n,a,!1),o=x.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",b(t,e.attrs),h(e,t),t}(t),r=S.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=k.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var r=[],o=0;o1||"string"!=typeof t||"r"!=t[0]&&"#"!=t[0]||"string"!=typeof n&&void 0!==n)return null;window.sbcRip||(window.sbcRip=function(e){var t=e.length,n=new Object;if(t>9){if((e=e.split(",")).length<3||e.length>4)return null;n[0]=r(e[0].slice(4)),n[1]=r(e[1]),n[2]=r(e[2]),n[3]=e[3]?parseFloat(e[3]):-1}else{if(8==t||6==t||t<4)return null;t<6&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?e[4]+""+e[4]:"")),e=r(e.slice(1),16),n[0]=e>>16&255,n[1]=e>>8&255,n[2]=255&e,n[3]=9==t||5==t?o((e>>24&255)/255*1e4)/1e4:-1}return n});var r=parseInt,o=Math.round,i=t.length>9,a=(i="string"==typeof n?n.length>9||"c"==n&&!i:i,e<0),l=(e=a?-1*e:e,n=n&&"c"!=n?n:a?"#000000":"#FFFFFF",window.sbcRip(t)),c=window.sbcRip(n);return l&&c?i?"rgb("+o((c[0]-l[0])*e+l[0])+","+o((c[1]-l[1])*e+l[1])+","+o((c[2]-l[2])*e+l[2])+(l[3]<0&&c[3]<0?")":","+(l[3]>-1&&c[3]>-1?o(1e4*((c[3]-l[3])*e+l[3]))/1e4:c[3]<0?l[3]:c[3])+")"):"#"+(4294967296+16777216*(l[3]>-1&&c[3]>-1?o(255*((c[3]-l[3])*e+l[3])):c[3]>-1?o(255*c[3]):l[3]>-1?o(255*l[3]):255)+65536*o((c[0]-l[0])*e+l[0])+256*o((c[1]-l[1])*e+l[1])+o((c[2]-l[2])*e+l[2])).toString(16).slice(l[3]>-1||c[3]>-1?1:3):null}var h=function(e,t){if(!e)return null;var n=function(e){return/^#?([a-f\d])([a-f\d])([a-f\d])$/i.test(e)||/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.test(e)}(e)?e:d(0,e,"c");if(!n)return null;var r=function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}(n);return r?"rgba(".concat(r.r,", ").concat(r.g,", ").concat(r.b,", ").concat(t,")"):e};function m(e){var t="";switch(e){case"watermark":t="\\e918";break;case"reset":t="\\e912";break;case"flip-v":t="\\e916";break;case"flip-h":t="\\e914";break;case"cross":t="\\e90c";break;case"effects":t="\\e900";break;case"filters":t="\\e904";break;case"adjust":t="\\e90a";break;case"crop":t="\\e901";break;case"resize":t="\\e907";break;case"rotate":t="\\e90b";break;case"previous":t="\\e905";break;case"next":t="\\e906";break;case"ratio":t="\\e90e";break;case"no-ratio":t="\\e90f";break;case"left-rotate":t="\\e902";break;case"right-rotate":t="\\e908";break;case"focus_point":t="\\e919";break;case"shapes":t="\\e91b";break;case"image":t="\\e91a";break;case"text":t="T";break;default:return}return"\n &:before {\n content: '".concat(t,"'\n }\n ")}function g(){var e=C(["\n#filerobot-image-editor-root & {\n text-transform: ",";\n height: 20px;\n line-height: 20px;\n}\n"]);return g=function(){return e},e}function b(){var e=C(["\n#filerobot-image-editor-root & {\n background: url('","') 50% 50% / cover no-repeat;\n width: 55px;\n height: 55px;\n border-radius: 2px;\n overflow: hidden;\n display: inline-block;\n}\n"]);return b=function(){return e},e}function v(){var e=C(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: top;\n padding: 10px;\n text-align: center;\n min-width: 90px;\n height: 90px;\n cursor: pointer;\n color: ",";\n font-size: 12px;\n background: ",";\n}\n \n #filerobot-image-editor-root &:hover {\n background: ",";\n }\n"]);return v=function(){return e},e}function y(){var e=C(["\n#filerobot-image-editor-root & {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n"]);return y=function(){return e},e}function w(){var e=C(["\n#filerobot-image-editor-root & {\n height: 20px;\n line-height: 20px;\n}\n"]);return w=function(){return e},e}function x(){var e=C(["\n#filerobot-image-editor-root & {\n height: 40px;\n font-size: 40px;\n \n ",";\n ",";\n}\n"]);return x=function(){return e},e}function k(){var e=C(["\n#filerobot-image-editor-root & {\n padding: 20px 10px;\n cursor: pointer;\n display: inline-block;\n min-width: 80px;\n min-height: 100px;\n text-align: center;\n font-size: 12px;\n color: ",";\n text-transform: ",";\n background: ",";\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n background: ",";\n }\n"]);return k=function(){return e},e}function S(){var e=C(["\n#filerobot-image-editor-root & {\n height: 100px;\n width: 100%;\n overflow-x: ",";\n overflow-y: ",";\n white-space: nowrap;\n text-align: center;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n height: initial;\n padding: 0 10px\n}\n }\n"]);return S=function(){return e},e}function C(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var E=a.b.div(S(),(function(e){return e.overlayYHidden?"auto":"none"}),(function(e){return e.overlayYHidden?"hidden":"visible"}),(function(e){return e.theme.colors.border||"#3b4d54"})),O=a.b.div(k(),(function(e){return e.theme.colors.text}),(function(e){return e.noCapitalStrs?"none":e.tt||"capitalize"}),(function(e){return e.active?e.theme.colors.secondaryBg:"inherit"}),(function(e){return e.theme.colors.textHover}),(function(e){return e.theme.colors.secondaryBg})),_=a.b.div(x(),(function(e){return p(e)}),(function(e){return m(e.name)})),P=a.b.div(w()),T=a.b.div(y(),(function(e){return e.theme.colors.border||"#3b4d54"})),j=a.b.div(v(),(function(e){return e.theme.colors.text}),(function(e){return e.active?e.theme.colors.secondaryBgHover:"transparent"}),(function(e){return e.theme.colors.secondaryBgHover})),R=a.b.div(b(),(function(e){return e.src})),D=a.b.div(g(),(function(e){return e.noCapitalStrs?"none":"capitalize"}));function M(){var e=I(["\n#filerobot-image-editor-root & {\n position: relative;\n background: ",";\n z-index: 1050;\n width: 100%;\n height: 100%;\n min-height: 520px;\n overflow: ",";\n font-size: 12px;\n}\n \n #filerobot-image-editor-root & .filerobot-original-canvas {\n visibility: hidden;\n position: absolute;\n left: -99999px;\n display: none;\n }\n \n #filerobot-image-editor-root & .cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n \n #filerobot-image-editor-root & .cropper-container img {/*Avoid margin top issue (Occur only when margin-top <= -height)*/\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-wrap-box,\n #filerobot-image-editor-root & .cropper-canvas,\n #filerobot-image-editor-root & .cropper-drag-box,\n #filerobot-image-editor-root & .cropper-crop-box,\n #filerobot-image-editor-root & .cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n }\n \n #filerobot-image-editor-root & .cropper-wrap-box,\n #filerobot-image-editor-root & .cropper-canvas {\n overflow: hidden;\n }\n \n #filerobot-image-editor-root & .cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n }\n \n #filerobot-image-editor-root & .cropper-modal {\n background-color: #000;\n opacity: .5;\n }\n \n #filerobot-image-editor-root & .cropper-view-box {\n display: block;\n height: 100%;\n outline-color: rgba(255, 255, 255, 0.75);\n outline: 1px solid #fff;\n overflow: hidden;\n width: 100%;\n ",";\n }\n \n #filerobot-image-editor-root & .cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: .5;\n position: absolute;\n }\n \n #filerobot-image-editor-root & .cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: 33.33333%;\n left: 0;\n top: 33.33333%;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: 33.33333%;\n top: 0;\n width: 33.33333%;\n }\n \n #filerobot-image-editor-root & .cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: .75;\n position: absolute;\n top: 50%;\n width: 0;\n }\n \n #filerobot-image-editor-root & .cropper-center:before,\n #filerobot-image-editor-root & .cropper-center:after {\n background-color: #fff;\n content: ' ';\n display: block;\n position: absolute;\n }\n \n #filerobot-image-editor-root & .cropper-center:before {\n height: 1px;\n left: -10px;\n top: 0;\n width: 20px;\n }\n \n #filerobot-image-editor-root & .cropper-center:after {\n height: 20px;\n left: 0;\n top: -10px;\n width: 1px;\n }\n \n #filerobot-image-editor-root & .cropper-face,\n #filerobot-image-editor-root & .cropper-line,\n #filerobot-image-editor-root & .cropper-point {\n display: block;\n height: 100%;\n opacity: .1;\n position: absolute;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n ",";\n }\n \n #filerobot-image-editor-root & .cropper-line {\n background-color: #fff;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n }\n \n #filerobot-image-editor-root & .cropper-point {\n background-color: #fff;\n height: 20px;\n opacity: .90;\n width: 20px;\n border-radius: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point:before {\n content: '';\n display: table;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: black;\n opacity: 0.8;\n z-index: 11;\n position: absolute;\n top: calc(50% - 4px);\n left: calc(50% - 4px);\n }\n \n #filerobot-image-editor-root & .cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -10px;\n right: -10px;\n top: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-w {\n cursor: ew-resize;\n left: -10px;\n margin-top: -10px;\n top: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-s {\n bottom: -10px;\n cursor: s-resize;\n left: 50%;\n margin-left: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-ne {\n cursor: nesw-resize;\n right: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-nw {\n cursor: nwse-resize;\n left: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-sw {\n bottom: -10px;\n cursor: nesw-resize;\n left: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-se {\n bottom: -10px;\n cursor: nwse-resize;\n height: 20px;\n right: -10px;\n width: 20px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-se:before {\n content: '';\n display: table;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: black;\n opacity: 0.8;\n z-index: 11;\n position: absolute;\n top: calc(50% - 4px);\n left: calc(50% - 4px);\n }\n \n #filerobot-image-editor-root & .cropper-invisible {\n opacity: 0;\n }\n \n #filerobot-image-editor-root & .cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n }\n \n #filerobot-image-editor-root & .cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n }\n \n #filerobot-image-editor-root & .cropper-hidden {\n display: none !important;\n }\n \n #filerobot-image-editor-root & .cropper-move {\n cursor: move;\n }\n \n #filerobot-image-editor-root & .cropper-crop {\n cursor: crosshair;\n }\n \n #filerobot-image-editor-root & .cropper-disabled .cropper-drag-box,\n #filerobot-image-editor-root & .cropper-disabled .cropper-face,\n #filerobot-image-editor-root & .cropper-disabled .cropper-line,\n #filerobot-image-editor-root & .cropper-disabled .cropper-point {\n cursor: not-allowed;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n justify-content: space-between\n}\n }\n"]);return M=function(){return e},e}function A(){var e=I(["\n#filerobot-image-editor-root & {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n width: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n \n #filerobot-image-editor-root & *, #filerobot-image-editor-root & *:after, #filerobot-image-editor-root & *:before, #filerobot-image-editor-root & *::after, #filerobot-image-editor-root & *::before {\n box-sizing: border-box;\n }\n \n #filerobot-image-editor-root & *:after, #filerobot-image-editor-root & *:before, #filerobot-image-editor-root & *::after, #filerobot-image-editor-root & *::before {\n padding: 0;\n margin: 0;\n outline: 0;\n box-sizing: border-box;\n }\n \n /* cyrillic-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY_ZraR2Tg8w2lzm7kLNL0-w.woff2) format('woff2');\n unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;\n }\n \n /* cyrillic */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY14sYYdJg5dU2qzJEVSuta0.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n }\n \n /* greek-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY1BW26QxpSj-_ZKm_xT4hWw.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n }\n \n /* greek */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpYwt_Rm691LTebKfY2ZkKSmI.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n }\n \n /* vietnamese */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY9DiNsR5a-9Oe_Ivpu8XWlY.woff2) format('woff2');\n unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;\n }\n \n /* latin-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY6E8kM4xWR1_1bYURRojRGc.woff2) format('woff2');\n unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;\n }\n \n /* latin */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY4gp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;\n }\n"]);return A=function(){return e},e}function I(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var z=Object(a.b)("div")(A(),(function(e){return e.theme.colors.border||"#3b4d54"})),B=a.b.div(M(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.isLoading?"hidden":"auto"}),(function(e){return e.roundCrop&&"border-radius: 50%"}),(function(e){return e.roundCrop&&"\n border-radius: 50%;\n box-shadow: 0 0 80px 15px #000;\n border: 2px solid #000;"}));function L(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function N(){var e=K(["\n#filerobot-image-editor-root & {\n margin-left: 8px;\n display: inline-block;\n vertical-align: middle;\n color: ",";\n margin-bottom: 3px;\n cursor: pointer;\n}\n"]);return N=function(){return e},e}function F(){var e=K(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n line-height: 30px;\n margin-right: 10px;\n float: right;\n}\n"]);return F=function(){return e},e}function U(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n width: 10px;\n height: 10px;\n margin: 5.5px;\n background: ",";\n position: absolute; top: 0; bottom: 0;\n right: ",";\n border: 1px solid ","; \n border-radius: 12px;\n transition: all 0.3s ease-in 0s;\n}\n"]);return U=function(){return e},e}function H(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n width: 200%; \n margin-left: ",';\n transition: margin 0.3s ease-in 0s;\n}\n \n #filerobot-image-editor-root &:before, #filerobot-image-editor-root &:after {\n display: block; float: left; width: 50%; height: 19px; padding: 0; line-height: 19px;\n font-size: 10px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;\n box-sizing: border-box;\n }\n \n #filerobot-image-editor-root &:before {\n content: "ON";\n padding-left: 10px !important;\n background-color: ','; \n color: #fff;\n }\n \n #filerobot-image-editor-root &:after {\n content: "OFF";\n padding-right: 10px !important;\n background-color: ',"; \n color: #aaa;\n text-align: right;\n }\n"]);return H=function(){return e},e}function W(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n overflow: hidden; \n cursor: pointer;\n border: 1px solid ","; \n border-radius: 4px;\n margin: 0;\n}\n"]);return W=function(){return e},e}function Y(){var e=K(["\n#filerobot-image-editor-root & {\n display: none !important;\n}\n \n #filerobot-image-editor-root & :checked + .onoffswitch-label .onoffswitch-inner {\n margin-left: 0;\n}\n"]);return Y=function(){return e},e}function V(){var e=K(["\n#filerobot-image-editor-root & {\n position: relative; \n display: inline-block;\n vertical-align: middle;\n width: 60px;\n margin-bottom: 2px;\n -webkit-user-select: none; \n -moz-user-select: none; \n -ms-user-select: none;\n}\n"]);return V=function(){return e},e}function X(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return X=function(){return e},e}function q(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return q=function(){return e},e}function $(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return $=function(){return e},e}function Q(){var e=K(["\n#filerobot-image-editor-root & {\n background: ",";\n border-top: 1px solid ",";\n height: 34px;\n position: relative;\n z-index: 1;\n}\n"]);return Q=function(){return e},e}function K(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Z=a.b.div(Q(),(function(e){return e.theme.colors.secondaryBg}),(function(e){return e.theme.colors.border})),G=a.b.div($(),(function(e){return p(e)}),m("previous"),(function(e){return se(e)})),J=a.b.div(q(),(function(e){return p(e)}),m("next"),(function(e){return se(e)})),ee=a.b.div(X(),(function(e){return p(e)}),m("reset"),(function(e){return se(e)})),te=a.b.div(V()),ne=a.b.input(Y()),re=a.b.label(W(),(function(e){return e.theme.colors.border})),oe=a.b.span(H(),(function(e){return e.checked?"0":"-100%"}),(function(e){var t;return(null===(t=e.theme.colors.button)||void 0===t?void 0:t.primary)||"#01717d"}),(function(e){return e.theme.colors.primaryBg})),ie=a.b.span(U(),(function(e){return e.theme.colors.accent}),(function(e){return e.checked?"0":"37px"}),(function(e){return e.theme.colors.accent})),ae=Object(a.b)("div").attrs((function(){return{className:"cloudimage-url-generator-switch"}}))(F()),le=Object(a.b)("div")(N(),(function(e){return e.theme.colors.text})),ce=function(e){var t=e.id,n=e.handleChange,r=e.text,o=e.checked,a=e.style;L(e,["id","handleChange","text","checked","style"]);return i.a.createElement(ae,{style:a},i.a.createElement(te,null,i.a.createElement(ne,{type:"checkbox",name:t,id:t,onChange:function(){n(!o)},checked:o}),i.a.createElement(re,{htmlFor:t},i.a.createElement(oe,{checked:o}),i.a.createElement(ie,{checked:o}))),r&&i.a.createElement(le,{onClick:function(){n(!o)}},r))};function se(e){return"\n display: inline-block;\n height: 34px;\n width: 34px;\n cursor: ".concat(e.muted?"not-allowed":"pointer",";\n text-align: center;\n line-height: 34px;\n border-right: 1px solid ").concat(e.theme.colors.border,";\n \n &:hover {\n background: ").concat(e.muted?"inherit":e.theme.colors.secondaryBgHover,";\n }\n ")}function ue(){var e=ye(["\n#filerobot-image-editor-root & {\n display: ",";\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n}\n"]);return ue=function(){return e},e}function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function de(){return(de=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function me(){var e=ye(["\n#filerobot-image-editor-root & {\n width: ","px;\n height: ","px;\n display: inline-block;\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n outline: 0;\n}\n"]);return me=function(){return e},e}function ge(){var e=ye(["\n#filerobot-image-editor-root & {\n display: inline-block;\n max-height: 100%;\n max-width: 100%;\n height: 100%;\n vertical-align: middle;\n\n ",";\n\n ",";\n}\n\n /* Limit image width to avoid overflow the container */\n\n #filerobot-image-editor-root & img {\n max-width: 100% !important; /* This rule is very important, please do not ignore this! */\n }\n\n #filerobot-image-editor-root & .filerobot-edit-canvas {\n display: ",";\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n }\n"]);return ge=function(){return e},e}function be(){var e=ye(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n}\n"]);return be=function(){return e},e}function ve(){var e=ye(["\n#filerobot-image-editor-root & {\n height: calc(100% - 187px);\n text-align: center;\n line-height: calc(100% - 187px);\n padding: 20px;\n position: relative;\n}\n\n #filerobot-image-editor-root &:before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n }\n"]);return ve=function(){return e},e}function ye(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var we=a.b.div(ve()),xe=Object(a.b)("div")(be()),ke=a.b.div(ge(),(function(e){return e.hideCanvas?"\n canvas {\n position: relative;\n left: -9999px;\n }\n ":"\n &:before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n }"}),(function(e){return e.isShowWatermark&&"\ncanvas:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: red;\n opacity: 0.5;\n }"}),(function(e){return e.hide?"none":"inline-block"})),Se=Object(a.b)("canvas")(me(),(function(e){return e.width||0}),(function(e){return e.height||0})),Ce=Object(a.b)(i.a.forwardRef((function(e,t){e.width,e.height;var n=he(e,["width","height"]);return i.a.createElement("div",de({className:"focus-point"},n,{ref:t}))})))((function(e){return{width:e.width,height:e.height,position:"absolute",margin:"auto",top:0,bottom:0,left:0,right:0,display:"inline-block",maxHeight:"100%",maxWidth:"100%",verticalAlign:"middle"}})),Ee=Object(a.b)((function(e){e.image;var t=he(e,["image"]);return i.a.createElement("div",t)}))((function(e){var t=e.image;return function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:"base",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=r?f.colors.base:null;return f.colors[t][i?i+(o?"er":""):n]}function Me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"base",n=e.light?"light":e.dark?"dark":null,r="base"!==t,o=f.colors.base;return n?f.colors[n][r?o:"base"]:f.colors.link[t]}function Ae(){var e=Fe(["\n#filerobot-image-editor-root & {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100px;\n background: ",";\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-direction: column;\n height: initial\n}\n }\n"]);return Ae=function(){return e},e}function Ie(){var e=Fe(["\n#filerobot-image-editor-root & {\n background: ",";\n border-color: ",";\n color: ",";\n text-transform: ",";\n min-width: 62px;\n height: 30px;\n margin-right: 8px;\n border: 0;\n}\n\n #filerobot-image-editor-root &:hover {\n background: ",";\n border-color: ",";\n color: ","; \n }\n"]);return Ie=function(){return e},e}function ze(){var e=Fe(["\n#filerobot-image-editor-root & {\n position: absolute;\n right: 12px;\n top: 8px;\n}\n"]);return ze=function(){return e},e}function Be(){var e=Fe(["\n#filerobot-image-editor-root & {\n text-align: center;\n text-transform: ",";\n color: ",";\n}\n"]);return Be=function(){return e},e}function Le(){var e=Fe(["\n#filerobot-image-editor-root & {\n line-height: 35px;\n border-bottom: 1px solid ",";\n background: ",";\n padding: 8px 0;\n}\n"]);return Le=function(){return e},e}function Ne(){var e=Fe(["\n#filerobot-image-editor-root & {\n background: ",";\n}\n"]);return Ne=function(){return e},e}function Fe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ue=a.b.div(Ne(),(function(e){return e.theme.colors.secondaryBg})),He=a.b.div(Le(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBg})),We=a.b.div(Be(),(function(e){return e.noCapitalStrs?"none":"capitalize"}),(function(e){return e.theme.colors.text})),Ye=a.b.div(ze()),Ve=Object(a.b)(je)(Ie(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.text}),(function(e){return e.noCapitalStrs?"none":"capitalize"}),(function(e){return function(e){if(!e)return null;var t=d(-.1,e)||"";return t.toLowerCase()===e.toLowerCase()?d(.25,e):t}(e.theme.colors.primaryBg)}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.text})),Xe=a.b.div(Ae(),(function(e){return e.theme.colors.secondaryBg}));function qe(){var e=st(["\n#filerobot-image-editor-root & {\n height: 20px;\n line-height: 20px;\n}\n"]);return qe=function(){return e},e}function $e(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n height: 50px;\n}\n"]);return $e=function(){return e},e}function Qe(){var e=st(["\n#filerobot-image-editor-root & {\n height: 50px;\n line-height: 50px;\n}\n"]);return Qe=function(){return e},e}function Ke(){var e=st(["\n#filerobot-image-editor-root & {\n height: ","px;\n border: 1px solid ",";\n width: ","px;\n margin: 0 auto;\n display: inline-block;\n vertical-align: middle;\n ",";\n}\n"]);return Ke=function(){return e},e}function Ze(){var e=st(["\n#filerobot-image-editor-root & {\n padding: 15px 0;\n height: 90px;\n line-height: 100px;\n}\n"]);return Ze=function(){return e},e}function Ge(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: top;\n text-align: center;\n padding: 0 20px;\n cursor: pointer;\n background: ",";\n}\n"]);return Ge=function(){return e},e}function Je(){var e=st(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: relative;\n font-weight: bold;\n font-size: ",";\n\n ",";\n ",";\n \n color: ",";\n}\n"]);return Je=function(){return e},e}function et(){var e=st(["\n#filerobot-image-editor-root & {\n padding: 0;\n}\n \n #filerobot-image-editor-root & > span {\n color: "," !important;\n }\n"]);return et=function(){return e},e}function tt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n padding: 0 5px;\n}\n"]);return tt=function(){return e},e}function nt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: ",";\n height: 30px;\n padding: 6px 12px;\n font-size: 12px;\n line-height: 1;\n color: ",";\n background: ",";\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n vertical-align: middle;\n border: 0px solid transparent;\n font-family: Roboto, sans-serif;\n border: 1px solid ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n \n #filerobot-image-editor-root &:hover {\n outline: none;\n }\n \n #filerobot-image-editor-root &:focus {\n outline: none;\n }\n"]);return nt=function(){return e},e}function rt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: ",";\n ",";\n height: 30px;\n padding: 6px 12px;\n font-size: 12px;\n line-height: 30px;\n color: ",";\n background: ",";\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out;\n vertical-align: middle;\n font-family: Roboto, sans-serif;\n border: 1px solid ",";\n \n ",";\n}\n \n #filerobot-image-editor-root &:hover {\n outline: none;\n }\n \n #filerobot-image-editor-root &:focus {\n outline: none;\n }\n"]);return rt=function(){return e},e}function ot(){var e=st(["\n#filerobot-image-editor-root & {\n display: block;\n margin-bottom: 5px;\n line-height: 15px;\n}\n"]);return ot=function(){return e},e}function it(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: 100px;\n padding-top: 10px;\n text-align: center;\n}\n"]);return it=function(){return e},e}function at(){var e=st(["\n#filerobot-image-editor-root & {\n display: block;\n color: ",";\n height: 30px;\n line-height: 30px;\n}\n"]);return at=function(){return e},e}function lt(){var e=st(["\n@media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n overflow-x: scroll\n}\n }\n"]);return lt=function(){return e},e}function ct(){var e=st(["\n#filerobot-image-editor-root & {\n color: ",";\n display: flex;\n}\n \n @media (min-widthL 768px) {\n#filerobot-image-editor-root & {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap\n}\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-direction: column\n}\n }\n"]);return ct=function(){return e},e}function st(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ut=a.b.div(ct(),(function(e){return e.theme.colors.text})),ft=Object(a.b)("div")(lt()),pt=a.b.div(at(),(function(e){return e.theme.colors.text})),dt=a.b.div(it()),ht=a.b.label(ot()),mt=a.b.input.attrs((function(e){return{type:e.type?e.type:"text"}}))(rt(),(function(e){return e.fullSize?"100%":e.theme.fieldWidth}),(function(e){return!e.fullSize&&"max-width: 400px;"}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.border}),(function(e){return"number"===e.type&&"::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }"})),gt=Object(a.b)("input").attrs((function(e){return{type:e.type?e.type:"file"}}))(nt(),(function(e){return e.fullSize?"100%":e.theme.fieldWidth}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.border})),bt=a.b.div(tt()),vt=Object(a.b)(je)(et(),(function(e){return e.active?e.theme.colors.text:e.theme.colors.textMute})),yt=a.b.span(Je(),(function(e){return e.fz||"28px"}),(function(e){return p(e)}),(function(e){return m(e.active?"ratio":"no-ratio")}),(function(e){return e.theme.textMuted})),wt=a.b.div(Ge(),(function(e){return e.active?e.theme.colors.secondaryBgHover:"transparent"})),xt=a.b.div(Ze()),kt=a.b.div(Ke(),(function(e){return _t(e.ratio)}),(function(e){return e.theme.textColor}),(function(e){return Ot(e.ratio)}),(function(e){var t=e.radius;return t&&"border-radius: ".concat(t,"%;")})),St=Object(a.b)("div")(Qe()),Ct=Object(a.b)("div")($e()),Et=a.b.div(qe()),Ot=function(e){var t=50*e;return t>200&&(t=200),t},_t=function(e){var t=50;return 50*e>200&&(t=200/e),t};function Pt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n background: ",";\n padding: 15px;\n margin: 5px;\n border-radius: 4px;\n cursor: pointer;\n}\n \n #filerobot-image-editor-root &:hover {\n background-color: ",";\n }\n"]);return Pt=function(){return e},e}function Tt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n}\n"]);return Tt=function(){return e},e}function jt(){var e=It(["\n#filerobot-image-editor-root & {\n max-width: 600px;\n margin: 15px auto;\n background: ",";\n border-radius: 4px;\n padding: 15px;\n}\n \n #filerobot-image-editor-root & h4 {\n line-height: 1.4;\n font-size: 16px;\n color: ",";\n }\n"]);return jt=function(){return e},e}function Rt(){var e=It(["\n#filerobot-image-editor-root & {\n color: ",";\n font-size: 14px;\n max-width: 600px;\n line-height: 1.4;\n margin: 0 auto;\n background: ",";\n border-radius: 4px;\n padding: 15px 15px 15px 55px;\n position: relative;\n font-weight: normal;\n text-align: left;\n}\n \n #filerobot-image-editor-root &:before {\n content: '\\e917';\n font-family: filerobot-image-editor-font;\n position: absolute;\n font-size: 20px;\n line-height: 20px;\n left: 20px;\n top: 50%;\n margin-top: -10px;\n }\n"],["\n#filerobot-image-editor-root & {\n color: ",";\n font-size: 14px;\n max-width: 600px;\n line-height: 1.4;\n margin: 0 auto;\n background: ",";\n border-radius: 4px;\n padding: 15px 15px 15px 55px;\n position: relative;\n font-weight: normal;\n text-align: left;\n}\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e917';\n font-family: filerobot-image-editor-font;\n position: absolute;\n font-size: 20px;\n line-height: 20px;\n left: 20px;\n top: 50%;\n margin-top: -10px;\n }\n"]);return Rt=function(){return e},e}function Dt(){var e=It(["\n#filerobot-image-editor-root & button {\n min-width: 240px;\n }\n"]);return Dt=function(){return e},e}function Mt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n}\n \n @media (min-width: 768px) {\n#filerobot-image-editor-root & {\n width: 300px;\n padding: 20px;\n height: 100px\n}\n }\n"]);return Mt=function(){return e},e}function At(){var e=It(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n justify-content: center\n}\n }\n"]);return At=function(){return e},e}function It(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var zt=a.b.div(At(),(function(e){return e.theme.colors.text})),Bt=a.b.div(Mt()),Lt=Object(a.b)("div")(Dt()),Nt=Object(a.b)("p")(Rt(),(function(e){return e.theme.colors.textWarn}),(function(e){return e.theme.colors.secondaryBg})),Ft=Object(a.b)("div")(jt(),(function(e){return e.theme.colors.secondaryBg}),(function(e){return e.theme.colors.text})),Ut=Object(a.b)("div")(Tt()),Ht=Object(a.b)("div")(Pt(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBgHover}));function Wt(){var e=Qt(["\n@media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 50%;\n margin-right: 0 !important\n}\n }\n"]);return Wt=function(){return e},e}function Yt(){var e=Qt(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n height: 16px;\n font-size: 16px;\n margin-top: -4px;\n display: inline-block;\n vertical-align: middle;\n color: ",";\n margin-right: 5px;\n}\n"]);return Yt=function(){return e},e}function Vt(){var e=Qt(["\n#filerobot-image-editor-root & {\n display: flex;\n width: 100%;\n flex-wrap: wrap;\n justify-content: center;\n}\n"]);return Vt=function(){return e},e}function Xt(){var e=Qt(["\n#filerobot-image-editor-root & {\n margin-top: 10px;\n width: 100%;\n}\n \n #filerobot-image-editor-root & button {\n text-transform: none;\n font-size: 12px;\n min-width: 142px;\n margin-right: 5px;\n }\n \n #filerobot-image-editor-root & button:focus, #filerobot-image-editor-root & button:active {\n outline: none !important;\n box-shadow: none !important;\n }\n"]);return Xt=function(){return e},e}function qt(){var e=Qt(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: 100%;\n}\n"]);return qt=function(){return e},e}function $t(){var e=Qt(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n}\n \n #filerobot-image-editor-root & svg {\n margin-top: -7px;\n width: 750px;\n }\n \n #filerobot-image-editor-root & svg text {\n font-size: 2px;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper {\n width: 280px;\n padding: 0;\n margin: 12px auto 0;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range {\n background: none;\n width: 280px;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 9px;\n height: 18px;\n border-radius: 50%;\n background: ",";\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range::-moz-range-thumb {\n border: none;\n width: 9px;\n height: 18px;\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper label {\n display: none;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper :after {\n display: none;\n }\n \n @media (max-width: 768px) {\n #filerobot-image-editor-root & svg {\n width: 100%;\n }\n }\n"]);return $t=function(){return e},e}function Qt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Kt=a.b.div($t(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text})),Zt=a.b.div(qt()),Gt=a.b.div(Xt()),Jt=Object(a.b)("div")(Vt()),en=a.b.span(Yt(),(function(e){return p(e)}),(function(e){return m(e.name)}),(function(e){return e.theme.colors.text})),tn=Object(a.b)(Ve)(Wt());function nn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n display: flex;\n justify-content: center;\n width: fit-content;\n margin: 0 auto;\n}\n\n #filerobot-image-editor-root & div {\n margin-left: 10px;\n }\n\n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-wrap: wrap\n}\n \n #filerobot-image-editor-root & .image-editor-range-wrapper {\n width: 50%;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input {\n width: 100% !important;\n }\n }\n"]);return nn=function(){return e},e}var rn=a.b.div(nn(),(function(e){return e.theme.colors.text}));function on(){var e=ln(["\n#filerobot-image-editor-root & {\n position: absolute;\n z-index: 999;\n top: 36px;\n left: 0;\n right: 0;\n height: 104px;\n cursor: not-allowed;\n}\n"]);return on=function(){return e},e}function an(){var e=ln(["\n#filerobot-image-editor-root & {\n position: absolute;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n cursor: wait;\n}\n"]);return an=function(){return e},e}function ln(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var cn=a.b.div(an()),sn=Object(a.b)("div")(on());function un(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\e90c'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e90c'\n }\n"]);return un=function(){return e},e}a.b.span.attrs((function(){return{role:"button"}}))(un(),(function(e){return e.t||"10px"}),(function(e){return e.r||"10px"}),(function(e){return e.l||"auto"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"18px"}),(function(e){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function fn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\26F6'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\26F6'\n }\n"]);return fn=function(){return e},e}var pn=a.b.span.attrs((function(){return{role:"button"}}))(fn(),(function(e){return e.t||"18px"}),(function(e){return e.r||"auto"}),(function(e){return e.l||"20px"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"15px"}),(function(e){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function dn(){var e=mn(["\n#filerobot-image-editor-root & {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 200px;\n height: 200px;\n margin: auto;\n padding: 40px;\n border-radius: 50%;\n background: ",";\n}\n \n #filerobot-image-editor-root & .svg-spin-icon {\n fill: ",";\n }\n \n #filerobot-image-editor-root & p {\n color: ",";\n }\n"]);return dn=function(){return e},e}function hn(){var e=mn(["\n#filerobot-image-editor-root & {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: ",";\n background: "," !important;\n opacity: "," !important;\n z-index: 1042;\n}\n"]);return hn=function(){return e},e}function mn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var gn=a.b.div(hn(),(function(e){return e.fullScreen?"fixed":"absolute"}),(function(e){return e.overlay?"rgba(10,10,10,0.26)":"transparent"}),(function(e){return e.overlay?"0.25":"0"})),bn=Object(a.b)("div")(dn(),(function(e){return e.theme.colors.secondaryBgOpacity}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text})),vn=function(e){return e.show?i.a.createElement(o.Fragment,null,i.a.createElement(gn,{fullScreen:e.fullScreen,overlay:e.overlay}),i.a.createElement(bn,null,i.a.createElement("svg",{id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 150 150",style:{enableBackground:"new 0 0 150 150"}},i.a.createElement("path",{className:"svg-spin-icon",d:"M74.9,14.8c-12.2,0-24.3,0-36.5,0c-2.4,0-3.9-1-4.8-3.1c-1.3-3-1.2-6,0.6-8.9c0.8-1.3,2-2,3.5-2\r c1.1,0,2.3,0,3.4,0c23.3,0,46.7,0,70-0.1c3.9,0,5.3,1.9,6,4.7c0.5,2.1,0.4,4.2-0.5,6.3c-0.9,2.2-2.5,3.1-4.8,3c-2.9,0-5.7,0-8.6,0\r C93.9,14.8,84.4,14.8,74.9,14.8z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M75.1,118.1c12,0,24,0,35.9,0c4,0,5.9,1.7,6.3,5.7c0.1,1.4,0,2.9-0.3,4.2c-0.7,2.9-2.4,4.1-5.3,4.1\r c-24.1,0-48.3,0-72.4,0c-3.7,0-5.4-1.2-6.3-5.3c-0.4-2-0.1-3.9,0.7-5.7c0.9-2,2.4-3.1,4.7-3C50.6,118.1,62.9,118.1,75.1,118.1z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M75.3,76.3c0.2,0.4,3.1,9.3,7.2,14.1c3.9,4.7,8.9,8.5,13,12.5c3.2,3.2,5.4,7,6.8,11.2c0.5,1.6,0.3,1.9-1.4,1.9\r c-17.3,0-34.5,0-51.8,0c-1.7,0-1.9-0.2-1.3-1.8c1.8-5.5,5.2-10,9.4-13.9c3.5-3.3,7.7-6.1,10.6-9.9c3.5-4.7,6.8-13.3,7.1-14.1\r C75.1,76.3,75.2,76.3,75.3,76.3z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M45.5,23.6c0,3.8-0.1,7.6,1.2,11.3c1,2.9,2.8,5.2,4.9,7.3c5,5.3,10.2,10.5,15.2,15.8c1.1,1.2,2,2.6,3.1,3.9\r c2,2.5,2.2,7.6-0.2,10.5c-1.8,2.2-3.6,4.3-5.5,6.4C59.5,84,54.7,89.1,50,94.2c-3.1,3.4-4.4,7.5-4.5,12c0,2.8-0.1,5.6,0,8.4\r c0,1-0.3,1.4-1.4,1.4c-1.7,0-2.3,0-3.7,0c-0.9,0-1.3-0.4-1.3-1.3c0-5-0.3-10,0.8-14.9c0.8-3.5,2.5-6.6,4.8-9.3\r c3.6-4.2,7.5-8.2,11.3-12.3c1.7-1.8,3.3-3.7,4.9-5.5c0.9-1,1.9-2,2.7-3c1.8-2.3,1.6-4.3-0.4-6.4c-5.2-5.4-10.4-11-15.8-16.3\r c-5.7-5.7-8.4-12.4-8.3-20.4c0-2.9,0-5.7,0-8.6c0-1.1,0.4-1.6,1.5-1.5c1.3,0,2.6,0,3.8,0c0.8,0,1.1,0.3,1.1,1.2\r C45.5,19.8,45.5,21.7,45.5,23.6z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M109.9,35.9c-0.6,2.7-2.1,5.3-3.9,7.5c-3.5,4.2-7.5,8.1-11.2,12.1c-3,3.2-5.9,6.5-8.8,9.7\r c-0.9,1-0.9,2.1-0.2,3.1c1.2,1.7,2.5,3.3,3.8,4.8c1.5,1.8,3,3.6,4.6,5.3c3.4,3.6,6.8,7.1,10.1,10.7c4.7,5.1,6.8,11.2,6.9,18.1\r c0,2.4,0,5,0,7.5c0,1.3-0.3,1.5-1.6,1.5c-1.3,0-2.1,0-3.3,0c-1.1,0-1.5-0.4-1.5-1.5c0-3.4-0.2-6.7-0.3-10.1\r c-0.1-4.1-1.9-7.5-4.5-10.5c-3.3-3.8-6.8-7.4-10.2-11.1c-3.3-3.5-6.9-6.6-9.3-10.8c-0.8-1.5-1.4-3.2-1.7-4.9c-0.4-2.1,0.7-4,1.9-5.5\r c3.1-3.8,6.5-7.4,9.8-11.1c2.9-3.2,6-6.2,9-9.3c3.5-3.6,5.1-8,5.2-13c0-3.4,0.1-6.7,0.1-10.1c0-1.1,0.3-1.5,1.3-1.4\r c1.2,0,2.4,0,3.6,0c1.2,0,1.6,0.5,1.6,1.6c-0.1,1.6,0,3.1,0,4.7C111.4,23,110.9,31.7,109.9,35.9z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M74.8,67.9c-0.2-1.3-1.1-5.7-1.5-7C71.4,54,59.7,44.3,54.3,39c-0.7-0.7-1.3-1.5-1.8-2.5\r c7.1,3.4,14.4,6.1,22.6,6.1c8.2,0,15.5-2.6,22.4-6.2c0.1,0.1,0.2,0.2,0.3,0.3c-0.5,0.6-0.9,1.2-1.4,1.8c-4.5,4.5-18.7,15.5-20,22.4\r c-0.2,0.8-1,6.2-1.2,7C75.1,67.9,75,67.9,74.8,67.9z"}),i.a.createElement("g",null)),i.a.createElement("p",{style:{textAlign:"center"}},e.label))):null};function yn(){var e=jn(["\n#filerobot-image-editor-root & {\n width: 200px;\n height: 70px;\n display: inline-block;\n vertical-align: middle;\n background: "," url(",") 50% 50% / contain no-repeat; \n margin: 10px;\n padding: 20px;\n border-radius: 4px;\n cursor: pointer;\n}\n \n #filerobot-image-editor-root &:hover {\n background-color: ",";\n }\n"]);return yn=function(){return e},e}function wn(){var e=jn(["\n#filerobot-image-editor-root & {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n line-height: 100px;\n background: ",";\n}\n"]);return wn=function(){return e},e}function xn(){var e=jn(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n margin-left: 20px;\n cursor: pointer;\n}\n"]);return xn=function(){return e},e}function kn(){var e=jn(["\n#filerobot-image-editor-root & {\n width: 30px;\n height: 30px;\n display: inline-block;\n vertical-align: top;\n border: 1px solid ",";\n background: ",";\n cursor: ",";\n \n ",";\n}\n"]);return kn=function(){return e},e}function Sn(){var e=jn(["\n#filerobot-image-editor-root & {\n width: 100px;\n padding: 10px;\n display: inline-block;\n vertical-align: top;\n}\n \n /* The container */\n \n #filerobot-image-editor-root & label {\n display: block;\n position: relative;\n line-height: 12px;\n padding-left: 15px;\n margin-bottom: 12px;\n cursor: pointer;\n user-select: none;\n }\n \n /* Hide the browser's default radio button */\n \n #filerobot-image-editor-root & label input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n }\n \n /* Create a custom radio button */\n \n #filerobot-image-editor-root & span {\n position: absolute;\n top: 0;\n left: 0;\n height: 10px;\n width: 10px;\n background-color: ",";\n border-radius: 50%;\n }\n \n /* On mouse-over, add a grey background color */\n \n #filerobot-image-editor-root & label:hover input ~ span {\n /* background-color: #ccc; */\n }\n \n /* When the radio button is checked, add a blue background */\n \n #filerobot-image-editor-root & label input:checked ~ span {\n background-color: ",";\n }\n \n #filerobot-image-editor-root & label input:checked ~ span:after {\n background-color: ",';\n }\n \n /* Create the indicator (the dot/circle - hidden when not checked) */\n \n #filerobot-image-editor-root & span:after {\n content: "";\n position: absolute;\n display: none;\n }\n \n /* Show the indicator (dot/circle) when checked */\n \n #filerobot-image-editor-root & label input:checked ~ span:after {\n display: block;\n }\n \n /* Style the indicator (dot/circle) */\n \n #filerobot-image-editor-root & label span:after {\n top: 3px;\n left: 2px;\n width: 6px;\n height: 5px;\n border-radius: 50%;\n background: ',";\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%\n}\n \n #filerobot-image-editor-root & label {\n display: inline-block;\n margin-right: 10px;\n }\n }\n"]);return Sn=function(){return e},e}function Cn(){var e=jn(["\n#filerobot-image-editor-root & {\n width: 100px;\n padding: 5px;\n display: inline-block;\n font-size: 0;\n}\n \n #filerobot-image-editor-root & div:nth-child(1) {\n border-radius: 4px 0 0 0;\n }\n \n #filerobot-image-editor-root & div:nth-child(3) {\n border-radius: 0 4px 0 0;\n }\n \n #filerobot-image-editor-root & div:nth-child(7) {\n border-radius: 0 0 0 4px;\n }\n \n #filerobot-image-editor-root & div:nth-child(9) {\n border-radius: 0 0 4px 0;\n }\n"]);return Cn=function(){return e},e}function En(){var e=jn(["\n#filerobot-image-editor-root & {\n width: calc(100% - 200px);\n display: inline-block;\n vertical-align: top;\n padding: 0 40px;\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n padding: 0\n}\n }\n"]);return En=function(){return e},e}function On(){var e=jn(["\n#filerobot-image-editor-root & {\n display: inline;\n vertical-align: middle;\n padding: 10px;\n}\n\n #filerobot-image-editor-root & label {\n min-width: 120px;\n display: inline-block;\n vertical-align: middle;\n }\n"]);return On=function(){return e},e}function _n(){var e=jn(["\n#filerobot-image-editor-root & {\n ",";\n}\n"]);return _n=function(){return e},e}function Pn(){var e=jn(["\n#filerobot-image-editor-root & {\n padding: 10px;\n}\n \n #filerobot-image-editor-root & label {\n min-width: 120px;\n display: inline-block;\n vertical-align: middle;\n margin: 0;\n }\n \n #filerobot-image-editor-root & input {\n width: 100%;\n }\n"]);return Pn=function(){return e},e}function Tn(){var e=jn(["\n#filerobot-image-editor-root & {\n position: relative;\n color: ",";\n text-align: left;\n white-space: normal;\n width: fit-content;\n margin: 0 auto;\n}\n \n #filerobot-image-editor-root & .image-editor-range {\n display: inline-block;\n padding: 5px;\n vertical-align: middle;\n }\n \n #filerobot-image-editor-root & .image-editor-range :after {\n display: none;\n }\n \n #filerobot-image-editor-root & .image-editor-range label {\n display: none;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n align-items: center\n}\n \n #filerobot-image-editor-root & .image-editor-range {\n width: 100%;\n }\n \n #filerobot-image-editor-root & .image-editor-range input {\n width: 100% !important;\n }\n }\n"]);return Tn=function(){return e},e}function jn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Rn=a.b.div(Tn(),(function(e){return e.theme.colors.text})),Dn=Object(a.b)("div")(Pn()),Mn=Object(a.b)("div")(_n(),(function(e){return"right"===e.switcherPosition?".cloudimage-url-generator-switch {\n margin-left: 100px;\n margin-top: -6px;\n \n label {\n min-width: auto;\n }\n \n @media (max-width: 768px) {\n margin-left: 4px;\n }\n }":"padding: 10px;"})),An=Object(a.b)("div")(On()),In=Object(a.b)("div")(En()),zn=Object(a.b)("div")(Cn()),Bn=Object(a.b)("div")(Sn(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.accent}),(function(e){return e.theme.colors.text})),Ln=Object(a.b)("div")(kn(),(function(e){return e.theme.colors.secondaryBgHover}),(function(e){var t;return e.clickable?e.active?(null===(t=e.theme.colors.button)||void 0===t?void 0:t.primary)||e.theme.colors.primaryBg:e.theme.colors.accent:e.theme.colors.disabledBg}),(function(e){return e.clickable?"pointer":"not-allowed"}),(function(e){if(0!==e.clickable&&!e.active)return"\n &:hover {\n background: ".concat(e.theme.colors.primaryBg,";\n }\n ")})),Nn=(Object(a.b)("div")(xn()),Object(a.b)("div")(wn(),(function(e){return e.theme.colors.secondaryBg}))),Fn=Object(a.b)("div")(yn(),(function(e){return e.theme.colors.primaryBgHover}),(function(e){return e.src}),(function(e){return e.theme.colors.secondaryBgHover}));function Un(e){return(Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wn(e){for(var t=1;t1&&m)&&(-1!==h||1!==d.length);return i.a.createElement(Z,null,i.a.createElement(ee,{muted:"preview"!==s,onClick:function(){"preview"===s&&c()},title:u["footer.reset"]}),i.a.createElement(G,{onClick:function(){!g&&l({operationIndex:h-1,operationObject:Wn(Wn({},d[h]),{},{index:h})})},muted:g,title:u["footer.undo"]}),i.a.createElement(J,{onClick:function(){!b&&l({operationIndex:h+1,operationObject:Wn(Wn({},d[h]),{},{index:h})})},muted:b,title:u["footer.redo"]}),f&&p&&i.a.createElement(ce,{id:"switch-watermark-footer",checked:p&&p.applyByDefault,handleChange:this.onApplyWatermarkChange,text:u["common.apply_watermark"]}))}}])&&Vn(t.prototype,n),r&&Vn(t,r),a}(o.Component),Jn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"filerobot";return"filerobot"===t?"https://api.filerobot.com/".concat(e,"/v3/"):"https://".concat(e,".api.airstore.io/v1/")},er="filerobot-image-editor-modal",tr="filerobot-image-edit-box",nr="filerobot-image-edit-box-original",rr=["adjust","effects","filters","rotate","crop","resize","watermark","shapes","image","text"],or=["edge_enhance","emboss","grungy","hazy","lomo","radial_blur","sin_city","tilt_shift"],ir=["cross_process","glow_sun","jarques","love","old_boot","orange_peel","pin_hole","sepia","sun_rise","vintage"],ar=["crop","resize","rotate","watermark","focus_point"],lr=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],cr={corners:[1,0,1,0,0,0,1,0,1],star:[0,1,0,1,1,1,0,1,0],center:[0,0,0,0,1,0,0,0,0],"top-row":[1,1,1,0,0,0,0,0,0],"center-row":[0,0,0,1,1,1,0,0,0],"bottom-row":[0,0,0,0,0,0,1,1,1]},sr={opacity:.7,position:"center",url:"",applyByDefault:!1},ur=[{label:"Arial",value:"Arial"},{label:"Tahoma",value:"Tahoma"},{label:"Times New Roman",value:"Times New Roman"},{label:"Courier",value:"Courier"},{label:"Courier New",value:"Courier New"},{label:"Verdana",value:"Verdana"},{label:"Georgia",value:"Georgia"},{label:"Palatino",value:"Palatino"},{label:"Garamond",value:"Garamond"},{label:"Bookman",value:"Bookman"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Candara",value:"Candara"},{label:"Impact",value:"Impact"}],fr=[{label:"Arial",value:"Arial"},{label:"Arial Bold",value:"Arial-Bold"},{label:"Arial Black",value:"Arial-Black"},{label:"AvantGarde Book",value:"AvantGarde-Book"},{label:"Bitstream Charter",value:"Bitstream-Charter"},{label:"Bitstream Charter Bold",value:"Bitstream-Charter-Bold"},{label:"Bookman Demi",value:"Bookman-Demi"},{label:"Comic Sans MS",value:"Comic-Sans-MS"},{label:"Courier",value:"Courier"},{label:"Courier Bold",value:"Courier-Bold"},{label:"Courier New",value:"Courier-New\t"},{label:"Courier New Bold",value:"Courier-New-bold"},{label:"DejaVu Sans",value:"DejaVu-Sans"},{label:"DejaVu Sans Bold",value:"DejaVu-Sans-bold"},{label:"Dingbats",value:"Dingbats"},{label:"fixed",value:"fixed"},{label:"FreeMono",value:"FreeMono"},{label:"FreeMono Bold",value:"FreeMono-Bold"},{label:"FreeSans",value:"FreeSans-Bold"},{label:"Halvetica",value:"Halvetica"},{label:"Georgia",value:"Georgia"},{label:"Impact",value:"Impact"},{label:"Noto mono",value:"Noto-Mono"}],pr="rect",dr="square",hr="circle",mr="image",gr="text",br={hideCloudimageSwitcher:!0,processWithCloudimage:!1,uploadWithCloudimageLink:!1,elementId:null,isLowQualityPreview:!0,reduceBeforeEdit:{mode:"manual",widthLimit:2e3,heightLimit:2e3},cropBeforeEdit:null,cropPresets:[{name:"original",value:0},{name:"square",value:1},{name:"banner",value:7.8},{name:"round",value:1,radius:50},{name:"5 : 4",value:1.25},{name:"4 : 3",value:1.33333},{name:"6 : 4",value:1.5},{name:"16 : 9",value:1.7777}],resizePresets:[{name:"big square",width:600,height:600,ratio:1},{name:"middle square",width:400,height:400,ratio:1},{name:"small square",width:200,height:200,ratio:1},{name:"small size",width:1200,height:960,ratio:1.25},{name:"better quality",width:1920,height:1536,ratio:1.25},{name:"small size",width:1200,height:900,ratio:1.33333},{name:"better quality",width:1920,height:1440,ratio:1.33333},{name:"small size",width:1200,height:800,ratio:1.5},{name:"better quality",width:1920,height:1280,ratio:1.5},{name:"small size",width:1200,height:675,ratio:1.7777},{name:"better quality",width:1920,height:1080,ratio:1.7777},{name:"small banner",width:468,height:60,ratio:7.8},{name:"big banner",width:936,height:120,ratio:7.8}]},vr="close-button-clicked",yr="toolbar-cancel-button-clicked",wr="esc-key-pressed",xr="modal-overlay-clicked",kr="image-edits-completed",Sr="image-downloaded",Cr="image-uploaded-filerobot",Er="image-uploaded-cloudimage",Or="image-uploading-fail-filerobot",_r="new",Pr="duplicate",Tr="replace",jr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return window.document.querySelector("#".concat(e,"_").concat(t||(n?nr:tr)))},Rr=function(e){switch(e){case"colorize":return"colorize";case"contrast":return"contrast";case"cross_process":return"crossProcess";case"glow_sun":return"glowingSun";case"hdr_effect":return"hdr";case"jarques":return"jarques";case"love":return"love";case"old_boot":return"oldBoot";case"orange_peel":return"orangePeel";case"pin_hole":return"pinhole";case"pleasant":return"pleasant";case"sepia":return"sepia";case"sun_rise":return"sunrise";case"vintage":return"vintage";case"clarity":return"";case"edge_enhance":return"edgeEnhance";case"emboss":return"emboss";case"grungy":return"grungy";case"hazy":return"hazyDays";case"lomo":return"lomo";case"noise":return"noise";case"old_paper":return"oldPaper";case"posterize":return"posterize";case"radial_blur":return"radialBlur";case"sin_city":return"sinCity";case"tilt_shift":return"tiltShift";default:return null}},Dr=function(e){switch(e){case"colorize":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/colorize.jpg";case"contrast":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/contrast.png";case"cross_process":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/cross_process.png";case"glow_sun":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/glow_sun.png";case"hdr_effect":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/hdr_effect.png";case"jarques":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/jarques.png";case"love":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/love.png";case"old_boot":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/old_boot.png";case"orange_peel":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/orange_peel.png";case"pin_hole":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/pin_hole.png";case"pleasant":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/pleasant.png";case"sepia":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/sepia.png";case"sun_rise":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/sun_rise.png";case"vintage":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/vintage.png";case"clarity":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/clarity.png";case"edge_enhance":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/edge_enhance.png";case"emboss":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/emboss.png";case"grungy":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/grungy.png";case"hazy":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/hazy.png";case"lomo":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/lomo.png";case"noise":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/noise.png";case"old_paper":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/old_paper.png";case"posterize":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/posterize.png";case"radial_blur":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/radial_blur.png";case"sin_city":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/sin_city.png";case"tilt_shift":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/tilt_shift.png";default:return""}},Mr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/_/g," ")},Ar=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"filerobot";return"filerobot"===e?"X-Filerobot-Key":"X-Airstore-Secret-Key"};function Ir(e){return function(e){if(Array.isArray(e))return zr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"center",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t.getBoundingClientRect(),i=.3,a=o.height*i,l=o.width*i;if(ln?n=(r=a)*c:r=(n=l)/c}var s=o.width/2-n/2,u=o.height/2-r/2;if("center"===e)return[s,u,n,r];e=e.split("-");var f=.015,p=o.width*f,d=o.height*f,h=o.width-n-p,m=o.height-r-d;return[].concat(Ir(e.map((function(e,t){return"center"===e?0===t?s:u:"right"===e?h:"bottom"===e?m:"left"===e?p:"top"===e?d:void 0}))),[n,r])},Lr=n(16),Nr=n.n(Lr);function Fr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ur(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ur(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:2;return parseFloat(e).toFixed(t)},Yr=n(17),Vr=n.n(Yr),Xr=n(10),qr=n.n(Xr);CanvasRenderingContext2D.prototype.roundRect=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return o?(n<2*o&&(o=n/2),r<2*o&&(o=r/2)):o=n>=r?n/2:r/2,this.beginPath(),this.moveTo(e+o,t),this.arcTo(e+n,t,e+n,t+r,o),this.arcTo(e+n,t+r,e,t+r,o),this.arcTo(e,t+r,e,t,o),this.arcTo(e,t,e+n,t,o),this.closePath(),this},CanvasRenderingContext2D.prototype.round=function(){var e=this.canvas,t=e.width,n=e.height;return this.imageSmoothingEnabled=!0,this.globalCompositeOperation="destination-in",this.strokeStyle="transparent",this.lineWidth=1,this.beginPath(),this.roundRect(0,0,t,n,Math.max(t,n)),this.fill(),this.globalCompositeOperation="source-over",this};CanvasRenderingContext2D,Number.prototype.mapNumber=function(e,t,n,r){return(this-e)*(r-n)/(t-e)+n};function $r(e){return($r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qr(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Kr(e){return function(e){if(Array.isArray(e))return Zr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Zr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.props.config.elementId;return jr(r,t,n)})),ao(oo(e),"initializeCanvases",(function(t){var n=oo(e),r=e.props,o=r.config,i=(o=void 0===o?{}:o).isLowQualityPreview,a=r.updateState,l=1;if(i&&t.height>1050){var c=e.getCanvas(null,!0),s=c.getContext("2d");c.width=t.width,c.height=t.height,s.drawImage(t,0,0,t.width,t.height),l=t.height/800;var u=t.width/l,f=t.height/l;a({initialZoom:l,canvasOriginal:n.cloneCanvas(c)}),setTimeout((function(){var t=e.getCanvas;new window.Caman(t(),(function(){this.resize({width:u,height:f}),this.render((function(){var e=n.replaceWithNewCanvas(tr);n.CamanInstanceZoomed=new window.Caman(e,(function(){n.CamanInstanceOriginal=new window.Caman(t(null,!0),(function(){})),a({isShowSpinner:!1,canvasZoomed:n.cloneCanvas(e)})}))}))}))}))}else setTimeout((function(){var t=e.getCanvas();n.CamanInstance=new window.Caman(t,(function(){a({isShowSpinner:!1,canvasOriginal:n.cloneCanvas(t)})}))}))})),ao(oo(e),"mergeCanvases",(function(t){var n=e.props.shapeOperations,r=t.getContext("2d"),o=n.prepareFinalCanvas(t);return r.drawImage(o,0,0),t.toDataURL()})),ao(oo(e),"cloneCanvas",(function(e){var t=document.createElement("canvas"),n=t.getContext("2d");return t.width=e.width,t.height=e.height,t.id=e.id,t.className=e.className,n.drawImage(e,0,0),t})),ao(oo(e),"replaceWithNewCanvas",(function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.getCanvas(t),o=r.width,i=r.height,a=document.createElement("canvas"),l=a.getContext("2d"),c=r.parentElement;return c.removeChild(r),a.width=o,a.height=i,a.id="".concat(e.props.config.elementId,"_").concat(t),a.className=r.className,l.drawImage(r,0,0),n&&l.round(),c.appendChild(a),a})),ao(oo(e),"replaceCanvas",(function(t,n){var r=e.getCanvas(n),o=r.parentElement;return o.removeChild(r),o.appendChild(t),t})),ao(oo(e),"saveImage",(function(){var t=e.props,n=t.onComplete,r=t.onClose,o=t.updateState,i=t.closeOnLoad,a=t.config,l=t.processWithCloudService,c=t.uploadCloudimageImage,s=t.operations,u=t.initialZoom,f=t.operationsOriginal,p=e.getFinalImageMime(),d=e.getFinalImageName(),h=a.filerobot,m=void 0===h?{}:h,g=a.platform,b=void 0===g?"filerobot":g,v=m.imageMeta,y=m.imageProperties,w=m.imageName,x=m.saveMode,k=void 0===x?Pr:x,S=e.props.src.split("?")[0],C=1!==u?nr:tr,E=e.getCanvas(C),O=function(e,t,n){return e?e+"/":Jn(t,n)}(m.baseAPI,m.container,b),_=(m.uploadParams||{}).dir||"image-editor",P=oo(e);if(l){var T=(1!==u?f:s).filter((function(e){var t=e.operation;return ar.includes(t)})),j=e.generateCloudimageURL(T,S.replace(/https?:\/\/scaleflex.ultrafast.io\//,""));if(c){var R=new XMLHttpRequest;R.addEventListener("load",e.onFileLoad),R.open("POST",[O,"upload?dir=".concat(_)].join("")),R.setRequestHeader(Ar(b),m.uploadKey),R.setRequestHeader("Content-Type","application/json"),R.send(JSON.stringify({files_urls:[j]}))}else o({isShowSpinner:!1,isHideCanvas:!1}),n(j,{url_permalink:j,url_public:j,url:{public:j,permalink:j}}),i&&r(Er)}else{e.mergeCanvases(E);var D=function(e,t,n){t=t||"",n=n||512;for(var r=atob(e),o=[],i=0;i0&&B.append("properties[file]",JSON.stringify(y)),v&&Object.keys(v).length>0&&B.append("meta[file]",JSON.stringify(v))),L.open("POST",[O,"upload?dir=".concat(_)].join("")),L.setRequestHeader(Ar(b),m.uploadKey),L.send(B)}})),ao(oo(e),"getResultCanvas",(function(){var t=1!==e.props.initialZoom?nr:tr,n=e.getCanvas(t);return e.mergeCanvases(n),n})),ao(oo(e),"getFinalImageMime",(function(){var t=e.props,n=t.roundCrop,r=t.imageMime;return n?"image/png":r})),ao(oo(e),"getFinalImageName",(function(){var t=e.props.roundCrop,n=e.state.imageName;return t&&(n=n.replace(n.substr(n.lastIndexOf(".")+1),"png")),n})),ao(oo(e),"downloadImage",(function(t){var n,r=e.getResultCanvas(),o=e.getFinalImageName(),i=e.getFinalImageMime(),a=document.createElement("a");a.download=o,a.href=r.toDataURL(i,.8),document.createEvent?((n=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),a.dispatchEvent(n)):a.fireEvent&&a.fireEvent("onclick"),t&&t()})),ao(oo(e),"onFileLoad",(function(t){var n=e.props,r=n.onComplete,o=n.onClose,i=n.updateState,a=n.closeOnLoad,l=t.srcElement,c=(void 0===l?{}:l).response,s=void 0===c?"{}":c,u=JSON.parse(s)||{};if("success"===u.status){var f=u.file,p=void 0===f?{}:f,d=function(e){return e.url&&e.url.public?e.url.public:e.url_public?e.url_public:""}(p);if(!d)return;i({isShowSpinner:!1,isHideCanvas:!1}),r(d,p),a&&o(Cr)}else i({isShowSpinner:!1,isHideCanvas:!1}),alert(u),a&&o(Or)})),ao(oo(e),"generateCloudimageURL",(function(t,n){var r=e.props,o=r.config,i=r.watermark,a=r.logoImage,l=r.processWithCloudimage,c=r.processWithFilerobot,s=r.imageSealing,u=o.cloudimage,f=void 0===u?{}:u,p=o.filerobot,d=void 0===p?{}:p,h=l&&f.token+".cloudimg.io/"+(f.version?"".concat(f.version,"/"):"v7/"),m=c&&d.token+".filerobot.com/"+(d.version?"".concat(d.version,"/"):""),g=m||h||"";g=(g?"https://":"")+g;var b=(m?d.doNotPrefixURL:f.doNotPrefixURL)?"":g,v=e.isOperationExist(t,"crop"),y=e.isOperationExist(t,"resize"),w=e.isOperationExist(t,"rotate"),x=e.isOperationExist(t,"focus_point"),k=i&&a&&i.applyByDefault,S="",C="",E="",O="",_="";v&&(S=e.getCropArguments(v.props)),y&&(C=(S?"&":"")+e.getResizeArguments(y.props)),w&&(E=(S||C?"&":"")+e.getOrientationArguments(w.props)),k&&(O=(S||C||E?"&":"")+e.getWatermarkArguments()),x&&(_=(S||C||E||O?"&":"")+e.getFocusPointArguments(x.props)),n=(n=n.split("?")[0]).replace(b,"");var P=S+C+E+O+_;return s.enabled&&(P=function(e,t,n){var r=t||{},o=r.salt,i=r.char_count,a=r.include_params,l=Array.isArray(a);if(l&&0===a.length)return e;var c="",s="";if(l){var u=[],f=[];e.split("&").forEach((function(e){var t=Fr(e.split("="),1)[0];a.indexOf(t)>-1?u.push(e):f.push(e)})),f.length>0&&(s=f.join("&")),c=Hr(u.join("&"),n,o,i)}else c=Hr(e,n,o,i);return[c,s].filter((function(e){return e})).join("&")}(P,s,n.replace(g,""))),b+n+(P?"?":"")+P})),ao(oo(e),"initFiltersOrEffects",(function(){})),ao(oo(e),"applyFilterOrEffect",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=e.props,o=r.updateState,i=r.initialZoom;e.props[t]&&o({isHideCanvas:!0,isShowSpinner:!0},(function(){1!==i?(e.CamanInstanceOriginal.revert(!1),e.CamanInstanceOriginal[Rr(e.props[t])](),e.CamanInstanceOriginal.render((function(){o(ao({},t,null),(function(){e.makeCanvasSnapshot({operation:t},n)}))}))):o(ao({},t,null),(function(){e.makeCanvasSnapshot({operation:t},n)}))}))})),ao(oo(e),"applyAdjust",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.initialZoom,i=n.adjust,a=i.brightness,l=i.contrast,c=i.saturation,s=i.exposure,u={brightness:0,contrast:0,saturation:0,exposure:0};r({isHideCanvas:!0,isShowSpinner:!0},(function(){1!==o?(e.CamanInstanceOriginal.revert(!1),"0"!==a.toString()&&e.CamanInstanceOriginal.brightness(parseInt(a||"0")),"0"!==l.toString()&&e.CamanInstanceOriginal.contrast(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstanceOriginal.saturation(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstanceOriginal.exposure(parseInt(s||"0")),e.CamanInstanceOriginal.render((function(){r({adjust:Jr({},u)},(function(){e.makeCanvasSnapshot({operation:"adjust"},t)}))}))):r({adjust:Jr({},u)},(function(){e.makeCanvasSnapshot({operation:"adjust"},t)}))}))})),ao(oo(e),"initOrientation",(function(){var t=e.props,n=t.config,r=t.redoOperation,o=t.operations,i=t.operationsZoomed,a=1!==t.initialZoom?i:o;if(n.processWithCloudService&&a.length>=1){var l=a.findIndex((function(e){return"rotate"===e.operation}));l>-1&&r({operationIndex:l-1,callback:function(){},resetActiveTab:!1})}})),ao(oo(e),"onRotate",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.props,a=i.initialZoom,l=i.rotate,c=i.updateState,s=l+t;c({isHideCanvas:!0,isShowSpinner:!0,rotate:s,correctionDegree:n,flipX:r,flipY:o},(function(){var t=e.getCanvas();1!==a?(e.CamanInstanceZoomed.reset(),r&&e.CamanInstanceZoomed.flip("x"),o&&e.CamanInstanceZoomed.flip("y"),(s||n)&&e.CamanInstanceZoomed.rotate((s||0)+(n||0)),e.CamanInstanceZoomed.render((function(){e.getCanvas().className=t.className,c({isHideCanvas:!1,isShowSpinner:!1})}))):(e.CamanInstance.reset(),r&&e.CamanInstance.flip("x"),o&&e.CamanInstance.flip("y"),(s||n)&&e.CamanInstance.rotate((s||0)+(n||0)),e.CamanInstance.render((function(){e.getCanvas().className=t.className,c({isHideCanvas:!1,isShowSpinner:!1})})))}))})),ao(oo(e),"applyOrientation",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.initialZoom,i=n.rotate,a=n.correctionDegree,l=n.flipX,c=n.flipY;r({isHideCanvas:!0,isShowSpinner:!0},(function(){var n=e.getCanvas(null,!0),s=(i||0)+(a||0);1!==o?(e.CamanInstanceOriginal.reset(),l&&e.CamanInstanceOriginal.flip("x"),c&&e.CamanInstanceOriginal.flip("y"),(i||a)&&e.CamanInstanceOriginal.rotate(s),e.CamanInstanceOriginal.render((function(){e.getCanvas(null,!0).className=n.className,r({rotate:0,flipX:!1,flipY:!1,correctionDegree:0},(function(){e.makeCanvasSnapshot({operation:"rotate",props:{rotate:s}},t)}))}))):(e.getCanvas(null,!0).className=n.className,r({rotate:0,flipX:!1,flipY:!1,correctionDegree:0},(function(){e.makeCanvasSnapshot({operation:"rotate",props:{rotate:s}},t)})))}))})),ao(oo(e),"getOrientationArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.rotate;switch(t){case 90:return"r=270";case-90:return"r=90";default:return"r=".concat(t)}})),ao(oo(e),"initCrop",(function(){var t=e.props,n=t.config,r=t.redoOperation,o=t.operations,i=t.operationsZoomed,a=1!==t.initialZoom?i:o;if(n.processWithCloudService&&a.length>=1){var l=a.findIndex((function(e){return"crop"===e.operation}));l>-1&&r({operationIndex:l-1,callback:e.onInitCrop,resetActiveTab:!1})}else e.onInitCrop()})),ao(oo(e),"onInitCrop",(function(){var t=e.props,n=t.updateState,r=t.config,o=r.beginCropArea,i=void 0===o?1:o,a=r.minCropAreaWidth,l=r.minCropAreaHeight;n({isHideCanvas:!0,isShowSpinner:!0},(function(){var t=e.getCanvas(),r=t.getBoundingClientRect(),o=t.width/r.width;e.cropper=new Vr.a(t,{viewMode:1,modal:!1,background:!1,rotatable:!1,scalable:!1,zoomable:!1,movable:!1,autoCropArea:i,minCropBoxWidth:a,minCropBoxHeight:l,crop:function(t){e.props.updateState({cropDetails:t.detail})}}),window.scaleflexPlugins=window.scaleflexPlugins||{},window.scaleflexPlugins.zoom=o,window.scaleflexPlugins.cropperjs=e.cropper,n({isHideCanvas:!1,isShowSpinner:!1})}))})),ao(oo(e),"applyCrop",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.initialZoom,o=n.updateState,i=n.cropDetails,a=n.roundCrop,l=i.width,c=i.height,s=i.x,u=i.y;o({isShowSpinner:!0},(function(){var n,o,i;(e.destroyCrop(),1!==r)?(n=[l,c,s,u].map((function(e){return e*r})),e.CamanInstanceZoomed.crop(l,c,s,u),(o=e.CamanInstanceOriginal).crop.apply(o,Kr(n))):(n=[l,c,s,u],(i=e.CamanInstance).crop.apply(i,Kr(n)));e.makeCanvasSnapshot({operation:"crop",props:{width:n[0],height:n[1],x:n[2],y:n[3],roundCrop:a}},t)}))})),ao(oo(e),"makeCanvasSnapshot",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.props,i=o.updateState,a=o.initialZoom,l=o.operationsZoomed,c=o.currentOperation,s=o.operationsOriginal,u=o.operations,f=o.roundCrop,p=1!==a;if(r){var d=(p?l:u).indexOf(c)+1,h=e.cloneCanvas(e.getCanvas()),m=Jr(Jr({},t),{},{previewCanvas:!0,canvas:h}),g={isHideCanvas:!1,isShowSpinner:!1,currentOperation:m};return p?(g.operationsZoomed=[].concat(Kr(l.slice(0,d)),[m]),g.operationsOriginal=[].concat(Kr(s.slice(0,d)),[Jr(Jr({},m),{},{canvas:e.cloneCanvas(e.getCanvas(null,!0))})]),g.isHideCanvasOriginal=!1,g.isShowSpinnerOriginal=!1):g.operations=[].concat(Kr(u.slice(0,d)),[m]),void i(g,n)}if(p){var b=l.indexOf(c)+1;e.CamanInstanceOriginal.render((function(){var r=e.replaceWithNewCanvas(nr,f),o=Jr(Jr({},t),{},{canvas:e.cloneCanvas(e.getCanvas(null,!0))});e.CamanInstanceOriginal=new window.Caman(r,(function(){i({isHideCanvasOriginal:!1,isShowSpinnerOriginal:!1,operationsOriginal:[].concat(Kr(s.slice(0,b)),[o])},n)}))}));var v=e.getCanvas;e.CamanInstanceZoomed.render((function(){var n=e.replaceWithNewCanvas(tr,f),r=Jr(Jr({},t),{},{canvas:e.cloneCanvas(v())});e.CamanInstanceZoomed=new window.Caman(n,(function(){i({isHideCanvas:!1,isShowSpinner:!1,operationsZoomed:[].concat(Kr(l.slice(0,b)),[r]),currentOperation:r})}))}))}else{var y=u.indexOf(c)+1,w=e.getCanvas;e.CamanInstance.render((function(){var r=e.replaceWithNewCanvas(tr,f),o=Jr(Jr({},t),{},{canvas:e.cloneCanvas(w())});e.CamanInstance=new window.Caman(r,(function(){i({isHideCanvas:!1,isShowSpinner:!1,operations:[].concat(Kr(u.slice(0,y)),[o]),currentOperation:o},n)}))}))}})),ao(oo(e),"destroyCrop",(function(){e.cropper.destroy()})),ao(oo(e),"getCropArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height,r=e.x,o=e.y,i=e.roundCrop;return"tl_px=".concat(Math.round(r),",").concat(Math.round(o),"&br_px=").concat(Math.round(r+t),",").concat(Math.round(o+n)).concat(i?"&radius=".concat(Math.round(Math.max(t,n)),"&force_format=png"):"")})),ao(oo(e),"initResize",(function(){var t=e.props,n=t.initialZoom,r=t.updateState,o=e.getCanvas(1!==n?nr:tr);r({canvasDimensions:{width:o.width,height:o.height,ratio:o.width/o.height}})})),ao(oo(e),"applyResize",(function(){var t=e.props,n=t.initialZoom,r=t.canvasDimensions,o=t.updateState,i=t.handleSave,a=t.operations,l=t.operationsOriginal;o({isHideCanvas:!0,isShowSpinner:!0,operationsOriginal:[].concat(Kr(l),[{operation:"resize",props:r}]),operations:[].concat(Kr(a),[{operation:"resize",props:r}])},(function(){1!==n?(e.CamanInstanceOriginal.resize(r),e.CamanInstanceOriginal.render((function(){i()}))):(e.CamanInstance.resize(r),e.CamanInstance.render((function(){i()})))}))})),ao(oo(e),"getResizeArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;return"w=".concat(t,"&h=").concat(n)})),ao(oo(e),"initAdjust",(function(){})),ao(oo(e),"onAdjust",(function(t,n){var r,o=e.props,i=o.updateState,a=o.adjust;i({adjust:Jr(Jr({},a),{},(r={},ao(r,t,n),ao(r,"isHideCanvas",!0),ao(r,"isShowSpinner",!0),r))},(function(){e.applyCorrections((function(){i({isHideCanvas:!1,isShowSpinner:!1})}))}))})),ao(oo(e),"initFocusPoint",(function(){var t=e.props,n=t.updateState,r=t.original,o=t.focusPoint,i=Jr({},o);null===i.x&&(i.x=r.width/2),null===i.y&&(i.y=r.height/2),e.tempFocusPoint=Jr({},o),n({focusPoint:i,isHideCanvas:!0,isShowSpinner:!0})})),ao(oo(e),"applyFocusPoint",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.operations,i=n.operationsOriginal,a=n.focusPoint;e.tempFocusPoint=a,r({operationsOriginal:[].concat(Kr(i),[{operation:"focus_point",props:a}]),operations:[].concat(Kr(o),[{operation:"focus_point",props:a}])}),t()})),ao(oo(e),"applyShapes",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props.shapeOperations;n.updateShapes({applied:!0},{selectedShape:{}},(function(){e.makeCanvasSnapshot({operation:"shape",props:{shapes:e.props.shapes}},t,!0)}))})),ao(oo(e),"getFocusPointArguments",(function(e){return"gravity=".concat(e.x,",").concat(e.y)})),ao(oo(e),"destroyFocusPoint",(function(){e.props.updateState({focusPoint:e.tempFocusPoint,isHideCanvas:!1,isShowSpinner:!1})})),ao(oo(e),"pushOperation",(function(e,t,n){var r=e.findIndex((function(e){return e===n})),o=e.length;o&&r!==e[o]&&e.splice(r+1,o),e.push(t)})),ao(oo(e),"applyOperations",(function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.props,i=o.initialZoom,a=o.operations,l=o.operationsZoomed,c=o.operationsOriginal,s=o.canvasZoomed,u=o.canvasOriginal,f=o.updateState,p=1!==i,d=p?l[t]:a[t],h=-1!==t;if(r&&r.previewCanvas&&r.index-1===t||d&&d.previewCanvas&&r.index+1===t){var m,g,b=e.props.shapeOperations,v=null==d||null===(m=d.props)||void 0===m?void 0:m.shapes;if(!v){var y=(p?l:a).filter((function(e,t){return"shape"===e.operation&&t0?y[y.length-1].props.shapes:[]}return b.replaceAllShapes(v),g=p?h?l[t]:{canvas:e.cloneCanvas(s)}:h?a[t]:{canvas:e.cloneCanvas(u)},void f(Jr(Jr({},lo),{},{currentOperation:g}),(function(){n&&n()}))}if(h||e.props.shapeOperations.replaceAllShapes([]),p){var w=h?l[t]:{canvas:e.cloneCanvas(s)},x=e.replaceCanvas(w.canvas,tr);e.CamanInstanceZoomed=new window.Caman(x,(function(){f(Jr(Jr({},lo),{},{currentOperation:w}),(function(){n&&n()}))}));var k=h?c[t]:{canvas:e.cloneCanvas(u)},S=e.replaceCanvas(k.canvas,nr);e.CamanInstanceOriginal=new window.Caman(S,(function(){}))}else{var C=h?a[t]:{canvas:e.cloneCanvas(u)},E=e.replaceCanvas(C.canvas,tr);e.CamanInstance=new window.Caman(E,(function(){f(Jr(Jr({},lo),{},{currentOperation:C}),(function(){n&&n()}))}))}})),ao(oo(e),"isOperationExist",(function(e,t){return e.find((function(e){return e.operation===t}))})),ao(oo(e),"getOperationQuery",(function(e,t){return e?"crop_px":t?"width":"cdn"})),ao(oo(e),"destroyAll",(function(){})),ao(oo(e),"resetAll",(function(t){var n=e.props.activeTab;n?e.cancelLastOperation(n,(function(){e.applyOperations(-1,t)})):e.applyOperations(-1,t)})),ao(oo(e),"applyCorrections",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.initialZoom,o=n.effect,i=n.filter,a=n.adjust,l=a.brightness,c=a.contrast,s=a.saturation,u=a.exposure;1!==r?(e.CamanInstanceZoomed.revert(!1),o&&e.CamanInstanceZoomed[Rr(o)](),i&&e.CamanInstanceZoomed[Rr(i)](),"0"!==l.toString()&&e.CamanInstanceZoomed.brightness(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstanceZoomed.contrast(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstanceZoomed.saturation(parseInt(s||"0")),"0"!==u.toString()&&e.CamanInstanceZoomed.exposure(parseInt(u||"0")),e.CamanInstanceZoomed.render(t)):(e.CamanInstance.revert(!1),o&&e.CamanInstance[Rr(o)](),i&&e.CamanInstance[Rr(i)](),"0"!==l.toString()&&e.CamanInstance.brightness(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstance.contrast(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstance.saturation(parseInt(s||"0")),"0"!==u.toString()&&e.CamanInstance.exposure(parseInt(u||"0")),e.CamanInstance.render(t))})),ao(oo(e),"cancelAddedShapes",(function(){e.props.shapeOperations.deleteShapes({all:!0},{selectedShape:{}})})),ao(oo(e),"cancelLastOperation",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=e.props.initialZoom;"crop"===t&&e.destroyCrop(),"watermark"===t&&e.cancelWatermark(),["shapes","image","text"].includes(t)&&e.cancelAddedShapes(),1!==r?(e.CamanInstanceZoomed.reset(),e.CamanInstanceOriginal.reset(),e.CamanInstanceOriginal.render(),e.CamanInstanceZoomed.render((function(){n&&n()}))):(e.CamanInstance.reset(),e.CamanInstance.render((function(){n&&n()})))})),ao(oo(e),"initWatermark",(function(){var t=e.props,n=t.watermark,r=t.updateState;n.applyByDefault||r({watermark:Jr(Jr({},n),{},{applyByDefault:!0})})})),ao(oo(e),"applyWatermark",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.shapeOperations,i=(o.getShape({key:"watermark-layer"})||{}).index;e.setState({tempWatermark:null}),r({selectedShape:{}}),e.makeCanvasSnapshot({operation:"shape",props:{shapes:[i]}},t,!0),t()})),ao(oo(e),"cancelWatermark",(function(){var t=e.state.tempWatermark,n=e.props,r=n.updateState,o=n.shapeOperations,i=o.getShape({key:"watermark-layer"})||{},a=null;t&&t.url&&t.applyByDefault?(r({isShowSpinner:!0}),(a=new Image).setAttribute("crossOrigin","Anonymous"),a.src=t.url+"?"+(new Date).getTime(),a.onload=function(){o.updateShape({img:a},i.index,{watermark:t,logoImage:a,isShowSpinner:!1,selectedShape:{}})}):o.deleteShape({index:i.index},{watermark:t,logoImage:a,selectedShape:{}})})),ao(oo(e),"getWatermarkArguments",(function(){var t=e.props,n=t.config.processWithCloudimage,r=t.shapeOperations.getShape({key:"watermark-layer"});if(!r)return"";var o=r.x,i=r.y,a=r.opacity,l=Qr(r,["x","y","opacity"]),c=e.state.original,s=((c=void 0===c?{}:c).width,c.height,e.getCanvas("filerobot-shapes-edit-box")),u=s.width,f=s.height,p=Wr(o/u*100),d=Wr(i/f*100),h=Math.max(l.width/u,l.height/f),m=Wr(100*h),g="wat_gravity=absolute&wat_pos=".concat(p,",").concat(d),b="wat=1&wat_opacity=".concat(a,"&wat_scale=").concat(m,"p&").concat(g);return b+=n&&l.text?"&wat_text=".concat(l.text,"&wat_font=").concat(l.textFont,"&wat_fontsize=").concat(l.textSize,"&wat_colour=").concat(l.color.replace("#","")):"&wat_url=".concat(l.img.src.split("?")[0])})),ao(oo(e),"applyChanges",(function(t,n){switch(t){case"adjust":e.applyAdjust(n);break;case"effects":e.applyFilterOrEffect("effect",n);break;case"filters":e.applyFilterOrEffect("filter",n);break;case"crop":e.applyCrop(n);break;case"resize":e.applyResize();break;case"rotate":e.applyOrientation(n);break;case"watermark":e.applyWatermark(n);break;case"focus_point":e.applyFocusPoint(n);break;case"shapes":case"image":case"text":e.applyShapes(n)}})),ao(oo(e),"changeTab",(function(t){switch(t){case"effects":case"filters":e.initFiltersOrEffects();break;case"adjust":e.initAdjust();break;case"crop":e.initCrop();break;case"resize":e.initResize();break;case"rotate":e.initOrientation();break;case"watermark":e.initWatermark();break;case"focus_point":e.initFocusPoint();break;default:e.destroyAll()}})),ao(oo(e),"destroyMode",(function(t){switch(t){case"effects":case"filters":case"adjust":break;case"crop":e.destroyCrop();break;case"resize":case"rotate":break;case"focus_point":e.destroyFocusPoint()}})),e.state={canvas:null,self:oo(e)},e.CamanInstance=null,e.CamanInstanceOriginal=null,e.CamanInstanceZoomed=null,e}return t=a,r=[{key:"getDerivedStateFromProps",value:function(e,t){var n,r={};return e.activeTab!==t.activeTab&&(t.activeTab&&t.self.destroyMode(t.activeTab),"watermark"===e.activeTab&&(r.tempWatermark=e.watermark&&(n=e.watermark,JSON.parse(JSON.stringify(n)))),t.self.changeTab(e.activeTab)),Jr(Jr({},r),e)}}],(n=[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentDidMount",value:function(){var e=this,t=this,n=this.props,r=n.updateState,o=n.img,i=n.isPreResize,a=n.preCanvasDimensions;r({isShowSpinner:!0,applyChanges:this.applyChanges,applyOperations:this.applyOperations,resetAll:this.resetAll,onRotate:this.onRotate,onAdjust:this.onAdjust,downloadImage:this.downloadImage,getResultCanvas:this.getResultCanvas,saveImage:this.saveImage,applyCorrections:this.applyCorrections,restoreAll:this.restoreAll,cancelLastOperation:this.cancelLastOperation},(function(){var n=e.getCanvas(),l=n.getContext("2d");n.width=o.width,n.height=o.height,l.drawImage(o,0,0,o.width,o.height);var c={height:o.height,width:o.width,ratio:o.width/o.height};r({original:c,canvasDimensions:c}),i&&a?new window.Caman(n,(function(){this.resize({width:a.width,height:a.height}),this.render((function(){var e=t.replaceWithNewCanvas(tr),n={height:e.height,width:e.width,ratio:e.width/e.height};r({original:n,canvasDimensions:Jr({},n),canvasOriginal:t.cloneCanvas(e)},(function(){t.initializeCanvases(e)}))}))})):e.initializeCanvases(o)}))}},{key:"render",value:function(){var e=this.props.config.elementId;return i.a.createElement(i.a.Fragment,null,i.a.createElement(Pe,{id:"".concat(e,"_").concat(nr),className:"filerobot-original-canvas"}),i.a.createElement(Pe,{id:"".concat(e,"_").concat(tr),className:"filerobot-edit-canvas"}))}}])&&eo(t.prototype,n),r&&eo(t,r),a}(o.Component),so=n(4);function uo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.width&&d>=t.height)h=t.width,m=t.height;else if(p>t.width&&dt.height)h=p,m=p/t.ratio;else{var g=p,b=p/t.ratio,v=d*t.ratio,y=d;t.width<=g&&t.height<=b?(h=g,m=b):(h=v,m=y)}return{width:h,height:m}}((document.getElementById("preview-img-box")||{}).parentElement,t),n=e.width,r=void 0===n?0:n,o=e.height;return{width:r,height:void 0===o?0:o}}),[t]),d=uo(Object(o.useState)(p()),2),h=d[0],m=d[1],g=Object(o.useMemo)((function(){return Object(so.debounce)(100,(function(){m(p())}))}),[p]);return Object(o.useEffect)((function(){var e=!0,t=function(){e&&g()};return window.addEventListener("resize",t),function(){e=!1,window.removeEventListener("resize",t)}}),[g]),i.a.createElement(Ce,{ref:u,width:h.width,height:h.height},i.a.createElement(Ee,{onMouseDown:function(e){var n=e.clientX-f.x,o=e.clientY-f.y,i=Math.round(n*t.width/h.width),a=Math.round(o*t.height/h.height),l=Math.min(Math.max(i,0),t.width),c=Math.min(Math.max(a,0),t.height);r({focusPoint:{x:l,y:c}})}},i.a.createElement(_e,{visible:c,src:a,onLoad:function(){r({isShowSpinner:!1}),s(!0)},onError:function(){r({isShowSpinner:!1})}}),i.a.createElement(Oe,{visible:c,x:n.x*h.width/t.width,y:n.y*h.height/t.height})))};function ho(e){return(ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||vo(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function go(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function bo(e){return function(e){if(Array.isArray(e))return yo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||vo(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vo(e,t){if(e){if("string"==typeof e)return yo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yo(e,t):void 0}}function yo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:function(){},r=t.props.updateState;r(e,n)})),Po(Oo(t),"pushShapeToShapes",(function(e,n){var r=t.props.shapes,o=r.length;return t.updateState(xo({shapes:[].concat(bo(r),[xo(xo({},e),{},{index:o})])},n)),o})),Po(Oo(t),"targettedShape",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e||0===e?t.props.shapes[e]:t.props.selectedShape})),Po(Oo(t),"onSelect",(function(e){var n=t.props,r=n.shapes,o=n.activeTab;if(t._allowedTabs.includes(o)){var i=e.offsetX,a=e.offsetY,l=!1;r.forEach((function(e){!e.hidden&&i>=e.x&&i<=e.x+e.width&&a>=e.y&&a<=e.y+e.height&&e.tab===o&&(l=!0,t.updateState({selectedShape:xo(xo({},e),{},{resizingBox:!0,startEdgeOffset:{x:i-e.x,y:a-e.y}})}),t.activateResizingActions(),t._canvas.addEventListener("keyup",t.activateShapeDeleting),t._canvas.addEventListener("mousemove",t.startDragging),t._canvas.addEventListener("touchmove",t.startDragging),document.addEventListener("mouseup",t.endDragging),document.addEventListener("touchend",t.endDragging))})),l||(t.updateState({selectedShape:{}}),t.disableResizingActions(),t._canvas.removeEventListener("keyup",t.activateShapeDeleting),t._canvas.removeEventListener("mousemove",t.startDragging),t._canvas.removeEventListener("touchmove",t.startDragging),document.removeEventListener("mouseup",t.endDragging),document.removeEventListener("touchend",t.endDragging))}})),Po(Oo(t),"activateShapeDeleting",(function(e){var n=e.key,r=t.props.selectedShape;"Delete"!==n&&"Backspace"!==n||!r||(t.deleteShapeByKeyOrIndex({index:r.index}),t.updateState({selectedShape:{}}),t.disableResizingActions(),t._canvas.removeEventListener("keyup",t.activateShapeDeleting))})),Po(Oo(t),"activateResizingActions",(function(){t.props.selectedShape.lockScaleToPercentage||Array.from(document.getElementsByClassName("shape-resizing-control")).forEach((function(e){e.addEventListener("mousedown",t.trackShapeResize)}))})),Po(Oo(t),"trackShapeResize",(function(e){var n=e.target;t.setState({resizeControlTarget:n}),document.addEventListener("mousemove",t.handleShapeResizing),document.addEventListener("touchmove",t.handleShapeResizing),document.addEventListener("mouseup",t.disableResizingActions),document.addEventListener("touchend",t.disableResizingActions)})),Po(Oo(t),"handleShapeResizing",(function(e){var n=e.movementX,r=e.movementY,o=e.shiftKey,i=t.state.resizeControlTarget,a=t.props,l=a.selectedShape,c=a.processWithCloudimage,s=l.index,u=l.width,f=l.height,p=l.x,d=l.y,h=l.variant,m=l.originalWidth,g=l.originalHeight;if(i&&h!==gr){var b=f,v=i.dataset.direction;if(c){if(["e","w","n","s"].includes(v))return;o=!0}var y=function(e){var t=u/f;if(Math.abs(n)>=Math.abs(r)){var o=Math.abs(f-(u+n)/t);r=(e?1:-1)*Math.sign(n)*o}else{var i=Math.abs(u-(f+r)*t);n=(e?1:-1)*Math.sign(r)*i}},w=function(){u+=n},x=function(){f+=r},k=function(){u-=n,p+=n},S=function(){f-=r,d+=r};switch(v){case"e":w();break;case"w":k();break;case"n":S();break;case"s":x();break;case"ne":if(o&&y(!1),w(),u>=t._canvas.width&&o)break;S();break;case"nw":if(o&&y(!0),k(),u>=t._canvas.width&&o)break;S();break;case"se":if(o&&y(!0),w(),u>=t._canvas.width&&o)break;x();break;case"sw":if(o&&y(!1),k(),u>=t._canvas.width&&o)break;x();break;default:return}if(h!==dr&&h!==hr||(f!==b?u=f:f=u),!c||!(u>=m||f>=g)){if(!(f<=15||u<=15)){p<0&&(p=0),d<0&&(d=0),p+u>t._canvas.width&&(p=t._canvas.width-u),d+f>t._canvas.height&&(d=t._canvas.height-f),u>t._canvas.width&&(u=t._canvas.width),f>t._canvas.height&&(f=t._canvas.height);var C={width:u,height:f,x:p,y:d};t.updateShape(C,s,{selectedShape:xo(xo({},l),C)})}}}})),Po(Oo(t),"disableResizingActions",(function(e){document.removeEventListener("mousemove",t.handleShapeResizing),document.removeEventListener("mouseup",t.disableResizingActions),t.updateState({selectedShape:{}}),t.setState({resizeControlTarget:null})})),Po(Oo(t),"removeResizingBox",(function(e){var n=e.offsetX,r=e.offsetY,o=t.props.selectedShape;(no.x+o.width||ro.y+o.height)&&(t.updateState({selectedShape:xo(xo({},o),{},{resizingBox:!1})}),t._canvas.removeEventListener("click",t.removeResizingBox))})),Po(Oo(t),"startDragging",(function(e){if(e.targetTouches&&e.targetTouches[0]){e.preventDefault();var n=e.targetTouches[0],r=n.clientX,o=n.clientY,i=t._canvas.getBoundingClientRect(),a=i.x,l=i.y;e.offsetX=r-a,e.offsetY=o-l}var c=t.props.selectedShape,s=c.startEdgeOffset,u=void 0===s?{}:s,f=c.width,p=c.height,d=c.index,h=e.offsetX-u.x,m=e.offsetY-u.y;h<0&&(h=0),m<0&&(m=0),h+f>t._canvas.width&&(h=t._canvas.width-f),m+p>t._canvas.height&&(m=t._canvas.height-p);var g=xo(xo({},c),{},{x:h,y:m});t.updateShape(g,d,{selectedShape:g})})),Po(Oo(t),"endDragging",(function(){t._canvas.removeEventListener("mousemove",t.startDragging),t._canvas.removeEventListener("mouseup",t.endDragging),t._canvas.removeEventListener("mouseleave",t.endDragging),t._canvas.addEventListener("click",t.removeResizingBox)})),Po(Oo(t),"getCanvasCenter",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t._canvas.width/2-e,o=t._canvas.height/2-n;return[r,o]})),Po(Oo(t),"draw",(function(e,n){var r=n.opacity,o=void 0===r?1:r,i=n.hidden,a=n.color,l=n.stroke,c=void 0===l?{}:l;i||(t._context.globalAlpha=+o,t._context.fillStyle=a,t._context.strokeStyle=c.color||"transparent",t._context.lineWidth=c.width||1,e(),t.props.round&&t._context.round())})),Po(Oo(t),"redrawShape",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=t.props.shapes;t.clearShape(0,0,t._canvas.width,t._canvas.height);var r=n.length;if(e&&e!==r-1){var o=xo(xo({},n.splice(e,1)[0]),{},{index:r});n.splice(r,0,o),n=n.map((function(e,n){return e.index=n,t.drawShapeThroughVariant(e),e})),t.updateState({shapes:n,selectedShape:o})}else n.forEach((function(e){return t.drawShapeThroughVariant(e)}))})),Po(Oo(t),"drawShapeThroughVariant",(function(e){switch(e.variant){case mr:t.drawImage(e);break;case pr:case dr:t.drawRect(e);break;case hr:t.drawCircle(e);break;case gr:t.drawText(e);default:return}})),Po(Oo(t),"drawRect",(function(e){var n=e.x,r=e.y,o=e.width,i=e.height,a=e.stroke,l=go(e,["x","y","width","height","stroke"]);t.draw((function(){t._context.fillRect(n,r,o,i),a&&t._context.strokeRect(n,r,o,i)}),xo({stroke:a},l))})),Po(Oo(t),"drawCircle",(function(e){var n=e.x,r=e.y,o=(e.radius,e.width),i=e.height,a=e.stroke,l=go(e,["x","y","radius","width","height","stroke"]);t.draw((function(){t._context.roundRect(n,r,o,i),t._context.fill(),a&&t._context.stroke()}),xo({stroke:a},l))})),Po(Oo(t),"drawImage",(function(e){var n=e.img,r=e.x,o=e.y,i=e.width,a=e.height,l=e.stroke,c=go(e,["img","x","y","width","height","stroke"]);t.draw((function(){t._context.drawImage(n,r,o,i,a),l&&t._context.strokeRect(r,o,i,a)}),xo({stroke:l},c))})),Po(Oo(t),"setTextStyle",(function(e){var n=e.textSize,r=e.textFont;t._context.textAlign="start",t._context.textBaseline="top",t._context.font="".concat(n,"px ").concat(r)})),Po(Oo(t),"getTextWidthAndHeight",(function(e){var n=e.text,r=e.textSize,o=e.textFont;t.setTextStyle({textSize:r,textFont:o});var i=t._context.measureText(n),a=i.width;return[a,0===a?0:i.actualBoundingBoxDescent-i.actualBoundingBoxAscent]})),Po(Oo(t),"drawText",(function(e){var n=e.text,r=e.textSize,o=e.textFont,i=e.x,a=e.y,l=e.stroke,c=go(e,["text","textSize","textFont","x","y","stroke"]);t.draw((function(){t.setTextStyle({textSize:r,textFont:o}),t._context.fillText(n,i,a,t._canvas.width),l&&t._context.strokeText(n,i,a)}),xo({stroke:l},c))})),Po(Oo(t),"addRect",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.x,r=e.y,o=e.width,i=void 0===o?100:o,a=e.height,l=void 0===a?75:a,c=e.stroke,s=void 0===c?{}:c,u=e.color,f=void 0===u?"#000000":u,p=e.opacity,d=void 0===p?1:p,h=e.variant,m=void 0===h?pr:h,g=e.tab,b=void 0===g?"shapes":g,v=go(e,["x","y","width","height","stroke","color","opacity","variant","tab"]),y=t.getCanvasCenter(i/2,l/2),w=mo(y,2),x=w[0],k=w[1],S={x:n||x,y:r||k,width:i,height:l,stroke:s,opacity:d,color:f},C=xo(xo(xo(xo({},t._initArgs),v),S),{},{variant:m,tab:b});if(!v.key||!t.replaceShapeIfExisted(v.key,C)){t.drawRect(S);var E=t.pushShapeToShapes(C);t.updateState({selectedShape:xo(xo({},C),{},{index:E,resizingBox:!0})},t.activateResizingActions)}})),Po(Oo(t),"addSquare",(function(e){e.width||(e.width=e.height=75),e.variant=dr,t.addRect(e)})),Po(Oo(t),"addCircle",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.x,r=e.y,o=e.radius,i=void 0===o?50:o,a=e.stroke,l=void 0===a?{}:a,c=e.color,s=void 0===c?"#000000":c,u=e.opacity,f=void 0===u?1:u,p=e.tab,d=void 0===p?"shapes":p,h=go(e,["x","y","radius","stroke","color","opacity","tab"]),m=t.getCanvasCenter(i,i),g=mo(m,2),b=g[0],v=g[1],y=2*i,w={x:n||b,y:r||v,radius:i,color:s,opacity:f,stroke:l,width:y,height:y},x=xo(xo(xo(xo({},t._initArgs),h),w),{},{tab:d,variant:hr});if(!h.key||!t.replaceShapeIfExisted(h.key,x)){t.drawCircle(w);var k=t.pushShapeToShapes(x);t.updateState({selectedShape:xo(xo({},x),{},{index:k,resizingBox:!0})},t.activateResizingActions)}})),Po(Oo(t),"addImage",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.img,r=e.x,o=void 0===r?void 0:r,i=e.y,a=void 0===i?void 0:i,l=e.opacity,c=void 0===l?1:l,s=e.tab,u=void 0===s?"image":s,f=e.stroke,p=void 0===f?{}:f,d=e.otherStates,h=go(e,["img","x","y","opacity","tab","stroke","otherStates"]);if(n){var m=function(){var e=mo(t.getSuitableImgDiemensions(n,h.lockScaleToPercentage),2),r=e[0],i=e[1],l=mo(t.getCanvasCenter((h.width||r)/2,(h.height||i)/2),2),s=l[0],f=l[1],m={img:n,opacity:c,originalWidth:r,originalHeight:i,width:h.width||r,height:h.height||i,x:o||s,y:a||f,stroke:p},g=xo(xo(xo(xo({},t._initArgs),h),m),{},{variant:mr,tab:u});if(!h.key||!t.replaceShapeIfExisted(h.key,g,d)){t.drawImage(m);var b=t.pushShapeToShapes(g);t.updateState(xo({selectedShape:xo(xo({},g),{},{index:b,resizingBox:!0})},d),t.activateResizingActions)}};"string"==typeof n?n=t.makeImgElement(n,m):m()}})),Po(Oo(t),"addText",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.text,r=void 0===n?"Text":n,o=e.textSize,i=void 0===o?62:o,a=e.color,l=void 0===a?"#000000":a,c=e.textFont,s=void 0===c?"Arial":c,u=e.x,f=void 0===u?void 0:u,p=e.y,d=void 0===p?void 0:p,h=e.stroke,m=void 0===h?{}:h,g=e.opacity,b=void 0===g?1:g,v=e.tab,y=void 0===v?"text":v,w=e.otherStates,x=go(e,["text","textSize","color","textFont","x","y","stroke","opacity","tab","otherStates"]),k=t.getTextWidthAndHeight({text:r,textSize:i,textFont:s}),S=mo(k,2),C=S[0],E=S[1],O=t.getCanvasCenter(C/2,E/2),_=mo(O,2),P=_[0],T=_[1];if(r){var j={text:r,textSize:i,textFont:s,x:f||P,y:d||T,opacity:b,stroke:m,color:l},R=xo(xo(xo(xo({},t._initArgs),x),j),{},{width:C,height:E,variant:gr,tab:y});if(x.key&&t.replaceShapeIfExisted(x.key,R,w))return;t.drawText(j);var D=t.pushShapeToShapes(R);t.updateState(xo({selectedShape:xo(xo({},R),{},{index:D,resizingBox:!0})},w),t.activateResizingActions)}})),Po(Oo(t),"addAnyShape",(function(e,n){if(e.index||0===e.index){var r=t.props.shapes[e.index];if(!e.variant||r.variant===e.variant)return void t.updateShape(e,e.index,n)}var o=xo(xo({},e),{},{otherStates:n});switch(e.variant){case mr:t.addImage(o);break;case pr:t.addRect(o);break;case dr:t.addSquare(o);break;case hr:t.addCircle(o);break;case gr:t.addText(o);default:return}})),Po(Oo(t),"getSuitableImgDiemensions",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.width,o=e.height;if(o>t._canvas.height){var i=o/t._canvas.height;o/=i,r/=i}if(r>t._canvas.width){var a=r/t._canvas.width;o/=a,r/=a}if(n){var l=n/100;r*=l,o*=l}return[r=t.fromLatestCanvasSizeValue(r,"width"),o=t.fromLatestCanvasSizeValue(o,"height")]})),Po(Oo(t),"getShapeByKeyOrIndex",(function(e){var n=e.key,r=e.index;if(!n&&!r&&0!==n&&0!==r)return!1;var o=t.props.shapes;return r?o[r]:o.filter((function(e){return e.key===n}))[0]})),Po(Oo(t),"replaceShapeIfExisted",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=t.getShapeByKeyOrIndex({key:e});return!!o&&(n=xo(xo({},n),{},{x:o.x,y:o.y,width:o.width,height:o.height}),t.updateShape(n,o.index,r),!0)})),Po(Oo(t),"setShapeVisibilityByKeyOrIndex",(function(e){var n=e.key,r=e.index,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=t.getShapeByKeyOrIndex({key:n,index:r});i&&i.hidden!==o&&t.updateShape({hidden:o||!i.hidden},i.index)})),Po(Oo(t),"getShapesIndexByAnyProp",(function(e,n){var r=t.props.shapes;if(r&&0===r.length)return[];var o=[];return r.filter((function(t,r){var i=t[e];return(i===n||void 0===i&&Boolean(i)===n)&&(o.push(r),!0)})),o})),Po(Oo(t),"updateShapes",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=t.props.shapes;o=o.map((function(t){return xo(xo({},t),e)})),t.updateState(xo({shapes:o},n),r)})),Po(Oo(t),"replaceAllShapes",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.updateState({shapes:e},(function(){t.redrawShape(),n()}))})),Po(Oo(t),"updateShape",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=t.props,i=o.shapes,a=o.selectedShape;if(e&&(n||0===n||a&&(a.index||0===a.index))){if("string"==typeof e.img)return t.updateState({selectedShape:xo(xo({},a),{},{lockScaleToPercentage:e.lockScaleToPercentage,img:e.img})}),void t.makeImgElement(e.img,t.updateShape,e,n,r);var l={};if(n||0===n||(l.selectedShape=xo(xo({},a),e)),i[n=n||0===n?n:a.index]){var c=i;if(e.textSize&&e.textSize!==i[n].textSize||e.text&&e.text!==i[n].text){var s=i[n],u=t.getTextWidthAndHeight(xo(xo({},s),e)),f=mo(u,2),p=f[0],d=f[1];l.selectedShape?(e.width=l.selectedShape.width=p,e.height=l.selectedShape.height=d,e.text=l.selectedShape.text=e.text||s.text):(e.width=p,e.height=d,e.text=e.text||s.text)}else{var h=xo({},e);void 0!==e.x&&void 0!==e.y&&(h.x=e.x,h.y=e.y),e.stroke&&(h.stroke=e.stroke),e.width&&e.height&&(h.width=e.width,h.height=e.height),e.lockScaleToPercentage&&(e.lockScaleToPercentage=e.lockScaleToPercentage),l.selectedShape=xo(xo({},a),h)}c[n]=xo(xo({},c[n]),e),t.updateState(xo(xo({shapes:c},l),r),(function(){t.redrawShape(n)}))}}})),Po(Oo(t),"clearShape",(function(e,n,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=i.width,l=a||1,c=e-l,s=n-l,u=r+l,f=o+l;t._context.clearRect(c,s,u,f)})),Po(Oo(t),"eraseAndRemoveShapeFromArray",(function(e,n){if(0!==Object.keys(t.targettedShape(e)).length)return t.clearShape(0,0,t._canvas.width,t._canvas.height),n.filter((function(n){return n.index!==e&&(n.index>e&&(n.index-=1),t.drawShapeThroughVariant(n),n)}))})),Po(Oo(t),"deleteShapeByKeyOrIndex",(function(e){var n=e.index,r=e.key,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.props.selectedShape;if(!n&&0!==n&&!r){if(!i)return;n=i.index}var a=t.props.shapes,l=n||0===n?n:(t.getShapeByKeyOrIndex({key:r})||{}).index;(l||0===l)&&(l===i.index&&(o.selectedShape={}),t.updateState(xo({shapes:t.eraseAndRemoveShapeFromArray(l,a)},o)))})),Po(Oo(t),"deleteShapes",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=t.props.shapes;e.forEach((function(e){r=t.eraseAndRemoveShapeFromArray(e,r)})),t.updateState(xo({shapes:r},n))})),Po(Oo(t),"deleteAllShapesOrByTypeOrIndicies",(function(e){var n=e.type,r=e.all,o=void 0!==r&&r,i=e.applied,a=void 0!==i&&i,l=e.secured,c=void 0===l?[]:l;if(n||o){if(o){var s=(t.getShapeByKeyOrIndex({key:"watermark-layer"})||{}).index,u=bo(c);!s&&0!==s||u.includes(s)||u.push(s);var f=[];return t.clearShape(0,0,t._canvas.width,t._canvas.height),a||(f=t.props.shapes.filter((function(e){return!(!e.applied&&!u.includes(e.index))&&(t.drawShapeThroughVariant(e),e)}))),void t.updateState({shapes:f,selectedShape:{}})}var p=t.getShapesIndexByAnyProp("type",n);p.length>0&&t.deleteShapes(p)}})),Po(Oo(t),"makeImgElement",(function(e,n,r){for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a-1&&n&&(t.splice(i,1),r({operations:t}),o(t,"resize"))}},{key:"render",value:function(){var e=this,t=this.state.isBlockRatio,n=this.props,r=n.canvasDimensions,o=n.processWithCloudService,a=n.onPreResize,l=n.t;return i.a.createElement(xe,{id:"preview-img-box"},i.a.createElement(Nt,null,l["warning.too_big_resolution"]),i.a.createElement(Ft,null,i.a.createElement("h4",null,l["pre_resize.title"]),i.a.createElement(zt,null,i.a.createElement(Bt,null,i.a.createElement(dt,null,i.a.createElement(ht,null,l["common.width"]),i.a.createElement(mt,{fullSize:!0,value:parseInt(r.width,10)||"",onChange:this.changeWidth})),i.a.createElement(bt,null,i.a.createElement(vt,{active:!t,style:o?{cursor:"not-allowed"}:{},link:!0,onClick:function(){!o&&e.toggleRatio()}},i.a.createElement(yt,{active:!t,style:o?{cursor:"not-allowed"}:{}}))),i.a.createElement(dt,null,i.a.createElement(ht,null,l["common.height"]),i.a.createElement(mt,{fullSize:!0,value:parseInt(r.height,10)||"",onChange:this.changeHeight})))),i.a.createElement(Lt,null,i.a.createElement("p",null,i.a.createElement(je,{themeColor:!0,themeBtn:!0,onClick:function(){a("keep")}},l["pre_resize.keep_original_resolution"])),i.a.createElement("p",null,i.a.createElement(je,{themeColor:!0,success:!0,onClick:function(){a("resize")}},l["pre_resize.resize_n_continue"])))))}}])&&Ho(t.prototype,n),r&&Ho(t,r),a}(o.Component);function Ko(e){return(Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Go(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=e.target.value;if(r.props.watermark.text)r.initWatermarkImage(n);else{var o=r.state.position;r.updateWatermarkProperty({url:n,position:o},sl({img:n,position:o},t),{url:"",text:!1})}})),gl(hl(r),"changeTextProperty",(function(e){var t=gl({},e.target.name,e.target.value);if(r.props.watermark.text)r.updateWatermarkProperty(t);else{var n=r.state,o=sl({text:n.text,color:n.color,textSize:n.textSize,textFont:n.textFont,opacity:n.opacity,variant:gr,tab:"watermark"},t);r.updateWatermarkProperty(sl({},t),sl(sl({},o),{},{resizingBox:!0}),{text:sl(sl({},r.props.watermark.text),o)})}})),gl(hl(r),"readFile",(function(e){if(r.props.config.processWithCloudimage)return null;var t=e.target;if(t.files&&t.files[0]){var n=new FileReader;n.onload=function(e){r.changeURL({target:{value:e.target.result}},{variant:mr})},n.readAsDataURL(t.files[0])}})),gl(hl(r),"getWatermarkDimensionsByPosString",(function(e,t,n){return Br(e,jr(r.props.config.elementId),t,n)})),gl(hl(r),"onPositionChange",(function(e){var t=r.getWatermarkLayer(),n=t.width,o=t.height,i=al(r.getWatermarkDimensionsByPosString(e,n,o),4),a=i[0],l=i[1],c=i[2],s=i[3];r.updateWatermarkProperty({position:e,width:c,height:s},{x:a,y:l,width:c,height:s},{position:e,x:a,y:l,width:c,height:s})})),gl(hl(r),"initWatermarkImage",Object(so.debounce)(500,(function(e){var t=r.props.updateState,n=null;t({isShowSpinner:!0});var o=function(e){return{logoImage:e,isShowSpinner:!1,watermark:sl(sl({},r.props.watermark),{},{url:e.src})}};if(e){var i=r.props,a=i.shapeOperations,l=i.watermark,c=l.lockScaleToPercentage,s=void 0===c?0:c,u=l.position,f=r.state.opacity;(n=new Image).setAttribute("crossOrigin","Anonymous"),n.onload=function(){var e,t=r.props.watermark.imageFilter;t&&"function"==typeof t?(n.onload=null,e=o(t(n))):e=o(n);var i=(r.getWatermarkLayer()||{}).index,l=al(r.getWatermarkDimensionsByPosString(u,n.width,n.height),4),c=l[0],p=l[1],d=l[2],h=l[3];a.addOrUpdate({img:n,opacity:f,index:i,x:c,y:p,width:d,height:h,variant:mr,key:"watermark-layer",tab:"watermark",lockScaleToPercentage:s},e)},n.onerror=function(){t({isShowSpinner:!1})},e.match(/^https?:\/\/./)?n.src=e+"?"+(new Date).getTime():n.src=e}else t({isShowSpinner:!1})}))),gl(hl(r),"showWatermarkList",(function(){r.setState({showWaterMarkList:!0})})),gl(hl(r),"hideWatermarkList",(function(){r.setState({showWaterMarkList:!1})})),gl(hl(r),"onChangeWatermark",(function(e){r.changeURL({target:{value:e}}),r.hideWatermarkList()})),gl(hl(r),"handleInputTypeChange",(function(e){var t=e.target,n=r.props,o=n.updateState,i=n.config;o({isShowSpinner:!0}),r.setState({selectedInputType:t.value}),"text"===t.value?(r.changeTextProperty({target:{name:"text",value:(i.watermark||{}).defaultText||"Your text"}}),o({isShowSpinner:!1})):(o({watermark:sl(sl({},r.props.watermark),{},{text:null})}),r.initWatermarkImage(r.props.watermark.url||""))}));var i=e.watermark,l=i.opacity,c=i.position,s=i.url,u=i.applyByDefault,f=i.activePositions,p=i.handleOpacity,d=e.watermark,h=d.urls,m=d.fonts,g=[],b=c||"right-top";if("string"==typeof f&&cr.hasOwnProperty(f))g=cr[f];else if(Array.isArray(f)){var v=Array(9).fill(0);f.map((function(e,t){return v[t]=e})),g=v}else g=Array(9).fill(1);return 1!==g[lr.indexOf(b)]&&(b=lr[g.indexOf(1)]),h&&(h=h.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("string"==typeof e){var t=e.split("/");return{url:e,label:t[t.length-1]}}return e}))),r.initWatermarkImage(s||(null===(t=h)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.url)),r.state={isBlockRatio:!1,opacity:l||.7,handleOpacity:"boolean"!=typeof p||p,position:b,url:s||(h&&h.length>1?h[0]&&h[0].url:""),urls:h||[],activePositions:g,isWatermarkList:h&&h.length>1,applyByDefault:u||!1,showWaterMarkList:!1,selectedInputType:h&&h.length>1?"gallery":"upload",text:"",color:"#000000",textSize:62,textFont:"Arial",fonts:m||r.props.config.theme.fonts},r}return t=a,(n=[{key:"componentDidUpdate",value:function(e){var t=this.props;t.watermark.position!==this.state.position&&this.onPositionChange(this.state.position),t.watermark.applyByDefault!==e.watermark.applyByDefault&&(this.getWatermarkLayer()?this.updateWatermarkProperty({applyByDefault:!1},{hidden:!0,resizingBox:!1},{applyByDefault:!1}):this.setState({applyByDefault:t.watermark.applyByDefault}),t.watermark.applyByDefault&&(this.getWatermarkLayer()?this.updateWatermarkProperty({applyByDefault:!0},{hidden:!1,resizingBox:!0},{applyByDefault:!0}):this.initWatermarkImage(t.watermark.url)))}},{key:"render",value:function(){var e=this,t=this.state,n=t.isWatermarkList,r=t.url,o=t.urls,a=t.opacity,l=t.handleOpacity,c=t.position,s=t.activePositions,u=(t.applyByDefault,t.showWaterMarkList),f=t.selectedInputType,p=t.text,d=t.color,h=t.textFont,m=t.textSize,g=t.fonts,b=this.props.config,v="upload"===f,y="gallery"===f,w="url"===f,x="text"===f,k=this.props.t;return i.a.createElement(Rn,null,i.a.createElement(Bn,null,i.a.createElement("label",null,k["common.gallery"],i.a.createElement("input",{type:"radio",value:"gallery",checked:"gallery"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",{style:{cursor:b.processWithCloudimage?"not-allowed":"auto"}},k["common.upload"],i.a.createElement("input",{type:"radio",value:"upload",checked:"upload"===f,disabled:b.processWithCloudimage,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",null,k["common.url"],i.a.createElement("input",{type:"radio",value:"url",checked:"url"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",null,k["common.text"],i.a.createElement("input",{type:"radio",value:"text",checked:"text"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null))),i.a.createElement(In,null,i.a.createElement(Dn,null,y&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"url"},"Watermark Gallery"),i.a.createElement(ol,{width:"100%",list:o,valueProp:"url",id:"gallery",value:r,style:{width:"calc(100% - 120px)"},onChange:function(t){e.changeURL({target:{value:t}})}})),w&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"url"},"Watermark URL"),i.a.createElement(mt,{id:"url",value:r,style:{width:"calc(100% - 120px)"},onChange:this.changeURL})),v&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"image-upload"},"Watermark Image"),i.a.createElement(gt,{id:"image-upload",style:{width:"calc(100% - 120px)"},onChange:this.readFile})),x&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"text"},"Watermark Text"),i.a.createElement(mt,{id:"text",value:p,style:{width:"calc(65% - 135px)",minWidth:120},name:"text",onChange:this.changeTextProperty}),i.a.createElement(ol,{list:b.processWithCloudimage?fr:g,valueProp:"value",id:"textFont",value:h,style:{width:111,display:"inline-block",marginLeft:8},onChange:function(t){return e.changeTextProperty({target:{name:"textFont",value:t}})}}),i.a.createElement(mt,{value:m,type:"number",name:"textSize",style:{width:60,marginLeft:8},onChange:this.changeTextProperty}),i.a.createElement(mt,{value:d,type:"color",style:{width:30,marginLeft:8,padding:0,background:"transparent",boxShadow:"none"},name:"color",onChange:this.changeTextProperty}))),i.a.createElement(Mn,{switcherPosition:l?"right":"left"},l&&i.a.createElement(An,null,i.a.createElement("label",{htmlFor:"opacity",style:{minWidth:80}},"Opacity"),i.a.createElement(da,{label:k["common.opacity"],min:0,max:1,step:.05,range:a,updateRange:this.changeOpacity})))),i.a.createElement(zn,null,lr.map((function(t,n){return i.a.createElement(Ln,{key:t,value:t,active:t===c,clickable:s[n],onClick:function(){s[n]&&e.onPositionChange(t)}})}))),n&&u&&i.a.createElement(Nn,null,o.map((function(t){return i.a.createElement(Fn,{key:t,src:t,onClick:function(){e.onChangeWatermark(t)}})}))))}}])&&ul(t.prototype,n),r&&ul(t,r),a}(o.Component);function vl(e){return(vl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wl(e){for(var t=1;t128?255-2*(255-e.r)*(255-t.r)/255:t.r*e.r*2/255,n.g=t.g>128?255-2*(255-e.g)*(255-t.g)/255:t.g*e.g*2/255,n.b=t.b>128?255-2*(255-e.b)*(255-t.b)/255:t.b*e.b*2/255,n})),Gc.register("difference",(function(e,t){return{r:e.r-t.r,g:e.g-t.g,b:e.b-t.b}})),Gc.register("addition",(function(e,t){return{r:t.r+e.r,g:t.g+e.g,b:t.b+e.b}})),Gc.register("exclusion",(function(e,t){return{r:128-2*(t.r-128)*(e.r-128)/255,g:128-2*(t.g-128)*(e.g-128)/255,b:128-2*(t.b-128)*(e.b-128)/255}})),Gc.register("softLight",(function(e,t){var n;return(n={}).r=t.r>128?255-(255-t.r)*(255-(e.r-128))/255:t.r*(e.r+128)/255,n.g=t.g>128?255-(255-t.g)*(255-(e.g-128))/255:t.g*(e.g+128)/255,n.b=t.b>128?255-(255-t.b)*(255-(e.b-128))/255:t.b*(e.b+128)/255,n})),Gc.register("lighten",(function(e,t){return{r:t.r>e.r?t.r:e.r,g:t.g>e.g?t.g:e.g,b:t.b>e.b?t.b:e.b}})),Gc.register("darken",(function(e,t){return{r:t.r>e.r?e.r:t.r,g:t.g>e.g?e.g:t.g,b:t.b>e.b?e.b:t.b}}));n(46);Caman.Plugin.register("crop",(function(e,t,n,r){var o;return null==n&&(n=0),null==r&&(r=0),o=document.createElement("canvas"),Qc.b.copyAttributes(this.canvas,o),o.width=e,o.height=t,o.getContext("2d").drawImage(this.canvas,n,r,e,t,0,0,e,t),this.cropCoordinates={x:n,y:r},this.cropped=!0,this.replaceCanvas(o)})),Caman.Plugin.register("resize",(function(e){var t;if(null==e&&(e=null),null!==e&&(null!=e.width||null!=e.height))return null==e.width?e.width=this.canvas.width*e.height/this.canvas.height:null==e.height&&(e.height=this.canvas.height*e.width/this.canvas.width),t=document.createElement("canvas"),Qc.b.copyAttributes(this.canvas,t),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,e.width,e.height),this.resized=!0,this.replaceCanvas(t);Xc.a.error("Invalid or missing dimensions given for resize")})),Caman.Filter.register("crop",(function(){return this.processPlugin("crop",Array.prototype.slice.call(arguments,0))})),Caman.Filter.register("resize",(function(){return this.processPlugin("resize",Array.prototype.slice.call(arguments,0))}));var ns,rs,os;n(47),n(48),n(49),n(50),n(51),n(52),n(53);ns=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],rs=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],os=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},Caman.Plugin.register("compoundBlur",(function(e,t,n,r){var o,i,a,l=this.dimensions.width,c=this.dimensions.height,s=this.pixelData,u=e.data,f=l*c,p=[];for(o=0,i=0<=(a=f<<2);i?oa;i?o++:o--)p[o]=s[o];var d=0,h=r;for(r-=1;h-- >=0;){var m,g,b,v,y,w,x,k,S,C,E,O,_,P,T,j,R,D,M,A,I,z,B,L=t+.5|0;if(0!==L){L>256&&(L=256);var N=L+L+1,F=l-1,U=c-1,H=L+1,W=H*(H+1)/2,Y=new os,V=void 0,X=Y;for(o=1,m=1<=(g=N);m?og;m?o++:o--)X=X.next=new os,o===H&&(V=X);X.next=Y;var q=null,$=null,Q=M=0,K=ns[L],Z=rs[L];for(D=0,A=0<=(I=c);A?DI;A?D++:D--){var G,J,ee,te,ne,re;for(_=w=b=T=k=y=0,P=H*(O=p[M]),x=H*(E=p[M+1]),v=H*(C=p[M+2]),T+=W*O,k+=W*E,y+=W*C,X=Y,o=0,G=0<=(J=H);G?oJ;G?o++:o--)X.r=O,X.g=E,X.b=C,X=X.next;for(o=1,ee=1<=(te=H);ee?ote;ee?o++:o--)S=M+((Fre;ne?R++:R--)p[M]=T*K>>Z,p[M+1]=k*K>>Z,p[M+2]=y*K>>Z,T-=P,k-=x,y-=v,P-=q.r,x-=q.g,v-=q.b,S=Q+((S=R+H)B;z?R++:R--){var oe,ie,ae,le,ce,se;for(w=b=_=k=y=T=0,P=H*(O=p[M=R<<2]),x=H*(E=p[M+1]),v=H*(C=p[M+2]),T+=W*O,k+=W*E,y+=W*C,X=Y,o=0,oe=0<=(ie=H);oe?oie;oe?o++:o--)X.r=O,X.g=E,X.b=C,X=X.next;var ue=l;for(o=1,ae=1<=(le=H);ae?ole;ae?o++:o--)M=ue+R<<2,T+=(X.r=O=p[M])*(j=H-o),k+=(X.g=E=p[M+1])*j,y+=(X.b=C=p[M+2])*j,_+=O,w+=E,b+=C,X=X.next,ose;ce?D++:D--)p[S=M<<2]=T*K>>Z,p[S+1]=k*K>>Z,p[S+2]=y*K>>Z,T-=P,k-=x,y-=v,P-=q.r,x-=q.g,v-=q.b,S=R+((S=D+H)-1;){var fe=o<<2,pe=(255&u[fe+2])/255*r,de=0|pe;if(de===d){var he=256*(pe-(0|pe)),me=256-he;s[fe]=s[fe]*me+p[fe]*he>>8,s[fe+1]=s[fe+1]*me+p[fe+1]*he>>8,s[fe+2]=s[fe+2]*me+p[fe+2]*he>>8}else de===d+1&&(s[fe]=p[fe],s[fe+1]=p[fe+1],s[fe+2]=p[fe+2])}d++}}return this})),Caman.Filter.register("tiltShift",(function(e){var t={center:{x:this.dimensions.width/2,y:this.dimensions.height/2},angle:45,focusWidth:200,startRadius:3,radiusFactor:1.5,steps:3};(e=Qc.b.extend(t,e)).angle*=Math.PI/180;var n=function(e,t,n,r,o,i,a){var l=document.createElement("canvas");l.width=e,l.height=t;var c=n+Math.cos(o)*i*.5,s=r+Math.sin(o)*i*.5,u=n-Math.cos(o)*i*.5,f=r-Math.sin(o)*i*.5,p=l.getContext("2d"),d=p.createLinearGradient(c,s,u,f);return a?(d.addColorStop(0,"white"),d.addColorStop(.5,"black"),d.addColorStop(1,"white")):(d.addColorStop(0,"white"),d.addColorStop(1,"black")),p.fillStyle=d,p.fillRect(0,0,e,t),p.getImageData(0,0,e,t)}(this.dimensions.width,this.dimensions.height,e.center.x,e.center.y,e.angle,e.focusWidth,!0);return this.processPlugin("compoundBlur",[n,e.startRadius,e.radiusFactor,e.steps])})),Caman.Filter.register("radialBlur",(function(e){var t={size:50,center:{x:this.dimensions.width/2,y:this.dimensions.height/2},startRadius:3,radiusFactor:1.5,steps:3,radius:null};(e=Qc.b.extend(t,e)).radius||(e.radius=this.dimensions.width-1?"&":"?")+(new Date).getTime()),u.setAttribute("crossOrigin","Anonymous"),u.src=e,e.startsWith("data:image/")||e.startsWith("blob:")||(u.src=u.src+(u.src.indexOf("?")>-1?"&version=":"?version=")+(new Date).getTime()),u.onload=function(){var e={width:u.width,height:u.height,ratio:u.width/u.height},n={activeBody:"preResize",isShowSpinner:!1,img:u,logoImage:f,imageName:s.indexOf("?")>-1?s.slice(0,s.indexOf("?")):s};if("manual"===o&&(i=u.height){var r=u.width/u.height,l={ratio:r,width:i,height:i/r};t.setState(cs(cs({preCanvasDimensions:cs({},l),canvasDimensions:cs({},l)},n),{},{activeBody:"preview",isPreResize:!0}))}else{var c=u.height/u.width,p={ratio:c,width:a/c,height:a};t.setState(cs(cs({preCanvasDimensions:cs({},p),canvasDimensions:cs({},p)},n),{},{activeBody:"preview",isPreResize:!0}))}else{var d,h=t.props.config.tools;1===h.length&&(d=h[0]),t.setState(cs(cs({},n),{},{activeBody:"preview",isPreResize:!1}),(function(){t.setState({activeTab:d})}))}}})),ms(ds(t),"determineImageType",(function(){var e=t.props.src;if(e instanceof Blob)t.setState({imageMime:e.type});else{var n=new XMLHttpRequest;n.open("GET",e),n.responseType="arraybuffer",n.onload=function(e){var n,r=e.target;t.setState({imageMime:(null===(n=Vc()(new Uint8Array(r.response)))||void 0===n?void 0:n.mime)||"image/svg+xml"})},n.send()}})),ms(ds(t),"updateState",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t._isMounted){var r=t.props.config.elementId,o=jr(r);e.latestCanvasSize={width:o.width,height:o.height},t.setState(e,n)}})),ms(ds(t),"onRevert",(function(){var e=t.state,n=e.cancelLastOperation,r=e.activeTab;t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}),n(r,(function(){t.setState(cs({isHideCanvas:!1,isShowSpinner:!1},gs))}))})),ms(ds(t),"onAdjust",(function(e,n){(0,t.state.onAdjust)(e,n)})),ms(ds(t),"onRotate",(function(e,n,r,o){(0,t.state.onRotate)(e,n,r,o)})),ms(ds(t),"onFlip",(function(e){(0,t.state.flip)(e)})),ms(ds(t),"onSave",(function(){var e=t.state.saveImage;t.setState({isShowSpinner:!0}),e()})),ms(ds(t),"onDownloadImage",(function(){var e=t.props.onBeforeComplete,n=t.state,r=n.downloadImage,o=(0,n.getResultCanvas)();!e||e({status:"before-complete",canvas:o})?r((function(){t.props.onComplete({status:"success",canvas:o}),t.props.onClose(Sr)})):(t.props.onComplete({status:"success",canvas:o}),t.props.onClose(kr))})),ms(ds(t),"onApplyEffects",(function(e){var n=t.state,r=n.applyCorrections,o=n.effect===e?null:e;t.setState({isShowSpinner:!0,effect:o},(function(){r((function(){t.setState({isShowSpinner:!1})}))}))})),ms(ds(t),"onApplyFilters",(function(e){var n=t.state,r=n.applyCorrections,o=n.filter===e?null:e;t.setState({isShowSpinner:!0,filter:o},(function(){r((function(){t.setState({isShowSpinner:!1})}))}))})),ms(ds(t),"handleSave",(function(){var e=t.state,n=e.processWithFilerobot,r=e.processWithCloudService;n||r?t.onSave():t.onDownloadImage()})),ms(ds(t),"apply",(function(e){var n=t.state,r=n.activeTab;(0,n.applyChanges)(r,e),t.setState({activeTab:null})})),ms(ds(t),"redoOperation",(function(e){var n=e.operationIndex,r=e.callback,o=void 0===r?function(){}:r,i=e.resetActiveTab,a=void 0===i||i,l=e.operationObject,c=void 0===l?{}:l,s=t.state.applyOperations;a?t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}):t.setState({isHideCanvas:!0,isShowSpinner:!0}),s(n,(function(){t.setState({isHideCanvas:!1,isShowSpinner:!1},o)}),c)})),ms(ds(t),"resetOperations",(function(){var e=t.state.resetAll;t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}),e((function(){t.setState(cs({isHideCanvas:!1,isShowSpinner:!1},gs))}))})),ms(ds(t),"onPreResize",(function(e){var n,r=t.props.config.tools;switch(1===r.length&&(n=r[0]),e){case"keep":t.setState({canvasDimensions:{},isPreResize:!1,activeBody:"preview"},(function(){t.setState({activeTab:n})}));break;case"resize":var o=t.state.canvasDimensions;t.setState({preCanvasDimensions:o,isPreResize:!0,activeBody:"preview"},(function(){t.setState({activeTab:n})}))}}));var n=e.config,r=n.processWithCloudimage,i=n.processWithFilerobot,l=n.processWithCloudService,c=n.uploadWithCloudimageLink,s=n.reduceBeforeEdit,u=n.cropBeforeEdit,f=n.watermark,p=n.imageSealing;return t.state=cs(cs({isShowSpinner:!0,isHideCanvas:!1,activeTab:null,activeBody:null,currentOperation:null,original:{width:300,height:200},cropDetails:{width:300,height:200},canvasDimensions:{width:300,height:200,ratio:1.5},processWithFilerobot:i,processWithCloudimage:r,processWithCloudService:l,uploadCloudimageImage:c,reduceBeforeEdit:s,cropBeforeEdit:u,roundCrop:!1,imageSealing:cs({enabled:!1,salt:"",char_count:10,include_params:null},p),operationsOriginal:[],operationsZoomed:[],operations:[],canvasZoomed:null,canvasOriginal:null,isPreResize:!1,initialZoom:1},gs),{},{watermark:f||sr,focusPoint:{x:null,y:null},shapes:[],selectedShape:{},availableShapes:[]}),t}return t=a,(n=[{key:"componentDidMount",value:function(){this._isMounted=!0,this.loadImage(),this.determineImageType()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"render",value:function(){var e=this.state,t=e.isShowSpinner,n=e.activeTab,r=e.operations,o=e.operationsOriginal,a=e.operationsZoomed,l=e.currentOperation,c=e.isHideCanvas,s=e.cropDetails,u=e.original,f=e.canvasDimensions,p=e.processWithCloudimage,d=e.processWithFilerobot,h=e.processWithCloudService,m=e.uploadCloudimageImage,g=e.imageMime,b=e.lastOperation,v=e.operationList,y=e.initialZoom,w=e.canvasZoomed,x=e.canvasOriginal,k=e.reduceBeforeEdit,S=e.cropBeforeEdit,C=e.img,E=e.imageName,O=e.activeBody,_=e.isPreResize,P=e.preCanvasDimensions,T=e.logoImage,j=e.imageSealing,R=e.effect,D=e.filter,M=e.crop,A=e.roundCrop,I=e.resize,z=e.rotate,L=e.correctionDegree,N=e.flipX,F=e.flipY,U=e.adjust,H=e.watermark,W=e.focusPoint,Y=e.shapes,V=e.shapeOperations,X=e.selectedShape,q=e.availableShapes,$=e.latestCanvasSize,Q=this.props,K=Q.src,Z=Q.config,G=Q.onClose,J=Q.onComplete,ee=Q.closeOnLoad,te=void 0===ee||ee,ne=Q.t,re=void 0===ne?{}:ne,oe=Q.theme,ie={effect:R,filter:D,crop:M,resize:I,rotate:z,flipX:N,flipY:F,adjust:U,correctionDegree:L},ae=cs(cs({t:re,theme:oe,cropDetails:s,original:u,activeTab:n,src:K,onClose:G,config:Z,canvasDimensions:f,processWithCloudimage:p,processWithFilerobot:d,processWithCloudService:h,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,isShowSpinner:t,img:C,logoImage:T,imageName:E,activeBody:O,preCanvasDimensions:P,updateState:this.updateState,onRevert:this.onRevert,apply:this.apply,onSave:this.onSave,onFlip:this.onFlip,onApplyEffects:this.onApplyEffects,onApplyFilters:this.onApplyFilters,onRotate:this.onRotate,onAdjust:this.onAdjust,onDownloadImage:this.onDownloadImage,handleSave:this.handleSave},ie),{},{watermark:H,focusPoint:W,shapes:Y,shapeOperations:V,selectedShape:X,availableShapes:q}),le=cs(cs({t:re,theme:oe,cropDetails:s,original:u,activeTab:n,isShowSpinner:t,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,currentOperation:l,isHideCanvas:c,src:K,imageMime:g,onClose:G,onComplete:J,canvasDimensions:f,closeOnLoad:te,config:Z,processWithCloudimage:p,processWithFilerobot:d,processWithCloudService:h,imageSealing:j,uploadCloudimageImage:m,lastOperation:b,operationList:v,canvasZoomed:w,canvasOriginal:x,reduceBeforeEdit:k,cropBeforeEdit:S,img:C,logoImage:T,imageName:E,isPreResize:_,preCanvasDimensions:P,updateState:this.updateState,handleSave:this.handleSave,onPreResize:this.onPreResize,redoOperation:this.redoOperation,roundCrop:A},ie),{},{watermark:H,focusPoint:W,shapes:Y,shapeOperations:V,selectedShape:X,latestCanvasSize:$}),ce={logoImage:T,t:re,theme:oe,activeBody:O,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,currentOperation:l,processWithCloudimage:p,processWithCloudService:h,updateState:this.updateState,redoOperation:this.redoOperation,resetOperations:this.resetOperations,config:Z,watermark:H};return i.a.createElement(B,{roundCrop:A,isLoading:t},i.a.createElement(Wc,ae),i.a.createElement(we,null,"preview"===O&&i.a.createElement(Bo,le),"preResize"===O&&i.a.createElement(Qo,le),i.a.createElement(vn,{overlay:!0,show:t,label:re["spinner.label"]})),i.a.createElement(Gn,ce))}}])&&ss(t.prototype,n),r&&ss(t,r),a}(o.Component);function vs(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\e90c'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e90c'\n }\n"]);return vs=function(){return e},e}var ys=a.b.span.attrs((function(){return{role:"button"}}))(vs(),(function(e){return e.t||"10px"}),(function(e){return e.r||"10px"}),(function(e){return e.l||"auto"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"18px"}),(function(){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function ws(e){return(ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xs(){return(xs=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Ss(e,t){for(var n=0;n div {\n padding: 40px !important;\n }\n \n * {\n color: black !important;\n }\n ":""}));var zs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cs(e,t)}(c,e);var t,n,a,l=Es(c);function c(e){var t,n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),t=l.call(this,e),n=_s(t),o=function(e){var n=t.props.onClose,r=void 0===n?function(){}:n;27===e.keyCode&&(e.stopPropagation(),r(wr))},(r="handleOutsideMouseClick")in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,t.root=document.createElement("div"),t.root.classList.add("filerobot-image-editor-root"),t.root.id="filerobot-image-editor-root",document.body.appendChild(t.root);var i=t.props.closeOnOutsideClick;return(void 0===i||i)&&document.addEventListener("keydown",t.handleOutsideMouseClick),t}return t=c,(n=[{key:"componentWillUnmount",value:function(){var e=this.props.closeOnOutsideClick,t=void 0===e||e;document.body.removeChild(this.root),t&&document.removeEventListener("keydown",this.handleOutsideMouseClick)}},{key:"render",value:function(){var e=this.props,t=e.onClose,n=void 0===t?function(){}:t,a=e.isHideCloseBtn,l=e.configModalId,c=ks(e,["onClose","isHideCloseBtn","configModalId"]);return Object(r.createPortal)(i.a.createElement(o.Fragment,null,i.a.createElement(Ms,{className:"modal-overlay",onClick:function(){return n(xr)}}),i.a.createElement(Is,xs({id:l||er},this.props),!a&&i.a.createElement(ys,{onClick:n}),i.a.createElement(As,xs({h:"100%"},c),this.props.children))),this.root)}}])&&Ss(t.prototype,n),a&&Ss(t,a),c}(o.Component),Bs=(n(66),{en:{"header.image_editor_title":"Filerobot Image Editor","header.toggle_fullscreen":"Toggle fullscreen","header.close_modal":"Close window","toolbar.download":"Download","toolbar.save":"Save","toolbar.apply":"Apply","toolbar.cancel":"Cancel","toolbar.go_back":"Go Back","toolbar.adjust":"Adjust","toolbar.effects":"Effects","toolbar.filters":"Filters","toolbar.orientation":"Orientation","toolbar.crop":"Crop","toolbar.resize":"Resize","toolbar.watermark":"Watermark","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"Brightness","adjust.contrast":"Contrast","adjust.exposure":"Exposure","adjust.saturation":"Saturation","orientation.rotate_l":"Rotate Left","orientation.rotate_r":"Rotate Right","orientation.flip_h":"Flip Horizontally","orientation.flip_v":"Flip Vertically","pre_resize.title":"Would you like to reduce resolution before editing the image?","pre_resize.keep_original_resolution":"Keep original resolution","pre_resize.resize_n_continue":"Resize & Continue","footer.reset":"Reset","footer.undo":"Undo","footer.redo":"Redo","spinner.label":"Processing...","warning.too_big_resolution":"The resolution of the image is too big for the web. It can cause problems with Image Editor performance.","common.x":"x","common.y":"y","common.width":"width","common.height":"height","common.custom":"custom","common.original":"original","common.square":"square","common.opacity":"Opacity","common.apply_watermark":"Apply watermark","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery","common.text":"Text"},fr:{"header.image_editor_title":"Éditeur d'Image Filerobot","toolbar.download":"Télécharger","toolbar.save":"Sauvegarder","toolbar.apply":"Appliquer","toolbar.cancel":"Annuler","toolbar.go_back":"Retour","toolbar.adjust":"Ajuster","toolbar.effects":"Effets","toolbar.filters":"Filtres","toolbar.orientation":"Orientation","toolbar.crop":"Rogner","toolbar.resize":"Redimensionner","toolbar.watermark":"Watermark","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"Luminosité","adjust.contrast":"Contraste","adjust.exposure":"Exposition","adjust.saturation":"Saturation","orientation.rotate_l":"Rotation Gauche","orientation.rotate_r":"Rotation Droite","orientation.flip_h":"Miroir Horizontal","orientation.flip_v":"Miroir Vertical","pre_resize.title":"Voulez-vous réduire la résolution de l'image avant d'éditer l'image ?","pre_resize.keep_original_resolution":"Conserver la résolution d'origine","pre_resize.resize_n_continue":"Redimensionner et Continuer","footer.reset":"Réinitialiser","footer.undo":"Annuler","footer.redo":"Refaire","spinner.label":"Transformation...","warning.too_big_resolution":"La résolution de l'image est trop grande pour le web et peut endommager les performances de l'Éditeur d'Image Filerobot.","common.x":"x","common.y":"y","common.width":"largeur","common.height":"hauteur","common.custom":"custom","common.original":"original","common.square":"carré","common.opacity":"opacité","common.apply_watermark":"Appliquer watermark","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery"},"zh-cn":{"header.image_editor_title":"Filerobot 图片编辑器","toolbar.download":"下载","toolbar.save":"保存","toolbar.apply":"应用","toolbar.cancel":"取消","toolbar.go_back":"后退","toolbar.adjust":"调整","toolbar.effects":"效果","toolbar.filters":"滤镜","toolbar.orientation":"方向","toolbar.crop":"裁切","toolbar.resize":"缩放","toolbar.watermark":"水印","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"亮度","adjust.contrast":"对比对","adjust.exposure":"曝光度","adjust.saturation":"饱和度","orientation.rotate_l":"向左旋转","orientation.rotate_r":"向右旋转","orientation.flip_h":"水平翻转","orientation.flip_v":"垂直翻转","pre_resize.title":"是否需要在开始编辑之前缩小图片的分辨率?","pre_resize.keep_original_resolution":"保持原始分辨率","pre_resize.resize_n_continue":"缩小并继续","footer.reset":"重置","footer.undo":"撤销","footer.redo":"重做","spinner.label":"处理中...","warning.too_big_resolution":"图片的分辨率过大,这会严重影响图片编辑器的性能。","common.x":"x","common.y":"y","common.width":"宽度","common.height":"高度","common.custom":"自定义","common.original":"原始比例","common.square":"方形","common.banner":"通栏","common.opacity":"透明度","common.apply_watermark":"应用水印","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery"}}),Ls={colors:{primaryBg:"#1e262c",primaryBgHover:"#637381",secondaryBg:"#263138",secondaryBgHover:"#34444c",text:"#F9FAFB",textHover:"#fff",textMute:"#aaa",textWarn:"#f7931e",secondaryBgOpacity:"rgba(0, 0, 0, 0.75)",accent:"#00707c",border:"#161e23",borderLight:"#70777f",disabledBg:"rgba(255, 0, 0, 0.1)"}},Ns={colors:{primaryBg:"#f2f2f2",primaryBgHover:"#fff",secondaryBg:"#fff",secondaryBgHover:"#f9fafb",secondaryBgOpacity:"rgba(255,255,255, 0.75)",text:"#34444c",textHover:"#1a2329",textMute:"#aaa",textWarn:"#f7931e",accent:"#00707c",border:"#aeaeae",borderLight:"#e1e1e1",disabledBg:"rgba(255, 0, 0, 0.1)"}},Fs="undefined"==typeof window||"undefined"==typeof CanvasRenderingContext2D;function Us(e){return(Us="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ws(e){for(var t=1;t-1})):n})})),Ks($s(t),"open",(function(e){var n=t.props.onOpen;t._isMounted&&t.setState({isVisible:!0,src:e},(function(){n&&n()}))})),Ks($s(t),"close",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vr,n=t.props.onClose,r="object"===Us(e)?vr:e;t._isMounted&&t.setState({isVisible:!1},(function(){n&&n({status:r})}))})),s.translations=s.translations||{},s.language=s.translations[s.language]||Bs[s.language]?s.language:"en",s.theme=s.theme||{},s.theme.colors=s.theme.colors||{},s.theme.fonts=s.theme.fonts||ur,s.colorScheme=s.colorScheme||"dark",s.platform=s.platform||"filerobot";var u="object"===Us(s.colorScheme);return t.state={isVisible:r,src:a,config:t.processConfig(s),t:Ws(Ws({},Bs[s.language]),s.translations[s.language]),colorScheme:u?"custom":s.colorScheme||"dark",theme:{colors:Ws(Ws({},(u?{colors:s.colorScheme}:"light"===s.colorScheme?Ns:Ls).colors),s.theme.colors),fonts:s.theme.fonts}},t}return t=l,(n=[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"componentDidUpdate",value:function(e){this.props.show!==e.show&&(this.props.show?this.open(this.props.src):this.close())}},{key:"render",value:function(){var e=this.state,t=e.isVisible,n=e.src,r=e.config,o=e.t,l=e.theme,c=this.props,s=c.onComplete,u=void 0===s?function(){}:s,f=c.onBeforeComplete,p=c.closeOnLoad,d=r.showInModal,h=void 0===d||d;if(!n||!t||Fs)return null;if(n instanceof Blob&&r.processWithCloudimage)return null;var m=i.a.createElement(z,null,i.a.createElement(bs,{src:n,config:r,onComplete:u,onBeforeComplete:f,onClose:this.close,closeOnLoad:p,t:o}));return i.a.createElement(a.a,{theme:Ws({},l)},h?i.a.createElement(zs,{noBorder:!0,fullScreen:"lg",isHideCloseBtn:!0,style:{borderRadius:5},onClose:this.close,configModalId:r.elementId},m):i.a.createElement("div",{className:"filerobot-image-editor-root",id:"filerobot-image-editor-root",style:{width:"100%",height:"100%"}},m))}}])&&Ys(t.prototype,n),r&&Ys(t,r),l}(o.Component);function Gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}window.FilerobotImageEditor=function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Gs(this,e),t=n.elementId?n.elementId:n.processWithCloudimage||n.cloudimage?"filerobot-image-editor-cloudimage":n.processWithFilerobot||n.filerobot?"filerobot-image-editor-uploader":"filerobot-image-editor";var l=document.getElementById(t),c=function(e){console.log(e)};c=o&&"function"==typeof o?o:(o=o||{}).onComplete||c,l||((l=document.createElement("div")).id=t,document.body.appendChild(l)),n.elementId=t;var s=function(e){return Object(r.render)(i.a.createElement(e,{show:a,config:n,onComplete:c,onBeforeComplete:o.onBeforeComplete,onOpen:o.onOpen,onClose:o.onClose}),l)};this.component=s(Zs),this.open=this.component.open,this.close=this.component.close,this.unmount=function(){return Object(r.unmountComponentAtNode)(l)}}}]); \ No newline at end of file +var r=n(36),o=n(37),i=n(38);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return _(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,a=1,l=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,l/=2,c/=2,n/=2}function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;il&&(n=l-c),i=n;i>=0;i--){for(var f=!0,p=0;po&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:s>223?3:s>191?2:1;if(o+f<=n)switch(f){case 1:s<128&&(u=s);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&s)<<6|63&i)>127&&(u=c);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(c=(15&s)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=e[o+1],a=e[o+2],l=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&l)&&(c=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&l)>65535&&c<1114112&&(u=c)}null===u?(u=65533,f=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),l=Math.min(i,a),s=this.slice(r,o),u=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return k(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function A(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function I(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,i){return i||I(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||I(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):A(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=0,a=1,l=0;for(this[t]=255&e;++i>0)-l&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/a>>0)-l&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):A(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(13))},function(e,t,n){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=s(e),a=r[0],l=r[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,l)),u=0,f=l>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===l&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===l&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,l=n-o;al?l:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,c=a.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var o,i,a=[],l=t;l>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,l=8*o-r-1,c=(1<>1,u=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-u)-1,d>>=-u,u+=l;u>0;i=256*i+e[t+f],f+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+f],f+=p,u-=8);if(0===i)i=1-s;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=s}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,l,c,s=8*i-o-1,u=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(t*c-1)*Math.pow(2,o),a+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&l,d+=h,l/=256,o-=8);for(a=a<0;e[n+d]=255&a,d+=h,a/=256,s-=8);e[n+d-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(module,__webpack_exports__,__webpack_require__){"use strict";var _module__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(19),_core_util__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2),_logger__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3),_store__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6),_renderer__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(20);function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n",this.hiDPIReplacement()),this.swapped=!0,this.image.src=this.hiDPIReplacement()),Caman.IO.isRemote(this.image))return this.image.src=Caman.IO.proxyUrl(this.image.src),_logger__WEBPACK_IMPORTED_MODULE_2__.a.debug("Remote image detected, using URL = ".concat(this.image.src))}},{key:"waitForImageLoaded",value:function(){return this.isImageLoaded()?this.imageLoaded():this.image.onload=this.imageLoaded}},{key:"isImageLoaded",value:function(){return!!this.image.complete&&(null==this.image.naturalWidth||0!==this.image.naturalWidth)}},{key:"imageWidth",value:function(){return this.image.width||this.image.naturalWidth}},{key:"imageHeight",value:function(){return this.image.height||this.image.naturalHeight}},{key:"imageLoaded",value:function(){return _logger__WEBPACK_IMPORTED_MODULE_2__.a.debug("Image loaded. Width = ".concat(this.imageWidth(),", Height = ").concat(this.imageHeight())),this.swapped?(this.canvas.width=this.imageWidth()/this.hiDPIRatio(),this.canvas.height=this.imageHeight()/this.hiDPIRatio()):(this.canvas.width=this.imageWidth(),this.canvas.height=this.imageHeight()),this.finishInit()}},{key:"finishInit",value:function(){if(null==this.context&&(this.context=this.canvas.getContext("2d")),this.originalWidth=this.preScaledWidth=this.width=this.canvas.width,this.originalHeight=this.preScaledHeight=this.height=this.canvas.height,this.hiDPIAdjustments(),this.hasId()||this.assignId(),null!=this.image&&this.context.drawImage(this.image,0,0,this.imageWidth(),this.imageHeight(),0,0,this.preScaledWidth,this.preScaledHeight),this.imageData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),this.pixelData=this.imageData.data,Caman.allowRevert){this.initializedPixelData=_core_util__WEBPACK_IMPORTED_MODULE_1__.b.dataArray(this.pixelData.length),this.originalPixelData=_core_util__WEBPACK_IMPORTED_MODULE_1__.b.dataArray(this.pixelData.length);for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;if(null==r&&(r=0),null==n){n=0;for(var o=0,i=t.length,a=0<=i;a?oi;a?o++:o--)n+=t[o]}return this.renderer.add({type:Caman.Filter.Type.Kernel,name:e,adjust:t,divisor:n,bias:r}),this}},{key:"processPlugin",value:function(e,t){return this.renderer.add({type:Caman.Filter.Type.Plugin,plugin:e,args:t}),this}},{key:"newLayer",value:function(e){var t=new Caman.Layer(this);return this.canvasQueue.push(t),this.renderer.add({type:Caman.Filter.Type.LayerDequeue}),e.call(t),this.renderer.add({type:Caman.Filter.Type.LayerFinished}),this}},{key:"executeLayer",value:function(e){return this.pushContext(e)}},{key:"pushContext",value:function(e){return this.layerStack.push(this.currentLayer),this.pixelStack.push(this.pixelData),this.currentLayer=e,this.pixelData=e.pixelData}},{key:"popContext",value:function(){return this.pixelData=this.pixelStack.pop(),this.currentLayer=this.layerStack.pop()}},{key:"applyCurrentLayer",value:function(){return this.currentLayer.applyToParent()}},{key:"save",value:function(){return this.browserSave.apply(this,arguments)}},{key:"browserSave",value:function(e){null==e&&(e="png"),e=e.toLowerCase();var t=this.toBase64(e).replace("image/".concat(e),"image/octet-stream");return document.location.href=t}},{key:"toImage",value:function(e){var t=new Image;return t.src=this.toBase64(e),t.width=this.dimensions.width,t.height=this.dimensions.height,window.devicePixelRatio&&(t.width/=window.devicePixelRatio,t.height/=window.devicePixelRatio),t}},{key:"toBase64",value:function(e){return null==e&&(e="png"),e=e.toLowerCase(),this.canvas.toDataURL("image/".concat(e))}}]),Caman}(_module__WEBPACK_IMPORTED_MODULE_0__.a);Caman.initClass(),window.Caman=Caman;var _unused_webpack_default_export=Caman},function(e,t){function n(e,t){for(var n=0;n1;){for(var m=[],g=0,b=h.length-2,v=0<=b;v?g<=b:g>=b;v?g++:g--)m.push([f(h[g][0],h[g+1][0],d),f(h[g][1],h[g+1][1],d)]);h=m}u[Math.round(h[0][0])]=Math.round((l=h[0][1],c=o,s=i,Math.min(Math.max(l,c),s)))}var y=a[a.length-1][0];return u=Caman.Calculate.missingValues(u,y),null==u[y]&&(u[y]=u[y-1]),u}},{key:"hermite",value:function(e,t,n){if(e.length<2)throw"Invalid number of arguments to hermite";for(var r,o,i,a,l={},c=function(e,t){return[e[0]*t[0],e[1]*t[1]]},s=function(e,t){return[e[0]-t[0],e[1]-t[1]]},u=function(e,t,n){return Math.min(Math.max(e,t),n)},f=0,p=e.length-2,d=0<=p;d?f<=p:f>=p;d?f++:f--){var h=e[f],m=e[f+1],g=m[0]-h[0],b=1/g;f===e.length-2&&(b=1/(g-1));for(var v=f>0?e[f-1]:h,y=c(s(m,v),[.5,.5]),w=c(s(v=f=k;S?x++:x--){var C=x*b,E=2*C*C*C-3*C*C+1,O=C*C*C-2*C*C+C,_=-2*C*C*C+3*C*C,P=C*C*C-C*C,T=(r=c(h,[E,E]),o=c(y,[O,O]),i=c(m,[_,_]),a=c(w,[P,P]),[r[0]+o[0]+i[0]+a[0],r[1]+o[1]+i[1]+a[1]]);l[Math.round(T[0])]=Math.round(u(T[1],t,n))}}var j=e[e.length-1][0];return l=Caman.Calculate.missingValues(l,j)}},{key:"missingValues",value:function(e,t){var n,r,o,i,a,l,c;if(Object.keys(e).length=t;n=0<=t?++l:--l)if(null!=e[n])i[n]=e[n];else{for(o=[n-1,i[n-1]],r=c=n;n<=t?c<=t:c>=t;r=n<=t?++c:--c)if(null!=e[r]){a=[r,e[r]];break}a||(a=[0,0]),i[n]=o[1]+(a[1]-o[1])/(a[0]-o[0])*(n-o[0])}return i}return e}}],(r=null)&&n(t.prototype,r),o&&n(t,o),e}();Caman.Calculate=r},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n.5?s/(2-a-l):s/(a+l),o=function(){switch(a){case e:return(t-r)/s+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}},{key:"rgbToHSV",value:function(e,t,n){var r;e/=255,t/=255,n/=255;var o=Math.max(e,t,n),i=Math.min(e,t,n),a=o,l=o-i,c=0===o?0:l/o;return o===i?r=0:(r=function(){switch(o){case e:return(t-n)/l+(t.04045?e=Math.pow((e+.055)/1.055,2.4):e/=12.92,t>.04045?t=Math.pow((t+.055)/1.055,2.4):t/=12.92,n>.04045?n=Math.pow((n+.055)/1.055,2.4):n/=12.92,{x:100*(.4124*e+.3576*t+.1805*n),y:100*(.2126*e+.7152*t+.0722*n),z:100*(.0193*e+.1192*t+.9505*n)}}},{key:"xyzToRGB",value:function(e,t,n){var r=3.2406*(e/=100)+-1.5372*(t/=100)+-.4986*(n/=100),o=-.9689*e+1.8758*t+.0415*n,i=.0557*e+-.204*t+1.057*n;return r>.0031308?r=1.055*Math.pow(r,.4166666667)-.055:r*=12.92,o>.0031308?o=1.055*Math.pow(o,.4166666667)-.055:o*=12.92,i>.0031308?i=1.055*Math.pow(i,.4166666667)-.055:i*=12.92,{r:255*r,g:255*o,b:255*i}}},{key:"xyzToLab",value:function(e,t,r){return"object"===n(e)&&(t=e.y,r=e.z,e=e.x),t/=100,r/=108.883,e=(e/=95.047)>.008856451679?Math.pow(e,.3333333333):7.787037037*e+.1379310345,{l:116*(t=t>.008856451679?Math.pow(t,.3333333333):7.787037037*t+.1379310345)-16,a:500*(e-t),b:200*(t-(r=r>.008856451679?Math.pow(r,.3333333333):7.787037037*r+.1379310345))}}},{key:"labToXYZ",value:function(e,t,r){"object"===n(e)&&(t=e.a,r=e.b,e=e.l);var o=(e+16)/116,i=o+t/500,a=o-r/200;return i>.2068965517?i*=i*i:i=.1284185493*(i-.1379310345),o>.2068965517?o*=o*o:o=.1284185493*(o-.1379310345),a>.2068965517?a*=a*a:a=.1284185493*(a-.1379310345),{x:95.047*i,y:100*o,z:108.883*a}}},{key:"rgbToLab",value:function(e,t,r){"object"===n(e)&&(t=e.g,r=e.b,e=e.r);var o=this.rgbToXYZ(e,t,r);return this.xyzToLab(o)}},{key:"labToRGB",value:function(e,t,n){}}],(o=null)&&r(t.prototype,o),i&&r(t,i),e}();Caman.Convert=o},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null;if(this.events[t]&&this.events[t].length)return function(){for(var o=[],i=0,a=Array.from(n.events[t]);i4&&void 0!==arguments[4]?arguments[4]:null;n(this,e),null==t&&(t=0),this.r=t,null==r&&(r=0),this.g=r,null==o&&(o=0),this.b=o,null==i&&(i=255),this.a=i,this.c=a,this.loc=0}return o(e,null,[{key:"coordinatesToLocation",value:function(e,t,n){return 4*(t*n+e)}},{key:"locationToCoordinates",value:function(e,t){return{x:e%(4*t)/4,y:Math.floor(e/(4*t))}}}]),o(e,[{key:"setContext",value:function(e){return this.c=e}},{key:"locationXY",value:function(){if(null==this.c)throw"Requires a CamanJS context";var e=this.c.dimensions.height-Math.floor(this.loc/(4*this.c.dimensions.width));return{x:this.loc%(4*this.c.dimensions.width)/4,y:e}}},{key:"pixelAtLocation",value:function(t){if(null==this.c)throw"Requires a CamanJS context";return new e(this.c.pixelData[t],this.c.pixelData[t+1],this.c.pixelData[t+2],this.c.pixelData[t+3],this.c)}},{key:"getPixelRelative",value:function(t,n){if(null==this.c)throw"Requires a CamanJS context";var r=this.loc+4*this.c.dimensions.width*(-1*n)+4*t;return r>this.c.pixelData.length||r<0?new e(0,0,0,255,this.c):this.pixelAtLocation(r)}},{key:"putPixelRelative",value:function(e,t,n){if(null==this.c)throw"Requires a CamanJS context";this.loc,this.c.dimensions.width;if(!(newLoc>this.c.pixelData.length||newLoc<0))return this.c.pixelData[newLoc]=n.r,this.c.pixelData[newLoc+1]=n.g,this.c.pixelData[newLoc+2]=n.b,this.c.pixelData[newLoc+3]=n.a,!0}},{key:"getPixel",value:function(e,t){if(null==this.c)throw"Requires a CamanJS context";var n=this.coordinatesToLocation(e,t,this.width);return this.pixelAtLocation(n)}},{key:"putPixel",value:function(e,t,n){if(null==this.c)throw"Requires a CamanJS context";var r=this.coordinatesToLocation(e,t,this.width);return this.c.pixelData[r]=n.r,this.c.pixelData[r+1]=n.g,this.c.pixelData[r+2]=n.b,this.c.pixelData[r+3]=n.a}},{key:"toString",value:function(){return this.toKey()}},{key:"toHex",value:function(e){null==e&&(e=!1);var t="#"+this.r.toString(16)+this.g.toString(16)+this.b.toString(16);return e?t+this.a.toString(16):t}}]),e}();Caman.Pixel=i},function(e,t){function n(e,t){for(var n=0;n255-e?t.r=255:t.r255-e?t.g=255:t.g255-e?t.b=255:t.b0?t.r+=(255-t.r)*e.red:t.r-=t.r*Math.abs(e.red)),null!=e.green&&(e.green>0?t.g+=(255-t.g)*e.green:t.g-=t.g*Math.abs(e.green)),null!=e.blue&&(e.blue>0?t.b+=(255-t.b)*e.blue:t.b-=t.b*Math.abs(e.blue)),t}))})),Caman.Filter.register("curves",(function(){var e,t,n,r,o,i,a,l,c,s,u,f;if(n=arguments[0],"function"==typeof(a=(r=2<=arguments.length?[].slice.call(arguments,1):[])[r.length-1])?(e=a,r.pop()):"string"==typeof a?(e=Caman.Calculate[a],r.pop()):e=Caman.Calculate.bezier,"string"==typeof n&&(n=n.split("")),"v"===n[0]&&(n=["r","g","b"]),r.length<2)throw"Invalid number of arguments to curves filter";if(t=e(r,0,255),(l=r[0])[0]>0)for(i=c=0,u=l[0];0<=u?cu;i=0<=u?++c:--c)t[i]=l[1];if((o=r[r.length-1])[0]<255)for(i=s=f=o[0];f<=255?s<=255:s>=255;i=f<=255?++s:--s)t[i]=o[1];return this.process("curves",(function(e){var r,o;for(i=r=0,o=n.length;0<=o?ro;i=0<=o?++r:--r)e[n[i]]=t[e[n[i]]];return e}))})),Caman.Filter.register("exposure",(function(e){var t,n,r;return t=[0,255*(r=Math.abs(e)/100)],n=[255-255*r,255],e<0&&(t=t.reverse(),n=n.reverse()),this.curves("rgb",[0,0],t,n,[255,255])}))},function(e,t){Caman.Filter.register("boxBlur",(function(){return this.processKernel("Box Blur",[1,1,1,1,1,1,1,1,1])})),Caman.Filter.register("heavyRadialBlur",(function(){return this.processKernel("Heavy Radial Blur",[0,0,1,0,0,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,0,0,1,0,0])})),Caman.Filter.register("gaussianBlur",(function(){return this.processKernel("Gaussian Blur",[1,4,6,4,1,4,16,24,16,4,6,24,36,24,6,4,16,24,16,4,1,4,6,4,1])})),Caman.Filter.register("motionBlur",(function(e){var t;return t=0===e||180===e?[0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0]:e>0&&e<90||e>180&&e<270?[0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0]:90===e||270===e?[0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0]:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],this.processKernel("Motion Blur",t)})),Caman.Filter.register("sharpen",(function(e){return null==e&&(e=100),e/=100,this.processKernel("Sharpen",[0,-e,0,-e,4*e+1,-e,0,-e,0])}))},function(e,t){Caman.Filter.register("vignette",(function(e,t){var n,r,o,i;return null==t&&(t=60),"string"==typeof e&&"%"===e.substr(-1)&&(e=this.dimensions.height>this.dimensions.width?this.dimensions.width*(parseInt(e.substr(0,e.length-1),10)/100):this.dimensions.height*(parseInt(e.substr(0,e.length-1),10)/100)),t/=100,r=[this.dimensions.width/2,this.dimensions.height/2],i=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)),o=i-e,n=Caman.Calculate.bezier([0,1],[30,30],[70,60],[100,80]),this.process("vignette",(function(i){var a,l,c;return c=i.locationXY(),(a=Caman.Calculate.distance(c.x,c.y,r[0],r[1]))>o&&(l=Math.max(1,n[Math.round((a-o)/e*100)]/10*t),i.r=255*Math.pow(i.r/255,l),i.g=255*Math.pow(i.g/255,l),i.b=255*Math.pow(i.b/255,l)),i}))}))},function(e,t){Caman.Filter.register("posterize",(function(e){var t,n;return t=256/e,n=255/(e-1),this.process("posterize",(function(e){return e.r=Math.floor(Math.floor(e.r/t)*n),e.g=Math.floor(Math.floor(e.g/t)*n),e.b=Math.floor(Math.floor(e.b/t)*n),e}))}))},function(e,t){Caman.Filter.register("edgeEnhance",(function(){return this.processKernel("Edge Enhance",[0,0,0,-1,1,0,0,0,0])})),Caman.Filter.register("edgeDetect",(function(){return this.processKernel("Edge Detect",[-1,-1,-1,-1,8,-1,-1,-1,-1])})),Caman.Filter.register("emboss",(function(){return this.processKernel("Emboss",[-2,-1,0,-1,1,1,0,1,2])}))},function(e,t){Caman.Filter.register("grungy",(function(){return this.gamma(1.5),this.clip(25),this.saturation(-60),this.contrast(5),this.noise(5),this.vignette("50%",30)}))},function(e,t){Caman.Filter.register("hazyDays",(function(){return this.gamma(1.2),this.newLayer((function(){return this.setBlendingMode("overlay"),this.opacity(60),this.copyParent(),this.filter.channels({red:5}),this.filter.stackBlur(15)})),this.newLayer((function(){return this.setBlendingMode("addition"),this.opacity(40),this.fillColor("#6899ba")})),this.newLayer((function(){return this.setBlendingMode("multiply"),this.opacity(35),this.copyParent(),this.filter.brightness(40),this.filter.vibrance(40),this.filter.exposure(30),this.filter.contrast(15),this.filter.curves("r",[0,40],[128,128],[128,128],[255,215]),this.filter.curves("g",[0,40],[128,128],[128,128],[255,215]),this.filter.curves("b",[0,40],[128,128],[128,128],[255,215]),this.filter.stackBlur(5)})),this.curves("r",[20,0],[128,158],[128,128],[235,255]),this.curves("g",[20,0],[128,128],[128,128],[235,255]),this.curves("b",[20,0],[128,108],[128,128],[235,255]),this.vignette("45%",20)}))},function(e,t){Caman.Filter.register("lomo",(function(e){return null==e&&(e=!0),this.brightness(15),this.exposure(15),this.curves("rgb",[0,0],[200,0],[155,255],[255,255]),this.saturation(-20),this.gamma(1.8),e&&this.vignette("50%",60),this.brightness(5)}))},function(e,t){Caman.Filter.register("sinCity",(function(){return this.contrast(100),this.brightness(15),this.exposure(10),this.posterize(80),this.clip(30),this.greyscale()}))},function(e,t){Caman.Filter.register("crossProcess",(function(){return this.exposure(5),this.colorize("#e87b22",4),this.sepia(20),this.channels({blue:8,red:3}),this.curves("b",[0,0],[100,150],[180,180],[255,255]),this.contrast(15),this.vibrance(75),this.gamma(1.6)}))},function(e,t){Caman.Filter.register("glowingSun",(function(e){if(null==e&&(e=!0),this.brightness(10),this.newLayer((function(){return this.setBlendingMode("multiply"),this.opacity(80),this.copyParent(),this.filter.gamma(.8),this.filter.contrast(50),this.filter.exposure(10)})),this.newLayer((function(){return this.setBlendingMode("softLight"),this.opacity(80),this.fillColor("#f49600")})),this.exposure(20),this.gamma(.8),e)return this.vignette("45%",20)}))},function(e,t){Caman.Filter.register("jarques",(function(){return this.saturation(-35),this.curves("b",[20,0],[90,120],[186,144],[255,230]),this.curves("r",[0,0],[144,90],[138,120],[255,255]),this.curves("g",[10,0],[115,105],[148,100],[255,248]),this.curves("rgb",[0,0],[120,100],[128,140],[255,255]),this.sharpen(20)}))},function(e,t){Caman.Filter.register("love",(function(){return this.brightness(5),this.exposure(8),this.contrast(4),this.colorize("#c42007",30),this.vibrance(50),this.gamma(1.3)}))},function(e,t){Caman.Filter.register("oldBoot",(function(){return this.saturation(-20),this.vibrance(-50),this.gamma(1.1),this.sepia(30),this.channels({red:-10,blue:5}),this.curves("rgb",[0,0],[80,50],[128,230],[255,255]),this.vignette("60%",30)}))},function(e,t){Caman.Filter.register("orangePeel",(function(){return this.curves("rgb",[0,0],[100,50],[140,200],[255,255]),this.vibrance(-30),this.saturation(-30),this.colorize("#ff9000",30),this.contrast(-5),this.gamma(1.4)}))},function(e,t){Caman.Filter.register("pinhole",(function(){return this.greyscale(),this.sepia(10),this.exposure(10),this.contrast(15),this.vignette("60%",35)}))},function(e,t){Caman.Filter.register("sunrise",(function(){return this.exposure(3.5),this.saturation(-5),this.vibrance(50),this.sepia(60),this.colorize("#e87b22",10),this.channels({red:8,blue:8}),this.contrast(5),this.gamma(1.2),this.vignette("55%",25)}))},function(e,t){Caman.Filter.register("vintage",(function(e){if(null==e&&(e=!0),this.greyscale(),this.contrast(5),this.noise(3),this.sepia(100),this.channels({red:8,blue:2,green:4}),this.gamma(.87),e)return this.vignette("40%",30)}))},function(e,t){var n,r,o;r=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],n=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},Caman.Plugin.register("stackBlur",(function(e){var t,i,a,l,c,s,u,f,p,d,h,m,g,b,v,y,w,x,k,S,C,E,O,_,P,T,j,R,D,M,A,I,z,B,L,N,F,U,H,W,Y,V,X,q;if(!(isNaN(e)||e<1)){for(e|=0,v=this.pixelData,l=e+e+1,(D=this.dimensions.width)<<2,M=D-1,p=(f=this.dimensions.height)-1,R=(S=e+1)*(S+1)/2,O=j=new n,d=N=1;1<=l?Nl;d=1<=l?++N:--N)O=O.next=new n,d===S&&(_=O);for(O.next=j,P=null,T=null,L=z=0,h=r[e],E=o[e],I=F=0;0<=f?Ff;I=0<=f?++F:--F){for(w=c=t=k=u=a=0,x=S*(y=v[z]),s=S*(b=v[z+1]),i=S*(g=v[z+2]),k+=R*y,u+=R*b,a+=R*g,O=j,d=U=0;0<=S?US;d=0<=S?++U:--U)O.r=y,O.g=b,O.b=g,O=O.next;for(d=H=1;1<=S?HS;d=1<=S?++H:--H)m=z+((MD;A=0<=D?++W:--W)v[z]=k*h>>E,v[z+1]=u*h>>E,v[z+2]=a*h>>E,k-=x,u-=s,a-=i,x-=P.r,s-=P.g,i-=P.b,m=L+((m=A+e+1)D;A=0<=D?++Y:--Y){for(c=t=w=u=a=k=0,x=S*(y=v[z=A<<2]),s=S*(b=v[z+1]),i=S*(g=v[z+2]),k+=R*y,u+=R*b,a+=R*g,O=j,d=V=0;0<=S?VS;d=0<=S?++V:--V)O.r=y,O.g=b,O.b=g,O=O.next;for(B=D,d=X=1;1<=e?X<=e:X>=e;d=1<=e?++X:--X)z=B+A<<2,k+=(O.r=y=v[z])*(C=S-d),u+=(O.g=b=v[z+1])*C,a+=(O.b=g=v[z+2])*C,w+=y,c+=b,t+=g,O=O.next,df;I=0<=f?++q:--q)v[m=z<<2]=k*h>>E,v[m+1]=u*h>>E,v[m+2]=a*h>>E,k-=x,u-=s,a-=i,x-=P.r,s-=P.g,i-=P.b,m=A+((m=I+S)=0&&u.splice(t,1)}function g(e){var t=document.createElement("style");return e.attrs.type="text/css",b(t,e.attrs),h(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function v(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var a=s++;n=c||(c=g(t)),r=x.bind(null,n,a,!1),o=x.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",b(t,e.attrs),h(e,t),t}(t),r=S.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=k.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var r=[],o=0;o1||"string"!=typeof t||"r"!=t[0]&&"#"!=t[0]||"string"!=typeof n&&void 0!==n)return null;window.sbcRip||(window.sbcRip=function(e){var t=e.length,n=new Object;if(t>9){if((e=e.split(",")).length<3||e.length>4)return null;n[0]=r(e[0].slice(4)),n[1]=r(e[1]),n[2]=r(e[2]),n[3]=e[3]?parseFloat(e[3]):-1}else{if(8==t||6==t||t<4)return null;t<6&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?e[4]+""+e[4]:"")),e=r(e.slice(1),16),n[0]=e>>16&255,n[1]=e>>8&255,n[2]=255&e,n[3]=9==t||5==t?o((e>>24&255)/255*1e4)/1e4:-1}return n});var r=parseInt,o=Math.round,i=t.length>9,a=(i="string"==typeof n?n.length>9||"c"==n&&!i:i,e<0),l=(e=a?-1*e:e,n=n&&"c"!=n?n:a?"#000000":"#FFFFFF",window.sbcRip(t)),c=window.sbcRip(n);return l&&c?i?"rgb("+o((c[0]-l[0])*e+l[0])+","+o((c[1]-l[1])*e+l[1])+","+o((c[2]-l[2])*e+l[2])+(l[3]<0&&c[3]<0?")":","+(l[3]>-1&&c[3]>-1?o(1e4*((c[3]-l[3])*e+l[3]))/1e4:c[3]<0?l[3]:c[3])+")"):"#"+(4294967296+16777216*(l[3]>-1&&c[3]>-1?o(255*((c[3]-l[3])*e+l[3])):c[3]>-1?o(255*c[3]):l[3]>-1?o(255*l[3]):255)+65536*o((c[0]-l[0])*e+l[0])+256*o((c[1]-l[1])*e+l[1])+o((c[2]-l[2])*e+l[2])).toString(16).slice(l[3]>-1||c[3]>-1?1:3):null}var h=function(e,t){if(!e)return null;var n=function(e){return/^#?([a-f\d])([a-f\d])([a-f\d])$/i.test(e)||/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.test(e)}(e)?e:d(0,e,"c");if(!n)return null;var r=function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}(n);return r?"rgba(".concat(r.r,", ").concat(r.g,", ").concat(r.b,", ").concat(t,")"):e};function m(e){var t="";switch(e){case"watermark":t="\\e918";break;case"reset":t="\\e912";break;case"flip-v":t="\\e916";break;case"flip-h":t="\\e914";break;case"cross":t="\\e90c";break;case"effects":t="\\e900";break;case"filters":t="\\e904";break;case"adjust":t="\\e90a";break;case"crop":t="\\e901";break;case"resize":t="\\e907";break;case"rotate":t="\\e90b";break;case"previous":t="\\e905";break;case"next":t="\\e906";break;case"ratio":t="\\e90e";break;case"no-ratio":t="\\e90f";break;case"left-rotate":t="\\e902";break;case"right-rotate":t="\\e908";break;case"focus_point":t="\\e919";break;case"shapes":t="\\e91b";break;case"image":t="\\e91a";break;case"text":t="T";break;default:return}return"\n &:before {\n content: '".concat(t,"'\n }\n ")}function g(){var e=C(["\n#filerobot-image-editor-root & {\n text-transform: ",";\n height: 20px;\n line-height: 20px;\n}\n"]);return g=function(){return e},e}function b(){var e=C(["\n#filerobot-image-editor-root & {\n background: url('","') 50% 50% / cover no-repeat;\n width: 55px;\n height: 55px;\n border-radius: 2px;\n overflow: hidden;\n display: inline-block;\n}\n"]);return b=function(){return e},e}function v(){var e=C(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: top;\n padding: 10px;\n text-align: center;\n min-width: 90px;\n height: 90px;\n cursor: pointer;\n color: ",";\n font-size: 12px;\n background: ",";\n}\n \n #filerobot-image-editor-root &:hover {\n background: ",";\n }\n"]);return v=function(){return e},e}function y(){var e=C(["\n#filerobot-image-editor-root & {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n"]);return y=function(){return e},e}function w(){var e=C(["\n#filerobot-image-editor-root & {\n height: 20px;\n line-height: 20px;\n}\n"]);return w=function(){return e},e}function x(){var e=C(["\n#filerobot-image-editor-root & {\n height: 40px;\n font-size: 40px;\n \n ",";\n ",";\n}\n"]);return x=function(){return e},e}function k(){var e=C(["\n#filerobot-image-editor-root & {\n padding: 20px 10px;\n cursor: pointer;\n display: inline-block;\n min-width: 80px;\n min-height: 100px;\n text-align: center;\n font-size: 12px;\n color: ",";\n text-transform: ",";\n background: ",";\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n background: ",";\n }\n"]);return k=function(){return e},e}function S(){var e=C(["\n#filerobot-image-editor-root & {\n height: 100px;\n width: 100%;\n overflow-x: ",";\n overflow-y: ",";\n white-space: nowrap;\n text-align: center;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n height: initial;\n padding: 0 10px\n}\n }\n"]);return S=function(){return e},e}function C(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var E=a.b.div(S(),(function(e){return e.overlayYHidden?"auto":"none"}),(function(e){return e.overlayYHidden?"hidden":"visible"}),(function(e){return e.theme.colors.border||"#3b4d54"})),O=a.b.div(k(),(function(e){return e.theme.colors.text}),(function(e){return e.noCapitalStrs?"none":e.tt||"capitalize"}),(function(e){return e.active?e.theme.colors.secondaryBg:"inherit"}),(function(e){return e.theme.colors.textHover}),(function(e){return e.theme.colors.secondaryBg})),_=a.b.div(x(),(function(e){return p(e)}),(function(e){return m(e.name)})),P=a.b.div(w()),T=a.b.div(y(),(function(e){return e.theme.colors.border||"#3b4d54"})),j=a.b.div(v(),(function(e){return e.theme.colors.text}),(function(e){return e.active?e.theme.colors.secondaryBgHover:"transparent"}),(function(e){return e.theme.colors.secondaryBgHover})),R=a.b.div(b(),(function(e){return e.src})),D=a.b.div(g(),(function(e){return e.noCapitalStrs?"none":"capitalize"}));function M(){var e=I(["\n#filerobot-image-editor-root & {\n position: relative;\n background: ",";\n z-index: 1050;\n width: 100%;\n height: 100%;\n min-height: 520px;\n overflow: ",";\n font-size: 12px;\n}\n \n #filerobot-image-editor-root & .filerobot-original-canvas {\n visibility: hidden;\n position: absolute;\n left: -99999px;\n display: none;\n }\n \n #filerobot-image-editor-root & .cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n \n #filerobot-image-editor-root & .cropper-container img {/*Avoid margin top issue (Occur only when margin-top <= -height)*/\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-wrap-box,\n #filerobot-image-editor-root & .cropper-canvas,\n #filerobot-image-editor-root & .cropper-drag-box,\n #filerobot-image-editor-root & .cropper-crop-box,\n #filerobot-image-editor-root & .cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n }\n \n #filerobot-image-editor-root & .cropper-wrap-box,\n #filerobot-image-editor-root & .cropper-canvas {\n overflow: hidden;\n }\n \n #filerobot-image-editor-root & .cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n }\n \n #filerobot-image-editor-root & .cropper-modal {\n background-color: #000;\n opacity: .5;\n }\n \n #filerobot-image-editor-root & .cropper-view-box {\n display: block;\n height: 100%;\n outline-color: rgba(255, 255, 255, 0.75);\n outline: 1px solid #fff;\n overflow: hidden;\n width: 100%;\n ",";\n }\n \n #filerobot-image-editor-root & .cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: .5;\n position: absolute;\n }\n \n #filerobot-image-editor-root & .cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: 33.33333%;\n left: 0;\n top: 33.33333%;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: 33.33333%;\n top: 0;\n width: 33.33333%;\n }\n \n #filerobot-image-editor-root & .cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: .75;\n position: absolute;\n top: 50%;\n width: 0;\n }\n \n #filerobot-image-editor-root & .cropper-center:before,\n #filerobot-image-editor-root & .cropper-center:after {\n background-color: #fff;\n content: ' ';\n display: block;\n position: absolute;\n }\n \n #filerobot-image-editor-root & .cropper-center:before {\n height: 1px;\n left: -10px;\n top: 0;\n width: 20px;\n }\n \n #filerobot-image-editor-root & .cropper-center:after {\n height: 20px;\n left: 0;\n top: -10px;\n width: 1px;\n }\n \n #filerobot-image-editor-root & .cropper-face,\n #filerobot-image-editor-root & .cropper-line,\n #filerobot-image-editor-root & .cropper-point {\n display: block;\n height: 100%;\n opacity: .1;\n position: absolute;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n ",";\n }\n \n #filerobot-image-editor-root & .cropper-line {\n background-color: #fff;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n }\n \n #filerobot-image-editor-root & .cropper-point {\n background-color: #fff;\n height: 20px;\n opacity: .90;\n width: 20px;\n border-radius: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point:before {\n content: '';\n display: table;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: black;\n opacity: 0.8;\n z-index: 11;\n position: absolute;\n top: calc(50% - 4px);\n left: calc(50% - 4px);\n }\n \n #filerobot-image-editor-root & .cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -10px;\n right: -10px;\n top: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-w {\n cursor: ew-resize;\n left: -10px;\n margin-top: -10px;\n top: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-s {\n bottom: -10px;\n cursor: s-resize;\n left: 50%;\n margin-left: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-ne {\n cursor: nesw-resize;\n right: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-nw {\n cursor: nwse-resize;\n left: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-sw {\n bottom: -10px;\n cursor: nesw-resize;\n left: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-se {\n bottom: -10px;\n cursor: nwse-resize;\n height: 20px;\n right: -10px;\n width: 20px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-se:before {\n content: '';\n display: table;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: black;\n opacity: 0.8;\n z-index: 11;\n position: absolute;\n top: calc(50% - 4px);\n left: calc(50% - 4px);\n }\n \n #filerobot-image-editor-root & .cropper-invisible {\n opacity: 0;\n }\n \n #filerobot-image-editor-root & .cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n }\n \n #filerobot-image-editor-root & .cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n }\n \n #filerobot-image-editor-root & .cropper-hidden {\n display: none !important;\n }\n \n #filerobot-image-editor-root & .cropper-move {\n cursor: move;\n }\n \n #filerobot-image-editor-root & .cropper-crop {\n cursor: crosshair;\n }\n \n #filerobot-image-editor-root & .cropper-disabled .cropper-drag-box,\n #filerobot-image-editor-root & .cropper-disabled .cropper-face,\n #filerobot-image-editor-root & .cropper-disabled .cropper-line,\n #filerobot-image-editor-root & .cropper-disabled .cropper-point {\n cursor: not-allowed;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n justify-content: space-between\n}\n }\n"]);return M=function(){return e},e}function A(){var e=I(["\n#filerobot-image-editor-root & {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n width: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n \n #filerobot-image-editor-root & *, #filerobot-image-editor-root & *:after, #filerobot-image-editor-root & *:before, #filerobot-image-editor-root & *::after, #filerobot-image-editor-root & *::before {\n box-sizing: border-box;\n }\n \n #filerobot-image-editor-root & *:after, #filerobot-image-editor-root & *:before, #filerobot-image-editor-root & *::after, #filerobot-image-editor-root & *::before {\n padding: 0;\n margin: 0;\n outline: 0;\n box-sizing: border-box;\n }\n \n /* cyrillic-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY_ZraR2Tg8w2lzm7kLNL0-w.woff2) format('woff2');\n unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;\n }\n \n /* cyrillic */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY14sYYdJg5dU2qzJEVSuta0.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n }\n \n /* greek-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY1BW26QxpSj-_ZKm_xT4hWw.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n }\n \n /* greek */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpYwt_Rm691LTebKfY2ZkKSmI.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n }\n \n /* vietnamese */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY9DiNsR5a-9Oe_Ivpu8XWlY.woff2) format('woff2');\n unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;\n }\n \n /* latin-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY6E8kM4xWR1_1bYURRojRGc.woff2) format('woff2');\n unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;\n }\n \n /* latin */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY4gp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;\n }\n"]);return A=function(){return e},e}function I(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var z=Object(a.b)("div")(A(),(function(e){return e.theme.colors.border||"#3b4d54"})),B=a.b.div(M(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.isLoading?"hidden":"auto"}),(function(e){return e.roundCrop&&"border-radius: 50%"}),(function(e){return e.roundCrop&&"\n border-radius: 50%;\n box-shadow: 0 0 80px 15px #000;\n border: 2px solid #000;"}));function L(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function N(){var e=K(["\n#filerobot-image-editor-root & {\n margin-left: 8px;\n display: inline-block;\n vertical-align: middle;\n color: ",";\n margin-bottom: 3px;\n cursor: pointer;\n}\n"]);return N=function(){return e},e}function F(){var e=K(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n line-height: 30px;\n margin-right: 10px;\n float: right;\n}\n"]);return F=function(){return e},e}function U(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n width: 10px;\n height: 10px;\n margin: 5.5px;\n background: ",";\n position: absolute; top: 0; bottom: 0;\n right: ",";\n border: 1px solid ","; \n border-radius: 12px;\n transition: all 0.3s ease-in 0s;\n}\n"]);return U=function(){return e},e}function H(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n width: 200%; \n margin-left: ",';\n transition: margin 0.3s ease-in 0s;\n}\n \n #filerobot-image-editor-root &:before, #filerobot-image-editor-root &:after {\n display: block; float: left; width: 50%; height: 19px; padding: 0; line-height: 19px;\n font-size: 10px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;\n box-sizing: border-box;\n }\n \n #filerobot-image-editor-root &:before {\n content: "ON";\n padding-left: 10px !important;\n background-color: ','; \n color: #fff;\n }\n \n #filerobot-image-editor-root &:after {\n content: "OFF";\n padding-right: 10px !important;\n background-color: ',"; \n color: #aaa;\n text-align: right;\n }\n"]);return H=function(){return e},e}function W(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n overflow: hidden; \n cursor: pointer;\n border: 1px solid ","; \n border-radius: 4px;\n margin: 0;\n}\n"]);return W=function(){return e},e}function Y(){var e=K(["\n#filerobot-image-editor-root & {\n display: none !important;\n}\n \n #filerobot-image-editor-root & :checked + .onoffswitch-label .onoffswitch-inner {\n margin-left: 0;\n}\n"]);return Y=function(){return e},e}function V(){var e=K(["\n#filerobot-image-editor-root & {\n position: relative; \n display: inline-block;\n vertical-align: middle;\n width: 60px;\n margin-bottom: 2px;\n -webkit-user-select: none; \n -moz-user-select: none; \n -ms-user-select: none;\n}\n"]);return V=function(){return e},e}function X(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return X=function(){return e},e}function q(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return q=function(){return e},e}function $(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return $=function(){return e},e}function Q(){var e=K(["\n#filerobot-image-editor-root & {\n background: ",";\n border-top: 1px solid ",";\n height: 34px;\n position: relative;\n z-index: 1;\n}\n"]);return Q=function(){return e},e}function K(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Z=a.b.div(Q(),(function(e){return e.theme.colors.secondaryBg}),(function(e){return e.theme.colors.border})),G=a.b.div($(),(function(e){return p(e)}),m("previous"),(function(e){return se(e)})),J=a.b.div(q(),(function(e){return p(e)}),m("next"),(function(e){return se(e)})),ee=a.b.div(X(),(function(e){return p(e)}),m("reset"),(function(e){return se(e)})),te=a.b.div(V()),ne=a.b.input(Y()),re=a.b.label(W(),(function(e){return e.theme.colors.border})),oe=a.b.span(H(),(function(e){return e.checked?"0":"-100%"}),(function(e){var t;return(null===(t=e.theme.colors.button)||void 0===t?void 0:t.primary)||"#01717d"}),(function(e){return e.theme.colors.primaryBg})),ie=a.b.span(U(),(function(e){return e.theme.colors.accent}),(function(e){return e.checked?"0":"37px"}),(function(e){return e.theme.colors.accent})),ae=Object(a.b)("div").attrs((function(){return{className:"cloudimage-url-generator-switch"}}))(F()),le=Object(a.b)("div")(N(),(function(e){return e.theme.colors.text})),ce=function(e){var t=e.id,n=e.handleChange,r=e.text,o=e.checked,a=e.style;L(e,["id","handleChange","text","checked","style"]);return i.a.createElement(ae,{style:a},i.a.createElement(te,null,i.a.createElement(ne,{type:"checkbox",name:t,id:t,onChange:function(){n(!o)},checked:o}),i.a.createElement(re,{htmlFor:t},i.a.createElement(oe,{checked:o}),i.a.createElement(ie,{checked:o}))),r&&i.a.createElement(le,{onClick:function(){n(!o)}},r))};function se(e){return"\n display: inline-block;\n height: 34px;\n width: 34px;\n cursor: ".concat(e.muted?"not-allowed":"pointer",";\n text-align: center;\n line-height: 34px;\n border-right: 1px solid ").concat(e.theme.colors.border,";\n \n &:hover {\n background: ").concat(e.muted?"inherit":e.theme.colors.secondaryBgHover,";\n }\n ")}function ue(){var e=ye(["\n#filerobot-image-editor-root & {\n display: ",";\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n}\n"]);return ue=function(){return e},e}function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function de(){return(de=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function me(){var e=ye(["\n#filerobot-image-editor-root & {\n width: ","px;\n height: ","px;\n display: inline-block;\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n outline: 0;\n}\n"]);return me=function(){return e},e}function ge(){var e=ye(["\n#filerobot-image-editor-root & {\n display: inline-block;\n max-height: 100%;\n max-width: 100%;\n height: 100%;\n vertical-align: middle;\n\n ",";\n\n ",";\n}\n\n /* Limit image width to avoid overflow the container */\n\n #filerobot-image-editor-root & img {\n max-width: 100% !important; /* This rule is very important, please do not ignore this! */\n }\n\n #filerobot-image-editor-root & .filerobot-edit-canvas {\n display: ",";\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n }\n"]);return ge=function(){return e},e}function be(){var e=ye(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n}\n"]);return be=function(){return e},e}function ve(){var e=ye(["\n#filerobot-image-editor-root & {\n height: calc(100% - 187px);\n text-align: center;\n line-height: calc(100% - 187px);\n padding: 20px;\n position: relative;\n}\n\n #filerobot-image-editor-root &:before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n }\n"]);return ve=function(){return e},e}function ye(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var we=a.b.div(ve()),xe=Object(a.b)("div")(be()),ke=a.b.div(ge(),(function(e){return e.hideCanvas?"\n canvas {\n position: relative;\n left: -9999px;\n }\n ":"\n &:before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n }"}),(function(e){return e.isShowWatermark&&"\ncanvas:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: red;\n opacity: 0.5;\n }"}),(function(e){return e.hide?"none":"inline-block"})),Se=Object(a.b)("canvas")(me(),(function(e){return e.width||0}),(function(e){return e.height||0})),Ce=Object(a.b)(i.a.forwardRef((function(e,t){e.width,e.height;var n=he(e,["width","height"]);return i.a.createElement("div",de({className:"focus-point"},n,{ref:t}))})))((function(e){return{width:e.width,height:e.height,position:"absolute",margin:"auto",top:0,bottom:0,left:0,right:0,display:"inline-block",maxHeight:"100%",maxWidth:"100%",verticalAlign:"middle"}})),Ee=Object(a.b)((function(e){e.image;var t=he(e,["image"]);return i.a.createElement("div",t)}))((function(e){var t=e.image;return function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:"base",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=r?f.colors.base:null;return f.colors[t][i?i+(o?"er":""):n]}function Me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"base",n=e.light?"light":e.dark?"dark":null,r="base"!==t,o=f.colors.base;return n?f.colors[n][r?o:"base"]:f.colors.link[t]}function Ae(){var e=Fe(["\n#filerobot-image-editor-root & {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100px;\n background: ",";\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-direction: column;\n height: initial\n}\n }\n"]);return Ae=function(){return e},e}function Ie(){var e=Fe(["\n#filerobot-image-editor-root & {\n background: ",";\n border-color: ",";\n color: ",";\n text-transform: ",";\n min-width: 62px;\n height: 30px;\n margin-right: 8px;\n border: 0;\n}\n\n #filerobot-image-editor-root &:hover {\n background: ",";\n border-color: ",";\n color: ","; \n }\n"]);return Ie=function(){return e},e}function ze(){var e=Fe(["\n#filerobot-image-editor-root & {\n position: absolute;\n right: 12px;\n top: 8px;\n}\n"]);return ze=function(){return e},e}function Be(){var e=Fe(["\n#filerobot-image-editor-root & {\n text-align: center;\n text-transform: ",";\n color: ",";\n}\n"]);return Be=function(){return e},e}function Le(){var e=Fe(["\n#filerobot-image-editor-root & {\n line-height: 35px;\n border-bottom: 1px solid ",";\n background: ",";\n padding: 8px 0;\n}\n"]);return Le=function(){return e},e}function Ne(){var e=Fe(["\n#filerobot-image-editor-root & {\n background: ",";\n}\n"]);return Ne=function(){return e},e}function Fe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ue=a.b.div(Ne(),(function(e){return e.theme.colors.secondaryBg})),He=a.b.div(Le(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBg})),We=a.b.div(Be(),(function(e){return e.noCapitalStrs?"none":"capitalize"}),(function(e){return e.theme.colors.text})),Ye=a.b.div(ze()),Ve=Object(a.b)(je)(Ie(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.text}),(function(e){return e.noCapitalStrs?"none":"capitalize"}),(function(e){return function(e){if(!e)return null;var t=d(-.1,e)||"";return t.toLowerCase()===e.toLowerCase()?d(.25,e):t}(e.theme.colors.primaryBg)}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.text})),Xe=a.b.div(Ae(),(function(e){return e.theme.colors.secondaryBg}));function qe(){var e=st(["\n#filerobot-image-editor-root & {\n height: 20px;\n line-height: 20px;\n}\n"]);return qe=function(){return e},e}function $e(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n height: 50px;\n}\n"]);return $e=function(){return e},e}function Qe(){var e=st(["\n#filerobot-image-editor-root & {\n height: 50px;\n line-height: 50px;\n}\n"]);return Qe=function(){return e},e}function Ke(){var e=st(["\n#filerobot-image-editor-root & {\n height: ","px;\n border: 1px solid ",";\n width: ","px;\n margin: 0 auto;\n display: inline-block;\n vertical-align: middle;\n ",";\n}\n"]);return Ke=function(){return e},e}function Ze(){var e=st(["\n#filerobot-image-editor-root & {\n padding: 15px 0;\n height: 90px;\n line-height: 100px;\n}\n"]);return Ze=function(){return e},e}function Ge(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: top;\n text-align: center;\n padding: 0 20px;\n cursor: pointer;\n background: ",";\n}\n"]);return Ge=function(){return e},e}function Je(){var e=st(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: relative;\n font-weight: bold;\n font-size: ",";\n\n ",";\n ",";\n \n color: ",";\n}\n"]);return Je=function(){return e},e}function et(){var e=st(["\n#filerobot-image-editor-root & {\n padding: 0;\n}\n \n #filerobot-image-editor-root & > span {\n color: "," !important;\n }\n"]);return et=function(){return e},e}function tt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n padding: 0 5px;\n}\n"]);return tt=function(){return e},e}function nt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: ",";\n height: 30px;\n padding: 6px 12px;\n font-size: 12px;\n line-height: 1;\n color: ",";\n background: ",";\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n vertical-align: middle;\n border: 0px solid transparent;\n font-family: Roboto, sans-serif;\n border: 1px solid ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n \n #filerobot-image-editor-root &:hover {\n outline: none;\n }\n \n #filerobot-image-editor-root &:focus {\n outline: none;\n }\n"]);return nt=function(){return e},e}function rt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: ",";\n ",";\n height: 30px;\n padding: 6px 12px;\n font-size: 12px;\n line-height: 30px;\n color: ",";\n background: ",";\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out;\n vertical-align: middle;\n font-family: Roboto, sans-serif;\n border: 1px solid ",";\n \n ",";\n}\n \n #filerobot-image-editor-root &:hover {\n outline: none;\n }\n \n #filerobot-image-editor-root &:focus {\n outline: none;\n }\n"]);return rt=function(){return e},e}function ot(){var e=st(["\n#filerobot-image-editor-root & {\n display: block;\n margin-bottom: 5px;\n line-height: 15px;\n}\n"]);return ot=function(){return e},e}function it(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: 100px;\n padding-top: 10px;\n text-align: center;\n}\n"]);return it=function(){return e},e}function at(){var e=st(["\n#filerobot-image-editor-root & {\n display: block;\n color: ",";\n height: 30px;\n line-height: 30px;\n}\n"]);return at=function(){return e},e}function lt(){var e=st(["\n@media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n overflow-x: scroll\n}\n }\n"]);return lt=function(){return e},e}function ct(){var e=st(["\n#filerobot-image-editor-root & {\n color: ",";\n display: flex;\n}\n \n @media (min-widthL 768px) {\n#filerobot-image-editor-root & {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap\n}\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-direction: column\n}\n }\n"]);return ct=function(){return e},e}function st(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ut=a.b.div(ct(),(function(e){return e.theme.colors.text})),ft=Object(a.b)("div")(lt()),pt=a.b.div(at(),(function(e){return e.theme.colors.text})),dt=a.b.div(it()),ht=a.b.label(ot()),mt=a.b.input.attrs((function(e){return{type:e.type?e.type:"text"}}))(rt(),(function(e){return e.fullSize?"100%":e.theme.fieldWidth}),(function(e){return!e.fullSize&&"max-width: 400px;"}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.border}),(function(e){return"number"===e.type&&"::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }"})),gt=Object(a.b)("input").attrs((function(e){return{type:e.type?e.type:"file"}}))(nt(),(function(e){return e.fullSize?"100%":e.theme.fieldWidth}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.border})),bt=a.b.div(tt()),vt=Object(a.b)(je)(et(),(function(e){return e.active?e.theme.colors.text:e.theme.colors.textMute})),yt=a.b.span(Je(),(function(e){return e.fz||"28px"}),(function(e){return p(e)}),(function(e){return m(e.active?"ratio":"no-ratio")}),(function(e){return e.theme.textMuted})),wt=a.b.div(Ge(),(function(e){return e.active?e.theme.colors.secondaryBgHover:"transparent"})),xt=a.b.div(Ze()),kt=a.b.div(Ke(),(function(e){return _t(e.ratio)}),(function(e){return e.theme.textColor}),(function(e){return Ot(e.ratio)}),(function(e){var t=e.radius;return t&&"border-radius: ".concat(t,"%;")})),St=Object(a.b)("div")(Qe()),Ct=Object(a.b)("div")($e()),Et=a.b.div(qe()),Ot=function(e){var t=50*e;return t>200&&(t=200),t},_t=function(e){var t=50;return 50*e>200&&(t=200/e),t};function Pt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n background: ",";\n padding: 15px;\n margin: 5px;\n border-radius: 4px;\n cursor: pointer;\n}\n \n #filerobot-image-editor-root &:hover {\n background-color: ",";\n }\n"]);return Pt=function(){return e},e}function Tt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n}\n"]);return Tt=function(){return e},e}function jt(){var e=It(["\n#filerobot-image-editor-root & {\n max-width: 600px;\n margin: 15px auto;\n background: ",";\n border-radius: 4px;\n padding: 15px;\n}\n \n #filerobot-image-editor-root & h4 {\n line-height: 1.4;\n font-size: 16px;\n color: ",";\n }\n"]);return jt=function(){return e},e}function Rt(){var e=It(["\n#filerobot-image-editor-root & {\n color: ",";\n font-size: 14px;\n max-width: 600px;\n line-height: 1.4;\n margin: 0 auto;\n background: ",";\n border-radius: 4px;\n padding: 15px 15px 15px 55px;\n position: relative;\n font-weight: normal;\n text-align: left;\n}\n \n #filerobot-image-editor-root &:before {\n content: '\\e917';\n font-family: filerobot-image-editor-font;\n position: absolute;\n font-size: 20px;\n line-height: 20px;\n left: 20px;\n top: 50%;\n margin-top: -10px;\n }\n"],["\n#filerobot-image-editor-root & {\n color: ",";\n font-size: 14px;\n max-width: 600px;\n line-height: 1.4;\n margin: 0 auto;\n background: ",";\n border-radius: 4px;\n padding: 15px 15px 15px 55px;\n position: relative;\n font-weight: normal;\n text-align: left;\n}\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e917';\n font-family: filerobot-image-editor-font;\n position: absolute;\n font-size: 20px;\n line-height: 20px;\n left: 20px;\n top: 50%;\n margin-top: -10px;\n }\n"]);return Rt=function(){return e},e}function Dt(){var e=It(["\n#filerobot-image-editor-root & button {\n min-width: 240px;\n }\n"]);return Dt=function(){return e},e}function Mt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n}\n \n @media (min-width: 768px) {\n#filerobot-image-editor-root & {\n width: 300px;\n padding: 20px;\n height: 100px\n}\n }\n"]);return Mt=function(){return e},e}function At(){var e=It(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n justify-content: center\n}\n }\n"]);return At=function(){return e},e}function It(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var zt=a.b.div(At(),(function(e){return e.theme.colors.text})),Bt=a.b.div(Mt()),Lt=Object(a.b)("div")(Dt()),Nt=Object(a.b)("p")(Rt(),(function(e){return e.theme.colors.textWarn}),(function(e){return e.theme.colors.secondaryBg})),Ft=Object(a.b)("div")(jt(),(function(e){return e.theme.colors.secondaryBg}),(function(e){return e.theme.colors.text})),Ut=Object(a.b)("div")(Tt()),Ht=Object(a.b)("div")(Pt(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBgHover}));function Wt(){var e=Qt(["\n@media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 50%;\n margin-right: 0 !important\n}\n }\n"]);return Wt=function(){return e},e}function Yt(){var e=Qt(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n height: 16px;\n font-size: 16px;\n margin-top: -4px;\n display: inline-block;\n vertical-align: middle;\n color: ",";\n margin-right: 5px;\n}\n"]);return Yt=function(){return e},e}function Vt(){var e=Qt(["\n#filerobot-image-editor-root & {\n display: flex;\n width: 100%;\n flex-wrap: wrap;\n justify-content: center;\n}\n"]);return Vt=function(){return e},e}function Xt(){var e=Qt(["\n#filerobot-image-editor-root & {\n margin-top: 10px;\n width: 100%;\n}\n \n #filerobot-image-editor-root & button {\n text-transform: none;\n font-size: 12px;\n min-width: 142px;\n margin-right: 5px;\n }\n \n #filerobot-image-editor-root & button:focus, #filerobot-image-editor-root & button:active {\n outline: none !important;\n box-shadow: none !important;\n }\n"]);return Xt=function(){return e},e}function qt(){var e=Qt(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: 100%;\n}\n"]);return qt=function(){return e},e}function $t(){var e=Qt(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n}\n \n #filerobot-image-editor-root & svg {\n margin-top: -7px;\n width: 750px;\n }\n \n #filerobot-image-editor-root & svg text {\n font-size: 2px;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper {\n width: 280px;\n padding: 0;\n margin: 12px auto 0;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range {\n background: none;\n width: 280px;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 9px;\n height: 18px;\n border-radius: 50%;\n background: ",";\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range::-moz-range-thumb {\n border: none;\n width: 9px;\n height: 18px;\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper label {\n display: none;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper :after {\n display: none;\n }\n \n @media (max-width: 768px) {\n #filerobot-image-editor-root & svg {\n width: 100%;\n }\n }\n"]);return $t=function(){return e},e}function Qt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Kt=a.b.div($t(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text})),Zt=a.b.div(qt()),Gt=a.b.div(Xt()),Jt=Object(a.b)("div")(Vt()),en=a.b.span(Yt(),(function(e){return p(e)}),(function(e){return m(e.name)}),(function(e){return e.theme.colors.text})),tn=Object(a.b)(Ve)(Wt());function nn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n display: flex;\n justify-content: center;\n width: fit-content;\n margin: 0 auto;\n}\n\n #filerobot-image-editor-root & div {\n margin-left: 10px;\n }\n\n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-wrap: wrap\n}\n \n #filerobot-image-editor-root & .image-editor-range-wrapper {\n width: 50%;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input {\n width: 100% !important;\n }\n }\n"]);return nn=function(){return e},e}var rn=a.b.div(nn(),(function(e){return e.theme.colors.text}));function on(){var e=ln(["\n#filerobot-image-editor-root & {\n position: absolute;\n z-index: 999;\n top: 36px;\n left: 0;\n right: 0;\n height: 104px;\n cursor: not-allowed;\n}\n"]);return on=function(){return e},e}function an(){var e=ln(["\n#filerobot-image-editor-root & {\n position: absolute;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n cursor: wait;\n}\n"]);return an=function(){return e},e}function ln(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var cn=a.b.div(an()),sn=Object(a.b)("div")(on());function un(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\e90c'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e90c'\n }\n"]);return un=function(){return e},e}var fn=a.b.span.attrs((function(){return{role:"button"}}))(un(),(function(e){return e.t||"18px"}),(function(e){return e.r||"auto"}),(function(e){return e.l||"10px"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"18px"}),(function(e){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function pn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\26F6'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\26F6'\n }\n"]);return pn=function(){return e},e}var dn=a.b.span.attrs((function(){return{role:"button"}}))(pn(),(function(e){return e.t||"18px"}),(function(e){return e.r||"auto"}),(function(e){return e.l||"35px"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"15px"}),(function(e){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function hn(){var e=gn(["\n#filerobot-image-editor-root & {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 200px;\n height: 200px;\n margin: auto;\n padding: 40px;\n border-radius: 50%;\n background: ",";\n}\n \n #filerobot-image-editor-root & .svg-spin-icon {\n fill: ",";\n }\n \n #filerobot-image-editor-root & p {\n color: ",";\n }\n"]);return hn=function(){return e},e}function mn(){var e=gn(["\n#filerobot-image-editor-root & {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: ",";\n background: "," !important;\n opacity: "," !important;\n z-index: 1042;\n}\n"]);return mn=function(){return e},e}function gn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bn=a.b.div(mn(),(function(e){return e.fullScreen?"fixed":"absolute"}),(function(e){return e.overlay?"rgba(10,10,10,0.26)":"transparent"}),(function(e){return e.overlay?"0.25":"0"})),vn=Object(a.b)("div")(hn(),(function(e){return e.theme.colors.secondaryBgOpacity}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text})),yn=function(e){return e.show?i.a.createElement(o.Fragment,null,i.a.createElement(bn,{fullScreen:e.fullScreen,overlay:e.overlay}),i.a.createElement(vn,null,i.a.createElement("svg",{id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 150 150",style:{enableBackground:"new 0 0 150 150"}},i.a.createElement("path",{className:"svg-spin-icon",d:"M74.9,14.8c-12.2,0-24.3,0-36.5,0c-2.4,0-3.9-1-4.8-3.1c-1.3-3-1.2-6,0.6-8.9c0.8-1.3,2-2,3.5-2\r c1.1,0,2.3,0,3.4,0c23.3,0,46.7,0,70-0.1c3.9,0,5.3,1.9,6,4.7c0.5,2.1,0.4,4.2-0.5,6.3c-0.9,2.2-2.5,3.1-4.8,3c-2.9,0-5.7,0-8.6,0\r C93.9,14.8,84.4,14.8,74.9,14.8z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M75.1,118.1c12,0,24,0,35.9,0c4,0,5.9,1.7,6.3,5.7c0.1,1.4,0,2.9-0.3,4.2c-0.7,2.9-2.4,4.1-5.3,4.1\r c-24.1,0-48.3,0-72.4,0c-3.7,0-5.4-1.2-6.3-5.3c-0.4-2-0.1-3.9,0.7-5.7c0.9-2,2.4-3.1,4.7-3C50.6,118.1,62.9,118.1,75.1,118.1z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M75.3,76.3c0.2,0.4,3.1,9.3,7.2,14.1c3.9,4.7,8.9,8.5,13,12.5c3.2,3.2,5.4,7,6.8,11.2c0.5,1.6,0.3,1.9-1.4,1.9\r c-17.3,0-34.5,0-51.8,0c-1.7,0-1.9-0.2-1.3-1.8c1.8-5.5,5.2-10,9.4-13.9c3.5-3.3,7.7-6.1,10.6-9.9c3.5-4.7,6.8-13.3,7.1-14.1\r C75.1,76.3,75.2,76.3,75.3,76.3z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M45.5,23.6c0,3.8-0.1,7.6,1.2,11.3c1,2.9,2.8,5.2,4.9,7.3c5,5.3,10.2,10.5,15.2,15.8c1.1,1.2,2,2.6,3.1,3.9\r c2,2.5,2.2,7.6-0.2,10.5c-1.8,2.2-3.6,4.3-5.5,6.4C59.5,84,54.7,89.1,50,94.2c-3.1,3.4-4.4,7.5-4.5,12c0,2.8-0.1,5.6,0,8.4\r c0,1-0.3,1.4-1.4,1.4c-1.7,0-2.3,0-3.7,0c-0.9,0-1.3-0.4-1.3-1.3c0-5-0.3-10,0.8-14.9c0.8-3.5,2.5-6.6,4.8-9.3\r c3.6-4.2,7.5-8.2,11.3-12.3c1.7-1.8,3.3-3.7,4.9-5.5c0.9-1,1.9-2,2.7-3c1.8-2.3,1.6-4.3-0.4-6.4c-5.2-5.4-10.4-11-15.8-16.3\r c-5.7-5.7-8.4-12.4-8.3-20.4c0-2.9,0-5.7,0-8.6c0-1.1,0.4-1.6,1.5-1.5c1.3,0,2.6,0,3.8,0c0.8,0,1.1,0.3,1.1,1.2\r C45.5,19.8,45.5,21.7,45.5,23.6z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M109.9,35.9c-0.6,2.7-2.1,5.3-3.9,7.5c-3.5,4.2-7.5,8.1-11.2,12.1c-3,3.2-5.9,6.5-8.8,9.7\r c-0.9,1-0.9,2.1-0.2,3.1c1.2,1.7,2.5,3.3,3.8,4.8c1.5,1.8,3,3.6,4.6,5.3c3.4,3.6,6.8,7.1,10.1,10.7c4.7,5.1,6.8,11.2,6.9,18.1\r c0,2.4,0,5,0,7.5c0,1.3-0.3,1.5-1.6,1.5c-1.3,0-2.1,0-3.3,0c-1.1,0-1.5-0.4-1.5-1.5c0-3.4-0.2-6.7-0.3-10.1\r c-0.1-4.1-1.9-7.5-4.5-10.5c-3.3-3.8-6.8-7.4-10.2-11.1c-3.3-3.5-6.9-6.6-9.3-10.8c-0.8-1.5-1.4-3.2-1.7-4.9c-0.4-2.1,0.7-4,1.9-5.5\r c3.1-3.8,6.5-7.4,9.8-11.1c2.9-3.2,6-6.2,9-9.3c3.5-3.6,5.1-8,5.2-13c0-3.4,0.1-6.7,0.1-10.1c0-1.1,0.3-1.5,1.3-1.4\r c1.2,0,2.4,0,3.6,0c1.2,0,1.6,0.5,1.6,1.6c-0.1,1.6,0,3.1,0,4.7C111.4,23,110.9,31.7,109.9,35.9z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M74.8,67.9c-0.2-1.3-1.1-5.7-1.5-7C71.4,54,59.7,44.3,54.3,39c-0.7-0.7-1.3-1.5-1.8-2.5\r c7.1,3.4,14.4,6.1,22.6,6.1c8.2,0,15.5-2.6,22.4-6.2c0.1,0.1,0.2,0.2,0.3,0.3c-0.5,0.6-0.9,1.2-1.4,1.8c-4.5,4.5-18.7,15.5-20,22.4\r c-0.2,0.8-1,6.2-1.2,7C75.1,67.9,75,67.9,74.8,67.9z"}),i.a.createElement("g",null)),i.a.createElement("p",{style:{textAlign:"center"}},e.label))):null};function wn(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: 200px;\n height: 70px;\n display: inline-block;\n vertical-align: middle;\n background: "," url(",") 50% 50% / contain no-repeat; \n margin: 10px;\n padding: 20px;\n border-radius: 4px;\n cursor: pointer;\n}\n \n #filerobot-image-editor-root &:hover {\n background-color: ",";\n }\n"]);return wn=function(){return e},e}function xn(){var e=Rn(["\n#filerobot-image-editor-root & {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n line-height: 100px;\n background: ",";\n}\n"]);return xn=function(){return e},e}function kn(){var e=Rn(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n margin-left: 20px;\n cursor: pointer;\n}\n"]);return kn=function(){return e},e}function Sn(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: 30px;\n height: 30px;\n display: inline-block;\n vertical-align: top;\n border: 1px solid ",";\n background: ",";\n cursor: ",";\n \n ",";\n}\n"]);return Sn=function(){return e},e}function Cn(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: 100px;\n padding: 10px;\n display: inline-block;\n vertical-align: top;\n}\n \n /* The container */\n \n #filerobot-image-editor-root & label {\n display: block;\n position: relative;\n line-height: 12px;\n padding-left: 15px;\n margin-bottom: 12px;\n cursor: pointer;\n user-select: none;\n }\n \n /* Hide the browser's default radio button */\n \n #filerobot-image-editor-root & label input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n }\n \n /* Create a custom radio button */\n \n #filerobot-image-editor-root & span {\n position: absolute;\n top: 0;\n left: 0;\n height: 10px;\n width: 10px;\n background-color: ",";\n border-radius: 50%;\n }\n \n /* On mouse-over, add a grey background color */\n \n #filerobot-image-editor-root & label:hover input ~ span {\n /* background-color: #ccc; */\n }\n \n /* When the radio button is checked, add a blue background */\n \n #filerobot-image-editor-root & label input:checked ~ span {\n background-color: ",";\n }\n \n #filerobot-image-editor-root & label input:checked ~ span:after {\n background-color: ",';\n }\n \n /* Create the indicator (the dot/circle - hidden when not checked) */\n \n #filerobot-image-editor-root & span:after {\n content: "";\n position: absolute;\n display: none;\n }\n \n /* Show the indicator (dot/circle) when checked */\n \n #filerobot-image-editor-root & label input:checked ~ span:after {\n display: block;\n }\n \n /* Style the indicator (dot/circle) */\n \n #filerobot-image-editor-root & label span:after {\n top: 3px;\n left: 2px;\n width: 6px;\n height: 5px;\n border-radius: 50%;\n background: ',";\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%\n}\n \n #filerobot-image-editor-root & label {\n display: inline-block;\n margin-right: 10px;\n }\n }\n"]);return Cn=function(){return e},e}function En(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: 100px;\n padding: 5px;\n display: inline-block;\n font-size: 0;\n}\n \n #filerobot-image-editor-root & div:nth-child(1) {\n border-radius: 4px 0 0 0;\n }\n \n #filerobot-image-editor-root & div:nth-child(3) {\n border-radius: 0 4px 0 0;\n }\n \n #filerobot-image-editor-root & div:nth-child(7) {\n border-radius: 0 0 0 4px;\n }\n \n #filerobot-image-editor-root & div:nth-child(9) {\n border-radius: 0 0 4px 0;\n }\n"]);return En=function(){return e},e}function On(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: calc(100% - 200px);\n display: inline-block;\n vertical-align: top;\n padding: 0 40px;\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n padding: 0\n}\n }\n"]);return On=function(){return e},e}function _n(){var e=Rn(["\n#filerobot-image-editor-root & {\n display: inline;\n vertical-align: middle;\n padding: 10px;\n}\n\n #filerobot-image-editor-root & label {\n min-width: 120px;\n display: inline-block;\n vertical-align: middle;\n }\n"]);return _n=function(){return e},e}function Pn(){var e=Rn(["\n#filerobot-image-editor-root & {\n ",";\n}\n"]);return Pn=function(){return e},e}function Tn(){var e=Rn(["\n#filerobot-image-editor-root & {\n padding: 10px;\n}\n \n #filerobot-image-editor-root & label {\n min-width: 120px;\n display: inline-block;\n vertical-align: middle;\n margin: 0;\n }\n \n #filerobot-image-editor-root & input {\n width: 100%;\n }\n"]);return Tn=function(){return e},e}function jn(){var e=Rn(["\n#filerobot-image-editor-root & {\n position: relative;\n color: ",";\n text-align: left;\n white-space: normal;\n width: fit-content;\n margin: 0 auto;\n}\n \n #filerobot-image-editor-root & .image-editor-range {\n display: inline-block;\n padding: 5px;\n vertical-align: middle;\n }\n \n #filerobot-image-editor-root & .image-editor-range :after {\n display: none;\n }\n \n #filerobot-image-editor-root & .image-editor-range label {\n display: none;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n align-items: center\n}\n \n #filerobot-image-editor-root & .image-editor-range {\n width: 100%;\n }\n \n #filerobot-image-editor-root & .image-editor-range input {\n width: 100% !important;\n }\n }\n"]);return jn=function(){return e},e}function Rn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Dn=a.b.div(jn(),(function(e){return e.theme.colors.text})),Mn=Object(a.b)("div")(Tn()),An=Object(a.b)("div")(Pn(),(function(e){return"right"===e.switcherPosition?".cloudimage-url-generator-switch {\n margin-left: 100px;\n margin-top: -6px;\n \n label {\n min-width: auto;\n }\n \n @media (max-width: 768px) {\n margin-left: 4px;\n }\n }":"padding: 10px;"})),In=Object(a.b)("div")(_n()),zn=Object(a.b)("div")(On()),Bn=Object(a.b)("div")(En()),Ln=Object(a.b)("div")(Cn(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.accent}),(function(e){return e.theme.colors.text})),Nn=Object(a.b)("div")(Sn(),(function(e){return e.theme.colors.secondaryBgHover}),(function(e){var t;return e.clickable?e.active?(null===(t=e.theme.colors.button)||void 0===t?void 0:t.primary)||e.theme.colors.primaryBg:e.theme.colors.accent:e.theme.colors.disabledBg}),(function(e){return e.clickable?"pointer":"not-allowed"}),(function(e){if(0!==e.clickable&&!e.active)return"\n &:hover {\n background: ".concat(e.theme.colors.primaryBg,";\n }\n ")})),Fn=(Object(a.b)("div")(kn()),Object(a.b)("div")(xn(),(function(e){return e.theme.colors.secondaryBg}))),Un=Object(a.b)("div")(wn(),(function(e){return e.theme.colors.primaryBgHover}),(function(e){return e.src}),(function(e){return e.theme.colors.secondaryBgHover}));function Hn(e){return(Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yn(e){for(var t=1;t1&&m)&&(-1!==h||1!==d.length);return i.a.createElement(Z,null,i.a.createElement(ee,{muted:"preview"!==s,onClick:function(){"preview"===s&&c()},title:u["footer.reset"]}),i.a.createElement(G,{onClick:function(){!g&&l({operationIndex:h-1,operationObject:Yn(Yn({},d[h]),{},{index:h})})},muted:g,title:u["footer.undo"]}),i.a.createElement(J,{onClick:function(){!b&&l({operationIndex:h+1,operationObject:Yn(Yn({},d[h]),{},{index:h})})},muted:b,title:u["footer.redo"]}),f&&p&&i.a.createElement(ce,{id:"switch-watermark-footer",checked:p&&p.applyByDefault,handleChange:this.onApplyWatermarkChange,text:u["common.apply_watermark"]}))}}])&&Xn(t.prototype,n),r&&Xn(t,r),a}(o.Component),er=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"filerobot";return"filerobot"===t?"https://api.filerobot.com/".concat(e,"/v3/"):"https://".concat(e,".api.airstore.io/v1/")},tr="filerobot-image-editor-modal",nr="filerobot-image-edit-box",rr="filerobot-image-edit-box-original",or=["adjust","effects","filters","rotate","crop","resize","watermark","shapes","image","text"],ir=["edge_enhance","emboss","grungy","hazy","lomo","radial_blur","sin_city","tilt_shift"],ar=["cross_process","glow_sun","jarques","love","old_boot","orange_peel","pin_hole","sepia","sun_rise","vintage"],lr=["crop","resize","rotate","watermark","focus_point"],cr=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],sr={corners:[1,0,1,0,0,0,1,0,1],star:[0,1,0,1,1,1,0,1,0],center:[0,0,0,0,1,0,0,0,0],"top-row":[1,1,1,0,0,0,0,0,0],"center-row":[0,0,0,1,1,1,0,0,0],"bottom-row":[0,0,0,0,0,0,1,1,1]},ur={opacity:.7,position:"center",url:"",applyByDefault:!1},fr=[{label:"Arial",value:"Arial"},{label:"Tahoma",value:"Tahoma"},{label:"Times New Roman",value:"Times New Roman"},{label:"Courier",value:"Courier"},{label:"Courier New",value:"Courier New"},{label:"Verdana",value:"Verdana"},{label:"Georgia",value:"Georgia"},{label:"Palatino",value:"Palatino"},{label:"Garamond",value:"Garamond"},{label:"Bookman",value:"Bookman"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Candara",value:"Candara"},{label:"Impact",value:"Impact"}],pr=[{label:"Arial",value:"Arial"},{label:"Arial Bold",value:"Arial-Bold"},{label:"Arial Black",value:"Arial-Black"},{label:"AvantGarde Book",value:"AvantGarde-Book"},{label:"Bitstream Charter",value:"Bitstream-Charter"},{label:"Bitstream Charter Bold",value:"Bitstream-Charter-Bold"},{label:"Bookman Demi",value:"Bookman-Demi"},{label:"Comic Sans MS",value:"Comic-Sans-MS"},{label:"Courier",value:"Courier"},{label:"Courier Bold",value:"Courier-Bold"},{label:"Courier New",value:"Courier-New\t"},{label:"Courier New Bold",value:"Courier-New-bold"},{label:"DejaVu Sans",value:"DejaVu-Sans"},{label:"DejaVu Sans Bold",value:"DejaVu-Sans-bold"},{label:"Dingbats",value:"Dingbats"},{label:"fixed",value:"fixed"},{label:"FreeMono",value:"FreeMono"},{label:"FreeMono Bold",value:"FreeMono-Bold"},{label:"FreeSans",value:"FreeSans-Bold"},{label:"Halvetica",value:"Halvetica"},{label:"Georgia",value:"Georgia"},{label:"Impact",value:"Impact"},{label:"Noto mono",value:"Noto-Mono"}],dr="rect",hr="square",mr="circle",gr="image",br="text",vr={hideCloudimageSwitcher:!0,processWithCloudimage:!1,uploadWithCloudimageLink:!1,elementId:null,isLowQualityPreview:!0,reduceBeforeEdit:{mode:"manual",widthLimit:2e3,heightLimit:2e3},cropBeforeEdit:null,cropPresets:[{name:"original",value:0},{name:"square",value:1},{name:"banner",value:7.8},{name:"round",value:1,radius:50},{name:"5 : 4",value:1.25},{name:"4 : 3",value:1.33333},{name:"6 : 4",value:1.5},{name:"16 : 9",value:1.7777}],resizePresets:[{name:"big square",width:600,height:600,ratio:1},{name:"middle square",width:400,height:400,ratio:1},{name:"small square",width:200,height:200,ratio:1},{name:"small size",width:1200,height:960,ratio:1.25},{name:"better quality",width:1920,height:1536,ratio:1.25},{name:"small size",width:1200,height:900,ratio:1.33333},{name:"better quality",width:1920,height:1440,ratio:1.33333},{name:"small size",width:1200,height:800,ratio:1.5},{name:"better quality",width:1920,height:1280,ratio:1.5},{name:"small size",width:1200,height:675,ratio:1.7777},{name:"better quality",width:1920,height:1080,ratio:1.7777},{name:"small banner",width:468,height:60,ratio:7.8},{name:"big banner",width:936,height:120,ratio:7.8}]},yr="close-button-clicked",wr="toolbar-cancel-button-clicked",xr="esc-key-pressed",kr="modal-overlay-clicked",Sr="image-edits-completed",Cr="image-downloaded",Er="image-uploaded-filerobot",Or="image-uploaded-cloudimage",_r="image-uploading-fail-filerobot",Pr="new",Tr="duplicate",jr="replace",Rr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return window.document.querySelector("#".concat(e,"_").concat(t||(n?rr:nr)))},Dr=function(e){switch(e){case"colorize":return"colorize";case"contrast":return"contrast";case"cross_process":return"crossProcess";case"glow_sun":return"glowingSun";case"hdr_effect":return"hdr";case"jarques":return"jarques";case"love":return"love";case"old_boot":return"oldBoot";case"orange_peel":return"orangePeel";case"pin_hole":return"pinhole";case"pleasant":return"pleasant";case"sepia":return"sepia";case"sun_rise":return"sunrise";case"vintage":return"vintage";case"clarity":return"";case"edge_enhance":return"edgeEnhance";case"emboss":return"emboss";case"grungy":return"grungy";case"hazy":return"hazyDays";case"lomo":return"lomo";case"noise":return"noise";case"old_paper":return"oldPaper";case"posterize":return"posterize";case"radial_blur":return"radialBlur";case"sin_city":return"sinCity";case"tilt_shift":return"tiltShift";default:return null}},Mr=function(e){switch(e){case"colorize":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/colorize.jpg";case"contrast":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/contrast.png";case"cross_process":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/cross_process.png";case"glow_sun":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/glow_sun.png";case"hdr_effect":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/hdr_effect.png";case"jarques":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/jarques.png";case"love":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/love.png";case"old_boot":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/old_boot.png";case"orange_peel":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/orange_peel.png";case"pin_hole":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/pin_hole.png";case"pleasant":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/pleasant.png";case"sepia":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/sepia.png";case"sun_rise":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/sun_rise.png";case"vintage":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/vintage.png";case"clarity":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/clarity.png";case"edge_enhance":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/edge_enhance.png";case"emboss":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/emboss.png";case"grungy":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/grungy.png";case"hazy":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/hazy.png";case"lomo":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/lomo.png";case"noise":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/noise.png";case"old_paper":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/old_paper.png";case"posterize":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/posterize.png";case"radial_blur":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/radial_blur.png";case"sin_city":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/sin_city.png";case"tilt_shift":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/tilt_shift.png";default:return""}},Ar=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/_/g," ")},Ir=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"filerobot";return"filerobot"===e?"X-Filerobot-Key":"X-Airstore-Secret-Key"};function zr(e){return function(e){if(Array.isArray(e))return Br(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Br(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"center",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t.getBoundingClientRect(),i=.3,a=o.height*i,l=o.width*i;if(ln?n=(r=a)*c:r=(n=l)/c}var s=o.width/2-n/2,u=o.height/2-r/2;if("center"===e)return[s,u,n,r];e=e.split("-");var f=.015,p=o.width*f,d=o.height*f,h=o.width-n-p,m=o.height-r-d;return[].concat(zr(e.map((function(e,t){return"center"===e?0===t?s:u:"right"===e?h:"bottom"===e?m:"left"===e?p:"top"===e?d:void 0}))),[n,r])},Nr=n(16),Fr=n.n(Nr);function Ur(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Hr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:2;return parseFloat(e).toFixed(t)},Vr=n(17),Xr=n.n(Vr),qr=n(10),$r=n.n(qr);CanvasRenderingContext2D.prototype.roundRect=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return o?(n<2*o&&(o=n/2),r<2*o&&(o=r/2)):o=n>=r?n/2:r/2,this.beginPath(),this.moveTo(e+o,t),this.arcTo(e+n,t,e+n,t+r,o),this.arcTo(e+n,t+r,e,t+r,o),this.arcTo(e,t+r,e,t,o),this.arcTo(e,t,e+n,t,o),this.closePath(),this},CanvasRenderingContext2D.prototype.round=function(){var e=this.canvas,t=e.width,n=e.height;return this.imageSmoothingEnabled=!0,this.globalCompositeOperation="destination-in",this.strokeStyle="transparent",this.lineWidth=1,this.beginPath(),this.roundRect(0,0,t,n,Math.max(t,n)),this.fill(),this.globalCompositeOperation="source-over",this};CanvasRenderingContext2D,Number.prototype.mapNumber=function(e,t,n,r){return(this-e)*(r-n)/(t-e)+n};function Qr(e){return(Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kr(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Zr(e){return function(e){if(Array.isArray(e))return Gr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Gr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.props.config.elementId;return Rr(r,t,n)})),lo(io(e),"initializeCanvases",(function(t){var n=io(e),r=e.props,o=r.config,i=(o=void 0===o?{}:o).isLowQualityPreview,a=r.updateState,l=1;if(i&&t.height>1050){var c=e.getCanvas(null,!0),s=c.getContext("2d");c.width=t.width,c.height=t.height,s.drawImage(t,0,0,t.width,t.height),l=t.height/800;var u=t.width/l,f=t.height/l;a({initialZoom:l,canvasOriginal:n.cloneCanvas(c)}),setTimeout((function(){var t=e.getCanvas;new window.Caman(t(),(function(){this.resize({width:u,height:f}),this.render((function(){var e=n.replaceWithNewCanvas(nr);n.CamanInstanceZoomed=new window.Caman(e,(function(){n.CamanInstanceOriginal=new window.Caman(t(null,!0),(function(){})),a({isShowSpinner:!1,canvasZoomed:n.cloneCanvas(e)})}))}))}))}))}else setTimeout((function(){var t=e.getCanvas();n.CamanInstance=new window.Caman(t,(function(){a({isShowSpinner:!1,canvasOriginal:n.cloneCanvas(t)})}))}))})),lo(io(e),"mergeCanvases",(function(t){var n=e.props.shapeOperations,r=t.getContext("2d"),o=n.prepareFinalCanvas(t);return r.drawImage(o,0,0),t.toDataURL()})),lo(io(e),"cloneCanvas",(function(e){var t=document.createElement("canvas"),n=t.getContext("2d");return t.width=e.width,t.height=e.height,t.id=e.id,t.className=e.className,n.drawImage(e,0,0),t})),lo(io(e),"replaceWithNewCanvas",(function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.getCanvas(t),o=r.width,i=r.height,a=document.createElement("canvas"),l=a.getContext("2d"),c=r.parentElement;return c.removeChild(r),a.width=o,a.height=i,a.id="".concat(e.props.config.elementId,"_").concat(t),a.className=r.className,l.drawImage(r,0,0),n&&l.round(),c.appendChild(a),a})),lo(io(e),"replaceCanvas",(function(t,n){var r=e.getCanvas(n),o=r.parentElement;return o.removeChild(r),o.appendChild(t),t})),lo(io(e),"saveImage",(function(){var t=e.props,n=t.onComplete,r=t.onClose,o=t.updateState,i=t.closeOnLoad,a=t.config,l=t.processWithCloudService,c=t.uploadCloudimageImage,s=t.operations,u=t.initialZoom,f=t.operationsOriginal,p=e.getFinalImageMime(),d=e.getFinalImageName(),h=a.filerobot,m=void 0===h?{}:h,g=a.platform,b=void 0===g?"filerobot":g,v=m.imageMeta,y=m.imageProperties,w=m.imageName,x=m.saveMode,k=void 0===x?Tr:x,S=e.props.src.split("?")[0],C=1!==u?rr:nr,E=e.getCanvas(C),O=function(e,t,n){return e?e+"/":er(t,n)}(m.baseAPI,m.container,b),_=(m.uploadParams||{}).dir||"image-editor",P=io(e);if(l){var T=(1!==u?f:s).filter((function(e){var t=e.operation;return lr.includes(t)})),j=e.generateCloudimageURL(T,S.replace(/https?:\/\/scaleflex.ultrafast.io\//,""));if(c){var R=new XMLHttpRequest;R.addEventListener("load",e.onFileLoad),R.open("POST",[O,"upload?dir=".concat(_)].join("")),R.setRequestHeader(Ir(b),m.uploadKey),R.setRequestHeader("Content-Type","application/json"),R.send(JSON.stringify({files_urls:[j]}))}else o({isShowSpinner:!1,isHideCanvas:!1}),n(j,{url_permalink:j,url_public:j,url:{public:j,permalink:j}}),i&&r(Or)}else{e.mergeCanvases(E);var D=function(e,t,n){t=t||"",n=n||512;for(var r=atob(e),o=[],i=0;i0&&B.append("properties[file]",JSON.stringify(y)),v&&Object.keys(v).length>0&&B.append("meta[file]",JSON.stringify(v))),L.open("POST",[O,"upload?dir=".concat(_)].join("")),L.setRequestHeader(Ir(b),m.uploadKey),L.send(B)}})),lo(io(e),"getResultCanvas",(function(){var t=1!==e.props.initialZoom?rr:nr,n=e.getCanvas(t);return e.mergeCanvases(n),n})),lo(io(e),"getFinalImageMime",(function(){var t=e.props,n=t.roundCrop,r=t.imageMime;return n?"image/png":r})),lo(io(e),"getFinalImageName",(function(){var t=e.props.roundCrop,n=e.state.imageName;return t&&(n=n.replace(n.substr(n.lastIndexOf(".")+1),"png")),n})),lo(io(e),"downloadImage",(function(t){var n,r=e.getResultCanvas(),o=e.getFinalImageName(),i=e.getFinalImageMime(),a=document.createElement("a");a.download=o,a.href=r.toDataURL(i,.8),document.createEvent?((n=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),a.dispatchEvent(n)):a.fireEvent&&a.fireEvent("onclick"),t&&t()})),lo(io(e),"onFileLoad",(function(t){var n=e.props,r=n.onComplete,o=n.onClose,i=n.updateState,a=n.closeOnLoad,l=t.srcElement,c=(void 0===l?{}:l).response,s=void 0===c?"{}":c,u=JSON.parse(s)||{};if("success"===u.status){var f=u.file,p=void 0===f?{}:f,d=function(e){return e.url&&e.url.public?e.url.public:e.url_public?e.url_public:""}(p);if(!d)return;i({isShowSpinner:!1,isHideCanvas:!1}),r(d,p),a&&o(Er)}else i({isShowSpinner:!1,isHideCanvas:!1}),alert(u),a&&o(_r)})),lo(io(e),"generateCloudimageURL",(function(t,n){var r=e.props,o=r.config,i=r.watermark,a=r.logoImage,l=r.processWithCloudimage,c=r.processWithFilerobot,s=r.imageSealing,u=o.cloudimage,f=void 0===u?{}:u,p=o.filerobot,d=void 0===p?{}:p,h=l&&f.token+".cloudimg.io/"+(f.version?"".concat(f.version,"/"):"v7/"),m=c&&d.token+".filerobot.com/"+(d.version?"".concat(d.version,"/"):""),g=m||h||"";g=(g?"https://":"")+g;var b=(m?d.doNotPrefixURL:f.doNotPrefixURL)?"":g,v=e.isOperationExist(t,"crop"),y=e.isOperationExist(t,"resize"),w=e.isOperationExist(t,"rotate"),x=e.isOperationExist(t,"focus_point"),k=i&&a&&i.applyByDefault,S="",C="",E="",O="",_="";v&&(S=e.getCropArguments(v.props)),y&&(C=(S?"&":"")+e.getResizeArguments(y.props)),w&&(E=(S||C?"&":"")+e.getOrientationArguments(w.props)),k&&(O=(S||C||E?"&":"")+e.getWatermarkArguments()),x&&(_=(S||C||E||O?"&":"")+e.getFocusPointArguments(x.props)),n=(n=n.split("?")[0]).replace(b,"");var P=S+C+E+O+_;return s.enabled&&(P=function(e,t,n){var r=t||{},o=r.salt,i=r.char_count,a=r.include_params,l=Array.isArray(a);if(l&&0===a.length)return e;var c="",s="";if(l){var u=[],f=[];e.split("&").forEach((function(e){var t=Ur(e.split("="),1)[0];a.indexOf(t)>-1?u.push(e):f.push(e)})),f.length>0&&(s=f.join("&")),c=Wr(u.join("&"),n,o,i)}else c=Wr(e,n,o,i);return[c,s].filter((function(e){return e})).join("&")}(P,s,n.replace(g,""))),b+n+(P?"?":"")+P})),lo(io(e),"initFiltersOrEffects",(function(){})),lo(io(e),"applyFilterOrEffect",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=e.props,o=r.updateState,i=r.initialZoom;e.props[t]&&o({isHideCanvas:!0,isShowSpinner:!0},(function(){1!==i?(e.CamanInstanceOriginal.revert(!1),e.CamanInstanceOriginal[Dr(e.props[t])](),e.CamanInstanceOriginal.render((function(){o(lo({},t,null),(function(){e.makeCanvasSnapshot({operation:t},n)}))}))):o(lo({},t,null),(function(){e.makeCanvasSnapshot({operation:t},n)}))}))})),lo(io(e),"applyAdjust",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.initialZoom,i=n.adjust,a=i.brightness,l=i.contrast,c=i.saturation,s=i.exposure,u={brightness:0,contrast:0,saturation:0,exposure:0};r({isHideCanvas:!0,isShowSpinner:!0},(function(){1!==o?(e.CamanInstanceOriginal.revert(!1),"0"!==a.toString()&&e.CamanInstanceOriginal.brightness(parseInt(a||"0")),"0"!==l.toString()&&e.CamanInstanceOriginal.contrast(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstanceOriginal.saturation(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstanceOriginal.exposure(parseInt(s||"0")),e.CamanInstanceOriginal.render((function(){r({adjust:eo({},u)},(function(){e.makeCanvasSnapshot({operation:"adjust"},t)}))}))):r({adjust:eo({},u)},(function(){e.makeCanvasSnapshot({operation:"adjust"},t)}))}))})),lo(io(e),"initOrientation",(function(){var t=e.props,n=t.config,r=t.redoOperation,o=t.operations,i=t.operationsZoomed,a=1!==t.initialZoom?i:o;if(n.processWithCloudService&&a.length>=1){var l=a.findIndex((function(e){return"rotate"===e.operation}));l>-1&&r({operationIndex:l-1,callback:function(){},resetActiveTab:!1})}})),lo(io(e),"onRotate",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.props,a=i.initialZoom,l=i.rotate,c=i.updateState,s=l+t;c({isHideCanvas:!0,isShowSpinner:!0,rotate:s,correctionDegree:n,flipX:r,flipY:o},(function(){var t=e.getCanvas();1!==a?(e.CamanInstanceZoomed.reset(),r&&e.CamanInstanceZoomed.flip("x"),o&&e.CamanInstanceZoomed.flip("y"),(s||n)&&e.CamanInstanceZoomed.rotate((s||0)+(n||0)),e.CamanInstanceZoomed.render((function(){e.getCanvas().className=t.className,c({isHideCanvas:!1,isShowSpinner:!1})}))):(e.CamanInstance.reset(),r&&e.CamanInstance.flip("x"),o&&e.CamanInstance.flip("y"),(s||n)&&e.CamanInstance.rotate((s||0)+(n||0)),e.CamanInstance.render((function(){e.getCanvas().className=t.className,c({isHideCanvas:!1,isShowSpinner:!1})})))}))})),lo(io(e),"applyOrientation",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.initialZoom,i=n.rotate,a=n.correctionDegree,l=n.flipX,c=n.flipY;r({isHideCanvas:!0,isShowSpinner:!0},(function(){var n=e.getCanvas(null,!0),s=(i||0)+(a||0);1!==o?(e.CamanInstanceOriginal.reset(),l&&e.CamanInstanceOriginal.flip("x"),c&&e.CamanInstanceOriginal.flip("y"),(i||a)&&e.CamanInstanceOriginal.rotate(s),e.CamanInstanceOriginal.render((function(){e.getCanvas(null,!0).className=n.className,r({rotate:0,flipX:!1,flipY:!1,correctionDegree:0},(function(){e.makeCanvasSnapshot({operation:"rotate",props:{rotate:s}},t)}))}))):(e.getCanvas(null,!0).className=n.className,r({rotate:0,flipX:!1,flipY:!1,correctionDegree:0},(function(){e.makeCanvasSnapshot({operation:"rotate",props:{rotate:s}},t)})))}))})),lo(io(e),"getOrientationArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.rotate;switch(t){case 90:return"r=270";case-90:return"r=90";default:return"r=".concat(t)}})),lo(io(e),"initCrop",(function(){var t=e.props,n=t.config,r=t.redoOperation,o=t.operations,i=t.operationsZoomed,a=1!==t.initialZoom?i:o;if(n.processWithCloudService&&a.length>=1){var l=a.findIndex((function(e){return"crop"===e.operation}));l>-1&&r({operationIndex:l-1,callback:e.onInitCrop,resetActiveTab:!1})}else e.onInitCrop()})),lo(io(e),"onInitCrop",(function(){var t=e.props,n=t.updateState,r=t.config,o=r.beginCropArea,i=void 0===o?1:o,a=r.minCropAreaWidth,l=r.minCropAreaHeight;n({isHideCanvas:!0,isShowSpinner:!0},(function(){var t=e.getCanvas(),r=t.getBoundingClientRect(),o=t.width/r.width;e.cropper=new Xr.a(t,{viewMode:1,modal:!1,background:!1,rotatable:!1,scalable:!1,zoomable:!1,movable:!1,autoCropArea:i,minCropBoxWidth:a,minCropBoxHeight:l,crop:function(t){e.props.updateState({cropDetails:t.detail})}}),window.scaleflexPlugins=window.scaleflexPlugins||{},window.scaleflexPlugins.zoom=o,window.scaleflexPlugins.cropperjs=e.cropper,n({isHideCanvas:!1,isShowSpinner:!1})}))})),lo(io(e),"applyCrop",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.initialZoom,o=n.updateState,i=n.cropDetails,a=n.roundCrop,l=i.width,c=i.height,s=i.x,u=i.y;o({isShowSpinner:!0},(function(){var n,o,i;(e.destroyCrop(),1!==r)?(n=[l,c,s,u].map((function(e){return e*r})),e.CamanInstanceZoomed.crop(l,c,s,u),(o=e.CamanInstanceOriginal).crop.apply(o,Zr(n))):(n=[l,c,s,u],(i=e.CamanInstance).crop.apply(i,Zr(n)));e.makeCanvasSnapshot({operation:"crop",props:{width:n[0],height:n[1],x:n[2],y:n[3],roundCrop:a}},t)}))})),lo(io(e),"makeCanvasSnapshot",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.props,i=o.updateState,a=o.initialZoom,l=o.operationsZoomed,c=o.currentOperation,s=o.operationsOriginal,u=o.operations,f=o.roundCrop,p=1!==a;if(r){var d=(p?l:u).indexOf(c)+1,h=e.cloneCanvas(e.getCanvas()),m=eo(eo({},t),{},{previewCanvas:!0,canvas:h}),g={isHideCanvas:!1,isShowSpinner:!1,currentOperation:m};return p?(g.operationsZoomed=[].concat(Zr(l.slice(0,d)),[m]),g.operationsOriginal=[].concat(Zr(s.slice(0,d)),[eo(eo({},m),{},{canvas:e.cloneCanvas(e.getCanvas(null,!0))})]),g.isHideCanvasOriginal=!1,g.isShowSpinnerOriginal=!1):g.operations=[].concat(Zr(u.slice(0,d)),[m]),void i(g,n)}if(p){var b=l.indexOf(c)+1;e.CamanInstanceOriginal.render((function(){var r=e.replaceWithNewCanvas(rr,f),o=eo(eo({},t),{},{canvas:e.cloneCanvas(e.getCanvas(null,!0))});e.CamanInstanceOriginal=new window.Caman(r,(function(){i({isHideCanvasOriginal:!1,isShowSpinnerOriginal:!1,operationsOriginal:[].concat(Zr(s.slice(0,b)),[o])},n)}))}));var v=e.getCanvas;e.CamanInstanceZoomed.render((function(){var n=e.replaceWithNewCanvas(nr,f),r=eo(eo({},t),{},{canvas:e.cloneCanvas(v())});e.CamanInstanceZoomed=new window.Caman(n,(function(){i({isHideCanvas:!1,isShowSpinner:!1,operationsZoomed:[].concat(Zr(l.slice(0,b)),[r]),currentOperation:r})}))}))}else{var y=u.indexOf(c)+1,w=e.getCanvas;e.CamanInstance.render((function(){var r=e.replaceWithNewCanvas(nr,f),o=eo(eo({},t),{},{canvas:e.cloneCanvas(w())});e.CamanInstance=new window.Caman(r,(function(){i({isHideCanvas:!1,isShowSpinner:!1,operations:[].concat(Zr(u.slice(0,y)),[o]),currentOperation:o},n)}))}))}})),lo(io(e),"destroyCrop",(function(){e.cropper.destroy()})),lo(io(e),"getCropArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height,r=e.x,o=e.y,i=e.roundCrop;return"tl_px=".concat(Math.round(r),",").concat(Math.round(o),"&br_px=").concat(Math.round(r+t),",").concat(Math.round(o+n)).concat(i?"&radius=".concat(Math.round(Math.max(t,n)),"&force_format=png"):"")})),lo(io(e),"initResize",(function(){var t=e.props,n=t.initialZoom,r=t.updateState,o=e.getCanvas(1!==n?rr:nr);r({canvasDimensions:{width:o.width,height:o.height,ratio:o.width/o.height}})})),lo(io(e),"applyResize",(function(){var t=e.props,n=t.initialZoom,r=t.canvasDimensions,o=t.updateState,i=t.handleSave,a=t.operations,l=t.operationsOriginal;o({isHideCanvas:!0,isShowSpinner:!0,operationsOriginal:[].concat(Zr(l),[{operation:"resize",props:r}]),operations:[].concat(Zr(a),[{operation:"resize",props:r}])},(function(){1!==n?(e.CamanInstanceOriginal.resize(r),e.CamanInstanceOriginal.render((function(){i()}))):(e.CamanInstance.resize(r),e.CamanInstance.render((function(){i()})))}))})),lo(io(e),"getResizeArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;return"w=".concat(t,"&h=").concat(n)})),lo(io(e),"initAdjust",(function(){})),lo(io(e),"onAdjust",(function(t,n){var r,o=e.props,i=o.updateState,a=o.adjust;i({adjust:eo(eo({},a),{},(r={},lo(r,t,n),lo(r,"isHideCanvas",!0),lo(r,"isShowSpinner",!0),r))},(function(){e.applyCorrections((function(){i({isHideCanvas:!1,isShowSpinner:!1})}))}))})),lo(io(e),"initFocusPoint",(function(){var t=e.props,n=t.updateState,r=t.original,o=t.focusPoint,i=eo({},o);null===i.x&&(i.x=r.width/2),null===i.y&&(i.y=r.height/2),e.tempFocusPoint=eo({},o),n({focusPoint:i,isHideCanvas:!0,isShowSpinner:!0})})),lo(io(e),"applyFocusPoint",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.operations,i=n.operationsOriginal,a=n.focusPoint;e.tempFocusPoint=a,r({operationsOriginal:[].concat(Zr(i),[{operation:"focus_point",props:a}]),operations:[].concat(Zr(o),[{operation:"focus_point",props:a}])}),t()})),lo(io(e),"applyShapes",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props.shapeOperations;n.updateShapes({applied:!0},{selectedShape:{}},(function(){e.makeCanvasSnapshot({operation:"shape",props:{shapes:e.props.shapes}},t,!0)}))})),lo(io(e),"getFocusPointArguments",(function(e){return"gravity=".concat(e.x,",").concat(e.y)})),lo(io(e),"destroyFocusPoint",(function(){e.props.updateState({focusPoint:e.tempFocusPoint,isHideCanvas:!1,isShowSpinner:!1})})),lo(io(e),"pushOperation",(function(e,t,n){var r=e.findIndex((function(e){return e===n})),o=e.length;o&&r!==e[o]&&e.splice(r+1,o),e.push(t)})),lo(io(e),"applyOperations",(function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.props,i=o.initialZoom,a=o.operations,l=o.operationsZoomed,c=o.operationsOriginal,s=o.canvasZoomed,u=o.canvasOriginal,f=o.updateState,p=1!==i,d=p?l[t]:a[t],h=-1!==t;if(r&&r.previewCanvas&&r.index-1===t||d&&d.previewCanvas&&r.index+1===t){var m,g,b=e.props.shapeOperations,v=null==d||null===(m=d.props)||void 0===m?void 0:m.shapes;if(!v){var y=(p?l:a).filter((function(e,t){return"shape"===e.operation&&t0?y[y.length-1].props.shapes:[]}return b.replaceAllShapes(v),g=p?h?l[t]:{canvas:e.cloneCanvas(s)}:h?a[t]:{canvas:e.cloneCanvas(u)},void f(eo(eo({},co),{},{currentOperation:g}),(function(){n&&n()}))}if(h||e.props.shapeOperations.replaceAllShapes([]),p){var w=h?l[t]:{canvas:e.cloneCanvas(s)},x=e.replaceCanvas(w.canvas,nr);e.CamanInstanceZoomed=new window.Caman(x,(function(){f(eo(eo({},co),{},{currentOperation:w}),(function(){n&&n()}))}));var k=h?c[t]:{canvas:e.cloneCanvas(u)},S=e.replaceCanvas(k.canvas,rr);e.CamanInstanceOriginal=new window.Caman(S,(function(){}))}else{var C=h?a[t]:{canvas:e.cloneCanvas(u)},E=e.replaceCanvas(C.canvas,nr);e.CamanInstance=new window.Caman(E,(function(){f(eo(eo({},co),{},{currentOperation:C}),(function(){n&&n()}))}))}})),lo(io(e),"isOperationExist",(function(e,t){return e.find((function(e){return e.operation===t}))})),lo(io(e),"getOperationQuery",(function(e,t){return e?"crop_px":t?"width":"cdn"})),lo(io(e),"destroyAll",(function(){})),lo(io(e),"resetAll",(function(t){var n=e.props.activeTab;n?e.cancelLastOperation(n,(function(){e.applyOperations(-1,t)})):e.applyOperations(-1,t)})),lo(io(e),"applyCorrections",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.initialZoom,o=n.effect,i=n.filter,a=n.adjust,l=a.brightness,c=a.contrast,s=a.saturation,u=a.exposure;1!==r?(e.CamanInstanceZoomed.revert(!1),o&&e.CamanInstanceZoomed[Dr(o)](),i&&e.CamanInstanceZoomed[Dr(i)](),"0"!==l.toString()&&e.CamanInstanceZoomed.brightness(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstanceZoomed.contrast(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstanceZoomed.saturation(parseInt(s||"0")),"0"!==u.toString()&&e.CamanInstanceZoomed.exposure(parseInt(u||"0")),e.CamanInstanceZoomed.render(t)):(e.CamanInstance.revert(!1),o&&e.CamanInstance[Dr(o)](),i&&e.CamanInstance[Dr(i)](),"0"!==l.toString()&&e.CamanInstance.brightness(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstance.contrast(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstance.saturation(parseInt(s||"0")),"0"!==u.toString()&&e.CamanInstance.exposure(parseInt(u||"0")),e.CamanInstance.render(t))})),lo(io(e),"cancelAddedShapes",(function(){e.props.shapeOperations.deleteShapes({all:!0},{selectedShape:{}})})),lo(io(e),"cancelLastOperation",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=e.props.initialZoom;"crop"===t&&e.destroyCrop(),"watermark"===t&&e.cancelWatermark(),["shapes","image","text"].includes(t)&&e.cancelAddedShapes(),1!==r?(e.CamanInstanceZoomed.reset(),e.CamanInstanceOriginal.reset(),e.CamanInstanceOriginal.render(),e.CamanInstanceZoomed.render((function(){n&&n()}))):(e.CamanInstance.reset(),e.CamanInstance.render((function(){n&&n()})))})),lo(io(e),"initWatermark",(function(){var t=e.props,n=t.watermark,r=t.updateState;n.applyByDefault||r({watermark:eo(eo({},n),{},{applyByDefault:!0})})})),lo(io(e),"applyWatermark",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.shapeOperations,i=(o.getShape({key:"watermark-layer"})||{}).index;e.setState({tempWatermark:null}),r({selectedShape:{}}),e.makeCanvasSnapshot({operation:"shape",props:{shapes:[i]}},t,!0),t()})),lo(io(e),"cancelWatermark",(function(){var t=e.state.tempWatermark,n=e.props,r=n.updateState,o=n.shapeOperations,i=o.getShape({key:"watermark-layer"})||{},a=null;t&&t.url&&t.applyByDefault?(r({isShowSpinner:!0}),(a=new Image).setAttribute("crossOrigin","Anonymous"),a.src=t.url+"?"+(new Date).getTime(),a.onload=function(){o.updateShape({img:a},i.index,{watermark:t,logoImage:a,isShowSpinner:!1,selectedShape:{}})}):o.deleteShape({index:i.index},{watermark:t,logoImage:a,selectedShape:{}})})),lo(io(e),"getWatermarkArguments",(function(){var t=e.props,n=t.config.processWithCloudimage,r=t.shapeOperations.getShape({key:"watermark-layer"});if(!r)return"";var o=r.x,i=r.y,a=r.opacity,l=Kr(r,["x","y","opacity"]),c=e.state.original,s=((c=void 0===c?{}:c).width,c.height,e.getCanvas("filerobot-shapes-edit-box")),u=s.width,f=s.height,p=Yr(o/u*100),d=Yr(i/f*100),h=Math.max(l.width/u,l.height/f),m=Yr(100*h),g="wat_gravity=absolute&wat_pos=".concat(p,",").concat(d),b="wat=1&wat_opacity=".concat(a,"&wat_scale=").concat(m,"p&").concat(g);return b+=n&&l.text?"&wat_text=".concat(l.text,"&wat_font=").concat(l.textFont,"&wat_fontsize=").concat(l.textSize,"&wat_colour=").concat(l.color.replace("#","")):"&wat_url=".concat(l.img.src.split("?")[0])})),lo(io(e),"applyChanges",(function(t,n){switch(t){case"adjust":e.applyAdjust(n);break;case"effects":e.applyFilterOrEffect("effect",n);break;case"filters":e.applyFilterOrEffect("filter",n);break;case"crop":e.applyCrop(n);break;case"resize":e.applyResize();break;case"rotate":e.applyOrientation(n);break;case"watermark":e.applyWatermark(n);break;case"focus_point":e.applyFocusPoint(n);break;case"shapes":case"image":case"text":e.applyShapes(n)}})),lo(io(e),"changeTab",(function(t){switch(t){case"effects":case"filters":e.initFiltersOrEffects();break;case"adjust":e.initAdjust();break;case"crop":e.initCrop();break;case"resize":e.initResize();break;case"rotate":e.initOrientation();break;case"watermark":e.initWatermark();break;case"focus_point":e.initFocusPoint();break;default:e.destroyAll()}})),lo(io(e),"destroyMode",(function(t){switch(t){case"effects":case"filters":case"adjust":break;case"crop":e.destroyCrop();break;case"resize":case"rotate":break;case"focus_point":e.destroyFocusPoint()}})),e.state={canvas:null,self:io(e)},e.CamanInstance=null,e.CamanInstanceOriginal=null,e.CamanInstanceZoomed=null,e}return t=a,r=[{key:"getDerivedStateFromProps",value:function(e,t){var n,r={};return e.activeTab!==t.activeTab&&(t.activeTab&&t.self.destroyMode(t.activeTab),"watermark"===e.activeTab&&(r.tempWatermark=e.watermark&&(n=e.watermark,JSON.parse(JSON.stringify(n)))),t.self.changeTab(e.activeTab)),eo(eo({},r),e)}}],(n=[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentDidMount",value:function(){var e=this,t=this,n=this.props,r=n.updateState,o=n.img,i=n.isPreResize,a=n.preCanvasDimensions;r({isShowSpinner:!0,applyChanges:this.applyChanges,applyOperations:this.applyOperations,resetAll:this.resetAll,onRotate:this.onRotate,onAdjust:this.onAdjust,downloadImage:this.downloadImage,getResultCanvas:this.getResultCanvas,saveImage:this.saveImage,applyCorrections:this.applyCorrections,restoreAll:this.restoreAll,cancelLastOperation:this.cancelLastOperation},(function(){var n=e.getCanvas(),l=n.getContext("2d");n.width=o.width,n.height=o.height,l.drawImage(o,0,0,o.width,o.height);var c={height:o.height,width:o.width,ratio:o.width/o.height};r({original:c,canvasDimensions:c}),i&&a?new window.Caman(n,(function(){this.resize({width:a.width,height:a.height}),this.render((function(){var e=t.replaceWithNewCanvas(nr),n={height:e.height,width:e.width,ratio:e.width/e.height};r({original:n,canvasDimensions:eo({},n),canvasOriginal:t.cloneCanvas(e)},(function(){t.initializeCanvases(e)}))}))})):e.initializeCanvases(o)}))}},{key:"render",value:function(){var e=this.props.config.elementId;return i.a.createElement(i.a.Fragment,null,i.a.createElement(Pe,{id:"".concat(e,"_").concat(rr),className:"filerobot-original-canvas"}),i.a.createElement(Pe,{id:"".concat(e,"_").concat(nr),className:"filerobot-edit-canvas"}))}}])&&to(t.prototype,n),r&&to(t,r),a}(o.Component),uo=n(4);function fo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return po(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return po(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function po(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.width&&d>=t.height)h=t.width,m=t.height;else if(p>t.width&&dt.height)h=p,m=p/t.ratio;else{var g=p,b=p/t.ratio,v=d*t.ratio,y=d;t.width<=g&&t.height<=b?(h=g,m=b):(h=v,m=y)}return{width:h,height:m}}((document.getElementById("preview-img-box")||{}).parentElement,t),n=e.width,r=void 0===n?0:n,o=e.height;return{width:r,height:void 0===o?0:o}}),[t]),d=fo(Object(o.useState)(p()),2),h=d[0],m=d[1],g=Object(o.useMemo)((function(){return Object(uo.debounce)(100,(function(){m(p())}))}),[p]);return Object(o.useEffect)((function(){var e=!0,t=function(){e&&g()};return window.addEventListener("resize",t),function(){e=!1,window.removeEventListener("resize",t)}}),[g]),i.a.createElement(Ce,{ref:u,width:h.width,height:h.height},i.a.createElement(Ee,{onMouseDown:function(e){var n=e.clientX-f.x,o=e.clientY-f.y,i=Math.round(n*t.width/h.width),a=Math.round(o*t.height/h.height),l=Math.min(Math.max(i,0),t.width),c=Math.min(Math.max(a,0),t.height);r({focusPoint:{x:l,y:c}})}},i.a.createElement(_e,{visible:c,src:a,onLoad:function(){r({isShowSpinner:!1}),s(!0)},onError:function(){r({isShowSpinner:!1})}}),i.a.createElement(Oe,{visible:c,x:n.x*h.width/t.width,y:n.y*h.height/t.height})))};function mo(e){return(mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function go(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||yo(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bo(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function vo(e){return function(e){if(Array.isArray(e))return wo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||yo(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yo(e,t){if(e){if("string"==typeof e)return wo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wo(e,t):void 0}}function wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:function(){},r=t.props.updateState;r(e,n)})),To(_o(t),"pushShapeToShapes",(function(e,n){var r=t.props.shapes,o=r.length;return t.updateState(ko({shapes:[].concat(vo(r),[ko(ko({},e),{},{index:o})])},n)),o})),To(_o(t),"targettedShape",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e||0===e?t.props.shapes[e]:t.props.selectedShape})),To(_o(t),"onSelect",(function(e){var n=t.props,r=n.shapes,o=n.activeTab;if(t._allowedTabs.includes(o)){var i=e.offsetX,a=e.offsetY,l=!1;r.forEach((function(e){!e.hidden&&i>=e.x&&i<=e.x+e.width&&a>=e.y&&a<=e.y+e.height&&e.tab===o&&(l=!0,t.updateState({selectedShape:ko(ko({},e),{},{resizingBox:!0,startEdgeOffset:{x:i-e.x,y:a-e.y}})}),t.activateResizingActions(),t._canvas.addEventListener("keyup",t.activateShapeDeleting),t._canvas.addEventListener("mousemove",t.startDragging),t._canvas.addEventListener("touchmove",t.startDragging),document.addEventListener("mouseup",t.endDragging),document.addEventListener("touchend",t.endDragging))})),l||(t.updateState({selectedShape:{}}),t.disableResizingActions(),t._canvas.removeEventListener("keyup",t.activateShapeDeleting),t._canvas.removeEventListener("mousemove",t.startDragging),t._canvas.removeEventListener("touchmove",t.startDragging),document.removeEventListener("mouseup",t.endDragging),document.removeEventListener("touchend",t.endDragging))}})),To(_o(t),"activateShapeDeleting",(function(e){var n=e.key,r=t.props.selectedShape;"Delete"!==n&&"Backspace"!==n||!r||(t.deleteShapeByKeyOrIndex({index:r.index}),t.updateState({selectedShape:{}}),t.disableResizingActions(),t._canvas.removeEventListener("keyup",t.activateShapeDeleting))})),To(_o(t),"activateResizingActions",(function(){t.props.selectedShape.lockScaleToPercentage||Array.from(document.getElementsByClassName("shape-resizing-control")).forEach((function(e){e.addEventListener("mousedown",t.trackShapeResize)}))})),To(_o(t),"trackShapeResize",(function(e){var n=e.target;t.setState({resizeControlTarget:n}),document.addEventListener("mousemove",t.handleShapeResizing),document.addEventListener("touchmove",t.handleShapeResizing),document.addEventListener("mouseup",t.disableResizingActions),document.addEventListener("touchend",t.disableResizingActions)})),To(_o(t),"handleShapeResizing",(function(e){var n=e.movementX,r=e.movementY,o=e.shiftKey,i=t.state.resizeControlTarget,a=t.props,l=a.selectedShape,c=a.processWithCloudimage,s=l.index,u=l.width,f=l.height,p=l.x,d=l.y,h=l.variant,m=l.originalWidth,g=l.originalHeight;if(i&&h!==br){var b=f,v=i.dataset.direction;if(c){if(["e","w","n","s"].includes(v))return;o=!0}var y=function(e){var t=u/f;if(Math.abs(n)>=Math.abs(r)){var o=Math.abs(f-(u+n)/t);r=(e?1:-1)*Math.sign(n)*o}else{var i=Math.abs(u-(f+r)*t);n=(e?1:-1)*Math.sign(r)*i}},w=function(){u+=n},x=function(){f+=r},k=function(){u-=n,p+=n},S=function(){f-=r,d+=r};switch(v){case"e":w();break;case"w":k();break;case"n":S();break;case"s":x();break;case"ne":if(o&&y(!1),w(),u>=t._canvas.width&&o)break;S();break;case"nw":if(o&&y(!0),k(),u>=t._canvas.width&&o)break;S();break;case"se":if(o&&y(!0),w(),u>=t._canvas.width&&o)break;x();break;case"sw":if(o&&y(!1),k(),u>=t._canvas.width&&o)break;x();break;default:return}if(h!==hr&&h!==mr||(f!==b?u=f:f=u),!c||!(u>=m||f>=g)){if(!(f<=15||u<=15)){p<0&&(p=0),d<0&&(d=0),p+u>t._canvas.width&&(p=t._canvas.width-u),d+f>t._canvas.height&&(d=t._canvas.height-f),u>t._canvas.width&&(u=t._canvas.width),f>t._canvas.height&&(f=t._canvas.height);var C={width:u,height:f,x:p,y:d};t.updateShape(C,s,{selectedShape:ko(ko({},l),C)})}}}})),To(_o(t),"disableResizingActions",(function(e){document.removeEventListener("mousemove",t.handleShapeResizing),document.removeEventListener("mouseup",t.disableResizingActions),t.updateState({selectedShape:{}}),t.setState({resizeControlTarget:null})})),To(_o(t),"removeResizingBox",(function(e){var n=e.offsetX,r=e.offsetY,o=t.props.selectedShape;(no.x+o.width||ro.y+o.height)&&(t.updateState({selectedShape:ko(ko({},o),{},{resizingBox:!1})}),t._canvas.removeEventListener("click",t.removeResizingBox))})),To(_o(t),"startDragging",(function(e){if(e.targetTouches&&e.targetTouches[0]){e.preventDefault();var n=e.targetTouches[0],r=n.clientX,o=n.clientY,i=t._canvas.getBoundingClientRect(),a=i.x,l=i.y;e.offsetX=r-a,e.offsetY=o-l}var c=t.props.selectedShape,s=c.startEdgeOffset,u=void 0===s?{}:s,f=c.width,p=c.height,d=c.index,h=e.offsetX-u.x,m=e.offsetY-u.y;h<0&&(h=0),m<0&&(m=0),h+f>t._canvas.width&&(h=t._canvas.width-f),m+p>t._canvas.height&&(m=t._canvas.height-p);var g=ko(ko({},c),{},{x:h,y:m});t.updateShape(g,d,{selectedShape:g})})),To(_o(t),"endDragging",(function(){t._canvas.removeEventListener("mousemove",t.startDragging),t._canvas.removeEventListener("mouseup",t.endDragging),t._canvas.removeEventListener("mouseleave",t.endDragging),t._canvas.addEventListener("click",t.removeResizingBox)})),To(_o(t),"getCanvasCenter",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t._canvas.width/2-e,o=t._canvas.height/2-n;return[r,o]})),To(_o(t),"draw",(function(e,n){var r=n.opacity,o=void 0===r?1:r,i=n.hidden,a=n.color,l=n.stroke,c=void 0===l?{}:l;i||(t._context.globalAlpha=+o,t._context.fillStyle=a,t._context.strokeStyle=c.color||"transparent",t._context.lineWidth=c.width||1,e(),t.props.round&&t._context.round())})),To(_o(t),"redrawShape",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=t.props.shapes;t.clearShape(0,0,t._canvas.width,t._canvas.height);var r=n.length;if(e&&e!==r-1){var o=ko(ko({},n.splice(e,1)[0]),{},{index:r});n.splice(r,0,o),n=n.map((function(e,n){return e.index=n,t.drawShapeThroughVariant(e),e})),t.updateState({shapes:n,selectedShape:o})}else n.forEach((function(e){return t.drawShapeThroughVariant(e)}))})),To(_o(t),"drawShapeThroughVariant",(function(e){switch(e.variant){case gr:t.drawImage(e);break;case dr:case hr:t.drawRect(e);break;case mr:t.drawCircle(e);break;case br:t.drawText(e);default:return}})),To(_o(t),"drawRect",(function(e){var n=e.x,r=e.y,o=e.width,i=e.height,a=e.stroke,l=bo(e,["x","y","width","height","stroke"]);t.draw((function(){t._context.fillRect(n,r,o,i),a&&t._context.strokeRect(n,r,o,i)}),ko({stroke:a},l))})),To(_o(t),"drawCircle",(function(e){var n=e.x,r=e.y,o=(e.radius,e.width),i=e.height,a=e.stroke,l=bo(e,["x","y","radius","width","height","stroke"]);t.draw((function(){t._context.roundRect(n,r,o,i),t._context.fill(),a&&t._context.stroke()}),ko({stroke:a},l))})),To(_o(t),"drawImage",(function(e){var n=e.img,r=e.x,o=e.y,i=e.width,a=e.height,l=e.stroke,c=bo(e,["img","x","y","width","height","stroke"]);t.draw((function(){t._context.drawImage(n,r,o,i,a),l&&t._context.strokeRect(r,o,i,a)}),ko({stroke:l},c))})),To(_o(t),"setTextStyle",(function(e){var n=e.textSize,r=e.textFont;t._context.textAlign="start",t._context.textBaseline="top",t._context.font="".concat(n,"px ").concat(r)})),To(_o(t),"getTextWidthAndHeight",(function(e){var n=e.text,r=e.textSize,o=e.textFont;t.setTextStyle({textSize:r,textFont:o});var i=t._context.measureText(n),a=i.width;return[a,0===a?0:i.actualBoundingBoxDescent-i.actualBoundingBoxAscent]})),To(_o(t),"drawText",(function(e){var n=e.text,r=e.textSize,o=e.textFont,i=e.x,a=e.y,l=e.stroke,c=bo(e,["text","textSize","textFont","x","y","stroke"]);t.draw((function(){t.setTextStyle({textSize:r,textFont:o}),t._context.fillText(n,i,a,t._canvas.width),l&&t._context.strokeText(n,i,a)}),ko({stroke:l},c))})),To(_o(t),"addRect",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.x,r=e.y,o=e.width,i=void 0===o?100:o,a=e.height,l=void 0===a?75:a,c=e.stroke,s=void 0===c?{}:c,u=e.color,f=void 0===u?"#000000":u,p=e.opacity,d=void 0===p?1:p,h=e.variant,m=void 0===h?dr:h,g=e.tab,b=void 0===g?"shapes":g,v=bo(e,["x","y","width","height","stroke","color","opacity","variant","tab"]),y=t.getCanvasCenter(i/2,l/2),w=go(y,2),x=w[0],k=w[1],S={x:n||x,y:r||k,width:i,height:l,stroke:s,opacity:d,color:f},C=ko(ko(ko(ko({},t._initArgs),v),S),{},{variant:m,tab:b});if(!v.key||!t.replaceShapeIfExisted(v.key,C)){t.drawRect(S);var E=t.pushShapeToShapes(C);t.updateState({selectedShape:ko(ko({},C),{},{index:E,resizingBox:!0})},t.activateResizingActions)}})),To(_o(t),"addSquare",(function(e){e.width||(e.width=e.height=75),e.variant=hr,t.addRect(e)})),To(_o(t),"addCircle",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.x,r=e.y,o=e.radius,i=void 0===o?50:o,a=e.stroke,l=void 0===a?{}:a,c=e.color,s=void 0===c?"#000000":c,u=e.opacity,f=void 0===u?1:u,p=e.tab,d=void 0===p?"shapes":p,h=bo(e,["x","y","radius","stroke","color","opacity","tab"]),m=t.getCanvasCenter(i,i),g=go(m,2),b=g[0],v=g[1],y=2*i,w={x:n||b,y:r||v,radius:i,color:s,opacity:f,stroke:l,width:y,height:y},x=ko(ko(ko(ko({},t._initArgs),h),w),{},{tab:d,variant:mr});if(!h.key||!t.replaceShapeIfExisted(h.key,x)){t.drawCircle(w);var k=t.pushShapeToShapes(x);t.updateState({selectedShape:ko(ko({},x),{},{index:k,resizingBox:!0})},t.activateResizingActions)}})),To(_o(t),"addImage",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.img,r=e.x,o=void 0===r?void 0:r,i=e.y,a=void 0===i?void 0:i,l=e.opacity,c=void 0===l?1:l,s=e.tab,u=void 0===s?"image":s,f=e.stroke,p=void 0===f?{}:f,d=e.otherStates,h=bo(e,["img","x","y","opacity","tab","stroke","otherStates"]);if(n){var m=function(){var e=go(t.getSuitableImgDiemensions(n,h.lockScaleToPercentage),2),r=e[0],i=e[1],l=go(t.getCanvasCenter((h.width||r)/2,(h.height||i)/2),2),s=l[0],f=l[1],m={img:n,opacity:c,originalWidth:r,originalHeight:i,width:h.width||r,height:h.height||i,x:o||s,y:a||f,stroke:p},g=ko(ko(ko(ko({},t._initArgs),h),m),{},{variant:gr,tab:u});if(!h.key||!t.replaceShapeIfExisted(h.key,g,d)){t.drawImage(m);var b=t.pushShapeToShapes(g);t.updateState(ko({selectedShape:ko(ko({},g),{},{index:b,resizingBox:!0})},d),t.activateResizingActions)}};"string"==typeof n?n=t.makeImgElement(n,m):m()}})),To(_o(t),"addText",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.text,r=void 0===n?"Text":n,o=e.textSize,i=void 0===o?62:o,a=e.color,l=void 0===a?"#000000":a,c=e.textFont,s=void 0===c?"Arial":c,u=e.x,f=void 0===u?void 0:u,p=e.y,d=void 0===p?void 0:p,h=e.stroke,m=void 0===h?{}:h,g=e.opacity,b=void 0===g?1:g,v=e.tab,y=void 0===v?"text":v,w=e.otherStates,x=bo(e,["text","textSize","color","textFont","x","y","stroke","opacity","tab","otherStates"]),k=t.getTextWidthAndHeight({text:r,textSize:i,textFont:s}),S=go(k,2),C=S[0],E=S[1],O=t.getCanvasCenter(C/2,E/2),_=go(O,2),P=_[0],T=_[1];if(r){var j={text:r,textSize:i,textFont:s,x:f||P,y:d||T,opacity:b,stroke:m,color:l},R=ko(ko(ko(ko({},t._initArgs),x),j),{},{width:C,height:E,variant:br,tab:y});if(x.key&&t.replaceShapeIfExisted(x.key,R,w))return;t.drawText(j);var D=t.pushShapeToShapes(R);t.updateState(ko({selectedShape:ko(ko({},R),{},{index:D,resizingBox:!0})},w),t.activateResizingActions)}})),To(_o(t),"addAnyShape",(function(e,n){if(e.index||0===e.index){var r=t.props.shapes[e.index];if(!e.variant||r.variant===e.variant)return void t.updateShape(e,e.index,n)}var o=ko(ko({},e),{},{otherStates:n});switch(e.variant){case gr:t.addImage(o);break;case dr:t.addRect(o);break;case hr:t.addSquare(o);break;case mr:t.addCircle(o);break;case br:t.addText(o);default:return}})),To(_o(t),"getSuitableImgDiemensions",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.width,o=e.height;if(o>t._canvas.height){var i=o/t._canvas.height;o/=i,r/=i}if(r>t._canvas.width){var a=r/t._canvas.width;o/=a,r/=a}if(n){var l=n/100;r*=l,o*=l}return[r=t.fromLatestCanvasSizeValue(r,"width"),o=t.fromLatestCanvasSizeValue(o,"height")]})),To(_o(t),"getShapeByKeyOrIndex",(function(e){var n=e.key,r=e.index;if(!n&&!r&&0!==n&&0!==r)return!1;var o=t.props.shapes;return r?o[r]:o.filter((function(e){return e.key===n}))[0]})),To(_o(t),"replaceShapeIfExisted",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=t.getShapeByKeyOrIndex({key:e});return!!o&&(n=ko(ko({},n),{},{x:o.x,y:o.y,width:o.width,height:o.height}),t.updateShape(n,o.index,r),!0)})),To(_o(t),"setShapeVisibilityByKeyOrIndex",(function(e){var n=e.key,r=e.index,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=t.getShapeByKeyOrIndex({key:n,index:r});i&&i.hidden!==o&&t.updateShape({hidden:o||!i.hidden},i.index)})),To(_o(t),"getShapesIndexByAnyProp",(function(e,n){var r=t.props.shapes;if(r&&0===r.length)return[];var o=[];return r.filter((function(t,r){var i=t[e];return(i===n||void 0===i&&Boolean(i)===n)&&(o.push(r),!0)})),o})),To(_o(t),"updateShapes",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=t.props.shapes;o=o.map((function(t){return ko(ko({},t),e)})),t.updateState(ko({shapes:o},n),r)})),To(_o(t),"replaceAllShapes",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.updateState({shapes:e},(function(){t.redrawShape(),n()}))})),To(_o(t),"updateShape",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=t.props,i=o.shapes,a=o.selectedShape;if(e&&(n||0===n||a&&(a.index||0===a.index))){if("string"==typeof e.img)return t.updateState({selectedShape:ko(ko({},a),{},{lockScaleToPercentage:e.lockScaleToPercentage,img:e.img})}),void t.makeImgElement(e.img,t.updateShape,e,n,r);var l={};if(n||0===n||(l.selectedShape=ko(ko({},a),e)),i[n=n||0===n?n:a.index]){var c=i;if(e.textSize&&e.textSize!==i[n].textSize||e.text&&e.text!==i[n].text){var s=i[n],u=t.getTextWidthAndHeight(ko(ko({},s),e)),f=go(u,2),p=f[0],d=f[1];l.selectedShape?(e.width=l.selectedShape.width=p,e.height=l.selectedShape.height=d,e.text=l.selectedShape.text=e.text||s.text):(e.width=p,e.height=d,e.text=e.text||s.text)}else{var h=ko({},e);void 0!==e.x&&void 0!==e.y&&(h.x=e.x,h.y=e.y),e.stroke&&(h.stroke=e.stroke),e.width&&e.height&&(h.width=e.width,h.height=e.height),e.lockScaleToPercentage&&(e.lockScaleToPercentage=e.lockScaleToPercentage),l.selectedShape=ko(ko({},a),h)}c[n]=ko(ko({},c[n]),e),t.updateState(ko(ko({shapes:c},l),r),(function(){t.redrawShape(n)}))}}})),To(_o(t),"clearShape",(function(e,n,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=i.width,l=a||1,c=e-l,s=n-l,u=r+l,f=o+l;t._context.clearRect(c,s,u,f)})),To(_o(t),"eraseAndRemoveShapeFromArray",(function(e,n){if(0!==Object.keys(t.targettedShape(e)).length)return t.clearShape(0,0,t._canvas.width,t._canvas.height),n.filter((function(n){return n.index!==e&&(n.index>e&&(n.index-=1),t.drawShapeThroughVariant(n),n)}))})),To(_o(t),"deleteShapeByKeyOrIndex",(function(e){var n=e.index,r=e.key,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.props.selectedShape;if(!n&&0!==n&&!r){if(!i)return;n=i.index}var a=t.props.shapes,l=n||0===n?n:(t.getShapeByKeyOrIndex({key:r})||{}).index;(l||0===l)&&(l===i.index&&(o.selectedShape={}),t.updateState(ko({shapes:t.eraseAndRemoveShapeFromArray(l,a)},o)))})),To(_o(t),"deleteShapes",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=t.props.shapes;e.forEach((function(e){r=t.eraseAndRemoveShapeFromArray(e,r)})),t.updateState(ko({shapes:r},n))})),To(_o(t),"deleteAllShapesOrByTypeOrIndicies",(function(e){var n=e.type,r=e.all,o=void 0!==r&&r,i=e.applied,a=void 0!==i&&i,l=e.secured,c=void 0===l?[]:l;if(n||o){if(o){var s=(t.getShapeByKeyOrIndex({key:"watermark-layer"})||{}).index,u=vo(c);!s&&0!==s||u.includes(s)||u.push(s);var f=[];return t.clearShape(0,0,t._canvas.width,t._canvas.height),a||(f=t.props.shapes.filter((function(e){return!(!e.applied&&!u.includes(e.index))&&(t.drawShapeThroughVariant(e),e)}))),void t.updateState({shapes:f,selectedShape:{}})}var p=t.getShapesIndexByAnyProp("type",n);p.length>0&&t.deleteShapes(p)}})),To(_o(t),"makeImgElement",(function(e,n,r){for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a-1&&n&&(t.splice(i,1),r({operations:t}),o(t,"resize"))}},{key:"render",value:function(){var e=this,t=this.state.isBlockRatio,n=this.props,r=n.canvasDimensions,o=n.processWithCloudService,a=n.onPreResize,l=n.t;return i.a.createElement(xe,{id:"preview-img-box"},i.a.createElement(Nt,null,l["warning.too_big_resolution"]),i.a.createElement(Ft,null,i.a.createElement("h4",null,l["pre_resize.title"]),i.a.createElement(zt,null,i.a.createElement(Bt,null,i.a.createElement(dt,null,i.a.createElement(ht,null,l["common.width"]),i.a.createElement(mt,{fullSize:!0,value:parseInt(r.width,10)||"",onChange:this.changeWidth})),i.a.createElement(bt,null,i.a.createElement(vt,{active:!t,style:o?{cursor:"not-allowed"}:{},link:!0,onClick:function(){!o&&e.toggleRatio()}},i.a.createElement(yt,{active:!t,style:o?{cursor:"not-allowed"}:{}}))),i.a.createElement(dt,null,i.a.createElement(ht,null,l["common.height"]),i.a.createElement(mt,{fullSize:!0,value:parseInt(r.height,10)||"",onChange:this.changeHeight})))),i.a.createElement(Lt,null,i.a.createElement("p",null,i.a.createElement(je,{themeColor:!0,themeBtn:!0,onClick:function(){a("keep")}},l["pre_resize.keep_original_resolution"])),i.a.createElement("p",null,i.a.createElement(je,{themeColor:!0,success:!0,onClick:function(){a("resize")}},l["pre_resize.resize_n_continue"])))))}}])&&Wo(t.prototype,n),r&&Wo(t,r),a}(o.Component);function Zo(e){return(Zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Go(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jo(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=e.target.value;if(r.props.watermark.text)r.initWatermarkImage(n);else{var o=r.state.position;r.updateWatermarkProperty({url:n,position:o},ul({img:n,position:o},t),{url:"",text:!1})}})),bl(ml(r),"changeTextProperty",(function(e){var t=bl({},e.target.name,e.target.value);if(r.props.watermark.text)r.updateWatermarkProperty(t);else{var n=r.state,o=ul({text:n.text,color:n.color,textSize:n.textSize,textFont:n.textFont,opacity:n.opacity,variant:br,tab:"watermark"},t);r.updateWatermarkProperty(ul({},t),ul(ul({},o),{},{resizingBox:!0}),{text:ul(ul({},r.props.watermark.text),o)})}})),bl(ml(r),"readFile",(function(e){if(r.props.config.processWithCloudimage)return null;var t=e.target;if(t.files&&t.files[0]){var n=new FileReader;n.onload=function(e){r.changeURL({target:{value:e.target.result}},{variant:gr})},n.readAsDataURL(t.files[0])}})),bl(ml(r),"getWatermarkDimensionsByPosString",(function(e,t,n){return Lr(e,Rr(r.props.config.elementId),t,n)})),bl(ml(r),"onPositionChange",(function(e){var t=r.getWatermarkLayer(),n=t.width,o=t.height,i=ll(r.getWatermarkDimensionsByPosString(e,n,o),4),a=i[0],l=i[1],c=i[2],s=i[3];r.updateWatermarkProperty({position:e,width:c,height:s},{x:a,y:l,width:c,height:s},{position:e,x:a,y:l,width:c,height:s})})),bl(ml(r),"initWatermarkImage",Object(uo.debounce)(500,(function(e){var t=r.props.updateState,n=null;t({isShowSpinner:!0});var o=function(e){return{logoImage:e,isShowSpinner:!1,watermark:ul(ul({},r.props.watermark),{},{url:e.src})}};if(e){var i=r.props,a=i.shapeOperations,l=i.watermark,c=l.lockScaleToPercentage,s=void 0===c?0:c,u=l.position,f=r.state.opacity;(n=new Image).setAttribute("crossOrigin","Anonymous"),n.onload=function(){var e,t=r.props.watermark.imageFilter;t&&"function"==typeof t?(n.onload=null,e=o(t(n))):e=o(n);var i=(r.getWatermarkLayer()||{}).index,l=ll(r.getWatermarkDimensionsByPosString(u,n.width,n.height),4),c=l[0],p=l[1],d=l[2],h=l[3];a.addOrUpdate({img:n,opacity:f,index:i,x:c,y:p,width:d,height:h,variant:gr,key:"watermark-layer",tab:"watermark",lockScaleToPercentage:s},e)},n.onerror=function(){t({isShowSpinner:!1})},e.match(/^https?:\/\/./)?n.src=e+"?"+(new Date).getTime():n.src=e}else t({isShowSpinner:!1})}))),bl(ml(r),"showWatermarkList",(function(){r.setState({showWaterMarkList:!0})})),bl(ml(r),"hideWatermarkList",(function(){r.setState({showWaterMarkList:!1})})),bl(ml(r),"onChangeWatermark",(function(e){r.changeURL({target:{value:e}}),r.hideWatermarkList()})),bl(ml(r),"handleInputTypeChange",(function(e){var t=e.target,n=r.props,o=n.updateState,i=n.config;o({isShowSpinner:!0}),r.setState({selectedInputType:t.value}),"text"===t.value?(r.changeTextProperty({target:{name:"text",value:(i.watermark||{}).defaultText||"Your text"}}),o({isShowSpinner:!1})):(o({watermark:ul(ul({},r.props.watermark),{},{text:null})}),r.initWatermarkImage(r.props.watermark.url||""))}));var i=e.watermark,l=i.opacity,c=i.position,s=i.url,u=i.applyByDefault,f=i.activePositions,p=i.handleOpacity,d=e.watermark,h=d.urls,m=d.fonts,g=[],b=c||"right-top";if("string"==typeof f&&sr.hasOwnProperty(f))g=sr[f];else if(Array.isArray(f)){var v=Array(9).fill(0);f.map((function(e,t){return v[t]=e})),g=v}else g=Array(9).fill(1);return 1!==g[cr.indexOf(b)]&&(b=cr[g.indexOf(1)]),h&&(h=h.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("string"==typeof e){var t=e.split("/");return{url:e,label:t[t.length-1]}}return e}))),r.initWatermarkImage(s||(null===(t=h)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.url)),r.state={isBlockRatio:!1,opacity:l||.7,handleOpacity:"boolean"!=typeof p||p,position:b,url:s||(h&&h.length>1?h[0]&&h[0].url:""),urls:h||[],activePositions:g,isWatermarkList:h&&h.length>1,applyByDefault:u||!1,showWaterMarkList:!1,selectedInputType:h&&h.length>1?"gallery":"upload",text:"",color:"#000000",textSize:62,textFont:"Arial",fonts:m||r.props.config.theme.fonts},r}return t=a,(n=[{key:"componentDidUpdate",value:function(e){var t=this.props;t.watermark.position!==this.state.position&&this.onPositionChange(this.state.position),t.watermark.applyByDefault!==e.watermark.applyByDefault&&(this.getWatermarkLayer()?this.updateWatermarkProperty({applyByDefault:!1},{hidden:!0,resizingBox:!1},{applyByDefault:!1}):this.setState({applyByDefault:t.watermark.applyByDefault}),t.watermark.applyByDefault&&(this.getWatermarkLayer()?this.updateWatermarkProperty({applyByDefault:!0},{hidden:!1,resizingBox:!0},{applyByDefault:!0}):this.initWatermarkImage(t.watermark.url)))}},{key:"render",value:function(){var e=this,t=this.state,n=t.isWatermarkList,r=t.url,o=t.urls,a=t.opacity,l=t.handleOpacity,c=t.position,s=t.activePositions,u=(t.applyByDefault,t.showWaterMarkList),f=t.selectedInputType,p=t.text,d=t.color,h=t.textFont,m=t.textSize,g=t.fonts,b=this.props.config,v="upload"===f,y="gallery"===f,w="url"===f,x="text"===f,k=this.props.t;return i.a.createElement(Dn,null,i.a.createElement(Ln,null,i.a.createElement("label",null,k["common.gallery"],i.a.createElement("input",{type:"radio",value:"gallery",checked:"gallery"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",{style:{cursor:b.processWithCloudimage?"not-allowed":"auto"}},k["common.upload"],i.a.createElement("input",{type:"radio",value:"upload",checked:"upload"===f,disabled:b.processWithCloudimage,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",null,k["common.url"],i.a.createElement("input",{type:"radio",value:"url",checked:"url"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",null,k["common.text"],i.a.createElement("input",{type:"radio",value:"text",checked:"text"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null))),i.a.createElement(zn,null,i.a.createElement(Mn,null,y&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"url"},"Watermark Gallery"),i.a.createElement(il,{width:"100%",list:o,valueProp:"url",id:"gallery",value:r,style:{width:"calc(100% - 120px)"},onChange:function(t){e.changeURL({target:{value:t}})}})),w&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"url"},"Watermark URL"),i.a.createElement(mt,{id:"url",value:r,style:{width:"calc(100% - 120px)"},onChange:this.changeURL})),v&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"image-upload"},"Watermark Image"),i.a.createElement(gt,{id:"image-upload",style:{width:"calc(100% - 120px)"},onChange:this.readFile})),x&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"text"},"Watermark Text"),i.a.createElement(mt,{id:"text",value:p,style:{width:"calc(65% - 135px)",minWidth:120},name:"text",onChange:this.changeTextProperty}),i.a.createElement(il,{list:b.processWithCloudimage?pr:g,valueProp:"value",id:"textFont",value:h,style:{width:111,display:"inline-block",marginLeft:8},onChange:function(t){return e.changeTextProperty({target:{name:"textFont",value:t}})}}),i.a.createElement(mt,{value:m,type:"number",name:"textSize",style:{width:60,marginLeft:8},onChange:this.changeTextProperty}),i.a.createElement(mt,{value:d,type:"color",style:{width:30,marginLeft:8,padding:0,background:"transparent",boxShadow:"none"},name:"color",onChange:this.changeTextProperty}))),i.a.createElement(An,{switcherPosition:l?"right":"left"},l&&i.a.createElement(In,null,i.a.createElement("label",{htmlFor:"opacity",style:{minWidth:80}},"Opacity"),i.a.createElement(ha,{label:k["common.opacity"],min:0,max:1,step:.05,range:a,updateRange:this.changeOpacity})))),i.a.createElement(Bn,null,cr.map((function(t,n){return i.a.createElement(Nn,{key:t,value:t,active:t===c,clickable:s[n],onClick:function(){s[n]&&e.onPositionChange(t)}})}))),n&&u&&i.a.createElement(Fn,null,o.map((function(t){return i.a.createElement(Un,{key:t,src:t,onClick:function(){e.onChangeWatermark(t)}})}))))}}])&&fl(t.prototype,n),r&&fl(t,r),a}(o.Component);function yl(e){return(yl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xl(e){for(var t=1;t128?255-2*(255-e.r)*(255-t.r)/255:t.r*e.r*2/255,n.g=t.g>128?255-2*(255-e.g)*(255-t.g)/255:t.g*e.g*2/255,n.b=t.b>128?255-2*(255-e.b)*(255-t.b)/255:t.b*e.b*2/255,n})),Jc.register("difference",(function(e,t){return{r:e.r-t.r,g:e.g-t.g,b:e.b-t.b}})),Jc.register("addition",(function(e,t){return{r:t.r+e.r,g:t.g+e.g,b:t.b+e.b}})),Jc.register("exclusion",(function(e,t){return{r:128-2*(t.r-128)*(e.r-128)/255,g:128-2*(t.g-128)*(e.g-128)/255,b:128-2*(t.b-128)*(e.b-128)/255}})),Jc.register("softLight",(function(e,t){var n;return(n={}).r=t.r>128?255-(255-t.r)*(255-(e.r-128))/255:t.r*(e.r+128)/255,n.g=t.g>128?255-(255-t.g)*(255-(e.g-128))/255:t.g*(e.g+128)/255,n.b=t.b>128?255-(255-t.b)*(255-(e.b-128))/255:t.b*(e.b+128)/255,n})),Jc.register("lighten",(function(e,t){return{r:t.r>e.r?t.r:e.r,g:t.g>e.g?t.g:e.g,b:t.b>e.b?t.b:e.b}})),Jc.register("darken",(function(e,t){return{r:t.r>e.r?e.r:t.r,g:t.g>e.g?e.g:t.g,b:t.b>e.b?e.b:t.b}}));n(46);Caman.Plugin.register("crop",(function(e,t,n,r){var o;return null==n&&(n=0),null==r&&(r=0),o=document.createElement("canvas"),Kc.b.copyAttributes(this.canvas,o),o.width=e,o.height=t,o.getContext("2d").drawImage(this.canvas,n,r,e,t,0,0,e,t),this.cropCoordinates={x:n,y:r},this.cropped=!0,this.replaceCanvas(o)})),Caman.Plugin.register("resize",(function(e){var t;if(null==e&&(e=null),null!==e&&(null!=e.width||null!=e.height))return null==e.width?e.width=this.canvas.width*e.height/this.canvas.height:null==e.height&&(e.height=this.canvas.height*e.width/this.canvas.width),t=document.createElement("canvas"),Kc.b.copyAttributes(this.canvas,t),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,e.width,e.height),this.resized=!0,this.replaceCanvas(t);qc.a.error("Invalid or missing dimensions given for resize")})),Caman.Filter.register("crop",(function(){return this.processPlugin("crop",Array.prototype.slice.call(arguments,0))})),Caman.Filter.register("resize",(function(){return this.processPlugin("resize",Array.prototype.slice.call(arguments,0))}));var rs,os,is;n(47),n(48),n(49),n(50),n(51),n(52),n(53);rs=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],os=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],is=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},Caman.Plugin.register("compoundBlur",(function(e,t,n,r){var o,i,a,l=this.dimensions.width,c=this.dimensions.height,s=this.pixelData,u=e.data,f=l*c,p=[];for(o=0,i=0<=(a=f<<2);i?oa;i?o++:o--)p[o]=s[o];var d=0,h=r;for(r-=1;h-- >=0;){var m,g,b,v,y,w,x,k,S,C,E,O,_,P,T,j,R,D,M,A,I,z,B,L=t+.5|0;if(0!==L){L>256&&(L=256);var N=L+L+1,F=l-1,U=c-1,H=L+1,W=H*(H+1)/2,Y=new is,V=void 0,X=Y;for(o=1,m=1<=(g=N);m?og;m?o++:o--)X=X.next=new is,o===H&&(V=X);X.next=Y;var q=null,$=null,Q=M=0,K=rs[L],Z=os[L];for(D=0,A=0<=(I=c);A?DI;A?D++:D--){var G,J,ee,te,ne,re;for(_=w=b=T=k=y=0,P=H*(O=p[M]),x=H*(E=p[M+1]),v=H*(C=p[M+2]),T+=W*O,k+=W*E,y+=W*C,X=Y,o=0,G=0<=(J=H);G?oJ;G?o++:o--)X.r=O,X.g=E,X.b=C,X=X.next;for(o=1,ee=1<=(te=H);ee?ote;ee?o++:o--)S=M+((Fre;ne?R++:R--)p[M]=T*K>>Z,p[M+1]=k*K>>Z,p[M+2]=y*K>>Z,T-=P,k-=x,y-=v,P-=q.r,x-=q.g,v-=q.b,S=Q+((S=R+H)B;z?R++:R--){var oe,ie,ae,le,ce,se;for(w=b=_=k=y=T=0,P=H*(O=p[M=R<<2]),x=H*(E=p[M+1]),v=H*(C=p[M+2]),T+=W*O,k+=W*E,y+=W*C,X=Y,o=0,oe=0<=(ie=H);oe?oie;oe?o++:o--)X.r=O,X.g=E,X.b=C,X=X.next;var ue=l;for(o=1,ae=1<=(le=H);ae?ole;ae?o++:o--)M=ue+R<<2,T+=(X.r=O=p[M])*(j=H-o),k+=(X.g=E=p[M+1])*j,y+=(X.b=C=p[M+2])*j,_+=O,w+=E,b+=C,X=X.next,ose;ce?D++:D--)p[S=M<<2]=T*K>>Z,p[S+1]=k*K>>Z,p[S+2]=y*K>>Z,T-=P,k-=x,y-=v,P-=q.r,x-=q.g,v-=q.b,S=R+((S=D+H)-1;){var fe=o<<2,pe=(255&u[fe+2])/255*r,de=0|pe;if(de===d){var he=256*(pe-(0|pe)),me=256-he;s[fe]=s[fe]*me+p[fe]*he>>8,s[fe+1]=s[fe+1]*me+p[fe+1]*he>>8,s[fe+2]=s[fe+2]*me+p[fe+2]*he>>8}else de===d+1&&(s[fe]=p[fe],s[fe+1]=p[fe+1],s[fe+2]=p[fe+2])}d++}}return this})),Caman.Filter.register("tiltShift",(function(e){var t={center:{x:this.dimensions.width/2,y:this.dimensions.height/2},angle:45,focusWidth:200,startRadius:3,radiusFactor:1.5,steps:3};(e=Kc.b.extend(t,e)).angle*=Math.PI/180;var n=function(e,t,n,r,o,i,a){var l=document.createElement("canvas");l.width=e,l.height=t;var c=n+Math.cos(o)*i*.5,s=r+Math.sin(o)*i*.5,u=n-Math.cos(o)*i*.5,f=r-Math.sin(o)*i*.5,p=l.getContext("2d"),d=p.createLinearGradient(c,s,u,f);return a?(d.addColorStop(0,"white"),d.addColorStop(.5,"black"),d.addColorStop(1,"white")):(d.addColorStop(0,"white"),d.addColorStop(1,"black")),p.fillStyle=d,p.fillRect(0,0,e,t),p.getImageData(0,0,e,t)}(this.dimensions.width,this.dimensions.height,e.center.x,e.center.y,e.angle,e.focusWidth,!0);return this.processPlugin("compoundBlur",[n,e.startRadius,e.radiusFactor,e.steps])})),Caman.Filter.register("radialBlur",(function(e){var t={size:50,center:{x:this.dimensions.width/2,y:this.dimensions.height/2},startRadius:3,radiusFactor:1.5,steps:3,radius:null};(e=Kc.b.extend(t,e)).radius||(e.radius=this.dimensions.width-1?"&":"?")+(new Date).getTime()),u.setAttribute("crossOrigin","Anonymous"),u.src=e,e.startsWith("data:image/")||e.startsWith("blob:")||(u.src=u.src+(u.src.indexOf("?")>-1?"&version=":"?version=")+(new Date).getTime()),u.onload=function(){var e={width:u.width,height:u.height,ratio:u.width/u.height},n={activeBody:"preResize",isShowSpinner:!1,img:u,logoImage:f,imageName:s.indexOf("?")>-1?s.slice(0,s.indexOf("?")):s};if("manual"===o&&(i=u.height){var r=u.width/u.height,l={ratio:r,width:i,height:i/r};t.setState(ss(ss({preCanvasDimensions:ss({},l),canvasDimensions:ss({},l)},n),{},{activeBody:"preview",isPreResize:!0}))}else{var c=u.height/u.width,p={ratio:c,width:a/c,height:a};t.setState(ss(ss({preCanvasDimensions:ss({},p),canvasDimensions:ss({},p)},n),{},{activeBody:"preview",isPreResize:!0}))}else{var d,h=t.props.config.tools;1===h.length&&(d=h[0]),t.setState(ss(ss({},n),{},{activeBody:"preview",isPreResize:!1}),(function(){t.setState({activeTab:d})}))}}})),gs(hs(t),"determineImageType",(function(){var e=t.props.src;if(e instanceof Blob)t.setState({imageMime:e.type});else{var n=new XMLHttpRequest;n.open("GET",e),n.responseType="arraybuffer",n.onload=function(e){var n,r=e.target;t.setState({imageMime:(null===(n=Xc()(new Uint8Array(r.response)))||void 0===n?void 0:n.mime)||"image/svg+xml"})},n.send()}})),gs(hs(t),"updateState",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t._isMounted){var r=t.props.config.elementId,o=Rr(r);e.latestCanvasSize={width:o.width,height:o.height},t.setState(e,n)}})),gs(hs(t),"onRevert",(function(){var e=t.state,n=e.cancelLastOperation,r=e.activeTab;t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}),n(r,(function(){t.setState(ss({isHideCanvas:!1,isShowSpinner:!1},bs))}))})),gs(hs(t),"onAdjust",(function(e,n){(0,t.state.onAdjust)(e,n)})),gs(hs(t),"onRotate",(function(e,n,r,o){(0,t.state.onRotate)(e,n,r,o)})),gs(hs(t),"onFlip",(function(e){(0,t.state.flip)(e)})),gs(hs(t),"onSave",(function(){var e=t.state.saveImage;t.setState({isShowSpinner:!0}),e()})),gs(hs(t),"onDownloadImage",(function(){var e=t.props.onBeforeComplete,n=t.state,r=n.downloadImage,o=(0,n.getResultCanvas)();!e||e({status:"before-complete",canvas:o})?r((function(){t.props.onComplete({status:"success",canvas:o}),t.props.onClose(Cr)})):(t.props.onComplete({status:"success",canvas:o}),t.props.onClose(Sr))})),gs(hs(t),"onApplyEffects",(function(e){var n=t.state,r=n.applyCorrections,o=n.effect===e?null:e;t.setState({isShowSpinner:!0,effect:o},(function(){r((function(){t.setState({isShowSpinner:!1})}))}))})),gs(hs(t),"onApplyFilters",(function(e){var n=t.state,r=n.applyCorrections,o=n.filter===e?null:e;t.setState({isShowSpinner:!0,filter:o},(function(){r((function(){t.setState({isShowSpinner:!1})}))}))})),gs(hs(t),"handleSave",(function(){var e=t.state,n=e.processWithFilerobot,r=e.processWithCloudService;n||r?t.onSave():t.onDownloadImage()})),gs(hs(t),"apply",(function(e){var n=t.state,r=n.activeTab;(0,n.applyChanges)(r,e),t.setState({activeTab:null})})),gs(hs(t),"redoOperation",(function(e){var n=e.operationIndex,r=e.callback,o=void 0===r?function(){}:r,i=e.resetActiveTab,a=void 0===i||i,l=e.operationObject,c=void 0===l?{}:l,s=t.state.applyOperations;a?t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}):t.setState({isHideCanvas:!0,isShowSpinner:!0}),s(n,(function(){t.setState({isHideCanvas:!1,isShowSpinner:!1},o)}),c)})),gs(hs(t),"resetOperations",(function(){var e=t.state.resetAll;t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}),e((function(){t.setState(ss({isHideCanvas:!1,isShowSpinner:!1},bs))}))})),gs(hs(t),"onPreResize",(function(e){var n,r=t.props.config.tools;switch(1===r.length&&(n=r[0]),e){case"keep":t.setState({canvasDimensions:{},isPreResize:!1,activeBody:"preview"},(function(){t.setState({activeTab:n})}));break;case"resize":var o=t.state.canvasDimensions;t.setState({preCanvasDimensions:o,isPreResize:!0,activeBody:"preview"},(function(){t.setState({activeTab:n})}))}}));var n=e.config,r=n.processWithCloudimage,i=n.processWithFilerobot,l=n.processWithCloudService,c=n.uploadWithCloudimageLink,s=n.reduceBeforeEdit,u=n.cropBeforeEdit,f=n.watermark,p=n.imageSealing;return t.state=ss(ss({isShowSpinner:!0,isHideCanvas:!1,activeTab:null,activeBody:null,currentOperation:null,original:{width:300,height:200},cropDetails:{width:300,height:200},canvasDimensions:{width:300,height:200,ratio:1.5},processWithFilerobot:i,processWithCloudimage:r,processWithCloudService:l,uploadCloudimageImage:c,reduceBeforeEdit:s,cropBeforeEdit:u,roundCrop:!1,imageSealing:ss({enabled:!1,salt:"",char_count:10,include_params:null},p),operationsOriginal:[],operationsZoomed:[],operations:[],canvasZoomed:null,canvasOriginal:null,isPreResize:!1,initialZoom:1},bs),{},{watermark:f||ur,focusPoint:{x:null,y:null},shapes:[],selectedShape:{},availableShapes:[]}),t}return t=a,(n=[{key:"componentDidMount",value:function(){this._isMounted=!0,this.loadImage(),this.determineImageType()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"render",value:function(){var e=this.state,t=e.isShowSpinner,n=e.activeTab,r=e.operations,o=e.operationsOriginal,a=e.operationsZoomed,l=e.currentOperation,c=e.isHideCanvas,s=e.cropDetails,u=e.original,f=e.canvasDimensions,p=e.processWithCloudimage,d=e.processWithFilerobot,h=e.processWithCloudService,m=e.uploadCloudimageImage,g=e.imageMime,b=e.lastOperation,v=e.operationList,y=e.initialZoom,w=e.canvasZoomed,x=e.canvasOriginal,k=e.reduceBeforeEdit,S=e.cropBeforeEdit,C=e.img,E=e.imageName,O=e.activeBody,_=e.isPreResize,P=e.preCanvasDimensions,T=e.logoImage,j=e.imageSealing,R=e.effect,D=e.filter,M=e.crop,A=e.roundCrop,I=e.resize,z=e.rotate,L=e.correctionDegree,N=e.flipX,F=e.flipY,U=e.adjust,H=e.watermark,W=e.focusPoint,Y=e.shapes,V=e.shapeOperations,X=e.selectedShape,q=e.availableShapes,$=e.latestCanvasSize,Q=this.props,K=Q.src,Z=Q.config,G=Q.onClose,J=Q.onComplete,ee=Q.closeOnLoad,te=void 0===ee||ee,ne=Q.t,re=void 0===ne?{}:ne,oe=Q.theme,ie={effect:R,filter:D,crop:M,resize:I,rotate:z,flipX:N,flipY:F,adjust:U,correctionDegree:L},ae=ss(ss({t:re,theme:oe,cropDetails:s,original:u,activeTab:n,src:K,onClose:G,config:Z,canvasDimensions:f,processWithCloudimage:p,processWithFilerobot:d,processWithCloudService:h,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,isShowSpinner:t,img:C,logoImage:T,imageName:E,activeBody:O,preCanvasDimensions:P,updateState:this.updateState,onRevert:this.onRevert,apply:this.apply,onSave:this.onSave,onFlip:this.onFlip,onApplyEffects:this.onApplyEffects,onApplyFilters:this.onApplyFilters,onRotate:this.onRotate,onAdjust:this.onAdjust,onDownloadImage:this.onDownloadImage,handleSave:this.handleSave},ie),{},{watermark:H,focusPoint:W,shapes:Y,shapeOperations:V,selectedShape:X,availableShapes:q}),le=ss(ss({t:re,theme:oe,cropDetails:s,original:u,activeTab:n,isShowSpinner:t,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,currentOperation:l,isHideCanvas:c,src:K,imageMime:g,onClose:G,onComplete:J,canvasDimensions:f,closeOnLoad:te,config:Z,processWithCloudimage:p,processWithFilerobot:d,processWithCloudService:h,imageSealing:j,uploadCloudimageImage:m,lastOperation:b,operationList:v,canvasZoomed:w,canvasOriginal:x,reduceBeforeEdit:k,cropBeforeEdit:S,img:C,logoImage:T,imageName:E,isPreResize:_,preCanvasDimensions:P,updateState:this.updateState,handleSave:this.handleSave,onPreResize:this.onPreResize,redoOperation:this.redoOperation,roundCrop:A},ie),{},{watermark:H,focusPoint:W,shapes:Y,shapeOperations:V,selectedShape:X,latestCanvasSize:$}),ce={logoImage:T,t:re,theme:oe,activeBody:O,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,currentOperation:l,processWithCloudimage:p,processWithCloudService:h,updateState:this.updateState,redoOperation:this.redoOperation,resetOperations:this.resetOperations,config:Z,watermark:H};return i.a.createElement(B,{roundCrop:A,isLoading:t},i.a.createElement(Yc,ae),i.a.createElement(we,null,"preview"===O&&i.a.createElement(Lo,le),"preResize"===O&&i.a.createElement(Ko,le),i.a.createElement(yn,{overlay:!0,show:t,label:re["spinner.label"]})),i.a.createElement(Jn,ce))}}])&&us(t.prototype,n),r&&us(t,r),a}(o.Component);function ys(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\e90c'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e90c'\n }\n"]);return ys=function(){return e},e}var ws=a.b.span.attrs((function(){return{role:"button"}}))(ys(),(function(e){return e.t||"10px"}),(function(e){return e.r||"10px"}),(function(e){return e.l||"auto"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"18px"}),(function(){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function xs(e){return(xs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ks(){return(ks=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Cs(e,t){for(var n=0;n div {\n padding: 40px !important;\n }\n \n * {\n color: black !important;\n }\n ":""}));var Bs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Es(e,t)}(c,e);var t,n,a,l=Os(c);function c(e){var t,n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),t=l.call(this,e),n=Ps(t),o=function(e){var n=t.props.onClose,r=void 0===n?function(){}:n;27===e.keyCode&&(e.stopPropagation(),r(xr))},(r="handleOutsideMouseClick")in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,t.root=document.createElement("div"),t.root.classList.add("filerobot-image-editor-root"),t.root.id="filerobot-image-editor-root",document.body.appendChild(t.root);var i=t.props.closeOnOutsideClick;return(void 0===i||i)&&document.addEventListener("keydown",t.handleOutsideMouseClick),t}return t=c,(n=[{key:"componentWillUnmount",value:function(){var e=this.props.closeOnOutsideClick,t=void 0===e||e;document.body.removeChild(this.root),t&&document.removeEventListener("keydown",this.handleOutsideMouseClick)}},{key:"render",value:function(){var e=this.props,t=e.onClose,n=void 0===t?function(){}:t,a=e.isHideCloseBtn,l=e.configModalId,c=Ss(e,["onClose","isHideCloseBtn","configModalId"]);return Object(r.createPortal)(i.a.createElement(o.Fragment,null,i.a.createElement(As,{className:"modal-overlay",onClick:function(){return n(kr)}}),i.a.createElement(zs,ks({id:l||tr},this.props),!a&&i.a.createElement(ws,{onClick:n}),i.a.createElement(Is,ks({h:"100%"},c),this.props.children))),this.root)}}])&&Cs(t.prototype,n),a&&Cs(t,a),c}(o.Component),Ls=(n(66),{en:{"header.image_editor_title":"Filerobot Image Editor","header.toggle_fullscreen":"Toggle fullscreen","header.close_modal":"Close window","toolbar.download":"Download","toolbar.save":"Save","toolbar.apply":"Apply","toolbar.cancel":"Cancel","toolbar.go_back":"Go Back","toolbar.adjust":"Adjust","toolbar.effects":"Effects","toolbar.filters":"Filters","toolbar.orientation":"Orientation","toolbar.crop":"Crop","toolbar.resize":"Resize","toolbar.watermark":"Watermark","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"Brightness","adjust.contrast":"Contrast","adjust.exposure":"Exposure","adjust.saturation":"Saturation","orientation.rotate_l":"Rotate Left","orientation.rotate_r":"Rotate Right","orientation.flip_h":"Flip Horizontally","orientation.flip_v":"Flip Vertically","pre_resize.title":"Would you like to reduce resolution before editing the image?","pre_resize.keep_original_resolution":"Keep original resolution","pre_resize.resize_n_continue":"Resize & Continue","footer.reset":"Reset","footer.undo":"Undo","footer.redo":"Redo","spinner.label":"Processing...","warning.too_big_resolution":"The resolution of the image is too big for the web. It can cause problems with Image Editor performance.","common.x":"x","common.y":"y","common.width":"width","common.height":"height","common.custom":"custom","common.original":"original","common.square":"square","common.opacity":"Opacity","common.apply_watermark":"Apply watermark","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery","common.text":"Text"},fr:{"header.image_editor_title":"Éditeur d'Image Filerobot","toolbar.download":"Télécharger","toolbar.save":"Sauvegarder","toolbar.apply":"Appliquer","toolbar.cancel":"Annuler","toolbar.go_back":"Retour","toolbar.adjust":"Ajuster","toolbar.effects":"Effets","toolbar.filters":"Filtres","toolbar.orientation":"Orientation","toolbar.crop":"Rogner","toolbar.resize":"Redimensionner","toolbar.watermark":"Watermark","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"Luminosité","adjust.contrast":"Contraste","adjust.exposure":"Exposition","adjust.saturation":"Saturation","orientation.rotate_l":"Rotation Gauche","orientation.rotate_r":"Rotation Droite","orientation.flip_h":"Miroir Horizontal","orientation.flip_v":"Miroir Vertical","pre_resize.title":"Voulez-vous réduire la résolution de l'image avant d'éditer l'image ?","pre_resize.keep_original_resolution":"Conserver la résolution d'origine","pre_resize.resize_n_continue":"Redimensionner et Continuer","footer.reset":"Réinitialiser","footer.undo":"Annuler","footer.redo":"Refaire","spinner.label":"Transformation...","warning.too_big_resolution":"La résolution de l'image est trop grande pour le web et peut endommager les performances de l'Éditeur d'Image Filerobot.","common.x":"x","common.y":"y","common.width":"largeur","common.height":"hauteur","common.custom":"custom","common.original":"original","common.square":"carré","common.opacity":"opacité","common.apply_watermark":"Appliquer watermark","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery"},"zh-cn":{"header.image_editor_title":"Filerobot 图片编辑器","toolbar.download":"下载","toolbar.save":"保存","toolbar.apply":"应用","toolbar.cancel":"取消","toolbar.go_back":"后退","toolbar.adjust":"调整","toolbar.effects":"效果","toolbar.filters":"滤镜","toolbar.orientation":"方向","toolbar.crop":"裁切","toolbar.resize":"缩放","toolbar.watermark":"水印","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"亮度","adjust.contrast":"对比对","adjust.exposure":"曝光度","adjust.saturation":"饱和度","orientation.rotate_l":"向左旋转","orientation.rotate_r":"向右旋转","orientation.flip_h":"水平翻转","orientation.flip_v":"垂直翻转","pre_resize.title":"是否需要在开始编辑之前缩小图片的分辨率?","pre_resize.keep_original_resolution":"保持原始分辨率","pre_resize.resize_n_continue":"缩小并继续","footer.reset":"重置","footer.undo":"撤销","footer.redo":"重做","spinner.label":"处理中...","warning.too_big_resolution":"图片的分辨率过大,这会严重影响图片编辑器的性能。","common.x":"x","common.y":"y","common.width":"宽度","common.height":"高度","common.custom":"自定义","common.original":"原始比例","common.square":"方形","common.banner":"通栏","common.opacity":"透明度","common.apply_watermark":"应用水印","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery"}}),Ns={colors:{primaryBg:"#1e262c",primaryBgHover:"#637381",secondaryBg:"#263138",secondaryBgHover:"#34444c",text:"#F9FAFB",textHover:"#fff",textMute:"#aaa",textWarn:"#f7931e",secondaryBgOpacity:"rgba(0, 0, 0, 0.75)",accent:"#00707c",border:"#161e23",borderLight:"#70777f",disabledBg:"rgba(255, 0, 0, 0.1)"}},Fs={colors:{primaryBg:"#f2f2f2",primaryBgHover:"#fff",secondaryBg:"#fff",secondaryBgHover:"#f9fafb",secondaryBgOpacity:"rgba(255,255,255, 0.75)",text:"#34444c",textHover:"#1a2329",textMute:"#aaa",textWarn:"#f7931e",accent:"#00707c",border:"#aeaeae",borderLight:"#e1e1e1",disabledBg:"rgba(255, 0, 0, 0.1)"}},Us="undefined"==typeof window||"undefined"==typeof CanvasRenderingContext2D;function Hs(e){return(Hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ys(e){for(var t=1;t-1})):n})})),Zs(Qs(t),"open",(function(e){var n=t.props.onOpen;t._isMounted&&t.setState({isVisible:!0,src:e},(function(){n&&n()}))})),Zs(Qs(t),"close",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yr,n=t.props.onClose,r="object"===Hs(e)?yr:e;t._isMounted&&t.setState({isVisible:!1},(function(){n&&n({status:r})}))})),s.translations=s.translations||{},s.language=s.translations[s.language]||Ls[s.language]?s.language:"en",s.theme=s.theme||{},s.theme.colors=s.theme.colors||{},s.theme.fonts=s.theme.fonts||fr,s.colorScheme=s.colorScheme||"dark",s.platform=s.platform||"filerobot";var u="object"===Hs(s.colorScheme);return t.state={isVisible:r,src:a,config:t.processConfig(s),t:Ys(Ys({},Ls[s.language]),s.translations[s.language]),colorScheme:u?"custom":s.colorScheme||"dark",theme:{colors:Ys(Ys({},(u?{colors:s.colorScheme}:"light"===s.colorScheme?Fs:Ns).colors),s.theme.colors),fonts:s.theme.fonts}},t}return t=l,(n=[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"componentDidUpdate",value:function(e){this.props.show!==e.show&&(this.props.show?this.open(this.props.src):this.close())}},{key:"render",value:function(){var e=this.state,t=e.isVisible,n=e.src,r=e.config,o=e.t,l=e.theme,c=this.props,s=c.onComplete,u=void 0===s?function(){}:s,f=c.onBeforeComplete,p=c.closeOnLoad,d=r.showInModal,h=void 0===d||d;if(!n||!t||Us)return null;if(n instanceof Blob&&r.processWithCloudimage)return null;var m=i.a.createElement(z,null,i.a.createElement(vs,{src:n,config:r,onComplete:u,onBeforeComplete:f,onClose:this.close,closeOnLoad:p,t:o}));return i.a.createElement(a.a,{theme:Ys({},l)},h?i.a.createElement(Bs,{noBorder:!0,fullScreen:"lg",isHideCloseBtn:!0,style:{borderRadius:5},onClose:this.close,configModalId:r.elementId},m):i.a.createElement("div",{className:"filerobot-image-editor-root",id:"filerobot-image-editor-root",style:{width:"100%",height:"100%"}},m))}}])&&Vs(t.prototype,n),r&&Vs(t,r),l}(o.Component);function Js(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}window.FilerobotImageEditor=function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Js(this,e),t=n.elementId?n.elementId:n.processWithCloudimage||n.cloudimage?"filerobot-image-editor-cloudimage":n.processWithFilerobot||n.filerobot?"filerobot-image-editor-uploader":"filerobot-image-editor";var l=document.getElementById(t),c=function(e){console.log(e)};c=o&&"function"==typeof o?o:(o=o||{}).onComplete||c,l||((l=document.createElement("div")).id=t,document.body.appendChild(l)),n.elementId=t;var s=function(e){return Object(r.render)(i.a.createElement(e,{show:a,config:n,onComplete:c,onBeforeComplete:o.onBeforeComplete,onOpen:o.onOpen,onClose:o.onClose}),l)};this.component=s(Gs),this.open=this.component.open,this.close=this.component.close,this.unmount=function(){return Object(r.unmountComponentAtNode)(l)}}}]); \ No newline at end of file diff --git a/build/3/filerobot-image-editor.min.js b/build/3/filerobot-image-editor.min.js index 9eaa4bf9..23094c3b 100644 --- a/build/3/filerobot-image-editor.min.js +++ b/build/3/filerobot-image-editor.min.js @@ -1,14 +1,14 @@ /*! * - * filerobot-image-editor v3.12.9 + * filerobot-image-editor v3.12.10 * https://github.com/scaleflex/filerobot-image-editor * * Copyright (c) 2019 scaleflex * Released under the MIT license * - * Date: 2020-12-23T06:54:55.099Z + * Date: 2021-01-04T08:51:05.866Z * - */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="https://cdn.scaleflex.it/plugins/filerobot-image-editor/3.12.9/",n(n.s=71)}([function(e,t,n){"use strict";e.exports=n(24)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Ve}));var r=n(7),o=n.n(r),i=n(14),a=n.n(i),l=n(0),c=n.n(l),s=n(15),u=n(8),f=n(9),p=(n(28),n(21)),d=n(22),h=function(e,t){for(var n=[e[0]],r=0,o=t.length;r1?r-1:0),i=1;i0?" Additional arguments: "+o.join(", "):"")));return w(a)}return y(t,e),t}(Error),R=/^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,D=function(e){var t=""+(e||""),n=[];return t.replace(R,(function(e,t,r){return n.push({componentId:t,matchIndex:r}),e})),n.map((function(e,r){var o=e.componentId,i=e.matchIndex,a=n[r+1];return{componentId:o,cssFromDOM:a?t.slice(i,a.matchIndex):t.slice(i)}}))},M=/^\s*\/\/.*$/gm,A=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!1,compress:!1,semicolon:!0}),I=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!1}),z=[],B=function(e){if(-2===e){var t=z;return z=[],t}},L=a()((function(e){z.push(e)})),N=void 0,F=void 0,U=void 0,H=function(e,t,n){return t>0&&-1!==n.slice(0,t).indexOf(F)&&n.slice(t-F.length,t)!==F?"."+N:e};I.use([function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(F)>0&&(n[0]=n[0].replace(U,H))},L,B]),A.use([L,B]);var W=function(e){return A("",e)};function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(M,""),i=t&&n?n+" "+t+" { "+o+" }":o;return N=r,F=t,U=new RegExp("\\"+F+"\\b","g"),I(n||!t?"":t,i)}var V=function(){return n.nc},X=function(e,t,n){n&&((e[t]||(e[t]=Object.create(null)))[n]=!0)},q=function(e,t){e[t]=Object.create(null)},$=function(e){return function(t,n){return void 0!==e[t]&&e[t][n]}},Q=function(e){var t="";for(var n in e)t+=Object.keys(e[n]).join(" ")+" ";return t.trim()},K=function(e){if(e.sheet)return e.sheet;for(var t=e.ownerDocument.styleSheets.length,n=0;n"+e()+""}},te=function(e,t){return function(){var n,r=((n={})[_]=Q(t),n["data-styled-version"]="4.4.1",n),o=V();return o&&(r.nonce=o),c.a.createElement("style",v({},r,{dangerouslySetInnerHTML:{__html:e()}}))}},ne=function(e){return function(){return Object.keys(e)}},re=function(e,t){return e.createTextNode(G(t))},oe=function e(t,n){var r=void 0===t?Object.create(null):t,o=void 0===n?Object.create(null):n,i=function(e){var t=o[e];return void 0!==t?t:o[e]=[""]},a=function(){var e="";for(var t in o){var n=o[t][0];n&&(e+=G(t)+n)}return e};return{clone:function(){var t=function(e){var t=Object.create(null);for(var n in e)t[n]=v({},e[n]);return t}(r),n=Object.create(null);for(var i in o)n[i]=[o[i][0]];return e(t,n)},css:a,getIds:ne(o),hasNameForId:$(r),insertMarker:i,insertRules:function(e,t,n){i(e)[0]+=t.join(" "),X(r,e,n)},removeRules:function(e){var t=o[e];void 0!==t&&(t[0]="",q(r,e))},sealed:!1,styleTag:null,toElement:te(a,r),toHTML:ee(a,r)}},ie=function(e,t,n,r,o){if(P&&!n){var i=function(e,t,n){var r=document;e?r=e.ownerDocument:t&&(r=t.ownerDocument);var o=r.createElement("style");o.setAttribute(_,""),o.setAttribute("data-styled-version","4.4.1");var i=V();if(i&&o.setAttribute("nonce",i),o.appendChild(r.createTextNode("")),e&&!t)e.appendChild(o);else{if(!t||!e||!t.parentNode)throw new j(6);t.parentNode.insertBefore(o,n?t:t.nextSibling)}return o}(e,t,r);return T?function(e,t){var n=Object.create(null),r=Object.create(null),o=void 0!==t,i=!1,a=function(t){var o=r[t];return void 0!==o?o:(r[t]=re(e.ownerDocument,t),e.appendChild(r[t]),n[t]=Object.create(null),r[t])},l=function(){var e="";for(var t in r)e+=r[t].data;return e};return{clone:function(){throw new j(5)},css:l,getIds:ne(r),hasNameForId:$(n),insertMarker:a,insertRules:function(e,r,l){for(var c=a(e),s=[],u=r.length,f=0;f0&&(i=!0,t().insertRules(e+"-import",s))},removeRules:function(a){var l=r[a];if(void 0!==l){var c=re(e.ownerDocument,a);e.replaceChild(c,l),r[a]=c,q(n,a),o&&i&&t().removeRules(a+"-import")}},sealed:!1,styleTag:e,toElement:te(l,n),toHTML:ee(l,n)}}(i,o):function(e,t){var n=Object.create(null),r=Object.create(null),o=[],i=void 0!==t,a=!1,l=function(e){var t=r[e];return void 0!==t?t:(r[e]=o.length,o.push(0),q(n,e),r[e])},c=function(){var t=K(e).cssRules,n="";for(var i in r){n+=G(i);for(var a=r[i],l=J(o,a),c=l-o[a];c0&&(a=!0,t().insertRules(r+"-import",h)),o[u]+=d,X(n,r,s)},removeRules:function(l){var c=r[l];if(void 0!==c&&!1!==e.isConnected){var s=o[c];!function(e,t,n){for(var r=t-n,o=t;o>r;o-=1)e.deleteRule(o)}(K(e),J(o,c)-1,s),o[c]=0,q(n,l),i&&a&&t().removeRules(l+"-import")}},sealed:!1,styleTag:e,toElement:te(c,n),toHTML:ee(c,n)}}(i,o)}return oe()},ae=/\s+/,le=void 0;le=P?T?40:1e3:-1;var ce=0,se=void 0,ue=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P?document.head:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g(this,e),this.getImportRuleTag=function(){var e=t.importRuleTag;if(void 0!==e)return e;var n=t.tags[0];return t.importRuleTag=ie(t.target,n?n.styleTag:null,t.forceServer,!0)},ce+=1,this.id=ce,this.forceServer=r,this.target=r?null:n,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!P||this.forceServer)return this;var e=[],t=[],n=!1,r=document.querySelectorAll("style["+_+'][data-styled-version="4.4.1"]'),o=r.length;if(!o)return this;for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];se=new e(void 0,t).rehydrate()},e.prototype.clone=function(){var t=new e(this.target,this.forceServer);return this.clones.push(t),t.tags=this.tags.map((function(e){for(var n=e.getIds(),r=e.clone(),o=0;o1?t-1:0),r=1;r=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return((r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16))^r>>>15)>>>0}var we=function(e){return String.fromCharCode(e+(e>25?39:97))};function xe(e){var t="",n=void 0;for(n=e;n>52;n=Math.floor(n/52))t=we(n%52)+t;return we(n%52)+t}function ke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:S,r=!!n&&e.theme===n.theme,o=e.theme&&!r?e.theme:t||n.theme;return o},_e=/[[\].#*$><+~=|^:(),"'`-]+/g,Pe=/(^-|-$)/g;function Te(e){return e.replace(_e,"-").replace(Pe,"")}function je(e){return"string"==typeof e&&!0}var Re={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},De={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Me=((Se={})[u.ForwardRef]={$$typeof:!0,render:!0},Se),Ae=Object.defineProperty,Ie=Object.getOwnPropertyNames,ze=Object.getOwnPropertySymbols,Be=void 0===ze?function(){return[]}:ze,Le=Object.getOwnPropertyDescriptor,Ne=Object.getPrototypeOf,Fe=Object.prototype,Ue=Array.prototype;function He(e,t,n){if("string"!=typeof t){var r=Ne(t);r&&r!==Fe&&He(e,r,n);for(var o=Ue.concat(Ie(t),Be(t)),i=Me[e.$$typeof]||Re,a=Me[t.$$typeof]||Re,l=o.length,c=void 0,s=void 0;l--;)if(s=o[l],!(De[s]||n&&n[s]||a&&a[s]||i&&i[s])&&(c=Le(t,s)))try{Ae(e,s,c)}catch(e){}return e}return e}var We=Object(l.createContext)(),Ye=We.Consumer,Ve=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext.bind(r)),r.renderInner=r.renderInner.bind(r),r}return y(t,e),t.prototype.render=function(){return this.props.children?c.a.createElement(We.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(e){var t=this.getContext(this.props.theme,e);return c.a.createElement(We.Provider,{value:t},this.props.children)},t.prototype.getTheme=function(e,t){if(C(e))return e(t);if(null===e||Array.isArray(e)||"object"!==(void 0===e?"undefined":m(e)))throw new j(8);return v({},t,e)},t.prototype.getContext=function(e,t){return this.getTheme(e,t)},t}(l.Component),Xe=(function(){function e(){g(this,e),this.masterSheet=ue.master,this.instance=this.masterSheet.clone(),this.sealed=!1}e.prototype.seal=function(){if(!this.sealed){var e=this.masterSheet.clones.indexOf(this.instance);this.masterSheet.clones.splice(e,1),this.sealed=!0}},e.prototype.collectStyles=function(e){if(this.sealed)throw new j(2);return c.a.createElement($e,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.seal(),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.seal(),this.instance.toReactElements()},e.prototype.interleaveWithNodeStream=function(e){throw new j(3)}}(),Object(l.createContext)()),qe=Xe.Consumer,$e=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext),r}return y(t,e),t.prototype.getContext=function(e,t){if(e)return e;if(t)return new ue(t);throw new j(4)},t.prototype.render=function(){var e=this.props,t=e.children,n=e.sheet,r=e.target;return c.a.createElement(Xe.Provider,{value:this.getContext(n,r)},t)},t}(l.Component),Qe={};var Ke=function(e){function t(){g(this,t);var n=w(this,e.call(this));return n.attrs={},n.renderOuter=n.renderOuter.bind(n),n.renderInner=n.renderInner.bind(n),n}return y(t,e),t.prototype.render=function(){return c.a.createElement(qe,null,this.renderOuter)},t.prototype.renderOuter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue.master;return this.styleSheet=e,this.props.forwardedComponent.componentStyle.isStatic?this.renderInner():c.a.createElement(Ye,null,this.renderInner)},t.prototype.renderInner=function(e){var t=this.props.forwardedComponent,n=t.componentStyle,r=t.defaultProps,o=(t.displayName,t.foldedComponentIds),i=t.styledComponentId,a=t.target,c=void 0;c=n.isStatic?this.generateAndInjectStyles(S,this.props):this.generateAndInjectStyles(Oe(this.props,e,r)||S,this.props);var s=this.props.as||this.attrs.as||a,u=je(s),f={},d=v({},this.props,this.attrs),h=void 0;for(h in d)"forwardedComponent"!==h&&"as"!==h&&("forwardedRef"===h?f.ref=d[h]:"forwardedAs"===h?f.as=d[h]:u&&!Object(p.a)(h)||(f[h]=d[h]));return this.props.style&&this.attrs.style&&(f.style=v({},this.attrs.style,this.props.style)),f.className=Array.prototype.concat(o,i,c!==i?c:null,this.props.className,this.attrs.className).filter(Boolean).join(" "),Object(l.createElement)(s,f)},t.prototype.buildExecutionContext=function(e,t,n){var r=this,o=v({},t,{theme:e});return n.length?(this.attrs={},n.forEach((function(e){var t,n=e,i=!1,a=void 0,l=void 0;for(l in C(n)&&(n=n(o),i=!0),n)a=n[l],i||!C(a)||(t=a)&&t.prototype&&t.prototype.isReactComponent||O(a)||(a=a(o)),r.attrs[l]=a,o[l]=a})),o):o},t.prototype.generateAndInjectStyles=function(e,t){var n=t.forwardedComponent,r=n.attrs,o=n.componentStyle;n.warnTooManyClasses;return o.isStatic&&!r.length?o.generateAndInjectStyles(S,this.styleSheet):o.generateAndInjectStyles(this.buildExecutionContext(e,t,r),this.styleSheet)},t}(l.Component);function Ze(e,t,n){var r=O(e),o=!je(e),i=t.displayName,a=void 0===i?function(e){return je(e)?"styled."+e:"Styled("+E(e)+")"}(e):i,l=t.componentId,s=void 0===l?function(e,t,n){var r="string"!=typeof t?"sc":Te(t),o=(Qe[r]||0)+1;Qe[r]=o;var i=r+"-"+e.generateName(r+o);return n?n+"-"+i:i}(Ee,t.displayName,t.parentComponentId):l,u=t.ParentComponent,f=void 0===u?Ke:u,p=t.attrs,h=void 0===p?k:p,m=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||s,g=r&&e.attrs?Array.prototype.concat(e.attrs,h).filter(Boolean):h,b=new Ee(r?e.componentStyle.rules.concat(n):n,g,m),y=void 0,w=function(e,t){return c.a.createElement(f,v({},e,{forwardedComponent:y,forwardedRef:t}))};return w.displayName=a,(y=c.a.forwardRef(w)).displayName=a,y.attrs=g,y.componentStyle=b,y.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):k,y.styledComponentId=m,y.target=r?e.target:e,y.withComponent=function(e){var r=t.componentId,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["componentId"]),i=r&&r+"-"+(je(e)?e:Te(E(e)));return Ze(e,v({},o,{attrs:g,componentId:i,ParentComponent:f}),n)},Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Object(d.a)(e.defaultProps,t):t}}),y.toString=function(){return"."+y.styledComponentId},o&&He(y,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,styledComponentId:!0,target:!0,withComponent:!0}),y}var Ge=function(e){return function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;if(!Object(u.isValidElementType)(n))throw new j(1,String(n));var o=function(){return t(n,r,ve.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,v({},r,o))},o.attrs=function(o){return e(t,n,v({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Ge[e]=Ge(e)}));!function(){function e(t,n){g(this,e),this.rules=t,this.componentId=n,this.isStatic=ke(t,k),ue.master.hasId(n)||ue.master.deferredInject(n,[])}e.prototype.createStyles=function(e,t){var n=Y(be(this.rules,e,t),"");t.inject(this.componentId,n)},e.prototype.removeStyles=function(e){var t=this.componentId;e.hasId(t)&&e.remove(t)},e.prototype.renderStyles=function(e,t){this.removeStyles(t),this.createStyles(e,t)}}();P&&(window.scCGSHMRCache={});t.b=Ge}).call(this,n(12))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1?n-1:0),o=1;o255?255:e}},{key:"copyAttributes",value:function(e,t,n){return null==n&&(n={}),function(){for(var r=[],o=0,i=Array.from(e.attributes);oe?d():!0!==t&&(o=setTimeout(r?h:d,void 0===r?e-p:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),c.cancel=function(){l(),i=!0},c}e.debounce=function(e,n,r){return void 0===r?t(e,n,!1):t(e,r,!1!==n)},e.throttle=t,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(23)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n])/g,v=/([[}=:>])\s+/g,y=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,x=/([^\(])(:+) */g,k=/[svh]\w+-[tblr]{2}/,S=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,E=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,T="-webkit-",j="-moz-",R="-ms-",D=59,M=125,A=123,I=40,z=41,B=10,L=13,N=32,F=45,U=42,H=44,W=58,Y=47,V=1,X=1,q=0,$=1,Q=1,K=1,Z=0,G=0,J=0,ee=[],te=[],ne=0,re=null,oe=0,ie=1,ae="",le="",ce="";function se(e,t,o,i,a){for(var l,c,u=0,f=0,p=0,d=0,b=0,v=0,y=0,w=0,k=0,C=0,E=0,O=0,_=0,P=0,j=0,R=0,Z=0,te=0,re=0,fe=o.length,be=fe-1,ve="",ye="",we="",xe="",ke="",Se="";j0&&(ye=ye.replace(r,"")),ye.trim().length>0)){switch(y){case N:case 9:case D:case L:case B:break;default:ye+=o.charAt(j)}y=D}if(1===Z)switch(y){case A:case M:case D:case 34:case 39:case I:case z:case H:Z=0;case 9:case L:case B:case N:break;default:for(Z=0,re=j,b=y,j--,y=D;re0&&(++j,y=b);case A:re=fe}}switch(y){case A:for(b=(ye=ye.trim()).charCodeAt(0),E=1,re=++j;j0&&(ye=ye.replace(r,"")),v=ye.charCodeAt(1)){case 100:case 109:case 115:case F:l=t;break;default:l=ee}if(re=(we=se(t,l,we,v,a+1)).length,J>0&&0===re&&(re=ye.length),ne>0&&(c=me(3,we,l=ue(ee,ye,te),t,X,V,re,v,a,i),ye=l.join(""),void 0!==c&&0===(re=(we=c.trim()).length)&&(v=0,we="")),re>0)switch(v){case 115:ye=ye.replace(S,he);case 100:case 109:case F:we=ye+"{"+we+"}";break;case 107:we=(ye=ye.replace(h,"$1 $2"+(ie>0?ae:"")))+"{"+we+"}",we=1===Q||2===Q&&de("@"+we,3)?"@"+T+we+"@"+we:"@"+we;break;default:we=ye+we,112===i&&(xe+=we,we="")}else we="";break;default:we=se(t,ue(t,ye,te),we,i,a+1)}ke+=we,O=0,Z=0,P=0,R=0,te=0,_=0,ye="",we="",y=o.charCodeAt(++j);break;case M:case D:if((re=(ye=(R>0?ye.replace(r,""):ye).trim()).length)>1)switch(0===P&&((b=ye.charCodeAt(0))===F||b>96&&b<123)&&(re=(ye=ye.replace(" ",":")).length),ne>0&&void 0!==(c=me(1,ye,t,e,X,V,xe.length,i,a,i))&&0===(re=(ye=c.trim()).length)&&(ye="\0\0"),b=ye.charCodeAt(0),v=ye.charCodeAt(1),b){case 0:break;case 64:if(105===v||99===v){Se+=ye+o.charAt(j);break}default:if(ye.charCodeAt(re-1)===W)break;xe+=pe(ye,b,v,ye.charCodeAt(2))}O=0,Z=0,P=0,R=0,te=0,ye="",y=o.charCodeAt(++j)}}switch(y){case L:case B:if(f+d+p+u+G===0)switch(C){case z:case 39:case 34:case 64:case 126:case 62:case U:case 43:case Y:case F:case W:case H:case D:case A:case M:break;default:P>0&&(Z=1)}f===Y?f=0:$+O===0&&107!==i&&ye.length>0&&(R=1,ye+="\0"),ne*oe>0&&me(0,ye,t,e,X,V,xe.length,i,a,i),V=1,X++;break;case D:case M:if(f+d+p+u===0){V++;break}default:switch(V++,ve=o.charAt(j),y){case 9:case N:if(d+u+f===0)switch(w){case H:case W:case 9:case N:ve="";break;default:y!==N&&(ve=" ")}break;case 0:ve="\\0";break;case 12:ve="\\f";break;case 11:ve="\\v";break;case 38:d+f+u===0&&$>0&&(te=1,R=1,ve="\f"+ve);break;case 108:if(d+f+u+q===0&&P>0)switch(j-P){case 2:112===w&&o.charCodeAt(j-3)===W&&(q=w);case 8:111===k&&(q=k)}break;case W:d+f+u===0&&(P=j);break;case H:f+p+d+u===0&&(R=1,ve+="\r");break;case 34:case 39:0===f&&(d=d===y?0:0===d?y:d);break;case 91:d+f+p===0&&u++;break;case 93:d+f+p===0&&u--;break;case z:d+f+u===0&&p--;break;case I:if(d+f+u===0){if(0===O)switch(2*w+3*k){case 533:break;default:E=0,O=1}p++}break;case 64:f+p+d+u+P+_===0&&(_=1);break;case U:case Y:if(d+u+p>0)break;switch(f){case 0:switch(2*y+3*o.charCodeAt(j+1)){case 235:f=Y;break;case 220:re=j,f=U}break;case U:y===Y&&w===U&&re+2!==j&&(33===o.charCodeAt(re+2)&&(xe+=o.substring(re,j+1)),ve="",f=0)}}if(0===f){if($+d+u+_===0&&107!==i&&y!==D)switch(y){case H:case 126:case 62:case 43:case z:case I:if(0===O){switch(w){case 9:case N:case B:case L:ve+="\0";break;default:ve="\0"+ve+(y===H?"":"\0")}R=1}else switch(y){case I:P+7===j&&108===w&&(P=0),O=++E;break;case z:0==(O=--E)&&(R=1,ve+="\0")}break;case 9:case N:switch(w){case 0:case A:case M:case D:case H:case 12:case 9:case N:case B:case L:break;default:0===O&&(R=1,ve+="\0")}}ye+=ve,y!==N&&9!==y&&(C=y)}}k=w,w=y,j++}if(re=xe.length,J>0&&0===re&&0===ke.length&&0===t[0].length==0&&(109!==i||1===t.length&&($>0?le:ce)===t[0])&&(re=t.join(",").length+2),re>0){if(l=0===$&&107!==i?function(e){for(var t,n,o=0,i=e.length,a=Array(i);o1)){if(p=c.charCodeAt(c.length-1),d=n.charCodeAt(0),t="",0!==u)switch(p){case U:case 126:case 62:case 43:case N:case I:break;default:t=" "}switch(d){case 38:n=t+le;case 126:case 62:case 43:case N:case z:case I:break;case 91:n=t+n+le;break;case W:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(K>0){n=t+n.substring(8,f-1);break}default:(u<1||l[u-1].length<1)&&(n=t+le+n)}break;case H:t="";default:n=f>1&&n.indexOf(":")>0?t+n.replace(x,"$1"+le+"$2"):t+n+le}c+=n}a[o]=c.replace(r,"").trim()}return a}(t):t,ne>0&&void 0!==(c=me(2,xe,l,e,X,V,re,i,a,i))&&0===(xe=c).length)return Se+xe+ke;if(xe=l.join(",")+"{"+xe+"}",Q*q!=0){switch(2!==Q||de(xe,2)||(q=0),q){case 111:xe=xe.replace(g,":-moz-$1")+xe;break;case 112:xe=xe.replace(m,"::"+T+"input-$1")+xe.replace(m,"::-moz-$1")+xe.replace(m,":-ms-input-$1")+xe}q=0}}return Se+xe+ke}function ue(e,t,n){var r=t.trim().split(u),o=r,i=r.length,a=e.length;switch(a){case 0:case 1:for(var l=0,c=0===a?"":e[0]+" ";l0&&$>0)return o.replace(p,"$1").replace(f,"$1"+ce);break;default:return e.trim()+o.replace(f,"$1"+e.trim())}default:if(n*$>0&&o.indexOf("\f")>0)return o.replace(f,(e.charCodeAt(0)===W?"":"$1")+e.trim())}return e+o}function pe(e,t,n,r){var s,u=0,f=e+";",p=2*t+3*n+4*r;if(944===p)return function(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim();switch(e.charCodeAt(9)*ie){case 0:break;case F:if(110!==e.charCodeAt(10))break;default:var i=o.split((o="",l)),a=0;for(n=0,t=i.length;a64&&f<90||f>96&&f<123||95===f||f===F&&s.charCodeAt(1)!==F))switch(isNaN(parseFloat(s))+(-1!==s.indexOf("("))){case 1:switch(s){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:s+=ae}}u[n++]=s}o+=(0===a?"":",")+u.join(" ")}}return o=r+o+";",1===Q||2===Q&&de(o,1)?T+o+o:o}(f);if(0===Q||2===Q&&!de(f,1))return f;switch(p){case 1015:return 97===f.charCodeAt(10)?T+f+f:f;case 951:return 116===f.charCodeAt(3)?T+f+f:f;case 963:return 110===f.charCodeAt(5)?T+f+f:f;case 1009:if(100!==f.charCodeAt(4))break;case 969:case 942:return T+f+f;case 978:return T+f+j+f+f;case 1019:case 983:return T+f+j+f+R+f+f;case 883:return f.charCodeAt(8)===F?T+f+f:f.indexOf("image-set(",11)>0?f.replace(P,"$1"+T+"$2")+f:f;case 932:if(f.charCodeAt(4)===F)switch(f.charCodeAt(5)){case 103:return T+"box-"+f.replace("-grow","")+T+f+R+f.replace("grow","positive")+f;case 115:return T+f+R+f.replace("shrink","negative")+f;case 98:return T+f+R+f.replace("basis","preferred-size")+f}return T+f+R+f+f;case 964:return T+f+R+"flex-"+f+f;case 1023:if(99!==f.charCodeAt(8))break;return s=f.substring(f.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),T+"box-pack"+s+T+f+R+"flex-pack"+s+f;case 1005:return i.test(f)?f.replace(o,":"+T)+f.replace(o,":"+j)+f:f;case 1e3:switch(u=(s=f.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(u)){case 226:s=f.replace(k,"tb");break;case 232:s=f.replace(k,"tb-rl");break;case 220:s=f.replace(k,"lr");break;default:return f}return T+f+R+s+f;case 1017:if(-1===f.indexOf("sticky",9))return f;case 975:switch(u=(f=e).length-10,p=(s=(33===f.charCodeAt(u)?f.substring(0,u):f).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(s.charCodeAt(8)<111)break;case 115:f=f.replace(s,T+s)+";"+f;break;case 207:case 102:f=f.replace(s,T+(p>102?"inline-":"")+"box")+";"+f.replace(s,T+s)+";"+f.replace(s,R+s+"box")+";"+f}return f+";";case 938:if(f.charCodeAt(5)===F)switch(f.charCodeAt(6)){case 105:return s=f.replace("-items",""),T+f+T+"box-"+s+R+"flex-"+s+f;case 115:return T+f+R+"flex-item-"+f.replace(E,"")+f;default:return T+f+R+"flex-line-pack"+f.replace("align-content","").replace(E,"")+f}break;case 973:case 989:if(f.charCodeAt(3)!==F||122===f.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?pe(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):f.replace(s,T+s)+f.replace(s,j+s.replace("fill-",""))+f;break;case 962:if(f=T+f+(102===f.charCodeAt(5)?R+f:"")+f,n+r===211&&105===f.charCodeAt(13)&&f.indexOf("transform",10)>0)return f.substring(0,f.indexOf(";",27)+1).replace(a,"$1"+T+"$2")+f}return f}function de(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10),o=e.substring(n+1,e.length-1);return re(2!==t?r:r.replace(O,"$1"),o,t)}function he(e,t){var n=pe(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(C," or ($1)").substring(4):"("+t+")"}function me(e,t,n,r,o,i,a,l,c,s){for(var u,f=0,p=t;f0&&(ae=o.replace(d,91===i?"":"-")),i=1,1===$?ce=o:le=o;var a,l=[ce];ne>0&&void 0!==(a=me(-1,n,l,l,X,V,0,0,0,0))&&"string"==typeof a&&(n=a);var c=se(ee,l,n,0,0);return ne>0&&void 0!==(a=me(-2,c,l,l,X,V,c.length,0,0,0))&&"string"!=typeof(c=a)&&(i=0),ae="",ce="",le="",q=0,X=1,V=1,Z*i==0?c:c.replace(r,"").replace(b,"").replace(v,"$1").replace(y,"$1").replace(w," ")}return ve.use=function e(t){switch(t){case void 0:case null:ne=te.length=0;break;default:if("function"==typeof t)te[ne++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n1?r-1:0),i=1;i0?" Additional arguments: "+o.join(", "):"")));return w(a)}return y(t,e),t}(Error),R=/^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,D=function(e){var t=""+(e||""),n=[];return t.replace(R,(function(e,t,r){return n.push({componentId:t,matchIndex:r}),e})),n.map((function(e,r){var o=e.componentId,i=e.matchIndex,a=n[r+1];return{componentId:o,cssFromDOM:a?t.slice(i,a.matchIndex):t.slice(i)}}))},M=/^\s*\/\/.*$/gm,A=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!1,compress:!1,semicolon:!0}),I=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!1}),z=[],B=function(e){if(-2===e){var t=z;return z=[],t}},L=a()((function(e){z.push(e)})),N=void 0,F=void 0,U=void 0,H=function(e,t,n){return t>0&&-1!==n.slice(0,t).indexOf(F)&&n.slice(t-F.length,t)!==F?"."+N:e};I.use([function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(F)>0&&(n[0]=n[0].replace(U,H))},L,B]),A.use([L,B]);var W=function(e){return A("",e)};function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(M,""),i=t&&n?n+" "+t+" { "+o+" }":o;return N=r,F=t,U=new RegExp("\\"+F+"\\b","g"),I(n||!t?"":t,i)}var V=function(){return n.nc},X=function(e,t,n){n&&((e[t]||(e[t]=Object.create(null)))[n]=!0)},q=function(e,t){e[t]=Object.create(null)},$=function(e){return function(t,n){return void 0!==e[t]&&e[t][n]}},Q=function(e){var t="";for(var n in e)t+=Object.keys(e[n]).join(" ")+" ";return t.trim()},K=function(e){if(e.sheet)return e.sheet;for(var t=e.ownerDocument.styleSheets.length,n=0;n"+e()+""}},te=function(e,t){return function(){var n,r=((n={})[_]=Q(t),n["data-styled-version"]="4.4.1",n),o=V();return o&&(r.nonce=o),c.a.createElement("style",v({},r,{dangerouslySetInnerHTML:{__html:e()}}))}},ne=function(e){return function(){return Object.keys(e)}},re=function(e,t){return e.createTextNode(G(t))},oe=function e(t,n){var r=void 0===t?Object.create(null):t,o=void 0===n?Object.create(null):n,i=function(e){var t=o[e];return void 0!==t?t:o[e]=[""]},a=function(){var e="";for(var t in o){var n=o[t][0];n&&(e+=G(t)+n)}return e};return{clone:function(){var t=function(e){var t=Object.create(null);for(var n in e)t[n]=v({},e[n]);return t}(r),n=Object.create(null);for(var i in o)n[i]=[o[i][0]];return e(t,n)},css:a,getIds:ne(o),hasNameForId:$(r),insertMarker:i,insertRules:function(e,t,n){i(e)[0]+=t.join(" "),X(r,e,n)},removeRules:function(e){var t=o[e];void 0!==t&&(t[0]="",q(r,e))},sealed:!1,styleTag:null,toElement:te(a,r),toHTML:ee(a,r)}},ie=function(e,t,n,r,o){if(P&&!n){var i=function(e,t,n){var r=document;e?r=e.ownerDocument:t&&(r=t.ownerDocument);var o=r.createElement("style");o.setAttribute(_,""),o.setAttribute("data-styled-version","4.4.1");var i=V();if(i&&o.setAttribute("nonce",i),o.appendChild(r.createTextNode("")),e&&!t)e.appendChild(o);else{if(!t||!e||!t.parentNode)throw new j(6);t.parentNode.insertBefore(o,n?t:t.nextSibling)}return o}(e,t,r);return T?function(e,t){var n=Object.create(null),r=Object.create(null),o=void 0!==t,i=!1,a=function(t){var o=r[t];return void 0!==o?o:(r[t]=re(e.ownerDocument,t),e.appendChild(r[t]),n[t]=Object.create(null),r[t])},l=function(){var e="";for(var t in r)e+=r[t].data;return e};return{clone:function(){throw new j(5)},css:l,getIds:ne(r),hasNameForId:$(n),insertMarker:a,insertRules:function(e,r,l){for(var c=a(e),s=[],u=r.length,f=0;f0&&(i=!0,t().insertRules(e+"-import",s))},removeRules:function(a){var l=r[a];if(void 0!==l){var c=re(e.ownerDocument,a);e.replaceChild(c,l),r[a]=c,q(n,a),o&&i&&t().removeRules(a+"-import")}},sealed:!1,styleTag:e,toElement:te(l,n),toHTML:ee(l,n)}}(i,o):function(e,t){var n=Object.create(null),r=Object.create(null),o=[],i=void 0!==t,a=!1,l=function(e){var t=r[e];return void 0!==t?t:(r[e]=o.length,o.push(0),q(n,e),r[e])},c=function(){var t=K(e).cssRules,n="";for(var i in r){n+=G(i);for(var a=r[i],l=J(o,a),c=l-o[a];c0&&(a=!0,t().insertRules(r+"-import",h)),o[u]+=d,X(n,r,s)},removeRules:function(l){var c=r[l];if(void 0!==c&&!1!==e.isConnected){var s=o[c];!function(e,t,n){for(var r=t-n,o=t;o>r;o-=1)e.deleteRule(o)}(K(e),J(o,c)-1,s),o[c]=0,q(n,l),i&&a&&t().removeRules(l+"-import")}},sealed:!1,styleTag:e,toElement:te(c,n),toHTML:ee(c,n)}}(i,o)}return oe()},ae=/\s+/,le=void 0;le=P?T?40:1e3:-1;var ce=0,se=void 0,ue=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P?document.head:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g(this,e),this.getImportRuleTag=function(){var e=t.importRuleTag;if(void 0!==e)return e;var n=t.tags[0];return t.importRuleTag=ie(t.target,n?n.styleTag:null,t.forceServer,!0)},ce+=1,this.id=ce,this.forceServer=r,this.target=r?null:n,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!P||this.forceServer)return this;var e=[],t=[],n=!1,r=document.querySelectorAll("style["+_+'][data-styled-version="4.4.1"]'),o=r.length;if(!o)return this;for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];se=new e(void 0,t).rehydrate()},e.prototype.clone=function(){var t=new e(this.target,this.forceServer);return this.clones.push(t),t.tags=this.tags.map((function(e){for(var n=e.getIds(),r=e.clone(),o=0;o1?t-1:0),r=1;r=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return((r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16))^r>>>15)>>>0}var we=function(e){return String.fromCharCode(e+(e>25?39:97))};function xe(e){var t="",n=void 0;for(n=e;n>52;n=Math.floor(n/52))t=we(n%52)+t;return we(n%52)+t}function ke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:S,r=!!n&&e.theme===n.theme,o=e.theme&&!r?e.theme:t||n.theme;return o},_e=/[[\].#*$><+~=|^:(),"'`-]+/g,Pe=/(^-|-$)/g;function Te(e){return e.replace(_e,"-").replace(Pe,"")}function je(e){return"string"==typeof e&&!0}var Re={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},De={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Me=((Se={})[u.ForwardRef]={$$typeof:!0,render:!0},Se),Ae=Object.defineProperty,Ie=Object.getOwnPropertyNames,ze=Object.getOwnPropertySymbols,Be=void 0===ze?function(){return[]}:ze,Le=Object.getOwnPropertyDescriptor,Ne=Object.getPrototypeOf,Fe=Object.prototype,Ue=Array.prototype;function He(e,t,n){if("string"!=typeof t){var r=Ne(t);r&&r!==Fe&&He(e,r,n);for(var o=Ue.concat(Ie(t),Be(t)),i=Me[e.$$typeof]||Re,a=Me[t.$$typeof]||Re,l=o.length,c=void 0,s=void 0;l--;)if(s=o[l],!(De[s]||n&&n[s]||a&&a[s]||i&&i[s])&&(c=Le(t,s)))try{Ae(e,s,c)}catch(e){}return e}return e}var We=Object(l.createContext)(),Ye=We.Consumer,Ve=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext.bind(r)),r.renderInner=r.renderInner.bind(r),r}return y(t,e),t.prototype.render=function(){return this.props.children?c.a.createElement(We.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(e){var t=this.getContext(this.props.theme,e);return c.a.createElement(We.Provider,{value:t},this.props.children)},t.prototype.getTheme=function(e,t){if(C(e))return e(t);if(null===e||Array.isArray(e)||"object"!==(void 0===e?"undefined":m(e)))throw new j(8);return v({},t,e)},t.prototype.getContext=function(e,t){return this.getTheme(e,t)},t}(l.Component),Xe=(function(){function e(){g(this,e),this.masterSheet=ue.master,this.instance=this.masterSheet.clone(),this.sealed=!1}e.prototype.seal=function(){if(!this.sealed){var e=this.masterSheet.clones.indexOf(this.instance);this.masterSheet.clones.splice(e,1),this.sealed=!0}},e.prototype.collectStyles=function(e){if(this.sealed)throw new j(2);return c.a.createElement($e,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.seal(),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.seal(),this.instance.toReactElements()},e.prototype.interleaveWithNodeStream=function(e){throw new j(3)}}(),Object(l.createContext)()),qe=Xe.Consumer,$e=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext),r}return y(t,e),t.prototype.getContext=function(e,t){if(e)return e;if(t)return new ue(t);throw new j(4)},t.prototype.render=function(){var e=this.props,t=e.children,n=e.sheet,r=e.target;return c.a.createElement(Xe.Provider,{value:this.getContext(n,r)},t)},t}(l.Component),Qe={};var Ke=function(e){function t(){g(this,t);var n=w(this,e.call(this));return n.attrs={},n.renderOuter=n.renderOuter.bind(n),n.renderInner=n.renderInner.bind(n),n}return y(t,e),t.prototype.render=function(){return c.a.createElement(qe,null,this.renderOuter)},t.prototype.renderOuter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue.master;return this.styleSheet=e,this.props.forwardedComponent.componentStyle.isStatic?this.renderInner():c.a.createElement(Ye,null,this.renderInner)},t.prototype.renderInner=function(e){var t=this.props.forwardedComponent,n=t.componentStyle,r=t.defaultProps,o=(t.displayName,t.foldedComponentIds),i=t.styledComponentId,a=t.target,c=void 0;c=n.isStatic?this.generateAndInjectStyles(S,this.props):this.generateAndInjectStyles(Oe(this.props,e,r)||S,this.props);var s=this.props.as||this.attrs.as||a,u=je(s),f={},d=v({},this.props,this.attrs),h=void 0;for(h in d)"forwardedComponent"!==h&&"as"!==h&&("forwardedRef"===h?f.ref=d[h]:"forwardedAs"===h?f.as=d[h]:u&&!Object(p.a)(h)||(f[h]=d[h]));return this.props.style&&this.attrs.style&&(f.style=v({},this.attrs.style,this.props.style)),f.className=Array.prototype.concat(o,i,c!==i?c:null,this.props.className,this.attrs.className).filter(Boolean).join(" "),Object(l.createElement)(s,f)},t.prototype.buildExecutionContext=function(e,t,n){var r=this,o=v({},t,{theme:e});return n.length?(this.attrs={},n.forEach((function(e){var t,n=e,i=!1,a=void 0,l=void 0;for(l in C(n)&&(n=n(o),i=!0),n)a=n[l],i||!C(a)||(t=a)&&t.prototype&&t.prototype.isReactComponent||O(a)||(a=a(o)),r.attrs[l]=a,o[l]=a})),o):o},t.prototype.generateAndInjectStyles=function(e,t){var n=t.forwardedComponent,r=n.attrs,o=n.componentStyle;n.warnTooManyClasses;return o.isStatic&&!r.length?o.generateAndInjectStyles(S,this.styleSheet):o.generateAndInjectStyles(this.buildExecutionContext(e,t,r),this.styleSheet)},t}(l.Component);function Ze(e,t,n){var r=O(e),o=!je(e),i=t.displayName,a=void 0===i?function(e){return je(e)?"styled."+e:"Styled("+E(e)+")"}(e):i,l=t.componentId,s=void 0===l?function(e,t,n){var r="string"!=typeof t?"sc":Te(t),o=(Qe[r]||0)+1;Qe[r]=o;var i=r+"-"+e.generateName(r+o);return n?n+"-"+i:i}(Ee,t.displayName,t.parentComponentId):l,u=t.ParentComponent,f=void 0===u?Ke:u,p=t.attrs,h=void 0===p?k:p,m=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||s,g=r&&e.attrs?Array.prototype.concat(e.attrs,h).filter(Boolean):h,b=new Ee(r?e.componentStyle.rules.concat(n):n,g,m),y=void 0,w=function(e,t){return c.a.createElement(f,v({},e,{forwardedComponent:y,forwardedRef:t}))};return w.displayName=a,(y=c.a.forwardRef(w)).displayName=a,y.attrs=g,y.componentStyle=b,y.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):k,y.styledComponentId=m,y.target=r?e.target:e,y.withComponent=function(e){var r=t.componentId,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["componentId"]),i=r&&r+"-"+(je(e)?e:Te(E(e)));return Ze(e,v({},o,{attrs:g,componentId:i,ParentComponent:f}),n)},Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Object(d.a)(e.defaultProps,t):t}}),y.toString=function(){return"."+y.styledComponentId},o&&He(y,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,styledComponentId:!0,target:!0,withComponent:!0}),y}var Ge=function(e){return function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;if(!Object(u.isValidElementType)(n))throw new j(1,String(n));var o=function(){return t(n,r,ve.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,v({},r,o))},o.attrs=function(o){return e(t,n,v({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Ge[e]=Ge(e)}));!function(){function e(t,n){g(this,e),this.rules=t,this.componentId=n,this.isStatic=ke(t,k),ue.master.hasId(n)||ue.master.deferredInject(n,[])}e.prototype.createStyles=function(e,t){var n=Y(be(this.rules,e,t),"");t.inject(this.componentId,n)},e.prototype.removeStyles=function(e){var t=this.componentId;e.hasId(t)&&e.remove(t)},e.prototype.renderStyles=function(e,t){this.removeStyles(t),this.createStyles(e,t)}}();P&&(window.scCGSHMRCache={});t.b=Ge}).call(this,n(12))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1?n-1:0),o=1;o255?255:e}},{key:"copyAttributes",value:function(e,t,n){return null==n&&(n={}),function(){for(var r=[],o=0,i=Array.from(e.attributes);oe?d():!0!==t&&(o=setTimeout(r?h:d,void 0===r?e-p:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),c.cancel=function(){l(),i=!0},c}e.debounce=function(e,n,r){return void 0===r?t(e,n,!1):t(e,r,!1!==n)},e.throttle=t,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(23)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n])/g,v=/([[}=:>])\s+/g,y=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,x=/([^\(])(:+) */g,k=/[svh]\w+-[tblr]{2}/,S=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,E=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,T="-webkit-",j="-moz-",R="-ms-",D=59,M=125,A=123,I=40,z=41,B=10,L=13,N=32,F=45,U=42,H=44,W=58,Y=47,V=1,X=1,q=0,$=1,Q=1,K=1,Z=0,G=0,J=0,ee=[],te=[],ne=0,re=null,oe=0,ie=1,ae="",le="",ce="";function se(e,t,o,i,a){for(var l,c,u=0,f=0,p=0,d=0,b=0,v=0,y=0,w=0,k=0,C=0,E=0,O=0,_=0,P=0,j=0,R=0,Z=0,te=0,re=0,fe=o.length,be=fe-1,ve="",ye="",we="",xe="",ke="",Se="";j0&&(ye=ye.replace(r,"")),ye.trim().length>0)){switch(y){case N:case 9:case D:case L:case B:break;default:ye+=o.charAt(j)}y=D}if(1===Z)switch(y){case A:case M:case D:case 34:case 39:case I:case z:case H:Z=0;case 9:case L:case B:case N:break;default:for(Z=0,re=j,b=y,j--,y=D;re0&&(++j,y=b);case A:re=fe}}switch(y){case A:for(b=(ye=ye.trim()).charCodeAt(0),E=1,re=++j;j0&&(ye=ye.replace(r,"")),v=ye.charCodeAt(1)){case 100:case 109:case 115:case F:l=t;break;default:l=ee}if(re=(we=se(t,l,we,v,a+1)).length,J>0&&0===re&&(re=ye.length),ne>0&&(c=me(3,we,l=ue(ee,ye,te),t,X,V,re,v,a,i),ye=l.join(""),void 0!==c&&0===(re=(we=c.trim()).length)&&(v=0,we="")),re>0)switch(v){case 115:ye=ye.replace(S,he);case 100:case 109:case F:we=ye+"{"+we+"}";break;case 107:we=(ye=ye.replace(h,"$1 $2"+(ie>0?ae:"")))+"{"+we+"}",we=1===Q||2===Q&&de("@"+we,3)?"@"+T+we+"@"+we:"@"+we;break;default:we=ye+we,112===i&&(xe+=we,we="")}else we="";break;default:we=se(t,ue(t,ye,te),we,i,a+1)}ke+=we,O=0,Z=0,P=0,R=0,te=0,_=0,ye="",we="",y=o.charCodeAt(++j);break;case M:case D:if((re=(ye=(R>0?ye.replace(r,""):ye).trim()).length)>1)switch(0===P&&((b=ye.charCodeAt(0))===F||b>96&&b<123)&&(re=(ye=ye.replace(" ",":")).length),ne>0&&void 0!==(c=me(1,ye,t,e,X,V,xe.length,i,a,i))&&0===(re=(ye=c.trim()).length)&&(ye="\0\0"),b=ye.charCodeAt(0),v=ye.charCodeAt(1),b){case 0:break;case 64:if(105===v||99===v){Se+=ye+o.charAt(j);break}default:if(ye.charCodeAt(re-1)===W)break;xe+=pe(ye,b,v,ye.charCodeAt(2))}O=0,Z=0,P=0,R=0,te=0,ye="",y=o.charCodeAt(++j)}}switch(y){case L:case B:if(f+d+p+u+G===0)switch(C){case z:case 39:case 34:case 64:case 126:case 62:case U:case 43:case Y:case F:case W:case H:case D:case A:case M:break;default:P>0&&(Z=1)}f===Y?f=0:$+O===0&&107!==i&&ye.length>0&&(R=1,ye+="\0"),ne*oe>0&&me(0,ye,t,e,X,V,xe.length,i,a,i),V=1,X++;break;case D:case M:if(f+d+p+u===0){V++;break}default:switch(V++,ve=o.charAt(j),y){case 9:case N:if(d+u+f===0)switch(w){case H:case W:case 9:case N:ve="";break;default:y!==N&&(ve=" ")}break;case 0:ve="\\0";break;case 12:ve="\\f";break;case 11:ve="\\v";break;case 38:d+f+u===0&&$>0&&(te=1,R=1,ve="\f"+ve);break;case 108:if(d+f+u+q===0&&P>0)switch(j-P){case 2:112===w&&o.charCodeAt(j-3)===W&&(q=w);case 8:111===k&&(q=k)}break;case W:d+f+u===0&&(P=j);break;case H:f+p+d+u===0&&(R=1,ve+="\r");break;case 34:case 39:0===f&&(d=d===y?0:0===d?y:d);break;case 91:d+f+p===0&&u++;break;case 93:d+f+p===0&&u--;break;case z:d+f+u===0&&p--;break;case I:if(d+f+u===0){if(0===O)switch(2*w+3*k){case 533:break;default:E=0,O=1}p++}break;case 64:f+p+d+u+P+_===0&&(_=1);break;case U:case Y:if(d+u+p>0)break;switch(f){case 0:switch(2*y+3*o.charCodeAt(j+1)){case 235:f=Y;break;case 220:re=j,f=U}break;case U:y===Y&&w===U&&re+2!==j&&(33===o.charCodeAt(re+2)&&(xe+=o.substring(re,j+1)),ve="",f=0)}}if(0===f){if($+d+u+_===0&&107!==i&&y!==D)switch(y){case H:case 126:case 62:case 43:case z:case I:if(0===O){switch(w){case 9:case N:case B:case L:ve+="\0";break;default:ve="\0"+ve+(y===H?"":"\0")}R=1}else switch(y){case I:P+7===j&&108===w&&(P=0),O=++E;break;case z:0==(O=--E)&&(R=1,ve+="\0")}break;case 9:case N:switch(w){case 0:case A:case M:case D:case H:case 12:case 9:case N:case B:case L:break;default:0===O&&(R=1,ve+="\0")}}ye+=ve,y!==N&&9!==y&&(C=y)}}k=w,w=y,j++}if(re=xe.length,J>0&&0===re&&0===ke.length&&0===t[0].length==0&&(109!==i||1===t.length&&($>0?le:ce)===t[0])&&(re=t.join(",").length+2),re>0){if(l=0===$&&107!==i?function(e){for(var t,n,o=0,i=e.length,a=Array(i);o1)){if(p=c.charCodeAt(c.length-1),d=n.charCodeAt(0),t="",0!==u)switch(p){case U:case 126:case 62:case 43:case N:case I:break;default:t=" "}switch(d){case 38:n=t+le;case 126:case 62:case 43:case N:case z:case I:break;case 91:n=t+n+le;break;case W:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(K>0){n=t+n.substring(8,f-1);break}default:(u<1||l[u-1].length<1)&&(n=t+le+n)}break;case H:t="";default:n=f>1&&n.indexOf(":")>0?t+n.replace(x,"$1"+le+"$2"):t+n+le}c+=n}a[o]=c.replace(r,"").trim()}return a}(t):t,ne>0&&void 0!==(c=me(2,xe,l,e,X,V,re,i,a,i))&&0===(xe=c).length)return Se+xe+ke;if(xe=l.join(",")+"{"+xe+"}",Q*q!=0){switch(2!==Q||de(xe,2)||(q=0),q){case 111:xe=xe.replace(g,":-moz-$1")+xe;break;case 112:xe=xe.replace(m,"::"+T+"input-$1")+xe.replace(m,"::-moz-$1")+xe.replace(m,":-ms-input-$1")+xe}q=0}}return Se+xe+ke}function ue(e,t,n){var r=t.trim().split(u),o=r,i=r.length,a=e.length;switch(a){case 0:case 1:for(var l=0,c=0===a?"":e[0]+" ";l0&&$>0)return o.replace(p,"$1").replace(f,"$1"+ce);break;default:return e.trim()+o.replace(f,"$1"+e.trim())}default:if(n*$>0&&o.indexOf("\f")>0)return o.replace(f,(e.charCodeAt(0)===W?"":"$1")+e.trim())}return e+o}function pe(e,t,n,r){var s,u=0,f=e+";",p=2*t+3*n+4*r;if(944===p)return function(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim();switch(e.charCodeAt(9)*ie){case 0:break;case F:if(110!==e.charCodeAt(10))break;default:var i=o.split((o="",l)),a=0;for(n=0,t=i.length;a64&&f<90||f>96&&f<123||95===f||f===F&&s.charCodeAt(1)!==F))switch(isNaN(parseFloat(s))+(-1!==s.indexOf("("))){case 1:switch(s){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:s+=ae}}u[n++]=s}o+=(0===a?"":",")+u.join(" ")}}return o=r+o+";",1===Q||2===Q&&de(o,1)?T+o+o:o}(f);if(0===Q||2===Q&&!de(f,1))return f;switch(p){case 1015:return 97===f.charCodeAt(10)?T+f+f:f;case 951:return 116===f.charCodeAt(3)?T+f+f:f;case 963:return 110===f.charCodeAt(5)?T+f+f:f;case 1009:if(100!==f.charCodeAt(4))break;case 969:case 942:return T+f+f;case 978:return T+f+j+f+f;case 1019:case 983:return T+f+j+f+R+f+f;case 883:return f.charCodeAt(8)===F?T+f+f:f.indexOf("image-set(",11)>0?f.replace(P,"$1"+T+"$2")+f:f;case 932:if(f.charCodeAt(4)===F)switch(f.charCodeAt(5)){case 103:return T+"box-"+f.replace("-grow","")+T+f+R+f.replace("grow","positive")+f;case 115:return T+f+R+f.replace("shrink","negative")+f;case 98:return T+f+R+f.replace("basis","preferred-size")+f}return T+f+R+f+f;case 964:return T+f+R+"flex-"+f+f;case 1023:if(99!==f.charCodeAt(8))break;return s=f.substring(f.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),T+"box-pack"+s+T+f+R+"flex-pack"+s+f;case 1005:return i.test(f)?f.replace(o,":"+T)+f.replace(o,":"+j)+f:f;case 1e3:switch(u=(s=f.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(u)){case 226:s=f.replace(k,"tb");break;case 232:s=f.replace(k,"tb-rl");break;case 220:s=f.replace(k,"lr");break;default:return f}return T+f+R+s+f;case 1017:if(-1===f.indexOf("sticky",9))return f;case 975:switch(u=(f=e).length-10,p=(s=(33===f.charCodeAt(u)?f.substring(0,u):f).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(s.charCodeAt(8)<111)break;case 115:f=f.replace(s,T+s)+";"+f;break;case 207:case 102:f=f.replace(s,T+(p>102?"inline-":"")+"box")+";"+f.replace(s,T+s)+";"+f.replace(s,R+s+"box")+";"+f}return f+";";case 938:if(f.charCodeAt(5)===F)switch(f.charCodeAt(6)){case 105:return s=f.replace("-items",""),T+f+T+"box-"+s+R+"flex-"+s+f;case 115:return T+f+R+"flex-item-"+f.replace(E,"")+f;default:return T+f+R+"flex-line-pack"+f.replace("align-content","").replace(E,"")+f}break;case 973:case 989:if(f.charCodeAt(3)!==F||122===f.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?pe(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):f.replace(s,T+s)+f.replace(s,j+s.replace("fill-",""))+f;break;case 962:if(f=T+f+(102===f.charCodeAt(5)?R+f:"")+f,n+r===211&&105===f.charCodeAt(13)&&f.indexOf("transform",10)>0)return f.substring(0,f.indexOf(";",27)+1).replace(a,"$1"+T+"$2")+f}return f}function de(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10),o=e.substring(n+1,e.length-1);return re(2!==t?r:r.replace(O,"$1"),o,t)}function he(e,t){var n=pe(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(C," or ($1)").substring(4):"("+t+")"}function me(e,t,n,r,o,i,a,l,c,s){for(var u,f=0,p=t;f0&&(ae=o.replace(d,91===i?"":"-")),i=1,1===$?ce=o:le=o;var a,l=[ce];ne>0&&void 0!==(a=me(-1,n,l,l,X,V,0,0,0,0))&&"string"==typeof a&&(n=a);var c=se(ee,l,n,0,0);return ne>0&&void 0!==(a=me(-2,c,l,l,X,V,c.length,0,0,0))&&"string"!=typeof(c=a)&&(i=0),ae="",ce="",le="",q=0,X=1,V=1,Z*i==0?c:c.replace(r,"").replace(b,"").replace(v,"$1").replace(y,"$1").replace(w," ")}return ve.use=function e(t){switch(t){case void 0:case null:ne=te.length=0;break;default:if("function"==typeof t)te[ne++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n * @license MIT */ -var r=n(36),o=n(37),i=n(38);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return _(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,a=1,l=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,l/=2,c/=2,n/=2}function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;il&&(n=l-c),i=n;i>=0;i--){for(var f=!0,p=0;po&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:s>223?3:s>191?2:1;if(o+f<=n)switch(f){case 1:s<128&&(u=s);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&s)<<6|63&i)>127&&(u=c);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(c=(15&s)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=e[o+1],a=e[o+2],l=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&l)&&(c=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&l)>65535&&c<1114112&&(u=c)}null===u?(u=65533,f=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),l=Math.min(i,a),s=this.slice(r,o),u=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return k(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function A(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function I(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,i){return i||I(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||I(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):A(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=0,a=1,l=0;for(this[t]=255&e;++i>0)-l&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/a>>0)-l&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):A(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(13))},function(e,t,n){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=s(e),a=r[0],l=r[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,l)),u=0,f=l>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===l&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===l&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,l=n-o;al?l:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,c=a.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var o,i,a=[],l=t;l>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,l=8*o-r-1,c=(1<>1,u=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-u)-1,d>>=-u,u+=l;u>0;i=256*i+e[t+f],f+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+f],f+=p,u-=8);if(0===i)i=1-s;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=s}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,l,c,s=8*i-o-1,u=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(t*c-1)*Math.pow(2,o),a+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&l,d+=h,l/=256,o-=8);for(a=a<0;e[n+d]=255&a,d+=h,a/=256,s-=8);e[n+d-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(module,__webpack_exports__,__webpack_require__){"use strict";var _module__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(19),_core_util__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2),_logger__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3),_store__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6),_renderer__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(20);function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n",this.hiDPIReplacement()),this.swapped=!0,this.image.src=this.hiDPIReplacement()),Caman.IO.isRemote(this.image))return this.image.src=Caman.IO.proxyUrl(this.image.src),_logger__WEBPACK_IMPORTED_MODULE_2__.a.debug("Remote image detected, using URL = ".concat(this.image.src))}},{key:"waitForImageLoaded",value:function(){return this.isImageLoaded()?this.imageLoaded():this.image.onload=this.imageLoaded}},{key:"isImageLoaded",value:function(){return!!this.image.complete&&(null==this.image.naturalWidth||0!==this.image.naturalWidth)}},{key:"imageWidth",value:function(){return this.image.width||this.image.naturalWidth}},{key:"imageHeight",value:function(){return this.image.height||this.image.naturalHeight}},{key:"imageLoaded",value:function(){return _logger__WEBPACK_IMPORTED_MODULE_2__.a.debug("Image loaded. Width = ".concat(this.imageWidth(),", Height = ").concat(this.imageHeight())),this.swapped?(this.canvas.width=this.imageWidth()/this.hiDPIRatio(),this.canvas.height=this.imageHeight()/this.hiDPIRatio()):(this.canvas.width=this.imageWidth(),this.canvas.height=this.imageHeight()),this.finishInit()}},{key:"finishInit",value:function(){if(null==this.context&&(this.context=this.canvas.getContext("2d")),this.originalWidth=this.preScaledWidth=this.width=this.canvas.width,this.originalHeight=this.preScaledHeight=this.height=this.canvas.height,this.hiDPIAdjustments(),this.hasId()||this.assignId(),null!=this.image&&this.context.drawImage(this.image,0,0,this.imageWidth(),this.imageHeight(),0,0,this.preScaledWidth,this.preScaledHeight),this.imageData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),this.pixelData=this.imageData.data,Caman.allowRevert){this.initializedPixelData=_core_util__WEBPACK_IMPORTED_MODULE_1__.b.dataArray(this.pixelData.length),this.originalPixelData=_core_util__WEBPACK_IMPORTED_MODULE_1__.b.dataArray(this.pixelData.length);for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;if(null==r&&(r=0),null==n){n=0;for(var o=0,i=t.length,a=0<=i;a?oi;a?o++:o--)n+=t[o]}return this.renderer.add({type:Caman.Filter.Type.Kernel,name:e,adjust:t,divisor:n,bias:r}),this}},{key:"processPlugin",value:function(e,t){return this.renderer.add({type:Caman.Filter.Type.Plugin,plugin:e,args:t}),this}},{key:"newLayer",value:function(e){var t=new Caman.Layer(this);return this.canvasQueue.push(t),this.renderer.add({type:Caman.Filter.Type.LayerDequeue}),e.call(t),this.renderer.add({type:Caman.Filter.Type.LayerFinished}),this}},{key:"executeLayer",value:function(e){return this.pushContext(e)}},{key:"pushContext",value:function(e){return this.layerStack.push(this.currentLayer),this.pixelStack.push(this.pixelData),this.currentLayer=e,this.pixelData=e.pixelData}},{key:"popContext",value:function(){return this.pixelData=this.pixelStack.pop(),this.currentLayer=this.layerStack.pop()}},{key:"applyCurrentLayer",value:function(){return this.currentLayer.applyToParent()}},{key:"save",value:function(){return this.browserSave.apply(this,arguments)}},{key:"browserSave",value:function(e){null==e&&(e="png"),e=e.toLowerCase();var t=this.toBase64(e).replace("image/".concat(e),"image/octet-stream");return document.location.href=t}},{key:"toImage",value:function(e){var t=new Image;return t.src=this.toBase64(e),t.width=this.dimensions.width,t.height=this.dimensions.height,window.devicePixelRatio&&(t.width/=window.devicePixelRatio,t.height/=window.devicePixelRatio),t}},{key:"toBase64",value:function(e){return null==e&&(e="png"),e=e.toLowerCase(),this.canvas.toDataURL("image/".concat(e))}}]),Caman}(_module__WEBPACK_IMPORTED_MODULE_0__.a);Caman.initClass(),window.Caman=Caman;var _unused_webpack_default_export=Caman},function(e,t){function n(e,t){for(var n=0;n1;){for(var m=[],g=0,b=h.length-2,v=0<=b;v?g<=b:g>=b;v?g++:g--)m.push([f(h[g][0],h[g+1][0],d),f(h[g][1],h[g+1][1],d)]);h=m}u[Math.round(h[0][0])]=Math.round((l=h[0][1],c=o,s=i,Math.min(Math.max(l,c),s)))}var y=a[a.length-1][0];return u=Caman.Calculate.missingValues(u,y),null==u[y]&&(u[y]=u[y-1]),u}},{key:"hermite",value:function(e,t,n){if(e.length<2)throw"Invalid number of arguments to hermite";for(var r,o,i,a,l={},c=function(e,t){return[e[0]*t[0],e[1]*t[1]]},s=function(e,t){return[e[0]-t[0],e[1]-t[1]]},u=function(e,t,n){return Math.min(Math.max(e,t),n)},f=0,p=e.length-2,d=0<=p;d?f<=p:f>=p;d?f++:f--){var h=e[f],m=e[f+1],g=m[0]-h[0],b=1/g;f===e.length-2&&(b=1/(g-1));for(var v=f>0?e[f-1]:h,y=c(s(m,v),[.5,.5]),w=c(s(v=f=k;S?x++:x--){var C=x*b,E=2*C*C*C-3*C*C+1,O=C*C*C-2*C*C+C,_=-2*C*C*C+3*C*C,P=C*C*C-C*C,T=(r=c(h,[E,E]),o=c(y,[O,O]),i=c(m,[_,_]),a=c(w,[P,P]),[r[0]+o[0]+i[0]+a[0],r[1]+o[1]+i[1]+a[1]]);l[Math.round(T[0])]=Math.round(u(T[1],t,n))}}var j=e[e.length-1][0];return l=Caman.Calculate.missingValues(l,j)}},{key:"missingValues",value:function(e,t){var n,r,o,i,a,l,c;if(Object.keys(e).length=t;n=0<=t?++l:--l)if(null!=e[n])i[n]=e[n];else{for(o=[n-1,i[n-1]],r=c=n;n<=t?c<=t:c>=t;r=n<=t?++c:--c)if(null!=e[r]){a=[r,e[r]];break}a||(a=[0,0]),i[n]=o[1]+(a[1]-o[1])/(a[0]-o[0])*(n-o[0])}return i}return e}}],(r=null)&&n(t.prototype,r),o&&n(t,o),e}();Caman.Calculate=r},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n.5?s/(2-a-l):s/(a+l),o=function(){switch(a){case e:return(t-r)/s+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}},{key:"rgbToHSV",value:function(e,t,n){var r;e/=255,t/=255,n/=255;var o=Math.max(e,t,n),i=Math.min(e,t,n),a=o,l=o-i,c=0===o?0:l/o;return o===i?r=0:(r=function(){switch(o){case e:return(t-n)/l+(t.04045?e=Math.pow((e+.055)/1.055,2.4):e/=12.92,t>.04045?t=Math.pow((t+.055)/1.055,2.4):t/=12.92,n>.04045?n=Math.pow((n+.055)/1.055,2.4):n/=12.92,{x:100*(.4124*e+.3576*t+.1805*n),y:100*(.2126*e+.7152*t+.0722*n),z:100*(.0193*e+.1192*t+.9505*n)}}},{key:"xyzToRGB",value:function(e,t,n){var r=3.2406*(e/=100)+-1.5372*(t/=100)+-.4986*(n/=100),o=-.9689*e+1.8758*t+.0415*n,i=.0557*e+-.204*t+1.057*n;return r>.0031308?r=1.055*Math.pow(r,.4166666667)-.055:r*=12.92,o>.0031308?o=1.055*Math.pow(o,.4166666667)-.055:o*=12.92,i>.0031308?i=1.055*Math.pow(i,.4166666667)-.055:i*=12.92,{r:255*r,g:255*o,b:255*i}}},{key:"xyzToLab",value:function(e,t,r){return"object"===n(e)&&(t=e.y,r=e.z,e=e.x),t/=100,r/=108.883,e=(e/=95.047)>.008856451679?Math.pow(e,.3333333333):7.787037037*e+.1379310345,{l:116*(t=t>.008856451679?Math.pow(t,.3333333333):7.787037037*t+.1379310345)-16,a:500*(e-t),b:200*(t-(r=r>.008856451679?Math.pow(r,.3333333333):7.787037037*r+.1379310345))}}},{key:"labToXYZ",value:function(e,t,r){"object"===n(e)&&(t=e.a,r=e.b,e=e.l);var o=(e+16)/116,i=o+t/500,a=o-r/200;return i>.2068965517?i*=i*i:i=.1284185493*(i-.1379310345),o>.2068965517?o*=o*o:o=.1284185493*(o-.1379310345),a>.2068965517?a*=a*a:a=.1284185493*(a-.1379310345),{x:95.047*i,y:100*o,z:108.883*a}}},{key:"rgbToLab",value:function(e,t,r){"object"===n(e)&&(t=e.g,r=e.b,e=e.r);var o=this.rgbToXYZ(e,t,r);return this.xyzToLab(o)}},{key:"labToRGB",value:function(e,t,n){}}],(o=null)&&r(t.prototype,o),i&&r(t,i),e}();Caman.Convert=o},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null;if(this.events[t]&&this.events[t].length)return function(){for(var o=[],i=0,a=Array.from(n.events[t]);i4&&void 0!==arguments[4]?arguments[4]:null;n(this,e),null==t&&(t=0),this.r=t,null==r&&(r=0),this.g=r,null==o&&(o=0),this.b=o,null==i&&(i=255),this.a=i,this.c=a,this.loc=0}return o(e,null,[{key:"coordinatesToLocation",value:function(e,t,n){return 4*(t*n+e)}},{key:"locationToCoordinates",value:function(e,t){return{x:e%(4*t)/4,y:Math.floor(e/(4*t))}}}]),o(e,[{key:"setContext",value:function(e){return this.c=e}},{key:"locationXY",value:function(){if(null==this.c)throw"Requires a CamanJS context";var e=this.c.dimensions.height-Math.floor(this.loc/(4*this.c.dimensions.width));return{x:this.loc%(4*this.c.dimensions.width)/4,y:e}}},{key:"pixelAtLocation",value:function(t){if(null==this.c)throw"Requires a CamanJS context";return new e(this.c.pixelData[t],this.c.pixelData[t+1],this.c.pixelData[t+2],this.c.pixelData[t+3],this.c)}},{key:"getPixelRelative",value:function(t,n){if(null==this.c)throw"Requires a CamanJS context";var r=this.loc+4*this.c.dimensions.width*(-1*n)+4*t;return r>this.c.pixelData.length||r<0?new e(0,0,0,255,this.c):this.pixelAtLocation(r)}},{key:"putPixelRelative",value:function(e,t,n){if(null==this.c)throw"Requires a CamanJS context";this.loc,this.c.dimensions.width;if(!(newLoc>this.c.pixelData.length||newLoc<0))return this.c.pixelData[newLoc]=n.r,this.c.pixelData[newLoc+1]=n.g,this.c.pixelData[newLoc+2]=n.b,this.c.pixelData[newLoc+3]=n.a,!0}},{key:"getPixel",value:function(e,t){if(null==this.c)throw"Requires a CamanJS context";var n=this.coordinatesToLocation(e,t,this.width);return this.pixelAtLocation(n)}},{key:"putPixel",value:function(e,t,n){if(null==this.c)throw"Requires a CamanJS context";var r=this.coordinatesToLocation(e,t,this.width);return this.c.pixelData[r]=n.r,this.c.pixelData[r+1]=n.g,this.c.pixelData[r+2]=n.b,this.c.pixelData[r+3]=n.a}},{key:"toString",value:function(){return this.toKey()}},{key:"toHex",value:function(e){null==e&&(e=!1);var t="#"+this.r.toString(16)+this.g.toString(16)+this.b.toString(16);return e?t+this.a.toString(16):t}}]),e}();Caman.Pixel=i},function(e,t){function n(e,t){for(var n=0;n255-e?t.r=255:t.r255-e?t.g=255:t.g255-e?t.b=255:t.b0?t.r+=(255-t.r)*e.red:t.r-=t.r*Math.abs(e.red)),null!=e.green&&(e.green>0?t.g+=(255-t.g)*e.green:t.g-=t.g*Math.abs(e.green)),null!=e.blue&&(e.blue>0?t.b+=(255-t.b)*e.blue:t.b-=t.b*Math.abs(e.blue)),t}))})),Caman.Filter.register("curves",(function(){var e,t,n,r,o,i,a,l,c,s,u,f;if(n=arguments[0],"function"==typeof(a=(r=2<=arguments.length?[].slice.call(arguments,1):[])[r.length-1])?(e=a,r.pop()):"string"==typeof a?(e=Caman.Calculate[a],r.pop()):e=Caman.Calculate.bezier,"string"==typeof n&&(n=n.split("")),"v"===n[0]&&(n=["r","g","b"]),r.length<2)throw"Invalid number of arguments to curves filter";if(t=e(r,0,255),(l=r[0])[0]>0)for(i=c=0,u=l[0];0<=u?cu;i=0<=u?++c:--c)t[i]=l[1];if((o=r[r.length-1])[0]<255)for(i=s=f=o[0];f<=255?s<=255:s>=255;i=f<=255?++s:--s)t[i]=o[1];return this.process("curves",(function(e){var r,o;for(i=r=0,o=n.length;0<=o?ro;i=0<=o?++r:--r)e[n[i]]=t[e[n[i]]];return e}))})),Caman.Filter.register("exposure",(function(e){var t,n,r;return t=[0,255*(r=Math.abs(e)/100)],n=[255-255*r,255],e<0&&(t=t.reverse(),n=n.reverse()),this.curves("rgb",[0,0],t,n,[255,255])}))},function(e,t){Caman.Filter.register("boxBlur",(function(){return this.processKernel("Box Blur",[1,1,1,1,1,1,1,1,1])})),Caman.Filter.register("heavyRadialBlur",(function(){return this.processKernel("Heavy Radial Blur",[0,0,1,0,0,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,0,0,1,0,0])})),Caman.Filter.register("gaussianBlur",(function(){return this.processKernel("Gaussian Blur",[1,4,6,4,1,4,16,24,16,4,6,24,36,24,6,4,16,24,16,4,1,4,6,4,1])})),Caman.Filter.register("motionBlur",(function(e){var t;return t=0===e||180===e?[0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0]:e>0&&e<90||e>180&&e<270?[0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0]:90===e||270===e?[0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0]:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],this.processKernel("Motion Blur",t)})),Caman.Filter.register("sharpen",(function(e){return null==e&&(e=100),e/=100,this.processKernel("Sharpen",[0,-e,0,-e,4*e+1,-e,0,-e,0])}))},function(e,t){Caman.Filter.register("vignette",(function(e,t){var n,r,o,i;return null==t&&(t=60),"string"==typeof e&&"%"===e.substr(-1)&&(e=this.dimensions.height>this.dimensions.width?this.dimensions.width*(parseInt(e.substr(0,e.length-1),10)/100):this.dimensions.height*(parseInt(e.substr(0,e.length-1),10)/100)),t/=100,r=[this.dimensions.width/2,this.dimensions.height/2],i=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)),o=i-e,n=Caman.Calculate.bezier([0,1],[30,30],[70,60],[100,80]),this.process("vignette",(function(i){var a,l,c;return c=i.locationXY(),(a=Caman.Calculate.distance(c.x,c.y,r[0],r[1]))>o&&(l=Math.max(1,n[Math.round((a-o)/e*100)]/10*t),i.r=255*Math.pow(i.r/255,l),i.g=255*Math.pow(i.g/255,l),i.b=255*Math.pow(i.b/255,l)),i}))}))},function(e,t){Caman.Filter.register("posterize",(function(e){var t,n;return t=256/e,n=255/(e-1),this.process("posterize",(function(e){return e.r=Math.floor(Math.floor(e.r/t)*n),e.g=Math.floor(Math.floor(e.g/t)*n),e.b=Math.floor(Math.floor(e.b/t)*n),e}))}))},function(e,t){Caman.Filter.register("edgeEnhance",(function(){return this.processKernel("Edge Enhance",[0,0,0,-1,1,0,0,0,0])})),Caman.Filter.register("edgeDetect",(function(){return this.processKernel("Edge Detect",[-1,-1,-1,-1,8,-1,-1,-1,-1])})),Caman.Filter.register("emboss",(function(){return this.processKernel("Emboss",[-2,-1,0,-1,1,1,0,1,2])}))},function(e,t){Caman.Filter.register("grungy",(function(){return this.gamma(1.5),this.clip(25),this.saturation(-60),this.contrast(5),this.noise(5),this.vignette("50%",30)}))},function(e,t){Caman.Filter.register("hazyDays",(function(){return this.gamma(1.2),this.newLayer((function(){return this.setBlendingMode("overlay"),this.opacity(60),this.copyParent(),this.filter.channels({red:5}),this.filter.stackBlur(15)})),this.newLayer((function(){return this.setBlendingMode("addition"),this.opacity(40),this.fillColor("#6899ba")})),this.newLayer((function(){return this.setBlendingMode("multiply"),this.opacity(35),this.copyParent(),this.filter.brightness(40),this.filter.vibrance(40),this.filter.exposure(30),this.filter.contrast(15),this.filter.curves("r",[0,40],[128,128],[128,128],[255,215]),this.filter.curves("g",[0,40],[128,128],[128,128],[255,215]),this.filter.curves("b",[0,40],[128,128],[128,128],[255,215]),this.filter.stackBlur(5)})),this.curves("r",[20,0],[128,158],[128,128],[235,255]),this.curves("g",[20,0],[128,128],[128,128],[235,255]),this.curves("b",[20,0],[128,108],[128,128],[235,255]),this.vignette("45%",20)}))},function(e,t){Caman.Filter.register("lomo",(function(e){return null==e&&(e=!0),this.brightness(15),this.exposure(15),this.curves("rgb",[0,0],[200,0],[155,255],[255,255]),this.saturation(-20),this.gamma(1.8),e&&this.vignette("50%",60),this.brightness(5)}))},function(e,t){Caman.Filter.register("sinCity",(function(){return this.contrast(100),this.brightness(15),this.exposure(10),this.posterize(80),this.clip(30),this.greyscale()}))},function(e,t){Caman.Filter.register("crossProcess",(function(){return this.exposure(5),this.colorize("#e87b22",4),this.sepia(20),this.channels({blue:8,red:3}),this.curves("b",[0,0],[100,150],[180,180],[255,255]),this.contrast(15),this.vibrance(75),this.gamma(1.6)}))},function(e,t){Caman.Filter.register("glowingSun",(function(e){if(null==e&&(e=!0),this.brightness(10),this.newLayer((function(){return this.setBlendingMode("multiply"),this.opacity(80),this.copyParent(),this.filter.gamma(.8),this.filter.contrast(50),this.filter.exposure(10)})),this.newLayer((function(){return this.setBlendingMode("softLight"),this.opacity(80),this.fillColor("#f49600")})),this.exposure(20),this.gamma(.8),e)return this.vignette("45%",20)}))},function(e,t){Caman.Filter.register("jarques",(function(){return this.saturation(-35),this.curves("b",[20,0],[90,120],[186,144],[255,230]),this.curves("r",[0,0],[144,90],[138,120],[255,255]),this.curves("g",[10,0],[115,105],[148,100],[255,248]),this.curves("rgb",[0,0],[120,100],[128,140],[255,255]),this.sharpen(20)}))},function(e,t){Caman.Filter.register("love",(function(){return this.brightness(5),this.exposure(8),this.contrast(4),this.colorize("#c42007",30),this.vibrance(50),this.gamma(1.3)}))},function(e,t){Caman.Filter.register("oldBoot",(function(){return this.saturation(-20),this.vibrance(-50),this.gamma(1.1),this.sepia(30),this.channels({red:-10,blue:5}),this.curves("rgb",[0,0],[80,50],[128,230],[255,255]),this.vignette("60%",30)}))},function(e,t){Caman.Filter.register("orangePeel",(function(){return this.curves("rgb",[0,0],[100,50],[140,200],[255,255]),this.vibrance(-30),this.saturation(-30),this.colorize("#ff9000",30),this.contrast(-5),this.gamma(1.4)}))},function(e,t){Caman.Filter.register("pinhole",(function(){return this.greyscale(),this.sepia(10),this.exposure(10),this.contrast(15),this.vignette("60%",35)}))},function(e,t){Caman.Filter.register("sunrise",(function(){return this.exposure(3.5),this.saturation(-5),this.vibrance(50),this.sepia(60),this.colorize("#e87b22",10),this.channels({red:8,blue:8}),this.contrast(5),this.gamma(1.2),this.vignette("55%",25)}))},function(e,t){Caman.Filter.register("vintage",(function(e){if(null==e&&(e=!0),this.greyscale(),this.contrast(5),this.noise(3),this.sepia(100),this.channels({red:8,blue:2,green:4}),this.gamma(.87),e)return this.vignette("40%",30)}))},function(e,t){var n,r,o;r=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],n=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},Caman.Plugin.register("stackBlur",(function(e){var t,i,a,l,c,s,u,f,p,d,h,m,g,b,v,y,w,x,k,S,C,E,O,_,P,T,j,R,D,M,A,I,z,B,L,N,F,U,H,W,Y,V,X,q;if(!(isNaN(e)||e<1)){for(e|=0,v=this.pixelData,l=e+e+1,(D=this.dimensions.width)<<2,M=D-1,p=(f=this.dimensions.height)-1,R=(S=e+1)*(S+1)/2,O=j=new n,d=N=1;1<=l?Nl;d=1<=l?++N:--N)O=O.next=new n,d===S&&(_=O);for(O.next=j,P=null,T=null,L=z=0,h=r[e],E=o[e],I=F=0;0<=f?Ff;I=0<=f?++F:--F){for(w=c=t=k=u=a=0,x=S*(y=v[z]),s=S*(b=v[z+1]),i=S*(g=v[z+2]),k+=R*y,u+=R*b,a+=R*g,O=j,d=U=0;0<=S?US;d=0<=S?++U:--U)O.r=y,O.g=b,O.b=g,O=O.next;for(d=H=1;1<=S?HS;d=1<=S?++H:--H)m=z+((MD;A=0<=D?++W:--W)v[z]=k*h>>E,v[z+1]=u*h>>E,v[z+2]=a*h>>E,k-=x,u-=s,a-=i,x-=P.r,s-=P.g,i-=P.b,m=L+((m=A+e+1)D;A=0<=D?++Y:--Y){for(c=t=w=u=a=k=0,x=S*(y=v[z=A<<2]),s=S*(b=v[z+1]),i=S*(g=v[z+2]),k+=R*y,u+=R*b,a+=R*g,O=j,d=V=0;0<=S?VS;d=0<=S?++V:--V)O.r=y,O.g=b,O.b=g,O=O.next;for(B=D,d=X=1;1<=e?X<=e:X>=e;d=1<=e?++X:--X)z=B+A<<2,k+=(O.r=y=v[z])*(C=S-d),u+=(O.g=b=v[z+1])*C,a+=(O.b=g=v[z+2])*C,w+=y,c+=b,t+=g,O=O.next,df;I=0<=f?++q:--q)v[m=z<<2]=k*h>>E,v[m+1]=u*h>>E,v[m+2]=a*h>>E,k-=x,u-=s,a-=i,x-=P.r,s-=P.g,i-=P.b,m=A+((m=I+S)=0&&u.splice(t,1)}function g(e){var t=document.createElement("style");return e.attrs.type="text/css",b(t,e.attrs),h(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function v(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var a=s++;n=c||(c=g(t)),r=x.bind(null,n,a,!1),o=x.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",b(t,e.attrs),h(e,t),t}(t),r=S.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=k.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var r=[],o=0;o1||"string"!=typeof t||"r"!=t[0]&&"#"!=t[0]||"string"!=typeof n&&void 0!==n)return null;window.sbcRip||(window.sbcRip=function(e){var t=e.length,n=new Object;if(t>9){if((e=e.split(",")).length<3||e.length>4)return null;n[0]=r(e[0].slice(4)),n[1]=r(e[1]),n[2]=r(e[2]),n[3]=e[3]?parseFloat(e[3]):-1}else{if(8==t||6==t||t<4)return null;t<6&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?e[4]+""+e[4]:"")),e=r(e.slice(1),16),n[0]=e>>16&255,n[1]=e>>8&255,n[2]=255&e,n[3]=9==t||5==t?o((e>>24&255)/255*1e4)/1e4:-1}return n});var r=parseInt,o=Math.round,i=t.length>9,a=(i="string"==typeof n?n.length>9||"c"==n&&!i:i,e<0),l=(e=a?-1*e:e,n=n&&"c"!=n?n:a?"#000000":"#FFFFFF",window.sbcRip(t)),c=window.sbcRip(n);return l&&c?i?"rgb("+o((c[0]-l[0])*e+l[0])+","+o((c[1]-l[1])*e+l[1])+","+o((c[2]-l[2])*e+l[2])+(l[3]<0&&c[3]<0?")":","+(l[3]>-1&&c[3]>-1?o(1e4*((c[3]-l[3])*e+l[3]))/1e4:c[3]<0?l[3]:c[3])+")"):"#"+(4294967296+16777216*(l[3]>-1&&c[3]>-1?o(255*((c[3]-l[3])*e+l[3])):c[3]>-1?o(255*c[3]):l[3]>-1?o(255*l[3]):255)+65536*o((c[0]-l[0])*e+l[0])+256*o((c[1]-l[1])*e+l[1])+o((c[2]-l[2])*e+l[2])).toString(16).slice(l[3]>-1||c[3]>-1?1:3):null}var h=function(e,t){if(!e)return null;var n=function(e){return/^#?([a-f\d])([a-f\d])([a-f\d])$/i.test(e)||/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.test(e)}(e)?e:d(0,e,"c");if(!n)return null;var r=function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}(n);return r?"rgba(".concat(r.r,", ").concat(r.g,", ").concat(r.b,", ").concat(t,")"):e};function m(e){var t="";switch(e){case"watermark":t="\\e918";break;case"reset":t="\\e912";break;case"flip-v":t="\\e916";break;case"flip-h":t="\\e914";break;case"cross":t="\\e90c";break;case"effects":t="\\e900";break;case"filters":t="\\e904";break;case"adjust":t="\\e90a";break;case"crop":t="\\e901";break;case"resize":t="\\e907";break;case"rotate":t="\\e90b";break;case"previous":t="\\e905";break;case"next":t="\\e906";break;case"ratio":t="\\e90e";break;case"no-ratio":t="\\e90f";break;case"left-rotate":t="\\e902";break;case"right-rotate":t="\\e908";break;case"focus_point":t="\\e919";break;case"shapes":t="\\e91b";break;case"image":t="\\e91a";break;case"text":t="T";break;default:return}return"\n &:before {\n content: '".concat(t,"'\n }\n ")}function g(){var e=C(["\n#filerobot-image-editor-root & {\n text-transform: ",";\n height: 20px;\n line-height: 20px;\n}\n"]);return g=function(){return e},e}function b(){var e=C(["\n#filerobot-image-editor-root & {\n background: url('","') 50% 50% / cover no-repeat;\n width: 55px;\n height: 55px;\n border-radius: 2px;\n overflow: hidden;\n display: inline-block;\n}\n"]);return b=function(){return e},e}function v(){var e=C(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: top;\n padding: 10px;\n text-align: center;\n min-width: 90px;\n height: 90px;\n cursor: pointer;\n color: ",";\n font-size: 12px;\n background: ",";\n}\n \n #filerobot-image-editor-root &:hover {\n background: ",";\n }\n"]);return v=function(){return e},e}function y(){var e=C(["\n#filerobot-image-editor-root & {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n"]);return y=function(){return e},e}function w(){var e=C(["\n#filerobot-image-editor-root & {\n height: 20px;\n line-height: 20px;\n}\n"]);return w=function(){return e},e}function x(){var e=C(["\n#filerobot-image-editor-root & {\n height: 40px;\n font-size: 40px;\n \n ",";\n ",";\n}\n"]);return x=function(){return e},e}function k(){var e=C(["\n#filerobot-image-editor-root & {\n padding: 20px 10px;\n cursor: pointer;\n display: inline-block;\n min-width: 80px;\n min-height: 100px;\n text-align: center;\n font-size: 12px;\n color: ",";\n text-transform: ",";\n background: ",";\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n background: ",";\n }\n"]);return k=function(){return e},e}function S(){var e=C(["\n#filerobot-image-editor-root & {\n height: 100px;\n width: 100%;\n overflow-x: ",";\n overflow-y: ",";\n white-space: nowrap;\n text-align: center;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n height: initial;\n padding: 0 10px\n}\n }\n"]);return S=function(){return e},e}function C(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var E=a.b.div(S(),(function(e){return e.overlayYHidden?"auto":"none"}),(function(e){return e.overlayYHidden?"hidden":"visible"}),(function(e){return e.theme.colors.border||"#3b4d54"})),O=a.b.div(k(),(function(e){return e.theme.colors.text}),(function(e){return e.noCapitalStrs?"none":e.tt||"capitalize"}),(function(e){return e.active?e.theme.colors.secondaryBg:"inherit"}),(function(e){return e.theme.colors.textHover}),(function(e){return e.theme.colors.secondaryBg})),_=a.b.div(x(),(function(e){return p(e)}),(function(e){return m(e.name)})),P=a.b.div(w()),T=a.b.div(y(),(function(e){return e.theme.colors.border||"#3b4d54"})),j=a.b.div(v(),(function(e){return e.theme.colors.text}),(function(e){return e.active?e.theme.colors.secondaryBgHover:"transparent"}),(function(e){return e.theme.colors.secondaryBgHover})),R=a.b.div(b(),(function(e){return e.src})),D=a.b.div(g(),(function(e){return e.noCapitalStrs?"none":"capitalize"}));function M(){var e=I(["\n#filerobot-image-editor-root & {\n position: relative;\n background: ",";\n z-index: 1050;\n width: 100%;\n height: 100%;\n min-height: 520px;\n overflow: ",";\n font-size: 12px;\n}\n \n #filerobot-image-editor-root & .filerobot-original-canvas {\n visibility: hidden;\n position: absolute;\n left: -99999px;\n display: none;\n }\n \n #filerobot-image-editor-root & .cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n \n #filerobot-image-editor-root & .cropper-container img {/*Avoid margin top issue (Occur only when margin-top <= -height)*/\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-wrap-box,\n #filerobot-image-editor-root & .cropper-canvas,\n #filerobot-image-editor-root & .cropper-drag-box,\n #filerobot-image-editor-root & .cropper-crop-box,\n #filerobot-image-editor-root & .cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n }\n \n #filerobot-image-editor-root & .cropper-wrap-box,\n #filerobot-image-editor-root & .cropper-canvas {\n overflow: hidden;\n }\n \n #filerobot-image-editor-root & .cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n }\n \n #filerobot-image-editor-root & .cropper-modal {\n background-color: #000;\n opacity: .5;\n }\n \n #filerobot-image-editor-root & .cropper-view-box {\n display: block;\n height: 100%;\n outline-color: rgba(255, 255, 255, 0.75);\n outline: 1px solid #fff;\n overflow: hidden;\n width: 100%;\n ",";\n }\n \n #filerobot-image-editor-root & .cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: .5;\n position: absolute;\n }\n \n #filerobot-image-editor-root & .cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: 33.33333%;\n left: 0;\n top: 33.33333%;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: 33.33333%;\n top: 0;\n width: 33.33333%;\n }\n \n #filerobot-image-editor-root & .cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: .75;\n position: absolute;\n top: 50%;\n width: 0;\n }\n \n #filerobot-image-editor-root & .cropper-center:before,\n #filerobot-image-editor-root & .cropper-center:after {\n background-color: #fff;\n content: ' ';\n display: block;\n position: absolute;\n }\n \n #filerobot-image-editor-root & .cropper-center:before {\n height: 1px;\n left: -10px;\n top: 0;\n width: 20px;\n }\n \n #filerobot-image-editor-root & .cropper-center:after {\n height: 20px;\n left: 0;\n top: -10px;\n width: 1px;\n }\n \n #filerobot-image-editor-root & .cropper-face,\n #filerobot-image-editor-root & .cropper-line,\n #filerobot-image-editor-root & .cropper-point {\n display: block;\n height: 100%;\n opacity: .1;\n position: absolute;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n ",";\n }\n \n #filerobot-image-editor-root & .cropper-line {\n background-color: #fff;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n }\n \n #filerobot-image-editor-root & .cropper-point {\n background-color: #fff;\n height: 20px;\n opacity: .90;\n width: 20px;\n border-radius: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point:before {\n content: '';\n display: table;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: black;\n opacity: 0.8;\n z-index: 11;\n position: absolute;\n top: calc(50% - 4px);\n left: calc(50% - 4px);\n }\n \n #filerobot-image-editor-root & .cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -10px;\n right: -10px;\n top: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-w {\n cursor: ew-resize;\n left: -10px;\n margin-top: -10px;\n top: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-s {\n bottom: -10px;\n cursor: s-resize;\n left: 50%;\n margin-left: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-ne {\n cursor: nesw-resize;\n right: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-nw {\n cursor: nwse-resize;\n left: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-sw {\n bottom: -10px;\n cursor: nesw-resize;\n left: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-se {\n bottom: -10px;\n cursor: nwse-resize;\n height: 20px;\n right: -10px;\n width: 20px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-se:before {\n content: '';\n display: table;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: black;\n opacity: 0.8;\n z-index: 11;\n position: absolute;\n top: calc(50% - 4px);\n left: calc(50% - 4px);\n }\n \n #filerobot-image-editor-root & .cropper-invisible {\n opacity: 0;\n }\n \n #filerobot-image-editor-root & .cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n }\n \n #filerobot-image-editor-root & .cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n }\n \n #filerobot-image-editor-root & .cropper-hidden {\n display: none !important;\n }\n \n #filerobot-image-editor-root & .cropper-move {\n cursor: move;\n }\n \n #filerobot-image-editor-root & .cropper-crop {\n cursor: crosshair;\n }\n \n #filerobot-image-editor-root & .cropper-disabled .cropper-drag-box,\n #filerobot-image-editor-root & .cropper-disabled .cropper-face,\n #filerobot-image-editor-root & .cropper-disabled .cropper-line,\n #filerobot-image-editor-root & .cropper-disabled .cropper-point {\n cursor: not-allowed;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n justify-content: space-between\n}\n }\n"]);return M=function(){return e},e}function A(){var e=I(["\n#filerobot-image-editor-root & {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n width: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n \n #filerobot-image-editor-root & *, #filerobot-image-editor-root & *:after, #filerobot-image-editor-root & *:before, #filerobot-image-editor-root & *::after, #filerobot-image-editor-root & *::before {\n box-sizing: border-box;\n }\n \n #filerobot-image-editor-root & *:after, #filerobot-image-editor-root & *:before, #filerobot-image-editor-root & *::after, #filerobot-image-editor-root & *::before {\n padding: 0;\n margin: 0;\n outline: 0;\n box-sizing: border-box;\n }\n \n /* cyrillic-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY_ZraR2Tg8w2lzm7kLNL0-w.woff2) format('woff2');\n unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;\n }\n \n /* cyrillic */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY14sYYdJg5dU2qzJEVSuta0.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n }\n \n /* greek-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY1BW26QxpSj-_ZKm_xT4hWw.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n }\n \n /* greek */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpYwt_Rm691LTebKfY2ZkKSmI.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n }\n \n /* vietnamese */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY9DiNsR5a-9Oe_Ivpu8XWlY.woff2) format('woff2');\n unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;\n }\n \n /* latin-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY6E8kM4xWR1_1bYURRojRGc.woff2) format('woff2');\n unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;\n }\n \n /* latin */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY4gp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;\n }\n"]);return A=function(){return e},e}function I(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var z=Object(a.b)("div")(A(),(function(e){return e.theme.colors.border||"#3b4d54"})),B=a.b.div(M(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.isLoading?"hidden":"auto"}),(function(e){return e.roundCrop&&"border-radius: 50%"}),(function(e){return e.roundCrop&&"\n border-radius: 50%;\n box-shadow: 0 0 80px 15px #000;\n border: 2px solid #000;"}));function L(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function N(){var e=K(["\n#filerobot-image-editor-root & {\n margin-left: 8px;\n display: inline-block;\n vertical-align: middle;\n color: ",";\n margin-bottom: 3px;\n cursor: pointer;\n}\n"]);return N=function(){return e},e}function F(){var e=K(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n line-height: 30px;\n margin-right: 10px;\n float: right;\n}\n"]);return F=function(){return e},e}function U(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n width: 10px;\n height: 10px;\n margin: 5.5px;\n background: ",";\n position: absolute; top: 0; bottom: 0;\n right: ",";\n border: 1px solid ","; \n border-radius: 12px;\n transition: all 0.3s ease-in 0s;\n}\n"]);return U=function(){return e},e}function H(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n width: 200%; \n margin-left: ",';\n transition: margin 0.3s ease-in 0s;\n}\n \n #filerobot-image-editor-root &:before, #filerobot-image-editor-root &:after {\n display: block; float: left; width: 50%; height: 19px; padding: 0; line-height: 19px;\n font-size: 10px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;\n box-sizing: border-box;\n }\n \n #filerobot-image-editor-root &:before {\n content: "ON";\n padding-left: 10px !important;\n background-color: ','; \n color: #fff;\n }\n \n #filerobot-image-editor-root &:after {\n content: "OFF";\n padding-right: 10px !important;\n background-color: ',"; \n color: #aaa;\n text-align: right;\n }\n"]);return H=function(){return e},e}function W(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n overflow: hidden; \n cursor: pointer;\n border: 1px solid ","; \n border-radius: 4px;\n margin: 0;\n}\n"]);return W=function(){return e},e}function Y(){var e=K(["\n#filerobot-image-editor-root & {\n display: none !important;\n}\n \n #filerobot-image-editor-root & :checked + .onoffswitch-label .onoffswitch-inner {\n margin-left: 0;\n}\n"]);return Y=function(){return e},e}function V(){var e=K(["\n#filerobot-image-editor-root & {\n position: relative; \n display: inline-block;\n vertical-align: middle;\n width: 60px;\n margin-bottom: 2px;\n -webkit-user-select: none; \n -moz-user-select: none; \n -ms-user-select: none;\n}\n"]);return V=function(){return e},e}function X(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return X=function(){return e},e}function q(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return q=function(){return e},e}function $(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return $=function(){return e},e}function Q(){var e=K(["\n#filerobot-image-editor-root & {\n background: ",";\n border-top: 1px solid ",";\n height: 34px;\n position: relative;\n z-index: 1;\n}\n"]);return Q=function(){return e},e}function K(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Z=a.b.div(Q(),(function(e){return e.theme.colors.secondaryBg}),(function(e){return e.theme.colors.border})),G=a.b.div($(),(function(e){return p(e)}),m("previous"),(function(e){return se(e)})),J=a.b.div(q(),(function(e){return p(e)}),m("next"),(function(e){return se(e)})),ee=a.b.div(X(),(function(e){return p(e)}),m("reset"),(function(e){return se(e)})),te=a.b.div(V()),ne=a.b.input(Y()),re=a.b.label(W(),(function(e){return e.theme.colors.border})),oe=a.b.span(H(),(function(e){return e.checked?"0":"-100%"}),(function(e){var t;return(null===(t=e.theme.colors.button)||void 0===t?void 0:t.primary)||"#01717d"}),(function(e){return e.theme.colors.primaryBg})),ie=a.b.span(U(),(function(e){return e.theme.colors.accent}),(function(e){return e.checked?"0":"37px"}),(function(e){return e.theme.colors.accent})),ae=Object(a.b)("div").attrs((function(){return{className:"cloudimage-url-generator-switch"}}))(F()),le=Object(a.b)("div")(N(),(function(e){return e.theme.colors.text})),ce=function(e){var t=e.id,n=e.handleChange,r=e.text,o=e.checked,a=e.style;L(e,["id","handleChange","text","checked","style"]);return i.a.createElement(ae,{style:a},i.a.createElement(te,null,i.a.createElement(ne,{type:"checkbox",name:t,id:t,onChange:function(){n(!o)},checked:o}),i.a.createElement(re,{htmlFor:t},i.a.createElement(oe,{checked:o}),i.a.createElement(ie,{checked:o}))),r&&i.a.createElement(le,{onClick:function(){n(!o)}},r))};function se(e){return"\n display: inline-block;\n height: 34px;\n width: 34px;\n cursor: ".concat(e.muted?"not-allowed":"pointer",";\n text-align: center;\n line-height: 34px;\n border-right: 1px solid ").concat(e.theme.colors.border,";\n \n &:hover {\n background: ").concat(e.muted?"inherit":e.theme.colors.secondaryBgHover,";\n }\n ")}function ue(){var e=ye(["\n#filerobot-image-editor-root & {\n display: ",";\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n}\n"]);return ue=function(){return e},e}function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function de(){return(de=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function me(){var e=ye(["\n#filerobot-image-editor-root & {\n width: ","px;\n height: ","px;\n display: inline-block;\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n outline: 0;\n}\n"]);return me=function(){return e},e}function ge(){var e=ye(["\n#filerobot-image-editor-root & {\n display: inline-block;\n max-height: 100%;\n max-width: 100%;\n height: 100%;\n vertical-align: middle;\n\n ",";\n\n ",";\n}\n\n /* Limit image width to avoid overflow the container */\n\n #filerobot-image-editor-root & img {\n max-width: 100% !important; /* This rule is very important, please do not ignore this! */\n }\n\n #filerobot-image-editor-root & .filerobot-edit-canvas {\n display: ",";\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n }\n"]);return ge=function(){return e},e}function be(){var e=ye(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n}\n"]);return be=function(){return e},e}function ve(){var e=ye(["\n#filerobot-image-editor-root & {\n height: calc(100% - 187px);\n text-align: center;\n line-height: calc(100% - 187px);\n padding: 20px;\n position: relative;\n}\n\n #filerobot-image-editor-root &:before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n }\n"]);return ve=function(){return e},e}function ye(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var we=a.b.div(ve()),xe=Object(a.b)("div")(be()),ke=a.b.div(ge(),(function(e){return e.hideCanvas?"\n canvas {\n position: relative;\n left: -9999px;\n }\n ":"\n &:before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n }"}),(function(e){return e.isShowWatermark&&"\ncanvas:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: red;\n opacity: 0.5;\n }"}),(function(e){return e.hide?"none":"inline-block"})),Se=Object(a.b)("canvas")(me(),(function(e){return e.width||0}),(function(e){return e.height||0})),Ce=Object(a.b)(i.a.forwardRef((function(e,t){e.width,e.height;var n=he(e,["width","height"]);return i.a.createElement("div",de({className:"focus-point"},n,{ref:t}))})))((function(e){return{width:e.width,height:e.height,position:"absolute",margin:"auto",top:0,bottom:0,left:0,right:0,display:"inline-block",maxHeight:"100%",maxWidth:"100%",verticalAlign:"middle"}})),Ee=Object(a.b)((function(e){e.image;var t=he(e,["image"]);return i.a.createElement("div",t)}))((function(e){var t=e.image;return function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:"base",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=r?f.colors.base:null;return f.colors[t][i?i+(o?"er":""):n]}function Me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"base",n=e.light?"light":e.dark?"dark":null,r="base"!==t,o=f.colors.base;return n?f.colors[n][r?o:"base"]:f.colors.link[t]}function Ae(){var e=Fe(["\n#filerobot-image-editor-root & {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100px;\n background: ",";\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-direction: column;\n height: initial\n}\n }\n"]);return Ae=function(){return e},e}function Ie(){var e=Fe(["\n#filerobot-image-editor-root & {\n background: ",";\n border-color: ",";\n color: ",";\n text-transform: ",";\n min-width: 62px;\n height: 30px;\n margin-right: 8px;\n border: 0;\n}\n\n #filerobot-image-editor-root &:hover {\n background: ",";\n border-color: ",";\n color: ","; \n }\n"]);return Ie=function(){return e},e}function ze(){var e=Fe(["\n#filerobot-image-editor-root & {\n position: absolute;\n right: 12px;\n top: 8px;\n}\n"]);return ze=function(){return e},e}function Be(){var e=Fe(["\n#filerobot-image-editor-root & {\n text-align: center;\n text-transform: ",";\n color: ",";\n}\n"]);return Be=function(){return e},e}function Le(){var e=Fe(["\n#filerobot-image-editor-root & {\n line-height: 35px;\n border-bottom: 1px solid ",";\n background: ",";\n padding: 8px 0;\n}\n"]);return Le=function(){return e},e}function Ne(){var e=Fe(["\n#filerobot-image-editor-root & {\n background: ",";\n}\n"]);return Ne=function(){return e},e}function Fe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ue=a.b.div(Ne(),(function(e){return e.theme.colors.secondaryBg})),He=a.b.div(Le(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBg})),We=a.b.div(Be(),(function(e){return e.noCapitalStrs?"none":"capitalize"}),(function(e){return e.theme.colors.text})),Ye=a.b.div(ze()),Ve=Object(a.b)(je)(Ie(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.text}),(function(e){return e.noCapitalStrs?"none":"capitalize"}),(function(e){return function(e){if(!e)return null;var t=d(-.1,e)||"";return t.toLowerCase()===e.toLowerCase()?d(.25,e):t}(e.theme.colors.primaryBg)}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.text})),Xe=a.b.div(Ae(),(function(e){return e.theme.colors.secondaryBg}));function qe(){var e=st(["\n#filerobot-image-editor-root & {\n height: 20px;\n line-height: 20px;\n}\n"]);return qe=function(){return e},e}function $e(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n height: 50px;\n}\n"]);return $e=function(){return e},e}function Qe(){var e=st(["\n#filerobot-image-editor-root & {\n height: 50px;\n line-height: 50px;\n}\n"]);return Qe=function(){return e},e}function Ke(){var e=st(["\n#filerobot-image-editor-root & {\n height: ","px;\n border: 1px solid ",";\n width: ","px;\n margin: 0 auto;\n display: inline-block;\n vertical-align: middle;\n ",";\n}\n"]);return Ke=function(){return e},e}function Ze(){var e=st(["\n#filerobot-image-editor-root & {\n padding: 15px 0;\n height: 90px;\n line-height: 100px;\n}\n"]);return Ze=function(){return e},e}function Ge(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: top;\n text-align: center;\n padding: 0 20px;\n cursor: pointer;\n background: ",";\n}\n"]);return Ge=function(){return e},e}function Je(){var e=st(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: relative;\n font-weight: bold;\n font-size: ",";\n\n ",";\n ",";\n \n color: ",";\n}\n"]);return Je=function(){return e},e}function et(){var e=st(["\n#filerobot-image-editor-root & {\n padding: 0;\n}\n \n #filerobot-image-editor-root & > span {\n color: "," !important;\n }\n"]);return et=function(){return e},e}function tt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n padding: 0 5px;\n}\n"]);return tt=function(){return e},e}function nt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: ",";\n height: 30px;\n padding: 6px 12px;\n font-size: 12px;\n line-height: 1;\n color: ",";\n background: ",";\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n vertical-align: middle;\n border: 0px solid transparent;\n font-family: Roboto, sans-serif;\n border: 1px solid ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n \n #filerobot-image-editor-root &:hover {\n outline: none;\n }\n \n #filerobot-image-editor-root &:focus {\n outline: none;\n }\n"]);return nt=function(){return e},e}function rt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: ",";\n ",";\n height: 30px;\n padding: 6px 12px;\n font-size: 12px;\n line-height: 30px;\n color: ",";\n background: ",";\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out;\n vertical-align: middle;\n font-family: Roboto, sans-serif;\n border: 1px solid ",";\n \n ",";\n}\n \n #filerobot-image-editor-root &:hover {\n outline: none;\n }\n \n #filerobot-image-editor-root &:focus {\n outline: none;\n }\n"]);return rt=function(){return e},e}function ot(){var e=st(["\n#filerobot-image-editor-root & {\n display: block;\n margin-bottom: 5px;\n line-height: 15px;\n}\n"]);return ot=function(){return e},e}function it(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: 100px;\n padding-top: 10px;\n text-align: center;\n}\n"]);return it=function(){return e},e}function at(){var e=st(["\n#filerobot-image-editor-root & {\n display: block;\n color: ",";\n height: 30px;\n line-height: 30px;\n}\n"]);return at=function(){return e},e}function lt(){var e=st(["\n@media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n overflow-x: scroll\n}\n }\n"]);return lt=function(){return e},e}function ct(){var e=st(["\n#filerobot-image-editor-root & {\n color: ",";\n display: flex;\n}\n \n @media (min-widthL 768px) {\n#filerobot-image-editor-root & {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap\n}\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-direction: column\n}\n }\n"]);return ct=function(){return e},e}function st(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ut=a.b.div(ct(),(function(e){return e.theme.colors.text})),ft=Object(a.b)("div")(lt()),pt=a.b.div(at(),(function(e){return e.theme.colors.text})),dt=a.b.div(it()),ht=a.b.label(ot()),mt=a.b.input.attrs((function(e){return{type:e.type?e.type:"text"}}))(rt(),(function(e){return e.fullSize?"100%":e.theme.fieldWidth}),(function(e){return!e.fullSize&&"max-width: 400px;"}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.border}),(function(e){return"number"===e.type&&"::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }"})),gt=Object(a.b)("input").attrs((function(e){return{type:e.type?e.type:"file"}}))(nt(),(function(e){return e.fullSize?"100%":e.theme.fieldWidth}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.border})),bt=a.b.div(tt()),vt=Object(a.b)(je)(et(),(function(e){return e.active?e.theme.colors.text:e.theme.colors.textMute})),yt=a.b.span(Je(),(function(e){return e.fz||"28px"}),(function(e){return p(e)}),(function(e){return m(e.active?"ratio":"no-ratio")}),(function(e){return e.theme.textMuted})),wt=a.b.div(Ge(),(function(e){return e.active?e.theme.colors.secondaryBgHover:"transparent"})),xt=a.b.div(Ze()),kt=a.b.div(Ke(),(function(e){return _t(e.ratio)}),(function(e){return e.theme.textColor}),(function(e){return Ot(e.ratio)}),(function(e){var t=e.radius;return t&&"border-radius: ".concat(t,"%;")})),St=Object(a.b)("div")(Qe()),Ct=Object(a.b)("div")($e()),Et=a.b.div(qe()),Ot=function(e){var t=50*e;return t>200&&(t=200),t},_t=function(e){var t=50;return 50*e>200&&(t=200/e),t};function Pt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n background: ",";\n padding: 15px;\n margin: 5px;\n border-radius: 4px;\n cursor: pointer;\n}\n \n #filerobot-image-editor-root &:hover {\n background-color: ",";\n }\n"]);return Pt=function(){return e},e}function Tt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n}\n"]);return Tt=function(){return e},e}function jt(){var e=It(["\n#filerobot-image-editor-root & {\n max-width: 600px;\n margin: 15px auto;\n background: ",";\n border-radius: 4px;\n padding: 15px;\n}\n \n #filerobot-image-editor-root & h4 {\n line-height: 1.4;\n font-size: 16px;\n color: ",";\n }\n"]);return jt=function(){return e},e}function Rt(){var e=It(["\n#filerobot-image-editor-root & {\n color: ",";\n font-size: 14px;\n max-width: 600px;\n line-height: 1.4;\n margin: 0 auto;\n background: ",";\n border-radius: 4px;\n padding: 15px 15px 15px 55px;\n position: relative;\n font-weight: normal;\n text-align: left;\n}\n \n #filerobot-image-editor-root &:before {\n content: '\\e917';\n font-family: filerobot-image-editor-font;\n position: absolute;\n font-size: 20px;\n line-height: 20px;\n left: 20px;\n top: 50%;\n margin-top: -10px;\n }\n"],["\n#filerobot-image-editor-root & {\n color: ",";\n font-size: 14px;\n max-width: 600px;\n line-height: 1.4;\n margin: 0 auto;\n background: ",";\n border-radius: 4px;\n padding: 15px 15px 15px 55px;\n position: relative;\n font-weight: normal;\n text-align: left;\n}\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e917';\n font-family: filerobot-image-editor-font;\n position: absolute;\n font-size: 20px;\n line-height: 20px;\n left: 20px;\n top: 50%;\n margin-top: -10px;\n }\n"]);return Rt=function(){return e},e}function Dt(){var e=It(["\n#filerobot-image-editor-root & button {\n min-width: 240px;\n }\n"]);return Dt=function(){return e},e}function Mt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n}\n \n @media (min-width: 768px) {\n#filerobot-image-editor-root & {\n width: 300px;\n padding: 20px;\n height: 100px\n}\n }\n"]);return Mt=function(){return e},e}function At(){var e=It(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n justify-content: center\n}\n }\n"]);return At=function(){return e},e}function It(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var zt=a.b.div(At(),(function(e){return e.theme.colors.text})),Bt=a.b.div(Mt()),Lt=Object(a.b)("div")(Dt()),Nt=Object(a.b)("p")(Rt(),(function(e){return e.theme.colors.textWarn}),(function(e){return e.theme.colors.secondaryBg})),Ft=Object(a.b)("div")(jt(),(function(e){return e.theme.colors.secondaryBg}),(function(e){return e.theme.colors.text})),Ut=Object(a.b)("div")(Tt()),Ht=Object(a.b)("div")(Pt(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBgHover}));function Wt(){var e=Qt(["\n@media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 50%;\n margin-right: 0 !important\n}\n }\n"]);return Wt=function(){return e},e}function Yt(){var e=Qt(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n height: 16px;\n font-size: 16px;\n margin-top: -4px;\n display: inline-block;\n vertical-align: middle;\n color: ",";\n margin-right: 5px;\n}\n"]);return Yt=function(){return e},e}function Vt(){var e=Qt(["\n#filerobot-image-editor-root & {\n display: flex;\n width: 100%;\n flex-wrap: wrap;\n justify-content: center;\n}\n"]);return Vt=function(){return e},e}function Xt(){var e=Qt(["\n#filerobot-image-editor-root & {\n margin-top: 10px;\n width: 100%;\n}\n \n #filerobot-image-editor-root & button {\n text-transform: none;\n font-size: 12px;\n min-width: 142px;\n margin-right: 5px;\n }\n \n #filerobot-image-editor-root & button:focus, #filerobot-image-editor-root & button:active {\n outline: none !important;\n box-shadow: none !important;\n }\n"]);return Xt=function(){return e},e}function qt(){var e=Qt(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: 100%;\n}\n"]);return qt=function(){return e},e}function $t(){var e=Qt(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n}\n \n #filerobot-image-editor-root & svg {\n margin-top: -7px;\n width: 750px;\n }\n \n #filerobot-image-editor-root & svg text {\n font-size: 2px;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper {\n width: 280px;\n padding: 0;\n margin: 12px auto 0;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range {\n background: none;\n width: 280px;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 9px;\n height: 18px;\n border-radius: 50%;\n background: ",";\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range::-moz-range-thumb {\n border: none;\n width: 9px;\n height: 18px;\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper label {\n display: none;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper :after {\n display: none;\n }\n \n @media (max-width: 768px) {\n #filerobot-image-editor-root & svg {\n width: 100%;\n }\n }\n"]);return $t=function(){return e},e}function Qt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Kt=a.b.div($t(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text})),Zt=a.b.div(qt()),Gt=a.b.div(Xt()),Jt=Object(a.b)("div")(Vt()),en=a.b.span(Yt(),(function(e){return p(e)}),(function(e){return m(e.name)}),(function(e){return e.theme.colors.text})),tn=Object(a.b)(Ve)(Wt());function nn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n display: flex;\n justify-content: center;\n width: fit-content;\n margin: 0 auto;\n}\n\n #filerobot-image-editor-root & div {\n margin-left: 10px;\n }\n\n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-wrap: wrap\n}\n \n #filerobot-image-editor-root & .image-editor-range-wrapper {\n width: 50%;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input {\n width: 100% !important;\n }\n }\n"]);return nn=function(){return e},e}var rn=a.b.div(nn(),(function(e){return e.theme.colors.text}));function on(){var e=ln(["\n#filerobot-image-editor-root & {\n position: absolute;\n z-index: 999;\n top: 36px;\n left: 0;\n right: 0;\n height: 104px;\n cursor: not-allowed;\n}\n"]);return on=function(){return e},e}function an(){var e=ln(["\n#filerobot-image-editor-root & {\n position: absolute;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n cursor: wait;\n}\n"]);return an=function(){return e},e}function ln(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var cn=a.b.div(an()),sn=Object(a.b)("div")(on());function un(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\e90c'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e90c'\n }\n"]);return un=function(){return e},e}a.b.span.attrs((function(){return{role:"button"}}))(un(),(function(e){return e.t||"10px"}),(function(e){return e.r||"10px"}),(function(e){return e.l||"auto"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"18px"}),(function(e){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function fn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\26F6'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\26F6'\n }\n"]);return fn=function(){return e},e}var pn=a.b.span.attrs((function(){return{role:"button"}}))(fn(),(function(e){return e.t||"18px"}),(function(e){return e.r||"auto"}),(function(e){return e.l||"20px"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"15px"}),(function(e){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function dn(){var e=mn(["\n#filerobot-image-editor-root & {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 200px;\n height: 200px;\n margin: auto;\n padding: 40px;\n border-radius: 50%;\n background: ",";\n}\n \n #filerobot-image-editor-root & .svg-spin-icon {\n fill: ",";\n }\n \n #filerobot-image-editor-root & p {\n color: ",";\n }\n"]);return dn=function(){return e},e}function hn(){var e=mn(["\n#filerobot-image-editor-root & {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: ",";\n background: "," !important;\n opacity: "," !important;\n z-index: 1042;\n}\n"]);return hn=function(){return e},e}function mn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var gn=a.b.div(hn(),(function(e){return e.fullScreen?"fixed":"absolute"}),(function(e){return e.overlay?"rgba(10,10,10,0.26)":"transparent"}),(function(e){return e.overlay?"0.25":"0"})),bn=Object(a.b)("div")(dn(),(function(e){return e.theme.colors.secondaryBgOpacity}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text})),vn=function(e){return e.show?i.a.createElement(o.Fragment,null,i.a.createElement(gn,{fullScreen:e.fullScreen,overlay:e.overlay}),i.a.createElement(bn,null,i.a.createElement("svg",{id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 150 150",style:{enableBackground:"new 0 0 150 150"}},i.a.createElement("path",{className:"svg-spin-icon",d:"M74.9,14.8c-12.2,0-24.3,0-36.5,0c-2.4,0-3.9-1-4.8-3.1c-1.3-3-1.2-6,0.6-8.9c0.8-1.3,2-2,3.5-2\r c1.1,0,2.3,0,3.4,0c23.3,0,46.7,0,70-0.1c3.9,0,5.3,1.9,6,4.7c0.5,2.1,0.4,4.2-0.5,6.3c-0.9,2.2-2.5,3.1-4.8,3c-2.9,0-5.7,0-8.6,0\r C93.9,14.8,84.4,14.8,74.9,14.8z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M75.1,118.1c12,0,24,0,35.9,0c4,0,5.9,1.7,6.3,5.7c0.1,1.4,0,2.9-0.3,4.2c-0.7,2.9-2.4,4.1-5.3,4.1\r c-24.1,0-48.3,0-72.4,0c-3.7,0-5.4-1.2-6.3-5.3c-0.4-2-0.1-3.9,0.7-5.7c0.9-2,2.4-3.1,4.7-3C50.6,118.1,62.9,118.1,75.1,118.1z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M75.3,76.3c0.2,0.4,3.1,9.3,7.2,14.1c3.9,4.7,8.9,8.5,13,12.5c3.2,3.2,5.4,7,6.8,11.2c0.5,1.6,0.3,1.9-1.4,1.9\r c-17.3,0-34.5,0-51.8,0c-1.7,0-1.9-0.2-1.3-1.8c1.8-5.5,5.2-10,9.4-13.9c3.5-3.3,7.7-6.1,10.6-9.9c3.5-4.7,6.8-13.3,7.1-14.1\r C75.1,76.3,75.2,76.3,75.3,76.3z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M45.5,23.6c0,3.8-0.1,7.6,1.2,11.3c1,2.9,2.8,5.2,4.9,7.3c5,5.3,10.2,10.5,15.2,15.8c1.1,1.2,2,2.6,3.1,3.9\r c2,2.5,2.2,7.6-0.2,10.5c-1.8,2.2-3.6,4.3-5.5,6.4C59.5,84,54.7,89.1,50,94.2c-3.1,3.4-4.4,7.5-4.5,12c0,2.8-0.1,5.6,0,8.4\r c0,1-0.3,1.4-1.4,1.4c-1.7,0-2.3,0-3.7,0c-0.9,0-1.3-0.4-1.3-1.3c0-5-0.3-10,0.8-14.9c0.8-3.5,2.5-6.6,4.8-9.3\r c3.6-4.2,7.5-8.2,11.3-12.3c1.7-1.8,3.3-3.7,4.9-5.5c0.9-1,1.9-2,2.7-3c1.8-2.3,1.6-4.3-0.4-6.4c-5.2-5.4-10.4-11-15.8-16.3\r c-5.7-5.7-8.4-12.4-8.3-20.4c0-2.9,0-5.7,0-8.6c0-1.1,0.4-1.6,1.5-1.5c1.3,0,2.6,0,3.8,0c0.8,0,1.1,0.3,1.1,1.2\r C45.5,19.8,45.5,21.7,45.5,23.6z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M109.9,35.9c-0.6,2.7-2.1,5.3-3.9,7.5c-3.5,4.2-7.5,8.1-11.2,12.1c-3,3.2-5.9,6.5-8.8,9.7\r c-0.9,1-0.9,2.1-0.2,3.1c1.2,1.7,2.5,3.3,3.8,4.8c1.5,1.8,3,3.6,4.6,5.3c3.4,3.6,6.8,7.1,10.1,10.7c4.7,5.1,6.8,11.2,6.9,18.1\r c0,2.4,0,5,0,7.5c0,1.3-0.3,1.5-1.6,1.5c-1.3,0-2.1,0-3.3,0c-1.1,0-1.5-0.4-1.5-1.5c0-3.4-0.2-6.7-0.3-10.1\r c-0.1-4.1-1.9-7.5-4.5-10.5c-3.3-3.8-6.8-7.4-10.2-11.1c-3.3-3.5-6.9-6.6-9.3-10.8c-0.8-1.5-1.4-3.2-1.7-4.9c-0.4-2.1,0.7-4,1.9-5.5\r c3.1-3.8,6.5-7.4,9.8-11.1c2.9-3.2,6-6.2,9-9.3c3.5-3.6,5.1-8,5.2-13c0-3.4,0.1-6.7,0.1-10.1c0-1.1,0.3-1.5,1.3-1.4\r c1.2,0,2.4,0,3.6,0c1.2,0,1.6,0.5,1.6,1.6c-0.1,1.6,0,3.1,0,4.7C111.4,23,110.9,31.7,109.9,35.9z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M74.8,67.9c-0.2-1.3-1.1-5.7-1.5-7C71.4,54,59.7,44.3,54.3,39c-0.7-0.7-1.3-1.5-1.8-2.5\r c7.1,3.4,14.4,6.1,22.6,6.1c8.2,0,15.5-2.6,22.4-6.2c0.1,0.1,0.2,0.2,0.3,0.3c-0.5,0.6-0.9,1.2-1.4,1.8c-4.5,4.5-18.7,15.5-20,22.4\r c-0.2,0.8-1,6.2-1.2,7C75.1,67.9,75,67.9,74.8,67.9z"}),i.a.createElement("g",null)),i.a.createElement("p",{style:{textAlign:"center"}},e.label))):null};function yn(){var e=jn(["\n#filerobot-image-editor-root & {\n width: 200px;\n height: 70px;\n display: inline-block;\n vertical-align: middle;\n background: "," url(",") 50% 50% / contain no-repeat; \n margin: 10px;\n padding: 20px;\n border-radius: 4px;\n cursor: pointer;\n}\n \n #filerobot-image-editor-root &:hover {\n background-color: ",";\n }\n"]);return yn=function(){return e},e}function wn(){var e=jn(["\n#filerobot-image-editor-root & {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n line-height: 100px;\n background: ",";\n}\n"]);return wn=function(){return e},e}function xn(){var e=jn(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n margin-left: 20px;\n cursor: pointer;\n}\n"]);return xn=function(){return e},e}function kn(){var e=jn(["\n#filerobot-image-editor-root & {\n width: 30px;\n height: 30px;\n display: inline-block;\n vertical-align: top;\n border: 1px solid ",";\n background: ",";\n cursor: ",";\n \n ",";\n}\n"]);return kn=function(){return e},e}function Sn(){var e=jn(["\n#filerobot-image-editor-root & {\n width: 100px;\n padding: 10px;\n display: inline-block;\n vertical-align: top;\n}\n \n /* The container */\n \n #filerobot-image-editor-root & label {\n display: block;\n position: relative;\n line-height: 12px;\n padding-left: 15px;\n margin-bottom: 12px;\n cursor: pointer;\n user-select: none;\n }\n \n /* Hide the browser's default radio button */\n \n #filerobot-image-editor-root & label input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n }\n \n /* Create a custom radio button */\n \n #filerobot-image-editor-root & span {\n position: absolute;\n top: 0;\n left: 0;\n height: 10px;\n width: 10px;\n background-color: ",";\n border-radius: 50%;\n }\n \n /* On mouse-over, add a grey background color */\n \n #filerobot-image-editor-root & label:hover input ~ span {\n /* background-color: #ccc; */\n }\n \n /* When the radio button is checked, add a blue background */\n \n #filerobot-image-editor-root & label input:checked ~ span {\n background-color: ",";\n }\n \n #filerobot-image-editor-root & label input:checked ~ span:after {\n background-color: ",';\n }\n \n /* Create the indicator (the dot/circle - hidden when not checked) */\n \n #filerobot-image-editor-root & span:after {\n content: "";\n position: absolute;\n display: none;\n }\n \n /* Show the indicator (dot/circle) when checked */\n \n #filerobot-image-editor-root & label input:checked ~ span:after {\n display: block;\n }\n \n /* Style the indicator (dot/circle) */\n \n #filerobot-image-editor-root & label span:after {\n top: 3px;\n left: 2px;\n width: 6px;\n height: 5px;\n border-radius: 50%;\n background: ',";\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%\n}\n \n #filerobot-image-editor-root & label {\n display: inline-block;\n margin-right: 10px;\n }\n }\n"]);return Sn=function(){return e},e}function Cn(){var e=jn(["\n#filerobot-image-editor-root & {\n width: 100px;\n padding: 5px;\n display: inline-block;\n font-size: 0;\n}\n \n #filerobot-image-editor-root & div:nth-child(1) {\n border-radius: 4px 0 0 0;\n }\n \n #filerobot-image-editor-root & div:nth-child(3) {\n border-radius: 0 4px 0 0;\n }\n \n #filerobot-image-editor-root & div:nth-child(7) {\n border-radius: 0 0 0 4px;\n }\n \n #filerobot-image-editor-root & div:nth-child(9) {\n border-radius: 0 0 4px 0;\n }\n"]);return Cn=function(){return e},e}function En(){var e=jn(["\n#filerobot-image-editor-root & {\n width: calc(100% - 200px);\n display: inline-block;\n vertical-align: top;\n padding: 0 40px;\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n padding: 0\n}\n }\n"]);return En=function(){return e},e}function On(){var e=jn(["\n#filerobot-image-editor-root & {\n display: inline;\n vertical-align: middle;\n padding: 10px;\n}\n\n #filerobot-image-editor-root & label {\n min-width: 120px;\n display: inline-block;\n vertical-align: middle;\n }\n"]);return On=function(){return e},e}function _n(){var e=jn(["\n#filerobot-image-editor-root & {\n ",";\n}\n"]);return _n=function(){return e},e}function Pn(){var e=jn(["\n#filerobot-image-editor-root & {\n padding: 10px;\n}\n \n #filerobot-image-editor-root & label {\n min-width: 120px;\n display: inline-block;\n vertical-align: middle;\n margin: 0;\n }\n \n #filerobot-image-editor-root & input {\n width: 100%;\n }\n"]);return Pn=function(){return e},e}function Tn(){var e=jn(["\n#filerobot-image-editor-root & {\n position: relative;\n color: ",";\n text-align: left;\n white-space: normal;\n width: fit-content;\n margin: 0 auto;\n}\n \n #filerobot-image-editor-root & .image-editor-range {\n display: inline-block;\n padding: 5px;\n vertical-align: middle;\n }\n \n #filerobot-image-editor-root & .image-editor-range :after {\n display: none;\n }\n \n #filerobot-image-editor-root & .image-editor-range label {\n display: none;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n align-items: center\n}\n \n #filerobot-image-editor-root & .image-editor-range {\n width: 100%;\n }\n \n #filerobot-image-editor-root & .image-editor-range input {\n width: 100% !important;\n }\n }\n"]);return Tn=function(){return e},e}function jn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Rn=a.b.div(Tn(),(function(e){return e.theme.colors.text})),Dn=Object(a.b)("div")(Pn()),Mn=Object(a.b)("div")(_n(),(function(e){return"right"===e.switcherPosition?".cloudimage-url-generator-switch {\n margin-left: 100px;\n margin-top: -6px;\n \n label {\n min-width: auto;\n }\n \n @media (max-width: 768px) {\n margin-left: 4px;\n }\n }":"padding: 10px;"})),An=Object(a.b)("div")(On()),In=Object(a.b)("div")(En()),zn=Object(a.b)("div")(Cn()),Bn=Object(a.b)("div")(Sn(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.accent}),(function(e){return e.theme.colors.text})),Ln=Object(a.b)("div")(kn(),(function(e){return e.theme.colors.secondaryBgHover}),(function(e){var t;return e.clickable?e.active?(null===(t=e.theme.colors.button)||void 0===t?void 0:t.primary)||e.theme.colors.primaryBg:e.theme.colors.accent:e.theme.colors.disabledBg}),(function(e){return e.clickable?"pointer":"not-allowed"}),(function(e){if(0!==e.clickable&&!e.active)return"\n &:hover {\n background: ".concat(e.theme.colors.primaryBg,";\n }\n ")})),Nn=(Object(a.b)("div")(xn()),Object(a.b)("div")(wn(),(function(e){return e.theme.colors.secondaryBg}))),Fn=Object(a.b)("div")(yn(),(function(e){return e.theme.colors.primaryBgHover}),(function(e){return e.src}),(function(e){return e.theme.colors.secondaryBgHover}));function Un(e){return(Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wn(e){for(var t=1;t1&&m)&&(-1!==h||1!==d.length);return i.a.createElement(Z,null,i.a.createElement(ee,{muted:"preview"!==s,onClick:function(){"preview"===s&&c()},title:u["footer.reset"]}),i.a.createElement(G,{onClick:function(){!g&&l({operationIndex:h-1,operationObject:Wn(Wn({},d[h]),{},{index:h})})},muted:g,title:u["footer.undo"]}),i.a.createElement(J,{onClick:function(){!b&&l({operationIndex:h+1,operationObject:Wn(Wn({},d[h]),{},{index:h})})},muted:b,title:u["footer.redo"]}),f&&p&&i.a.createElement(ce,{id:"switch-watermark-footer",checked:p&&p.applyByDefault,handleChange:this.onApplyWatermarkChange,text:u["common.apply_watermark"]}))}}])&&Vn(t.prototype,n),r&&Vn(t,r),a}(o.Component),Jn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"filerobot";return"filerobot"===t?"https://api.filerobot.com/".concat(e,"/v3/"):"https://".concat(e,".api.airstore.io/v1/")},er="filerobot-image-editor-modal",tr="filerobot-image-edit-box",nr="filerobot-image-edit-box-original",rr=["adjust","effects","filters","rotate","crop","resize","watermark","shapes","image","text"],or=["edge_enhance","emboss","grungy","hazy","lomo","radial_blur","sin_city","tilt_shift"],ir=["cross_process","glow_sun","jarques","love","old_boot","orange_peel","pin_hole","sepia","sun_rise","vintage"],ar=["crop","resize","rotate","watermark","focus_point"],lr=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],cr={corners:[1,0,1,0,0,0,1,0,1],star:[0,1,0,1,1,1,0,1,0],center:[0,0,0,0,1,0,0,0,0],"top-row":[1,1,1,0,0,0,0,0,0],"center-row":[0,0,0,1,1,1,0,0,0],"bottom-row":[0,0,0,0,0,0,1,1,1]},sr={opacity:.7,position:"center",url:"",applyByDefault:!1},ur=[{label:"Arial",value:"Arial"},{label:"Tahoma",value:"Tahoma"},{label:"Times New Roman",value:"Times New Roman"},{label:"Courier",value:"Courier"},{label:"Courier New",value:"Courier New"},{label:"Verdana",value:"Verdana"},{label:"Georgia",value:"Georgia"},{label:"Palatino",value:"Palatino"},{label:"Garamond",value:"Garamond"},{label:"Bookman",value:"Bookman"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Candara",value:"Candara"},{label:"Impact",value:"Impact"}],fr=[{label:"Arial",value:"Arial"},{label:"Arial Bold",value:"Arial-Bold"},{label:"Arial Black",value:"Arial-Black"},{label:"AvantGarde Book",value:"AvantGarde-Book"},{label:"Bitstream Charter",value:"Bitstream-Charter"},{label:"Bitstream Charter Bold",value:"Bitstream-Charter-Bold"},{label:"Bookman Demi",value:"Bookman-Demi"},{label:"Comic Sans MS",value:"Comic-Sans-MS"},{label:"Courier",value:"Courier"},{label:"Courier Bold",value:"Courier-Bold"},{label:"Courier New",value:"Courier-New\t"},{label:"Courier New Bold",value:"Courier-New-bold"},{label:"DejaVu Sans",value:"DejaVu-Sans"},{label:"DejaVu Sans Bold",value:"DejaVu-Sans-bold"},{label:"Dingbats",value:"Dingbats"},{label:"fixed",value:"fixed"},{label:"FreeMono",value:"FreeMono"},{label:"FreeMono Bold",value:"FreeMono-Bold"},{label:"FreeSans",value:"FreeSans-Bold"},{label:"Halvetica",value:"Halvetica"},{label:"Georgia",value:"Georgia"},{label:"Impact",value:"Impact"},{label:"Noto mono",value:"Noto-Mono"}],pr="rect",dr="square",hr="circle",mr="image",gr="text",br={hideCloudimageSwitcher:!0,processWithCloudimage:!1,uploadWithCloudimageLink:!1,elementId:null,isLowQualityPreview:!0,reduceBeforeEdit:{mode:"manual",widthLimit:2e3,heightLimit:2e3},cropBeforeEdit:null,cropPresets:[{name:"original",value:0},{name:"square",value:1},{name:"banner",value:7.8},{name:"round",value:1,radius:50},{name:"5 : 4",value:1.25},{name:"4 : 3",value:1.33333},{name:"6 : 4",value:1.5},{name:"16 : 9",value:1.7777}],resizePresets:[{name:"big square",width:600,height:600,ratio:1},{name:"middle square",width:400,height:400,ratio:1},{name:"small square",width:200,height:200,ratio:1},{name:"small size",width:1200,height:960,ratio:1.25},{name:"better quality",width:1920,height:1536,ratio:1.25},{name:"small size",width:1200,height:900,ratio:1.33333},{name:"better quality",width:1920,height:1440,ratio:1.33333},{name:"small size",width:1200,height:800,ratio:1.5},{name:"better quality",width:1920,height:1280,ratio:1.5},{name:"small size",width:1200,height:675,ratio:1.7777},{name:"better quality",width:1920,height:1080,ratio:1.7777},{name:"small banner",width:468,height:60,ratio:7.8},{name:"big banner",width:936,height:120,ratio:7.8}]},vr="close-button-clicked",yr="toolbar-cancel-button-clicked",wr="esc-key-pressed",xr="modal-overlay-clicked",kr="image-edits-completed",Sr="image-downloaded",Cr="image-uploaded-filerobot",Er="image-uploaded-cloudimage",Or="image-uploading-fail-filerobot",_r="new",Pr="duplicate",Tr="replace",jr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return window.document.querySelector("#".concat(e,"_").concat(t||(n?nr:tr)))},Rr=function(e){switch(e){case"colorize":return"colorize";case"contrast":return"contrast";case"cross_process":return"crossProcess";case"glow_sun":return"glowingSun";case"hdr_effect":return"hdr";case"jarques":return"jarques";case"love":return"love";case"old_boot":return"oldBoot";case"orange_peel":return"orangePeel";case"pin_hole":return"pinhole";case"pleasant":return"pleasant";case"sepia":return"sepia";case"sun_rise":return"sunrise";case"vintage":return"vintage";case"clarity":return"";case"edge_enhance":return"edgeEnhance";case"emboss":return"emboss";case"grungy":return"grungy";case"hazy":return"hazyDays";case"lomo":return"lomo";case"noise":return"noise";case"old_paper":return"oldPaper";case"posterize":return"posterize";case"radial_blur":return"radialBlur";case"sin_city":return"sinCity";case"tilt_shift":return"tiltShift";default:return null}},Dr=function(e){switch(e){case"colorize":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/colorize.jpg";case"contrast":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/contrast.png";case"cross_process":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/cross_process.png";case"glow_sun":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/glow_sun.png";case"hdr_effect":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/hdr_effect.png";case"jarques":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/jarques.png";case"love":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/love.png";case"old_boot":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/old_boot.png";case"orange_peel":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/orange_peel.png";case"pin_hole":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/pin_hole.png";case"pleasant":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/pleasant.png";case"sepia":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/sepia.png";case"sun_rise":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/sun_rise.png";case"vintage":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/vintage.png";case"clarity":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/clarity.png";case"edge_enhance":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/edge_enhance.png";case"emboss":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/emboss.png";case"grungy":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/grungy.png";case"hazy":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/hazy.png";case"lomo":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/lomo.png";case"noise":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/noise.png";case"old_paper":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/old_paper.png";case"posterize":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/posterize.png";case"radial_blur":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/radial_blur.png";case"sin_city":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/sin_city.png";case"tilt_shift":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/tilt_shift.png";default:return""}},Mr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/_/g," ")},Ar=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"filerobot";return"filerobot"===e?"X-Filerobot-Key":"X-Airstore-Secret-Key"};function Ir(e){return function(e){if(Array.isArray(e))return zr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"center",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t.getBoundingClientRect(),i=.3,a=o.height*i,l=o.width*i;if(ln?n=(r=a)*c:r=(n=l)/c}var s=o.width/2-n/2,u=o.height/2-r/2;if("center"===e)return[s,u,n,r];e=e.split("-");var f=.015,p=o.width*f,d=o.height*f,h=o.width-n-p,m=o.height-r-d;return[].concat(Ir(e.map((function(e,t){return"center"===e?0===t?s:u:"right"===e?h:"bottom"===e?m:"left"===e?p:"top"===e?d:void 0}))),[n,r])},Lr=n(16),Nr=n.n(Lr);function Fr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ur(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ur(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:2;return parseFloat(e).toFixed(t)},Yr=n(17),Vr=n.n(Yr),Xr=n(10),qr=n.n(Xr);CanvasRenderingContext2D.prototype.roundRect=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return o?(n<2*o&&(o=n/2),r<2*o&&(o=r/2)):o=n>=r?n/2:r/2,this.beginPath(),this.moveTo(e+o,t),this.arcTo(e+n,t,e+n,t+r,o),this.arcTo(e+n,t+r,e,t+r,o),this.arcTo(e,t+r,e,t,o),this.arcTo(e,t,e+n,t,o),this.closePath(),this},CanvasRenderingContext2D.prototype.round=function(){var e=this.canvas,t=e.width,n=e.height;return this.imageSmoothingEnabled=!0,this.globalCompositeOperation="destination-in",this.strokeStyle="transparent",this.lineWidth=1,this.beginPath(),this.roundRect(0,0,t,n,Math.max(t,n)),this.fill(),this.globalCompositeOperation="source-over",this};CanvasRenderingContext2D,Number.prototype.mapNumber=function(e,t,n,r){return(this-e)*(r-n)/(t-e)+n};function $r(e){return($r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qr(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Kr(e){return function(e){if(Array.isArray(e))return Zr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Zr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.props.config.elementId;return jr(r,t,n)})),ao(oo(e),"initializeCanvases",(function(t){var n=oo(e),r=e.props,o=r.config,i=(o=void 0===o?{}:o).isLowQualityPreview,a=r.updateState,l=1;if(i&&t.height>1050){var c=e.getCanvas(null,!0),s=c.getContext("2d");c.width=t.width,c.height=t.height,s.drawImage(t,0,0,t.width,t.height),l=t.height/800;var u=t.width/l,f=t.height/l;a({initialZoom:l,canvasOriginal:n.cloneCanvas(c)}),setTimeout((function(){var t=e.getCanvas;new window.Caman(t(),(function(){this.resize({width:u,height:f}),this.render((function(){var e=n.replaceWithNewCanvas(tr);n.CamanInstanceZoomed=new window.Caman(e,(function(){n.CamanInstanceOriginal=new window.Caman(t(null,!0),(function(){})),a({isShowSpinner:!1,canvasZoomed:n.cloneCanvas(e)})}))}))}))}))}else setTimeout((function(){var t=e.getCanvas();n.CamanInstance=new window.Caman(t,(function(){a({isShowSpinner:!1,canvasOriginal:n.cloneCanvas(t)})}))}))})),ao(oo(e),"mergeCanvases",(function(t){var n=e.props.shapeOperations,r=t.getContext("2d"),o=n.prepareFinalCanvas(t);return r.drawImage(o,0,0),t.toDataURL()})),ao(oo(e),"cloneCanvas",(function(e){var t=document.createElement("canvas"),n=t.getContext("2d");return t.width=e.width,t.height=e.height,t.id=e.id,t.className=e.className,n.drawImage(e,0,0),t})),ao(oo(e),"replaceWithNewCanvas",(function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.getCanvas(t),o=r.width,i=r.height,a=document.createElement("canvas"),l=a.getContext("2d"),c=r.parentElement;return c.removeChild(r),a.width=o,a.height=i,a.id="".concat(e.props.config.elementId,"_").concat(t),a.className=r.className,l.drawImage(r,0,0),n&&l.round(),c.appendChild(a),a})),ao(oo(e),"replaceCanvas",(function(t,n){var r=e.getCanvas(n),o=r.parentElement;return o.removeChild(r),o.appendChild(t),t})),ao(oo(e),"saveImage",(function(){var t=e.props,n=t.onComplete,r=t.onClose,o=t.updateState,i=t.closeOnLoad,a=t.config,l=t.processWithCloudService,c=t.uploadCloudimageImage,s=t.operations,u=t.initialZoom,f=t.operationsOriginal,p=e.getFinalImageMime(),d=e.getFinalImageName(),h=a.filerobot,m=void 0===h?{}:h,g=a.platform,b=void 0===g?"filerobot":g,v=m.imageMeta,y=m.imageProperties,w=m.imageName,x=m.saveMode,k=void 0===x?Pr:x,S=e.props.src.split("?")[0],C=1!==u?nr:tr,E=e.getCanvas(C),O=function(e,t,n){return e?e+"/":Jn(t,n)}(m.baseAPI,m.container,b),_=(m.uploadParams||{}).dir||"image-editor",P=oo(e);if(l){var T=(1!==u?f:s).filter((function(e){var t=e.operation;return ar.includes(t)})),j=e.generateCloudimageURL(T,S.replace(/https?:\/\/scaleflex.ultrafast.io\//,""));if(c){var R=new XMLHttpRequest;R.addEventListener("load",e.onFileLoad),R.open("POST",[O,"upload?dir=".concat(_)].join("")),R.setRequestHeader(Ar(b),m.uploadKey),R.setRequestHeader("Content-Type","application/json"),R.send(JSON.stringify({files_urls:[j]}))}else o({isShowSpinner:!1,isHideCanvas:!1}),n(j,{url_permalink:j,url_public:j,url:{public:j,permalink:j}}),i&&r(Er)}else{e.mergeCanvases(E);var D=function(e,t,n){t=t||"",n=n||512;for(var r=atob(e),o=[],i=0;i0&&B.append("properties[file]",JSON.stringify(y)),v&&Object.keys(v).length>0&&B.append("meta[file]",JSON.stringify(v))),L.open("POST",[O,"upload?dir=".concat(_)].join("")),L.setRequestHeader(Ar(b),m.uploadKey),L.send(B)}})),ao(oo(e),"getResultCanvas",(function(){var t=1!==e.props.initialZoom?nr:tr,n=e.getCanvas(t);return e.mergeCanvases(n),n})),ao(oo(e),"getFinalImageMime",(function(){var t=e.props,n=t.roundCrop,r=t.imageMime;return n?"image/png":r})),ao(oo(e),"getFinalImageName",(function(){var t=e.props.roundCrop,n=e.state.imageName;return t&&(n=n.replace(n.substr(n.lastIndexOf(".")+1),"png")),n})),ao(oo(e),"downloadImage",(function(t){var n,r=e.getResultCanvas(),o=e.getFinalImageName(),i=e.getFinalImageMime(),a=document.createElement("a");a.download=o,a.href=r.toDataURL(i,.8),document.createEvent?((n=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),a.dispatchEvent(n)):a.fireEvent&&a.fireEvent("onclick"),t&&t()})),ao(oo(e),"onFileLoad",(function(t){var n=e.props,r=n.onComplete,o=n.onClose,i=n.updateState,a=n.closeOnLoad,l=t.srcElement,c=(void 0===l?{}:l).response,s=void 0===c?"{}":c,u=JSON.parse(s)||{};if("success"===u.status){var f=u.file,p=void 0===f?{}:f,d=function(e){return e.url&&e.url.public?e.url.public:e.url_public?e.url_public:""}(p);if(!d)return;i({isShowSpinner:!1,isHideCanvas:!1}),r(d,p),a&&o(Cr)}else i({isShowSpinner:!1,isHideCanvas:!1}),alert(u),a&&o(Or)})),ao(oo(e),"generateCloudimageURL",(function(t,n){var r=e.props,o=r.config,i=r.watermark,a=r.logoImage,l=r.processWithCloudimage,c=r.processWithFilerobot,s=r.imageSealing,u=o.cloudimage,f=void 0===u?{}:u,p=o.filerobot,d=void 0===p?{}:p,h=l&&f.token+".cloudimg.io/"+(f.version?"".concat(f.version,"/"):"v7/"),m=c&&d.token+".filerobot.com/"+(d.version?"".concat(d.version,"/"):""),g=m||h||"";g=(g?"https://":"")+g;var b=(m?d.doNotPrefixURL:f.doNotPrefixURL)?"":g,v=e.isOperationExist(t,"crop"),y=e.isOperationExist(t,"resize"),w=e.isOperationExist(t,"rotate"),x=e.isOperationExist(t,"focus_point"),k=i&&a&&i.applyByDefault,S="",C="",E="",O="",_="";v&&(S=e.getCropArguments(v.props)),y&&(C=(S?"&":"")+e.getResizeArguments(y.props)),w&&(E=(S||C?"&":"")+e.getOrientationArguments(w.props)),k&&(O=(S||C||E?"&":"")+e.getWatermarkArguments()),x&&(_=(S||C||E||O?"&":"")+e.getFocusPointArguments(x.props)),n=(n=n.split("?")[0]).replace(b,"");var P=S+C+E+O+_;return s.enabled&&(P=function(e,t,n){var r=t||{},o=r.salt,i=r.char_count,a=r.include_params,l=Array.isArray(a);if(l&&0===a.length)return e;var c="",s="";if(l){var u=[],f=[];e.split("&").forEach((function(e){var t=Fr(e.split("="),1)[0];a.indexOf(t)>-1?u.push(e):f.push(e)})),f.length>0&&(s=f.join("&")),c=Hr(u.join("&"),n,o,i)}else c=Hr(e,n,o,i);return[c,s].filter((function(e){return e})).join("&")}(P,s,n.replace(g,""))),b+n+(P?"?":"")+P})),ao(oo(e),"initFiltersOrEffects",(function(){})),ao(oo(e),"applyFilterOrEffect",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=e.props,o=r.updateState,i=r.initialZoom;e.props[t]&&o({isHideCanvas:!0,isShowSpinner:!0},(function(){1!==i?(e.CamanInstanceOriginal.revert(!1),e.CamanInstanceOriginal[Rr(e.props[t])](),e.CamanInstanceOriginal.render((function(){o(ao({},t,null),(function(){e.makeCanvasSnapshot({operation:t},n)}))}))):o(ao({},t,null),(function(){e.makeCanvasSnapshot({operation:t},n)}))}))})),ao(oo(e),"applyAdjust",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.initialZoom,i=n.adjust,a=i.brightness,l=i.contrast,c=i.saturation,s=i.exposure,u={brightness:0,contrast:0,saturation:0,exposure:0};r({isHideCanvas:!0,isShowSpinner:!0},(function(){1!==o?(e.CamanInstanceOriginal.revert(!1),"0"!==a.toString()&&e.CamanInstanceOriginal.brightness(parseInt(a||"0")),"0"!==l.toString()&&e.CamanInstanceOriginal.contrast(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstanceOriginal.saturation(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstanceOriginal.exposure(parseInt(s||"0")),e.CamanInstanceOriginal.render((function(){r({adjust:Jr({},u)},(function(){e.makeCanvasSnapshot({operation:"adjust"},t)}))}))):r({adjust:Jr({},u)},(function(){e.makeCanvasSnapshot({operation:"adjust"},t)}))}))})),ao(oo(e),"initOrientation",(function(){var t=e.props,n=t.config,r=t.redoOperation,o=t.operations,i=t.operationsZoomed,a=1!==t.initialZoom?i:o;if(n.processWithCloudService&&a.length>=1){var l=a.findIndex((function(e){return"rotate"===e.operation}));l>-1&&r({operationIndex:l-1,callback:function(){},resetActiveTab:!1})}})),ao(oo(e),"onRotate",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.props,a=i.initialZoom,l=i.rotate,c=i.updateState,s=l+t;c({isHideCanvas:!0,isShowSpinner:!0,rotate:s,correctionDegree:n,flipX:r,flipY:o},(function(){var t=e.getCanvas();1!==a?(e.CamanInstanceZoomed.reset(),r&&e.CamanInstanceZoomed.flip("x"),o&&e.CamanInstanceZoomed.flip("y"),(s||n)&&e.CamanInstanceZoomed.rotate((s||0)+(n||0)),e.CamanInstanceZoomed.render((function(){e.getCanvas().className=t.className,c({isHideCanvas:!1,isShowSpinner:!1})}))):(e.CamanInstance.reset(),r&&e.CamanInstance.flip("x"),o&&e.CamanInstance.flip("y"),(s||n)&&e.CamanInstance.rotate((s||0)+(n||0)),e.CamanInstance.render((function(){e.getCanvas().className=t.className,c({isHideCanvas:!1,isShowSpinner:!1})})))}))})),ao(oo(e),"applyOrientation",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.initialZoom,i=n.rotate,a=n.correctionDegree,l=n.flipX,c=n.flipY;r({isHideCanvas:!0,isShowSpinner:!0},(function(){var n=e.getCanvas(null,!0),s=(i||0)+(a||0);1!==o?(e.CamanInstanceOriginal.reset(),l&&e.CamanInstanceOriginal.flip("x"),c&&e.CamanInstanceOriginal.flip("y"),(i||a)&&e.CamanInstanceOriginal.rotate(s),e.CamanInstanceOriginal.render((function(){e.getCanvas(null,!0).className=n.className,r({rotate:0,flipX:!1,flipY:!1,correctionDegree:0},(function(){e.makeCanvasSnapshot({operation:"rotate",props:{rotate:s}},t)}))}))):(e.getCanvas(null,!0).className=n.className,r({rotate:0,flipX:!1,flipY:!1,correctionDegree:0},(function(){e.makeCanvasSnapshot({operation:"rotate",props:{rotate:s}},t)})))}))})),ao(oo(e),"getOrientationArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.rotate;switch(t){case 90:return"r=270";case-90:return"r=90";default:return"r=".concat(t)}})),ao(oo(e),"initCrop",(function(){var t=e.props,n=t.config,r=t.redoOperation,o=t.operations,i=t.operationsZoomed,a=1!==t.initialZoom?i:o;if(n.processWithCloudService&&a.length>=1){var l=a.findIndex((function(e){return"crop"===e.operation}));l>-1&&r({operationIndex:l-1,callback:e.onInitCrop,resetActiveTab:!1})}else e.onInitCrop()})),ao(oo(e),"onInitCrop",(function(){var t=e.props,n=t.updateState,r=t.config,o=r.beginCropArea,i=void 0===o?1:o,a=r.minCropAreaWidth,l=r.minCropAreaHeight;n({isHideCanvas:!0,isShowSpinner:!0},(function(){var t=e.getCanvas(),r=t.getBoundingClientRect(),o=t.width/r.width;e.cropper=new Vr.a(t,{viewMode:1,modal:!1,background:!1,rotatable:!1,scalable:!1,zoomable:!1,movable:!1,autoCropArea:i,minCropBoxWidth:a,minCropBoxHeight:l,crop:function(t){e.props.updateState({cropDetails:t.detail})}}),window.scaleflexPlugins=window.scaleflexPlugins||{},window.scaleflexPlugins.zoom=o,window.scaleflexPlugins.cropperjs=e.cropper,n({isHideCanvas:!1,isShowSpinner:!1})}))})),ao(oo(e),"applyCrop",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.initialZoom,o=n.updateState,i=n.cropDetails,a=n.roundCrop,l=i.width,c=i.height,s=i.x,u=i.y;o({isShowSpinner:!0},(function(){var n,o,i;(e.destroyCrop(),1!==r)?(n=[l,c,s,u].map((function(e){return e*r})),e.CamanInstanceZoomed.crop(l,c,s,u),(o=e.CamanInstanceOriginal).crop.apply(o,Kr(n))):(n=[l,c,s,u],(i=e.CamanInstance).crop.apply(i,Kr(n)));e.makeCanvasSnapshot({operation:"crop",props:{width:n[0],height:n[1],x:n[2],y:n[3],roundCrop:a}},t)}))})),ao(oo(e),"makeCanvasSnapshot",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.props,i=o.updateState,a=o.initialZoom,l=o.operationsZoomed,c=o.currentOperation,s=o.operationsOriginal,u=o.operations,f=o.roundCrop,p=1!==a;if(r){var d=(p?l:u).indexOf(c)+1,h=e.cloneCanvas(e.getCanvas()),m=Jr(Jr({},t),{},{previewCanvas:!0,canvas:h}),g={isHideCanvas:!1,isShowSpinner:!1,currentOperation:m};return p?(g.operationsZoomed=[].concat(Kr(l.slice(0,d)),[m]),g.operationsOriginal=[].concat(Kr(s.slice(0,d)),[Jr(Jr({},m),{},{canvas:e.cloneCanvas(e.getCanvas(null,!0))})]),g.isHideCanvasOriginal=!1,g.isShowSpinnerOriginal=!1):g.operations=[].concat(Kr(u.slice(0,d)),[m]),void i(g,n)}if(p){var b=l.indexOf(c)+1;e.CamanInstanceOriginal.render((function(){var r=e.replaceWithNewCanvas(nr,f),o=Jr(Jr({},t),{},{canvas:e.cloneCanvas(e.getCanvas(null,!0))});e.CamanInstanceOriginal=new window.Caman(r,(function(){i({isHideCanvasOriginal:!1,isShowSpinnerOriginal:!1,operationsOriginal:[].concat(Kr(s.slice(0,b)),[o])},n)}))}));var v=e.getCanvas;e.CamanInstanceZoomed.render((function(){var n=e.replaceWithNewCanvas(tr,f),r=Jr(Jr({},t),{},{canvas:e.cloneCanvas(v())});e.CamanInstanceZoomed=new window.Caman(n,(function(){i({isHideCanvas:!1,isShowSpinner:!1,operationsZoomed:[].concat(Kr(l.slice(0,b)),[r]),currentOperation:r})}))}))}else{var y=u.indexOf(c)+1,w=e.getCanvas;e.CamanInstance.render((function(){var r=e.replaceWithNewCanvas(tr,f),o=Jr(Jr({},t),{},{canvas:e.cloneCanvas(w())});e.CamanInstance=new window.Caman(r,(function(){i({isHideCanvas:!1,isShowSpinner:!1,operations:[].concat(Kr(u.slice(0,y)),[o]),currentOperation:o},n)}))}))}})),ao(oo(e),"destroyCrop",(function(){e.cropper.destroy()})),ao(oo(e),"getCropArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height,r=e.x,o=e.y,i=e.roundCrop;return"tl_px=".concat(Math.round(r),",").concat(Math.round(o),"&br_px=").concat(Math.round(r+t),",").concat(Math.round(o+n)).concat(i?"&radius=".concat(Math.round(Math.max(t,n)),"&force_format=png"):"")})),ao(oo(e),"initResize",(function(){var t=e.props,n=t.initialZoom,r=t.updateState,o=e.getCanvas(1!==n?nr:tr);r({canvasDimensions:{width:o.width,height:o.height,ratio:o.width/o.height}})})),ao(oo(e),"applyResize",(function(){var t=e.props,n=t.initialZoom,r=t.canvasDimensions,o=t.updateState,i=t.handleSave,a=t.operations,l=t.operationsOriginal;o({isHideCanvas:!0,isShowSpinner:!0,operationsOriginal:[].concat(Kr(l),[{operation:"resize",props:r}]),operations:[].concat(Kr(a),[{operation:"resize",props:r}])},(function(){1!==n?(e.CamanInstanceOriginal.resize(r),e.CamanInstanceOriginal.render((function(){i()}))):(e.CamanInstance.resize(r),e.CamanInstance.render((function(){i()})))}))})),ao(oo(e),"getResizeArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;return"w=".concat(t,"&h=").concat(n)})),ao(oo(e),"initAdjust",(function(){})),ao(oo(e),"onAdjust",(function(t,n){var r,o=e.props,i=o.updateState,a=o.adjust;i({adjust:Jr(Jr({},a),{},(r={},ao(r,t,n),ao(r,"isHideCanvas",!0),ao(r,"isShowSpinner",!0),r))},(function(){e.applyCorrections((function(){i({isHideCanvas:!1,isShowSpinner:!1})}))}))})),ao(oo(e),"initFocusPoint",(function(){var t=e.props,n=t.updateState,r=t.original,o=t.focusPoint,i=Jr({},o);null===i.x&&(i.x=r.width/2),null===i.y&&(i.y=r.height/2),e.tempFocusPoint=Jr({},o),n({focusPoint:i,isHideCanvas:!0,isShowSpinner:!0})})),ao(oo(e),"applyFocusPoint",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.operations,i=n.operationsOriginal,a=n.focusPoint;e.tempFocusPoint=a,r({operationsOriginal:[].concat(Kr(i),[{operation:"focus_point",props:a}]),operations:[].concat(Kr(o),[{operation:"focus_point",props:a}])}),t()})),ao(oo(e),"applyShapes",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props.shapeOperations;n.updateShapes({applied:!0},{selectedShape:{}},(function(){e.makeCanvasSnapshot({operation:"shape",props:{shapes:e.props.shapes}},t,!0)}))})),ao(oo(e),"getFocusPointArguments",(function(e){return"gravity=".concat(e.x,",").concat(e.y)})),ao(oo(e),"destroyFocusPoint",(function(){e.props.updateState({focusPoint:e.tempFocusPoint,isHideCanvas:!1,isShowSpinner:!1})})),ao(oo(e),"pushOperation",(function(e,t,n){var r=e.findIndex((function(e){return e===n})),o=e.length;o&&r!==e[o]&&e.splice(r+1,o),e.push(t)})),ao(oo(e),"applyOperations",(function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.props,i=o.initialZoom,a=o.operations,l=o.operationsZoomed,c=o.operationsOriginal,s=o.canvasZoomed,u=o.canvasOriginal,f=o.updateState,p=1!==i,d=p?l[t]:a[t],h=-1!==t;if(r&&r.previewCanvas&&r.index-1===t||d&&d.previewCanvas&&r.index+1===t){var m,g,b=e.props.shapeOperations,v=null==d||null===(m=d.props)||void 0===m?void 0:m.shapes;if(!v){var y=(p?l:a).filter((function(e,t){return"shape"===e.operation&&t0?y[y.length-1].props.shapes:[]}return b.replaceAllShapes(v),g=p?h?l[t]:{canvas:e.cloneCanvas(s)}:h?a[t]:{canvas:e.cloneCanvas(u)},void f(Jr(Jr({},lo),{},{currentOperation:g}),(function(){n&&n()}))}if(h||e.props.shapeOperations.replaceAllShapes([]),p){var w=h?l[t]:{canvas:e.cloneCanvas(s)},x=e.replaceCanvas(w.canvas,tr);e.CamanInstanceZoomed=new window.Caman(x,(function(){f(Jr(Jr({},lo),{},{currentOperation:w}),(function(){n&&n()}))}));var k=h?c[t]:{canvas:e.cloneCanvas(u)},S=e.replaceCanvas(k.canvas,nr);e.CamanInstanceOriginal=new window.Caman(S,(function(){}))}else{var C=h?a[t]:{canvas:e.cloneCanvas(u)},E=e.replaceCanvas(C.canvas,tr);e.CamanInstance=new window.Caman(E,(function(){f(Jr(Jr({},lo),{},{currentOperation:C}),(function(){n&&n()}))}))}})),ao(oo(e),"isOperationExist",(function(e,t){return e.find((function(e){return e.operation===t}))})),ao(oo(e),"getOperationQuery",(function(e,t){return e?"crop_px":t?"width":"cdn"})),ao(oo(e),"destroyAll",(function(){})),ao(oo(e),"resetAll",(function(t){var n=e.props.activeTab;n?e.cancelLastOperation(n,(function(){e.applyOperations(-1,t)})):e.applyOperations(-1,t)})),ao(oo(e),"applyCorrections",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.initialZoom,o=n.effect,i=n.filter,a=n.adjust,l=a.brightness,c=a.contrast,s=a.saturation,u=a.exposure;1!==r?(e.CamanInstanceZoomed.revert(!1),o&&e.CamanInstanceZoomed[Rr(o)](),i&&e.CamanInstanceZoomed[Rr(i)](),"0"!==l.toString()&&e.CamanInstanceZoomed.brightness(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstanceZoomed.contrast(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstanceZoomed.saturation(parseInt(s||"0")),"0"!==u.toString()&&e.CamanInstanceZoomed.exposure(parseInt(u||"0")),e.CamanInstanceZoomed.render(t)):(e.CamanInstance.revert(!1),o&&e.CamanInstance[Rr(o)](),i&&e.CamanInstance[Rr(i)](),"0"!==l.toString()&&e.CamanInstance.brightness(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstance.contrast(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstance.saturation(parseInt(s||"0")),"0"!==u.toString()&&e.CamanInstance.exposure(parseInt(u||"0")),e.CamanInstance.render(t))})),ao(oo(e),"cancelAddedShapes",(function(){e.props.shapeOperations.deleteShapes({all:!0},{selectedShape:{}})})),ao(oo(e),"cancelLastOperation",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=e.props.initialZoom;"crop"===t&&e.destroyCrop(),"watermark"===t&&e.cancelWatermark(),["shapes","image","text"].includes(t)&&e.cancelAddedShapes(),1!==r?(e.CamanInstanceZoomed.reset(),e.CamanInstanceOriginal.reset(),e.CamanInstanceOriginal.render(),e.CamanInstanceZoomed.render((function(){n&&n()}))):(e.CamanInstance.reset(),e.CamanInstance.render((function(){n&&n()})))})),ao(oo(e),"initWatermark",(function(){var t=e.props,n=t.watermark,r=t.updateState;n.applyByDefault||r({watermark:Jr(Jr({},n),{},{applyByDefault:!0})})})),ao(oo(e),"applyWatermark",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.shapeOperations,i=(o.getShape({key:"watermark-layer"})||{}).index;e.setState({tempWatermark:null}),r({selectedShape:{}}),e.makeCanvasSnapshot({operation:"shape",props:{shapes:[i]}},t,!0),t()})),ao(oo(e),"cancelWatermark",(function(){var t=e.state.tempWatermark,n=e.props,r=n.updateState,o=n.shapeOperations,i=o.getShape({key:"watermark-layer"})||{},a=null;t&&t.url&&t.applyByDefault?(r({isShowSpinner:!0}),(a=new Image).setAttribute("crossOrigin","Anonymous"),a.src=t.url+"?"+(new Date).getTime(),a.onload=function(){o.updateShape({img:a},i.index,{watermark:t,logoImage:a,isShowSpinner:!1,selectedShape:{}})}):o.deleteShape({index:i.index},{watermark:t,logoImage:a,selectedShape:{}})})),ao(oo(e),"getWatermarkArguments",(function(){var t=e.props,n=t.config.processWithCloudimage,r=t.shapeOperations.getShape({key:"watermark-layer"});if(!r)return"";var o=r.x,i=r.y,a=r.opacity,l=Qr(r,["x","y","opacity"]),c=e.state.original,s=((c=void 0===c?{}:c).width,c.height,e.getCanvas("filerobot-shapes-edit-box")),u=s.width,f=s.height,p=Wr(o/u*100),d=Wr(i/f*100),h=Math.max(l.width/u,l.height/f),m=Wr(100*h),g="wat_gravity=absolute&wat_pos=".concat(p,",").concat(d),b="wat=1&wat_opacity=".concat(a,"&wat_scale=").concat(m,"p&").concat(g);return b+=n&&l.text?"&wat_text=".concat(l.text,"&wat_font=").concat(l.textFont,"&wat_fontsize=").concat(l.textSize,"&wat_colour=").concat(l.color.replace("#","")):"&wat_url=".concat(l.img.src.split("?")[0])})),ao(oo(e),"applyChanges",(function(t,n){switch(t){case"adjust":e.applyAdjust(n);break;case"effects":e.applyFilterOrEffect("effect",n);break;case"filters":e.applyFilterOrEffect("filter",n);break;case"crop":e.applyCrop(n);break;case"resize":e.applyResize();break;case"rotate":e.applyOrientation(n);break;case"watermark":e.applyWatermark(n);break;case"focus_point":e.applyFocusPoint(n);break;case"shapes":case"image":case"text":e.applyShapes(n)}})),ao(oo(e),"changeTab",(function(t){switch(t){case"effects":case"filters":e.initFiltersOrEffects();break;case"adjust":e.initAdjust();break;case"crop":e.initCrop();break;case"resize":e.initResize();break;case"rotate":e.initOrientation();break;case"watermark":e.initWatermark();break;case"focus_point":e.initFocusPoint();break;default:e.destroyAll()}})),ao(oo(e),"destroyMode",(function(t){switch(t){case"effects":case"filters":case"adjust":break;case"crop":e.destroyCrop();break;case"resize":case"rotate":break;case"focus_point":e.destroyFocusPoint()}})),e.state={canvas:null,self:oo(e)},e.CamanInstance=null,e.CamanInstanceOriginal=null,e.CamanInstanceZoomed=null,e}return t=a,r=[{key:"getDerivedStateFromProps",value:function(e,t){var n,r={};return e.activeTab!==t.activeTab&&(t.activeTab&&t.self.destroyMode(t.activeTab),"watermark"===e.activeTab&&(r.tempWatermark=e.watermark&&(n=e.watermark,JSON.parse(JSON.stringify(n)))),t.self.changeTab(e.activeTab)),Jr(Jr({},r),e)}}],(n=[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentDidMount",value:function(){var e=this,t=this,n=this.props,r=n.updateState,o=n.img,i=n.isPreResize,a=n.preCanvasDimensions;r({isShowSpinner:!0,applyChanges:this.applyChanges,applyOperations:this.applyOperations,resetAll:this.resetAll,onRotate:this.onRotate,onAdjust:this.onAdjust,downloadImage:this.downloadImage,getResultCanvas:this.getResultCanvas,saveImage:this.saveImage,applyCorrections:this.applyCorrections,restoreAll:this.restoreAll,cancelLastOperation:this.cancelLastOperation},(function(){var n=e.getCanvas(),l=n.getContext("2d");n.width=o.width,n.height=o.height,l.drawImage(o,0,0,o.width,o.height);var c={height:o.height,width:o.width,ratio:o.width/o.height};r({original:c,canvasDimensions:c}),i&&a?new window.Caman(n,(function(){this.resize({width:a.width,height:a.height}),this.render((function(){var e=t.replaceWithNewCanvas(tr),n={height:e.height,width:e.width,ratio:e.width/e.height};r({original:n,canvasDimensions:Jr({},n),canvasOriginal:t.cloneCanvas(e)},(function(){t.initializeCanvases(e)}))}))})):e.initializeCanvases(o)}))}},{key:"render",value:function(){var e=this.props.config.elementId;return i.a.createElement(i.a.Fragment,null,i.a.createElement(Pe,{id:"".concat(e,"_").concat(nr),className:"filerobot-original-canvas"}),i.a.createElement(Pe,{id:"".concat(e,"_").concat(tr),className:"filerobot-edit-canvas"}))}}])&&eo(t.prototype,n),r&&eo(t,r),a}(o.Component),so=n(4);function uo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.width&&d>=t.height)h=t.width,m=t.height;else if(p>t.width&&dt.height)h=p,m=p/t.ratio;else{var g=p,b=p/t.ratio,v=d*t.ratio,y=d;t.width<=g&&t.height<=b?(h=g,m=b):(h=v,m=y)}return{width:h,height:m}}((document.getElementById("preview-img-box")||{}).parentElement,t),n=e.width,r=void 0===n?0:n,o=e.height;return{width:r,height:void 0===o?0:o}}),[t]),d=uo(Object(o.useState)(p()),2),h=d[0],m=d[1],g=Object(o.useMemo)((function(){return Object(so.debounce)(100,(function(){m(p())}))}),[p]);return Object(o.useEffect)((function(){var e=!0,t=function(){e&&g()};return window.addEventListener("resize",t),function(){e=!1,window.removeEventListener("resize",t)}}),[g]),i.a.createElement(Ce,{ref:u,width:h.width,height:h.height},i.a.createElement(Ee,{onMouseDown:function(e){var n=e.clientX-f.x,o=e.clientY-f.y,i=Math.round(n*t.width/h.width),a=Math.round(o*t.height/h.height),l=Math.min(Math.max(i,0),t.width),c=Math.min(Math.max(a,0),t.height);r({focusPoint:{x:l,y:c}})}},i.a.createElement(_e,{visible:c,src:a,onLoad:function(){r({isShowSpinner:!1}),s(!0)},onError:function(){r({isShowSpinner:!1})}}),i.a.createElement(Oe,{visible:c,x:n.x*h.width/t.width,y:n.y*h.height/t.height})))};function ho(e){return(ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||vo(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function go(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function bo(e){return function(e){if(Array.isArray(e))return yo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||vo(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vo(e,t){if(e){if("string"==typeof e)return yo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yo(e,t):void 0}}function yo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:function(){},r=t.props.updateState;r(e,n)})),Po(Oo(t),"pushShapeToShapes",(function(e,n){var r=t.props.shapes,o=r.length;return t.updateState(xo({shapes:[].concat(bo(r),[xo(xo({},e),{},{index:o})])},n)),o})),Po(Oo(t),"targettedShape",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e||0===e?t.props.shapes[e]:t.props.selectedShape})),Po(Oo(t),"onSelect",(function(e){var n=t.props,r=n.shapes,o=n.activeTab;if(t._allowedTabs.includes(o)){var i=e.offsetX,a=e.offsetY,l=!1;r.forEach((function(e){!e.hidden&&i>=e.x&&i<=e.x+e.width&&a>=e.y&&a<=e.y+e.height&&e.tab===o&&(l=!0,t.updateState({selectedShape:xo(xo({},e),{},{resizingBox:!0,startEdgeOffset:{x:i-e.x,y:a-e.y}})}),t.activateResizingActions(),t._canvas.addEventListener("keyup",t.activateShapeDeleting),t._canvas.addEventListener("mousemove",t.startDragging),t._canvas.addEventListener("touchmove",t.startDragging),document.addEventListener("mouseup",t.endDragging),document.addEventListener("touchend",t.endDragging))})),l||(t.updateState({selectedShape:{}}),t.disableResizingActions(),t._canvas.removeEventListener("keyup",t.activateShapeDeleting),t._canvas.removeEventListener("mousemove",t.startDragging),t._canvas.removeEventListener("touchmove",t.startDragging),document.removeEventListener("mouseup",t.endDragging),document.removeEventListener("touchend",t.endDragging))}})),Po(Oo(t),"activateShapeDeleting",(function(e){var n=e.key,r=t.props.selectedShape;"Delete"!==n&&"Backspace"!==n||!r||(t.deleteShapeByKeyOrIndex({index:r.index}),t.updateState({selectedShape:{}}),t.disableResizingActions(),t._canvas.removeEventListener("keyup",t.activateShapeDeleting))})),Po(Oo(t),"activateResizingActions",(function(){t.props.selectedShape.lockScaleToPercentage||Array.from(document.getElementsByClassName("shape-resizing-control")).forEach((function(e){e.addEventListener("mousedown",t.trackShapeResize)}))})),Po(Oo(t),"trackShapeResize",(function(e){var n=e.target;t.setState({resizeControlTarget:n}),document.addEventListener("mousemove",t.handleShapeResizing),document.addEventListener("touchmove",t.handleShapeResizing),document.addEventListener("mouseup",t.disableResizingActions),document.addEventListener("touchend",t.disableResizingActions)})),Po(Oo(t),"handleShapeResizing",(function(e){var n=e.movementX,r=e.movementY,o=e.shiftKey,i=t.state.resizeControlTarget,a=t.props,l=a.selectedShape,c=a.processWithCloudimage,s=l.index,u=l.width,f=l.height,p=l.x,d=l.y,h=l.variant,m=l.originalWidth,g=l.originalHeight;if(i&&h!==gr){var b=f,v=i.dataset.direction;if(c){if(["e","w","n","s"].includes(v))return;o=!0}var y=function(e){var t=u/f;if(Math.abs(n)>=Math.abs(r)){var o=Math.abs(f-(u+n)/t);r=(e?1:-1)*Math.sign(n)*o}else{var i=Math.abs(u-(f+r)*t);n=(e?1:-1)*Math.sign(r)*i}},w=function(){u+=n},x=function(){f+=r},k=function(){u-=n,p+=n},S=function(){f-=r,d+=r};switch(v){case"e":w();break;case"w":k();break;case"n":S();break;case"s":x();break;case"ne":if(o&&y(!1),w(),u>=t._canvas.width&&o)break;S();break;case"nw":if(o&&y(!0),k(),u>=t._canvas.width&&o)break;S();break;case"se":if(o&&y(!0),w(),u>=t._canvas.width&&o)break;x();break;case"sw":if(o&&y(!1),k(),u>=t._canvas.width&&o)break;x();break;default:return}if(h!==dr&&h!==hr||(f!==b?u=f:f=u),!c||!(u>=m||f>=g)){if(!(f<=15||u<=15)){p<0&&(p=0),d<0&&(d=0),p+u>t._canvas.width&&(p=t._canvas.width-u),d+f>t._canvas.height&&(d=t._canvas.height-f),u>t._canvas.width&&(u=t._canvas.width),f>t._canvas.height&&(f=t._canvas.height);var C={width:u,height:f,x:p,y:d};t.updateShape(C,s,{selectedShape:xo(xo({},l),C)})}}}})),Po(Oo(t),"disableResizingActions",(function(e){document.removeEventListener("mousemove",t.handleShapeResizing),document.removeEventListener("mouseup",t.disableResizingActions),t.updateState({selectedShape:{}}),t.setState({resizeControlTarget:null})})),Po(Oo(t),"removeResizingBox",(function(e){var n=e.offsetX,r=e.offsetY,o=t.props.selectedShape;(no.x+o.width||ro.y+o.height)&&(t.updateState({selectedShape:xo(xo({},o),{},{resizingBox:!1})}),t._canvas.removeEventListener("click",t.removeResizingBox))})),Po(Oo(t),"startDragging",(function(e){if(e.targetTouches&&e.targetTouches[0]){e.preventDefault();var n=e.targetTouches[0],r=n.clientX,o=n.clientY,i=t._canvas.getBoundingClientRect(),a=i.x,l=i.y;e.offsetX=r-a,e.offsetY=o-l}var c=t.props.selectedShape,s=c.startEdgeOffset,u=void 0===s?{}:s,f=c.width,p=c.height,d=c.index,h=e.offsetX-u.x,m=e.offsetY-u.y;h<0&&(h=0),m<0&&(m=0),h+f>t._canvas.width&&(h=t._canvas.width-f),m+p>t._canvas.height&&(m=t._canvas.height-p);var g=xo(xo({},c),{},{x:h,y:m});t.updateShape(g,d,{selectedShape:g})})),Po(Oo(t),"endDragging",(function(){t._canvas.removeEventListener("mousemove",t.startDragging),t._canvas.removeEventListener("mouseup",t.endDragging),t._canvas.removeEventListener("mouseleave",t.endDragging),t._canvas.addEventListener("click",t.removeResizingBox)})),Po(Oo(t),"getCanvasCenter",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t._canvas.width/2-e,o=t._canvas.height/2-n;return[r,o]})),Po(Oo(t),"draw",(function(e,n){var r=n.opacity,o=void 0===r?1:r,i=n.hidden,a=n.color,l=n.stroke,c=void 0===l?{}:l;i||(t._context.globalAlpha=+o,t._context.fillStyle=a,t._context.strokeStyle=c.color||"transparent",t._context.lineWidth=c.width||1,e(),t.props.round&&t._context.round())})),Po(Oo(t),"redrawShape",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=t.props.shapes;t.clearShape(0,0,t._canvas.width,t._canvas.height);var r=n.length;if(e&&e!==r-1){var o=xo(xo({},n.splice(e,1)[0]),{},{index:r});n.splice(r,0,o),n=n.map((function(e,n){return e.index=n,t.drawShapeThroughVariant(e),e})),t.updateState({shapes:n,selectedShape:o})}else n.forEach((function(e){return t.drawShapeThroughVariant(e)}))})),Po(Oo(t),"drawShapeThroughVariant",(function(e){switch(e.variant){case mr:t.drawImage(e);break;case pr:case dr:t.drawRect(e);break;case hr:t.drawCircle(e);break;case gr:t.drawText(e);default:return}})),Po(Oo(t),"drawRect",(function(e){var n=e.x,r=e.y,o=e.width,i=e.height,a=e.stroke,l=go(e,["x","y","width","height","stroke"]);t.draw((function(){t._context.fillRect(n,r,o,i),a&&t._context.strokeRect(n,r,o,i)}),xo({stroke:a},l))})),Po(Oo(t),"drawCircle",(function(e){var n=e.x,r=e.y,o=(e.radius,e.width),i=e.height,a=e.stroke,l=go(e,["x","y","radius","width","height","stroke"]);t.draw((function(){t._context.roundRect(n,r,o,i),t._context.fill(),a&&t._context.stroke()}),xo({stroke:a},l))})),Po(Oo(t),"drawImage",(function(e){var n=e.img,r=e.x,o=e.y,i=e.width,a=e.height,l=e.stroke,c=go(e,["img","x","y","width","height","stroke"]);t.draw((function(){t._context.drawImage(n,r,o,i,a),l&&t._context.strokeRect(r,o,i,a)}),xo({stroke:l},c))})),Po(Oo(t),"setTextStyle",(function(e){var n=e.textSize,r=e.textFont;t._context.textAlign="start",t._context.textBaseline="top",t._context.font="".concat(n,"px ").concat(r)})),Po(Oo(t),"getTextWidthAndHeight",(function(e){var n=e.text,r=e.textSize,o=e.textFont;t.setTextStyle({textSize:r,textFont:o});var i=t._context.measureText(n),a=i.width;return[a,0===a?0:i.actualBoundingBoxDescent-i.actualBoundingBoxAscent]})),Po(Oo(t),"drawText",(function(e){var n=e.text,r=e.textSize,o=e.textFont,i=e.x,a=e.y,l=e.stroke,c=go(e,["text","textSize","textFont","x","y","stroke"]);t.draw((function(){t.setTextStyle({textSize:r,textFont:o}),t._context.fillText(n,i,a,t._canvas.width),l&&t._context.strokeText(n,i,a)}),xo({stroke:l},c))})),Po(Oo(t),"addRect",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.x,r=e.y,o=e.width,i=void 0===o?100:o,a=e.height,l=void 0===a?75:a,c=e.stroke,s=void 0===c?{}:c,u=e.color,f=void 0===u?"#000000":u,p=e.opacity,d=void 0===p?1:p,h=e.variant,m=void 0===h?pr:h,g=e.tab,b=void 0===g?"shapes":g,v=go(e,["x","y","width","height","stroke","color","opacity","variant","tab"]),y=t.getCanvasCenter(i/2,l/2),w=mo(y,2),x=w[0],k=w[1],S={x:n||x,y:r||k,width:i,height:l,stroke:s,opacity:d,color:f},C=xo(xo(xo(xo({},t._initArgs),v),S),{},{variant:m,tab:b});if(!v.key||!t.replaceShapeIfExisted(v.key,C)){t.drawRect(S);var E=t.pushShapeToShapes(C);t.updateState({selectedShape:xo(xo({},C),{},{index:E,resizingBox:!0})},t.activateResizingActions)}})),Po(Oo(t),"addSquare",(function(e){e.width||(e.width=e.height=75),e.variant=dr,t.addRect(e)})),Po(Oo(t),"addCircle",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.x,r=e.y,o=e.radius,i=void 0===o?50:o,a=e.stroke,l=void 0===a?{}:a,c=e.color,s=void 0===c?"#000000":c,u=e.opacity,f=void 0===u?1:u,p=e.tab,d=void 0===p?"shapes":p,h=go(e,["x","y","radius","stroke","color","opacity","tab"]),m=t.getCanvasCenter(i,i),g=mo(m,2),b=g[0],v=g[1],y=2*i,w={x:n||b,y:r||v,radius:i,color:s,opacity:f,stroke:l,width:y,height:y},x=xo(xo(xo(xo({},t._initArgs),h),w),{},{tab:d,variant:hr});if(!h.key||!t.replaceShapeIfExisted(h.key,x)){t.drawCircle(w);var k=t.pushShapeToShapes(x);t.updateState({selectedShape:xo(xo({},x),{},{index:k,resizingBox:!0})},t.activateResizingActions)}})),Po(Oo(t),"addImage",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.img,r=e.x,o=void 0===r?void 0:r,i=e.y,a=void 0===i?void 0:i,l=e.opacity,c=void 0===l?1:l,s=e.tab,u=void 0===s?"image":s,f=e.stroke,p=void 0===f?{}:f,d=e.otherStates,h=go(e,["img","x","y","opacity","tab","stroke","otherStates"]);if(n){var m=function(){var e=mo(t.getSuitableImgDiemensions(n,h.lockScaleToPercentage),2),r=e[0],i=e[1],l=mo(t.getCanvasCenter((h.width||r)/2,(h.height||i)/2),2),s=l[0],f=l[1],m={img:n,opacity:c,originalWidth:r,originalHeight:i,width:h.width||r,height:h.height||i,x:o||s,y:a||f,stroke:p},g=xo(xo(xo(xo({},t._initArgs),h),m),{},{variant:mr,tab:u});if(!h.key||!t.replaceShapeIfExisted(h.key,g,d)){t.drawImage(m);var b=t.pushShapeToShapes(g);t.updateState(xo({selectedShape:xo(xo({},g),{},{index:b,resizingBox:!0})},d),t.activateResizingActions)}};"string"==typeof n?n=t.makeImgElement(n,m):m()}})),Po(Oo(t),"addText",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.text,r=void 0===n?"Text":n,o=e.textSize,i=void 0===o?62:o,a=e.color,l=void 0===a?"#000000":a,c=e.textFont,s=void 0===c?"Arial":c,u=e.x,f=void 0===u?void 0:u,p=e.y,d=void 0===p?void 0:p,h=e.stroke,m=void 0===h?{}:h,g=e.opacity,b=void 0===g?1:g,v=e.tab,y=void 0===v?"text":v,w=e.otherStates,x=go(e,["text","textSize","color","textFont","x","y","stroke","opacity","tab","otherStates"]),k=t.getTextWidthAndHeight({text:r,textSize:i,textFont:s}),S=mo(k,2),C=S[0],E=S[1],O=t.getCanvasCenter(C/2,E/2),_=mo(O,2),P=_[0],T=_[1];if(r){var j={text:r,textSize:i,textFont:s,x:f||P,y:d||T,opacity:b,stroke:m,color:l},R=xo(xo(xo(xo({},t._initArgs),x),j),{},{width:C,height:E,variant:gr,tab:y});if(x.key&&t.replaceShapeIfExisted(x.key,R,w))return;t.drawText(j);var D=t.pushShapeToShapes(R);t.updateState(xo({selectedShape:xo(xo({},R),{},{index:D,resizingBox:!0})},w),t.activateResizingActions)}})),Po(Oo(t),"addAnyShape",(function(e,n){if(e.index||0===e.index){var r=t.props.shapes[e.index];if(!e.variant||r.variant===e.variant)return void t.updateShape(e,e.index,n)}var o=xo(xo({},e),{},{otherStates:n});switch(e.variant){case mr:t.addImage(o);break;case pr:t.addRect(o);break;case dr:t.addSquare(o);break;case hr:t.addCircle(o);break;case gr:t.addText(o);default:return}})),Po(Oo(t),"getSuitableImgDiemensions",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.width,o=e.height;if(o>t._canvas.height){var i=o/t._canvas.height;o/=i,r/=i}if(r>t._canvas.width){var a=r/t._canvas.width;o/=a,r/=a}if(n){var l=n/100;r*=l,o*=l}return[r=t.fromLatestCanvasSizeValue(r,"width"),o=t.fromLatestCanvasSizeValue(o,"height")]})),Po(Oo(t),"getShapeByKeyOrIndex",(function(e){var n=e.key,r=e.index;if(!n&&!r&&0!==n&&0!==r)return!1;var o=t.props.shapes;return r?o[r]:o.filter((function(e){return e.key===n}))[0]})),Po(Oo(t),"replaceShapeIfExisted",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=t.getShapeByKeyOrIndex({key:e});return!!o&&(n=xo(xo({},n),{},{x:o.x,y:o.y,width:o.width,height:o.height}),t.updateShape(n,o.index,r),!0)})),Po(Oo(t),"setShapeVisibilityByKeyOrIndex",(function(e){var n=e.key,r=e.index,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=t.getShapeByKeyOrIndex({key:n,index:r});i&&i.hidden!==o&&t.updateShape({hidden:o||!i.hidden},i.index)})),Po(Oo(t),"getShapesIndexByAnyProp",(function(e,n){var r=t.props.shapes;if(r&&0===r.length)return[];var o=[];return r.filter((function(t,r){var i=t[e];return(i===n||void 0===i&&Boolean(i)===n)&&(o.push(r),!0)})),o})),Po(Oo(t),"updateShapes",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=t.props.shapes;o=o.map((function(t){return xo(xo({},t),e)})),t.updateState(xo({shapes:o},n),r)})),Po(Oo(t),"replaceAllShapes",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.updateState({shapes:e},(function(){t.redrawShape(),n()}))})),Po(Oo(t),"updateShape",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=t.props,i=o.shapes,a=o.selectedShape;if(e&&(n||0===n||a&&(a.index||0===a.index))){if("string"==typeof e.img)return t.updateState({selectedShape:xo(xo({},a),{},{lockScaleToPercentage:e.lockScaleToPercentage,img:e.img})}),void t.makeImgElement(e.img,t.updateShape,e,n,r);var l={};if(n||0===n||(l.selectedShape=xo(xo({},a),e)),i[n=n||0===n?n:a.index]){var c=i;if(e.textSize&&e.textSize!==i[n].textSize||e.text&&e.text!==i[n].text){var s=i[n],u=t.getTextWidthAndHeight(xo(xo({},s),e)),f=mo(u,2),p=f[0],d=f[1];l.selectedShape?(e.width=l.selectedShape.width=p,e.height=l.selectedShape.height=d,e.text=l.selectedShape.text=e.text||s.text):(e.width=p,e.height=d,e.text=e.text||s.text)}else{var h=xo({},e);void 0!==e.x&&void 0!==e.y&&(h.x=e.x,h.y=e.y),e.stroke&&(h.stroke=e.stroke),e.width&&e.height&&(h.width=e.width,h.height=e.height),e.lockScaleToPercentage&&(e.lockScaleToPercentage=e.lockScaleToPercentage),l.selectedShape=xo(xo({},a),h)}c[n]=xo(xo({},c[n]),e),t.updateState(xo(xo({shapes:c},l),r),(function(){t.redrawShape(n)}))}}})),Po(Oo(t),"clearShape",(function(e,n,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=i.width,l=a||1,c=e-l,s=n-l,u=r+l,f=o+l;t._context.clearRect(c,s,u,f)})),Po(Oo(t),"eraseAndRemoveShapeFromArray",(function(e,n){if(0!==Object.keys(t.targettedShape(e)).length)return t.clearShape(0,0,t._canvas.width,t._canvas.height),n.filter((function(n){return n.index!==e&&(n.index>e&&(n.index-=1),t.drawShapeThroughVariant(n),n)}))})),Po(Oo(t),"deleteShapeByKeyOrIndex",(function(e){var n=e.index,r=e.key,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.props.selectedShape;if(!n&&0!==n&&!r){if(!i)return;n=i.index}var a=t.props.shapes,l=n||0===n?n:(t.getShapeByKeyOrIndex({key:r})||{}).index;(l||0===l)&&(l===i.index&&(o.selectedShape={}),t.updateState(xo({shapes:t.eraseAndRemoveShapeFromArray(l,a)},o)))})),Po(Oo(t),"deleteShapes",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=t.props.shapes;e.forEach((function(e){r=t.eraseAndRemoveShapeFromArray(e,r)})),t.updateState(xo({shapes:r},n))})),Po(Oo(t),"deleteAllShapesOrByTypeOrIndicies",(function(e){var n=e.type,r=e.all,o=void 0!==r&&r,i=e.applied,a=void 0!==i&&i,l=e.secured,c=void 0===l?[]:l;if(n||o){if(o){var s=(t.getShapeByKeyOrIndex({key:"watermark-layer"})||{}).index,u=bo(c);!s&&0!==s||u.includes(s)||u.push(s);var f=[];return t.clearShape(0,0,t._canvas.width,t._canvas.height),a||(f=t.props.shapes.filter((function(e){return!(!e.applied&&!u.includes(e.index))&&(t.drawShapeThroughVariant(e),e)}))),void t.updateState({shapes:f,selectedShape:{}})}var p=t.getShapesIndexByAnyProp("type",n);p.length>0&&t.deleteShapes(p)}})),Po(Oo(t),"makeImgElement",(function(e,n,r){for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a-1&&n&&(t.splice(i,1),r({operations:t}),o(t,"resize"))}},{key:"render",value:function(){var e=this,t=this.state.isBlockRatio,n=this.props,r=n.canvasDimensions,o=n.processWithCloudService,a=n.onPreResize,l=n.t;return i.a.createElement(xe,{id:"preview-img-box"},i.a.createElement(Nt,null,l["warning.too_big_resolution"]),i.a.createElement(Ft,null,i.a.createElement("h4",null,l["pre_resize.title"]),i.a.createElement(zt,null,i.a.createElement(Bt,null,i.a.createElement(dt,null,i.a.createElement(ht,null,l["common.width"]),i.a.createElement(mt,{fullSize:!0,value:parseInt(r.width,10)||"",onChange:this.changeWidth})),i.a.createElement(bt,null,i.a.createElement(vt,{active:!t,style:o?{cursor:"not-allowed"}:{},link:!0,onClick:function(){!o&&e.toggleRatio()}},i.a.createElement(yt,{active:!t,style:o?{cursor:"not-allowed"}:{}}))),i.a.createElement(dt,null,i.a.createElement(ht,null,l["common.height"]),i.a.createElement(mt,{fullSize:!0,value:parseInt(r.height,10)||"",onChange:this.changeHeight})))),i.a.createElement(Lt,null,i.a.createElement("p",null,i.a.createElement(je,{themeColor:!0,themeBtn:!0,onClick:function(){a("keep")}},l["pre_resize.keep_original_resolution"])),i.a.createElement("p",null,i.a.createElement(je,{themeColor:!0,success:!0,onClick:function(){a("resize")}},l["pre_resize.resize_n_continue"])))))}}])&&Ho(t.prototype,n),r&&Ho(t,r),a}(o.Component);function Ko(e){return(Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Go(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=e.target.value;if(r.props.watermark.text)r.initWatermarkImage(n);else{var o=r.state.position;r.updateWatermarkProperty({url:n,position:o},sl({img:n,position:o},t),{url:"",text:!1})}})),gl(hl(r),"changeTextProperty",(function(e){var t=gl({},e.target.name,e.target.value);if(r.props.watermark.text)r.updateWatermarkProperty(t);else{var n=r.state,o=sl({text:n.text,color:n.color,textSize:n.textSize,textFont:n.textFont,opacity:n.opacity,variant:gr,tab:"watermark"},t);r.updateWatermarkProperty(sl({},t),sl(sl({},o),{},{resizingBox:!0}),{text:sl(sl({},r.props.watermark.text),o)})}})),gl(hl(r),"readFile",(function(e){if(r.props.config.processWithCloudimage)return null;var t=e.target;if(t.files&&t.files[0]){var n=new FileReader;n.onload=function(e){r.changeURL({target:{value:e.target.result}},{variant:mr})},n.readAsDataURL(t.files[0])}})),gl(hl(r),"getWatermarkDimensionsByPosString",(function(e,t,n){return Br(e,jr(r.props.config.elementId),t,n)})),gl(hl(r),"onPositionChange",(function(e){var t=r.getWatermarkLayer(),n=t.width,o=t.height,i=al(r.getWatermarkDimensionsByPosString(e,n,o),4),a=i[0],l=i[1],c=i[2],s=i[3];r.updateWatermarkProperty({position:e,width:c,height:s},{x:a,y:l,width:c,height:s},{position:e,x:a,y:l,width:c,height:s})})),gl(hl(r),"initWatermarkImage",Object(so.debounce)(500,(function(e){var t=r.props.updateState,n=null;t({isShowSpinner:!0});var o=function(e){return{logoImage:e,isShowSpinner:!1,watermark:sl(sl({},r.props.watermark),{},{url:e.src})}};if(e){var i=r.props,a=i.shapeOperations,l=i.watermark,c=l.lockScaleToPercentage,s=void 0===c?0:c,u=l.position,f=r.state.opacity;(n=new Image).setAttribute("crossOrigin","Anonymous"),n.onload=function(){var e,t=r.props.watermark.imageFilter;t&&"function"==typeof t?(n.onload=null,e=o(t(n))):e=o(n);var i=(r.getWatermarkLayer()||{}).index,l=al(r.getWatermarkDimensionsByPosString(u,n.width,n.height),4),c=l[0],p=l[1],d=l[2],h=l[3];a.addOrUpdate({img:n,opacity:f,index:i,x:c,y:p,width:d,height:h,variant:mr,key:"watermark-layer",tab:"watermark",lockScaleToPercentage:s},e)},n.onerror=function(){t({isShowSpinner:!1})},e.match(/^https?:\/\/./)?n.src=e+"?"+(new Date).getTime():n.src=e}else t({isShowSpinner:!1})}))),gl(hl(r),"showWatermarkList",(function(){r.setState({showWaterMarkList:!0})})),gl(hl(r),"hideWatermarkList",(function(){r.setState({showWaterMarkList:!1})})),gl(hl(r),"onChangeWatermark",(function(e){r.changeURL({target:{value:e}}),r.hideWatermarkList()})),gl(hl(r),"handleInputTypeChange",(function(e){var t=e.target,n=r.props,o=n.updateState,i=n.config;o({isShowSpinner:!0}),r.setState({selectedInputType:t.value}),"text"===t.value?(r.changeTextProperty({target:{name:"text",value:(i.watermark||{}).defaultText||"Your text"}}),o({isShowSpinner:!1})):(o({watermark:sl(sl({},r.props.watermark),{},{text:null})}),r.initWatermarkImage(r.props.watermark.url||""))}));var i=e.watermark,l=i.opacity,c=i.position,s=i.url,u=i.applyByDefault,f=i.activePositions,p=i.handleOpacity,d=e.watermark,h=d.urls,m=d.fonts,g=[],b=c||"right-top";if("string"==typeof f&&cr.hasOwnProperty(f))g=cr[f];else if(Array.isArray(f)){var v=Array(9).fill(0);f.map((function(e,t){return v[t]=e})),g=v}else g=Array(9).fill(1);return 1!==g[lr.indexOf(b)]&&(b=lr[g.indexOf(1)]),h&&(h=h.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("string"==typeof e){var t=e.split("/");return{url:e,label:t[t.length-1]}}return e}))),r.initWatermarkImage(s||(null===(t=h)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.url)),r.state={isBlockRatio:!1,opacity:l||.7,handleOpacity:"boolean"!=typeof p||p,position:b,url:s||(h&&h.length>1?h[0]&&h[0].url:""),urls:h||[],activePositions:g,isWatermarkList:h&&h.length>1,applyByDefault:u||!1,showWaterMarkList:!1,selectedInputType:h&&h.length>1?"gallery":"upload",text:"",color:"#000000",textSize:62,textFont:"Arial",fonts:m||r.props.config.theme.fonts},r}return t=a,(n=[{key:"componentDidUpdate",value:function(e){var t=this.props;t.watermark.position!==this.state.position&&this.onPositionChange(this.state.position),t.watermark.applyByDefault!==e.watermark.applyByDefault&&(this.getWatermarkLayer()?this.updateWatermarkProperty({applyByDefault:!1},{hidden:!0,resizingBox:!1},{applyByDefault:!1}):this.setState({applyByDefault:t.watermark.applyByDefault}),t.watermark.applyByDefault&&(this.getWatermarkLayer()?this.updateWatermarkProperty({applyByDefault:!0},{hidden:!1,resizingBox:!0},{applyByDefault:!0}):this.initWatermarkImage(t.watermark.url)))}},{key:"render",value:function(){var e=this,t=this.state,n=t.isWatermarkList,r=t.url,o=t.urls,a=t.opacity,l=t.handleOpacity,c=t.position,s=t.activePositions,u=(t.applyByDefault,t.showWaterMarkList),f=t.selectedInputType,p=t.text,d=t.color,h=t.textFont,m=t.textSize,g=t.fonts,b=this.props.config,v="upload"===f,y="gallery"===f,w="url"===f,x="text"===f,k=this.props.t;return i.a.createElement(Rn,null,i.a.createElement(Bn,null,i.a.createElement("label",null,k["common.gallery"],i.a.createElement("input",{type:"radio",value:"gallery",checked:"gallery"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",{style:{cursor:b.processWithCloudimage?"not-allowed":"auto"}},k["common.upload"],i.a.createElement("input",{type:"radio",value:"upload",checked:"upload"===f,disabled:b.processWithCloudimage,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",null,k["common.url"],i.a.createElement("input",{type:"radio",value:"url",checked:"url"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",null,k["common.text"],i.a.createElement("input",{type:"radio",value:"text",checked:"text"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null))),i.a.createElement(In,null,i.a.createElement(Dn,null,y&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"url"},"Watermark Gallery"),i.a.createElement(ol,{width:"100%",list:o,valueProp:"url",id:"gallery",value:r,style:{width:"calc(100% - 120px)"},onChange:function(t){e.changeURL({target:{value:t}})}})),w&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"url"},"Watermark URL"),i.a.createElement(mt,{id:"url",value:r,style:{width:"calc(100% - 120px)"},onChange:this.changeURL})),v&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"image-upload"},"Watermark Image"),i.a.createElement(gt,{id:"image-upload",style:{width:"calc(100% - 120px)"},onChange:this.readFile})),x&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"text"},"Watermark Text"),i.a.createElement(mt,{id:"text",value:p,style:{width:"calc(65% - 135px)",minWidth:120},name:"text",onChange:this.changeTextProperty}),i.a.createElement(ol,{list:b.processWithCloudimage?fr:g,valueProp:"value",id:"textFont",value:h,style:{width:111,display:"inline-block",marginLeft:8},onChange:function(t){return e.changeTextProperty({target:{name:"textFont",value:t}})}}),i.a.createElement(mt,{value:m,type:"number",name:"textSize",style:{width:60,marginLeft:8},onChange:this.changeTextProperty}),i.a.createElement(mt,{value:d,type:"color",style:{width:30,marginLeft:8,padding:0,background:"transparent",boxShadow:"none"},name:"color",onChange:this.changeTextProperty}))),i.a.createElement(Mn,{switcherPosition:l?"right":"left"},l&&i.a.createElement(An,null,i.a.createElement("label",{htmlFor:"opacity",style:{minWidth:80}},"Opacity"),i.a.createElement(da,{label:k["common.opacity"],min:0,max:1,step:.05,range:a,updateRange:this.changeOpacity})))),i.a.createElement(zn,null,lr.map((function(t,n){return i.a.createElement(Ln,{key:t,value:t,active:t===c,clickable:s[n],onClick:function(){s[n]&&e.onPositionChange(t)}})}))),n&&u&&i.a.createElement(Nn,null,o.map((function(t){return i.a.createElement(Fn,{key:t,src:t,onClick:function(){e.onChangeWatermark(t)}})}))))}}])&&ul(t.prototype,n),r&&ul(t,r),a}(o.Component);function vl(e){return(vl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wl(e){for(var t=1;t128?255-2*(255-e.r)*(255-t.r)/255:t.r*e.r*2/255,n.g=t.g>128?255-2*(255-e.g)*(255-t.g)/255:t.g*e.g*2/255,n.b=t.b>128?255-2*(255-e.b)*(255-t.b)/255:t.b*e.b*2/255,n})),Gc.register("difference",(function(e,t){return{r:e.r-t.r,g:e.g-t.g,b:e.b-t.b}})),Gc.register("addition",(function(e,t){return{r:t.r+e.r,g:t.g+e.g,b:t.b+e.b}})),Gc.register("exclusion",(function(e,t){return{r:128-2*(t.r-128)*(e.r-128)/255,g:128-2*(t.g-128)*(e.g-128)/255,b:128-2*(t.b-128)*(e.b-128)/255}})),Gc.register("softLight",(function(e,t){var n;return(n={}).r=t.r>128?255-(255-t.r)*(255-(e.r-128))/255:t.r*(e.r+128)/255,n.g=t.g>128?255-(255-t.g)*(255-(e.g-128))/255:t.g*(e.g+128)/255,n.b=t.b>128?255-(255-t.b)*(255-(e.b-128))/255:t.b*(e.b+128)/255,n})),Gc.register("lighten",(function(e,t){return{r:t.r>e.r?t.r:e.r,g:t.g>e.g?t.g:e.g,b:t.b>e.b?t.b:e.b}})),Gc.register("darken",(function(e,t){return{r:t.r>e.r?e.r:t.r,g:t.g>e.g?e.g:t.g,b:t.b>e.b?e.b:t.b}}));n(46);Caman.Plugin.register("crop",(function(e,t,n,r){var o;return null==n&&(n=0),null==r&&(r=0),o=document.createElement("canvas"),Qc.b.copyAttributes(this.canvas,o),o.width=e,o.height=t,o.getContext("2d").drawImage(this.canvas,n,r,e,t,0,0,e,t),this.cropCoordinates={x:n,y:r},this.cropped=!0,this.replaceCanvas(o)})),Caman.Plugin.register("resize",(function(e){var t;if(null==e&&(e=null),null!==e&&(null!=e.width||null!=e.height))return null==e.width?e.width=this.canvas.width*e.height/this.canvas.height:null==e.height&&(e.height=this.canvas.height*e.width/this.canvas.width),t=document.createElement("canvas"),Qc.b.copyAttributes(this.canvas,t),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,e.width,e.height),this.resized=!0,this.replaceCanvas(t);Xc.a.error("Invalid or missing dimensions given for resize")})),Caman.Filter.register("crop",(function(){return this.processPlugin("crop",Array.prototype.slice.call(arguments,0))})),Caman.Filter.register("resize",(function(){return this.processPlugin("resize",Array.prototype.slice.call(arguments,0))}));var ns,rs,os;n(47),n(48),n(49),n(50),n(51),n(52),n(53);ns=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],rs=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],os=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},Caman.Plugin.register("compoundBlur",(function(e,t,n,r){var o,i,a,l=this.dimensions.width,c=this.dimensions.height,s=this.pixelData,u=e.data,f=l*c,p=[];for(o=0,i=0<=(a=f<<2);i?oa;i?o++:o--)p[o]=s[o];var d=0,h=r;for(r-=1;h-- >=0;){var m,g,b,v,y,w,x,k,S,C,E,O,_,P,T,j,R,D,M,A,I,z,B,L=t+.5|0;if(0!==L){L>256&&(L=256);var N=L+L+1,F=l-1,U=c-1,H=L+1,W=H*(H+1)/2,Y=new os,V=void 0,X=Y;for(o=1,m=1<=(g=N);m?og;m?o++:o--)X=X.next=new os,o===H&&(V=X);X.next=Y;var q=null,$=null,Q=M=0,K=ns[L],Z=rs[L];for(D=0,A=0<=(I=c);A?DI;A?D++:D--){var G,J,ee,te,ne,re;for(_=w=b=T=k=y=0,P=H*(O=p[M]),x=H*(E=p[M+1]),v=H*(C=p[M+2]),T+=W*O,k+=W*E,y+=W*C,X=Y,o=0,G=0<=(J=H);G?oJ;G?o++:o--)X.r=O,X.g=E,X.b=C,X=X.next;for(o=1,ee=1<=(te=H);ee?ote;ee?o++:o--)S=M+((Fre;ne?R++:R--)p[M]=T*K>>Z,p[M+1]=k*K>>Z,p[M+2]=y*K>>Z,T-=P,k-=x,y-=v,P-=q.r,x-=q.g,v-=q.b,S=Q+((S=R+H)B;z?R++:R--){var oe,ie,ae,le,ce,se;for(w=b=_=k=y=T=0,P=H*(O=p[M=R<<2]),x=H*(E=p[M+1]),v=H*(C=p[M+2]),T+=W*O,k+=W*E,y+=W*C,X=Y,o=0,oe=0<=(ie=H);oe?oie;oe?o++:o--)X.r=O,X.g=E,X.b=C,X=X.next;var ue=l;for(o=1,ae=1<=(le=H);ae?ole;ae?o++:o--)M=ue+R<<2,T+=(X.r=O=p[M])*(j=H-o),k+=(X.g=E=p[M+1])*j,y+=(X.b=C=p[M+2])*j,_+=O,w+=E,b+=C,X=X.next,ose;ce?D++:D--)p[S=M<<2]=T*K>>Z,p[S+1]=k*K>>Z,p[S+2]=y*K>>Z,T-=P,k-=x,y-=v,P-=q.r,x-=q.g,v-=q.b,S=R+((S=D+H)-1;){var fe=o<<2,pe=(255&u[fe+2])/255*r,de=0|pe;if(de===d){var he=256*(pe-(0|pe)),me=256-he;s[fe]=s[fe]*me+p[fe]*he>>8,s[fe+1]=s[fe+1]*me+p[fe+1]*he>>8,s[fe+2]=s[fe+2]*me+p[fe+2]*he>>8}else de===d+1&&(s[fe]=p[fe],s[fe+1]=p[fe+1],s[fe+2]=p[fe+2])}d++}}return this})),Caman.Filter.register("tiltShift",(function(e){var t={center:{x:this.dimensions.width/2,y:this.dimensions.height/2},angle:45,focusWidth:200,startRadius:3,radiusFactor:1.5,steps:3};(e=Qc.b.extend(t,e)).angle*=Math.PI/180;var n=function(e,t,n,r,o,i,a){var l=document.createElement("canvas");l.width=e,l.height=t;var c=n+Math.cos(o)*i*.5,s=r+Math.sin(o)*i*.5,u=n-Math.cos(o)*i*.5,f=r-Math.sin(o)*i*.5,p=l.getContext("2d"),d=p.createLinearGradient(c,s,u,f);return a?(d.addColorStop(0,"white"),d.addColorStop(.5,"black"),d.addColorStop(1,"white")):(d.addColorStop(0,"white"),d.addColorStop(1,"black")),p.fillStyle=d,p.fillRect(0,0,e,t),p.getImageData(0,0,e,t)}(this.dimensions.width,this.dimensions.height,e.center.x,e.center.y,e.angle,e.focusWidth,!0);return this.processPlugin("compoundBlur",[n,e.startRadius,e.radiusFactor,e.steps])})),Caman.Filter.register("radialBlur",(function(e){var t={size:50,center:{x:this.dimensions.width/2,y:this.dimensions.height/2},startRadius:3,radiusFactor:1.5,steps:3,radius:null};(e=Qc.b.extend(t,e)).radius||(e.radius=this.dimensions.width-1?"&":"?")+(new Date).getTime()),u.setAttribute("crossOrigin","Anonymous"),u.src=e,e.startsWith("data:image/")||e.startsWith("blob:")||(u.src=u.src+(u.src.indexOf("?")>-1?"&version=":"?version=")+(new Date).getTime()),u.onload=function(){var e={width:u.width,height:u.height,ratio:u.width/u.height},n={activeBody:"preResize",isShowSpinner:!1,img:u,logoImage:f,imageName:s.indexOf("?")>-1?s.slice(0,s.indexOf("?")):s};if("manual"===o&&(i=u.height){var r=u.width/u.height,l={ratio:r,width:i,height:i/r};t.setState(cs(cs({preCanvasDimensions:cs({},l),canvasDimensions:cs({},l)},n),{},{activeBody:"preview",isPreResize:!0}))}else{var c=u.height/u.width,p={ratio:c,width:a/c,height:a};t.setState(cs(cs({preCanvasDimensions:cs({},p),canvasDimensions:cs({},p)},n),{},{activeBody:"preview",isPreResize:!0}))}else{var d,h=t.props.config.tools;1===h.length&&(d=h[0]),t.setState(cs(cs({},n),{},{activeBody:"preview",isPreResize:!1}),(function(){t.setState({activeTab:d})}))}}})),ms(ds(t),"determineImageType",(function(){var e=t.props.src;if(e instanceof Blob)t.setState({imageMime:e.type});else{var n=new XMLHttpRequest;n.open("GET",e),n.responseType="arraybuffer",n.onload=function(e){var n,r=e.target;t.setState({imageMime:(null===(n=Vc()(new Uint8Array(r.response)))||void 0===n?void 0:n.mime)||"image/svg+xml"})},n.send()}})),ms(ds(t),"updateState",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t._isMounted){var r=t.props.config.elementId,o=jr(r);e.latestCanvasSize={width:o.width,height:o.height},t.setState(e,n)}})),ms(ds(t),"onRevert",(function(){var e=t.state,n=e.cancelLastOperation,r=e.activeTab;t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}),n(r,(function(){t.setState(cs({isHideCanvas:!1,isShowSpinner:!1},gs))}))})),ms(ds(t),"onAdjust",(function(e,n){(0,t.state.onAdjust)(e,n)})),ms(ds(t),"onRotate",(function(e,n,r,o){(0,t.state.onRotate)(e,n,r,o)})),ms(ds(t),"onFlip",(function(e){(0,t.state.flip)(e)})),ms(ds(t),"onSave",(function(){var e=t.state.saveImage;t.setState({isShowSpinner:!0}),e()})),ms(ds(t),"onDownloadImage",(function(){var e=t.props.onBeforeComplete,n=t.state,r=n.downloadImage,o=(0,n.getResultCanvas)();!e||e({status:"before-complete",canvas:o})?r((function(){t.props.onComplete({status:"success",canvas:o}),t.props.onClose(Sr)})):(t.props.onComplete({status:"success",canvas:o}),t.props.onClose(kr))})),ms(ds(t),"onApplyEffects",(function(e){var n=t.state,r=n.applyCorrections,o=n.effect===e?null:e;t.setState({isShowSpinner:!0,effect:o},(function(){r((function(){t.setState({isShowSpinner:!1})}))}))})),ms(ds(t),"onApplyFilters",(function(e){var n=t.state,r=n.applyCorrections,o=n.filter===e?null:e;t.setState({isShowSpinner:!0,filter:o},(function(){r((function(){t.setState({isShowSpinner:!1})}))}))})),ms(ds(t),"handleSave",(function(){var e=t.state,n=e.processWithFilerobot,r=e.processWithCloudService;n||r?t.onSave():t.onDownloadImage()})),ms(ds(t),"apply",(function(e){var n=t.state,r=n.activeTab;(0,n.applyChanges)(r,e),t.setState({activeTab:null})})),ms(ds(t),"redoOperation",(function(e){var n=e.operationIndex,r=e.callback,o=void 0===r?function(){}:r,i=e.resetActiveTab,a=void 0===i||i,l=e.operationObject,c=void 0===l?{}:l,s=t.state.applyOperations;a?t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}):t.setState({isHideCanvas:!0,isShowSpinner:!0}),s(n,(function(){t.setState({isHideCanvas:!1,isShowSpinner:!1},o)}),c)})),ms(ds(t),"resetOperations",(function(){var e=t.state.resetAll;t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}),e((function(){t.setState(cs({isHideCanvas:!1,isShowSpinner:!1},gs))}))})),ms(ds(t),"onPreResize",(function(e){var n,r=t.props.config.tools;switch(1===r.length&&(n=r[0]),e){case"keep":t.setState({canvasDimensions:{},isPreResize:!1,activeBody:"preview"},(function(){t.setState({activeTab:n})}));break;case"resize":var o=t.state.canvasDimensions;t.setState({preCanvasDimensions:o,isPreResize:!0,activeBody:"preview"},(function(){t.setState({activeTab:n})}))}}));var n=e.config,r=n.processWithCloudimage,i=n.processWithFilerobot,l=n.processWithCloudService,c=n.uploadWithCloudimageLink,s=n.reduceBeforeEdit,u=n.cropBeforeEdit,f=n.watermark,p=n.imageSealing;return t.state=cs(cs({isShowSpinner:!0,isHideCanvas:!1,activeTab:null,activeBody:null,currentOperation:null,original:{width:300,height:200},cropDetails:{width:300,height:200},canvasDimensions:{width:300,height:200,ratio:1.5},processWithFilerobot:i,processWithCloudimage:r,processWithCloudService:l,uploadCloudimageImage:c,reduceBeforeEdit:s,cropBeforeEdit:u,roundCrop:!1,imageSealing:cs({enabled:!1,salt:"",char_count:10,include_params:null},p),operationsOriginal:[],operationsZoomed:[],operations:[],canvasZoomed:null,canvasOriginal:null,isPreResize:!1,initialZoom:1},gs),{},{watermark:f||sr,focusPoint:{x:null,y:null},shapes:[],selectedShape:{},availableShapes:[]}),t}return t=a,(n=[{key:"componentDidMount",value:function(){this._isMounted=!0,this.loadImage(),this.determineImageType()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"render",value:function(){var e=this.state,t=e.isShowSpinner,n=e.activeTab,r=e.operations,o=e.operationsOriginal,a=e.operationsZoomed,l=e.currentOperation,c=e.isHideCanvas,s=e.cropDetails,u=e.original,f=e.canvasDimensions,p=e.processWithCloudimage,d=e.processWithFilerobot,h=e.processWithCloudService,m=e.uploadCloudimageImage,g=e.imageMime,b=e.lastOperation,v=e.operationList,y=e.initialZoom,w=e.canvasZoomed,x=e.canvasOriginal,k=e.reduceBeforeEdit,S=e.cropBeforeEdit,C=e.img,E=e.imageName,O=e.activeBody,_=e.isPreResize,P=e.preCanvasDimensions,T=e.logoImage,j=e.imageSealing,R=e.effect,D=e.filter,M=e.crop,A=e.roundCrop,I=e.resize,z=e.rotate,L=e.correctionDegree,N=e.flipX,F=e.flipY,U=e.adjust,H=e.watermark,W=e.focusPoint,Y=e.shapes,V=e.shapeOperations,X=e.selectedShape,q=e.availableShapes,$=e.latestCanvasSize,Q=this.props,K=Q.src,Z=Q.config,G=Q.onClose,J=Q.onComplete,ee=Q.closeOnLoad,te=void 0===ee||ee,ne=Q.t,re=void 0===ne?{}:ne,oe=Q.theme,ie={effect:R,filter:D,crop:M,resize:I,rotate:z,flipX:N,flipY:F,adjust:U,correctionDegree:L},ae=cs(cs({t:re,theme:oe,cropDetails:s,original:u,activeTab:n,src:K,onClose:G,config:Z,canvasDimensions:f,processWithCloudimage:p,processWithFilerobot:d,processWithCloudService:h,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,isShowSpinner:t,img:C,logoImage:T,imageName:E,activeBody:O,preCanvasDimensions:P,updateState:this.updateState,onRevert:this.onRevert,apply:this.apply,onSave:this.onSave,onFlip:this.onFlip,onApplyEffects:this.onApplyEffects,onApplyFilters:this.onApplyFilters,onRotate:this.onRotate,onAdjust:this.onAdjust,onDownloadImage:this.onDownloadImage,handleSave:this.handleSave},ie),{},{watermark:H,focusPoint:W,shapes:Y,shapeOperations:V,selectedShape:X,availableShapes:q}),le=cs(cs({t:re,theme:oe,cropDetails:s,original:u,activeTab:n,isShowSpinner:t,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,currentOperation:l,isHideCanvas:c,src:K,imageMime:g,onClose:G,onComplete:J,canvasDimensions:f,closeOnLoad:te,config:Z,processWithCloudimage:p,processWithFilerobot:d,processWithCloudService:h,imageSealing:j,uploadCloudimageImage:m,lastOperation:b,operationList:v,canvasZoomed:w,canvasOriginal:x,reduceBeforeEdit:k,cropBeforeEdit:S,img:C,logoImage:T,imageName:E,isPreResize:_,preCanvasDimensions:P,updateState:this.updateState,handleSave:this.handleSave,onPreResize:this.onPreResize,redoOperation:this.redoOperation,roundCrop:A},ie),{},{watermark:H,focusPoint:W,shapes:Y,shapeOperations:V,selectedShape:X,latestCanvasSize:$}),ce={logoImage:T,t:re,theme:oe,activeBody:O,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,currentOperation:l,processWithCloudimage:p,processWithCloudService:h,updateState:this.updateState,redoOperation:this.redoOperation,resetOperations:this.resetOperations,config:Z,watermark:H};return i.a.createElement(B,{roundCrop:A,isLoading:t},i.a.createElement(Wc,ae),i.a.createElement(we,null,"preview"===O&&i.a.createElement(Bo,le),"preResize"===O&&i.a.createElement(Qo,le),i.a.createElement(vn,{overlay:!0,show:t,label:re["spinner.label"]})),i.a.createElement(Gn,ce))}}])&&ss(t.prototype,n),r&&ss(t,r),a}(o.Component);function vs(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\e90c'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e90c'\n }\n"]);return vs=function(){return e},e}var ys=a.b.span.attrs((function(){return{role:"button"}}))(vs(),(function(e){return e.t||"10px"}),(function(e){return e.r||"10px"}),(function(e){return e.l||"auto"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"18px"}),(function(){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function ws(e){return(ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xs(){return(xs=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Ss(e,t){for(var n=0;n div {\n padding: 40px !important;\n }\n \n * {\n color: black !important;\n }\n ":""}));var zs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cs(e,t)}(c,e);var t,n,a,l=Es(c);function c(e){var t,n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),t=l.call(this,e),n=_s(t),o=function(e){var n=t.props.onClose,r=void 0===n?function(){}:n;27===e.keyCode&&(e.stopPropagation(),r(wr))},(r="handleOutsideMouseClick")in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,t.root=document.createElement("div"),t.root.classList.add("filerobot-image-editor-root"),t.root.id="filerobot-image-editor-root",document.body.appendChild(t.root);var i=t.props.closeOnOutsideClick;return(void 0===i||i)&&document.addEventListener("keydown",t.handleOutsideMouseClick),t}return t=c,(n=[{key:"componentWillUnmount",value:function(){var e=this.props.closeOnOutsideClick,t=void 0===e||e;document.body.removeChild(this.root),t&&document.removeEventListener("keydown",this.handleOutsideMouseClick)}},{key:"render",value:function(){var e=this.props,t=e.onClose,n=void 0===t?function(){}:t,a=e.isHideCloseBtn,l=e.configModalId,c=ks(e,["onClose","isHideCloseBtn","configModalId"]);return Object(r.createPortal)(i.a.createElement(o.Fragment,null,i.a.createElement(Ms,{className:"modal-overlay",onClick:function(){return n(xr)}}),i.a.createElement(Is,xs({id:l||er},this.props),!a&&i.a.createElement(ys,{onClick:n}),i.a.createElement(As,xs({h:"100%"},c),this.props.children))),this.root)}}])&&Ss(t.prototype,n),a&&Ss(t,a),c}(o.Component),Bs=(n(66),{en:{"header.image_editor_title":"Filerobot Image Editor","header.toggle_fullscreen":"Toggle fullscreen","header.close_modal":"Close window","toolbar.download":"Download","toolbar.save":"Save","toolbar.apply":"Apply","toolbar.cancel":"Cancel","toolbar.go_back":"Go Back","toolbar.adjust":"Adjust","toolbar.effects":"Effects","toolbar.filters":"Filters","toolbar.orientation":"Orientation","toolbar.crop":"Crop","toolbar.resize":"Resize","toolbar.watermark":"Watermark","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"Brightness","adjust.contrast":"Contrast","adjust.exposure":"Exposure","adjust.saturation":"Saturation","orientation.rotate_l":"Rotate Left","orientation.rotate_r":"Rotate Right","orientation.flip_h":"Flip Horizontally","orientation.flip_v":"Flip Vertically","pre_resize.title":"Would you like to reduce resolution before editing the image?","pre_resize.keep_original_resolution":"Keep original resolution","pre_resize.resize_n_continue":"Resize & Continue","footer.reset":"Reset","footer.undo":"Undo","footer.redo":"Redo","spinner.label":"Processing...","warning.too_big_resolution":"The resolution of the image is too big for the web. It can cause problems with Image Editor performance.","common.x":"x","common.y":"y","common.width":"width","common.height":"height","common.custom":"custom","common.original":"original","common.square":"square","common.opacity":"Opacity","common.apply_watermark":"Apply watermark","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery","common.text":"Text"},fr:{"header.image_editor_title":"Éditeur d'Image Filerobot","toolbar.download":"Télécharger","toolbar.save":"Sauvegarder","toolbar.apply":"Appliquer","toolbar.cancel":"Annuler","toolbar.go_back":"Retour","toolbar.adjust":"Ajuster","toolbar.effects":"Effets","toolbar.filters":"Filtres","toolbar.orientation":"Orientation","toolbar.crop":"Rogner","toolbar.resize":"Redimensionner","toolbar.watermark":"Watermark","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"Luminosité","adjust.contrast":"Contraste","adjust.exposure":"Exposition","adjust.saturation":"Saturation","orientation.rotate_l":"Rotation Gauche","orientation.rotate_r":"Rotation Droite","orientation.flip_h":"Miroir Horizontal","orientation.flip_v":"Miroir Vertical","pre_resize.title":"Voulez-vous réduire la résolution de l'image avant d'éditer l'image ?","pre_resize.keep_original_resolution":"Conserver la résolution d'origine","pre_resize.resize_n_continue":"Redimensionner et Continuer","footer.reset":"Réinitialiser","footer.undo":"Annuler","footer.redo":"Refaire","spinner.label":"Transformation...","warning.too_big_resolution":"La résolution de l'image est trop grande pour le web et peut endommager les performances de l'Éditeur d'Image Filerobot.","common.x":"x","common.y":"y","common.width":"largeur","common.height":"hauteur","common.custom":"custom","common.original":"original","common.square":"carré","common.opacity":"opacité","common.apply_watermark":"Appliquer watermark","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery"},"zh-cn":{"header.image_editor_title":"Filerobot 图片编辑器","toolbar.download":"下载","toolbar.save":"保存","toolbar.apply":"应用","toolbar.cancel":"取消","toolbar.go_back":"后退","toolbar.adjust":"调整","toolbar.effects":"效果","toolbar.filters":"滤镜","toolbar.orientation":"方向","toolbar.crop":"裁切","toolbar.resize":"缩放","toolbar.watermark":"水印","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"亮度","adjust.contrast":"对比对","adjust.exposure":"曝光度","adjust.saturation":"饱和度","orientation.rotate_l":"向左旋转","orientation.rotate_r":"向右旋转","orientation.flip_h":"水平翻转","orientation.flip_v":"垂直翻转","pre_resize.title":"是否需要在开始编辑之前缩小图片的分辨率?","pre_resize.keep_original_resolution":"保持原始分辨率","pre_resize.resize_n_continue":"缩小并继续","footer.reset":"重置","footer.undo":"撤销","footer.redo":"重做","spinner.label":"处理中...","warning.too_big_resolution":"图片的分辨率过大,这会严重影响图片编辑器的性能。","common.x":"x","common.y":"y","common.width":"宽度","common.height":"高度","common.custom":"自定义","common.original":"原始比例","common.square":"方形","common.banner":"通栏","common.opacity":"透明度","common.apply_watermark":"应用水印","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery"}}),Ls={colors:{primaryBg:"#1e262c",primaryBgHover:"#637381",secondaryBg:"#263138",secondaryBgHover:"#34444c",text:"#F9FAFB",textHover:"#fff",textMute:"#aaa",textWarn:"#f7931e",secondaryBgOpacity:"rgba(0, 0, 0, 0.75)",accent:"#00707c",border:"#161e23",borderLight:"#70777f",disabledBg:"rgba(255, 0, 0, 0.1)"}},Ns={colors:{primaryBg:"#f2f2f2",primaryBgHover:"#fff",secondaryBg:"#fff",secondaryBgHover:"#f9fafb",secondaryBgOpacity:"rgba(255,255,255, 0.75)",text:"#34444c",textHover:"#1a2329",textMute:"#aaa",textWarn:"#f7931e",accent:"#00707c",border:"#aeaeae",borderLight:"#e1e1e1",disabledBg:"rgba(255, 0, 0, 0.1)"}},Fs="undefined"==typeof window||"undefined"==typeof CanvasRenderingContext2D;function Us(e){return(Us="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ws(e){for(var t=1;t-1})):n})})),Ks($s(t),"open",(function(e){var n=t.props.onOpen;t._isMounted&&t.setState({isVisible:!0,src:e},(function(){n&&n()}))})),Ks($s(t),"close",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vr,n=t.props.onClose,r="object"===Us(e)?vr:e;t._isMounted&&t.setState({isVisible:!1},(function(){n&&n({status:r})}))})),s.translations=s.translations||{},s.language=s.translations[s.language]||Bs[s.language]?s.language:"en",s.theme=s.theme||{},s.theme.colors=s.theme.colors||{},s.theme.fonts=s.theme.fonts||ur,s.colorScheme=s.colorScheme||"dark",s.platform=s.platform||"filerobot";var u="object"===Us(s.colorScheme);return t.state={isVisible:r,src:a,config:t.processConfig(s),t:Ws(Ws({},Bs[s.language]),s.translations[s.language]),colorScheme:u?"custom":s.colorScheme||"dark",theme:{colors:Ws(Ws({},(u?{colors:s.colorScheme}:"light"===s.colorScheme?Ns:Ls).colors),s.theme.colors),fonts:s.theme.fonts}},t}return t=l,(n=[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"componentDidUpdate",value:function(e){this.props.show!==e.show&&(this.props.show?this.open(this.props.src):this.close())}},{key:"render",value:function(){var e=this.state,t=e.isVisible,n=e.src,r=e.config,o=e.t,l=e.theme,c=this.props,s=c.onComplete,u=void 0===s?function(){}:s,f=c.onBeforeComplete,p=c.closeOnLoad,d=r.showInModal,h=void 0===d||d;if(!n||!t||Fs)return null;if(n instanceof Blob&&r.processWithCloudimage)return null;var m=i.a.createElement(z,null,i.a.createElement(bs,{src:n,config:r,onComplete:u,onBeforeComplete:f,onClose:this.close,closeOnLoad:p,t:o}));return i.a.createElement(a.a,{theme:Ws({},l)},h?i.a.createElement(zs,{noBorder:!0,fullScreen:"lg",isHideCloseBtn:!0,style:{borderRadius:5},onClose:this.close,configModalId:r.elementId},m):i.a.createElement("div",{className:"filerobot-image-editor-root",id:"filerobot-image-editor-root",style:{width:"100%",height:"100%"}},m))}}])&&Ys(t.prototype,n),r&&Ys(t,r),l}(o.Component);function Gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}window.FilerobotImageEditor=function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Gs(this,e),t=n.elementId?n.elementId:n.processWithCloudimage||n.cloudimage?"filerobot-image-editor-cloudimage":n.processWithFilerobot||n.filerobot?"filerobot-image-editor-uploader":"filerobot-image-editor";var l=document.getElementById(t),c=function(e){console.log(e)};c=o&&"function"==typeof o?o:(o=o||{}).onComplete||c,l||((l=document.createElement("div")).id=t,document.body.appendChild(l)),n.elementId=t;var s=function(e){return Object(r.render)(i.a.createElement(e,{show:a,config:n,onComplete:c,onBeforeComplete:o.onBeforeComplete,onOpen:o.onOpen,onClose:o.onClose}),l)};this.component=s(Zs),this.open=this.component.open,this.close=this.component.close,this.unmount=function(){return Object(r.unmountComponentAtNode)(l)}}}]); \ No newline at end of file +var r=n(36),o=n(37),i=n(38);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return _(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,a=1,l=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,l/=2,c/=2,n/=2}function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;il&&(n=l-c),i=n;i>=0;i--){for(var f=!0,p=0;po&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:s>223?3:s>191?2:1;if(o+f<=n)switch(f){case 1:s<128&&(u=s);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&s)<<6|63&i)>127&&(u=c);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(c=(15&s)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=e[o+1],a=e[o+2],l=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&l)&&(c=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&l)>65535&&c<1114112&&(u=c)}null===u?(u=65533,f=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),l=Math.min(i,a),s=this.slice(r,o),u=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return k(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function A(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function I(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,i){return i||I(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||I(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):A(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=0,a=1,l=0;for(this[t]=255&e;++i>0)-l&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/a>>0)-l&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):A(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(13))},function(e,t,n){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=s(e),a=r[0],l=r[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,l)),u=0,f=l>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===l&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===l&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,l=n-o;al?l:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,c=a.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var o,i,a=[],l=t;l>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,l=8*o-r-1,c=(1<>1,u=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-u)-1,d>>=-u,u+=l;u>0;i=256*i+e[t+f],f+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+f],f+=p,u-=8);if(0===i)i=1-s;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=s}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,l,c,s=8*i-o-1,u=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(t*c-1)*Math.pow(2,o),a+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&l,d+=h,l/=256,o-=8);for(a=a<0;e[n+d]=255&a,d+=h,a/=256,s-=8);e[n+d-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(module,__webpack_exports__,__webpack_require__){"use strict";var _module__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(19),_core_util__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2),_logger__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3),_store__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6),_renderer__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(20);function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n",this.hiDPIReplacement()),this.swapped=!0,this.image.src=this.hiDPIReplacement()),Caman.IO.isRemote(this.image))return this.image.src=Caman.IO.proxyUrl(this.image.src),_logger__WEBPACK_IMPORTED_MODULE_2__.a.debug("Remote image detected, using URL = ".concat(this.image.src))}},{key:"waitForImageLoaded",value:function(){return this.isImageLoaded()?this.imageLoaded():this.image.onload=this.imageLoaded}},{key:"isImageLoaded",value:function(){return!!this.image.complete&&(null==this.image.naturalWidth||0!==this.image.naturalWidth)}},{key:"imageWidth",value:function(){return this.image.width||this.image.naturalWidth}},{key:"imageHeight",value:function(){return this.image.height||this.image.naturalHeight}},{key:"imageLoaded",value:function(){return _logger__WEBPACK_IMPORTED_MODULE_2__.a.debug("Image loaded. Width = ".concat(this.imageWidth(),", Height = ").concat(this.imageHeight())),this.swapped?(this.canvas.width=this.imageWidth()/this.hiDPIRatio(),this.canvas.height=this.imageHeight()/this.hiDPIRatio()):(this.canvas.width=this.imageWidth(),this.canvas.height=this.imageHeight()),this.finishInit()}},{key:"finishInit",value:function(){if(null==this.context&&(this.context=this.canvas.getContext("2d")),this.originalWidth=this.preScaledWidth=this.width=this.canvas.width,this.originalHeight=this.preScaledHeight=this.height=this.canvas.height,this.hiDPIAdjustments(),this.hasId()||this.assignId(),null!=this.image&&this.context.drawImage(this.image,0,0,this.imageWidth(),this.imageHeight(),0,0,this.preScaledWidth,this.preScaledHeight),this.imageData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),this.pixelData=this.imageData.data,Caman.allowRevert){this.initializedPixelData=_core_util__WEBPACK_IMPORTED_MODULE_1__.b.dataArray(this.pixelData.length),this.originalPixelData=_core_util__WEBPACK_IMPORTED_MODULE_1__.b.dataArray(this.pixelData.length);for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;if(null==r&&(r=0),null==n){n=0;for(var o=0,i=t.length,a=0<=i;a?oi;a?o++:o--)n+=t[o]}return this.renderer.add({type:Caman.Filter.Type.Kernel,name:e,adjust:t,divisor:n,bias:r}),this}},{key:"processPlugin",value:function(e,t){return this.renderer.add({type:Caman.Filter.Type.Plugin,plugin:e,args:t}),this}},{key:"newLayer",value:function(e){var t=new Caman.Layer(this);return this.canvasQueue.push(t),this.renderer.add({type:Caman.Filter.Type.LayerDequeue}),e.call(t),this.renderer.add({type:Caman.Filter.Type.LayerFinished}),this}},{key:"executeLayer",value:function(e){return this.pushContext(e)}},{key:"pushContext",value:function(e){return this.layerStack.push(this.currentLayer),this.pixelStack.push(this.pixelData),this.currentLayer=e,this.pixelData=e.pixelData}},{key:"popContext",value:function(){return this.pixelData=this.pixelStack.pop(),this.currentLayer=this.layerStack.pop()}},{key:"applyCurrentLayer",value:function(){return this.currentLayer.applyToParent()}},{key:"save",value:function(){return this.browserSave.apply(this,arguments)}},{key:"browserSave",value:function(e){null==e&&(e="png"),e=e.toLowerCase();var t=this.toBase64(e).replace("image/".concat(e),"image/octet-stream");return document.location.href=t}},{key:"toImage",value:function(e){var t=new Image;return t.src=this.toBase64(e),t.width=this.dimensions.width,t.height=this.dimensions.height,window.devicePixelRatio&&(t.width/=window.devicePixelRatio,t.height/=window.devicePixelRatio),t}},{key:"toBase64",value:function(e){return null==e&&(e="png"),e=e.toLowerCase(),this.canvas.toDataURL("image/".concat(e))}}]),Caman}(_module__WEBPACK_IMPORTED_MODULE_0__.a);Caman.initClass(),window.Caman=Caman;var _unused_webpack_default_export=Caman},function(e,t){function n(e,t){for(var n=0;n1;){for(var m=[],g=0,b=h.length-2,v=0<=b;v?g<=b:g>=b;v?g++:g--)m.push([f(h[g][0],h[g+1][0],d),f(h[g][1],h[g+1][1],d)]);h=m}u[Math.round(h[0][0])]=Math.round((l=h[0][1],c=o,s=i,Math.min(Math.max(l,c),s)))}var y=a[a.length-1][0];return u=Caman.Calculate.missingValues(u,y),null==u[y]&&(u[y]=u[y-1]),u}},{key:"hermite",value:function(e,t,n){if(e.length<2)throw"Invalid number of arguments to hermite";for(var r,o,i,a,l={},c=function(e,t){return[e[0]*t[0],e[1]*t[1]]},s=function(e,t){return[e[0]-t[0],e[1]-t[1]]},u=function(e,t,n){return Math.min(Math.max(e,t),n)},f=0,p=e.length-2,d=0<=p;d?f<=p:f>=p;d?f++:f--){var h=e[f],m=e[f+1],g=m[0]-h[0],b=1/g;f===e.length-2&&(b=1/(g-1));for(var v=f>0?e[f-1]:h,y=c(s(m,v),[.5,.5]),w=c(s(v=f=k;S?x++:x--){var C=x*b,E=2*C*C*C-3*C*C+1,O=C*C*C-2*C*C+C,_=-2*C*C*C+3*C*C,P=C*C*C-C*C,T=(r=c(h,[E,E]),o=c(y,[O,O]),i=c(m,[_,_]),a=c(w,[P,P]),[r[0]+o[0]+i[0]+a[0],r[1]+o[1]+i[1]+a[1]]);l[Math.round(T[0])]=Math.round(u(T[1],t,n))}}var j=e[e.length-1][0];return l=Caman.Calculate.missingValues(l,j)}},{key:"missingValues",value:function(e,t){var n,r,o,i,a,l,c;if(Object.keys(e).length=t;n=0<=t?++l:--l)if(null!=e[n])i[n]=e[n];else{for(o=[n-1,i[n-1]],r=c=n;n<=t?c<=t:c>=t;r=n<=t?++c:--c)if(null!=e[r]){a=[r,e[r]];break}a||(a=[0,0]),i[n]=o[1]+(a[1]-o[1])/(a[0]-o[0])*(n-o[0])}return i}return e}}],(r=null)&&n(t.prototype,r),o&&n(t,o),e}();Caman.Calculate=r},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n.5?s/(2-a-l):s/(a+l),o=function(){switch(a){case e:return(t-r)/s+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}},{key:"rgbToHSV",value:function(e,t,n){var r;e/=255,t/=255,n/=255;var o=Math.max(e,t,n),i=Math.min(e,t,n),a=o,l=o-i,c=0===o?0:l/o;return o===i?r=0:(r=function(){switch(o){case e:return(t-n)/l+(t.04045?e=Math.pow((e+.055)/1.055,2.4):e/=12.92,t>.04045?t=Math.pow((t+.055)/1.055,2.4):t/=12.92,n>.04045?n=Math.pow((n+.055)/1.055,2.4):n/=12.92,{x:100*(.4124*e+.3576*t+.1805*n),y:100*(.2126*e+.7152*t+.0722*n),z:100*(.0193*e+.1192*t+.9505*n)}}},{key:"xyzToRGB",value:function(e,t,n){var r=3.2406*(e/=100)+-1.5372*(t/=100)+-.4986*(n/=100),o=-.9689*e+1.8758*t+.0415*n,i=.0557*e+-.204*t+1.057*n;return r>.0031308?r=1.055*Math.pow(r,.4166666667)-.055:r*=12.92,o>.0031308?o=1.055*Math.pow(o,.4166666667)-.055:o*=12.92,i>.0031308?i=1.055*Math.pow(i,.4166666667)-.055:i*=12.92,{r:255*r,g:255*o,b:255*i}}},{key:"xyzToLab",value:function(e,t,r){return"object"===n(e)&&(t=e.y,r=e.z,e=e.x),t/=100,r/=108.883,e=(e/=95.047)>.008856451679?Math.pow(e,.3333333333):7.787037037*e+.1379310345,{l:116*(t=t>.008856451679?Math.pow(t,.3333333333):7.787037037*t+.1379310345)-16,a:500*(e-t),b:200*(t-(r=r>.008856451679?Math.pow(r,.3333333333):7.787037037*r+.1379310345))}}},{key:"labToXYZ",value:function(e,t,r){"object"===n(e)&&(t=e.a,r=e.b,e=e.l);var o=(e+16)/116,i=o+t/500,a=o-r/200;return i>.2068965517?i*=i*i:i=.1284185493*(i-.1379310345),o>.2068965517?o*=o*o:o=.1284185493*(o-.1379310345),a>.2068965517?a*=a*a:a=.1284185493*(a-.1379310345),{x:95.047*i,y:100*o,z:108.883*a}}},{key:"rgbToLab",value:function(e,t,r){"object"===n(e)&&(t=e.g,r=e.b,e=e.r);var o=this.rgbToXYZ(e,t,r);return this.xyzToLab(o)}},{key:"labToRGB",value:function(e,t,n){}}],(o=null)&&r(t.prototype,o),i&&r(t,i),e}();Caman.Convert=o},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null;if(this.events[t]&&this.events[t].length)return function(){for(var o=[],i=0,a=Array.from(n.events[t]);i4&&void 0!==arguments[4]?arguments[4]:null;n(this,e),null==t&&(t=0),this.r=t,null==r&&(r=0),this.g=r,null==o&&(o=0),this.b=o,null==i&&(i=255),this.a=i,this.c=a,this.loc=0}return o(e,null,[{key:"coordinatesToLocation",value:function(e,t,n){return 4*(t*n+e)}},{key:"locationToCoordinates",value:function(e,t){return{x:e%(4*t)/4,y:Math.floor(e/(4*t))}}}]),o(e,[{key:"setContext",value:function(e){return this.c=e}},{key:"locationXY",value:function(){if(null==this.c)throw"Requires a CamanJS context";var e=this.c.dimensions.height-Math.floor(this.loc/(4*this.c.dimensions.width));return{x:this.loc%(4*this.c.dimensions.width)/4,y:e}}},{key:"pixelAtLocation",value:function(t){if(null==this.c)throw"Requires a CamanJS context";return new e(this.c.pixelData[t],this.c.pixelData[t+1],this.c.pixelData[t+2],this.c.pixelData[t+3],this.c)}},{key:"getPixelRelative",value:function(t,n){if(null==this.c)throw"Requires a CamanJS context";var r=this.loc+4*this.c.dimensions.width*(-1*n)+4*t;return r>this.c.pixelData.length||r<0?new e(0,0,0,255,this.c):this.pixelAtLocation(r)}},{key:"putPixelRelative",value:function(e,t,n){if(null==this.c)throw"Requires a CamanJS context";this.loc,this.c.dimensions.width;if(!(newLoc>this.c.pixelData.length||newLoc<0))return this.c.pixelData[newLoc]=n.r,this.c.pixelData[newLoc+1]=n.g,this.c.pixelData[newLoc+2]=n.b,this.c.pixelData[newLoc+3]=n.a,!0}},{key:"getPixel",value:function(e,t){if(null==this.c)throw"Requires a CamanJS context";var n=this.coordinatesToLocation(e,t,this.width);return this.pixelAtLocation(n)}},{key:"putPixel",value:function(e,t,n){if(null==this.c)throw"Requires a CamanJS context";var r=this.coordinatesToLocation(e,t,this.width);return this.c.pixelData[r]=n.r,this.c.pixelData[r+1]=n.g,this.c.pixelData[r+2]=n.b,this.c.pixelData[r+3]=n.a}},{key:"toString",value:function(){return this.toKey()}},{key:"toHex",value:function(e){null==e&&(e=!1);var t="#"+this.r.toString(16)+this.g.toString(16)+this.b.toString(16);return e?t+this.a.toString(16):t}}]),e}();Caman.Pixel=i},function(e,t){function n(e,t){for(var n=0;n255-e?t.r=255:t.r255-e?t.g=255:t.g255-e?t.b=255:t.b0?t.r+=(255-t.r)*e.red:t.r-=t.r*Math.abs(e.red)),null!=e.green&&(e.green>0?t.g+=(255-t.g)*e.green:t.g-=t.g*Math.abs(e.green)),null!=e.blue&&(e.blue>0?t.b+=(255-t.b)*e.blue:t.b-=t.b*Math.abs(e.blue)),t}))})),Caman.Filter.register("curves",(function(){var e,t,n,r,o,i,a,l,c,s,u,f;if(n=arguments[0],"function"==typeof(a=(r=2<=arguments.length?[].slice.call(arguments,1):[])[r.length-1])?(e=a,r.pop()):"string"==typeof a?(e=Caman.Calculate[a],r.pop()):e=Caman.Calculate.bezier,"string"==typeof n&&(n=n.split("")),"v"===n[0]&&(n=["r","g","b"]),r.length<2)throw"Invalid number of arguments to curves filter";if(t=e(r,0,255),(l=r[0])[0]>0)for(i=c=0,u=l[0];0<=u?cu;i=0<=u?++c:--c)t[i]=l[1];if((o=r[r.length-1])[0]<255)for(i=s=f=o[0];f<=255?s<=255:s>=255;i=f<=255?++s:--s)t[i]=o[1];return this.process("curves",(function(e){var r,o;for(i=r=0,o=n.length;0<=o?ro;i=0<=o?++r:--r)e[n[i]]=t[e[n[i]]];return e}))})),Caman.Filter.register("exposure",(function(e){var t,n,r;return t=[0,255*(r=Math.abs(e)/100)],n=[255-255*r,255],e<0&&(t=t.reverse(),n=n.reverse()),this.curves("rgb",[0,0],t,n,[255,255])}))},function(e,t){Caman.Filter.register("boxBlur",(function(){return this.processKernel("Box Blur",[1,1,1,1,1,1,1,1,1])})),Caman.Filter.register("heavyRadialBlur",(function(){return this.processKernel("Heavy Radial Blur",[0,0,1,0,0,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,0,0,1,0,0])})),Caman.Filter.register("gaussianBlur",(function(){return this.processKernel("Gaussian Blur",[1,4,6,4,1,4,16,24,16,4,6,24,36,24,6,4,16,24,16,4,1,4,6,4,1])})),Caman.Filter.register("motionBlur",(function(e){var t;return t=0===e||180===e?[0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0]:e>0&&e<90||e>180&&e<270?[0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0]:90===e||270===e?[0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0]:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],this.processKernel("Motion Blur",t)})),Caman.Filter.register("sharpen",(function(e){return null==e&&(e=100),e/=100,this.processKernel("Sharpen",[0,-e,0,-e,4*e+1,-e,0,-e,0])}))},function(e,t){Caman.Filter.register("vignette",(function(e,t){var n,r,o,i;return null==t&&(t=60),"string"==typeof e&&"%"===e.substr(-1)&&(e=this.dimensions.height>this.dimensions.width?this.dimensions.width*(parseInt(e.substr(0,e.length-1),10)/100):this.dimensions.height*(parseInt(e.substr(0,e.length-1),10)/100)),t/=100,r=[this.dimensions.width/2,this.dimensions.height/2],i=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)),o=i-e,n=Caman.Calculate.bezier([0,1],[30,30],[70,60],[100,80]),this.process("vignette",(function(i){var a,l,c;return c=i.locationXY(),(a=Caman.Calculate.distance(c.x,c.y,r[0],r[1]))>o&&(l=Math.max(1,n[Math.round((a-o)/e*100)]/10*t),i.r=255*Math.pow(i.r/255,l),i.g=255*Math.pow(i.g/255,l),i.b=255*Math.pow(i.b/255,l)),i}))}))},function(e,t){Caman.Filter.register("posterize",(function(e){var t,n;return t=256/e,n=255/(e-1),this.process("posterize",(function(e){return e.r=Math.floor(Math.floor(e.r/t)*n),e.g=Math.floor(Math.floor(e.g/t)*n),e.b=Math.floor(Math.floor(e.b/t)*n),e}))}))},function(e,t){Caman.Filter.register("edgeEnhance",(function(){return this.processKernel("Edge Enhance",[0,0,0,-1,1,0,0,0,0])})),Caman.Filter.register("edgeDetect",(function(){return this.processKernel("Edge Detect",[-1,-1,-1,-1,8,-1,-1,-1,-1])})),Caman.Filter.register("emboss",(function(){return this.processKernel("Emboss",[-2,-1,0,-1,1,1,0,1,2])}))},function(e,t){Caman.Filter.register("grungy",(function(){return this.gamma(1.5),this.clip(25),this.saturation(-60),this.contrast(5),this.noise(5),this.vignette("50%",30)}))},function(e,t){Caman.Filter.register("hazyDays",(function(){return this.gamma(1.2),this.newLayer((function(){return this.setBlendingMode("overlay"),this.opacity(60),this.copyParent(),this.filter.channels({red:5}),this.filter.stackBlur(15)})),this.newLayer((function(){return this.setBlendingMode("addition"),this.opacity(40),this.fillColor("#6899ba")})),this.newLayer((function(){return this.setBlendingMode("multiply"),this.opacity(35),this.copyParent(),this.filter.brightness(40),this.filter.vibrance(40),this.filter.exposure(30),this.filter.contrast(15),this.filter.curves("r",[0,40],[128,128],[128,128],[255,215]),this.filter.curves("g",[0,40],[128,128],[128,128],[255,215]),this.filter.curves("b",[0,40],[128,128],[128,128],[255,215]),this.filter.stackBlur(5)})),this.curves("r",[20,0],[128,158],[128,128],[235,255]),this.curves("g",[20,0],[128,128],[128,128],[235,255]),this.curves("b",[20,0],[128,108],[128,128],[235,255]),this.vignette("45%",20)}))},function(e,t){Caman.Filter.register("lomo",(function(e){return null==e&&(e=!0),this.brightness(15),this.exposure(15),this.curves("rgb",[0,0],[200,0],[155,255],[255,255]),this.saturation(-20),this.gamma(1.8),e&&this.vignette("50%",60),this.brightness(5)}))},function(e,t){Caman.Filter.register("sinCity",(function(){return this.contrast(100),this.brightness(15),this.exposure(10),this.posterize(80),this.clip(30),this.greyscale()}))},function(e,t){Caman.Filter.register("crossProcess",(function(){return this.exposure(5),this.colorize("#e87b22",4),this.sepia(20),this.channels({blue:8,red:3}),this.curves("b",[0,0],[100,150],[180,180],[255,255]),this.contrast(15),this.vibrance(75),this.gamma(1.6)}))},function(e,t){Caman.Filter.register("glowingSun",(function(e){if(null==e&&(e=!0),this.brightness(10),this.newLayer((function(){return this.setBlendingMode("multiply"),this.opacity(80),this.copyParent(),this.filter.gamma(.8),this.filter.contrast(50),this.filter.exposure(10)})),this.newLayer((function(){return this.setBlendingMode("softLight"),this.opacity(80),this.fillColor("#f49600")})),this.exposure(20),this.gamma(.8),e)return this.vignette("45%",20)}))},function(e,t){Caman.Filter.register("jarques",(function(){return this.saturation(-35),this.curves("b",[20,0],[90,120],[186,144],[255,230]),this.curves("r",[0,0],[144,90],[138,120],[255,255]),this.curves("g",[10,0],[115,105],[148,100],[255,248]),this.curves("rgb",[0,0],[120,100],[128,140],[255,255]),this.sharpen(20)}))},function(e,t){Caman.Filter.register("love",(function(){return this.brightness(5),this.exposure(8),this.contrast(4),this.colorize("#c42007",30),this.vibrance(50),this.gamma(1.3)}))},function(e,t){Caman.Filter.register("oldBoot",(function(){return this.saturation(-20),this.vibrance(-50),this.gamma(1.1),this.sepia(30),this.channels({red:-10,blue:5}),this.curves("rgb",[0,0],[80,50],[128,230],[255,255]),this.vignette("60%",30)}))},function(e,t){Caman.Filter.register("orangePeel",(function(){return this.curves("rgb",[0,0],[100,50],[140,200],[255,255]),this.vibrance(-30),this.saturation(-30),this.colorize("#ff9000",30),this.contrast(-5),this.gamma(1.4)}))},function(e,t){Caman.Filter.register("pinhole",(function(){return this.greyscale(),this.sepia(10),this.exposure(10),this.contrast(15),this.vignette("60%",35)}))},function(e,t){Caman.Filter.register("sunrise",(function(){return this.exposure(3.5),this.saturation(-5),this.vibrance(50),this.sepia(60),this.colorize("#e87b22",10),this.channels({red:8,blue:8}),this.contrast(5),this.gamma(1.2),this.vignette("55%",25)}))},function(e,t){Caman.Filter.register("vintage",(function(e){if(null==e&&(e=!0),this.greyscale(),this.contrast(5),this.noise(3),this.sepia(100),this.channels({red:8,blue:2,green:4}),this.gamma(.87),e)return this.vignette("40%",30)}))},function(e,t){var n,r,o;r=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],n=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},Caman.Plugin.register("stackBlur",(function(e){var t,i,a,l,c,s,u,f,p,d,h,m,g,b,v,y,w,x,k,S,C,E,O,_,P,T,j,R,D,M,A,I,z,B,L,N,F,U,H,W,Y,V,X,q;if(!(isNaN(e)||e<1)){for(e|=0,v=this.pixelData,l=e+e+1,(D=this.dimensions.width)<<2,M=D-1,p=(f=this.dimensions.height)-1,R=(S=e+1)*(S+1)/2,O=j=new n,d=N=1;1<=l?Nl;d=1<=l?++N:--N)O=O.next=new n,d===S&&(_=O);for(O.next=j,P=null,T=null,L=z=0,h=r[e],E=o[e],I=F=0;0<=f?Ff;I=0<=f?++F:--F){for(w=c=t=k=u=a=0,x=S*(y=v[z]),s=S*(b=v[z+1]),i=S*(g=v[z+2]),k+=R*y,u+=R*b,a+=R*g,O=j,d=U=0;0<=S?US;d=0<=S?++U:--U)O.r=y,O.g=b,O.b=g,O=O.next;for(d=H=1;1<=S?HS;d=1<=S?++H:--H)m=z+((MD;A=0<=D?++W:--W)v[z]=k*h>>E,v[z+1]=u*h>>E,v[z+2]=a*h>>E,k-=x,u-=s,a-=i,x-=P.r,s-=P.g,i-=P.b,m=L+((m=A+e+1)D;A=0<=D?++Y:--Y){for(c=t=w=u=a=k=0,x=S*(y=v[z=A<<2]),s=S*(b=v[z+1]),i=S*(g=v[z+2]),k+=R*y,u+=R*b,a+=R*g,O=j,d=V=0;0<=S?VS;d=0<=S?++V:--V)O.r=y,O.g=b,O.b=g,O=O.next;for(B=D,d=X=1;1<=e?X<=e:X>=e;d=1<=e?++X:--X)z=B+A<<2,k+=(O.r=y=v[z])*(C=S-d),u+=(O.g=b=v[z+1])*C,a+=(O.b=g=v[z+2])*C,w+=y,c+=b,t+=g,O=O.next,df;I=0<=f?++q:--q)v[m=z<<2]=k*h>>E,v[m+1]=u*h>>E,v[m+2]=a*h>>E,k-=x,u-=s,a-=i,x-=P.r,s-=P.g,i-=P.b,m=A+((m=I+S)=0&&u.splice(t,1)}function g(e){var t=document.createElement("style");return e.attrs.type="text/css",b(t,e.attrs),h(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function v(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var a=s++;n=c||(c=g(t)),r=x.bind(null,n,a,!1),o=x.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",b(t,e.attrs),h(e,t),t}(t),r=S.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=k.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var r=[],o=0;o1||"string"!=typeof t||"r"!=t[0]&&"#"!=t[0]||"string"!=typeof n&&void 0!==n)return null;window.sbcRip||(window.sbcRip=function(e){var t=e.length,n=new Object;if(t>9){if((e=e.split(",")).length<3||e.length>4)return null;n[0]=r(e[0].slice(4)),n[1]=r(e[1]),n[2]=r(e[2]),n[3]=e[3]?parseFloat(e[3]):-1}else{if(8==t||6==t||t<4)return null;t<6&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?e[4]+""+e[4]:"")),e=r(e.slice(1),16),n[0]=e>>16&255,n[1]=e>>8&255,n[2]=255&e,n[3]=9==t||5==t?o((e>>24&255)/255*1e4)/1e4:-1}return n});var r=parseInt,o=Math.round,i=t.length>9,a=(i="string"==typeof n?n.length>9||"c"==n&&!i:i,e<0),l=(e=a?-1*e:e,n=n&&"c"!=n?n:a?"#000000":"#FFFFFF",window.sbcRip(t)),c=window.sbcRip(n);return l&&c?i?"rgb("+o((c[0]-l[0])*e+l[0])+","+o((c[1]-l[1])*e+l[1])+","+o((c[2]-l[2])*e+l[2])+(l[3]<0&&c[3]<0?")":","+(l[3]>-1&&c[3]>-1?o(1e4*((c[3]-l[3])*e+l[3]))/1e4:c[3]<0?l[3]:c[3])+")"):"#"+(4294967296+16777216*(l[3]>-1&&c[3]>-1?o(255*((c[3]-l[3])*e+l[3])):c[3]>-1?o(255*c[3]):l[3]>-1?o(255*l[3]):255)+65536*o((c[0]-l[0])*e+l[0])+256*o((c[1]-l[1])*e+l[1])+o((c[2]-l[2])*e+l[2])).toString(16).slice(l[3]>-1||c[3]>-1?1:3):null}var h=function(e,t){if(!e)return null;var n=function(e){return/^#?([a-f\d])([a-f\d])([a-f\d])$/i.test(e)||/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.test(e)}(e)?e:d(0,e,"c");if(!n)return null;var r=function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}(n);return r?"rgba(".concat(r.r,", ").concat(r.g,", ").concat(r.b,", ").concat(t,")"):e};function m(e){var t="";switch(e){case"watermark":t="\\e918";break;case"reset":t="\\e912";break;case"flip-v":t="\\e916";break;case"flip-h":t="\\e914";break;case"cross":t="\\e90c";break;case"effects":t="\\e900";break;case"filters":t="\\e904";break;case"adjust":t="\\e90a";break;case"crop":t="\\e901";break;case"resize":t="\\e907";break;case"rotate":t="\\e90b";break;case"previous":t="\\e905";break;case"next":t="\\e906";break;case"ratio":t="\\e90e";break;case"no-ratio":t="\\e90f";break;case"left-rotate":t="\\e902";break;case"right-rotate":t="\\e908";break;case"focus_point":t="\\e919";break;case"shapes":t="\\e91b";break;case"image":t="\\e91a";break;case"text":t="T";break;default:return}return"\n &:before {\n content: '".concat(t,"'\n }\n ")}function g(){var e=C(["\n#filerobot-image-editor-root & {\n text-transform: ",";\n height: 20px;\n line-height: 20px;\n}\n"]);return g=function(){return e},e}function b(){var e=C(["\n#filerobot-image-editor-root & {\n background: url('","') 50% 50% / cover no-repeat;\n width: 55px;\n height: 55px;\n border-radius: 2px;\n overflow: hidden;\n display: inline-block;\n}\n"]);return b=function(){return e},e}function v(){var e=C(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: top;\n padding: 10px;\n text-align: center;\n min-width: 90px;\n height: 90px;\n cursor: pointer;\n color: ",";\n font-size: 12px;\n background: ",";\n}\n \n #filerobot-image-editor-root &:hover {\n background: ",";\n }\n"]);return v=function(){return e},e}function y(){var e=C(["\n#filerobot-image-editor-root & {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n"]);return y=function(){return e},e}function w(){var e=C(["\n#filerobot-image-editor-root & {\n height: 20px;\n line-height: 20px;\n}\n"]);return w=function(){return e},e}function x(){var e=C(["\n#filerobot-image-editor-root & {\n height: 40px;\n font-size: 40px;\n \n ",";\n ",";\n}\n"]);return x=function(){return e},e}function k(){var e=C(["\n#filerobot-image-editor-root & {\n padding: 20px 10px;\n cursor: pointer;\n display: inline-block;\n min-width: 80px;\n min-height: 100px;\n text-align: center;\n font-size: 12px;\n color: ",";\n text-transform: ",";\n background: ",";\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n background: ",";\n }\n"]);return k=function(){return e},e}function S(){var e=C(["\n#filerobot-image-editor-root & {\n height: 100px;\n width: 100%;\n overflow-x: ",";\n overflow-y: ",";\n white-space: nowrap;\n text-align: center;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n height: initial;\n padding: 0 10px\n}\n }\n"]);return S=function(){return e},e}function C(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var E=a.b.div(S(),(function(e){return e.overlayYHidden?"auto":"none"}),(function(e){return e.overlayYHidden?"hidden":"visible"}),(function(e){return e.theme.colors.border||"#3b4d54"})),O=a.b.div(k(),(function(e){return e.theme.colors.text}),(function(e){return e.noCapitalStrs?"none":e.tt||"capitalize"}),(function(e){return e.active?e.theme.colors.secondaryBg:"inherit"}),(function(e){return e.theme.colors.textHover}),(function(e){return e.theme.colors.secondaryBg})),_=a.b.div(x(),(function(e){return p(e)}),(function(e){return m(e.name)})),P=a.b.div(w()),T=a.b.div(y(),(function(e){return e.theme.colors.border||"#3b4d54"})),j=a.b.div(v(),(function(e){return e.theme.colors.text}),(function(e){return e.active?e.theme.colors.secondaryBgHover:"transparent"}),(function(e){return e.theme.colors.secondaryBgHover})),R=a.b.div(b(),(function(e){return e.src})),D=a.b.div(g(),(function(e){return e.noCapitalStrs?"none":"capitalize"}));function M(){var e=I(["\n#filerobot-image-editor-root & {\n position: relative;\n background: ",";\n z-index: 1050;\n width: 100%;\n height: 100%;\n min-height: 520px;\n overflow: ",";\n font-size: 12px;\n}\n \n #filerobot-image-editor-root & .filerobot-original-canvas {\n visibility: hidden;\n position: absolute;\n left: -99999px;\n display: none;\n }\n \n #filerobot-image-editor-root & .cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n \n #filerobot-image-editor-root & .cropper-container img {/*Avoid margin top issue (Occur only when margin-top <= -height)*/\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-wrap-box,\n #filerobot-image-editor-root & .cropper-canvas,\n #filerobot-image-editor-root & .cropper-drag-box,\n #filerobot-image-editor-root & .cropper-crop-box,\n #filerobot-image-editor-root & .cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n }\n \n #filerobot-image-editor-root & .cropper-wrap-box,\n #filerobot-image-editor-root & .cropper-canvas {\n overflow: hidden;\n }\n \n #filerobot-image-editor-root & .cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n }\n \n #filerobot-image-editor-root & .cropper-modal {\n background-color: #000;\n opacity: .5;\n }\n \n #filerobot-image-editor-root & .cropper-view-box {\n display: block;\n height: 100%;\n outline-color: rgba(255, 255, 255, 0.75);\n outline: 1px solid #fff;\n overflow: hidden;\n width: 100%;\n ",";\n }\n \n #filerobot-image-editor-root & .cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: .5;\n position: absolute;\n }\n \n #filerobot-image-editor-root & .cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: 33.33333%;\n left: 0;\n top: 33.33333%;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: 33.33333%;\n top: 0;\n width: 33.33333%;\n }\n \n #filerobot-image-editor-root & .cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: .75;\n position: absolute;\n top: 50%;\n width: 0;\n }\n \n #filerobot-image-editor-root & .cropper-center:before,\n #filerobot-image-editor-root & .cropper-center:after {\n background-color: #fff;\n content: ' ';\n display: block;\n position: absolute;\n }\n \n #filerobot-image-editor-root & .cropper-center:before {\n height: 1px;\n left: -10px;\n top: 0;\n width: 20px;\n }\n \n #filerobot-image-editor-root & .cropper-center:after {\n height: 20px;\n left: 0;\n top: -10px;\n width: 1px;\n }\n \n #filerobot-image-editor-root & .cropper-face,\n #filerobot-image-editor-root & .cropper-line,\n #filerobot-image-editor-root & .cropper-point {\n display: block;\n height: 100%;\n opacity: .1;\n position: absolute;\n width: 100%;\n }\n \n #filerobot-image-editor-root & .cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n ",";\n }\n \n #filerobot-image-editor-root & .cropper-line {\n background-color: #fff;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n }\n \n #filerobot-image-editor-root & .cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n }\n \n #filerobot-image-editor-root & .cropper-point {\n background-color: #fff;\n height: 20px;\n opacity: .90;\n width: 20px;\n border-radius: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point:before {\n content: '';\n display: table;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: black;\n opacity: 0.8;\n z-index: 11;\n position: absolute;\n top: calc(50% - 4px);\n left: calc(50% - 4px);\n }\n \n #filerobot-image-editor-root & .cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -10px;\n right: -10px;\n top: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-w {\n cursor: ew-resize;\n left: -10px;\n margin-top: -10px;\n top: 50%;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-s {\n bottom: -10px;\n cursor: s-resize;\n left: 50%;\n margin-left: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-ne {\n cursor: nesw-resize;\n right: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-nw {\n cursor: nwse-resize;\n left: -10px;\n top: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-sw {\n bottom: -10px;\n cursor: nesw-resize;\n left: -10px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-se {\n bottom: -10px;\n cursor: nwse-resize;\n height: 20px;\n right: -10px;\n width: 20px;\n }\n \n #filerobot-image-editor-root & .cropper-point.point-se:before {\n content: '';\n display: table;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: black;\n opacity: 0.8;\n z-index: 11;\n position: absolute;\n top: calc(50% - 4px);\n left: calc(50% - 4px);\n }\n \n #filerobot-image-editor-root & .cropper-invisible {\n opacity: 0;\n }\n \n #filerobot-image-editor-root & .cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n }\n \n #filerobot-image-editor-root & .cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n }\n \n #filerobot-image-editor-root & .cropper-hidden {\n display: none !important;\n }\n \n #filerobot-image-editor-root & .cropper-move {\n cursor: move;\n }\n \n #filerobot-image-editor-root & .cropper-crop {\n cursor: crosshair;\n }\n \n #filerobot-image-editor-root & .cropper-disabled .cropper-drag-box,\n #filerobot-image-editor-root & .cropper-disabled .cropper-face,\n #filerobot-image-editor-root & .cropper-disabled .cropper-line,\n #filerobot-image-editor-root & .cropper-disabled .cropper-point {\n cursor: not-allowed;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n justify-content: space-between\n}\n }\n"]);return M=function(){return e},e}function A(){var e=I(["\n#filerobot-image-editor-root & {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n}\n \n #filerobot-image-editor-root & ::-webkit-scrollbar {\n height: 10px !important;\n width: 10px !important;\n }\n \n #filerobot-image-editor-root & ::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 5px;\n }\n \n #filerobot-image-editor-root & *, #filerobot-image-editor-root & *:after, #filerobot-image-editor-root & *:before, #filerobot-image-editor-root & *::after, #filerobot-image-editor-root & *::before {\n box-sizing: border-box;\n }\n \n #filerobot-image-editor-root & *:after, #filerobot-image-editor-root & *:before, #filerobot-image-editor-root & *::after, #filerobot-image-editor-root & *::before {\n padding: 0;\n margin: 0;\n outline: 0;\n box-sizing: border-box;\n }\n \n /* cyrillic-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY_ZraR2Tg8w2lzm7kLNL0-w.woff2) format('woff2');\n unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;\n }\n \n /* cyrillic */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY14sYYdJg5dU2qzJEVSuta0.woff2) format('woff2');\n unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n }\n \n /* greek-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY1BW26QxpSj-_ZKm_xT4hWw.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n }\n \n /* greek */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpYwt_Rm691LTebKfY2ZkKSmI.woff2) format('woff2');\n unicode-range: U+0370-03FF;\n }\n \n /* vietnamese */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY9DiNsR5a-9Oe_Ivpu8XWlY.woff2) format('woff2');\n unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;\n }\n \n /* latin-ext */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY6E8kM4xWR1_1bYURRojRGc.woff2) format('woff2');\n unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;\n }\n \n /* latin */\n \n @font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400;\n src: local('Roboto Mono'), local('RobotoMono-Regular'), url(https://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY4gp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;\n }\n"]);return A=function(){return e},e}function I(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var z=Object(a.b)("div")(A(),(function(e){return e.theme.colors.border||"#3b4d54"})),B=a.b.div(M(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.isLoading?"hidden":"auto"}),(function(e){return e.roundCrop&&"border-radius: 50%"}),(function(e){return e.roundCrop&&"\n border-radius: 50%;\n box-shadow: 0 0 80px 15px #000;\n border: 2px solid #000;"}));function L(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function N(){var e=K(["\n#filerobot-image-editor-root & {\n margin-left: 8px;\n display: inline-block;\n vertical-align: middle;\n color: ",";\n margin-bottom: 3px;\n cursor: pointer;\n}\n"]);return N=function(){return e},e}function F(){var e=K(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n line-height: 30px;\n margin-right: 10px;\n float: right;\n}\n"]);return F=function(){return e},e}function U(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n width: 10px;\n height: 10px;\n margin: 5.5px;\n background: ",";\n position: absolute; top: 0; bottom: 0;\n right: ",";\n border: 1px solid ","; \n border-radius: 12px;\n transition: all 0.3s ease-in 0s;\n}\n"]);return U=function(){return e},e}function H(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n width: 200%; \n margin-left: ",';\n transition: margin 0.3s ease-in 0s;\n}\n \n #filerobot-image-editor-root &:before, #filerobot-image-editor-root &:after {\n display: block; float: left; width: 50%; height: 19px; padding: 0; line-height: 19px;\n font-size: 10px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;\n box-sizing: border-box;\n }\n \n #filerobot-image-editor-root &:before {\n content: "ON";\n padding-left: 10px !important;\n background-color: ','; \n color: #fff;\n }\n \n #filerobot-image-editor-root &:after {\n content: "OFF";\n padding-right: 10px !important;\n background-color: ',"; \n color: #aaa;\n text-align: right;\n }\n"]);return H=function(){return e},e}function W(){var e=K(["\n#filerobot-image-editor-root & {\n display: block; \n overflow: hidden; \n cursor: pointer;\n border: 1px solid ","; \n border-radius: 4px;\n margin: 0;\n}\n"]);return W=function(){return e},e}function Y(){var e=K(["\n#filerobot-image-editor-root & {\n display: none !important;\n}\n \n #filerobot-image-editor-root & :checked + .onoffswitch-label .onoffswitch-inner {\n margin-left: 0;\n}\n"]);return Y=function(){return e},e}function V(){var e=K(["\n#filerobot-image-editor-root & {\n position: relative; \n display: inline-block;\n vertical-align: middle;\n width: 60px;\n margin-bottom: 2px;\n -webkit-user-select: none; \n -moz-user-select: none; \n -ms-user-select: none;\n}\n"]);return V=function(){return e},e}function X(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return X=function(){return e},e}function q(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return q=function(){return e},e}function $(){var e=K(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n \n ",";\n}\n"]);return $=function(){return e},e}function Q(){var e=K(["\n#filerobot-image-editor-root & {\n background: ",";\n border-top: 1px solid ",";\n height: 34px;\n position: relative;\n z-index: 1;\n}\n"]);return Q=function(){return e},e}function K(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Z=a.b.div(Q(),(function(e){return e.theme.colors.secondaryBg}),(function(e){return e.theme.colors.border})),G=a.b.div($(),(function(e){return p(e)}),m("previous"),(function(e){return se(e)})),J=a.b.div(q(),(function(e){return p(e)}),m("next"),(function(e){return se(e)})),ee=a.b.div(X(),(function(e){return p(e)}),m("reset"),(function(e){return se(e)})),te=a.b.div(V()),ne=a.b.input(Y()),re=a.b.label(W(),(function(e){return e.theme.colors.border})),oe=a.b.span(H(),(function(e){return e.checked?"0":"-100%"}),(function(e){var t;return(null===(t=e.theme.colors.button)||void 0===t?void 0:t.primary)||"#01717d"}),(function(e){return e.theme.colors.primaryBg})),ie=a.b.span(U(),(function(e){return e.theme.colors.accent}),(function(e){return e.checked?"0":"37px"}),(function(e){return e.theme.colors.accent})),ae=Object(a.b)("div").attrs((function(){return{className:"cloudimage-url-generator-switch"}}))(F()),le=Object(a.b)("div")(N(),(function(e){return e.theme.colors.text})),ce=function(e){var t=e.id,n=e.handleChange,r=e.text,o=e.checked,a=e.style;L(e,["id","handleChange","text","checked","style"]);return i.a.createElement(ae,{style:a},i.a.createElement(te,null,i.a.createElement(ne,{type:"checkbox",name:t,id:t,onChange:function(){n(!o)},checked:o}),i.a.createElement(re,{htmlFor:t},i.a.createElement(oe,{checked:o}),i.a.createElement(ie,{checked:o}))),r&&i.a.createElement(le,{onClick:function(){n(!o)}},r))};function se(e){return"\n display: inline-block;\n height: 34px;\n width: 34px;\n cursor: ".concat(e.muted?"not-allowed":"pointer",";\n text-align: center;\n line-height: 34px;\n border-right: 1px solid ").concat(e.theme.colors.border,";\n \n &:hover {\n background: ").concat(e.muted?"inherit":e.theme.colors.secondaryBgHover,";\n }\n ")}function ue(){var e=ye(["\n#filerobot-image-editor-root & {\n display: ",";\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n}\n"]);return ue=function(){return e},e}function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function de(){return(de=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function me(){var e=ye(["\n#filerobot-image-editor-root & {\n width: ","px;\n height: ","px;\n display: inline-block;\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n outline: 0;\n}\n"]);return me=function(){return e},e}function ge(){var e=ye(["\n#filerobot-image-editor-root & {\n display: inline-block;\n max-height: 100%;\n max-width: 100%;\n height: 100%;\n vertical-align: middle;\n\n ",";\n\n ",";\n}\n\n /* Limit image width to avoid overflow the container */\n\n #filerobot-image-editor-root & img {\n max-width: 100% !important; /* This rule is very important, please do not ignore this! */\n }\n\n #filerobot-image-editor-root & .filerobot-edit-canvas {\n display: ",";\n max-height: 100%;\n max-width: 100%;\n vertical-align: middle;\n }\n"]);return ge=function(){return e},e}function be(){var e=ye(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n}\n"]);return be=function(){return e},e}function ve(){var e=ye(["\n#filerobot-image-editor-root & {\n height: calc(100% - 187px);\n text-align: center;\n line-height: calc(100% - 187px);\n padding: 20px;\n position: relative;\n}\n\n #filerobot-image-editor-root &:before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n }\n"]);return ve=function(){return e},e}function ye(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var we=a.b.div(ve()),xe=Object(a.b)("div")(be()),ke=a.b.div(ge(),(function(e){return e.hideCanvas?"\n canvas {\n position: relative;\n left: -9999px;\n }\n ":"\n &:before {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n }"}),(function(e){return e.isShowWatermark&&"\ncanvas:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: red;\n opacity: 0.5;\n }"}),(function(e){return e.hide?"none":"inline-block"})),Se=Object(a.b)("canvas")(me(),(function(e){return e.width||0}),(function(e){return e.height||0})),Ce=Object(a.b)(i.a.forwardRef((function(e,t){e.width,e.height;var n=he(e,["width","height"]);return i.a.createElement("div",de({className:"focus-point"},n,{ref:t}))})))((function(e){return{width:e.width,height:e.height,position:"absolute",margin:"auto",top:0,bottom:0,left:0,right:0,display:"inline-block",maxHeight:"100%",maxWidth:"100%",verticalAlign:"middle"}})),Ee=Object(a.b)((function(e){e.image;var t=he(e,["image"]);return i.a.createElement("div",t)}))((function(e){var t=e.image;return function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:"base",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=r?f.colors.base:null;return f.colors[t][i?i+(o?"er":""):n]}function Me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"base",n=e.light?"light":e.dark?"dark":null,r="base"!==t,o=f.colors.base;return n?f.colors[n][r?o:"base"]:f.colors.link[t]}function Ae(){var e=Fe(["\n#filerobot-image-editor-root & {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100px;\n background: ",";\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-direction: column;\n height: initial\n}\n }\n"]);return Ae=function(){return e},e}function Ie(){var e=Fe(["\n#filerobot-image-editor-root & {\n background: ",";\n border-color: ",";\n color: ",";\n text-transform: ",";\n min-width: 62px;\n height: 30px;\n margin-right: 8px;\n border: 0;\n}\n\n #filerobot-image-editor-root &:hover {\n background: ",";\n border-color: ",";\n color: ","; \n }\n"]);return Ie=function(){return e},e}function ze(){var e=Fe(["\n#filerobot-image-editor-root & {\n position: absolute;\n right: 12px;\n top: 8px;\n}\n"]);return ze=function(){return e},e}function Be(){var e=Fe(["\n#filerobot-image-editor-root & {\n text-align: center;\n text-transform: ",";\n color: ",";\n}\n"]);return Be=function(){return e},e}function Le(){var e=Fe(["\n#filerobot-image-editor-root & {\n line-height: 35px;\n border-bottom: 1px solid ",";\n background: ",";\n padding: 8px 0;\n}\n"]);return Le=function(){return e},e}function Ne(){var e=Fe(["\n#filerobot-image-editor-root & {\n background: ",";\n}\n"]);return Ne=function(){return e},e}function Fe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ue=a.b.div(Ne(),(function(e){return e.theme.colors.secondaryBg})),He=a.b.div(Le(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBg})),We=a.b.div(Be(),(function(e){return e.noCapitalStrs?"none":"capitalize"}),(function(e){return e.theme.colors.text})),Ye=a.b.div(ze()),Ve=Object(a.b)(je)(Ie(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.text}),(function(e){return e.noCapitalStrs?"none":"capitalize"}),(function(e){return function(e){if(!e)return null;var t=d(-.1,e)||"";return t.toLowerCase()===e.toLowerCase()?d(.25,e):t}(e.theme.colors.primaryBg)}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.text})),Xe=a.b.div(Ae(),(function(e){return e.theme.colors.secondaryBg}));function qe(){var e=st(["\n#filerobot-image-editor-root & {\n height: 20px;\n line-height: 20px;\n}\n"]);return qe=function(){return e},e}function $e(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n height: 50px;\n}\n"]);return $e=function(){return e},e}function Qe(){var e=st(["\n#filerobot-image-editor-root & {\n height: 50px;\n line-height: 50px;\n}\n"]);return Qe=function(){return e},e}function Ke(){var e=st(["\n#filerobot-image-editor-root & {\n height: ","px;\n border: 1px solid ",";\n width: ","px;\n margin: 0 auto;\n display: inline-block;\n vertical-align: middle;\n ",";\n}\n"]);return Ke=function(){return e},e}function Ze(){var e=st(["\n#filerobot-image-editor-root & {\n padding: 15px 0;\n height: 90px;\n line-height: 100px;\n}\n"]);return Ze=function(){return e},e}function Ge(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: top;\n text-align: center;\n padding: 0 20px;\n cursor: pointer;\n background: ",";\n}\n"]);return Ge=function(){return e},e}function Je(){var e=st(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: relative;\n font-weight: bold;\n font-size: ",";\n\n ",";\n ",";\n \n color: ",";\n}\n"]);return Je=function(){return e},e}function et(){var e=st(["\n#filerobot-image-editor-root & {\n padding: 0;\n}\n \n #filerobot-image-editor-root & > span {\n color: "," !important;\n }\n"]);return et=function(){return e},e}function tt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n padding: 0 5px;\n}\n"]);return tt=function(){return e},e}function nt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: ",";\n height: 30px;\n padding: 6px 12px;\n font-size: 12px;\n line-height: 1;\n color: ",";\n background: ",";\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n vertical-align: middle;\n border: 0px solid transparent;\n font-family: Roboto, sans-serif;\n border: 1px solid ",";\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n \n #filerobot-image-editor-root &:hover {\n outline: none;\n }\n \n #filerobot-image-editor-root &:focus {\n outline: none;\n }\n"]);return nt=function(){return e},e}function rt(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: ",";\n ",";\n height: 30px;\n padding: 6px 12px;\n font-size: 12px;\n line-height: 30px;\n color: ",";\n background: ",";\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out;\n vertical-align: middle;\n font-family: Roboto, sans-serif;\n border: 1px solid ",";\n \n ",";\n}\n \n #filerobot-image-editor-root &:hover {\n outline: none;\n }\n \n #filerobot-image-editor-root &:focus {\n outline: none;\n }\n"]);return rt=function(){return e},e}function ot(){var e=st(["\n#filerobot-image-editor-root & {\n display: block;\n margin-bottom: 5px;\n line-height: 15px;\n}\n"]);return ot=function(){return e},e}function it(){var e=st(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: 100px;\n padding-top: 10px;\n text-align: center;\n}\n"]);return it=function(){return e},e}function at(){var e=st(["\n#filerobot-image-editor-root & {\n display: block;\n color: ",";\n height: 30px;\n line-height: 30px;\n}\n"]);return at=function(){return e},e}function lt(){var e=st(["\n@media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n overflow-x: scroll\n}\n }\n"]);return lt=function(){return e},e}function ct(){var e=st(["\n#filerobot-image-editor-root & {\n color: ",";\n display: flex;\n}\n \n @media (min-widthL 768px) {\n#filerobot-image-editor-root & {\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap\n}\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-direction: column\n}\n }\n"]);return ct=function(){return e},e}function st(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ut=a.b.div(ct(),(function(e){return e.theme.colors.text})),ft=Object(a.b)("div")(lt()),pt=a.b.div(at(),(function(e){return e.theme.colors.text})),dt=a.b.div(it()),ht=a.b.label(ot()),mt=a.b.input.attrs((function(e){return{type:e.type?e.type:"text"}}))(rt(),(function(e){return e.fullSize?"100%":e.theme.fieldWidth}),(function(e){return!e.fullSize&&"max-width: 400px;"}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.border}),(function(e){return"number"===e.type&&"::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }"})),gt=Object(a.b)("input").attrs((function(e){return{type:e.type?e.type:"file"}}))(nt(),(function(e){return e.fullSize?"100%":e.theme.fieldWidth}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.border})),bt=a.b.div(tt()),vt=Object(a.b)(je)(et(),(function(e){return e.active?e.theme.colors.text:e.theme.colors.textMute})),yt=a.b.span(Je(),(function(e){return e.fz||"28px"}),(function(e){return p(e)}),(function(e){return m(e.active?"ratio":"no-ratio")}),(function(e){return e.theme.textMuted})),wt=a.b.div(Ge(),(function(e){return e.active?e.theme.colors.secondaryBgHover:"transparent"})),xt=a.b.div(Ze()),kt=a.b.div(Ke(),(function(e){return _t(e.ratio)}),(function(e){return e.theme.textColor}),(function(e){return Ot(e.ratio)}),(function(e){var t=e.radius;return t&&"border-radius: ".concat(t,"%;")})),St=Object(a.b)("div")(Qe()),Ct=Object(a.b)("div")($e()),Et=a.b.div(qe()),Ot=function(e){var t=50*e;return t>200&&(t=200),t},_t=function(e){var t=50;return 50*e>200&&(t=200/e),t};function Pt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n background: ",";\n padding: 15px;\n margin: 5px;\n border-radius: 4px;\n cursor: pointer;\n}\n \n #filerobot-image-editor-root &:hover {\n background-color: ",";\n }\n"]);return Pt=function(){return e},e}function Tt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n}\n"]);return Tt=function(){return e},e}function jt(){var e=It(["\n#filerobot-image-editor-root & {\n max-width: 600px;\n margin: 15px auto;\n background: ",";\n border-radius: 4px;\n padding: 15px;\n}\n \n #filerobot-image-editor-root & h4 {\n line-height: 1.4;\n font-size: 16px;\n color: ",";\n }\n"]);return jt=function(){return e},e}function Rt(){var e=It(["\n#filerobot-image-editor-root & {\n color: ",";\n font-size: 14px;\n max-width: 600px;\n line-height: 1.4;\n margin: 0 auto;\n background: ",";\n border-radius: 4px;\n padding: 15px 15px 15px 55px;\n position: relative;\n font-weight: normal;\n text-align: left;\n}\n \n #filerobot-image-editor-root &:before {\n content: '\\e917';\n font-family: filerobot-image-editor-font;\n position: absolute;\n font-size: 20px;\n line-height: 20px;\n left: 20px;\n top: 50%;\n margin-top: -10px;\n }\n"],["\n#filerobot-image-editor-root & {\n color: ",";\n font-size: 14px;\n max-width: 600px;\n line-height: 1.4;\n margin: 0 auto;\n background: ",";\n border-radius: 4px;\n padding: 15px 15px 15px 55px;\n position: relative;\n font-weight: normal;\n text-align: left;\n}\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e917';\n font-family: filerobot-image-editor-font;\n position: absolute;\n font-size: 20px;\n line-height: 20px;\n left: 20px;\n top: 50%;\n margin-top: -10px;\n }\n"]);return Rt=function(){return e},e}function Dt(){var e=It(["\n#filerobot-image-editor-root & button {\n min-width: 240px;\n }\n"]);return Dt=function(){return e},e}function Mt(){var e=It(["\n#filerobot-image-editor-root & {\n display: inline-block;\n}\n \n @media (min-width: 768px) {\n#filerobot-image-editor-root & {\n width: 300px;\n padding: 20px;\n height: 100px\n}\n }\n"]);return Mt=function(){return e},e}function At(){var e=It(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n justify-content: center\n}\n }\n"]);return At=function(){return e},e}function It(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var zt=a.b.div(At(),(function(e){return e.theme.colors.text})),Bt=a.b.div(Mt()),Lt=Object(a.b)("div")(Dt()),Nt=Object(a.b)("p")(Rt(),(function(e){return e.theme.colors.textWarn}),(function(e){return e.theme.colors.secondaryBg})),Ft=Object(a.b)("div")(jt(),(function(e){return e.theme.colors.secondaryBg}),(function(e){return e.theme.colors.text})),Ut=Object(a.b)("div")(Tt()),Ht=Object(a.b)("div")(Pt(),(function(e){return e.theme.colors.primaryBg}),(function(e){return e.theme.colors.primaryBgHover}));function Wt(){var e=Qt(["\n@media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 50%;\n margin-right: 0 !important\n}\n }\n"]);return Wt=function(){return e},e}function Yt(){var e=Qt(["\n#filerobot-image-editor-root & {\n ",";\n ",";\n height: 16px;\n font-size: 16px;\n margin-top: -4px;\n display: inline-block;\n vertical-align: middle;\n color: ",";\n margin-right: 5px;\n}\n"]);return Yt=function(){return e},e}function Vt(){var e=Qt(["\n#filerobot-image-editor-root & {\n display: flex;\n width: 100%;\n flex-wrap: wrap;\n justify-content: center;\n}\n"]);return Vt=function(){return e},e}function Xt(){var e=Qt(["\n#filerobot-image-editor-root & {\n margin-top: 10px;\n width: 100%;\n}\n \n #filerobot-image-editor-root & button {\n text-transform: none;\n font-size: 12px;\n min-width: 142px;\n margin-right: 5px;\n }\n \n #filerobot-image-editor-root & button:focus, #filerobot-image-editor-root & button:active {\n outline: none !important;\n box-shadow: none !important;\n }\n"]);return Xt=function(){return e},e}function qt(){var e=Qt(["\n#filerobot-image-editor-root & {\n display: inline-block;\n width: 100%;\n}\n"]);return qt=function(){return e},e}function $t(){var e=Qt(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n}\n \n #filerobot-image-editor-root & svg {\n margin-top: -7px;\n width: 750px;\n }\n \n #filerobot-image-editor-root & svg text {\n font-size: 2px;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper {\n width: 280px;\n padding: 0;\n margin: 12px auto 0;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range {\n background: none;\n width: 280px;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 9px;\n height: 18px;\n border-radius: 50%;\n background: ",";\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input#range::-moz-range-thumb {\n border: none;\n width: 9px;\n height: 18px;\n border-radius: 50%;\n background: ",";\n cursor: pointer;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper label {\n display: none;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper :after {\n display: none;\n }\n \n @media (max-width: 768px) {\n #filerobot-image-editor-root & svg {\n width: 100%;\n }\n }\n"]);return $t=function(){return e},e}function Qt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Kt=a.b.div($t(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text})),Zt=a.b.div(qt()),Gt=a.b.div(Xt()),Jt=Object(a.b)("div")(Vt()),en=a.b.span(Yt(),(function(e){return p(e)}),(function(e){return m(e.name)}),(function(e){return e.theme.colors.text})),tn=Object(a.b)(Ve)(Wt());function nn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n color: ",";\n text-align: center;\n display: flex;\n justify-content: center;\n width: fit-content;\n margin: 0 auto;\n}\n\n #filerobot-image-editor-root & div {\n margin-left: 10px;\n }\n\n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n flex-wrap: wrap\n}\n \n #filerobot-image-editor-root & .image-editor-range-wrapper {\n width: 50%;\n }\n \n #filerobot-image-editor-root & .image-editor-range-wrapper input {\n width: 100% !important;\n }\n }\n"]);return nn=function(){return e},e}var rn=a.b.div(nn(),(function(e){return e.theme.colors.text}));function on(){var e=ln(["\n#filerobot-image-editor-root & {\n position: absolute;\n z-index: 999;\n top: 36px;\n left: 0;\n right: 0;\n height: 104px;\n cursor: not-allowed;\n}\n"]);return on=function(){return e},e}function an(){var e=ln(["\n#filerobot-image-editor-root & {\n position: absolute;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n cursor: wait;\n}\n"]);return an=function(){return e},e}function ln(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var cn=a.b.div(an()),sn=Object(a.b)("div")(on());function un(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\e90c'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e90c'\n }\n"]);return un=function(){return e},e}var fn=a.b.span.attrs((function(){return{role:"button"}}))(un(),(function(e){return e.t||"18px"}),(function(e){return e.r||"auto"}),(function(e){return e.l||"10px"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"18px"}),(function(e){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function pn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\26F6'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\26F6'\n }\n"]);return pn=function(){return e},e}var dn=a.b.span.attrs((function(){return{role:"button"}}))(pn(),(function(e){return e.t||"18px"}),(function(e){return e.r||"auto"}),(function(e){return e.l||"35px"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"15px"}),(function(e){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function hn(){var e=gn(["\n#filerobot-image-editor-root & {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 200px;\n height: 200px;\n margin: auto;\n padding: 40px;\n border-radius: 50%;\n background: ",";\n}\n \n #filerobot-image-editor-root & .svg-spin-icon {\n fill: ",";\n }\n \n #filerobot-image-editor-root & p {\n color: ",";\n }\n"]);return hn=function(){return e},e}function mn(){var e=gn(["\n#filerobot-image-editor-root & {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: ",";\n background: "," !important;\n opacity: "," !important;\n z-index: 1042;\n}\n"]);return mn=function(){return e},e}function gn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bn=a.b.div(mn(),(function(e){return e.fullScreen?"fixed":"absolute"}),(function(e){return e.overlay?"rgba(10,10,10,0.26)":"transparent"}),(function(e){return e.overlay?"0.25":"0"})),vn=Object(a.b)("div")(hn(),(function(e){return e.theme.colors.secondaryBgOpacity}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text})),yn=function(e){return e.show?i.a.createElement(o.Fragment,null,i.a.createElement(bn,{fullScreen:e.fullScreen,overlay:e.overlay}),i.a.createElement(vn,null,i.a.createElement("svg",{id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 150 150",style:{enableBackground:"new 0 0 150 150"}},i.a.createElement("path",{className:"svg-spin-icon",d:"M74.9,14.8c-12.2,0-24.3,0-36.5,0c-2.4,0-3.9-1-4.8-3.1c-1.3-3-1.2-6,0.6-8.9c0.8-1.3,2-2,3.5-2\r c1.1,0,2.3,0,3.4,0c23.3,0,46.7,0,70-0.1c3.9,0,5.3,1.9,6,4.7c0.5,2.1,0.4,4.2-0.5,6.3c-0.9,2.2-2.5,3.1-4.8,3c-2.9,0-5.7,0-8.6,0\r C93.9,14.8,84.4,14.8,74.9,14.8z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M75.1,118.1c12,0,24,0,35.9,0c4,0,5.9,1.7,6.3,5.7c0.1,1.4,0,2.9-0.3,4.2c-0.7,2.9-2.4,4.1-5.3,4.1\r c-24.1,0-48.3,0-72.4,0c-3.7,0-5.4-1.2-6.3-5.3c-0.4-2-0.1-3.9,0.7-5.7c0.9-2,2.4-3.1,4.7-3C50.6,118.1,62.9,118.1,75.1,118.1z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M75.3,76.3c0.2,0.4,3.1,9.3,7.2,14.1c3.9,4.7,8.9,8.5,13,12.5c3.2,3.2,5.4,7,6.8,11.2c0.5,1.6,0.3,1.9-1.4,1.9\r c-17.3,0-34.5,0-51.8,0c-1.7,0-1.9-0.2-1.3-1.8c1.8-5.5,5.2-10,9.4-13.9c3.5-3.3,7.7-6.1,10.6-9.9c3.5-4.7,6.8-13.3,7.1-14.1\r C75.1,76.3,75.2,76.3,75.3,76.3z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M45.5,23.6c0,3.8-0.1,7.6,1.2,11.3c1,2.9,2.8,5.2,4.9,7.3c5,5.3,10.2,10.5,15.2,15.8c1.1,1.2,2,2.6,3.1,3.9\r c2,2.5,2.2,7.6-0.2,10.5c-1.8,2.2-3.6,4.3-5.5,6.4C59.5,84,54.7,89.1,50,94.2c-3.1,3.4-4.4,7.5-4.5,12c0,2.8-0.1,5.6,0,8.4\r c0,1-0.3,1.4-1.4,1.4c-1.7,0-2.3,0-3.7,0c-0.9,0-1.3-0.4-1.3-1.3c0-5-0.3-10,0.8-14.9c0.8-3.5,2.5-6.6,4.8-9.3\r c3.6-4.2,7.5-8.2,11.3-12.3c1.7-1.8,3.3-3.7,4.9-5.5c0.9-1,1.9-2,2.7-3c1.8-2.3,1.6-4.3-0.4-6.4c-5.2-5.4-10.4-11-15.8-16.3\r c-5.7-5.7-8.4-12.4-8.3-20.4c0-2.9,0-5.7,0-8.6c0-1.1,0.4-1.6,1.5-1.5c1.3,0,2.6,0,3.8,0c0.8,0,1.1,0.3,1.1,1.2\r C45.5,19.8,45.5,21.7,45.5,23.6z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M109.9,35.9c-0.6,2.7-2.1,5.3-3.9,7.5c-3.5,4.2-7.5,8.1-11.2,12.1c-3,3.2-5.9,6.5-8.8,9.7\r c-0.9,1-0.9,2.1-0.2,3.1c1.2,1.7,2.5,3.3,3.8,4.8c1.5,1.8,3,3.6,4.6,5.3c3.4,3.6,6.8,7.1,10.1,10.7c4.7,5.1,6.8,11.2,6.9,18.1\r c0,2.4,0,5,0,7.5c0,1.3-0.3,1.5-1.6,1.5c-1.3,0-2.1,0-3.3,0c-1.1,0-1.5-0.4-1.5-1.5c0-3.4-0.2-6.7-0.3-10.1\r c-0.1-4.1-1.9-7.5-4.5-10.5c-3.3-3.8-6.8-7.4-10.2-11.1c-3.3-3.5-6.9-6.6-9.3-10.8c-0.8-1.5-1.4-3.2-1.7-4.9c-0.4-2.1,0.7-4,1.9-5.5\r c3.1-3.8,6.5-7.4,9.8-11.1c2.9-3.2,6-6.2,9-9.3c3.5-3.6,5.1-8,5.2-13c0-3.4,0.1-6.7,0.1-10.1c0-1.1,0.3-1.5,1.3-1.4\r c1.2,0,2.4,0,3.6,0c1.2,0,1.6,0.5,1.6,1.6c-0.1,1.6,0,3.1,0,4.7C111.4,23,110.9,31.7,109.9,35.9z"}),i.a.createElement("path",{className:"svg-spin-icon",d:"M74.8,67.9c-0.2-1.3-1.1-5.7-1.5-7C71.4,54,59.7,44.3,54.3,39c-0.7-0.7-1.3-1.5-1.8-2.5\r c7.1,3.4,14.4,6.1,22.6,6.1c8.2,0,15.5-2.6,22.4-6.2c0.1,0.1,0.2,0.2,0.3,0.3c-0.5,0.6-0.9,1.2-1.4,1.8c-4.5,4.5-18.7,15.5-20,22.4\r c-0.2,0.8-1,6.2-1.2,7C75.1,67.9,75,67.9,74.8,67.9z"}),i.a.createElement("g",null)),i.a.createElement("p",{style:{textAlign:"center"}},e.label))):null};function wn(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: 200px;\n height: 70px;\n display: inline-block;\n vertical-align: middle;\n background: "," url(",") 50% 50% / contain no-repeat; \n margin: 10px;\n padding: 20px;\n border-radius: 4px;\n cursor: pointer;\n}\n \n #filerobot-image-editor-root &:hover {\n background-color: ",";\n }\n"]);return wn=function(){return e},e}function xn(){var e=Rn(["\n#filerobot-image-editor-root & {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n line-height: 100px;\n background: ",";\n}\n"]);return xn=function(){return e},e}function kn(){var e=Rn(["\n#filerobot-image-editor-root & {\n display: inline-block;\n vertical-align: middle;\n margin-left: 20px;\n cursor: pointer;\n}\n"]);return kn=function(){return e},e}function Sn(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: 30px;\n height: 30px;\n display: inline-block;\n vertical-align: top;\n border: 1px solid ",";\n background: ",";\n cursor: ",";\n \n ",";\n}\n"]);return Sn=function(){return e},e}function Cn(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: 100px;\n padding: 10px;\n display: inline-block;\n vertical-align: top;\n}\n \n /* The container */\n \n #filerobot-image-editor-root & label {\n display: block;\n position: relative;\n line-height: 12px;\n padding-left: 15px;\n margin-bottom: 12px;\n cursor: pointer;\n user-select: none;\n }\n \n /* Hide the browser's default radio button */\n \n #filerobot-image-editor-root & label input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n }\n \n /* Create a custom radio button */\n \n #filerobot-image-editor-root & span {\n position: absolute;\n top: 0;\n left: 0;\n height: 10px;\n width: 10px;\n background-color: ",";\n border-radius: 50%;\n }\n \n /* On mouse-over, add a grey background color */\n \n #filerobot-image-editor-root & label:hover input ~ span {\n /* background-color: #ccc; */\n }\n \n /* When the radio button is checked, add a blue background */\n \n #filerobot-image-editor-root & label input:checked ~ span {\n background-color: ",";\n }\n \n #filerobot-image-editor-root & label input:checked ~ span:after {\n background-color: ",';\n }\n \n /* Create the indicator (the dot/circle - hidden when not checked) */\n \n #filerobot-image-editor-root & span:after {\n content: "";\n position: absolute;\n display: none;\n }\n \n /* Show the indicator (dot/circle) when checked */\n \n #filerobot-image-editor-root & label input:checked ~ span:after {\n display: block;\n }\n \n /* Style the indicator (dot/circle) */\n \n #filerobot-image-editor-root & label span:after {\n top: 3px;\n left: 2px;\n width: 6px;\n height: 5px;\n border-radius: 50%;\n background: ',";\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%\n}\n \n #filerobot-image-editor-root & label {\n display: inline-block;\n margin-right: 10px;\n }\n }\n"]);return Cn=function(){return e},e}function En(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: 100px;\n padding: 5px;\n display: inline-block;\n font-size: 0;\n}\n \n #filerobot-image-editor-root & div:nth-child(1) {\n border-radius: 4px 0 0 0;\n }\n \n #filerobot-image-editor-root & div:nth-child(3) {\n border-radius: 0 4px 0 0;\n }\n \n #filerobot-image-editor-root & div:nth-child(7) {\n border-radius: 0 0 0 4px;\n }\n \n #filerobot-image-editor-root & div:nth-child(9) {\n border-radius: 0 0 4px 0;\n }\n"]);return En=function(){return e},e}function On(){var e=Rn(["\n#filerobot-image-editor-root & {\n width: calc(100% - 200px);\n display: inline-block;\n vertical-align: top;\n padding: 0 40px;\n}\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n width: 100%;\n padding: 0\n}\n }\n"]);return On=function(){return e},e}function _n(){var e=Rn(["\n#filerobot-image-editor-root & {\n display: inline;\n vertical-align: middle;\n padding: 10px;\n}\n\n #filerobot-image-editor-root & label {\n min-width: 120px;\n display: inline-block;\n vertical-align: middle;\n }\n"]);return _n=function(){return e},e}function Pn(){var e=Rn(["\n#filerobot-image-editor-root & {\n ",";\n}\n"]);return Pn=function(){return e},e}function Tn(){var e=Rn(["\n#filerobot-image-editor-root & {\n padding: 10px;\n}\n \n #filerobot-image-editor-root & label {\n min-width: 120px;\n display: inline-block;\n vertical-align: middle;\n margin: 0;\n }\n \n #filerobot-image-editor-root & input {\n width: 100%;\n }\n"]);return Tn=function(){return e},e}function jn(){var e=Rn(["\n#filerobot-image-editor-root & {\n position: relative;\n color: ",";\n text-align: left;\n white-space: normal;\n width: fit-content;\n margin: 0 auto;\n}\n \n #filerobot-image-editor-root & .image-editor-range {\n display: inline-block;\n padding: 5px;\n vertical-align: middle;\n }\n \n #filerobot-image-editor-root & .image-editor-range :after {\n display: none;\n }\n \n #filerobot-image-editor-root & .image-editor-range label {\n display: none;\n }\n \n @media (max-width: 768px) {\n#filerobot-image-editor-root & {\n display: flex;\n flex-direction: column;\n align-items: center\n}\n \n #filerobot-image-editor-root & .image-editor-range {\n width: 100%;\n }\n \n #filerobot-image-editor-root & .image-editor-range input {\n width: 100% !important;\n }\n }\n"]);return jn=function(){return e},e}function Rn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Dn=a.b.div(jn(),(function(e){return e.theme.colors.text})),Mn=Object(a.b)("div")(Tn()),An=Object(a.b)("div")(Pn(),(function(e){return"right"===e.switcherPosition?".cloudimage-url-generator-switch {\n margin-left: 100px;\n margin-top: -6px;\n \n label {\n min-width: auto;\n }\n \n @media (max-width: 768px) {\n margin-left: 4px;\n }\n }":"padding: 10px;"})),In=Object(a.b)("div")(_n()),zn=Object(a.b)("div")(On()),Bn=Object(a.b)("div")(En()),Ln=Object(a.b)("div")(Cn(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.accent}),(function(e){return e.theme.colors.text})),Nn=Object(a.b)("div")(Sn(),(function(e){return e.theme.colors.secondaryBgHover}),(function(e){var t;return e.clickable?e.active?(null===(t=e.theme.colors.button)||void 0===t?void 0:t.primary)||e.theme.colors.primaryBg:e.theme.colors.accent:e.theme.colors.disabledBg}),(function(e){return e.clickable?"pointer":"not-allowed"}),(function(e){if(0!==e.clickable&&!e.active)return"\n &:hover {\n background: ".concat(e.theme.colors.primaryBg,";\n }\n ")})),Fn=(Object(a.b)("div")(kn()),Object(a.b)("div")(xn(),(function(e){return e.theme.colors.secondaryBg}))),Un=Object(a.b)("div")(wn(),(function(e){return e.theme.colors.primaryBgHover}),(function(e){return e.src}),(function(e){return e.theme.colors.secondaryBgHover}));function Hn(e){return(Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yn(e){for(var t=1;t1&&m)&&(-1!==h||1!==d.length);return i.a.createElement(Z,null,i.a.createElement(ee,{muted:"preview"!==s,onClick:function(){"preview"===s&&c()},title:u["footer.reset"]}),i.a.createElement(G,{onClick:function(){!g&&l({operationIndex:h-1,operationObject:Yn(Yn({},d[h]),{},{index:h})})},muted:g,title:u["footer.undo"]}),i.a.createElement(J,{onClick:function(){!b&&l({operationIndex:h+1,operationObject:Yn(Yn({},d[h]),{},{index:h})})},muted:b,title:u["footer.redo"]}),f&&p&&i.a.createElement(ce,{id:"switch-watermark-footer",checked:p&&p.applyByDefault,handleChange:this.onApplyWatermarkChange,text:u["common.apply_watermark"]}))}}])&&Xn(t.prototype,n),r&&Xn(t,r),a}(o.Component),er=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"filerobot";return"filerobot"===t?"https://api.filerobot.com/".concat(e,"/v3/"):"https://".concat(e,".api.airstore.io/v1/")},tr="filerobot-image-editor-modal",nr="filerobot-image-edit-box",rr="filerobot-image-edit-box-original",or=["adjust","effects","filters","rotate","crop","resize","watermark","shapes","image","text"],ir=["edge_enhance","emboss","grungy","hazy","lomo","radial_blur","sin_city","tilt_shift"],ar=["cross_process","glow_sun","jarques","love","old_boot","orange_peel","pin_hole","sepia","sun_rise","vintage"],lr=["crop","resize","rotate","watermark","focus_point"],cr=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],sr={corners:[1,0,1,0,0,0,1,0,1],star:[0,1,0,1,1,1,0,1,0],center:[0,0,0,0,1,0,0,0,0],"top-row":[1,1,1,0,0,0,0,0,0],"center-row":[0,0,0,1,1,1,0,0,0],"bottom-row":[0,0,0,0,0,0,1,1,1]},ur={opacity:.7,position:"center",url:"",applyByDefault:!1},fr=[{label:"Arial",value:"Arial"},{label:"Tahoma",value:"Tahoma"},{label:"Times New Roman",value:"Times New Roman"},{label:"Courier",value:"Courier"},{label:"Courier New",value:"Courier New"},{label:"Verdana",value:"Verdana"},{label:"Georgia",value:"Georgia"},{label:"Palatino",value:"Palatino"},{label:"Garamond",value:"Garamond"},{label:"Bookman",value:"Bookman"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Candara",value:"Candara"},{label:"Impact",value:"Impact"}],pr=[{label:"Arial",value:"Arial"},{label:"Arial Bold",value:"Arial-Bold"},{label:"Arial Black",value:"Arial-Black"},{label:"AvantGarde Book",value:"AvantGarde-Book"},{label:"Bitstream Charter",value:"Bitstream-Charter"},{label:"Bitstream Charter Bold",value:"Bitstream-Charter-Bold"},{label:"Bookman Demi",value:"Bookman-Demi"},{label:"Comic Sans MS",value:"Comic-Sans-MS"},{label:"Courier",value:"Courier"},{label:"Courier Bold",value:"Courier-Bold"},{label:"Courier New",value:"Courier-New\t"},{label:"Courier New Bold",value:"Courier-New-bold"},{label:"DejaVu Sans",value:"DejaVu-Sans"},{label:"DejaVu Sans Bold",value:"DejaVu-Sans-bold"},{label:"Dingbats",value:"Dingbats"},{label:"fixed",value:"fixed"},{label:"FreeMono",value:"FreeMono"},{label:"FreeMono Bold",value:"FreeMono-Bold"},{label:"FreeSans",value:"FreeSans-Bold"},{label:"Halvetica",value:"Halvetica"},{label:"Georgia",value:"Georgia"},{label:"Impact",value:"Impact"},{label:"Noto mono",value:"Noto-Mono"}],dr="rect",hr="square",mr="circle",gr="image",br="text",vr={hideCloudimageSwitcher:!0,processWithCloudimage:!1,uploadWithCloudimageLink:!1,elementId:null,isLowQualityPreview:!0,reduceBeforeEdit:{mode:"manual",widthLimit:2e3,heightLimit:2e3},cropBeforeEdit:null,cropPresets:[{name:"original",value:0},{name:"square",value:1},{name:"banner",value:7.8},{name:"round",value:1,radius:50},{name:"5 : 4",value:1.25},{name:"4 : 3",value:1.33333},{name:"6 : 4",value:1.5},{name:"16 : 9",value:1.7777}],resizePresets:[{name:"big square",width:600,height:600,ratio:1},{name:"middle square",width:400,height:400,ratio:1},{name:"small square",width:200,height:200,ratio:1},{name:"small size",width:1200,height:960,ratio:1.25},{name:"better quality",width:1920,height:1536,ratio:1.25},{name:"small size",width:1200,height:900,ratio:1.33333},{name:"better quality",width:1920,height:1440,ratio:1.33333},{name:"small size",width:1200,height:800,ratio:1.5},{name:"better quality",width:1920,height:1280,ratio:1.5},{name:"small size",width:1200,height:675,ratio:1.7777},{name:"better quality",width:1920,height:1080,ratio:1.7777},{name:"small banner",width:468,height:60,ratio:7.8},{name:"big banner",width:936,height:120,ratio:7.8}]},yr="close-button-clicked",wr="toolbar-cancel-button-clicked",xr="esc-key-pressed",kr="modal-overlay-clicked",Sr="image-edits-completed",Cr="image-downloaded",Er="image-uploaded-filerobot",Or="image-uploaded-cloudimage",_r="image-uploading-fail-filerobot",Pr="new",Tr="duplicate",jr="replace",Rr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return window.document.querySelector("#".concat(e,"_").concat(t||(n?rr:nr)))},Dr=function(e){switch(e){case"colorize":return"colorize";case"contrast":return"contrast";case"cross_process":return"crossProcess";case"glow_sun":return"glowingSun";case"hdr_effect":return"hdr";case"jarques":return"jarques";case"love":return"love";case"old_boot":return"oldBoot";case"orange_peel":return"orangePeel";case"pin_hole":return"pinhole";case"pleasant":return"pleasant";case"sepia":return"sepia";case"sun_rise":return"sunrise";case"vintage":return"vintage";case"clarity":return"";case"edge_enhance":return"edgeEnhance";case"emboss":return"emboss";case"grungy":return"grungy";case"hazy":return"hazyDays";case"lomo":return"lomo";case"noise":return"noise";case"old_paper":return"oldPaper";case"posterize":return"posterize";case"radial_blur":return"radialBlur";case"sin_city":return"sinCity";case"tilt_shift":return"tiltShift";default:return null}},Mr=function(e){switch(e){case"colorize":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/colorize.jpg";case"contrast":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/contrast.png";case"cross_process":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/cross_process.png";case"glow_sun":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/glow_sun.png";case"hdr_effect":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/hdr_effect.png";case"jarques":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/jarques.png";case"love":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/love.png";case"old_boot":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/old_boot.png";case"orange_peel":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/orange_peel.png";case"pin_hole":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/pin_hole.png";case"pleasant":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/pleasant.png";case"sepia":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/sepia.png";case"sun_rise":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/sun_rise.png";case"vintage":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/filters/vintage.png";case"clarity":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/clarity.png";case"edge_enhance":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/edge_enhance.png";case"emboss":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/emboss.png";case"grungy":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/grungy.png";case"hazy":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/hazy.png";case"lomo":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/lomo.png";case"noise":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/noise.png";case"old_paper":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/old_paper.png";case"posterize":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/posterize.png";case"radial_blur":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/radial_blur.png";case"sin_city":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/sin_city.png";case"tilt_shift":return"https://cdn.scaleflex.it/plugins/filerobot-image-editor/assets/images/effects/tilt_shift.png";default:return""}},Ar=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/_/g," ")},Ir=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"filerobot";return"filerobot"===e?"X-Filerobot-Key":"X-Airstore-Secret-Key"};function zr(e){return function(e){if(Array.isArray(e))return Br(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Br(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"center",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t.getBoundingClientRect(),i=.3,a=o.height*i,l=o.width*i;if(ln?n=(r=a)*c:r=(n=l)/c}var s=o.width/2-n/2,u=o.height/2-r/2;if("center"===e)return[s,u,n,r];e=e.split("-");var f=.015,p=o.width*f,d=o.height*f,h=o.width-n-p,m=o.height-r-d;return[].concat(zr(e.map((function(e,t){return"center"===e?0===t?s:u:"right"===e?h:"bottom"===e?m:"left"===e?p:"top"===e?d:void 0}))),[n,r])},Nr=n(16),Fr=n.n(Nr);function Ur(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Hr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:2;return parseFloat(e).toFixed(t)},Vr=n(17),Xr=n.n(Vr),qr=n(10),$r=n.n(qr);CanvasRenderingContext2D.prototype.roundRect=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return o?(n<2*o&&(o=n/2),r<2*o&&(o=r/2)):o=n>=r?n/2:r/2,this.beginPath(),this.moveTo(e+o,t),this.arcTo(e+n,t,e+n,t+r,o),this.arcTo(e+n,t+r,e,t+r,o),this.arcTo(e,t+r,e,t,o),this.arcTo(e,t,e+n,t,o),this.closePath(),this},CanvasRenderingContext2D.prototype.round=function(){var e=this.canvas,t=e.width,n=e.height;return this.imageSmoothingEnabled=!0,this.globalCompositeOperation="destination-in",this.strokeStyle="transparent",this.lineWidth=1,this.beginPath(),this.roundRect(0,0,t,n,Math.max(t,n)),this.fill(),this.globalCompositeOperation="source-over",this};CanvasRenderingContext2D,Number.prototype.mapNumber=function(e,t,n,r){return(this-e)*(r-n)/(t-e)+n};function Qr(e){return(Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kr(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Zr(e){return function(e){if(Array.isArray(e))return Gr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Gr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.props.config.elementId;return Rr(r,t,n)})),lo(io(e),"initializeCanvases",(function(t){var n=io(e),r=e.props,o=r.config,i=(o=void 0===o?{}:o).isLowQualityPreview,a=r.updateState,l=1;if(i&&t.height>1050){var c=e.getCanvas(null,!0),s=c.getContext("2d");c.width=t.width,c.height=t.height,s.drawImage(t,0,0,t.width,t.height),l=t.height/800;var u=t.width/l,f=t.height/l;a({initialZoom:l,canvasOriginal:n.cloneCanvas(c)}),setTimeout((function(){var t=e.getCanvas;new window.Caman(t(),(function(){this.resize({width:u,height:f}),this.render((function(){var e=n.replaceWithNewCanvas(nr);n.CamanInstanceZoomed=new window.Caman(e,(function(){n.CamanInstanceOriginal=new window.Caman(t(null,!0),(function(){})),a({isShowSpinner:!1,canvasZoomed:n.cloneCanvas(e)})}))}))}))}))}else setTimeout((function(){var t=e.getCanvas();n.CamanInstance=new window.Caman(t,(function(){a({isShowSpinner:!1,canvasOriginal:n.cloneCanvas(t)})}))}))})),lo(io(e),"mergeCanvases",(function(t){var n=e.props.shapeOperations,r=t.getContext("2d"),o=n.prepareFinalCanvas(t);return r.drawImage(o,0,0),t.toDataURL()})),lo(io(e),"cloneCanvas",(function(e){var t=document.createElement("canvas"),n=t.getContext("2d");return t.width=e.width,t.height=e.height,t.id=e.id,t.className=e.className,n.drawImage(e,0,0),t})),lo(io(e),"replaceWithNewCanvas",(function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.getCanvas(t),o=r.width,i=r.height,a=document.createElement("canvas"),l=a.getContext("2d"),c=r.parentElement;return c.removeChild(r),a.width=o,a.height=i,a.id="".concat(e.props.config.elementId,"_").concat(t),a.className=r.className,l.drawImage(r,0,0),n&&l.round(),c.appendChild(a),a})),lo(io(e),"replaceCanvas",(function(t,n){var r=e.getCanvas(n),o=r.parentElement;return o.removeChild(r),o.appendChild(t),t})),lo(io(e),"saveImage",(function(){var t=e.props,n=t.onComplete,r=t.onClose,o=t.updateState,i=t.closeOnLoad,a=t.config,l=t.processWithCloudService,c=t.uploadCloudimageImage,s=t.operations,u=t.initialZoom,f=t.operationsOriginal,p=e.getFinalImageMime(),d=e.getFinalImageName(),h=a.filerobot,m=void 0===h?{}:h,g=a.platform,b=void 0===g?"filerobot":g,v=m.imageMeta,y=m.imageProperties,w=m.imageName,x=m.saveMode,k=void 0===x?Tr:x,S=e.props.src.split("?")[0],C=1!==u?rr:nr,E=e.getCanvas(C),O=function(e,t,n){return e?e+"/":er(t,n)}(m.baseAPI,m.container,b),_=(m.uploadParams||{}).dir||"image-editor",P=io(e);if(l){var T=(1!==u?f:s).filter((function(e){var t=e.operation;return lr.includes(t)})),j=e.generateCloudimageURL(T,S.replace(/https?:\/\/scaleflex.ultrafast.io\//,""));if(c){var R=new XMLHttpRequest;R.addEventListener("load",e.onFileLoad),R.open("POST",[O,"upload?dir=".concat(_)].join("")),R.setRequestHeader(Ir(b),m.uploadKey),R.setRequestHeader("Content-Type","application/json"),R.send(JSON.stringify({files_urls:[j]}))}else o({isShowSpinner:!1,isHideCanvas:!1}),n(j,{url_permalink:j,url_public:j,url:{public:j,permalink:j}}),i&&r(Or)}else{e.mergeCanvases(E);var D=function(e,t,n){t=t||"",n=n||512;for(var r=atob(e),o=[],i=0;i0&&B.append("properties[file]",JSON.stringify(y)),v&&Object.keys(v).length>0&&B.append("meta[file]",JSON.stringify(v))),L.open("POST",[O,"upload?dir=".concat(_)].join("")),L.setRequestHeader(Ir(b),m.uploadKey),L.send(B)}})),lo(io(e),"getResultCanvas",(function(){var t=1!==e.props.initialZoom?rr:nr,n=e.getCanvas(t);return e.mergeCanvases(n),n})),lo(io(e),"getFinalImageMime",(function(){var t=e.props,n=t.roundCrop,r=t.imageMime;return n?"image/png":r})),lo(io(e),"getFinalImageName",(function(){var t=e.props.roundCrop,n=e.state.imageName;return t&&(n=n.replace(n.substr(n.lastIndexOf(".")+1),"png")),n})),lo(io(e),"downloadImage",(function(t){var n,r=e.getResultCanvas(),o=e.getFinalImageName(),i=e.getFinalImageMime(),a=document.createElement("a");a.download=o,a.href=r.toDataURL(i,.8),document.createEvent?((n=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),a.dispatchEvent(n)):a.fireEvent&&a.fireEvent("onclick"),t&&t()})),lo(io(e),"onFileLoad",(function(t){var n=e.props,r=n.onComplete,o=n.onClose,i=n.updateState,a=n.closeOnLoad,l=t.srcElement,c=(void 0===l?{}:l).response,s=void 0===c?"{}":c,u=JSON.parse(s)||{};if("success"===u.status){var f=u.file,p=void 0===f?{}:f,d=function(e){return e.url&&e.url.public?e.url.public:e.url_public?e.url_public:""}(p);if(!d)return;i({isShowSpinner:!1,isHideCanvas:!1}),r(d,p),a&&o(Er)}else i({isShowSpinner:!1,isHideCanvas:!1}),alert(u),a&&o(_r)})),lo(io(e),"generateCloudimageURL",(function(t,n){var r=e.props,o=r.config,i=r.watermark,a=r.logoImage,l=r.processWithCloudimage,c=r.processWithFilerobot,s=r.imageSealing,u=o.cloudimage,f=void 0===u?{}:u,p=o.filerobot,d=void 0===p?{}:p,h=l&&f.token+".cloudimg.io/"+(f.version?"".concat(f.version,"/"):"v7/"),m=c&&d.token+".filerobot.com/"+(d.version?"".concat(d.version,"/"):""),g=m||h||"";g=(g?"https://":"")+g;var b=(m?d.doNotPrefixURL:f.doNotPrefixURL)?"":g,v=e.isOperationExist(t,"crop"),y=e.isOperationExist(t,"resize"),w=e.isOperationExist(t,"rotate"),x=e.isOperationExist(t,"focus_point"),k=i&&a&&i.applyByDefault,S="",C="",E="",O="",_="";v&&(S=e.getCropArguments(v.props)),y&&(C=(S?"&":"")+e.getResizeArguments(y.props)),w&&(E=(S||C?"&":"")+e.getOrientationArguments(w.props)),k&&(O=(S||C||E?"&":"")+e.getWatermarkArguments()),x&&(_=(S||C||E||O?"&":"")+e.getFocusPointArguments(x.props)),n=(n=n.split("?")[0]).replace(b,"");var P=S+C+E+O+_;return s.enabled&&(P=function(e,t,n){var r=t||{},o=r.salt,i=r.char_count,a=r.include_params,l=Array.isArray(a);if(l&&0===a.length)return e;var c="",s="";if(l){var u=[],f=[];e.split("&").forEach((function(e){var t=Ur(e.split("="),1)[0];a.indexOf(t)>-1?u.push(e):f.push(e)})),f.length>0&&(s=f.join("&")),c=Wr(u.join("&"),n,o,i)}else c=Wr(e,n,o,i);return[c,s].filter((function(e){return e})).join("&")}(P,s,n.replace(g,""))),b+n+(P?"?":"")+P})),lo(io(e),"initFiltersOrEffects",(function(){})),lo(io(e),"applyFilterOrEffect",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=e.props,o=r.updateState,i=r.initialZoom;e.props[t]&&o({isHideCanvas:!0,isShowSpinner:!0},(function(){1!==i?(e.CamanInstanceOriginal.revert(!1),e.CamanInstanceOriginal[Dr(e.props[t])](),e.CamanInstanceOriginal.render((function(){o(lo({},t,null),(function(){e.makeCanvasSnapshot({operation:t},n)}))}))):o(lo({},t,null),(function(){e.makeCanvasSnapshot({operation:t},n)}))}))})),lo(io(e),"applyAdjust",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.initialZoom,i=n.adjust,a=i.brightness,l=i.contrast,c=i.saturation,s=i.exposure,u={brightness:0,contrast:0,saturation:0,exposure:0};r({isHideCanvas:!0,isShowSpinner:!0},(function(){1!==o?(e.CamanInstanceOriginal.revert(!1),"0"!==a.toString()&&e.CamanInstanceOriginal.brightness(parseInt(a||"0")),"0"!==l.toString()&&e.CamanInstanceOriginal.contrast(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstanceOriginal.saturation(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstanceOriginal.exposure(parseInt(s||"0")),e.CamanInstanceOriginal.render((function(){r({adjust:eo({},u)},(function(){e.makeCanvasSnapshot({operation:"adjust"},t)}))}))):r({adjust:eo({},u)},(function(){e.makeCanvasSnapshot({operation:"adjust"},t)}))}))})),lo(io(e),"initOrientation",(function(){var t=e.props,n=t.config,r=t.redoOperation,o=t.operations,i=t.operationsZoomed,a=1!==t.initialZoom?i:o;if(n.processWithCloudService&&a.length>=1){var l=a.findIndex((function(e){return"rotate"===e.operation}));l>-1&&r({operationIndex:l-1,callback:function(){},resetActiveTab:!1})}})),lo(io(e),"onRotate",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.props,a=i.initialZoom,l=i.rotate,c=i.updateState,s=l+t;c({isHideCanvas:!0,isShowSpinner:!0,rotate:s,correctionDegree:n,flipX:r,flipY:o},(function(){var t=e.getCanvas();1!==a?(e.CamanInstanceZoomed.reset(),r&&e.CamanInstanceZoomed.flip("x"),o&&e.CamanInstanceZoomed.flip("y"),(s||n)&&e.CamanInstanceZoomed.rotate((s||0)+(n||0)),e.CamanInstanceZoomed.render((function(){e.getCanvas().className=t.className,c({isHideCanvas:!1,isShowSpinner:!1})}))):(e.CamanInstance.reset(),r&&e.CamanInstance.flip("x"),o&&e.CamanInstance.flip("y"),(s||n)&&e.CamanInstance.rotate((s||0)+(n||0)),e.CamanInstance.render((function(){e.getCanvas().className=t.className,c({isHideCanvas:!1,isShowSpinner:!1})})))}))})),lo(io(e),"applyOrientation",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.initialZoom,i=n.rotate,a=n.correctionDegree,l=n.flipX,c=n.flipY;r({isHideCanvas:!0,isShowSpinner:!0},(function(){var n=e.getCanvas(null,!0),s=(i||0)+(a||0);1!==o?(e.CamanInstanceOriginal.reset(),l&&e.CamanInstanceOriginal.flip("x"),c&&e.CamanInstanceOriginal.flip("y"),(i||a)&&e.CamanInstanceOriginal.rotate(s),e.CamanInstanceOriginal.render((function(){e.getCanvas(null,!0).className=n.className,r({rotate:0,flipX:!1,flipY:!1,correctionDegree:0},(function(){e.makeCanvasSnapshot({operation:"rotate",props:{rotate:s}},t)}))}))):(e.getCanvas(null,!0).className=n.className,r({rotate:0,flipX:!1,flipY:!1,correctionDegree:0},(function(){e.makeCanvasSnapshot({operation:"rotate",props:{rotate:s}},t)})))}))})),lo(io(e),"getOrientationArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.rotate;switch(t){case 90:return"r=270";case-90:return"r=90";default:return"r=".concat(t)}})),lo(io(e),"initCrop",(function(){var t=e.props,n=t.config,r=t.redoOperation,o=t.operations,i=t.operationsZoomed,a=1!==t.initialZoom?i:o;if(n.processWithCloudService&&a.length>=1){var l=a.findIndex((function(e){return"crop"===e.operation}));l>-1&&r({operationIndex:l-1,callback:e.onInitCrop,resetActiveTab:!1})}else e.onInitCrop()})),lo(io(e),"onInitCrop",(function(){var t=e.props,n=t.updateState,r=t.config,o=r.beginCropArea,i=void 0===o?1:o,a=r.minCropAreaWidth,l=r.minCropAreaHeight;n({isHideCanvas:!0,isShowSpinner:!0},(function(){var t=e.getCanvas(),r=t.getBoundingClientRect(),o=t.width/r.width;e.cropper=new Xr.a(t,{viewMode:1,modal:!1,background:!1,rotatable:!1,scalable:!1,zoomable:!1,movable:!1,autoCropArea:i,minCropBoxWidth:a,minCropBoxHeight:l,crop:function(t){e.props.updateState({cropDetails:t.detail})}}),window.scaleflexPlugins=window.scaleflexPlugins||{},window.scaleflexPlugins.zoom=o,window.scaleflexPlugins.cropperjs=e.cropper,n({isHideCanvas:!1,isShowSpinner:!1})}))})),lo(io(e),"applyCrop",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.initialZoom,o=n.updateState,i=n.cropDetails,a=n.roundCrop,l=i.width,c=i.height,s=i.x,u=i.y;o({isShowSpinner:!0},(function(){var n,o,i;(e.destroyCrop(),1!==r)?(n=[l,c,s,u].map((function(e){return e*r})),e.CamanInstanceZoomed.crop(l,c,s,u),(o=e.CamanInstanceOriginal).crop.apply(o,Zr(n))):(n=[l,c,s,u],(i=e.CamanInstance).crop.apply(i,Zr(n)));e.makeCanvasSnapshot({operation:"crop",props:{width:n[0],height:n[1],x:n[2],y:n[3],roundCrop:a}},t)}))})),lo(io(e),"makeCanvasSnapshot",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.props,i=o.updateState,a=o.initialZoom,l=o.operationsZoomed,c=o.currentOperation,s=o.operationsOriginal,u=o.operations,f=o.roundCrop,p=1!==a;if(r){var d=(p?l:u).indexOf(c)+1,h=e.cloneCanvas(e.getCanvas()),m=eo(eo({},t),{},{previewCanvas:!0,canvas:h}),g={isHideCanvas:!1,isShowSpinner:!1,currentOperation:m};return p?(g.operationsZoomed=[].concat(Zr(l.slice(0,d)),[m]),g.operationsOriginal=[].concat(Zr(s.slice(0,d)),[eo(eo({},m),{},{canvas:e.cloneCanvas(e.getCanvas(null,!0))})]),g.isHideCanvasOriginal=!1,g.isShowSpinnerOriginal=!1):g.operations=[].concat(Zr(u.slice(0,d)),[m]),void i(g,n)}if(p){var b=l.indexOf(c)+1;e.CamanInstanceOriginal.render((function(){var r=e.replaceWithNewCanvas(rr,f),o=eo(eo({},t),{},{canvas:e.cloneCanvas(e.getCanvas(null,!0))});e.CamanInstanceOriginal=new window.Caman(r,(function(){i({isHideCanvasOriginal:!1,isShowSpinnerOriginal:!1,operationsOriginal:[].concat(Zr(s.slice(0,b)),[o])},n)}))}));var v=e.getCanvas;e.CamanInstanceZoomed.render((function(){var n=e.replaceWithNewCanvas(nr,f),r=eo(eo({},t),{},{canvas:e.cloneCanvas(v())});e.CamanInstanceZoomed=new window.Caman(n,(function(){i({isHideCanvas:!1,isShowSpinner:!1,operationsZoomed:[].concat(Zr(l.slice(0,b)),[r]),currentOperation:r})}))}))}else{var y=u.indexOf(c)+1,w=e.getCanvas;e.CamanInstance.render((function(){var r=e.replaceWithNewCanvas(nr,f),o=eo(eo({},t),{},{canvas:e.cloneCanvas(w())});e.CamanInstance=new window.Caman(r,(function(){i({isHideCanvas:!1,isShowSpinner:!1,operations:[].concat(Zr(u.slice(0,y)),[o]),currentOperation:o},n)}))}))}})),lo(io(e),"destroyCrop",(function(){e.cropper.destroy()})),lo(io(e),"getCropArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height,r=e.x,o=e.y,i=e.roundCrop;return"tl_px=".concat(Math.round(r),",").concat(Math.round(o),"&br_px=").concat(Math.round(r+t),",").concat(Math.round(o+n)).concat(i?"&radius=".concat(Math.round(Math.max(t,n)),"&force_format=png"):"")})),lo(io(e),"initResize",(function(){var t=e.props,n=t.initialZoom,r=t.updateState,o=e.getCanvas(1!==n?rr:nr);r({canvasDimensions:{width:o.width,height:o.height,ratio:o.width/o.height}})})),lo(io(e),"applyResize",(function(){var t=e.props,n=t.initialZoom,r=t.canvasDimensions,o=t.updateState,i=t.handleSave,a=t.operations,l=t.operationsOriginal;o({isHideCanvas:!0,isShowSpinner:!0,operationsOriginal:[].concat(Zr(l),[{operation:"resize",props:r}]),operations:[].concat(Zr(a),[{operation:"resize",props:r}])},(function(){1!==n?(e.CamanInstanceOriginal.resize(r),e.CamanInstanceOriginal.render((function(){i()}))):(e.CamanInstance.resize(r),e.CamanInstance.render((function(){i()})))}))})),lo(io(e),"getResizeArguments",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;return"w=".concat(t,"&h=").concat(n)})),lo(io(e),"initAdjust",(function(){})),lo(io(e),"onAdjust",(function(t,n){var r,o=e.props,i=o.updateState,a=o.adjust;i({adjust:eo(eo({},a),{},(r={},lo(r,t,n),lo(r,"isHideCanvas",!0),lo(r,"isShowSpinner",!0),r))},(function(){e.applyCorrections((function(){i({isHideCanvas:!1,isShowSpinner:!1})}))}))})),lo(io(e),"initFocusPoint",(function(){var t=e.props,n=t.updateState,r=t.original,o=t.focusPoint,i=eo({},o);null===i.x&&(i.x=r.width/2),null===i.y&&(i.y=r.height/2),e.tempFocusPoint=eo({},o),n({focusPoint:i,isHideCanvas:!0,isShowSpinner:!0})})),lo(io(e),"applyFocusPoint",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.operations,i=n.operationsOriginal,a=n.focusPoint;e.tempFocusPoint=a,r({operationsOriginal:[].concat(Zr(i),[{operation:"focus_point",props:a}]),operations:[].concat(Zr(o),[{operation:"focus_point",props:a}])}),t()})),lo(io(e),"applyShapes",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props.shapeOperations;n.updateShapes({applied:!0},{selectedShape:{}},(function(){e.makeCanvasSnapshot({operation:"shape",props:{shapes:e.props.shapes}},t,!0)}))})),lo(io(e),"getFocusPointArguments",(function(e){return"gravity=".concat(e.x,",").concat(e.y)})),lo(io(e),"destroyFocusPoint",(function(){e.props.updateState({focusPoint:e.tempFocusPoint,isHideCanvas:!1,isShowSpinner:!1})})),lo(io(e),"pushOperation",(function(e,t,n){var r=e.findIndex((function(e){return e===n})),o=e.length;o&&r!==e[o]&&e.splice(r+1,o),e.push(t)})),lo(io(e),"applyOperations",(function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.props,i=o.initialZoom,a=o.operations,l=o.operationsZoomed,c=o.operationsOriginal,s=o.canvasZoomed,u=o.canvasOriginal,f=o.updateState,p=1!==i,d=p?l[t]:a[t],h=-1!==t;if(r&&r.previewCanvas&&r.index-1===t||d&&d.previewCanvas&&r.index+1===t){var m,g,b=e.props.shapeOperations,v=null==d||null===(m=d.props)||void 0===m?void 0:m.shapes;if(!v){var y=(p?l:a).filter((function(e,t){return"shape"===e.operation&&t0?y[y.length-1].props.shapes:[]}return b.replaceAllShapes(v),g=p?h?l[t]:{canvas:e.cloneCanvas(s)}:h?a[t]:{canvas:e.cloneCanvas(u)},void f(eo(eo({},co),{},{currentOperation:g}),(function(){n&&n()}))}if(h||e.props.shapeOperations.replaceAllShapes([]),p){var w=h?l[t]:{canvas:e.cloneCanvas(s)},x=e.replaceCanvas(w.canvas,nr);e.CamanInstanceZoomed=new window.Caman(x,(function(){f(eo(eo({},co),{},{currentOperation:w}),(function(){n&&n()}))}));var k=h?c[t]:{canvas:e.cloneCanvas(u)},S=e.replaceCanvas(k.canvas,rr);e.CamanInstanceOriginal=new window.Caman(S,(function(){}))}else{var C=h?a[t]:{canvas:e.cloneCanvas(u)},E=e.replaceCanvas(C.canvas,nr);e.CamanInstance=new window.Caman(E,(function(){f(eo(eo({},co),{},{currentOperation:C}),(function(){n&&n()}))}))}})),lo(io(e),"isOperationExist",(function(e,t){return e.find((function(e){return e.operation===t}))})),lo(io(e),"getOperationQuery",(function(e,t){return e?"crop_px":t?"width":"cdn"})),lo(io(e),"destroyAll",(function(){})),lo(io(e),"resetAll",(function(t){var n=e.props.activeTab;n?e.cancelLastOperation(n,(function(){e.applyOperations(-1,t)})):e.applyOperations(-1,t)})),lo(io(e),"applyCorrections",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.initialZoom,o=n.effect,i=n.filter,a=n.adjust,l=a.brightness,c=a.contrast,s=a.saturation,u=a.exposure;1!==r?(e.CamanInstanceZoomed.revert(!1),o&&e.CamanInstanceZoomed[Dr(o)](),i&&e.CamanInstanceZoomed[Dr(i)](),"0"!==l.toString()&&e.CamanInstanceZoomed.brightness(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstanceZoomed.contrast(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstanceZoomed.saturation(parseInt(s||"0")),"0"!==u.toString()&&e.CamanInstanceZoomed.exposure(parseInt(u||"0")),e.CamanInstanceZoomed.render(t)):(e.CamanInstance.revert(!1),o&&e.CamanInstance[Dr(o)](),i&&e.CamanInstance[Dr(i)](),"0"!==l.toString()&&e.CamanInstance.brightness(parseInt(l||"0")),"0"!==c.toString()&&e.CamanInstance.contrast(parseInt(c||"0")),"0"!==s.toString()&&e.CamanInstance.saturation(parseInt(s||"0")),"0"!==u.toString()&&e.CamanInstance.exposure(parseInt(u||"0")),e.CamanInstance.render(t))})),lo(io(e),"cancelAddedShapes",(function(){e.props.shapeOperations.deleteShapes({all:!0},{selectedShape:{}})})),lo(io(e),"cancelLastOperation",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=e.props.initialZoom;"crop"===t&&e.destroyCrop(),"watermark"===t&&e.cancelWatermark(),["shapes","image","text"].includes(t)&&e.cancelAddedShapes(),1!==r?(e.CamanInstanceZoomed.reset(),e.CamanInstanceOriginal.reset(),e.CamanInstanceOriginal.render(),e.CamanInstanceZoomed.render((function(){n&&n()}))):(e.CamanInstance.reset(),e.CamanInstance.render((function(){n&&n()})))})),lo(io(e),"initWatermark",(function(){var t=e.props,n=t.watermark,r=t.updateState;n.applyByDefault||r({watermark:eo(eo({},n),{},{applyByDefault:!0})})})),lo(io(e),"applyWatermark",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=e.props,r=n.updateState,o=n.shapeOperations,i=(o.getShape({key:"watermark-layer"})||{}).index;e.setState({tempWatermark:null}),r({selectedShape:{}}),e.makeCanvasSnapshot({operation:"shape",props:{shapes:[i]}},t,!0),t()})),lo(io(e),"cancelWatermark",(function(){var t=e.state.tempWatermark,n=e.props,r=n.updateState,o=n.shapeOperations,i=o.getShape({key:"watermark-layer"})||{},a=null;t&&t.url&&t.applyByDefault?(r({isShowSpinner:!0}),(a=new Image).setAttribute("crossOrigin","Anonymous"),a.src=t.url+"?"+(new Date).getTime(),a.onload=function(){o.updateShape({img:a},i.index,{watermark:t,logoImage:a,isShowSpinner:!1,selectedShape:{}})}):o.deleteShape({index:i.index},{watermark:t,logoImage:a,selectedShape:{}})})),lo(io(e),"getWatermarkArguments",(function(){var t=e.props,n=t.config.processWithCloudimage,r=t.shapeOperations.getShape({key:"watermark-layer"});if(!r)return"";var o=r.x,i=r.y,a=r.opacity,l=Kr(r,["x","y","opacity"]),c=e.state.original,s=((c=void 0===c?{}:c).width,c.height,e.getCanvas("filerobot-shapes-edit-box")),u=s.width,f=s.height,p=Yr(o/u*100),d=Yr(i/f*100),h=Math.max(l.width/u,l.height/f),m=Yr(100*h),g="wat_gravity=absolute&wat_pos=".concat(p,",").concat(d),b="wat=1&wat_opacity=".concat(a,"&wat_scale=").concat(m,"p&").concat(g);return b+=n&&l.text?"&wat_text=".concat(l.text,"&wat_font=").concat(l.textFont,"&wat_fontsize=").concat(l.textSize,"&wat_colour=").concat(l.color.replace("#","")):"&wat_url=".concat(l.img.src.split("?")[0])})),lo(io(e),"applyChanges",(function(t,n){switch(t){case"adjust":e.applyAdjust(n);break;case"effects":e.applyFilterOrEffect("effect",n);break;case"filters":e.applyFilterOrEffect("filter",n);break;case"crop":e.applyCrop(n);break;case"resize":e.applyResize();break;case"rotate":e.applyOrientation(n);break;case"watermark":e.applyWatermark(n);break;case"focus_point":e.applyFocusPoint(n);break;case"shapes":case"image":case"text":e.applyShapes(n)}})),lo(io(e),"changeTab",(function(t){switch(t){case"effects":case"filters":e.initFiltersOrEffects();break;case"adjust":e.initAdjust();break;case"crop":e.initCrop();break;case"resize":e.initResize();break;case"rotate":e.initOrientation();break;case"watermark":e.initWatermark();break;case"focus_point":e.initFocusPoint();break;default:e.destroyAll()}})),lo(io(e),"destroyMode",(function(t){switch(t){case"effects":case"filters":case"adjust":break;case"crop":e.destroyCrop();break;case"resize":case"rotate":break;case"focus_point":e.destroyFocusPoint()}})),e.state={canvas:null,self:io(e)},e.CamanInstance=null,e.CamanInstanceOriginal=null,e.CamanInstanceZoomed=null,e}return t=a,r=[{key:"getDerivedStateFromProps",value:function(e,t){var n,r={};return e.activeTab!==t.activeTab&&(t.activeTab&&t.self.destroyMode(t.activeTab),"watermark"===e.activeTab&&(r.tempWatermark=e.watermark&&(n=e.watermark,JSON.parse(JSON.stringify(n)))),t.self.changeTab(e.activeTab)),eo(eo({},r),e)}}],(n=[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentDidMount",value:function(){var e=this,t=this,n=this.props,r=n.updateState,o=n.img,i=n.isPreResize,a=n.preCanvasDimensions;r({isShowSpinner:!0,applyChanges:this.applyChanges,applyOperations:this.applyOperations,resetAll:this.resetAll,onRotate:this.onRotate,onAdjust:this.onAdjust,downloadImage:this.downloadImage,getResultCanvas:this.getResultCanvas,saveImage:this.saveImage,applyCorrections:this.applyCorrections,restoreAll:this.restoreAll,cancelLastOperation:this.cancelLastOperation},(function(){var n=e.getCanvas(),l=n.getContext("2d");n.width=o.width,n.height=o.height,l.drawImage(o,0,0,o.width,o.height);var c={height:o.height,width:o.width,ratio:o.width/o.height};r({original:c,canvasDimensions:c}),i&&a?new window.Caman(n,(function(){this.resize({width:a.width,height:a.height}),this.render((function(){var e=t.replaceWithNewCanvas(nr),n={height:e.height,width:e.width,ratio:e.width/e.height};r({original:n,canvasDimensions:eo({},n),canvasOriginal:t.cloneCanvas(e)},(function(){t.initializeCanvases(e)}))}))})):e.initializeCanvases(o)}))}},{key:"render",value:function(){var e=this.props.config.elementId;return i.a.createElement(i.a.Fragment,null,i.a.createElement(Pe,{id:"".concat(e,"_").concat(rr),className:"filerobot-original-canvas"}),i.a.createElement(Pe,{id:"".concat(e,"_").concat(nr),className:"filerobot-edit-canvas"}))}}])&&to(t.prototype,n),r&&to(t,r),a}(o.Component),uo=n(4);function fo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return po(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return po(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function po(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.width&&d>=t.height)h=t.width,m=t.height;else if(p>t.width&&dt.height)h=p,m=p/t.ratio;else{var g=p,b=p/t.ratio,v=d*t.ratio,y=d;t.width<=g&&t.height<=b?(h=g,m=b):(h=v,m=y)}return{width:h,height:m}}((document.getElementById("preview-img-box")||{}).parentElement,t),n=e.width,r=void 0===n?0:n,o=e.height;return{width:r,height:void 0===o?0:o}}),[t]),d=fo(Object(o.useState)(p()),2),h=d[0],m=d[1],g=Object(o.useMemo)((function(){return Object(uo.debounce)(100,(function(){m(p())}))}),[p]);return Object(o.useEffect)((function(){var e=!0,t=function(){e&&g()};return window.addEventListener("resize",t),function(){e=!1,window.removeEventListener("resize",t)}}),[g]),i.a.createElement(Ce,{ref:u,width:h.width,height:h.height},i.a.createElement(Ee,{onMouseDown:function(e){var n=e.clientX-f.x,o=e.clientY-f.y,i=Math.round(n*t.width/h.width),a=Math.round(o*t.height/h.height),l=Math.min(Math.max(i,0),t.width),c=Math.min(Math.max(a,0),t.height);r({focusPoint:{x:l,y:c}})}},i.a.createElement(_e,{visible:c,src:a,onLoad:function(){r({isShowSpinner:!1}),s(!0)},onError:function(){r({isShowSpinner:!1})}}),i.a.createElement(Oe,{visible:c,x:n.x*h.width/t.width,y:n.y*h.height/t.height})))};function mo(e){return(mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function go(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||yo(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bo(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function vo(e){return function(e){if(Array.isArray(e))return wo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||yo(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yo(e,t){if(e){if("string"==typeof e)return wo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wo(e,t):void 0}}function wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:function(){},r=t.props.updateState;r(e,n)})),To(_o(t),"pushShapeToShapes",(function(e,n){var r=t.props.shapes,o=r.length;return t.updateState(ko({shapes:[].concat(vo(r),[ko(ko({},e),{},{index:o})])},n)),o})),To(_o(t),"targettedShape",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e||0===e?t.props.shapes[e]:t.props.selectedShape})),To(_o(t),"onSelect",(function(e){var n=t.props,r=n.shapes,o=n.activeTab;if(t._allowedTabs.includes(o)){var i=e.offsetX,a=e.offsetY,l=!1;r.forEach((function(e){!e.hidden&&i>=e.x&&i<=e.x+e.width&&a>=e.y&&a<=e.y+e.height&&e.tab===o&&(l=!0,t.updateState({selectedShape:ko(ko({},e),{},{resizingBox:!0,startEdgeOffset:{x:i-e.x,y:a-e.y}})}),t.activateResizingActions(),t._canvas.addEventListener("keyup",t.activateShapeDeleting),t._canvas.addEventListener("mousemove",t.startDragging),t._canvas.addEventListener("touchmove",t.startDragging),document.addEventListener("mouseup",t.endDragging),document.addEventListener("touchend",t.endDragging))})),l||(t.updateState({selectedShape:{}}),t.disableResizingActions(),t._canvas.removeEventListener("keyup",t.activateShapeDeleting),t._canvas.removeEventListener("mousemove",t.startDragging),t._canvas.removeEventListener("touchmove",t.startDragging),document.removeEventListener("mouseup",t.endDragging),document.removeEventListener("touchend",t.endDragging))}})),To(_o(t),"activateShapeDeleting",(function(e){var n=e.key,r=t.props.selectedShape;"Delete"!==n&&"Backspace"!==n||!r||(t.deleteShapeByKeyOrIndex({index:r.index}),t.updateState({selectedShape:{}}),t.disableResizingActions(),t._canvas.removeEventListener("keyup",t.activateShapeDeleting))})),To(_o(t),"activateResizingActions",(function(){t.props.selectedShape.lockScaleToPercentage||Array.from(document.getElementsByClassName("shape-resizing-control")).forEach((function(e){e.addEventListener("mousedown",t.trackShapeResize)}))})),To(_o(t),"trackShapeResize",(function(e){var n=e.target;t.setState({resizeControlTarget:n}),document.addEventListener("mousemove",t.handleShapeResizing),document.addEventListener("touchmove",t.handleShapeResizing),document.addEventListener("mouseup",t.disableResizingActions),document.addEventListener("touchend",t.disableResizingActions)})),To(_o(t),"handleShapeResizing",(function(e){var n=e.movementX,r=e.movementY,o=e.shiftKey,i=t.state.resizeControlTarget,a=t.props,l=a.selectedShape,c=a.processWithCloudimage,s=l.index,u=l.width,f=l.height,p=l.x,d=l.y,h=l.variant,m=l.originalWidth,g=l.originalHeight;if(i&&h!==br){var b=f,v=i.dataset.direction;if(c){if(["e","w","n","s"].includes(v))return;o=!0}var y=function(e){var t=u/f;if(Math.abs(n)>=Math.abs(r)){var o=Math.abs(f-(u+n)/t);r=(e?1:-1)*Math.sign(n)*o}else{var i=Math.abs(u-(f+r)*t);n=(e?1:-1)*Math.sign(r)*i}},w=function(){u+=n},x=function(){f+=r},k=function(){u-=n,p+=n},S=function(){f-=r,d+=r};switch(v){case"e":w();break;case"w":k();break;case"n":S();break;case"s":x();break;case"ne":if(o&&y(!1),w(),u>=t._canvas.width&&o)break;S();break;case"nw":if(o&&y(!0),k(),u>=t._canvas.width&&o)break;S();break;case"se":if(o&&y(!0),w(),u>=t._canvas.width&&o)break;x();break;case"sw":if(o&&y(!1),k(),u>=t._canvas.width&&o)break;x();break;default:return}if(h!==hr&&h!==mr||(f!==b?u=f:f=u),!c||!(u>=m||f>=g)){if(!(f<=15||u<=15)){p<0&&(p=0),d<0&&(d=0),p+u>t._canvas.width&&(p=t._canvas.width-u),d+f>t._canvas.height&&(d=t._canvas.height-f),u>t._canvas.width&&(u=t._canvas.width),f>t._canvas.height&&(f=t._canvas.height);var C={width:u,height:f,x:p,y:d};t.updateShape(C,s,{selectedShape:ko(ko({},l),C)})}}}})),To(_o(t),"disableResizingActions",(function(e){document.removeEventListener("mousemove",t.handleShapeResizing),document.removeEventListener("mouseup",t.disableResizingActions),t.updateState({selectedShape:{}}),t.setState({resizeControlTarget:null})})),To(_o(t),"removeResizingBox",(function(e){var n=e.offsetX,r=e.offsetY,o=t.props.selectedShape;(no.x+o.width||ro.y+o.height)&&(t.updateState({selectedShape:ko(ko({},o),{},{resizingBox:!1})}),t._canvas.removeEventListener("click",t.removeResizingBox))})),To(_o(t),"startDragging",(function(e){if(e.targetTouches&&e.targetTouches[0]){e.preventDefault();var n=e.targetTouches[0],r=n.clientX,o=n.clientY,i=t._canvas.getBoundingClientRect(),a=i.x,l=i.y;e.offsetX=r-a,e.offsetY=o-l}var c=t.props.selectedShape,s=c.startEdgeOffset,u=void 0===s?{}:s,f=c.width,p=c.height,d=c.index,h=e.offsetX-u.x,m=e.offsetY-u.y;h<0&&(h=0),m<0&&(m=0),h+f>t._canvas.width&&(h=t._canvas.width-f),m+p>t._canvas.height&&(m=t._canvas.height-p);var g=ko(ko({},c),{},{x:h,y:m});t.updateShape(g,d,{selectedShape:g})})),To(_o(t),"endDragging",(function(){t._canvas.removeEventListener("mousemove",t.startDragging),t._canvas.removeEventListener("mouseup",t.endDragging),t._canvas.removeEventListener("mouseleave",t.endDragging),t._canvas.addEventListener("click",t.removeResizingBox)})),To(_o(t),"getCanvasCenter",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t._canvas.width/2-e,o=t._canvas.height/2-n;return[r,o]})),To(_o(t),"draw",(function(e,n){var r=n.opacity,o=void 0===r?1:r,i=n.hidden,a=n.color,l=n.stroke,c=void 0===l?{}:l;i||(t._context.globalAlpha=+o,t._context.fillStyle=a,t._context.strokeStyle=c.color||"transparent",t._context.lineWidth=c.width||1,e(),t.props.round&&t._context.round())})),To(_o(t),"redrawShape",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=t.props.shapes;t.clearShape(0,0,t._canvas.width,t._canvas.height);var r=n.length;if(e&&e!==r-1){var o=ko(ko({},n.splice(e,1)[0]),{},{index:r});n.splice(r,0,o),n=n.map((function(e,n){return e.index=n,t.drawShapeThroughVariant(e),e})),t.updateState({shapes:n,selectedShape:o})}else n.forEach((function(e){return t.drawShapeThroughVariant(e)}))})),To(_o(t),"drawShapeThroughVariant",(function(e){switch(e.variant){case gr:t.drawImage(e);break;case dr:case hr:t.drawRect(e);break;case mr:t.drawCircle(e);break;case br:t.drawText(e);default:return}})),To(_o(t),"drawRect",(function(e){var n=e.x,r=e.y,o=e.width,i=e.height,a=e.stroke,l=bo(e,["x","y","width","height","stroke"]);t.draw((function(){t._context.fillRect(n,r,o,i),a&&t._context.strokeRect(n,r,o,i)}),ko({stroke:a},l))})),To(_o(t),"drawCircle",(function(e){var n=e.x,r=e.y,o=(e.radius,e.width),i=e.height,a=e.stroke,l=bo(e,["x","y","radius","width","height","stroke"]);t.draw((function(){t._context.roundRect(n,r,o,i),t._context.fill(),a&&t._context.stroke()}),ko({stroke:a},l))})),To(_o(t),"drawImage",(function(e){var n=e.img,r=e.x,o=e.y,i=e.width,a=e.height,l=e.stroke,c=bo(e,["img","x","y","width","height","stroke"]);t.draw((function(){t._context.drawImage(n,r,o,i,a),l&&t._context.strokeRect(r,o,i,a)}),ko({stroke:l},c))})),To(_o(t),"setTextStyle",(function(e){var n=e.textSize,r=e.textFont;t._context.textAlign="start",t._context.textBaseline="top",t._context.font="".concat(n,"px ").concat(r)})),To(_o(t),"getTextWidthAndHeight",(function(e){var n=e.text,r=e.textSize,o=e.textFont;t.setTextStyle({textSize:r,textFont:o});var i=t._context.measureText(n),a=i.width;return[a,0===a?0:i.actualBoundingBoxDescent-i.actualBoundingBoxAscent]})),To(_o(t),"drawText",(function(e){var n=e.text,r=e.textSize,o=e.textFont,i=e.x,a=e.y,l=e.stroke,c=bo(e,["text","textSize","textFont","x","y","stroke"]);t.draw((function(){t.setTextStyle({textSize:r,textFont:o}),t._context.fillText(n,i,a,t._canvas.width),l&&t._context.strokeText(n,i,a)}),ko({stroke:l},c))})),To(_o(t),"addRect",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.x,r=e.y,o=e.width,i=void 0===o?100:o,a=e.height,l=void 0===a?75:a,c=e.stroke,s=void 0===c?{}:c,u=e.color,f=void 0===u?"#000000":u,p=e.opacity,d=void 0===p?1:p,h=e.variant,m=void 0===h?dr:h,g=e.tab,b=void 0===g?"shapes":g,v=bo(e,["x","y","width","height","stroke","color","opacity","variant","tab"]),y=t.getCanvasCenter(i/2,l/2),w=go(y,2),x=w[0],k=w[1],S={x:n||x,y:r||k,width:i,height:l,stroke:s,opacity:d,color:f},C=ko(ko(ko(ko({},t._initArgs),v),S),{},{variant:m,tab:b});if(!v.key||!t.replaceShapeIfExisted(v.key,C)){t.drawRect(S);var E=t.pushShapeToShapes(C);t.updateState({selectedShape:ko(ko({},C),{},{index:E,resizingBox:!0})},t.activateResizingActions)}})),To(_o(t),"addSquare",(function(e){e.width||(e.width=e.height=75),e.variant=hr,t.addRect(e)})),To(_o(t),"addCircle",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.x,r=e.y,o=e.radius,i=void 0===o?50:o,a=e.stroke,l=void 0===a?{}:a,c=e.color,s=void 0===c?"#000000":c,u=e.opacity,f=void 0===u?1:u,p=e.tab,d=void 0===p?"shapes":p,h=bo(e,["x","y","radius","stroke","color","opacity","tab"]),m=t.getCanvasCenter(i,i),g=go(m,2),b=g[0],v=g[1],y=2*i,w={x:n||b,y:r||v,radius:i,color:s,opacity:f,stroke:l,width:y,height:y},x=ko(ko(ko(ko({},t._initArgs),h),w),{},{tab:d,variant:mr});if(!h.key||!t.replaceShapeIfExisted(h.key,x)){t.drawCircle(w);var k=t.pushShapeToShapes(x);t.updateState({selectedShape:ko(ko({},x),{},{index:k,resizingBox:!0})},t.activateResizingActions)}})),To(_o(t),"addImage",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.img,r=e.x,o=void 0===r?void 0:r,i=e.y,a=void 0===i?void 0:i,l=e.opacity,c=void 0===l?1:l,s=e.tab,u=void 0===s?"image":s,f=e.stroke,p=void 0===f?{}:f,d=e.otherStates,h=bo(e,["img","x","y","opacity","tab","stroke","otherStates"]);if(n){var m=function(){var e=go(t.getSuitableImgDiemensions(n,h.lockScaleToPercentage),2),r=e[0],i=e[1],l=go(t.getCanvasCenter((h.width||r)/2,(h.height||i)/2),2),s=l[0],f=l[1],m={img:n,opacity:c,originalWidth:r,originalHeight:i,width:h.width||r,height:h.height||i,x:o||s,y:a||f,stroke:p},g=ko(ko(ko(ko({},t._initArgs),h),m),{},{variant:gr,tab:u});if(!h.key||!t.replaceShapeIfExisted(h.key,g,d)){t.drawImage(m);var b=t.pushShapeToShapes(g);t.updateState(ko({selectedShape:ko(ko({},g),{},{index:b,resizingBox:!0})},d),t.activateResizingActions)}};"string"==typeof n?n=t.makeImgElement(n,m):m()}})),To(_o(t),"addText",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.text,r=void 0===n?"Text":n,o=e.textSize,i=void 0===o?62:o,a=e.color,l=void 0===a?"#000000":a,c=e.textFont,s=void 0===c?"Arial":c,u=e.x,f=void 0===u?void 0:u,p=e.y,d=void 0===p?void 0:p,h=e.stroke,m=void 0===h?{}:h,g=e.opacity,b=void 0===g?1:g,v=e.tab,y=void 0===v?"text":v,w=e.otherStates,x=bo(e,["text","textSize","color","textFont","x","y","stroke","opacity","tab","otherStates"]),k=t.getTextWidthAndHeight({text:r,textSize:i,textFont:s}),S=go(k,2),C=S[0],E=S[1],O=t.getCanvasCenter(C/2,E/2),_=go(O,2),P=_[0],T=_[1];if(r){var j={text:r,textSize:i,textFont:s,x:f||P,y:d||T,opacity:b,stroke:m,color:l},R=ko(ko(ko(ko({},t._initArgs),x),j),{},{width:C,height:E,variant:br,tab:y});if(x.key&&t.replaceShapeIfExisted(x.key,R,w))return;t.drawText(j);var D=t.pushShapeToShapes(R);t.updateState(ko({selectedShape:ko(ko({},R),{},{index:D,resizingBox:!0})},w),t.activateResizingActions)}})),To(_o(t),"addAnyShape",(function(e,n){if(e.index||0===e.index){var r=t.props.shapes[e.index];if(!e.variant||r.variant===e.variant)return void t.updateShape(e,e.index,n)}var o=ko(ko({},e),{},{otherStates:n});switch(e.variant){case gr:t.addImage(o);break;case dr:t.addRect(o);break;case hr:t.addSquare(o);break;case mr:t.addCircle(o);break;case br:t.addText(o);default:return}})),To(_o(t),"getSuitableImgDiemensions",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.width,o=e.height;if(o>t._canvas.height){var i=o/t._canvas.height;o/=i,r/=i}if(r>t._canvas.width){var a=r/t._canvas.width;o/=a,r/=a}if(n){var l=n/100;r*=l,o*=l}return[r=t.fromLatestCanvasSizeValue(r,"width"),o=t.fromLatestCanvasSizeValue(o,"height")]})),To(_o(t),"getShapeByKeyOrIndex",(function(e){var n=e.key,r=e.index;if(!n&&!r&&0!==n&&0!==r)return!1;var o=t.props.shapes;return r?o[r]:o.filter((function(e){return e.key===n}))[0]})),To(_o(t),"replaceShapeIfExisted",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=t.getShapeByKeyOrIndex({key:e});return!!o&&(n=ko(ko({},n),{},{x:o.x,y:o.y,width:o.width,height:o.height}),t.updateShape(n,o.index,r),!0)})),To(_o(t),"setShapeVisibilityByKeyOrIndex",(function(e){var n=e.key,r=e.index,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=t.getShapeByKeyOrIndex({key:n,index:r});i&&i.hidden!==o&&t.updateShape({hidden:o||!i.hidden},i.index)})),To(_o(t),"getShapesIndexByAnyProp",(function(e,n){var r=t.props.shapes;if(r&&0===r.length)return[];var o=[];return r.filter((function(t,r){var i=t[e];return(i===n||void 0===i&&Boolean(i)===n)&&(o.push(r),!0)})),o})),To(_o(t),"updateShapes",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=t.props.shapes;o=o.map((function(t){return ko(ko({},t),e)})),t.updateState(ko({shapes:o},n),r)})),To(_o(t),"replaceAllShapes",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.updateState({shapes:e},(function(){t.redrawShape(),n()}))})),To(_o(t),"updateShape",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=t.props,i=o.shapes,a=o.selectedShape;if(e&&(n||0===n||a&&(a.index||0===a.index))){if("string"==typeof e.img)return t.updateState({selectedShape:ko(ko({},a),{},{lockScaleToPercentage:e.lockScaleToPercentage,img:e.img})}),void t.makeImgElement(e.img,t.updateShape,e,n,r);var l={};if(n||0===n||(l.selectedShape=ko(ko({},a),e)),i[n=n||0===n?n:a.index]){var c=i;if(e.textSize&&e.textSize!==i[n].textSize||e.text&&e.text!==i[n].text){var s=i[n],u=t.getTextWidthAndHeight(ko(ko({},s),e)),f=go(u,2),p=f[0],d=f[1];l.selectedShape?(e.width=l.selectedShape.width=p,e.height=l.selectedShape.height=d,e.text=l.selectedShape.text=e.text||s.text):(e.width=p,e.height=d,e.text=e.text||s.text)}else{var h=ko({},e);void 0!==e.x&&void 0!==e.y&&(h.x=e.x,h.y=e.y),e.stroke&&(h.stroke=e.stroke),e.width&&e.height&&(h.width=e.width,h.height=e.height),e.lockScaleToPercentage&&(e.lockScaleToPercentage=e.lockScaleToPercentage),l.selectedShape=ko(ko({},a),h)}c[n]=ko(ko({},c[n]),e),t.updateState(ko(ko({shapes:c},l),r),(function(){t.redrawShape(n)}))}}})),To(_o(t),"clearShape",(function(e,n,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=i.width,l=a||1,c=e-l,s=n-l,u=r+l,f=o+l;t._context.clearRect(c,s,u,f)})),To(_o(t),"eraseAndRemoveShapeFromArray",(function(e,n){if(0!==Object.keys(t.targettedShape(e)).length)return t.clearShape(0,0,t._canvas.width,t._canvas.height),n.filter((function(n){return n.index!==e&&(n.index>e&&(n.index-=1),t.drawShapeThroughVariant(n),n)}))})),To(_o(t),"deleteShapeByKeyOrIndex",(function(e){var n=e.index,r=e.key,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.props.selectedShape;if(!n&&0!==n&&!r){if(!i)return;n=i.index}var a=t.props.shapes,l=n||0===n?n:(t.getShapeByKeyOrIndex({key:r})||{}).index;(l||0===l)&&(l===i.index&&(o.selectedShape={}),t.updateState(ko({shapes:t.eraseAndRemoveShapeFromArray(l,a)},o)))})),To(_o(t),"deleteShapes",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=t.props.shapes;e.forEach((function(e){r=t.eraseAndRemoveShapeFromArray(e,r)})),t.updateState(ko({shapes:r},n))})),To(_o(t),"deleteAllShapesOrByTypeOrIndicies",(function(e){var n=e.type,r=e.all,o=void 0!==r&&r,i=e.applied,a=void 0!==i&&i,l=e.secured,c=void 0===l?[]:l;if(n||o){if(o){var s=(t.getShapeByKeyOrIndex({key:"watermark-layer"})||{}).index,u=vo(c);!s&&0!==s||u.includes(s)||u.push(s);var f=[];return t.clearShape(0,0,t._canvas.width,t._canvas.height),a||(f=t.props.shapes.filter((function(e){return!(!e.applied&&!u.includes(e.index))&&(t.drawShapeThroughVariant(e),e)}))),void t.updateState({shapes:f,selectedShape:{}})}var p=t.getShapesIndexByAnyProp("type",n);p.length>0&&t.deleteShapes(p)}})),To(_o(t),"makeImgElement",(function(e,n,r){for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a-1&&n&&(t.splice(i,1),r({operations:t}),o(t,"resize"))}},{key:"render",value:function(){var e=this,t=this.state.isBlockRatio,n=this.props,r=n.canvasDimensions,o=n.processWithCloudService,a=n.onPreResize,l=n.t;return i.a.createElement(xe,{id:"preview-img-box"},i.a.createElement(Nt,null,l["warning.too_big_resolution"]),i.a.createElement(Ft,null,i.a.createElement("h4",null,l["pre_resize.title"]),i.a.createElement(zt,null,i.a.createElement(Bt,null,i.a.createElement(dt,null,i.a.createElement(ht,null,l["common.width"]),i.a.createElement(mt,{fullSize:!0,value:parseInt(r.width,10)||"",onChange:this.changeWidth})),i.a.createElement(bt,null,i.a.createElement(vt,{active:!t,style:o?{cursor:"not-allowed"}:{},link:!0,onClick:function(){!o&&e.toggleRatio()}},i.a.createElement(yt,{active:!t,style:o?{cursor:"not-allowed"}:{}}))),i.a.createElement(dt,null,i.a.createElement(ht,null,l["common.height"]),i.a.createElement(mt,{fullSize:!0,value:parseInt(r.height,10)||"",onChange:this.changeHeight})))),i.a.createElement(Lt,null,i.a.createElement("p",null,i.a.createElement(je,{themeColor:!0,themeBtn:!0,onClick:function(){a("keep")}},l["pre_resize.keep_original_resolution"])),i.a.createElement("p",null,i.a.createElement(je,{themeColor:!0,success:!0,onClick:function(){a("resize")}},l["pre_resize.resize_n_continue"])))))}}])&&Wo(t.prototype,n),r&&Wo(t,r),a}(o.Component);function Zo(e){return(Zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Go(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jo(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=e.target.value;if(r.props.watermark.text)r.initWatermarkImage(n);else{var o=r.state.position;r.updateWatermarkProperty({url:n,position:o},ul({img:n,position:o},t),{url:"",text:!1})}})),bl(ml(r),"changeTextProperty",(function(e){var t=bl({},e.target.name,e.target.value);if(r.props.watermark.text)r.updateWatermarkProperty(t);else{var n=r.state,o=ul({text:n.text,color:n.color,textSize:n.textSize,textFont:n.textFont,opacity:n.opacity,variant:br,tab:"watermark"},t);r.updateWatermarkProperty(ul({},t),ul(ul({},o),{},{resizingBox:!0}),{text:ul(ul({},r.props.watermark.text),o)})}})),bl(ml(r),"readFile",(function(e){if(r.props.config.processWithCloudimage)return null;var t=e.target;if(t.files&&t.files[0]){var n=new FileReader;n.onload=function(e){r.changeURL({target:{value:e.target.result}},{variant:gr})},n.readAsDataURL(t.files[0])}})),bl(ml(r),"getWatermarkDimensionsByPosString",(function(e,t,n){return Lr(e,Rr(r.props.config.elementId),t,n)})),bl(ml(r),"onPositionChange",(function(e){var t=r.getWatermarkLayer(),n=t.width,o=t.height,i=ll(r.getWatermarkDimensionsByPosString(e,n,o),4),a=i[0],l=i[1],c=i[2],s=i[3];r.updateWatermarkProperty({position:e,width:c,height:s},{x:a,y:l,width:c,height:s},{position:e,x:a,y:l,width:c,height:s})})),bl(ml(r),"initWatermarkImage",Object(uo.debounce)(500,(function(e){var t=r.props.updateState,n=null;t({isShowSpinner:!0});var o=function(e){return{logoImage:e,isShowSpinner:!1,watermark:ul(ul({},r.props.watermark),{},{url:e.src})}};if(e){var i=r.props,a=i.shapeOperations,l=i.watermark,c=l.lockScaleToPercentage,s=void 0===c?0:c,u=l.position,f=r.state.opacity;(n=new Image).setAttribute("crossOrigin","Anonymous"),n.onload=function(){var e,t=r.props.watermark.imageFilter;t&&"function"==typeof t?(n.onload=null,e=o(t(n))):e=o(n);var i=(r.getWatermarkLayer()||{}).index,l=ll(r.getWatermarkDimensionsByPosString(u,n.width,n.height),4),c=l[0],p=l[1],d=l[2],h=l[3];a.addOrUpdate({img:n,opacity:f,index:i,x:c,y:p,width:d,height:h,variant:gr,key:"watermark-layer",tab:"watermark",lockScaleToPercentage:s},e)},n.onerror=function(){t({isShowSpinner:!1})},e.match(/^https?:\/\/./)?n.src=e+"?"+(new Date).getTime():n.src=e}else t({isShowSpinner:!1})}))),bl(ml(r),"showWatermarkList",(function(){r.setState({showWaterMarkList:!0})})),bl(ml(r),"hideWatermarkList",(function(){r.setState({showWaterMarkList:!1})})),bl(ml(r),"onChangeWatermark",(function(e){r.changeURL({target:{value:e}}),r.hideWatermarkList()})),bl(ml(r),"handleInputTypeChange",(function(e){var t=e.target,n=r.props,o=n.updateState,i=n.config;o({isShowSpinner:!0}),r.setState({selectedInputType:t.value}),"text"===t.value?(r.changeTextProperty({target:{name:"text",value:(i.watermark||{}).defaultText||"Your text"}}),o({isShowSpinner:!1})):(o({watermark:ul(ul({},r.props.watermark),{},{text:null})}),r.initWatermarkImage(r.props.watermark.url||""))}));var i=e.watermark,l=i.opacity,c=i.position,s=i.url,u=i.applyByDefault,f=i.activePositions,p=i.handleOpacity,d=e.watermark,h=d.urls,m=d.fonts,g=[],b=c||"right-top";if("string"==typeof f&&sr.hasOwnProperty(f))g=sr[f];else if(Array.isArray(f)){var v=Array(9).fill(0);f.map((function(e,t){return v[t]=e})),g=v}else g=Array(9).fill(1);return 1!==g[cr.indexOf(b)]&&(b=cr[g.indexOf(1)]),h&&(h=h.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("string"==typeof e){var t=e.split("/");return{url:e,label:t[t.length-1]}}return e}))),r.initWatermarkImage(s||(null===(t=h)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.url)),r.state={isBlockRatio:!1,opacity:l||.7,handleOpacity:"boolean"!=typeof p||p,position:b,url:s||(h&&h.length>1?h[0]&&h[0].url:""),urls:h||[],activePositions:g,isWatermarkList:h&&h.length>1,applyByDefault:u||!1,showWaterMarkList:!1,selectedInputType:h&&h.length>1?"gallery":"upload",text:"",color:"#000000",textSize:62,textFont:"Arial",fonts:m||r.props.config.theme.fonts},r}return t=a,(n=[{key:"componentDidUpdate",value:function(e){var t=this.props;t.watermark.position!==this.state.position&&this.onPositionChange(this.state.position),t.watermark.applyByDefault!==e.watermark.applyByDefault&&(this.getWatermarkLayer()?this.updateWatermarkProperty({applyByDefault:!1},{hidden:!0,resizingBox:!1},{applyByDefault:!1}):this.setState({applyByDefault:t.watermark.applyByDefault}),t.watermark.applyByDefault&&(this.getWatermarkLayer()?this.updateWatermarkProperty({applyByDefault:!0},{hidden:!1,resizingBox:!0},{applyByDefault:!0}):this.initWatermarkImage(t.watermark.url)))}},{key:"render",value:function(){var e=this,t=this.state,n=t.isWatermarkList,r=t.url,o=t.urls,a=t.opacity,l=t.handleOpacity,c=t.position,s=t.activePositions,u=(t.applyByDefault,t.showWaterMarkList),f=t.selectedInputType,p=t.text,d=t.color,h=t.textFont,m=t.textSize,g=t.fonts,b=this.props.config,v="upload"===f,y="gallery"===f,w="url"===f,x="text"===f,k=this.props.t;return i.a.createElement(Dn,null,i.a.createElement(Ln,null,i.a.createElement("label",null,k["common.gallery"],i.a.createElement("input",{type:"radio",value:"gallery",checked:"gallery"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",{style:{cursor:b.processWithCloudimage?"not-allowed":"auto"}},k["common.upload"],i.a.createElement("input",{type:"radio",value:"upload",checked:"upload"===f,disabled:b.processWithCloudimage,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",null,k["common.url"],i.a.createElement("input",{type:"radio",value:"url",checked:"url"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null)),i.a.createElement("label",null,k["common.text"],i.a.createElement("input",{type:"radio",value:"text",checked:"text"===f,onChange:this.handleInputTypeChange}),i.a.createElement("span",null))),i.a.createElement(zn,null,i.a.createElement(Mn,null,y&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"url"},"Watermark Gallery"),i.a.createElement(il,{width:"100%",list:o,valueProp:"url",id:"gallery",value:r,style:{width:"calc(100% - 120px)"},onChange:function(t){e.changeURL({target:{value:t}})}})),w&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"url"},"Watermark URL"),i.a.createElement(mt,{id:"url",value:r,style:{width:"calc(100% - 120px)"},onChange:this.changeURL})),v&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"image-upload"},"Watermark Image"),i.a.createElement(gt,{id:"image-upload",style:{width:"calc(100% - 120px)"},onChange:this.readFile})),x&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"text"},"Watermark Text"),i.a.createElement(mt,{id:"text",value:p,style:{width:"calc(65% - 135px)",minWidth:120},name:"text",onChange:this.changeTextProperty}),i.a.createElement(il,{list:b.processWithCloudimage?pr:g,valueProp:"value",id:"textFont",value:h,style:{width:111,display:"inline-block",marginLeft:8},onChange:function(t){return e.changeTextProperty({target:{name:"textFont",value:t}})}}),i.a.createElement(mt,{value:m,type:"number",name:"textSize",style:{width:60,marginLeft:8},onChange:this.changeTextProperty}),i.a.createElement(mt,{value:d,type:"color",style:{width:30,marginLeft:8,padding:0,background:"transparent",boxShadow:"none"},name:"color",onChange:this.changeTextProperty}))),i.a.createElement(An,{switcherPosition:l?"right":"left"},l&&i.a.createElement(In,null,i.a.createElement("label",{htmlFor:"opacity",style:{minWidth:80}},"Opacity"),i.a.createElement(ha,{label:k["common.opacity"],min:0,max:1,step:.05,range:a,updateRange:this.changeOpacity})))),i.a.createElement(Bn,null,cr.map((function(t,n){return i.a.createElement(Nn,{key:t,value:t,active:t===c,clickable:s[n],onClick:function(){s[n]&&e.onPositionChange(t)}})}))),n&&u&&i.a.createElement(Fn,null,o.map((function(t){return i.a.createElement(Un,{key:t,src:t,onClick:function(){e.onChangeWatermark(t)}})}))))}}])&&fl(t.prototype,n),r&&fl(t,r),a}(o.Component);function yl(e){return(yl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xl(e){for(var t=1;t128?255-2*(255-e.r)*(255-t.r)/255:t.r*e.r*2/255,n.g=t.g>128?255-2*(255-e.g)*(255-t.g)/255:t.g*e.g*2/255,n.b=t.b>128?255-2*(255-e.b)*(255-t.b)/255:t.b*e.b*2/255,n})),Jc.register("difference",(function(e,t){return{r:e.r-t.r,g:e.g-t.g,b:e.b-t.b}})),Jc.register("addition",(function(e,t){return{r:t.r+e.r,g:t.g+e.g,b:t.b+e.b}})),Jc.register("exclusion",(function(e,t){return{r:128-2*(t.r-128)*(e.r-128)/255,g:128-2*(t.g-128)*(e.g-128)/255,b:128-2*(t.b-128)*(e.b-128)/255}})),Jc.register("softLight",(function(e,t){var n;return(n={}).r=t.r>128?255-(255-t.r)*(255-(e.r-128))/255:t.r*(e.r+128)/255,n.g=t.g>128?255-(255-t.g)*(255-(e.g-128))/255:t.g*(e.g+128)/255,n.b=t.b>128?255-(255-t.b)*(255-(e.b-128))/255:t.b*(e.b+128)/255,n})),Jc.register("lighten",(function(e,t){return{r:t.r>e.r?t.r:e.r,g:t.g>e.g?t.g:e.g,b:t.b>e.b?t.b:e.b}})),Jc.register("darken",(function(e,t){return{r:t.r>e.r?e.r:t.r,g:t.g>e.g?e.g:t.g,b:t.b>e.b?e.b:t.b}}));n(46);Caman.Plugin.register("crop",(function(e,t,n,r){var o;return null==n&&(n=0),null==r&&(r=0),o=document.createElement("canvas"),Kc.b.copyAttributes(this.canvas,o),o.width=e,o.height=t,o.getContext("2d").drawImage(this.canvas,n,r,e,t,0,0,e,t),this.cropCoordinates={x:n,y:r},this.cropped=!0,this.replaceCanvas(o)})),Caman.Plugin.register("resize",(function(e){var t;if(null==e&&(e=null),null!==e&&(null!=e.width||null!=e.height))return null==e.width?e.width=this.canvas.width*e.height/this.canvas.height:null==e.height&&(e.height=this.canvas.height*e.width/this.canvas.width),t=document.createElement("canvas"),Kc.b.copyAttributes(this.canvas,t),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,e.width,e.height),this.resized=!0,this.replaceCanvas(t);qc.a.error("Invalid or missing dimensions given for resize")})),Caman.Filter.register("crop",(function(){return this.processPlugin("crop",Array.prototype.slice.call(arguments,0))})),Caman.Filter.register("resize",(function(){return this.processPlugin("resize",Array.prototype.slice.call(arguments,0))}));var rs,os,is;n(47),n(48),n(49),n(50),n(51),n(52),n(53);rs=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],os=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],is=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},Caman.Plugin.register("compoundBlur",(function(e,t,n,r){var o,i,a,l=this.dimensions.width,c=this.dimensions.height,s=this.pixelData,u=e.data,f=l*c,p=[];for(o=0,i=0<=(a=f<<2);i?oa;i?o++:o--)p[o]=s[o];var d=0,h=r;for(r-=1;h-- >=0;){var m,g,b,v,y,w,x,k,S,C,E,O,_,P,T,j,R,D,M,A,I,z,B,L=t+.5|0;if(0!==L){L>256&&(L=256);var N=L+L+1,F=l-1,U=c-1,H=L+1,W=H*(H+1)/2,Y=new is,V=void 0,X=Y;for(o=1,m=1<=(g=N);m?og;m?o++:o--)X=X.next=new is,o===H&&(V=X);X.next=Y;var q=null,$=null,Q=M=0,K=rs[L],Z=os[L];for(D=0,A=0<=(I=c);A?DI;A?D++:D--){var G,J,ee,te,ne,re;for(_=w=b=T=k=y=0,P=H*(O=p[M]),x=H*(E=p[M+1]),v=H*(C=p[M+2]),T+=W*O,k+=W*E,y+=W*C,X=Y,o=0,G=0<=(J=H);G?oJ;G?o++:o--)X.r=O,X.g=E,X.b=C,X=X.next;for(o=1,ee=1<=(te=H);ee?ote;ee?o++:o--)S=M+((Fre;ne?R++:R--)p[M]=T*K>>Z,p[M+1]=k*K>>Z,p[M+2]=y*K>>Z,T-=P,k-=x,y-=v,P-=q.r,x-=q.g,v-=q.b,S=Q+((S=R+H)B;z?R++:R--){var oe,ie,ae,le,ce,se;for(w=b=_=k=y=T=0,P=H*(O=p[M=R<<2]),x=H*(E=p[M+1]),v=H*(C=p[M+2]),T+=W*O,k+=W*E,y+=W*C,X=Y,o=0,oe=0<=(ie=H);oe?oie;oe?o++:o--)X.r=O,X.g=E,X.b=C,X=X.next;var ue=l;for(o=1,ae=1<=(le=H);ae?ole;ae?o++:o--)M=ue+R<<2,T+=(X.r=O=p[M])*(j=H-o),k+=(X.g=E=p[M+1])*j,y+=(X.b=C=p[M+2])*j,_+=O,w+=E,b+=C,X=X.next,ose;ce?D++:D--)p[S=M<<2]=T*K>>Z,p[S+1]=k*K>>Z,p[S+2]=y*K>>Z,T-=P,k-=x,y-=v,P-=q.r,x-=q.g,v-=q.b,S=R+((S=D+H)-1;){var fe=o<<2,pe=(255&u[fe+2])/255*r,de=0|pe;if(de===d){var he=256*(pe-(0|pe)),me=256-he;s[fe]=s[fe]*me+p[fe]*he>>8,s[fe+1]=s[fe+1]*me+p[fe+1]*he>>8,s[fe+2]=s[fe+2]*me+p[fe+2]*he>>8}else de===d+1&&(s[fe]=p[fe],s[fe+1]=p[fe+1],s[fe+2]=p[fe+2])}d++}}return this})),Caman.Filter.register("tiltShift",(function(e){var t={center:{x:this.dimensions.width/2,y:this.dimensions.height/2},angle:45,focusWidth:200,startRadius:3,radiusFactor:1.5,steps:3};(e=Kc.b.extend(t,e)).angle*=Math.PI/180;var n=function(e,t,n,r,o,i,a){var l=document.createElement("canvas");l.width=e,l.height=t;var c=n+Math.cos(o)*i*.5,s=r+Math.sin(o)*i*.5,u=n-Math.cos(o)*i*.5,f=r-Math.sin(o)*i*.5,p=l.getContext("2d"),d=p.createLinearGradient(c,s,u,f);return a?(d.addColorStop(0,"white"),d.addColorStop(.5,"black"),d.addColorStop(1,"white")):(d.addColorStop(0,"white"),d.addColorStop(1,"black")),p.fillStyle=d,p.fillRect(0,0,e,t),p.getImageData(0,0,e,t)}(this.dimensions.width,this.dimensions.height,e.center.x,e.center.y,e.angle,e.focusWidth,!0);return this.processPlugin("compoundBlur",[n,e.startRadius,e.radiusFactor,e.steps])})),Caman.Filter.register("radialBlur",(function(e){var t={size:50,center:{x:this.dimensions.width/2,y:this.dimensions.height/2},startRadius:3,radiusFactor:1.5,steps:3,radius:null};(e=Kc.b.extend(t,e)).radius||(e.radius=this.dimensions.width-1?"&":"?")+(new Date).getTime()),u.setAttribute("crossOrigin","Anonymous"),u.src=e,e.startsWith("data:image/")||e.startsWith("blob:")||(u.src=u.src+(u.src.indexOf("?")>-1?"&version=":"?version=")+(new Date).getTime()),u.onload=function(){var e={width:u.width,height:u.height,ratio:u.width/u.height},n={activeBody:"preResize",isShowSpinner:!1,img:u,logoImage:f,imageName:s.indexOf("?")>-1?s.slice(0,s.indexOf("?")):s};if("manual"===o&&(i=u.height){var r=u.width/u.height,l={ratio:r,width:i,height:i/r};t.setState(ss(ss({preCanvasDimensions:ss({},l),canvasDimensions:ss({},l)},n),{},{activeBody:"preview",isPreResize:!0}))}else{var c=u.height/u.width,p={ratio:c,width:a/c,height:a};t.setState(ss(ss({preCanvasDimensions:ss({},p),canvasDimensions:ss({},p)},n),{},{activeBody:"preview",isPreResize:!0}))}else{var d,h=t.props.config.tools;1===h.length&&(d=h[0]),t.setState(ss(ss({},n),{},{activeBody:"preview",isPreResize:!1}),(function(){t.setState({activeTab:d})}))}}})),gs(hs(t),"determineImageType",(function(){var e=t.props.src;if(e instanceof Blob)t.setState({imageMime:e.type});else{var n=new XMLHttpRequest;n.open("GET",e),n.responseType="arraybuffer",n.onload=function(e){var n,r=e.target;t.setState({imageMime:(null===(n=Xc()(new Uint8Array(r.response)))||void 0===n?void 0:n.mime)||"image/svg+xml"})},n.send()}})),gs(hs(t),"updateState",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t._isMounted){var r=t.props.config.elementId,o=Rr(r);e.latestCanvasSize={width:o.width,height:o.height},t.setState(e,n)}})),gs(hs(t),"onRevert",(function(){var e=t.state,n=e.cancelLastOperation,r=e.activeTab;t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}),n(r,(function(){t.setState(ss({isHideCanvas:!1,isShowSpinner:!1},bs))}))})),gs(hs(t),"onAdjust",(function(e,n){(0,t.state.onAdjust)(e,n)})),gs(hs(t),"onRotate",(function(e,n,r,o){(0,t.state.onRotate)(e,n,r,o)})),gs(hs(t),"onFlip",(function(e){(0,t.state.flip)(e)})),gs(hs(t),"onSave",(function(){var e=t.state.saveImage;t.setState({isShowSpinner:!0}),e()})),gs(hs(t),"onDownloadImage",(function(){var e=t.props.onBeforeComplete,n=t.state,r=n.downloadImage,o=(0,n.getResultCanvas)();!e||e({status:"before-complete",canvas:o})?r((function(){t.props.onComplete({status:"success",canvas:o}),t.props.onClose(Cr)})):(t.props.onComplete({status:"success",canvas:o}),t.props.onClose(Sr))})),gs(hs(t),"onApplyEffects",(function(e){var n=t.state,r=n.applyCorrections,o=n.effect===e?null:e;t.setState({isShowSpinner:!0,effect:o},(function(){r((function(){t.setState({isShowSpinner:!1})}))}))})),gs(hs(t),"onApplyFilters",(function(e){var n=t.state,r=n.applyCorrections,o=n.filter===e?null:e;t.setState({isShowSpinner:!0,filter:o},(function(){r((function(){t.setState({isShowSpinner:!1})}))}))})),gs(hs(t),"handleSave",(function(){var e=t.state,n=e.processWithFilerobot,r=e.processWithCloudService;n||r?t.onSave():t.onDownloadImage()})),gs(hs(t),"apply",(function(e){var n=t.state,r=n.activeTab;(0,n.applyChanges)(r,e),t.setState({activeTab:null})})),gs(hs(t),"redoOperation",(function(e){var n=e.operationIndex,r=e.callback,o=void 0===r?function(){}:r,i=e.resetActiveTab,a=void 0===i||i,l=e.operationObject,c=void 0===l?{}:l,s=t.state.applyOperations;a?t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}):t.setState({isHideCanvas:!0,isShowSpinner:!0}),s(n,(function(){t.setState({isHideCanvas:!1,isShowSpinner:!1},o)}),c)})),gs(hs(t),"resetOperations",(function(){var e=t.state.resetAll;t.setState({activeTab:null,isHideCanvas:!0,isShowSpinner:!0}),e((function(){t.setState(ss({isHideCanvas:!1,isShowSpinner:!1},bs))}))})),gs(hs(t),"onPreResize",(function(e){var n,r=t.props.config.tools;switch(1===r.length&&(n=r[0]),e){case"keep":t.setState({canvasDimensions:{},isPreResize:!1,activeBody:"preview"},(function(){t.setState({activeTab:n})}));break;case"resize":var o=t.state.canvasDimensions;t.setState({preCanvasDimensions:o,isPreResize:!0,activeBody:"preview"},(function(){t.setState({activeTab:n})}))}}));var n=e.config,r=n.processWithCloudimage,i=n.processWithFilerobot,l=n.processWithCloudService,c=n.uploadWithCloudimageLink,s=n.reduceBeforeEdit,u=n.cropBeforeEdit,f=n.watermark,p=n.imageSealing;return t.state=ss(ss({isShowSpinner:!0,isHideCanvas:!1,activeTab:null,activeBody:null,currentOperation:null,original:{width:300,height:200},cropDetails:{width:300,height:200},canvasDimensions:{width:300,height:200,ratio:1.5},processWithFilerobot:i,processWithCloudimage:r,processWithCloudService:l,uploadCloudimageImage:c,reduceBeforeEdit:s,cropBeforeEdit:u,roundCrop:!1,imageSealing:ss({enabled:!1,salt:"",char_count:10,include_params:null},p),operationsOriginal:[],operationsZoomed:[],operations:[],canvasZoomed:null,canvasOriginal:null,isPreResize:!1,initialZoom:1},bs),{},{watermark:f||ur,focusPoint:{x:null,y:null},shapes:[],selectedShape:{},availableShapes:[]}),t}return t=a,(n=[{key:"componentDidMount",value:function(){this._isMounted=!0,this.loadImage(),this.determineImageType()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"render",value:function(){var e=this.state,t=e.isShowSpinner,n=e.activeTab,r=e.operations,o=e.operationsOriginal,a=e.operationsZoomed,l=e.currentOperation,c=e.isHideCanvas,s=e.cropDetails,u=e.original,f=e.canvasDimensions,p=e.processWithCloudimage,d=e.processWithFilerobot,h=e.processWithCloudService,m=e.uploadCloudimageImage,g=e.imageMime,b=e.lastOperation,v=e.operationList,y=e.initialZoom,w=e.canvasZoomed,x=e.canvasOriginal,k=e.reduceBeforeEdit,S=e.cropBeforeEdit,C=e.img,E=e.imageName,O=e.activeBody,_=e.isPreResize,P=e.preCanvasDimensions,T=e.logoImage,j=e.imageSealing,R=e.effect,D=e.filter,M=e.crop,A=e.roundCrop,I=e.resize,z=e.rotate,L=e.correctionDegree,N=e.flipX,F=e.flipY,U=e.adjust,H=e.watermark,W=e.focusPoint,Y=e.shapes,V=e.shapeOperations,X=e.selectedShape,q=e.availableShapes,$=e.latestCanvasSize,Q=this.props,K=Q.src,Z=Q.config,G=Q.onClose,J=Q.onComplete,ee=Q.closeOnLoad,te=void 0===ee||ee,ne=Q.t,re=void 0===ne?{}:ne,oe=Q.theme,ie={effect:R,filter:D,crop:M,resize:I,rotate:z,flipX:N,flipY:F,adjust:U,correctionDegree:L},ae=ss(ss({t:re,theme:oe,cropDetails:s,original:u,activeTab:n,src:K,onClose:G,config:Z,canvasDimensions:f,processWithCloudimage:p,processWithFilerobot:d,processWithCloudService:h,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,isShowSpinner:t,img:C,logoImage:T,imageName:E,activeBody:O,preCanvasDimensions:P,updateState:this.updateState,onRevert:this.onRevert,apply:this.apply,onSave:this.onSave,onFlip:this.onFlip,onApplyEffects:this.onApplyEffects,onApplyFilters:this.onApplyFilters,onRotate:this.onRotate,onAdjust:this.onAdjust,onDownloadImage:this.onDownloadImage,handleSave:this.handleSave},ie),{},{watermark:H,focusPoint:W,shapes:Y,shapeOperations:V,selectedShape:X,availableShapes:q}),le=ss(ss({t:re,theme:oe,cropDetails:s,original:u,activeTab:n,isShowSpinner:t,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,currentOperation:l,isHideCanvas:c,src:K,imageMime:g,onClose:G,onComplete:J,canvasDimensions:f,closeOnLoad:te,config:Z,processWithCloudimage:p,processWithFilerobot:d,processWithCloudService:h,imageSealing:j,uploadCloudimageImage:m,lastOperation:b,operationList:v,canvasZoomed:w,canvasOriginal:x,reduceBeforeEdit:k,cropBeforeEdit:S,img:C,logoImage:T,imageName:E,isPreResize:_,preCanvasDimensions:P,updateState:this.updateState,handleSave:this.handleSave,onPreResize:this.onPreResize,redoOperation:this.redoOperation,roundCrop:A},ie),{},{watermark:H,focusPoint:W,shapes:Y,shapeOperations:V,selectedShape:X,latestCanvasSize:$}),ce={logoImage:T,t:re,theme:oe,activeBody:O,operations:r,operationsOriginal:o,operationsZoomed:a,initialZoom:y,currentOperation:l,processWithCloudimage:p,processWithCloudService:h,updateState:this.updateState,redoOperation:this.redoOperation,resetOperations:this.resetOperations,config:Z,watermark:H};return i.a.createElement(B,{roundCrop:A,isLoading:t},i.a.createElement(Yc,ae),i.a.createElement(we,null,"preview"===O&&i.a.createElement(Lo,le),"preResize"===O&&i.a.createElement(Ko,le),i.a.createElement(yn,{overlay:!0,show:t,label:re["spinner.label"]})),i.a.createElement(Jn,ce))}}])&&us(t.prototype,n),r&&us(t,r),a}(o.Component);function ys(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\e90c'\n }\n"],["\n#filerobot-image-editor-root & {\n cursor: pointer;\n position: absolute;\n font-weight: normal;\n top: ",";\n right: ",";\n left: ",";\n bottom: ",";\n font-size: ",";\n z-index: 10;\n font-family: 'filerobot-image-editor-font' !important;\n color: ",";\n speak: none;\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n\n /* Better Font Rendering =========== */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n \n #filerobot-image-editor-root &:hover {\n color: ",";\n }\n \n #filerobot-image-editor-root &:before {\n content: '\\\\e90c'\n }\n"]);return ys=function(){return e},e}var ws=a.b.span.attrs((function(){return{role:"button"}}))(ys(),(function(e){return e.t||"10px"}),(function(e){return e.r||"10px"}),(function(e){return e.l||"auto"}),(function(e){return e.b||"auto"}),(function(e){return e.fz||"18px"}),(function(){return f.modal.colorMuted}),(function(e){return f.modal.colorMutedHover}));function xs(e){return(xs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ks(){return(ks=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Cs(e,t){for(var n=0;n div {\n padding: 40px !important;\n }\n \n * {\n color: black !important;\n }\n ":""}));var Bs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Es(e,t)}(c,e);var t,n,a,l=Os(c);function c(e){var t,n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),t=l.call(this,e),n=Ps(t),o=function(e){var n=t.props.onClose,r=void 0===n?function(){}:n;27===e.keyCode&&(e.stopPropagation(),r(xr))},(r="handleOutsideMouseClick")in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,t.root=document.createElement("div"),t.root.classList.add("filerobot-image-editor-root"),t.root.id="filerobot-image-editor-root",document.body.appendChild(t.root);var i=t.props.closeOnOutsideClick;return(void 0===i||i)&&document.addEventListener("keydown",t.handleOutsideMouseClick),t}return t=c,(n=[{key:"componentWillUnmount",value:function(){var e=this.props.closeOnOutsideClick,t=void 0===e||e;document.body.removeChild(this.root),t&&document.removeEventListener("keydown",this.handleOutsideMouseClick)}},{key:"render",value:function(){var e=this.props,t=e.onClose,n=void 0===t?function(){}:t,a=e.isHideCloseBtn,l=e.configModalId,c=Ss(e,["onClose","isHideCloseBtn","configModalId"]);return Object(r.createPortal)(i.a.createElement(o.Fragment,null,i.a.createElement(As,{className:"modal-overlay",onClick:function(){return n(kr)}}),i.a.createElement(zs,ks({id:l||tr},this.props),!a&&i.a.createElement(ws,{onClick:n}),i.a.createElement(Is,ks({h:"100%"},c),this.props.children))),this.root)}}])&&Cs(t.prototype,n),a&&Cs(t,a),c}(o.Component),Ls=(n(66),{en:{"header.image_editor_title":"Filerobot Image Editor","header.toggle_fullscreen":"Toggle fullscreen","header.close_modal":"Close window","toolbar.download":"Download","toolbar.save":"Save","toolbar.apply":"Apply","toolbar.cancel":"Cancel","toolbar.go_back":"Go Back","toolbar.adjust":"Adjust","toolbar.effects":"Effects","toolbar.filters":"Filters","toolbar.orientation":"Orientation","toolbar.crop":"Crop","toolbar.resize":"Resize","toolbar.watermark":"Watermark","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"Brightness","adjust.contrast":"Contrast","adjust.exposure":"Exposure","adjust.saturation":"Saturation","orientation.rotate_l":"Rotate Left","orientation.rotate_r":"Rotate Right","orientation.flip_h":"Flip Horizontally","orientation.flip_v":"Flip Vertically","pre_resize.title":"Would you like to reduce resolution before editing the image?","pre_resize.keep_original_resolution":"Keep original resolution","pre_resize.resize_n_continue":"Resize & Continue","footer.reset":"Reset","footer.undo":"Undo","footer.redo":"Redo","spinner.label":"Processing...","warning.too_big_resolution":"The resolution of the image is too big for the web. It can cause problems with Image Editor performance.","common.x":"x","common.y":"y","common.width":"width","common.height":"height","common.custom":"custom","common.original":"original","common.square":"square","common.opacity":"Opacity","common.apply_watermark":"Apply watermark","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery","common.text":"Text"},fr:{"header.image_editor_title":"Éditeur d'Image Filerobot","toolbar.download":"Télécharger","toolbar.save":"Sauvegarder","toolbar.apply":"Appliquer","toolbar.cancel":"Annuler","toolbar.go_back":"Retour","toolbar.adjust":"Ajuster","toolbar.effects":"Effets","toolbar.filters":"Filtres","toolbar.orientation":"Orientation","toolbar.crop":"Rogner","toolbar.resize":"Redimensionner","toolbar.watermark":"Watermark","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"Luminosité","adjust.contrast":"Contraste","adjust.exposure":"Exposition","adjust.saturation":"Saturation","orientation.rotate_l":"Rotation Gauche","orientation.rotate_r":"Rotation Droite","orientation.flip_h":"Miroir Horizontal","orientation.flip_v":"Miroir Vertical","pre_resize.title":"Voulez-vous réduire la résolution de l'image avant d'éditer l'image ?","pre_resize.keep_original_resolution":"Conserver la résolution d'origine","pre_resize.resize_n_continue":"Redimensionner et Continuer","footer.reset":"Réinitialiser","footer.undo":"Annuler","footer.redo":"Refaire","spinner.label":"Transformation...","warning.too_big_resolution":"La résolution de l'image est trop grande pour le web et peut endommager les performances de l'Éditeur d'Image Filerobot.","common.x":"x","common.y":"y","common.width":"largeur","common.height":"hauteur","common.custom":"custom","common.original":"original","common.square":"carré","common.opacity":"opacité","common.apply_watermark":"Appliquer watermark","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery"},"zh-cn":{"header.image_editor_title":"Filerobot 图片编辑器","toolbar.download":"下载","toolbar.save":"保存","toolbar.apply":"应用","toolbar.cancel":"取消","toolbar.go_back":"后退","toolbar.adjust":"调整","toolbar.effects":"效果","toolbar.filters":"滤镜","toolbar.orientation":"方向","toolbar.crop":"裁切","toolbar.resize":"缩放","toolbar.watermark":"水印","toolbar.focus_point":"Focus point","toolbar.shapes":"Shapes","toolbar.image":"Image","toolbar.text":"Text","adjust.brightness":"亮度","adjust.contrast":"对比对","adjust.exposure":"曝光度","adjust.saturation":"饱和度","orientation.rotate_l":"向左旋转","orientation.rotate_r":"向右旋转","orientation.flip_h":"水平翻转","orientation.flip_v":"垂直翻转","pre_resize.title":"是否需要在开始编辑之前缩小图片的分辨率?","pre_resize.keep_original_resolution":"保持原始分辨率","pre_resize.resize_n_continue":"缩小并继续","footer.reset":"重置","footer.undo":"撤销","footer.redo":"重做","spinner.label":"处理中...","warning.too_big_resolution":"图片的分辨率过大,这会严重影响图片编辑器的性能。","common.x":"x","common.y":"y","common.width":"宽度","common.height":"高度","common.custom":"自定义","common.original":"原始比例","common.square":"方形","common.banner":"通栏","common.opacity":"透明度","common.apply_watermark":"应用水印","common.url":"URL","common.upload":"Upload","common.gallery":"Gallery"}}),Ns={colors:{primaryBg:"#1e262c",primaryBgHover:"#637381",secondaryBg:"#263138",secondaryBgHover:"#34444c",text:"#F9FAFB",textHover:"#fff",textMute:"#aaa",textWarn:"#f7931e",secondaryBgOpacity:"rgba(0, 0, 0, 0.75)",accent:"#00707c",border:"#161e23",borderLight:"#70777f",disabledBg:"rgba(255, 0, 0, 0.1)"}},Fs={colors:{primaryBg:"#f2f2f2",primaryBgHover:"#fff",secondaryBg:"#fff",secondaryBgHover:"#f9fafb",secondaryBgOpacity:"rgba(255,255,255, 0.75)",text:"#34444c",textHover:"#1a2329",textMute:"#aaa",textWarn:"#f7931e",accent:"#00707c",border:"#aeaeae",borderLight:"#e1e1e1",disabledBg:"rgba(255, 0, 0, 0.1)"}},Us="undefined"==typeof window||"undefined"==typeof CanvasRenderingContext2D;function Hs(e){return(Hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ys(e){for(var t=1;t-1})):n})})),Zs(Qs(t),"open",(function(e){var n=t.props.onOpen;t._isMounted&&t.setState({isVisible:!0,src:e},(function(){n&&n()}))})),Zs(Qs(t),"close",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yr,n=t.props.onClose,r="object"===Hs(e)?yr:e;t._isMounted&&t.setState({isVisible:!1},(function(){n&&n({status:r})}))})),s.translations=s.translations||{},s.language=s.translations[s.language]||Ls[s.language]?s.language:"en",s.theme=s.theme||{},s.theme.colors=s.theme.colors||{},s.theme.fonts=s.theme.fonts||fr,s.colorScheme=s.colorScheme||"dark",s.platform=s.platform||"filerobot";var u="object"===Hs(s.colorScheme);return t.state={isVisible:r,src:a,config:t.processConfig(s),t:Ys(Ys({},Ls[s.language]),s.translations[s.language]),colorScheme:u?"custom":s.colorScheme||"dark",theme:{colors:Ys(Ys({},(u?{colors:s.colorScheme}:"light"===s.colorScheme?Fs:Ns).colors),s.theme.colors),fonts:s.theme.fonts}},t}return t=l,(n=[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"componentDidUpdate",value:function(e){this.props.show!==e.show&&(this.props.show?this.open(this.props.src):this.close())}},{key:"render",value:function(){var e=this.state,t=e.isVisible,n=e.src,r=e.config,o=e.t,l=e.theme,c=this.props,s=c.onComplete,u=void 0===s?function(){}:s,f=c.onBeforeComplete,p=c.closeOnLoad,d=r.showInModal,h=void 0===d||d;if(!n||!t||Us)return null;if(n instanceof Blob&&r.processWithCloudimage)return null;var m=i.a.createElement(z,null,i.a.createElement(vs,{src:n,config:r,onComplete:u,onBeforeComplete:f,onClose:this.close,closeOnLoad:p,t:o}));return i.a.createElement(a.a,{theme:Ys({},l)},h?i.a.createElement(Bs,{noBorder:!0,fullScreen:"lg",isHideCloseBtn:!0,style:{borderRadius:5},onClose:this.close,configModalId:r.elementId},m):i.a.createElement("div",{className:"filerobot-image-editor-root",id:"filerobot-image-editor-root",style:{width:"100%",height:"100%"}},m))}}])&&Vs(t.prototype,n),r&&Vs(t,r),l}(o.Component);function Js(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}window.FilerobotImageEditor=function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Js(this,e),t=n.elementId?n.elementId:n.processWithCloudimage||n.cloudimage?"filerobot-image-editor-cloudimage":n.processWithFilerobot||n.filerobot?"filerobot-image-editor-uploader":"filerobot-image-editor";var l=document.getElementById(t),c=function(e){console.log(e)};c=o&&"function"==typeof o?o:(o=o||{}).onComplete||c,l||((l=document.createElement("div")).id=t,document.body.appendChild(l)),n.elementId=t;var s=function(e){return Object(r.render)(i.a.createElement(e,{show:a,config:n,onComplete:c,onBeforeComplete:o.onBeforeComplete,onOpen:o.onOpen,onClose:o.onClose}),l)};this.component=s(Gs),this.open=this.component.open,this.close=this.component.close,this.unmount=function(){return Object(r.unmountComponentAtNode)(l)}}}]); \ No newline at end of file diff --git a/examples/js/src/index.html b/examples/js/src/index.html index 8cce9a3a..89d064fc 100644 --- a/examples/js/src/index.html +++ b/examples/js/src/index.html @@ -297,7 +297,7 @@

Ready to get started?

Include the following script into your project

-
<script src="https://cdn.scaleflex.it/plugins/filerobot-image-editor/3.12.9/filerobot-image-editor.min.js"/></script>
+
<script src="https://cdn.scaleflex.it/plugins/filerobot-image-editor/3.12.10/filerobot-image-editor.min.js"/></script>
diff --git a/package.json b/package.json index 3dffa373..10ec2505 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "filerobot-image-editor", - "version": "3.12.9", + "version": "3.12.10", "main": "dist/index.js", "description": "Edit, resize, and filter any image!", "author": "scaleflex",