1(self.webpackChunkplatform_web=self.webpackChunkplatform_web||[]).push([[246],{51659:function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return y}});var r=t(74165),o=t(15861),i=t(29439),a=t(34208),s=t(50390),u=t(58364),l=t(8991),c=(t(29133),t(6542),t(63309)),d=t.n(c),m=t(36088),f=t(45082),v=t(18326),p=t(75501),h=t(49108),b=t(62559);var C=(0,a.Z)("div",{target:"e1ne2tqo0"})({name:"447v19",styles:"position:relative;line-height:normal;text-align:left"});function y(n){var e=n.asset,t=n.annotateButtonRef,a=(0,s.useState)(!1),c=(0,i.Z)(a,2),y=c[0],g=c[1],k=(0,h._i)(),Z=k.activeCommentId,w=k.setActiveCommentId,A=(0,s.useRef)(null),j=(0,s.useRef)(null),x=(0,s.useRef)(null),I=(0,s.useState)(null),S=(0,i.Z)(I,2),E=S[0],L=S[1],R=(0,m.e6)(),T=(0,m.Vq)(),M=(0,u.D)(p.f),P=(0,i.Z)(M,1)[0],_=(0,s.useMemo)((function(){return R.comments?R.comments.filter((function(n){return n.assetId===parseInt(e.id||"0")&&!n.resolved})):[]}),[R,e]),q=Z?_.find((function(n){return n.id===Z})):null,D=(0,s.useCallback)((function(){null===E||void 0===E||E.fire("addingAnnotation"),g(!0),w(null)}),[E,w]),O=(0,s.useCallback)((function(n){w(n.detail.annotation.id)}),[w]),B=function(){var n=(0,o.Z)((0,r.Z)().mark((function n(t){var o,i,a,s,u,l,c;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=t.body,a=Math.floor((null===x||void 0===x||null===(o=x.current)||void 0===o?void 0:o.currentTime())||0),s={commentableId:R.id,commentableType:"Story",assetId:e.id,startTime:a,body:i},n.next=5,P({variables:s});case 5:return u=n.sent,l=u.data.createComment.comment.id,n.next=9,T();case 9:c={id:l,range:{start:a},comments:[]},E.fire("newAnnotation",c),w(l),g(!1),E.fire("cancelAddingAnnotation");case 14:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),F=(0,s.useCallback)((function(){return _.map((function(n){return{id:n.id,range:{start:n.startTime},comments:[{id:n.id,meta:{datetime:n.createdAt,user_name:n.author.fullName},body:n.body}]}}))}),[_]),K=(0,s.useCallback)((function(){if(!x.current){var n,t={autoplay:!1,controls:!0,responsive:!0,fluid:!0,sources:[{src:e.url,type:"video/mp4"}]},r={annotationsObjects:F(),showControls:!1,bindArrowKeys:!1,showCommentList:!1,showMarkerShapeAndTooltips:!1,showFullScreen:!1,internalCommenting:!1,startInAnnotationMode:!0},o=document.createElement("video-js");o.classList.add("vjs-big-play-centered"),null===(n=A.current)||void 0===n||n.appendChild(o);var i=x.current=(0,l.Z)(o,t);l.Z.getPlugins().annotationComments||l.Z.registerPlugin("annotationComments",d()(l.Z));var a=i.annotationComments(r);a.onReady((function(){a.registerListener("annotationOpened",O)})),L(a)}}),[F,O,e]);return(0,s.useEffect)((function(){K();var n=t&&t.current?t.current:null;return n&&n.addEventListener("click",D,!1),function(){null===n||void 0===n||n.removeEventListener("click",D)}}),[A,e,K,t,D]),(0,s.useEffect)((function(){var n=x.current;return function(){n&&!n.isDisposed()&&(n.dispose(),x.current=null)}}),[x]),e?(0,b.jsxs)(C,{ref:j,children:[y&&(0,b.jsx)(f.Z,{yPos:"0",handleSubmitComment:B,handleCancelComment:function(){g(!1),E.fire("cancelAddingAnnotation")}}),q&&(0,b.jsx)(s.Suspense,{fallback:null,children:(0,b.jsx)(v.Z,{activeAnnotation:Z||"",yPos:"0",hide:function(){return w(null)},storyId:R.id})}),(0,b.jsx)("div",{"data-vjs-player":!0,children:(0,b.jsx)("div",{ref:A})})]}):null}},25893:function(){}}]); 2//# sourceMappingURL=246.5a2a0d35.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.