@clickview/lite 0.55.1 → 0.55.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickview/lite",
3
- "version": "0.55.1",
3
+ "version": "0.55.2",
4
4
  "description": "ClickView Lite",
5
5
  "main": "dist/scripts/bundle.js",
6
6
  "types": "dist/projects/lite/src/index.d.ts",
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[1169],{1353:(e,t,n)=>{n.d(t,{$:()=>s});var a=n(32735),r=n(23481),i=n(11607),c=n(54610),l=n(67453),o=n(22161),u=r.T.encloseNamespace("shared.curriculumLinks");function s(e){var t=e.data;return a.createElement(i.L,{key:t.id,className:"p-1 pe-2 rounded-pill d-inline-flex align-items-center cursor-pointer ".concat(o.Z.tag," ").concat(e.selected?o.Z.selected:""),onClick:function(){return e.onChangeCurriculum(t.id.toString())},"aria-label":"".concat(u("ariaFilter")," ").concat(t.name)},a.createElement("div",{className:"bg-white ".concat(o.Z.cover," rounded-circle border")},a.createElement("img",{src:l.j.createUrl(t.cover.url,{size:c.h2.Small}),alt:t.name,className:"rounded-circle"})),a.createElement("div",{className:"ms-2"},t.name))}},38496:(e,t,n)=>{n.d(t,{p:()=>u});var a=n(32735),r=n(23481),i=n(23232),c=n(83345),l="shared.curriculumLinks",o=r.T.encloseNamespace(l);function u(e){return a.createElement(i.u,{className:"pt-3"},a.createElement(i.u.Image,{src:e.emptyStateUrl,altText:o("emptyInfo"),size:"small"}),a.createElement(i.u.Heading,null,a.createElement(c.x,{namespace:l,phrase:"emptyHeading"})),a.createElement(i.u.Info,null,a.createElement(c.x,{namespace:l,phrase:"emptyInfo"})))}},44599:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(32735);var r=function(){return a.createElement(a.Fragment,null,a.createElement("div",{className:"partial-loading-background rounded-pill py-1 px-2 d-inline-block me-1 mb-2 ".concat("vDcrq")}),a.createElement("div",null,a.createElement("div",{className:"partial-loading-background mb-1 ".concat("GXhoW")}),a.createElement("div",{className:"mb-2 d-flex"},a.createElement("div",{className:"me-1 align-self-start ".concat("goKaS")},a.createElement("div",{className:"partial-loading-background rounded-pill py-1 px-2 d-inline-block w-100 h-100"})),a.createElement("div",{className:"partial-loading-background ".concat("vFew6")}))))};function i(){return a.createElement("div",null,a.createElement("div",{className:"mb-3"},a.createElement(r,null)),a.createElement("div",{className:"mb-3"},a.createElement(r,null)),a.createElement("div",null,a.createElement(r,null)))}},34223:(e,t,n)=>{n.d(t,{Y:()=>y});var a=n(32735),r=n(38496),i=n(44599),c=n(83345),l=n(85597);const o={curriculumSubject:"i4D3h",curriculumSet:"WCdf9",areaLeafSet:"o8H8s",closeButton:"McsPs",leafDescriptionOnly:"xmEEo"};function u(e){return u="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},u(e)}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,"string");if("object"!=u(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}var m=/(.*)\s\((.*)?\)/i,v="shared.curriculumLinks",p="text-nowrap font-size-normal rounded-pill py-1 px-2 my-0 d-inline-block fw-semibold";function f(e){function t(){var t=p+" bg-white border";return!e.leaf.name&&e.uiContainsCodes?t+" border-secondary text-secondary":t+" border-dark"}var n=a.useRef();return a.useEffect((function(){if(n.current){var t=n.current.getBoundingClientRect().width;e.trySetMaxCodeWidth(t)}}),[n.current]),a.createElement("div",{className:"d-flex"},e.leaf.description?!e.leaf.name&&e.uiContainsCodes?a.createElement(a.Fragment,null,a.createElement("div",{className:"me-1 align-self-start",style:{minWidth:e.codeWidth?"".concat(e.codeWidth,"px"):"auto"}},a.createElement("h5",{ref:n,className:t()},a.createElement(c.x,{namespace:v,phrase:"noCode"}))),a.createElement("p",{className:"m-0 align-self-center",dangerouslySetInnerHTML:{__html:e.leaf.description}})):e.leaf.name||e.uiContainsCodes?a.createElement(a.Fragment,null,a.createElement("div",{className:"me-1 align-self-start",style:{minWidth:e.codeWidth?"".concat(e.codeWidth,"px"):"auto"}},a.createElement("h5",{ref:n,className:t()},e.leaf.name)),a.createElement("p",{className:"m-0 align-self-center",dangerouslySetInnerHTML:{__html:e.leaf.description}})):a.createElement("p",{className:"m-0",dangerouslySetInnerHTML:{__html:e.leaf.description}}):a.createElement("p",{className:"m-0",dangerouslySetInnerHTML:{__html:e.leaf.name}}))}function g(e){var t,n,r,i={},c=!1;function u(e){var t="mb-2";return e.name||c?t:t+" ms-4 "+o.leafDescriptionOnly}return e.linkSet.areasAndLeaves.forEach((function(e){var t=e[l.k.Area].map((function(e){return e.name})).join(" - ");i[t]?e[l.k.Leaf].forEach((function(e){i[t].find((function(t){return t.name===e.name}))||(i[t].push(e),e.name&&(c=!0))})):i[t]=e[l.k.Leaf]})),a.createElement(a.Fragment,null,a.createElement("h3",{className:"".concat(p," text-white bg-dark-blue fw-normal me-1 mb-2")},(t=e.linkSet[l.k.Audience].name,n=e.linkSet[l.k.Subject].name,(r=t.match(m))?"".concat(r[1]," • ").concat(r[2]," • ").concat(n):"".concat(t," • ").concat(n))),a.createElement("div",{className:"me-2 ".concat(o.curriculumSubject)},Object.keys(i).map((function(t,n){return a.createElement("div",{key:n,className:o.areaLeafSet},t&&a.createElement("h4",{className:"mb-1 font-size-normal"},t),a.createElement("ul",{className:"list-unstyled"},i[t].map((function(t){return a.createElement("li",{key:t.id,className:u(t)},a.createElement(f,{leaf:t,codeWidth:e.codeWidth,trySetMaxCodeWidth:e.trySetMaxCodeWidth,uiContainsCodes:c}))}))))}))))}function y(e){var t,n,c,u=(n=a.useState(0),c=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,c,l=[],o=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;o=!1}else for(;!(o=(a=i.call(n)).done)&&(l.push(a.value),l.length!==t);o=!0);}catch(e){u=!0,r=e}finally{try{if(!o&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(u)throw r}}return l}}(n,c)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(n,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=u[0],v=u[1];function p(e){v((function(t){return t>=e?t:e}))}var f=a.useMemo((function(){var t={};return e.curriculumLinks.forEach((function(e){var n=null,a=null,r=[],i=[];e.forEach((function(e){switch(e.type){case l.k.Subject:n=e;break;case l.k.Audience:a=e;break;case l.k.Area:r.push(e);break;case l.k.Leaf:i.push(e)}}));var c="".concat(n.id,":").concat(a.id);t[c]?t[c].areasAndLeaves.push(s(s({},l.k.Area,r),l.k.Leaf,i)):t[c]=s(s(s({},l.k.Subject,n),l.k.Audience,a),"areasAndLeaves",[s(s({},l.k.Area,r),l.k.Leaf,i)])})),t}),[e.curriculumLinks]);return e.curriculumLinks?(null===(t=e.curriculumLinks)||void 0===t?void 0:t.length)?a.createElement("ul",{className:"list-unstyled m-0"},Object.keys(f).map((function(e,t){return a.createElement("li",{key:"linkset-".concat(t),className:o.curriculumSet},a.createElement(g,{linkSet:f[e],trySetMaxCodeWidth:p,codeWidth:m}))}))):a.createElement(r.p,{emptyStateUrl:e.emptyStateUrl}):a.createElement(i.Z,null)}},22283:(e,t,n)=>{n.d(t,{P:()=>l});var a=n(32735),r=n(1353),i=n(63112),c=n(65163);function l(e){var t,n,l;return a.createElement(c.eb,{collection:(null===(t=e.selectedCurriculum)||void 0===t?void 0:t.id)?e.curriculums.nonEmptyCurriculums:null,childClassName:"flex-shrink-0",childComponent:function(t){var n,i;return a.createElement(r.$,Object.assign({},t,{selected:(null===(i=null===(n=e.selectedCurriculum)||void 0===n?void 0:n.id)||void 0===i?void 0:i.toString())===t.data.id.toString(),onChangeCurriculum:e.onChangeCurriculum}))},partialLoadingComponent:function(){return a.createElement(i.o,null)},widgetDataDeps:[null===(l=null===(n=e.selectedCurriculum)||void 0===n?void 0:n.id)||void 0===l?void 0:l.toString(),e.onChangeCurriculum],noNegativePadding:e.noNegativePadding})}},63112:(e,t,n)=>{n.d(t,{o:()=>i});var a=n(32735),r=n(91807),i=a.memo((function(e){var t=e.tagClass,n="partial-loading-background d-inline-block rounded-pill py-1 px-2 mb-1 me-1 text-nowrap ".concat(void 0===t?"":t," ").concat(r.Z.partialTag);return a.createElement("div",{className:"mt-1"},a.createElement("span",{className:n}," "))}))},65163:(e,t,n)=>{n.d(t,{QL:()=>a.Q,eb:()=>a.e});var a=n(16450);n(14244)},85597:(e,t,n)=>{var a;n.d(t,{k:()=>a}),function(e){e.Subject="CurriculumSubject",e.Audience="CurriculumAudience",e.Area="CurriculumArea",e.Leaf="CurriculumLeaf"}(a||(a={}))},61169:(e,t,n)=>{n.d(t,{R:()=>X});var a=n(32735),r=n(49935),i=n(5640),c=n(42648),l=n(23481),o=n(75896),u=n(49985),s=n(65858),d=n(44599),m=n(83345),v=n(69883),p=n(59598),f=n(34223),g=n(22283);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}var h="shared.curriculumLinks",b=l.T.encloseNamespace(h);function E(e){var t,n,r=e.curriculums,i=r.hasLoaded,l=r.activeCurriculum,E=r.availableCurriculums,S=r.curriculumLinks,k=r.updateCurriculum,C=r.customerHasCurriculumLinks,I=(t=a.useState(),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,c,l=[],o=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;o=!1}else for(;!(o=(a=i.call(n)).done)&&(l.push(a.value),l.length!==t);o=!0);}catch(e){u=!0,r=e}finally{try{if(!o&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(u)throw r}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),L=I[0],A=I[1],N=(0,v.Z)();return a.useEffect((function(){i&&(L||A(null!=l?l:o.m.first(E)))}),[null==l?void 0:l.id,i]),e.canViewCurriculumLinks&&C?a.createElement("section",{id:p.K.CurriculumLinks,ref:function(t){var n;t&&(null===(n=e.headingRef)||void 0===n?void 0:n.current)&&e.headingRef.current.set(p.K.CurriculumLinks,t)},className:"play-page-section"},a.createElement("h2",{className:"h4 me-2 h-100"},a.createElement(m.x,{namespace:h,phrase:"heading"})),a.createElement("div",{className:"mb-2"},a.createElement(g.P,{curriculums:e.curriculums,selectedCurriculum:L,onChangeCurriculum:function(t){var n,a,r=E.find((function(e){return e.id.toString()===t}));(null==r?void 0:r.id)&&(null===(n=null==L?void 0:L.id)||void 0===n?void 0:n.toString())!==(null===(a=null==r?void 0:r.id)||void 0===a?void 0:a.toString())&&(A(r),k(r,(function(){u.k.logUserAction({id:r.id,name:r.id,description:r.description,videoId:e.video.id,videoName:e.video.name},{entity:s.py.Presentation,actionType:s.Vw.Select,descriptor:s.kD.Curriculum,location:s.LZ.PlayPage})}),(function(){A(L),N.error(b("updateFailed"))})))}})),a.createElement("div",{className:"rounded border position-relative"},a.createElement(c.$B,{autoHeight:!0,autoHeightMax:e.height},a.createElement("div",{className:"p-3"},i?a.createElement(f.Y,{curriculumLinks:S,emptyStateUrl:e.emptyStateUrl}):a.createElement(d.Z,null))))):a.createElement(a.Fragment,null)}var S=n(8887),k=n(51184),C=n(64921),I=n(95812),L=n(53709),A=n(40178),N=n(71063),x=n(10439),w=n(35429),T=n(4594),R=n(16714),j=n(22902),O=n(65332),U=n(76196),P=n(31908),V=n(26492),F=n(9465),M=n(91479),G=n(99092),W=n(47938),_=n(81024),D=n(78166),H=n(99742),Z=n(14070),B=n(97291),K=n(22490),Y=n(63010),$=n(14476),z=n(53256);const Q={main:"xSI0l",expandedToc:"j5FCv"};var q="shared.play";function X(e){var t,n,c,l,o,u,s,d,v,f=(0,w.g)(),g=(0,j.T)().hasPermissions,y=P.M.getCanBeConsumed(e.video).canConsume,h=(0,Y.Q)(e.tableOfContentsId),b=h.tableOfContentsActiveId,X=h.setTableOfContentsActiveId,J=h.controlledId,ee=h.setControlledId,te=h.tableOfContentsExpanded,ne=h.onToggleTableOfContents,ae=(0,k.Wp)(e.video)&&e.featureAccess.canViewGlance,re=(0,$.i)(ae),ie=re.headingRef,ce=re.headingElements,le=ce.map((function(t){var n;return{id:t.id,name:z.d.getSectionHeading(t.id,{clips:e.clips,interactives:e.interactives,resources:null===(n=e.video.resources)||void 0===n?void 0:n.data})}})),oe=P.M.isVideoTypeArchived(e.video),ue=g(R.C.StudentExperience);(0,O.D)({setActiveId:X,headingElements:ce,controlledId:J,setControlledId:ee}),(0,U.P)(ce,J);var se=a.useRef(!1),de=(0,G.lU)();function me(){var e,t,n,a;se.current=!(null===(t=null===(e=null==f?void 0:f.playerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.isPaused()),null===(a=null===(n=null==f?void 0:f.playerRef)||void 0===n?void 0:n.current)||void 0===a||a.pause()}function ve(){var e,t;se.current&&(null===(t=null===(e=null==f?void 0:f.playerRef)||void 0===e?void 0:e.current)||void 0===t||t.play())}var pe="picture-in-picture"===f.mode||e.featureAccess.canViewPublicLayout;return a.createElement(m.D.Provider,{value:q},a.createElement("div",{className:"px-4 play-page-sections-container ".concat(e.shouldShowSideTableOfContents?"row":"")},a.createElement("main",{className:"".concat(Q.main," ").concat(e.shouldShowSideTableOfContents&&te?"".concat(Q.expandedToc," col-9"):e.shouldShowSideTableOfContents&&!te?"pe-4":void 0)},!!(null===(t=e.breadcrumbs)||void 0===t?void 0:t.length)&&a.createElement("div",{className:"mb-2"},a.createElement(r.Oo,{breadcrumbs:e.breadcrumbs})),a.createElement(W.W,{restrictions:e.video._restrictions,yearGroups:e.yearGroups,objectId:e.video.id,objectTypeId:T.E.Video,canManageVideoAccess:e.canManageVideoAccess}),oe&&a.createElement(V.T,{typeId:e.video.typeId,hasStudentExperience:ue}),a.createElement("section",{id:p.K.Video,className:"mb-2 ".concat(N.M.GLOBAL_PLAYER_SELECTOR),ref:function(e){e&&(null==ie?void 0:ie.current)&&ie.current.set(p.K.Video,e)}},y&&a.createElement(x.r,{key:e.video.id,objectId:e.video.id,objectTypeId:e.video.typeId,shareId:e.shareId,context:null===(n=e.params)||void 0===n?void 0:n.context,contextId:null===(c=e.params)||void 0===c?void 0:c.contextId,playNext:null===(l=e.params)||void 0===l?void 0:l.playNext,moviesAndTv:null===(o=e.params)||void 0===o?void 0:o.mtv,startTime:null!==(s=null===(u=e.params)||void 0===u?void 0:u.t)&&void 0!==s?s:null===(d=e.params)||void 0===d?void 0:d.startTime,endTime:null===(v=e.params)||void 0===v?void 0:v.endTime,mode:"default",location:"play-page"}),a.createElement("div",{className:pe?"":"d-none"},a.createElement(_.S,{video:e.video,appLink:{application:B.O.SIGN_UP,action:Z.e.SignUp.SIGN_UP},type:"picture-in-picture"===f.mode?"pip":"public"}))),a.createElement(M.v,{media:e.video,yearGroups:e.yearGroups,audiences:e.audiences,getSeriesAppLink:function(t){return de.getSeriesAppLink(t,e.params.mtv)},featureAccess:e.featureAccess,shareId:e.shareId}),ae?a.createElement(C.j,{video:e.video,pointsOfInterest:e.pointsOfInterest,setStartTime:function(e){var t;return null===(t=f.playerRef.current)||void 0===t?void 0:t.currentTime(e)},getTagAppLink:de.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout,canViewGlance:ae}):a.createElement(S.a,{video:e.video,currentUser:e.currentUser,headingRef:ie,onLaunchImmersiveReader:me,onExitImmersiveReader:ve,getTagAppLink:de.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout}),a.createElement(E,{headingRef:ie,video:e.video,height:A.x,curriculums:e.curriculums,emptyStateUrl:H.W.EmptyStates.CURRICULUM_LINKS,canViewCurriculumLinks:e.featureAccess.canViewCurriculumLinks}),a.createElement(L.M,{headingRef:ie,video:e.video,canViewResources:e.featureAccess.canViewResourceItems,imageCdnUrl:e.imageCdnUrl,getAppLink:de.getResourceAppLink(e.video.id,e.shareId,e.featureAccess.canViewResourceItems),analyticsData:{videoId:e.video.id,videoName:e.video.name},resourceThumbnailFallbackUrl:H.W.Fallbacks.RESOURCE_THUMBNAIL}),a.createElement(I.J,{headingRef:ie,video:e.video,interactives:e.interactives,imageCdnUrl:e.imageCdnUrl,analyticsData:{videoId:e.video.id,videoName:e.video.name},canViewInteractives:e.featureAccess.canViewInteractives,yearGroups:e.yearGroups,setFavourite:e.setFavourite,canFavourite:e.canFavourite,isPlugin:e.isPlugin}),a.createElement(i.O,{video:e.video,headingRef:ie,clips:e.clips,canViewClips:e.featureAccess.canViewClips,yearGroups:e.yearGroups,audiences:e.audiences,imageCdnUrl:e.imageCdnUrl,setFavourite:e.setFavourite,canFavourite:e.canFavourite,analyticsData:{videoId:e.video.id,videoName:e.video.name},isPlugin:e.isPlugin}),ae&&a.createElement(S.a,{video:e.video,currentUser:e.currentUser,headingRef:ie,onLaunchImmersiveReader:me,onExitImmersiveReader:ve,getTagAppLink:de.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout,showHeading:!0}),a.createElement(D.Z,{currentVideo:e.video,headingRef:ie,yearGroups:e.yearGroups,relatedVideos:e.relatedVideos,currentUser:e.currentUser,setFavourite:e.setFavourite,canFavourite:e.canFavourite,getVideoAppLink:function(t,n){return K.W.getAppLink(t,Object.assign(Object.assign({},n),{context:e.params.context,contextId:e.params.contextId,playNext:e.params.playNext,shareId:e.shareId,moviesAndTv:e.params.mtv}))},audiences:e.audiences,moviesAndTv:e.params.mtv,isPlugin:e.isPlugin})),a.createElement(F.h,{isExpanded:te,setIsExpanded:ne,items:le,activeId:b,setControlledId:ee,analyticsData:{videoId:e.video.id,videoName:e.video.name},showInSide:e.shouldShowSideTableOfContents})))}},22161:(e,t,n)=>{n.d(t,{Z:()=>a});const a={curriculumSubject:"GvGYH",curriculumSet:"d7RK0",areaLeafSet:"XRTAe",closeButton:"N3l5Q",heading:"hAxR4",leafDescriptionOnly:"h66ke",dropdown:"CsG6G",tag:"rdLqY",cover:"etwaD",active:"aDLMe",selected:"BMrSd"}}}]);
2
- //# sourceMappingURL=1169-ab6b70717a-lite.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scripts/1169-ab6b70717a-lite.chunk.js","mappings":"yMAYMA,EAAY,qBADA,0BASZ,SAAUC,EAAmBC,GACjC,IAAcC,EAAkBD,EAAxBE,KAER,OACE,gBAAC,IAAS,CACRC,IAAKF,EAAcG,GACnBC,UAAS,gFAA2E,QAAU,YAAIL,EAAMM,SAAW,aAAkB,IACrIC,QAAS,WAAF,OAAQP,EAAMQ,mBAAmBP,EAAcG,GAAGK,WAAW,yBACrDX,EAAU,cAAa,YAAIG,EAAcS,OAExD,uBAAKL,UAAS,mBAAc,UA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F,wBACxDC,GAAI,CACPhD,QAASrL,EAAMsL,OAAOD,QACtBE,UAAWvL,EAAMsL,OAAOC,UACxBC,SAAUxL,EAAMsL,OAAOE,SACvBJ,QAASpL,EAAMoL,QACfK,YAAazL,EAAMsL,OAAOI,MAC1B,EACFU,UAAWpM,EAAMoM,UACjBX,YAAazL,EAAMsL,OAAOI,IAC1BkC,SAAU5N,EAAM4N,YAIpB,gBAACW,EAAA,EAAwB,CACvBC,WAAYjG,GACZkG,cAAejG,GACfM,MAAOA,GACP4F,SAAUvG,EACVG,gBAAiBA,GACjBgF,cAAe,CAAEtG,QAAShH,EAAMiH,MAAM7G,GAAI8G,UAAWlH,EAAMiH,MAAMvG,MACjEiO,WAAY3O,EAAMqK,iCAM5B,C,mCCpUA,SAAgB,kBAAoB,QAAQ,cAAgB,QAAQ,YAAc,QAAQ,YAAc,QAAQ,QAAU,QAAQ,oBAAsB,QAAQ,SAAW,QAAQ,IAAM,QAAQ,MAAQ,QAAQ,OAAS,QAAQ,SAAW,Q","sources":["file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/curriculum-links/CurriculumLinkItem.tsx","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/curriculum-links/CurriculumLinksEmptyState.tsx","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/curriculum-links/partial-loading/PartialCurriculumLinks.tsx","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/curriculum-links/partial-loading/partial-curriculum-links.scss","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/play-page-v2/curriculum-links/curriculum-links.scss","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/play-page-v2/curriculum-links/CurriculumLinksV2.tsx","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/play-page-v2/curriculum-links/CurriculumsWidget.tsx","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/tags/PartialTagItem.tsx","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/enums/CurriculumType.ts","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/play-page-v2/curriculum-links/CurriculumLinksWithScrollbarV2.tsx","file:///Users/joshua.taylor/Projects/clickview/packages/projects/lite/src/shared/views/play/v2/components/play-page/play-page.scss","file:///Users/joshua.taylor/Projects/clickview/packages/projects/lite/src/shared/views/play/v2/components/play-page/PlayPageV2.tsx","file:///Users/joshua.taylor/Projects/clickview/packages/libs/shared/src/components/curriculum-links/curriculum-links.scss"],"sourcesContent":["import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { DivButton } from 'libs/shared/components/div-button/DivButton';\nimport { ImageSize } from 'libs/shared/enums/Images';\nimport { Presentation } from 'libs/shared/interfaces';\nimport { ImageHelper } from 'libs/shared/utils/ImageHelper';\n\nimport styles from './curriculum-links.scss';\n\nconst namespace = 'shared.curriculumLinks';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface CurriculumLinkItemProps {\n data: Presentation;\n onChangeCurriculum: (id: string) => any;\n selected: boolean;\n}\n\nexport function CurriculumLinkItem(props: CurriculumLinkItemProps): JSX.Element {\n const { data: curriculumTag } = props;\n\n return (\n <DivButton\n key={curriculumTag.id}\n className={`p-1 pe-2 rounded-pill d-inline-flex align-items-center cursor-pointer ${styles.tag} ${props.selected ? styles.selected : ''}`}\n onClick={() => props.onChangeCurriculum(curriculumTag.id.toString())}\n aria-label={`${getPhrase('ariaFilter')} ${curriculumTag.name}`}\n >\n <div className={`bg-white ${styles.cover} rounded-circle border`}>\n <img\n src={ImageHelper.createUrl(curriculumTag.cover.url, { size: ImageSize.Small })}\n alt={curriculumTag.name}\n className='rounded-circle'\n />\n </div>\n <div className='ms-2'>\n {curriculumTag.name}\n </div>\n </DivButton>\n );\n}","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\nimport { Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'shared.curriculumLinks';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface CurriculumLinksEmptyStateProps {\n emptyStateUrl: string;\n}\n\nexport function CurriculumLinksEmptyState(props: CurriculumLinksEmptyStateProps): JSX.Element {\n return (\n <EmptyState className='pt-3'>\n <EmptyState.Image src={props.emptyStateUrl} altText={getPhrase('emptyInfo')} size='small'/>\n <EmptyState.Heading>\n <Text namespace={namespace} phrase='emptyHeading' />\n </EmptyState.Heading>\n <EmptyState.Info>\n <Text namespace={namespace} phrase='emptyInfo' />\n </EmptyState.Info>\n </EmptyState>\n );\n}","import React from 'react';\n\nimport styles from './partial-curriculum-links.scss';\n\nconst PartialCurriculumLinkSection = () => (\n <>\n <div className={`partial-loading-background rounded-pill py-1 px-2 d-inline-block me-1 mb-2 ${styles.audience}`} />\n <div>\n <div className={`partial-loading-background mb-1 ${styles.area}`} />\n\n <div className='mb-2 d-flex'>\n <div className={`me-1 align-self-start ${styles.code}`}>\n <div className={`partial-loading-background rounded-pill py-1 px-2 d-inline-block w-100 h-100`} />\n </div>\n \n <div className={`partial-loading-background ${styles.description}`} />\n </div>\n </div>\n </>\n);\n\nexport function PartialCurriculumLinks(): JSX.Element {\n return (\n <div>\n <div className='mb-3'>\n <PartialCurriculumLinkSection />\n </div>\n\n <div className='mb-3'>\n <PartialCurriculumLinkSection />\n </div>\n\n <div>\n <PartialCurriculumLinkSection />\n </div>\n </div>\n );\n}","// extracted by mini-css-extract-plugin\nexport default {\"audience\":\"vDcrq\",\"area\":\"GXhoW\",\"code\":\"goKaS\",\"description\":\"vFew6\"};","// extracted by mini-css-extract-plugin\nexport default {\"curriculumSubject\":\"i4D3h\",\"curriculumSet\":\"WCdf9\",\"areaLeafSet\":\"o8H8s\",\"closeButton\":\"McsPs\",\"leafDescriptionOnly\":\"xmEEo\"};","import React from 'react';\n\nimport { CurriculumLinksEmptyState } from 'libs/shared/components/curriculum-links/CurriculumLinksEmptyState';\nimport { PartialCurriculumLinks } from 'libs/shared/components/curriculum-links/partial-loading/PartialCurriculumLinks';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { CurriculumType } from 'libs/shared/enums/CurriculumType';\nimport { Curriculum } from 'libs/shared/interfaces';\n\nimport styles from './curriculum-links.scss';\n\nconst BRACKET_SEGMENT_REGEX = /(.*)\\s\\((.*)?\\)/i;\n\nconst namespace = 'shared.curriculumLinks';\n\nconst BASE_PILL_CLASS = 'text-nowrap font-size-normal rounded-pill py-1 px-2 my-0 d-inline-block fw-semibold';\n\ninterface CurriculumStructure {\n [CurriculumType.Subject]: Curriculum<CurriculumType.Subject>;\n [CurriculumType.Audience]: Curriculum<CurriculumType.Audience>;\n areasAndLeaves: Array<{\n [CurriculumType.Area]: Curriculum<CurriculumType.Area>[];\n [CurriculumType.Leaf]: Curriculum<CurriculumType.Leaf>[];\n }>;\n}\n\ninterface CurriculumLeafProps {\n leaf: Curriculum<CurriculumType.Leaf>;\n codeWidth: number;\n trySetMaxCodeWidth: React.Dispatch<React.SetStateAction<number>>;\n uiContainsCodes: boolean;\n}\n\nfunction CurriculumLeaf(props: CurriculumLeafProps): JSX.Element {\n function getCurriculumCodeClass(): string {\n const baseClass = BASE_PILL_CLASS + ' bg-white border';\n\n // If a leaf has no code but the rest of the UI has leaf nodes w/ codes, we show a special \"No code\" pill\n if (!props.leaf.name && props.uiContainsCodes)\n return baseClass + ' border-secondary text-secondary';\n\n return baseClass + ' border-dark';\n }\n\n const codeRef = React.useRef<HTMLDivElement>();\n\n React.useEffect(() => {\n if (!codeRef.current)\n return;\n\n const { width } = codeRef.current.getBoundingClientRect();\n\n props.trySetMaxCodeWidth(width);\n }, [codeRef.current]);\n\n return (\n <div className='d-flex'>\n {(() => {\n if (!props.leaf.description)\n return <p className='m-0' dangerouslySetInnerHTML={{ __html: props.leaf.name }} />;\n\n /**\n * If a leaf has no code but the rest of the UI has leaf nodes\n * with codes, we show a special \"No code\" pill. Example: https://imgur.com/3L1Ela3\n */\n if (!props.leaf.name && props.uiContainsCodes) {\n return (\n <>\n <div\n className='me-1 align-self-start'\n style={{ minWidth: props.codeWidth ? `${props.codeWidth}px` : 'auto' }}\n >\n <h5 ref={codeRef} className={getCurriculumCodeClass()}>\n <Text namespace={namespace} phrase='noCode' />\n </h5>\n </div>\n <p className='m-0 align-self-center' dangerouslySetInnerHTML={{ __html: props.leaf.description }} />\n </>\n );\n }\n\n /**\n * If a leaf has no code and the rest of the UI leaf nodes have no code, we just\n * display the description with a bullet point. Example: https://imgur.com/jzJvmWs\n */\n if (!props.leaf.name && !props.uiContainsCodes)\n return <p className='m-0' dangerouslySetInnerHTML={{ __html: props.leaf.description }} />;\n\n return (\n <>\n <div\n className='me-1 align-self-start'\n style={{ minWidth: props.codeWidth ? `${props.codeWidth}px` : 'auto' }}\n >\n <h5 ref={codeRef} className={getCurriculumCodeClass()}>{props.leaf.name}</h5>\n </div>\n <p className='m-0 align-self-center' dangerouslySetInnerHTML={{ __html: props.leaf.description }} />\n </>\n );\n })()}\n </div>\n );\n}\n\ninterface CurriculumSubjectProps {\n linkSet: CurriculumStructure;\n codeWidth: number;\n trySetMaxCodeWidth: React.Dispatch<React.SetStateAction<number>>;\n}\n\nfunction CurriculumSubject(props: CurriculumSubjectProps): JSX.Element {\n const areaAndLeafSets: { [areaText: string]: Curriculum<CurriculumType.Leaf>[]; } = {};\n\n let uiContainsCodes = false;\n\n props.linkSet.areasAndLeaves.forEach(areaAndLeafSet => {\n const areaText = areaAndLeafSet[CurriculumType.Area].map(ca => ca.name).join(' - ');\n\n if (areaAndLeafSets[areaText]) {\n areaAndLeafSet[CurriculumType.Leaf].forEach(leaf => {\n if (!areaAndLeafSets[areaText].find(l => l.name === leaf.name)) {\n areaAndLeafSets[areaText].push(leaf);\n\n // We need the info on if _any_ leaf node has a code in it. See why in the comments in `<CurriculumLeaf />`\n if (leaf.name)\n uiContainsCodes = true;\n }\n });\n\n return;\n }\n\n areaAndLeafSets[areaText] = areaAndLeafSet[CurriculumType.Leaf];\n });\n\n function getAudienceText(): string {\n const audienceSegment = props.linkSet[CurriculumType.Audience].name;\n const subjectSegment = props.linkSet[CurriculumType.Subject].name;\n\n /**\n * In some curriculums, such as the UK curriculum, the audience string may contain a year group\n * in brackets. For example, it may be \"Lower Key Stage 2 (Year 4)\".\n * This regex will pull that segment out if it exists.\n */\n const audienceBracketSegments = audienceSegment.match(BRACKET_SEGMENT_REGEX);\n\n if (audienceBracketSegments)\n return `${audienceBracketSegments[1]} • ${audienceBracketSegments[2]} • ${subjectSegment}`;\n\n return `${audienceSegment} • ${subjectSegment}`;\n }\n\n function getLeafStyleClass(leaf: Curriculum<CurriculumType.Leaf>): string {\n const className = 'mb-2';\n\n if (!leaf.name && !uiContainsCodes)\n return className + ' ms-4 ' + styles.leafDescriptionOnly;\n\n return className;\n }\n\n return (\n <>\n <h3 className={`${BASE_PILL_CLASS} text-white bg-dark-blue fw-normal me-1 mb-2`}>\n {getAudienceText()}\n </h3>\n\n <div className={`me-2 ${styles.curriculumSubject}`}>\n {Object.keys(areaAndLeafSets).map((areaText, i) => {\n return (\n <div key={i} className={styles.areaLeafSet} >\n {areaText && <h4 className='mb-1 font-size-normal'>{areaText}</h4>}\n <ul className='list-unstyled'>\n {areaAndLeafSets[areaText].map(leaf => (\n <li key={leaf.id} className={getLeafStyleClass(leaf)}>\n <CurriculumLeaf\n leaf={leaf}\n codeWidth={props.codeWidth}\n trySetMaxCodeWidth={props.trySetMaxCodeWidth}\n uiContainsCodes={uiContainsCodes}\n />\n </li>\n ))}\n </ul>\n </div>\n );\n })}\n </div>\n </>\n );\n}\n\ninterface CurriculumLinksSet {\n [subjectAndAudienceIdKey: string]: CurriculumStructure\n}\n\ninterface CurriculumLinksV2Props {\n curriculumLinks?: Curriculum[][];\n emptyStateUrl: string;\n}\n\nexport function CurriculumLinksV2(props: CurriculumLinksV2Props): JSX.Element {\n const [ codeWidth, setCodeWidth ] = React.useState(0);\n\n function trySetMaxCodeWidth(width: number): void {\n /**\n * The width of the curriculum code column should be identical for each leaf node, meaning\n * the leaf description text will be perfectly vertically aligned all the way down.\n * See here for example: https://imgur.com/MbganZf\n * \n * This is achieved by us setting the state for the maximum code width, and forcing all\n * smaller codes to abide by that max width.\n * \n * This value is used in the `<CurriculumLeaf />` component.\n */\n setCodeWidth(currentVal => {\n if (currentVal >= width)\n return currentVal;\n\n return width;\n });\n }\n\n /**\n * Here, we're taking the structure of links from the backend, and restructuring it in a way\n * that resembles the structure of our UI more closely. The general idea is:\n * \n * CurriculumAudience - CurriculumSubject\n * CurriculumAreas\n * CurriculumLeaves\n */\n const curriculumLinkSets = React.useMemo(() => {\n const newSet: CurriculumLinksSet = {};\n\n props.curriculumLinks.forEach(linkSet => {\n let subject: Curriculum<CurriculumType.Subject> = null;\n let audience: Curriculum<CurriculumType.Audience> = null;\n const areas: Curriculum<CurriculumType.Area>[] = [];\n const leaves: Curriculum<CurriculumType.Leaf>[] = [];\n \n linkSet.forEach(curriculumObj => {\n switch (curriculumObj.type) {\n case CurriculumType.Subject:\n subject = curriculumObj as Curriculum<CurriculumType.Subject>;\n break;\n case CurriculumType.Audience:\n audience = curriculumObj as Curriculum<CurriculumType.Audience>;\n break;\n case CurriculumType.Area:\n areas.push(curriculumObj as Curriculum<CurriculumType.Area>);\n break;\n case CurriculumType.Leaf:\n leaves.push(curriculumObj as Curriculum<CurriculumType.Leaf>);\n break;\n default:\n break;\n }\n });\n \n const key = `${subject.id}:${audience.id}`;\n\n if (newSet[key]) {\n newSet[key].areasAndLeaves.push({\n [CurriculumType.Area]: areas,\n [CurriculumType.Leaf]: leaves\n });\n \n return;\n }\n \n newSet[key] = {\n [CurriculumType.Subject]: subject,\n [CurriculumType.Audience]: audience,\n areasAndLeaves: [{\n [CurriculumType.Area]: areas,\n [CurriculumType.Leaf]: leaves\n }]\n };\n });\n\n return newSet;\n }, [props.curriculumLinks]);\n\n if (!props.curriculumLinks)\n return <PartialCurriculumLinks />;\n\n if (!props.curriculumLinks?.length) {\n return <CurriculumLinksEmptyState emptyStateUrl={props.emptyStateUrl} />;\n }\n\n return (\n <ul className='list-unstyled m-0'>\n {Object.keys(curriculumLinkSets).map((linkSetKey, i) => (\n <li key={`linkset-${i}`} className={styles.curriculumSet}>\n <CurriculumSubject\n linkSet={curriculumLinkSets[linkSetKey]}\n trySetMaxCodeWidth={trySetMaxCodeWidth}\n codeWidth={codeWidth}\n />\n </li>\n ))}\n </ul>\n );\n}","import React from 'react';\n\nimport { CurriculumLinkItem } from 'libs/shared/components/curriculum-links/CurriculumLinkItem';\nimport { PartialTagItem } from 'libs/shared/components/tags/PartialTagItem';\nimport { DynamicWidget } from 'libs/shared/components/widgets/dynamic-widget';\nimport { CurriculumData, Presentation } from 'libs/shared/interfaces';\n\ninterface CurriculumsWidgetProps {\n curriculums: CurriculumData;\n selectedCurriculum: Presentation;\n onChangeCurriculum: (curriculumId: string) => void;\n noNegativePadding?: boolean;\n}\n\nexport function CurriculumsWidget(props: CurriculumsWidgetProps): JSX.Element {\n return (\n <DynamicWidget\n collection={props.selectedCurriculum?.id ? props.curriculums.nonEmptyCurriculums : null}\n childClassName='flex-shrink-0'\n childComponent={_props => {\n return (\n <CurriculumLinkItem\n {..._props}\n selected={props.selectedCurriculum?.id?.toString() === _props.data.id.toString()}\n onChangeCurriculum={props.onChangeCurriculum}\n />\n );\n }}\n partialLoadingComponent={() => <PartialTagItem />}\n widgetDataDeps={[ props.selectedCurriculum?.id?.toString(), props.onChangeCurriculum ]}\n noNegativePadding={props.noNegativePadding}\n />\n );\n}","import React from 'react';\n\nimport styles from './tags.scss';\n\ninterface PartialTagItemProps {\n tagClass?: string;\n}\n\nexport const PartialTagItem = React.memo(function({ tagClass = '' }: PartialTagItemProps): JSX.Element {\n const classNames = `partial-loading-background d-inline-block rounded-pill py-1 px-2 mb-1 me-1 text-nowrap ${tagClass} ${styles.partialTag}`;\n\n return (\n <div className='mt-1'>\n <span className={classNames}>&nbsp;</span>\n </div>\n );\n});","export enum CurriculumType {\n Subject = 'CurriculumSubject',\n Audience = 'CurriculumAudience',\n Area = 'CurriculumArea',\n Leaf = 'CurriculumLeaf'\n}","import React from 'react';\nimport { Scrollbars } from 'react-custom-scrollbars-2';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { EntityType, LocationContext, PresentationDescriptor, UserAction } from 'libs/analytics/interfaces';\n\nimport { PartialCurriculumLinks } from 'libs/shared/components/curriculum-links/partial-loading/PartialCurriculumLinks';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { CurriculumData, Presentation, Video } from 'libs/shared/interfaces';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\n\nimport { CurriculumLinksV2 } from './CurriculumLinksV2';\nimport { CurriculumsWidget } from './CurriculumsWidget';\n\nconst namespace = 'shared.curriculumLinks';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface CurriculumLinksWithScrollbarV2Props {\n video: Video;\n curriculums: CurriculumData;\n emptyStateUrl: string;\n height?: number;\n canViewCurriculumLinks: boolean;\n headingRef?: React.MutableRefObject<Map<PlayPageAnchor, HTMLElement>>;\n}\n\nexport function CurriculumLinksWithScrollbarV2(props: CurriculumLinksWithScrollbarV2Props): JSX.Element {\n const {\n hasLoaded,\n activeCurriculum,\n availableCurriculums,\n curriculumLinks,\n updateCurriculum,\n customerHasCurriculumLinks\n } = props.curriculums;\n\n const [ selectedCurriculum, setSelectedCurriculum ] = React.useState<Presentation>();\n\n const alerts = useAlerts();\n\n React.useEffect(() => {\n if (!hasLoaded)\n return;\n\n if (!selectedCurriculum)\n setSelectedCurriculum(activeCurriculum ?? ArrayHelper.first(availableCurriculums));\n }, [ activeCurriculum?.id, hasLoaded ]);\n\n function onChangeCurriculum(curriculumId: string): void {\n const newCurriculum = availableCurriculums.find(c => c.id.toString() === curriculumId);\n\n if (!newCurriculum?.id)\n return;\n\n if (selectedCurriculum?.id?.toString() === newCurriculum?.id?.toString())\n return;\n\n setSelectedCurriculum(newCurriculum);\n\n const onError = () => {\n // If the request to change curriculum fails, we reset the select state and alert the user\n setSelectedCurriculum(selectedCurriculum);\n alerts.error(getPhrase('updateFailed'));\n };\n\n const onSuccess = () => {\n AnalyticsHelper.logUserAction({\n id: newCurriculum.id,\n name: newCurriculum.id,\n description: newCurriculum.description,\n videoId: props.video.id,\n videoName: props.video.name\n }, {\n entity: EntityType.Presentation,\n actionType: UserAction.Select,\n descriptor: PresentationDescriptor.Curriculum,\n location: LocationContext.PlayPage\n });\n };\n\n updateCurriculum(newCurriculum, onSuccess, onError);\n }\n\n if (!props.canViewCurriculumLinks || !customerHasCurriculumLinks)\n return <></>;\n \n return (\n <section\n id={PlayPageAnchor.CurriculumLinks}\n ref={el => {\n (el && props.headingRef?.current) && props.headingRef.current.set(PlayPageAnchor.CurriculumLinks, el);\n }}\n className='play-page-section'\n >\n <h2 className='h4 me-2 h-100'>\n <Text namespace={namespace} phrase='heading' />\n </h2>\n <div className='mb-2'>\n <CurriculumsWidget\n curriculums={props.curriculums}\n selectedCurriculum={selectedCurriculum}\n onChangeCurriculum={onChangeCurriculum}\n />\n </div>\n\n <div className='rounded border position-relative'>\n <Scrollbars autoHeight autoHeightMax={props.height}>\n <div className='p-3'>\n {!hasLoaded\n ? <PartialCurriculumLinks />\n : (\n <CurriculumLinksV2\n curriculumLinks={curriculumLinks}\n emptyStateUrl={props.emptyStateUrl}\n />\n )}\n </div>\n </Scrollbars>\n </div>\n </section>\n );\n}","// extracted by mini-css-extract-plugin\nexport default {\"main\":\"xSI0l\",\"expandedToc\":\"j5FCv\"};","import React from 'react';\n\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { PlayPageClips } from 'libs/shared/components/play-page-v2/clips-widget/PlayPageClips';\nimport { CurriculumLinksWithScrollbarV2 } from 'libs/shared/components/play-page-v2/curriculum-links/CurriculumLinksWithScrollbarV2';\nimport { VideoDetailsWithScrollbarV2 } from 'libs/shared/components/play-page-v2/details/VideoDetailsV2';\nimport { hasGlanceData } from 'libs/shared/components/play-page-v2/glance/VideoAtAGlanceUtilsV2';\nimport { VideoAtAGlanceV2 } from 'libs/shared/components/play-page-v2/glance/VideoAtAGlanceV2';\nimport { PlayPageInteractives } from 'libs/shared/components/play-page-v2/interactives-widget/PlayPageInteractives';\nimport { PlayPageResources } from 'libs/shared/components/play-page-v2/resources-widget/PlayPageResources';\nimport { LanguageNamespaceContext } from 'libs/shared/components/text/Text';\nimport { MINIMUM_GLANCE_HEIGHT } from 'libs/shared/constants/MinimumGlanceHeight';\nimport { SeoConstants } from 'libs/shared/constants/SeoConstants';\nimport { GlobalPlayerConsumer } from 'libs/shared/context/player-context/components/GlobalPlayerConsumer';\nimport { usePlayerContext } from 'libs/shared/context/player-context/PlayerContext';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useTableOfContentsActiveHeading } from 'libs/shared/hooks/useTableOfContentsActiveHeading';\nimport { useTableOfContentsScroll } from 'libs/shared/hooks/useTableOfContentsScroll';\nimport { CanFavouriteFunc, Clip, CurrentUser, CurriculumData, FavouriteFunc, InteractiveMetadata, PointOfInterest, PresentationAudience, Video, YearGroup } from 'libs/shared/interfaces';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { ArchivedBanner } from 'shared/components/play-page/ArchivedBanner';\nimport { TableOfContentsContainer } from 'shared/components/play-page/components/table-of-contents/TableOfContents';\nimport { PlayPageTitleAndActions } from 'shared/components/play-page/components/title-and-actions/PlayPageTitleAndActions';\nimport { getAppLinks } from 'shared/components/play-page/PlayPageUtils';\nimport { RestrictionBanner } from 'shared/components/play-page/RestrictionBanner';\nimport { PlayerPlaceholder } from 'shared/components/player-placeholder/PlayerPlaceholder';\nimport { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { ImageUrls } from 'shared/constants/ImageUrls';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoFeaturesHash } from 'shared/hooks/useVideoFeatureAccess';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\nimport { usePlayPageTableOfContent } from 'shared/views/play/v2/hooks/usePlayPageTableOfContent';\nimport { useSectionHeadings } from 'shared/views/play/v2/hooks/useSectionHeadings';\nimport { PlayPageUtils } from 'shared/views/play/v2/PlayPageUtilV2';\n\nimport styles from './play-page.scss';\n\nconst namespace = 'shared.play';\n\ninterface PlayPageV2Props {\n video: Video;\n clips: Clip[];\n interactives: InteractiveMetadata[];\n yearGroups: YearGroup[];\n imageCdnUrl: string;\n relatedVideos: RelatedVideosHash;\n audiences: PresentationAudience[];\n setFavourite?: FavouriteFunc;\n canFavourite?: CanFavouriteFunc;\n currentUser: CurrentUser;\n pointsOfInterest?: PointOfInterest[];\n playNext: boolean;\n shareId?: string;\n curriculums: CurriculumData;\n featureAccess: VideoFeaturesHash;\n params?: PlayViewQueryParams;\n canManageVideoAccess: boolean;\n tableOfContentsId: string;\n shouldShowSideTableOfContents: boolean;\n isPlugin: boolean;\n breadcrumbs?: Breadcrumb[];\n}\n\nexport function PlayPageV2(props: PlayPageV2Props): JSX.Element {\n const playerContext = usePlayerContext();\n\n const { hasPermissions } = usePermissions();\n const { canConsume } = VideoHelper.getCanBeConsumed(props.video);\n\n const {\n tableOfContentsActiveId,\n setTableOfContentsActiveId,\n controlledId,\n setControlledId,\n tableOfContentsExpanded,\n onToggleTableOfContents\n } = usePlayPageTableOfContent(props.tableOfContentsId);\n\n const hasGlance = hasGlanceData(props.video) && props.featureAccess.canViewGlance;\n\n const { headingRef, headingElements } = useSectionHeadings(hasGlance);\n const items = headingElements.map(ele => {\n return {\n id: ele.id as PlayPageAnchor,\n name: PlayPageUtils.getSectionHeading(\n ele.id as PlayPageAnchor,\n {\n clips: props.clips,\n interactives: props.interactives,\n resources: props.video.resources?.data\n }\n )\n };\n });\n\n const isArchived = VideoHelper.isVideoTypeArchived(props.video);\n const hasStudentExperience = hasPermissions(PermissionName.StudentExperience);\n\n useTableOfContentsActiveHeading({\n setActiveId: setTableOfContentsActiveId,\n headingElements,\n controlledId,\n setControlledId\n });\n\n useTableOfContentsScroll(headingElements, controlledId);\n\n /**\n * Need to use a ref because if we use state, onExitImmersiveReader will have a stale\n * reference of the state. This is because the state is changed in onLaunchImmersiveReader\n * which is passed in at the same time as onExitImmersiveReader\n */\n const shouldPlayOnExitImmersiveReader = React.useRef(false);\n\n const appLinkFns = getAppLinks();\n\n function onLaunchImmersiveReader(): void {\n shouldPlayOnExitImmersiveReader.current = !playerContext?.playerRef?.current?.isPaused();\n playerContext?.playerRef?.current?.pause();\n }\n\n function onExitImmersiveReader(): void {\n if (!shouldPlayOnExitImmersiveReader.current)\n return;\n\n playerContext?.playerRef?.current?.play();\n }\n\n function getMainClassName() {\n if (props.shouldShowSideTableOfContents && tableOfContentsExpanded) {\n return `${styles.expandedToc} col-9`;\n }\n if (props.shouldShowSideTableOfContents && !tableOfContentsExpanded)\n return 'pe-4';\n }\n\n const showPlayerPlaceholder = playerContext.mode === 'picture-in-picture' || props.featureAccess.canViewPublicLayout;\n\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <div className={`px-4 play-page-sections-container ${props.shouldShowSideTableOfContents ? 'row' : ''}`}>\n <main className={`${styles.main} ${getMainClassName()}`}>\n {!!props.breadcrumbs?.length &&\n <div className='mb-2'>\n <Breadcrumbs breadcrumbs={props.breadcrumbs} />\n </div>\n }\n\n <RestrictionBanner\n restrictions={props.video._restrictions}\n yearGroups={props.yearGroups}\n objectId={props.video.id}\n objectTypeId={MasterType.Video}\n canManageVideoAccess={props.canManageVideoAccess}\n />\n \n {isArchived && <ArchivedBanner typeId={props.video.typeId} hasStudentExperience={hasStudentExperience}/>}\n \n <section\n id={PlayPageAnchor.Video}\n className={`mb-2 ${SeoConstants.GLOBAL_PLAYER_SELECTOR}`}\n ref={el => { (el && headingRef?.current) && headingRef.current.set(PlayPageAnchor.Video, el); }}\n >\n {canConsume && (\n <GlobalPlayerConsumer\n key={props.video.id}\n objectId={props.video.id}\n objectTypeId={props.video.typeId}\n shareId={props.shareId}\n context={props.params?.context}\n contextId={props.params?.contextId}\n playNext={props.params?.playNext}\n moviesAndTv={props.params?.mtv}\n startTime={props.params?.t ?? props.params?.startTime}\n endTime={props.params?.endTime}\n mode='default'\n location='play-page'\n />\n )}\n <div className={showPlayerPlaceholder ? '' : 'd-none'}>\n <PlayerPlaceholder\n video={props.video}\n appLink={{\n application: AppChannels.SIGN_UP,\n action: Actions.SignUp.SIGN_UP\n }}\n type={playerContext.mode === 'picture-in-picture' ? 'pip' : 'public'}\n />\n </div>\n </section>\n\n <PlayPageTitleAndActions\n media={props.video}\n yearGroups={props.yearGroups}\n audiences={props.audiences}\n getSeriesAppLink={series => appLinkFns.getSeriesAppLink(series, props.params.mtv)}\n featureAccess={props.featureAccess}\n shareId={props.shareId}\n />\n {/* if no glance render video details here */}\n {hasGlance ? (\n <VideoAtAGlanceV2\n video={props.video}\n pointsOfInterest={props.pointsOfInterest}\n setStartTime={(time: number) => playerContext.playerRef.current?.currentTime(time)}\n getTagAppLink={appLinkFns.getTagAppLink}\n suppressInteractivity={props.featureAccess.canViewPublicLayout}\n canViewGlance={hasGlance}\n />\n ) : (\n <VideoDetailsWithScrollbarV2\n video={props.video}\n currentUser={props.currentUser}\n headingRef={headingRef}\n onLaunchImmersiveReader={onLaunchImmersiveReader}\n onExitImmersiveReader={onExitImmersiveReader}\n getTagAppLink={appLinkFns.getTagAppLink}\n suppressInteractivity={props.featureAccess.canViewPublicLayout}\n />\n )}\n\n <CurriculumLinksWithScrollbarV2\n headingRef={headingRef}\n video={props.video}\n height={MINIMUM_GLANCE_HEIGHT}\n curriculums={props.curriculums}\n emptyStateUrl={ImageUrls.EmptyStates.CURRICULUM_LINKS}\n canViewCurriculumLinks={props.featureAccess.canViewCurriculumLinks}\n />\n \n <PlayPageResources\n headingRef={headingRef}\n video={props.video}\n canViewResources={props.featureAccess.canViewResourceItems}\n imageCdnUrl={props.imageCdnUrl}\n getAppLink={\n appLinkFns.getResourceAppLink(props.video.id, props.shareId, props.featureAccess.canViewResourceItems)\n }\n analyticsData={{ videoId: props.video.id, videoName: props.video.name }}\n resourceThumbnailFallbackUrl={ImageUrls.Fallbacks.RESOURCE_THUMBNAIL}\n />\n\n <PlayPageInteractives\n headingRef={headingRef}\n video={props.video}\n interactives={props.interactives}\n imageCdnUrl={props.imageCdnUrl}\n analyticsData={{ videoId: props.video.id, videoName: props.video.name }}\n canViewInteractives={props.featureAccess.canViewInteractives}\n yearGroups={props.yearGroups}\n setFavourite={props.setFavourite}\n canFavourite={props.canFavourite}\n isPlugin={props.isPlugin}\n />\n\n <PlayPageClips\n video={props.video}\n headingRef={headingRef}\n clips={props.clips}\n canViewClips={props.featureAccess.canViewClips}\n yearGroups={props.yearGroups}\n audiences={props.audiences}\n imageCdnUrl={props.imageCdnUrl}\n setFavourite={props.setFavourite}\n canFavourite={props.canFavourite}\n analyticsData={{ videoId: props.video.id, videoName: props.video.name }}\n isPlugin={props.isPlugin}\n />\n\n {/* if has glance, render video details here */}\n {hasGlance && (\n <VideoDetailsWithScrollbarV2\n video={props.video}\n currentUser={props.currentUser}\n headingRef={headingRef}\n onLaunchImmersiveReader={onLaunchImmersiveReader}\n onExitImmersiveReader={onExitImmersiveReader}\n getTagAppLink={appLinkFns.getTagAppLink}\n suppressInteractivity={props.featureAccess.canViewPublicLayout}\n showHeading\n />\n )}\n\n <RelatedVideos\n currentVideo={props.video}\n headingRef={headingRef}\n yearGroups={props.yearGroups}\n relatedVideos={props.relatedVideos}\n currentUser={props.currentUser}\n setFavourite={props.setFavourite}\n canFavourite={props.canFavourite}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.params.context,\n contextId: props.params.contextId,\n playNext: props.params.playNext,\n shareId: props.shareId,\n moviesAndTv: props.params.mtv\n })}\n audiences={props.audiences}\n moviesAndTv={props.params.mtv}\n isPlugin={props.isPlugin}\n />\n </main>\n\n <TableOfContentsContainer\n isExpanded={tableOfContentsExpanded}\n setIsExpanded={onToggleTableOfContents}\n items={items}\n activeId={tableOfContentsActiveId}\n setControlledId={setControlledId}\n analyticsData={{ videoId: props.video.id, videoName: props.video.name }}\n showInSide={props.shouldShowSideTableOfContents}\n />\n\n </div>\n </LanguageNamespaceContext.Provider>\n );\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"curriculumSubject\":\"GvGYH\",\"curriculumSet\":\"d7RK0\",\"areaLeafSet\":\"XRTAe\",\"closeButton\":\"N3l5Q\",\"heading\":\"hAxR4\",\"leafDescriptionOnly\":\"h66ke\",\"dropdown\":\"CsG6G\",\"tag\":\"rdLqY\",\"cover\":\"etwaD\",\"active\":\"aDLMe\",\"selected\":\"BMrSd\"};"],"names":["getPhrase","CurriculumLinkItem","props","curriculumTag","data","key","id","className","selected","onClick","onChangeCurriculum","toString","name","src","cover","url","size","alt","namespace","CurriculumLinksEmptyState","emptyStateUrl","altText","phrase","PartialCurriculumLinkSection","PartialCurriculumLinks","BRACKET_SEGMENT_REGEX","BASE_PILL_CLASS","CurriculumLeaf","getCurriculumCodeClass","baseClass","leaf","uiContainsCodes","codeRef","current","width","getBoundingClientRect","trySetMaxCodeWidth","description","style","minWidth","codeWidth","ref","Text","dangerouslySetInnerHTML","__html","CurriculumSubject","audienceSegment","subjectSegment","audienceBracketSegments","areaAndLeafSets","getLeafStyleClass","linkSet","areasAndLeaves","forEach","areaAndLeafSet","areaText","CurriculumType","map","ca","join","find","l","push","match","Object","keys","i","CurriculumLinksV2","setCodeWidth","currentVal","curriculumLinkSets","newSet","curriculumLinks","subject","audience","areas","leaves","curriculumObj","type","length","linkSetKey","CurriculumsWidget","collection","selectedCurriculum","curriculums","nonEmptyCurriculums","childClassName","childComponent","_props","partialLoadingComponent","widgetDataDeps","noNegativePadding","PartialTagItem","tagClass","classNames","LanguageService","CurriculumLinksWithScrollbarV2","hasLoaded","activeCurriculum","availableCurriculums","updateCurriculum","customerHasCurriculumLinks","setSelectedCurriculum","alerts","ArrayHelper","canViewCurriculumLinks","PlayPageAnchor","el","headingRef","set","curriculumId","newCurriculum","c","AnalyticsHelper","videoId","video","videoName","entity","actionType","descriptor","location","error","autoHeight","autoHeightMax","height","PlayPageV2","playerContext","hasPermissions","usePermissions","canConsume","VideoHelper","usePlayPageTableOfContent","tableOfContentsId","tableOfContentsActiveId","setTableOfContentsActiveId","controlledId","setControlledId","tableOfContentsExpanded","onToggleTableOfContents","hasGlance","featureAccess","canViewGlance","useSectionHeadings","headingElements","items","ele","clips","interactives","resources","isArchived","hasStudentExperience","PermissionName","useTableOfContentsActiveHeading","setActiveId","useTableOfContentsScroll","shouldPlayOnExitImmersiveReader","appLinkFns","onLaunchImmersiveReader","playerRef","isPaused","pause","onExitImmersiveReader","play","showPlayerPlaceholder","mode","canViewPublicLayout","value","shouldShowSideTableOfContents","breadcrumbs","Breadcrumbs","RestrictionBanner","restrictions","_restrictions","yearGroups","objectId","objectTypeId","MasterType","canManageVideoAccess","ArchivedBanner","typeId","SeoConstants","GlobalPlayerConsumer","shareId","context","params","contextId","playNext","moviesAndTv","mtv","startTime","t","endTime","PlayerPlaceholder","appLink","application","action","PlayPageTitleAndActions","media","audiences","getSeriesAppLink","series","VideoAtAGlanceV2","pointsOfInterest","setStartTime","time","currentTime","getTagAppLink","suppressInteractivity","currentUser","ImageUrls","PlayPageResources","canViewResources","canViewResourceItems","imageCdnUrl","getAppLink","getResourceAppLink","analyticsData","resourceThumbnailFallbackUrl","PlayPageInteractives","canViewInteractives","setFavourite","canFavourite","isPlugin","PlayPageClips","canViewClips","showHeading","RelatedVideos","currentVideo","relatedVideos","getVideoAppLink","v","opts","VideoAppLinkHelper","TableOfContents","isExpanded","setIsExpanded","activeId","showInSide"],"sourceRoot":""}