-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7.58e89c1e.js
2 lines (2 loc) · 10.2 KB
/
7.58e89c1e.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{992:function(e,t,n){"use strict";n.r(t);var r=n(11),a=n(13),o=n(7),i=n(15),c=n(0),s=n.n(c),l=n(485),u=n(12),f=n.n(u),p=n(337),d=n(338),h=n(388),v=n(24),y=n(1),b=n(5),g=(n(2),n(4)),m=n(75),w=Object(m.a)(c.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");var O=c.forwardRef((function(e,t){var n=e.alt,r=e.children,a=e.classes,o=e.className,i=e.component,s=void 0===i?"div":i,l=e.imgProps,u=e.sizes,f=e.src,p=e.srcSet,d=e.variant,h=void 0===d?"circle":d,v=Object(b.a)(e,["alt","children","classes","className","component","imgProps","sizes","src","srcSet","variant"]),m=null,O=function(e){var t=e.src,n=e.srcSet,r=c.useState(!1),a=r[0],o=r[1];return c.useEffect((function(){if(t||n){o(!1);var e=!0,r=new Image;return r.src=t,r.srcSet=n,r.onload=function(){e&&o("loaded")},r.onerror=function(){e&&o("error")},function(){e=!1}}}),[t,n]),a}({src:f,srcSet:p}),j=f||p,C=j&&"error"!==O;return m=C?c.createElement("img",Object(y.a)({alt:n,src:f,srcSet:p,sizes:u,className:a.img},l)):null!=r?r:j&&n?n[0]:c.createElement(w,{className:a.fallback}),c.createElement(s,Object(y.a)({className:Object(g.a)(a.root,a.system,a[h],o,!C&&a.colorDefault),ref:t},v),m)})),j=Object(o.a)((function(e){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:e.palette.background.default,backgroundColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},circle:{},circular:{},rounded:{borderRadius:e.shape.borderRadius},square:{borderRadius:0},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4},fallback:{width:"75%",height:"75%"}}}),{name:"MuiAvatar"})(O),C=n(878),x=n(898),I=n.n(x),k=n(302),E=n.n(k),P=n(50),S=n.n(P),R=(n(514),n(420)),A=n(42),_=n(104);function N(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)}}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(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,r=$(e);if(t){var a=$(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return q(this,n)}}function q(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?T(e):t}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $(e){return($=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var K=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}}),t&&D(e,t)}(o,e);var t,n,r,a=z(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=a.call(this,e)).state={requestedAnnotations:!1},t.handleSelect=t.handleSelect.bind(T(t)),t.handleKey=t.handleKey.bind(T(t)),t.handleIntersection=t.handleIntersection.bind(T(t)),t}return t=o,(n=[{key:"handleSelect",value:function(){var e=this.props,t=e.canvas,n=e.selected,r=e.setCanvas,a=e.focusOnCanvas;n?a():r(t.id)}},{key:"handleKey",value:function(e){var t=this.props,n=t.canvas,r=t.setCanvas,a=t.focusOnCanvas;this.keys={enter:"Enter",space:" "},this.chars={enter:13,space:32},e.key===this.keys.enter||e.which===this.chars.enter||e.key===this.keys.space||e.which===this.chars.space?a():r(n.id)}},{key:"handleIntersection",value:function(e){var t=e.isIntersecting,n=this.props,r=n.annotationsCount,a=n.requestCanvasAnnotations,o=this.state.requestedAnnotations;!t||void 0===r||r>0||o||(this.setState({requestedAnnotations:!0}),a())}},{key:"render",value:function(){var e=this.props,t=e.annotationsCount,n=e.searchAnnotationsCount,r=e.canvas,a=e.classes,o=e.config,i=e.selected,c=new A.a(r);return s.a.createElement(R.a,{onChange:this.handleIntersection},s.a.createElement("div",{key:r.index,className:S()(a.galleryViewItem,i?a.selected:"",n>0?a.hasAnnotations:""),onClick:this.handleSelect,onKeyUp:this.handleKey,role:"button",tabIndex:0},s.a.createElement(_.a,{resource:r,labelled:!0,variant:"outside",maxWidth:o.width,maxHeight:o.height,style:{margin:"0 auto",maxWidth:"".concat(Math.ceil(o.height*c.aspectRatio),"px")}},s.a.createElement("div",{className:a.chips},n>0&&s.a.createElement(C.a,{avatar:s.a.createElement(j,{className:a.avatar,classes:{circle:a.avatarIcon}},s.a.createElement(E.a,{fontSize:"small"})),label:n,className:S()(a.searchChip),size:"small"}),(t||0)>0&&s.a.createElement(C.a,{avatar:s.a.createElement(j,{className:a.avatar,classes:{circle:a.avatarIcon}},s.a.createElement(I.a,{className:a.annotationIcon})),label:t,className:S()(a.annotationsChip),size:"small"})))))}}])&&N(t.prototype,n),r&&N(t,r),o}(c.Component);K.defaultProps={annotationsCount:void 0,config:{height:100,width:null},requestCanvasAnnotations:function(){},searchAnnotationsCount:0,selected:!1};var B=n(33),V=n(412),W=n(93),F=n(421),H=n(77);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){G(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function G(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=Object(r.compose)(Object(a.b)((function(e,t){var n=t.canvas,r=t.windowId,a=Object(B.g)(e,{windowId:r}),o=Object(V.f)(e,{windowId:r}),i=f()(o.map((function(e){return e.resources}))).filter((function(e){return e.targetId===n.id})),c=Object(W.e)(e,{content:"annotations",windowId:r}).length>0;return{annotationsCount:function(){if(c)return Object(F.d)(e,{canvasId:n.id}).reduce((function(e,t){return e+t.resources.filter((function(e){return e.targetId===n.id})).length}),0)}(),config:Object(H.a)(e).galleryView,searchAnnotationsCount:i.length,selected:a&&a.id===n.id}}),(function(e,t){var n=t.canvas,r=(t.id,t.windowId);return{focusOnCanvas:function(){return e(p.i(r,"single"))},requestCanvasAnnotations:function(){return e(d.f(r,n.id))},setCanvas:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e(h.a.apply(v,[r].concat(n)))}}})),Object(o.a)((function(e){return{annotationIcon:{height:"1rem",width:"1rem"},annotationsChip:J({},e.typography.caption),avatar:{backgroundColor:"transparent"},chips:{opacity:.875,position:"absolute",right:0,textAlign:"right",top:0},galleryViewItem:{"&$hasAnnotations":{border:"2px solid ".concat(e.palette.action.selected)},"&$selected,&$selected$hasAnnotations":{border:"2px solid ".concat(e.palette.primary.main)},"&:focus":{outline:"none"},"&:hover":{backgroundColor:e.palette.action.hover},border:"2px solid transparent",cursor:"pointer",display:"inline-block",margin:"".concat(e.spacing(1),"px ").concat(e.spacing(.5),"px"),maxHeight:function(e){return e.config.height+45},minWidth:"60px",overflow:"hidden",padding:e.spacing(.5),position:"relative",width:"min-content"},hasAnnotations:{},searchChip:J(J({},e.typography.caption),{},{"&$selected $avatar":{backgroundColor:e.palette.highlights.primary},marginTop:2}),selected:{}}})))(K);function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y(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)}}function L(e,t){return(L=Object.setPrototypeOf||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,r=ee(e);if(t){var a=ee(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Z(this,n)}}function Z(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var te=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}}),t&&L(e,t)}(o,e);var t,n,r,a=Q(o);function o(){return X(this,o),a.apply(this,arguments)}return t=o,(n=[{key:"render",value:function(){var e=this.props,t=e.canvases,n=e.classes,r=e.viewingDirection,a=e.windowId,o="right-to-left"===r?"rtl":"ltr";return s.a.createElement(l.a,{component:"section",dir:o,square:!0,elevation:0,className:n.galleryContainer,id:"".concat(a,"-gallery")},t.map((function(e){return s.a.createElement(U,{key:e.id,windowId:a,canvas:e})})))}}])&&Y(t.prototype,n),r&&Y(t,r),o}(c.Component);te.defaultProps={classes:{},viewingDirection:""};var ne=n(55),re=Object(r.compose)(Object(o.a)((function(e){return{galleryContainer:{alignItems:"flex-start",display:"flex",flexDirection:"row",flexWrap:"wrap",overflowX:"hidden",overflowY:"scroll",padding:"50px 0 50px 20px",width:"100%"}}})),Object(a.b)((function(e,t){var n=t.windowId;return{canvases:Object(B.f)(e,{windowId:n}),viewingDirection:Object(ne.e)(e,{windowId:n})}})),Object(i.a)("GalleryView"));t.default=re(te)}}]);
//# sourceMappingURL=7.58e89c1e.js.map