@sheetxl/studio-mui 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/B29yIlf_FSHx9q3M.cjs +7 -0
- package/browser/cjs/B783moVfFT70yQuK.cjs +7 -0
- package/browser/cjs/BCtVyhxIZSUPH_Z4.cjs +7 -0
- package/browser/cjs/BE6O6K7i1mHBC3et.cjs +7 -0
- package/browser/cjs/BQ-G2ABc3FYN-D50.cjs +7 -0
- package/browser/cjs/BabvaPi1dUIPt5AG.cjs +7 -0
- package/browser/cjs/BbvcxaJzfy7H6xfa.cjs +7 -0
- package/browser/cjs/Bhh0dqxUzzOzHWMc.cjs +7 -0
- package/browser/cjs/CH50hiw_7LBSC6dR.cjs +7 -0
- package/browser/cjs/Cfb0T6htsh82UPK-.cjs +7 -0
- package/browser/cjs/CisYglNTHGrj9oMH.cjs +7 -0
- package/browser/cjs/Clbakb5VUTDTlofM.cjs +7 -0
- package/browser/cjs/D7xmeRe-f7IifEKc.cjs +7 -0
- package/browser/cjs/DCV-6w2JGk_faE3x.cjs +7 -0
- package/browser/cjs/DY2PuDSgw0TrB5-_.cjs +7 -0
- package/browser/cjs/Df5v6knUJ4dqHmmo.cjs +7 -0
- package/browser/cjs/DyzVC_iq7ceqC2fj.cjs +7 -0
- package/browser/cjs/QB_8kWYEsfOH_HwK.cjs +7 -0
- package/browser/cjs/aOmlMJRAkQEF59EX.cjs +7 -0
- package/browser/cjs/index.cjs +10 -4
- package/browser/cjs/li-J7BWV6WUzY5aq.cjs +7 -0
- package/browser/cjs/u0WmWLGlCwhnhL9i.cjs +7 -0
- package/browser/cjs/uoBAuXnlUz8scSA1.cjs +7 -0
- package/browser/cjs/xp2ZII-PuLk9tHK3.cjs +7 -0
- package/browser/cjs/xq-CJbsvm7BQO8lK.cjs +7 -0
- package/browser/esm/12Ttun7hzbiInyVr.mjs +7 -0
- package/browser/esm/7jSMnphGrNRPUa_S.mjs +7 -0
- package/browser/esm/AnCmK-idMDJ2vI8H.mjs +7 -0
- package/browser/esm/B-Ut_yUCD9THCz0T.mjs +7 -0
- package/browser/esm/BTD5k7gtFcqDwslB.mjs +7 -0
- package/browser/esm/BVRUNnRvnt7aVCDD.mjs +7 -0
- package/browser/esm/BauTkiamxm0HDt6M.mjs +7 -0
- package/browser/esm/BcIp2mxLBfjUBE0q.mjs +7 -0
- package/browser/esm/Bi_0z0hyhFuz5Ta3.mjs +7 -0
- package/browser/esm/BkDEdK7zOlsoUKCZ.mjs +7 -0
- package/browser/esm/BpGexBYtmHbTIJz2.mjs +7 -0
- package/browser/esm/CJawFB555VEY-Vge.mjs +7 -0
- package/browser/esm/CWogLlWYHiL4W6CH.mjs +7 -0
- package/browser/esm/Cr46Bo9bGoz0LbWq.mjs +7 -0
- package/browser/esm/Csk8rXNpaXmf5g7O.mjs +7 -0
- package/browser/esm/Cu-5HDPN8B0qE77-.mjs +7 -0
- package/browser/esm/CzgR8PxJ_89IC4Mr.mjs +7 -0
- package/browser/esm/DMUXpRbV3ahdB1lN.mjs +7 -0
- package/browser/esm/DiIX5KzrWnbDWjGE.mjs +7 -0
- package/browser/esm/Djo2IS-ivmVSrO3v.mjs +7 -0
- package/browser/esm/Hy95ExHvIFgzxQb-.mjs +7 -0
- package/browser/esm/Z1_72ZY8rW2Mc3g_.mjs +7 -0
- package/browser/esm/_ZR9nT54xwy-C6ow.mjs +7 -0
- package/browser/esm/csxyptiqbJZO0pQA.mjs +7 -0
- package/browser/esm/index.mjs +8 -82
- package/licenses/dependencies.txt +145 -145
- package/node/esm/{CsbP0EYKOHobzZCu.mjs → 8THCZRGNmI2nPqMR.mjs} +2 -2
- package/node/esm/{CGiJgZJFY-YsXWCX.mjs → BDm0y2dv7wLZhYj1.mjs} +1 -1
- package/node/esm/{CijBL1IDWaxPgQ_E.mjs → BPylexVHXa-t0sqJ.mjs} +6 -6
- package/node/esm/{B7xzqWxB07TdXnmo.mjs → BQYQg7lfqFbWaf8x.mjs} +2 -2
- package/node/esm/{BUVA6vYXyFFnBCMg.mjs → BSUbQzac78SXiAJe.mjs} +1 -1
- package/node/esm/{qewbqty13W1sKrMC.mjs → BeNXnrWMr5S34Oxb.mjs} +1 -1
- package/node/esm/{BfuG4JD3t3n1uOci.mjs → C6jxZQrvMLctjLZM.mjs} +4 -4
- package/node/esm/{Dn38s6pH3QNvdk-x.mjs → CCZepFZNn1pIXrnd.mjs} +1 -1
- package/node/esm/{9iDXWtTOWeDVslQL.mjs → CXSwyUs6BuNGCic0.mjs} +13 -13
- package/node/esm/{Dq49h62ihEYk_8VR.mjs → CaV6SH-PMyHlXUhx.mjs} +1 -1
- package/node/esm/{B18g9zjzyR9YL3Mv.mjs → D481dAOp77EZbV5s.mjs} +2 -2
- package/node/esm/{DWKLdf_rn5dajRBA.mjs → DHj9iDuBImdwscIb.mjs} +25 -25
- package/node/esm/{uY021f9cZSWYX0--.mjs → DIGsHHDexzj0uG_T.mjs} +5 -5
- package/node/esm/{Cr5l_3AqPbv4mke9.mjs → DLiw-2C_tqGgJIQ6.mjs} +2 -2
- package/node/esm/{CG1T0Z1roNRSVlal.mjs → DNJVdt9TbBsUE8Jm.mjs} +1 -1
- package/node/esm/{DGTK2YeARR5cTnft.mjs → DaCmut490aSCGvX8.mjs} +1 -1
- package/node/esm/{C7t1ZHhSDgJnZ4Da.mjs → Dd2OFQJQyYp6bAeP.mjs} +1 -1
- package/node/esm/{DHmVr6jRLzt6lD1x.mjs → DkpAjhQeaZn_Ipxg.mjs} +2 -2
- package/node/esm/{DODhKM0Qeycx3Hvp.mjs → DyMCnCG9LzH5Mgw0.mjs} +2 -2
- package/node/esm/{v4fR5lIq2IqY_Clq.mjs → RV-AvxVzzFKWjYFM.mjs} +38 -38
- package/node/esm/{tur4cwLbnCn69JK-.mjs → Ui3_6RhrEZQDOXwg.mjs} +8 -8
- package/node/esm/index.mjs +5373 -5075
- package/node/esm/{CILOMzOF30-XSZqR.mjs → qI75rORek8T0-Kpf.mjs} +2 -2
- package/package.json +8 -8
- package/types/index.d.ts +24 -0
- package/browser/cjs/02LSJ7jnb-ovS7ex.cjs +0 -15
- package/browser/cjs/BDDJIe6JwgEYEtda.cjs +0 -6
- package/browser/cjs/BGh6tEDK_1MFKfMU.cjs +0 -145
- package/browser/cjs/BSRDKlVOTYHfOAF_.cjs +0 -11
- package/browser/cjs/Bn0BSzVk_S-rvDwk.cjs +0 -6
- package/browser/cjs/Bzf8jKmmZl374mof.cjs +0 -6
- package/browser/cjs/C20NTPRE5_ExESDZ.cjs +0 -6
- package/browser/cjs/C5i9hklL-WNb8J_q.cjs +0 -42
- package/browser/cjs/CLxYxjd0yz1LCTB-.cjs +0 -6
- package/browser/cjs/CUo2iW5IL6UZJNWT.cjs +0 -6
- package/browser/cjs/C_QWbWVBVc6YJ4Q3.cjs +0 -16
- package/browser/cjs/CeeZxww7wpF45vvp.cjs +0 -6
- package/browser/cjs/CekKZCV1J1HUFIqO.cjs +0 -6
- package/browser/cjs/CgD0b2zJD8zElhuz.cjs +0 -6
- package/browser/cjs/CqwEnIUDMxWw5DX1.cjs +0 -87
- package/browser/cjs/CwOKyPq_H2afJacv.cjs +0 -7
- package/browser/cjs/D32t9wiFoNX7WVEo.cjs +0 -161
- package/browser/cjs/DILF3GzsMdg-Y2wu.cjs +0 -11
- package/browser/cjs/Dr-PR7J1T91UjrPL.cjs +0 -12
- package/browser/cjs/DyR0_iZAINpjodWL.cjs +0 -12
- package/browser/cjs/LWuNxqu9MyiniH_g.cjs +0 -18
- package/browser/cjs/O8r9K4Qh6Pgd6rXU.cjs +0 -7
- package/browser/cjs/jbTHHxJODyD10jVH.cjs +0 -6
- package/browser/cjs/n-4XaX3pkXUEEQ5u.cjs +0 -6
- package/browser/cjs/qQGaIq5VhlZJU-xf.cjs +0 -6
- package/browser/esm/AmErN6xXU01K_bEs.mjs +0 -3803
- package/browser/esm/B08nVBuOXar7x7in.mjs +0 -1703
- package/browser/esm/B8xKZIF9fvamlvW5.mjs +0 -1467
- package/browser/esm/BGWd79IfMfoHoO6g.mjs +0 -392
- package/browser/esm/BT8vduOS21nsJ6EQ.mjs +0 -1366
- package/browser/esm/Bz6NqTbktTH8Df6_.mjs +0 -2251
- package/browser/esm/CDRALHzsBIsRPM5g.mjs +0 -153
- package/browser/esm/CIH1rBtL9lK5ku-N.mjs +0 -13391
- package/browser/esm/CVJee4uHPTdpZGEH.mjs +0 -46
- package/browser/esm/CXUv64T9mbQbJGgM.mjs +0 -48
- package/browser/esm/Ca5nvvpeuP6Wsv5P.mjs +0 -43
- package/browser/esm/CelDYTh0f7McDj4o.mjs +0 -44
- package/browser/esm/DHlS6l8ZPDMN2cwP.mjs +0 -1672
- package/browser/esm/DXKQ9TZdaT7ytR1S.mjs +0 -640
- package/browser/esm/D_FJwwe-bsDiDGBV.mjs +0 -2410
- package/browser/esm/DduyjhwDREaxXNzm.mjs +0 -59
- package/browser/esm/DffuCp_514AjqJLT.mjs +0 -864
- package/browser/esm/DgC_oaBYpwh1mBi_.mjs +0 -25
- package/browser/esm/Dl-SlJoaP7EFX-GR.mjs +0 -52
- package/browser/esm/DpTSO921EQ7L_abP.mjs +0 -52
- package/browser/esm/Dr5y4zmj1js9FjzE.mjs +0 -1352
- package/browser/esm/DuoEo0hJBssfAmB4.mjs +0 -84
- package/browser/esm/jIv4VNLAAFANZjhN.mjs +0 -424
- package/browser/esm/wysWhT4-jO-uukUH.mjs +0 -23
- package/browser/esm/zZaxvhjZK5N3yZkw.mjs +0 -19947
- package/node/esm/BBWRiJSBxt6O1CfK.mjs +0 -312
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import*as t from"react";import{createElement as e,forwardRef as n,useRef as r,useImperativeHandle as i,useEffect as o}from"react";function a(t,e){for(var n=t.length,r=0;r<n;++r)if(e(t[r],r))return!0;return!1}function s(t,e){for(var n=t.length,r=0;r<n;++r)if(e(t[r],r))return t[r];return null}function u(t){var e=t;if(void 0===e){if("undefined"==typeof navigator||!navigator)return"";e=navigator.userAgent||""}return e.toLowerCase()}function c(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function l(t){return t.replace(/_/g,".")}function f(t,e){var n=null,r="-1";return a(t,function(t){var i=c("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",e);return!(!i||t.brand||(n=t,r=i[3]||"-1",t.versionAlias?r=t.versionAlias:t.versionTest&&(r=function(t,e){var n=c("("+t+")((?:\\/|\\s|:)([0-9|\\.|_]+))",e);return n?n[3]:""}(t.versionTest.toLowerCase(),e)||r),r=l(r),0))}),{preset:n,version:r}}function p(t,e){var n={brand:"",version:"-1"};return a(t,function(t){var r=d(e,t);return!!r&&(n.brand=t.id,n.version=t.versionAlias||r.version,"-1"!==n.version)}),n}function d(t,e){return s(t,function(t){var n=t.brand;return c(""+e.test,n.toLowerCase())})}var h=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],g=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome",versionTest:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",versionAlias:"-1",brand:!0}],v=[{test:"applewebkit",id:"webkit",versionTest:"applewebkit|safari"}],m=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],b=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"win32|windows",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"macos|macintel|mac os x",id:"mac"},{test:"android|linux armv81",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function x(t){return!!f(m,t).preset}function y(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.map(function(e){return e.split(" ").map(function(e){return e?""+t+e:""}).join(" ")}).join(" ")}function E(t,e){return function(n){n&&(t[e]=n)}}function D(t,e,n){return function(r){r&&(t[e][n]=r)}}var w="undefined",S=typeof window!==w,M=typeof document!==w&&document,C=[{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:'\\"',close:'\\"'},{open:"\\'",close:"\\'"}],_=1e-7,T={cm:function(t){return 96*t/2.54},mm:function(t){return 96*t/254},in:function(t){return 96*t},pt:function(t){return 96*t/72},pc:function(t){return 96*t/6},"%":function(t,e){return t*e/100},vw:function(t,e){return void 0===e&&(e=window.innerWidth),t/100*e},vh:function(t,e){return void 0===e&&(e=window.innerHeight),t/100*e},vmax:function(t,e){return void 0===e&&(e=Math.max(window.innerWidth,window.innerHeight)),t/100*e},vmin:function(t,e){return void 0===e&&(e=Math.min(window.innerWidth,window.innerHeight)),t/100*e}};function O(t,e,n,r){return(t*r+e*n)/(n+r)}function P(t){return typeof t===w}function R(t){return t&&"object"==typeof t}function k(t){return Array.isArray(t)}function F(t){return"string"==typeof t}function B(t){return"number"==typeof t}function G(t){return"function"==typeof t}function A(t,e,n,r,i){return z(t,e,n)?n:function(t,e,n,r,i){for(var o,a=function(n){var a=e[n].trim();if(a===t.close&&!z(t,e,n))return{value:n};var s=n,u=q(i,function(t){return t.open===a});if(u&&(s=A(u,e,n,r,i)),-1===s)return o=n,"break";o=n=s},s=n;s<r;++s){var u=a(s);if(s=o,"object"==typeof u)return u.value;if("break"===u)break}return-1}(t,e,n+1,r,i)}function z(t,e,n){if(!t.ignore)return null;var r=e.slice(Math.max(n-3,0),n+3).join("");return new RegExp(t.ignore).exec(r)}function I(t,e){var n=F(e)?{separator:e}:e,r=n.separator,i=void 0===r?",":r,o=n.isSeparateFirst,a=n.isSeparateOnlyOpenClose,s=n.isSeparateOpenClose,u=void 0===s?a:s,c=n.openCloseCharacters,l=void 0===c?C:c,f=l.map(function(t){var e=t.open,n=t.close;return e===n?e:e+"|"+n}).join("|"),p=new RegExp("(\\s*"+i+"\\s*|"+f+"|\\s+)","g"),d=t.split(p).filter(function(t){return t&&"undefined"!==t}),h=d.length,g=[],v=[];function m(){return!!v.length&&(g.push(v.join("")),v=[],!0)}for(var b,x=function(e){var n=d[e].trim(),r=e,s=q(l,function(t){return t.open===n}),c=q(l,function(t){return t.close===n});if(s){if(-1!==(r=A(s,d,e,h,l))&&u)return m()&&o?(b=e,"break"):(g.push(d.slice(e,r+1).join("")),e=r,o?(b=e,"break"):(b=e,"continue"))}else{if(c&&!z(c,d,e)){var f=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(l);return f.splice(l.indexOf(c),1),{value:I(t,{separator:i,isSeparateFirst:o,isSeparateOnlyOpenClose:a,isSeparateOpenClose:u,openCloseCharacters:f})}}if(function(t,e){return(""===e||" "==e)&&(""===t||" "==t)||t===e}(n,i)&&!a)return m(),o?(b=e,"break"):(b=e,"continue")}-1===r&&(r=h-1),v.push(d.slice(e,r+1).join("")),b=e=r},y=0;y<h;++y){var E=x(y);if(y=b,"object"==typeof E)return E.value;if("break"===E)break}return v.length&&g.push(v.join("")),g}function N(t){return I(t,"")}function Y(t){return I(t,",")}function X(t){var e=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(t);if(!e)return{prefix:"",unit:"",value:NaN};var n=e[1],r=e[2];return{prefix:n,unit:e[3],value:parseFloat(r)}}function W(){return Date.now?Date.now():(new Date).getTime()}function H(t,e,n){void 0===n&&(n=-1);for(var r=t.length,i=0;i<r;++i)if(e(t[i],i,t))return i;return n}function q(t,e,n){var r=H(t,e);return r>-1?t[r]:n}var j,L,V=(j=W(),(L=S&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame))?L.bind(window):function(t){var e=W();return setTimeout(function(){t(e-j)},1e3/60)}),U=function(){var t=S&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return t?t.bind(window):function(t){clearTimeout(t)}}();function Z(t){return Object.keys(t)}function K(t,e){var n=X(t),r=n.value,i=n.unit;if(R(e)){var o=e[i];if(o){if(G(o))return o(r);if(T[i])return T[i](r,o)}}else if("%"===i)return r*e/100;return T[i]?T[i](r):r}function $(t,e,n){return Math.max(e,Math.min(t,n))}function J(t,e,n,r){return void 0===r&&(r=t[0]/t[1]),[[rt(e[0],_),rt(e[0]/r,_)],[rt(e[1]*r,_),rt(e[1],_)]].filter(function(t){return t.every(function(t,r){var i=e[r],o=rt(i,_);return n?t<=i||t<=o:t>=i||t>=o})})[0]||t}function Q(t){for(var e=t.length,n=0,r=e-1;r>=0;--r)n+=t[r];return e?n/e:0}function tt(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=Math.atan2(r,n);return i>=0?i:i+2*Math.PI}function et(t){var e=function(t){return[0,1].map(function(e){return Q(t.map(function(t){return t[e]}))})}(t),n=tt(e,t[0]),r=tt(e,t[1]);return n<r&&r-n<Math.PI||n>r&&r-n<-Math.PI?1:-1}function nt(t,e){return Math.sqrt(Math.pow((e?e[0]:0)-t[0],2)+Math.pow((e?e[1]:0)-t[1],2))}function rt(t,e){if(!e)return t;var n=1/e;return Math.round(t/e)/n}function it(t,e){return t.forEach(function(n,r){t[r]=rt(t[r],e)}),t}function ot(t,e){return t.classList?t.classList.contains(e):!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function at(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function st(t,e){if(t.classList)t.classList.remove(e);else{var n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}function ut(t,e,n,r){t.addEventListener(e,n,r)}function ct(t,e,n,r){t.removeEventListener(e,n,r)}function lt(t){return(null==t?void 0:t.ownerDocument)||M}function ft(t){return lt(t).documentElement}function pt(t){return lt(t).body}function dt(t){var e;return(null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView)||window}function ht(t){return t&&"postMessage"in t&&"blur"in t&&"self"in t}function gt(t){return R(t)&&t.nodeName&&t.nodeType&&"ownerDocument"in t}function vt(t,e,n,r,i,o){for(var a=0;a<i;++a){var s=n+a*i,u=r+a*i;t[s]+=t[u]*o,e[s]+=e[u]*o}}function mt(t,e,n,r,i){for(var o=0;o<i;++o){var a=n+o*i,s=r+o*i,u=t[a],c=e[a];t[a]=t[s],t[s]=u,e[a]=e[s],e[s]=c}}function bt(t,e,n,r,i){for(var o=0;o<r;++o){var a=n+o*r;t[a]/=i,e[a]/=i}}function xt(t,e){void 0===e&&(e=Math.sqrt(t.length));for(var n=t.slice(),r=At(e),i=0;i<e;++i){var o=e*i+i;if(!rt(n[o],_))for(var a=i+1;a<e;++a)if(n[e*i+a]){mt(n,r,i,a,e);break}if(!rt(n[o],_))return[];for(bt(n,r,i,e,n[o]),a=0;a<e;++a){var s=a,u=n[a+i*e];rt(u,_)&&i!==a&&vt(n,r,s,i,e,-u)}}return r}function yt(t,e){for(var n=t.slice(),r=t.length;r<e-1;++r)n[r]=0;return n[e-1]=1,n}function Et(t,e,n){if(void 0===e&&(e=Math.sqrt(t.length)),e===n)return t;for(var r=At(n),i=Math.min(e,n),o=0;o<i-1;++o){for(var a=0;a<i-1;++a)r[o*n+a]=t[o*e+a];r[(o+1)*n-1]=t[(o+1)*e-1],r[(n-1)*n+o]=t[(e-1)*e+o]}return r[n*n-1]=t[e*e-1],r}function Dt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=At(t);return e.forEach(function(e){r=wt(r,e,t)}),r}function wt(t,e,n){void 0===n&&(n=Math.sqrt(t.length));var r=[],i=t.length/n,o=e.length/i;if(!i)return e;if(!o)return t;for(var a=0;a<n;++a)for(var s=0;s<o;++s){r[s*n+a]=0;for(var u=0;u<i;++u)r[s*n+a]+=t[u*n+a]*e[s*i+u]}return r}function St(t,e){for(var n=Math.min(t.length,e.length),r=t.slice(),i=0;i<n;++i)r[i]=r[i]+e[i];return r}function Mt(t,e){for(var n=Math.min(t.length,e.length),r=t.slice(),i=0;i<n;++i)r[i]=r[i]-e[i];return r}function Ct(t,e){return void 0===e&&(e=6===t.length),e?[t[0],t[1],0,t[2],t[3],0,t[4],t[5],1]:t}function _t(t,e){return void 0===e&&(e=9===t.length),e?[t[0],t[1],t[3],t[4],t[6],t[7]]:t}function Tt(t,e,n){void 0===n&&(n=e.length);var r=wt(t,e,n),i=r[n-1];return r.map(function(t){return t/i})}function Ot(t,e){return wt(t,[1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1],4)}function Pt(t,e){return wt(t,[Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1],4)}function Rt(t,e){return wt(t,Gt(e,4))}function kt(t,e){var n=e[0],r=void 0===n?1:n,i=e[1],o=void 0===i?1:i,a=e[2];return wt(t,[r,0,0,0,0,o,0,0,0,0,void 0===a?1:a,0,0,0,0,1],4)}function Ft(t,e){var n=e[0],r=void 0===n?0:n,i=e[1],o=void 0===i?0:i,a=e[2];return wt(t,[1,0,0,0,0,1,0,0,0,0,1,0,r,o,void 0===a?0:a,1],4)}function Bt(t,e){return wt(t,e,4)}function Gt(t,e){var n=Math.cos(t),r=Math.sin(t),i=At(e);return i[0]=n,i[1]=r,i[e]=-r,i[e+1]=n,i}function At(t){for(var e=t*t,n=[],r=0;r<e;++r)n[r]=r%(t+1)?0:1;return n}function zt(t,e){for(var n=At(e),r=Math.min(t.length,e-1),i=0;i<r;++i)n[(e+1)*i]=t[i];return n}function It(t,e){for(var n=At(e),r=Math.min(t.length,e-1),i=0;i<r;++i)n[e*(e-1)+i]=t[i];return n}function Nt(t,e,n,r,i,o,a,s){var u=t[0],c=t[1],l=e[0],f=e[1],p=n[0],d=n[1],h=r[0],g=r[1],v=i[0],m=i[1],b=o[0],x=o[1],y=a[0],E=a[1],D=s[0],w=s[1],S=xt([u,0,l,0,p,0,h,0,c,0,f,0,d,0,g,0,1,0,1,0,1,0,1,0,0,u,0,l,0,p,0,h,0,c,0,f,0,d,0,g,0,1,0,1,0,1,0,1,-v*u,-m*u,-b*l,-x*l,-y*p,-E*p,-D*h,-w*h,-v*c,-m*c,-b*f,-x*f,-y*d,-E*d,-D*g,-w*g],8);if(!S.length)return[];var M=wt(S,[v,m,b,x,y,E,D,w],8);return M[8]=1,Et(function(t,e){void 0===e&&(e=Math.sqrt(t.length));for(var n=[],r=0;r<e;++r)for(var i=0;i<e;++i)n[i*e+r]=t[e*r+i];return n}(M),3,4)}var Yt=function(){return Yt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Yt.apply(this,arguments)};function Xt(t,e){return void 0===e&&(e=0),Wt(Ht(t,e))}function Wt(t){var e=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return t.forEach(function(t){var n=t.matrixFunction,r=t.functionValue;n&&(e=n(e,r))}),e}function Ht(t,e){return void 0===e&&(e=0),(k(t)?t:N(t)).map(function(t){var n,r=!(n=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(t))||n.length<4?{}:{prefix:n[1],value:n[2],suffix:n[3]},i=r.prefix,o=r.value,a=null,s=i,u="";if("translate"===i||"translateX"===i||"translate3d"===i){var c=R(e)?Yt(Yt({},e),{"o%":e["%"]}):{"%":e,"o%":e},l=Y(o).map(function(t,n){return c["%"]=0===n&&"x%"in c?e["x%"]:1===n&&"y%"in c?e["y%"]:e["o%"],K(t,c)}),f=l[0],p=l[1],d=void 0===p?0:p,h=l[2];a=Ft,u=[f,d,void 0===h?0:h]}else if("translateY"===i)a=Ft,u=[0,d=K(o,R(e)?Yt({"%":e["y%"]},e):{"%":e}),0];else if("translateZ"===i)a=Ft,u=[0,0,parseFloat(o)];else if("scale"===i||"scale3d"===i){var g=Y(o).map(function(t){return parseFloat(t)}),v=g[0],m=g[1],b=void 0===m?v:m,x=g[2];a=kt,u=[v,b,void 0===x?1:x]}else if("scaleX"===i)a=kt,u=[v=parseFloat(o),1,1];else if("scaleY"===i)a=kt,u=[1,b=parseFloat(o),1];else if("scaleZ"===i)a=kt,u=[1,1,parseFloat(o)];else if("rotate"===i||"rotateZ"===i||"rotateX"===i||"rotateY"===i){var y=X(o),E=y.unit,D=y.value;"rotate"===i||"rotateZ"===i?(s="rotateZ",a=Rt):"rotateX"===i?a=Ot:"rotateY"===i&&(a=Pt),u="rad"===E?D:D*Math.PI/180}else if("matrix3d"===i)a=Bt,u=Y(o).map(function(t){return parseFloat(t)});else if("matrix"===i){var w=Y(o).map(function(t){return parseFloat(t)});a=Bt,u=[w[0],w[1],0,0,w[2],w[3],0,0,0,0,1,0,w[4],w[5],0,1]}else s="";return{name:i,functionName:s,value:o,matrixFunction:a,functionValue:u}})}var qt=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,r=this.values,i=n.indexOf(t),o=-1===i?n.length:i;n[o]=t,r[o]=e},t}(),jt=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),Lt="function"==typeof Map,Vt=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}(),Ut=function(){function t(t,e,n,r,i,o,a,s){this.prevList=t,this.list=e,this.added=n,this.removed=r,this.changed=i,this.maintained=o,this.changedBeforeAdded=a,this.fixed=s}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t=function(t,e){var n=[],r=[];return t.forEach(function(t){var e=t[0],i=t[1],o=new Vt;n[e]=o,r[i]=o}),n.forEach(function(t,e){t.connect(n[e-1])}),t.filter(function(t,n){return!e[n]}).map(function(t,e){var i=t[0],o=t[1];if(i===o)return[0,0];var a=n[i],s=r[o-1],u=a.getIndex();return a.disconnect(),s?a.connect(s,s.next):a.connect(void 0,n[0]),[u,a.getIndex()]})}(this.changedBeforeAdded,this.fixed),e=this.changed,n=[];this.cacheOrdered=t.filter(function(t,r){var i=t[0],o=t[1],a=e[r],s=a[0],u=a[1];if(i!==o)return n.push([s,u]),!0}),this.cachePureChanged=n},t}();function Zt(t,e,n){var r=Lt?Map:n?jt:qt,i=n||function(t){return t},o=[],a=[],s=[],u=t.map(i),c=e.map(i),l=new r,f=new r,p=[],d=[],h={},g=[],v=0,m=0;return u.forEach(function(t,e){l.set(t,e)}),c.forEach(function(t,e){f.set(t,e)}),u.forEach(function(t,e){var n=f.get(t);void 0===n?(++m,a.push(e)):h[n]=m}),c.forEach(function(t,e){var n=l.get(t);void 0===n?(o.push(e),++v):(s.push([n,e]),m=h[e]||0,p.push([n-m,e-v]),d.push(e===n),n!==e&&g.push([n,e]))}),a.reverse(),new Ut(t,e,o,a,g,s,p,d)}var Kt,$t=function(){function t(t,e){void 0===t&&(t=[]),this.findKeyCallback=e,this.list=[].slice.call(t)}return t.prototype.update=function(t){var e=[].slice.call(t),n=Zt(this.list,e,this.findKeyCallback);return this.list=e,n},t}(),Jt=function(t,e){return Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},Jt(t,e)},Qt="function"==typeof Map?void 0:(Kt=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++Kt)}),te=function(t){function e(e){return void 0===e&&(e=[]),t.call(this,e,Qt)||this}return function(t,e){function n(){this.constructor=t}Jt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e}($t),ee=function(){return ee=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ee.apply(this,arguments)},ne=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(R(t))for(var n in t)this.on(n,t[n]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(R(t))for(var n in t)this.off(n);else if(e){var r=this._events[t];if(r){var i=H(r,function(t){return t.listener===e});i>-1&&r.splice(i,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(t,e){var n=this;return e&&this._addEvent(t,e,{once:!0}),new Promise(function(e){n._addEvent(t,e,{once:!0})})},e.emit=function(t,e){var n=this;void 0===e&&(e={});var r=this._events[t];if(!t||!r)return!0;var i=!1;return e.eventType=t,e.stop=function(){i=!0},e.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(r).forEach(function(r){r.listener(e),r.once&&n.off(t,r.listener)}),!i},e.trigger=function(t,e){return void 0===e&&(e={}),this.emit(t,e)},e._addEvent=function(t,e,n){var r=this._events;r[t]=r[t]||[],r[t].push(ee({listener:e},n))},t}();function re(t){return rt(t,_)}function ie(t){return t.length<3?0:Math.abs(function(t){for(var e=0,n=t.length-1;n>=0;--n)e+=t[n];return e}(t.map(function(e,n){var r=t[n+1]||t[0];return e[0]*r[1]-r[0]*e[1]})))/2}function oe(t,e){var n=e.width,r=e.height,i=e.left,o=e.top,a=ae(t),s=a.minX,u=a.minY,c=a.maxX,l=a.maxY,f=n/(c-s),p=r/(l-u);return t.map(function(t){return[i+(t[0]-s)*f,o+(t[1]-u)*p]})}function ae(t){var e=t.map(function(t){return t[0]}),n=t.map(function(t){return t[1]});return{minX:Math.min.apply(Math,e),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,e),maxY:Math.max.apply(Math,n)}}function se(t,e,n){var r=t[0],i=t[1],o=ae(e),a=o.minX,s=o.maxX,u=[[a,i],[s,i]],c=ue(u[0],u[1]),l=fe(e),f=[];if(l.forEach(function(e){var n,r=ue(e[0],e[1]),o=e[0];n=r,c.every(function(t,e){return 0===re(t-n[e])})?f.push({pos:t,line:e,type:"line"}):le(ce(c,r),[u,e]).forEach(function(t){e.some(function(e){return r=t,!re((n=e)[0]-r[0])&&!re(n[1]-r[1]);var n,r})?f.push({pos:t,line:e,type:"point"}):0!==re(o[1]-i)&&f.push({pos:t,line:e,type:"intersection"})})}),q(f,function(t){return t[0]===r}))return!0;var p=0,d={};return f.forEach(function(t){var e=t.pos,n=t.type,o=t.line;if(!(e[0]>r))if("intersection"===n)++p;else{if("line"===n)return;if("point"===n){var a=q(o,function(t){return t[1]!==i}),s=d[e[0]],u=a[1]>i?1:-1;s?s!==u&&++p:d[e[0]]=u}}}),p%2==1}function ue(t,e){var n=t[0],r=t[1],i=e[0]-n,o=e[1]-r;Math.abs(i)<_&&(i=0),Math.abs(o)<_&&(o=0);var a=0,s=0,u=0;return i?o?(s=1,u=-(a=-o/i)*n-r):(s=1,u=-r):o&&(a=-1,u=n),[a,s,u]}function ce(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=0===n&&0===o,c=0===r&&0===a,l=[];if(u&&c)return[];if(u){var f=-i/r;return f!==-s/a?[]:[[-1/0,f],[1/0,f]]}if(c){var p=-i/n;return p!==-s/o?[]:[[p,-1/0],[p,1/0]]}if(0===n)l=[[d=-(a*(h=-i/r)+s)/o,h]];else if(0===o)l=[[d=-(r*(h=-s/a)+i)/n,h]];else if(0===r)l=[[d=-i/n,h=-(o*d+s)/a]];else if(0===a)l=[[d=-s/o,h=-(n*d+i)/r]];else{var d,h;l=[[d=(r*s-a*i)/(a*n-r*o),h=-(n*d+i)/r]]}return l.map(function(t){return[t[0],t[1]]})}function le(t,e){var n=e.map(function(t){return[0,1].map(function(e){return[Math.min(t[0][e],t[1][e]),Math.max(t[0][e],t[1][e])]})}),r=[];if(2===t.length){var i=t[0],o=i[0],a=i[1];if(re(o-t[1][0])){if(!re(a-t[1][1])){var s=Math.max.apply(Math,n.map(function(t){return t[0][0]})),u=Math.min.apply(Math,n.map(function(t){return t[0][1]}));if(re(s-u)>0)return[];r=[[s,a],[u,a]]}}else{var c=Math.max.apply(Math,n.map(function(t){return t[1][0]})),l=Math.min.apply(Math,n.map(function(t){return t[1][1]}));if(re(c-l)>0)return[];r=[[o,c],[o,l]]}}return r.length||(r=t.filter(function(t){var e=t[0],r=t[1];return n.every(function(t){return 0<=re(e-t[0][0])&&0<=re(t[0][1]-e)&&0<=re(r-t[1][0])&&0<=re(t[1][1]-r)})})),r.map(function(t){return[re(t[0]),re(t[1])]})}function fe(t){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(t.slice(1),[t[0]]).map(function(e,n){return[t[n],e]})}var pe=function(t,e){return pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},pe(t,e)},de=function(){return de=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},de.apply(this,arguments)};function he(t){return 180*(e=[t[0].clientX,t[0].clientY],r=(n=[t[1].clientX,t[1].clientY])[0]-e[0],i=n[1]-e[1],((o=Math.atan2(i,r))>=0?o:o+2*Math.PI)/Math.PI);var e,n,r,i,o}function ge(t){return t?t.touches?function(t){for(var e=Math.min(t.length,2),n=[],r=0;r<e;++r)n.push(be(t[r]));return n}(t.touches):[be(t)]:[]}function ve(t,e,n){var r=n.length,i=xe(t,r),o=i.clientX,a=i.clientY,s=i.originalClientX,u=i.originalClientY,c=xe(e,r),l=c.clientX,f=c.clientY,p=xe(n,r);return{clientX:s,clientY:u,deltaX:o-l,deltaY:a-f,distX:o-p.clientX,distY:a-p.clientY}}function me(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function be(t){return{clientX:t.clientX,clientY:t.clientY}}function xe(t,e){void 0===e&&(e=t.length);for(var n={clientX:0,clientY:0,originalClientX:0,originalClientY:0},r=Math.min(t.length,e),i=0;i<r;++i){var o=t[i];n.originalClientX+="originalClientX"in o?o.originalClientX:o.clientX,n.originalClientY+="originalClientY"in o?o.originalClientY:o.clientY,n.clientX+=o.clientX,n.clientY+=o.clientY}return e?{clientX:n.clientX/e,clientY:n.clientY/e,originalClientX:n.originalClientX/e,originalClientY:n.originalClientY/e}:n}var ye=function(){function t(t){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=t,this.prevClients=t,this.length=t.length}return t.prototype.getAngle=function(t){return void 0===t&&(t=this.prevClients),he(t)},t.prototype.getRotation=function(t){return void 0===t&&(t=this.prevClients),he(t)-he(this.startClients)},t.prototype.getPosition=function(t,e){void 0===t&&(t=this.prevClients);var n=ve(t||this.prevClients,this.prevClients,this.startClients),r=n.deltaX,i=n.deltaY;return this.movement+=Math.sqrt(r*r+i*i),this.prevClients=t,n},t.prototype.getPositions=function(t){void 0===t&&(t=this.prevClients);for(var e=this.prevClients,n=this.startClients,r=Math.min(this.length,e.length),i=[],o=0;o<r;++o)i[o]=ve([t[o]],[e[o]],[n[o]]);return i},t.prototype.getMovement=function(t){var e=this.movement;if(!t)return e;var n=xe(t,this.length),r=xe(this.prevClients,this.length),i=n.clientX-r.clientX,o=n.clientY-r.clientY;return Math.sqrt(i*i+o*o)+e},t.prototype.getDistance=function(t){return void 0===t&&(t=this.prevClients),me(t)},t.prototype.getScale=function(t){return void 0===t&&(t=this.prevClients),me(t)/me(this.startClients)},t.prototype.move=function(t,e){this.startClients.forEach(function(n){n.clientX-=t,n.clientY-=e}),this.prevClients.forEach(function(n){n.clientX-=t,n.clientY-=e})},t}(),Ee=["textarea","input"],De=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this)||this;r.options={},r.flag=!1,r.pinchFlag=!1,r.data={},r.isDrag=!1,r.isPinch=!1,r.clientStores=[],r.targets=[],r.prevTime=0,r.doubleFlag=!1,r._useMouse=!1,r._useTouch=!1,r._useDrag=!1,r._dragFlag=!1,r._isTrusted=!1,r._isMouseEvent=!1,r._isSecondaryButton=!1,r._preventMouseEvent=!1,r._prevInputEvent=null,r._isDragAPI=!1,r._isIdle=!0,r._preventMouseEventId=0,r._window=window,r.onDragStart=function(t,e){if(void 0===e&&(e=!0),r.flag||!1!==t.cancelable){var n=t.type.indexOf("drag")>=-1;if(!r.flag||!n){r._isDragAPI=!0;var i=r.options,o=i.container,a=i.pinchOutside,s=i.preventWheelClick,u=i.preventRightClick,c=i.preventDefault,l=i.checkInput,f=i.dragFocusedInput,p=i.preventClickEventOnDragStart,d=i.preventClickEventOnDrag,h=i.preventClickEventByCondition,g=r._useTouch,v=!r.flag;if(r._isSecondaryButton=3===t.which||2===t.button,s&&(2===t.which||1===t.button)||u&&(3===t.which||2===t.button))return r.stop(),!1;if(v){var m=r._window.document.activeElement,b=t.target;if(b){var x=b.tagName.toLowerCase(),y=Ee.indexOf(x)>-1,E=b.isContentEditable;if(y||E){if(l||!f&&m===b)return!1;if(m&&(m===b||E&&m.isContentEditable&&m.contains(b))){if(!f)return!1;b.blur()}}else if((c||"touchstart"===t.type)&&m){var D=m.tagName.toLowerCase();(m.isContentEditable||Ee.indexOf(D)>-1)&&m.blur()}(p||d||h)&&ut(r._window,"click",r._onClick,!0)}r.clientStores=[new ye(ge(t))],r._isIdle=!1,r.flag=!0,r.isDrag=!1,r._isTrusted=e,r._dragFlag=!0,r._prevInputEvent=t,r.data={},r.doubleFlag=W()-r.prevTime<200,r._isMouseEvent=function(t){return t&&(t.type.indexOf("mouse")>-1||"button"in t)}(t),!r._isMouseEvent&&r._preventMouseEvent&&r._allowMouseEvent(),!1===(r._preventMouseEvent||r.emit("dragStart",de(de({data:r.data,datas:r.data,inputEvent:t,isMouseEvent:r._isMouseEvent,isSecondaryButton:r._isSecondaryButton,isTrusted:e,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()),{preventDefault:function(){t.preventDefault()},preventDrag:function(){r._dragFlag=!1}})))&&r.stop(),r._isMouseEvent&&r.flag&&c&&t.preventDefault()}if(!r.flag)return!1;var w=0;if(v?(r._attchDragEvent(),g&&a&&(w=setTimeout(function(){ut(o,"touchstart",r.onDragStart,{passive:!1})}))):g&&a&&ct(o,"touchstart",r.onDragStart),r.flag&&function(t){return t.touches&&t.touches.length>=2}(t)){if(clearTimeout(w),v&&t.touches.length!==t.changedTouches.length)return;r.pinchFlag||r.onPinchStart(t)}}}},r.onDrag=function(t,e){if(r.flag){var n=r.options.preventDefault;!r._isMouseEvent&&n&&t.preventDefault(),r._prevInputEvent=t;var i=ge(t),o=r.moveClients(i,t,!1);if(r._dragFlag){if((r.pinchFlag||o.deltaX||o.deltaY)&&!1===(r._preventMouseEvent||r.emit("drag",de(de({},o),{isScroll:!!e,inputEvent:t}))))return void r.stop();r.pinchFlag&&r.onPinch(t,i)}r.getCurrentStore().getPosition(i,!0)}},r.onDragEnd=function(t){if(r.flag){var e=r.options,n=e.pinchOutside,i=e.container,o=e.preventClickEventOnDrag,a=e.preventClickEventOnDragStart,s=e.preventClickEventByCondition,u=r.isDrag;(o||a||s)&&requestAnimationFrame(function(){r._allowClickEvent()}),s||a||!o||u||r._allowClickEvent(),r._useTouch&&n&&ct(i,"touchstart",r.onDragStart),r.pinchFlag&&r.onPinchEnd(t);var c=(null==t?void 0:t.touches)?ge(t):[];0!==c.length&&r.options.keepDragging?r._addStore(new ye(c)):r.flag=!1;var l=r._getPosition(),f=W(),p=!u&&r.doubleFlag;r._prevInputEvent=null,r.prevTime=u||p?0:f,r.flag||(r._dettachDragEvent(),r._preventMouseEvent||r.emit("dragEnd",de({data:r.data,datas:r.data,isDouble:p,isDrag:u,isClick:!u,isMouseEvent:r._isMouseEvent,isSecondaryButton:r._isSecondaryButton,inputEvent:t,isTrusted:r._isTrusted},l)),r.clientStores=[],r._isMouseEvent||(r._preventMouseEvent=!0,clearTimeout(r._preventMouseEventId),r._preventMouseEventId=setTimeout(function(){r._preventMouseEvent=!1},200)),r._isIdle=!0)}},r.onBlur=function(){r.onDragEnd()},r._allowClickEvent=function(){ct(r._window,"click",r._onClick,!0)},r._onClick=function(t){r._allowClickEvent(),r._allowMouseEvent();var e=r.options.preventClickEventByCondition;(null==e?void 0:e(t))||(t.stopPropagation(),t.preventDefault())},r._onContextMenu=function(t){r.options.preventRightClick?r.onDragEnd(t):t.preventDefault()},r._passCallback=function(){};var i=[].concat(e),o=i[0];r._window=ht(o)?o:dt(o),r.options=de({checkInput:!1,container:o&&!("document"in o)?dt(o):o,preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,s=a.container,u=a.events,c=a.checkWindowBlur;if(r._useDrag=u.indexOf("drag")>-1,r._useTouch=u.indexOf("touch")>-1,r._useMouse=u.indexOf("mouse")>-1,r.targets=i,r._useDrag&&i.forEach(function(t){ut(t,"dragstart",r.onDragStart)}),r._useMouse&&(i.forEach(function(t){ut(t,"mousedown",r.onDragStart),ut(t,"mousemove",r._passCallback)}),ut(s,"contextmenu",r._onContextMenu)),c&&ut(dt(),"blur",r.onBlur),r._useTouch){var l={passive:!1};i.forEach(function(t){ut(t,"touchstart",r.onDragStart,l),ut(t,"touchmove",r._passCallback,l)})}return r}return function(t,e){function n(){this.constructor=t}pe(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._isIdle=!0,this._allowClickEvent(),this._dettachDragEvent(),this._isDragAPI=!1},e.prototype.getMovement=function(t){return this.getCurrentStore().getMovement(t)+this.clientStores.slice(1).reduce(function(t,e){return t+e.movement},0)},e.prototype.isDragging=function(){return this.isDrag},e.prototype.isIdle=function(){return this._isIdle},e.prototype.isFlag=function(){return this.flag},e.prototype.isPinchFlag=function(){return this.pinchFlag},e.prototype.isDoubleFlag=function(){return this.doubleFlag},e.prototype.isPinching=function(){return this.isPinch},e.prototype.scrollBy=function(t,e,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(t,e),r&&this.onDrag(n,!0))},e.prototype.move=function(t,e){var n=t[0],r=t[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map(function(t){var e=t.clientX,i=t.clientY;return{clientX:e+n,clientY:i+r,originalClientX:e,originalClientY:i}}),e,!0)},e.prototype.triggerDragStart=function(t){this.onDragStart(t,!1)},e.prototype.setEventData=function(t){var e=this.data;for(var n in t)e[n]=t[n];return this},e.prototype.setEventDatas=function(t){return this.setEventData(t)},e.prototype.getCurrentEvent=function(t){return void 0===t&&(t=this._prevInputEvent),de(de({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},e.prototype.getEventData=function(){return this.data},e.prototype.getEventDatas=function(){return this.data},e.prototype.unset=function(){var t=this,e=this.targets,n=this.options.container;this.off(),ct(this._window,"blur",this.onBlur),this._useDrag&&e.forEach(function(e){ct(e,"dragstart",t.onDragStart)}),this._useMouse&&(e.forEach(function(e){ct(e,"mousedown",t.onDragStart)}),ct(n,"contextmenu",this._onContextMenu)),this._useTouch&&(e.forEach(function(e){ct(e,"touchstart",t.onDragStart)}),ct(n,"touchstart",this.onDragStart)),this._prevInputEvent=null,this._allowClickEvent(),this._dettachDragEvent()},e.prototype.onPinchStart=function(t){var e=this,n=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>n)){var r=new ye(ge(t));this.pinchFlag=!0,this._addStore(r),!1===this.emit("pinchStart",de(de({data:this.data,datas:this.data,angle:r.getAngle(),touches:this.getCurrentStore().getPositions()},r.getPosition()),{inputEvent:t,isTrusted:this._isTrusted,preventDefault:function(){t.preventDefault()},preventDrag:function(){e._dragFlag=!1}}))&&(this.pinchFlag=!1)}},e.prototype.onPinch=function(t,e){if(this.flag&&this.pinchFlag&&!(e.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",de(de({data:this.data,datas:this.data,movement:this.getMovement(e),angle:n.getAngle(e),rotation:n.getRotation(e),touches:n.getPositions(e),scale:n.getScale(e),distance:n.getDistance(e)},n.getPosition(e)),{inputEvent:t,isTrusted:this._isTrusted}))}},e.prototype.onPinchEnd=function(t){if(this.pinchFlag){var e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",de(de({data:this.data,datas:this.data,isPinch:e,touches:n.getPositions()},n.getPosition()),{inputEvent:t}))}},e.prototype.getCurrentStore=function(){return this.clientStores[0]},e.prototype.moveClients=function(t,e,n){var r=this._getPosition(t,n),i=this.isDrag;(r.deltaX||r.deltaY)&&(this.isDrag=!0);var o=!1;return!i&&this.isDrag&&(o=!0),de(de({data:this.data,datas:this.data},r),{movement:this.getMovement(t),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:e,isTrusted:this._isTrusted,isFirstDrag:o})},e.prototype._addStore=function(t){this.clientStores.splice(0,0,t)},e.prototype._getPosition=function(t,e){var n=this.getCurrentStore().getPosition(t,e),r=this.clientStores.slice(1).reduce(function(t,e){var n=e.getPosition();return t.distX+=n.distX,t.distY+=n.distY,t},n),i=r.distX,o=r.distY;return de(de({},n),{distX:i,distY:o})},e.prototype._attchDragEvent=function(){var t=this._window,e=this.options.container,n={passive:!1};this._isDragAPI&&(ut(e,"dragover",this.onDrag,n),ut(t,"dragend",this.onDragEnd)),this._useMouse&&(ut(e,"mousemove",this.onDrag),ut(t,"mouseup",this.onDragEnd)),this._useTouch&&(ut(e,"touchmove",this.onDrag,n),ut(t,"touchend",this.onDragEnd,n),ut(t,"touchcancel",this.onDragEnd,n))},e.prototype._dettachDragEvent=function(){var t=this._window,e=this.options.container;this._isDragAPI&&(ct(e,"dragover",this.onDrag),ct(t,"dragend",this.onDragEnd)),this._useMouse&&(ct(e,"mousemove",this.onDrag),ct(t,"mouseup",this.onDragEnd)),this._useTouch&&(ct(e,"touchstart",this.onDragStart),ct(e,"touchmove",this.onDrag),ct(t,"touchend",this.onDragEnd),ct(t,"touchcancel",this.onDragEnd))},e.prototype._allowMouseEvent=function(){this._preventMouseEvent=!1,clearTimeout(this._preventMouseEventId)},e}(ne);function we(t){var e="rCS"+function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0}(t).toString(36);return{className:e,inject:function(n,r){void 0===r&&(r={});var i=function(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}(n),o=(i||n.ownerDocument||document).querySelector('style[data-styled-id="'.concat(e,'"]'));if(o){var a=parseFloat(o.getAttribute("data-styled-count"))||0;o.setAttribute("data-styled-count","".concat(a+1))}else o=function(t,e,n,r,i){var o=lt(r),a=o.createElement("style");return a.setAttribute("type","text/css"),a.setAttribute("data-styled-id",t),a.setAttribute("data-styled-count","1"),n.nonce&&a.setAttribute("nonce",n.nonce),a.innerHTML=function(t,e,n){return n.original?e:e.replace(/([^};{\s}][^};{]*|^\s*){/gm,function(e,n){var r=n.trim();return(r?Y(r):[""]).map(function(e){var n=e.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?"".concat(n.replace(/\:host/g,".".concat(t))):n?".".concat(t," ").concat(n):".".concat(t)}).join(", ")+" {"})}(t,e,n),(i||o.head||o.body).appendChild(a),a}(e,t,r,n,i);return{destroy:function(){var t,e=parseFloat(o.getAttribute("data-styled-count"))||0;e<=1?(o.remove?o.remove():null===(t=o.parentNode)||void 0===t||t.removeChild(o),o=null):o.setAttribute("data-styled-count","".concat(e-1))}}}}}var Se=function(){return Se=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Se.apply(this,arguments)};function Me(t,a){var s=we(a),u=s.className;return n(function(n,a){var c=n.className,l=void 0===c?"":c;n.cspNonce;var f=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(n,["className","cspNonce"]),p=r();return i(a,function(){return p.current},[]),o(function(){var t=s.inject(p.current,{nonce:n.cspNonce});return function(){t.destroy()}},[]),e(t,Se({ref:p,"data-styled-id":u,className:"".concat(l," ").concat(u)},f))})}var Ce=function(t,e){return Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ce(t,e)};function _e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ce(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Te=function(){return Te=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Te.apply(this,arguments)};function Oe(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Pe(t,e,n){if(2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function Re(t,e){return Te({events:[],props:[],name:t},e)}var ke,Fe,Be,Ge=["n","w","s","e"],Ae=["n","w","s","e","nw","ne","sw","se"],ze=function(){if("undefined"==typeof navigator||!navigator||!navigator.userAgentData)return!1;var t=navigator.userAgentData,e=t.brands||t.uaList;return!(!e||!e.length)}()?function(){var t=navigator.userAgentData,e=(t.uaList||t.brands).slice(),n=t.mobile||!1,r=e[0],i=(t.platform||navigator.platform).toLowerCase(),o={name:r.brand,version:r.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!p(m,e).brand||x(u())},c={name:"unknown",version:"-1",majorVersion:-1};o.webkit=!o.chromium&&a(v,function(t){return d(e,t)});var f=p(g,e);if(o.chromium=!!f.brand,o.chromiumVersion=f.version||"-1",!o.chromium){var y=p(v,e);o.webkit=!!y.brand,o.webkitVersion=y.version||"-1"}var E=s(b,function(t){return new RegExp(""+t.test,"g").exec(i)});c.name=E?E.id:"";var D=p(h,e);return o.name=D.brand||o.name,o.version=(D.brand,D.version),o.webkit&&(c.name=n?"ios":"mac"),"ios"===c.name&&o.webview&&(o.version="-1"),c.version=l(c.version),o.version=l(o.version),c.majorVersion=parseInt(c.version,10),o.majorVersion=parseInt(o.version,10),{browser:o,os:c,isMobile:n,isHints:!0}}():function(){var t=u(ke),e=!!/mobi/g.exec(t),n={name:"unknown",version:"-1",majorVersion:-1,webview:x(t),chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},r={name:"unknown",version:"-1",majorVersion:-1},i=f(h,t),o=i.preset,a=i.version,s=f(b,t),c=s.preset,l=s.version,p=f(g,t);if(n.chromium=!!p.preset,n.chromiumVersion=p.version,!n.chromium){var d=f(v,t);n.webkit=!!d.preset,n.webkitVersion=d.version}return c&&(r.name=c.id,r.version=l,r.majorVersion=parseInt(l,10)),o&&(n.name=o.id,n.version=a,n.webview&&"ios"===r.name&&"safari"!==n.name&&(n.webview=!1)),n.majorVersion=parseInt(n.version,10),{browser:n,os:r,isMobile:e,isHints:!1}}(),Ie=ze.browser.webkit,Ne=Ie&&(Fe="undefined"==typeof window?{userAgent:""}:window.navigator,!!(Be=/applewebkit\/([^\s]+)/g.exec(Fe.userAgent.toLowerCase()))&&parseFloat(Be[1])<605),Ye=ze.browser.name,Xe=parseInt(ze.browser.version,10),We="chrome"===Ye,He=ze.browser.chromium,qe=parseInt(ze.browser.chromiumVersion,10)||0,je=We&&Xe>=109||He&&qe>=109,Le="firefox"===Ye,Ve=parseInt(ze.browser.webkitVersion,10)>=612||Xe>=15,Ue="moveable-",Ze=Ae.map(function(t){var e="",n="",r="center",i="center",o="calc(var(--moveable-control-padding, 20) * -1px)";return t.indexOf("n")>-1&&(e="top: ".concat(o,";"),i="bottom"),t.indexOf("s")>-1&&(e="top: 0px;",i="top"),t.indexOf("w")>-1&&(n="left: ".concat(o,";"),r="right"),t.indexOf("e")>-1&&(n="left: 0px;",r="left"),'.around-control[data-direction*="'.concat(t,'"] {\n ').concat(n).concat(e,"\n transform-origin: ").concat(r," ").concat(i,";\n }")}).join("\n"),Ke="\n{\nposition: absolute;\nwidth: 1px;\nheight: 1px;\nleft: 0;\ntop: 0;\nz-index: 3000;\n--moveable-color: #4af;\n--zoom: 1;\n--zoompx: 1px;\n--moveable-line-padding: 0;\n--moveable-control-padding: 0;\nwill-change: transform;\noutline: 1px solid transparent;\n}\n.control-box {\nz-index: 0;\n}\n.line, .control {\nposition: absolute;\nleft: 0;\ntop: 0;\nwill-change: transform;\n}\n.control {\nwidth: 14px;\nheight: 14px;\nborder-radius: 50%;\nborder: 2px solid #fff;\nbox-sizing: border-box;\nbackground: #4af;\nbackground: var(--moveable-color);\nmargin-top: -7px;\nmargin-left: -7px;\nborder: 2px solid #fff;\nz-index: 10;\n}\n.around-control {\nposition: absolute;\nwill-change: transform;\nwidth: calc(var(--moveable-control-padding, 20) * 1px);\nheight: calc(var(--moveable-control-padding, 20) * 1px);\nleft: calc(var(--moveable-control-padding, 20) * -0.5px);\ntop: calc(var(--moveable-control-padding, 20) * -0.5px);\nbox-sizing: border-box;\nbackground: transparent;\nz-index: 8;\ncursor: alias;\ntransform-origin: center center;\n}\n".concat(Ze,"\n.padding {\nposition: absolute;\ntop: 0px;\nleft: 0px;\nwidth: 100px;\nheight: 100px;\ntransform-origin: 0 0;\n}\n.line {\nwidth: 1px;\nheight: 1px;\nbackground: #4af;\nbackground: var(--moveable-color);\ntransform-origin: 0px 50%;\n}\n.line.edge {\nz-index: 1;\nbackground: transparent;\n}\n.line.dashed {\nbox-sizing: border-box;\nbackground: transparent;\n}\n.line.dashed.horizontal {\nborder-top: 1px dashed #4af;\nborder-top-color: #4af;\nborder-top-color: var(--moveable-color);\n}\n.line.dashed.vertical {\nborder-left: 1px dashed #4af;\nborder-left-color: #4af;\nborder-left-color: var(--moveable-color);\n}\n.line.vertical {\ntransform: translateX(-50%);\n}\n.line.horizontal {\ntransform: translateY(-50%);\n}\n.line.vertical.bold {\nwidth: 2px;\n}\n.line.horizontal.bold {\nheight: 2px;\n}\n\n.control.origin {\nborder-color: #f55;\nbackground: #fff;\nwidth: 12px;\nheight: 12px;\nmargin-top: -6px;\nmargin-left: -6px;\npointer-events: none;\n}\n").concat([0,15,30,45,60,75,90,105,120,135,150,165].map(function(t){return'\n.direction[data-rotation="'.concat(t,'"], :global .view-control-rotation').concat(t," {\n").concat(function(t){var e=function(t,e){return'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(32,'px" height="').concat(32,'px" viewBox="0 0 32 32" ><path d="M 16,5 L 12,10 L 14.5,10 L 14.5,22 L 12,22 L 16,27 L 20,22 L 17.5,22 L 17.5,10 L 20, 10 L 16,5 Z" stroke-linejoin="round" stroke-width="1.2" fill="black" stroke="white" style="transform:rotate(').concat(e,'deg);transform-origin: 16px 16px"></path></svg>')}(0,t),n=45*Math.round(t/45)%180,r="ns-resize";return 135===n?r="nwse-resize":45===n?r="nesw-resize":90===n&&(r="ew-resize"),"cursor:".concat(r,";cursor: url('").concat(e,"') 16 16, ").concat(r,";")}(t),"\n}\n")}).join("\n"),'\n\n.line.direction:before {\ncontent: "";\nposition: absolute;\nwidth: 100%;\nheight: calc(var(--moveable-line-padding, 0) * 1px);\nbottom: 0;\nleft: 0;\n}\n.group {\nz-index: -1;\n}\n.area {\nposition: absolute;\n}\n.area-pieces {\nposition: absolute;\ntop: 0;\nleft: 0;\ndisplay: none;\n}\n.area.avoid, .area.pass {\npointer-events: none;\n}\n.area.avoid+.area-pieces {\ndisplay: block;\n}\n.area-piece {\nposition: absolute;\n}\n\n').concat(Ne?':global svg *:before {\ncontent:"";\ntransform-origin: inherit;\n}':"","\n"),$e=1e-4,Je=1e-7,Qe=Math.pow(10,10),tn=-Qe,en={n:[0,1],e:[1,3],s:[3,2],w:[2,0],nw:[0],ne:[1],sw:[2],se:[3]},nn={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},rn=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate","waitToChangeTarget","updateSelectors","getTargets","stopDrag","getControlBoxElement","getMoveables","getDragElement"];function on(t,e,n,r,i,o){var a,s,u=null!==(s=null===(a=e.gestos[o])||void 0===a?void 0:a.move(n,t.inputEvent))&&void 0!==s?s:{},c=u.originalDatas||u.datas,l=c[o]||(c[o]={});return Te(Te({},u),{isPinch:!!r,parentEvent:!0,datas:l,originalDatas:t.originalDatas})}var an=function(){function t(t){var e;void 0===t&&(t="draggable"),this.ableName=t,this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}},this.datas=((e={})[t]={},e)}return t.prototype.dragStart=function(t,e){this.isDrag=!1,this.isFlag=!1;var n=e.originalDatas;return this.datas=n,n[this.ableName]||(n[this.ableName]={}),Te(Te({},this.move(t,e.inputEvent)),{type:"dragstart"})},t.prototype.drag=function(t,e){return this.move([t[0]-this.prevX,t[1]-this.prevY],e)},t.prototype.move=function(t,e){var n,r,i=!1;if(this.isFlag){var o=this.isDrag;n=this.prevX+t[0],r=this.prevY+t[1],(t[0]||t[1])&&(this.isDrag=!0),!o&&this.isDrag&&(i=!0)}else this.prevX=t[0],this.prevY=t[1],this.startX=t[0],this.startY=t[1],n=t[0],r=t[1],this.isFlag=!0;return this.prevX=n,this.prevY=r,{type:"drag",clientX:n,clientY:r,inputEvent:e,isFirstDrag:i,isDrag:this.isDrag,distX:n-this.startX,distY:r-this.startY,deltaX:t[0],deltaY:t[1],datas:this.datas[this.ableName],originalDatas:this.datas,parentEvent:!0,parentGesto:this}},t}();function sn(t,e,n,r){var i=16===t.length?4:3,o=Oe(wr(t,n,r,i),4),a=Oe(o[0],2),s=a[0],u=a[1],c=Oe(o[1],2),l=c[0],f=c[1],p=Oe(o[2],2),d=p[0],h=p[1],g=Oe(o[3],2),v=g[0],m=g[1],b=Oe(Dr(t,e,i),2),x=b[0],y=b[1],E=Math.min(s,l,d,v),D=Math.min(u,f,h,m),w=Math.max(s,l,d,v);return s=s-E||0,{left:E,top:D,right:w,bottom:Math.max(u,f,h,m),origin:[x=x-E||0,y=y-D||0],pos1:[s,u=u-D||0],pos2:[l=l-E||0,f=f-D||0],pos3:[d=d-E||0,h=h-D||0],pos4:[v=v-E||0,m=m-D||0],direction:ii(t[0]*t[i+1])}}function un(t,e){var n=e.datas,r=t.state,i=r.allMatrix,o=r.beforeMatrix,a=r.is3d,s=r.left,u=r.top,c=r.origin,l=r.offsetMatrix,f=r.targetMatrix,p=r.transformOrigin,d=a?4:3;n.is3d=a,n.matrix=i,n.targetMatrix=f,n.beforeMatrix=o,n.offsetMatrix=l,n.transformOrigin=p,n.inverseMatrix=xt(i,d),n.inverseBeforeMatrix=xt(o,d),n.absoluteOrigin=yt(St([s,u],c),d),n.startDragBeforeDist=Tt(n.inverseBeforeMatrix,n.absoluteOrigin,d),n.startDragDist=Tt(n.inverseMatrix,n.absoluteOrigin,d)}function cn(t,e,n){var r=e.datas,i=e.originalDatas.beforeRenderable,o=r.transformIndex,a=i.nextTransforms,s=a.length,u=i.nextTransformAppendedIndexes,c=-1;-1===o?(-1==(c=0)&&(c=a.length),r.transformIndex=c):c=q(u,function(t){return t.index===o&&t.functionName===n})?o:o+u.filter(function(t){return t.index<o}).length;var l=function(t,e,n){var r,i=Ht(t,{"x%":function(t){return t/100*e.offsetWidth},"y%":function(t){return t/100*e.offsetHeight}}),o=t.slice(0,n<0?void 0:n),a=t.slice(0,n<0?void 0:n+1),s=t[n]||"",u=n<0?[]:t.slice(n),c=n<0?[]:t.slice(n+1),l=i.slice(0,n<0?void 0:n),f=i.slice(0,n<0?void 0:n+1),p=null!==(r=i[n])&&void 0!==r?r:Ht([""])[0],d=n<0?[]:i.slice(n),h=n<0?[]:i.slice(n+1),g=p?[p]:[],v=Wt(l),m=Wt(f),b=Wt(d),x=Wt(h),y=wt(v,b,4);return{transforms:t,beforeFunctionMatrix:v,beforeFunctionMatrix2:m,targetFunctionMatrix:Wt(g),afterFunctionMatrix:b,afterFunctionMatrix2:x,allFunctionMatrix:y,beforeFunctions:l,beforeFunctions2:f,targetFunction:g[0],afterFunctions:d,afterFunctions2:h,beforeFunctionTexts:o,beforeFunctionTexts2:a,targetFunctionText:s,afterFunctionTexts:u,afterFunctionTexts2:c}}(a,t.state,c),f=l.targetFunction,p=n;r.beforeFunctionTexts=l.beforeFunctionTexts,r.afterFunctionTexts=l.afterFunctionTexts,r.beforeTransform=l.beforeFunctionMatrix,r.beforeTransform2=l.beforeFunctionMatrix2,r.targetTansform=l.targetFunctionMatrix,r.afterTransform=l.afterFunctionMatrix,r.afterTransform2=l.afterFunctionMatrix2,r.targetAllTransform=l.allFunctionMatrix,f.functionName===p?(r.afterFunctionTexts.splice(0,1),r.isAppendTransform=!1):s>c&&(r.isAppendTransform=!0,i.nextTransformAppendedIndexes=Pe(Pe([],Oe(u),!1),[{functionName:n,index:c,isAppend:!0}],!1))}function ln(t){var e=t.datas,n=t.distX,r=t.distY,i=e.inverseBeforeMatrix,o=e.is3d,a=e.startDragBeforeDist,s=o?4:3;return Mt(Tt(i,St(e.absoluteOrigin,[n,r]),s),a)}function fn(t,e){var n=t.datas,r=t.distX,i=t.distY;n.inverseBeforeMatrix;var o=n.inverseMatrix,a=n.is3d;n.startDragBeforeDist;var s=n.startDragDist,u=a?4:3;return Mt(Tt(o,St(n.absoluteOrigin,[r,i]),u),s)}function pn(t,e){var n=(e+1)/2;return[O(t[0][0],t[1][0],n,1-n),O(t[0][1],t[1][1],n,1-n)]}function dn(t,e){var n=pn([t[0],t[1]],e[0]),r=pn([t[2],t[3]],e[0]);return pn([n,r],e[1])}function hn(t,e,n,r){return wt(t,fr(e,r,n),r)}function gn(t,e,n){var r=vn(e),i=e.datas;if(i.transformIndex=n,-1!==n){var o=r.startTransforms[n];if(o){var a=t.state,s=Ht([o],{"x%":function(t){return t/100*a.offsetWidth},"y%":function(t){return t/100*a.offsetHeight}});i.startValue=s[0].functionValue}}}function vn(t){return t.originalDatas.beforeRenderable}function mn(t){return t.originalDatas.beforeRenderable.nextTransforms}function bn(t){return(mn(t)||[]).join(" ")}function xn(t){return vn(t).nextStyle}function yn(t,e,n,r,i,o){var a=t.props.groupable,s=t.state,u=s.transformOrigin,c=s.offsetMatrix,l=s.is3d,f=s.width,p=s.height,d=s.left,h=s.top,g=o.fixedDirection,v=o.nextTargetMatrix||s.targetMatrix,m=l?4:3,b=function(t,e,n,r,i,o){return void 0===r&&(r=e),void 0===i&&(i=n),void 0===o&&(o=[0,0]),t?t.map(function(t,a){var s=X(t),u=s.value,c=s.unit,l=a?i:r,f=a?n:e;return"%"===t||isNaN(u)?f*(l?o[a]/l:0):"%"!==c?u:f*u/100}):o}(i,e,n,f,p,u),x=a?d:0,y=a?h:0,E=function(t,e,n,r,i,o){var a=dn(wr(e,n,r,i),o);return[t[0]-a[0],t[1]-a[1]]}(r,hn(c,v,b,m),e,n,m,g);return Mt(E,[x,y])}function En(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}function Dn(t){var e=t("scale"),n=t("rotate"),r=t("translate"),i=[];return r&&"0px"!==r&&"none"!==r&&i.push("translate(".concat(r.split(/\s+/).join(","),")")),n&&"1"!==n&&"none"!==n&&i.push("rotate(".concat(n,")")),e&&"1"!==e&&"none"!==e&&i.push("scale(".concat(e.split(/\s+/).join(","),")")),i}function wn(t,e,n){for(var r,i,o,a=t,s=[],u=ft(t)||pt(t),c=!n&&t===e||t===u,l=c,f=!1,p=3,d=!1,h=hr(e,e,!0).offsetParent,g=1;a&&!l;){l=c;var v=Tn(a),m=v("position"),b=dr(a),x="fixed"===m,y=Dn(v),E=Ct(lr(b)),D=void 0,w=!1,S=!1,M=0,C=0,_=0,T=0,O={hasTransform:!1,fixedContainer:null};x&&(d=!0,h=(O=br(a)).fixedContainer);var P=E.length;f||16!==P&&!y.length||(f=!0,p=4,mr(s),o&&(o=Et(o,3,4))),f&&9===P&&(E=Et(E,3,4));var R=gr(a,t),k=R.tagName,F=R.hasOffset,B=R.isSVG,G=R.origin,A=R.targetOrigin,z=Oe(R.offset,2),I=z[0],N=z[1];"svg"===k&&!a.ownerSVGElement&&o&&(s.push({type:"target",target:a,matrix:Er(a,p)}),s.push({type:"offset",target:a,matrix:At(p)}));var Y=parseFloat(v("zoom"))||1;if(x)D=O.fixedContainer,w=!0;else{var X=hr(a,e,!1,!0,v),W=X.offsetZoom;if(D=X.offsetParent,w=X.isEnd,S=X.isStatic,g*=W,(X.isCustomElement||1!==W)&&S)I-=D.offsetLeft,N-=D.offsetTop;else if((Le||je)&&X.parentSlotElement){for(var H=D,q=0,j=0;H&&En(H);)q+=H.offsetLeft,j+=H.offsetTop,H=H.offsetParent;I-=q,N-=j}}if(!Ie||Ve||!F||B||!S||"relative"!==m&&"static"!==m||(I-=D.offsetLeft,N-=D.offsetTop,c=c||w),x)F&&O.hasTransform&&(_=D.clientLeft,T=D.clientTop);else if(F&&h!==D&&(M=D.clientLeft,C=D.clientTop),F&&D===u){var L=vr(a,!1);I+=L[0],N+=L[1]}if(s.push({type:"target",target:a,matrix:fr(E,p,G)}),y.length&&(s.push({type:"offset",target:a,matrix:At(p)}),s.push({type:"target",target:a,matrix:fr(Xt(y),p,G)})),F){var V=a===t,U=V?0:a.scrollLeft,Z=V?0:a.scrollTop;s.push({type:"offset",target:a,matrix:It([I-U+M-_,N-Z+C-T],p)})}else s.push({type:"offset",target:a,origin:G});if(1!==Y&&s.push({type:"zoom",target:a,matrix:fr(zt([Y,Y],p),p,[0,0])}),o||(o=E),r||(r=G),i||(i=A),l||x)break;a=D,c=w,n&&a!==u||(l=c)}return o||(o=At(p)),r||(r=[0,0]),i||(i=[0,0]),{zoom:g,offsetContainer:h,matrixes:s,targetMatrix:o,transformOrigin:r,targetOrigin:i,is3d:f,hasFixed:d}}var Sn=null,Mn=null,Cn=null;function _n(t){t?(window.Map&&(Sn=new Map,Mn=new Map),Cn=[]):(Sn=null,Cn=null,Mn=null)}function Tn(t){var e=null==Sn?void 0:Sn.get(t);if(!e){var n=dt(t).getComputedStyle(t);if(!Sn)return function(t){return n[t]};e={style:n,cached:{}},Sn.set(t,e)}var r=e.cached,i=e.style;return function(t){return t in r||(r[t]=i[t]),r[t]}}function On(t,e,n){var r=n.originalDatas;r.groupable=r.groupable||{};var i=r.groupable;i.childDatas=i.childDatas||[];var o=i.childDatas;return t.moveables.map(function(t,r){return o[r]=o[r]||{},o[r][e]=o[r][e]||{},Te(Te({},n),{isRequestChild:!0,datas:o[r][e],originalDatas:o[r]})})}function Pn(t,e,n,r,i,o,a){var s=!!n.match(/Start$/g),u=!!n.match(/End$/g),c=i.isPinch,l=i.datas,f=On(t,e.name,i),p=t.moveables,d=[],h=f.map(function(t,i){var o=p[i],f=o.state,h=f.gestos,g=t;if(s)g=new an(a).dragStart(r,t),d.push(g);else{if(h[a]||(h[a]=l.childGestos[i]),!h[a])return;g=on(t,f,r,c,0,a),d.push(g)}var v=e[n](o,Te(Te({},g),{parentFlag:!0}));return u&&(h[a]=null),v});return s&&(l.childGestos=p.map(function(t){return t.state.gestos[a]})),{eventParams:h,childEvents:d}}function Rn(t,e,n,r,i,o){void 0===i&&(i=function(t,e){return e});var a=!!n.match(/End$/g),s=On(t,e.name,r),u=t.moveables;return s.map(function(t,r){var o,s=u[r];o=i(s,t);var c=e[n](s,Te(Te({},o),{parentFlag:!0}));return a&&(s.state.gestos={}),c})}function kn(t,e,n,r){var i=n.fixedDirection,o=n.fixedPosition,a=dn(r.datas.startPositions||Gr(e.state),i),s=Oe(Tt(Gt(-t.rotation/180*Math.PI,3),[a[0]-o[0],a[1]-o[1],1],3),2),u=s[0],c=s[1];return r.datas.originalX=u,r.datas.originalY=c,r}function Fn(t,e,n,r){var i=Or(t.props,n),o=i.renderDirections,a=void 0===o?e:o,s=i.displayAroundControls;if(!a)return[];var u=!0===a?Ae:a;return Pe(Pe([],Oe(s?function(t,e,n,r){var i=t.renderState;i.renderDirectionMap||(i.renderDirectionMap={});var o=t.getState(),a=o.renderPoses,s=o.rotation,u=o.direction,c=i.renderDirectionMap,l=t.props.zoom,f=ii(u),p=s/Math.PI*180;return(r||Z(c)).map(function(t){var r=en[t];if(!r)return null;var i=(rt(p,15)+f*nn[t]+720)%180,o=["around-control"];return n&&o.push("direction",n),e.createElement("div",{className:ur.apply(void 0,Pe([],Oe(o),!1)),"data-rotation":i,"data-direction":t,key:"direction-around-".concat(t),style:Tr.apply(void 0,Pe([s,l],Oe(r.map(function(t){return a[t]})),!1))})})}(t,r,n,u):[]),!1),Oe(function(t,e,n,r){var i,o=t.getState(),a=o.renderPoses,s=o.rotation,u=o.direction,c=Or(t.props,e).zoom,l=((i=s/Math.PI*180)<0&&(i=i%360+360),i%360),f={},p=t.renderState;p.renderDirectionMap||(p.renderDirectionMap={});var d=p.renderDirectionMap;n.forEach(function(t){var e=t.dir;f[e]=!0});var h=ii(u);return n.map(function(t){var n=t.data,i=t.classNames,o=t.dir,u=en[o];if(!u||!f[o])return null;d[o]=!0;var p=(rt(l,15)+h*nn[o]+720)%180,g={};return Z(n).forEach(function(t){g["data-".concat(t)]=n[t]}),r.createElement("div",Te({className:ur.apply(void 0,Pe(["control","direction",o,e],Oe(i),!1)),"data-rotation":p,"data-direction":o},g,{key:"direction-".concat(o),style:Tr.apply(void 0,Pe([s,c],Oe(u.map(function(t){return a[t]})),!1))}))})}(t,n,u.map(function(t){return{data:{},classNames:[],dir:t}}),r)),!1)}function Bn(t,e,n,r,i,o){for(var a=[],s=6;s<arguments.length;s++)a[s-6]=arguments[s];var u=tt(n,r),c=e?rt(u/Math.PI*180,15)%180:-1;return t.createElement("div",{key:"line-".concat(o),className:ur.apply(void 0,Pe(["line","direction",e?"edge":"",e],Oe(a),!1)),"data-rotation":c,"data-line-key":o,"data-direction":e,style:_r(n,r,i,u)})}function Gn(t,e,n,r,i){return(!0===n?Ge:n).map(function(n,o){var a=Oe(en[n],2),s=a[0],u=a[1];if(null!=u)return Bn(t,n,r[s],r[u],i,"".concat(e,"Edge").concat(o),e)}).filter(Boolean)}function An(t,e){var n=t.state,r=n.containerClientRect,i=r.clientHeight,o=r.clientWidth,a=r.clientLeft,s=r.clientTop,u=n.snapOffset,c=u.left,l=u.top,f=u.right,p=u.bottom,d=t.props.bounds||{},h="css"===(d.position||"client"),g=d.left,v=void 0===g?-1/0:g,m=d.top,b=void 0===m?-1/0:m,x=d.right,y=void 0===x?h?-1/0:1/0:x,E=d.bottom,D=void 0===E?h?-1/0:1/0:E;return h&&(y=o+f-c-y,D=i+p-l-D),{left:v+c-a,right:y+c-a,top:b+l-s,bottom:D+l-s}}function zn(t,e,n){var r=t[n?"left":"top"],i=t[n?"right":"bottom"],o=Math.min.apply(Math,Pe([],Oe(e),!1)),a=Math.max.apply(Math,Pe([],Oe(e),!1)),s=[];return r+1>o&&s.push({direction:"start",isBound:!0,offset:o-r,pos:r}),i-1<a&&s.push({direction:"end",isBound:!0,offset:a-i,pos:i}),s.length||s.push({isBound:!1,offset:0,pos:0}),s.sort(function(t,e){return oi(e.offset)-oi(t.offset)})}var In=["left","right","center"],Nn=["top","bottom","middle"];function Yn(t,e){var n=t.props,r=n.snappable,i=n.bounds,o=n.innerBounds,a=n.verticalGuidelines,s=n.horizontalGuidelines,u=n.snapGridWidth,c=n.snapGridHeight,l=t.state,f=l.guidelines,p=l.enableSnap;return!(!r||!p||e&&!0!==r&&r.indexOf(e)<0||!(u||c||i||o||f&&f.length||a&&a.length||s&&s.length))}function Xn(t){return!1===t?{}:!0!==t&&t?t:{left:!0,right:!0,top:!0,bottom:!0}}function Wn(t,e,n,r,i,o,a){var s;void 0===r&&(r=[]),void 0===i&&(i=[]);var u=t.props,c=(null===(s=t.state.snapThresholdInfo)||void 0===s?void 0:s.multiples)||[1,1],l=jr(a,u.snapHorizontalThreshold,5),f=jr(o,u.snapVerticalThreshold,5);return function(t,e,n,r,i,o,a,s){return{vertical:qn(t,"vertical",e,a*s[0],r),horizontal:qn(t,"horizontal",n,o*s[1],i)}}(t.state.guidelines,e,n,r,i,l,f,c)}function Hn(t){var e=t.isSnap;if(!e)return{isSnap:!1,offset:0,dist:-1,pos:0,guideline:null};var n=t.posInfos[0],r=n.guidelineInfos[0],i=r.offset,o=r.dist,a=r.guideline;return{isSnap:e,offset:i,dist:o,pos:n.pos,guideline:a}}function qn(t,e,n,r,i){var o,a;if(void 0===i&&(i=[]),!t||!t.length)return{isSnap:!1,index:-1,direction:"",posInfos:[]};var s="vertical"===e?0:1,u=n.map(function(n,o){var a=i[o]||"",u=t.map(function(t){var e=t.pos,r=n-e[s];return{offset:r,dist:oi(r),guideline:t,direction:a}}).filter(function(t){var n=t.guideline,i=t.dist;return!(n.type!==e||i>r)}).sort(function(t,e){return t.dist-e.dist});return{pos:n,index:o,guidelineInfos:u,direction:a}}).filter(function(t){return t.guidelineInfos.length>0}).sort(function(t,e){return t.guidelineInfos[0].dist-e.guidelineInfos[0].dist}),c=u.length>0;return{isSnap:c,index:c?u[0].index:-1,direction:null!==(a=null===(o=u[0])||void 0===o?void 0:o.direction)&&void 0!==a?a:"",posInfos:u}}function jn(t,e){return t.slice().sort(function(t,n){var r=t.sign[e],i=n.sign[e],o=t.offset[e],a=n.offset[e];return r?i?function(t,e){var n=oi(t.offset),r=oi(e.offset);return t.isBound&&e.isBound?r-n:t.isBound?-1:e.isBound?1:t.isSnap&&e.isSnap?r-n:t.isSnap?-1:e.isSnap||n<Je?1:r<Je?-1:n-r}({isBound:t.isBound,isSnap:t.isSnap,offset:o},{isBound:n.isBound,isSnap:n.isSnap,offset:a}):-1:1})[0]}function Ln(t,e){var n,r,i=Oe(e,2),o=i[0],a=i[1],s=a[0]-o[0],u=a[1]-o[1];return oi(s)<Je&&(s=0),oi(u)<Je&&(u=0),s?u?(n=u/s*(t[0]-o[0])+o[1],r=t[1]):(n=o[1],r=t[1]):(n=o[0],r=t[0]),n-r}function Vn(t,e,n,r,i){return void 0===i&&(i=0),r&&e-i<=t||!r&&t<=n+i?{isBound:!0,offset:r?e-t:n-t}:{isBound:!1,offset:0}}function Un(t,e,n,r,i,o){var a,s,u=Oe(e,2),c=u[0],l=u[1],f=t[0],p=n[0],d=n[1],h=Kr(d[1]-p[1]),g=l,v=-c/l;return Kr(d[0]-p[0])?h?{isBound:!1,offset:0}:c?Vn((p[1]-f[1])/v+f[0],p[0],d[0],r,i):{isBound:s=oi(a=p[1]-f[1])<=0,offset:s?a:0}:g?Vn(v*(p[0]-f[0])+f[1],p[1],d[1],r,i):{isBound:s=oi(a=p[0]-f[0])<=0,offset:s?a:0}}function Zn(t,e,n){return e.map(function(e){var r=function(t,e){var n=e.line,r=e.centerSign,i=e.verticalSign,o=e.horizontalSign,a=e.lineConstants,s=t.props.innerBounds;if(!s)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var u=s.left,c=s.top,l=s.width,f=s.height,p=[[u,c],[u,c+f]],d=[[u,c],[u+l,c]],h=[[u+l,c],[u+l,c+f]],g=[[u,c+f],[u+l,c+f]];if(function(t,e,n,r){return void 0===r&&(r=Je),t.every(function(t){var i=Ln(t,e);return i<=0===n||oi(i)<=r})}([[u,c],[u+l,c],[u,c+f],[u+l,c+f]],n,r))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var v=Un(n,a,d,i),m=Un(n,a,g,i),b=Un(n,a,p,o),x=Un(n,a,h,o),y=v.isBound&&m.isBound,E=v.isBound||m.isBound,D=b.isBound&&x.isBound,w=b.isBound||x.isBound,S=Vr(v.offset,m.offset),M=Vr(b.offset,x.offset),C=[0,0],_=!1,T=!1;return oi(M)<oi(S)?(C=[S,0],_=E,T=y):(C=[0,M],_=w,T=D),{isAllBound:T,isVerticalBound:E,isHorizontalBound:w,isBound:_,offset:C}}(t,e),i=r.isBound,o=r.offset,a=r.isVerticalBound,s=r.isHorizontalBound,u=e.multiple,c=fn({datas:n,distX:o[0],distY:o[1]}).map(function(t,e){return t*(u[e]?2/u[e]:0)});return{sign:u,isBound:i,isVerticalBound:a,isHorizontalBound:s,isSnap:!1,offset:c}})}function Kn(t,e,n,r){var i=t.state,o=wr(i.allMatrix,100,100,i.is3d?4:3),a=dn(o,[0,0]);return function(t,e){var n=[],r=t[0],i=t[1];return r&&i?n.push([[0,2*i],t,[-r,i]],[[2*r,0],t,[r,-i]]):r?(n.push([[2*r,0],[r,1],[r,-1]]),e&&n.push([[0,-1],[r,-1],[-r,-1]],[[0,1],[r,1],[-r,1]])):i?(n.push([[0,2*i],[1,i],[-1,i]]),e&&n.push([[-1,0],[-1,i],[-1,-i]],[[1,0],[1,i],[1,-i]])):n.push([[-1,0],[-1,-1],[-1,1]],[[1,0],[1,-1],[1,1]],[[0,-1],[-1,-1],[1,-1]],[[0,1],[-1,1],[1,1]]),n}(n,r).map(function(t){var n=Oe(t,3),r=n[0],i=n[1],s=n[2],u=[dn(o,i),dn(o,s)],c=function(t){var e=Oe(t,2),n=e[0],r=e[1],i=r[0]-n[0],o=r[1]-n[1];Math.abs(i)<_&&(i=0),Math.abs(o)<_&&(o=0);var a=0,s=0,u=0;return i?o?(s=1,u=(a=-o/i)*n[0]-n[1]):(s=1,u=-n[1]):(a=-1,u=n[0]),[a,s,u].map(function(t){return rt(t,_)})}(u),l=function(t,e){var n=Q([e[0][0],e[1][0]]),r=Q([e[0][1],e[1][1]]);return{vertical:n<=t[0],horizontal:r<=t[1]}}(a,u),f=l.vertical,p=l.horizontal;return{multiple:r,centerSign:Ln(a,u)<=0,verticalSign:f,horizontalSign:p,lineConstants:c,line:[dn(e,i),dn(e,s)]}})}function $n(t,e,n,r,i){var o=function(t,e,n,r){var i=e[0]-t[0],o=e[1]-t[1];if(oi(i)<_&&(i=0),oi(o)<_&&(o=0),!i)return r?[0,0]:[0,n];if(!o)return r?[n,0]:[0,0];var a=o/i,s=t[1]-a*t[0];return r?[n,a*(e[0]+n)+s-e[1]]:[(e[1]+n-s)/a-e[0],n]}(t,e,n,r);if(!o)return{isOutside:!1,offset:[0,0]};var a=nt(t,e),s=nt(o,t),u=nt(o,e),c=s>a||u>a,l=Oe(fn({datas:i,distX:o[0],distY:o[1]}),2);return{offset:[l[0],l[1]],isOutside:c}}function Jn(t,e){return t.isBound?t.offset:e.isSnap?Hn(e).offset:0}function Qn(t,e,n,r,i,o){if(!Yn(t,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var a=Br(o.absolutePoses,[e,n]),s=Sr(a),u=s.left,c=s.right,l=s.top,f=s.bottom,p={horizontal:a.map(function(t){return t[1]}),vertical:a.map(function(t){return t[0]})},d=tr(t,i,function(t,e){var n=function(t,e){var n=Xn(t),r={};for(var i in n)i in e&&n[i]&&(r[i]=e[i]);return r}(t,e),r=Nn.filter(function(t){return t in n}),i=In.filter(function(t){return t in n});return{horizontalNames:r,verticalNames:i,horizontal:r.map(function(t){return n[t]}),vertical:i.map(function(t){return n[t]})}}(Xn(t.props.snapDirections),{left:u,right:c,top:l,bottom:f,center:(u+c)/2,middle:(l+f)/2}),p),h=d.vertical,g=d.horizontal,v=function(t,e,n){var r,i=Zn(t,Kn(t,e,[0,0],!1).map(function(t){return Te(Te({},t),{multiple:t.multiple.map(function(t){return 2*oi(t)})})}),n),o=jn(i,0),a=jn(i,1),s=0,u=0,c=o.isVerticalBound||a.isVerticalBound,l=o.isHorizontalBound||a.isHorizontalBound;return(c||l)&&(r=Oe(function(t){var e=t.datas,n=t.distX,r=t.distY;e.beforeMatrix;var i=e.matrix,o=e.is3d;e.startDragBeforeDist;var a=e.startDragDist,s=e.absoluteOrigin,u=o?4:3;return Mt(Tt(i,St(a,[n,r]),u),s)}({datas:n,distX:-o.offset[0],distY:-a.offset[1]}),2),s=r[0],u=r[1]),{vertical:{isBound:c,offset:s},horizontal:{isBound:l,offset:u}}}(t,a,o),m=v.vertical,b=v.horizontal,x=h.isSnap,y=g.isSnap,E=h.isBound||m.isBound,D=g.isBound||b.isBound,w=Oe(function(t,e,n,r,i){var o=Oe(e,2),a=o[0],s=o[1],u=Oe(n,2),c=u[0],l=u[1],f=Oe(r,2),p=f[0],d=f[1],h=Oe(i,2),g=h[0],v=h[1],m=-g,b=-v;if(t&&a&&s){m=0,b=0;var x=[];if(c&&l?x.push([0,v],[g,0]):c?x.push([g,0]):l?x.push([0,v]):p&&d?x.push([0,v],[g,0]):p?x.push([g,0]):d&&x.push([0,v]),x.length){x.sort(function(t,e){return Cr(Mt([a,s],t))-Cr(Mt([a,s],e))});var y=x[0];if(y[0]&&oi(a)>_)m=-y[0],b=s*oi(a+m)/oi(a)-s;else if(y[1]&&oi(s)>_){var E=s;b=-y[1],m=a*oi(s+b)/oi(E)-a}if(t&&l&&c)if(oi(m)>_&&oi(m)<oi(g))m*=D=oi(g)/oi(m),b*=D;else if(oi(b)>_&&oi(b)<oi(v)){var D;m*=D=oi(v)/oi(b),b*=D}else m=Vr(-g,m),b=Vr(-v,b)}}else m=a||c?-g:0,b=s||l?-v:0;return[m,b]}(r,[e,n],[E,D],[x,y],[Vr(h.offset,m.offset),Vr(g.offset,b.offset)]),2);return[{isBound:E,isSnap:x,offset:w[0]},{isBound:D,isSnap:y,offset:w[1]}]}function tr(t,e,n,r){void 0===r&&(r=n);var i=function(t,e,n){var r=t||{},i=r.position,o=void 0===i?"client":i,a=r.left,s=void 0===a?-1/0:a,u=r.top,c=void 0===u?-1/0:u,l=r.right,f=void 0===l?1/0:l,p=r.bottom,d={position:o,left:s,top:c,right:f,bottom:void 0===p?1/0:p};return{vertical:zn(d,e,!0),horizontal:zn(d,n,!1)}}(An(t),r.vertical,r.horizontal),o=i.horizontal,a=i.vertical,s=e?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:Wn(t,n.vertical,n.horizontal,void 0,void 0,void 0,void 0),u=s.horizontal,c=s.vertical,l=Jn(o[0],u),f=Jn(a[0],c),p=oi(l),d=oi(f);return{horizontal:{isBound:o[0].isBound,isSnap:u.isSnap,snapIndex:u.index,offset:l,dist:p,bounds:o,snap:u},vertical:{isBound:a[0].isBound,isSnap:c.isSnap,snapIndex:c.index,offset:f,dist:d,bounds:a,snap:c}}}function er(t,e){return t.isBound?t.offset:e.isSnap?e.offset:0}var nr,rr={name:"draggable",props:["draggable","throttleDrag","throttleDragRotate","hideThrottleDragRotateLine","startDragRotate","edgeDraggable"],events:["dragStart","drag","dragEnd","dragGroupStart","dragGroup","dragGroupEnd"],requestStyle:function(){return["left","top","right","bottom"]},requestChildStyle:function(){return["left","top","right","bottom"]},render:function(t,e){var n=t.props,r=n.hideThrottleDragRotateLine,i=n.throttleDragRotate,o=n.zoom,a=t.getState(),s=a.dragInfo,u=a.beforeOrigin;if(r||!i||!s)return[];var c=s.dist;if(!c[0]&&!c[1])return[];var l=Cr(c),f=tt(c,[0,0]);return[e.createElement("div",{className:ur("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:"".concat(l,"px"),transform:"translate(".concat(u[0],"px, ").concat(u[1],"px) rotate(").concat(f,"rad) scaleY(").concat(o,")")}})]},dragStart:function(t,e){var n=e.datas,r=e.parentEvent,i=e.parentGesto,o=t.state,a=o.gestos,s=o.style;if(a.draggable)return!1;a.draggable=i||t.targetGesto,n.datas={},n.left=parseFloat(s.left||"")||0,n.top=parseFloat(s.top||"")||0,n.bottom=parseFloat(s.bottom||"")||0,n.right=parseFloat(s.right||"")||0,n.startValue=[0,0],un(t,e),function(t,e){gn(t,e,H(vn(e).startTransforms,function(t){return 0===t.indexOf("".concat("translate","("))}))}(t,e),function(t,e){e.absolutePoses=Gr(t.state)}(t,n),n.prevDist=[0,0],n.prevBeforeDist=[0,0],n.isDrag=!1,n.deltaOffset=[0,0];var u=Nr(t,e,Te({set:function(t){n.startValue=t}},function(t,e){var n=vn(e);return{setTransform:function(r,i){void 0===i&&(i=-1),n.startTransforms=k(r)?r:N(r),gn(t,e,i)},setTransformIndex:function(n){gn(t,e,n)}}}(t,e)));return!1!==(r||Xr(t,"onDragStart",u))?(n.isDrag=!0,t.state.dragInfo={startRect:t.getRect(),dist:[0,0]}):(a.draggable=null,n.isPinch=!1),!!n.isDrag&&u},drag:function(t,e){if(e){cn(t,e,"translate");var n=e.datas,r=e.parentEvent,i=e.parentFlag,o=e.isPinch,a=e.deltaOffset,s=e.useSnap,u=e.isRequest,c=e.isGroup,l=e.parentThrottleDrag,f=e.distX,p=e.distY,d=n.isDrag,h=n.prevDist,g=n.prevBeforeDist,v=n.startValue;if(d){a&&(f+=a[0],p+=a[1]);var m=t.props,b=m.parentMoveable,x=c?0:m.throttleDrag||l||0,y=r?0:m.throttleDragRotate||0,E=0,D=!1,w=!1,S=!1,M=!1;if(!r&&y>0&&(f||p)){var C=m.startDragRotate||0,_=rt(C+180*tt([0,0],[f,p])/Math.PI,y)-C,T=p*Math.abs(Math.cos((_-90)/180*Math.PI)),O=Cr([f*Math.abs(Math.cos(_/180*Math.PI)),T]);E=_*Math.PI/180,f=O*Math.cos(E),p=O*Math.sin(E)}if(!o&&!r&&!i){var P=Oe(Qn(t,f,p,y,!s&&u||a,n),2),R=P[0],k=P[1];D=R.isSnap,w=R.isBound,S=k.isSnap,M=k.isBound,f+=R.offset,p+=k.offset}var F=St(ln({datas:n,distX:f,distY:p}),v),B=St(function(t){var e=t.datas,n=Oe(ln({datas:e,distX:t.distX,distY:t.distY}),2),r=function(t,e){var n=t.beforeTransform,r=t.afterTransform;t.beforeTransform2,t.afterTransform2;var i=wt(e,t.targetAllTransform,4),o=wt(xt(n,4),i,4);return wt(o,xt(r,4),4)}(e,function(t){for(var e=At(4),n=0;n<3;++n)e[12+n]=t[n]||0;return e}([n[0],n[1]]));return Tt(r,yt([0,0,0],4),4)}({datas:n,distX:f,distY:p}),v);it(B,Je),it(F,Je),y||(D||w||(B[0]=rt(B[0],x),F[0]=rt(F[0],x)),S||M||(B[1]=rt(B[1],x),F[1]=rt(F[1],x)));var G=Mt(F,v),A=Mt(B,v),z=Mt(A,h),I=Mt(G,g);n.prevDist=A,n.prevBeforeDist=G,n.passDelta=z,n.passDist=A;var Y=n.left+G[0],X=n.top+G[1],W=n.right-G[0],H=n.bottom-G[1],q=function(t,e,n){return"".concat(t.beforeFunctionTexts.join(" ")," ").concat(t.isAppendTransform?n:e," ").concat(t.afterFunctionTexts.join(" "))}(n,"translate(".concat(B[0],"px, ").concat(B[1],"px)"),"translate(".concat(A[0],"px, ").concat(A[1],"px)"));if(function(t,e){vn(t).nextTransforms=N(e)}(e,q),t.state.dragInfo.dist=r?[0,0]:A,r||b||!z.every(function(t){return!t})||!I.some(function(t){return!t})){var j=t.state,L=j.width,V=j.height,U=Nr(t,e,Te({transform:q,dist:A,delta:z,translate:B,beforeDist:G,beforeDelta:I,beforeTranslate:F,left:Y,top:X,right:W,bottom:H,width:L,height:V,isPinch:o},Ir({transform:q},e)));return!r&&Xr(t,"onDrag",U),U}}}},dragAfter:function(t,e){var n=e.datas,r=n.deltaOffset;return!(!r[0]&&!r[1])&&(n.deltaOffset=[0,0],this.drag(t,Te(Te({},e),{deltaOffset:r})))},dragEnd:function(t,e){var n=e.parentEvent,r=e.datas;if(t.state.dragInfo=null,r.isDrag){r.isDrag=!1;var i=Yr(t,e,{});return!n&&Xr(t,"onDragEnd",i),i}},dragGroupStart:function(t,e){var n,r,i=e.datas,o=e.clientX,a=e.clientY,s=this.dragStart(t,e);if(!s)return!1;var u=Pn(t,this,"dragStart",[o||0,a||0],e,0,"draggable"),c=u.childEvents,l=u.eventParams,f=Xr(t,"onDragGroupStart",Te(Te({},s),{targets:t.props.targets,events:l}));i.isDrag=!1!==f;var p=null!==(r=null===(n=c[0])||void 0===n?void 0:n.datas.startValue)&&void 0!==r?r:[0,0];return i.throttleOffset=[p[0]%1,p[1]%1],!!i.isDrag&&s},dragGroup:function(t,e){if(e.datas.isDrag){var n=this.drag(t,Te(Te({},e),{parentThrottleDrag:t.props.throttleDrag})),r=Pn(t,this,"drag",e.datas.passDelta,e,0,"draggable").eventParams;if(n){var i=Te({targets:t.props.targets,events:r},n);return Xr(t,"onDragGroup",i),i}}},dragGroupEnd:function(t,e){var n=e.isDrag;if(e.datas.isDrag){this.dragEnd(t,e);var r=Pn(t,this,"dragEnd",[0,0],e,0,"draggable").eventParams;return Xr(t,"onDragGroupEnd",Yr(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=t.getRect(),r=0,i=0,o=!1;return{isControl:!1,requestStart:function(t){return o=t.useSnap,{datas:e,useSnap:o}},request:function(t){return"x"in t?r=t.x-n.left:"deltaX"in t&&(r+=t.deltaX),"y"in t?i=t.y-n.top:"deltaY"in t&&(i+=t.deltaY),{datas:e,distX:r,distY:i,useSnap:o}},requestEnd:function(){return{datas:e,isDrag:!0,useSnap:o}}}},unset:function(t){t.state.gestos.draggable=null,t.state.dragInfo=null}},ir=$r("resizable"),or={name:"resizable",ableGroup:"size",canPinch:!0,props:["resizable","throttleResize","renderDirections","displayAroundControls","keepRatio","resizeFormat","keepRatioFinally","edge","checkResizableError"],events:["resizeStart","beforeResize","resize","resizeEnd","resizeGroupStart","beforeResizeGroup","resizeGroup","resizeGroupEnd"],render:(nr="resizable",function(t,e){var n=Or(t.props,nr).edge;return n&&(!0===n||n.length)?Pe(Pe([],Oe(Gn(e,nr,n,t.getState().renderPoses,t.props.zoom)),!1),Oe(function(t,e,n){return Fn(t,["nw","ne","sw","se"],nr,n)}(t,0,e)),!1):function(t,e,n){return Fn(t,Ae,nr,n)}(t,0,e)}),dragControlCondition:ir,viewClassName:function(t){return function(e){if(!e.isDragging(t))return"";var n=function(t,e){var n,r=t.targetGesto,i=t.controlGesto;return(null==r?void 0:r.isFlag())&&(n=r.getEventData()[e]),!n&&(null==i?void 0:i.isFlag())&&(n=i.getEventData()[e]),n||{}}(e,t),r=n.deg;return r?ur("view-control-rotation".concat(r)):""}}("resizable"),dragControlStart:function(t,e){var n,r=e.inputEvent,i=e.isPinch,o=e.isGroup,a=e.parentDirection,s=e.parentGesto,u=e.datas,c=e.parentFixedDirection,l=e.parentEvent,f=function(t,e,n,r){var i;return i=t||(e?[0,0]:function(t,e){if(t){var n=t.getAttribute("data-rotation")||"",r=t.getAttribute("data-direction");if(e.deg=n,r){var i=[0,0];return r.indexOf("w")>-1&&(i[0]=-1),r.indexOf("e")>-1&&(i[0]=1),r.indexOf("n")>-1&&(i[1]=-1),r.indexOf("s")>-1&&(i[1]=1),i}}}(n.target,r)),i}(a,i,r,u),p=t.state,d=p.target,h=p.width,g=p.height,v=p.gestos;if(!f||!d)return!1;if(v.resizable)return!1;v.resizable=s||t.controlGesto,!i&&un(t,e),u.datas={},u.direction=f,u.startOffsetWidth=h,u.startOffsetHeight=g,u.prevWidth=0,u.prevHeight=0,u.minSize=[0,0],u.startWidth=p.inlineCSSWidth||p.cssWidth,u.startHeight=p.inlineCSSHeight||p.cssHeight,u.maxSize=[1/0,1/0],o||(u.minSize=[p.minOffsetWidth,p.minOffsetHeight],u.maxSize=[p.maxOffsetWidth,p.maxOffsetHeight]);var m=t.props.transformOrigin||"% %";function b(t){u.ratio=t&&isFinite(t)?t:0}function x(t){var e=function(t,e){return{fixedPosition:dn(t,e),fixedDirection:e,fixedOffset:[0,0]}}(u.startPositions,t);u.fixedDirection=e.fixedDirection,u.fixedPosition=e.fixedPosition,u.fixedOffset=e.fixedOffset}function y(e){var n=function(t,e){var n=t.allMatrix,r=t.is3d,i=t.width,o=t.height,a=r?4:3,s=function(t,e,n){return[e?t[0]/(e/2)-1:0,n?t[1]/(n/2)-1:0]}(e,i,o);return{fixedPosition:Dr(n,e,a),fixedDirection:s,fixedOffset:[i?0:e[0],o?0:e[1]]}}(t.state,e);u.fixedDirection=n.fixedDirection,u.fixedPosition=n.fixedPosition,u.fixedOffset=n.fixedOffset}function E(t){u.minSize=[K("".concat(t[0]),0)||0,K("".concat(t[1]),0)||0]}function D(t){var e=[t[0]||1/0,t[1]||1/0];B(e[0])&&!isFinite(e[0])||(e[0]=K("".concat(e[0]),0)||1/0),B(e[1])&&!isFinite(e[1])||(e[1]=K("".concat(e[1]),0)||1/0),u.maxSize=e}u.transformOrigin=F(m)?m.split(" "):m,u.startOffsetMatrix=p.offsetMatrix,u.startTransformOrigin=p.transformOrigin,u.isWidth=null!==(n=null==e?void 0:e.parentIsWidth)&&void 0!==n?n:!f[0]&&!f[1]||f[0]||!f[1],u.startPositions=Gr(t.state),b(h/g),x(c||[-f[0],-f[1]]),u.setFixedDirection=x,u.setFixedPosition=y,u.setMin=E,u.setMax=D;var w=Nr(t,e,{direction:f,startRatio:u.ratio,set:function(t){var e=Oe(t,2),n=e[0],r=e[1];u.startWidth=n,u.startHeight=r},setMin:E,setMax:D,setRatio:b,setFixedDirection:x,setFixedPosition:y,setOrigin:function(t){u.transformOrigin=t},dragStart:rr.dragStart(t,(new an).dragStart([0,0],e))}),S=l||Xr(t,"onResizeStart",w);return u.startFixedDirection=u.fixedDirection,u.startFixedPosition=u.fixedPosition,!1!==S&&(u.isResize=!0,t.state.snapRenderInfo={request:e.isRequest,direction:f}),!!u.isResize&&w},dragControl:function(t,e){var n,r=e.datas,i=e.parentFlag,o=e.isPinch,a=e.parentKeepRatio,s=e.dragClient,u=e.parentDist,c=e.useSnap,l=e.isRequest,f=e.isGroup,p=e.parentEvent,d=e.resolveMatrix,h=r.isResize,g=r.transformOrigin,v=r.startWidth,m=r.startHeight,b=r.prevWidth,x=r.prevHeight,y=r.minSize,E=r.maxSize,D=r.ratio,w=r.startOffsetWidth,S=r.startOffsetHeight,M=r.isWidth;if(h){if(d){var C=t.state.is3d,_=r.startOffsetMatrix,T=r.startTransformOrigin,O=C?4:3,P=Xt(mn(e)),R=Math.sqrt(P.length);O!==R&&(P=Et(P,R,O));var k=hn(_,P,T,O),F=wr(k,w,S,O);r.startPositions=F,r.nextTargetMatrix=P,r.nextAllMatrix=k}var G=Or(t.props,"resizable"),A=G.resizeFormat,z=G.throttleResize,I=void 0===z?i?0:1:z,N=G.parentMoveable,Y=G.keepRatioFinally,X=r.direction,W=X,H=0,q=0;X[0]||X[1]||(W=[1,1]);var j=D&&(null!=a?a:G.keepRatio)||!1,L=Oe(dt(),2),V=L[0],U=L[1];p||(r.setFixedDirection(r.fixedDirection),Xr(t,"onBeforeResize",Nr(t,e,{startFixedDirection:r.startFixedDirection,startFixedPosition:r.startFixedPosition,setFixedDirection:function(t){var e;return r.setFixedDirection(t),e=Oe(dt(),2),V=e[0],U=e[1],[V,U]},setFixedPosition:function(t){var e;return r.setFixedPosition(t),e=Oe(dt(),2),V=e[0],U=e[1],[V,U]},boundingWidth:V,boundingHeight:U,setSize:function(t){var e;e=Oe(t,2),V=e[0],U=e[1]}},!0)));var Z=s;s||(Z=!i&&o?function(t){return dn(Gr(t.state),[0,0])}(t):r.fixedPosition);var K=[0,0];if(o||(K=function(t,e,n,r,i,o,a){if(!Yn(t,"resizable"))return[0,0];var s=a.fixedDirection,u=a.nextAllMatrix,c=t.state,l=c.allMatrix,f=c.is3d;return function(t,e,n,r,i,o,a,s){for(var u=Gr(t.state),c=t.props.keepRatio,l=0,f=0,p=0;p<2;++p){var d=sr(t,e(l,f),i,c,a,s),h=d.width,g=d.height,v=h.isBound,m=g.isBound,b=h.offset,x=g.offset;if(1===p&&(v||(b=0),m||(x=0)),0===p&&a&&!v&&!m)return[0,0];if(c){var y=oi(b)*(n?1/n:1),E=oi(x)*(r?1/r:1);(v&&m?y<E:m||!v&&y<E)?b=n*x/r:x=r*b/n}l+=b,f+=x}if(!c&&i[0]&&i[1]){var D=function(t,e,n,r,i){var o=[-n[0],-n[1]],a=t.state,s=a.width,u=a.height,c=t.props.bounds,l=1/0,f=1/0;if(c){var p=[[n[0],-n[1]],[-n[0],n[1]]],d=c.left,h=void 0===d?-1/0:d,g=c.top,v=void 0===g?-1/0:g,m=c.right,b=void 0===m?1/0:m,x=c.bottom,y=void 0===x?1/0:x;p.forEach(function(t){var n=t[0]!==o[0],a=t[1]!==o[1],c=dn(e,t),p=360*tt(r,c)/Math.PI;if(a){var d=c.slice();(oi(p-360)<2||oi(p-180)<2)&&(d[1]=r[1]);var g=$n(r,d,(r[1]<c[1]?y:v)-c[1],!1,i),m=Oe(g.offset,2)[1],x=g.isOutside;isNaN(m)||(f=u+(x?1:-1)*oi(m))}if(n){d=c.slice(),(oi(p-90)<2||oi(p-270)<2)&&(d[0]=r[0]);var E=$n(r,d,(r[0]<c[0]?b:h)-c[0],!0,i),D=Oe(E.offset,1)[0],w=E.isOutside;isNaN(D)||(l=s+(w?1:-1)*oi(D))}})}return{maxWidth:l,maxHeight:f}}(t,u,i,o,s),w=D.maxWidth,S=D.maxHeight,M=Oe(function(t,e,n,r,i,o,a,s,u){var c=dn(e,a),l=tr(t,s,{vertical:[c[0]],horizontal:[c[1]]}),f=l.horizontal.offset,p=l.vertical.offset;if(rt(p,$e)||rt(f,$e)){var d=Oe(fn({datas:u,distX:-p,distY:-f}),2),h=d[0],g=d[1];return[Math.min(i||1/0,n+a[0]*h)-n,Math.min(o||1/0,r+a[1]*g)-r]}return[0,0]}(t,e(l,f).map(function(t){return t.map(function(t){return rt(t,$e)})}),n+l,r+f,w,S,i,a,s),2);l+=b=M[0],f+=x=M[1]}return[l,f]}(t,function(t,r){return function(t,e,n,r,i,o){var a=wr(t,e,n,o?4:3);return Br(a,Mt(i,dn(a,r)))}(u||l,e+t,n+r,s,i,f)},e,n,r,i,o,a)}(t,V,U,X,Z,!c&&l,r)),u&&(!u[0]&&(K[0]=0),!u[1]&&(K[1]=0)),j){W[0]&&W[1]&&K[0]&&K[1]&&(oi(K[0])>oi(K[1])?K[1]=0:K[0]=0);var Q=!K[0]&&!K[1];Q&&ht(),W[0]&&!W[1]||K[0]&&!K[1]||Q&&M?(V+=K[0],U=V/D):(!W[0]&&W[1]||!K[0]&&K[1]||Q&&!M)&&(U+=K[1],V=U*D)}else V+=K[0],U+=K[1],V=Math.max(0,V),U=Math.max(0,U);n=Oe(function(t,e,n,r){if(!r)return t.map(function(t,r){return $(t,e[r],n[r])});var i=t[0],o=t[1],a=!0===r?i/o:r,s=J(t,e,!1,a),u=s[0],c=s[1],l=J(t,n,!0,a),f=l[0],p=l[1];return i<u||o<c?(i=u,o=c):(i>f||o>p)&&(i=f,o=p),[i,o]}([V,U],y,E,!!j&&D),2),V=n[0],U=n[1],ht(),j&&(f||Y)&&(M?U=V/D:V=U*D);var et=[(H=V-w)-b,(q=U-S)-x];r.prevWidth=H,r.prevHeight=q;var nt=yn(t,V,U,Z,g,r);if(N||!et.every(function(t){return!t})||!nt.every(function(t){return!t})){var it,ot,at,st,ut=rr.drag(t,on(e,t.state,nt,!!o,0,"draggable")),ct=ut.transform,lt=v+H,ft=m+q,pt=Nr(t,e,Te({width:lt,height:ft,offsetWidth:Math.round(V),offsetHeight:Math.round(U),startRatio:D,boundingWidth:V,boundingHeight:U,direction:X,dist:[H,q],delta:et,isPinch:!!o,drag:ut},(it={style:{width:"".concat(lt,"px"),height:"".concat(ft,"px")},transform:ct},at=e,st=(ot=ut).afterTransform||ot.transform,Te(Te({},Ir(Te(Te(Te({},it.style),ot.style),{transform:st}),at)),{afterTransform:st,transform:it.transform}))));return!p&&Xr(t,"onResize",pt),pt}}function dt(){var t=r.fixedDirection,n=function(t,e,n,r){var i,o=n.ratio,a=n.startOffsetWidth,s=n.startOffsetHeight,u=0,c=0,l=r.distX,f=r.distY,p=r.pinchScale,d=r.parentDistance,h=r.parentDist,g=r.parentScale,v=n.fixedDirection,m=[0,1].map(function(e){return oi(t[e]-v[e])}),b=[0,1].map(function(t){var e=m[t];return 0!==e&&(e=2/e),e});if(h)u=h[0],c=h[1],e&&(u?c||(c=u/o):u=c*o);else if(B(p))u=(p-1)*a,c=(p-1)*s;else if(g)u=(g[0]-1)*a,c=(g[1]-1)*s;else if(d){var x=a*m[0],y=s*m[1],E=Cr([x,y]);u=d/E*x*b[0],c=d/E*y*b[1]}else{var D=fn({datas:n,distX:l,distY:f});D=b.map(function(t,e){return D[e]*t}),i=Oe(function(t,e,n,r,i){var o=Oe(t,2),a=o[0],s=o[1],u=0,c=0;if(i&&a&&s){var l=tt([0,0],e),f=tt([0,0],r),p=Cr(e),d=Math.cos(l-f)*p;if(r[0])if(r[1]){var h=r[0]*a,g=r[1]*s,v=Math.atan2(h+e[0],g+e[1]),m=Math.atan2(h,g);v<0&&(v+=2*Math.PI),m<0&&(m+=2*Math.PI);var b=0;(b=oi(v-m)<Math.PI/2||oi(v-m)>Math.PI/2*3?v-m:v-(m+=Math.PI))>2*Math.PI?b-=2*Math.PI:b>Math.PI?b=2*Math.PI-b:b<-Math.PI&&(b=-2*Math.PI-b);var x=Cr([h+e[0],g+e[1]])*Math.cos(b);u=x*Math.sin(m)-h,c=x*Math.cos(m)-g,r[0]<0&&(u*=-1),r[1]<0&&(c*=-1)}else c=(u=d)/n;else u=(c=d)*n}else u=r[0]*e[0],c=r[1]*e[1];return[u,c]}([a,s],D,o,t,e),2),u=i[0],c=i[1]}return{distWidth:u,distHeight:c}}(W,j,r,e);H=n.distWidth,q=n.distHeight;var i=W[0]-t[0]||j?Math.max(w+H,Je):w,o=W[1]-t[1]||j?Math.max(S+q,Je):S;return j&&w&&S&&(M?o=i/D:i=o*D),[i,o]}function ht(){var t;A&&(t=Oe(A([V,U]),2),V=t[0],U=t[1]),V=rt(V,I),U=rt(U,I)}},dragControlAfter:function(t,e){var n=e.datas,r=n.isResize,i=n.startOffsetWidth,o=n.startOffsetHeight,a=n.prevWidth,s=n.prevHeight;if(r&&!1!==t.props.checkResizableError){var u=t.state,c=u.width-(i+a),l=u.height-(o+s),f=oi(c)>3,p=oi(l)>3;return f&&(n.startWidth+=c,n.startOffsetWidth+=c,n.prevWidth+=c),p&&(n.startHeight+=l,n.startOffsetHeight+=l,n.prevHeight+=l),f||p?this.dragControl(t,e):void 0}},dragControlEnd:function(t,e){var n=e.datas,r=e.parentEvent;if(n.isResize){n.isResize=!1;var i=Yr(t,e,{});return!r&&Xr(t,"onResizeEnd",i),i}},dragGroupControlCondition:ir,dragGroupControlStart:function(t,e){var n=e.datas,r=this.dragControlStart(t,Te(Te({},e),{isGroup:!0}));if(!r)return!1;var i=On(t,"resizable",e),o=n.startOffsetWidth,a=n.startOffsetHeight;function s(){var t=n.minSize;i.forEach(function(e){var n=e.datas,r=n.minSize,i=n.startOffsetWidth,s=n.startOffsetHeight,u=o*(i?r[0]/i:0),c=a*(s?r[1]/s:0);t[0]=Math.max(t[0],u),t[1]=Math.max(t[1],c)})}function u(){var t=n.maxSize;i.forEach(function(e){var n=e.datas,r=n.maxSize,i=n.startOffsetWidth,s=n.startOffsetHeight,u=o*(i?r[0]/i:0),c=a*(s?r[1]/s:0);t[0]=Math.min(t[0],u),t[1]=Math.min(t[1],c)})}var c=Rn(t,this,"dragControlStart",e,function(e,r){return kn(t,e,n,r)});s(),u();var l=function(e){r.setFixedDirection(e),c.forEach(function(r,o){r.setFixedDirection(e),kn(t,r.moveable,n,i[o])})};n.setFixedDirection=l;var f=Te(Te({},r),{targets:t.props.targets,events:c.map(function(t){return Te(Te({},t),{setMin:function(e){t.setMin(e),s()},setMax:function(e){t.setMax(e),u()}})}),setFixedDirection:l,setMin:function(t){r.setMin(t),s()},setMax:function(t){r.setMax(t),u()}}),p=Xr(t,"onResizeGroupStart",f);return n.isResize=!1!==p,!!n.isResize&&r},dragGroupControl:function(t,e){var n=e.datas;if(n.isResize){var r=Or(t.props,"resizable");!function(t,e,n){t._emitter.on("onBeforeResize",n)}(t,0,function(n){Xr(t,"onBeforeResizeGroup",Nr(t,e,Te(Te({},n),{targets:r.targets}),!0))});var i=this.dragControl(t,Te(Te({},e),{isGroup:!0}));if(i){var o=i.boundingWidth,a=i.boundingHeight,s=i.dist,u=r.keepRatio,c=[o/(o-s[0]),a/(a-s[1])],l=n.fixedPosition,f=Rn(t,this,"dragControl",e,function(e,n){var r=Oe(Tt(Gt(t.rotation/180*Math.PI,3),[n.datas.originalX*c[0],n.datas.originalY*c[1],1],3),2),i=r[0],o=r[1];return Te(Te({},n),{parentDist:null,parentScale:c,dragClient:St(l,[i,o]),parentKeepRatio:u})}),p=Te({targets:r.targets,events:f},i);return Xr(t,"onResizeGroup",p),p}}},dragGroupControlEnd:function(t,e){var n=e.isDrag;if(e.datas.isResize){this.dragControlEnd(t,e);var r=Rn(t,this,"dragControlEnd",e);return Xr(t,"onResizeGroupEnd",Yr(t,e,{targets:t.props.targets,events:r})),n}},request:function(t){var e={},n=0,r=0,i=!1,o=t.getRect();return{isControl:!0,requestStart:function(t){var n;return i=t.useSnap,{datas:e,parentDirection:t.direction||[1,1],parentIsWidth:null===(n=null==t?void 0:t.horizontal)||void 0===n||n,useSnap:i}},request:function(t){return"offsetWidth"in t?n=t.offsetWidth-o.offsetWidth:"deltaWidth"in t&&(n+=t.deltaWidth),"offsetHeight"in t?r=t.offsetHeight-o.offsetHeight:"deltaHeight"in t&&(r+=t.deltaHeight),{datas:e,parentDist:[n,r],parentKeepRatio:t.keepRatio,useSnap:i}},requestEnd:function(){return{datas:e,isDrag:!0,useSnap:i}}}},unset:function(t){t.state.gestos.resizable=null}};function ar(t){return t?t/oi(t):0}function sr(t,e,n,r,i,o){var a=function(t,e,n){var r=[];if(n)1!==oi(e[0])||1!==oi(e[1])?r.push([e,[-1,-1]],[e,[-1,1]],[e,[1,-1]],[e,[1,1]]):r.push([e,[t[0],-t[1]]],[e,[-t[0],t[1]]]),r.push([e,t]);else if(t[0]&&t[1]||!t[0]&&!t[1]){var i=t[0]?t:[1,1];[1,-1].forEach(function(t){[1,-1].forEach(function(n){var o=[t*i[0],n*i[1]];e[0]===o[0]&&e[1]===o[1]||r.push([e,o])})})}else t[0]?(1===oi(e[0])?[1]:[1,-1]).forEach(function(n){r.push([[e[0],-1],[n*t[0],-1]],[[e[0],0],[n*t[0],0]],[[e[0],1],[n*t[0],1]])}):t[1]&&(1===oi(e[1])?[1]:[1,-1]).forEach(function(n){r.push([[-1,e[1]],[-1,n*t[1]]],[[0,e[1]],[0,n*t[1]]],[[1,e[1]],[1,n*t[1]]])});return r}(n,o.fixedDirection,r),s=Kn(t,e,n,r),u=Pe(Pe([],Oe(function(t,e,n,r,i,o){return n.map(function(n){var a=Oe(n,2),s=a[0],u=a[1],c=dn(e,s),l=dn(e,u),f=r?function(t,e,n,r){var i=function(t,e,n){var r=An(t),i=r.left,o=r.top,a=r.right,s=r.bottom,u=Oe(n,2),c=u[0],l=u[1],f=Oe(Mt(n,e),2),p=f[0],d=f[1];oi(p)<Je&&(p=0),oi(d)<Je&&(d=0);var h=d>0,g=p>0,v={isBound:!1,offset:0,pos:0},m={isBound:!1,offset:0,pos:0};if(0===p&&0===d)return{vertical:v,horizontal:m};if(0===p)h?s<l&&(m.pos=s,m.offset=l-s):o>l&&(m.pos=o,m.offset=l-o);else if(0===d)g?a<c&&(v.pos=a,v.offset=c-a):i>c&&(v.pos=i,v.offset=c-i);else{var b=d/p,x=n[1]-b*c,y=0,E=0,D=!1;g&&a<=c?(y=b*a+x,E=a,D=!0):!g&&c<=i&&(y=b*i+x,E=i,D=!0),D&&(y<o||y>s)&&(D=!1),D||(h&&s<=l?(E=((y=s)-x)/b,D=!0):!h&&l<=o&&(E=((y=o)-x)/b,D=!0)),D&&(v.isBound=!0,v.pos=E,v.offset=c-E,m.isBound=!0,m.pos=y,m.offset=l-y)}return{vertical:v,horizontal:m}}(t,e,n),o=i.horizontal,a=i.vertical,s=r?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(t,e,n){var r=Oe(n,2),i=r[0],o=r[1],a=Oe(e,2),s=a[0],u=a[1],c=Oe(Mt(n,e),2),l=c[0],f=c[1],p=f>0,d=l>0;l=Kr(l),f=Kr(f);var h={isSnap:!1,offset:0,pos:0},g={isSnap:!1,offset:0,pos:0};if(0===l&&0===f)return{vertical:h,horizontal:g};var v=Wn(t,l?[i]:[],f?[o]:[],[],[],void 0,void 0),m=v.vertical,b=v.horizontal;m.posInfos.filter(function(t){var e=t.pos;return d?e>=s:e<=s}),b.posInfos.filter(function(t){var e=t.pos;return p?e>=u:e<=u}),m.isSnap=m.posInfos.length>0,b.isSnap=b.posInfos.length>0;var x=Hn(m),y=x.isSnap,E=x.guideline,D=Hn(b),w=D.isSnap,S=D.guideline,M=w?S.pos[1]:0,C=y?E.pos[0]:0;if(0===l)w&&(g.isSnap=!0,g.pos=S.pos[1],g.offset=o-g.pos);else if(0===f)y&&(h.isSnap=!0,h.pos=C,h.offset=i-C);else{var _=f/l,T=n[1]-_*i,O=0,P=0,R=!1;y?(O=_*(P=C)+T,R=!0):w&&(P=((O=M)-T)/_,R=!0),R&&(h.isSnap=!0,h.pos=P,h.offset=i-P,g.isSnap=!0,g.pos=O,g.offset=o-O)}return{vertical:h,horizontal:g}}(t,e,n),u=s.horizontal,c=s.vertical,l=er(o,u),f=er(a,c),p=oi(l),d=oi(f);return{horizontal:{isBound:o.isBound,isSnap:u.isSnap,offset:l,dist:p},vertical:{isBound:a.isBound,isSnap:c.isSnap,offset:f,dist:d}}}(t,c,l,i):tr(t,i,{vertical:[l[0]],horizontal:[l[1]]}),p=f.horizontal,d=p.offset,h=p.isBound,g=p.isSnap,v=f.vertical,m=v.offset,b=v.isBound,x=v.isSnap,y=Mt(u,s);if(!m&&!d)return{isBound:b||h,isSnap:x||g,sign:y,offset:[0,0]};var E=function(t,e,n,r){var i=tt(t,e)/Math.PI*180,o=n.vertical,a=o.isBound,s=o.isSnap,u=o.dist,c=n.horizontal,l=c.isBound,f=c.isSnap,p=i%180,d=p<3||p>177,h=p>87&&p<93;return c.dist<u&&(a||s&&!h&&(!r||!d))?"vertical":!l&&(!f||d||r&&h)?"":"horizontal"}(c,l,f,r);if(!E)return{sign:y,isBound:!1,isSnap:!1,offset:[0,0]};var D="vertical"===E,w=[0,0];return w=(w=r||1!==oi(u[0])||1!==oi(u[1])||s[0]===u[0]||s[1]===u[1]?$n(c,l,-(D?m:d),D,o).offset:fn({datas:o,distX:-m,distY:-d})).map(function(t,e){return t*(y[e]?2/y[e]:0)}),{sign:y,isBound:D?b:h,isSnap:D?x:g,offset:w}})}(t,e,a,r,i,o)),!1),Oe(Zn(t,s,o)),!1),c=jn(u,0),l=jn(u,1);return{width:{isBound:c.isBound,offset:c.offset[0]},height:{isBound:l.isBound,offset:l.offset[1]}}}function ur(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y.apply(void 0,Pe([Ue],Oe(t),!1))}function cr(t){t()}function lr(t){return t&&"none"!==t?R(t)?t:Xt(t):[1,0,0,1,0,0]}function fr(t,e,n){return Dt(e,It(n,e),t,It(n.map(function(t){return-t}),e))}function pr(t){return t?t.split(" "):["0","0"]}function dr(t){var e=Tn(t)("transform");if(e&&"none"!==e)return e;if("transform"in t){var n=t.transform.baseVal;if(!n)return"";var r=n.length;if(!r)return"";for(var i=[],o=function(t){var e=n[t].matrix;i.push("matrix(".concat(["a","b","c","d","e","f"].map(function(t){return e[t]}).join(", "),")"))},a=0;a<r;++a)o(a);return i.join(" ")}return""}function hr(t,e,n,r,i){var o,a,s,u,c=ft(t)||pt(t),l=!1;if(!t||n)s=t;else{var f=null===(o=null==t?void 0:t.assignedSlot)||void 0===o?void 0:o.parentElement,p=t.parentElement;f?(l=!0,u=p,s=f):s=p}for(var d=!1,h=t===e||s===e,g="relative",v=1,m=parseFloat(null==i?void 0:i("zoom"))||1,b=null==i?void 0:i("position");s&&s!==c;){e===s&&(h=!0);var x=Tn(s),y=s.tagName.toLowerCase(),E=dr(s),D=x("willChange"),w=parseFloat(x("zoom"))||1;if(g=x("position"),r&&1!==w){v=w;break}if(!n&&r&&1!==m&&b&&"absolute"!==b||"svg"===y||"foreignobject"===y||"static"!==g||E&&"none"!==E||"transform"===D)break;var S=null===(a=null==t?void 0:t.assignedSlot)||void 0===a?void 0:a.parentNode,M=s.parentNode;S&&(l=!0,u=M);var C=M;if(C&&11===C.nodeType){d=!0,g=Tn(s=C.host)("position");break}s=C,g="relative"}return{offsetZoom:v,hasSlot:l,parentSlotElement:u,isCustomElement:d,isStatic:"static"===g,isEnd:h||!s||s===c,offsetParent:s||c}}function gr(t,e){var n,r,i,o=t.tagName.toLowerCase(),a=t.offsetLeft,s=t.offsetTop,u=Tn(t),c=P(a),l=!c;return l||"svg"===o&&!t.ownerSVGElement?i=(r=pr(u("transformOrigin")).map(function(t){return parseFloat(t)})).slice():(i=(r=Ne?function(t){return pr(Wr(t,":before").transformOrigin).map(function(e,n){var r=X(e),i=r.value,o=r.unit;return i*function(t,e,n){return"%"===e?yr(t.ownerSVGElement)[n?"width":"height"]/100:1}(t,o,0===n)})}(t):pr(u("transformOrigin")).map(function(t){return parseFloat(t)})).slice(),l=!0,"svg"===o?(a=0,s=0):(n=Oe(function(t,e,n){var r=t.tagName.toLowerCase();if(!t.getBBox||!n&&"g"===r)return[0,0,0,0];var i="fill-box"===Tn(t)("transform-box"),o=t.getBBox(),a=yr(t.ownerSVGElement),s=o.x,u=o.y;"foreignobject"!==r||s||u||(s=parseFloat(t.getAttribute("x"))||0,u=parseFloat(t.getAttribute("y"))||0);var c=s-a.x,l=u-a.y;return[c,l,i?e[0]:e[0]-c,i?e[1]:e[1]-l]}(t,r,t===e&&"g"===e.tagName.toLowerCase()),4),a=n[0],s=n[1],r[0]=n[2],r[1]=n[3])),{tagName:o,isSVG:c,hasOffset:l,offset:[a||0,s||0],origin:r,targetOrigin:i}}function vr(t,e){var n=Tn(t),r=Tn(pt(t)),i=r("position");if(!(e||i&&"static"!==i))return[0,0];var o=parseInt(r("marginLeft"),10),a=parseInt(r("marginTop"),10);return"absolute"===n("position")&&("auto"===n("top")&&"auto"===n("bottom")||(a=0),"auto"===n("left")&&"auto"===n("right")||(o=0)),[o,a]}function mr(t){t.forEach(function(t){var e=t.matrix;e&&(t.matrix=Et(e,3,4))})}function br(t){for(var e=t.parentElement,n=!1,r=pt(t);e;){var i=Wr(e).transform;if(i&&"none"!==i){n=!0;break}if(e===r)break;e=e.parentElement}return{fixedContainer:e||r,hasTransform:n}}function xr(t,e){return void 0===e&&(e=t.length>9),"".concat(e?"matrix3d":"matrix","(").concat(_t(t,!e).join(","),")")}function yr(t){var e=t.clientWidth,n=t.clientHeight;if(!t)return{x:0,y:0,width:0,height:0,clientWidth:e,clientHeight:n};var r=t.viewBox,i=r&&r.baseVal||{x:0,y:0,width:0,height:0};return{x:i.x,y:i.y,width:i.width||e,height:i.height||n,clientWidth:e,clientHeight:n}}function Er(t,e){var n,r=yr(t),i=r.width,o=r.height,a=r.clientWidth,s=r.clientHeight,u=a/i,c=s/o,l=t.preserveAspectRatio.baseVal,f=l.align,p=l.meetOrSlice,d=[0,0],h=[u,c],g=[0,0];if(1!==f){var v=(f-2)%3,m=Math.floor((f-2)/3);d[0]=i*v/2,d[1]=o*m/2;var b=2===p?Math.max(c,u):Math.min(u,c);h[0]=b,h[1]=b,g[0]=(a-i)/2*v,g[1]=(s-o)/2*m}var x=zt(h,e);return n=Oe(g,2),x[e*(e-1)]=n[0],x[e*(e-1)+1]=n[1],fr(x,e,d)}function Dr(t,e,n){return Tt(t,yt(e,n),n)}function wr(t,e,n,r){return[[0,0],[e,0],[0,n],[e,n]].map(function(e){return Dr(t,e,r)})}function Sr(t){var e=t.map(function(t){return t[0]}),n=t.map(function(t){return t[1]}),r=Math.min.apply(Math,Pe([],Oe(e),!1)),i=Math.min.apply(Math,Pe([],Oe(n),!1)),o=Math.max.apply(Math,Pe([],Oe(e),!1)),a=Math.max.apply(Math,Pe([],Oe(n),!1));return{left:r,top:i,right:o,bottom:a,width:o-r,height:a-i}}function Mr(t,e,n,r){return Sr(wr(t,e,n,r))}function Cr(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function _r(t,e,n,r){void 0===n&&(n=1),void 0===r&&(r=tt(t,e));var i=function(t,e){return Cr([e[0]-t[0],e[1]-t[1]])}(t,e);return{transform:"translateY(-50%) translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(r,"rad) scaleY(").concat(n,")"),width:"".concat(i,"px")}}function Tr(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n.length,o=n.reduce(function(t,e){return t+e[0]},0)/i,a=n.reduce(function(t,e){return t+e[1]},0)/i;return{transform:"translateZ(0px) translate(".concat(o,"px, ").concat(a,"px) rotate(").concat(t,"rad) scale(").concat(e,")")}}function Or(t,e){var n=t[e];return R(n)?Te(Te({},t),n):t}function Pr(t){var e=t&&!P(t.offsetWidth),n=0,r=0,i=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,p=0,d=0,h=1/0,g=1/0,v=1/0,m=1/0,b=0,x=0,y=!1;if(t)if(!e&&t.ownerSVGElement){var E=t.getBBox();y=!0,a=n=E.width,s=r=E.height,u=n,c=r,i=n,o=r}else{var D=Tn(t),w=t.style,S="border-box"===D("boxSizing"),M=parseFloat(D("borderLeftWidth"))||0,C=parseFloat(D("borderRightWidth"))||0,_=parseFloat(D("borderTopWidth"))||0,T=parseFloat(D("borderBottomWidth"))||0,O=(parseFloat(D("paddingLeft"))||0)+(parseFloat(D("paddingRight"))||0),R=(parseFloat(D("paddingTop"))||0)+(parseFloat(D("paddingBottom"))||0),k=O+(M+C),F=R+(_+T),B=D("position"),G=0,A=0;if("clientLeft"in t){var z=null;if(z="absolute"===B?hr(t,pt(t)).offsetParent:t.parentElement){var I=Tn(z);G=parseFloat(I("width")),A=parseFloat(I("height"))}}l=Math.max(O,K(D("minWidth"),G)||0),f=Math.max(R,K(D("minHeight"),A)||0),h=K(D("maxWidth"),G),g=K(D("maxHeight"),A),isNaN(h)&&(h=1/0),isNaN(g)&&(g=1/0),b=K(w.width,0)||0,x=K(w.height,0)||0,a=parseFloat(D("width"))||0,s=parseFloat(D("height"))||0,n=u=oi(a-b)<1?$(l,b||a,h):a,r=c=oi(s-x)<1?$(f,x||s,g):s,i=u,o=c,S?(v=h,m=g,p=l,d=f,u=n-k,c=r-F):(v=h+k,m=g+F,p=l+k,d=f+F,n=u+k,r=c+F),i=u+O,o=c+R}return{svg:y,offsetWidth:n,offsetHeight:r,clientWidth:i,clientHeight:o,contentWidth:u,contentHeight:c,inlineCSSWidth:b,inlineCSSHeight:x,cssWidth:a,cssHeight:s,minWidth:l,minHeight:f,maxWidth:h,maxHeight:g,minOffsetWidth:p,minOffsetHeight:d,maxOffsetWidth:v,maxOffsetHeight:m}}function Rr(t,e){var n=t===pt(t)||t===ft(t),r={clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight,overflow:!1};return n&&(r.clientHeight=Math.max(e.height,r.clientHeight),r.scrollHeight=Math.max(e.height,r.scrollHeight)),r.overflow="visible"!==Tn(t)("overflow"),Te(Te({},e),r)}function kr(t,e,n,r){var i=t.left,o=t.right,a=t.top,s=t.bottom,u=e.top,c=e.left,l={left:c+i,top:u+a,right:c+o,bottom:u+s,width:o-i,height:s-a};return n&&r?Rr(n,l):l}function Fr(t,e){var n=0,r=0,i=0,o=0;if(t){var a=t.getBoundingClientRect();n=a.left,r=a.top,i=a.width,o=a.height}var s={left:n,top:r,width:i,height:o,right:n+i,bottom:r+o};return t&&e?Rr(t,s):s}function Br(t,e){return[St(e,t[0]),St(e,t[1]),St(e,t[2]),St(e,t[3])]}function Gr(t){var e=t.left,n=t.top;return Br([t.pos1,t.pos2,t.pos3,t.pos4],[e,n])}function Ar(t,e){t[e?"controlAbles":"targetAbles"].forEach(function(e){e.unset&&e.unset(t)})}function zr(t,e){var n=e?"controlGesto":"targetGesto",r=t[n];!1===(null==r?void 0:r.isIdle())&&Ar(t,e),null==r||r.unset(),t[n]=null}function Ir(t,e){if(e){var n=vn(e);n.nextStyle=Te(Te({},n.nextStyle),t)}return{style:t,cssText:Z(t).map(function(e){return"".concat((n=e,n.replace(/([a-z])([A-Z])/g,function(t,e,n){return e+"-"+n.toLowerCase()})),": ").concat(t[e],";");var n}).join("")}}function Nr(t,e,n,r){var i=e.datas;i.datas||(i.datas={});var o=Te(Te({},n),{target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,moveable:t,datas:i.datas,isRequest:e.isRequest,isRequestChild:e.isRequestChild,isFirstDrag:!!e.isFirstDrag,isTrusted:!1!==e.isTrusted,stopAble:function(){i.isEventStart=!1},stopDrag:function(){var t;null===(t=e.stop)||void 0===t||t.call(e)}});return i.isStartEvent?r||(i.lastEvent=o):i.isStartEvent=!0,o}function Yr(t,e,n){var r=e.datas,i="isDrag"in n?n.isDrag:e.isDrag;return r.datas||(r.datas={}),Te(Te({isDrag:i},n),{moveable:t,target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,lastEvent:r.lastEvent,isDouble:e.isDouble,datas:r.datas,isFirstDrag:!!e.isFirstDrag})}function Xr(t,e,n,r,i){return t.triggerEvent(e,n,r,i)}function Wr(t,e){return dt(t).getComputedStyle(t,e)}function Hr(t,e,n){var r={},i={};return t.filter(function(t){var o=t.name;if(r[o]||!e.some(function(e){return t[e]}))return!1;if(!n&&t.ableGroup){if(i[t.ableGroup])return!1;i[t.ableGroup]=!0}return r[o]=!0,!0})}function qr(t,e){return t===e||null==t&&null==e}function jr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=t.length-1,r=0;r<n;++r){var i=t[r];if(!P(i))return i}return t[n]}function Lr(t){return t.reduce(function(t,e){return t.concat(e)},[])}function Vr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.sort(function(t,e){return oi(e)-oi(t)}),t[0]}function Ur(t,e,n){return Tt(xt(t,n),yt(e,n),n)}function Zr(t,e,n,r){if(!n[0]&&!n[1])return e;var i=Dr(t,[ar(n[0]||1),0],r),o=Dr(t,[0,ar(n[1]||1)],r);return St(e,Dr(t,[n[0]/Cr(i),n[1]/Cr(o)],r))}function Kr(t){return oi(t)<=Je?0:t}function $r(t,e){return void 0===e&&(e=[t]),function(n,r){if(r.isRequest)return!!e.some(function(t){return r.requestAble===t})&&r.parentDirection;var i=r.inputEvent.target;return ot(i,ur("direction"))&&(!t||ot(i,ur(t)))}}function Jr(t,e){return t?gt(t)?t:F(t)?e?document.querySelector(t):t:G(t)?t():ht(t)?t:"current"in t?t.current:t:null}function Qr(t,e){return t?((n=t)&&R(n)&&!gt(n)&&(k(n)||"length"in n)?[].slice.call(t):[t]).reduce(function(t,n){return k(n)?t.push(Qr(n,e)):t.push(Jr(n,e)),t},[]):[];var n}function ti(t,e){if(e){if("left"===t)return{x:"0%",y:"50%"};if("top"===t)return{x:"50%",y:"50%"};if("center"===t)return{x:"50%",y:"50%"};if("right"===t)return{x:"100%",y:"50%"};if("bottom"===t)return{x:"50%",y:"100%"};var n=Oe(t.split(" "),2),r=n[0],i=n[1],o=ti(r||""),a=ti(i||""),s=Te(Te({},o),a),u={x:"50%",y:"50%"};return s.x&&(u.x=s.x),s.y&&(u.y=s.y),s.value&&(s.x&&!s.y&&(u.y=s.value),!s.x&&s.y&&(u.x=s.value)),u}return"left"===t?{x:"0%"}:"right"===t?{x:"100%"}:"top"===t?{y:"0%"}:"bottom"===t?{y:"100%"}:t?"center"===t?{value:"50%"}:{value:t}:{}}function ei(t,e,n){var r=ti(t,!0),i=r.x,o=r.y;return[K(i,e)||0,K(o,n)||0]}function ni(t,e){return t.length===e.length&&t.every(function(t,n){var r=e[n],i=k(t),o=k(r);return i&&o?ni(t,r):!i&&!o&&t===r})}function ri(t,e,n,r,i){var o=t._store,a=o[e];return!(e in o)||a!==n&&r(a)!==r(n)?(o[e]=n,n):a}function ii(t){return t>=0?1:-1}function oi(t){return Math.abs(t)}function ai(t){return B(t)?{top:t,left:t,right:t,bottom:t}:{left:t.left||0,top:t.top||0,right:t.right||0,bottom:t.bottom||0}}$r("",["resizable","scalable"]),Re("pinchable",{props:["pinchable"],events:["pinchStart","pinch","pinchEnd","pinchGroupStart","pinchGroup","pinchGroupEnd"],dragStart:function(){return!0},pinchStart:function(t,e){var n=e.datas,r=e.targets,i=e.angle,o=e.originalDatas,a=t.props,s=a.pinchable,u=a.ables;if(!s)return!1;var c="onPinch".concat(r?"Group":"","Start"),l="drag".concat(r?"Group":"","ControlStart"),f=(!0===s?t.controlAbles:u.filter(function(t){return s.indexOf(t.name)>-1})).filter(function(t){return t.canPinch&&t[l]}),p=Nr(t,e,{});r&&(p.targets=r);var d=Xr(t,c,p);n.isPinch=!1!==d,n.ables=f;var h=n.isPinch;return!!h&&(f.forEach(function(n){if(o[n.name]=o[n.name]||{},n[l]){var r=Te(Te({},e),{datas:o[n.name],parentRotate:i,isPinch:!0});n[l](t,r)}}),t.state.snapRenderInfo={request:e.isRequest,direction:[0,0]},h)},pinch:function(t,e){var n=e.datas,r=e.scale,i=e.distance,o=e.originalDatas,a=e.inputEvent,s=e.targets,u=e.angle;if(n.isPinch){var c=i*(1-1/r),l=Nr(t,e,{});s&&(l.targets=s);var f="onPinch".concat(s?"Group":"");Xr(t,f,l);var p=n.ables,d="drag".concat(s?"Group":"","Control");return p.forEach(function(n){n[d]&&n[d](t,Te(Te({},e),{datas:o[n.name],inputEvent:a,resolveMatrix:!0,pinchScale:r,parentDistance:c,parentRotate:u,isPinch:!0}))}),l}},pinchEnd:function(t,e){var n=e.datas,r=e.isPinch,i=e.inputEvent,o=e.targets,a=e.originalDatas;if(n.isPinch){var s="onPinch".concat(o?"Group":"","End"),u=Yr(t,e,{isDrag:r});o&&(u.targets=o),Xr(t,s,u);var c=n.ables,l="drag".concat(o?"Group":"","ControlEnd");return c.forEach(function(n){n[l]&&n[l](t,Te(Te({},e),{isDrag:r,datas:a[n.name],inputEvent:i,isPinch:!0}))}),r}},pinchGroupStart:function(t,e){return this.pinchStart(t,Te(Te({},e),{targets:t.props.targets}))},pinchGroup:function(t,e){return this.pinch(t,Te(Te({},e),{targets:t.props.targets}))},pinchGroupEnd:function(t,e){return this.pinchEnd(t,Te(Te({},e),{targets:t.props.targets}))}}),$r("scalable");var si=ur("area-pieces"),ui=ur("area-piece"),ci=ur("avoid"),li=ur("view-dragging");function fi(t){var e=t.areaElement;if(e){var n=t.state,r=n.width,i=n.height;st(e,ci),e.style.cssText+="left: 0px; top: 0px; width: ".concat(r,"px; height: ").concat(i,"px")}}function pi(t){return t.createElement("div",{key:"area_pieces",className:si},t.createElement("div",{className:ui}),t.createElement("div",{className:ui}),t.createElement("div",{className:ui}),t.createElement("div",{className:ui}))}var di={name:"dragArea",props:["dragArea","passDragArea"],events:["click","clickGroup"],render:function(t,e){var n=t.props,r=n.target,i=n.dragArea,o=n.groupable,a=n.passDragArea,s=t.getState(),u=s.width,c=s.height,l=s.renderPoses,f=a?ur("area","pass"):ur("area");if(o)return[e.createElement("div",{key:"area",ref:E(t,"areaElement"),className:f}),pi(e)];if(!r||!i)return[];var p=Nt([0,0],[u,0],[0,c],[u,c],l[0],l[1],l[2],l[3]),d=p.length?xr(p,!0):"none";return[e.createElement("div",{key:"area",ref:E(t,"areaElement"),className:f,style:{top:"0px",left:"0px",width:"".concat(u,"px"),height:"".concat(c,"px"),transformOrigin:"0 0",transform:d}}),pi(e)]},dragStart:function(t,e){var n=e.datas,r=e.clientX,i=e.clientY;if(!e.inputEvent)return!1;n.isDragArea=!1;var o=t.areaElement,a=t.state,s=a.moveableClientRect,u=a.renderPoses,c=a.rootMatrix,l=a.is3d,f=s.left,p=s.top,d=Sr(u),h=d.left,g=d.top,v=d.width,m=d.height,b=Oe(Ur(c,[r-f,i-p],l?4:3),2),x=b[0],y=b[1],E=[{left:h,top:g,width:v,height:(y-=g)-10},{left:h,top:g,width:(x-=h)-10,height:m},{left:h,top:g+y+10,width:v,height:m-y-10},{left:h+x+10,top:g,width:v-x-10,height:m}],D=[].slice.call(o.nextElementSibling.children);E.forEach(function(t,e){D[e].style.cssText="left: ".concat(t.left,"px;top: ").concat(t.top,"px; width: ").concat(t.width,"px; height: ").concat(t.height,"px;")}),at(o,ci),a.disableNativeEvent=!0},drag:function(t,e){var n=e.datas,r=e.inputEvent;if(this.enableNativeEvent(t),!r)return!1;n.isDragArea||(n.isDragArea=!0,fi(t))},dragEnd:function(t,e){this.enableNativeEvent(t);var n=e.inputEvent,r=e.datas;if(!n)return!1;r.isDragArea||fi(t)},dragGroupStart:function(t,e){return this.dragStart(t,e)},dragGroup:function(t,e){return this.drag(t,e)},dragGroupEnd:function(t,e){return this.dragEnd(t,e)},unset:function(t){fi(t),t.state.disableNativeEvent=!1},enableNativeEvent:function(t){var e=t.state;e.disableNativeEvent&&V(function(){e.disableNativeEvent=!1})}};Re("origin",{props:["origin","svgOrigin"],render:function(t,e){var n,r=t.props,i=r.zoom,o=r.svgOrigin,a=r.groupable,s=t.getState(),u=s.beforeOrigin,c=s.rotation,l=s.svg,f=s.allMatrix,p=s.is3d,d=s.left,h=s.top,g=s.offsetWidth,v=s.offsetHeight;if(!a&&l&&o){var m=Oe(ei(o,g,v),2);n=Tr(c,i,Mt(Dr(f,[m[0],m[1]],p?4:3),[d,h]))}else n=Tr(c,i,u);return[e.createElement("div",{className:ur("control","origin"),style:n,key:"beforeOrigin"})]}});var hi={name:"",props:["target","dragTargetSelf","dragTarget","dragContainer","container","warpSelf","rootContainer","useResizeObserver","useMutationObserver","zoom","dragFocusedInput","transformOrigin","ables","className","pinchThreshold","pinchOutside","triggerAblesSimultaneously","checkInput","cspNonce","translateZ","hideDefaultLines","props","flushSync","stopPropagation","preventClickEventOnDrag","preventClickDefault","viewContainer","persistData","useAccuratePosition","firstRenderState","linePadding","controlPadding","preventDefault","preventRightClick","preventWheelClick","requestStyles"],events:["changeTargets"]};Re("padding",{props:["padding"],render:function(t,e){var n=t.props;if(n.dragArea)return[];var r=ai(n.padding||{}),i=r.left,o=r.top,a=r.right,s=r.bottom,u=t.getState(),c=u.renderPoses,l=[u.pos1,u.pos2,u.pos3,u.pos4],f=[];return i>0&&f.push([0,2]),o>0&&f.push([0,1]),a>0&&f.push([1,3]),s>0&&f.push([2,3]),f.map(function(t,n){var r=Oe(t,2),i=r[0],o=r[1],a=Nt([0,0],[100,0],[0,100],[100,100],l[i],l[o],c[i],c[o]);if(a.length)return e.createElement("div",{key:"padding".concat(n),className:ur("padding"),style:{transform:xr(a,!0)}})})}});var gi={isPinch:!0,name:"beforeRenderable",props:[],events:["beforeRenderStart","beforeRender","beforeRenderEnd","beforeRenderGroupStart","beforeRenderGroup","beforeRenderGroupEnd"],dragRelation:"weak",setTransform:function(t,e){var n=t.state,r=n.is3d,i=n.targetMatrix,o=n.inlineTransform,a=r?"matrix3d(".concat(i.join(","),")"):"matrix(".concat(_t(i,!0),")"),s=o&&"none"!==o?o:a;e.datas.startTransforms=function(t,e){var n=At(e?4:3);return t==="matrix".concat(e?"3d":"","(").concat(n.join(","),")")||"matrix(1,0,0,1,0,0)"===t}(s,r)?[]:N(s)},resetStyle:function(t){var e=t.datas;e.nextStyle={},e.nextTransforms=t.datas.startTransforms,e.nextTransformAppendedIndexes=[]},fillDragStartParams:function(t,e){return Nr(t,e,{setTransform:function(t){e.datas.startTransforms=k(t)?t:N(t)},isPinch:!!e.isPinch})},fillDragParams:function(t,e){return Nr(t,e,{isPinch:!!e.isPinch})},dragStart:function(t,e){this.setTransform(t,e),this.resetStyle(e),Xr(t,"onBeforeRenderStart",this.fillDragStartParams(t,e))},drag:function(t,e){e.datas.startTransforms||this.setTransform(t,e),this.resetStyle(e),Xr(t,"onBeforeRender",Nr(t,e,{isPinch:!!e.isPinch}))},dragEnd:function(t,e){e.datas.startTransforms||(this.setTransform(t,e),this.resetStyle(e)),Xr(t,"onBeforeRenderEnd",Nr(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag}))},dragGroupStart:function(t,e){var n=this;this.dragStart(t,e);var r=On(t,"beforeRenderable",e),i=t.moveables,o=r.map(function(t,e){var r=i[e];return n.setTransform(r,t),n.resetStyle(t),n.fillDragStartParams(r,t)});Xr(t,"onBeforeRenderGroupStart",Nr(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,setTransform:function(){},events:o}))},dragGroup:function(t,e){var n=this;this.drag(t,e);var r=On(t,"beforeRenderable",e),i=t.moveables,o=r.map(function(t,e){var r=i[e];return n.resetStyle(t),n.fillDragParams(r,t)});Xr(t,"onBeforeRenderGroup",Nr(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,events:o}))},dragGroupEnd:function(t,e){this.dragEnd(t,e),Xr(t,"onBeforeRenderGroupEnd",Nr(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets}))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)}},vi={name:"renderable",props:[],events:["renderStart","render","renderEnd","renderGroupStart","renderGroup","renderGroupEnd"],dragRelation:"weak",dragStart:function(t,e){Xr(t,"onRenderStart",Nr(t,e,{isPinch:!!e.isPinch}))},drag:function(t,e){Xr(t,"onRender",this.fillDragParams(t,e))},dragAfter:function(t,e){return this.drag(t,e)},dragEnd:function(t,e){Xr(t,"onRenderEnd",this.fillDragEndParams(t,e))},dragGroupStart:function(t,e){Xr(t,"onRenderGroupStart",Nr(t,e,{isPinch:!!e.isPinch,targets:t.props.targets}))},dragGroup:function(t,e){var n=this,r=On(t,"beforeRenderable",e),i=t.moveables,o=r.map(function(t,e){var r=i[e];return n.fillDragParams(r,t)});Xr(t,"onRenderGroup",Nr(t,e,Te(Te({isPinch:!!e.isPinch,targets:t.props.targets,transform:bn(e),transformObject:{}},Ir(xn(e))),{events:o})))},dragGroupEnd:function(t,e){var n=this,r=On(t,"beforeRenderable",e),i=t.moveables,o=r.map(function(t,e){var r=i[e];return n.fillDragEndParams(r,t)});Xr(t,"onRenderGroupEnd",Nr(t,e,Te({isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets,events:o,transformObject:{},transform:bn(e)},Ir(xn(e)))))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlAfter:function(t,e){return this.dragAfter(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)},fillDragParams:function(t,e){var n={};return Ht(mn(e)||[]).forEach(function(t){n[t.name]=t.functionValue}),Nr(t,e,Te({isPinch:!!e.isPinch,transformObject:n,transform:bn(e)},Ir(xn(e))))},fillDragEndParams:function(t,e){var n={};return Ht(mn(e)||[]).forEach(function(t){n[t.name]=t.functionValue}),Nr(t,e,Te({isPinch:!!e.isPinch,isDrag:e.isDrag,transformObject:n,transform:bn(e)},Ir(xn(e))))}};function mi(t,e,n,r,i,o,a){o.clientDistX=o.distX,o.clientDistY=o.distY;var s="Start"===i,u="End"===i,c="After"===i,l=t.state.target,f=o.isRequest,p=r.indexOf("Control")>-1;if(!l||s&&p&&!f&&t.areaElement===o.inputEvent.target)return!1;var d=Pe([],Oe(e),!1);if(f){var h=o.requestAble;d.some(function(t){return t.name===h})||d.push.apply(d,Pe([],Oe(t.props.ables.filter(function(t){return t.name===h})),!1))}if(!d.length||d.every(function(t){return t.dragRelation}))return!1;var g,v=o.inputEvent;u&&v&&(g=document.elementFromPoint(o.clientX,o.clientY)||v.target);var m=!1,b=function(){var t;m=!0,null===(t=o.stop)||void 0===t||t.call(o)},x=s&&(!t.targetGesto||!t.controlGesto||!t.targetGesto.isFlag()||!t.controlGesto.isFlag());x&&t.updateRect(i,!0,!1);var y=o.datas,E=p?"controlGesto":"targetGesto",D=t[E],w=function(e,n,r){if(!(n in e)||D!==t[E])return!1;var i=e.name,a=y[i]||(y[i]={});if(s&&(a.isEventStart=!r||!e[r]||e[r](t,o)),!a.isEventStart)return!1;var u=e[n](t,Te(Te({},o),{stop:b,datas:a,originalDatas:y,inputTarget:g}));return t._emitter.off(),s&&!1===u&&(a.isEventStart=!1),u};x&&d.forEach(function(e){e.unset&&e.unset(t)}),w(gi,"drag".concat(r).concat(i));var S=0,M=0;n.forEach(function(e){if(m)return!1;var n="".concat(e).concat(r).concat(i),a="".concat(e).concat(r,"Condition");""!==i||f||function(t,e){var n,r=t.is3d?4:3;n=Oe(Ur(t.rootMatrix,[e.distX,e.distY],r),2),e.distX=n[0],e.distY=n[1]}(t.state,o);var u=d.filter(function(t){return t[n]}),c=(u=u.filter(function(t,e){return t.name&&u.indexOf(t)===e})).filter(function(t){return w(t,n,a)}).length;m&&++S,c&&++M,!m&&s&&u.length&&!c&&(S+=u.filter(function(t){var e=t.name;return!!y[e].isEventStart&&"strong"!==t.dragRelation}).length?1:0)}),c&&!M||w(vi,"drag".concat(r).concat(i));var C=D!==t[E]||S===n.length;return(u||m||C)&&(t.state.gestos={},t.moveables&&t.moveables.forEach(function(t){t.state.gestos={}}),d.forEach(function(e){e.unset&&e.unset(t)})),s&&!C&&!f&&M&&t.props.preventDefault&&(null==o||o.preventDefault()),!t.isUnmounted&&!C&&((!s&&M&&!a||u)&&(t.props.flushSync||cr)(function(){t.updateRect(u?i:"",!0,!1),t.forceUpdate()}),s||u||c||!M||a||mi(t,e,n,r,i+"After",o),!0)}function bi(t,e){return function(n,r){var i;void 0===r&&(r=n.inputEvent.target);var o=r,a=t.areaElement,s=t._dragTarget;return!(!s||!e&&(null===(i=t.controlGesto)||void 0===i?void 0:i.isFlag()))&&(o===s||s.contains(o)||o===a||!t.isMoveableElement(o)&&!t.controlBox.contains(o)||ot(o,"moveable-area")||ot(o,"moveable-padding")||ot(o,"moveable-edgeDraggable"))}}function xi(t,e,n){var r=t.controlBox,i=[],o=t.props,a=o.dragArea,s=t.state.target,u=o.dragTarget;i.push(r),a&&!u||i.push(e),!a&&u&&s&&e!==s&&o.dragTargetSelf&&i.push(s);var c=bi(t);return Ei(t,i,"targetAbles",n,{dragStart:c,pinchStart:c})}function yi(t,e){var n=t.controlBox,r=[];r.push(n);var i=bi(t,!0),o=function(t,e){return void 0===e&&(e=t.inputEvent.target),e===n||!i(t,e)};return Ei(t,r,"controlAbles",e,{dragStart:o,pinchStart:o})}function Ei(t,e,n,r,i){void 0===i&&(i={});var o="targetAbles"===n,a=t.props,s=a.pinchOutside,u=a.pinchThreshold,c=a.preventClickEventOnDrag,l=a.preventClickDefault,f=a.checkInput,p=a.dragFocusedInput,d=a.preventDefault,h=void 0===d||d,g=a.preventRightClick,v=void 0===g||g,m=a.preventWheelClick,b={preventDefault:h,preventRightClick:v,preventWheelClick:void 0===m||m,container:Jr(a.dragContainer,!0)||dt(t.getControlBoxElement()),pinchThreshold:u,pinchOutside:s,preventClickEventOnDrag:!!o&&c,preventClickEventOnDragStart:!!o&&l,preventClickEventByCondition:o?null:function(e){return t.controlBox.contains(e.target)},checkInput:!!o&&f,dragFocusedInput:p},x=new De(e,b),y="Control"===r;return["drag","pinch"].forEach(function(e){["Start","","End"].forEach(function(o){x.on("".concat(e).concat(o),function(a){var s,u=a.eventType,c="drag"===e&&a.isPinch;if(!i[u]||i[u](a)){if(!c){var l="drag"===e?[e]:["drag",e],f=Pe([],Oe(t[n]),!1);mi(t,f,l,r,o,a)?(t.props.stopPropagation||"Start"===o&&y)&&(null===(s=null==a?void 0:a.inputEvent)||void 0===s||s.stopPropagation()):a.stop()}}else a.stop()})})}),x}var Di=function(){function t(t,e,n){var r=this;this.target=t,this.moveable=e,this.eventName=n,this.ables=[],this._onEvent=function(t){var e=r.eventName,n=r.moveable;n.state.disableNativeEvent||r.ables.forEach(function(r){r[e](n,{inputEvent:t})})},t.addEventListener(n.toLowerCase(),this._onEvent)}return t.prototype.setAbles=function(t){this.ables=t},t.prototype.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this._onEvent),this.target=null,this.moveable=null},t}();function wi(t,e,n,r){void 0===n&&(n=e);var i,o,a=0,s=0,u=0,c={},l=Pr(t);if(t&&(a=l.offsetWidth,s=l.offsetHeight),t){var f=function(t,e,n,r){var i;void 0===n&&(n=e);var o=wn(t,e),a=o.matrixes,s=o.is3d,u=o.targetMatrix,c=o.transformOrigin,l=o.targetOrigin,f=o.offsetContainer,p=o.hasFixed,d=o.zoom,h=function(t,e){if(Cn){var n=q(Cn,function(n){return n[0][0]==t&&n[0][1]==e});if(n)return n[1]}var r=wn(t,e,!0);return Cn&&Cn.push([[t,e],r]),r}(f,n),g=h.matrixes,v=h.is3d,m=h.offsetContainer,b=h.zoom,x=r,y="svg"!==t.tagName.toLowerCase()&&"ownerSVGElement"in t,E=u,D=At(4),w=At(4),S=At(4),M=At(4),C=a.length,_=g.map(function(t){return Te(Te({},t),{matrix:t.matrix?Pe([],Oe(t.matrix),!1):void 0})}).reverse();a.reverse(),!s&&x&&(E=Et(E,3,4),mr(a)),!v&&x&&mr(_),_.forEach(function(t){w=wt(w,t.matrix,4)});var T=n||pt(t),O=(null===(i=_[0])||void 0===i?void 0:i.target)||hr(T,T,!0).offsetParent,P=_.slice(1).reduce(function(t,e){return wt(t,e.matrix,4)},At(4));a.forEach(function(t,e){if(C-2===e&&(S=D.slice()),C-1===e&&(M=D.slice()),!t.matrix){var n=function(t,e,n,r,i){var o,a=t.target,s=t.origin,u=e.matrix,c=Pr(a),l=c.offsetWidth,f=c.offsetHeight,p=n.getBoundingClientRect(),d=[0,0];n===pt(n)&&(d=vr(a,!0));for(var h=a.getBoundingClientRect(),g=h.left-p.left+n.scrollLeft-(n.clientLeft||0)+d[0],v=h.top-p.top+n.scrollTop-(n.clientTop||0)+d[1],m=h.width,b=h.height,x=Dt(4,i,u),y=Mr(x,l,f,4),E=y.left,D=y.top,w=y.width,S=y.height,M=Dr(x,s,4),C=Mt(M,[E,D]),_=[g+C[0]*m/w,v+C[1]*b/S],T=[0,0],O=0;++O<10;){var P=xt(i,4);o=Oe(Mt(Dr(P,_,4),Dr(P,M,4)),2),T[0]=o[0],T[1]=o[1];var R=Mr(Dt(4,i,It(T,4),u),l,f,4),k=R.left-g,F=R.top-v;if(oi(k)<2&&oi(F)<2)break;_[0]-=k,_[1]-=F}return T.map(function(t){return Math.round(t)})}(t,a[e+1],O,0,wt(P,D,4));t.matrix=It(n,4)}D=wt(D,t.matrix,4)});var R=!y&&s;E||(E=At(R?4:3));var k=xr(y&&16===E.length?Et(E,4,3):E,R),F=w;return w=function(t){for(var e=t.slice(),n=0;n<4;++n)e[4*n+4-1]=0,e[12+n]=0;return e[15]=1,e}(w),{hasZoom:1!==d||1!==b,hasFixed:p,matrixes:a,rootMatrix:w,originalRootMatrix:F,beforeMatrix:S,offsetMatrix:M,allMatrix:D,targetMatrix:E,targetTransform:k,inlineTransform:t.style.transform,transformOrigin:c,targetOrigin:l,is3d:x,offsetContainer:f,offsetRootContainer:m}}(t,e,n,r),p=sn(f.allMatrix,f.transformOrigin,a,s);c=Te(Te({},f),p);var d=sn(f.allMatrix,[50,50],100,100);i=[d.pos1,d.pos2],u=tt((o=d.direction)>0?i[0]:i[1],o>0?i[1]:i[0])}return Te(Te(Te({hasZoom:!1,width:a,height:s,rotation:u},l),{originalRootMatrix:At(4),rootMatrix:At(4),beforeMatrix:At(4),offsetMatrix:At(4),allMatrix:At(4),targetMatrix:At(4),targetTransform:"",inlineTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!0,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1,hasFixed:!1,offsetContainer:null,offsetRootContainer:null,matrixes:[]}),c)}function Si(t,e,n,r,i,o){void 0===o&&(o=[]);var a=1,s=[0,0],u={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},c={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},l={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},f={left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},p=[0,0],d={},h=wi(e,n,i,!0);if(e){var g=Tn(e);o.forEach(function(t){d[t]=g(t)});var v=h.is3d?4:3,m=sn(h.offsetMatrix,St(h.transformOrigin,function(t,e){void 0===e&&(e=Math.sqrt(t.length));for(var n=[],r=t[e*e-1],i=0;i<e-1;++i)n[i]=t[e*(e-1)+i]/r;return n[e-1]=0,n}(h.targetMatrix,v)),h.width,h.height);a=m.direction,s=St(m.origin,[m.left-h.left,m.top-h.top]),f=Fr(h.offsetRootContainer);var b=hr(r,r,!0).offsetParent||h.offsetRootContainer;if(h.hasZoom){var x=sn(wt(h.originalRootMatrix,h.allMatrix),h.transformOrigin,h.width,h.height),y=sn(h.originalRootMatrix,pr(Tn(b)("transformOrigin")).map(function(t){return parseFloat(t)}),b.offsetWidth,b.offsetHeight);if(u=kr(x,f),l=kr(y,f,b,!0),t){var E=x.left,D=x.top;c=kr({left:E,top:D,bottom:D,right:D},f)}}else{u=Fr(e),l=function(t){var e=null==Mn?void 0:Mn.get(t);if(e)return e;var n=Fr(t,!0);return Mn&&Mn.set(t,n),n}(b),t&&(c=Fr(t));var w=l.left,S=l.top,M=l.clientLeft,C=l.clientTop,_=[u.left-w,u.top-S];p=Mt(Ur(h.rootMatrix,_,4),[M+h.left,C+h.top])}}return Te({targetClientRect:u,containerClientRect:l,moveableClientRect:c,rootContainerClientRect:f,beforeDirection:a,beforeOrigin:s,originalBeforeOrigin:s,target:e,style:d,offsetDelta:p},h)}function Mi(t){var e=t.pos1,n=t.pos2,r=t.pos3,i=t.pos4;if(!(e&&n&&r&&i))return null;var o=ae([e,n,r,i]),a=[o.minX,o.minY],s=Mt(t.origin,a);return e=Mt(e,a),n=Mt(n,a),r=Mt(r,a),i=Mt(i,a),Te(Te({},t),{left:t.left,top:t.top,posDelta:a,pos1:e,pos2:n,pos3:r,pos4:i,origin:s,beforeOrigin:s,isPersisted:!0})}var Ci=function(n){function r(){var t=null!==n&&n.apply(this,arguments)||this;return t.state=Te({container:null,gestos:{},renderLines:[[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]]],renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1,posDelta:[0,0]},Si(null)),t.renderState={},t.enabledAbles=[],t.targetAbles=[],t.controlAbles=[],t.rotation=0,t.scale=[1,1],t.isMoveableMounted=!1,t.isUnmounted=!1,t.events={mouseEnter:null,mouseLeave:null},t._emitter=new ne,t._prevOriginalDragTarget=null,t._originalDragTarget=null,t._prevDragTarget=null,t._dragTarget=null,t._prevPropTarget=null,t._propTarget=null,t._prevDragArea=!1,t._isPropTargetChanged=!1,t._hasFirstTarget=!1,t._reiszeObserver=null,t._observerId=0,t._mutationObserver=null,t._rootContainer=null,t._viewContainer=null,t._viewClassNames=[],t._store={},t.checkUpdateRect=function(){if(!t.isDragging()){var e=t.props.parentMoveable;e?e.checkUpdateRect():(U(t._observerId),t._observerId=V(function(){t.isDragging()||t.updateRect()}))}},t._onPreventClick=function(t){t.stopPropagation(),t.preventDefault()},t}return _e(r,n),r.prototype.render=function(){var e=this.props,n=this.getState(),r=e.parentPosition,i=e.className,o=e.target,a=e.zoom,s=e.cspNonce,u=e.translateZ,c=e.cssStyled,l=e.groupable,f=e.linePadding,p=e.controlPadding;this._checkUpdateRootContainer(),this.checkUpdate(),this.updateRenderPoses();var d=Oe(r||[0,0],2),h=d[0],g=d[1],v=n.left,m=n.top,b=n.target,x=n.direction,y=n.hasFixed,D=n.offsetDelta,w=e.targets,S=this.isDragging(),M={};this.getEnabledAbles().forEach(function(t){M["data-able-".concat(t.name.toLowerCase())]=!0});var C=this._getAbleClassName(),_=w&&w.length&&(b||l)||o||!this._hasFirstTarget&&this.state.isPersisted,T=this.controlBox||this.props.firstRenderState||this.props.persistData,O=[v-h,m-g];!l&&e.useAccuratePosition&&(O[0]+=D[0],O[1]+=D[1]);var P={position:y?"fixed":"absolute",display:_?"block":"none",visibility:T?"visible":"hidden",transform:"translate3d(".concat(O[0],"px, ").concat(O[1],"px, ").concat(u,")"),"--zoom":a,"--zoompx":"".concat(a,"px")};return f&&(P["--moveable-line-padding"]=f),p&&(P["--moveable-control-padding"]=p),t.createElement(c,Te({cspNonce:s,ref:E(this,"controlBox"),className:"".concat(ur("control-box",-1===x?"reverse":"",S?"dragging":"")," ").concat(C," ").concat(i)},M,{onClick:this._onPreventClick,style:P}),this.renderAbles(),this._renderLines())},r.prototype.componentDidMount=function(){this.isMoveableMounted=!0,this.isUnmounted=!1;var t=this.props,e=t.parentMoveable,n=t.container;this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(this.props),n||e||this.state.isPersisted||(this.updateRect("",!1,!1),this.forceUpdate())},r.prototype.componentDidUpdate=function(t){this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateNativeEvents(),this._updateTargets(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(t)},r.prototype.componentWillUnmount=function(){var t,e;this.isMoveableMounted=!1,this.isUnmounted=!0,this._emitter.off(),null===(t=this._reiszeObserver)||void 0===t||t.disconnect(),null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._viewContainer&&this._changeAbleViewClassNames([]),zr(this,!1),zr(this,!0);var n=this.events;for(var r in n){var i=n[r];i&&i.destroy()}},r.prototype.getTargets=function(){var t=this.props.target;return t?[t]:[]},r.prototype.getAble=function(t){return q(this.props.ables||[],function(e){return e.name===t})},r.prototype.getContainer=function(){var t=this.props,e=t.parentMoveable,n=t.wrapperMoveable;return t.container||n&&n.getContainer()||e&&e.getContainer()||this.controlBox.parentElement},r.prototype.getControlBoxElement=function(){return this.controlBox},r.prototype.getDragElement=function(){return this._dragTarget},r.prototype.isMoveableElement=function(t){var e;return t&&((null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"class"))||"").indexOf(Ue)>-1},r.prototype.dragStart=function(t,e){void 0===e&&(e=t.target);var n=this.targetGesto,r=this.controlGesto;return n&&bi(this)({inputEvent:t},e)?n.isFlag()||n.triggerDragStart(t):r&&this.isMoveableElement(e)&&(r.isFlag()||r.triggerDragStart(t)),this},r.prototype.hitTest=function(t){var e,n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,s=n.pos4,u=n.targetClientRect;if(!r)return 0;if(gt(t)){var c=t.getBoundingClientRect();e={left:c.left,top:c.top,width:c.width,height:c.height}}else e=Te({width:0,height:0},t);var l=e.left,f=e.top,p=e.width,d=e.height,h=oe([i,o,s,a],u),g=ie(function(t,e){var n=function(t,e){var n=t.slice(),r=e.slice();-1===et(n)&&n.reverse(),-1===et(r)&&r.reverse();var i=fe(n),o=fe(r),a=i.map(function(t){return ue(t[0],t[1])}),s=o.map(function(t){return ue(t[0],t[1])}),u=[];a.forEach(function(t,e){var n=i[e],a=[];s.forEach(function(r,i){var s=le(ce(t,r),[n,o[i]]);a.push.apply(a,s.map(function(t){return{index1:e,index2:i,pos:t,type:"intersection"}}))}),a.sort(function(t,e){return nt(n[0],t.pos)-nt(n[0],e.pos)}),u.push.apply(u,a),se(n[1],r)&&u.push({index1:e,index2:-1,pos:n[1],type:"inside"})}),o.forEach(function(t,e){if(se(t[1],n)){var r=!1,i=H(u,function(t){return t.index2===e?(r=!0,!1):!!r});-1===i&&(r=!1,i=H(u,function(t){var n=t.index1,i=t.index2;return-1===n&&i+1===e?(r=!0,!1):!!r})),-1===i?u.push({index1:-1,index2:e,pos:t[1],type:"inside"}):u.splice(i,0,{index1:-1,index2:e,pos:t[1],type:"inside"})}});var c={};return u.filter(function(t){var e=t.pos,n=e[0]+"x"+e[1];return!c[n]&&(c[n]=!0,!0)})}(t,e);return n.map(function(t){return t.pos})}(h,[[l,f],[l+p,f],[l+p,f+d],[l,f+d]])),v=ie(h);return g&&v?Math.min(100,g/v*100):0},r.prototype.isInside=function(t,e){var n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,s=n.pos4,u=n.targetClientRect;return!!r&&se([t,e],oe([i,o,s,a],u))},r.prototype.updateRect=function(t,e,n){void 0===n&&(n=!0);var r=this.props,i=!r.parentPosition&&!r.wrapperMoveable;i&&_n(!0);var o=r.parentMoveable,a=this.state.target||r.target,s=this.getContainer(),u=o?o._rootContainer:this._rootContainer,c=Si(this.controlBox,a,s,s,u||s,this._getRequestStyles());if(!a&&this._hasFirstTarget&&r.persistData){var l=Mi(r.persistData);for(var f in l)c[f]=l[f]}i&&_n(),this.updateState(c,!o&&n)},r.prototype.isDragging=function(t){var e,n,r=this.targetGesto,i=this.controlGesto;return(null==r?void 0:r.isFlag())?!t||!!(null===(e=r.getEventData()[t])||void 0===e?void 0:e.isEventStart):!(!(null==i?void 0:i.isFlag())||t&&!(null===(n=i.getEventData()[t])||void 0===n?void 0:n.isEventStart))},r.prototype.updateTarget=function(t){this.updateRect(t,!0)},r.prototype.getRect=function(){var t=this.state,e=Gr(this.state),n=Oe(e,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Sr(e),u=t.width,c=t.height,l=s.width,f=s.height,p=s.left,d=s.top,h=[t.left,t.top],g=St(h,t.origin);return{width:l,height:f,left:p,top:d,pos1:r,pos2:i,pos3:o,pos4:a,offsetWidth:u,offsetHeight:c,beforeOrigin:St(h,t.beforeOrigin),origin:g,transformOrigin:t.transformOrigin,rotation:this.getRotation()}},r.prototype.getManager=function(){return this},r.prototype.stopDrag=function(t){var e;t&&"target"!==t||(!1===(null==(e=this.targetGesto)?void 0:e.isIdle())&&Ar(this,!1),null==e||e.stop()),t&&"control"!==t||(!1===(null==(e=this.controlGesto)?void 0:e.isIdle())&&Ar(this,!0),null==e||e.stop())},r.prototype.getRotation=function(){var t=this.state;return function(t,e,n){var r=tt(t,e)/Math.PI*180;return(r=n>=0?r:180-r)>=0?r:360+r}(t.pos1,t.pos2,t.direction)},r.prototype.request=function(t,e,n){void 0===e&&(e={});var r=this,i=r.props,o=i.parentMoveable||i.wrapperMoveable||r,a=o.props.ables,s=i.groupable,u=q(a,function(e){return e.name===t});if(this.isDragging()||!u||!u.request)return{request:function(){return this},requestEnd:function(){return this}};var c=u.request(r),l=n||e.isInstant,f=c.isControl?"controlAbles":"targetAbles",p="".concat(s?"Group":"").concat(c.isControl?"Control":""),d=Pe([],Oe(o[f]),!1),h={request:function(e){return mi(r,d,["drag"],p,"",Te(Te({},c.request(e)),{requestAble:t,isRequest:!0}),l),h},requestEnd:function(){return mi(r,d,["drag"],p,"End",Te(Te({},c.requestEnd()),{requestAble:t,isRequest:!0}),l),h}};return mi(r,d,["drag"],p,"Start",Te(Te({},c.requestStart(e)),{requestAble:t,isRequest:!0}),l),l?h.request(e).requestEnd():h},r.prototype.getMoveables=function(){return[this]},r.prototype.destroy=function(){this.componentWillUnmount()},r.prototype.updateRenderPoses=function(){var t=this.getState(),e=this.props,n=e.padding,r=t.originalBeforeOrigin,i=t.transformOrigin,o=t.allMatrix,a=t.is3d,s=t.pos1,u=t.pos2,c=t.pos3,l=t.pos4,f=t.left,p=t.top,d=t.isPersisted,h=e.zoom||1;if(!n&&h<=1)return t.renderPoses=[s,u,c,l],void(t.renderLines=[[s,u],[u,l],[l,c],[c,s]]);var g=ai(n||{}),v=g.left,m=g.top,b=g.bottom,x=g.right,y=a?4:3,E=Dt(y,It((d?i:this.controlBox&&e.groupable?r:St(r,[f,p])).map(function(t){return-t}),y),o,It(i,y)),D=Zr(E,s,[-v,-m],y),w=Zr(E,u,[x,-m],y),S=Zr(E,c,[-v,b],y),M=Zr(E,l,[x,b],y);t.renderPoses=[D,w,S,M],t.renderLines=[[D,w],[w,M],[M,S],[S,D]];var C=h/2;t.renderLines=[[Zr(E,s,[-v-C,-m],y),Zr(E,u,[x+C,-m],y)],[Zr(E,u,[x,-m-C],y),Zr(E,l,[x,b+C],y)],[Zr(E,l,[x+C,b],y),Zr(E,c,[-v-C,b],y)],[Zr(E,c,[-v,b+C],y),Zr(E,s,[-v,-m-C],y)]]},r.prototype.checkUpdate=function(){this._isPropTargetChanged=!1;var t=this.props,e=t.target,n=t.container,r=t.parentMoveable,i=this.state,o=i.target,a=i.container;if(o||e){this.updateAbles();var s=!qr(o,e);if(s||!qr(a,n)){var u=n||this.controlBox;u&&this.unsetAbles(),this.updateState({target:e,container:n}),!r&&u&&this.updateRect("End",!1,!1),this._isPropTargetChanged=s}}},r.prototype.waitToChangeTarget=function(){return new Promise(function(){})},r.prototype.triggerEvent=function(t,e){var n=this.props;if(this._emitter.trigger(t,e),n.parentMoveable&&e.isRequest&&!e.isRequestChild)return n.parentMoveable.triggerEvent(t,e,!0);var r=n[t];return r&&r(e)},r.prototype.useCSS=function(t,e){var n=this.props.customStyledMap,r=t+e;return n[r]||(n[r]=Me(t,e)),n[r]},r.prototype.getState=function(){var t,e=this.props;(e.target||(null===(t=e.targets)||void 0===t?void 0:t.length))&&(this._hasFirstTarget=!0);var n=this.controlBox,r=e.persistData,i=e.firstRenderState;if(i&&!n)return i;if(!this._hasFirstTarget&&r){var o=Mi(r);if(o)return this.updateState(o,!1),this.state}return this.state.isPersisted=!1,this.state},r.prototype.updateSelectors=function(){},r.prototype.unsetAbles=function(){var t=this;this.targetAbles.forEach(function(e){e.unset&&e.unset(t)})},r.prototype.updateAbles=function(t,e){void 0===t&&(t=this.props.ables),void 0===e&&(e="");var n=this.props.triggerAblesSimultaneously,r=this.getEnabledAbles(t),i="drag".concat(e,"Start"),o="pinch".concat(e,"Start"),a="drag".concat(e,"ControlStart"),s=Hr(r,[i,o],n),u=Hr(r,[a],n);this.enabledAbles=r,this.targetAbles=s,this.controlAbles=u},r.prototype.updateState=function(t,e){if(e){if(this.isUnmounted)return;this.setState(t)}else{var n=this.state;for(var r in t)n[r]=t[r]}},r.prototype.getEnabledAbles=function(t){void 0===t&&(t=this.props.ables);var e=this.props;return t.filter(function(t){return t&&(t.always&&!1!==e[t.name]||e[t.name])})},r.prototype.renderAbles=function(){var t,n,r,i,o=this,a=this.props.triggerAblesSimultaneously,s={createElement:e};return this.renderState={},(t=Lr(Hr(this.getEnabledAbles(),["render"],a).map(function(t){return(0,t.render)(o,s)||[]})).filter(function(t){return t}),n=function(t){return t.key},r=[],i={},t.forEach(function(t,e){var o=n(t),a=i[o];a||(a=[],i[o]=a,r.push(a)),a.push(t)}),r).map(function(t){return t[0]})},r.prototype.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},r.prototype._getRequestStyles=function(){return this.getEnabledAbles().reduce(function(t,e){var n,r,i=null!==(r=null===(n=e.requestStyle)||void 0===n?void 0:n.call(e))&&void 0!==r?r:[];return Pe(Pe([],Oe(t),!1),Oe(i),!1)},Pe([],Oe(this.props.requestStyles||[]),!1))},r.prototype._updateObserver=function(t){this._updateResizeObserver(t),this._updateMutationObserver(t)},r.prototype._updateEvents=function(){var t=this.targetAbles.length,e=this.controlAbles.length,n=this._dragTarget;(!t&&this.targetGesto||this._isTargetChanged(!0))&&(zr(this,!1),this.updateState({gestos:{}})),e||zr(this,!0),n&&t&&!this.targetGesto&&(this.targetGesto=xi(this,n,"")),!this.controlGesto&&e&&(this.controlGesto=yi(this,"Control"))},r.prototype._updateTargets=function(){var t=this.props;this._prevPropTarget=this._propTarget,this._prevDragTarget=this._dragTarget,this._prevOriginalDragTarget=this._originalDragTarget,this._prevDragArea=t.dragArea,this._propTarget=t.target,this._originalDragTarget=t.dragTarget||t.target,this._dragTarget=Jr(this._originalDragTarget,!0)},r.prototype._renderLines=function(){var t=this.props,n=t.zoom,r=t.hideDefaultLines,i=t.hideChildMoveableDefaultLines,o=t.parentMoveable;if(r||o&&i)return[];var a=this.getState(),s={createElement:e};return a.renderLines.map(function(t,e){return Bn(s,"",t[0],t[1],n,"render-line-".concat(e))})},r.prototype._isTargetChanged=function(t){var e=this.props,n=e.dragTarget||e.target,r=this._prevOriginalDragTarget,i=this._prevDragArea,o=e.dragArea;return!o&&r!==n||(t||o)&&i!==o||this._prevPropTarget!=this._propTarget},r.prototype._updateNativeEvents=function(){var t=this,e=this.props.dragArea?this.areaElement:this.state.target,n=this.events,r=Z(n);if(this._isTargetChanged())for(var i in n){var o=n[i];o&&o.destroy(),n[i]=null}if(e){var a=this.enabledAbles;r.forEach(function(r){var i=Hr(a,[r]),o=i.length>0,s=n[r];o?(s||(s=new Di(e,t,r),n[r]=s),s.setAbles(i)):s&&(s.destroy(),n[r]=null)})}},r.prototype._checkUpdateRootContainer=function(){var t=this.props.rootContainer;!this._rootContainer&&t&&(this._rootContainer=Jr(t,!0))},r.prototype._checkUpdateViewContainer=function(){var t=this.props.viewContainer;!this._viewContainer&&t&&(this._viewContainer=Jr(t,!0)),this._viewContainer&&this._changeAbleViewClassNames(Pe(Pe([],Oe(this._getAbleViewClassNames()),!1),[this.isDragging()?li:""],!1))},r.prototype._changeAbleViewClassNames=function(t){var e,n,r,i=this._viewContainer,o=(e=t.filter(Boolean),n=[],r=[],e.forEach(function(t,e){var i=t,o=r.indexOf(i),a=n[o]||[];-1===o&&(r.push(i),n.push(a)),a.push(t)}),n).map(function(t){return Oe(t,1)[0]}),a=this._viewClassNames,s=Zt(a,o),u=s.removed,c=s.added;u.forEach(function(t){st(i,a[t])}),c.forEach(function(t){at(i,o[t])}),this._viewClassNames=o},r.prototype._getAbleViewClassNames=function(){var t=this;return(this.getEnabledAbles().map(function(e){var n;return(null===(n=e.viewClassName)||void 0===n?void 0:n.call(e,t))||""}).join(" ")+" ".concat(this._getAbleClassName("-view"))).split(/\s+/g)},r.prototype._getAbleClassName=function(t){var e=this;void 0===t&&(t="");var n=this.getEnabledAbles(),r=this.targetGesto,i=this.controlGesto,o=(null==r?void 0:r.isFlag())?r.getEventData():{},a=(null==i?void 0:i.isFlag())?i.getEventData():{};return n.map(function(n){var r,i,s,u=n.name,c=(null===(r=n.className)||void 0===r?void 0:r.call(n,e))||"";return((null===(i=o[u])||void 0===i?void 0:i.isEventStart)||(null===(s=a[u])||void 0===s?void 0:s.isEventStart))&&(c+=" ".concat(ur("".concat(u).concat(t,"-dragging")))),c.trim()}).filter(Boolean).join(" ")},r.prototype._updateResizeObserver=function(t){var e,n=this.props,r=n.target,i=dt(this.getControlBoxElement());if(i.ResizeObserver&&r&&n.useResizeObserver){if(t.target!==r||!this._reiszeObserver){var o=new i.ResizeObserver(this.checkUpdateRect);o.observe(r,{box:"border-box"}),this._reiszeObserver=o}}else null===(e=this._reiszeObserver)||void 0===e||e.disconnect()},r.prototype._updateMutationObserver=function(t){var e,n=this,r=this.props,i=r.target,o=dt(this.getControlBoxElement());if(o.MutationObserver&&i&&r.useMutationObserver){if(t.target!==i||!this._mutationObserver){var a=new o.MutationObserver(function(t){var e,r;try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),o=i.next();!o.done;o=i.next()){var a=o.value;"attributes"===a.type&&"style"===a.attributeName&&n.checkUpdateRect()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}});a.observe(i,{attributes:!0}),this._mutationObserver=a}}else null===(e=this._mutationObserver)||void 0===e||e.disconnect()},r.defaultProps={dragTargetSelf:!1,target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,parentMoveable:null,wrapperMoveable:null,isWrapperMounted:!1,parentPosition:null,warpSelf:!1,svgOrigin:"",dragContainer:null,useResizeObserver:!1,useMutationObserver:!1,preventDefault:!0,preventRightClick:!0,preventWheelClick:!0,linePadding:0,controlPadding:0,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,dragFocusedInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{},stopPropagation:!1,preventClickDefault:!1,preventClickEventOnDrag:!0,flushSync:cr,firstRenderState:null,persistData:null,viewContainer:null,requestStyles:[],useAccuratePosition:!1},r}(t.PureComponent),_i={name:"groupable",props:["defaultGroupRotate","useDefaultGroupRotate","defaultGroupOrigin","groupable","groupableProps","targetGroups","hideChildMoveableDefaultLines"],events:[],render:function(t,e){var n,r=t.props,i=r.targets||[],o=t.getState(),a=o.left,s=o.top,u=o.isPersisted,c=r.zoom||1,l=t.renderGroupRects,f=(null===(n=r.persistData)||void 0===n?void 0:n.children)||[];u?i=f.map(function(){return null}):f=[];var p=ri(t,"parentPosition",[a,s],function(t){return t.join(",")}),d=ri(t,"requestStyles",t.getRequestChildStyles(),function(t){return t.join(",")});return t.moveables=t.moveables.slice(0,i.length),Pe(Pe([],Oe(i.map(function(n,i){return e.createElement(Ci,{key:"moveable"+i,ref:D(t,"moveables",i),target:n,origin:!1,requestStyles:d,cssStyled:r.cssStyled,customStyledMap:r.customStyledMap,useResizeObserver:r.useResizeObserver,useMutationObserver:r.useMutationObserver,hideChildMoveableDefaultLines:r.hideChildMoveableDefaultLines,parentMoveable:t,parentPosition:[a,s],persistData:f[i],zoom:c})})),!1),Oe(Lr(l.map(function(t,n){var r=[t.pos1,t.pos2,t.pos3,t.pos4];return[[0,1],[1,3],[3,2],[2,0]].map(function(t,i){var o=Oe(t,2),a=o[0],s=o[1];return Bn(e,"",Mt(r[a],p),Mt(r[s],p),c,"group-rect-".concat(n,"-").concat(i))})}))),!1)}};function Ti(t){var e=t.originalDatas.draggable;return e||(t.originalDatas.draggable={},e=t.originalDatas.draggable),Te(Te({},t),{datas:e})}Re("clickable",{props:["clickable"],events:["click","clickGroup"],always:!0,dragRelation:"weak",dragStart:function(){},dragControlStart:function(){},dragGroupStart:function(t,e){e.datas.inputTarget=e.inputEvent&&e.inputEvent.target},dragEnd:function(t,e){var n=t.props.target,r=e.inputEvent,i=e.inputTarget,o=!t.isMoveableElement(i)&&t.controlBox.contains(i);if(r&&i&&!e.isDrag&&!t.isMoveableElement(i)&&!o){var a=n.contains(i);Xr(t,"onClick",Nr(t,e,{isDouble:e.isDouble,inputTarget:i,isTarget:n===i,moveableTarget:t.props.target,containsTarget:a}))}},dragGroupEnd:function(t,e){var n=e.inputEvent,r=e.inputTarget;if(n&&r&&!e.isDrag&&!t.isMoveableElement(r)&&e.datas.inputTarget!==r){var i=t.props.targets,o=i.indexOf(r),a=o>-1,s=!1;-1===o&&(s=(o=H(i,function(t){return t.contains(r)}))>-1),Xr(t,"onClickGroup",Nr(t,e,{isDouble:e.isDouble,targets:i,inputTarget:r,targetIndex:o,isTarget:a,containsTarget:s,moveableTarget:i[o]}))}},dragControlEnd:function(t,e){this.dragEnd(t,e)},dragGroupControlEnd:function(t,e){this.dragEnd(t,e)}}),Re("edgeDraggable",{css:[".edge.edgeDraggable.line {\ncursor: move;\n}"],render:function(t,e){var n=t.props,r=n.edgeDraggable;return r?Gn(e,"edgeDraggable",r,t.getState().renderPoses,n.zoom):[]},dragCondition:function(t,e){var n,r=t.props,i=null===(n=e.inputEvent)||void 0===n?void 0:n.target;return!(!r.edgeDraggable||!i)&&!r.draggable&&ot(i,ur("direction"))&&ot(i,ur("edge"))&&ot(i,ur("edgeDraggable"))},dragStart:function(t,e){return rr.dragStart(t,Ti(e))},drag:function(t,e){return rr.drag(t,Ti(e))},dragEnd:function(t,e){return rr.dragEnd(t,Ti(e))},dragGroupCondition:function(t,e){var n,r=t.props,i=null===(n=e.inputEvent)||void 0===n?void 0:n.target;return!(!r.edgeDraggable||!i)&&!r.draggable&&ot(i,ur("direction"))&&ot(i,ur("line"))},dragGroupStart:function(t,e){return rr.dragGroupStart(t,Ti(e))},dragGroup:function(t,e){return rr.dragGroup(t,Ti(e))},dragGroupEnd:function(t,e){return rr.dragGroupEnd(t,Ti(e))},unset:function(t){return rr.unset(t)}});var Oi={name:"individualGroupable",props:["individualGroupable","individualGroupableProps"],events:[]};function Pi(t,e){var n=Oe(t,3),r=n[0],i=n[1],o=n[2];return(r*e[0]+i*e[1]+o)/Math.sqrt(r*r+i*i)}function Ri(t,e){var n=Oe(t,2),r=n[0],i=n[1];return-r*e[0]-i*e[1]}function ki(t,e){return Math.max.apply(Math,Pe([],Oe(t.map(function(t){var n=Oe(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return Math.max(r[e],i[e],o[e],a[e])})),!1))}function Fi(t,e){return Math.min.apply(Math,Pe([],Oe(t.map(function(t){var n=Oe(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return Math.min(r[e],i[e],o[e],a[e])})),!1))}function Bi(t,e){var n=e.map(function(e){if(k(e)){var n=Bi(t,e),r=n.length;return r>1?n:1===r?n[0]:null}var i=q(t,function(t){return t.manager.props.target===e});return i?(i.finded=!0,i.manager):null}).filter(Boolean);return 1===n.length&&k(n[0])?n[0]:n}var Gi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.differ=new te,e.moveables=[],e.transformOrigin="50% 50%",e.renderGroupRects=[],e._targetGroups=[],e._hasFirstTargets=!1,e}return _e(e,t),e.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this)},e.prototype.checkUpdate=function(){this._isPropTargetChanged=!1,this.updateAbles()},e.prototype.getTargets=function(){return this.props.targets},e.prototype.updateRect=function(t,e,n){var r;void 0===n&&(n=!0);var i=this.state;if(this.controlBox&&!i.isPersisted){_n(!0),this.moveables.forEach(function(e){e.updateRect(t,!1,!1)});var o=this.props,a=this.moveables,s=i.target||o.target,u=a.map(function(t){return{finded:!1,manager:t}}),c=this.props.targetGroups||[],l=Bi(u,c),f=o.useDefaultGroupRotate;l.push.apply(l,Pe([],Oe(u.filter(function(t){return!t.finded}).map(function(t){return t.manager})),!1));var p=[],d=!e||""!==t&&o.updateGroup,h=o.defaultGroupRotate||0;if(!this._hasFirstTargets){var g=null===(r=o.persistData)||void 0===r?void 0:r.rotation;null!=g&&(h=g)}var v=function t(e,n,r){var i,o=e.map(function(e){if(k(e)){var r=t(e,n),i=[r.pos1,r.pos2,r.pos3,r.pos4];return p.push(r),{poses:i,rotation:r.rotation}}return{poses:Gr(e.state),rotation:e.getRotation()}}),a=o.map(function(t){return t.rotation}),s=a[0],u=a.every(function(t){return Math.abs(s-t)<.1});i=d?!f&&u?s:h:f||r||!u?n:s;var c=o.map(function(t){return t.poses}),l=function(t,e){var n,r,i,o=[0,0],a=[0,0],s=[0,0],u=[0,0],c=0,l=0;if(!t.length)return{pos1:o,pos2:a,pos3:s,pos4:u,minX:0,minY:0,maxX:0,maxY:0,width:c,height:l,rotation:e};var f=rt(e,Je);if(f%90){var p=f/180*Math.PI,d=Math.tan(p),h=-1/d,g=[Qe,tn],v=[[0,0],[0,0]],m=[Qe,tn],b=[[0,0],[0,0]];t.forEach(function(t){t.forEach(function(t){var e=Pi([-d,1,0],t),n=Pi([-h,1,0],t);g[0]>e&&(v[0]=t,g[0]=e),g[1]<e&&(v[1]=t,g[1]=e),m[0]>n&&(b[0]=t,m[0]=n),m[1]<n&&(b[1]=t,m[1]=n)})});var x=Oe(v,2),y=x[0],E=x[1],D=Oe(b,2),w=D[0],S=D[1],M=[-d,1,Ri([-d,1],y)],C=[-d,1,Ri([-d,1],E)],_=[-h,1,Ri([-h,1],w)],T=[-h,1,Ri([-h,1],S)];n=Oe([[M,_],[M,T],[C,_],[C,T]].map(function(t){var e=Oe(t,2);return ce(e[0],e[1])[0]}),4),o=n[0],a=n[1],s=n[2],u=n[3],c=m[1]-m[0],l=g[1]-g[0]}else{var O=Fi(t,0),P=Fi(t,1),R=ki(t,0),k=ki(t,1);o=[O,P],a=[R,P],s=[O,k],u=[R,k],c=R-O,l=k-P,f%180&&(o=(r=Oe([s,o,u,a],4))[0],a=r[1],s=r[2],u=r[3],c=k-P,l=R-O)}f%360>180&&(o=(i=Oe([u,s,a,o],4))[0],a=i[1],s=i[2],u=i[3]);var F=ae([o,a,s,u]);return{pos1:o,pos2:a,pos3:s,pos4:u,width:c,height:l,minX:F.minX,minY:F.minY,maxX:F.maxX,maxY:F.maxY,rotation:e}}(c,i);return l}(l,this.rotation,!0);d&&(this.rotation=v.rotation,this.transformOrigin=o.defaultGroupOrigin||"50% 50%",this.scale=[1,1]),this._targetGroups=c,this.renderGroupRects=p;var m=this.transformOrigin,b=this.rotation,x=this.scale,y=v.width,E=v.height,D=v.minX,w=v.minY,S=ae(function(t,e,n){var r=t.map(function(t){return Mt(t,e)}),i=r.map(function(t){return function(t,e){return Tt(Gt(e,3),yt(t,3))}(t,n)});return{prev:r,next:i,result:i.map(function(t){return St(t,e)})}}([[0,0],[y,0],[0,E],[y,E]],ei(m,y,E),this.rotation/180*Math.PI).result),M=S.minX,C=S.minY,_=" rotate(".concat(b,"deg)")+" scale(".concat(ii(x[0]),", ").concat(ii(x[1]),")"),T="translate(".concat(-M,"px, ").concat(-C,"px)").concat(_);this.controlBox.style.transform="translate3d(".concat(D,"px, ").concat(w,"px, ").concat(this.props.translateZ||0,")"),s.style.cssText+="left:0px;top:0px;"+"transform-origin:".concat(m,";")+"width:".concat(y,"px;height:").concat(E,"px;")+"transform: ".concat(T),i.width=y,i.height=E;var O=this.getContainer(),P=Si(this.controlBox,s,this.controlBox,this.getContainer(),this._rootContainer||O,[]),R=[P.left,P.top],F=Oe(Gr(P),4),B=F[0],G=F[1],A=F[2],z=F[3],I=ae([B,G,A,z]),N=[I.minX,I.minY],Y=ii(x[0]*x[1]);P.pos1=Mt(B,N),P.pos2=Mt(G,N),P.pos3=Mt(A,N),P.pos4=Mt(z,N),P.left=D-P.left+N[0],P.top=w-P.top+N[1],P.origin=Mt(St(R,P.origin),N),P.beforeOrigin=Mt(St(R,P.beforeOrigin),N),P.originalBeforeOrigin=St(R,P.originalBeforeOrigin),P.transformOrigin=Mt(St(R,P.transformOrigin),N),s.style.transform="translate(".concat(-M-N[0],"px, ").concat(-C-N[1],"px)")+_,_n(),this.updateState(Te(Te({},P),{posDelta:N,direction:Y,beforeDirection:Y}),n)}},e.prototype.getRect=function(){return Te(Te({},t.prototype.getRect.call(this)),{children:this.moveables.map(function(t){return t.getRect()})})},e.prototype.triggerEvent=function(e,n,r){if(r||e.indexOf("Group")>-1)return t.prototype.triggerEvent.call(this,e,n);this._emitter.trigger(e,n)},e.prototype.getRequestChildStyles=function(){return this.getEnabledAbles().reduce(function(t,e){var n,r,i=null!==(r=null===(n=e.requestChildStyle)||void 0===n?void 0:n.call(e))&&void 0!==r?r:[];return Pe(Pe([],Oe(t),!1),Oe(i),!1)},[])},e.prototype.getMoveables=function(){return Pe([],Oe(this.moveables),!1)},e.prototype.updateAbles=function(){t.prototype.updateAbles.call(this,Pe(Pe([],Oe(this.props.ables),!1),[_i],!1),"Group")},e.prototype._updateTargets=function(){t.prototype._updateTargets.call(this),this._originalDragTarget=this.props.dragTarget||this.areaElement,this._dragTarget=Jr(this._originalDragTarget,!0)},e.prototype._updateEvents=function(){var t=this.state,e=this.props,n=this._prevDragTarget,r=e.dragTarget||this.areaElement,i=e.targets,o=this.differ.update(i),a=o.added,s=o.changed,u=o.removed,c=a.length||u.length;(c||this._prevOriginalDragTarget!==this._originalDragTarget)&&(zr(this,!1),zr(this,!0),this.updateState({gestos:{}})),n!==r&&(t.target=null),t.target||(t.target=this.areaElement,this.controlBox.style.display="block"),t.target&&(this.targetGesto||(this.targetGesto=xi(this,this._dragTarget,"Group")),this.controlGesto||(this.controlGesto=yi(this,"GroupControl")));var l=!qr(t.container,e.container);l&&(t.container=e.container),(l||c||this.transformOrigin!==(e.defaultGroupOrigin||"50% 50%")||s.length||i.length&&!ni(this._targetGroups,e.targetGroups||[]))&&(this.updateRect(),this._hasFirstTargets=!0),this._isPropTargetChanged=!!c},e.prototype._updateObserver=function(){},e.defaultProps=Te(Te({},Ci.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),e}(Ci),Ai=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.moveables=[],t}return _e(n,e),n.prototype.render=function(){var e,n=this,r=this.props,i=r.cspNonce,o=r.cssStyled,a=r.persistData,s=r.targets||[],u=s.length,c=this.isUnmounted||!u,l=null!==(e=null==a?void 0:a.children)&&void 0!==e?e:[];return c&&!u&&l.length?s=l.map(function(){return null}):c||(l=[]),t.createElement(o,{cspNonce:i,ref:E(this,"controlBox"),className:ur("control-box")},s.map(function(e,i){var o,a,s=null!==(a=null===(o=r.individualGroupableProps)||void 0===o?void 0:o.call(r,e,i))&&void 0!==a?a:{};return t.createElement(Ci,Te({key:"moveable"+i,ref:D(n,"moveables",i)},r,s,{target:e,wrapperMoveable:n,isWrapperMounted:n.isMoveableMounted,persistData:l[i]}))}))},n.prototype.componentDidMount=function(){},n.prototype.componentDidUpdate=function(){},n.prototype.getTargets=function(){return this.props.targets},n.prototype.updateRect=function(t,e,n){void 0===n&&(n=!0),_n(!0),this.moveables.forEach(function(r){r.updateRect(t,e,n)}),_n()},n.prototype.getRect=function(){return Te(Te({},e.prototype.getRect.call(this)),{children:this.moveables.map(function(t){return t.getRect()})})},n.prototype.request=function(t,e,n){void 0===e&&(e={});var r=this.moveables.map(function(n){return n.request(t,Te(Te({},e),{isInstant:!1}),!1)}),i={request:function(t){return r.forEach(function(e){return e.request(t)}),this},requestEnd:function(){return r.forEach(function(t){return t.requestEnd()}),this}};return n||e.isInstant?i.request(e).requestEnd():i},n.prototype.dragStart=function(t,e){void 0===e&&(e=t.target);var n=e,r=q(this.moveables,function(t){var e=t.getTargets()[0],r=t.getControlBoxElement(),i=t.getDragElement();return!(!e||!i)&&(i===n||i.contains(n)||i!==e&&e===n||e.contains(n)||r===n||r.contains(n))});return r&&r.dragStart(t,e),this},n.prototype.hitTest=function(){return 0},n.prototype.isInside=function(){return!1},n.prototype.isDragging=function(){return!1},n.prototype.getDragElement=function(){return null},n.prototype.getMoveables=function(){return Pe([],Oe(this.moveables),!1)},n.prototype.updateRenderPoses=function(){},n.prototype.checkUpdate=function(){},n.prototype.triggerEvent=function(){},n.prototype.updateAbles=function(){},n.prototype._updateEvents=function(){},n.prototype._updateObserver=function(){},n}(Ci);function zi(t,e){var n=[];return t.forEach(function(t){t&&(F(t)?e[t]&&n.push.apply(n,Pe([],Oe(e[t]),!1)):k(t)?n.push.apply(n,Pe([],Oe(zi(t,e)),!1)):n.push(t))}),n}function Ii(t,e){var n=[];return t.forEach(function(t){t&&(F(t)?e[t]&&n.push.apply(n,Pe([],Oe(e[t]),!1)):k(t)?n.push(Ii(t,e)):n.push(t))}),n}function Ni(t,e){return t.length!==e.length||t.some(function(t,n){var r=e[n];return!(!t&&!r)&&t!=r&&(!k(t)||!k(r)||Ni(t,r))})}var Yi=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.refTargets=[],t.selectorMap={},t._differ=new te,t._elementTargets=[],t._tmpRefTargets=[],t._tmpSelectorMap={},t._onChangeTargets=null,t}var r,i;return _e(n,e),n.makeStyled=function(){var t={};this.getTotalAbles().forEach(function(e){var n=e.css;n&&n.forEach(function(e){t[e]=!0})});var e=Z(t).join("\n");this.defaultStyled=Me("div",function(t,e){return e.replace(/([^}{]*){/gm,function(e,n){return n.replace(/\.([^{,\s\d.]+)/g,"."+t+"$1")+"{"})}(Ue,Ke+e))},n.getTotalAbles=function(){return Pe([hi,_i,Oi,di],Oe(this.defaultAbles),!1)},n.prototype.render=function(){var e,n=this.constructor;n.defaultStyled||n.makeStyled();var r=this.props,i=r.ables,o=r.props,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(r,["ables","props"]),s=Oe(this._updateRefs(!0),2),u=s[0],c=s[1],l=zi(u,c),f=l.length>1,p=Pe(Pe([],Oe(n.getTotalAbles()),!1),Oe(i||[]),!1),d=Te(Te(Te({},a),o||{}),{ables:p,cssStyled:n.defaultStyled,customStyledMap:n.customStyledMap});this._elementTargets=l;var h=null,g=this.moveable,v=a.persistData;if((null==v?void 0:v.children)&&(f=!0),a.individualGroupable)return t.createElement(Ai,Te({key:"individual-group",ref:E(this,"moveable")},d,{target:null,targets:l}));if(f){var m=Ii(u,c);if(g&&!g.props.groupable&&!g.props.individualGroupable){var b=g.props.target;b&&l.indexOf(b)>-1&&(h=Te({},g.state))}return t.createElement(Gi,Te({key:"group",ref:E(this,"moveable")},d,null!==(e=a.groupableProps)&&void 0!==e?e:{},{target:null,targets:l,targetGroups:m,firstRenderState:h}))}var x=l[0];if(g&&(g.props.groupable||g.props.individualGroupable)){var y=q(g.moveables||[],function(t){return t.props.target===x});y&&(h=Te({},y.state))}return t.createElement(Ci,Te({key:"single",ref:E(this,"moveable")},d,{target:x,firstRenderState:h}))},n.prototype.componentDidMount=function(){this._checkChangeTargets()},n.prototype.componentDidUpdate=function(){this._checkChangeTargets()},n.prototype.componentWillUnmount=function(){this.selectorMap={},this.refTargets=[]},n.prototype.getTargets=function(){var t,e;return null!==(e=null===(t=this.moveable)||void 0===t?void 0:t.getTargets())&&void 0!==e?e:[]},n.prototype.updateSelectors=function(){this.selectorMap={},this._updateRefs(),this.forceUpdate()},n.prototype.waitToChangeTarget=function(){var t,e=this;return this._onChangeTargets=function(){e._onChangeTargets=null,t()},new Promise(function(e){t=e})},n.prototype.waitToChangeTargets=function(){return this.waitToChangeTarget()},n.prototype.getManager=function(){return this.moveable},n.prototype.getMoveables=function(){return this.moveable.getMoveables()},n.prototype.getDragElement=function(){return this.moveable.getDragElement()},n.prototype._updateRefs=function(t){var e=this.refTargets,n=Qr(this.props.target||this.props.targets),r="undefined"!=typeof document,i=Ni(e,n),o=this.selectorMap,a={};return this.refTargets.forEach(function t(e){F(e)?o[e]?a[e]=o[e]:r&&(i=!0,a[e]=[].slice.call(document.querySelectorAll(e))):k(e)&&e.forEach(t)}),this._tmpRefTargets=n,this._tmpSelectorMap=a,[n,a,!t&&i]},n.prototype._checkChangeTargets=function(){var t,e,n;this.refTargets=this._tmpRefTargets,this.selectorMap=this._tmpSelectorMap;var r=this._differ.update(this._elementTargets),i=r.added,o=r.removed;(i.length||o.length)&&(null===(e=(t=this.props).onChangeTargets)||void 0===e||e.call(t,{moveable:this.moveable,targets:this._elementTargets}),null===(n=this._onChangeTargets)||void 0===n||n.call(this));var a=Oe(this._updateRefs(),3),s=a[0],u=a[1],c=a[2];this.refTargets=s,this.selectorMap=u,c&&this.forceUpdate()},n.defaultAbles=[],n.customStyledMap={},n.defaultStyled=null,function(t,e,n,r){var i,o=arguments.length,a=o<3?e:r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([(r=rn,void 0===i&&(i={}),function(t,e){r.forEach(function(n){var r=i[n]||n;r in t||(t[r]=function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=(t=this[e])[n].apply(t,r);return o===this[e]?this:o})})})],n.prototype,"moveable",void 0),n}(t.PureComponent);const Xi=(Wi=[rr,or],Hi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _e(e,t),e}(Yi),Hi.defaultAbles=Wi,Hi);var Wi,Hi;export{Xi as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.11
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import{Workbook as e}from"@sheetxl/sdk";const r=async(e,r)=>{const n=await e.toJSON(),t=r?.whiteSpace??0;let o;r?.beforeWrite?.(e,n),o=0===t?JSON.stringify(n):function(e,r=2){const n=[];function t(e){const t=r*e;return void 0===n[t]&&(n[t]=" ".repeat(t)),n[t]}return function e(r,n,o,f){if(null==r||"object"!=typeof r)return JSON.stringify(r);const i=t(n),a=t(n+1);if(Array.isArray(r)){const t=r.length;if(0===t)return"[]";if(0!==o)return JSON.stringify(r);let f="[\n";for(let i=0;i<t;i++)f+=a+e(r[i],n+1,o+1,!0),i<t-1&&(f+=",\n");return f+="\n"+i+"]",f}const s=Object.keys(r),u=s.length;if(0===u)return"{}";if(!(o<2))return JSON.stringify(r);let c="{\n";f||(o=0);for(let t=0;t<u;t++){const f=s[t];c+=a+JSON.stringify(f)+": "+e(r[f],n+1,o,!1),t<u-1&&(c+=",\n")}return c+="\n"+i+"}",c}(e,0,0,!1)}(n,t);let f=(new TextEncoder).encode(o).buffer;const i=r?.compress??!0;return i&&(f=await async function(e,r="gzip"){let n;"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer?(n=new ArrayBuffer(e.byteLength),new Uint8Array(n).set(new Uint8Array(e))):n=e;const t=new ReadableStream({start(e){e.enqueue(n),e.close()}}),o=new CompressionStream(r),f=t.pipeThrough(o);return(await new Response(f).blob()).arrayBuffer()}(f,"string"==typeof i?i:void 0)),f},n=async(r,n)=>{let t=r;(function(e){if(e.byteLength<4)return!1;const r=new Uint8Array(e),n={gzip:[31,139],zip:[80,75,3,4],bz2:[66,90,104],br:[206,178,207,129]},t=Object.keys(n);for(let e=0;e<t.length;e++){const o=t[e],f=n[o];let i=!0;for(let e=0;e<f.length;e++)if(r[e]!==f[e]){i=!1;break}if(i)return o}return!1})(t)&&(t=await async function(e,r="gzip"){let n;"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer?(n=new ArrayBuffer(e.byteLength),new Uint8Array(n).set(new Uint8Array(e))):n=e;const t=new Blob([n]).stream(),o=new DecompressionStream(r),f=t.pipeThrough(o);return(await new Response(f).blob()).arrayBuffer()}(t));let o=(new TextDecoder).decode(t);const f=JSON.parse(o),i={...n?.createWorkbookOptions??{},json:f};return new e(i)};export{n as fromBufferJSON,r as toBufferJSON};
|