-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7dc17c328b506af49c99bf8c3a0419698ed32d9e-7826e77d6b782cc36e6d.js
2 lines (2 loc) · 18.2 KB
/
7dc17c328b506af49c99bf8c3a0419698ed32d9e-7826e77d6b782cc36e6d.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"GD1+":function(e,t,n){"use strict";n.d(t,"a",(function(){return Y}));var o=n("q1tI"),r=n.n(o);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=s(e);if(t){var r=s(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return f(this,n)}}function f(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(a,e);var t,n,o,r=u(a);function a(){return c(this,a),r.apply(this,arguments)}return t=a,(n=[{key:"componentDidMount",value:function(){!function(e,t){if(!document.head.querySelector("#"+e)){var n=document.createElement("style");n.textContent=t,n.type="text/css",n.id=e,document.head.appendChild(n)}}(this.props.name,this.props.css)}},{key:"componentWillUnmount",value:function(){var e=document.getElementById(this.props.name);e.parentNode.removeChild(e)}},{key:"render",value:function(){return null}}])&&i(t.prototype,n),o&&i(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Component),d=function(e){var t=e.imageBackgroundColor;return"\n body {\n overflow: hidden;\n }\n\n .__react_modal_image__modal_container {\n position: fixed;\n z-index: 5000;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n touch-action: none;\n overflow: hidden;\n }\n\n .__react_modal_image__modal_content {\n position: relative;\n height: 100%;\n width: 100%;\n }\n\n .__react_modal_image__modal_content img, \n .__react_modal_image__modal_content svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0);\n -webkit-transform: translate3d(-50%, -50%, 0);\n -ms-transform: translate3d(-50%, -50%, 0);\n overflow: hidden;\n }\n\n .__react_modal_image__medium_img {\n max-width: 98%;\n max-height: 98%;\n background-color: ".concat(t,";\n }\n\n .__react_modal_image__large_img {\n cursor: move;\n background-color: ").concat(t,"\n }\n\n .__react_modal_image__icon_menu a {\n display: inline-block;\n font-size: 40px;\n cursor: pointer;\n line-height: 40px;\n box-sizing: border-box;\n border: none;\n padding: 0px 5px 0px 5px;\n margin-left: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0);\n }\n\n .__react_modal_image__icon_menu {\n display: inline-block;\n float: right;\n }\n\n .__react_modal_image__caption {\n display: inline-block;\n color: white;\n font-size: 120%;\n padding: 10px;\n margin: 0;\n }\n\n .__react_modal_image__header {\n position: absolute;\n top: 0;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n overflow: hidden;\n }\n")},p=function(){return r.a.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},r.a.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),r.a.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))},h=function(){return r.a.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},r.a.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),r.a.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))},y=function(){return r.a.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},r.a.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),r.a.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},v=function(){return r.a.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},r.a.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),r.a.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},g=function(){return r.a.createElement("svg",{fill:"#ffffff",height:"48",viewBox:"0 0 24 24",width:"48",xmlns:"http://www.w3.org/2000/svg"},r.a.createElement("path",{d:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"}),r.a.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}))},b=function(){return r.a.createElement("svg",{fill:"#ffffff",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},r.a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0zm0 0h24v24H0V0z"}),r.a.createElement("path",{d:"M7.47 21.49C4.2 19.93 1.86 16.76 1.5 13H0c.51 6.16 5.66 11 11.95 11 .23 0 .44-.02.66-.03L8.8 20.15l-1.33 1.34zM12.05 0c-.23 0-.44.02-.66.04l3.81 3.81 1.33-1.33C19.8 4.07 22.14 7.24 22.5 11H24c-.51-6.16-5.66-11-11.95-11zM16 14h2V8c0-1.11-.9-2-2-2h-6v2h6v6zm-8 2V4H6v2H4v2h2v8c0 1.1.89 2 2 2h8v2h2v-2h2v-2H8z"}))};var _=function(e){return function(t){(function(e){return document.location.hostname!==new URL(e,document.location).hostname})(e)&&(t.preventDefault(),fetch(e).then((function(t){return t.ok||console.error("Failed to download image, HTTP status "+t.status+" from "+e),t.blob().then((function(t){var n=document.createElement("a");n.setAttribute("download",e.split("/").pop()),n.href=URL.createObjectURL(t),n.click()}))})).catch((function(t){console.error(t),console.error("Failed to download image from "+e)})))}},w=function(e){var t=e.image,n=e.alt,o=e.zoomed,a=e.toggleZoom,c=e.toggleRotate,i=e.onClose,l=e.enableDownload,u=e.enableZoom,f=e.enableRotate;return r.a.createElement("div",{className:"__react_modal_image__header"},r.a.createElement("span",{className:"__react_modal_image__icon_menu"},l&&r.a.createElement("a",{href:t,download:!0,onClick:_(t)},r.a.createElement(y,null)),u&&r.a.createElement("a",{onClick:a},o?r.a.createElement(h,null):r.a.createElement(p,null)),f&&r.a.createElement("a",{onClick:c},r.a.createElement(b,null)),r.a.createElement("a",{onClick:i},r.a.createElement(v,null))),n&&r.a.createElement("span",{className:"__react_modal_image__caption"},n))};function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function j(e,t){return(j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=C(e);if(t){var r=C(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return k(this,n)}}function k(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return S(e)}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}(c,e);var t,n,o,a=M(c);function c(){var e;E(this,c);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return P(S(e=a.call.apply(a,[this].concat(n))),"state",{loading:!0}),P(S(e),"handleOnLoad",(function(){e.setState({loading:!1})})),P(S(e),"handleOnContextMenu",(function(t){!e.props.contextMenu&&t.preventDefault()})),e}return t=c,(n=[{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,o=e.src,a=e.style,c=e.handleDoubleClick;return r.a.createElement("div",null,this.state.loading&&r.a.createElement(g,null),r.a.createElement("img",{id:t,className:n,src:o,style:a,onLoad:this.handleOnLoad,onDoubleClick:c,onContextMenu:this.handleOnContextMenu}))}}])&&x(t.prototype,n),o&&x(t,o),Object.defineProperty(t,"prototype",{writable:!1}),c}(o.Component);function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function H(e,t){return(H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function B(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=N(e);if(t){var r=N(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return V(this,n)}}function V(e,t){if(t&&("object"===R(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return L(e)}function L(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(c,e);var t,n,o,a=B(c);function c(){var e;D(this,c);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Z(L(e=a.call.apply(a,[this].concat(n))),"state",{move:{x:0,y:0},moveStart:void 0,zoomed:!1,rotationDeg:0}),Z(L(e),"handleKeyDown",(function(t){27!==t.keyCode&&13!==t.keyCode||e.props.onClose()})),Z(L(e),"getCoordinatesIfOverImg",(function(t){var n=t.changedTouches?t.changedTouches[0]:t;if("react-modal-image-img"===n.target.id){var o=e.contentEl.getBoundingClientRect();return{x:n.clientX-o.left,y:n.clientY-o.top}}})),Z(L(e),"handleMouseDownOrTouchStart",(function(t){if(t.preventDefault(),!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n||e.props.onClose(),e.state.zoomed&&e.setState((function(e){return{moveStart:{x:n.x-e.move.x,y:n.y-e.move.y}}}))}})),Z(L(e),"handleMouseMoveOrTouchMove",(function(t){if(t.preventDefault(),e.state.zoomed&&e.state.moveStart&&!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n&&e.setState((function(e){return{move:{x:n.x-e.moveStart.x,y:n.y-e.moveStart.y}}}))}})),Z(L(e),"handleMouseUpOrTouchEnd",(function(t){e.setState({moveStart:void 0})})),Z(L(e),"toggleZoom",(function(t){t.preventDefault(),e.setState((function(e){return{zoomed:!e.zoomed,move:e.zoomed?{x:0,y:0}:e.move}}))})),Z(L(e),"toggleRotate",(function(t){t.preventDefault(),360!==e.state.rotationDeg?e.setState((function(e){return{rotationDeg:e.rotationDeg+=90}})):e.setState({rotationDeg:90})})),e}return t=c,(n=[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown,!1)}},{key:"render",value:function(){var e=this,t=this.props,n=t.medium,o=t.large,a=t.alt,c=t.onClose,i=t.hideDownload,l=t.hideZoom,u=t.showRotate,f=t.imageBackgroundColor,s=void 0===f?"black":f,p=this.state,h=p.move,y=p.zoomed,v=p.rotationDeg;return r.a.createElement("div",null,r.a.createElement(m,{name:"__react_modal_image__lightbox",css:d({imageBackgroundColor:s})}),r.a.createElement("div",{className:"__react_modal_image__modal_container"},r.a.createElement("div",{className:"__react_modal_image__modal_content",onMouseDown:this.handleMouseDownOrTouchStart,onMouseUp:this.handleMouseUpOrTouchEnd,onMouseMove:this.handleMouseMoveOrTouchMove,onTouchStart:this.handleMouseDownOrTouchStart,onTouchEnd:this.handleMouseUpOrTouchEnd,onTouchMove:this.handleMouseMoveOrTouchMove,ref:function(t){e.contentEl=t}},y&&r.a.createElement(z,{id:"react-modal-image-img",className:"__react_modal_image__large_img",src:o||n,style:{transform:"translate3d(-50%, -50%, 0) translate3d(".concat(h.x,"px, ").concat(h.y,"px, 0) rotate(").concat(v,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(h.x,"px, ").concat(h.y,"px, 0) rotate(").concat(v,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(h.x,"px, ").concat(h.y,"px, 0) rotate(").concat(v,"deg)")},handleDoubleClick:this.toggleZoom}),!y&&r.a.createElement(z,{id:"react-modal-image-img",className:"__react_modal_image__medium_img",src:n||o,handleDoubleClick:this.toggleZoom,contextMenu:!n,style:{transform:"translate3d(-50%, -50%, 0) rotate(".concat(v,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) rotate(".concat(v,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) rotate(".concat(v,"deg)")}})),r.a.createElement(w,{image:o||n,alt:a,zoomed:y,toggleZoom:this.toggleZoom,toggleRotate:this.toggleRotate,onClose:c,enableDownload:!i,enableZoom:!l,enableRotate:!!u})))}}])&&T(t.prototype,n),o&&T(t,o),Object.defineProperty(t,"prototype",{writable:!1}),c}(o.Component);function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function K(e,t){return(K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=G(e);if(t){var r=G(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return F(this,n)}}function F(e,t){if(t&&("object"===I(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return J(e)}function J(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e){return(G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K(e,t)}(c,e);var t,n,o,a=q(c);function c(){var e;W(this,c);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return X(J(e=a.call.apply(a,[this].concat(n))),"state",{modalOpen:!1}),X(J(e),"toggleModal",(function(){e.setState((function(e){return{modalOpen:!e.modalOpen}}))})),e}return t=c,(n=[{key:"render",value:function(){var e=this.props,t=e.className,n=e.small,o=e.smallSrcSet,a=e.medium,c=e.large,i=e.alt,l=e.hideDownload,u=e.hideZoom,f=e.showRotate,s=e.imageBackgroundColor,m=this.state.modalOpen;return r.a.createElement("div",null,r.a.createElement("img",{className:t,style:{cursor:"pointer",maxWidth:"100%",maxHeight:"100%"},onClick:this.toggleModal,src:n,srcSet:o,alt:i}),m&&r.a.createElement(U,{medium:a,large:c,alt:i,onClose:this.toggleModal,hideDownload:l,hideZoom:u,showRotate:f,imageBackgroundColor:s}))}}])&&A(t.prototype,n),o&&A(t,o),Object.defineProperty(t,"prototype",{writable:!1}),c}(o.Component)}}]);
//# sourceMappingURL=7dc17c328b506af49c99bf8c3a0419698ed32d9e-7826e77d6b782cc36e6d.js.map