diff --git a/.gitignore b/.gitignore index cb6effe19..a446f075f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,4 @@ statistics/ .scene_cache *.mp4 demo/storybook -dist/ + diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a385382a..2fc5360a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Expand the functions of `translate` and `rotate` properties. +## [0.25.2] - 2021-06-16 +* `moveable` 0.25.2 +* `react-moveable` 0.28.2 +* `preact-moveable` 0.27.2 +* `ngx-moveable` 0.21.2 +* `svelte-moveable` 0.16.2 +* `lit-moveable` 0.2.2 + +### Fixed +* Fixed the problem that left and top dashed guidelines were not visible + ## [0.25.1] - 2021-06-16 * `moveable` 0.25.1 diff --git a/demo/index.html b/demo/index.html index 652196875..a24b82148 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1 +1 @@ -Moveable is Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable!
\ No newline at end of file +Moveable is Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable!
\ No newline at end of file diff --git a/demo/static/js/2.fa621068.chunk.js b/demo/static/js/2.8e0d6703.chunk.js similarity index 99% rename from demo/static/js/2.fa621068.chunk.js rename to demo/static/js/2.8e0d6703.chunk.js index f2c96754a..122934950 100644 --- a/demo/static/js/2.fa621068.chunk.js +++ b/demo/static/js/2.8e0d6703.chunk.js @@ -1,3 +1,3 @@ -/*! For license information please see 2.fa621068.chunk.js.LICENSE.txt */ -(this["webpackJsonp@scena/react-editor"]=this["webpackJsonp@scena/react-editor"]||[]).push([[2],[function(e,t,n){"use strict";n.d(t,"l",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"f",(function(){return o})),n.d(t,"k",(function(){return a})),n.d(t,"c",(function(){return A})),n.d(t,"j",(function(){return s})),n.d(t,"m",(function(){return l})),n.d(t,"i",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"o",(function(){return h})),n.d(t,"e",(function(){return g})),n.d(t,"b",(function(){return v})),n.d(t,"h",(function(){return B})),n.d(t,"n",(function(){return b})),n.d(t,"X",(function(){return te})),n.d(t,"y",(function(){return E})),n.d(t,"M",(function(){return y})),n.d(t,"K",(function(){return C})),n.d(t,"H",(function(){return Q})),n.d(t,"L",(function(){return x})),n.d(t,"J",(function(){return F})),n.d(t,"I",(function(){return U})),n.d(t,"V",(function(){return O})),n.d(t,"U",(function(){return H})),n.d(t,"T",(function(){return T})),n.d(t,"S",(function(){return N})),n.d(t,"W",(function(){return _})),n.d(t,"u",(function(){return M})),n.d(t,"x",(function(){return R})),n.d(t,"Z",(function(){return D})),n.d(t,"N",(function(){return P})),n.d(t,"A",(function(){return k})),n.d(t,"z",(function(){return I})),n.d(t,"Q",(function(){return K})),n.d(t,"v",(function(){return L})),n.d(t,"D",(function(){return z})),n.d(t,"R",(function(){return j})),n.d(t,"w",(function(){return X})),n.d(t,"s",(function(){return G})),n.d(t,"Y",(function(){return V})),n.d(t,"t",(function(){return W})),n.d(t,"r",(function(){return J})),n.d(t,"E",(function(){return q})),n.d(t,"F",(function(){return Z})),n.d(t,"C",(function(){return $})),n.d(t,"a",(function(){return ne})),n.d(t,"G",(function(){return re})),n.d(t,"p",(function(){return ie})),n.d(t,"O",(function(){return oe})),n.d(t,"B",(function(){return ae})),n.d(t,"q",(function(){return Ae})),n.d(t,"P",(function(){return se}));var r="rgba",i=["rgb",r,"hsl","hsla"],o="function",a="property",A="array",s="object",l="string",u="number",c="undefined"!==typeof window,f="undefined"!==typeof document&&document,d=["webkit","ms","moz","o"],p=function(e){if(!f)return"";var t=(f.body||f.documentElement).style,n=d.length;if("undefined"!==typeof t[e])return e;for(var r=0;r-1&&(a=S(o,t,i+1,r)),-1===a)break;i=a}return-1}function O(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,o=[],a=[],A=0;A-1)l=S(s,r,A+1,i);else if(s===t){a.length&&(o.push(a.join("")),a=[]);continue}}-1===l&&(l=i-1),a.push(r.slice(A,l+1).join("")),A=l}return a.length&&o.push(a.join("")),o}function H(e){return O(e,"")}function T(e){return O(e,",")}function N(e){var t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!t||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]}}function _(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var n=t[1],r=t[2];return{prefix:n,unit:t[3],value:parseFloat(r)}}function M(e){return e.replace(/[\s-_]([a-z])/g,(function(e,t){return t.toUpperCase()}))}function R(e,t){return void 0===t&&(t="-"),e.replace(/([a-z])([A-Z])/g,(function(e,n,r){return""+n+t+r.toLowerCase()}))}function D(e){return[].slice.call(e)}function P(){return Date.now?Date.now():(new Date).getTime()}function k(e,t,n){void 0===n&&(n=-1);for(var r=e.length,i=0;i-1?e[r]:n}var K=function(){var e=P(),t=c&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return t?t.bind(window):function(t){var n=P();return window.setTimeout((function(){t(n-e)}),1e3/60)}}(),L=function(){var e=c&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return e?e.bind(window):function(e){clearTimeout(e)}}();function z(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in t)t.push(n);return t}function j(e,t){void 0===t&&(t=[]),e.sort((function(e,n){var r=t.indexOf(e),i=t.indexOf(n);return-1===i&&-1===r?0:-1===r?1:-1===i?-1:r-i}))}function X(e,t){var n=_(e),r=n.value,i=n.unit;if(C(t)){var o=t[i];if(o){if(U(o))return o(r);if(w[i])return w[i](r,o)}}else if("%"===i)return r*t/100;return w[i]?w[i](r):r}function G(e,t,n){return Math.max(t,Math.min(e,n))}function V(e,t){return t?Math.round(e/t)*t:e}function Y(e,t,n){return[[V(t[0],b),V(t[0]*e[1]/e[0],b)],[V(t[1]*e[0]/e[1],b),V(t[1],b)]].filter((function(e){return e.every((function(e,r){return n?e<=t[r]:e>=t[r]}))}))[0]||e}function W(e,t,n,r){if(!r)return e.map((function(e,r){return G(e,t[r],n[r])}));var i=e[0],o=e[1],a=Y(e,t,!1),A=a[0],s=a[1],l=Y(e,n,!0),u=l[0],c=l[1];return iu||o>c)&&(i=u,o=c),[i,o]}function J(e){for(var t=e.length,n=0,r=t-1;r>=0;--r)n+=e[r];return t?n/t:0}function q(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=Math.atan2(r,n);return i>=0?i:i+2*Math.PI}function Z(e){var t=function(e){return[0,1].map((function(t){return J(e.map((function(e){return e[t]})))}))}(e),n=q(t,e[0]),r=q(t,e[1]);return nr&&r-n<-Math.PI?1:-1}function $(e,t){return Math.sqrt(Math.pow((t?t[0]:0)-e[0],2)+Math.pow((t?t[1]:0)-e[1],2))}function ee(e){var t=function(e){return e.replace("#","")}(e),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),o=parseInt(t.substring(6,8),16)/255;return isNaN(o)&&(o=1),[n,r,i,o]}function te(e){if("#"===e.charAt(0))return 4===e.length||5===e.length?ee(function(e){var t=e.charAt(1),n=e.charAt(2),r=e.charAt(3),i=e.charAt(4);return["#",t,t,n,n,r,r,i,i].join("")}(e)):ee(e);if(-1!==e.indexOf("(")){var t=N(e),n=t.prefix,i=t.value;if(!n||!i)return;var o=T(i),a=[0,0,0,1],A=o.length;switch(n){case"rgb":case r:for(var s=0;s1?t-1:0),a=1;a-1&&a&&(c={portalContainer:a}),Object(i.createElement)(u,A({ref:(e=this,t="element",function(n){n&&(e[t]=n)}),"data-styled-id":l,className:o+" "+l},c,s))},n.componentDidMount=function(){this.injectResult=this.injector.inject(this.element,{nonce:this.props.cspNonce})},n.componentWillUnmount=function(){this.injectResult.destroy(),this.injectResult=null},n.getElement=function(){return this.element},t}(i.Component);t.a=function(e,t){var n=Object(r.a)(t);return function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.injector=n,r.tag=e,r}return a(r,t),r}(s)}},function(e,t,n){"use strict";function r(e){for(var t=[],n=1;n-1&&o.splice(a,1)}}else this._events[e]=[];else this._events={};return this},t.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise((function(t){n._addEvent(e,t,{once:!0})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var i=!1;return t.eventType=e,t.stop=function(){i=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;t=0?i:i+2*Math.PI}function o(e){var t=function(e){return[0,1].map((function(t){return function(e){for(var t=e.length,n=0,r=t-1;r>=0;--r)n+=e[r];return t?n/t:0}(e.map((function(e){return e[t]})))}))}(e),n=i(t,e[0]),r=i(t,e[1]);return nr&&r-n<-Math.PI?1:-1}function a(e,t){return Math.sqrt(Math.pow((t?t[0]:0)-e[0],2)+Math.pow((t?t[1]:0)-e[1],2))}function A(e){return e.length<3?0:Math.abs(function(e){for(var t=0,n=e.length-1;n>=0;--n)t+=e[n];return t}(e.map((function(t,n){var r=e[n+1]||e[0];return t[0]*r[1]-r[0]*t[1]}))))/2}function s(e,t){var n=t.width,r=t.height,i=t.left,o=t.top,a=l(e),A=a.minX,s=a.minY,u=a.maxX,c=a.maxY,f=n/(u-A),d=r/(c-s);return e.map((function(e){return[i+(e[0]-A)*f,o+(e[1]-s)*d]}))}function l(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]}));return{minX:Math.min.apply(Math,t),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,t),maxY:Math.max.apply(Math,n)}}function u(e,t,n){var i=e[0],o=e[1],a=l(t),A=a.minX,s=a.minY,u=a.maxX,h=a.maxY,g=[[A,o],[u,o]],v=[[i,s],[i,h]],B=c(g[0],g[1]),m=c(v[0],v[1]),b=p(t),w=[],E=[];return b.forEach((function(e){var t=c(e[0],e[1]),n=d(f(B,t),[g,e]),r=d(f(m,t),[v,e]);1===n.length&&e[0][1]===o||w.push.apply(w,n),1===r.length&&e[0][0]===i||E.push.apply(E,r),t[0]||w.push.apply(w,n),t[1]||E.push.apply(E,r)})),!n&&(r(w,(function(e){return e[0]===i}))>-1||r(E,(function(e){return e[1]===o}))>-1)||!!(w.filter((function(e){return e[0]>i})).length%2&&E.filter((function(e){return e[1]>o})).length%2)}function c(e,t){var n=e[0],r=e[1],i=t[0],o=t[1];if(n===i&&r===o)return[0,0,0];if(n===i)return[1,0,-n];if(r===o)return[0,1,-r];var a=(i-n)/(r-o);return[1,a,-n-a*r]}function f(e,t){var n,r,i=e[0],o=e[1],a=e[2],A=t[0],s=t[1],l=t[2],u=0===i&&0===A,c=0===o&&0===s;if(u&&c)return[];if(u){var f=-a/o;return f!==-l/s?[]:[[-1/0,f],[1/0,f]]}if(c){var d=-a/i;return d!==-l/A?[]:[[d,-1/0],[d,1/0]]}return 0===i?[[n=-(s*(r=-a/o)+l)/A,r]]:0===A?[[n=-(o*(r=-l/s)+a)/i,r]]:0===o?[[n=-a/i,r=-(A*n+l)/s]]:0===s?[[n=-l/A,r=-(i*n+a)/o]]:[[n=(o*l-s*a)/(s*i-o*A),r=-(i*n+a)/o]]}function d(e,t){var n=t.map((function(e){return[0,1].map((function(t){return[Math.min(e[0][t],e[1][t]),Math.max(e[0][t],e[1][t])]}))}));if(2===e.length){var r=e[0],i=r[0],o=r[1];if(i===e[1][0]){var a=Math.max.apply(Math,n.map((function(e){return e[1][0]}))),A=Math.min.apply(Math,n.map((function(e){return e[1][1]})));return a>A?[]:[[i,a],[i,A]]}if(o===e[1][1]){var s=Math.max.apply(Math,n.map((function(e){return e[0][0]}))),l=Math.min.apply(Math,n.map((function(e){return e[0][1]})));return s>l?[]:[[s,o],[l,o]]}}return e.filter((function(e){return n.every((function(t){return t[0][0]<=e[0]&&e[0]<=t[0][1]&&t[1][0]<=e[1]&&e[1]<=t[1][1]}))}))}function p(e){return function(){for(var e=0,t=0,n=arguments.length;t=128?"#000":"#fff"},t.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}};t.default=t},function(e,t,n){"use strict";var r=n(0);var i=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0};function o(e,t,n,i){var o=document.createElement("style");return o.setAttribute("type","text/css"),o.setAttribute("data-styled-id",e),n.nonce&&o.setAttribute("nonce",n.nonce),o.innerHTML=function(e,t,n){return n.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(t,n){var i=n.trim();return(i?Object(r.T)(i):[""]).map((function(t){var n=t.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?""+n.replace(/\:host/g,"."+e):n?"."+e+" "+n:"."+e})).join(", ")+" {"}))}(e,t,n),(i||document.head||document.body).appendChild(o),o}t.a=function(e){var t,n="rCS"+i(e).toString(36),r=0;return{className:n,inject:function(i,a){void 0===a&&(a={});var A,s=function(e){if(e&&e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t}}(i),l=0===r;return(s||l)&&(A=o(n,e,a,s)),l&&(t=A),s||++r,{destroy:function(){s?(i.removeChild(A),A=null):(r>0&&--r,0===r&&t&&(t.parentNode.removeChild(t),t=null))}}}}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return g}));var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e){return e&&"object"===typeof e}function o(e){return Array.isArray(e)}function a(e){return"string"===typeof e}function A(e,t,n,r){e.addEventListener(t,n,r)}function s(e,t,n){e.removeEventListener(t,n)}var l=function(){return(l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1&&r.splice(o,1)}}else this._events[e]=[];else this._events={};return this},t.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise((function(t){n._addEvent(e,t,{once:!0})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var i=!1;return t.eventType=e,t.stop=function(){i=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;t1&&this.trigger(e+"."+i.join("."),r)},t}(u);t.a=m},function(e,t,n){var r=n(86),i=n(141),o=n(199),a=n(17);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},function(e,t,n){e.exports=n(127)},function(e,t,n){"use strict";n.d(t,"b",(function(){return A}));var r=n(44),i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var o="function"===typeof Map?void 0:function(){var e=0;return function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++e)}}(),a=function(e){function t(t){return void 0===t&&(t=[]),e.call(this,t,o)||this}return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(r.a);function A(e,t){return Object(r.b)(e,t,o)}t.a=a},function(e,t,n){var r=n(36),i=n(132),o=n(133),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t,n){var r=n(154),i=n(157);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){"use strict";n.d(t,"b",(function(){return ce}));var r=n(34),i=n(10),o=n(0);function a(e,t,n,r,i,o){for(var a=0;ai-s?(p[1]>d.top||ip[1])&&(v[1]=1),d.left>r-s?(p[0]>d.left||rp[0])&&(v[0]=1),clearTimeout(this.timer),!v[0]&&!v[1])return!1;if(g>0)return this.timer=window.setTimeout((function(){n.drag(e,t)}),g),!1;this.prevTime=h;var B=f({container:a,direction:v});this.trigger("scroll",{container:a,direction:v,inputEvent:e});var m=f({container:a,direction:v}),b=m[0]-B[0],w=m[1]-B[1];return!(!b&&!w)&&(this.trigger("move",{offsetX:v[0]?b:0,offsetY:v[1]?w:0,inputEvent:e}),u&&(this.timer=window.setTimeout((function(){n.drag(e,t)}),u)),!0)},n.dragEnd=function(){clearTimeout(this.timer)},t}(H.a),M=n(1),R=n(57),D=n(9),P=function(e,t){return(P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function k(e,t){function n(){this.constructor=e}P(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var I=function(){return(I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n'}var j=Object(r.a)().browser.webkit,X=j&&function(){var e=/applewebkit\/([^\s]+)/g.exec(navigator.userAgent.toLowerCase());return!!e&&parseFloat(e[1])<605}(),G="moveable-",V="\n{\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tleft: 0;\n\ttop: 0;\n z-index: 3000;\n --moveable-color: #4af;\n --zoom: 1;\n --zoompx: 1px;\n will-change: transform;\n}\n.control-box {\n z-index: 0;\n}\n.line, .control {\n position: absolute;\n\tleft: 0;\n top: 0;\n will-change: transform;\n}\n.control {\n\twidth: 14px;\n\theight: 14px;\n\tborder-radius: 50%;\n\tborder: 2px solid #fff;\n\tbox-sizing: border-box;\n background: #4af;\n background: var(--moveable-color);\n\tmargin-top: -7px;\n margin-left: -7px;\n border: 2px solid #fff;\n z-index: 10;\n}\n.padding {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100px;\n height: 100px;\n transform-origin: 0 0;\n}\n.line {\n\twidth: 1px;\n height: 1px;\n background: #4af;\n background: var(--moveable-color);\n\ttransform-origin: 0px 50%;\n}\n.line.dashed {\n box-sizing: border-box;\n background: transparent;\n}\n.line.dashed.horizontal {\n border-top: 1px dashed #4af;\n border-top-color: #4af;\n border-top-color: var(--moveable-color);\n}\n.line.dashed.vertical {\n border-left: 1px dashed #4af;\n border-left-color: #4af;\n border-left-color: var(--moveable-color);\n}\n.line.vertical {\n transform: translateX(-50%);\n}\n.line.horizontal {\n transform: translateY(-50%);\n}\n.line.vertical.bold {\n width: 2px;\n}\n.line.horizontal.bold {\n height: 2px;\n}\n\n.control.origin {\n\tborder-color: #f55;\n\tbackground: #fff;\n\twidth: 12px;\n\theight: 12px;\n\tmargin-top: -6px;\n margin-left: -6px;\n\tpointer-events: none;\n}\n"+[0,15,30,45,60,75,90,105,120,135,150,165].map((function(e){return'\n.direction[data-rotation="'+e+'"] {\n\t'+function(e){var t=z(1,e),n=z(2,e),r=45*Math.round(e/45)%180,i="ns-resize";return 135===r?i="nwse-resize":45===r?i="nesw-resize":90===r&&(i="ew-resize"),"cursor:"+i+";cursor: url('"+t+"') 16 16, "+i+";cursor: -webkit-image-set(url('"+t+"') 1x, url('"+n+"') 2x) 16 16, "+i+";"}(e)+"\n}\n"})).join("\n")+"\n.group {\n z-index: -1;\n}\n.area {\n position: absolute;\n}\n.area-pieces {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n}\n.area.avoid, .area.pass {\n pointer-events: none;\n}\n.area.avoid+.area-pieces {\n display: block;\n}\n.area-piece {\n position: absolute;\n}\n\n"+(X?':global svg *:before {\n\tcontent:"";\n\ttransform-origin: inherit;\n}':"")+"\n",Y=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],W=Math.pow(10,10),J=-W,q=["n","w","s","e","nw","ne","sw","se"],Z={n:[0,1],s:[2,3],w:[2,0],e:[1,3],nw:[0],ne:[1],sw:[2],se:[3]},$={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},ee=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager"];function te(){for(var e=[],t=0;t9),(t?"matrix3d":"matrix")+"("+v(e,!t).join(",")+")"}function de(e){var t=e.clientWidth,n=e.clientHeight;if(!e)return{x:0,y:0,width:0,height:0,clientWidth:t,clientHeight:n};var r=e.viewBox,i=r&&r.baseVal||{x:0,y:0,width:0,height:0};return{x:i.x,y:i.y,width:i.width||t,height:i.height||n,clientWidth:t,clientHeight:n}}function pe(e,t){var n=de(e),r=n.width,i=n.height,o=n.clientWidth,a=n.clientHeight,A=o/r,s=a/i,l=e.preserveAspectRatio.baseVal,u=l.align,c=l.meetOrSlice,f=[0,0],d=[A,s],p=[0,0];if(1!==u){var h=(u-2)%3,g=Math.floor((u-2)/3);f[0]=r*h/2,f[1]=i*g/2;var v=2===c?Math.max(s,A):Math.min(A,s);d[0]=v,d[1]=v,p[0]=(o-r)/2*h,p[1]=(a-i)/2*g}var B=E(d,t);return B[t*(t-1)]=p[0],B[t*(t-1)+1]=p[1],ne(B,t,f)}function he(e,t,n){return B(e,c(t,n),n)}function ge(e,t,n,r){return[[0,0],[t,0],[0,n],[t,n]].map((function(t){return he(e,t,r)}))}function ve(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]})),r=Math.min.apply(Math,t),i=Math.min.apply(Math,n),o=Math.max.apply(Math,t),a=Math.max.apply(Math,n);return{left:r,top:i,right:o,bottom:a,width:o-r,height:a-i}}function Be(e,t,n,r){return ve(ge(e,t,n,r))}function me(e,t,n,r){var i=16===e.length?4:3,a=ge(e,n,r,i),A=a[0],s=A[0],l=A[1],u=a[1],c=u[0],f=u[1],d=a[2],p=d[0],h=d[1],g=a[3],v=g[0],B=g[1],m=he(e,t,i),b=m[0],w=m[1],E=Math.min(s,c,p,v),y=Math.min(l,f,h,B),C=Math.max(s,c,p,v);return s=s-E||0,{left:E,top:y,right:C,bottom:Math.max(l,f,h,B),origin:[b=b-E||0,w=w-y||0],pos1:[s,l=l-y||0],pos2:[c=c-E||0,f=f-y||0],pos3:[p=p-E||0,h=h-y||0],pos4:[v=v-E||0,B=B-y||0],direction:Object(o.F)(a)}}function be(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function we(e,t){return be([t[0]-e[0],t[1]-e[1]])}function Ee(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=Object(o.E)(e,t));var i=we(e,t);return{transform:"translateY(-50%) translate("+e[0]+"px, "+e[1]+"px) rotate("+r+"rad) scaleY("+n+")",width:i+"px"}}function ye(e,t){for(var n=[],r=2;r0?e[0]:e[1],t>0?e[1]:e[0])}function xe(e,t,n,r,i){var o=1,a=[0,0],A={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},s={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},l={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},u=ue(t,n,i,!1);if(t){var c=u.is3d?4:3,f=me(u.offsetMatrix,h(u.transformOrigin,function(e,t){void 0===t&&(t=Math.sqrt(e.length));for(var n=[],r=e[t*t-1],i=0;i-1&&(n[0]=-1),t.indexOf("e")>-1&&(n[0]=1),t.indexOf("n")>-1&&(n[1]=-1),t.indexOf("s")>-1&&(n[1]=1),n}}}function Se(e,t){return[h(t,e[0]),h(t,e[1]),h(t,e[2]),h(t,e[3])]}function Oe(e){var t=e.left,n=e.top;return Se([e.pos1,e.pos2,e.pos3,e.pos4],[t,n])}function He(e,t){return t?Math.round(e/t)*t:e}function Te(e,t){return e.forEach((function(n,r){e[r]=He(e[r],t)})),e}function Ne(e,t){e[t]&&(e[t].unset(),e[t]=null)}function _e(e,t,n){var r=t.datas;r.datas||(r.datas={});var i=I(I({},n),{target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,moveable:e,datas:r.datas});return r.isStartEvent?r.lastEvent=i:r.isStartEvent=!0,i}function Me(e,t,n){var r=t.datas,i="isDrag"in n?n.isDrag:t.isDrag;return r.datas||(r.datas={}),I(I({isDrag:i},n),{moveable:e,target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,lastEvent:r.lastEvent,isDouble:t.isDouble,datas:r.datas})}function Re(e,t,n,r){return e.triggerEvent(t,n,r)}function De(e,t){return window.getComputedStyle(e,t)}function Pe(e,t,n){var r={},i={};return e.filter((function(e){var o=e.name;if(r[o]||!t.some((function(t){return e[t]})))return!1;if(!n&&e.ableGroup){if(i[e.ableGroup])return!1;i[e.ableGroup]=!0}return r[o]=!0,!0}))}function ke(e,t){return e===t||null==e&&null==t}function Ie(e,t){var n=[],r=[];return e.forEach((function(i,o){var a=t(i,o,e),A=r.indexOf(a),s=n[A]||[];-1===A&&(r.push(a),n.push(s)),s.push(i)})),n}function Ke(e){return e.reduce((function(e,t){return e.concat(t)}),[])}function Le(){for(var e=[],t=0;t-1}))).filter((function(e){return e.canPinch&&e[u]})),f=_e(e,t,{});r&&(f.targets=r);var d=Re(e,l,f);n.isPinch=!1!==d,n.ables=c;var p=n.isPinch;return!!p&&(c.forEach((function(n){if(o[n.name]=o[n.name]||{},n[u]){var r=I(I({},t),{datas:o[n.name],parentRotate:i,isPinch:!0});n[u](e,r)}})),e.state.snapRenderInfo={request:t.isRequest,direction:[0,0]},p)},pinch:function(e,t){var n=t.datas,r=t.scale,i=t.distance,o=t.originalDatas,a=t.inputEvent,A=t.targets,s=t.angle;if(n.isPinch){var l=i*(1-1/r),u=_e(e,t,{});A&&(u.targets=A),Re(e,"onPinch"+(A?"Group":""),u);var c=n.ables,f="drag"+(A?"Group":"")+"Control";return c.forEach((function(n){n[f]&&n[f](e,I(I({},t),{datas:o[n.name],inputEvent:a,parentDistance:l,parentRotate:s,isPinch:!0}))})),u}},pinchEnd:function(e,t){var n=t.datas,r=t.isPinch,i=t.inputEvent,o=t.targets,a=t.originalDatas;if(n.isPinch){var A="onPinch"+(o?"Group":"")+"End",s=Me(e,t,{isDrag:r});o&&(s.targets=o),Re(e,A,s);var l=n.ables,u="drag"+(o?"Group":"")+"ControlEnd";return l.forEach((function(n){n[u]&&n[u](e,I(I({},t),{isDrag:r,datas:a[n.name],inputEvent:i,isPinch:!0}))})),r}},pinchGroupStart:function(e,t){return this.pinchStart(e,I(I({},t),{targets:e.props.targets}))},pinchGroup:function(e,t){return this.pinch(e,I(I({},t),{targets:e.props.targets}))},pinchGroupEnd:function(e,t){return this.pinchEnd(e,I(I({},t),{targets:e.props.targets}))}});function et(e,t,n,r,i){var o=t.gesto.move(n,e.inputEvent),a=o.originalDatas||o.datas,A=a.draggable||(a.draggable={});return I(I({},i?je(t,o):o),{isDrag:!0,isPinch:!!r,parentEvent:!0,datas:A,originalDatas:e.originalDatas})}var tt=function(){function e(){this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}}}var t=e.prototype;return t.dragStart=function(e,t){this.isDrag=!1,this.isFlag=!1;var n=t.originalDatas;return this.datas=n,n.draggable||(n.draggable={}),I(I({},this.move(e,t.inputEvent)),{type:"dragstart"})},t.drag=function(e,t){return this.move([e[0]-this.prevX,e[1]-this.prevY],t)},t.move=function(e,t){var n,r;return this.isFlag?(n=this.prevX+e[0],r=this.prevY+e[1],this.isDrag=!0):(this.prevX=e[0],this.prevY=e[1],this.startX=e[0],this.startY=e[1],n=e[0],r=e[1],this.isFlag=!0),this.prevX=n,this.prevY=r,{type:"drag",clientX:n,clientY:r,inputEvent:t,isDrag:this.isDrag,distX:n-this.startX,distY:r-this.startY,deltaX:e[0],deltaY:e[1],datas:this.datas.draggable,originalDatas:this.datas,parentEvent:!0,parentGesto:this}},e}();function nt(e,t,n){var r=n.originalDatas;r.groupable=r.groupable||{};var i=r.groupable;i.childDatas=i.childDatas||[];var o=i.childDatas;return e.moveables.map((function(e,r){return o[r]=o[r]||{},o[r][t]=o[r][t]||{},I(I({},n),{datas:o[r][t],originalDatas:o[r]})}))}function rt(e,t,n,r,i,o){var a=!!n.match(/Start$/g),A=!!n.match(/End$/g),s=i.isPinch,l=i.datas,u=nt(e,t.name,i),c=e.moveables,f=u.map((function(e,i){var u=c[i],f=e;a?f=(new tt).dragStart(r,e):(u.state.gesto||(u.state.gesto=l.childGestos[i]),f=et(e,u.state,r,s,o));var d=t[n](u,I(I({},f),{parentFlag:!0}));return A&&(u.state.gesto=null),d}));return a&&(l.childGestos=c.map((function(e){return e.state.gesto}))),f}function it(e,t,n,r,i,o){void 0===i&&(i=function(e,t){return t});var a=!!n.match(/End$/g),A=nt(e,t.name,r),s=e.moveables;return A.map((function(e,r){var A,l=s[r];A=i(l,e);var u=t[n](l,I(I({},A),{parentFlag:!0}));return u&&o&&o(l,e,u,r),a&&(l.state.gesto=null),u}))}function ot(e,t){var n=t.clientX,r=t.clientY,i=t.datas,o=e.state,a=o.moveableClientRect,A=o.rootMatrix,s=o.is3d,l=o.pos1,u=g(ze(A,[n-a.left,r-a.top],s?4:3),l),c=ft({datas:i,distX:u[0],distY:u[1]});return[c[0],c[1]]}function at(e,t){var n=t.datas,r=e.state,i=r.allMatrix,o=r.beforeMatrix,a=r.is3d,A=r.left,s=r.top,l=r.origin,f=r.offsetMatrix,d=r.targetMatrix,p=r.transformOrigin,g=a?4:3;n.is3d=a,n.matrix=i,n.targetMatrix=d,n.beforeMatrix=o,n.offsetMatrix=f,n.transformOrigin=p,n.inverseMatrix=u(i,g),n.inverseBeforeMatrix=u(o,g),n.absoluteOrigin=c(h([A,s],l),g),n.startDragBeforeDist=B(n.inverseBeforeMatrix,n.absoluteOrigin,g),n.startDragDist=B(n.inverseMatrix,n.absoluteOrigin,g)}function At(e,t){var n=e.datas,r=e.originalDatas.beforeRenderable,i=n.transformIndex,o=r.nextTransforms,a=r.nextTransformAppendedIndexes,A=-1===i?o.length:i+a.filter((function(e){return e=0&&(e[0]>=0&&t.push(3),e[0]<=0&&t.push(2)),e[1]<=0&&(e[0]>=0&&t.push(1),e[0]<=0&&t.push(0)),t}function pt(e,t){return dt(t).map((function(t){return e[t]}))}function ht(e,t){var n=pt(e,t);return[Object(o.r)(n.map((function(e){return e[0]}))),Object(o.r)(n.map((function(e){return e[1]})))]}function gt(e,t,n,r){return p(e,ne(t,r,n),r)}function vt(e){var t=e.originalDatas.beforeRenderable;return{setTransform:function(n,r){void 0===r&&(r=-1),t.startTransforms=Object(o.H)(n)?n:Object(o.U)(n),mt(e,r)},setTransformIndex:function(t){mt(e,t)}}}function Bt(e,t){var n=e.originalDatas.beforeRenderable.startTransforms;mt(e,Object(o.A)(n,(function(e){return 0===e.indexOf(t+"(")})))}function mt(e,t){var n=e.originalDatas.beforeRenderable,r=e.datas;if(r.transformIndex=t,-1!==t){var i=n.startTransforms[t];if(i){var o=U([i]);r.startValue=o[0].functionValue}}}function bt(e,t){e.originalDatas.beforeRenderable.nextTransforms=Object(o.U)(t)}function wt(e,t,n,r,i){return bt(i,t),{transform:t,drag:Sn.drag(e,et(i,e.state,n,r,!1))}}function Et(e,t,n,r,i){var o=e.state,a=o.left,A=o.top,s=e.props.groupable,l=s?a:0,u=s?A:0,c=g(r,Ct(e,n,function(e,t,n){var r=e.transformOrigin,i=e.offsetMatrix,o=e.is3d,a=t.beforeTransform,A=t.afterTransform,s=o?4:3;return gt(i,f(p(p(a,x([n]),4),A,4),4,s),r,s)}(e.state,i,t)));return g(c,[l,u])}function yt(e){var t=e.state,n=t.width,r=t.height,i=t.transformOrigin;return[i[0]/(n/2)-1,i[1]/(r/2)-1]}function Ct(e,t,n){void 0===n&&(n=e.state.allMatrix);var r=e.state,i=r.width,o=r.height,a=r.is3d?4:3;return he(n,[i/2*(1+t[0]),o/2*(1+t[1])],a)}function Qt(e,t,n,r,i,a){var A=e.props.groupable,s=e.state,l=s.transformOrigin,u=s.targetMatrix,c=s.offsetMatrix,f=s.is3d,d=s.width,p=s.height,h=s.left,v=s.top,B=f?4:3,m=A?h:0,b=A?v:0;return g(function(e,t,n,r,i,o){var a=ht(ge(t,n,r,i),o);return[e[0]-a[0],e[1]-a[1]]}(i,gt(c,u,function(e,t,n,r,i,a){return void 0===r&&(r=t),void 0===i&&(i=n),void 0===a&&(a=[0,0]),e?e.map((function(e,A){var s=Object(o.W)(e),l=s.value,u=s.unit,c=A?i:r,f=A?n:t;return"%"===e||isNaN(l)?f*(c?a[A]/c:0):"%"!==u?l:f*l/100})):a}(a,t,n,d,p,l),B),t,n,B,r),[m,b])}function xt(e,t){return ht(Oe(e.state),t)}function Ft(e,t,n){var r=he(e,[t.clientLeft,t.clientTop],n);return[t.left+r[0],t.top+r[1]]}function Ut(e,t,n,r,i,o){var a=i[0],A=i[1],s=o[0],l=o[1],u=[],c=r?0:1,f="vertical"===t?"horizontal":"vertical",d=Ie(e.filter((function(e){return e.type===t})),(function(e){return e.element})).map((function(e){return e[0]})).filter((function(e){var t=e.pos,n=e.sizes;return t[c]<=l&&s<=t[c]+n[c]}));return d.forEach((function(e){var t=e.pos[r],i=t+e.sizes[r];d.forEach((function(e){var o=e.pos,s=e.sizes,l=e.element,c=e.className,p=o[r],h=p+s[r],g=0,v=0,B=!0;if(i<=p)a<(g=h-(v=i-p))-n&&(B=!1);else{if(!(h<=t))return;A>(g=p-(v=t-h))+n&&(B=!1)}if(B&&u.push({pos:"vertical"===f?[g,o[1]]:[o[0],g],element:l,sizes:s,size:0,type:f,gap:v,className:c,gapGuidelines:d}),i<=a&&A<=p){var m=(p+i-(A-a))/2;He(a-(m-n),.1)>=0&&u.push({pos:"vertical"===f?[m,o[1]]:[o[0],m],className:c,element:l,sizes:s,size:0,type:f,gap:i-a,gapGuidelines:d})}}))})),u}function St(e,t,n,r,i,o,a){void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a={left:0,top:0,right:0,bottom:0});var A=[],s=a.left,l=a.top,u=a.bottom,c=n+a.right-s,f=r+u-l;return e&&e.forEach((function(e){A.push({type:"horizontal",pos:[s,He(e-o+l,.1)],size:c})})),t&&t.forEach((function(e){A.push({type:"vertical",pos:[He(e-i+s,.1),l],size:f})})),A}function Ot(e,t){var n=[];if(!t.length)return n;var r=e.state,i=e.props.snapCenter,o=r.containerClientRect,a=r.targetClientRect,A=a.top,s=a.left,l=r.rootMatrix,u=r.is3d?4:3,c=Ft(l,o,u),f=c[0],d=c[1],p=Oe(r),h=Object(S.c)(p),v=g([h.minX,h.minY],ze(l,[s-f,A-d],u)).map((function(e){return t=e,Math.round(t%1===-.5?t-1:t);var t})),B=v[0],m=v[1];return t.forEach((function(e){var t=e.element,r=e.top,o=e.left,a=e.right,A=e.bottom,s=e.className,c=t.getBoundingClientRect(),p=c.left-f,h=c.top-d,g=h+c.height,v=p+c.width,b=ze(l,[p,h],u),w=b[0],E=b[1],y=ze(l,[v,g],u),C=y[0],Q=y[1],x=C-w,F=Q-E,U=[x,F];!1!==r&&n.push({type:"vertical",element:t,pos:[He(w+B,.1),E],size:F,sizes:U,className:s}),!1!==A&&n.push({type:"vertical",element:t,pos:[He(C+B,.1),E],size:F,sizes:U,className:s}),!1!==o&&n.push({type:"horizontal",element:t,pos:[w,He(E+m,.1)],size:x,sizes:U,className:s}),!1!==a&&n.push({type:"horizontal",element:t,pos:[w,He(Q+m,.1)],size:x,sizes:U,className:s}),i&&(n.push({type:"vertical",element:t,pos:[He((w+C)/2+B,.1),E],size:F,sizes:U,center:!0,className:s}),n.push({type:"horizontal",element:t,pos:[w,He((E+Q)/2+m,.1)],size:x,sizes:U,center:!0,className:s}))})),n}function Ht(e,t,n){void 0===n&&(n=[]);var r=[],i=e.state;if(t&&i.guidelines&&i.guidelines.length)return r;var a=e.props.elementGuidelines,A=void 0===a?[]:a;if(!A.length)return r;var s=i.elementGuidelineValues||[],l=A.map((function(e){return Object(o.K)(e)&&"element"in e?e:{element:Je(e,!0)}})).filter((function(e){return e.element}));i.elementGuidelineValues=l;var u=Object(O.b)(s.map((function(e){return e.element})),l.map((function(e){return e.element}))),c=u.added,f=u.removed.map((function(e){return s[e].element})),d=Ot(e,c.map((function(e){return l[e]})).filter((function(e){return e.refresh&&t||!e.refresh&&!t})));return K(n.filter((function(e){return-1===f.indexOf(e.element)})),d)}function Tt(e){var t=e.state,n=t.snapOffset,r=t.staticGuidelines,i=t.containerClientRect,o=i.overflow,a=i.scrollHeight,A=i.scrollWidth,s=i.clientHeight,l=i.clientWidth,u=i.clientLeft,c=i.clientTop,f=e.props,d=f.snapHorizontal,p=void 0===d||d,h=f.snapVertical,g=void 0===h||h,v=f.snapGap,B=void 0===v||v,m=f.verticalGuidelines,b=f.horizontalGuidelines,w=f.snapThreshold,E=void 0===w?5:w,y=f.snapGridWidth,C=void 0===y?0:y,Q=f.snapGridHeight,x=void 0===Q?0:Q,F=K(r,Ht(e,!0));if(B){var U=ve(Oe(e.state)),S=U.top,O=U.left,H=U.bottom,T=U.right,N=r.filter((function(e){return e.element}));F.push.apply(F,K(Ut(N,"horizontal",E,0,[O,T],[S,H]),Ut(N,"vertical",E,1,[S,H],[O,T])))}return F.push.apply(F,function(e,t,n,r,i,o){void 0===i&&(i=0);void 0===o&&(o=0);var a=[];if(t)for(var A=0;Aa)})).sort((function(e,t){return e.dist-t.dist}));return{pos:n,index:r,guidelineInfos:i}})).filter((function(e){return e.guidelineInfos.length>0})).sort((function(e,t){return e.guidelineInfos[0].dist-t.guidelineInfos[0].dist})),c=u.length>0;return{isSnap:c,index:c?u[0].index:-1,posInfos:u}}function Pt(e,t){var n=Math.abs(e.offset),r=Math.abs(t.offset);return e.isBound&&t.isBound?r-n:e.isBound?-1:t.isBound?1:e.isSnap&&t.isSnap?r-n:e.isSnap?-1:t.isSnap||n<1e-7?1:r<1e-7?-1:n-r}function kt(e,t){return e.slice().sort((function(e,n){var r=e.sign[t],i=n.sign[t],o=e.offset[t],a=n.offset[t];return r?i?Pt({isBound:e.isBound,isSnap:e.isSnap,offset:o},{isBound:n.isBound,isSnap:n.isSnap,offset:a}):-1:1}))[0]}function It(e,t){var n=Object(o.r)([t[0][0],t[1][0]]),r=Object(o.r)([t[0][1],t[1][1]]);return{vertical:n<=e[0],horizontal:r<=e[1]}}function Kt(e,t){var n,r,i=t[0],o=t[1],a=o[0]-i[0],A=o[1]-i[1];if(Math.abs(a)<1e-7&&(a=0),Math.abs(A)<1e-7&&(A=0),a)if(A){n=A/a*(e[0]-i[0])+i[1],r=e[1]}else n=i[1],r=e[1];else n=i[0],r=e[0];return n-r}function Lt(e,t,n){void 0===n&&(n=1e-7);var r=Kt(e[0],t)<=0;return e.slice(1).every((function(e){var i=Kt(e,t);return i<=0===r||Math.abs(i)<=n}))}function zt(e,t,n,r,i){return void 0===i&&(i=0),r&&t-i<=e||!r&&e<=n+i?{isBound:!0,offset:r?t-e:n-e}:{isBound:!1,offset:0}}function jt(e,t,n,r,i){var o=e[0],a=e[1],A=t[0],s=t[1],l=Ve(a[1]-o[1]),u=Ve(a[0]-o[0]),c=Ve(s[1]-A[1]);if(!Ve(s[0]-A[0])){if(i&&!l)return{isBound:!1,offset:0};if(u)return zt(l/u*(A[0]-o[0])+o[1],A[1],s[1],n,r);var f=A[0]-o[0];return{isBound:d=Math.abs(f)<=(r||0),offset:d?f:0}}if(!c){if(i&&!u)return{isBound:!1,offset:0};if(l)return zt((A[1]-o[1])/(l/u)+o[0],A[0],s[0],n,r);var d;f=A[1]-o[1];return{isBound:d=Math.abs(f)<=(r||0),offset:d?f:0}}return{isBound:!1,offset:0}}function Xt(e,t,n,r){return t.map((function(t){var i=t[0],o=t[1],a=t[2],A=function(e,t,n){var r=e.props.innerBounds;if(!r)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var i=r.left,o=r.top,a=r.width,A=r.height,s=[[i,o],[i,o+A]],l=[[i,o],[i+a,o]],u=[[i+a,o],[i+a,o+A]],c=[[i,o+A],[i+a,o+A]],f=It(n,t),d=f.horizontal,p=f.vertical;if(Lt([n,[i,o],[i+a,o],[i,o+A],[i+a,o+A]],t))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var h=jt(t,l,p),g=jt(t,c,p),v=jt(t,s,d),B=jt(t,u,d),m=h.isBound&&g.isBound,b=h.isBound||g.isBound,w=v.isBound&&B.isBound,E=v.isBound||B.isBound,y=Le(h.offset,g.offset),C=Le(v.offset,B.offset),Q=[0,0],x=!1,F=!1;return Math.abs(C)o&&A.push({isBound:!0,offset:o-r,pos:r}),i-1.1||e[0]>t.right&&Math.abs(e[0]-t.right)>.1||e[1].1||e[1]>t.bottom&&Math.abs(e[1]-t.bottom)>.1}))}function en(e,t,n,r,i){if(!e.props.bounds)return[];var a=i*Math.PI/180,A=qt(e),s=A.left,l=A.top,u=A.right,c=A.bottom,f=s-r[0],d=u-r[0],p=l-r[1],h=c-r[1],g={left:f,top:p,right:d,bottom:h};if(!$t(n,g,0))return[];var v=[];return[[f,0],[d,0],[p,1],[h,1]].forEach((function(e){var r=e[0],i=e[1];n.forEach((function(e){var n=Object(o.E)([0,0],e);v.push.apply(v,function(e,t,n){var r=be(e),i=Math.sqrt(r*r-t*t)||0;return[i,-i].sort((function(t,r){return Math.abs(t-e[n?0:1])-Math.abs(r-e[n?0:1])})).map((function(e){return Object(o.E)([0,0],n?[e,t]:[t,e])}))}(e,r,i).map((function(e){return a+e-n})).filter((function(e){return!$t(t,g,e)})).map((function(e){return He(180*e/Math.PI,1e-7)})))}))})),v}var tn={horizontal:["left","top","width","Y","X"],vertical:["top","left","height","X","Y"]};function nn(e,t,n,r){var i=e-n,o=i<0?i+t:r;return{size:(i<0?0:i)-o,pos:o}}function rn(e,t){return function(e,t){var n,r=e.direction,i=e.classNames,o=e.size,a=e.pos,A=e.zoom,s=e.key,l="horizontal"===r,u=l?"Y":"X";return t.createElement("div",{key:s,className:i.join(" "),style:(n={},n[l?"width":"height"]=""+o,n.transform="translate("+a[0]+", "+a[1]+") translate"+u+"(-50%) scale"+u+"("+A+")",n)})}(I(I({},e),{classNames:K([te("line","guideline",e.direction)],e.classNames).filter((function(e){return e})),size:e.size||e.sizeValue+"px",pos:e.pos||e.posValue.map((function(e){return He(e,.1)+"px"}))}),t)}function on(e,t,n,r,i,o,a,A,s,l,u,c){var f=e.props,d=f.zoom,p=f.isDisplaySnapDigit,h=void 0===p||p,g=tn[t],v=g[0],B=g[1],m=g[2],b=g[4];return Ke(n.map((function(e,n){var f=!0;return e.map((function(e,p){var g,w=e.pos,E=e.size,y=nn(w[l],E,i,o),C=y.pos,Q=y.size;if(Q0?u(F):""))}))})))}function an(e,t,n,r,i,o,a,A){var s=e.props.zoom;return n.map((function(e,n){var l=e.type,u=e.pos,c=[0,0];return c[a]=r,c[a?0:1]=-i+u,rn({key:t+"TargetGuideline"+n,classNames:[te("target","bold",l)],posValue:c,sizeValue:o,zoom:s,direction:t},A)}))}function An(e,t,n,r,i,a){var A=e.props.isDisplayInnerSnapDigit,s=n?0:1,l=r[n],u=a[n],c=[],f=t.filter((function(e){var t=e.element,i=e.pos,o=e.size;if(A&&t&&i[n]0&&o>a[n])}))}))})),{guidelines:f,groups:d,gapGuidelines:c}}function sn(e,t,n,r,i){var o=e.props.zoom;return n.filter((function(e){return!e.hide})).map((function(e,n){var a=e.pos,A=e.size,s=e.element,l=[-r[0]+a[0],-r[1]+a[1]];return rn({key:t+"Guideline"+n,classNames:s?[te("bold")]:[],direction:t,posValue:l,sizeValue:A,zoom:o},i)}))}function ln(e,t,n,r,i){var o=e.props,a=o.snapDigit,A=void 0===a?0:a,s=o.isDisplaySnapDigit,l=void 0===s||s,u=o.zoom,c="horizontal"===t?"X":"Y",f="horizontal"===t?"width":"height";return n.map((function(e,n){var o,a=e.renderPos,s=e.gap,d=e.className,p=e.inner,h=Math.abs(s),g=l?parseFloat(h.toFixed(A)):0;return i.createElement("div",{key:t+"GapGuideline"+n,className:te("guideline-group",t),style:(o={left:a[0]+"px",top:a[1]+"px"},o[f]=h+"px",o)},rn({direction:t,classNames:[te(p?"dashed":"gap"),d],size:"100%",posValue:[0,0],sizeValue:h,zoom:u},i),i.createElement("div",{className:te("size-value","gap"),style:{transform:"translate"+c+"(-50%) scale("+u+")"}},g>0?r(g):""))}))}function un(e){var t=e.state;if(!t.guidelines||!t.guidelines.length){var n=e.state.container,r=e.props.snapContainer||n,i=t.containerClientRect,o={left:0,top:0,bottom:0,right:0};if(n!==r){var a=Je(r,!0);if(a){var A=Fe(a),s=Ze(t,[A.left-i.left,A.top-i.top]),l=Ze(t,[A.right-i.right,A.bottom-i.bottom]);o.left=He(s[0],.1),o.top=He(s[1],.1),o.right=He(l[0],.1),o.bottom=He(l[1],.1)}}t.snapOffset=o,t.elementGuidelineValues=[],t.staticGuidelines=Ht(e,!1),t.guidelines=Tt(e),t.enableSnap=!0}}function cn(e,t){var n=e.props,r=n.snappable,i=n.bounds,o=n.innerBounds,a=n.verticalGuidelines,A=n.horizontalGuidelines,s=n.snapGridWidth,l=n.snapGridHeight,u=e.state,c=u.guidelines,f=u.enableSnap;return!(!r||!f||t&&!0!==r&&r.indexOf(t)<0)&&!!(s||l||i||o||c&&c.length||a&&a.length||A&&A.length)}function fn(e,t,n,r,i){var a=function(e,t,n,r){var i=t[0]-e[0],o=t[1]-e[1];Math.abs(i)<1e-7&&(i=0);Math.abs(o)<1e-7&&(o=0);if(!i)return r?[0,0]:[0,n];if(!o)return r?[n,0]:[0,0];var a=o/i,A=e[1]-a*e[0];if(r){var s=a*(t[0]+n)+A;return[n,s-t[1]]}return[(t[1]+n-A)/a-t[0],n]}(e,t,n,r);if(!a)return{isOutside:!1,offset:[0,0]};var A=Object(o.C)(e,t),s=Object(o.C)(a,e),l=Object(o.C)(a,t),u=s>A||l>A,c=ft({datas:i,distX:a[0],distY:a[1]});return{offset:[c[0],c[1]],isOutside:u}}function dn(e,t,n,r,i,o){var a=ge(e,t,n,o?4:3);return Se(a,g(r,function(e,t){return ht(e,t.map((function(e){return-e})))}(a,i)))}function pn(e,t){return e.isBound?e.offset:t.isSnap?t.offset:0}function hn(e,t){return e.isBound?e.offset:t.isSnap?Rt(t).offset:0}function gn(e,t,n,r){var i=function(e,t,n){var r=qt(e),i=r.left,o=r.top,a=r.right,A=r.bottom,s=n[0],l=n[1],u=g(n,t),c=u[0],f=u[1];Math.abs(c)<1e-7&&(c=0),Math.abs(f)<1e-7&&(f=0);var d=f>0,p=c>0,h={isBound:!1,offset:0,pos:0},v={isBound:!1,offset:0,pos:0};if(0===c&&0===f)return{vertical:h,horizontal:v};if(0===c)d?Al&&(v.pos=o,v.offset=l-o);else if(0===f)p?as&&(h.pos=i,h.offset=s-i);else{var B=f/c,m=n[1]-B*s,b=0,w=0,E=!1;p&&a<=s?(b=B*a+m,w=a,E=!0):!p&&s<=i&&(b=B*i+m,w=i,E=!0),E&&(bA)&&(E=!1),E||(d&&A<=l?(w=((b=A)-m)/B,E=!0):!d&&l<=o&&(w=((b=o)-m)/B,E=!0)),E&&(h.isBound=!0,h.pos=w,h.offset=s-w,v.isBound=!0,v.pos=b,v.offset=l-b)}return{vertical:h,horizontal:v}}(e,t,n),o=i.horizontal,a=i.vertical,A=r?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(e,t,n){var r=n[0],i=n[1],o=t[0],a=t[1],A=g(n,t),s=A[0],l=A[1],u=l>0,c=s>0;s=Ve(s),l=Ve(l);var f={isSnap:!1,offset:0,pos:0},d={isSnap:!1,offset:0,pos:0};if(0===s&&0===l)return{vertical:f,horizontal:d};var p=Nt(e,s?[r]:[],l?[i]:[]),h=p.vertical,v=p.horizontal;h.posInfos.filter((function(e){var t=e.pos;return c?t>=o:t<=o})),v.posInfos.filter((function(e){var t=e.pos;return u?t>=a:t<=a})),h.isSnap=h.posInfos.length>0,v.isSnap=v.posInfos.length>0;var B=Rt(h),m=B.isSnap,b=B.guideline,w=Rt(v),E=w.isSnap,y=w.guideline,C=E?y.pos[1]:0,Q=m?b.pos[0]:0;if(0===s)E&&(d.isSnap=!0,d.pos=y.pos[1],d.offset=i-d.pos);else if(0===l)m&&(f.isSnap=!0,f.pos=Q,f.offset=r-Q);else{var x=l/s,F=n[1]-x*r,U=0,S=0,O=!1;m?(U=x*(S=Q)+F,O=!0):E&&(S=((U=C)-F)/x,O=!0),O&&(f.isSnap=!0,f.pos=S,f.offset=r-S,d.isSnap=!0,d.pos=U,d.offset=i-U)}return{vertical:f,horizontal:d}}(e,t,n),s=A.horizontal,l=A.vertical,u=pn(o,s),c=pn(a,l),f=Math.abs(u),d=Math.abs(c);return{horizontal:{isBound:o.isBound,isSnap:s.isSnap,offset:u,dist:f},vertical:{isBound:a.isBound,isSnap:l.isSnap,offset:c,dist:d}}}function vn(e,t,n,r){void 0===r&&(r=n);var i=Jt(qt(e),r.map((function(e){return e[0]})),r.map((function(e){return e[1]}))),o=i.horizontal,a=i.vertical,A=t?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:Nt(e,n.map((function(e){return e[0]})),n.map((function(e){return e[1]})),e.props.snapCenter),s=A.horizontal,l=A.vertical,u=hn(o[0],s),c=hn(a[0],l),f=Math.abs(u),d=Math.abs(c);return{horizontal:{isBound:o[0].isBound,isSnap:s.isSnap,snapIndex:s.index,offset:u,dist:f,bounds:o,snap:s},vertical:{isBound:a[0].isBound,isSnap:l.isSnap,snapIndex:l.index,offset:c,dist:d,bounds:a,snap:l}}}function Bn(e,t,n,r,i){void 0===i&&(i={});var o=Jt(t,n,r),a=o.horizontal,A=o.vertical,s=i.isRequest?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:_t(e,n,r,i),l=s.horizontal,u=s.vertical,c=hn(a[0],l),f=hn(A[0],u),d=Math.abs(c),p=Math.abs(f);return{horizontal:{isBound:a[0].isBound,isSnap:l.isSnap,snapIndex:l.index,offset:c,dist:d,bounds:a,snap:l},vertical:{isBound:A[0].isBound,isSnap:u.isSnap,snapIndex:u.index,offset:f,dist:p,bounds:A,snap:u}}}function mn(e,t,n,r,i,a){return n.map((function(n){var A=n[0],s=n[1],l=ht(t,A),u=ht(t,s),c=r?gn(e,l,u,i):vn(e,i,[u]),f=c.horizontal,d=f.offset,p=f.isBound,h=f.isSnap,v=c.vertical,B=v.offset,m=v.isBound,b=v.isSnap,w=g(s,A);if(!B&&!d)return{isBound:m||p,isSnap:b||h,sign:w,offset:[0,0]};var E=function(e,t,n,r){var i=Object(o.E)(e,t)/Math.PI*180,a=n.vertical,A=a.isBound,s=a.isSnap,l=a.dist,u=n.horizontal,c=u.isBound,f=u.isSnap,d=i%180,p=d<3||d>177,h=d>87&&d<93;return u.dist1e-7)d=-v[0],p=a*Math.abs(o+d)/Math.abs(o)-a;else if(v[1]&&Math.abs(a)>1e-7){var B=a;p=-v[1],d=o*Math.abs(a+p)/Math.abs(B)-o}if(e&&s&&A)if(Math.abs(d)>1e-7&&Math.abs(d)1e-7&&Math.abs(p)-1||t.push(n)}))})),t}function xn(e,t,n,r){var i=e.filter((function(e){var n=e.element,r=e.gap,i=e.type;return n&&r&&i===t})),o="vertical"===t?[0,1]:[1,0],a=o[0],A=o[1];return Ke(i.map((function(e){var t=e.pos,i=e.gap,o=e.gapGuidelines,s=e.sizes,l=function(){for(var e=[],t=0;t0&&l>u?l=2*(l-u/2):l<0&&l<-u&&(l=2*(l+u/2)),0===l)return[];var c=(l>0?0:r[A])+l/2;return K(function(e,t,n,r,i,o,a){var A=Math.abs(o),s=i[t]+(o>0?r[0]:0);return e.filter((function(e){return e.pos[t]<=n[t]})).sort((function(e,n){var r=e.pos;return n.pos[t]-r[t]})).filter((function(e){var n=e.pos,r=e.sizes,i=n[t];return He(i+r[t],1e-4)===He(s-A,1e-4)&&(s=i,!0)})).map((function(e){var r=-n[t]+e.pos[t]+e.sizes[t];return I(I({},e),{gap:o,renderPos:t?[a,r]:[r,a]})}))}(o,a,n,r,t,i,c),function(e,t,n,r,i,o,a){var A=Math.abs(o),s=i[t]+(o<0?r[t]:0);return e.filter((function(e){return e.pos[t]>n[t]})).sort((function(e,n){var r=e.pos,i=n.pos;return r[t]-i[t]})).filter((function(e){var n=e.pos,r=e.sizes,i=n[t];return He(i,1e-4)===He(s+A,1e-4)&&(s=i+r[t],!0)})).map((function(e){var r=-n[t]+e.pos[t]-A;return I(I({},e),{gap:o,renderPos:t?[a,r]:[r,a]})}))}(o,a,n,r,t,i,c))})))}function Fn(e,t,n,r,i,a){var A=Jt(qt(e,a),t,n),s=A.vertical,l=A.horizontal;s.forEach((function(e){e.isBound&&r.push({type:"bounds",pos:e.pos})})),l.forEach((function(e){e.isBound&&i.push({type:"bounds",pos:e.pos})}));var u=function(e){var t=e.props.innerBounds;if(!t)return{vertical:[],horizontal:[]};var n=e.getRect(),r=n.pos1,i=n.pos2,o=n.pos3,a=n.pos4,A=ht([r,i,o,a],[0,0]),s=t.left,l=t.top,u=t.width,c=t.height,f=[[s,l],[s,l+c]],d=[[s,l],[s+u,l]],p=[[s+u,l],[s+u,l+c]],h=[[s,l+c],[s+u,l+c]],g=[],v=[],B={top:!1,bottom:!1,left:!1,right:!1};return[[r,i],[i,a],[a,o],[o,r]].forEach((function(e){var t=It(A,e),n=t.horizontal,r=t.vertical,i=jt(e,d,r,1,!0),o=jt(e,h,r,1,!0),a=jt(e,f,n,1,!0),m=jt(e,p,n,1,!0);i.isBound&&!B.top&&(g.push(l),B.top=!0),o.isBound&&!B.bottom&&(g.push(l+c),B.bottom=!0),a.isBound&&!B.left&&(v.push(s),B.left=!0),m.isBound&&!B.right&&(v.push(s+u),B.right=!0)})),{horizontal:g,vertical:v}}(e),c=u.vertical,f=u.horizontal;c.forEach((function(e){Object(o.A)(r,(function(t){var n=t.type,r=t.pos;return"bounds"===n&&r===e}))>=0||r.push({type:"bounds",pos:e})})),f.forEach((function(e){Object(o.A)(i,(function(t){var n=t.type,r=t.pos;return"bounds"===n&&r===e}))>=0||i.push({type:"bounds",pos:e})}))}var Un={name:"snappable",props:{snappable:[Boolean,Array],snapContainer:Object,snapCenter:Boolean,snapHorizontal:Boolean,snapVertical:Boolean,snapElement:Boolean,snapGap:Boolean,snapGridWidth:Number,snapGridHeight:Number,isDisplaySnapDigit:Boolean,isDisplayInnerSnapDigit:Boolean,snapDigit:Number,snapThreshold:Number,horizontalGuidelines:Array,verticalGuidelines:Array,elementGuidelines:Array,bounds:Object,innerBounds:Object,snapDistFormat:Function},events:{onSnap:"snap"},css:[":host {\n --bounds-color: #d66;\n}\n.guideline {\n pointer-events: none;\n z-index: 2;\n}\n.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}\n.guideline-group {\n position: absolute;\n top: 0;\n left: 0;\n}\n.guideline-group .size-value {\n position: absolute;\n color: #f55;\n font-size: 12px;\n font-weight: bold;\n}\n.guideline-group.horizontal .size-value {\n transform-origin: 50% 100%;\n transform: translateX(-50%);\n left: 50%;\n bottom: 5px;\n}\n.guideline-group.vertical .size-value {\n transform-origin: 0% 50%;\n top: 50%;\n transform: translateY(-50%);\n left: 5px;\n}\n.guideline.gap {\n background: #f55;\n}\n.size-value.gap {\n color: #f55;\n}\n"],render:function(e,t){var n=e.state,r=n.top,i=n.left,o=n.pos1,a=n.pos2,A=n.pos3,s=n.pos4,l=n.snapRenderInfo,u=n.targetClientRect,c=n.containerClientRect,f=n.is3d,d=n.rootMatrix;if(!l||!cn(e,""))return[];n.staticGuidelines=Ht(e,!1,n.staticGuidelines),n.guidelines=Tt(e);var p=f?4:3,h=Math.min(o[0],a[0],A[0],s[0]),g=Math.min(o[1],a[1],A[1],s[1]),v=Ft(d,c,p),B=ze(d,[u.left-v[0],u.top-v[1]],p),m=B[0],b=B[1],w=e.props,E=w.snapThreshold,y=void 0===E?5:E,C=w.snapDigit,Q=void 0===C?0:C,x=w.snapDistFormat,F=void 0===x?function(e){return e}:x,U=l.externalPoses||[],S=Oe(e.state),O=[],H=[],T=[],N=[],_=[],M=ve(S),R=M.width,D=M.height,P=M.top,k=M.left,I=M.bottom,L=M.right,z=U.length>0,j=z?ve(U):{};if(!l.request){if(l.direction&&_.push(function(e,t,n){var r=[];if(n[0]&&n[1])r=[n,[-n[0],n[1]],[n[0],-n[1]]].map((function(e){return ht(t,e)}));else if(n[0]||n[1])e.props.keepRatio?r=[[-1,-1],[-1,1],[1,-1],[1,1],n].map((function(e){return ht(t,e)})):(r=pt(t,n)).length>1&&r.push([(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]);else for(var i=[t[0],t[1],t[3],t[2],t[0]],o=0;o<4;++o)r.push(i[o]),r.push([(i[o][0]+i[o+1][0])/2,(i[o][1]+i[o+1][1])/2]);return Nt(e,r.map((function(e){return e[0]})),r.map((function(e){return e[1]})),!0,1)}(e,S,l.direction)),l.snap){var X=ve(S);l.center&&(X.middle=(X.top+X.bottom)/2,X.center=(X.left+X.right)/2),_.push(Mt(e,X,!0,1))}z&&(l.center&&(j.middle=(j.top+j.bottom)/2,j.center=(j.left+j.right)/2),_.push(Mt(e,j,!0,1))),_.forEach((function(e){var t=e.vertical.posInfos,n=e.horizontal.posInfos;O.push.apply(O,t.filter((function(e){return e.guidelineInfos.some((function(e){return!e.guideline.hide}))})).map((function(e){return{type:"snap",pos:e.pos}}))),H.push.apply(H,n.filter((function(e){return e.guidelineInfos.some((function(e){return!e.guideline.hide}))})).map((function(e){return{type:"snap",pos:e.pos}}))),T.push.apply(T,Qn(t)),N.push.apply(N,Qn(n))}))}Fn(e,[k,L],[P,I],O,H),z&&Fn(e,[j.left,j.right],[j.top,j.bottom],O,H,l.externalBounds);var G=xn(T,"vertical",[i,r],[R,D]),V=xn(N,"horizontal",[i,r],[R,D]),Y=K(T,N);Re(e,"onSnap",{guidelines:Y.filter((function(e){return!e.element})),elements:Ie(Y.filter((function(e){return e.element})),(function(e){return e.element})),gaps:K(V,G)},!0);var W=An(e,N,0,[i,r],[m,b],[R,D]),J=W.guidelines,q=W.groups,Z=W.gapGuidelines,$=An(e,T,1,[i,r],[m,b],[R,D]),ee=$.guidelines,te=$.groups;return K(ln(e,"vertical",K(V,$.gapGuidelines),F,t),ln(e,"horizontal",K(G,Z),F,t),on(e,"horizontal",q,h,m,R,r,y,Q,0,F,t),on(e,"vertical",te,g,b,D,i,y,Q,1,F,t),sn(e,"horizontal",J,[i,r],t),sn(e,"vertical",ee,[i,r],t),an(e,"horizontal",H,h,r,R,0,t),an(e,"vertical",O,g,i,D,1,t))},dragStart:function(e,t){e.state.snapRenderInfo={request:t.isRequest,snap:!0,center:!0},un(e)},drag:function(e){var t=e.state;t.staticGuidelines=Ht(e,!1,t.staticGuidelines),t.guidelines=Tt(e)},pinchStart:function(e){this.unset(e)},dragEnd:function(e){this.unset(e)},dragControlCondition:function(e,t){return!(!Ye(0,t)&&!Pn(e,t))||(!t.isRequest&&t.inputEvent?Object(o.G)(t.inputEvent.target,te("snap-control")):void 0)},dragControlStart:function(e){e.state.snapRenderInfo=null,un(e)},dragControl:function(e){this.drag(e)},dragControlEnd:function(e){this.unset(e)},dragGroupStart:function(e,t){this.dragStart(e,t)},dragGroup:function(e){this.drag(e)},dragGroupEnd:function(e){this.unset(e)},dragGroupControlStart:function(e){e.state.snapRenderInfo=null,un(e)},dragGroupControl:function(e){this.drag(e)},dragGroupControlEnd:function(e){this.unset(e)},unset:function(e){var t=e.state;t.enableSnap=!1,t.staticGuidelines=[],t.guidelines=[],t.snapRenderInfo=null}},Sn={name:"draggable",props:{draggable:Boolean,throttleDrag:Number,throttleDragRotate:Number,startDragRotate:Number,edgeDraggable:Boolean},events:{onDragStart:"dragStart",onDrag:"drag",onDragEnd:"dragEnd",onDragGroupStart:"dragGroupStart",onDragGroup:"dragGroup",onDragGroupEnd:"dragGroupEnd"},render:function(e,t){var n=e.props,r=n.throttleDragRotate,i=n.zoom,a=e.state,A=a.dragInfo,s=a.beforeOrigin;if(!r||!A)return[];var l=A.dist;if(!l[0]&&!l[1])return[];var u=be(l),c=Object(o.E)(l,[0,0]);return[t.createElement("div",{className:te("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:u+"px",transform:"translate("+s[0]+"px, "+s[1]+"px) rotate("+c+"rad) scaleY("+i+")"}})]},dragStart:function(e,t){var n=t.datas,r=t.parentEvent,i=t.parentGesto,o=e.state,a=o.target;if(o.gesto)return!1;o.gesto=i||e.targetGesto;var A=window.getComputedStyle(a);n.datas={},n.left=parseFloat(A.left||"")||0,n.top=parseFloat(A.top||"")||0,n.bottom=parseFloat(A.bottom||"")||0,n.right=parseFloat(A.right||"")||0,n.startValue=[0,0],at(e,t),Bt(t,"translate"),function(e,t){t.absolutePoses=Oe(e.state)}(e,n),n.prevDist=[0,0],n.prevBeforeDist=[0,0],n.isDrag=!1;var s=_e(e,t,I({set:function(e){n.startValue=e}},vt(t)));return!1!==(r||Re(e,"onDragStart",s))?(n.isDrag=!0,e.state.dragInfo={startRect:e.getRect(),dist:[0,0]}):(o.gesto=null,n.isPinch=!1),!!n.isDrag&&s},drag:function(e,t){At(t,"translate");var n=t.datas,r=t.parentEvent,i=t.parentFlag,a=t.isPinch,A=t.isRequest,s=t.distX,l=t.distY,u=n.isDrag,c=n.prevDist,f=n.prevBeforeDist,d=n.startValue;if(u){var p=e.props,v=p.parentMoveable,B=r?0:p.throttleDrag||0,m=r?0:p.throttleDragRotate||0,b=!1,w=0;if(!r&&m>0&&(s||l)){var E=p.startDragRotate||0,y=He(E+180*Object(o.E)([0,0],[s,l])/Math.PI,m)-E,C=l*Math.abs(Math.cos((y-90)/180*Math.PI)),Q=be([s*Math.abs(Math.cos(y/180*Math.PI)),C]);w=y*Math.PI/180,s=Q*Math.cos(w),l=Q*Math.sin(w)}if(!a&&!r&&!i&&(!m||s||l)){var x=Cn(e,s,l,m,A,n),F=x[0],U=x[1],S=F.isSnap,O=F.isBound,H=F.offset,T=U.isSnap,N=U.isBound;b=S||T||O||N,s+=H,l+=U.offset}n.passDeltaX=s-(n.passDistX||0),n.passDeltaY=l-(n.passDistY||0),n.passDistX=s,n.passDistY=l;var _=h(ct({datas:n,distX:s,distY:l}),d),M=h(lt({datas:n,distX:s,distY:l}),d);m||b||(Te(M,B),Te(_,B));var R=g(_,d),D=g(M,d),P=g(D,c),k=g(R,f);n.prevDist=D,n.prevBeforeDist=R;var I=n.left+R[0],K=n.top+R[1],L=n.right-R[0],z=n.bottom-R[1],j=st(n,"translate("+M[0]+"px, "+M[1]+"px)","translate("+D[0]+"px, "+D[1]+"px)");if(e.state.dragInfo.dist=r?[0,0]:D,r||v||!P.every((function(e){return!e}))||!k.some((function(e){return!e}))){var X=e.state,G=_e(e,t,{transform:j,dist:D,delta:P,translate:M,beforeDist:R,beforeDelta:k,beforeTranslate:_,left:I,top:K,right:L,bottom:z,width:X.width,height:X.height,isPinch:a});return!r&&Re(e,"onDrag",G),G}}},dragEnd:function(e,t){var n=t.parentEvent,r=t.datas,i=t.isDrag;if(e.state.gesto=null,e.state.dragInfo=null,r.isDrag)return r.isDrag=!1,!n&&Re(e,"onDragEnd",Me(e,t,{})),i},dragGroupStart:function(e,t){var n=t.datas,r=t.clientX,i=t.clientY,o=this.dragStart(e,t);if(!o)return!1;var a=rt(e,this,"dragStart",[r||0,i||0],t,!1),A=Re(e,"onDragGroupStart",I(I({},o),{targets:e.props.targets,events:a}));return n.isDrag=!1!==A,!!n.isDrag&&o},dragGroup:function(e,t){if(t.datas.isDrag){var n=this.drag(e,t),r=t.datas,i=rt(e,this,"drag",[r.passDeltaX,r.passDeltaY],t,!1);if(n){var o=I({targets:e.props.targets,events:i},n);return Re(e,"onDragGroup",o),o}}},dragGroupEnd:function(e,t){var n=t.isDrag;if(t.datas.isDrag)return this.dragEnd(e,t),rt(e,this,"dragEnd",[0,0],t,!1),Re(e,"onDragGroupEnd",Me(e,t,{targets:e.props.targets})),n},request:function(e){var t={},n=e.getRect(),r=0,i=0;return{isControl:!1,requestStart:function(){return{datas:t}},request:function(e){return"x"in e?r=e.x-n.left:"deltaX"in e&&(r+=e.deltaX),"y"in e?i=e.y-n.top:"deltaY"in e&&(i+=e.deltaY),{datas:t,distX:r,distY:i}},requestEnd:function(){return{datas:t,isDrag:!0}}}},unset:function(e){e.state.dragInfo=null}};function On(e,t,n,r){void 0===r&&(r="");var i=e.state,o=i.renderPoses,a=i.rotation,A=i.direction,s=e.props,l=s.renderDirections,u=void 0===l?t:l,c=s.zoom,f={};if(!u)return[];var d=A>0?1:-1,p=!0===u?q:u,h=a/Math.PI*180;return p.forEach((function(e){f[e]=!0})),p.map((function(e){var t=Z[e];if(!t||!f[e])return null;var i=(He(h,15)+d*$[e]+720)%180;return n.createElement("div",{className:te("control","direction",e,r),"data-rotation":i,"data-direction":e,key:"direction-"+e,style:ye.apply(void 0,K([a,c],t.map((function(e){return o[e]}))))})}))}function Hn(e,t,n,r,i,a){for(var A=[],s=6;sr&&s>270&&r<90?++n.loop:s270&&--n.loop;var f=n.loop,d=360*c+l-u+o,p=360*f+r-u+o;n.prevDeg=p-360*f+u-o;var h=i*((p=He(p,a))-o);return A&&(p=(h=En(e,t,n.origin,h))/i+o),n.prevSnapDeg=p-360*f+u-o,[i*(p-d),h,o+h]}function Dn(e,t,n,r,i,a,A,s){return Rn(e,t,n,Object(o.E)(n.startAbsoluteOrigin,[i,a])/Math.PI*180,r,A,s,!0)}function Pn(e,t){if(t.isRequest)return"rotatable"===t.requestAble;var n=t.inputEvent.target;if(Object(o.G)(n,te("rotation-control")))return!0;var r=e.props.rotationTarget;return!!r&&qe(r,!0).some((function(e){return!!e&&(n===e||n.contains(e))}))}var kn={name:"rotatable",canPinch:!0,props:{rotatable:Boolean,rotationPosition:String,throttleRotate:Number,renderDirections:Object,rotationTarget:Object},events:{onRotateStart:"rotateStart",onRotate:"rotate",onRotateEnd:"rotateEnd",onRotateGroupStart:"rotateGroupStart",onRotateGroup:"rotateGroup",onRotateGroupEnd:"rotateGroupEnd"},css:[".rotation {\n position: absolute;\n height: 40px;\n width: 1px;\n transform-origin: 50% 100%;\n height: calc(40px * var(--zoom));\n top: auto;\n left: 0;\n bottom: 100%;\n will-change: transform;\n }\n .rotation .rotation-line {\n display: block;\n width: 100%;\n height: 100%;\n transform-origin: 50% 50%;\n }\n .rotation .rotation-control {\n border-color: #4af;\n border-color: var(--moveable-color);\n background:#fff;\n cursor: alias;\n }"],render:function(e,t){var n=e.props,r=n.rotatable,i=n.rotationPosition,o=n.zoom,a=n.renderDirections,A=e.state,s=A.renderPoses,l=A.direction;if(!r)return null;var u=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];if("none"!==e){var A=(e||"top").split("-"),s=A[0],l=A[1],u=[r,i];"left"===s?u=[o,r]:"right"===s?u=[i,a]:"bottom"===s&&(u=[a,o]);var c=[(u[0][0]+u[1][0])/2,(u[0][1]+u[1][1])/2],f=Qe(u,n);if(l){var d="top"===l||"left"===l,p="bottom"===s||"left"===s;c=u[d&&!p||!d&&p?0:1]}return[c,f]}}(i,s,l),c=[];if(u){var f=u[0],d=u[1];c.push(t.createElement("div",{key:"rotation",className:te("rotation"),style:{transform:"translate(-50%) translate("+f[0]+"px, "+f[1]+"px) rotate("+d+"rad)"}},t.createElement("div",{className:te("line rotation-line"),style:{transform:"scaleX("+o+")"}}),t.createElement("div",{className:te("control rotation-control"),style:{transform:"translate(0.5px) scale("+o+")"}})))}return a&&c.push.apply(c,On(e,[],t)),c},dragControlCondition:Pn,dragControlStart:function(e,t){var n=t.datas,r=t.clientX,i=t.clientY,o=t.parentRotate,a=t.parentFlag,A=t.isPinch,s=t.isRequest,l=e.state,u=l.target,c=l.left,f=l.top,d=l.origin,p=l.beforeOrigin,h=l.direction,g=l.beforeDirection,v=l.targetTransform,B=l.moveableClientRect;if(!s&&!u)return!1;var m=e.getRect();if(n.rect=m,n.transform=v,n.left=c,n.top=f,n.fixedPosition=Ct(e,yt(e)),n.absoluteInfo={origin:m.origin,startValue:m.rotation},_n(e,n.absoluteInfo,r,i,d,B),s||A||a){var b=o||0;n.beforeInfo={origin:m.beforeOrigin,prevDeg:b,startDeg:b,prevSnapDeg:b,loop:0},n.afterInfo={origin:m.origin,prevDeg:b,startDeg:b,prevSnapDeg:b,loop:0}}else n.beforeInfo={origin:m.beforeOrigin},n.afterInfo={origin:m.origin},_n(e,n.beforeInfo,r,i,p,B),_n(e,n.afterInfo,r,i,d,B);n.direction=h,n.beforeDirection=g,n.startValue=0,n.datas={},Bt(t,"rotate");var w=_e(e,t,I(I({set:function(e){n.startValue=e*Math.PI/180}},vt(t)),{dragStart:Sn.dragStart(e,(new tt).dragStart([0,0],t))})),E=Re(e,"onRotateStart",w);return n.isRotate=!1!==E,e.state.snapRenderInfo={request:t.isRequest},!!n.isRotate&&w},dragControl:function(e,t){var n,r,i,o,a,A,s,l,u,c=t.datas,f=t.clientX,d=t.clientY,p=t.parentRotate,v=t.parentFlag,B=t.isPinch,m=t.groupDelta,b=c.beforeDirection,w=c.beforeInfo,E=c.afterInfo,y=c.absoluteInfo,C=c.isRotate,Q=c.startValue,x=c.rect;if(C){At(t,"rotate");var F,U,S,O,H,T,N,_,M,R=b*function(e){return me(e.datas.beforeTransform,[50,50],100,100).direction}(t),D=e.props,P=D.throttleRotate,k=void 0===P?0:P,K=D.parentMoveable,L=180/Math.PI*Q,z=y.startValue;if(!v&&"parentDist"in t){var j=t.parentDist;F=(n=Mn(e,x,E,j,0,L))[0],U=n[1],S=n[2],O=(r=Mn(e,x,w,j,0,L))[0],H=r[1],T=r[2],N=(i=Mn(e,x,y,j,0,z))[0],_=i[1],M=i[2]}else B||v?(F=(o=Rn(e,x,E,p,R,L,k))[0],U=o[1],S=o[2],O=(a=Rn(e,x,w,p,b,L,k))[0],H=a[1],T=a[2],N=(A=Rn(e,x,y,p,R,z,k))[0],_=A[1],M=A[2]):(F=(s=Dn(e,x,E,R,f,d,L,k))[0],U=s[1],S=s[2],O=(l=Dn(e,x,w,b,f,d,L,k))[0],H=l[1],T=l[2],N=(u=Dn(e,x,y,R,f,d,z,k))[0],_=u[1],M=u[2]);if(N||F||O||K){var X=st(c,"rotate("+S+"deg)","rotate("+U+"deg)"),G=function(e,t,n,r){return Et(e,"rotate("+t+"deg)",yt(e),n,r)}(e,U,c.fixedPosition,c),V=g(h(m||[0,0],G),c.prevInverseDist||[0,0]);c.prevInverseDist=G;var Y=_e(e,t,I({delta:F,dist:U,rotate:S,beforeDist:H,beforeDelta:O,beforeRotate:T,absoluteDist:_,absoluteDelta:N,absoluteRotate:M,isPinch:!!B},wt(e,X,V,B,t)));return Re(e,"onRotate",Y),Y}}},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isRotate&&(n.isRotate=!1,Re(e,"onRotateEnd",Me(e,t,{})),r)},dragGroupControlCondition:Pn,dragGroupControlStart:function(e,t){var n=t.datas,r=e.state,i=r.left,o=r.top,a=r.beforeOrigin,A=this.dragControlStart(e,t);if(!A)return!1;A.set(n.beforeDirection*e.rotation);var s=it(e,this,"dragControlStart",t,(function(e,t){var n=e.state,r=n.left,A=n.top,s=n.beforeOrigin,l=h(g([r,A],[i,o]),g(s,a));return t.datas.groupClient=l,I(I({},t),{parentRotate:0})})),l=Re(e,"onRotateGroupStart",I(I({},A),{targets:e.props.targets,events:s}));return n.isRotate=!1!==l,!!n.isRotate&&A},dragGroupControl:function(e,t){var n=t.datas;if(n.isRotate){var r=this.dragControl(e,t);if(r){var i=n.beforeDirection,o=r.beforeDist,a=r.beforeDelta/180*Math.PI,A=it(e,this,"dragControl",t,(function(e,t){var n=t.datas.groupClient,r=n[0],A=n[1],s=m([r,A],a*i),l=s[0],u=s[1],c=[l-r,u-A];return t.datas.groupClient=[l,u],I(I({},t),{parentRotate:o,groupDelta:c})}));e.rotation=i*r.beforeRotate;var s=I({targets:e.props.targets,events:A,set:function(t){e.rotation=t}},r);return Re(e,"onRotateGroup",s),s}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isRotate)return this.dragControlEnd(e,t),it(e,this,"dragControlEnd",t),Re(e,"onRotateGroupEnd",Me(e,t,{targets:e.props.targets})),n},request:function(e){var t={},n=0,r=e.getRotation();return{isControl:!0,requestStart:function(){return{datas:t}},request:function(e){return"deltaRotate"in e?n+=e.deltaRotate:"rotate"in e&&(n=e.rotate-r),{datas:t,parentDist:n}},requestEnd:function(){return{datas:t,isDrag:!0}}}}},In={name:"resizable",ableGroup:"size",canPinch:!0,props:{resizable:Boolean,throttleResize:Number,renderDirections:Array,keepRatio:Boolean},events:{onResizeStart:"resizeStart",onResize:"resize",onResizeEnd:"resizeEnd",onResizeGroupStart:"resizeGroupStart",onResizeGroup:"resizeGroup",onResizeGroupEnd:"resizeGroupEnd"},render:function(e,t){var n=e.props,r=n.resizable,i=n.edge;if(r)return i?Nn(e,t):Tn(e,t)},dragControlCondition:Ye,dragControlStart:function(e,t){var n,r=t.inputEvent,i=t.isPinch,a=t.parentDirection,A=t.datas,s=t.parentFlag,l=a||(i?[0,0]:Ue(r.target)),u=e.state,c=u.target,f=u.width,d=u.height;if(!l||!c)return!1;!i&&at(e,t),A.datas={},A.direction=l,A.startOffsetWidth=f,A.startOffsetHeight=d,A.prevWidth=0,A.prevHeight=0,n=function(e){var t=window.getComputedStyle(e);return[parseFloat(t.width),parseFloat(t.height)]}(c),A.startWidth=n[0],A.startHeight=n[1];var p=[Math.max(0,f-A.startWidth),Math.max(0,d-A.startHeight)];if(A.minSize=p,A.maxSize=[1/0,1/0],!s){var g=window.getComputedStyle(c),v=g.position,B=g.minWidth,m=g.minHeight,b=g.maxWidth,w=g.maxHeight,E="static"===v||"relative"===v,y=E?c.parentElement:c.offsetParent,C=f,Q=d;if(y&&(C=y.clientWidth,Q=y.clientHeight,E)){var x=window.getComputedStyle(y);C-=parseFloat(x.paddingLeft)||0,Q-=parseFloat(x.paddingTop)||0}A.minSize=h([Object(o.w)(B,C)||0,Object(o.w)(m,Q)||0],p),A.maxSize=h([Object(o.w)(b,C)||1/0,Object(o.w)(w,Q)||1/0],p)}var F=e.props.transformOrigin||"% %";function U(e){A.ratio=e&&isFinite(e)?e:0}function S(t){A.fixedDirection=t,A.fixedPosition=xt(e,t)}A.transformOrigin=F&&Object(o.L)(F)?F.split(" "):F,A.isWidth=!l[0]&&!l[1]||l[0]||!l[1],U(f/d),S([-l[0],-l[1]]);var O=_e(e,t,{direction:l,set:function(e){var t=e[0],n=e[1];A.startWidth=t,A.startHeight=n},setMin:function(e){A.minSize=e},setMax:function(e){A.maxSize=[e[0]||1/0,e[1]||1/0]},setRatio:U,setFixedDirection:S,setOrigin:function(e){A.transformOrigin=e},dragStart:Sn.dragStart(e,(new tt).dragStart([0,0],t))});return!1!==Re(e,"onResizeStart",O)&&(A.isResize=!0,e.state.snapRenderInfo={request:t.isRequest,direction:l}),!!A.isResize&&O},dragControl:function(e,t){var n,r=t.datas,i=t.distX,a=t.distY,A=t.parentFlag,s=t.isPinch,l=t.parentDistance,u=t.parentScale,c=t.parentKeepRatio,f=t.dragClient,d=t.parentDist,p=t.isRequest,h=r.isResize,g=r.transformOrigin,v=r.fixedDirection,B=r.startWidth,m=r.startHeight,b=r.prevWidth,w=r.prevHeight,E=r.minSize,y=r.maxSize,C=r.ratio,Q=r.isWidth,x=r.startOffsetWidth,F=r.startOffsetHeight;if(h){var U=e.props,S=U.throttleResize,O=void 0===S?0:S,H=U.parentMoveable,T=U.snapThreshold,N=void 0===T?5:T,_=r.direction,M=_,R=0,D=0;_[0]||_[1]||(M=[1,1]);var P=C&&(e.props.keepRatio||c),k=f;if(f||(k=!A&&s?xt(e,[0,0]):r.fixedPosition),d)R=d[0],D=d[1],P&&(R?D||(D=R/C):R=D*C);else if(u)R=(u[0]-1)*x,D=(u[1]-1)*F;else if(s)l&&(R=l,D=l*F/x);else{var I=ft({datas:r,distX:i,distY:a});if(R=M[0]*I[0],D=M[1]*I[1],P&&x&&F){var L=Object(o.E)([0,0],I),z=Object(o.E)([0,0],M),j=be([R,D]),X=Math.cos(L-z)*j;if(M[0])if(M[1]){var G=2*M[0]*x,V=2*M[1]*F,Y=be([G+I[0],V+I[1]])-be([G,V]),W=Object(o.E)([0,0],[C,1]);R=Math.cos(W)*Y,D=Math.sin(W)*Y}else D=(R=X)*C;else R=(D=X)/C}else if(!P){var J=K(_);x||(I[0]<0?J[0]=-1:I[0]>0&&(J[0]=1)),F||(I[1]<0?J[1]=-1:I[1]>0&&(J[1]=1)),_=J,R=(M=J)[0]*I[0],D=M[1]*I[1]}}var q=M[0]||P?Math.max(x+R,1e-7):x,Z=M[1]||P?Math.max(F+D,1e-7):F;P&&x&&F&&(Q?Z=q/C:q=Z*C);var $=[0,0];if(s||($=function(e,t,n,r,i,o,a){if(!cn(e,"resizable"))return[0,0];var A=e.state,s=A.allMatrix,l=A.is3d;return wn(e,(function(e,o){return dn(s,t+e,n+o,i,r,l)}),t,n,r,i,o,a)}(e,q,Z,_,k,p,r)),d&&(!d[0]&&($[0]=0),!d[1]&&($[1]=0)),P){M[0]&&M[1]&&$[0]&&$[1]&&(Math.abs($[0])>Math.abs($[1])?$[1]=0:$[0]=0);var ee=!$[0]&&!$[1];ee&&(Q?q=He(q,O):Z=He(Z,O)),M[0]&&!M[1]||$[0]&&!$[1]||ee&&Q?Z=(q+=$[0])/C:(!M[0]&&M[1]||!$[0]&&$[1]||ee&&!Q)&&(q=(Z+=$[1])*C)}else x+R<-N&&($[0]=0),x+D<-N&&($[1]=0),q+=$[0],Z+=$[1],$[0]||(q=He(q,O)),$[1]||(Z=He(Z,O));q=(n=Object(o.t)([q,Z],E,y,P))[0],Z=n[1];var te=[(R=(q=Math.round(q))-x)-b,(D=(Z=Math.round(Z))-F)-w];r.prevWidth=R,r.prevHeight=D;var ne=Qt(e,q,Z,v,k,g);if(H||!te.every((function(e){return!e}))||!ne.every((function(e){return!e}))){var re=_e(e,t,{width:B+R,height:m+D,offsetWidth:q,offsetHeight:Z,direction:_,dist:[R,D],delta:te,isPinch:!!s,drag:Sn.drag(e,et(t,e.state,ne,!!s,!1))});return Re(e,"onResize",re),re}}},dragControlAfter:function(e,t){var n=t.datas,r=n.isResize,i=n.startOffsetWidth,o=n.startOffsetHeight,a=n.prevWidth,A=n.prevHeight;if(r){var s=e.state,l=s.width-(i+a),u=s.height-(o+A),c=Math.abs(l)>3,f=Math.abs(u)>3;return c&&(n.startWidth+=l,n.startOffsetWidth+=l,n.prevWidth+=l),f&&(n.startHeight+=u,n.startOffsetHeight+=u,n.prevHeight+=u),c||f?(this.dragControl(e,t),!0):void 0}},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isResize&&(n.isResize=!1,Re(e,"onResizeEnd",Me(e,t,{})),r)},dragGroupControlCondition:Ye,dragGroupControlStart:function(e,t){var n=t.datas,r=this.dragControlStart(e,t);if(!r)return!1;var i=nt(e,"resizable",t);function o(t,r){var i=n.fixedDirection,o=n.fixedPosition,a=xt(t,i),A=B(b(-e.rotation/180*Math.PI,3),[a[0]-o[0],a[1]-o[1],1],3),s=A[0],l=A[1];return r.datas.originalX=s,r.datas.originalY=l,r}var a=it(e,this,"dragControlStart",t,(function(e,t){return o(e,t)})),A=I(I({},r),{targets:e.props.targets,events:a,setFixedDirection:function(t){r.setFixedDirection(t),a.forEach((function(n,r){n.setFixedDirection(t),o(e.moveables[r],i[r])}))}}),s=Re(e,"onResizeGroupStart",A);return n.isResize=!1!==s,!!n.isResize&&r},dragGroupControl:function(e,t){var n=t.datas;if(n.isResize){var r=this.dragControl(e,t);if(r){var i=r.offsetWidth,o=r.offsetHeight,a=r.dist,A=e.props.keepRatio,s=[i/(i-a[0]),o/(o-a[1])],l=n.fixedPosition,u=it(e,this,"dragControl",t,(function(t,n){var r=B(b(e.rotation/180*Math.PI,3),[n.datas.originalX*s[0],n.datas.originalY*s[1],1],3),i=r[0],o=r[1];return I(I({},n),{parentDist:null,parentScale:s,dragClient:h(l,[i,o]),parentKeepRatio:A})})),c=I({targets:e.props.targets,events:u},r);return Re(e,"onResizeGroup",c),c}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isResize)return this.dragControlEnd(e,t),it(e,this,"dragControlEnd",t),Re(e,"onResizeGroupEnd",Me(e,t,{targets:e.props.targets})),n},request:function(e){var t={},n=0,r=0,i=e.getRect();return{isControl:!0,requestStart:function(e){return{datas:t,parentDirection:e.direction||[1,1]}},request:function(e){return"offsetWidth"in e?n=e.offsetWidth-i.offsetWidth:"deltaWidth"in e&&(n+=e.deltaWidth),"offsetHeight"in e?r=e.offsetHeight-i.offsetHeight:"deltaHeight"in e&&(r+=e.deltaHeight),{datas:t,parentDist:[n,r]}},requestEnd:function(){return{datas:t,isDrag:!0}}}}},Kn={name:"scalable",ableGroup:"size",canPinch:!0,props:{scalable:Boolean,throttleScale:Number,renderDirections:String,keepRatio:Boolean},events:{onScaleStart:"scaleStart",onScale:"scale",onScaleEnd:"scaleEnd",onScaleGroupStart:"scaleGroupStart",onScaleGroup:"scaleGroup",onScaleGroupEnd:"scaleGroupEnd"},render:function(e,t){var n=e.props,r=n.resizable,i=n.scalable,o=n.edge;if(!r&&i)return o?Nn(e,t):Tn(e,t)},dragControlCondition:Ye,dragControlStart:function(e,t){var n=t.datas,r=t.isPinch,i=t.inputEvent,a=t.parentDirection||(r?[0,0]:Ue(i.target)),A=e.state,s=A.width,l=A.height,u=A.targetTransform,c=A.target,f=A.pos1,d=A.pos2,p=A.pos4;if(!a||!c)return!1;r||at(e,t),n.datas={},n.transform=u,n.prevDist=[1,1],n.direction=a,n.width=s,n.height=l,n.startValue=[1,1];var h=Object(o.C)(f,d),g=Object(o.C)(d,p),v=!a[0]&&!a[1]||a[0]||!a[1];function B(e){n.ratio=e&&isFinite(e)?e:0}function m(t){n.fixedDirection=t,n.fixedPosition=xt(e,t)}n.scaleWidth=h,n.scaleHeight=g,n.scaleXRatio=h/s,n.scaleYRatio=g/l,Bt(t,"scale"),n.isWidth=v,B(Object(o.C)(f,d)/Object(o.C)(d,p)),m([-a[0],-a[1]]);var b=_e(e,t,I(I({direction:a,set:function(e){n.startValue=e},setRatio:B,setFixedDirection:m},vt(t)),{dragStart:Sn.dragStart(e,(new tt).dragStart([0,0],t))}));return!1!==Re(e,"onScaleStart",b)&&(n.isScale=!0,e.state.snapRenderInfo={request:t.isRequest,direction:a}),!!n.isScale&&b},dragControl:function(e,t){At(t,"scale");var n=t.datas,r=t.distX,i=t.distY,a=t.parentScale,A=t.parentDistance,s=t.parentKeepRatio,l=t.parentFlag,u=t.isPinch,c=t.dragClient,f=t.parentDist,d=t.isRequest,p=n.prevDist,h=n.direction,v=n.width,B=n.height,m=n.isScale,b=n.startValue,w=n.isWidth,E=n.ratio,y=n.fixedDirection,C=n.scaleXRatio,Q=n.scaleYRatio;if(!m)return!1;var x=e.props,F=x.throttleScale,U=x.parentMoveable,S=h;h[0]||h[1]||(S=[1,1]);var O=E&&(e.props.keepRatio||s),H=e.state,T=1,N=1,_=c;if(c||(_=!l&&u?xt(e,[0,0]):n.fixedPosition),f)T=(v+f[0])/v,N=(B+f[1])/B;else if(a)T=a[0],N=a[1];else if(u)A&&(T=(v+A)/v,N=(B+A*B/v)/B);else{var M=ft({datas:n,distX:r,distY:i}),R=S[0]*M[0]*C,D=S[1]*M[1]*Q;if(O&&v&&B)if(S[0])if(S[1]){var P=be([R,D]),k=Object(o.E)([0,0],M),K=Object(o.E)([0,0],S),L=Math.cos(k-K)*P,z=Object(o.E)([0,0],[E,1]);R=Math.cos(z)*L,D=Math.sin(z)*L}else D=R/E;else R=D*E;T=(v+R/C)/v,N=(B+D/Q)/B}T=S[0]||O?T*b[0]:b[0],N=S[1]||O?N*b[1]:b[1],0===T&&(T=1e-9*(p[0]>0?1:-1)),0===N&&(N=1e-9*(p[1]>0?1:-1));var j=[T/b[0],N/b[1]],X=[T,N];if(!u&&e.props.groupable){var G=(H.snapRenderInfo||{}).direction;Object(o.H)(G)&&(G[0]||G[1])&&(H.snapRenderInfo={direction:h,request:t.isRequest})}var V=[0,0];if(u||(V=yn(e,j,h,d,n)),O){S[0]&&S[1]&&V[0]&&V[1]&&(Math.abs(V[0]*v)>Math.abs(V[1]*B)?V[1]=0:V[0]=0);var Y=!V[0]&&!V[1];if(Y&&(w?j[0]=He(j[0]*b[0],F)/b[0]:j[1]=He(j[1]*b[1],F)/b[1]),S[0]&&!S[1]||V[0]&&!V[1]||Y&&w){j[0]+=V[0];var W=v*j[0]*b[0]/E;j[1]=W/B/b[1]}else if(!S[0]&&S[1]||!V[0]&&V[1]||Y&&!w){j[1]+=V[1];var J=B*j[1]*b[1]*E;j[0]=J/v/b[0]}}else j[0]+=V[0],j[1]+=V[1],V[0]||(j[0]=He(j[0]*b[0],F)/b[0]),V[1]||(j[1]=He(j[1]*b[1],F)/b[1]);0===j[0]&&(j[0]=1e-9*(p[0]>0?1:-1)),0===j[1]&&(j[1]=1e-9*(p[1]>0?1:-1));var q,Z,$=[j[0]/p[0],j[1]/p[1]];Z=b,X=[(q=j)[0]*Z[0],q[1]*Z[1]];var ee=function(e,t,n,r,i){return Et(e,"scale("+t.join(", ")+")",n,r,i)}(e,j,y,_,n),te=g(ee,n.prevInverseDist||[0,0]);if(n.prevDist=j,n.prevInverseDist=ee,T===p[0]&&N===p[1]&&te.every((function(e){return!e}))&&!U)return!1;var ne=st(n,"scale("+X.join(", ")+")","scale("+j.join(", ")+")"),re=_e(e,t,I({offsetWidth:v,offsetHeight:B,direction:h,scale:X,dist:j,delta:$,isPinch:!!u},wt(e,ne,te,u,t)));return Re(e,"onScale",re),re},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isScale&&(n.isScale=!1,Re(e,"onScaleEnd",Me(e,t,{})),r)},dragGroupControlCondition:Ye,dragGroupControlStart:function(e,t){var n=t.datas,r=this.dragControlStart(e,t);if(!r)return!1;var i=nt(e,"resizable",t);function o(t,r){var i=n.fixedDirection,o=n.fixedPosition,a=xt(t,i),A=B(b(-e.rotation/180*Math.PI,3),[a[0]-o[0],a[1]-o[1],1],3),s=A[0],l=A[1];return r.datas.originalX=s,r.datas.originalY=l,r}n.moveableScale=e.scale;var a=it(e,this,"dragControlStart",t,(function(e,t){return o(e,t)})),A=I(I({},r),{targets:e.props.targets,events:a,setFixedDirection:function(t){r.setFixedDirection(t),a.forEach((function(n,r){n.setFixedDirection(t),o(e.moveables[r],i[r])}))}}),s=Re(e,"onScaleGroupStart",A);return n.isScale=!1!==s,!!n.isScale&&A},dragGroupControl:function(e,t){var n=t.datas;if(n.isScale){var r=this.dragControl(e,t);if(r){var i=n.moveableScale;e.scale=[r.scale[0]*i[0],r.scale[1]*i[1]];var o=e.props.keepRatio,a=r.dist,A=r.scale,s=n.fixedPosition,l=it(e,this,"dragControl",t,(function(t,n){var r=B(b(e.rotation/180*Math.PI,3),[n.datas.originalX*a[0],n.datas.originalY*a[1],1],3),i=r[0],l=r[1];return I(I({},n),{parentDist:null,parentScale:A,parentKeepRatio:o,dragClient:h(s,[i,l])})})),u=I({targets:e.props.targets,events:l},r);return Re(e,"onScaleGroup",u),u}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isScale)return this.dragControlEnd(e,t),it(e,this,"dragControlEnd",t),Re(e,"onScaleGroupEnd",Me(e,t,{targets:e.props.targets})),n},request:function(){var e={},t=0,n=0;return{isControl:!0,requestStart:function(t){return{datas:e,parentDirection:t.direction||[1,1]}},request:function(r){return t+=r.deltaWidth,n+=r.deltaHeight,{datas:e,parentDist:[t,n]}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function Ln(e,t){return e.map((function(e,n){return Object(o.y)(e,t[n],1,2)}))}function zn(e,t,n){var r=Object(o.E)(e,t),i=Object(o.E)(e,n)-r;return i>=0?i:i+2*Math.PI}var jn={name:"warpable",ableGroup:"size",props:{warpable:Boolean,renderDirections:Array},events:{onWarpStart:"warpStart",onWarp:"warp",onWarpEnd:"warpEnd"},render:function(e,t){var n=e.props,r=n.resizable,i=n.scalable,o=n.warpable,a=n.zoom;if(r||i||!o)return[];var A=e.state,s=A.pos1,l=A.pos2,u=A.pos3,c=A.pos4,f=Ln(s,l),d=Ln(l,s),p=Ln(s,u),h=Ln(u,s),g=Ln(u,c),v=Ln(c,u),B=Ln(l,c),m=Ln(c,l);return K([t.createElement("div",{className:te("line"),key:"middeLine1",style:Ee(f,g,a)}),t.createElement("div",{className:te("line"),key:"middeLine2",style:Ee(d,v,a)}),t.createElement("div",{className:te("line"),key:"middeLine3",style:Ee(p,B,a)}),t.createElement("div",{className:te("line"),key:"middeLine4",style:Ee(h,m,a)})],Tn(e,t))},dragControlCondition:function(e,t){return!t.isRequest&&Object(o.G)(t.inputEvent.target,te("direction"))},dragControlStart:function(e,t){var n=t.datas,r=t.inputEvent,i=e.props.target,o=Ue(r.target);if(!o||!i)return!1;var a=e.state,A=a.transformOrigin,s=a.is3d,c=a.targetTransform,d=a.targetMatrix,p=a.width,h=a.height,v=a.left,m=a.top;return n.datas={},n.targetTransform=c,n.warpTargetMatrix=s?d:f(d,3,4),n.targetInverseMatrix=l(u(n.warpTargetMatrix,4),3,4),n.direction=o,n.left=v,n.top=m,n.poses=[[0,0],[p,0],[0,h],[p,h]].map((function(e){return g(e,A)})),n.nextPoses=n.poses.map((function(e){var t=e[0],r=e[1];return B(n.warpTargetMatrix,[t,r,0,1],4)})),n.startValue=w(4),n.prevMatrix=w(4),n.absolutePoses=Oe(a),n.posIndexes=dt(o),at(e,t),Bt(t,"matrix3d"),a.snapRenderInfo={request:t.isRequest,direction:o},!1!==Re(e,"onWarpStart",_e(e,t,I({set:function(e){n.startValue=e}},vt(t))))&&(n.isWarp=!0),n.isWarp},dragControl:function(e,t){var n=t.datas,r=t.isRequest,i=t.distX,o=t.distY,a=n.targetInverseMatrix,A=n.prevMatrix,s=n.isWarp,l=n.startValue,c=n.poses,f=n.posIndexes,d=n.absolutePoses;if(!s)return!1;if(At(t,"matrix3d"),cn(e,"warpable")){var g=f.map((function(e){return d[e]}));g.length>1&&g.push([(g[0][0]+g[1][0])/2,(g[0][1]+g[1][1])/2]);var v=vn(e,r,g.map((function(e){return[e[0]+i,e[1]+o]}))),B=v.horizontal,m=v.vertical;o-=B.offset,i-=m.offset}var b=ft({datas:n,distX:i,distY:o},!0),w=n.nextPoses.slice();if(f.forEach((function(e){w[e]=h(w[e],b)})),!Y.every((function(e){return function(e,t){var n=zn(e[0],e[1],e[2]),r=zn(t[0],t[1],t[2]),i=Math.PI;return!(n>=i&&r<=i||n<=i&&r>=i)}(e.map((function(e){return c[e]})),e.map((function(e){return w[e]})))})))return!1;var E=C(c[0],c[2],c[1],c[3],w[0],w[2],w[1],w[3]);if(!E.length)return!1;var y=ut(n,p(a,E,4),!0),Q=p(u(A,4),y,4);n.prevMatrix=y;var x=p(l,y,4),F=st(n,"matrix3d("+x.join(", ")+")","matrix3d("+y.join(", ")+")");return bt(t,F),Re(e,"onWarp",_e(e,t,{delta:Q,matrix:x,dist:y,multiply:p,transform:F})),!0},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isWarp&&(n.isWarp=!1,Re(e,"onWarpEnd",Me(e,t,{})),r)}},Xn=te("area-pieces"),Gn=te("area-piece"),Vn=te("avoid");function Yn(e){var t=e.areaElement,n=e.state,r=n.width,i=n.height;Object(o.O)(t,Vn),t.style.cssText+="left: 0px; top: 0px; width: "+r+"px; height: "+i+"px"}function Wn(e){return e.createElement("div",{key:"area_pieces",className:Xn},e.createElement("div",{className:Gn}),e.createElement("div",{className:Gn}),e.createElement("div",{className:Gn}),e.createElement("div",{className:Gn}))}var Jn={name:"dragArea",props:{dragArea:Boolean,passDragArea:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},render:function(e,t){var n=e.props,r=n.target,o=n.dragArea,a=n.groupable,A=n.passDragArea,s=e.state,l=s.width,u=s.height,c=s.renderPoses,f=A?te("area","pass"):te("area");if(a)return[t.createElement("div",{key:"area",ref:Object(i.c)(e,"areaElement"),className:f}),Wn(t)];if(!r||!o)return[];var d=C([0,0],[l,0],[0,u],[l,u],c[0],c[1],c[2],c[3]),p=d.length?fe(d,!0):"none";return[t.createElement("div",{key:"area",ref:Object(i.c)(e,"areaElement"),className:f,style:{top:"0px",left:"0px",width:l+"px",height:u+"px",transformOrigin:"0 0",transform:p}}),Wn(t)]},dragStart:function(e,t){var n=t.datas,r=t.clientX,i=t.clientY;if(!t.inputEvent)return!1;n.isDragArea=!1;var a=e.areaElement,A=e.state,s=A.moveableClientRect,l=A.renderPoses,u=A.rootMatrix,c=A.is3d,f=s.left,d=s.top,p=ve(l),h=p.left,g=p.top,v=p.width,B=p.height,m=ze(u,[r-f,i-d],c?4:3),b=m[0],w=m[1],E=[{left:h,top:g,width:v,height:(w-=g)-10},{left:h,top:g,width:(b-=h)-10,height:B},{left:h,top:g+w+10,width:v,height:B-w-10},{left:h+b+10,top:g,width:v-b-10,height:B}],y=[].slice.call(a.nextElementSibling.children);E.forEach((function(e,t){y[t].style.cssText="left: "+e.left+"px;top: "+e.top+"px; width: "+e.width+"px; height: "+e.height+"px;"})),Object(o.p)(a,Vn)},drag:function(e,t){var n=t.datas;if(!t.inputEvent)return!1;n.isDragArea||(n.isDragArea=!0,Yn(e))},dragEnd:function(e,t){var n=t.inputEvent,r=t.datas;if(!n)return!1;r.isDragArea||Yn(e)},dragGroupStart:function(e,t){return this.dragStart(e,t)},dragGroup:function(e,t){return this.drag(e,t)},dragGroupEnd:function(e,t){return this.dragEnd(e,t)},unset:function(e){Yn(e)}},qn=L("origin",{render:function(e,t){var n=e.props.zoom,r=e.state,i=r.beforeOrigin,o=r.rotation;return[t.createElement("div",{className:te("control","origin"),style:ye(o,n,i),key:"beforeOrigin"})]}});function Zn(e){var t=e.scrollContainer;return[t.scrollLeft,t.scrollTop]}var $n={name:"scrollable",canPinch:!0,props:{scrollable:Boolean,scrollContainer:Object,scrollThreshold:Number,getScrollPosition:Function},events:{onScroll:"scroll",onScrollGroup:"scrollGroup"},dragStart:function(e,t){var n=e.props.scrollContainer,r=void 0===n?e.getContainer():n,i=new _,o=Je(r,!0);t.datas.dragScroll=i;var a=t.isControl?"controlGesto":"targetGesto",A=t.targets;i.on("scroll",(function(n){var r=n.container,i=n.direction,o=_e(e,t,{scrollContainer:r,direction:i}),a=A?"onScrollGroup":"onScroll";A&&(o.targets=A),Re(e,a,o)})).on("move",(function(n){var r=n.offsetX,i=n.offsetY;e[a].scrollBy(r,i,t.inputEvent,!1)})),i.dragStart(t,{container:o})},checkScroll:function(e,t){var n=t.datas.dragScroll;if(n){var r=e.props,i=r.scrollContainer,o=void 0===i?e.getContainer():i,a=r.scrollThreshold,A=void 0===a?0:a,s=r.getScrollPosition,l=void 0===s?Zn:s;return n.drag(t,{container:o,threshold:A,getScrollPosition:function(e){return l({scrollContainer:e.container,direction:e.direction})}}),!0}},drag:function(e,t){return this.checkScroll(e,t)},dragEnd:function(e,t){t.datas.dragScroll.dragEnd(),t.datas.dragScroll=null},dragControlStart:function(e,t){return this.dragStart(e,I(I({},t),{isControl:!0}))},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupStart:function(e,t){return this.dragStart(e,I(I({},t),{targets:e.props.targets}))},dragGroup:function(e,t){return this.drag(e,I(I({},t),{targets:e.props.targets}))},dragGroupEnd:function(e,t){return this.dragEnd(e,I(I({},t),{targets:e.props.targets}))},dragGroupControlStart:function(e,t){return this.dragStart(e,I(I({},t),{targets:e.props.targets,isControl:!0}))},dragGroupContro:function(e,t){return this.drag(e,I(I({},t),{targets:e.props.targets}))},dragGroupControEnd:function(e,t){return this.dragEnd(e,I(I({},t),{targets:e.props.targets}))}},er={name:"",props:{target:Object,dragTarget:Object,container:Object,portalContainer:Object,rootContainer:Object,zoom:Number,transformOrigin:Array,edge:Boolean,ables:Array,className:String,pinchThreshold:Number,pinchOutside:Boolean,triggerAblesSimultaneously:Boolean,checkInput:Boolean,cspNonce:String,translateZ:Number,props:Object},events:{}},tr=L("padding",{render:function(e,t){var n=e.props;if(n.dragArea)return[];var r=n.padding||{},i=r.left,o=void 0===i?0:i,a=r.top,A=void 0===a?0:a,s=r.right,l=void 0===s?0:s,u=r.bottom,c=void 0===u?0:u,f=e.state,d=f.renderPoses,p=[f.pos1,f.pos2,f.pos3,f.pos4],h=[];return o>0&&h.push([0,2]),A>0&&h.push([0,1]),l>0&&h.push([1,3]),c>0&&h.push([2,3]),h.map((function(e,n){var r=e[0],i=e[1],o=C([0,0],[100,0],[0,100],[100,100],p[r],p[i],d[r],d[i]);if(o.length)return t.createElement("div",{key:"padding"+n,className:te("padding"),style:{transform:fe(o,!0)}})}))}}),nr=["nw","ne","se","sw"];function rr(e,t){var n=e[0]+e[1],r=n>t?t/n:1;return e[0]*=r,e[1]=t-e[1]*r,e}var ir=[1,2,5,6],or=[0,3,4,7],ar=[1,-1,-1,1],Ar=[1,1,-1,-1];function sr(e,t,n,r,i,o,a,A,s){void 0===o&&(o=0),void 0===a&&(a=0),void 0===A&&(A=r),void 0===s&&(s=i);var l=[],u=!1,c=e.map((function(e,c){var f=t[c],d=f.horizontal,p=f.vertical;if(p&&!u&&(u=!0,l.push("/")),u){var h=Math.max(0,1===p?e[1]-a:s-e[1]);return l.push(Ge(h,i,n)),h}h=Math.max(0,1===d?e[0]-o:A-e[0]);return l.push(Ge(h,r,n)),h}));return{styles:l,raws:c}}function lr(e){for(var t=[0,0],n=[0,0],r=e.length,i=0;i-1?e.slice(0,c):e).length,d=e.slice(0,f),p=e.slice(f+1),h=d[0],g=void 0===h?"0px":h,v=d[1],B=void 0===v?g:v,m=d[2],b=void 0===m?g:m,w=d[3],E=void 0===w?B:w,y=p[0],C=void 0===y?g:y,Q=p[1],x=void 0===Q?C:Q,F=p[2],U=void 0===F?C:F,S=p[3],O=void 0===S?x:S,H=[g,B,b,E].map((function(e){return Object(o.w)(e,t)})),T=[C,x,U,O].map((function(e){return Object(o.w)(e,n)})),N=H.slice(),_=T.slice();A=rr([N[0],N[1]],t),N[0]=A[0],N[1]=A[1],s=rr([N[3],N[2]],t),N[3]=s[0],N[2]=s[1],l=rr([_[0],_[3]],n),_[0]=l[0],_[3]=l[1],u=rr([_[1],_[2]],n),_[1]=u[0],_[2]=u[1];var M=N.slice(0,Math.max(a[0],d.length)),R=_.slice(0,Math.max(a[1],p.length));return K(M.map((function(e,t){var o=nr[t];return{horizontal:ar[t],vertical:0,pos:[r+e,i+(-1===Ar[t]?n:0)],sub:!0,raw:H[t],direction:o}})),R.map((function(e,n){var o=nr[n];return{horizontal:0,vertical:Ar[n],pos:[r+(-1===ar[n]?t:0),i+e],sub:!0,raw:T[n],direction:o}})))}function cr(e,t,n,r,i){void 0===i&&(i=t.length);var o=lr(e.slice(r)),a=o.horizontalRange,A=o.verticalRange,s=n-r,l=0;if(0===s)l=i;else if(s>0&&s=A[0]))return;l=A[0]+A[1]-s}e.splice(n,l),t.splice(n,l)}function fr(e,t,n,r,i,o,a,A,s,l,u){void 0===l&&(l=0),void 0===u&&(u=0);var c=lr(e.slice(n)),f=c.horizontalRange,d=c.verticalRange;if(r>-1)for(var p=1===ar[r]?o-l:A-o,h=f[1];h<=r;++h){var g=1===Ar[h]?u:s,v=0;if(r===h?v=o:0===h?v=l+p:-1===ar[h]&&(v=A-(t[n][0]-l)),e.splice(n+h,0,{horizontal:ar[h],vertical:0,pos:[v,g]}),t.splice(n+h,0,[v,g]),0===h)break}else if(i>-1){var B=1===Ar[i]?a-u:s-a;if(0===f[1]&&0===d[1]){var m=[l+B,u];e.push({horizontal:ar[0],vertical:0,pos:m}),t.push(m)}var b=d[0];for(h=d[1];h<=i;++h){v=1===ar[h]?l:A,g=0;if(i===h?g=a:0===h?g=u+B:1===Ar[h]?g=t[n+b][1]:-1===Ar[h]&&(g=s-(t[n+b][1]-u)),e.push({horizontal:0,vertical:Ar[h],pos:[v,g]}),t.push([v,g]),0===h)break}}}function dr(e,t){return void 0===t&&(t=e.map((function(e){return e.raw}))),{horizontals:e.map((function(e,n){return e.horizontal?t[n]:null})).filter((function(e){return null!=e})),verticals:e.map((function(e,n){return e.vertical?t[n]:null})).filter((function(e){return null!=e}))}}var pr=[[0,-1,"n"],[1,0,"e"]],hr=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function gr(e,t,n){var r=e.props.clipRelative,i=e.state,o=i.width,a=i.height,A=t,s=A.type,l=A.poses,u="rect"===s,c="circle"===s;if("polygon"===s)return n.map((function(e){return Ge(e[0],o,r)+" "+Ge(e[1],a,r)}));if(u||"inset"===s){var f=n[1][1],d=n[3][0],p=n[7][0],h=n[5][1];if(u)return[f,d,h,p].map((function(e){return e+"px"}));var v=[f,o-d,a-h,p].map((function(e,t){return Ge(e,t%2?o:a,r)}));if(n.length>8){var B=g(n[4],n[0]),m=B[0],b=B[1];v.push.apply(v,K(["round"],sr(n.slice(8),l.slice(8),r,m,b,p,f,d,h).styles))}return v}if(c||"ellipse"===s){var w=n[0],E=Ge(Math.abs(n[1][1]-w[1]),c?Math.sqrt((o*o+a*a)/2):a,r);return(v=c?[E]:[Ge(Math.abs(n[2][0]-w[0]),o,r),E]).push("at",Ge(w[0],o,r),Ge(w[1],a,r)),v}}function vr(e,t,n,r){var i=[r,(r+t)/2,t],o=[e,(e+n)/2,n];return hr.map((function(e){var t=e[0],n=e[1],r=e[2],a=i[t+1],A=o[n+1];return{vertical:Math.abs(n),horizontal:Math.abs(t),direction:r,pos:[a,A]}}))}function Br(e,t,n,r,i){var a,A,s,l,u,c,f,d=i;if(!d){var p=getComputedStyle(e),h=p.clipPath;d="none"!==h?h:p.clip}if(d&&"none"!==d&&"auto"!==d||(d=r)){var g=Object(o.S)(d),v=g.prefix,B=void 0===v?d:v,m=g.value,b=void 0===m?"":m,w="circle"===B,E=" ";if("polygon"===B)return E=",",{type:B,clipText:d,poses:T=(F=Object(o.T)(b||"0% 0%, 100% 0%, 100% 100%, 0% 100%")).map((function(e){var r=e.split(" "),i=r[0],a=r[1];return{vertical:1,horizontal:1,pos:[Object(o.w)(i,t),Object(o.w)(a,n)]}})),splitter:E};if(w||"ellipse"===B){var y="",C="",Q=0,x=0,F=Object(o.U)(b);if(w){var U;U=void 0===(a=F[0])?"50%":a,y=void 0===(A=F[2])?"50%":A,C=void 0===(s=F[3])?"50%":s,Q=Object(o.w)(U,Math.sqrt((t*t+n*n)/2)),x=Q}else{var S,O;S=void 0===(l=F[0])?"50%":l,O=void 0===(u=F[1])?"50%":u,y=void 0===(c=F[3])?"50%":c,C=void 0===(f=F[4])?"50%":f,Q=Object(o.w)(S,t),x=Object(o.w)(O,n)}var H=[Object(o.w)(y,t),Object(o.w)(C,n)],T=K([{vertical:1,horizontal:1,pos:H,direction:"nesw"}],pr.slice(0,w?1:2).map((function(e){return{vertical:Math.abs(e[1]),horizontal:e[0],direction:e[2],sub:!0,pos:[H[0]+e[0]*Q,H[1]+e[1]*x]}})));return{type:B,clipText:d,radiusX:Q,radiusY:x,left:H[0]-Q,top:H[1]-x,poses:T,splitter:E}}if("inset"===B){var N=(F=Object(o.U)(b||"0 0 0 0")).indexOf("round"),_=(N>-1?F.slice(0,N):F).length,M=F.slice(_+1),R=F.slice(0,_),D=R[0],P=R[1],k=void 0===P?D:P,I=R[2],L=void 0===I?D:I,z=R[3],j=void 0===z?k:z,X=[D,L].map((function(e){return Object(o.w)(e,n)})),G=X[0],V=X[1],Y=[j,k].map((function(e){return Object(o.w)(e,t)})),W=Y[0],J=Y[1],q=t-J,Z=n-V,$=ur(M,q-W,Z-G,W,G);return{type:"inset",clipText:d,poses:T=K(vr(G,q,Z,W),$),top:G,left:W,right:q,bottom:Z,radius:M,splitter:E}}if("rect"===B){E=",";var ee=(F=Object(o.T)(b||"0px, "+t+"px, "+n+"px, 0px")).map((function(e){return Object(o.W)(e).value}));return{type:"rect",clipText:d,poses:T=vr(G=ee[0],J=ee[1],V=ee[2],W=ee[3]),top:G,right:J,bottom:V,left:W,values:F,splitter:E}}}}var mr={name:"clippable",props:{clippable:Boolean,defaultClipPath:String,customClipPath:String,clipRelative:Boolean,clipArea:Boolean,dragWithClip:Boolean,clipTargetBounds:Boolean,clipVerticalGuidelines:Array,clipHorizontalGuidelines:Array,clipSnapThreshold:Boolean},events:{onClipStart:"clipStart",onClip:"clip",onClipEnd:"clipEnd"},css:[".control.clip-control {\n background: #6d6;\n cursor: pointer;\n}\n.control.clip-control.clip-radius {\n background: #d66;\n}\n.line.clip-line {\n background: #6e6;\n cursor: move;\n z-index: 1;\n}\n.clip-area {\n position: absolute;\n top: 0;\n left: 0;\n}\n.clip-ellipse {\n position: absolute;\n cursor: move;\n border: 1px solid #6d6;\n border: var(--zoompx) solid #6d6;\n border-radius: 50%;\n transform-origin: 0px 0px;\n}",":host {\n --bounds-color: #d66;\n}",".guideline {\n pointer-events: none;\n z-index: 2;\n}",".line.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}"],render:function(e,t){var n=e.props,r=n.customClipPath,i=n.defaultClipPath,a=n.clipArea,A=n.zoom,s=e.state,l=s.target,u=s.width,c=s.height,f=s.allMatrix,d=s.is3d,p=s.left,h=s.top,v=s.pos1,B=s.pos2,m=s.pos3,b=s.pos4,w=s.clipPathState,E=s.snapBoundInfos;if(!l)return[];var y=Br(l,u,c,i||"inset",w||r);if(!y)return[];var C=d?4:3,Q=y.type,x=y.poses.map((function(e){var t=he(f,e.pos,C);return[t[0]-p,t[1]-h]})),F=[],U=[],S="rect"===Q,O="inset"===Q,H="polygon"===Q;if(S||O||H){var T=O?x.slice(0,8):x;U=T.map((function(e,n){var r=0===n?T[T.length-1]:T[n-1],i=Object(o.E)(r,e),a=we(r,e);return t.createElement("div",{key:"clipLine"+n,className:te("line","clip-line","snap-control"),"data-clip-index":n,style:{width:a+"px",transform:"translate("+r[0]+"px, "+r[1]+"px) rotate("+i+"rad) scaleY("+A+")"}})}))}if(F=x.map((function(e,n){return t.createElement("div",{key:"clipControl"+n,className:te("control","clip-control","snap-control"),"data-clip-index":n,style:{transform:"translate("+e[0]+"px, "+e[1]+"px) scale("+A+")"}})})),O&&F.push.apply(F,x.slice(8).map((function(e,n){return t.createElement("div",{key:"clipRadiusControl"+n,className:te("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+n,style:{transform:"translate("+e[0]+"px, "+e[1]+"px) scale("+A+")"}})}))),"circle"===Q||"ellipse"===Q){var N=y.left,_=y.top,M=y.radiusX,R=y.radiusY,D=g(he(f,[N,_],C),he(f,[0,0],C)),P=D[0],k=D[1],I="none";if(!a){for(var L=Math.max(10,M/5,R/5),z=[],j=0;j<=L;++j){var X=2*Math.PI/L*j;z.push([M+(M-A)*Math.cos(X),R+(R-A)*Math.sin(X)])}z.push([M,-2]),z.push([-2,-2]),z.push([-2,2*R+2]),z.push([2*M+2,2*R+2]),z.push([2*M+2,-2]),z.push([M,-2]),I="polygon("+z.map((function(e){return e[0]+"px "+e[1]+"px"})).join(", ")+")"}F.push(t.createElement("div",{key:"clipEllipse",className:te("clip-ellipse","snap-control"),style:{width:2*M+"px",height:2*R+"px",clipPath:I,transform:"translate("+(-p+P)+"px, "+(-h+k)+"px) "+fe(f)}}))}if(a){var G=ve(K([v,B,m,b],x)),V=G.width,Y=G.height,W=G.left,J=G.top;if(H||S||O){z=O?x.slice(0,8):x;F.push(t.createElement("div",{key:"clipArea",className:te("clip-area","snap-control"),style:{width:V+"px",height:Y+"px",transform:"translate("+W+"px, "+J+"px)",clipPath:"polygon("+z.map((function(e){return e[0]-W+"px "+(e[1]-J)+"px"})).join(", ")+")"}}))}}return E&&["vertical","horizontal"].forEach((function(e){var n=E[e],r="horizontal"===e;n.isSnap&&U.push.apply(U,n.snap.posInfos.map((function(n,i){var o=n.pos,a=g(he(f,r?[0,o]:[o,0],C),[p,h]),s=g(he(f,r?[u,o]:[o,c],C),[p,h]);return Hn(t,"",a,s,A,"clip"+e+"snap"+i,"guideline")}))),n.isBound&&U.push.apply(U,n.bounds.map((function(n,i){var o=n.pos,a=g(he(f,r?[0,o]:[o,0],C),[p,h]),s=g(he(f,r?[u,o]:[o,c],C),[p,h]);return Hn(t,"",a,s,A,"clip"+e+"bounds"+i,"guideline","bounds","bold")})))})),K(F,U)},dragControlCondition:function(e,t){return t.inputEvent&&(t.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(e,t){var n=e.props.dragWithClip;return!(void 0===n||n)&&this.dragControlStart(e,t)},drag:function(e,t){return this.dragControl(e,t)},dragEnd:function(e,t){return this.dragControlEnd(e,t)},dragControlStart:function(e,t){var n=e.state,r=e.props,i=r.defaultClipPath,o=r.customClipPath,a=n.target,A=n.width,s=n.height,l=t.inputEvent?t.inputEvent.target:null,u=l?l.getAttribute("class"):"",c=t.datas,f=Br(a,A,s,i||"inset",o);if(!f)return!1;var d=f.clipText;return!1===Re(e,"onClipStart",_e(e,t,{clipType:f.type,clipStyle:d,poses:f.poses.map((function(e){return e.pos}))}))?(c.isClipStart=!1,!1):(c.isControl=u.indexOf("clip-control")>-1,c.isLine=u.indexOf("clip-line")>-1,c.isArea=u.indexOf("clip-area")>-1||u.indexOf("clip-ellipse")>-1,c.index=l?parseInt(l.getAttribute("data-clip-index"),10):-1,c.clipPath=f,c.isClipStart=!0,n.clipPathState=d,at(e,t),!0)},dragControl:function(e,t){var n=t.datas,r=t.originalDatas;if(!n.isClipStart)return!1;var i=r&&r.draggable||{},a=n,A=a.isControl,s=a.isLine,l=a.isArea,u=a.index,c=a.clipPath;if(!c)return!1;var f=i.isDrag?i.prevDist:ft(t),d=f[0],p=f[1],g=e.props,v=e.state,B=v.width,m=v.height,b=!l&&!A&&!s,w=c.type,E=c.poses,y=c.splitter,C=E.map((function(e){return e.pos}));b&&(d=-d,p=-p);var Q=!A||"nesw"===E[u].direction,x="inset"===w||"rect"===w,F=E.map((function(){return[0,0]}));if(A&&!Q){var U=E[u],S=U.horizontal,O=U.vertical,H=[d*Math.abs(S),p*Math.abs(O)];F=function(e,t,n,r){var i=e[t],o=i.direction,a=i.sub,A=e.map((function(){return[0,0]})),s=o?o.split(""):[];if(r&&t<8){var l=s.filter((function(e){return"w"===e||"e"===e}))[0],u=s.filter((function(e){return"n"===e||"s"===e}))[0];A[t]=n,e.forEach((function(e,t){var r=e.direction;r&&(r.indexOf(l)>-1&&(A[t][0]=n[0]),r.indexOf(u)>-1&&(A[t][1]=n[1]))})),l&&(A[1][0]=n[0]/2,A[5][0]=n[0]/2),u&&(A[3][1]=n[1]/2,A[7][1]=n[1]/2)}else o&&!a?s.forEach((function(t){var r="n"===t||"s"===t;e.forEach((function(e,i){var o=e.direction,a=e.horizontal,s=e.vertical;o&&-1!==o.indexOf(t)&&(A[i]=[r||!a?0:n[0],r&&s?n[1]:0])}))})):A[t]=n;return A}(E,u,H,x)}else Q&&(F=C.map((function(){return[d,p]})));var T=C.map((function(e,t){return h(e,F[t])})),N=K(T);v.snapBoundInfos=null;var _="circle"===c.type,M="ellipse"===c.type;if(_||M){var R=ve(T),D=Math.abs(R.bottom-R.top),P=Math.abs(M?R.right-R.left:D),k=T[0][1]+D,I=T[0][0]-P,L=T[0][0]+P;_&&(N.push([L,R.bottom]),F.push([1,0])),N.push([R.left,k]),F.push([0,1]),N.push([I,R.bottom]),F.push([1,0])}var z=St((g.clipHorizontalGuidelines||[]).map((function(e){return Object(o.w)(""+e,m)})),(g.clipVerticalGuidelines||[]).map((function(e){return Object(o.w)(""+e,B)})),B,m),j=[],X=[];if(_||M)j=[N[4][0],N[2][0]],X=[N[1][1],N[3][1]];else if(x){var G=[N[0],N[2],N[4],N[6]],V=[F[0],F[2],F[4],F[6]];j=G.filter((function(e,t){return V[t][0]})).map((function(e){return e[0]})),X=G.filter((function(e,t){return V[t][1]})).map((function(e){return e[1]}))}else j=N.filter((function(e,t){return F[t][0]})).map((function(e){return e[0]})),X=N.filter((function(e,t){return F[t][1]})).map((function(e){return e[1]}));for(var Y=function(e){var t=Bn(z,g.clipTargetBounds&&{left:0,top:0,right:B,bottom:m},j,X,{snapThreshold:5}),n=t.horizontal,r=t.vertical,i=n.offset,o=r.offset;if(!M&&!_||0!==F[0][0]||0!==F[0][1])return N.forEach((function(e,t){var n=F[t];n[0]&&(e[0]-=o),n[1]&&(e[1]-=i)})),"break";var a=ve(T),A=a.bottom-a.top,s=M?a.right-a.left:A;s-=r.isBound?Math.abs(o):0===r.snapIndex?-o:o,A-=n.isBound?Math.abs(i):0===n.snapIndex?-i:i,_&&(s=A=Pt(r,n)>0?A:s);var l=N[0];N[1][1]=l[1]-A,N[2][0]=l[0]+s,N[3][1]=l[1]+A,N[4][0]=l[0]-s},W=0;W<2;++W){if("break"===Y())break}var J=gr(e,c,T),q=w+"("+J.join(y)+")";if(v.clipPathState=q,_||M)j=[N[4][0],N[2][0]],X=[N[1][1],N[3][1]];else if(x){G=[N[0],N[2],N[4],N[6]];j=G.map((function(e){return e[0]})),X=G.map((function(e){return e[1]}))}else j=N.map((function(e){return e[0]})),X=N.map((function(e){return e[1]}));return v.snapBoundInfos=Bn(z,g.clipTargetBounds&&{left:0,top:0,right:B,bottom:m},j,X,{snapThreshold:1}),Re(e,"onClip",_e(e,t,{clipEventType:"changed",clipType:w,poses:T,clipStyle:q,clipStyles:J,distX:d,distY:p})),!0},dragControlEnd:function(e,t){this.unset(e);var n=t.isDrag,r=t.datas,i=t.isDouble,o=r.isLine,a=r.isClipStart,A=r.isControl;return!!a&&(Re(e,"onClipEnd",Me(e,t,{})),i&&(A?function(e,t){var n=t.datas,r=n.clipPath,i=n.index,o=r,a=o.type,A=o.poses,s=o.splitter,l=A.map((function(e){return e.pos})),u=l.length;if("polygon"===a)A.splice(i,1),l.splice(i,1);else{if("inset"!==a)return;if(i<8)return;if(cr(A,l,i,8,u),u===A.length)return}var c=gr(e,r,l);Re(e,"onClip",_e(e,t,{clipEventType:"removed",clipType:a,poses:l,clipStyles:c,clipStyle:a+"("+c.join(s)+")",distX:0,distY:0}))}(e,t):o&&function(e,t){var n=ot(e,t),r=n[0],i=n[1],o=t.datas,a=o.clipPath,A=o.index,s=a,l=s.type,u=s.poses,c=s.splitter,f=u.map((function(e){return e.pos}));if("polygon"===l)f.splice(A,0,[r,i]);else{if("inset"!==l)return;var d=ir.indexOf(A),p=or.indexOf(A),h=u.length;if(fr(u,f,8,d,p,r,i,f[4][0],f[4][1],f[0][0],f[0][1]),h===u.length)return}var g=gr(e,a,f);Re(e,"onClip",_e(e,t,{clipEventType:"added",clipType:l,poses:f,clipStyles:g,clipStyle:l+"("+g.join(c)+")",distX:0,distY:0}))}(e,t)),i||n)},unset:function(e){e.state.clipPathState="",e.state.snapBoundInfos=null}},br={name:"originDraggable",props:{originDraggable:Boolean,originRelative:Boolean},events:{onDragOriginStart:"dragOriginStart",onDragOrigin:"dragOrigin",onDragOriginEnd:"dragOriginEnd"},css:[":host[data-able-origindraggable] .control.origin {\n pointer-events: auto;\n}"],dragControlCondition:function(e,t){return t.isRequest?"originDraggable"===t.requestAble:Object(o.G)(t.inputEvent.target,te("origin"))},dragControlStart:function(e,t){var n=t.datas;at(e,t);var r=_e(e,t,{dragStart:Sn.dragStart(e,(new tt).dragStart([0,0],t))}),i=Re(e,"onDragOriginStart",r);return n.startOrigin=e.state.transformOrigin,n.startTargetOrigin=e.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,!1===i?(n.isDragOrigin=!1,!1):r},dragControl:function(e,t){var n=t.datas,r=t.isPinch,i=t.isRequest;if(!n.isDragOrigin)return!1;var o=ft(t),a=o[0],A=o[1],s=e.state,l=s.width,u=s.height,c=s.offsetMatrix,f=s.targetMatrix,d=s.is3d,p=e.props.originRelative,v=void 0===p||p,B=d?4:3,m=[a,A];if(i){var b=t.distOrigin;(b[0]||b[1])&&(m=b)}var w=h(n.startOrigin,m),E=h(n.startTargetOrigin,m),y=g(m,n.prevOrigin),C=gt(c,f,w,B),Q=e.getRect(),x=ve(ge(C,l,u,B)),F=[Q.left-x.left,Q.top-x.top];n.prevOrigin=m;var U=_e(e,t,{width:l,height:u,origin:w,dist:m,delta:y,transformOrigin:[Ge(E[0],l,v),Ge(E[1],u,v)].join(" "),drag:Sn.drag(e,et(t,e.state,F,!!r,!1))});return Re(e,"onDragOrigin",U),U},dragControlEnd:function(e,t){return!!t.datas.isDragOrigin&&(Re(e,"onDragOriginEnd",Me(e,t,{})),!0)},dragGroupControlCondition:function(e,t){return this.dragControlCondition(e,t)},dragGroupControlStart:function(e,t){return!!this.dragControlStart(e,t)},dragGroupControl:function(e,t){var n=this.dragControl(e,t);return!!n&&(e.transformOrigin=n.transformOrigin,!0)},request:function(e){var t={},n=e.getRect(),r=0,i=0,o=n.transformOrigin,a=[0,0];return{isControl:!0,requestStart:function(){return{datas:t}},request:function(e){return"deltaOrigin"in e?(a[0]+=e.deltaOrigin[0],a[1]+=e.deltaOrigin[1]):"origin"in e?(a[0]=e.origin[0]-o[0],a[1]=e.origin[1]-o[1]):("x"in e?r=e.x-n.left:"deltaX"in e&&(r+=e.deltaX),"y"in e?i=e.y-n.top:"deltaY"in e&&(i+=e.deltaY)),{datas:t,distX:r,distY:i,distOrigin:a}},requestEnd:function(){return{datas:t,isDrag:!0}}}}};function wr(e,t,n,r,i){var a;void 0===r&&(r=[0,0]);if(i)a=i;else{var A=window.getComputedStyle(e);a=A&&A.borderRadius||""}return ur(!a||!i&&"0px"===a?[]:Object(o.U)(a),t,n,0,0,r)}function Er(e,t,n,r,i,o){var a=e.state,A=a.width,s=a.height,l=sr(o,i,e.props.roundRelative,A,s),u=l.raws,c=l.styles,f=dr(i,u),d=f.horizontals,p=f.verticals,h=c.join(" ");a.borderRadiusState=h,Re(e,"onRound",_e(e,t,{horizontals:d,verticals:p,borderRadius:h,width:A,height:s,delta:r,dist:n}))}var yr={name:"roundable",props:{roundable:Boolean,roundRelative:Boolean,minRoundControls:Array,maxRoundControls:Array,roundClickable:Boolean},events:{onRoundStart:"roundStart",onRound:"round",onRoundEnd:"roundEnd"},css:[".control.border-radius {\n background: #d66;\n cursor: pointer;\n}",":host[data-able-roundable] .line.direction {\n cursor: pointer;\n}"],render:function(e,t){var n=e.state,r=n.target,i=n.width,o=n.height,a=n.allMatrix,A=n.is3d,s=n.left,l=n.top,u=n.borderRadiusState,c=e.props,f=c.minRoundControls,d=void 0===f?[0,0]:f,p=c.maxRoundControls,h=void 0===p?[4,4]:p,v=c.zoom;if(!r)return null;var B=A?4:3,m=wr(r,i,o,d,u);if(!m)return null;var b=0,w=0;return m.map((function(e,n){w+=Math.abs(e.horizontal),b+=Math.abs(e.vertical);var r=g(he(a,e.pos,B),[s,l]),i=e.vertical?b<=h[1]:w<=h[0];return t.createElement("div",{key:"borderRadiusControl"+n,className:te("control","border-radius"),"data-radius-index":n,style:{display:i?"block":"none",transform:"translate("+r[0]+"px, "+r[1]+"px) scale("+v+")"}})}))},dragControlCondition:function(e,t){if(!t.inputEvent||t.isRequest)return!1;var n=t.inputEvent.target.getAttribute("class")||"";return n.indexOf("border-radius")>-1||n.indexOf("moveable-line")>-1&&n.indexOf("moveable-direction")>-1},dragControlStart:function(e,t){var n=t.inputEvent,r=t.datas,i=n.target,o=i.getAttribute("class")||"",a=o.indexOf("border-radius")>-1,A=o.indexOf("moveable-line")>-1&&o.indexOf("moveable-direction")>-1,s=a?parseInt(i.getAttribute("data-radius-index"),10):-1,l=A?parseInt(i.getAttribute("data-line-index"),10):-1;if(!a&&!A)return!1;if(!1===Re(e,"onRoundStart",_e(e,t,{})))return!1;r.lineIndex=l,r.controlIndex=s,r.isControl=a,r.isLine=A,at(e,t);var u=e.props,c=u.roundRelative,f=u.minRoundControls,d=void 0===f?[0,0]:f,p=e.state,h=p.target,g=p.width,v=p.height;r.isRound=!0,r.prevDist=[0,0];var B=wr(h,g,v,d)||[];return r.controlPoses=B,p.borderRadiusState=sr(B.map((function(e){return e.pos})),B,c,g,v).styles.join(" "),!0},dragControl:function(e,t){var n=t.datas;if(!n.isRound||!n.isControl||!n.controlPoses.length)return!1;var r=n.controlIndex,i=n.controlPoses,o=ft(t),a=o[0],A=o[1],s=[a,A],l=g(s,n.prevDist),u=e.props.maxRoundControls,c=void 0===u?[4,4]:u,f=e.state,d=f.width,p=f.height,v=i[r],B=v.vertical,m=v.horizontal,b=i.map((function(e){var t=e.horizontal,n=e.vertical,r=[t*m*s[0],n*B*s[1]];if(t){if(1===c[0])return r;if(c[0]<4&&t!==m)return r}else{if(0===c[1])return r[1]=n*m*s[0]/d*p,r;if(B){if(1===c[1])return r;if(c[1]<4&&n!==B)return r}}return[0,0]}));b[r]=s;var w=i.map((function(e,t){return h(e.pos,b[t])}));return n.prevDist=[a,A],Er(e,t,s,l,i,w),!0},dragControlEnd:function(e,t){var n=e.state;n.borderRadiusState="";var r=t.datas,i=t.isDouble;if(!r.isRound)return!1;var o=n.width,a=n.height,A=r.isControl,s=r.controlIndex,l=r.isLine,u=r.lineIndex,c=r.controlPoses,f=c.map((function(e){return e.pos})),d=f.length,p=e.props.roundClickable;if(i&&(void 0===p||p)){if(A)cr(c,f,s,0);else if(l){var h=ot(e,t);!function(e,t,n,r,i,o,a){var A=dr(e),s=A.horizontals,l=A.verticals,u=s.length,c=l.length,f=-1,d=-1;0===n?0===u?f=0:1===u&&(f=1):3===n&&(u<=2?f=2:u<=3&&(f=3)),2===n?0===c?d=0:c<4&&(d=3):1===n&&(c<=1?d=1:c<=2&&(d=2)),fr(e,t,0,f,d,r,i,o,a)}(c,f,u,h[0],h[1],o,a)}d!==c.length&&Er(e,t,[0,0],[0,0],c,f)}return Re(e,"onRoundEnd",Me(e,t,{})),n.borderRadiusState="",!0},unset:function(e){e.state.borderRadiusState=""}},Cr={isPinch:!0,name:"beforeRenderable",props:{},events:{onBeforeRenderStart:"beforeRenderStart",onBeforeRender:"beforeRender",onBeforeRenderEnd:"beforeRenderEnd",onBeforeRenderGroupStart:"beforeRenderGroupStart",onBeforeRenderGroup:"beforeRenderGroup",onBeforeRenderGroupEnd:"beforeRenderGroupEnd"},setTransform:function(e,t){var n=e.state,r=n.is3d,i=n.targetMatrix,o=r?"matrix3d("+i.join(",")+")":"matrix("+v(i,!0)+")";t.datas.startTransforms=[o]},resetTransform:function(e,t){t.datas.nextTransforms=t.datas.startTransforms,t.datas.nextTransformAppendedIndexes=[]},fillDragStartParams:function(e,t){return _e(e,t,{setTransform:function(e){t.datas.startTransforms=Object(o.H)(e)?e:Object(o.U)(e)},isPinch:!!t.isPinch})},fillDragParams:function(e,t){return _e(e,t,{isPinch:!!t.isPinch})},dragStart:function(e,t){this.setTransform(e,t),Re(e,"onBeforeRenderStart",this.fillDragStartParams(e,t))},drag:function(e,t){this.resetTransform(e,t),Re(e,"onBeforeRender",_e(e,t,{isPinch:!!t.isPinch}))},dragEnd:function(e,t){Re(e,"onBeforeRenderEnd",_e(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag}))},dragGroupStart:function(e,t){var n=this;this.dragStart(e,t);var r=nt(e,"beforeRenderable",t),i=e.moveables,o=r.map((function(e,t){var r=i[t];return n.setTransform(r,e),n.fillDragStartParams(r,e)}));Re(e,"onBeforeRenderGroupStart",_e(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,setTransform:function(){},events:o}))},dragGroup:function(e,t){var n=this;this.drag(e,t);var r=nt(e,"beforeRenderable",t),i=e.moveables,o=r.map((function(e,t){var r=i[t];return n.resetTransform(r,e),n.fillDragParams(r,e)}));Re(e,"onBeforeRenderGroup",_e(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,events:o}))},dragGroupEnd:function(e,t){this.dragEnd(e,t),Re(e,"onBeforeRenderGroupEnd",_e(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)}},Qr={name:"renderable",props:{},events:{onRenderStart:"renderStart",onRender:"render",onRenderEnd:"renderEnd",onRenderGroupStart:"renderGroupStart",onRenderGroup:"renderGroup",onRenderGroupEnd:"renderGroupEnd"},dragStart:function(e,t){Re(e,"onRenderStart",_e(e,t,{isPinch:!!t.isPinch}))},drag:function(e,t){Re(e,"onRender",_e(e,t,{isPinch:!!t.isPinch}))},dragEnd:function(e,t){Re(e,"onRenderEnd",_e(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag}))},dragGroupStart:function(e,t){Re(e,"onRenderGroupStart",_e(e,t,{isPinch:!!t.isPinch,targets:e.props.targets}))},dragGroup:function(e,t){Re(e,"onRenderGroup",_e(e,t,{isPinch:!!t.isPinch,targets:e.props.targets}))},dragGroupEnd:function(e,t){Re(e,"onRenderGroupEnd",_e(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)}};function xr(e,t,n,r,i,o,a){var A="Start"===i,s=e.state.target,l=o.isRequest;if(!s||A&&r.indexOf("Control")>-1&&!l&&e.areaElement===o.inputEvent.target)return!1;var u=""+n+r+i,c=""+n+r+"Condition",f="End"===i,d=i.indexOf("After")>-1,p=A&&(!e.targetGesto||!e.controlGesto||!e.targetGesto.isFlag()||!e.controlGesto.isFlag());p&&e.updateRect(i,!0,!1),""!==i||d||l||je(e.state,o);var h=K([Cr],e[t].slice(),[Qr]);if(l){var g=o.requestAble;h.some((function(e){return e.name===g}))||h.push.apply(h,e.props.ables.filter((function(e){return e.name===g})))}if(!h.length)return!1;var v=h.filter((function(e){return e[u]})),B=o.datas;p&&v.forEach((function(t){t.unset&&t.unset(e)}));var m,b=o.inputEvent;f&&b&&(m=document.elementFromPoint(o.clientX,o.clientY)||b.target);var w=v.filter((function(t){var n=t.name,r=B[n]||(B[n]={});return A&&(r.isEventStart=!t[c]||t[c](e,o)),!!r.isEventStart&&t[u](e,I(I({},o),{datas:r,originalDatas:B,inputTarget:m}))})).length,E=A&&v.length&&!w;return(f||E)&&(e.state.gesto=null,e.moveables&&e.moveables.forEach((function(e){e.state.gesto=null}))),p&&E&&v.forEach((function(t){t.unset&&t.unset(e)})),!e.isUnmounted&&!E&&((!A&&w&&!a||f)&&(e.updateRect(i,!0,!1),e.forceUpdate()),A||f||d||!w||a||xr(e,t,n,r,i+"After",o),!0)}function Fr(e,t,n){var r=e.controlBox.getElement(),i=[];i.push(r),e.props.dragArea&&!e.props.dragTarget||i.push(t);var a=function(t){var n=t.inputEvent.target;return n===e.areaElement||!e.isMoveableElement(n)||Object(o.G)(n,"moveable-area")||Object(o.G)(n,"moveable-padding")};return Ur(e,i,"targetAbles",n,{dragStart:a,pinchStart:a})}function Ur(e,t,n,r,i){void 0===i&&(i={});var o=e.props,a=o.pinchOutside,A=o.pinchThreshold,s={container:window,pinchThreshold:A,pinchOutside:a},l=new R.a(t,s);return["drag","pinch"].forEach((function(t){["Start","","End"].forEach((function(o){l.on(""+t+o,(function(a){var A=a.eventType;!i[A]||i[A](a)?xr(e,n,t,r,o,a)||a.stop():a.stop()}))}))})),l}var Sr=function(){function e(e,t,n){var r=this;this.target=e,this.moveable=t,this.eventName=n,this.ables=[],this.onEvent=function(e){var t=r.eventName,n=r.moveable;r.ables.forEach((function(r){r[t]({inputEvent:e},n)}))},this.target.addEventListener(this.eventName.toLowerCase(),this.onEvent)}var t=e.prototype;return t.setAbles=function(e){this.ables=e},t.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this.onEvent),this.target=null,this.moveable=null},e}(),Or=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state=I({container:null,target:null,gesto:null,renderPoses:[[0,0],[0,0],[0,0],[0,0]]},xe(null)),t.enabledAbles=[],t.targetAbles=[],t.controlAbles=[],t.rotation=0,t.scale=[1,1],t.isUnmounted=!1,t.events={mouseEnter:null,mouseLeave:null},t}k(t,e);var n=t.prototype;return n.render=function(){var e=this.props,t=this.state,n=e.edge,r=e.parentPosition,o=e.className,a=e.target,A=e.zoom,s=e.cspNonce,l=e.translateZ,u=e.cssStyled,c=e.portalContainer;this.checkUpdate(),this.updateRenderPoses();var f=r||{left:0,top:0},d=f.left,p=f.top,h=t.left,g=t.top,v=t.target,B=t.direction,m=t.renderPoses,b=e.targets,w=(b&&b.length||a)&&v,E=this.isDragging(),y={},C={createElement:M.createElement};return this.getEnabledAbles().forEach((function(e){y["data-able-"+e.name.toLowerCase()]=!0})),Object(M.createElement)(u,I({cspNonce:s,ref:Object(i.c)(this,"controlBox"),className:te("control-box",-1===B?"reverse":"",E?"dragging":"")+" "+o},y,{portalContainer:c,style:{position:"absolute",display:w?"block":"none",transform:"translate3d("+(h-d)+"px, "+(g-p)+"px, "+l+")","--zoom":A,"--zoompx":A+"px"}}),this.renderAbles(),Hn(C,n?"n":"",m[0],m[1],A,0),Hn(C,n?"e":"",m[1],m[3],A,1),Hn(C,n?"w":"",m[0],m[2],A,2),Hn(C,n?"s":"",m[2],m[3],A,3))},n.componentDidMount=function(){this.controlBox.getElement();var e=this.props,t=e.parentMoveable,n=e.container,r=e.wrapperMoveable;this.updateEvent(e),this.updateNativeEvents(e),n||t||r||this.updateRect("",!1,!0),this.updateCheckInput()},n.componentDidUpdate=function(e){this.updateNativeEvents(e),this.updateEvent(e),this.updateCheckInput()},n.componentWillUnmount=function(){this.isUnmounted=!0,Ne(this,"targetGesto"),Ne(this,"controlGesto");var e=this.events;for(var t in e){var n=e[t];n&&n.destroy()}},n.getContainer=function(){var e=this.props,t=e.parentMoveable,n=e.wrapperMoveable;return e.container||n&&n.getContainer()||t&&t.getContainer()||this.controlBox.getElement().parentElement},n.isMoveableElement=function(e){return e&&(e.getAttribute("class")||"").indexOf(G)>-1},n.dragStart=function(e){return this.targetGesto&&this.targetGesto.triggerDragStart(e),this},n.hitTest=function(e){var t,n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,A=n.pos4,s=n.targetClientRect;if(!r)return 0;if(e instanceof Element){var l=e.getBoundingClientRect();t={left:l.left,top:l.top,width:l.width,height:l.height}}else t=I({width:0,height:0},e);var u=t.left,c=t.top,f=t.width,d=t.height,p=Object(S.a)([i,o,A,a],s),h=Object(S.e)(p,[[u,c],[u+f,c],[u+f,c+d],[u,c+d]]),g=Object(S.b)(p);return h&&g?Math.min(100,h/g*100):0},n.isInside=function(e,t){var n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,A=n.pos4,s=n.targetClientRect;return!!r&&Object(S.f)([e,t],Object(S.a)([i,o,A,a],s))},n.updateRect=function(e,t,n){void 0===n&&(n=!0);var r=this.props,i=r.parentMoveable,o=this.state.target||this.props.target,a=this.getContainer(),A=i?i.props.rootContainer:r.rootContainer;this.updateState(xe(this.controlBox&&this.controlBox.getElement(),o,a,a,A||a),!i&&n)},n.isTargetChanged=function(e,t){var n=this.props,r=n.dragTarget||n.target,i=e.dragTarget||e.target,o=n.dragArea,a=e.dragArea;return!o&&i!==r||(t||o)&&a!==o},n.updateNativeEvents=function(e){var t=this,n=this.props.dragArea?this.areaElement:this.state.target,r=this.events,i=Object(o.D)(r);if(this.isTargetChanged(e))for(var a in r){var A=r[a];A&&A.destroy(),r[a]=null}if(n){var s=this.enabledAbles;i.forEach((function(e){var i=Pe(s,[e]),o=i.length>0,a=r[e];o?(a||(a=new Sr(n,t,e),r[e]=a),a.setAbles(i)):a&&(a.destroy(),r[e]=null)}))}},n.updateEvent=function(e){var t=this.controlBox.getElement(),n=this.targetAbles.length,r=this.controlAbles.length,i=this.props,o=i.dragTarget||i.target,a=this.isTargetChanged(e,!0),A=!n&&this.targetGesto||a;A&&(Ne(this,"targetGesto"),this.updateState({gesto:null})),r||Ne(this,"controlGesto"),o&&n&&!this.targetGesto&&(this.targetGesto=Fr(this,o,"")),!this.controlGesto&&r&&(this.controlGesto=Ur(this,t,"controlAbles","Control")),A&&this.unsetAbles()},n.isDragging=function(){return!!this.targetGesto&&this.targetGesto.isFlag()||!!this.controlGesto&&this.controlGesto.isFlag()},n.updateTarget=function(e){this.updateRect(e,!0)},n.getRect=function(){var e=this.state,t=Oe(this.state),n=t[0],r=t[1],i=t[2],o=t[3],a=ve(t),A=e.width,s=e.height,l=a.width,u=a.height,c=a.left,f=a.top,d=[e.left,e.top],p=h(d,e.origin);return{width:l,height:u,left:c,top:f,pos1:n,pos2:r,pos3:i,pos4:o,offsetWidth:A,offsetHeight:s,beforeOrigin:h(d,e.beforeOrigin),origin:p,transformOrigin:e.transformOrigin,rotation:this.getRotation()}},n.getManager=function(){return this},n.getRotation=function(){var e=this.state;return function(e,t,n){var r=Object(o.E)(e,t)/Math.PI*180;return r=(r=n>=0?r:180-r)>=0?r:360+r}(e.pos1,e.pos2,e.direction)},n.request=function(e,t,n){void 0===t&&(t={});var r=this.props,i=r.ables,o=r.groupable,a=i.filter((function(t){return t.name===e}))[0];if(this.isDragging()||!a||!a.request)return{request:function(){return this},requestEnd:function(){return this}};var A=this,s=a.request(this),l=n||t.isInstant,u=s.isControl?"controlAbles":"targetAbles",c=(o?"Group":"")+(s.isControl?"Control":""),f={request:function(t){return xr(A,u,"drag",c,"",I(I({},s.request(t)),{requestAble:e,isRequest:!0}),l),this},requestEnd:function(){return xr(A,u,"drag",c,"End",I(I({},s.requestEnd()),{requestAble:e,isRequest:!0}),l),this}};return xr(A,u,"drag",c,"Start",I(I({},s.requestStart(t)),{requestAble:e,isRequest:!0}),l),l?f.request(t).requestEnd():f},n.destroy=function(){this.componentWillUnmount()},n.updateRenderPoses=function(){var e=this.state,t=this.props,n=e.originalBeforeOrigin,r=e.transformOrigin,i=e.allMatrix,o=e.is3d,a=e.pos1,A=e.pos2,s=e.pos3,l=e.pos4,u=e.left,c=e.top,f=t.padding||{},d=f.left,p=void 0===d?0:d,g=f.top,v=void 0===g?0:g,B=f.bottom,m=void 0===B?0:B,b=f.right,w=void 0===b?0:b,E=o?4:3,y=t.groupable?n:h(n,[u,c]);e.renderPoses=[h(a,Xe(i,[-p,-v],r,y,E)),h(A,Xe(i,[w,-v],r,y,E)),h(s,Xe(i,[-p,m],r,y,E)),h(l,Xe(i,[w,m],r,y,E))]},n.checkUpdate=function(){var e=this.props,t=e.target,n=e.container,r=e.parentMoveable,i=this.state,o=i.target,a=i.container;(o||t)&&(this.updateAbles(),(!ke(o,t)||!ke(a,n))&&(this.updateState({target:t,container:n}),r||!n&&!this.controlBox||this.updateRect("End",!1,!1)))},n.triggerEvent=function(e,t){var n=this.props[e];return n&&n(t)},n.useCSS=function(e,t){var n=this.props.customStyledMap,r=e+t;return n[r]||(n[r]=Object(D.a)(e,t)),n[r]},n.unsetAbles=function(){var e=this;this.targetAbles.filter((function(t){return!!t.unset&&(t.unset(e),!0)})).length&&this.forceUpdate()},n.updateAbles=function(e,t){void 0===e&&(e=this.props.ables),void 0===t&&(t="");var n=this.props,r=n.triggerAblesSimultaneously,i=e.filter((function(e){return e&&(e.always||n[e.name])})),o="drag"+t+"ControlStart",a=Pe(i,["drag"+t+"Start","pinch"+t+"Start"],r),A=Pe(i,[o],r);this.enabledAbles=i,this.targetAbles=a,this.controlAbles=A},n.updateState=function(e,t){if(t)this.setState(e);else{var n=this.state;for(var r in e)n[r]=e[r]}},n.getEnabledAbles=function(){var e=this.props;return e.ables.filter((function(t){return t&&e[t.name]}))},n.renderAbles=function(){var e=this,t=this.props.triggerAblesSimultaneously,n={createElement:M.createElement};return function(e,t){var n=[],r={};return e.forEach((function(i,o){var a=t(i,o,e),A=r[a];A||(A=[],r[a]=A,n.push(A)),A.push(i)})),n}(Ke(Pe(this.getEnabledAbles(),["render"],t).map((function(t){return(0,t.render)(e,n)||[]}))).filter((function(e){return e})),(function(e){return e.key})).map((function(e){return e[0]}))},n.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},t.defaultProps={target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,edge:!1,parentMoveable:null,wrapperMoveable:null,parentPosition:null,portalContainer:null,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,groupable:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{}},t}(M.PureComponent),Hr={name:"groupable",props:{defaultGroupRotate:Number,defaultGroupOrigin:String,groupable:Boolean},events:{},render:function(e,t){var n=e.props.targets||[];e.moveables=[];var r=e.state,o={left:r.left,top:r.top};return n.map((function(n,r){return t.createElement(Or,{key:"moveable"+r,ref:Object(i.d)(e,"moveables",r),target:n,origin:!1,cssStyled:e.props.cssStyled,customStyledMap:e.props.customStyledMap,parentMoveable:e,parentPosition:o})}))}},Tr=L("clickable",{props:{},events:{onClick:"click",onClickGroup:"clickGroup"},always:!0,dragStart:function(){},dragGroupStart:function(e,t){t.datas.inputTarget=t.inputEvent&&t.inputEvent.target},dragEnd:function(e,t){var n=e.state.target,r=t.inputEvent,i=t.inputTarget;if(r&&i&&!t.isDrag&&!e.isMoveableElement(i)){var o=n.contains(i);Re(e,"onClick",_e(e,t,{isDouble:t.isDouble,inputTarget:i,isTarget:n===i,containsTarget:o}))}},dragGroupEnd:function(e,t){var n=t.inputEvent,r=t.inputTarget;if(n&&r&&!t.isDrag&&!e.isMoveableElement(r)&&t.datas.inputTarget!==r){var i=e.props.targets,a=i.indexOf(r),A=a>-1,s=!1;-1===a&&(s=(a=Object(o.A)(i,(function(e){return e.contains(r)})))>-1),Re(e,"onClickGroup",_e(e,t,{isDouble:t.isDouble,targets:i,inputTarget:r,targetIndex:a,isTarget:A,containsTarget:s}))}}});function Nr(e){var t=e.originalDatas.draggable;return t||(e.originalDatas.draggable={},t=e.originalDatas.draggable),I(I({},e),{datas:t})}var _r=L("edgeDraggable",{dragControlCondition:function(e,t){if(!e.props.edgeDraggable||!t.inputEvent)return!1;var n=t.inputEvent.target;return Object(o.G)(n,te("direction"))&&Object(o.G)(n,te("line"))},dragControlStart:function(e,t){return Sn.dragStart(e,Nr(t))},dragControl:function(e,t){return Sn.drag(e,Nr(t))},dragControlEnd:function(e,t){return Sn.dragEnd(e,Nr(t))},dragGroupControlCondition:function(e,t){if(!e.props.edgeDraggable||!t.inputEvent)return!1;var n=t.inputEvent.target;return Object(o.G)(n,te("direction"))&&Object(o.G)(n,te("line"))},dragGroupControlStart:function(e,t){return Sn.dragGroupStart(e,Nr(t))},dragGroupControl:function(e,t){return Sn.dragGroup(e,Nr(t))},dragGroupControlEnd:function(e,t){return Sn.dragGroupEnd(e,Nr(t))},unset:function(e){e.state.dragInfo=null}}),Mr={name:"individualGroupable",props:{individualGroupable:Boolean},events:{}},Rr=[Cr,er,Un,$e,Sn,_r,kn,In,Kn,jn,$n,tr,qn,br,mr,yr,Hr,Mr,Tr,Jn,Qr],Dr=Rr.reduce((function(e,t){return I(I({},e),"events"in t?t.events:{})}),{}),Pr=Rr.reduce((function(e,t){return I(I({},e),t.props)}),{}),kr=We(Dr);Object.keys(kr),Object.keys(Pr);function Ir(e,t){return Math.max.apply(Math,e.map((function(e){var n=e[0],r=e[1],i=e[2],o=e[3];return Math.max(n[t],r[t],i[t],o[t])})))}function Kr(e,t){return Math.min.apply(Math,e.map((function(e){var n=e[0],r=e[1],i=e[2],o=e[3];return Math.min(n[t],r[t],i[t],o[t])})))}var Lr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.differ=new O.a,t.moveables=[],t.transformOrigin="50% 50%",t}k(t,e);var n=t.prototype;return n.updateEvent=function(e){var t=this.state,n=this.props,r=e.dragTarget||t.target,i=n.dragTarget||this.areaElement;r!==i&&(Ne(this,"targetGesto"),Ne(this,"controlGesto"),t.target=null),t.target||(t.target=this.areaElement,this.controlBox.getElement().style.display="block",this.targetGesto=Fr(this,i,"Group"),this.controlGesto=Ur(this,this.controlBox.getElement(),"controlAbles","GroupControl"));var o=!ke(e.container,n.container);o&&(t.container=n.container);var a=this.differ.update(n.targets),A=a.added,s=a.changed,l=a.removed;(o||A.length||s.length||l.length)&&this.updateRect()},n.checkUpdate=function(){this.updateAbles()},n.updateRect=function(e,t,n){if(void 0===n&&(n=!0),this.controlBox){this.moveables.forEach((function(t){t.updateRect(e,!1,!1)}));var r=this.state,i=this.props,o=r.target||i.target;(!t||""!==e&&i.updateGroup)&&(this.rotation=i.defaultGroupRotate,this.transformOrigin=i.defaultGroupOrigin||"50% 50%",this.scale=[1,1]);var a=this.rotation,A=this.scale,s=function(e,t){if(!e.length)return[0,0,0,0];var n=e.map((function(e){return Oe(e.state)})),r=W,i=W,o=0,a=0,A=He(t,1e-7);if(A%90){var s=A/180*Math.PI,l=Math.tan(s),u=-1/l,c=[J,W],f=[J,W];n.forEach((function(e){e.forEach((function(e){var t=e[1]-l*e[0],n=e[1]-u*e[0];c[0]=Math.max(c[0],t),c[1]=Math.min(c[1],t),f[0]=Math.max(f[0],n),f[1]=Math.min(f[1],n)}))})),c.forEach((function(e){f.forEach((function(t){var n=(t-e)/(l-u),o=l*n+e;r=Math.min(r,n),i=Math.min(i,o)}))}));var d=n.map((function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return[m(t,-s),m(n,-s),m(r,-s),m(i,-s)]}));o=Ir(d,0)-Kr(d,0),a=Ir(d,1)-Kr(d,1)}else if(r=Kr(n,0),i=Kr(n,1),o=Ir(n,0)-r,a=Ir(n,1)-i,A%180){var p=o;o=a,a=p}return[r,i,o,a]}(this.moveables,a),l=s[0],u=s[1],c=s[2],f=s[3],d="rotate("+a+"deg) scale("+(A[0]>=0?1:-1)+", "+(A[1]>=0?1:-1)+")";o.style.cssText+="left:0px;top:0px; transform-origin: "+this.transformOrigin+"; width:"+c+"px; height:"+f+"px;transform:"+d,r.width=c,r.height=f;var p=this.getContainer(),v=xe(this.controlBox.getElement(),o,this.controlBox.getElement(),this.getContainer(),this.props.rootContainer||p),B=[v.left,v.top],b=Oe(v),w=b[0],E=b[1],y=b[2],C=b[3],Q=Object(S.c)([w,E,y,C]),x=[Q.minX,Q.minY];v.pos1=g(w,x),v.pos2=g(E,x),v.pos3=g(y,x),v.pos4=g(C,x),v.left=l-v.left+x[0],v.top=u-v.top+x[1],v.origin=g(h(B,v.origin),x),v.beforeOrigin=g(h(B,v.beforeOrigin),x),v.originalBeforeOrigin=h(B,v.originalBeforeOrigin);var F=v.targetClientRect,U=A[0]*A[1]>0?1:-1;F.top+=v.top-r.top,F.left+=v.left-r.left,o.style.transform="translate("+-x[0]+"px, "+-x[1]+"px) "+d,this.updateState(I(I({},v),{direction:U,beforeDirection:U}),n)}},n.getRect=function(){return I(I({},e.prototype.getRect.call(this)),{children:this.moveables.map((function(e){return e.getRect()}))})},n.triggerEvent=function(t,n,r){if(r||t.indexOf("Group")>-1)return e.prototype.triggerEvent.call(this,t,n)},n.updateAbles=function(){e.prototype.updateAbles.call(this,K(this.props.ables,[Hr]),"Group")},t.defaultProps=I(I({},Or.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),t}(Or),zr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.moveables=[],t}k(t,e);var n=t.prototype;return n.render=function(){var e=this,t=this.props,n=t.cspNonce,r=t.cssStyled,o=t.targets;return Object(M.createElement)(r,{cspNonce:n,ref:Object(i.c)(this,"controlBox"),className:te("control-box")},o.map((function(t,n){return Object(M.createElement)(Or,I({key:"moveable"+n,ref:Object(i.d)(e,"moveables",n)},e.props,{target:t,wrapperMoveable:e}))})))},n.componentDidUpdate=function(){},n.updateRect=function(e,t,n){void 0===n&&(n=!0),this.moveables.forEach((function(r){r.updateRect(e,t,n)}))},n.getRect=function(){return I(I({},e.prototype.getRect.call(this)),{children:this.moveables.map((function(e){return e.getRect()}))})},n.request=function(){return{request:function(){return this},requestEnd:function(){return this}}},n.dragStart=function(){return this},n.hitTest=function(){return 0},n.isInside=function(){return!1},n.isDragging=function(){return!1},n.updateRenderPoses=function(){},n.updateEvent=function(){},n.checkUpdate=function(){},n.triggerEvent=function(){},n.updateAbles=function(){},t}(Or),jr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.refTargets=[],t.selectorMap={},t}k(t,e);var n=t.prototype;return t.makeStyled=function(){var e={};this.getTotalAbles().forEach((function(t){var n=t.css;n&&n.forEach((function(t){e[t]=!0}))}));var t=Object(o.D)(e).join("\n");this.defaultStyled=Object(D.a)("div",Object(i.a)(G,V+t))},t.getTotalAbles=function(){return K([er,Hr,Mr,Jn],this.defaultAbles)},n.render=function(){var e=this.constructor;e.defaultStyled||e.makeStyled();var t=this.props,n=t.ables,r=t.props,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1,u=K(e.getTotalAbles(),n||[]),c=I(I(I({},a),r||{}),{ables:u,cssStyled:e.defaultStyled,customStyledMap:e.customStyledMap});return l?a.individualGroupable?Object(M.createElement)(zr,I({key:"individual-group",ref:Object(i.c)(this,"moveable")},c,{target:null,targets:s})):Object(M.createElement)(Lr,I({key:"group",ref:Object(i.c)(this,"moveable")},c,{target:null,targets:s})):Object(M.createElement)(Or,I({key:"single",ref:Object(i.c)(this,"moveable")},c,{target:s[0]}))},n.componentDidMount=function(){this.updateRefs()},n.componentDidUpdate=function(){this.updateRefs()},n.updateRefs=function(e){var t=qe(this.props.target||this.props.targets),n=this.refTargets.some((function(e,n){var r=t[n];return!(!e&&!r)&&e!==r})),r=e?{}:this.selectorMap,i={};this.refTargets.forEach((function(e){Object(o.L)(e)&&(r[e]?i[e]=r[e]:(n=!0,i[e]=[].slice.call(document.querySelectorAll(e))))})),this.selectorMap=i,n&&this.forceUpdate()},n.getManager=function(){return this.moveable},t.defaultAbles=[],t.customStyledMap={},t.defaultStyled=null,function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(i.e)(ee)],t.prototype,"moveable",void 0),t}(M.PureComponent),Xr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return k(t,e),t.defaultAbles=Rr,t}(jr);t.a=Xr},function(e,t,n){var r=n(67),i=n(63);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=e.length,r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function s(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=v.isContentEditable;if(m||b){if(c||g===v)return!1;if(g&&b&&g.isContentEditable&&g.contains(v))return!1}else if((u||"touchstart"===e.type)&&g){var w=g.tagName;(g.isContentEditable||p.indexOf(w)>-1)&&g.blur()}if(r.clientStores=[new d(s(e))],r.flag=!0,r.isDrag=!1,r.datas={},l&&(3===e.which||2===e.button))return r.initDrag(),!1;!1===r.emit("dragStart",a({datas:r.datas,inputEvent:e,isTrusted:t},r.getCurrentStore().getPosition()))&&r.initDrag(),r.isDouble=Object(i.N)()-r.prevTime<200,r.flag&&u&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(h&&f&&A&&(E=setTimeout((function(){Object(i.q)(o,"touchstart",r.onDragStart,{passive:!1})}))),!h&&f&&A&&Object(i.P)(o,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),h&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=s(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",a({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,o=t.container;r.isTouch&&n&&Object(i.P)(o,"touchstart",r.onDragStart),r.flag=!1;var A=r.getCurrentStore().getPosition(),s=Object(i.N)(),l=!r.isDrag&&r.isDouble;r.prevTime=r.isDrag||l?0:s,r.emit("dragEnd",a({datas:r.datas,isDouble:l,isDrag:r.isDrag,inputEvent:e},A)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var o=[].concat(t);r.options=a({checkInput:!1,container:o.length>1?window:o[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var A=r.options,l=A.container,u=A.events,c=A.checkWindowBlur;if(r.isTouch=u.indexOf("touch")>-1,r.isMouse=u.indexOf("mouse")>-1,r.targets=o,r.isMouse&&(o.forEach((function(e){Object(i.q)(e,"mousedown",r.onDragStart)})),Object(i.q)(l,"mousemove",r.onDrag),Object(i.q)(l,"mouseup",r.onDragEnd),Object(i.q)(l,"contextmenu",r.onDragEnd)),c&&Object(i.q)(window,"blur",r.onBlur),r.isTouch){var f={passive:!1};o.forEach((function(e){Object(i.q)(e,"touchstart",r.onDragStart,f)})),Object(i.q)(l,"touchmove",r.onDrag,f),Object(i.q)(l,"touchend",r.onDragEnd,f),Object(i.q)(l,"touchcancel",r.onDragEnd,f)}return r}!function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),Object(i.P)(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){Object(i.P)(t,"mousedown",e.onDragStart)})),Object(i.P)(n,"mousemove",this.onDrag),Object(i.P)(n,"mouseup",this.onDragEnd),Object(i.P)(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){Object(i.P)(t,"touchstart",e.onDragStart)})),Object(i.P)(n,"touchstart",this.onDragStart),Object(i.P)(n,"touchmove",this.onDrag),Object(i.P)(n,"touchend",this.onDragEnd),Object(i.P)(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new d(s(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",a({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",a({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",a({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,a({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(r.a);t.a=h},function(e,t,n){var r=n(80),i=n(84);e.exports=function(e,t){return e&&r(e,i(t))}},function(e,t,n){var r=n(136),i=n(22),o=Object.prototype,a=o.hasOwnProperty,A=o.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!A.call(e,"callee")};e.exports=s},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(79),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,A=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=A}).call(this,n(60)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(29),i=n(20);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(83)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(30)(n(21),"Map");e.exports=r},function(e,t,n){var r=n(158),i=n(165),o=n(167),a=n(168),A=n(169);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=-g&&b=h)){var F=0===Q?d?c:u:Q%2===0?10:7,U=d?[x,p?0:c-F]:[p?0:u-F,x],S=U[0],O=U[1],H=d?[S,O+F]:[S+F,O],T=H[0],N=H[1];f.moveTo(S,O),f.lineTo(T,N)}}}f.stroke(),f.restore()},t.defaultProps={type:"horizontal",zoom:1,width:0,height:0,unit:50,direction:"end",style:{width:"100%",height:"100%"},backgroundColor:"#333333",textColor:"#ffffff",lineColor:"#777777"},t}(r.PureComponent);function a(e){for(var t=[],n=1;n-1&&(a=c(o,t,i+1,r)),-1===a)break;i=a}return-1}function f(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,o=[],a=[],A=0;A-1)l=c(s,r,A+1,i);else if(s===t){a.length&&(o.push(a.join("")),a=[]);continue}}-1===l&&(l=i-1),a.push(r.slice(A,l+1).join("")),A=l}return a.length&&o.push(a.join("")),o}function d(e){return f(e,",")}function p(e){var t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!t||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]}}function h(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var n=t[1],r=t[2];return{prefix:n,unit:t[3],value:parseFloat(r)}}function g(){return Date.now?Date.now():(new Date).getTime()}function v(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function B(e,t){if(e.classList)e.classList.remove(t);else{var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}function m(e,t,n,r){e.addEventListener(t,n,r)}function b(e,t,n){e.removeEventListener(t,n)}var w=function(e,t){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var E=function(){return(E=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function C(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,h=f.isContentEditable;if(p||h){if(s||c===f)return!1;if(c&&h&&c.isContentEditable&&c.contains(f))return!1}else if((A||"touchstart"===e.type)&&c){var v=c.tagName;(c.isContentEditable||O.indexOf(v)>-1)&&c.blur()}if(r.clientStores=[new S(C(e))],r.flag=!0,r.isDrag=!1,r.datas={},a&&(3===e.which||2===e.button))return r.initDrag(),!1;!1===r.emit("dragStart",E({datas:r.datas,inputEvent:e,isTrusted:t},r.getCurrentStore().getPosition()))&&r.initDrag(),r.isDouble=g()-r.prevTime<200,r.flag&&A&&e.preventDefault()}if(!r.flag)return!1;var B=0;if(u&&l&&o&&(B=setTimeout((function(){m(i,"touchstart",r.onDragStart,{passive:!1})}))),!u&&l&&o&&b(i,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(B),u&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=C(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",E({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,i=t.container;r.isTouch&&n&&b(i,"touchstart",r.onDragStart),r.flag=!1;var o=r.getCurrentStore().getPosition(),a=g(),A=!r.isDrag&&r.isDouble;r.prevTime=r.isDrag||A?0:a,r.emit("dragEnd",E({datas:r.datas,isDouble:A,isDrag:r.isDrag,inputEvent:e},o)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var i=[].concat(t);r.options=E({checkInput:!1,container:i.length>1?window:i[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var o=r.options,a=o.container,A=o.events,s=o.checkWindowBlur;if(r.isTouch=A.indexOf("touch")>-1,r.isMouse=A.indexOf("mouse")>-1,r.targets=i,r.isMouse&&(i.forEach((function(e){m(e,"mousedown",r.onDragStart)})),m(a,"mousemove",r.onDrag),m(a,"mouseup",r.onDragEnd),m(a,"contextmenu",r.onDragEnd)),s&&m(window,"blur",r.onBlur),r.isTouch){var l={passive:!1};i.forEach((function(e){m(e,"touchstart",r.onDragStart,l)})),m(a,"touchmove",r.onDrag,l),m(a,"touchend",r.onDragEnd,l),m(a,"touchcancel",r.onDragEnd,l)}return r}!function(e,t){function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),b(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){b(t,"mousedown",e.onDragStart)})),b(n,"mousemove",this.onDrag),b(n,"mouseup",this.onDragEnd),b(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){b(t,"touchstart",e.onDragStart)})),b(n,"touchstart",this.onDragStart),b(n,"touchmove",this.onDrag),b(n,"touchend",this.onDragEnd),b(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new S(C(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",E({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",E({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",E({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,E({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(l.a),T=n(9),N=n(8);function _(e){return function(e){var t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach((function(e){var n=e.matrixFunction,r=e.functionValue;n&&(t=n(t,r))})),t}(function(e){return(n=e,Array.isArray(n)?e:(t=e,f(t,""))).map((function(e){var t=p(e),n=t.prefix,r=t.value,i=null,o=n,a="";if("translate"===n||"translateX"===n||"translate3d"===n){var A=d(r).map((function(e){return parseFloat(e)})),s=A[0],l=A[1],u=void 0===l?0:l,c=A[2],f=void 0===c?0:c;i=N.i,a=[s,u,f]}else if("translateY"===n){u=parseFloat(r);i=N.i,a=[0,u,0]}else if("translateZ"===n){f=parseFloat(r);i=N.i,a=[0,0,f]}else if("scale"===n||"scale3d"===n){var g=d(r).map((function(e){return parseFloat(e)})),v=g[0],B=g[1],m=void 0===B?v:B,b=g[2],w=void 0===b?1:b;i=N.h,a=[v,m,w]}else if("scaleX"===n){v=parseFloat(r);i=N.h,a=[v,1,1]}else if("scaleY"===n){m=parseFloat(r);i=N.h,a=[1,m,1]}else if("scaleZ"===n){w=parseFloat(r);i=N.h,a=[1,1,w]}else if("rotate"===n||"rotateZ"===n||"rotateX"===n||"rotateY"===n){var E=h(r),y=E.unit,C=E.value,Q="rad"===y?C:C*Math.PI/180;"rotate"===n||"rotateZ"===n?(o="rotateZ",i=N.g):"rotateX"===n?i=N.e:"rotateY"===n&&(i=N.f),a=Q}else if("matrix3d"===n)i=N.d,a=d(r).map((function(e){return parseFloat(e)}));else if("matrix"===n){var x=d(r).map((function(e){return parseFloat(e)}));i=N.d,a=[x[0],x[1],0,0,x[2],x[3],0,0,0,0,1,0,x[4],x[5],0,1]}else o="";return{name:n,functionName:o,value:r,matrixFunction:i,functionValue:a}}));var t;var n}(e))}function M(e,t){var n=Object(N.a)(e,[t[0],t[1]||0,t[2]||0,1],4),r=n[3]||1;return[n[0]/r,n[1]/r,n[2]/r]}var R=function(e,t){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var D=function(){return(D=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=t.scrollPos&&A.indexOf(d)<0&&t.setState({guides:A.concat([d])},(function(){u({guides:t.state.guides,distX:i,distY:o}),l(t.state.guides)}));else{var p=n.target.getAttribute("data-index");if(r||d-1)return;A[p]=d}t.setState({guides:A.slice()},(function(){var e=t.state.guides;l(e),u({distX:i,distY:o,guides:e})}))}},t}!function(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.render=function(){var e=this.props,t=e.className,n=e.type,i=e.width,a=e.height,s=e.unit,l=e.zoom,u=e.style,c=e.rulerStyle,f=e.backgroundColor,d=e.lineColor,p=e.textColor,h=e.direction,g=e.textFormat,v=e.displayDragPos,B=e.cspNonce,m=this.getTranslateName();return Object(r.createElement)(X,{ref:A(this,"manager"),cspNonce:B,className:P("manager",n)+" "+t,style:u},Object(r.createElement)("div",{className:P("guide-origin"),ref:A(this,"originElement")}),Object(r.createElement)(o,{ref:A(this,"ruler"),type:n,width:i,height:a,unit:s,zoom:l,backgroundColor:f,lineColor:d,style:c,textColor:p,direction:h,textFormat:g}),Object(r.createElement)("div",{className:I,ref:A(this,"guidesElement"),style:{transform:m+"("+-this.scrollPos*l+"px)"}},v&&Object(r.createElement)("div",{className:z,ref:A(this,"displayElement")}),Object(r.createElement)("div",{className:k,ref:A(this,"adderElement")}),this.renderGuides()))},n.renderGuides=function(){var e=this,t=this.props,n=t.type,i=t.zoom,o=t.showGuides,a=this.getTranslateName(),A=this.state.guides;if(this.guideElements=[],o)return A.map((function(t,o){return Object(r.createElement)("div",{className:P("guide",n),ref:s(e,"guideElements",o),key:o,"data-index":o,"data-pos":t,style:{transform:a+"("+t*i+"px)"}})}))},n.componentDidMount=function(){var e=this;this.gesto=new H(this.manager.getElement(),{container:document.body}).on("dragStart",(function(t){var n,r,i=t.inputEvent.target,o=t.datas,a=e.ruler.canvasElement,A=e.guidesElement,s="horizontal"===e.props.type,l=e.originElement.getBoundingClientRect(),u=function(e,t){void 0===t&&(t=document.body);for(var n=e,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];n;){var i=getComputedStyle(n).transform;if(r=Object(N.d)(_(i),r),n===t)break;n=n.parentElement}return(r=Object(N.c)(r,4))[12]=0,r[13]=0,r[14]=0,r}(e.manager.getElement()),c=M(u,[t.clientX-l.left,t.clientY-l.top]);if(c[0]-=A.offsetLeft,c[1]-=A.offsetTop,c[s?1:0]+=e.scrollPos*e.props.zoom,o.offsetPos=c,o.matrix=u,i===a)o.fromRuler=!0,o.target=e.adderElement;else{if(r=K,!((n=i).classList?n.classList.contains(r):n.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))))return t.stop(),!1;o.target=i}e.onDragStart(t)})).on("drag",this.onDrag).on("dragEnd",this.onDragEnd),this.setState({guides:this.props.defaultGuides||[]})},n.componentWillUnmount=function(){this.gesto.unset()},n.componentDidUpdate=function(e){e.defaultGuides!==this.props.defaultGuides&&this.setState({guides:this.props.defaultGuides||[]})},n.loadGuides=function(e){this.setState({guides:e})},n.getGuides=function(){return this.state.guides},n.scrollGuides=function(e){var t=this.props.zoom,n=this.guidesElement;this.scrollPos=e,n.style.transform=this.getTranslateName()+"("+-e*t+"px)";var r=this.state.guides;this.guideElements.forEach((function(t,n){t&&(t.style.display=-e+r[n]<0?"none":"block")}))},n.resize=function(){this.ruler.resize()},n.scroll=function(e){this.ruler.scroll(e)},n.movePos=function(e){var t=e.datas,n=e.distX,r=e.distY,i=this.props,o=i.type,a=i.zoom,A=i.snaps,s=i.snapThreshold,l=i.displayDragPos,u=i.dragPosFormat,c="horizontal"===o,f=M(t.matrix,[n,r]),d=t.offsetPos,p=f[0]+d[0],h=f[1]+d[1],g=Math.round(c?h:p),v=Math.round(g/a),B=A.slice().sort((function(e,t){return Math.abs(v-e)-Math.abs(v-t)}));if(B.length&&Math.abs(B[0]-v)u))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var p=-1,h=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++p=t||n<0||g&&e-p>=u}function w(){var e=i();if(b(e))return E(e);f=setTimeout(w,function(e){var n=t-(e-d);return g?A(n,u-(e-p)):n}(e))}function E(e){return f=void 0,v&&s?B(e):(s=l=void 0,c)}function y(){var e=i(),n=b(e);if(s=arguments,l=this,d=e,n){if(void 0===f)return m(d);if(g)return clearTimeout(f),f=setTimeout(w,t),B(d)}return void 0===f&&(f=setTimeout(w,t)),c}return t=o(t)||0,r(n)&&(h=!!n.leading,u=(g="maxWait"in n)?a(o(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),y.cancel=function(){void 0!==f&&clearTimeout(f),p=0,s=d=l=f=void 0},y.flush=function(){return void 0===f?c:E(i())},y}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorWrap=void 0;var r=Object.assign||function(e){for(var t=1;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=55296&&i<=56319&&n>10),a%1024+56320)),(i+1===n||r.length>16384)&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return o},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="undefined"===typeof Uint8Array?[]:new Uint8Array(256),c=0;c=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),h=10,g=13,v=15,B=17,m=18,b=19,w=20,E=21,y=22,C=24,Q=25,x=26,F=27,U=28,S=30,O=32,H=33,T=34,N=35,_=37,M=38,R=39,D=40,P=42,k=function(e){var t,n,r,i=function(e){var t,n,r,i,o,a=.75*e.length,A=e.length,s=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint8Array.prototype.slice?new ArrayBuffer(a):new Array(a),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t>4,c[s++]=(15&r)<<4|i>>2,c[s++]=(3&i)<<6|63&o;return l}(e),o=Array.isArray(i)?function(e){for(var t=e.length,n=[],r=0;r0;){var a=r[--o];if(Array.isArray(e)?-1!==e.indexOf(a):e===a)for(var A=n;A<=r.length;){var s;if((s=r[++A])===t)return!0;if(s!==h)break}if(a!==h)break}return!1},Y=function(e,t){for(var n=e;n>=0;){var r=t[n];if(r!==h)return r;n--}return 0},W=function(e,t,n,r,i){if(0===n[r])return"\xd7";var o=r-1;if(Array.isArray(i)&&!0===i[o])return"\xd7";var a=o-1,A=o+1,s=t[o],l=a>=0?t[a]:0,u=t[A];if(2===s&&3===u)return"\xd7";if(-1!==K.indexOf(s))return"!";if(-1!==K.indexOf(u))return"\xd7";if(-1!==L.indexOf(u))return"\xd7";if(8===Y(o,t))return"\xf7";if(11===k.get(e[o])&&(u===_||u===O||u===H))return"\xd7";if(7===s||7===u)return"\xd7";if(9===s)return"\xd7";if(-1===[h,g,v].indexOf(s)&&9===u)return"\xd7";if(-1!==[B,m,b,C,U].indexOf(u))return"\xd7";if(Y(o,t)===y)return"\xd7";if(V(23,y,o,t))return"\xd7";if(V([B,m],E,o,t))return"\xd7";if(V(12,12,o,t))return"\xd7";if(s===h)return"\xf7";if(23===s||23===u)return"\xd7";if(16===u||16===s)return"\xf7";if(-1!==[g,v,E].indexOf(u)||14===s)return"\xd7";if(36===l&&-1!==G.indexOf(s))return"\xd7";if(s===U&&36===u)return"\xd7";if(u===w&&-1!==I.concat(w,b,Q,_,O,H).indexOf(s))return"\xd7";if(-1!==I.indexOf(u)&&s===Q||-1!==I.indexOf(s)&&u===Q)return"\xd7";if(s===F&&-1!==[_,O,H].indexOf(u)||-1!==[_,O,H].indexOf(s)&&u===x)return"\xd7";if(-1!==I.indexOf(s)&&-1!==z.indexOf(u)||-1!==z.indexOf(s)&&-1!==I.indexOf(u))return"\xd7";if(-1!==[F,x].indexOf(s)&&(u===Q||-1!==[y,v].indexOf(u)&&t[A+1]===Q)||-1!==[y,v].indexOf(s)&&u===Q||s===Q&&-1!==[Q,U,C].indexOf(u))return"\xd7";if(-1!==[Q,U,C,B,m].indexOf(u))for(var c=o;c>=0;){if((f=t[c])===Q)return"\xd7";if(-1===[U,C].indexOf(f))break;c--}if(-1!==[F,x].indexOf(u))for(c=-1!==[B,m].indexOf(s)?a:o;c>=0;){var f;if((f=t[c])===Q)return"\xd7";if(-1===[U,C].indexOf(f))break;c--}if(M===s&&-1!==[M,R,T,N].indexOf(u)||-1!==[R,T].indexOf(s)&&-1!==[R,D].indexOf(u)||-1!==[D,N].indexOf(s)&&u===D)return"\xd7";if(-1!==X.indexOf(s)&&-1!==[w,x].indexOf(u)||-1!==X.indexOf(u)&&s===F)return"\xd7";if(-1!==I.indexOf(s)&&-1!==I.indexOf(u))return"\xd7";if(s===C&&-1!==I.indexOf(u))return"\xd7";if(-1!==I.concat(Q).indexOf(s)&&u===y||-1!==I.concat(Q).indexOf(u)&&s===m)return"\xd7";if(41===s&&41===u){for(var d=n[o],p=1;d>0&&41===t[--d];)p++;if(p%2!==0)return"\xd7"}return s===O&&u===H?"\xd7":"\xf7"},J=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=function(e,t){void 0===t&&(t="strict");var n=[],r=[],i=[];return e.forEach((function(e,o){var a=k.get(e);if(a>50?(i.push(!0),a-=50):i.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(o),n.push(16);if(4===a||11===a){if(0===o)return r.push(o),n.push(S);var A=n[o-1];return-1===j.indexOf(A)?(r.push(r[o-1]),n.push(A)):(r.push(o),n.push(S))}return r.push(o),31===a?n.push("strict"===t?E:_):a===P||29===a?n.push(S):43===a?e>=131072&&e<=196605||e>=196608&&e<=262141?n.push(_):n.push(S):void n.push(a)})),[r,n,i]}(e,t.lineBreak),r=n[0],i=n[1],o=n[2];return"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(i=i.map((function(e){return-1!==[Q,S,P].indexOf(e)?_:e}))),[r,i,"keep-all"===t.wordBreak?o.map((function(t,n){return t&&e[n]>=19968&&e[n]<=40959})):void 0]},q=function(){function e(e,t,n,r){this.codePoints=e,this.required="!"===t,this.start=n,this.end=r}return e.prototype.slice=function(){return s.apply(void 0,this.codePoints.slice(this.start,this.end))},e}();!function(e){e[e.STRING_TOKEN=0]="STRING_TOKEN",e[e.BAD_STRING_TOKEN=1]="BAD_STRING_TOKEN",e[e.LEFT_PARENTHESIS_TOKEN=2]="LEFT_PARENTHESIS_TOKEN",e[e.RIGHT_PARENTHESIS_TOKEN=3]="RIGHT_PARENTHESIS_TOKEN",e[e.COMMA_TOKEN=4]="COMMA_TOKEN",e[e.HASH_TOKEN=5]="HASH_TOKEN",e[e.DELIM_TOKEN=6]="DELIM_TOKEN",e[e.AT_KEYWORD_TOKEN=7]="AT_KEYWORD_TOKEN",e[e.PREFIX_MATCH_TOKEN=8]="PREFIX_MATCH_TOKEN",e[e.DASH_MATCH_TOKEN=9]="DASH_MATCH_TOKEN",e[e.INCLUDE_MATCH_TOKEN=10]="INCLUDE_MATCH_TOKEN",e[e.LEFT_CURLY_BRACKET_TOKEN=11]="LEFT_CURLY_BRACKET_TOKEN",e[e.RIGHT_CURLY_BRACKET_TOKEN=12]="RIGHT_CURLY_BRACKET_TOKEN",e[e.SUFFIX_MATCH_TOKEN=13]="SUFFIX_MATCH_TOKEN",e[e.SUBSTRING_MATCH_TOKEN=14]="SUBSTRING_MATCH_TOKEN",e[e.DIMENSION_TOKEN=15]="DIMENSION_TOKEN",e[e.PERCENTAGE_TOKEN=16]="PERCENTAGE_TOKEN",e[e.NUMBER_TOKEN=17]="NUMBER_TOKEN",e[e.FUNCTION=18]="FUNCTION",e[e.FUNCTION_TOKEN=19]="FUNCTION_TOKEN",e[e.IDENT_TOKEN=20]="IDENT_TOKEN",e[e.COLUMN_TOKEN=21]="COLUMN_TOKEN",e[e.URL_TOKEN=22]="URL_TOKEN",e[e.BAD_URL_TOKEN=23]="BAD_URL_TOKEN",e[e.CDC_TOKEN=24]="CDC_TOKEN",e[e.CDO_TOKEN=25]="CDO_TOKEN",e[e.COLON_TOKEN=26]="COLON_TOKEN",e[e.SEMICOLON_TOKEN=27]="SEMICOLON_TOKEN",e[e.LEFT_SQUARE_BRACKET_TOKEN=28]="LEFT_SQUARE_BRACKET_TOKEN",e[e.RIGHT_SQUARE_BRACKET_TOKEN=29]="RIGHT_SQUARE_BRACKET_TOKEN",e[e.UNICODE_RANGE_TOKEN=30]="UNICODE_RANGE_TOKEN",e[e.WHITESPACE_TOKEN=31]="WHITESPACE_TOKEN",e[e.EOF_TOKEN=32]="EOF_TOKEN"}(f||(f={}));var Z=function(e){return e>=48&&e<=57},$=function(e){return Z(e)||e>=65&&e<=70||e>=97&&e<=102},ee=function(e){return 10===e||9===e||32===e},te=function(e){return function(e){return function(e){return e>=97&&e<=122}(e)||function(e){return e>=65&&e<=90}(e)}(e)||function(e){return e>=128}(e)||95===e},ne=function(e){return te(e)||Z(e)||45===e},re=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},ie=function(e,t){return 92===e&&10!==t},oe=function(e,t,n){return 45===e?te(t)||ie(t,n):!!te(e)||!(92!==e||!ie(e,t))},ae=function(e,t,n){return 43===e||45===e?!!Z(t)||46===t&&Z(n):Z(46===e?t:e)},Ae=function(e){var t=0,n=1;43!==e[t]&&45!==e[t]||(45===e[t]&&(n=-1),t++);for(var r=[];Z(e[t]);)r.push(e[t++]);var i=r.length?parseInt(s.apply(void 0,r),10):0;46===e[t]&&t++;for(var o=[];Z(e[t]);)o.push(e[t++]);var a=o.length,A=a?parseInt(s.apply(void 0,o),10):0;69!==e[t]&&101!==e[t]||t++;var l=1;43!==e[t]&&45!==e[t]||(45===e[t]&&(l=-1),t++);for(var u=[];Z(e[t]);)u.push(e[t++]);var c=u.length?parseInt(s.apply(void 0,u),10):0;return n*(i+A*Math.pow(10,-a))*Math.pow(10,l*c)},se={type:f.LEFT_PARENTHESIS_TOKEN},le={type:f.RIGHT_PARENTHESIS_TOKEN},ue={type:f.COMMA_TOKEN},ce={type:f.SUFFIX_MATCH_TOKEN},fe={type:f.PREFIX_MATCH_TOKEN},de={type:f.COLUMN_TOKEN},pe={type:f.DASH_MATCH_TOKEN},he={type:f.INCLUDE_MATCH_TOKEN},ge={type:f.LEFT_CURLY_BRACKET_TOKEN},ve={type:f.RIGHT_CURLY_BRACKET_TOKEN},Be={type:f.SUBSTRING_MATCH_TOKEN},me={type:f.BAD_URL_TOKEN},be={type:f.BAD_STRING_TOKEN},we={type:f.CDO_TOKEN},Ee={type:f.CDC_TOKEN},ye={type:f.COLON_TOKEN},Ce={type:f.SEMICOLON_TOKEN},Qe={type:f.LEFT_SQUARE_BRACKET_TOKEN},xe={type:f.RIGHT_SQUARE_BRACKET_TOKEN},Fe={type:f.WHITESPACE_TOKEN},Ue={type:f.EOF_TOKEN},Se=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(A(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Ue;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(ne(t)||ie(n,r)){var i=oe(t,n,r)?2:1,o=this.consumeName();return{type:f.HASH_TOKEN,value:o,flags:i}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),ce;break;case 39:return this.consumeStringToken(39);case 40:return se;case 41:return le;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Be;break;case 43:if(ae(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return ue;case 45:var a=e,A=this.peekCodePoint(0),l=this.peekCodePoint(1);if(ae(a,A,l))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(oe(a,A,l))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(45===A&&62===l)return this.consumeCodePoint(),this.consumeCodePoint(),Ee;break;case 46:if(ae(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(42===u&&47===(u=this.consumeCodePoint()))return this.consumeToken();if(-1===u)return this.consumeToken()}break;case 58:return ye;case 59:return Ce;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),we;break;case 64:var c=this.peekCodePoint(0),d=this.peekCodePoint(1),p=this.peekCodePoint(2);if(oe(c,d,p))return o=this.consumeName(),{type:f.AT_KEYWORD_TOKEN,value:o};break;case 91:return Qe;case 92:if(ie(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return xe;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),fe;break;case 123:return ge;case 125:return ve;case 117:case 85:var h=this.peekCodePoint(0),g=this.peekCodePoint(1);return 43!==h||!$(g)&&63!==g||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),pe;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),de;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),he;break;case-1:return Ue}return ee(e)?(this.consumeWhiteSpace(),Fe):Z(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):te(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:f.DELIM_TOKEN,value:s(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return"undefined"===typeof e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();$(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var n=!1;63===t&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n){var r=parseInt(s.apply(void 0,e.map((function(e){return 63===e?48:e}))),16),i=parseInt(s.apply(void 0,e.map((function(e){return 63===e?70:e}))),16);return{type:f.UNICODE_RANGE_TOKEN,start:r,end:i}}var o=parseInt(s.apply(void 0,e),16);if(45===this.peekCodePoint(0)&&$(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var a=[];$(t)&&a.length<6;)a.push(t),t=this.consumeCodePoint();return i=parseInt(s.apply(void 0,a),16),{type:f.UNICODE_RANGE_TOKEN,start:o,end:i}}return{type:f.UNICODE_RANGE_TOKEN,start:o,end:o}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:f.FUNCTION_TOKEN,value:e}):{type:f.IDENT_TOKEN,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:f.URL_TOKEN,value:""};var t=this.peekCodePoint(0);if(39===t||34===t){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===f.STRING_TOKEN&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:f.URL_TOKEN,value:n.value}):(this.consumeBadUrlRemnants(),me)}for(;;){var r=this.consumeCodePoint();if(-1===r||41===r)return{type:f.URL_TOKEN,value:s.apply(void 0,e)};if(ee(r))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:f.URL_TOKEN,value:s.apply(void 0,e)}):(this.consumeBadUrlRemnants(),me);if(34===r||39===r||40===r||re(r))return this.consumeBadUrlRemnants(),me;if(92===r){if(!ie(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),me;e.push(this.consumeEscapedCodePoint())}else e.push(r)}},e.prototype.consumeWhiteSpace=function(){for(;ee(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||-1===e)return;ie(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t="";e>0;){var n=Math.min(6e4,e);t+=s.apply(void 0,this._value.splice(0,n)),e-=n}return this._value.shift(),t},e.prototype.consumeStringToken=function(e){for(var t="",n=0;;){var r=this._value[n];if(-1===r||void 0===r||r===e)return t+=this.consumeStringSlice(n),{type:f.STRING_TOKEN,value:t};if(10===r)return this._value.splice(0,n),be;if(92===r){var i=this._value[n+1];-1!==i&&void 0!==i&&(10===i?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):ie(r,i)&&(t+=this.consumeStringSlice(n),t+=s(this.consumeEscapedCodePoint()),n=-1))}n++}},e.prototype.consumeNumber=function(){var e=[],t=4,n=this.peekCodePoint(0);for(43!==n&&45!==n||e.push(this.consumeCodePoint());Z(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===n&&Z(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;Z(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((69===n||101===n)&&((43===r||45===r)&&Z(i)||Z(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;Z(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Ae(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),o=this.peekCodePoint(2);if(oe(r,i,o)){var a=this.consumeName();return{type:f.DIMENSION_TOKEN,number:t,flags:n,unit:a}}return 37===r?(this.consumeCodePoint(),{type:f.PERCENTAGE_TOKEN,number:t,flags:n}):{type:f.NUMBER_TOKEN,number:t,flags:n}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if($(e)){for(var t=s(e);$(this.peekCodePoint(0))&&t.length<6;)t+=s(this.consumeCodePoint());ee(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return 0===n||function(e){return e>=55296&&e<=57343}(n)||n>1114111?65533:n}return-1===e?65533:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(ne(t))e+=s(t);else{if(!ie(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=s(this.consumeEscapedCodePoint())}}},e}(),Oe=function(){function e(e){this._tokens=e}return e.create=function(t){var n=new Se;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===f.WHITESPACE_TOKEN;)e=this.consumeToken();if(e.type===f.EOF_TOKEN)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(e.type===f.WHITESPACE_TOKEN);if(e.type===f.EOF_TOKEN)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===f.EOF_TOKEN)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case f.LEFT_CURLY_BRACKET_TOKEN:case f.LEFT_SQUARE_BRACKET_TOKEN:case f.LEFT_PARENTHESIS_TOKEN:return this.consumeSimpleBlock(e.type);case f.FUNCTION_TOKEN:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},n=this.consumeToken();;){if(n.type===f.EOF_TOKEN||ke(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:f.FUNCTION};;){var n=this.consumeToken();if(n.type===f.EOF_TOKEN||n.type===f.RIGHT_PARENTHESIS_TOKEN)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return"undefined"===typeof e?Ue:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),He=function(e){return e.type===f.DIMENSION_TOKEN},Te=function(e){return e.type===f.NUMBER_TOKEN},Ne=function(e){return e.type===f.IDENT_TOKEN},_e=function(e){return e.type===f.STRING_TOKEN},Me=function(e,t){return Ne(e)&&e.value===t},Re=function(e){return e.type!==f.WHITESPACE_TOKEN},De=function(e){return e.type!==f.WHITESPACE_TOKEN&&e.type!==f.COMMA_TOKEN},Pe=function(e){var t=[],n=[];return e.forEach((function(e){if(e.type===f.COMMA_TOKEN){if(0===n.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(n),void(n=[])}e.type!==f.WHITESPACE_TOKEN&&n.push(e)})),n.length&&t.push(n),t},ke=function(e,t){return t===f.LEFT_CURLY_BRACKET_TOKEN&&e.type===f.RIGHT_CURLY_BRACKET_TOKEN||t===f.LEFT_SQUARE_BRACKET_TOKEN&&e.type===f.RIGHT_SQUARE_BRACKET_TOKEN||t===f.LEFT_PARENTHESIS_TOKEN&&e.type===f.RIGHT_PARENTHESIS_TOKEN},Ie=function(e){return e.type===f.NUMBER_TOKEN||e.type===f.DIMENSION_TOKEN},Ke=function(e){return e.type===f.PERCENTAGE_TOKEN||Ie(e)},Le=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},ze={type:f.NUMBER_TOKEN,number:0,flags:4},je={type:f.PERCENTAGE_TOKEN,number:50,flags:4},Xe={type:f.PERCENTAGE_TOKEN,number:100,flags:4},Ge=function(e,t,n){var r=e[0],i=e[1];return[Ve(r,t),Ve("undefined"!==typeof i?i:r,n)]},Ve=function(e,t){if(e.type===f.PERCENTAGE_TOKEN)return e.number/100*t;if(He(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},Ye=function(e){if(e.type===f.DIMENSION_TOKEN)switch(e.unit){case"deg":return Math.PI*e.number/180;case"grad":return Math.PI/200*e.number;case"rad":return e.number;case"turn":return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},We=function(e){return e.type===f.DIMENSION_TOKEN&&("deg"===e.unit||"grad"===e.unit||"rad"===e.unit||"turn"===e.unit)},Je=function(e){switch(e.filter(Ne).map((function(e){return e.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ze,ze];case"to top":case"bottom":return qe(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ze,Xe];case"to right":case"left":return qe(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Xe,Xe];case"to bottom":case"top":return qe(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Xe,ze];case"to left":case"right":return qe(270)}return 0},qe=function(e){return Math.PI*e/180},Ze=function(e){if(e.type===f.FUNCTION){var t=st[e.name];if("undefined"===typeof t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(e.values)}if(e.type===f.HASH_TOKEN){if(3===e.value.length){var n=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3);return tt(parseInt(n+n,16),parseInt(r+r,16),parseInt(i+i,16),1)}if(4===e.value.length){n=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3);var o=e.value.substring(3,4);return tt(parseInt(n+n,16),parseInt(r+r,16),parseInt(i+i,16),parseInt(o+o,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6),tt(parseInt(n,16),parseInt(r,16),parseInt(i,16),1);if(8===e.value.length)return n=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6),o=e.value.substring(6,8),tt(parseInt(n,16),parseInt(r,16),parseInt(i,16),parseInt(o,16)/255)}if(e.type===f.IDENT_TOKEN){var a=lt[e.value.toUpperCase()];if("undefined"!==typeof a)return a}return lt.TRANSPARENT},$e=function(e){return 0===(255&e)},et=function(e){var t=255&e,n=255&e>>8,r=255&e>>16,i=255&e>>24;return t<255?"rgba("+i+","+r+","+n+","+t/255+")":"rgb("+i+","+r+","+n+")"},tt=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(255*r)<<0)>>>0},nt=function(e,t){if(e.type===f.NUMBER_TOKEN)return e.number;if(e.type===f.PERCENTAGE_TOKEN){var n=3===t?1:255;return 3===t?e.number/100*n:Math.round(e.number/100*n)}return 0},rt=function(e){var t=e.filter(De);if(3===t.length){var n=t.map(nt),r=n[0],i=n[1],o=n[2];return tt(r,i,o,1)}if(4===t.length){var a=t.map(nt),A=(r=a[0],i=a[1],o=a[2],a[3]);return tt(r,i,o,A)}return 0};function it(e,t,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(t-e)*n*6+e:n<.5?t:n<2/3?6*(t-e)*(2/3-n)+e:e}var ot,at,At=function(e){var t=e.filter(De),n=t[0],r=t[1],i=t[2],o=t[3],a=(n.type===f.NUMBER_TOKEN?qe(n.number):Ye(n))/(2*Math.PI),A=Ke(r)?r.number/100:0,s=Ke(i)?i.number/100:0,l="undefined"!==typeof o&&Ke(o)?Ve(o,1):1;if(0===A)return tt(255*s,255*s,255*s,1);var u=s<=.5?s*(A+1):s+A-s*A,c=2*s-u,d=it(c,u,a+1/3),p=it(c,u,a),h=it(c,u,a-1/3);return tt(255*d,255*p,255*h,l)},st={hsl:At,hsla:At,rgb:rt,rgba:rt},lt={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199};(function(e){e[e.VALUE=0]="VALUE",e[e.LIST=1]="LIST",e[e.IDENT_VALUE=2]="IDENT_VALUE",e[e.TYPE_VALUE=3]="TYPE_VALUE",e[e.TOKEN_VALUE=4]="TOKEN_VALUE"})(ot||(ot={})),function(e){e[e.BORDER_BOX=0]="BORDER_BOX",e[e.PADDING_BOX=1]="PADDING_BOX",e[e.CONTENT_BOX=2]="CONTENT_BOX"}(at||(at={}));var ut,ct,ft,dt={name:"background-clip",initialValue:"border-box",prefix:!1,type:ot.LIST,parse:function(e){return e.map((function(e){if(Ne(e))switch(e.value){case"padding-box":return at.PADDING_BOX;case"content-box":return at.CONTENT_BOX}return at.BORDER_BOX}))}},pt={name:"background-color",initialValue:"transparent",prefix:!1,type:ot.TYPE_VALUE,format:"color"},ht=function(e){var t=Ze(e[0]),n=e[1];return n&&Ke(n)?{color:t,stop:n}:{color:t,stop:null}},gt=function(e,t){var n=e[0],r=e[e.length-1];null===n.stop&&(n.stop=ze),null===r.stop&&(r.stop=Xe);for(var i=[],o=0,a=0;ao?i.push(s):i.push(o),o=s}else i.push(null)}var l=null;for(a=0;ae.optimumDistance)?{optimumCorner:t,optimumDistance:A}:e}),{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},bt=function(e){var t=qe(180),n=[];return Pe(e).forEach((function(e,r){if(0===r){var i=e[0];if(i.type===f.IDENT_TOKEN&&-1!==["top","left","right","bottom"].indexOf(i.value))return void(t=Je(e));if(We(i))return void(t=(Ye(i)+qe(270))%qe(360))}var o=ht(e);n.push(o)})),{angle:t,stops:n,type:ut.LINEAR_GRADIENT}},wt=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Et=function(e,t,n,r,i){var o="http://www.w3.org/2000/svg",a=document.createElementNS(o,"svg"),A=document.createElementNS(o,"foreignObject");return a.setAttributeNS(null,"width",e.toString()),a.setAttributeNS(null,"height",t.toString()),A.setAttributeNS(null,"width","100%"),A.setAttributeNS(null,"height","100%"),A.setAttributeNS(null,"x",n.toString()),A.setAttributeNS(null,"y",r.toString()),A.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(A),A.appendChild(i),a},yt=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},Ct={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var n=e.createElement("boundtest");n.style.height="123px",n.style.display="block",e.body.appendChild(n),t.selectNode(n);var r=t.getBoundingClientRect(),i=Math.round(r.height);if(e.body.removeChild(n),123===i)return!0}}return!1}(document);return Object.defineProperty(Ct,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,n=e.createElement("canvas"),r=n.getContext("2d");if(!r)return!1;t.src="data:image/svg+xml,";try{r.drawImage(t,0,0),n.toDataURL()}catch(i){return!1}return!0}(document);return Object.defineProperty(Ct,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"===typeof Array.from&&"function"===typeof window.fetch?function(e){var t=e.createElement("canvas");t.width=100,t.height=100;var n=t.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,100,100);var r=new Image,i=t.toDataURL();r.src=i;var o=Et(100,100,0,0,r);return n.fillStyle="red",n.fillRect(0,0,100,100),yt(o).then((function(t){n.drawImage(t,0,0);var r=n.getImageData(0,0,100,100).data;n.fillStyle="red",n.fillRect(0,0,100,100);var o=e.createElement("div");return o.style.backgroundImage="url("+i+")",o.style.height="100px",wt(r)?yt(Et(100,100,0,0,o)):Promise.reject(!1)})).then((function(e){return n.drawImage(e,0,0),wt(n.getImageData(0,0,100,100).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(Ct,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e="undefined"!==typeof(new Image).crossOrigin;return Object.defineProperty(Ct,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"===typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Ct,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Ct,"SUPPORT_CORS_XHR",{value:e}),e}},Qt=function(){function e(e){var t=e.id,n=e.enabled;this.id=t,this.enabled=n,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t0&&setTimeout((function(){return t("Timed out ("+a._options.imageTimeout+"ms) loading image")}),a._options.imageTimeout)}))];case 3:return[2,i.sent()]}}))}))},e.prototype.has=function(e){return"undefined"!==typeof this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise((function(i,o){var a=Ct.SUPPORT_RESPONSE_TYPE?"blob":"text",A=new XMLHttpRequest;if(A.onload=function(){if(200===A.status)if("text"===a)i(A.response);else{var e=new FileReader;e.addEventListener("load",(function(){return i(e.result)}),!1),e.addEventListener("error",(function(e){return o(e)}),!1),e.readAsDataURL(A.response)}else o("Failed to proxy resource "+r+" with status code "+A.status)},A.onerror=o,A.open("GET",n+"?url="+encodeURIComponent(e)+"&responseType="+a),"text"!==a&&A instanceof XMLHttpRequest&&(A.responseType=a),t._options.imageTimeout){var s=t._options.imageTimeout;A.timeout=s,A.ontimeout=function(){return o("Timed out ("+s+"ms) proxying "+r)}}A.send()}))},e}(),Ut=/^data:image\/svg\+xml/i,St=/^data:image\/.*;base64,/i,Ot=/^data:image\/.*/i,Ht=function(e){return Ct.SUPPORT_SVG_DRAWING||!Mt(e)},Tt=function(e){return Ot.test(e)},Nt=function(e){return St.test(e)},_t=function(e){return"blob"===e.substr(0,4)},Mt=function(e){return"svg"===e.substr(-3).toLowerCase()||Ut.test(e)},Rt=function(e){var t=ct.CIRCLE,n=ft.FARTHEST_CORNER,r=[],i=[];return Pe(e).forEach((function(e,o){var a=!0;if(0===o?a=e.reduce((function(e,t){if(Ne(t))switch(t.value){case"center":return i.push(je),!1;case"top":case"left":return i.push(ze),!1;case"right":case"bottom":return i.push(Xe),!1}else if(Ke(t)||Ie(t))return i.push(t),!1;return e}),a):1===o&&(a=e.reduce((function(e,r){if(Ne(r))switch(r.value){case"circle":return t=ct.CIRCLE,!1;case"ellipse":return t=ct.ELLIPSE,!1;case"contain":case"closest-side":return n=ft.CLOSEST_SIDE,!1;case"farthest-side":return n=ft.FARTHEST_SIDE,!1;case"closest-corner":return n=ft.CLOSEST_CORNER,!1;case"cover":case"farthest-corner":return n=ft.FARTHEST_CORNER,!1}else if(Ie(r)||Ke(r))return Array.isArray(n)||(n=[]),n.push(r),!1;return e}),a)),a){var A=ht(e);r.push(A)}})),{size:n,shape:t,stops:r,position:i,type:ut.RADIAL_GRADIENT}};!function(e){e[e.URL=0]="URL",e[e.LINEAR_GRADIENT=1]="LINEAR_GRADIENT",e[e.RADIAL_GRADIENT=2]="RADIAL_GRADIENT"}(ut||(ut={})),function(e){e[e.CIRCLE=0]="CIRCLE",e[e.ELLIPSE=1]="ELLIPSE"}(ct||(ct={})),function(e){e[e.CLOSEST_SIDE=0]="CLOSEST_SIDE",e[e.FARTHEST_SIDE=1]="FARTHEST_SIDE",e[e.CLOSEST_CORNER=2]="CLOSEST_CORNER",e[e.FARTHEST_CORNER=3]="FARTHEST_CORNER"}(ft||(ft={}));var Dt,Pt=function(e){if(e.type===f.URL_TOKEN){var t={url:e.value,type:ut.URL};return xt.getInstance().addImage(e.value),t}if(e.type===f.FUNCTION){var n=kt[e.name];if("undefined"===typeof n)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return n(e.values)}throw new Error("Unsupported image type")},kt={"linear-gradient":function(e){var t=qe(180),n=[];return Pe(e).forEach((function(e,r){if(0===r){var i=e[0];if(i.type===f.IDENT_TOKEN&&"to"===i.value)return void(t=Je(e));if(We(i))return void(t=Ye(i))}var o=ht(e);n.push(o)})),{angle:t,stops:n,type:ut.LINEAR_GRADIENT}},"-moz-linear-gradient":bt,"-ms-linear-gradient":bt,"-o-linear-gradient":bt,"-webkit-linear-gradient":bt,"radial-gradient":function(e){var t=ct.CIRCLE,n=ft.FARTHEST_CORNER,r=[],i=[];return Pe(e).forEach((function(e,o){var a=!0;if(0===o){var A=!1;a=e.reduce((function(e,r){if(A)if(Ne(r))switch(r.value){case"center":return i.push(je),e;case"top":case"left":return i.push(ze),e;case"right":case"bottom":return i.push(Xe),e}else(Ke(r)||Ie(r))&&i.push(r);else if(Ne(r))switch(r.value){case"circle":return t=ct.CIRCLE,!1;case"ellipse":return t=ct.ELLIPSE,!1;case"at":return A=!0,!1;case"closest-side":return n=ft.CLOSEST_SIDE,!1;case"cover":case"farthest-side":return n=ft.FARTHEST_SIDE,!1;case"contain":case"closest-corner":return n=ft.CLOSEST_CORNER,!1;case"farthest-corner":return n=ft.FARTHEST_CORNER,!1}else if(Ie(r)||Ke(r))return Array.isArray(n)||(n=[]),n.push(r),!1;return e}),a)}if(a){var s=ht(e);r.push(s)}})),{size:n,shape:t,stops:r,position:i,type:ut.RADIAL_GRADIENT}},"-moz-radial-gradient":Rt,"-ms-radial-gradient":Rt,"-o-radial-gradient":Rt,"-webkit-radial-gradient":Rt,"-webkit-gradient":function(e){var t=qe(180),n=[],r=ut.LINEAR_GRADIENT,i=ct.CIRCLE,o=ft.FARTHEST_CORNER;return Pe(e).forEach((function(e,t){var i=e[0];if(0===t){if(Ne(i)&&"linear"===i.value)return void(r=ut.LINEAR_GRADIENT);if(Ne(i)&&"radial"===i.value)return void(r=ut.RADIAL_GRADIENT)}if(i.type===f.FUNCTION)if("from"===i.name){var o=Ze(i.values[0]);n.push({stop:ze,color:o})}else if("to"===i.name)o=Ze(i.values[0]),n.push({stop:Xe,color:o});else if("color-stop"===i.name){var a=i.values.filter(De);if(2===a.length){o=Ze(a[1]);var A=a[0];Te(A)&&n.push({stop:{type:f.PERCENTAGE_TOKEN,number:100*A.number,flags:A.flags},color:o})}}})),r===ut.LINEAR_GRADIENT?{angle:(t+qe(180))%qe(360),stops:n,type:r}:{size:o,shape:i,stops:n,position:[],type:r}}},It={name:"background-image",initialValue:"none",type:ot.LIST,prefix:!1,parse:function(e){if(0===e.length)return[];var t=e[0];return t.type===f.IDENT_TOKEN&&"none"===t.value?[]:e.filter((function(e){return De(e)&&function(e){return e.type!==f.FUNCTION||kt[e.name]}(e)})).map(Pt)}},Kt={name:"background-origin",initialValue:"border-box",prefix:!1,type:ot.LIST,parse:function(e){return e.map((function(e){if(Ne(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Lt={name:"background-position",initialValue:"0% 0%",type:ot.LIST,prefix:!1,parse:function(e){return Pe(e).map((function(e){return e.filter(Ke)})).map(Le)}};!function(e){e[e.REPEAT=0]="REPEAT",e[e.NO_REPEAT=1]="NO_REPEAT",e[e.REPEAT_X=2]="REPEAT_X",e[e.REPEAT_Y=3]="REPEAT_Y"}(Dt||(Dt={}));var zt,jt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:ot.LIST,parse:function(e){return Pe(e).map((function(e){return e.filter(Ne).map((function(e){return e.value})).join(" ")})).map(Xt)}},Xt=function(e){switch(e){case"no-repeat":return Dt.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return Dt.REPEAT_X;case"repeat-y":case"no-repeat repeat":return Dt.REPEAT_Y;case"repeat":default:return Dt.REPEAT}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(zt||(zt={}));var Gt,Vt={name:"background-size",initialValue:"0",prefix:!1,type:ot.LIST,parse:function(e){return Pe(e).map((function(e){return e.filter(Yt)}))}},Yt=function(e){return Ne(e)||Ke(e)},Wt=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:ot.TYPE_VALUE,format:"color"}},Jt=Wt("top"),qt=Wt("right"),Zt=Wt("bottom"),$t=Wt("left"),en=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:ot.LIST,parse:function(e){return Le(e.filter(Ke))}}},tn=en("top-left"),nn=en("top-right"),rn=en("bottom-right"),on=en("bottom-left");!function(e){e[e.NONE=0]="NONE",e[e.SOLID=1]="SOLID"}(Gt||(Gt={}));var an,An=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"none":return Gt.NONE}return Gt.SOLID}}},sn=An("top"),ln=An("right"),un=An("bottom"),cn=An("left"),fn=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:ot.VALUE,prefix:!1,parse:function(e){return He(e)?e.number:0}}},dn=fn("top"),pn=fn("right"),hn=fn("bottom"),gn=fn("left"),vn={name:"color",initialValue:"transparent",prefix:!1,type:ot.TYPE_VALUE,format:"color"},Bn={name:"display",initialValue:"inline-block",prefix:!1,type:ot.LIST,parse:function(e){return e.filter(Ne).reduce((function(e,t){return e|mn(t.value)}),0)}},mn=function(e){switch(e){case"block":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0};!function(e){e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.INLINE_START=3]="INLINE_START",e[e.INLINE_END=4]="INLINE_END"}(an||(an={}));var bn,wn={name:"float",initialValue:"none",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"left":return an.LEFT;case"right":return an.RIGHT;case"inline-start":return an.INLINE_START;case"inline-end":return an.INLINE_END}return an.NONE}},En={name:"letter-spacing",initialValue:"0",prefix:!1,type:ot.VALUE,parse:function(e){return e.type===f.IDENT_TOKEN&&"normal"===e.value?0:e.type===f.NUMBER_TOKEN||e.type===f.DIMENSION_TOKEN?e.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(bn||(bn={}));var yn,Cn={name:"line-break",initialValue:"normal",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"strict":return bn.STRICT;case"normal":default:return bn.NORMAL}}},Qn={name:"line-height",initialValue:"normal",prefix:!1,type:ot.TOKEN_VALUE},xn={name:"list-style-image",initialValue:"none",type:ot.VALUE,prefix:!1,parse:function(e){return e.type===f.IDENT_TOKEN&&"none"===e.value?null:Pt(e)}};!function(e){e[e.INSIDE=0]="INSIDE",e[e.OUTSIDE=1]="OUTSIDE"}(yn||(yn={}));var Fn,Un={name:"list-style-position",initialValue:"outside",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"inside":return yn.INSIDE;case"outside":default:return yn.OUTSIDE}}};!function(e){e[e.NONE=-1]="NONE",e[e.DISC=0]="DISC",e[e.CIRCLE=1]="CIRCLE",e[e.SQUARE=2]="SQUARE",e[e.DECIMAL=3]="DECIMAL",e[e.CJK_DECIMAL=4]="CJK_DECIMAL",e[e.DECIMAL_LEADING_ZERO=5]="DECIMAL_LEADING_ZERO",e[e.LOWER_ROMAN=6]="LOWER_ROMAN",e[e.UPPER_ROMAN=7]="UPPER_ROMAN",e[e.LOWER_GREEK=8]="LOWER_GREEK",e[e.LOWER_ALPHA=9]="LOWER_ALPHA",e[e.UPPER_ALPHA=10]="UPPER_ALPHA",e[e.ARABIC_INDIC=11]="ARABIC_INDIC",e[e.ARMENIAN=12]="ARMENIAN",e[e.BENGALI=13]="BENGALI",e[e.CAMBODIAN=14]="CAMBODIAN",e[e.CJK_EARTHLY_BRANCH=15]="CJK_EARTHLY_BRANCH",e[e.CJK_HEAVENLY_STEM=16]="CJK_HEAVENLY_STEM",e[e.CJK_IDEOGRAPHIC=17]="CJK_IDEOGRAPHIC",e[e.DEVANAGARI=18]="DEVANAGARI",e[e.ETHIOPIC_NUMERIC=19]="ETHIOPIC_NUMERIC",e[e.GEORGIAN=20]="GEORGIAN",e[e.GUJARATI=21]="GUJARATI",e[e.GURMUKHI=22]="GURMUKHI",e[e.HEBREW=22]="HEBREW",e[e.HIRAGANA=23]="HIRAGANA",e[e.HIRAGANA_IROHA=24]="HIRAGANA_IROHA",e[e.JAPANESE_FORMAL=25]="JAPANESE_FORMAL",e[e.JAPANESE_INFORMAL=26]="JAPANESE_INFORMAL",e[e.KANNADA=27]="KANNADA",e[e.KATAKANA=28]="KATAKANA",e[e.KATAKANA_IROHA=29]="KATAKANA_IROHA",e[e.KHMER=30]="KHMER",e[e.KOREAN_HANGUL_FORMAL=31]="KOREAN_HANGUL_FORMAL",e[e.KOREAN_HANJA_FORMAL=32]="KOREAN_HANJA_FORMAL",e[e.KOREAN_HANJA_INFORMAL=33]="KOREAN_HANJA_INFORMAL",e[e.LAO=34]="LAO",e[e.LOWER_ARMENIAN=35]="LOWER_ARMENIAN",e[e.MALAYALAM=36]="MALAYALAM",e[e.MONGOLIAN=37]="MONGOLIAN",e[e.MYANMAR=38]="MYANMAR",e[e.ORIYA=39]="ORIYA",e[e.PERSIAN=40]="PERSIAN",e[e.SIMP_CHINESE_FORMAL=41]="SIMP_CHINESE_FORMAL",e[e.SIMP_CHINESE_INFORMAL=42]="SIMP_CHINESE_INFORMAL",e[e.TAMIL=43]="TAMIL",e[e.TELUGU=44]="TELUGU",e[e.THAI=45]="THAI",e[e.TIBETAN=46]="TIBETAN",e[e.TRAD_CHINESE_FORMAL=47]="TRAD_CHINESE_FORMAL",e[e.TRAD_CHINESE_INFORMAL=48]="TRAD_CHINESE_INFORMAL",e[e.UPPER_ARMENIAN=49]="UPPER_ARMENIAN",e[e.DISCLOSURE_OPEN=50]="DISCLOSURE_OPEN",e[e.DISCLOSURE_CLOSED=51]="DISCLOSURE_CLOSED"}(Fn||(Fn={}));var Sn,On={name:"list-style-type",initialValue:"none",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"disc":return Fn.DISC;case"circle":return Fn.CIRCLE;case"square":return Fn.SQUARE;case"decimal":return Fn.DECIMAL;case"cjk-decimal":return Fn.CJK_DECIMAL;case"decimal-leading-zero":return Fn.DECIMAL_LEADING_ZERO;case"lower-roman":return Fn.LOWER_ROMAN;case"upper-roman":return Fn.UPPER_ROMAN;case"lower-greek":return Fn.LOWER_GREEK;case"lower-alpha":return Fn.LOWER_ALPHA;case"upper-alpha":return Fn.UPPER_ALPHA;case"arabic-indic":return Fn.ARABIC_INDIC;case"armenian":return Fn.ARMENIAN;case"bengali":return Fn.BENGALI;case"cambodian":return Fn.CAMBODIAN;case"cjk-earthly-branch":return Fn.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return Fn.CJK_HEAVENLY_STEM;case"cjk-ideographic":return Fn.CJK_IDEOGRAPHIC;case"devanagari":return Fn.DEVANAGARI;case"ethiopic-numeric":return Fn.ETHIOPIC_NUMERIC;case"georgian":return Fn.GEORGIAN;case"gujarati":return Fn.GUJARATI;case"gurmukhi":return Fn.GURMUKHI;case"hebrew":return Fn.HEBREW;case"hiragana":return Fn.HIRAGANA;case"hiragana-iroha":return Fn.HIRAGANA_IROHA;case"japanese-formal":return Fn.JAPANESE_FORMAL;case"japanese-informal":return Fn.JAPANESE_INFORMAL;case"kannada":return Fn.KANNADA;case"katakana":return Fn.KATAKANA;case"katakana-iroha":return Fn.KATAKANA_IROHA;case"khmer":return Fn.KHMER;case"korean-hangul-formal":return Fn.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return Fn.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return Fn.KOREAN_HANJA_INFORMAL;case"lao":return Fn.LAO;case"lower-armenian":return Fn.LOWER_ARMENIAN;case"malayalam":return Fn.MALAYALAM;case"mongolian":return Fn.MONGOLIAN;case"myanmar":return Fn.MYANMAR;case"oriya":return Fn.ORIYA;case"persian":return Fn.PERSIAN;case"simp-chinese-formal":return Fn.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return Fn.SIMP_CHINESE_INFORMAL;case"tamil":return Fn.TAMIL;case"telugu":return Fn.TELUGU;case"thai":return Fn.THAI;case"tibetan":return Fn.TIBETAN;case"trad-chinese-formal":return Fn.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return Fn.TRAD_CHINESE_INFORMAL;case"upper-armenian":return Fn.UPPER_ARMENIAN;case"disclosure-open":return Fn.DISCLOSURE_OPEN;case"disclosure-closed":return Fn.DISCLOSURE_CLOSED;case"none":default:return Fn.NONE}}},Hn=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:ot.TOKEN_VALUE}},Tn=Hn("top"),Nn=Hn("right"),_n=Hn("bottom"),Mn=Hn("left");!function(e){e[e.VISIBLE=0]="VISIBLE",e[e.HIDDEN=1]="HIDDEN",e[e.SCROLL=2]="SCROLL",e[e.AUTO=3]="AUTO"}(Sn||(Sn={}));var Rn,Dn={name:"overflow",initialValue:"visible",prefix:!1,type:ot.LIST,parse:function(e){return e.filter(Ne).map((function(e){switch(e.value){case"hidden":return Sn.HIDDEN;case"scroll":return Sn.SCROLL;case"auto":return Sn.AUTO;case"visible":default:return Sn.VISIBLE}}))}};!function(e){e.NORMAL="normal",e.BREAK_WORD="break-word"}(Rn||(Rn={}));var Pn,kn={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"break-word":return Rn.BREAK_WORD;case"normal":default:return Rn.NORMAL}}},In=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:ot.TYPE_VALUE,format:"length-percentage"}},Kn=In("top"),Ln=In("right"),zn=In("bottom"),jn=In("left");!function(e){e[e.LEFT=0]="LEFT",e[e.CENTER=1]="CENTER",e[e.RIGHT=2]="RIGHT"}(Pn||(Pn={}));var Xn,Gn={name:"text-align",initialValue:"left",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"right":return Pn.RIGHT;case"center":case"justify":return Pn.CENTER;case"left":default:return Pn.LEFT}}};!function(e){e[e.STATIC=0]="STATIC",e[e.RELATIVE=1]="RELATIVE",e[e.ABSOLUTE=2]="ABSOLUTE",e[e.FIXED=3]="FIXED",e[e.STICKY=4]="STICKY"}(Xn||(Xn={}));var Vn,Yn={name:"position",initialValue:"static",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"relative":return Xn.RELATIVE;case"absolute":return Xn.ABSOLUTE;case"fixed":return Xn.FIXED;case"sticky":return Xn.STICKY}return Xn.STATIC}},Wn={name:"text-shadow",initialValue:"none",type:ot.LIST,prefix:!1,parse:function(e){return 1===e.length&&Me(e[0],"none")?[]:Pe(e).map((function(e){for(var t={color:lt.TRANSPARENT,offsetX:ze,offsetY:ze,blur:ze},n=0,r=0;r1?1:0],this.overflowWrap=Fr(kn,e.overflowWrap),this.paddingTop=Fr(Kn,e.paddingTop),this.paddingRight=Fr(Ln,e.paddingRight),this.paddingBottom=Fr(zn,e.paddingBottom),this.paddingLeft=Fr(jn,e.paddingLeft),this.position=Fr(Yn,e.position),this.textAlign=Fr(Gn,e.textAlign),this.textDecorationColor=Fr(lr,e.textDecorationColor||e.color),this.textDecorationLine=Fr(ur,e.textDecorationLine),this.textShadow=Fr(Wn,e.textShadow),this.textTransform=Fr(qn,e.textTransform),this.transform=Fr(Zn,e.transform),this.transformOrigin=Fr(nr,e.transformOrigin),this.visibility=Fr(ir,e.visibility),this.wordBreak=Fr(ar,e.wordBreak),this.zIndex=Fr(Ar,e.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===Jn.VISIBLE},e.prototype.isTransparent=function(){return $e(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return this.position!==Xn.STATIC},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==an.NONE},e.prototype.isInlineLevel=function(){return vr(this.display,4)||vr(this.display,33554432)||vr(this.display,268435456)||vr(this.display,536870912)||vr(this.display,67108864)||vr(this.display,134217728)},e}(),Qr=function(e){this.content=Fr(Br,e.content),this.quotes=Fr(wr,e.quotes)},xr=function(e){this.counterIncrement=Fr(mr,e.counterIncrement),this.counterReset=Fr(br,e.counterReset)},Fr=function(e,t){var n=new Se,r=null!==t&&"undefined"!==typeof t?t.toString():e.initialValue;n.write(r);var i=new Oe(n.read());switch(e.type){case ot.IDENT_VALUE:var o=i.parseComponentValue();return e.parse(Ne(o)?o.value:e.initialValue);case ot.VALUE:return e.parse(i.parseComponentValue());case ot.LIST:return e.parse(i.parseComponentValues());case ot.TOKEN_VALUE:return i.parseComponentValue();case ot.TYPE_VALUE:switch(e.format){case"angle":return Ye(i.parseComponentValue());case"color":return Ze(i.parseComponentValue());case"image":return Pt(i.parseComponentValue());case"length":var a=i.parseComponentValue();return Ie(a)?a:ze;case"length-percentage":var A=i.parseComponentValue();return Ke(A)?A:ze}}throw new Error("Attempting to parse unsupported css format type "+e.format)},Ur=function(e){this.styles=new Cr(window.getComputedStyle(e,null)),this.textNodes=[],this.elements=[],null!==this.styles.transform&&ii(e)&&(e.style.transform="none"),this.bounds=a(e),this.flags=0},Sr=function(e,t){this.text=e,this.bounds=t},Or=function(e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var r=e.parentNode;if(r){r.replaceChild(n,e);var i=a(n);return n.firstChild&&r.replaceChild(n.firstChild,n),i}}return new o(0,0,0,0)},Hr=function(e,t,n){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(e,t),i.setEnd(e,t+n),o.fromClientRect(i.getBoundingClientRect())},Tr=function(e,t){return 0!==t.letterSpacing?A(e).map((function(e){return s(e)})):Nr(e,t)},Nr=function(e,t){for(var n,r=function(e,t){var n=A(e),r=J(n,t),i=r[0],o=r[1],a=r[2],s=n.length,l=0,u=0;return{next:function(){if(u>=s)return{done:!0,value:null};for(var e="\xd7";u0)if(Ct.SUPPORT_RANGE_BOUNDS)i.push(new Sr(e,Hr(n,o,e.length)));else{var r=n.splitText(e.length);i.push(new Sr(e,Or(n))),n=r}else Ct.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));o+=e.length})),i}(this.text,t,e)},Mr=function(e,t){switch(t){case Vn.LOWERCASE:return e.toLowerCase();case Vn.CAPITALIZE:return e.replace(Rr,Dr);case Vn.UPPERCASE:return e.toUpperCase();default:return e}},Rr=/(^|\s|:|-|\(|\))([a-z])/g,Dr=function(e,t,n){return e.length>0?t+n.toUpperCase():e},Pr=function(e){function n(t){var n=e.call(this,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,xt.getInstance().addImage(n.src),n}return t(n,e),n}(Ur),kr=function(e){function n(t){var n=e.call(this,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return t(n,e),n}(Ur),Ir=function(e){function n(t){var n=e.call(this,t)||this,r=new XMLSerializer;return n.svg="data:image/svg+xml,"+encodeURIComponent(r.serializeToString(t)),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,xt.getInstance().addImage(n.svg),n}return t(n,e),n}(Ur),Kr=function(e){function n(t){var n=e.call(this,t)||this;return n.value=t.value,n}return t(n,e),n}(Ur),Lr=function(e){function n(t){var n=e.call(this,t)||this;return n.start=t.start,n.reversed="boolean"===typeof t.reversed&&!0===t.reversed,n}return t(n,e),n}(Ur),zr=[{type:f.DIMENSION_TOKEN,flags:0,unit:"px",number:3}],jr=[{type:f.PERCENTAGE_TOKEN,flags:0,number:50}],Xr="password",Gr=function(e){function n(t){var n,r=e.call(this,t)||this;switch(r.type=t.type.toLowerCase(),r.checked=t.checked,r.value=function(e){var t=e.type===Xr?new Array(e.value.length+1).join("\u2022"):e.value;return 0===t.length?e.placeholder||"":t}(t),"checkbox"!==r.type&&"radio"!==r.type||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=Gt.SOLID,r.styles.backgroundClip=[at.BORDER_BOX],r.styles.backgroundOrigin=[0],r.bounds=(n=r.bounds).width>n.height?new o(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width0)n.textNodes.push(new _r(i,n.styles));else if(ri(i)){var a=Zr(i);a.styles.isVisible()&&(ei(i,a,r)?a.flags|=4:ti(a.styles)&&(a.flags|=2),-1!==qr.indexOf(i.tagName)&&(a.flags|=8),n.elements.push(a),gi(i)||li(i)||vi(i)||e(i,a,r))}}(e,t,t),t},ei=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||ui(e)&&n.styles.isTransparent()},ti=function(e){return e.isPositioned()||e.isFloating()},ni=function(e){return e.nodeType===Node.TEXT_NODE},ri=function(e){return e.nodeType===Node.ELEMENT_NODE},ii=function(e){return ri(e)&&"undefined"!==typeof e.style&&!oi(e)},oi=function(e){return"object"===typeof e.className},ai=function(e){return"LI"===e.tagName},Ai=function(e){return"OL"===e.tagName},si=function(e){return"INPUT"===e.tagName},li=function(e){return"svg"===e.tagName},ui=function(e){return"BODY"===e.tagName},ci=function(e){return"CANVAS"===e.tagName},fi=function(e){return"IMG"===e.tagName},di=function(e){return"IFRAME"===e.tagName},pi=function(e){return"STYLE"===e.tagName},hi=function(e){return"SCRIPT"===e.tagName},gi=function(e){return"TEXTAREA"===e.tagName},vi=function(e){return"SELECT"===e.tagName},Bi=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach((function(e){return t.counters[e].pop()}))},e.prototype.parse=function(e){var t=this,n=e.counterIncrement,r=e.counterReset,i=!0;null!==n&&n.forEach((function(e){var n=t.counters[e.counter];n&&0!==e.increment&&(i=!1,n[Math.max(0,n.length-1)]+=e.increment)}));var o=[];return i&&r.forEach((function(e){var n=t.counters[e.counter];o.push(e.counter),n||(n=t.counters[e.counter]=[]),n.push(e.reset)})),o},e}(),mi={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},bi={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054f","\u054e","\u054d","\u054c","\u054b","\u054a","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053f","\u053e","\u053d","\u053c","\u053b","\u053a","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},wi={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05d9\u05f3","\u05d8\u05f3","\u05d7\u05f3","\u05d6\u05f3","\u05d5\u05f3","\u05d4\u05f3","\u05d3\u05f3","\u05d2\u05f3","\u05d1\u05f3","\u05d0\u05f3","\u05ea","\u05e9","\u05e8","\u05e7","\u05e6","\u05e4","\u05e2","\u05e1","\u05e0","\u05de","\u05dc","\u05db","\u05d9\u05d8","\u05d9\u05d7","\u05d9\u05d6","\u05d8\u05d6","\u05d8\u05d5","\u05d9","\u05d8","\u05d7","\u05d6","\u05d5","\u05d4","\u05d3","\u05d2","\u05d1","\u05d0"]},Ei={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10f5","\u10f0","\u10ef","\u10f4","\u10ee","\u10ed","\u10ec","\u10eb","\u10ea","\u10e9","\u10e8","\u10e7","\u10e6","\u10e5","\u10e4","\u10f3","\u10e2","\u10e1","\u10e0","\u10df","\u10de","\u10dd","\u10f2","\u10dc","\u10db","\u10da","\u10d9","\u10d8","\u10d7","\u10f1","\u10d6","\u10d5","\u10d4","\u10d3","\u10d2","\u10d1","\u10d0"]},yi=function(e,t,n,r,i,o){return en?Ui(e,i,o.length>0):r.integers.reduce((function(t,n,i){for(;e>=n;)e-=n,t+=r.values[i];return t}),"")+o},Ci=function(e,t,n,r){var i="";do{n||e--,i=r(e)+i,e/=t}while(e*t>=t);return i},Qi=function(e,t,n,r,i){var o=n-t+1;return(e<0?"-":"")+(Ci(Math.abs(e),o,r,(function(e){return s(Math.floor(e%o)+t)}))+i)},xi=function(e,t,n){void 0===n&&(n=". ");var r=t.length;return Ci(Math.abs(e),r,!1,(function(e){return t[Math.floor(e%r)]}))+n},Fi=function(e,t,n,r,i,o){if(e<-9999||e>9999)return Ui(e,Fn.CJK_DECIMAL,i.length>0);var a=Math.abs(e),A=i;if(0===a)return t[0]+A;for(var s=0;a>0&&s<=4;s++){var l=a%10;0===l&&vr(o,1)&&""!==A?A=t[l]+A:l>1||1===l&&0===s||1===l&&1===s&&vr(o,2)||1===l&&1===s&&vr(o,4)&&e>100||1===l&&s>1&&vr(o,8)?A=t[l]+(s>0?n[s-1]:"")+A:1===l&&s>0&&(A=n[s-1]+A),a=Math.floor(a/10)}return(e<0?r:"")+A},Ui=function(e,t,n){var r=n?". ":"",i=n?"\u3001":"",o=n?", ":"",a=n?" ":"";switch(t){case Fn.DISC:return"\u2022"+a;case Fn.CIRCLE:return"\u25e6"+a;case Fn.SQUARE:return"\u25fe"+a;case Fn.DECIMAL_LEADING_ZERO:var A=Qi(e,48,57,!0,r);return A.length<4?"0"+A:A;case Fn.CJK_DECIMAL:return xi(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",i);case Fn.LOWER_ROMAN:return yi(e,1,3999,mi,Fn.DECIMAL,r).toLowerCase();case Fn.UPPER_ROMAN:return yi(e,1,3999,mi,Fn.DECIMAL,r);case Fn.LOWER_GREEK:return Qi(e,945,969,!1,r);case Fn.LOWER_ALPHA:return Qi(e,97,122,!1,r);case Fn.UPPER_ALPHA:return Qi(e,65,90,!1,r);case Fn.ARABIC_INDIC:return Qi(e,1632,1641,!0,r);case Fn.ARMENIAN:case Fn.UPPER_ARMENIAN:return yi(e,1,9999,bi,Fn.DECIMAL,r);case Fn.LOWER_ARMENIAN:return yi(e,1,9999,bi,Fn.DECIMAL,r).toLowerCase();case Fn.BENGALI:return Qi(e,2534,2543,!0,r);case Fn.CAMBODIAN:case Fn.KHMER:return Qi(e,6112,6121,!0,r);case Fn.CJK_EARTHLY_BRANCH:return xi(e,"\u5b50\u4e11\u5bc5\u536f\u8fb0\u5df3\u5348\u672a\u7533\u9149\u620c\u4ea5",i);case Fn.CJK_HEAVENLY_STEM:return xi(e,"\u7532\u4e59\u4e19\u4e01\u620a\u5df1\u5e9a\u8f9b\u58ec\u7678",i);case Fn.CJK_IDEOGRAPHIC:case Fn.TRAD_CHINESE_INFORMAL:return Fi(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\u8ca0",i,14);case Fn.TRAD_CHINESE_FORMAL:return Fi(e,"\u96f6\u58f9\u8cb3\u53c3\u8086\u4f0d\u9678\u67d2\u634c\u7396","\u62fe\u4f70\u4edf\u842c","\u8ca0",i,15);case Fn.SIMP_CHINESE_INFORMAL:return Fi(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\u8d1f",i,14);case Fn.SIMP_CHINESE_FORMAL:return Fi(e,"\u96f6\u58f9\u8d30\u53c1\u8086\u4f0d\u9646\u67d2\u634c\u7396","\u62fe\u4f70\u4edf\u842c","\u8d1f",i,15);case Fn.JAPANESE_INFORMAL:return Fi(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u4e07","\u30de\u30a4\u30ca\u30b9",i,0);case Fn.JAPANESE_FORMAL:return Fi(e,"\u96f6\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343\u4e07","\u30de\u30a4\u30ca\u30b9",i,7);case Fn.KOREAN_HANGUL_FORMAL:return Fi(e,"\uc601\uc77c\uc774\uc0bc\uc0ac\uc624\uc721\uce60\ud314\uad6c","\uc2ed\ubc31\ucc9c\ub9cc","\ub9c8\uc774\ub108\uc2a4",o,7);case Fn.KOREAN_HANJA_INFORMAL:return Fi(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\ub9c8\uc774\ub108\uc2a4",o,0);case Fn.KOREAN_HANJA_FORMAL:return Fi(e,"\u96f6\u58f9\u8cb3\u53c3\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343","\ub9c8\uc774\ub108\uc2a4",o,7);case Fn.DEVANAGARI:return Qi(e,2406,2415,!0,r);case Fn.GEORGIAN:return yi(e,1,19999,Ei,Fn.DECIMAL,r);case Fn.GUJARATI:return Qi(e,2790,2799,!0,r);case Fn.GURMUKHI:return Qi(e,2662,2671,!0,r);case Fn.HEBREW:return yi(e,1,10999,wi,Fn.DECIMAL,r);case Fn.HIRAGANA:return xi(e,"\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3053\u3055\u3057\u3059\u305b\u305d\u305f\u3061\u3064\u3066\u3068\u306a\u306b\u306c\u306d\u306e\u306f\u3072\u3075\u3078\u307b\u307e\u307f\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308a\u308b\u308c\u308d\u308f\u3090\u3091\u3092\u3093");case Fn.HIRAGANA_IROHA:return xi(e,"\u3044\u308d\u306f\u306b\u307b\u3078\u3068\u3061\u308a\u306c\u308b\u3092\u308f\u304b\u3088\u305f\u308c\u305d\u3064\u306d\u306a\u3089\u3080\u3046\u3090\u306e\u304a\u304f\u3084\u307e\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304d\u3086\u3081\u307f\u3057\u3091\u3072\u3082\u305b\u3059");case Fn.KANNADA:return Qi(e,3302,3311,!0,r);case Fn.KATAKANA:return xi(e,"\u30a2\u30a4\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f0\u30f1\u30f2\u30f3",i);case Fn.KATAKANA_IROHA:return xi(e,"\u30a4\u30ed\u30cf\u30cb\u30db\u30d8\u30c8\u30c1\u30ea\u30cc\u30eb\u30f2\u30ef\u30ab\u30e8\u30bf\u30ec\u30bd\u30c4\u30cd\u30ca\u30e9\u30e0\u30a6\u30f0\u30ce\u30aa\u30af\u30e4\u30de\u30b1\u30d5\u30b3\u30a8\u30c6\u30a2\u30b5\u30ad\u30e6\u30e1\u30df\u30b7\u30f1\u30d2\u30e2\u30bb\u30b9",i);case Fn.LAO:return Qi(e,3792,3801,!0,r);case Fn.MONGOLIAN:return Qi(e,6160,6169,!0,r);case Fn.MYANMAR:return Qi(e,4160,4169,!0,r);case Fn.ORIYA:return Qi(e,2918,2927,!0,r);case Fn.PERSIAN:return Qi(e,1776,1785,!0,r);case Fn.TAMIL:return Qi(e,3046,3055,!0,r);case Fn.TELUGU:return Qi(e,3174,3183,!0,r);case Fn.THAI:return Qi(e,3664,3673,!0,r);case Fn.TIBETAN:return Qi(e,3872,3881,!0,r);case Fn.DECIMAL:default:return Qi(e,48,57,!0,r)}},Si=function(){function e(e,t){if(this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Bi,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement)}return e.prototype.toIFrame=function(e,t){var n=this,o=Hi(e,t);if(!o.contentWindow)return Promise.reject("Unable to find iframe window");var a=e.defaultView.pageXOffset,A=e.defaultView.pageYOffset,s=o.contentWindow,l=s.document,u=Ti(o).then((function(){return r(n,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return this.scrolledElements.forEach(Ri),s&&(s.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===t.top&&s.scrollX===t.left||(l.documentElement.style.top=-t.top+"px",l.documentElement.style.left=-t.left+"px",l.documentElement.style.position="absolute")),e=this.options.onclone,"undefined"===typeof this.clonedReferenceElement?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:l.fonts&&l.fonts.ready?[4,l.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return"function"===typeof e?[2,Promise.resolve().then((function(){return e(l)})).then((function(){return o}))]:[2,o]}}))}))}));return l.open(),l.write(_i(document.doctype)+""),Mi(this.referenceElement.ownerDocument,a,A),l.replaceChild(l.adoptNode(this.documentElement),l.documentElement),l.close(),u},e.prototype.createElementClone=function(e){if(ci(e))return this.createCanvasClone(e);if(pi(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return fi(t)&&"lazy"===t.loading&&(t.loading="eager"),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var n=[].slice.call(t.cssRules,0).reduce((function(e,t){return t&&"string"===typeof t.cssText?e+t.cssText:e}),""),r=e.cloneNode(!1);return r.textContent=n,r}}catch(i){if(Qt.getInstance(this.options.id).error("Unable to access cssRules property",i),"SecurityError"!==i.name)throw i}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){if(this.options.inlineImages&&e.ownerDocument){var t=e.ownerDocument.createElement("img");try{return t.src=e.toDataURL(),t}catch(o){Qt.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted")}}var n=e.cloneNode(!1);try{n.width=e.width,n.height=e.height;var r=e.getContext("2d"),i=n.getContext("2d");return i&&(r?i.putImageData(r.getImageData(0,0,e.width,e.height),0,0):i.drawImage(e,0,0)),n}catch(o){}return n},e.prototype.cloneNode=function(e){if(ni(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var t=e.ownerDocument.defaultView;if(t&&ri(e)&&(ii(e)||oi(e))){var n=this.createElementClone(e),r=t.getComputedStyle(e),i=t.getComputedStyle(e,":before"),o=t.getComputedStyle(e,":after");this.referenceElement===e&&ii(n)&&(this.clonedReferenceElement=n),ui(n)&&ki(n);for(var a=this.counters.parse(new xr(r)),A=this.resolvePseudoContent(e,n,i,hr.BEFORE),s=e.firstChild;s;s=s.nextSibling)ri(s)&&(hi(s)||s.hasAttribute("data-html2canvas-ignore")||"function"===typeof this.options.ignoreElements&&this.options.ignoreElements(s))||this.options.copyStyles&&ri(s)&&pi(s)||n.appendChild(this.cloneNode(s));A&&n.insertBefore(A,n.firstChild);var l=this.resolvePseudoContent(e,n,o,hr.AFTER);return l&&n.appendChild(l),this.counters.pop(a),r&&(this.options.copyStyles||oi(e))&&!di(e)&&Ni(r,n),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([n,e.scrollLeft,e.scrollTop]),(gi(e)||vi(e))&&(gi(n)||vi(n))&&(n.value=e.value),n}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,n,r){var i=this;if(n){var o=n.content,a=t.ownerDocument;if(a&&o&&"none"!==o&&"-moz-alt-content"!==o&&"none"!==n.display){this.counters.parse(new xr(n));var A=new Qr(n),s=a.createElement("html2canvaspseudoelement");Ni(n,s),A.content.forEach((function(t){if(t.type===f.STRING_TOKEN)s.appendChild(a.createTextNode(t.value));else if(t.type===f.URL_TOKEN){var n=a.createElement("img");n.src=t.value,n.style.opacity="1",s.appendChild(n)}else if(t.type===f.FUNCTION){if("attr"===t.name){var r=t.values.filter(Ne);r.length&&s.appendChild(a.createTextNode(e.getAttribute(r[0].value)||""))}else if("counter"===t.name){var o=t.values.filter(De),l=o[0],u=o[1];if(l&&Ne(l)){var c=i.counters.getCounterValue(l.value),d=u&&Ne(u)?On.parse(u.value):Fn.DECIMAL;s.appendChild(a.createTextNode(Ui(c,d,!1)))}}else if("counters"===t.name){var p=t.values.filter(De),h=(l=p[0],p[1]);if(u=p[2],l&&Ne(l)){var g=i.counters.getCounterValues(l.value),v=u&&Ne(u)?On.parse(u.value):Fn.DECIMAL,B=h&&h.type===f.STRING_TOKEN?h.value:"",m=g.map((function(e){return Ui(e,v,!1)})).join(B);s.appendChild(a.createTextNode(m))}}}else if(t.type===f.IDENT_TOKEN)switch(t.value){case"open-quote":s.appendChild(a.createTextNode(Er(A.quotes,i.quoteDepth++,!0)));break;case"close-quote":s.appendChild(a.createTextNode(Er(A.quotes,--i.quoteDepth,!1)));break;default:s.appendChild(a.createTextNode(t.value))}})),s.className=Di+" "+Pi;var l=r===hr.BEFORE?" "+Di:" "+Pi;return oi(t)?t.className.baseValue+=l:t.className+=l,s}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(hr||(hr={}));var Oi,Hi=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute("data-html2canvas-ignore","true"),e.body.appendChild(n),n},Ti=function(e){return new Promise((function(t,n){var r=e.contentWindow;if(!r)return n("No window assigned for iframe");var i=r.document;r.onload=e.onload=i.onreadystatechange=function(){r.onload=e.onload=i.onreadystatechange=null;var n=setInterval((function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(n),t(e))}),50)}}))},Ni=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);"content"!==r&&t.style.setProperty(r,e.getPropertyValue(r))}return t},_i=function(e){var t="";return e&&(t+=""),t},Mi=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},Ri=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},Di="___html2canvas___pseudoelement_before",Pi="___html2canvas___pseudoelement_after",ki=function(e){Ii(e,"."+Di+':before{\n content: "" !important;\n display: none !important;\n}\n .'+Pi+':after{\n content: "" !important;\n display: none !important;\n}')},Ii=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement("style");r.textContent=t,e.appendChild(r)}};!function(e){e[e.VECTOR=0]="VECTOR",e[e.BEZIER_CURVE=1]="BEZIER_CURVE"}(Oi||(Oi={}));var Ki,Li=function(e,t){return e.length===t.length&&e.some((function(e,n){return e===t[n]}))},zi=function(){function e(e,t){this.type=Oi.VECTOR,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),ji=function(e,t,n){return new zi(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},Xi=function(){function e(e,t,n,r){this.type=Oi.BEZIER_CURVE,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=ji(this.start,this.startControl,t),i=ji(this.startControl,this.endControl,t),o=ji(this.endControl,this.end,t),a=ji(r,i,t),A=ji(i,o,t),s=ji(a,A,t);return n?new e(this.start,r,a,s):new e(s,A,o,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Gi=function(e){return e.type===Oi.BEZIER_CURVE},Vi=function(e){var t=e.styles,n=e.bounds,r=Ge(t.borderTopLeftRadius,n.width,n.height),i=r[0],o=r[1],a=Ge(t.borderTopRightRadius,n.width,n.height),A=a[0],s=a[1],l=Ge(t.borderBottomRightRadius,n.width,n.height),u=l[0],c=l[1],f=Ge(t.borderBottomLeftRadius,n.width,n.height),d=f[0],p=f[1],h=[];h.push((i+A)/n.width),h.push((d+u)/n.width),h.push((o+p)/n.height),h.push((s+c)/n.height);var g=Math.max.apply(Math,h);g>1&&(i/=g,o/=g,A/=g,s/=g,u/=g,c/=g,d/=g,p/=g);var v=n.width-A,B=n.height-c,m=n.width-u,b=n.height-p,w=t.borderTopWidth,E=t.borderRightWidth,y=t.borderBottomWidth,C=t.borderLeftWidth,Q=Ve(t.paddingTop,e.bounds.width),x=Ve(t.paddingRight,e.bounds.width),F=Ve(t.paddingBottom,e.bounds.width),U=Ve(t.paddingLeft,e.bounds.width);this.topLeftBorderBox=i>0||o>0?Yi(n.left,n.top,i,o,Ki.TOP_LEFT):new zi(n.left,n.top),this.topRightBorderBox=A>0||s>0?Yi(n.left+v,n.top,A,s,Ki.TOP_RIGHT):new zi(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||c>0?Yi(n.left+m,n.top+B,u,c,Ki.BOTTOM_RIGHT):new zi(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=d>0||p>0?Yi(n.left,n.top+b,d,p,Ki.BOTTOM_LEFT):new zi(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||o>0?Yi(n.left+C,n.top+w,Math.max(0,i-C),Math.max(0,o-w),Ki.TOP_LEFT):new zi(n.left+C,n.top+w),this.topRightPaddingBox=A>0||s>0?Yi(n.left+Math.min(v,n.width+C),n.top+w,v>n.width+C?0:A-C,s-w,Ki.TOP_RIGHT):new zi(n.left+n.width-E,n.top+w),this.bottomRightPaddingBox=u>0||c>0?Yi(n.left+Math.min(m,n.width-C),n.top+Math.min(B,n.height+w),Math.max(0,u-E),c-y,Ki.BOTTOM_RIGHT):new zi(n.left+n.width-E,n.top+n.height-y),this.bottomLeftPaddingBox=d>0||p>0?Yi(n.left+C,n.top+b,Math.max(0,d-C),p-y,Ki.BOTTOM_LEFT):new zi(n.left+C,n.top+n.height-y),this.topLeftContentBox=i>0||o>0?Yi(n.left+C+U,n.top+w+Q,Math.max(0,i-(C+U)),Math.max(0,o-(w+Q)),Ki.TOP_LEFT):new zi(n.left+C+U,n.top+w+Q),this.topRightContentBox=A>0||s>0?Yi(n.left+Math.min(v,n.width+C+U),n.top+w+Q,v>n.width+C+U?0:A-C+U,s-(w+Q),Ki.TOP_RIGHT):new zi(n.left+n.width-(E+x),n.top+w+Q),this.bottomRightContentBox=u>0||c>0?Yi(n.left+Math.min(m,n.width-(C+U)),n.top+Math.min(B,n.height+w+Q),Math.max(0,u-(E+x)),c-(y+F),Ki.BOTTOM_RIGHT):new zi(n.left+n.width-(E+x),n.top+n.height-(y+F)),this.bottomLeftContentBox=d>0||p>0?Yi(n.left+C+U,n.top+b,Math.max(0,d-(C+U)),p-(y+F),Ki.BOTTOM_LEFT):new zi(n.left+C+U,n.top+n.height-(y+F))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Ki||(Ki={}));var Yi=function(e,t,n,r,i){var o=(Math.sqrt(2)-1)/3*4,a=n*o,A=r*o,s=e+n,l=t+r;switch(i){case Ki.TOP_LEFT:return new Xi(new zi(e,l),new zi(e,l-A),new zi(s-a,t),new zi(s,t));case Ki.TOP_RIGHT:return new Xi(new zi(e,t),new zi(e+a,t),new zi(s,l-A),new zi(s,l));case Ki.BOTTOM_RIGHT:return new Xi(new zi(s,t),new zi(s,t+A),new zi(e+a,l),new zi(e,l));case Ki.BOTTOM_LEFT:default:return new Xi(new zi(s,l),new zi(s-a,l),new zi(e,t+A),new zi(e,t))}},Wi=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Ji=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},qi=function(e,t,n){this.type=0,this.offsetX=e,this.offsetY=t,this.matrix=n,this.target=6},Zi=function(e,t){this.type=1,this.target=t,this.path=e},$i=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},eo=function(){function e(e,t){if(this.container=e,this.effects=t.slice(0),this.curves=new Vi(e),null!==e.styles.transform){var n=e.bounds.left+e.styles.transformOrigin[0].number,r=e.bounds.top+e.styles.transformOrigin[1].number,i=e.styles.transform;this.effects.push(new qi(n,r,i))}if(e.styles.overflowX!==Sn.VISIBLE){var o=Wi(this.curves),a=Ji(this.curves);Li(o,a)?this.effects.push(new Zi(o,6)):(this.effects.push(new Zi(o,2)),this.effects.push(new Zi(a,4)))}}return e.prototype.getParentEffects=function(){var e=this.effects.slice(0);if(this.container.styles.overflowX!==Sn.VISIBLE){var t=Wi(this.curves),n=Ji(this.curves);Li(t,n)||e.push(new Zi(n,6))}return e},e}(),to=function(e,t){for(var n=e instanceof Lr?e.start:1,r=e instanceof Lr&&e.reversed,i=0;ie.element.container.styles.zIndex.order?(d=t,!1):d>0})),u.negativeZIndex.splice(d,0,c)}else if(f>0){var p=0;u.positiveZIndex.some((function(e,t){return f>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0})),u.positiveZIndex.splice(p,0,c)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else o.styles.isFloating()?u.nonPositionedFloats.push(c):u.nonPositionedInlineLevel.push(c);e(s,c,a?c:r,l)}else o.styles.isInlineLevel()?n.inlineLevel.push(s):n.nonInlineLevel.push(s),e(s,n,r,l);vr(o.flags,8)&&to(o,l)}))}(t,n,n,r),to(t.container,r),n},ro=function(e,t,n,r){var i=[];return Gi(e)?i.push(e.subdivide(.5,!1)):i.push(e),Gi(n)?i.push(n.subdivide(.5,!0)):i.push(n),Gi(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Gi(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},io=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},oo=function(e){var t=e.styles,n=e.bounds,r=Ve(t.paddingLeft,n.width),i=Ve(t.paddingRight,n.width),o=Ve(t.paddingTop,n.width),a=Ve(t.paddingBottom,n.width);return n.add(r+t.borderLeftWidth,o+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+i),-(t.borderTopWidth+t.borderBottomWidth+o+a))},ao=function(e,t,n){var r=function(e,t){return 0===e?t.bounds:2===e?oo(t):io(t)}(uo(e.styles.backgroundOrigin,t),e),i=function(e,t){return e===at.BORDER_BOX?t.bounds:e===at.CONTENT_BOX?oo(t):io(t)}(uo(e.styles.backgroundClip,t),e),o=lo(uo(e.styles.backgroundSize,t),n,r),a=o[0],A=o[1],s=Ge(uo(e.styles.backgroundPosition,t),r.width-a,r.height-A);return[co(uo(e.styles.backgroundRepeat,t),s,o,r,i),Math.round(r.left+s[0]),Math.round(r.top+s[1]),a,A]},Ao=function(e){return Ne(e)&&e.value===zt.AUTO},so=function(e){return"number"===typeof e},lo=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=e[0],A=e[1];if(Ke(a)&&A&&Ke(A))return[Ve(a,n.width),Ve(A,n.height)];var s=so(o);if(Ne(a)&&(a.value===zt.CONTAIN||a.value===zt.COVER))return so(o)?n.width/n.height0&&e.intrinsicHeight>0){var r=oo(e),i=Ji(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return r(this,void 0,void 0,(function(){var n,r,a,A,s,l,u,c,d,p,h,g,v,B;return i(this,(function(i){switch(i.label){case 0:this.applyEffects(t.effects,4),n=t.container,r=t.curves,a=n.styles,A=0,s=n.textNodes,i.label=1;case 1:return A0&&C>0&&(B=r.ctx.createPattern(h,"repeat"),r.renderRepeat(b,B,x,F))):function(e){return e.type===ut.RADIAL_GRADIENT}(n)&&(m=ao(e,t,[null,null,null]),b=m[0],w=m[1],E=m[2],y=m[3],C=m[4],Q=0===n.position.length?[je]:n.position,x=Ve(Q[0],y),F=Ve(Q[Q.length-1],C),U=function(e,t,n,r,i){var o=0,a=0;switch(e.size){case ft.CLOSEST_SIDE:e.shape===ct.CIRCLE?o=a=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===ct.ELLIPSE&&(o=Math.min(Math.abs(t),Math.abs(t-r)),a=Math.min(Math.abs(n),Math.abs(n-i)));break;case ft.CLOSEST_CORNER:if(e.shape===ct.CIRCLE)o=a=Math.min(Bt(t,n),Bt(t,n-i),Bt(t-r,n),Bt(t-r,n-i));else if(e.shape===ct.ELLIPSE){var A=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(t),Math.abs(t-r)),s=mt(r,i,t,n,!0),l=s[0],u=s[1];a=A*(o=Bt(l-t,(u-n)/A))}break;case ft.FARTHEST_SIDE:e.shape===ct.CIRCLE?o=a=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===ct.ELLIPSE&&(o=Math.max(Math.abs(t),Math.abs(t-r)),a=Math.max(Math.abs(n),Math.abs(n-i)));break;case ft.FARTHEST_CORNER:if(e.shape===ct.CIRCLE)o=a=Math.max(Bt(t,n),Bt(t,n-i),Bt(t-r,n),Bt(t-r,n-i));else if(e.shape===ct.ELLIPSE){A=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(t),Math.abs(t-r));var c=mt(r,i,t,n,!1);l=c[0],u=c[1],a=A*(o=Bt(l-t,(u-n)/A))}}return Array.isArray(e.size)&&(o=Ve(e.size[0],r),a=2===e.size.length?Ve(e.size[1],i):o),[o,a]}(n,x,F,y,C),S=U[0],O=U[1],S>0&&S>0&&(H=r.ctx.createRadialGradient(w+x,E+F,0,w+x,E+F,S),gt(n.stops,2*S).forEach((function(e){return H.addColorStop(e.stop,et(e.color))})),r.path(b),r.ctx.fillStyle=H,S!==O?(T=e.bounds.left+.5*e.bounds.width,N=e.bounds.top+.5*e.bounds.height,M=1/(_=O/S),r.ctx.save(),r.ctx.translate(T,N),r.ctx.transform(1,0,0,_,0,0),r.ctx.translate(-T,-N),r.ctx.fillRect(w,M*(E-N)+N,y,C*M),r.ctx.restore()):r.ctx.fill())),i.label=6;case 6:return t--,[2]}}))},r=this,o=0,a=e.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return o-1&&r.splice(o,1)}}else this._events[e]=[];else this._events={};return this},t.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise((function(t){n._addEvent(e,t,{once:!0})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var i=!1;return t.eventType=e,t.stop=function(){i=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;t=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function u(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=v.isContentEditable;if(m||b){if(c||p===v)return!1;if(p&&b&&p.isContentEditable&&p.contains(v))return!1}else if((l||"touchstart"===e.type)&&p){var w=p.tagName;(p.isContentEditable||g.indexOf(w)>-1)&&p.blur()}if(r.clientStores=[new h(u(e))],r.flag=!0,r.isDrag=!1,r.datas={},A&&(3===e.which||2===e.button))return r.initDrag(),!1;r.doubleFlag=Object(i.N)()-r.prevTime<200,!1===r.emit("dragStart",s({datas:r.datas,inputEvent:e,isTrusted:t,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()))&&r.initDrag(),r.flag&&l&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(d&&f&&a&&(E=setTimeout((function(){Object(i.q)(o,"touchstart",r.onDragStart,{passive:!1})}))),!d&&f&&a&&Object(i.P)(o,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),d&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=u(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",s({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,o=t.container;r.isTouch&&n&&Object(i.P)(o,"touchstart",r.onDragStart),r.flag=!1;var a=r.getCurrentStore().getPosition(),A=Object(i.N)(),l=!r.isDrag&&r.doubleFlag;r.prevTime=r.isDrag||l?0:A,r.emit("dragEnd",s({datas:r.datas,isDouble:l,isDrag:r.isDrag,inputEvent:e},a)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var o=[].concat(t);r.options=s({checkInput:!1,container:o.length>1?window:o[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,A=a.container,l=a.events,c=a.checkWindowBlur;if(r.isTouch=l.indexOf("touch")>-1,r.isMouse=l.indexOf("mouse")>-1,r.targets=o,r.isMouse&&(o.forEach((function(e){Object(i.q)(e,"mousedown",r.onDragStart)})),Object(i.q)(A,"mousemove",r.onDrag),Object(i.q)(A,"mouseup",r.onDragEnd),Object(i.q)(A,"contextmenu",r.onDragEnd)),c&&Object(i.q)(window,"blur",r.onBlur),r.isTouch){var f={passive:!1};o.forEach((function(e){Object(i.q)(e,"touchstart",r.onDragStart,f)})),Object(i.q)(A,"touchmove",r.onDrag,f),Object(i.q)(A,"touchend",r.onDragEnd,f),Object(i.q)(A,"touchcancel",r.onDragEnd,f)}return r}!function(e,t){function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isDoubleFlag=function(){return this.doubleFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),Object(i.P)(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){Object(i.P)(t,"mousedown",e.onDragStart)})),Object(i.P)(n,"mousemove",this.onDrag),Object(i.P)(n,"mouseup",this.onDragEnd),Object(i.P)(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){Object(i.P)(t,"touchstart",e.onDragStart)})),Object(i.P)(n,"touchstart",this.onDragStart),Object(i.P)(n,"touchmove",this.onDrag),Object(i.P)(n,"touchend",this.onDragEnd),Object(i.P)(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new h(u(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",s({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",s({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",s({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,s({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(a);var B=n(28),m=n(15),b=function(e,t){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function w(e){var t=e.container;return[t.scrollLeft,t.scrollTop]}var E=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.startRect=null,t.startPos=[],t.prevTime=0,t.timer=0,t}!function(e,t){function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.dragStart=function(e,t){var n=t.container.getBoundingClientRect(),r=n.top,i=n.left,o=n.width,a=n.height;this.startPos=[e.clientX,e.clientY],this.startRect={top:r,left:i,width:o,height:a}},n.drag=function(e,t){var n=this,r=e.clientX,o=e.clientY,a=t.container,A=t.threshold,s=void 0===A?0:A,l=t.throttleTime,u=void 0===l?0:l,c=t.getScrollPosition,f=void 0===c?w:c,d=this.startRect,p=this.startPos,h=Object(i.N)(),g=Math.max(u+this.prevTime-h,0),v=[0,0];if(d.top>o-s?(p[1]>d.top||op[1])&&(v[1]=1),d.left>r-s?(p[0]>d.left||rp[0])&&(v[0]=1),clearTimeout(this.timer),!v[0]&&!v[1])return!1;if(g>0)return this.timer=window.setTimeout((function(){n.drag(e,t)}),g),!1;this.prevTime=h;var B=f({container:a,direction:v});this.trigger("scroll",{container:a,direction:v,inputEvent:e});var m=f({container:a,direction:v}),b=m[0]-B[0],E=m[1]-B[1];return!(!b&&!E)&&(this.trigger("move",{offsetX:v[0]?b:0,offsetY:v[1]?E:0,inputEvent:e}),u&&(this.timer=window.setTimeout((function(){n.drag(e,t)}),u)),!0)},n.dragEnd=function(){clearTimeout(this.timer)},t}(m.a),y=n(25),C=n(16),Q=n(24),x=function(e,t){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function F(e,t){function n(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var U=function(){return(U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0){var f=Math.sqrt((a*a+s*s)/(1+t*t));a=(a>=0?1:-1)*(t*f),s=(s>=0?1:-1)*f}var d=Math.abs(a),p=Math.abs(s),h=a<0?u-n.left:n.right-u,g=s<0?c-n.top:n.bottom-c;a=(a>=0?1:-1)*(d=(r=Object(i.t)([d,p],[0,0],[h,g],!!t))[0]),s=(s>=0?1:-1)*(p=r[1]);var v=u+Math.min(0,a),B=c+Math.min(0,s);return{left:v,top:B,right:v+d,bottom:B+p,width:d,height:p}}function T(e){var t=e.getBoundingClientRect(),n=t.left,r=t.top,i=t.width,o=t.height;return{pos1:[n,r],pos2:[n+i,r],pos3:[n,r+o],pos4:[n+i,r+o]}}function N(e,t){var n=Object(B.b)(e,t),r=n.list,i=n.prevList,o=n.added,a=n.removed;return o.map((function(e){return r[e]})).concat(a.map((function(e){return i[e]})))}var _=Object(Q.a)("\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n"),M="selecto-selection "+_.className,R=["boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect","preventDragFromInside"],D=function(){for(var e=0,t=0,n=arguments.length;t-1);)m=m.parentElement;B=m?[m]:[]}var b=B.length>0,w=!u&&b;if(w&&!c)return e.stop(),!1;var E=A.type,y="mousedown"===E||"touchstart"===E;if(!(!(!e.isClick&&y)||n.trigger("dragStart",U({},e))))return e.stop(),!1;if(l?(B=N(n.selectedTargets,B),r.startPassedTargets=n.selectedTargets):r.startPassedTargets=[],n.select(n.selectedTargets,B,v,A,!0),r.startX=o,r.startY=a,r.selectFlag=!1,r.preventDragFromInside=!1,r.boundsArea=n.target.style.cssText+="left:0px;top:0px;transform: translate("+o+"px, "+a+"px)",w&&c)A.preventDefault(),p&&(n.selectEnd(r.startSelectedTargets,r.startPassedTargets,v,e),r.preventDragFromInside=!0);else{r.selectFlag=!0,"touchstart"===E&&A.preventDefault();var C=n.options.scrollOptions;C&&C.container&&n.dragScroll.dragStart(e,C)}return!0},n.onDrag=function(e){if(e.datas.selectFlag){var t=n.options.scrollOptions;if(t&&t.container&&n.dragScroll.drag(e,t))return}n.check(e)},n.onDragEnd=function(e){var t=e.datas,r=e.inputEvent,i=H(e,n.options.ratio),o=t.selectFlag;r&&!e.isClick&&n.trigger("dragEnd",U(U({isDouble:!!e.isDouble,isDrag:!1,isSelect:o},e),{rect:i})),n.target.style.cssText+="display: none;",o&&(t.selectFlag=!1,n.dragScroll.dragEnd()),t.preventDragFromInside||n.selectEnd(t.startSelectedTargets,t.startPassedTargets,i,e)},n.onKeyDown=function(e){n.sameCombiKey(e)&&(n.continueSelect=!0,n.trigger("keydown",{}))},n.onKeyUp=function(e){n.sameCombiKey(e,!0)&&(n.continueSelect=!1,n.trigger("keyup",{}))},n.onBlur=function(){n.toggleContinueSelect&&n.continueSelect&&(n.continueSelect=!1,n.trigger("keyup",{}))},n.onDocumentSelectStart=function(e){if(n.gesto.isFlag()){var t=n.dragContainer;t===window&&(t=document.documentElement);var r=t instanceof Element?[t]:[].slice.call(t),i=e.target;r.some((function(t){if(t===i||t.contains(i))return e.preventDefault(),!0}))}},n.target=t.target,n.container=t.container||document.body,n.options=U({target:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,hitRate:100,continueSelect:!1,toggleContinueSelect:null,keyContainer:null,scrollOptions:void 0,checkInput:!1,preventDefault:!1,boundContainer:!1,preventDragFromInside:!0,getElementRect:T,cspNonce:"",ratio:0},t),n.initElement(),n.initDragScroll(),n.setKeyController(),n}F(t,e);var n,r,o=t.prototype;return o.setSelectedTargets=function(e){return this.selectedTargets=e,this},o.getSelectedTargets=function(){return this.selectedTargets},o.setKeyContainer=function(e){var t=this,n=this.options;O(n.keyContainer,e,(function(){n.keyContainer=e,t.setKeyController()}))},o.setToggleContinueSelect=function(e){var t=this,n=this.options;O(n.toggleContinueSelect,e,(function(){n.toggleContinueSelect=e,t.setKeyEvent()}))},o.setPreventDefault=function(e){this.gesto.options.preventDefault=e},o.setCheckInput=function(e){this.gesto.options.checkInput=e},o.triggerDragStart=function(e){return this.gesto.triggerDragStart(e),this},o.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),Object(i.P)(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},o.getElementPoints=function(e){var t=this.getElementRect,n=t(e),r=[n.pos1,n.pos2,n.pos4,n.pos3];if(t!==T){var i=e.getBoundingClientRect();return Object(C.a)(r,i)}return r},o.findSelectableTargets=function(e){var t=this;void 0===e&&(e=this.gesto.getEventDatas());var n=this.getSelectableTargets(),r=n.map((function(e){return t.getElementPoints(e)}));e.selectableTargets=n,e.selectablePoints=r},o.clickTarget=function(e,t){var n=function(e){if("touches"in e){var t=e.touches[0]||e.changedTouches[0];return{clientX:t.clientX,clientY:t.clientY}}return{clientX:e.clientX,clientY:e.clientY}}(e),r={datas:{selectFlag:!1},clientX:n.clientX,clientY:n.clientY,inputEvent:e,isClick:!0,stop:function(){return!1}};return this.onDragStart(r,t)&&this.onDragEnd(r),this},o.setKeyController=function(){var e=this.options,t=e.keyContainer,n=e.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new y.a(t||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},o.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},o.initElement=function(){this.target=function e(t,n,r){var o=t.tag,a=t.children,A=t.attributes,s=t.className,l=t.style,u=n||document.createElement(o);for(var c in A)u.setAttribute(c,A[c]);var f=u.children;if(a.forEach((function(t,n){e(t,f[n],u)})),s&&s.split(" ").forEach((function(e){Object(i.G)(u,e)||Object(i.p)(u,e)})),l){var d=u.style;for(var c in l)d[c]=l[c]}return!n&&r&&r.appendChild(u),u}(function(e,t){for(var n=[],r=2;r=Math.min(100,A)}))},o.initDragScroll=function(){var e=this;this.dragScroll.on("scroll",(function(t){var n=t.container,r=t.direction;e.trigger("scroll",{container:n,direction:r})})).on("move",(function(t){var n=t.offsetX,r=t.offsetY,i=t.inputEvent,o=i.datas;o.startX-=n,o.startY-=r,o.selectablePoints.forEach((function(e){e.forEach((function(e){e[0]-=n,e[1]-=r}))})),e.gesto.scrollBy(n,r,i.inputEvent,!1),i.distX+=n,i.distY+=r,e.check(i)}))},o.getSelectableTargets=function(){var e=[];return this.options.selectableTargets.forEach((function(t){Object(i.K)(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach((function(t){e.push(t)}))})),e},o.select=function(e,t,n,r,i){var o=Object(B.b)(e,t),a=o.added,A=o.removed,s=o.prevList,l=o.list;this.selectedTargets=t,i&&this.trigger("selectStart",{selected:t,added:a.map((function(e){return l[e]})),removed:A.map((function(e){return s[e]})),rect:n,inputEvent:r}),(a.length||A.length)&&this.trigger("select",{selected:t,added:a.map((function(e){return l[e]})),removed:A.map((function(e){return s[e]})),rect:n,inputEvent:r})},o.selectEnd=function(e,t,n,r){var i=r.inputEvent,o=r.isDouble,a=Object(B.b)(e,this.selectedTargets),A=a.added,s=a.removed,l=a.prevList,u=a.list,c=Object(B.b)(t,this.selectedTargets),f=c.added,d=c.removed,p=c.prevList,h=c.list,g=i&&i.type,v="mousedown"===g||"touchstart"===g;this.trigger("selectEnd",{selected:this.selectedTargets,added:A.map((function(e){return u[e]})),removed:s.map((function(e){return l[e]})),afterAdded:f.map((function(e){return h[e]})),afterRemoved:d.map((function(e){return p[e]})),isDragStart:v,isDouble:!!o,rect:n,inputEvent:i})},o.check=function(e,t){void 0===t&&(t=H(e,this.options.ratio));var n=e.datas,r=e.inputEvent,i=t.top,o=t.left,a=t.width,A=t.height,s=n.selectFlag,l=[],u=[];if(s){this.target.style.cssText+="display: block;left:0px;top:0px;transform: translate("+o+"px, "+i+"px);width:"+a+"px;height:"+A+"px;";var c=this.hitTest(t,n.startX,n.startY,n.selectableTargets,n.selectablePoints);l=this.selectedTargets,u=N(n.startPassedTargets,c),this.selectedTargets=u}this.trigger("drag",U(U({},e),{isSelect:s,rect:t})),s&&this.select(l,u,t,r)},o.sameCombiKey=function(e,t){var n=[].concat(this.options.toggleContinueSelect),r=Object(y.b)(e.inputEvent,e.key),o=Object(i.H)(n[0])?n:[n];if(t){var a=e.key;return o.some((function(e){return e.some((function(e){return e===a}))}))}return o.some((function(e){return e.every((function(e){return r.indexOf(e)>-1}))}))},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([(n=R,r=function(e,t){var n={enumerable:!0,configurable:!0,get:function(){return this.options[t]}},r=Object(i.u)("set "+t);e[r]?n.set=function(e){this[r](e)}:n.set=function(e){this.options[t]=e},Object.defineProperty(e,t,n)},function(e){var t=e.prototype;n.forEach((function(e){r(t,e)}))})],t)}(a)),K=n(10),L=function(e,t){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var z=function(){return(z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(K.e)(k)],t.prototype,"selecto",void 0),t}(r.PureComponent);t.a=X},function(e,t,n){"use strict";var r=n(1),i=n(15),o=n(0),a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var A=function(){return(A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function l(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=v.isContentEditable;if(m||b){if(c||g===v)return!1;if(g&&b&&g.isContentEditable&&g.contains(v))return!1}else if((u||"touchstart"===e.type)&&g){var w=g.tagName;(g.isContentEditable||h.indexOf(w)>-1)&&g.blur()}if(r.clientStores=[new p(l(e))],r.flag=!0,r.isDrag=!1,r.datas={},s&&(3===e.which||2===e.button))return r.initDrag(),!1;r.doubleFlag=Object(o.N)()-r.prevTime<200,!1===r.emit("dragStart",A({datas:r.datas,inputEvent:e,isTrusted:t,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()))&&r.initDrag(),r.flag&&u&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(d&&f&&a&&(E=setTimeout((function(){Object(o.q)(i,"touchstart",r.onDragStart,{passive:!1})}))),!d&&f&&a&&Object(o.P)(i,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),d&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=l(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",A({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,i=t.container;r.isTouch&&n&&Object(o.P)(i,"touchstart",r.onDragStart),r.flag=!1;var a=r.getCurrentStore().getPosition(),s=Object(o.N)(),l=!r.isDrag&&r.doubleFlag;r.prevTime=r.isDrag||l?0:s,r.emit("dragEnd",A({datas:r.datas,isDouble:l,isDrag:r.isDrag,inputEvent:e},a)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var i=[].concat(t);r.options=A({checkInput:!1,container:i.length>1?window:i[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,s=a.container,u=a.events,c=a.checkWindowBlur;if(r.isTouch=u.indexOf("touch")>-1,r.isMouse=u.indexOf("mouse")>-1,r.targets=i,r.isMouse&&(i.forEach((function(e){Object(o.q)(e,"mousedown",r.onDragStart)})),Object(o.q)(s,"mousemove",r.onDrag),Object(o.q)(s,"mouseup",r.onDragEnd),Object(o.q)(s,"contextmenu",r.onDragEnd)),c&&Object(o.q)(window,"blur",r.onBlur),r.isTouch){var f={passive:!1};i.forEach((function(e){Object(o.q)(e,"touchstart",r.onDragStart,f)})),Object(o.q)(s,"touchmove",r.onDrag,f),Object(o.q)(s,"touchend",r.onDragEnd,f),Object(o.q)(s,"touchcancel",r.onDragEnd,f)}return r}!function(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isDoubleFlag=function(){return this.doubleFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),Object(o.P)(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){Object(o.P)(t,"mousedown",e.onDragStart)})),Object(o.P)(n,"mousemove",this.onDrag),Object(o.P)(n,"mouseup",this.onDragEnd),Object(o.P)(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){Object(o.P)(t,"touchstart",e.onDragStart)})),Object(o.P)(n,"touchstart",this.onDragStart),Object(o.P)(n,"touchmove",this.onDrag),Object(o.P)(n,"touchend",this.onDragEnd),Object(o.P)(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new p(l(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",A({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",A({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",A({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,A({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(i.a);var v=n(24),B=n(34),m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function b(e,t){function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var w=function(){return(w=Object.assign||function(e){for(var t,n=1,r=arguments.length;nn?"block":"none",o=this.isHorizontal?["X","width"]:["Y","height"],a=o[0],A=o[1];this.barElement.style.cssText="display: "+i+";",this.thumbElement.style.cssText+=A+": "+n*n/r+"px;transform: translate"+a+"("+t/r*n+"px)"},n.destroy=function(){Object(o.P)(this.barElement,"wheel",this.onWheel),this.gesto.off(),this.off()},t}(i.a),R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return b(t,e),t}(function(e){function t(t,n,r){void 0===r&&(r={});var i=e.call(this)||this;return i.containerElement=t,i.viewportElement=n,i.offsetX=0,i.offsetY=0,i.containerWidth=0,i.containerHeight=0,i.viewportWidth=0,i.viewportHeight=0,i.scrollLeft=0,i.scrollTop=0,i.timer=0,i.tempScale=1,i.dragFlag=!1,i.isLoop=!1,i.resize=function(){var e=i.containerElement,t=e.offsetWidth,n=e.offsetHeight,r=i.viewportElement,o=r.offsetWidth,a=r.offsetHeight;i.containerWidth=t,i.containerHeight=n,i.viewportWidth=o,i.viewportHeight=a},i.onScroll=function(){var e=i.wrapperElement,t=e.scrollLeft,n=e.scrollTop,r=i.zoom,o=void 0===r?x.zoom:r,a=t-i.scrollLeft,A=n-i.scrollTop,s=i.getScrollLeft(),l=i.getScrollTop();i.isLoop&&(i.isLoop=!1),i.scrollLeft=t,i.scrollTop=n,i.scrollTo(s+a/o,l+A/o)},i.onWheel=function(e){var t=i.options;if(e.ctrlKey){var n=-e.deltaY,r=Math.max(1+n*(t.wheelScale||.01),1e-6);i.trigger("pinch",{distance:n,scale:r,rotation:0,zoom:i.zoom*r,inputEvent:e})}else{if(!y&&!t.useForceWheel)return;var o=i.zoom,a=e.deltaX,A=e.deltaY;e.shiftKey&&!a&&(a=A,A=0),i.scrollBy(a/o,A/o)}e.preventDefault()},i.onGestureStart=function(e){i.tempScale=i.zoom,e.preventDefault()},i.onGestureChange=function(e){if(e.preventDefault(),!i.gesto.isFlag()&&i.tempScale){var t=e.scale;i.trigger("pinch",{distance:0,scale:t,rotation:e.rotation,zoom:i.tempScale*t,inputEvent:e})}else i.tempScale=0},i.options=w(w({},x),r),i.init(),i}b(t,e);var n,r,i=t.prototype;return i.getContainer=function(){return this.containerElement},i.getViewport=function(){return this.viewportElement},i.getWrapper=function(){return this.wrapperElement},i.destroy=function(){this.off(),this.gesto.unset(),this.verticalScrollbar.destroy(),this.horizontalScrollbar.destroy(),this.injectResult.destroy();var e=this.containerElement;Object(o.P)(window,"resize",this.resize),Object(o.P)(this.wrapperElement,"scroll",this.onScroll),Object(o.P)(e,"wheel",this.onWheel),Object(o.P)(e,"tgesturestart",this.onGestureStart),Object(o.P)(e,"gesturechange",this.onGestureChange),this.gesto=null,this.injectResult=null,this.containerElement=null,this.viewportElement=null,this.options=null},i.getScrollTop=function(e){return this.scrollTop/this.zoom+this.offsetY+(e?N(this.getRangeY()[0]):0)},i.getScrollLeft=function(e){return this.scrollLeft/this.zoom+this.offsetX+(e?N(this.getRangeX()[0]):0)},i.getScrollWidth=function(e){var t=this.getRangeX(e);return this.containerWidth+N(t[0])+N(t[1])},i.getScrollHeight=function(e){var t=this.getRangeY(e);return this.containerHeight+N(t[0])+N(t[1])},i.scrollCenter=function(){this.resize();var e=this.zoom,t=-(this.containerWidth/e-this.viewportWidth)/2,n=-(this.containerHeight/e-this.viewportHeight)/2;return this.scrollTo(t,n)},i.scrollBy=function(e,t){return this.scrollTo(this.getScrollLeft()+e,this.getScrollTop()+t)},i.scrollTo=function(e,t){var n=this,r=this,i=r.zoom,o=void 0===i?x.zoom:i,a=r.margin,A=void 0===a?x.margin:a,s=r.threshold,l=void 0===s?x.threshold:s,u=r.scrollLeft,c=r.scrollTop,f=this.getRangeX(!0,!0),d=f[0],p=f[1],h=this.getRangeY(!0,!0),g=h[0],v=h[1],B=u,m=c,b=this.getScrollAreaWidth(),w=this.getScrollAreaHeight(),E=e*o,y=t*o;if(E-l<=d){var C=Math.max(0,E-d);B=C,e=(d+C)/o}else if(E+l>=p){var Q=Math.max(0,p-E);B=b-Q,e=(p-Q)/o}else Bb-l&&(B-=A);if(y-l<=g){C=Math.max(0,y-g);m=C,t=(g+C)/o}else if(y+l>=v){Q=Math.max(0,v-y);m=w-Q,t=(v-Q)/o}else mw-l&&(m-=A);B=Math.round(B),m=Math.round(m),this.scrollLeft=B,this.scrollTop=m,this.offsetX=e-B/o,this.offsetY=t-m/o,this.render();var F=this.getScrollLeft(),U=this.getScrollTop();return this.trigger("scroll",{scrollLeft:F,scrollTop:U}),u===B&&c===m||(this.isLoop=!0,this.move(B,m),requestAnimationFrame((function(){if(n.isLoop){n.isLoop=!1;var e=n.wrapperElement,t=e.scrollLeft,r=e.scrollTop;n.scrollLeft=t,n.scrollTop=r,B===t&&m===r||n.scrollTo(F,U)}})),!1)},i.setZoom=function(e){var t=this,n=t.containerWidth,r=t.containerHeight,i=t.zoomOffsetX,a=void 0===i?x.zoomOffsetX:i,A=t.zoomOffsetY,s=void 0===A?x.zoomOffsetY:A,l=t.zoom,u=this.getScrollLeft(),c=this.getScrollTop();this.options.zoom=e;var f=this.getScrollLeft(),d=this.getScrollTop(),p=Object(o.w)(""+a,n),h=Object(o.w)(""+s,r),g=u+p/l,v=c+h/l,B=f+p/e,m=d+h/e;this.scrollBy(g-B,v-m),this.render()},i.getRangeX=function(e,t){var n=this.rangeX,r=void 0===n?x.rangeX:n,i=this.margin,o=void 0===i?x.margin:i,a=this.zoom,A=void 0===a?x.zoom:a,s=this.threshold,l=_(this.getScrollLeft(),o,r,s,t);return e?[l[0]*A,Math.max(this.viewportWidth*A-this.containerWidth,l[1]*A)]:l},i.getRangeY=function(e,t){var n=this.rangeY,r=void 0===n?x.rangeY:n,i=this.margin,o=void 0===i?x.margin:i,a=this.zoom,A=void 0===a?x.zoom:a,s=this.threshold,l=_(this.getScrollTop(),o,r,s,t);return e?[l[0]*A,Math.max(this.viewportHeight*A-this.containerHeight,l[1]*A)]:l},i.init=function(){var e=this,t=this.containerElement,n=this.options;Object(o.p)(t,F);var r=n.wrapperElement||t.querySelector(".infinite-viewer-wrapper"),i=n.scrollAreaElement||t.querySelector(".infinite-viewer-scroll-area"),a=n.horizontalScrollElement||t.querySelector(".infinite-viewer-horizontal-scroll-bar"),A=n.verticalScrollElement||t.querySelector(".infinite-viewer-vertical-scroll-bar");r||(r=document.createElement("div"),Object(o.p)(r,"infinite-viewer-wrapper"),r.insertBefore(this.viewportElement,null),t.insertBefore(r,null)),this.wrapperElement=r,i||(i=document.createElement("div"),Object(o.p)(i,"infinite-viewer-scroll-area"),r.insertBefore(i,r.firstChild)),this.scrollAreaElement=i,this.horizontalScrollbar=new M("horizontal",a),this.verticalScrollbar=new M("vertical",A),this.horizontalScrollbar.on("scroll",(function(t){e.scrollBy(t.delta/e.zoom,0)})),this.verticalScrollbar.on("scroll",(function(t){e.scrollBy(0,t.delta/e.zoom)})),this.horizontalScrollbar.isAppend&&t.insertBefore(this.horizontalScrollbar.barElement,null),this.verticalScrollbar.isAppend&&t.insertBefore(this.verticalScrollbar.barElement,null),Object(o.p)(t,F),this.injectResult=Q.inject(t,{nonce:this.options.cspNonce}),this.gesto=new g(t,{container:document.body,events:["touch"]}).on("dragStart",(function(t){var n=t.inputEvent,r=t.datas,i=t.stop;e.pauseAnimation(),e.dragFlag=!1,!1!==e.trigger("dragStart",{inputEvent:n})?(n.preventDefault(),r.startEvent=n):i()})).on("drag",(function(t){if(!e.options.usePinch||t.isPinch){e.trigger("drag",{inputEvent:t.inputEvent}),function(e){var t=e.deltaX,n=e.deltaY,r=e.datas,i=Date.now(),o=r.speed;if(!o)return r.speed=[0,0],void(r.time=i);var a=i-r.time;r.speed=[o[0]/2+t/a,o[1]/2+n/a]}(t);var r=e.zoom;e.scrollBy(-t.deltaX/r,-t.deltaY/r)}else!e.dragFlag&&t.movement>n.pinchThreshold&&(e.dragFlag=!0,e.trigger("abortPinch",{inputEvent:t.datas.startEvent||t.inputEvent}))})).on("dragEnd",(function(t){e.trigger("dragEnd",{isDrag:t.isDrag,isDouble:t.isDouble,inputEvent:t.inputEvent}),e.startAnimation(t.datas.speed)})).on("pinchStart",(function(t){var n=t.inputEvent,r=t.datas,i=t.stop;n.preventDefault(),e.pauseAnimation(),r.startZoom=e.zoom,!1===e.trigger("pinchStart",{inputEvent:n})&&i()})).on("pinch",(function(t){e.trigger("pinch",{rotation:t.rotation,distance:t.distance,scale:t.scale,zoom:t.datas.startZoom*t.scale,inputEvent:t.inputEvent})})),Object(o.q)(r,"scroll",this.onScroll),Object(o.q)(window,"resize",this.resize),Object(o.q)(t,"wheel",this.onWheel,{passive:!1}),Object(o.q)(t,"gesturestart",this.onGestureStart,{passive:!1}),Object(o.q)(t,"gesturechange",this.onGestureChange,{passive:!1}),this.resize(),this.render(),this.scrollTo(0,0)},i.render=function(){var e=this.offsetX,t=this.offsetY,n=this.zoom,r=void 0===n?x.zoom:n,i=this.translateZ,o=void 0===i?0:i,a=-e*r,A=-t*r;this.scrollAreaElement.style.cssText="width:calc(100% + "+this.getScrollAreaWidth()+"px);height:calc(100% + "+this.getScrollAreaHeight()+"px);",this.viewportElement.style.cssText+="transform-origin: 0 0;transform:translate3d("+a+"px, "+A+"px, "+o+"px) scale("+r+");",this.renderScroll()},i.renderScroll=function(){var e=this.containerWidth,t=this.containerHeight,n=this.zoom,r=this.getScrollLeft(!0)*n,i=this.getScrollTop(!0)*n,o=this.getScrollWidth(!0),a=this.getScrollHeight(!0);this.horizontalScrollbar.render(this.displayHorizontalScroll,r,e,o),this.verticalScrollbar.render(this.displayVerticalScroll,i,t,a)},i.move=function(e,t){var n=this.wrapperElement;n.scrollLeft=e,n.scrollTop=t},i.startAnimation=function(e){var t=this;if(e&&(e[0]||e[1])){var n=-6e-4,r=function(e){return 1-Math.pow(1-e,3)},i=T(e,n),o=function(e,t){var n=T(e,t);return[e[0]/2*n,e[1]/2*n]}(e,n),a=Date.now(),A=a;this.timer=requestAnimationFrame((function e(){var n=Date.now(),s=n-a;i=i||(t.timer=requestAnimationFrame(e))}))}},i.pauseAnimation=function(){cancelAnimationFrame(this.timer)},i.getScrollAreaWidth=function(){var e=this.getRangeX(!0),t=e[0],n=e[1];return t||n?2*this.margin:0},i.getScrollAreaHeight=function(){var e=this.getRangeY(!0),t=e[0],n=e[1];return t||n?2*this.margin:0},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([(n=U,r=function(e,t){var n={enumerable:!0,configurable:!0,get:function(){return this.options[t]}},r=Object(o.u)("set "+t);e[r]?n.set=function(e){this[r](e)}:n.set=function(e){this.options[t]=e},Object.defineProperty(e,t,n)},function(e){var t=e.prototype;n.forEach((function(e){r(t,e)}))})],t)}(i.a)),D=n(10),P=function(e,t){return(P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var k=function(){return(k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(D.e)(H)],t.prototype,"infiniteViewer",void 0),t}(r.PureComponent);t.a=K},function(e,t,n){"use strict";var r=n(0),i=n(15),o=function(){function e(e){this.separator=e,this.orderMap={}}var t=e.prototype;return t.getFullName=function(e){return e.join(this.separator)},t.get=function(e){return this.orderMap[this.getFullName(e)]},t.gets=function(e,t){void 0===t&&(t=!0);var n=[],r=this;return function e(t,i){var o=r.get(t);if(o)return o.forEach((function(r){var o=i.concat([r]),a=e(t.concat([r]),o);a&&a.length||n.push(i.concat([r]))})),o}(e,t?e:[]),n},t.set=function(e,t){var n=this;return e.forEach((function(t,r){n.addName(e.slice(0,r),t)})),this.orderMap[this.getFullName(e)]=t,t},t.add=function(e){var t=e.length;return t?this.addName(e.slice(0,-1),e[t-1]):[]},t.addName=function(e,t){var n=this.get(e)||this.set(e,[]);return-1===n.indexOf(t)&&n.push(t),n},t.findIndex=function(e,t){var n=this.orderMap[this.getFullName(e)];return n?n.indexOf(t):-1},t.remove=function(e){var t=this.getFullName(e),n=this.orderMap;for(var r in n)0===r.indexOf(t)&&delete n[r];var i=e.length;if(i){var o=e.slice(0,-1),a=e[i-1];this.splice(o,this.findIndex(o,a),1)}return this},t.filter=function(t,n,r){void 0===r&&(r=!0);var i=this.gets(t,r).filter(n),o=new e(this.separator),a=r?[]:t;return i.forEach((function(e){o.add(a.concat(e))})),o},t.splice=function(e,t,n){for(var r=[],i=3;i.001;){if(i=l(e,t,r)-n,Math.abs(i)<.001)return r;r-=i/2}return r}(e,n,Object(r.s)(o,0,1));return l(t,i,a)};return o.easingName="cubic-bezier("+e+","+t+","+n+","+i+")",o}function c(e,t){var n=function(n){var r=1/e;return n>=1?1:("start"===t?r:0)+Math.floor(n/r)*r};return n.easingName="steps("+e+", "+t+")",n}var f,d=c(1,"start"),p=c(1,"end"),h=u(0,0,1,1),g=u(.25,.1,.25,1),v=u(.42,0,1,1),B=u(0,0,.58,1),m=u(.42,0,.58,1),b="animation-timing-function",w={transform:{},filter:{},attribute:{},html:!0},E={easing:[b]},y=((f={})[b]=!0,f.contents=!0,f.html=!0,f),C="delay",Q={linear:h,ease:g,"ease-in":v,"ease-out":B,"ease-in-out":m,"step-start":d,"step-end":p},x=["duration","fillMode","direction","iterationCount",C,"easing","playSpeed"],F=function(){function e(e,t){this.prefix="",this.suffix="",this.model="",this.type="",this.separator=",",t&&this.setOptions(t),this.value=Object(r.L)(e)?e.split(this.separator):e}var t=e.prototype;return t.setOptions=function(e){for(var t in e)this[t]=e[t];return this},t.size=function(){return this.value.length},t.get=function(e){return this.value[e]},t.set=function(e,t){return this.value[e]=t,this},t.clone=function(){var t=this,n=t.separator,r=t.prefix,i=t.suffix,o=t.model,a=t.type;return new e(this.value.map((function(t){return t instanceof e?t.clone():t})),{separator:n,prefix:r,suffix:i,model:o,type:a})},t.toValue=function(){return this.prefix+this.join()+this.suffix},t.join=function(){return this.value.map((function(t){return t instanceof e?t.toValue():t})).join(this.separator)},t.forEach=function(e){return this.value.forEach(e),this},e}();function U(e){for(var t=Object(r.V)(e,";"),n={},i=t.length,o=i,a=0;a1?O(n.map((function(e){return H(e)})),","):(n=Object(r.U)(e)).length>1?O(n.map((function(e){return H(e)}))," "):(n=/^(['"])([^'"]*)(['"])$/g.exec(e))&&n[1]===n[3]?new F([H(n[2])],{prefix:n[1],suffix:n[1]}):-1!==e.indexOf("(")?function(e){var t=Object(r.S)(e),n=t.prefix,i=t.value,o=t.suffix;if("undefined"===typeof i)return e;if(r.d.indexOf(n)>-1)return S(Object(r.X)(e));var a=H(i,n),A=[i],s=",",l=n+"(",u=")"+o;return a instanceof F&&(s=a.separator,A=a.value,l+=a.prefix,u=a.suffix+u),new F(A,{separator:s,model:n,prefix:l,suffix:u})}(e):"#"===e.charAt(0)&&"url"!==t?function(e){var t=Object(r.X)(e);return t?S(t):e}(e):e}function T(e,t){void 0===t&&(t={});var n=e.model;if(n){e.setOptions({model:"",suffix:"",prefix:""});var r=e.size()>1?e:e.get(0);t[n]=r}else e.forEach((function(e){T(e,t)}));return t}function N(e){return e instanceof F}function _(e){var t=typeof e;if(t===r.j){if(Object(r.H)(e))return r.c;if(N(e))return r.k}else if(t===r.m||t===r.i)return"value";return t}function M(e){return Object(r.K)(e)&&e.constructor===Object}function R(e,t){var n=[];if(M(e))for(var r in e)t.push(r),n=n.concat(R(e[r],t)),t.pop();else n.push(t.slice());return n}function D(e){return Math.round(1e6*e)/1e6}function P(e,t,n){void 0===n&&(n=e.length);for(var i=t,o=0;o=1?"alternate-reverse":"alternate"):n===(e%2>=1?"alternate":"alternate-reverse"))}var j=["id","iterationCount",C,"fillMode","direction","playSpeed","duration","playSpeed","iterationTime","playState"],X=s(j,["easing","easingName"]);i.a;function G(e,t){if(void 0===t&&(t=[]),!e)return"";var n=[],i=Object(r.D)(e);return Object(r.R)(i,t),i.forEach((function(t){n.push(t.replace(/\d$/g,"")+"("+e[t]+")")})),n.join(" ")}function V(e,t){return void 0===t&&(t=!1),Y({},e,t)}function Y(e,t,n){for(var i in void 0===n&&(n=!1),t){var o=t[i],a=_(o);a===r.k?e[i]=n?o.toValue():o.clone():a===r.f?e[i]=n?J([i],o):o:a===r.c?e[i]=o.slice():a===r.j?Object(r.K)(e[i])&&!N(e[i])?Y(e[i],o,n):e[i]=V(o,n):e[i]=t[i]}return e}function W(e){return e[0]in E?E[e[0]]:e}function J(e,t){var n=_(t);if(n===r.k)return t.toValue();if(n===r.f){if(e[0]!==b)return J(e,t())}else if(n===r.j)return V(t,!0);return t}var q=function(){function e(e){void 0===e&&(e={}),this.properties={},this.orderMap=new o("_///_"),this.properties={},this.set(e)}var t=e.prototype;return t.get=function(){for(var e=[],t=0;tO.length&&O.push(e)}function N(e,t,n){return null==e?0:function e(t,n,r,i){var A=typeof t;"undefined"!==A&&"boolean"!==A||(t=null);var s=!1;if(null===t)s=!0;else switch(A){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case o:case a:s=!0}}if(s)return r(i,t,""===n?"."+_(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;l