New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-svg-pan-zoom

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-svg-pan-zoom - npm Package Compare versions

Comparing version 2.16.0 to 2.16.1

build-storybook/static/manager.99051738a0d6b840fc95.bundle.js

2

build-commonjs/ui-miniature/miniature-toggle-button.js

@@ -47,3 +47,3 @@ 'use strict';

'button',
{ role: 'button', style: style, onClick: function onClick(event) {
{ role: 'button', type: 'button', style: style, onClick: function onClick(event) {
return onChangeValue(action(value));

@@ -50,0 +50,0 @@ } },

@@ -102,4 +102,4 @@ 'use strict';

name: this.props.name,
role: 'button'
role: 'button',
type: 'button'
},

@@ -106,0 +106,0 @@ this.props.children

@@ -28,3 +28,3 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

'button',
{ role: 'button', style: style, onClick: function onClick(event) {
{ role: 'button', type: 'button', style: style, onClick: function onClick(event) {
return onChangeValue(action(value));

@@ -31,0 +31,0 @@ } },

@@ -88,4 +88,4 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

name: this.props.name,
role: 'button'
role: 'button',
type: 'button'
},

@@ -92,0 +92,0 @@ this.props.children

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react")):"function"==typeof define&&define.amd?define(["prop-types","react"],t):"object"==typeof exports?exports.ReactSVGPanZoom=t(require("prop-types"),require("react")):e.ReactSVGPanZoom=t(e.PropTypes,e.React)}(window,function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e,t){return{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function o(e,t){return t.map(function(t){return r(e,t)})}function i(e){return{a:parseFloat(e.a),b:parseFloat(e.b),c:parseFloat(e.c),d:parseFloat(e.d),e:parseFloat(e.e),f:parseFloat(e.f)}}n.r(t);var a=/^matrix\(\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*\)$/i;function u(e){var t=e.match(a);if(null===t||t.length<7)throw new Error("'"+e+"' is not a matrix");return{a:parseFloat(t[1]),b:parseFloat(t[2]),c:parseFloat(t[3]),d:parseFloat(t[4]),e:parseFloat(t[5]),f:parseFloat(t[6])}}function c(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function l(e){var t=e.a,n=e.b,r=e.c,o=e.d,i=e.e,a=e.f,u=t*o-n*r;return{a:o/u,b:n/-u,c:r/-u,d:t/u,e:(o*i-r*a)/-u,f:(n*i-t*a)/u}}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function h(e){var t=function(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)};return"object"===(void 0===e?"undefined":s(e))&&e.hasOwnProperty("a")&&t(e.a)&&e.hasOwnProperty("b")&&t(e.b)&&e.hasOwnProperty("c")&&t(e.c)&&e.hasOwnProperty("d")&&t(e.d)&&e.hasOwnProperty("e")&&t(e.e)&&e.hasOwnProperty("f")&&t(e.f)}function f(e){return void 0===e}function d(e){return{a:1,c:0,e:e,b:0,d:1,f:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}}function p(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=function(e,t){return{a:e.a*t.a+e.c*t.b,c:e.a*t.c+e.c*t.d,e:e.a*t.e+e.c*t.f+e.e,b:e.b*t.a+e.d*t.b,d:e.b*t.c+e.d*t.d,f:e.b*t.e+e.d*t.f+e.f}};switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return o(t[0],t[1]);default:var i=(r=t,Array.isArray(r)?r:Array.from(r)),a=i[0],u=i[1],c=i.slice(2),l=o(a,u);return p.apply(void 0,[l].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(c)))}}var v=Math.cos,g=Math.sin,m=Math.PI;function b(e,t,n){var r=v(e),o=g(e),i={a:r,c:-o,e:0,b:o,d:r,f:0};return f(t)||f(n)?i:p([d(t,n),i,d(-t,-n)])}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return b(e*m/180,t,n)}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return f(t)&&(t=e),{a:e,c:0,e:0,b:0,d:t,f:0}}function O(e,t){return{a:1,c:e,e:0,b:t,d:1,f:0}}function V(e){return P(e)}function x(e){return P(e)}function P(e){return"matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")"}n.d(t,"applyToPoint",function(){return r}),n.d(t,"applyToPoints",function(){return o}),n.d(t,"fromObject",function(){return i}),n.d(t,"fromString",function(){return u}),n.d(t,"identity",function(){return c}),n.d(t,"inverse",function(){return l}),n.d(t,"isAffineMatrix",function(){return h}),n.d(t,"rotate",function(){return b}),n.d(t,"rotateDEG",function(){return y}),n.d(t,"scale",function(){return w}),n.d(t,"shear",function(){return O}),n.d(t,"toCSS",function(){return V}),n.d(t,"toSVG",function(){return x}),n.d(t,"toString",function(){return P}),n.d(t,"transform",function(){return p}),n.d(t,"translate",function(){return d})}])},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(0),a=n.n(i),u=n(2),c="idle",l="panning",s="zooming",h="auto",f="none",d="pan",p="zoom-in",v="zoom-out",g="top",m="right",b="bottom",y="left",w="zoom",O="pan",V=("function"==typeof Symbol&&Symbol.iterator,Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e});function x(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e=Object.assign({},e,t,{lastAction:n}),Object.freeze(e)}function P(e,t,n){var r=Object(u.fromObject)(e),o=Object(u.inverse)(r);return Object(u.applyToPoint)(o,{x:t,y:n})}function M(e){var t=Object(u.fromObject)(e);return{scaleFactor:t.a,translationX:t.e,translationY:t.f}}function E(e,t,n,r){var o=e.viewerWidth,i=e.viewerHeight,a=Object(u.transform)(Object(u.translate)(o/2-t,i/2-n),Object(u.translate)(t,n),Object(u.scale)(r,r),Object(u.translate)(-t,-n));return x(e,V({mode:c},a))}function k(e){return x(e,V({mode:c},Object(u.identity)()))}function j(e){return x(e,{mode:c,startX:null,startY:null,endX:null,endY:null})}var T=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var _=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.originalEvent=t,this.value=n,this.SVGViewer=r}return T(e,[{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"scaleFactor",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||M(this.value),this._cacheDecomposedValue.scaleFactor}},{key:"translationX",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||M(this.value),this._cacheDecomposedValue.translationX}},{key:"translationY",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||M(this.value),this._cacheDecomposedValue.translationY}}]),e}(),C=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,_),C(t,[{key:"point",get:function(){if(!this._cachePoint){var e=this.originalEvent,t=this.value,n=this.SVGViewer.getBoundingClientRect(),r=e.clientX-Math.round(n.left),o=e.clientY-Math.round(n.top);this._cachePoint=P(t,r,o)}return this._cachePoint}},{key:"x",get:function(){return this.point.x}},{key:"y",get:function(){return this.point.y}}]),t}(),R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var D=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,_),F(t,[{key:"points",get:function(){return this._cachePoints||(this._cachePoints=t.touchesToPoints(this.originalEvent.touches,this.SVGViewer,this.value)),this._cachePoints}},{key:"changedPoints",get:function(){return this._cacheChangedPoints||(this._cacheChangedPoints=t.touchesToPoints(this.originalEvent.changedTouches,this.SVGViewer,this.value)),this._cacheChangedPoints}}],[{key:"touchesToPoints",value:function(e,t,n){for(var r=[],o=0;o<e.length;o++){var i=e[o],a=t.getBoundingClientRect(),u=P(n,i.clientX-Math.round(a.left),i.clientY-Math.round(a.top));r.push(R({},u,{identifier:i.identifier}))}return r}}]),t}(),q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=Object(u.transform)(Object(u.fromObject)(e),Object(u.translate)(t,n));if(r){var i=Object(u.applyToPoints)(o,[{x:r,y:r},{x:e.SVGWidth-r,y:e.SVGHeight-r}]),a=G(i,2),l=a[0],s=l.x,h=l.y,f=a[1],d=f.x,p=f.y,v=0;e.viewerWidth-s<0?v=e.viewerWidth-s:d<0&&(v=-d);var g=0;e.viewerHeight-h<0?g=e.viewerHeight-h:p<0&&(g=-p),o=Object(u.transform)(Object(u.translate)(v,g),o)}return x(e,q({mode:c},o),O)}function X(e){return x(e,{mode:c,startX:null,startY:null,endX:null,endY:null},O)}function L(e,t){return e.x<=t.x&&e.y<=t.y?{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}:e.x>=t.x&&e.y<=t.y?{x:t.x,y:e.y,width:e.x-t.x,height:t.y-e.y}:e.x>=t.x&&e.y>=t.y?{x:t.x,y:t.y,width:e.x-t.x,height:e.y-t.y}:e.x<=t.x&&e.y>=t.y?{x:e.x,y:t.y,width:t.x-e.x,height:e.y-t.y}:void 0}var H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function W(e,t){return function(e,t){return e.scaleFactorMin&&e.d*t<=e.scaleFactorMin}(e,t)&&t<1||function(e,t){return e.scaleFactorMax&&e.d*t>=e.scaleFactorMax}(e,t)&&t>1}function A(e,t){var n=t.a;return null!=e.scaleFactorMin&&(n=Math.max(n,e.scaleFactorMin)),null!=e.scaleFactorMax&&(n=Math.min(n,e.scaleFactorMax)),x(t,{a:n,d:n})}function z(e,t,n,r){if(W(e,r))return e;var o=Object(u.transform)(Object(u.fromObject)(e),Object(u.translate)(t,n),Object(u.scale)(r,r),Object(u.translate)(-t,-n));return x(e,H({mode:c},A(e,o),{startX:null,startY:null,endX:null,endY:null}),w)}function N(e,t,n,r,o){var i=e.viewerWidth/r,a=e.viewerHeight/o,l=Math.min(i,a),s=Object(u.transform)(Object(u.scale)(l,l),Object(u.translate)(-t,-n));return W(e,l/e.d)?x(e,{mode:c,startX:null,startY:null,endX:null,endY:null}):x(e,H({mode:c},A(e,s),{startX:null,startY:null,endX:null,endY:null}),w)}function I(e){return N(e,0,0,e.SVGWidth,e.SVGHeight)}function B(e,t){var n=P(e,e.viewerWidth/2,e.viewerHeight/2);return z(e,n.x,n.y,t)}function Z(e,t,n,r,o){var i=e.startX,a=e.startY,u=e.endX,c=e.endY,l=P(e,i,a),s=P(e,u,c);if(Math.abs(i-u)>7&&Math.abs(a-c)>7){var h=L(l,s);return N(e,h.x,h.y,h.width,h.height)}var f=P(e,t,n);return z(e,f.x,f.y,r)}function U(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),f=c.left,g=c.top;a=e.clientX-Math.round(f),u=e.clientY-Math.round(g)}var m=r;switch(n){case v:var b=P(r,a,u);m=z(r,b.x,b.y,1/o.scaleFactor);break;case p:m=function(e,t,n){return x(e,{mode:s,startX:t,startY:n,endX:t,endY:n})}(r,a,u);break;case h:case d:m=function(e,t,n){return x(e,{mode:l,startX:t,startY:n,endX:t,endY:n},O)}(r,a,u);break;default:return r}return e.preventDefault(),m}function K(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),f=c.left,v=c.top;a=e.clientX-Math.round(f),u=e.clientY-Math.round(v)}var g=0===e.buttons,m=r;switch(n){case p:r.mode===s&&(m=g?Z(r,a,u,o.scaleFactor):function(e,t,n){if(e.mode!==s)throw new Error("update selection not allowed in this mode "+e.mode);return x(e,{endX:t,endY:n})}(r,a,u));break;case h:case d:r.mode===l&&(m=g?X(r):function(e,t,n,r){if(e.mode!==l)throw new Error("update pan not allowed in this mode "+e.mode);var o=P(e,e.endX,e.endY),i=P(e,t,n);return x(Y(e,i.x-o.x,i.y-o.y,r),{mode:l,endX:t,endY:n},O)}(r,a,u,o.preventPanOutside?20:void 0));break;default:return r}return e.preventDefault(),m}function $(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),f=c.left,g=c.top;a=e.clientX-Math.round(f),u=e.clientY-Math.round(g)}var m=r;switch(n){case v:r.mode===s&&(m=Z(r,a,u,1/o.scaleFactor));break;case p:r.mode===s&&(m=Z(r,a,u,o.scaleFactor));break;case h:case d:r.mode===l&&(m=X(r));break;default:return r}return e.preventDefault(),m}function J(e,t,n,r,o){arguments.length>5&&void 0!==arguments[5]&&arguments[5];var i=function(e,t){return x(e,{focus:t})}(r,"mouseenter"===e.type);return e.preventDefault(),i}function Q(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=i.x,u=i.y;return[f,h].indexOf(n)>=0&&o.detectAutoPan&&r.focus?function(e,t,n){var r=0,o=0;return n<=20&&(o=2),e.viewerWidth-t<=20&&(r=-2),e.viewerHeight-n<=20&&(o=-2),t<=20&&(r=2),r/=e.d,o/=e.d,0===r&&0===o?e:Y(e,r,o)}(r,a,u):r}var ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function te(e){return"number"==typeof e.pinchPointDistance}function ne(e,t,n,r,o){var i=t.getBoundingClientRect(),a=i.left,c=i.top,l=e.touches[0].clientX-Math.round(a),h=e.touches[0].clientY-Math.round(c),f=e.touches[1].clientX-Math.round(a),d=e.touches[1].clientY-Math.round(c),p=Math.sqrt(Math.pow(f-l,2)+Math.pow(d-h,2)),v=te(r)?r.pinchPointDistance:p,g=P(r,(l+f)/2,(h+d)/2),m=p/v;if(W(r,m))return r;e.cancelable&&e.preventDefault();var b=Object(u.transform)(Object(u.fromObject)(r),Object(u.translate)(g.x,g.y),Object(u.scale)(m,m),Object(u.translate)(-g.x,-g.y));return x(r,x(ee({mode:s},A(r,b),{startX:null,startY:null,endX:null,endY:null,prePinchMode:r.prePinchMode?r.prePinchMode:r.mode,pinchPointDistance:p})))}function re(e,t){return t.detectPinchGesture&&e.touches.length>1}function oe(e,t,n,r,o,i){var a=0===e.touches.length?x(r,{mode:r.prePinchMode?c:r.mode,prePinchMode:null}):r,u=function(e,t){var n=t.getBoundingClientRect(),r=n.left,o=n.top;return{x:e.clientX-Math.round(r),y:e.clientY-Math.round(o)}}(e.touches.length>0?e.touches[0]:e.changedTouches[0],t);switch(n){case v:case p:case h:case d:return e.stopPropagation(),e.preventDefault(),i(e,t,n,a,o,u);default:return a}}function ie(e,t,n,r,o){if(!([l,s].indexOf(r.mode)>=0))return r;var i=function(e,t,n){return n.detectPinchGesture&&te(t)&&e.touches.length<2}(e,r,o)?x(r,{pinchPointDistance:null}):r;return e.touches.length>0?i:oe(e,t,n,i,o,$)}function ae(e){return x(e,{miniatureOpen:!0})}function ue(e){return x(e,{miniatureOpen:!1})}var ce=function(){return navigator.userAgent.toLowerCase()},le=function(e){return function(e){return["zoom-in","zoom-out","grab","grabbing"].indexOf(e)>-1}(e)?ce().indexOf("firefox")>-1?"-moz-"+e:ce().indexOf("webkit")>-1?"-webkit-"+e:void 0:e};var se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},he=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var fe=1,de=function(){return"uid"+fe++};function pe(e){var t=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={uid:de()},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),he(n,[{key:"render",value:function(){return o.a.createElement(e,se({_uid:this.state.uid},this.props))}}]),n}();return t.displayName="RandomUID("+function(e){return e.displayName||e.name||"Component"}(e)+")",t}var ve="react-svg-pan-zoom_border_gradient";function ge(e){var t=e.direction,n=e.width,r=e.height,i=e._uid,a=void 0;switch(t){case g:a="translate("+n+", 0) rotate(90)";break;case m:a="translate("+n+", "+r+") rotate(180)";break;case b:a="translate(0, "+r+") rotate(270)";break;case y:a=" "}var u=ve+"_gradient_"+i,c=ve+"_mask_"+i;return o.a.createElement("g",null,o.a.createElement("defs",null,o.a.createElement("linearGradient",{id:u,x1:"0%",y1:"0%",x2:"100%",y2:"0%",spreadMethod:"pad"},o.a.createElement("stop",{offset:"0%",stopColor:"#fff",stopOpacity:"0.8"}),o.a.createElement("stop",{offset:"100%",stopColor:"#000",stopOpacity:"0.5"})),o.a.createElement("mask",{id:c,x:"0",y:"0",width:"20",height:Math.max(n,r)},o.a.createElement("rect",{x:"0",y:"0",width:"20",height:Math.max(n,r),style:{stroke:"none",fill:"url(#"+u+")"}}))),o.a.createElement("rect",{x:"0",y:"0",width:"20",height:Math.max(n,r),style:{stroke:"none",fill:"#000",mask:"url(#"+c+")"},transform:a}))}ge.propTypes={direction:a.a.oneOf([g,m,b,y]).isRequired,width:a.a.number.isRequired,height:a.a.number.isRequired};var me=pe(ge);function be(e){var t=e.startX,n=e.startY,r=e.endX,i=e.endY;if(!(t&&n&&r&&i))return null;var a=L({x:t,y:n},{x:r,y:i});return o.a.createElement("rect",{stroke:"#969FFF",strokeOpacity:.7,fill:"#F3F4FF",fillOpacity:.7,x:a.x,y:a.y,width:a.width,height:a.height,style:{pointerEvents:"none"}})}function ye(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"}))}function we(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"}))}function Oe(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("g",null,o.a.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o.a.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}function Ve(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"}))}function xe(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M15 3l2.3 2.3-2.89 2.87 1.42 1.42L18.7 6.7 21 9V3zM3 9l2.3-2.3 2.87 2.89 1.42-1.42L6.7 5.3 9 3H3zm6 12l-2.3-2.3 2.89-2.87-1.42-1.42L5.3 17.3 3 15v6zm12-6l-2.3 2.3-2.87-2.89-1.42 1.42 2.89 2.87L15 21h6z"}))}be.propTypes={startX:a.a.number.isRequired,startY:a.a.number.isRequired,endX:a.a.number.isRequired,endY:a.a.number.isRequired};var Pe=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Me=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={hover:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.Component),Pe(t,[{key:"change",value:function(e){switch(e.preventDefault(),e.stopPropagation(),e.type){case"mouseenter":case"touchstart":this.setState({hover:!0});break;case"mouseleave":case"touchend":case"touchcancel":this.setState({hover:!1})}}},{key:"render",value:function(){var e=this,t={display:"block",width:"24px",height:"24px",margin:[g,b].indexOf(this.props.toolbarPosition)>=0?"2px 1px":"1px 2px",color:this.props.active||this.state.hover?"#1CA6FC":"#FFF",transition:"color 200ms ease",background:"none",padding:"0px",border:"0px",outline:"0px",cursor:"pointer"};return o.a.createElement("button",{onMouseEnter:function(t){return e.change(t)},onMouseLeave:function(t){return e.change(t)},onTouchStart:function(t){e.change(t),e.props.onClick(t)},onTouchEnd:function(t){return e.change(t)},onTouchCancel:function(t){return e.change(t)},onClick:this.props.onClick,style:t,title:this.props.title,name:this.props.name,role:"button"},this.props.children)}}]),t}(),Ee=Me;function ke(e){var t=e.tool,n=e.value,r=e.onChangeValue,i=e.onChangeTool,a=e.position,u=function(e,t){i(t),e.stopPropagation(),e.preventDefault()},c=[g,b].indexOf(a)>=0,l={position:"absolute",transform:[g,b].indexOf(a)>=0?"translate(-50%, 0px)":"none",top:[y,m,g].indexOf(a)>=0?"5px":"unset",left:[g,b].indexOf(a)>=0?"50%":y===a?"5px":"unset",right:[m].indexOf(a)>=0?"5px":"unset",bottom:[b].indexOf(a)>=0?"5px":"unset",backgroundColor:"rgba(19, 20, 22, 0.90)",borderRadius:"2px",display:"flex",flexDirection:c?"row":"column",padding:c?"1px 2px":"2px 1px"};return o.a.createElement("div",{style:l,role:"toolbar"},o.a.createElement(Ee,{toolbarPosition:a,active:t===f,name:"unselect-tools",title:"Selection",onClick:function(e){return u(e,f)}},o.a.createElement(ye,null)),o.a.createElement(Ee,{toolbarPosition:a,active:t===d,name:"select-tool-pan",title:"Pan",onClick:function(e){return u(e,d)}},o.a.createElement(we,null)),o.a.createElement(Ee,{toolbarPosition:a,active:t===p,name:"select-tool-zoom-in",title:"Zoom in",onClick:function(e){return u(e,p)}},o.a.createElement(Oe,null)),o.a.createElement(Ee,{toolbarPosition:a,active:t===v,name:"select-tool-zoom-out",title:"Zoom out",onClick:function(e){return u(e,v)}},o.a.createElement(Ve,null)),o.a.createElement(Ee,{toolbarPosition:a,active:!1,name:"fit-to-viewer",title:"Fit to viewer",onClick:function(e){return function(e){r(I(n)),e.stopPropagation(),e.preventDefault()}(e)}},o.a.createElement(xe,null)))}function je(e){var t=e.open,n=0;switch(e.position){case y:n=t?"rotate(225, 12, 13)":"rotate(45, 12, 13)";break;case m:n=n=t?"rotate(135, 12, 13)":"rotate(-45, 12, 13)"}return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("g",{transform:n},o.a.createElement("path",{fill:"#000000",d:"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"})))}function Te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e){var t,n=e.value,r=e.onChangeValue,i=e.position,a=(Te(t={width:"24px",height:"24px",display:"block",position:"absolute",bottom:0},i===y?"left":"right","0px"),Te(t,"background","rgba(19, 20, 22, 0.901961)"),Te(t,"border",0),Te(t,"padding",0),Te(t,"outline",0),Te(t,"color","#fff"),t),u=n.miniatureOpen?ue:ae;return o.a.createElement("button",{role:"button",style:a,onClick:function(e){return r(u(n))}},o.a.createElement(je,{open:n.miniatureOpen,position:i}))}Me.propTypes={title:a.a.string.isRequired,name:a.a.string.isRequired,toolbarPosition:a.a.string.isRequired,onClick:a.a.func.isRequired,active:a.a.bool.isRequired},ke.propTypes={position:a.a.oneOf([g,m,b,y]).isRequired,tool:a.a.string.isRequired,value:a.a.object.isRequired,onChangeValue:a.a.func.isRequired,onChangeTool:a.a.func.isRequired},je.propTypes={open:a.a.bool.isRequired,position:a.a.oneOf([m,y]).isRequired},_e.propTypes={value:a.a.object.isRequired,onChangeValue:a.a.func.isRequired,position:a.a.oneOf([m,y]).isRequired};var Ce="react-svg-pan-zoom_miniature";function Se(e){var t=e.SVGWidth,n=e.SVGHeight,r=e.x1,i=e.y1,a=e.x2,u=e.y2,c=(e.zoomToFit,e._uid),l=Ce+"_mask_"+c;return o.a.createElement("g",null,o.a.createElement("defs",null,o.a.createElement("mask",{id:l},o.a.createElement("rect",{x:"0",y:"0",width:t,height:n,fill:"#ffffff"}),o.a.createElement("rect",{x:r,y:i,width:a-r,height:u-i}))),o.a.createElement("rect",{x:"0",y:"0",width:t,height:n,style:{stroke:"none",fill:"#000",mask:"url(#"+l+")",opacity:.4}}))}Se.propTypes={SVGWidth:a.a.number.isRequired,SVGHeight:a.a.number.isRequired,x1:a.a.number.isRequired,y1:a.a.number.isRequired,x2:a.a.number.isRequired,y2:a.a.number.isRequired,zoomToFit:a.a.number.isRequired};var Re=pe(Se),Fe=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Math.min,Math.max;function qe(e){var t,n=e.value,r=e.onChangeValue,i=e.position,a=e.children,c=e.background,l=e.SVGBackground,s=e.width,h=e.height,f=n.SVGWidth,d=n.SVGHeight,p=n.viewerWidth,v=n.viewerHeight,g=d/f,m=g>=1?h/d:s/f,b=Object(u.applyToPoints)(Object(u.inverse)(n),[{x:0,y:0},{x:p,y:v}]),w=Fe(b,2),O=w[0],V=O.x,x=O.y,P=w[1],M=P.x,E=P.y,k=void 0,j=void 0;n.miniatureOpen?(k=s,j=h):(k=24,j=24);var T=(De(t={position:"absolute",overflow:"hidden",outline:"1px solid rgba(19, 20, 22, 0.90)",transition:"width 200ms ease, height 200ms ease, bottom 200ms ease",width:k+"px",height:j+"px",bottom:"6px"},i===y?"left":"right","6px"),De(t,"background",c),t),_=g>=1?"translate("+(s-f*m)/2+", 0)":"translate(0, "+(h-d*m)/2+")";return o.a.createElement("div",{role:"navigation",style:T},o.a.createElement("svg",{width:s,height:h,style:{pointerEvents:"none"}},o.a.createElement("g",{transform:_},o.a.createElement("g",{transform:"scale("+m+", "+m+")"},o.a.createElement("rect",{fill:l,x:0,y:0,width:n.SVGWidth,height:n.SVGHeight}),a,o.a.createElement(Re,{SVGWidth:f,SVGHeight:d,x1:V,y1:x,x2:M,y2:E,zoomToFit:m})))),o.a.createElement(_e,{value:n,onChangeValue:r,position:i}))}qe.propTypes={position:a.a.oneOf([m,y]).isRequired,value:a.a.object.isRequired,onChangeValue:a.a.func.isRequired,background:a.a.string.isRequired,SVGBackground:a.a.string.isRequired,width:a.a.number.isRequired};var Ge=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ye=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Xe=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),o=r.props,i=o.tool,a=o.value,l=o.width,s=o.height,h=o.scaleFactorMin,d=o.scaleFactorMax,p=o.children.props,v=p.width,g=p.height;return r.state={value:a||function(e,t,n,r,o,i){return x({},V({},Object(u.identity)(),{version:2,mode:c,focus:!1,pinchPointDistance:null,prePinchMode:null,viewerWidth:e,viewerHeight:t,SVGWidth:n,SVGHeight:r,scaleFactorMin:o,scaleFactorMax:i,startX:null,startY:null,endX:null,endY:null,miniatureOpen:!0,lastAction:null}))}(l,s,v,g,h,d),tool:i||f},r.ViewerDOM=null,r.autoPanLoop=r.autoPanLoop.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.Component),Ye(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.getValue(),n=!1,r=t;t.viewerWidth===e.width&&t.viewerHeight===e.height||(r=function(e,t,n){return x(e,{viewerWidth:t,viewerHeight:n})}(r,e.width,e.height),n=!0);var o=e.children.props,i=o.width,a=o.height;t.SVGWidth===i&&t.SVGHeight===a||(r=function(e,t,n){return x(e,{SVGWidth:t,SVGHeight:n})}(r,i,a),n=!0),t.scaleFactorMin===e.scaleFactorMin&&t.scaleFactorMax===e.scaleFactorMax||(r=function(e,t,n){return x(e,{scaleFactorMin:t,scaleFactorMax:n})}(r,e.scaleFactorMin,e.scaleFactorMax),n=!0),n&&this.setValue(r)}},{key:"getValue",value:function(){return this.props.value?this.props.value:this.state.value}},{key:"getTool",value:function(){return this.props.tool?this.props.tool:this.state.tool}},{key:"getSvgStyle",value:function(e){var t={display:"block"};return e&&(t.cursor=e),(this.props.detectPinchGesture||-1!==[d,h].indexOf(this.getTool()))&&(t.touchAction="none"),t}},{key:"setValue",value:function(e){var t=this.props,n=t.onChangeValue,r=t.onZoom,o=t.onPan;this.setState({value:e}),n&&n(e),e.lastAction&&(r&&e.lastAction===w&&r(e),o&&e.lastAction===O&&o(e))}},{key:"pan",value:function(e,t){var n=Y(this.getValue(),e,t);this.setValue(n)}},{key:"zoom",value:function(e,t,n){var r=z(this.getValue(),e,t,n);this.setValue(r)}},{key:"fitSelection",value:function(e,t,n,r){var o=N(this.getValue(),e,t,n,r);this.setValue(o)}},{key:"fitToViewer",value:function(){var e=I(this.getValue());this.setValue(e)}},{key:"zoomOnViewerCenter",value:function(e){var t=B(this.getValue(),e);this.setValue(t)}},{key:"setPointOnViewerCenter",value:function(e,t,n){var r=E(this.getValue(),e,t,n);this.setValue(r)}},{key:"reset",value:function(){var e=k(this.getValue());this.setValue(e)}},{key:"changeTool",value:function(e){this.setState({tool:e}),this.props.onChangeTool&&this.props.onChangeTool(e)}},{key:"openMiniature",value:function(){var e=ae(this.getValue());this.setValue(e)}},{key:"closeMiniature",value:function(){var e=ue(this.getValue());this.setValue(e)}},{key:"handleViewerEvent",value:function(e){var t=this.props,n=this.state.value,r=this.ViewerDOM;if([f,h].indexOf(this.getTool())>=0&&e.target!==r){var o={click:t.onClick,dblclick:t.onDoubleClick,mousemove:t.onMouseMove,mouseup:t.onMouseUp,mousedown:t.onMouseDown,touchstart:t.onTouchStart,touchmove:t.onTouchMove,touchend:t.onTouchEnd,touchcancel:t.onTouchCancel}[e.type];o&&o(function(e,t,n){var r=e.type;switch(r){case"mousemove":case"mouseup":case"mousedown":case"click":case"dblclick":return new S(e,t,n);case"touchstart":case"touchmove":case"touchend":case"touchcancel":return new D(e,t,n);default:throw new Error(r+" not supported")}}(e,n,r))}}},{key:"autoPanLoop",value:function(){var e={x:this.state.viewerX,y:this.state.viewerY},t=Q(null,this.ViewerDOM,this.getTool(),this.getValue(),this.props,e);this.getValue()!==t&&this.setValue(t),this.autoPanIsRunning&&requestAnimationFrame(this.autoPanLoop)}},{key:"componentDidMount",value:function(){var e=this.props,t=this.state;e.onChangeValue&&e.onChangeValue(t.value),this.autoPanIsRunning=!0,requestAnimationFrame(this.autoPanLoop)}},{key:"componentWillUnmount",value:function(){this.autoPanIsRunning=!1}},{key:"render",value:function(){var e=this,t=this.props,n=this.state,r=n.viewerX,i=n.viewerY,a=this.getTool(),w=this.getValue(),O=t.customToolbar,V=t.customMiniature,x=a===h&&w.mode===l&&w.startX!==w.endX&&w.startY!==w.endY,M=void 0;a===d&&(M=le(w.mode===l?"grabbing":"grab")),a===p&&(M=le("zoom-in")),a===v&&(M=le("zoom-out")),x&&(M=le("grabbing"));var E=[d,p,v].indexOf(a)>=0;return E=E||x,o.a.createElement("div",{style:Ge({position:"relative",width:w.viewerWidth,height:w.viewerHeight},t.style),className:this.props.className},o.a.createElement("svg",{ref:function(t){return e.ViewerDOM=t},width:w.viewerWidth,height:w.viewerHeight,style:this.getSvgStyle(M),onMouseDown:function(t){var n=U(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onMouseMove:function(t){var n=e.ViewerDOM.getBoundingClientRect(),r=n.left,o=n.top,i=t.clientX-Math.round(r),a=t.clientY-Math.round(o),u=K(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props,{x:i,y:a});e.getValue()!==u&&e.setValue(u),e.setState({viewerX:i,viewerY:a}),e.handleViewerEvent(t)},onMouseUp:function(t){var n=$(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onClick:function(t){e.handleViewerEvent(t)},onDoubleClick:function(t){var n=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),l=c.left,s=c.top;a=e.clientX-Math.round(l),u=e.clientY-Math.round(s)}var f=r;switch(n){case h:if(!o.disableDoubleClickZoomWithToolAuto){var d=P(r,a,u),p=o.modifierKeys.reduce(function(t,n){return t||e.getModifierState(n)},!1)?1/o.scaleFactor:o.scaleFactor;f=z(r,d.x,d.y,p)}break;default:return r}return e.preventDefault(),f}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onWheel:function(t){var n=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),l=c.left,s=c.top;a=e.clientX-Math.round(l),u=e.clientY-Math.round(s)}if(!o.detectWheel)return r;var h=function(e,t,n,r,o){return r+(o-r)*(e-t)/(n-t)}(Math.max(-1,Math.min(1,e.deltaY)),-1,1,o.scaleFactorOnWheel,1/o.scaleFactorOnWheel),f=P(r,a,u),d=z(r,f.x,f.y,h);return e.preventDefault(),d}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n)},onMouseEnter:function(t){if(!("ontouchstart"in window||navigator.maxTouchPoints)){var n=J(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n)}},onMouseLeave:function(t){var n=J(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n)},onTouchStart:function(t){var n=function(e,t,n,r,o){if(re(e,o))return ne(e,t,0,r);if(1!==e.touches.length){if([l,s].indexOf(r.mode)>=0)return j(r);if([c].indexOf(r.mode)>=0)return r}return oe(e,t,n,r,o,U)}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onTouchMove:function(t){var n=function(e,t,n,r,o){return re(e,o)?ne(e,t,0,r):[l,s].indexOf(r.mode)>=0?oe(e,t,n,r,o,K):r}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onTouchEnd:function(t){var n=ie(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onTouchCancel:function(t){var n=function(e,t,n,r,o){return e.stopPropagation(),e.preventDefault(),j(r)}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)}},o.a.createElement("rect",{fill:t.background,x:0,y:0,width:w.viewerWidth,height:w.viewerHeight,style:{pointerEvents:"none"}}),o.a.createElement("g",{transform:Object(u.toSVG)(w),style:E?{pointerEvents:"none"}:{}},o.a.createElement("rect",{fill:this.props.SVGBackground,style:this.props.SVGStyle,x:0,y:0,width:w.SVGWidth,height:w.SVGHeight}),o.a.createElement("g",null,t.children.props.children)),[f,h].indexOf(a)>=0&&t.detectAutoPan&&w.focus?o.a.createElement("g",{style:{pointerEvents:"none"}},i<=20?o.a.createElement(me,{direction:g,width:w.viewerWidth,height:w.viewerHeight}):null,w.viewerWidth-r<=20?o.a.createElement(me,{direction:m,width:w.viewerWidth,height:w.viewerHeight}):null,w.viewerHeight-i<=20?o.a.createElement(me,{direction:b,width:w.viewerWidth,height:w.viewerHeight}):null,w.focus&&r<=20?o.a.createElement(me,{direction:y,width:w.viewerWidth,height:w.viewerHeight}):null):null,w.mode!==s?null:o.a.createElement(be,{startX:w.startX,startY:w.startY,endX:w.endX,endY:w.endY})),"none"===t.toolbarPosition?null:o.a.createElement(O,{position:t.toolbarPosition,value:w,onChangeValue:function(t){return e.setValue(t)},tool:a,onChangeTool:function(t){return e.changeTool(t)}}),"none"===t.miniaturePosition?null:o.a.createElement(V,{position:t.miniaturePosition,value:w,onChangeValue:function(t){return e.setValue(t)},SVGBackground:this.props.SVGBackground,background:this.props.miniatureBackground,width:this.props.miniatureWidth,height:this.props.miniatureHeight},t.children.props.children))}}]),t}(),Le=Xe;Xe.propTypes={width:a.a.number.isRequired,height:a.a.number.isRequired,background:a.a.string,SVGBackground:a.a.string,SVGStyle:a.a.object,value:a.a.shape({version:a.a.oneOf([2]).isRequired,mode:a.a.oneOf([c,l,s]).isRequired,focus:a.a.bool.isRequired,a:a.a.number.isRequired,b:a.a.number.isRequired,c:a.a.number.isRequired,d:a.a.number.isRequired,e:a.a.number.isRequired,f:a.a.number.isRequired,viewerWidth:a.a.number.isRequired,viewerHeight:a.a.number.isRequired,SVGWidth:a.a.number.isRequired,SVGHeight:a.a.number.isRequired,startX:a.a.number,startY:a.a.number,endX:a.a.number,endY:a.a.number,miniatureOpen:a.a.bool.isRequired}),style:a.a.object,className:a.a.string,detectWheel:a.a.bool,detectAutoPan:a.a.bool,detectPinchGesture:a.a.bool,toolbarPosition:a.a.oneOf(["none",g,m,b,y]),onChangeValue:a.a.func,onChangeTool:a.a.func,onZoom:a.a.func,onPan:a.a.func,onClick:a.a.func,onDoubleClick:a.a.func,onMouseUp:a.a.func,onMouseMove:a.a.func,onMouseDown:a.a.func,preventPanOutside:a.a.bool,scaleFactor:a.a.number,scaleFactorOnWheel:a.a.number,scaleFactorMax:a.a.number,scaleFactorMin:a.a.number,tool:a.a.oneOf([h,f,d,p,v]),modifierKeys:a.a.array,customToolbar:a.a.oneOfType([a.a.element,a.a.func]),miniaturePosition:a.a.oneOf(["none",m,y]),miniatureBackground:a.a.string,miniatureWidth:a.a.number,miniatureHeight:a.a.number,customMiniature:a.a.oneOfType([a.a.element,a.a.func]),disableDoubleClickZoomWithToolAuto:a.a.bool,children:function(e,t,n){var r=e[t],i=["svg"];return 1!==o.a.Children.count(r)||-1===i.indexOf(r.type)?new Error("`"+n+"` should have a single child of the following types: `"+i.join("`, `")+"`."):r.props.hasOwnProperty("width")&&r.props.hasOwnProperty("height")?void 0:new Error("SVG should have props `width` and `height`")}},Xe.defaultProps={value:null,tool:null,style:{},background:"#616264",SVGBackground:"#fff",SVGStyle:{},detectWheel:!0,detectAutoPan:!0,detectPinchGesture:!0,toolbarPosition:m,modifierKeys:["Alt","Shift","Control"],customToolbar:ke,preventPanOutside:!0,scaleFactor:1.1,scaleFactorOnWheel:1.06,miniaturePosition:y,miniatureWidth:100,miniatureHeight:80,miniatureBackground:"#616264",customMiniature:qe,disableZoomWithToolAuto:!1,onZoom:null,onPan:null},n.d(t,"Viewer",function(){return He}),n.d(t,"ReactSVGPanZoom",function(){return Le}),n.d(t,"Toolbar",function(){return ke}),n.d(t,"Miniature",function(){return qe}),n.d(t,"setPointOnViewerCenter",function(){return E}),n.d(t,"reset",function(){return k}),n.d(t,"pan",function(){return Y}),n.d(t,"zoom",function(){return z}),n.d(t,"fitSelection",function(){return N}),n.d(t,"fitToViewer",function(){return I}),n.d(t,"zoomOnViewerCenter",function(){return B}),n.d(t,"openMiniature",function(){return ae}),n.d(t,"closeMiniature",function(){return ue}),n.d(t,"MODE_IDLE",function(){return c}),n.d(t,"MODE_PANNING",function(){return l}),n.d(t,"MODE_ZOOMING",function(){return s}),n.d(t,"TOOL_AUTO",function(){return h}),n.d(t,"TOOL_NONE",function(){return f}),n.d(t,"TOOL_PAN",function(){return d}),n.d(t,"TOOL_ZOOM_IN",function(){return p}),n.d(t,"TOOL_ZOOM_OUT",function(){return v}),n.d(t,"POSITION_NONE",function(){return"none"}),n.d(t,"POSITION_TOP",function(){return g}),n.d(t,"POSITION_RIGHT",function(){return m}),n.d(t,"POSITION_BOTTOM",function(){return b}),n.d(t,"POSITION_LEFT",function(){return y}),n.d(t,"ACTION_ZOOM",function(){return w}),n.d(t,"ACTION_PAN",function(){return O});var He=function(){return console.error("HEY! You are trying to use an older version of ReactSVGPanZoom. Read here https://github.com/chrvadala/react-svg-pan-zoom/blob/master/docs/migrate-from-v1-to-v2.md"),null}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react")):"function"==typeof define&&define.amd?define(["prop-types","react"],t):"object"==typeof exports?exports.ReactSVGPanZoom=t(require("prop-types"),require("react")):e.ReactSVGPanZoom=t(e.PropTypes,e.React)}(window,function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e,t){return{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function o(e,t){return t.map(function(t){return r(e,t)})}function i(e){return{a:parseFloat(e.a),b:parseFloat(e.b),c:parseFloat(e.c),d:parseFloat(e.d),e:parseFloat(e.e),f:parseFloat(e.f)}}n.r(t);var a=/^matrix\(\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*,\s*([0-9_\+\-\.e]+)\s*\)$/i;function u(e){var t=e.match(a);if(null===t||t.length<7)throw new Error("'"+e+"' is not a matrix");return{a:parseFloat(t[1]),b:parseFloat(t[2]),c:parseFloat(t[3]),d:parseFloat(t[4]),e:parseFloat(t[5]),f:parseFloat(t[6])}}function c(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function l(e){var t=e.a,n=e.b,r=e.c,o=e.d,i=e.e,a=e.f,u=t*o-n*r;return{a:o/u,b:n/-u,c:r/-u,d:t/u,e:(o*i-r*a)/-u,f:(n*i-t*a)/u}}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h=function(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)},f=function(e){return null!=e&&"object"===(void 0===e?"undefined":s(e))};function d(e){return f(e)&&e.hasOwnProperty("a")&&h(e.a)&&e.hasOwnProperty("b")&&h(e.b)&&e.hasOwnProperty("c")&&h(e.c)&&e.hasOwnProperty("d")&&h(e.d)&&e.hasOwnProperty("e")&&h(e.e)&&e.hasOwnProperty("f")&&h(e.f)}function p(e){return void 0===e}function v(e){return{a:1,c:0,e:e,b:0,d:1,f:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}}function g(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=function(e,t){return{a:e.a*t.a+e.c*t.b,c:e.a*t.c+e.c*t.d,e:e.a*t.e+e.c*t.f+e.e,b:e.b*t.a+e.d*t.b,d:e.b*t.c+e.d*t.d,f:e.b*t.e+e.d*t.f+e.f}};switch((t=Array.isArray(t[0])?t[0]:t).length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return o(t[0],t[1]);default:var i=(r=t,Array.isArray(r)?r:Array.from(r)),a=i[0],u=i[1],c=i.slice(2),l=o(a,u);return g.apply(void 0,[l].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(c)))}}var m=Math.cos,b=Math.sin,y=Math.PI;function w(e,t,n){var r=m(e),o=b(e),i={a:r,c:-o,e:0,b:o,d:r,f:0};return p(t)||p(n)?i:g([v(t,n),i,v(-t,-n)])}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return w(e*y/180,t,n)}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return p(t)&&(t=e),{a:e,c:0,e:0,b:0,d:t,f:0}}function x(e,t){return{a:1,c:e,e:0,b:t,d:1,f:0}}function P(e){return E(e)}function M(e){return E(e)}function E(e){return"matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")"}n.d(t,"applyToPoint",function(){return r}),n.d(t,"applyToPoints",function(){return o}),n.d(t,"fromObject",function(){return i}),n.d(t,"fromString",function(){return u}),n.d(t,"identity",function(){return c}),n.d(t,"inverse",function(){return l}),n.d(t,"isAffineMatrix",function(){return d}),n.d(t,"rotate",function(){return w}),n.d(t,"rotateDEG",function(){return O}),n.d(t,"scale",function(){return V}),n.d(t,"shear",function(){return x}),n.d(t,"toCSS",function(){return P}),n.d(t,"toSVG",function(){return M}),n.d(t,"toString",function(){return E}),n.d(t,"transform",function(){return g}),n.d(t,"translate",function(){return v})}])},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(0),a=n.n(i),u=n(2),c="idle",l="panning",s="zooming",h="auto",f="none",d="pan",p="zoom-in",v="zoom-out",g="top",m="right",b="bottom",y="left",w="zoom",O="pan",V=("function"==typeof Symbol&&Symbol.iterator,Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e});function x(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e=Object.assign({},e,t,{lastAction:n}),Object.freeze(e)}function P(e,t,n){var r=Object(u.fromObject)(e),o=Object(u.inverse)(r);return Object(u.applyToPoint)(o,{x:t,y:n})}function M(e){var t=Object(u.fromObject)(e);return{scaleFactor:t.a,translationX:t.e,translationY:t.f}}function E(e,t,n,r){var o=e.viewerWidth,i=e.viewerHeight,a=Object(u.transform)(Object(u.translate)(o/2-t,i/2-n),Object(u.translate)(t,n),Object(u.scale)(r,r),Object(u.translate)(-t,-n));return x(e,V({mode:c},a))}function k(e){return x(e,V({mode:c},Object(u.identity)()))}function j(e){return x(e,{mode:c,startX:null,startY:null,endX:null,endY:null})}var T=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var _=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.originalEvent=t,this.value=n,this.SVGViewer=r}return T(e,[{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"scaleFactor",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||M(this.value),this._cacheDecomposedValue.scaleFactor}},{key:"translationX",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||M(this.value),this._cacheDecomposedValue.translationX}},{key:"translationY",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||M(this.value),this._cacheDecomposedValue.translationY}}]),e}(),C=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,_),C(t,[{key:"point",get:function(){if(!this._cachePoint){var e=this.originalEvent,t=this.value,n=this.SVGViewer.getBoundingClientRect(),r=e.clientX-Math.round(n.left),o=e.clientY-Math.round(n.top);this._cachePoint=P(t,r,o)}return this._cachePoint}},{key:"x",get:function(){return this.point.x}},{key:"y",get:function(){return this.point.y}}]),t}(),R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var D=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,_),F(t,[{key:"points",get:function(){return this._cachePoints||(this._cachePoints=t.touchesToPoints(this.originalEvent.touches,this.SVGViewer,this.value)),this._cachePoints}},{key:"changedPoints",get:function(){return this._cacheChangedPoints||(this._cacheChangedPoints=t.touchesToPoints(this.originalEvent.changedTouches,this.SVGViewer,this.value)),this._cacheChangedPoints}}],[{key:"touchesToPoints",value:function(e,t,n){for(var r=[],o=0;o<e.length;o++){var i=e[o],a=t.getBoundingClientRect(),u=P(n,i.clientX-Math.round(a.left),i.clientY-Math.round(a.top));r.push(R({},u,{identifier:i.identifier}))}return r}}]),t}(),q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=Object(u.transform)(Object(u.fromObject)(e),Object(u.translate)(t,n));if(r){var i=Object(u.applyToPoints)(o,[{x:r,y:r},{x:e.SVGWidth-r,y:e.SVGHeight-r}]),a=G(i,2),l=a[0],s=l.x,h=l.y,f=a[1],d=f.x,p=f.y,v=0;e.viewerWidth-s<0?v=e.viewerWidth-s:d<0&&(v=-d);var g=0;e.viewerHeight-h<0?g=e.viewerHeight-h:p<0&&(g=-p),o=Object(u.transform)(Object(u.translate)(v,g),o)}return x(e,q({mode:c},o),O)}function X(e){return x(e,{mode:c,startX:null,startY:null,endX:null,endY:null},O)}function L(e,t){return e.x<=t.x&&e.y<=t.y?{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}:e.x>=t.x&&e.y<=t.y?{x:t.x,y:e.y,width:e.x-t.x,height:t.y-e.y}:e.x>=t.x&&e.y>=t.y?{x:t.x,y:t.y,width:e.x-t.x,height:e.y-t.y}:e.x<=t.x&&e.y>=t.y?{x:e.x,y:t.y,width:t.x-e.x,height:e.y-t.y}:void 0}var H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function W(e,t){return function(e,t){return e.scaleFactorMin&&e.d*t<=e.scaleFactorMin}(e,t)&&t<1||function(e,t){return e.scaleFactorMax&&e.d*t>=e.scaleFactorMax}(e,t)&&t>1}function A(e,t){var n=t.a;return null!=e.scaleFactorMin&&(n=Math.max(n,e.scaleFactorMin)),null!=e.scaleFactorMax&&(n=Math.min(n,e.scaleFactorMax)),x(t,{a:n,d:n})}function z(e,t,n,r){if(W(e,r))return e;var o=Object(u.transform)(Object(u.fromObject)(e),Object(u.translate)(t,n),Object(u.scale)(r,r),Object(u.translate)(-t,-n));return x(e,H({mode:c},A(e,o),{startX:null,startY:null,endX:null,endY:null}),w)}function N(e,t,n,r,o){var i=e.viewerWidth/r,a=e.viewerHeight/o,l=Math.min(i,a),s=Object(u.transform)(Object(u.scale)(l,l),Object(u.translate)(-t,-n));return W(e,l/e.d)?x(e,{mode:c,startX:null,startY:null,endX:null,endY:null}):x(e,H({mode:c},A(e,s),{startX:null,startY:null,endX:null,endY:null}),w)}function I(e){return N(e,0,0,e.SVGWidth,e.SVGHeight)}function B(e,t){var n=P(e,e.viewerWidth/2,e.viewerHeight/2);return z(e,n.x,n.y,t)}function Z(e,t,n,r,o){var i=e.startX,a=e.startY,u=e.endX,c=e.endY,l=P(e,i,a),s=P(e,u,c);if(Math.abs(i-u)>7&&Math.abs(a-c)>7){var h=L(l,s);return N(e,h.x,h.y,h.width,h.height)}var f=P(e,t,n);return z(e,f.x,f.y,r)}function U(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),f=c.left,g=c.top;a=e.clientX-Math.round(f),u=e.clientY-Math.round(g)}var m=r;switch(n){case v:var b=P(r,a,u);m=z(r,b.x,b.y,1/o.scaleFactor);break;case p:m=function(e,t,n){return x(e,{mode:s,startX:t,startY:n,endX:t,endY:n})}(r,a,u);break;case h:case d:m=function(e,t,n){return x(e,{mode:l,startX:t,startY:n,endX:t,endY:n},O)}(r,a,u);break;default:return r}return e.preventDefault(),m}function K(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),f=c.left,v=c.top;a=e.clientX-Math.round(f),u=e.clientY-Math.round(v)}var g=0===e.buttons,m=r;switch(n){case p:r.mode===s&&(m=g?Z(r,a,u,o.scaleFactor):function(e,t,n){if(e.mode!==s)throw new Error("update selection not allowed in this mode "+e.mode);return x(e,{endX:t,endY:n})}(r,a,u));break;case h:case d:r.mode===l&&(m=g?X(r):function(e,t,n,r){if(e.mode!==l)throw new Error("update pan not allowed in this mode "+e.mode);var o=P(e,e.endX,e.endY),i=P(e,t,n);return x(Y(e,i.x-o.x,i.y-o.y,r),{mode:l,endX:t,endY:n},O)}(r,a,u,o.preventPanOutside?20:void 0));break;default:return r}return e.preventDefault(),m}function $(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),f=c.left,g=c.top;a=e.clientX-Math.round(f),u=e.clientY-Math.round(g)}var m=r;switch(n){case v:r.mode===s&&(m=Z(r,a,u,1/o.scaleFactor));break;case p:r.mode===s&&(m=Z(r,a,u,o.scaleFactor));break;case h:case d:r.mode===l&&(m=X(r));break;default:return r}return e.preventDefault(),m}function J(e,t,n,r,o){arguments.length>5&&void 0!==arguments[5]&&arguments[5];var i=function(e,t){return x(e,{focus:t})}(r,"mouseenter"===e.type);return e.preventDefault(),i}function Q(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=i.x,u=i.y;return[f,h].indexOf(n)>=0&&o.detectAutoPan&&r.focus?function(e,t,n){var r=0,o=0;return n<=20&&(o=2),e.viewerWidth-t<=20&&(r=-2),e.viewerHeight-n<=20&&(o=-2),t<=20&&(r=2),r/=e.d,o/=e.d,0===r&&0===o?e:Y(e,r,o)}(r,a,u):r}var ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function te(e){return"number"==typeof e.pinchPointDistance}function ne(e,t,n,r,o){var i=t.getBoundingClientRect(),a=i.left,c=i.top,l=e.touches[0].clientX-Math.round(a),h=e.touches[0].clientY-Math.round(c),f=e.touches[1].clientX-Math.round(a),d=e.touches[1].clientY-Math.round(c),p=Math.sqrt(Math.pow(f-l,2)+Math.pow(d-h,2)),v=te(r)?r.pinchPointDistance:p,g=P(r,(l+f)/2,(h+d)/2),m=p/v;if(W(r,m))return r;e.cancelable&&e.preventDefault();var b=Object(u.transform)(Object(u.fromObject)(r),Object(u.translate)(g.x,g.y),Object(u.scale)(m,m),Object(u.translate)(-g.x,-g.y));return x(r,x(ee({mode:s},A(r,b),{startX:null,startY:null,endX:null,endY:null,prePinchMode:r.prePinchMode?r.prePinchMode:r.mode,pinchPointDistance:p})))}function re(e,t){return t.detectPinchGesture&&e.touches.length>1}function oe(e,t,n,r,o,i){var a=0===e.touches.length?x(r,{mode:r.prePinchMode?c:r.mode,prePinchMode:null}):r,u=function(e,t){var n=t.getBoundingClientRect(),r=n.left,o=n.top;return{x:e.clientX-Math.round(r),y:e.clientY-Math.round(o)}}(e.touches.length>0?e.touches[0]:e.changedTouches[0],t);switch(n){case v:case p:case h:case d:return e.stopPropagation(),e.preventDefault(),i(e,t,n,a,o,u);default:return a}}function ie(e,t,n,r,o){if(!([l,s].indexOf(r.mode)>=0))return r;var i=function(e,t,n){return n.detectPinchGesture&&te(t)&&e.touches.length<2}(e,r,o)?x(r,{pinchPointDistance:null}):r;return e.touches.length>0?i:oe(e,t,n,i,o,$)}function ae(e){return x(e,{miniatureOpen:!0})}function ue(e){return x(e,{miniatureOpen:!1})}var ce=function(){return navigator.userAgent.toLowerCase()},le=function(e){return function(e){return["zoom-in","zoom-out","grab","grabbing"].indexOf(e)>-1}(e)?ce().indexOf("firefox")>-1?"-moz-"+e:ce().indexOf("webkit")>-1?"-webkit-"+e:void 0:e};var se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},he=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var fe=1,de=function(){return"uid"+fe++};function pe(e){var t=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={uid:de()},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),he(n,[{key:"render",value:function(){return o.a.createElement(e,se({_uid:this.state.uid},this.props))}}]),n}();return t.displayName="RandomUID("+function(e){return e.displayName||e.name||"Component"}(e)+")",t}var ve="react-svg-pan-zoom_border_gradient";function ge(e){var t=e.direction,n=e.width,r=e.height,i=e._uid,a=void 0;switch(t){case g:a="translate("+n+", 0) rotate(90)";break;case m:a="translate("+n+", "+r+") rotate(180)";break;case b:a="translate(0, "+r+") rotate(270)";break;case y:a=" "}var u=ve+"_gradient_"+i,c=ve+"_mask_"+i;return o.a.createElement("g",null,o.a.createElement("defs",null,o.a.createElement("linearGradient",{id:u,x1:"0%",y1:"0%",x2:"100%",y2:"0%",spreadMethod:"pad"},o.a.createElement("stop",{offset:"0%",stopColor:"#fff",stopOpacity:"0.8"}),o.a.createElement("stop",{offset:"100%",stopColor:"#000",stopOpacity:"0.5"})),o.a.createElement("mask",{id:c,x:"0",y:"0",width:"20",height:Math.max(n,r)},o.a.createElement("rect",{x:"0",y:"0",width:"20",height:Math.max(n,r),style:{stroke:"none",fill:"url(#"+u+")"}}))),o.a.createElement("rect",{x:"0",y:"0",width:"20",height:Math.max(n,r),style:{stroke:"none",fill:"#000",mask:"url(#"+c+")"},transform:a}))}ge.propTypes={direction:a.a.oneOf([g,m,b,y]).isRequired,width:a.a.number.isRequired,height:a.a.number.isRequired};var me=pe(ge);function be(e){var t=e.startX,n=e.startY,r=e.endX,i=e.endY;if(!(t&&n&&r&&i))return null;var a=L({x:t,y:n},{x:r,y:i});return o.a.createElement("rect",{stroke:"#969FFF",strokeOpacity:.7,fill:"#F3F4FF",fillOpacity:.7,x:a.x,y:a.y,width:a.width,height:a.height,style:{pointerEvents:"none"}})}function ye(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"}))}function we(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"}))}function Oe(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("g",null,o.a.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o.a.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}function Ve(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"}))}function xe(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M15 3l2.3 2.3-2.89 2.87 1.42 1.42L18.7 6.7 21 9V3zM3 9l2.3-2.3 2.87 2.89 1.42-1.42L6.7 5.3 9 3H3zm6 12l-2.3-2.3 2.89-2.87-1.42-1.42L5.3 17.3 3 15v6zm12-6l-2.3 2.3-2.87-2.89-1.42 1.42 2.89 2.87L15 21h6z"}))}be.propTypes={startX:a.a.number.isRequired,startY:a.a.number.isRequired,endX:a.a.number.isRequired,endY:a.a.number.isRequired};var Pe=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Me=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={hover:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.Component),Pe(t,[{key:"change",value:function(e){switch(e.preventDefault(),e.stopPropagation(),e.type){case"mouseenter":case"touchstart":this.setState({hover:!0});break;case"mouseleave":case"touchend":case"touchcancel":this.setState({hover:!1})}}},{key:"render",value:function(){var e=this,t={display:"block",width:"24px",height:"24px",margin:[g,b].indexOf(this.props.toolbarPosition)>=0?"2px 1px":"1px 2px",color:this.props.active||this.state.hover?"#1CA6FC":"#FFF",transition:"color 200ms ease",background:"none",padding:"0px",border:"0px",outline:"0px",cursor:"pointer"};return o.a.createElement("button",{onMouseEnter:function(t){return e.change(t)},onMouseLeave:function(t){return e.change(t)},onTouchStart:function(t){e.change(t),e.props.onClick(t)},onTouchEnd:function(t){return e.change(t)},onTouchCancel:function(t){return e.change(t)},onClick:this.props.onClick,style:t,title:this.props.title,name:this.props.name,role:"button",type:"button"},this.props.children)}}]),t}(),Ee=Me;function ke(e){var t=e.tool,n=e.value,r=e.onChangeValue,i=e.onChangeTool,a=e.position,u=function(e,t){i(t),e.stopPropagation(),e.preventDefault()},c=[g,b].indexOf(a)>=0,l={position:"absolute",transform:[g,b].indexOf(a)>=0?"translate(-50%, 0px)":"none",top:[y,m,g].indexOf(a)>=0?"5px":"unset",left:[g,b].indexOf(a)>=0?"50%":y===a?"5px":"unset",right:[m].indexOf(a)>=0?"5px":"unset",bottom:[b].indexOf(a)>=0?"5px":"unset",backgroundColor:"rgba(19, 20, 22, 0.90)",borderRadius:"2px",display:"flex",flexDirection:c?"row":"column",padding:c?"1px 2px":"2px 1px"};return o.a.createElement("div",{style:l,role:"toolbar"},o.a.createElement(Ee,{toolbarPosition:a,active:t===f,name:"unselect-tools",title:"Selection",onClick:function(e){return u(e,f)}},o.a.createElement(ye,null)),o.a.createElement(Ee,{toolbarPosition:a,active:t===d,name:"select-tool-pan",title:"Pan",onClick:function(e){return u(e,d)}},o.a.createElement(we,null)),o.a.createElement(Ee,{toolbarPosition:a,active:t===p,name:"select-tool-zoom-in",title:"Zoom in",onClick:function(e){return u(e,p)}},o.a.createElement(Oe,null)),o.a.createElement(Ee,{toolbarPosition:a,active:t===v,name:"select-tool-zoom-out",title:"Zoom out",onClick:function(e){return u(e,v)}},o.a.createElement(Ve,null)),o.a.createElement(Ee,{toolbarPosition:a,active:!1,name:"fit-to-viewer",title:"Fit to viewer",onClick:function(e){return function(e){r(I(n)),e.stopPropagation(),e.preventDefault()}(e)}},o.a.createElement(xe,null)))}function je(e){var t=e.open,n=0;switch(e.position){case y:n=t?"rotate(225, 12, 13)":"rotate(45, 12, 13)";break;case m:n=n=t?"rotate(135, 12, 13)":"rotate(-45, 12, 13)"}return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("g",{transform:n},o.a.createElement("path",{fill:"#000000",d:"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"})))}function Te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e){var t,n=e.value,r=e.onChangeValue,i=e.position,a=(Te(t={width:"24px",height:"24px",display:"block",position:"absolute",bottom:0},i===y?"left":"right","0px"),Te(t,"background","rgba(19, 20, 22, 0.901961)"),Te(t,"border",0),Te(t,"padding",0),Te(t,"outline",0),Te(t,"color","#fff"),t),u=n.miniatureOpen?ue:ae;return o.a.createElement("button",{role:"button",type:"button",style:a,onClick:function(e){return r(u(n))}},o.a.createElement(je,{open:n.miniatureOpen,position:i}))}Me.propTypes={title:a.a.string.isRequired,name:a.a.string.isRequired,toolbarPosition:a.a.string.isRequired,onClick:a.a.func.isRequired,active:a.a.bool.isRequired},ke.propTypes={position:a.a.oneOf([g,m,b,y]).isRequired,tool:a.a.string.isRequired,value:a.a.object.isRequired,onChangeValue:a.a.func.isRequired,onChangeTool:a.a.func.isRequired},je.propTypes={open:a.a.bool.isRequired,position:a.a.oneOf([m,y]).isRequired},_e.propTypes={value:a.a.object.isRequired,onChangeValue:a.a.func.isRequired,position:a.a.oneOf([m,y]).isRequired};var Ce="react-svg-pan-zoom_miniature";function Se(e){var t=e.SVGWidth,n=e.SVGHeight,r=e.x1,i=e.y1,a=e.x2,u=e.y2,c=(e.zoomToFit,e._uid),l=Ce+"_mask_"+c;return o.a.createElement("g",null,o.a.createElement("defs",null,o.a.createElement("mask",{id:l},o.a.createElement("rect",{x:"0",y:"0",width:t,height:n,fill:"#ffffff"}),o.a.createElement("rect",{x:r,y:i,width:a-r,height:u-i}))),o.a.createElement("rect",{x:"0",y:"0",width:t,height:n,style:{stroke:"none",fill:"#000",mask:"url(#"+l+")",opacity:.4}}))}Se.propTypes={SVGWidth:a.a.number.isRequired,SVGHeight:a.a.number.isRequired,x1:a.a.number.isRequired,y1:a.a.number.isRequired,x2:a.a.number.isRequired,y2:a.a.number.isRequired,zoomToFit:a.a.number.isRequired};var Re=pe(Se),Fe=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Math.min,Math.max;function qe(e){var t,n=e.value,r=e.onChangeValue,i=e.position,a=e.children,c=e.background,l=e.SVGBackground,s=e.width,h=e.height,f=n.SVGWidth,d=n.SVGHeight,p=n.viewerWidth,v=n.viewerHeight,g=d/f,m=g>=1?h/d:s/f,b=Object(u.applyToPoints)(Object(u.inverse)(n),[{x:0,y:0},{x:p,y:v}]),w=Fe(b,2),O=w[0],V=O.x,x=O.y,P=w[1],M=P.x,E=P.y,k=void 0,j=void 0;n.miniatureOpen?(k=s,j=h):(k=24,j=24);var T=(De(t={position:"absolute",overflow:"hidden",outline:"1px solid rgba(19, 20, 22, 0.90)",transition:"width 200ms ease, height 200ms ease, bottom 200ms ease",width:k+"px",height:j+"px",bottom:"6px"},i===y?"left":"right","6px"),De(t,"background",c),t),_=g>=1?"translate("+(s-f*m)/2+", 0)":"translate(0, "+(h-d*m)/2+")";return o.a.createElement("div",{role:"navigation",style:T},o.a.createElement("svg",{width:s,height:h,style:{pointerEvents:"none"}},o.a.createElement("g",{transform:_},o.a.createElement("g",{transform:"scale("+m+", "+m+")"},o.a.createElement("rect",{fill:l,x:0,y:0,width:n.SVGWidth,height:n.SVGHeight}),a,o.a.createElement(Re,{SVGWidth:f,SVGHeight:d,x1:V,y1:x,x2:M,y2:E,zoomToFit:m})))),o.a.createElement(_e,{value:n,onChangeValue:r,position:i}))}qe.propTypes={position:a.a.oneOf([m,y]).isRequired,value:a.a.object.isRequired,onChangeValue:a.a.func.isRequired,background:a.a.string.isRequired,SVGBackground:a.a.string.isRequired,width:a.a.number.isRequired};var Ge=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ye=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Xe=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),o=r.props,i=o.tool,a=o.value,l=o.width,s=o.height,h=o.scaleFactorMin,d=o.scaleFactorMax,p=o.children.props,v=p.width,g=p.height;return r.state={value:a||function(e,t,n,r,o,i){return x({},V({},Object(u.identity)(),{version:2,mode:c,focus:!1,pinchPointDistance:null,prePinchMode:null,viewerWidth:e,viewerHeight:t,SVGWidth:n,SVGHeight:r,scaleFactorMin:o,scaleFactorMax:i,startX:null,startY:null,endX:null,endY:null,miniatureOpen:!0,lastAction:null}))}(l,s,v,g,h,d),tool:i||f},r.ViewerDOM=null,r.autoPanLoop=r.autoPanLoop.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.Component),Ye(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.getValue(),n=!1,r=t;t.viewerWidth===e.width&&t.viewerHeight===e.height||(r=function(e,t,n){return x(e,{viewerWidth:t,viewerHeight:n})}(r,e.width,e.height),n=!0);var o=e.children.props,i=o.width,a=o.height;t.SVGWidth===i&&t.SVGHeight===a||(r=function(e,t,n){return x(e,{SVGWidth:t,SVGHeight:n})}(r,i,a),n=!0),t.scaleFactorMin===e.scaleFactorMin&&t.scaleFactorMax===e.scaleFactorMax||(r=function(e,t,n){return x(e,{scaleFactorMin:t,scaleFactorMax:n})}(r,e.scaleFactorMin,e.scaleFactorMax),n=!0),n&&this.setValue(r)}},{key:"getValue",value:function(){return this.props.value?this.props.value:this.state.value}},{key:"getTool",value:function(){return this.props.tool?this.props.tool:this.state.tool}},{key:"getSvgStyle",value:function(e){var t={display:"block"};return e&&(t.cursor=e),(this.props.detectPinchGesture||-1!==[d,h].indexOf(this.getTool()))&&(t.touchAction="none"),t}},{key:"setValue",value:function(e){var t=this.props,n=t.onChangeValue,r=t.onZoom,o=t.onPan;this.setState({value:e}),n&&n(e),e.lastAction&&(r&&e.lastAction===w&&r(e),o&&e.lastAction===O&&o(e))}},{key:"pan",value:function(e,t){var n=Y(this.getValue(),e,t);this.setValue(n)}},{key:"zoom",value:function(e,t,n){var r=z(this.getValue(),e,t,n);this.setValue(r)}},{key:"fitSelection",value:function(e,t,n,r){var o=N(this.getValue(),e,t,n,r);this.setValue(o)}},{key:"fitToViewer",value:function(){var e=I(this.getValue());this.setValue(e)}},{key:"zoomOnViewerCenter",value:function(e){var t=B(this.getValue(),e);this.setValue(t)}},{key:"setPointOnViewerCenter",value:function(e,t,n){var r=E(this.getValue(),e,t,n);this.setValue(r)}},{key:"reset",value:function(){var e=k(this.getValue());this.setValue(e)}},{key:"changeTool",value:function(e){this.setState({tool:e}),this.props.onChangeTool&&this.props.onChangeTool(e)}},{key:"openMiniature",value:function(){var e=ae(this.getValue());this.setValue(e)}},{key:"closeMiniature",value:function(){var e=ue(this.getValue());this.setValue(e)}},{key:"handleViewerEvent",value:function(e){var t=this.props,n=this.state.value,r=this.ViewerDOM;if([f,h].indexOf(this.getTool())>=0&&e.target!==r){var o={click:t.onClick,dblclick:t.onDoubleClick,mousemove:t.onMouseMove,mouseup:t.onMouseUp,mousedown:t.onMouseDown,touchstart:t.onTouchStart,touchmove:t.onTouchMove,touchend:t.onTouchEnd,touchcancel:t.onTouchCancel}[e.type];o&&o(function(e,t,n){var r=e.type;switch(r){case"mousemove":case"mouseup":case"mousedown":case"click":case"dblclick":return new S(e,t,n);case"touchstart":case"touchmove":case"touchend":case"touchcancel":return new D(e,t,n);default:throw new Error(r+" not supported")}}(e,n,r))}}},{key:"autoPanLoop",value:function(){var e={x:this.state.viewerX,y:this.state.viewerY},t=Q(null,this.ViewerDOM,this.getTool(),this.getValue(),this.props,e);this.getValue()!==t&&this.setValue(t),this.autoPanIsRunning&&requestAnimationFrame(this.autoPanLoop)}},{key:"componentDidMount",value:function(){var e=this.props,t=this.state;e.onChangeValue&&e.onChangeValue(t.value),this.autoPanIsRunning=!0,requestAnimationFrame(this.autoPanLoop)}},{key:"componentWillUnmount",value:function(){this.autoPanIsRunning=!1}},{key:"render",value:function(){var e=this,t=this.props,n=this.state,r=n.viewerX,i=n.viewerY,a=this.getTool(),w=this.getValue(),O=t.customToolbar,V=t.customMiniature,x=a===h&&w.mode===l&&w.startX!==w.endX&&w.startY!==w.endY,M=void 0;a===d&&(M=le(w.mode===l?"grabbing":"grab")),a===p&&(M=le("zoom-in")),a===v&&(M=le("zoom-out")),x&&(M=le("grabbing"));var E=[d,p,v].indexOf(a)>=0;return E=E||x,o.a.createElement("div",{style:Ge({position:"relative",width:w.viewerWidth,height:w.viewerHeight},t.style),className:this.props.className},o.a.createElement("svg",{ref:function(t){return e.ViewerDOM=t},width:w.viewerWidth,height:w.viewerHeight,style:this.getSvgStyle(M),onMouseDown:function(t){var n=U(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onMouseMove:function(t){var n=e.ViewerDOM.getBoundingClientRect(),r=n.left,o=n.top,i=t.clientX-Math.round(r),a=t.clientY-Math.round(o),u=K(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props,{x:i,y:a});e.getValue()!==u&&e.setValue(u),e.setState({viewerX:i,viewerY:a}),e.handleViewerEvent(t)},onMouseUp:function(t){var n=$(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onClick:function(t){e.handleViewerEvent(t)},onDoubleClick:function(t){var n=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),l=c.left,s=c.top;a=e.clientX-Math.round(l),u=e.clientY-Math.round(s)}var f=r;switch(n){case h:if(!o.disableDoubleClickZoomWithToolAuto){var d=P(r,a,u),p=o.modifierKeys.reduce(function(t,n){return t||e.getModifierState(n)},!1)?1/o.scaleFactor:o.scaleFactor;f=z(r,d.x,d.y,p)}break;default:return r}return e.preventDefault(),f}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onWheel:function(t){var n=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=void 0,u=void 0;if(i)a=i.x,u=i.y;else{var c=t.getBoundingClientRect(),l=c.left,s=c.top;a=e.clientX-Math.round(l),u=e.clientY-Math.round(s)}if(!o.detectWheel)return r;var h=function(e,t,n,r,o){return r+(o-r)*(e-t)/(n-t)}(Math.max(-1,Math.min(1,e.deltaY)),-1,1,o.scaleFactorOnWheel,1/o.scaleFactorOnWheel),f=P(r,a,u),d=z(r,f.x,f.y,h);return e.preventDefault(),d}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n)},onMouseEnter:function(t){if(!("ontouchstart"in window||navigator.maxTouchPoints)){var n=J(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n)}},onMouseLeave:function(t){var n=J(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n)},onTouchStart:function(t){var n=function(e,t,n,r,o){if(re(e,o))return ne(e,t,0,r);if(1!==e.touches.length){if([l,s].indexOf(r.mode)>=0)return j(r);if([c].indexOf(r.mode)>=0)return r}return oe(e,t,n,r,o,U)}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onTouchMove:function(t){var n=function(e,t,n,r,o){return re(e,o)?ne(e,t,0,r):[l,s].indexOf(r.mode)>=0?oe(e,t,n,r,o,K):r}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onTouchEnd:function(t){var n=ie(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)},onTouchCancel:function(t){var n=function(e,t,n,r,o){return e.stopPropagation(),e.preventDefault(),j(r)}(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==n&&e.setValue(n),e.handleViewerEvent(t)}},o.a.createElement("rect",{fill:t.background,x:0,y:0,width:w.viewerWidth,height:w.viewerHeight,style:{pointerEvents:"none"}}),o.a.createElement("g",{transform:Object(u.toSVG)(w),style:E?{pointerEvents:"none"}:{}},o.a.createElement("rect",{fill:this.props.SVGBackground,style:this.props.SVGStyle,x:0,y:0,width:w.SVGWidth,height:w.SVGHeight}),o.a.createElement("g",null,t.children.props.children)),[f,h].indexOf(a)>=0&&t.detectAutoPan&&w.focus?o.a.createElement("g",{style:{pointerEvents:"none"}},i<=20?o.a.createElement(me,{direction:g,width:w.viewerWidth,height:w.viewerHeight}):null,w.viewerWidth-r<=20?o.a.createElement(me,{direction:m,width:w.viewerWidth,height:w.viewerHeight}):null,w.viewerHeight-i<=20?o.a.createElement(me,{direction:b,width:w.viewerWidth,height:w.viewerHeight}):null,w.focus&&r<=20?o.a.createElement(me,{direction:y,width:w.viewerWidth,height:w.viewerHeight}):null):null,w.mode!==s?null:o.a.createElement(be,{startX:w.startX,startY:w.startY,endX:w.endX,endY:w.endY})),"none"===t.toolbarPosition?null:o.a.createElement(O,{position:t.toolbarPosition,value:w,onChangeValue:function(t){return e.setValue(t)},tool:a,onChangeTool:function(t){return e.changeTool(t)}}),"none"===t.miniaturePosition?null:o.a.createElement(V,{position:t.miniaturePosition,value:w,onChangeValue:function(t){return e.setValue(t)},SVGBackground:this.props.SVGBackground,background:this.props.miniatureBackground,width:this.props.miniatureWidth,height:this.props.miniatureHeight},t.children.props.children))}}]),t}(),Le=Xe;Xe.propTypes={width:a.a.number.isRequired,height:a.a.number.isRequired,background:a.a.string,SVGBackground:a.a.string,SVGStyle:a.a.object,value:a.a.shape({version:a.a.oneOf([2]).isRequired,mode:a.a.oneOf([c,l,s]).isRequired,focus:a.a.bool.isRequired,a:a.a.number.isRequired,b:a.a.number.isRequired,c:a.a.number.isRequired,d:a.a.number.isRequired,e:a.a.number.isRequired,f:a.a.number.isRequired,viewerWidth:a.a.number.isRequired,viewerHeight:a.a.number.isRequired,SVGWidth:a.a.number.isRequired,SVGHeight:a.a.number.isRequired,startX:a.a.number,startY:a.a.number,endX:a.a.number,endY:a.a.number,miniatureOpen:a.a.bool.isRequired}),style:a.a.object,className:a.a.string,detectWheel:a.a.bool,detectAutoPan:a.a.bool,detectPinchGesture:a.a.bool,toolbarPosition:a.a.oneOf(["none",g,m,b,y]),onChangeValue:a.a.func,onChangeTool:a.a.func,onZoom:a.a.func,onPan:a.a.func,onClick:a.a.func,onDoubleClick:a.a.func,onMouseUp:a.a.func,onMouseMove:a.a.func,onMouseDown:a.a.func,preventPanOutside:a.a.bool,scaleFactor:a.a.number,scaleFactorOnWheel:a.a.number,scaleFactorMax:a.a.number,scaleFactorMin:a.a.number,tool:a.a.oneOf([h,f,d,p,v]),modifierKeys:a.a.array,customToolbar:a.a.oneOfType([a.a.element,a.a.func]),miniaturePosition:a.a.oneOf(["none",m,y]),miniatureBackground:a.a.string,miniatureWidth:a.a.number,miniatureHeight:a.a.number,customMiniature:a.a.oneOfType([a.a.element,a.a.func]),disableDoubleClickZoomWithToolAuto:a.a.bool,children:function(e,t,n){var r=e[t],i=["svg"];return 1!==o.a.Children.count(r)||-1===i.indexOf(r.type)?new Error("`"+n+"` should have a single child of the following types: `"+i.join("`, `")+"`."):r.props.hasOwnProperty("width")&&r.props.hasOwnProperty("height")?void 0:new Error("SVG should have props `width` and `height`")}},Xe.defaultProps={value:null,tool:null,style:{},background:"#616264",SVGBackground:"#fff",SVGStyle:{},detectWheel:!0,detectAutoPan:!0,detectPinchGesture:!0,toolbarPosition:m,modifierKeys:["Alt","Shift","Control"],customToolbar:ke,preventPanOutside:!0,scaleFactor:1.1,scaleFactorOnWheel:1.06,miniaturePosition:y,miniatureWidth:100,miniatureHeight:80,miniatureBackground:"#616264",customMiniature:qe,disableZoomWithToolAuto:!1,onZoom:null,onPan:null},n.d(t,"Viewer",function(){return He}),n.d(t,"ReactSVGPanZoom",function(){return Le}),n.d(t,"Toolbar",function(){return ke}),n.d(t,"Miniature",function(){return qe}),n.d(t,"setPointOnViewerCenter",function(){return E}),n.d(t,"reset",function(){return k}),n.d(t,"pan",function(){return Y}),n.d(t,"zoom",function(){return z}),n.d(t,"fitSelection",function(){return N}),n.d(t,"fitToViewer",function(){return I}),n.d(t,"zoomOnViewerCenter",function(){return B}),n.d(t,"openMiniature",function(){return ae}),n.d(t,"closeMiniature",function(){return ue}),n.d(t,"MODE_IDLE",function(){return c}),n.d(t,"MODE_PANNING",function(){return l}),n.d(t,"MODE_ZOOMING",function(){return s}),n.d(t,"TOOL_AUTO",function(){return h}),n.d(t,"TOOL_NONE",function(){return f}),n.d(t,"TOOL_PAN",function(){return d}),n.d(t,"TOOL_ZOOM_IN",function(){return p}),n.d(t,"TOOL_ZOOM_OUT",function(){return v}),n.d(t,"POSITION_NONE",function(){return"none"}),n.d(t,"POSITION_TOP",function(){return g}),n.d(t,"POSITION_RIGHT",function(){return m}),n.d(t,"POSITION_BOTTOM",function(){return b}),n.d(t,"POSITION_LEFT",function(){return y}),n.d(t,"ACTION_ZOOM",function(){return w}),n.d(t,"ACTION_PAN",function(){return O});var He=function(){return console.error("HEY! You are trying to use an older version of ReactSVGPanZoom. Read here https://github.com/chrvadala/react-svg-pan-zoom/blob/master/docs/migrate-from-v1-to-v2.md"),null}}])});
//# sourceMappingURL=react-svg-pan-zoom.min.js.map
{
"author": "chrvadala",
"name": "react-svg-pan-zoom",
"version": "2.16.0",
"version": "2.16.1",
"description": "A React component that adds pan and zoom features to SVG",

@@ -54,11 +54,11 @@ "main": "./build-commonjs/index.js",

"prop-types": "^15.6.1",
"transformation-matrix": "^1.7.0"
"transformation-matrix": "^1.10.0"
},
"devDependencies": {
"@storybook/addon-actions": "^3.3.15",
"@storybook/addon-knobs": "^3.3.15",
"@storybook/addon-options": "^3.3.15",
"@storybook/addons": "^3.3.15",
"@storybook/react": "^3.3.15",
"@storybook/ui": "^3.3.15",
"@storybook/addon-knobs": "^3.4.0",
"@storybook/addon-options": "^3.4.0",
"@storybook/addons": "^3.4.0",
"@storybook/react": "^3.4.0",
"@storybook/ui": "^3.4.0",
"babel-cli": "^6.26.0",

@@ -75,8 +75,8 @@ "babel-core": "^6.26.0",

"npm-run-all": "^4.1.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-virtualized": "^9.18.5",
"webpack": "^4.1.1",
"webpack-cli": "^2.0.10",
"webpack-dev-server": "^3.1.1"
"webpack": "^4.5.0",
"webpack-cli": "^2.0.14",
"webpack-dev-server": "^3.1.3"
},

@@ -83,0 +83,0 @@ "peerDependencies": {

@@ -50,2 +50,3 @@ # react-svg-pan-zoom

- [**JSFiddle**](https://jsfiddle.net/chrvadala/f67qyfsd/) - This is a JSFiddle demo that uses UMD bundle.
- [**CodeSandbox**](https://codesandbox.io/s/1v19809803) - This is a CodeSandbox demo.

@@ -86,1 +87,2 @@ ## Changelog

- [ahmedhosny](https://github.com/ahmedhosny)
- [spcfran](https://github.com/spcfran)

@@ -25,3 +25,3 @@ import React from 'react';

return (
<button role="button" style={style} onClick={event => onChangeValue(action(value))}>
<button role="button" type="button" style={style} onClick={event => onChangeValue(action(value))}>
<IconArrow open={value.miniatureOpen} position={position}/>

@@ -28,0 +28,0 @@ </button>

@@ -63,3 +63,3 @@ import React from 'react';

role="button"
type="button"
>{this.props.children}</button>

@@ -66,0 +66,0 @@ )

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc