UNPKG

photoeditorsdk

Version:

The most comprehensive photo editor SDK for HTML5

590 lines (539 loc) 505 kB
import{$a as Dc,A as lc,Da as xc,Fa as Cc,Ia as Sc,J as cc,L as dc,La as wc,Na as kc,Oa as ye,Pa as Tc,Qa as g,Ra as Ic,Sa as Mc,T as pc,Ta as S,Ua as ks,V as hc,Va as jt,Wa as dt,Z as uc,Za as oe,_ as ws,_a as Xt,a as ql,ab as Ec,b as Rt,bb as re,c as s,cb as Ts,d as Jl,db as Is,e as T,ea as mc,eb as Pc,f as h,fa as Vo,fb as Ms,g as Br,gb as Ds,h as Or,hb as Es,i as Zl,ia as fc,ib as zc,j as Wo,jb as ve,k as Ql,kb as Ps,l as p,lb as zs,m as nt,mb as Ac,n as tc,na as gc,nb as Lc,o as ec,ob as Bc,p as I,pb as Oc,q as ic,qa as bc,qb as As,r as oo,ra as ro,rb as Uo,s as yi,sb as Ls,t as Gt,tb as Fr,u as oc,ub as Fc,v as rc,va as yc,w as nc,x as sc,y as ac,ya as vc,z as No}from"./chunk-UDNMGV4K.js";var po=ql((d4,cd)=>{var Ug="Expected a function";var ad=0/0;var Gg="[object Symbol]";var jg=/^\s+|\s+$/g;var Xg=/^[-+]0x[0-9a-f]+$/i;var Yg=/^0b[01]+$/i;var Kg=/^0o[0-7]+$/i;var qg=parseInt;var Jg=typeof global=="object"&&global&&global.Object===Object&&global;var Zg=typeof self=="object"&&self&&self.Object===Object&&self;var Qg=Jg||Zg||Function("return this")();var tb=Object.prototype;var eb=tb.toString;var ib=Math.max;var ob=Math.min;var Ks=function(){return Qg.Date.now()};function rb(i,t,e){var o,r,n,a,l,c,d=0,u=false,m=false,f=true;if(typeof i!="function"){throw new TypeError(Ug)}t=ld(t)||0;if(qs(e)){u=!!e.leading;m="maxWait"in e;n=m?ib(ld(e.maxWait)||0,t):n;f="trailing"in e?!!e.trailing:f}function b(P){var V=o,U=r;o=r=void 0;d=P;a=i.apply(U,V);return a}function y(P){d=P;l=setTimeout(C,t);return u?b(P):a}function v(P){var V=P-c,U=P-d,st=t-V;return m?ob(st,n-U):st}function x(P){var V=P-c,U=P-d;return c===void 0||V>=t||V<0||m&&U>=n}function C(){var P=Ks();if(x(P)){return D(P)}l=setTimeout(C,v(P))}function D(P){l=void 0;if(f&&o){return b(P)}o=r=void 0;return a}function A(){if(l!==void 0){clearTimeout(l)}d=0;o=c=r=l=void 0}function B(){return l===void 0?a:D(Ks())}function O(){var P=Ks(),V=x(P);o=arguments;r=this;c=P;if(V){if(l===void 0){return y(c)}if(m){l=setTimeout(C,t);return b(c)}}if(l===void 0){l=setTimeout(C,t)}return a}O.cancel=A;O.flush=B;return O}function qs(i){var t=typeof i;return!!i&&(t=="object"||t=="function")}function nb(i){return!!i&&typeof i=="object"}function sb(i){return typeof i=="symbol"||nb(i)&&eb.call(i)==Gg}function ld(i){if(typeof i=="number"){return i}if(sb(i)){return ad}if(qs(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=qs(t)?t+"":t}if(typeof i!="string"){return i===0?i:+i}i=i.replace(jg,"");var e=Yg.test(i);return e||Kg.test(i)?qg(i.slice(2),e?2:8):Xg.test(i)?ad:+i}cd.exports=rb});var yo=ql((LT,np)=>{var rp="Expected a function";var ip=0/0;var w0="[object Symbol]";var k0=/^\s+|\s+$/g;var T0=/^[-+]0x[0-9a-f]+$/i;var I0=/^0b[01]+$/i;var M0=/^0o[0-7]+$/i;var D0=parseInt;var E0=typeof global=="object"&&global&&global.Object===Object&&global;var P0=typeof self=="object"&&self&&self.Object===Object&&self;var z0=E0||P0||Function("return this")();var A0=Object.prototype;var L0=A0.toString;var B0=Math.max;var O0=Math.min;var va=function(){return z0.Date.now()};function F0(i,t,e){var o,r,n,a,l,c,d=0,u=false,m=false,f=true;if(typeof i!="function"){throw new TypeError(rp)}t=op(t)||0;if(xn(e)){u=!!e.leading;m="maxWait"in e;n=m?B0(op(e.maxWait)||0,t):n;f="trailing"in e?!!e.trailing:f}function b(P){var V=o,U=r;o=r=void 0;d=P;a=i.apply(U,V);return a}function y(P){d=P;l=setTimeout(C,t);return u?b(P):a}function v(P){var V=P-c,U=P-d,st=t-V;return m?O0(st,n-U):st}function x(P){var V=P-c,U=P-d;return c===void 0||V>=t||V<0||m&&U>=n}function C(){var P=va();if(x(P)){return D(P)}l=setTimeout(C,v(P))}function D(P){l=void 0;if(f&&o){return b(P)}o=r=void 0;return a}function A(){if(l!==void 0){clearTimeout(l)}d=0;o=c=r=l=void 0}function B(){return l===void 0?a:D(va())}function O(){var P=va(),V=x(P);o=arguments;r=this;c=P;if(V){if(l===void 0){return y(c)}if(m){l=setTimeout(C,t);return b(c)}}if(l===void 0){l=setTimeout(C,t)}return a}O.cancel=A;O.flush=B;return O}function R0(i,t,e){var o=true,r=true;if(typeof i!="function"){throw new TypeError(rp)}if(xn(e)){o="leading"in e?!!e.leading:o;r="trailing"in e?!!e.trailing:r}return F0(i,t,{"leading":o,"maxWait":t,"trailing":r})}function xn(i){var t=typeof i;return!!i&&(t=="object"||t=="function")}function H0(i){return!!i&&typeof i=="object"}function _0(i){return typeof i=="symbol"||H0(i)&&L0.call(i)==w0}function op(i){if(typeof i=="number"){return i}if(_0(i)){return ip}if(xn(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=xn(t)?t+"":t}if(typeof i!="string"){return i===0?i:+i}i=i.replace(k0,"");var e=I0.test(i);return e||M0.test(i)?D0(i.slice(2),e?2:8):T0.test(i)?ip:+i}np.exports=R0});import cg from"styled-components";var Rc=cg.div` position: absolute; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid ${i=>i.theme.dropdown.caretColor}; transform: rotate(${i=>i.rotation||0}deg); display: inline-block; transition-duration: 0.3s; transition-timing-function: ease-in; right: 0; top: 13px; `;import gg from"styled-components";import jo from"react";import ug,{css as mg}from"styled-components";import{css as dg}from"styled-components";var mt=dg` &:focus { outline: none; box-shadow: 0 0 2px ${i=>i.theme.focusOutlineColor}; } &:-moz-focusring { outline: none; box-shadow: 0 0 2px ${i=>i.theme.focusOutlineColor}; } `;import{css as pg}from"styled-components";var no=pg` position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ clip: rect(1px, 1px, 1px, 1px); `;import Go from"styled-components";import{keyframes as hg}from"styled-components";var Rr=hg` from { opacity: 1; transform: scale(0); } to { opacity: 0; transform: scale(10); } `;var Hr=Go.span` position: absolute; top: 0; left: 0; width: 100%; height: 100%; `;var Bs=Go(Hr)``;var xt=Go(Hr)``;var so=Go(Hr)``;var _r={display:"none",left:0,top:0};var $r=Go(Hr)` display: ${({display:i})=>i}; left: ${({left:i})=>i}px; top: ${({top:i})=>i}px; pointer-events: none; border-radius: 50%; background-color: rgba(255, 255, 255, 0.12); animation: ${Rr} 1.2s; width: 100px; height: 100px; margin-top: -50px; margin-left: -50px; opacity: 0; `;var Yt=mg` color: ${i=>i.theme.button.activeForeground}; border-color: ${i=>i.theme.button.activeForeground}; svg { color: ${i=>i.theme.button.activeForeground}; } `;var fg=ug.button` &&& { box-sizing: border-box; } text-align: center; position: relative; padding: 4px 8px; min-height: 32px; border-radius: ${i=>i.theme.shape.radiusMedium}px; font-size: ${i=>i.theme.measurements.fontSystem.button1.size}px; letter-spacing: ${i=>i.theme.measurements.fontSystem.button1.letterSpacing}px; text-transform: ${i=>i.theme.measurements.fontSystem.button1.case}; font-family: ${i=>i.theme.typography.fontFamily}, sans-serif; cursor: pointer; border: none; background-color: transparent; overflow: hidden; ${mt} /* Active */ &:active { ${Yt} } ${({isActive:i})=>i&&Yt} /* Disabled */ &:disabled { cursor: default; pointer-events: none; ${xt} { background-color: ${i=>i.theme.button.outlinedInactiveOverlayColor}; } } /* Hover */ &:hover { ${so} { background-color: ${i=>i.theme.button.hoverOverlayColor}; } } div { font-size: ${i=>i.theme.measurements.fontSystem.button1.size}px; letter-spacing: ${i=>i.theme.measurements.fontSystem.button1.letterSpacing}px; } `;var gt=class extends jo.Component{constructor(){super(...arguments);this.state=_r;this.timeout=null;this.onClick=t=>{const e=t.currentTarget.getBoundingClientRect();const o=t.pageX-e.left;const r=t.pageY-e.top;if(this.state.display==="block"){this.setState({display:"none"},()=>{this.setRippleState(o,r)})}else{this.setRippleState(o,r)}this.props.onClick(t)};this.setRippleState=(t,e)=>{this.setState({left:t,top:e,display:"block"});this.timeout=setTimeout(()=>{this.setState({display:"none"})},1200)}}componentWillUnmount(){clearTimeout(this.timeout)}render(){const{isActive:t,isDisabled:e,label:o,ariaLabel:r,children:n,className:a,...l}=this.props;const{left:c,top:d,display:u}=this.state;return jo.createElement(fg,{"data-test":r,className:a,isActive:t,disabled:e,"aria-label":r,...l,onClick:this.onClick},o,n,jo.createElement($r,{display:u,left:c,top:d}),jo.createElement(xt,null),jo.createElement(so,null))}};gt.defaultProps={type:"button",isDisabled:false,isActive:false};var Xo=gg(gt)` color: ${i=>i.theme.button.textPrimaryForeground}; svg { color: ${i=>i.theme.button.textPrimaryForeground}; } /* Repeat active styles so they are not overwritten */ ${({isActive:i})=>i&&Yt} ${xt} { display: none; } &:disabled { opacity: ${i=>i.theme.button.textInactiveOpacity}; } `;import bg from"styled-components";var vi=bg(gt)` color: ${i=>i.theme.button.textSecondaryForeground}; /* Repeat active styles so they are not overwritten */ ${({isActive:i})=>i&&Yt} ${xt} { display: none; } &:disabled { opacity: ${i=>i.theme.button.textInactiveOpacity}; } svg { color: ${i=>i.theme.button.textSecondaryForeground}; } `;import wg from"styled-components";import Os,{useContext as vg}from"react";import Fs,{css as xi}from"styled-components";import yg from"react";var et=yg.createContext({});var Hc=xi` display: flex; flex: 0 0 auto; justify-content: center; align-items: center; padding: 4px; `;var xg=Fs(gt)` ${({fullWidth:i})=>i&&xi` width: 100%; `} ${({hasIcon:i,smallContainer:t})=>i&&t&&Hc} ${({hasIcon:i})=>i&&xi` @media all and (min-width: 0) and (max-width: 599px) { ${Hc} } `} `;var _c=xi` display: flex; `;var Cg=Fs.div` &:focus { outline: none; } > img { height: 18px; width: 18px; } > svg { height: 18px; width: 18px; } display: none; ${i=>i.smallContainer&&_c} @media all and (min-width: 0) and (max-width: 599px) { ${_c} } `;var $c=xi` display: none; `;var Sg=Fs.div` display: flex; justify-content: center; align-items: center; &:focus { outline: none; } font-size: inherit; text-spacing: inherit; color: inherit; ${({isDisabled:i})=>i&&xi` opacity: ${t=>t.theme.button.textInactiveOpacity}; `} ${({hasIcon:i,smallContainer:t})=>i&&t&&$c} ${({hasIcon:i})=>i&&xi` @media all and (min-width: 0) and (max-width: 599px) { ${$c} } `} `;var Kt=({label:i,children:t,icon:e,fullWidth:o,isDisabled:r,...n})=>{const{rect:a}=vg(et);const l=!!a&&a.width<600;const c=Os.createElement(Sg,{hasIcon:!!e,isDisabled:r,smallContainer:l},i,t);return Os.createElement(xg,{fullWidth:o,isDisabled:r,hasIcon:!!e,smallContainer:l,...n},e&&Os.createElement(Cg,{smallContainer:l},e),(t||i)&&c)};var Rs=wg(Kt)` background: ${i=>i.theme.button.outlinedPrimaryBackground}; color: ${i=>i.theme.button.outlinedPrimaryForeground}; border: 1px solid ${i=>i.theme.button.outlinedBorderColor}; min-width: 32px; svg { color: ${i=>i.theme.button.outlinedPrimaryForeground}; } `;import kg from"styled-components";var ao=kg(Kt)` background: ${i=>i.theme.button.outlinedSecondaryBackground}; color: ${i=>i.theme.button.outlinedSecondaryForeground}; border: 1px solid ${i=>i.theme.button.outlinedBorderColor}; svg { color: ${i=>i.theme.button.outlinedSecondaryForeground}; } ${({isActive:i})=>i&&Yt} `;import Wc from"react";import Nc from"styled-components";var Tg=Nc(gt)` color: ${i=>i.theme.foreground}; svg { color: ${i=>i.theme.foreground}; } /* Repeat active styles so they are not overwritten */ ${({isActive:i})=>i&&Yt} ${xt} { display: none; } &:disabled { opacity: ${i=>i.theme.button.textInactiveOpacity}; } `;var Ig=Nc.div` display: flex; &:focus { outline: none; } `;var Ci=({label:i,icon:t,children:e,...o})=>Wc.createElement(Tg,{...o},Wc.createElement(Ig,null,t));import Mg from"styled-components";var Hs=Mg(Kt)` background: ${i=>i.theme.button.containedPrimaryBackground}; color: ${i=>i.theme.button.containedPrimaryForeground}; border: 1px solid ${i=>i.theme.button.containedPrimaryBackground}; &:active { color: ${i=>i.theme.button.containedPrimaryForeground}; } svg { color: ${i=>i.theme.button.containedPrimaryForeground}; &:active { color: ${i=>i.theme.button.containedPrimaryForeground}; } } `;import Yo from"react";import Ko,{css as lo}from"styled-components";var Dg=Ko.div` display: flex; justify-content: center; align-items: center; padding: 0 4px; font-size: ${i=>i.theme.measurements.fontSystem.label.size}px; letter-spacing: ${i=>i.theme.measurements.fontSystem.label.letterSpacing}px; text-transform: ${i=>i.theme.measurements.fontSystem.label.case}; ${i=>i.withBackground?lo` color: ${i.theme.card.labelForeground}; `:lo` color: ${i.theme.card.foreground}; `} `;var Eg=Ko.div` display: flex; flex-direction: column; justify-content: center; align-items: center; position: absolute; bottom: 0px; border-radius: ${i=>i.theme.shape.radiusMedium}px; left: 0; ${i=>i.withBackground?lo` color: ${i.theme.card.labelForeground}; height: 40px; background: ${i.theme.card.labelBackground}; `:lo` color: ${i.theme.card.foreground}; height: 32px; `} width: 100%; cursor: pointer; `;var Pg=Ko.div` width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid ${i=>i.theme.card.labelForeground}; ${i=>i.withBackground?lo` border-top-color: ${i.theme.card.labelForeground}; `:lo` border-top-color: ${i.theme.card.foreground}; `} transform: rotate(${i=>i.rotation||0}deg); display: inline-block; transition-duration: 0.3s; transition-timing-function: ease-in; `;var zg=Ko.span` display: flex; align-items: center; justify-content: center; padding-left: 10px; `;var Ag=Ko.div` ${no} `;var _s=({children:i,className:t,caret:e,isActive:o,style:r,withBackground:n,hidden:a})=>{if(a){return Yo.createElement(Ag,null,i)}const l=()=>Yo.createElement(zg,null,Yo.createElement(Pg,{"aria-hidden":true,rotation:o?180:0,withBackground:n}));return Yo.createElement(Eg,{className:t,withBackground:n,style:r},Yo.createElement(Dg,{"data-test":S.CardLabel,withBackground:n},i,e&&l()))};import Lg from"styled-components";var $s=Lg.div.attrs(i=>({"data-test":S.CardAvatar,style:{backgroundImage:`url(${i.url})`}}))` position: absolute; top: 4px; left: 4px; height: 28px; width: 28px; border-radius: 50%; `;import{keyframes as Bg}from"styled-components";var Vc=Bg` 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } `;import{keyframes as Og}from"styled-components";var Wr=Og` 0% { opacity: 0; transform: scale(0.9) translateY(-20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } `;import Ti from"react";var Ht=[];var Uc=function(){return Ht.some(function(i){return i.activeTargets.length>0})};var Gc=function(){return Ht.some(function(i){return i.skippedTargets.length>0})};var jc="ResizeObserver loop completed with undelivered notifications.";var Xc=function(){var i;if(typeof ErrorEvent==="function"){i=new ErrorEvent("error",{message:jc})}else{i=document.createEvent("Event");i.initEvent("error",false,false);i.message=jc}window.dispatchEvent(i)};var Si;(function(i){i["BORDER_BOX"]="border-box";i["CONTENT_BOX"]="content-box";i["DEVICE_PIXEL_CONTENT_BOX"]="device-pixel-content-box"})(Si||(Si={}));var Ws=function(){function i(t,e,o,r){this.x=t;this.y=e;this.width=o;this.height=r;this.top=this.y;this.left=this.x;this.bottom=this.top+this.height;this.right=this.left+this.width;return Object.freeze(this)}i.prototype.toJSON=function(){var t=this,e=t.x,o=t.y,r=t.top,n=t.right,a=t.bottom,l=t.left,c=t.width,d=t.height;return{x:e,y:o,top:r,right:n,bottom:a,left:l,width:c,height:d}};i.fromRect=function(t){return new i(t.x,t.y,t.width,t.height)};return i}();var qo=function(i){return i instanceof SVGElement&&"getBBox"in i};var Nr=function(i){if(qo(i)){var t=i.getBBox(),e=t.width,o=t.height;return!e&&!o}var r=i,n=r.offsetWidth,a=r.offsetHeight;return!(n||a||i.getClientRects().length)};var Ns=function(i){var t,e;var o=(e=(t=i)===null||t===void 0?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(o&&i instanceof o.Element)};var Yc=function(i){switch(i.tagName){case"INPUT":if(i.type!=="image"){break}case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return true}return false};var wi=typeof window!=="undefined"?window:{};var Vr=new WeakMap;var Kc=/auto|scroll/;var Fg=/^tb|vertical/;var Rg=/msie|trident/i.test(wi.navigator&&wi.navigator.userAgent);var ne=function(i){return parseFloat(i||"0")};var co=function(i,t,e){if(i===void 0){i=0}if(t===void 0){t=0}if(e===void 0){e=false}return Object.freeze({inlineSize:(e?t:i)||0,blockSize:(e?i:t)||0})};var qc=Object.freeze({devicePixelContentBoxSize:co(),borderBoxSize:co(),contentBoxSize:co(),contentRect:new Ws(0,0,0,0)});var Vs=function(i,t){if(t===void 0){t=false}if(Vr.has(i)&&!t){return Vr.get(i)}if(Nr(i)){Vr.set(i,qc);return qc}var e=getComputedStyle(i);var o=qo(i)&&i.ownerSVGElement&&i.getBBox();var r=!Rg&&e.boxSizing==="border-box";var n=Fg.test(e.writingMode||"");var a=!o&&Kc.test(e.overflowY||"");var l=!o&&Kc.test(e.overflowX||"");var c=o?0:ne(e.paddingTop);var d=o?0:ne(e.paddingRight);var u=o?0:ne(e.paddingBottom);var m=o?0:ne(e.paddingLeft);var f=o?0:ne(e.borderTopWidth);var b=o?0:ne(e.borderRightWidth);var y=o?0:ne(e.borderBottomWidth);var v=o?0:ne(e.borderLeftWidth);var x=m+d;var C=c+u;var D=v+b;var A=f+y;var B=!l?0:i.offsetHeight-A-i.clientHeight;var O=!a?0:i.offsetWidth-D-i.clientWidth;var P=r?x+D:0;var V=r?C+A:0;var U=o?o.width:ne(e.width)-P-O;var st=o?o.height:ne(e.height)-V-B;var Fe=U+x+O+D;var gi=st+C+B+A;var bi=Object.freeze({devicePixelContentBoxSize:co(Math.round(U*devicePixelRatio),Math.round(st*devicePixelRatio),n),borderBoxSize:co(Fe,gi,n),contentBoxSize:co(U,st,n),contentRect:new Ws(m,c,U,st)});Vr.set(i,bi);return bi};var Ur=function(i,t,e){var o=Vs(i,e),r=o.borderBoxSize,n=o.contentBoxSize,a=o.devicePixelContentBoxSize;switch(t){case Si.DEVICE_PIXEL_CONTENT_BOX:return a;case Si.BORDER_BOX:return r;default:return n}};var Us=function(){function i(t){var e=Vs(t);this.target=t;this.contentRect=e.contentRect;this.borderBoxSize=[e.borderBoxSize];this.contentBoxSize=[e.contentBoxSize];this.devicePixelContentBoxSize=[e.devicePixelContentBoxSize]}return i}();var Gr=function(i){if(Nr(i)){return Infinity}var t=0;var e=i.parentNode;while(e){t+=1;e=e.parentNode}return t};var Jc=function(){var i=Infinity;var t=[];Ht.forEach(function n(a){if(a.activeTargets.length===0){return}var l=[];a.activeTargets.forEach(function c(d){var u=new Us(d.target);var m=Gr(d.target);l.push(u);d.lastReportedSize=Ur(d.target,d.observedBox);if(m<i){i=m}});t.push(function c(){a.callback.call(a.observer,l,a.observer)});a.activeTargets.splice(0,a.activeTargets.length)});for(var e=0,o=t;e<o.length;e++){var r=o[e];r()}return i};var Gs=function(i){Ht.forEach(function t(e){e.activeTargets.splice(0,e.activeTargets.length);e.skippedTargets.splice(0,e.skippedTargets.length);e.observationTargets.forEach(function o(r){if(r.isActive()){if(Gr(r.target)>i){e.activeTargets.push(r)}else{e.skippedTargets.push(r)}}})})};var Zc=function(){var i=0;Gs(i);while(Uc()){i=Jc();Gs(i)}if(Gc()){Xc()}return i>0};var js;var Qc=[];var Hg=function(){return Qc.splice(0).forEach(function(i){return i()})};var td=function(i){if(!js){var t=0;var e=document.createTextNode("");var o={characterData:true};new MutationObserver(function(){return Hg()}).observe(e,o);js=function(){e.textContent=""+(t?t--:t++)}}Qc.push(i);js()};var ed=function(i){td(function t(){requestAnimationFrame(i)})};var jr=0;var _g=function(){return!!jr};var $g=250;var Wg={attributes:true,characterData:true,childList:true,subtree:true};var id=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"];var od=function(i){if(i===void 0){i=0}return Date.now()+i};var Xs=false;var Ng=function(){function i(){var t=this;this.stopped=true;this.listener=function(){return t.schedule()}}i.prototype.run=function(t){var e=this;if(t===void 0){t=$g}if(Xs){return}Xs=true;var o=od(t);ed(function(){var r=false;try{r=Zc()}finally{Xs=false;t=o-od();if(!_g()){return}if(r){e.run(1e3)}else if(t>0){e.run(t)}else{e.start()}}})};i.prototype.schedule=function(){this.stop();this.run()};i.prototype.observe=function(){var t=this;var e=function(){return t.observer&&t.observer.observe(document.body,Wg)};document.body?e():wi.addEventListener("DOMContentLoaded",e)};i.prototype.start=function(){var t=this;if(this.stopped){this.stopped=false;this.observer=new MutationObserver(this.listener);this.observe();id.forEach(function(e){return wi.addEventListener(e,t.listener,true)})}};i.prototype.stop=function(){var t=this;if(!this.stopped){this.observer&&this.observer.disconnect();id.forEach(function(e){return wi.removeEventListener(e,t.listener,true)});this.stopped=true}};return i}();var Xr=new Ng;var Ys=function(i){!jr&&i>0&&Xr.start();jr+=i;!jr&&Xr.stop()};var Vg=function(i){return!qo(i)&&!Yc(i)&&getComputedStyle(i).display==="inline"};var rd=function(){function i(t,e){this.target=t;this.observedBox=e||Si.CONTENT_BOX;this.lastReportedSize={inlineSize:0,blockSize:0}}i.prototype.isActive=function(){var t=Ur(this.target,this.observedBox,true);if(Vg(this.target)){this.lastReportedSize=t}if(this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize){return true}return false};return i}();var nd=function(){function i(t,e){this.activeTargets=[];this.skippedTargets=[];this.observationTargets=[];this.observer=t;this.callback=e}return i}();var Yr=new WeakMap;var sd=function(i,t){for(var e=0;e<i.length;e+=1){if(i[e].target===t){return e}}return-1};var Jo=function(){function i(){}i.connect=function(t,e){var o=new nd(t,e);Yr.set(t,o)};i.observe=function(t,e,o){var r=Yr.get(t);var n=r.observationTargets.length===0;if(sd(r.observationTargets,e)<0){n&&Ht.push(r);r.observationTargets.push(new rd(e,o&&o.box));Ys(1);Xr.schedule()}};i.unobserve=function(t,e){var o=Yr.get(t);var r=sd(o.observationTargets,e);var n=o.observationTargets.length===1;if(r>=0){n&&Ht.splice(Ht.indexOf(o),1);o.observationTargets.splice(r,1);Ys(-1)}};i.disconnect=function(t){var e=this;var o=Yr.get(t);o.observationTargets.slice().forEach(function(r){return e.unobserve(t,r.target)});o.activeTargets.splice(0,o.activeTargets.length)};return i}();var ki=function(){function i(t){if(arguments.length===0){throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.")}if(typeof t!=="function"){throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.")}Jo.connect(this,t)}i.prototype.observe=function(t,e){if(arguments.length===0){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.")}if(!Ns(t)){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element")}Jo.observe(this,t,e)};i.prototype.unobserve=function(t){if(arguments.length===0){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.")}if(!Ns(t)){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element")}Jo.unobserve(this,t)};i.prototype.disconnect=function(){Jo.disconnect(this)};i.toString=function(){return"function ResizeObserver () { [polyfill code] }"};return i}();var dd=Rt(po());import ab from"styled-components";var lb=ab.div` position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; background: ${i=>i.theme.background}; color: ${i=>i.theme.foreground}; display: flex; flex-direction: row; overflow: hidden; -webkit-touch-callout: none; user-select: none; * { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-family: '${i=>i.theme.typography.fontFamily}', sans-serif; /* css reset for a global box-sizing: border-box */ box-sizing: content-box; scrollbar-width: thin; scrollbar-color: ${i=>i.theme.scrollbar.handleColor} transparent; &::-webkit-scrollbar-track { border-radius: 10px; background-color: transparent; margin: 1px; } &::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; } &::-webkit-scrollbar-thumb { border-radius: 10px; box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.4); background-color: ${i=>i.theme.scrollbar.handleColor}; } &::-webkit-scrollbar-thumb:hover { background-color: ${i=>i.theme.scrollbar.handleColor}; } } /* This will be applied first in some cases and should be treated as such */ h1, h2, h3, input, textarea, label, span, div, p { line-height: normal; } `;var Js=class extends Ti.Component{constructor(t){super(t);this.node=Ti.createRef();this.mounted=false;this.saveEditorDimensions=t=>{if(this.mounted){this.setState({contextValue:{element:t,rect:t.getBoundingClientRect()}})}};var e;if((e=Ti)==null?void 0:e.version){const o=Number.parseInt(Ti.version.split(".")[0],10);const r=Number.parseInt(Ti.version.split(".")[1],10);if(o<16||o===16&&r<8)console.error("Please be aware that the PhotoEditorSDK will require React 16.8.6 or above.")}this.saveEditorDimensions=(0,dd.default)(this.saveEditorDimensions,100);this.resizeObserver=new ki(([o])=>{this.saveEditorDimensions(o.target)});this.state={contextValue:{element:null,rect:null}}}componentDidMount(){var t;this.mounted=true;if((t=this.node)==null?void 0:t.current){this.resizeObserver.observe(this.node.current)}}componentWillUnmount(){this.mounted=false;this.resizeObserver.disconnect()}render(){const{children:t}=this.props;const{contextValue:e}=this.state;return Ti.createElement(lb,{ref:this.node,"data-test":S.EditorContainer},Ti.createElement(et.Provider,{value:e},t))}};import sn from"react";import Ii,{PureComponent as Eb,Component as ca,forwardRef as sa,memo as Sd,createElement as Pb}from"react";import{useState as cb}from"react";if(!cb){throw new Error("mobx-react-lite requires React with Hooks support")}if(!Ql){throw new Error("mobx-react-lite requires mobx at least version 4 to be available")}import{unstable_batchedUpdates as pd}from"react-dom";import{useCallback as pb,useEffect as S4,useState as hb}from"react";var db=function(i,t){var e=typeof Symbol==="function"&&i[Symbol.iterator];if(!e)return i;var o=e.call(i),r,n=[],a;try{while((t===void 0||t-- >0)&&!(r=o.next()).done)n.push(r.value)}catch(l){a={error:l}}finally{try{if(r&&!r.done&&(e=o["return"]))e.call(o)}finally{if(a)throw a.error}}return n};function Zs(){var i=db(hb(0),2),t=i[1];var e=pb(function(){t(function(o){return o+1})},[]);return e}function hd(i){if(typeof Symbol==="function"){return Symbol.for(i)}return"__$mobx-react "+i+"__"}var ub={};function ud(){if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}if(typeof self!=="undefined"){return self}return ub}var mb=hd("observerBatching");function fb(i){i()}function Kr(i){if(!i){i=fb;if(false){console.warn("[MobX] Failed to get unstable_batched updates from react-dom / react-native")}}tc({reactionScheduler:i});ud()[mb]=true}var gb=false;function se(){return gb}import{forwardRef as Sb,memo as xd}from"react";import ia from"react";function md(i){return ec(i)}function fd(i){var t={cleanAt:Date.now()+bb,reaction:i};return t}var bb=1e4;var yb=1e4;var Zo=new Set;var Qs;function gd(){if(Qs===void 0){Qs=setTimeout(vb,yb)}}function bd(i){Zo.add(i);gd()}function yd(i){Zo.delete(i)}function vb(){Qs=void 0;var i=Date.now();Zo.forEach(function(t){var e=t.current;if(e){if(i>=e.cleanAt){e.reaction.dispose();t.current=null;Zo.delete(t)}}});if(Zo.size>0){gd()}}import xb from"react";var qr=false;var Jr=[];function ta(i){return function(){if(qr){Jr.push(i)}else{i()}}}function ea(i){qr=true;Jr=[];try{var t=i();qr=false;var e=Jr.length>0?Jr:void 0;xb.useLayoutEffect(function(){if(e){e.forEach(function(o){return o()})}},[e]);return t}finally{qr=false}}var Cb={};function vd(i){return"observer"+i}function ho(i,t,e){if(t===void 0){t="observed"}if(e===void 0){e=Cb}if(se()){return i()}var o=e.useForceUpdate||Zs;var r=o();var n=ta(r);var a=ia.useRef(null);if(!a.current){var l=new Wo(vd(t),function(){if(c.mounted){n()}else{l.dispose();a.current=null}});var c=fd(l);a.current=c;bd(a)}var d=a.current.reaction;ia.useDebugValue(d,md);ia.useEffect(function(){yd(a);if(a.current){a.current.mounted=true}else{a.current={reaction:new Wo(vd(t),function(){n()}),cleanAt:Infinity};n()}return function(){a.current.reaction.dispose();a.current=null}},[]);return ea(function(){var u;var m;d.track(function(){try{u=i()}catch(f){m=f}});if(m){throw m}return u})}var oa=function(){oa=Object.assign||function(i){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))i[r]=t[r]}return i};return oa.apply(this,arguments)};function ra(i,t){if(se()){return i}var e=oa({forwardRef:false},t);var o=i.displayName||i.name;var r=function(a,l){return ho(function(){return i(a,l)},o)};r.displayName=o;var n;if(e.forwardRef){n=xd(Sb(r))}else{n=xd(r)}kb(i,n);n.displayName=o;return n}var wb={$$typeof:true,render:true,compare:true,type:true};function kb(i,t){Object.keys(i).forEach(function(e){if(!wb[e]){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}})}function uo(i){var t=i.children,e=i.render;var o=t||e;if(typeof o!=="function"){return null}return ho(o)}uo.propTypes={children:Cd,render:Cd};uo.displayName="Observer";function Cd(i,t,e,o,r){var n=t==="children"?"render":"children";var a=typeof i[t]==="function";var l=typeof i[n]==="function";if(a&&l){return new Error("MobX Observer: Do not use children and render in the same time in`"+e)}if(a||l){return null}return new Error("Invalid prop `"+r+"` of type `"+typeof i[t]+"` supplied to `"+e+"`, expected `function`.")}import K4 from"react";import ik from"react";Kr(pd);var wd=0;function zb(i){if(typeof Symbol==="function"){return Symbol(i)}var t="__$mobx-react "+i+" ("+wd+")";wd++;return t}var na={};function Re(i){if(!na[i]){na[i]=zb(i)}return na[i]}function Bd(i,t){if(kd(i,t))return true;if(typeof i!=="object"||i===null||typeof t!=="object"||t===null){return false}var e=Object.keys(i);var o=Object.keys(t);if(e.length!==o.length)return false;for(var r=0;r<e.length;r++){if(!Object.hasOwnProperty.call(t,e[r])||!kd(i[e[r]],t[e[r]])){return false}}return true}function kd(i,t){if(i===t){return i!==0||1/i===1/t}else{return i!==i&&t!==t}}var Ab={$$typeof:1,render:1,compare:1,type:1,childContextTypes:1,contextType:1,contextTypes:1,defaultProps:1,getDefaultProps:1,getDerivedStateFromError:1,getDerivedStateFromProps:1,mixins:1,propTypes:1};function Lb(i,t){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(i));Object.getOwnPropertyNames(i).forEach(function(o){if(!Ab[o]&&e.indexOf(o)===-1){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(i,o))}})}function xe(i,t,e){if(!Object.hasOwnProperty.call(i,t)){Object.defineProperty(i,t,{enumerable:false,configurable:true,writable:true,value:e})}else{i[t]=e}}var Td=Re("patchMixins");var Od=Re("patchedDefinition");function Bb(i,t){var e=i[Td]=i[Td]||{};var o=e[t]=e[t]||{};o.locks=o.locks||0;o.methods=o.methods||[];return o}function Id(i,t){var e=this;for(var o=arguments.length,r=new Array(o>2?o-2:0),n=2;n<o;n++){r[n-2]=arguments[n]}t.locks++;try{var a;if(i!==void 0&&i!==null){a=i.apply(this,r)}return a}finally{t.locks--;if(t.locks===0){t.methods.forEach(function(l){l.apply(e,r)})}}}function Md(i,t){var e=function o(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++){n[a]=arguments[a]}Id.call.apply(Id,[this,i,t].concat(n))};return e}function Ob(i,t,e){var o=Bb(i,t);if(o.methods.indexOf(e)<0){o.methods.push(e)}var r=Object.getOwnPropertyDescriptor(i,t);if(r&&r[Od]){return}var n=i[t];var a=Fd(i,t,r?r.enumerable:void 0,o,n);Object.defineProperty(i,t,a)}function Fd(i,t,e,o,r){var n;var a=Md(r,o);return n={},n[Od]=true,n.get=function l(){return a},n.set=function l(c){if(this===i){a=Md(c,o)}else{var d=Fd(this,t,e,o,c);Object.defineProperty(this,t,d)}},n.configurable=true,n.enumerable=e,n}var aa=ic||"$mobx";var Dd=Re("isMobXReactObserver");var Rd=Re("isUnmounted");var Qr=Re("skipRender");var Zr=Re("isForcingUpdate");function Fb(i){var t=i.prototype;if(i[Dd]){var e=la(t);console.warn("The provided component class ("+e+") \n has already been declared as an observer component.")}else{i[Dd]=true}if(t.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(i["__proto__"]!==Eb){if(!t.shouldComponentUpdate)t.shouldComponentUpdate=Ed;else if(t.shouldComponentUpdate!==Ed)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}Pd(t,"props");Pd(t,"state");var o=t.render;t.render=function(){return Rb.call(this,o)};Ob(t,"componentWillUnmount",function(){var r;if(se()===true)return;(r=this.render[aa])===null||r===void 0?void 0:r.dispose();this[Rd]=true;if(!this.render[aa]){var n=la(this);console.warn("The reactive render of an observer class component ("+n+") \n was overriden after MobX attached. This may result in a memory leak if the \n overriden reactive render was not properly disposed.")}});return i}function la(i){return i.displayName||i.name||i.constructor&&(i.constructor.displayName||i.constructor.name)||"<component>"}function Rb(i){var t=this;if(se()===true)return i.call(this);xe(this,Qr,false);xe(this,Zr,false);var e=la(this);var o=i.bind(this);var r=false;var n=new Wo(e+".render()",function(){if(!r){r=true;if(t[Rd]!==true){var l=true;try{xe(t,Zr,true);if(!t[Qr])ca.prototype.forceUpdate.call(t);l=false}finally{xe(t,Zr,false);if(l)n.dispose()}}}});n["reactComponent"]=this;a[aa]=n;this.render=a;function a(){r=false;var l=void 0;var c=void 0;n.track(function(){try{c=Zl(false,o)}catch(d){l=d}});if(l){throw l}return c}return a.call(this)}function Ed(i,t){if(se()){console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side.")}if(this.state!==t){return true}return!Bd(this.props,i)}function Pd(i,t){var e=Re("reactProp_"+t+"_valueHolder");var o=Re("reactProp_"+t+"_atomHolder");function r(){if(!this[o]){xe(this,o,Jl("reactive "+t))}return this[o]}Object.defineProperty(i,t,{configurable:true,enumerable:true,get:function n(){var a=false;if(Br&&Or){a=Br(true)}r.call(this).reportObserved();if(Br&&Or){Or(a)}return this[e]},set:function n(a){if(!this[Zr]&&!Bd(this[e],a)){xe(this,e,a);xe(this,Qr,true);r.call(this).reportChanged();xe(this,Qr,false)}else{xe(this,e,a)}}})}var Hd=typeof Symbol==="function"&&Symbol.for;var zd=Hd?Symbol.for("react.forward_ref"):typeof sa==="function"&&sa(function(i){return null})["$$typeof"];var Ad=Hd?Symbol.for("react.memo"):typeof Sd==="function"&&Sd(function(i){return null})["$$typeof"];function E(i){if(i["isMobxInjector"]===true){console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'")}if(Ad&&i["$$typeof"]===Ad){throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.")}if(zd&&i["$$typeof"]===zd){var t=i["render"];if(typeof t!=="function")throw new Error("render property of ForwardRef was not a function");return sa(function e(){var o=arguments;return Pb(uo,null,function(){return t.apply(void 0,o)})})}if(typeof i==="function"&&(!i.prototype||!i.prototype.render)&&!i["isReactClass"]&&!Object.prototype.isPrototypeOf.call(ca,i)){return ra(i)}return Fb(i)}function tn(){tn=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e){if(Object.prototype.hasOwnProperty.call(e,o)){i[o]=e[o]}}}return i};return tn.apply(this,arguments)}function Hb(i,t){if(i==null)return{};var e={};var o=Object.keys(i);var r,n;for(n=0;n<o.length;n++){r=o[n];if(t.indexOf(r)>=0)continue;e[r]=i[r]}return e}var Qo=Ii.createContext({});function _b(i){var t=i.children,e=Hb(i,["children"]);var o=Ii.useContext(Qo);var r=Ii.useRef(tn({},o,e));var n=r.current;if(false){var a=tn({},n,e);if(!Bd(n,a)){throw new Error("MobX Provider: The set of provided stores has changed. See: https://github.com/mobxjs/mobx-react#the-set-of-provided-stores-has-changed-error.")}}return Ii.createElement(Qo.Provider,{value:n},t)}_b.displayName="MobXProvider";function Ld(i,t,e,o){var r=Ii.forwardRef(function(n,a){var l=tn({},n);var c=Ii.useContext(Qo);Object.assign(l,i(c||{},l)||{});if(a){l.ref=a}return Ii.createElement(t,l)});if(o)r=E(r);r["isMobxInjector"]=true;Lb(t,r);r["wrappedComponent"]=t;r.displayName=$b(t,e);return r}function $b(i,t){var e;var o=i.displayName||i.name||i.constructor&&i.constructor.name||"Component";if(t)e="inject-with-"+t+"("+o+")";else e="inject("+o+")";return e}function Wb(i){return function(t,e){i.forEach(function(o){if(o in e)return;if(!(o in t))throw new Error("MobX injector: Store '"+o+"' is not available! Make sure it is provided by some Provider");e[o]=t[o]});return e}}function F(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++){t[e]=arguments[e]}if(typeof arguments[0]==="function"){var o=arguments[0];return function(r){return Ld(o,r,o.name,true)}}else{return function(r){return Ld(Wb(t),r,t.join("-"),false)}}}if(!ca)throw new Error("mobx-react requires React to be available");if(!T)throw new Error("mobx-react requires mobx to be available");import mo from"react";import _d,{css as Gb}from"styled-components";import Nb,{css as Vb}from"styled-components";var tr=Vb` position: absolute; top: 0; left: 0; height: ${i=>i.theme.measurements.colorItem.size}px; width: ${i=>i.theme.measurements.colorItem.size}px; border-radius: ${i=>i.theme.colorItem.borderRadius||`${i.theme.shape.radiusSmall}px`}; pointer-events: none; `;var Ub=Nb.div.attrs(i=>({style:{background:i.color}}))` ${tr} z-index: ${i=>i.theme.measurements.zIndex.colorItem.background}; `;var en=Ub;var jb=_d.div` ${tr} display: flex; justify-content: center; align-items: center; z-index: ${i=>i.theme.measurements.zIndex.colorItem.overlay}; box-sizing: border-box; border: 2px solid transparent; border-radius: ${i=>i.theme.colorItem.borderRadius||`${i.theme.shape.radiusSmall}px`}; transition: border-color 300ms ease-in-out; ${i=>i.isActive&&Gb` border-color: ${i.theme.selectColor.activeBorderColor}; `} `;var da=_d.span` display: inline-block; height: 2px; width: 2px; border-radius: 50%; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.6); background: rgba(255, 255, 255, 0.87); margin: 1px; pointer-events: none; `;var Xb=({isActive:i,className:t,style:e})=>{return mo.createElement(jb,{isActive:i,className:t,style:e},i&&mo.createElement(mo.Fragment,null,mo.createElement(da,null),mo.createElement(da,null),mo.createElement(da,null)))};var on=Xb;import Yb from"styled-components";var Kb=Yb.button.attrs({type:"button"})` &&& { box-sizing: border-box; } position: relative; background: transparent; border: none; height: ${i=>i.theme.measurements.colorItem.size}px; width: ${i=>i.theme.measurements.colorItem.size}px; margin: ${i=>i.theme.colorItem.margin}; padding: 0; cursor: pointer; border-radius: ${i=>i.theme.colorItem.borderRadius||`${i.theme.shape.radiusSmall}px`}; &:hover { opacity: 0.7; } ${mt} &:disabled { opacity: ${i=>i.theme.selectColor.inactiveOpacity}; cursor: default; } `;var rn=Kb;import qb from"styled-components";var Jb=qb.div.attrs(i=>{const t=i.url?{backgroundImage:`url(${i.url})`}:{};return{style:t,...i.style}})` ${tr} z-index: ${i=>i.theme.measurements.zIndex.colorItem.tiledBackground}; `;var nn=Jb;var Zb=({isActive:i,onClick:t,color:e,label:o,isDisabled:r,tiledBackgroundUrl:n,className:a,style:l,children:c})=>{return sn.createElement(rn,{disabled:r,onClick:t,"aria-label":o,className:a,style:l},sn.createElement(nn,{url:n}),sn.createElement(en,{color:e}),sn.createElement(on,{isActive:i}),c)};var $d=F("config")(E(Zb));import pa from"react";import Qb from"styled-components";var t0=Qb.div` display: block; opacity: 1; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: ${i=>i.theme.measurements.zIndex.dialog.backdrop}; text-align: left; background: ${i=>i.theme.modal.backdrop}; height: 100%; width: 100%; `;var an=t0;import e0 from"react";import i0,{css as o0}from"styled-components";var r0=i0.div` display: none; visibility: hidden; opacity: 0; position: absolute; width: 100%; height: 100%; z-index: ${i=>i.theme.measurements.zIndex.dialog.base}; transition: opacity 100s ease-in-out; ${i=>i.isVisible&&o0` opacity: 1; display: block; visibility: visible; `}; `;var ln=({isVisible:i,className:t,children:e})=>{return e0.createElement(r0,{isVisible:i,className:t},e)};import n0 from"styled-components";var s0=n0.div.attrs(({style:i})=>({role:"dialog","aria-hidden":false,style:i}))` display: flex; flex: 0 0 auto; flex-direction: column; transition: top 0.25s ease; position: absolute; top: calc(50% + ${i=>i.top}px); left: calc(50% + ${i=>i.left}px); width: ${i=>i.width}; height: ${i=>i.height}; transform: translate(-50%, -50%); border-radius: ${i=>i.theme.shape.radiusLarge}px; background: ${i=>i.theme.modal.background}; color: ${i=>i.theme.modal.bodyForeground}; z-index: ${i=>i.theme.measurements.zIndex.dialog.container}; @media all and (min-width: 0) and (max-width: 640px) { text-align: center; width: auto; min-width: 200px; height: auto; top: 50%; left: 50%; } `;var cn=s0;var a0=({isVisible:i=false,width:t="350px",height:e="fit-content",position:o,header:r,body:n,footer:a,className:l,style:c,children:d})=>pa.createElement(ln,{isVisible:i},pa.createElement(an,null),pa.createElement(cn,{height:e,width:t,left:o.x,top:o.y,className:l,style:c,"data-test":S.Dialog},r,n,d,a));var Wd=a0;import l0 from"styled-components";var c0=l0.div` display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; font-size: ${i=>i.theme.measurements.fontSystem.body.size}px; letter-spacing: ${i=>i.theme.measurements.fontSystem.body.letterSpacing}px; text-transform: ${i=>i.theme.measurements.fontSystem.body.case}; color: ${i=>i.theme.modal.bodyForeground}; padding: 0px 20px 11px; &:first-child { padding-top: 11px; } @media all and (min-width: 0) and (max-width: 640px) { align-items: center; } `;var Ce=c0;import d0 from"styled-components";var p0=d0.div` display: flex; border-top: 2px solid ${i=>i.type==="error"?i.theme.error:i.theme.warning}; min-height: 40px; justify-content: flex-end; @media all and (min-width: 0) and (max-width: 640px) { height: auto; flex-direction: column; justify-content: space-around; } `;var fo=p0;import h0 from"styled-components";var u0=h0.h3` font-size: ${i=>i.theme.measurements.fontSystem.headline2.size}px; letter-spacing: ${i=>i.theme.measurements.fontSystem.headline2.letterSpacing}px; text-transform: ${i=>i.theme.measurements.fontSystem.headline2.case}; color: ${i=>i.theme.modal.headerForeground}; padding: 11px 20px 0px; `;var go=u0;import er from"react";import Nd,{keyframes as m0}from"styled-components";var f0=m0` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `;var g0=Nd.div` display: inline-block; position: relative; width: 45px; height: 45px; `;var dn=Nd.div` box-sizing: border-box; display: block; position: absolute; width: 40px; height: 40px; margin: 2.5px; border: 2.5px solid ${i=>i.theme.primary}; border-radius: 50%; animation: ${f0} 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; border-color: ${i=>i.theme.primary} transparent transparent transparent; :nth-child(1) { animation-delay: -0.45s; } :nth-child(2) { animation-delay: -0.3s; } :nth-child(3) { animation-delay: -0.15s; } `;var b0=({className:i,style:t})=>{return er.createElement(g0,{className:i,style:t},er.createElement(dn,null),er.createElement(dn,null),er.createElement(dn,null),er.createElement(dn,null))};var pn=b0;import yn from"react";import ba from"react";var ha=["Moz","Webkit","O","ms"];function y0(i){let t="";let e=true;let o;for(o=0;o<i.length;o+=1){if(e){t+=i[o].toUpperCase();e=false}else if(i[o]==="-"){e=true}else{t+=i[o]}}return t}function ua(i,t){return t?`${t}${y0(i)}`:i}function v0(i="transform"){if(typeof window==="undefined"||typeof window.document==="undefined"){return""}const{style:t}=window.document.documentElement;if(i in t){return""}let e;for(e=0;e<ha.length;e+=1){if(ua(i,ha[e])in t){return ha[e]}}return""}var Vd=v0();function hn(i,t){for(let e=0,{length:o}=i;e<o;e+=1){if(t.apply(t,[i[e],e,i])){return i[e]}}return null}function ma(i){return typeof i==="function"||Object.prototype.toString.call(i)==="[object Function]"}function bo(i){return typeof i==="number"&&!Number.isNaN(i)}function ft(i){return parseInt(i,10)}var un="";function x0(i,t){if(!un){un=hn(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],e=>{return ma(i[e])})}if(!ma(i[un])){return false}return i[un](t)}function fa(i,t,e){let o=i;do{if(x0(o,t)){return true}if(o===e){return false}o=o.parentNode}while(o);return false}function mn(i,t,e){if(!i){return}if(i.attachEvent){i.attachEvent(`on${t}`,e)}else if(i.addEventListener){i.addEventListener(t,e,true)}else{i[`on${t}`]=e}}function He(i,t,e){if(!i){return}if(i.detachEvent){i.detachEvent(`on${t}`,e)}else if(i.removeEventListener){i.removeEventListener(t,e,true)}else{i[`on${t}`]=null}}function Ud(i){let t=i.clientHeight;const e=i.ownerDocument.defaultView.getComputedStyle(i);t+=ft(e.borderTopWidth);t+=ft(e.borderBottomWidth);return t}function Gd(i){let t=i.clientWidth;const e=i.ownerDocument.defaultView.getComputedStyle(i);t+=ft(e.borderLeftWidth);t+=ft(e.borderRightWidth);return t}function jd(i){let t=i.clientHeight;const e=i.ownerDocument.defaultView.getComputedStyle(i);t-=ft(e.paddingTop);t-=ft(e.paddingBottom);return t}function Xd(i){let t=i.clientWidth;const e=i.ownerDocument.defaultView.getComputedStyle(i);t-=ft(e.paddingLeft);t-=ft(e.paddingRight);return t}function Yd(i,t){const e=t===t.ownerDocument.body;const o=e?{left:0,top:0}:t.getBoundingClientRect();const r=i.clientX+t.scrollLeft-o.left;const n=i.clientY+t.scrollTop-o.top;return{x:r,y:n}}function Kd({x:i,y:t,rotation:e}){const o=`translate(${i}px,${t}px) rotate(${e}rad)`;return{[ua("transform",Vd)]:o}}function qd(i,t){let e=null;if(i.targetTouches){e=hn(i.targetTouches,o=>t===o.identifier)}if(i.changedTouches&&!e){e=hn(i.changedTouches,o=>t===o.identifier)}return e}function Jd(i){if(i.targetTouches&&i.targetTouches[0]){return i.targetTouches[0].identifier}if(i.changedTouches&&i.changedTouches[0]){return i.changedTouches[0].identifier}return null}function ga(i){const t=i.findDOMNode();if(!t){return null}return t}function C0(i){return{left:i.left,top:i.top,right:i.right,bottom:i.bottom}}function Zd(i,t,e){if(!i.props.bounds)return[t,e];let{bounds:o}=i.props;o=typeof o==="string"?o:C0(o);const r=ga(i);if(!r)return[t,e];if(typeof o==="string"){const{ownerDocument:n}=r;const a=n.defaultView;let l;if(o==="parent"){l=r.parentNode}else{l=n.querySelector(o)}const c=a.getComputedStyle(r);const d=a.getComputedStyle(l);o={left:-r.offsetLeft+ft(d.paddingLeft)+ft(c.marginLeft),top:-r.offsetTop+ft(d.paddingTop)+ft(c.marginTop),right:Xd(l)-Gd(r)-r.offsetLeft+ft(d.paddingRight)-ft(c.marginRight),bottom:jd(l)-Ud(r)-r.offsetTop+ft(d.paddingBottom)-ft(c.marginBottom)}}if(bo(o.right))t=Math.min(t,o.right);if(bo(o.bottom))e=Math.min(e,o.bottom);if(bo(o.left))t=Math.max(t,o.left);if(bo(o.top))e=Math.max(e,o.top);return[t,e]}function fn(i,t,e){const{state:o}=i;const r=!bo(o.lastX);const n=ga(i);if(r){return{node:n,deltaX:0,deltaY:0,lastX:t,lastY:e,x:t,y:e}}return{node:n,deltaX:t-o.lastX,deltaY:e-o.lastY,lastX:o.lastX,lastY:o.lastY,x:t,y:e}}function gn(i,t){return{node:t.node,x:i.state.x+t.deltaX,y:i.state.y+t.deltaY,deltaX:t.deltaX,deltaY:t.deltaY,lastX:i.state.x,lastY:i.state.y}}function Qd(i){return i.props.axis==="both"||i.props.axis==="x"}function tp(i){return i.props.axis==="both"||i.props.axis==="y"}function bn(i,t){const e=ga(t);if(!e)return{x:0,y:0};let{offsetParent:o}=t.props;if(!o&&e instanceof HTMLElement){o=e.offsetParent||e.ownerDocument.body}return Yd(i,o)}var ae={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};var Pt=ae.mouse;var ya={cancel:null,disabled:false,offsetParent:null,handle:null,transform:null,onStart:()=>{},onDrag:()=>{},onStop:()=>{},onMouseDown:()=>{}};var Mi=class extends ba.Component{constructor(){super(...arguments);this.state={dragging:false,lastX:NaN,lastY:NaN,touchIdentifier:void 0};this.findDOMNode=()=>{const{nodeRef:t}=this.props;return(t==null?void 0:t.current)||null};this.getTouchFromEvent=t=>{const e=Jd(t);this.setState({touchIdentifier:e});return qd(t,e)};this.preventDefault=t=>{if(t.stopPropagation){t.stopPropagation()}};this.handleDragStart=t=>{const e=this.findDOMNode();if(!e||!e.ownerDocument||!e.ownerDocument.body){throw new Error("<DraggableCore> not mounted on DragStart!")}const{ownerDocument:o}=e;if(this.props.disabl