@clickview/lite 0.104.0-rc.2 → 0.104.0-rc.4
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/dist/.vite/manifest.json +779 -779
- package/dist/bundles.json +1 -1
- package/dist/en.json +1 -1
- package/dist/scripts/{CXN0_XjU.chunk.js → -KvTbeQV.chunk.js} +2 -2
- package/dist/scripts/{CXN0_XjU.chunk.js.map → -KvTbeQV.chunk.js.map} +1 -1
- package/dist/scripts/{Bu7Sr1dy.chunk.js → 0Fek4oFk.chunk.js} +2 -2
- package/dist/scripts/{Bu7Sr1dy.chunk.js.map → 0Fek4oFk.chunk.js.map} +1 -1
- package/dist/scripts/{CfRQYWGG.chunk.js → 5PKjjI4Y.chunk.js} +2 -2
- package/dist/scripts/{CfRQYWGG.chunk.js.map → 5PKjjI4Y.chunk.js.map} +1 -1
- package/dist/scripts/{z8IWZ1V1.chunk.js → AEOAlemi.chunk.js} +2 -2
- package/dist/scripts/{z8IWZ1V1.chunk.js.map → AEOAlemi.chunk.js.map} +1 -1
- package/dist/scripts/{DBcWjmUy.chunk.js → B1TqilLB.chunk.js} +2 -2
- package/dist/scripts/{DBcWjmUy.chunk.js.map → B1TqilLB.chunk.js.map} +1 -1
- package/dist/scripts/B1hsuVfV2.chunk.js +2 -0
- package/dist/scripts/{BwBWuxjr2.chunk.js.map → B1hsuVfV2.chunk.js.map} +1 -1
- package/dist/scripts/{BiUOH1CR.chunk.js → B2wDqI1S.chunk.js} +2 -2
- package/dist/scripts/{BiUOH1CR.chunk.js.map → B2wDqI1S.chunk.js.map} +1 -1
- package/dist/scripts/{DWJiezgB2.chunk.js → BBWnpWNB2.chunk.js} +2 -2
- package/dist/scripts/{DWJiezgB2.chunk.js.map → BBWnpWNB2.chunk.js.map} +1 -1
- package/dist/scripts/BILyzh0I.chunk.js +1 -0
- package/dist/scripts/{B-k4BlVQ2.chunk.js → BUVko1EF2.chunk.js} +3 -3
- package/dist/scripts/{B-k4BlVQ2.chunk.js.map → BUVko1EF2.chunk.js.map} +1 -1
- package/dist/scripts/{GolowYbA.chunk.js → BYbQI3CA.chunk.js} +2 -2
- package/dist/scripts/{GolowYbA.chunk.js.map → BYbQI3CA.chunk.js.map} +1 -1
- package/dist/scripts/{DFlO2qoz2.chunk.js → Bf9r1ZoF2.chunk.js} +2 -2
- package/dist/scripts/{DFlO2qoz2.chunk.js.map → Bf9r1ZoF2.chunk.js.map} +1 -1
- package/dist/scripts/{BpHA-MkZ.chunk.js → BiWUSyJr.chunk.js} +2 -2
- package/dist/scripts/{BpHA-MkZ.chunk.js.map → BiWUSyJr.chunk.js.map} +1 -1
- package/dist/scripts/{C8tDgg1l2.chunk.js → BlsbWOzw2.chunk.js} +2 -2
- package/dist/scripts/{C8tDgg1l2.chunk.js.map → BlsbWOzw2.chunk.js.map} +1 -1
- package/dist/scripts/{C_tdgSWS2.chunk.js → Bzk4AwVx2.chunk.js} +2 -2
- package/dist/scripts/{C_tdgSWS2.chunk.js.map → Bzk4AwVx2.chunk.js.map} +1 -1
- package/dist/scripts/{uSXjtjlJ.chunk.js → C3PXfYEd.chunk.js} +2 -2
- package/dist/scripts/{uSXjtjlJ.chunk.js.map → C3PXfYEd.chunk.js.map} +1 -1
- package/dist/scripts/{BgPye7Nd2.chunk.js → C46OeU6w2.chunk.js} +2 -2
- package/dist/scripts/{BgPye7Nd2.chunk.js.map → C46OeU6w2.chunk.js.map} +1 -1
- package/dist/scripts/{9oMRc0cb2.chunk.js → CAs2Sere2.chunk.js} +2 -2
- package/dist/scripts/{9oMRc0cb2.chunk.js.map → CAs2Sere2.chunk.js.map} +1 -1
- package/dist/scripts/{Bm5qACA52.chunk.js → CNfmLVE82.chunk.js} +2 -2
- package/dist/scripts/{Bm5qACA52.chunk.js.map → CNfmLVE82.chunk.js.map} +1 -1
- package/dist/scripts/{-7qiRMLt.chunk.js → CW1i-QHv.chunk.js} +2 -2
- package/dist/scripts/{-7qiRMLt.chunk.js.map → CW1i-QHv.chunk.js.map} +1 -1
- package/dist/scripts/{EKwCaE3J2.chunk.js → CX6c7KRp2.chunk.js} +2 -2
- package/dist/scripts/{EKwCaE3J2.chunk.js.map → CX6c7KRp2.chunk.js.map} +1 -1
- package/dist/scripts/{D_uAdX7E2.chunk.js → CaCm4N_d2.chunk.js} +2 -2
- package/dist/scripts/{D_uAdX7E2.chunk.js.map → CaCm4N_d2.chunk.js.map} +1 -1
- package/dist/scripts/{DW_sm5se2.chunk.js → CfNYFxJl2.chunk.js} +2 -2
- package/dist/scripts/{DW_sm5se2.chunk.js.map → CfNYFxJl2.chunk.js.map} +1 -1
- package/dist/scripts/{CVL6bQWp.chunk.js → CpzveYo2.chunk.js} +2 -2
- package/dist/scripts/{CVL6bQWp.chunk.js.map → CpzveYo2.chunk.js.map} +1 -1
- package/dist/scripts/{CFduwlo0.chunk.js → Cqq1N9xw.chunk.js} +2 -2
- package/dist/scripts/{CFduwlo0.chunk.js.map → Cqq1N9xw.chunk.js.map} +1 -1
- package/dist/scripts/{UCiRB6cQ.chunk.js → CwFYdvvA.chunk.js} +2 -2
- package/dist/scripts/{UCiRB6cQ.chunk.js.map → CwFYdvvA.chunk.js.map} +1 -1
- package/dist/scripts/{By9Vb8Wn.chunk.js → CwYg3Mqk.chunk.js} +2 -2
- package/dist/scripts/{By9Vb8Wn.chunk.js.map → CwYg3Mqk.chunk.js.map} +1 -1
- package/dist/scripts/{DLcyKjA7.chunk.js → Cyit3dMk.chunk.js} +2 -2
- package/dist/scripts/{DLcyKjA7.chunk.js.map → Cyit3dMk.chunk.js.map} +1 -1
- package/dist/scripts/{BxjzTnvL2.chunk.js → D-iyHqNw2.chunk.js} +3 -3
- package/dist/scripts/{BxjzTnvL2.chunk.js.map → D-iyHqNw2.chunk.js.map} +1 -1
- package/dist/scripts/{DICsRDM42.chunk.js → DH_0KtTK2.chunk.js} +2 -2
- package/dist/scripts/{DICsRDM42.chunk.js.map → DH_0KtTK2.chunk.js.map} +1 -1
- package/dist/scripts/{BTcLMVw4.chunk.js → DKDWcWxk.chunk.js} +2 -2
- package/dist/scripts/{BTcLMVw4.chunk.js.map → DKDWcWxk.chunk.js.map} +1 -1
- package/dist/scripts/{Df6x5Ekm2.chunk.js → DN82USWW2.chunk.js} +2 -2
- package/dist/scripts/{Df6x5Ekm2.chunk.js.map → DN82USWW2.chunk.js.map} +1 -1
- package/dist/scripts/{C62uevy9.chunk.js → DWo8DfD9.chunk.js} +2 -2
- package/dist/scripts/{C62uevy9.chunk.js.map → DWo8DfD9.chunk.js.map} +1 -1
- package/dist/scripts/{Bh-26cqn.chunk.js → Dnz8CbEu.chunk.js} +3 -3
- package/dist/scripts/{Bh-26cqn.chunk.js.map → Dnz8CbEu.chunk.js.map} +1 -1
- package/dist/scripts/{CukXgE1z.chunk.js → Dt5731Ay.chunk.js} +2 -2
- package/dist/scripts/{CukXgE1z.chunk.js.map → Dt5731Ay.chunk.js.map} +1 -1
- package/dist/scripts/{DCPsmD1m.chunk.js → Dtag-27K.chunk.js} +2 -2
- package/dist/scripts/{DCPsmD1m.chunk.js.map → Dtag-27K.chunk.js.map} +1 -1
- package/dist/scripts/{DOCHl5Sy.chunk.js → DyE6EUDb.chunk.js} +2 -2
- package/dist/scripts/{DOCHl5Sy.chunk.js.map → DyE6EUDb.chunk.js.map} +1 -1
- package/dist/scripts/{app-CuKrDFuc.js → app-CfAhMxn1.js} +4 -4
- package/dist/scripts/{app-CuKrDFuc.js.map → app-CfAhMxn1.js.map} +1 -1
- package/dist/scripts/{DerPQKk6.chunk.js → cDv6zuhh.chunk.js} +2 -2
- package/dist/scripts/{DerPQKk6.chunk.js.map → cDv6zuhh.chunk.js.map} +1 -1
- package/dist/scripts/jAtAipGN.chunk.js +2 -0
- package/dist/scripts/{CpsbRDII.chunk.js.map → jAtAipGN.chunk.js.map} +1 -1
- package/dist/scripts/{CXKdMqPJ.chunk.js → pKtXmGbN.chunk.js} +2 -2
- package/dist/scripts/{CXKdMqPJ.chunk.js.map → pKtXmGbN.chunk.js.map} +1 -1
- package/dist/scripts/{DhdM2yGm.chunk.js → qRLSbnEr.chunk.js} +2 -2
- package/dist/scripts/{DhdM2yGm.chunk.js.map → qRLSbnEr.chunk.js.map} +1 -1
- package/package.json +1 -1
- package/dist/scripts/BwBWuxjr2.chunk.js +0 -2
- package/dist/scripts/CCBk_ENs.chunk.js +0 -1
- package/dist/scripts/CpsbRDII.chunk.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./CcI-EKxs.chunk.js";import{m as t}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{t as e}from"./CcI-EKxs.chunk.js";import{m as t}from"./DKDWcWxk.chunk.js";var n=t.getPlugin(`plugin`),r=class extends n{constructor(e){super(e),this.player.dataLoaded(()=>this.initialize())}initialize(){e.setCanReload(!1)}dispose(){e.setCanReload(!0),super.dispose()}};t.registerPlugin(`oldVersionRefreshPlugin`,r);
|
|
2
|
+
//# sourceMappingURL=CNfmLVE82.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"CNfmLVE82.chunk.js","names":[],"sources":["../../../player/src/plugins/old-version-refresh-plugin/old-version-refresh-plugin.ts"],"sourcesContent":["import videojs, { VideoJsPlayer } from 'video.js';\n\nimport { OldVersionService } from 'libs/shared/services/OldVersionService';\n\nconst Plugin = videojs.getPlugin('plugin');\n\nclass OldVersionRefreshPlugin extends Plugin {\n constructor(player: VideoJsPlayer) {\n super(player);\n this.player.dataLoaded(() => this.initialize());\n }\n\n private initialize(): void {\n OldVersionService.setCanReload(false);\n }\n\n public dispose(): void {\n OldVersionService.setCanReload(true);\n super.dispose();\n }\n}\n\nvideojs.registerPlugin('oldVersionRefreshPlugin', OldVersionRefreshPlugin);\n\ndeclare module 'video.js' {\n export interface VideoJsPlayer {\n oldVersionRefreshPlugin(): OldVersionRefreshPlugin;\n }\n}\n\n"],"mappings":"gFAIA,IAAM,EAAS,EAAQ,UAAU,QAAQ,EAEnC,EAAN,cAAsC,CAAO,CAC3C,YAAY,EAAuB,CACjC,MAAM,CAAM,EACZ,KAAK,OAAO,eAAiB,KAAK,WAAW,CAAC,CAChD,CAEA,YAA2B,CACzB,EAAkB,aAAa,EAAK,CACtC,CAEA,SAAuB,CACrB,EAAkB,aAAa,EAAI,EACnC,MAAM,QAAQ,CAChB,CACF,EAEA,EAAQ,eAAe,0BAA2B,CAAuB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./DAXXjFlN.chunk.js";import{t as e}from"./CQyJ7YGa.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{u as r}from"./BX0wDJmp.chunk.js";import{y as i}from"./NlCAcBdo.chunk.js";import{t as a}from"./DGmmTRu72.chunk.js";import{t as o}from"./LoQS6GjP.chunk.js";import{r as s}from"./CsWeCs8U2.chunk.js";import{t as c}from"./DaT2nTfp.chunk.js";import{t as l}from"./C-k6FY-f.chunk.js";import{t as u}from"./
|
|
2
|
-
//# sourceMappingURL
|
|
1
|
+
import"./DAXXjFlN.chunk.js";import{t as e}from"./CQyJ7YGa.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{u as r}from"./BX0wDJmp.chunk.js";import{y as i}from"./NlCAcBdo.chunk.js";import{t as a}from"./DGmmTRu72.chunk.js";import{t as o}from"./LoQS6GjP.chunk.js";import{r as s}from"./CsWeCs8U2.chunk.js";import{t as c}from"./DaT2nTfp.chunk.js";import{t as l}from"./C-k6FY-f.chunk.js";import{t as u}from"./jAtAipGN.chunk.js";import"./BILyzh0I.chunk.js";import{t as d}from"./CCb14vhF.chunk.js";import{n as f}from"./D6bsI9KZ.chunk.js";import{t as p}from"./DkxWaE9O.chunk.js";t();var m=n(),h=e.encloseNamespace(`shared.viewCurriculumLinks`);function g(e){let{preferredCurriculum:t,availableCurriculums:n,curriculumLinks:g,mappedCurriculums:_,updateCurriculum:v,hasCompleted:y,isFetching:b}=d(e.id),x=r(o.video(e.id)),{hasNewSearch:S}=a(null);function C(e){v(e,{shouldLog:!0,locationContext:i.Popup,video:x.data})}return(0,m.jsxs)(c,{title:h(`heading`),closePopup:e.closePopup,size:`lg`,children:[(0,m.jsx)(p,{availableCurriculums:n,onChangeCurriculum:C,selectedCurriculum:t}),(0,m.jsx)(`div`,{className:`pb-3`,children:(0,m.jsx)(f,{curriculumLinks:g,onChangeCurriculum:C,hasCompleted:y,mappedCurriculums:_,isFetching:b,getCodeAppLink:(e,t)=>S?u.getSearchAppLink(e,{[s]:t}):null,locationContext:i.ViewCurriculumLinks})}),(0,m.jsx)(l,{children:(0,m.jsx)(l.Submit,{variant:`dark`,onClick:e.closePopup,text:h(`close`)})})]})}export{g as ViewCurriculumLinksView};
|
|
2
|
+
//# sourceMappingURL=CW1i-QHv.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"-
|
|
1
|
+
{"version":3,"file":"CW1i-QHv.chunk.js","names":[],"sources":["../../src/shared/views/view-curriculum-links/ViewCurriculumLinksView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/react/index';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { SEARCH_CURRICULUM_CODE_PARAM } from 'libs/shared/apps/search/utils/SharedSearchHelper';\nimport { CurriculumDropdown } from 'libs/shared/components/curriculum-links/CurriculumDropdown';\nimport { CurriculumLinks } from 'libs/shared/components/curriculum-links/CurriculumLinks';\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { PopupButtons } from 'libs/shared/components/popup/PopupButtons';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { PopupViewProps, Video } from 'libs/shared/interfaces';\n\nimport { useCurriculums } from 'shared/hooks/useCurriculums';\n\nimport { SearchHelper } from 'apps/search/utils';\n\nconst getPhrase = LanguageService.encloseNamespace('shared.viewCurriculumLinks');\n\ninterface ViewCurriculumLinksViewProps extends PopupViewProps {\n id: string;\n}\n\nexport function ViewCurriculumLinksView(props: ViewCurriculumLinksViewProps): React.ReactElement {\n const {\n preferredCurriculum,\n availableCurriculums,\n curriculumLinks,\n mappedCurriculums,\n updateCurriculum,\n hasCompleted: hasLoadedCurriculums,\n isFetching\n } = useCurriculums(props.id);\n\n const video = Flight.useBasicFetch<Video>(VideoRequests.video(props.id));\n const { hasNewSearch } = useSettings(null);\n\n function onChangeCurriculum(curriculumId: string): void {\n updateCurriculum(curriculumId, {\n shouldLog: true,\n locationContext: LocationContext.Popup,\n video: video.data\n });\n }\n\n return (\n <Popup\n title={getPhrase('heading')}\n closePopup={props.closePopup}\n size='lg'\n >\n <CurriculumDropdown\n availableCurriculums={availableCurriculums}\n onChangeCurriculum={onChangeCurriculum}\n selectedCurriculum={preferredCurriculum}\n />\n\n <div className='pb-3'>\n <CurriculumLinks\n curriculumLinks={curriculumLinks}\n onChangeCurriculum={onChangeCurriculum}\n hasCompleted={hasLoadedCurriculums}\n mappedCurriculums={mappedCurriculums}\n isFetching={isFetching}\n getCodeAppLink={(query, isCode) => {\n if (!hasNewSearch)\n return null;\n\n return SearchHelper.getSearchAppLink(query, { [SEARCH_CURRICULUM_CODE_PARAM]: isCode });\n }}\n locationContext={LocationContext.ViewCurriculumLinks}\n />\n </div>\n\n <PopupButtons>\n <PopupButtons.Submit variant='dark' onClick={props.closePopup} text={getPhrase('close')} />\n </PopupButtons>\n </Popup>\n );\n}\n"],"mappings":"mnBAoBM,EAAY,EAAgB,iBAAiB,4BAA4B,EAM/E,SAAgB,EAAwB,EAAyD,CAC/F,GAAM,CACJ,sBACA,uBACA,kBACA,oBACA,mBACA,aAAc,EACd,cACE,EAAe,EAAM,EAAE,EAErB,EAAQ,EAA4B,EAAc,MAAM,EAAM,EAAE,CAAC,EACjE,CAAE,gBAAiB,EAAY,IAAI,EAEzC,SAAS,EAAmB,EAA4B,CACtD,EAAiB,EAAc,CAC7B,UAAW,GACX,gBAAiB,EAAgB,MACjC,MAAO,EAAM,IACf,CAAC,CACH,CAEA,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CACE,MAAO,EAAU,SAAS,EAC1B,WAAY,EAAM,WAClB,KAAK,cAHP,EAKE,EAAA,EAAA,IAAA,CAAC,EAAD,CACwB,uBACF,qBACpB,mBAAoB,CACrB,CAAA,GAED,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,iBACb,EAAA,EAAA,IAAA,CAAC,EAAD,CACmB,kBACG,qBACpB,aAAc,EACK,oBACP,aACZ,gBAAiB,EAAO,IACjB,EAGE,EAAa,iBAAiB,EAAO,EAAG,GAA+B,CAAO,CAAC,EAF7E,KAIX,gBAAiB,EAAgB,mBAClC,CAAA,CACE,CAAA,GAEL,EAAA,EAAA,IAAA,CAAC,EAAD,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAa,OAAd,CAAqB,QAAQ,OAAO,QAAS,EAAM,WAAY,KAAM,EAAU,OAAO,CAAI,CAAA,CAC9E,CAAA,CACT,GAEX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./DAXXjFlN.chunk.js";import{n as t,r as n,t as r}from"./snXCXfT6.chunk.js";import{n as i}from"./B785hxeE.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./e57H3T-k.chunk.js";import{t as s}from"./C2w0pmFW.chunk.js";import{t as c}from"./wrLrTezN.chunk.js";import{t as l}from"./BXTI9cmX.chunk.js";import{u}from"./BX0wDJmp.chunk.js";import{i as d,t as f}from"./BMKh-xhT2.chunk.js";import{t as p}from"./BDwjs8qz2.chunk.js";import{t as m}from"./CVHQXNzi2.chunk.js";import{t as h}from"./BrbeV-Gn2.chunk.js";import{t as g}from"./CqrjHjAN.chunk.js";import{t as _}from"./eoAypzU3.chunk.js";import{t as v}from"./QCFxJYkI2.chunk.js";import{t as y}from"./CduNFx13.chunk.js";import{t as b}from"./B3gsVN-_.chunk.js";import{t as x}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{n as t,r as n,t as r}from"./snXCXfT6.chunk.js";import{n as i}from"./B785hxeE.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./e57H3T-k.chunk.js";import{t as s}from"./C2w0pmFW.chunk.js";import{t as c}from"./wrLrTezN.chunk.js";import{t as l}from"./BXTI9cmX.chunk.js";import{u}from"./BX0wDJmp.chunk.js";import{i as d,t as f}from"./BMKh-xhT2.chunk.js";import{t as p}from"./BDwjs8qz2.chunk.js";import{t as m}from"./CVHQXNzi2.chunk.js";import{t as h}from"./BrbeV-Gn2.chunk.js";import{t as g}from"./CqrjHjAN.chunk.js";import{t as _}from"./eoAypzU3.chunk.js";import{t as v}from"./QCFxJYkI2.chunk.js";import{t as y}from"./CduNFx13.chunk.js";import{t as b}from"./B3gsVN-_.chunk.js";import{t as x}from"./D-iyHqNw2.chunk.js";import{t as S}from"./Dfw0sxVt2.chunk.js";import{n as C,t as w}from"./CpFtf-tI2.chunk.js";import{t as T}from"./DBkEQkKm2.chunk.js";import{t as E}from"./CCrnRkGN2.chunk.js";import{n as D,r as O}from"./BGswYbRT.chunk.js";import{n as k}from"./xa4cS6Fq.chunk.js";import{t as A}from"./Z4RlHaVG.chunk.js";import{l as j,o as M}from"./BOJK8LI1.chunk.js";import{t as N}from"./DzgAvoez.chunk.js";import{n as P,t as F}from"./CvtZ8ZFA2.chunk.js";import{t as I}from"./pP_cpHCu2.chunk.js";import{a as L,i as R,n as z,r as B,t as V}from"./Bf9r1ZoF2.chunk.js";import{t as H}from"./7I0L5W4N2.chunk.js";function U(e){let{hasPermissions:t}=b(),{hasProduct:n}=S(),r=u(g.currentUser());return!t(i.StudentExperience)&&n(v.Primary)&&r.data.isAuthenticated&&(!e||e.version===`v1`)}var W=e(s(),1),G=c(),K=`interactives.interactiveTitleAndActions`;function q(e){let t,n;return e._parentClip?(t=e._parentClip.name,n={application:l.CLIPS,action:_.Clips.PLAY_CLIP,args:[e._parentClip.id,o.slugify(e._parentClip.name)]}):(t=e._parentVideo.name,n={application:l.VIDEOS,action:_.Videos.PLAY_VIDEO,args:[null,e._parentVideo.id,o.slugify(e._parentVideo.name)]}),[t,n]}function J(e){let{hasPermissions:t}=b(),n=P({location:e.location,shareId:e.shareId,presentationSlug:null}),r=t(i.StudentExperience),a=e.interactive.status===p.Draft,[o,s]=q(e.interactive);return(0,G.jsx)(w.Provider,{value:K,children:(0,G.jsx)(`div`,{className:`d-flex justify-content-between align-items-center`,children:(0,G.jsxs)(`div`,{className:`inline-block w-100`,children:[(0,G.jsx)(`div`,{className:`ms-2 float-end`,children:!r&&(0,G.jsx)(A,{actions:n.getVideoActions(e.interactive),actionsDropdownClassName:`btn btn-outline-dark`,fetchMore:()=>n.fetchMoreActions(e.interactive)})}),(0,G.jsxs)(`h1`,{className:`h3 mb-2`,children:[a&&(0,G.jsx)(`div`,{className:`badge draft-badge me-2 align-bottom flex-shrink-0 h-auto lh-base`,children:(0,G.jsx)(C,{phrase:`draft`})}),e.interactive.name,!r&&(0,G.jsx)(M,{tooltipPlacement:`right`,className:`ps-1 d-inline-block`,video:e.interactive,yearGroups:e.commonVideoProps.yearGroups})]}),h.canViewOriginalVideo(e.interactive)&&(0,G.jsxs)(`div`,{className:`mb-1 me-3 clamp-1`,children:[(0,G.jsx)(C,{phrase:`viewOriginal`}),`\xA0`,(0,G.jsx)(y,{appLink:s,className:`text-info`,children:o})]})]})})})}function Y(e){let[t,n]=W.useState(!0),r=h.isVideoTypeArchived(e.interactive),a=W.useMemo(()=>O(),[]),{hasPermissions:o}=b();function s(e){n(!e)}return(0,G.jsxs)(`div`,{className:`px-3`,children:[r&&(0,G.jsx)(L,{typeId:e.interactive.typeId,hasStudentExperience:!0}),(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(x,{config:e.config,video:e.interactive,currentUser:e.currentUser,shareLink:e.shareLink,viewKey:e.viewKey,startTime:e.startTime,presentationSlug:null,context:e.queryParams?.context,contextId:e.queryParams?.contextId,playNext:e.queryParams?.playNext,mode:`default`,relatedVideos:e.relatedVideos?.videos,onShowSummary:s,summaryPortalNode:a,token:e.token,collectAnonResults:e.collectAnonResults})}),(0,G.jsx)(`div`,{children:t&&(0,G.jsx)(J,{interactive:e.interactive,location:F.PlayPage,commonVideoProps:e.commonVideoProps,shareId:e.shareLink?.id})}),(0,G.jsx)(D,{node:a}),!o(i.StudentExperience)&&(0,G.jsx)(R,{presentationSlug:null,currentVideo:e.interactive,currentUser:e.currentUser,relatedVideos:e.relatedVideos,audiences:e.audiences,getVideoAppLink:(t,n)=>T.getAppLink(t,{...n,context:e.queryParams.context,contextId:e.queryParams.contextId,playNext:e.queryParams.playNext,shareId:e.shareLink?.id,moviesAndTv:e.queryParams.mtv,includeContext:e.currentUser?.isAuthenticated},null),moviesAndTv:e.queryParams.mtv,commonVideoProps:e.commonVideoProps})]})}var X=a.encloseNamespace(`interactives.previewInteractive`);function Z(e){return(0,G.jsxs)(`div`,{className:`alert text-dark bg-light-blue px-2 rounded d-flex flex-column flex-lg-row justify-content-between mb-3 align-items-center`,role:`alert`,children:[e.isArchived?(0,G.jsxs)(`div`,{className:`d-flex align-items-center`,children:[(0,G.jsx)(r,{svg:I,size:t.Standard,className:`me-2 svg-container`}),(0,G.jsxs)(`div`,{className:`w-100`,children:[(0,G.jsx)(`p`,{className:`fw-semibold mb-0`,children:X(`archivedInfoTitle`)}),(0,G.jsx)(`p`,{className:`mb-1`,children:X(`archivedInfo`)})]})]}):(0,G.jsx)(C,{phrase:`alert`}),e.isPreviewPreventScrubbingEnabled&&(0,G.jsx)(n,{title:X(`previewPreventScrubbingExplain`),trigger:[`hover`,`focus`],spanHack:!0,children:(0,G.jsxs)(`div`,{className:`d-flex mt-1 mt-lg-0`,children:[(0,G.jsx)(`div`,{className:`me-2`,children:(0,G.jsx)(C,{phrase:`previewPreventScrubbing`})}),(0,G.jsx)(E,{on:e.isPreviewingPreventScrubbing,onClick:e.toggleStudentMode})]})})]})}function Q(e,t){W.useEffect(()=>{t()},[e])}var $=`interactives.previewInteractive`,ee=a.encloseNamespace($);function te(e){let t=k(),[n,r]=W.useState(!1),{canConsume:i}=h.getCanBeConsumed(e.interactive);Q(n,a);function a(){t.playerRef?.current?.togglePreviewPreventScrubbing?.()}function s(){r(!n)}let c=e.interactives?.filter(t=>t.id.toString()!==e.interactive.id.toString());return(0,G.jsx)(w.Provider,{value:$,children:(0,G.jsxs)(`div`,{className:`px-4`,children:[!!e.breadcrumbs?.length&&(0,G.jsx)(`div`,{className:`mb-2`,children:(0,G.jsx)(N,{breadcrumbs:e.breadcrumbs})}),(0,G.jsx)(V,{restrictions:e.interactive._restrictions,yearGroups:e.commonVideoProps.yearGroups,objectId:e.interactive.id,objectTypeId:m.Interactive,canManageVideoAccess:e.canManageVideoAccess}),(0,G.jsx)(Z,{isPreviewPreventScrubbingEnabled:e.isPreviewPreventScrubbingEnabled,isPreviewingPreventScrubbing:n,toggleStudentMode:s,isArchived:h.isVideoTypeArchived(e.interactive)}),(0,G.jsx)(`div`,{className:`mb-3`,children:i&&(0,G.jsx)(j,{objectId:e.interactive.id,objectTypeId:e.interactive.typeId,shareId:e.shareId,startTime:e.queryParams.t??e.queryParams.startTime,context:e.queryParams?.context,contextId:e.queryParams?.contextId,playNext:e.queryParams?.playNext,mode:`default`,location:`play-page`,token:e.token},e.interactive.id)}),(0,G.jsx)(J,{interactive:e.interactive,location:F.PlayPage,shareId:e.shareId,commonVideoProps:e.commonVideoProps}),e.interactive.description&&(0,G.jsx)(H,{lines:5,children:()=>(0,G.jsx)(`p`,{className:`mb-0 d-inline`,children:e.interactive.description})}),(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(D,{node:t.questionListPortalNode})}),!!c?.length&&(0,G.jsx)(`div`,{className:`pb-3`,children:(0,G.jsx)(f,{name:ee(`otherInteractives`,{count:c.length}),contents:d.Interactives,collection:c,prefetched:!0,getChildAppLink:e=>({application:l.INTERACTIVES,action:_.Interactives.VIEW_INTERACTIVE,args:[e.id,o.slugify(e.name)]}),childComponent:B,extraChildComponentProps:{questionsAppLink:{application:l.INTERACTIVES,action:_.Interactives.PREVIEW_QUESTIONS},commonVideoProps:e.commonVideoProps},analyticsData:{widgetId:`interactives`}})}),!h.isUgc(e.interactive)&&(0,G.jsx)(z,{media:e.interactive,parentVideo:e.interactive._parentClip||e.interactive._parentVideo,contentRegion:e.currentUser.contentRegion,shareId:e.shareId,presentationSlug:null}),(0,G.jsx)(R,{presentationSlug:null,currentVideo:e.interactive,currentUser:e.currentUser,audiences:e.audiences,relatedVideos:e.relatedVideos,getVideoAppLink:(t,n)=>T.getAppLink(t,{...n,context:e.queryParams.context,contextId:e.queryParams.contextId,playNext:e.queryParams.playNext,shareId:e.shareId,moviesAndTv:e.queryParams.mtv,includeContext:e.currentUser?.isAuthenticated},null),moviesAndTv:e.queryParams.mtv,commonVideoProps:e.commonVideoProps})]})})}export{Y as n,U as r,te as t};
|
|
2
|
+
//# sourceMappingURL=CX6c7KRp2.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EKwCaE3J2.chunk.js","names":[],"sources":["../../src/shared/hooks/useShouldPreviewInteractive.ts","../../src/apps/interactives/components/interactive-title-and-actions/InteractiveTitleAndActions.tsx","../../src/apps/interactives/components/play-interactive/PlayInteractive.tsx","../../src/apps/interactives/components/preview-interactive/InteractiveAlertBanner.tsx","../../src/apps/interactives/hooks/interactiveHooks.tsx","../../src/apps/interactives/components/preview-interactive/PreviewInteractive.tsx"],"sourcesContent":["import { Flight } from 'libs/common/flight';\n\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useProducts } from 'libs/shared/hooks/UseProducts';\nimport { CurrentUser, UnionShareObject } from 'libs/shared/interfaces';\n\nexport function useShouldPreviewInteractive(shareLink?: UnionShareObject) {\n const { hasPermissions } = usePermissions();\n const { hasProduct } = useProducts();\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n\n return !hasPermissions(PermissionName.StudentExperience) &&\n hasProduct(ProductId.Primary) &&\n currentUser.data.isAuthenticated &&\n (!shareLink || shareLink.version === 'v1'); // Previewing shares is not supported for Share 2.0 links\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Actions as ActionsComponent } from 'libs/shared/components/actions/Actions';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\nimport { RestrictionPadlock } from 'libs/shared/components/video-list/components/restriction-padlock/RestrictionPadlock';\nimport { CurationStatus } from 'libs/shared/enums/CurationStatus';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { InteractiveMetadata } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\n\nconst namespace = 'interactives.interactiveTitleAndActions';\n\nfunction getBackToData(interactive: InteractiveMetadata): [name: string, appLink: Core.AppLink] {\n let name: string;\n let appLink: Core.AppLink;\n \n if (interactive._parentClip) {\n name = interactive._parentClip.name;\n appLink = {\n application: AppChannels.CLIPS,\n action: Actions.Clips.PLAY_CLIP,\n args: [ interactive._parentClip.id, TextHelper.slugify(interactive._parentClip.name) ]\n };\n } else {\n name = interactive._parentVideo.name;\n appLink = {\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PLAY_VIDEO,\n args: [\n null,\n interactive._parentVideo.id,\n TextHelper.slugify(interactive._parentVideo.name)\n ]\n };\n }\n\n return [ name, appLink ];\n}\n\ninterface InteractiveTitleAndActionsProps {\n interactive: InteractiveMetadata;\n location: VideoActionsLocation;\n shareId?: string;\n commonVideoProps: CommonVideoProps;\n}\n\nexport function InteractiveTitleAndActions(props: InteractiveTitleAndActionsProps): JSX.Element {\n const { hasPermissions } = usePermissions();\n const videoActions = useVideoActions({\n location: props.location,\n shareId: props.shareId,\n presentationSlug: null\n });\n\n const hasStudentExperience = hasPermissions(PermissionName.StudentExperience);\n\n const isDraft = props.interactive.status === CurationStatus.Draft;\n const [ backToName, backToAppLink ] = getBackToData(props.interactive);\n \n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <div className='d-flex justify-content-between align-items-center'>\n <div className='inline-block w-100'>\n <div className='ms-2 float-end'>\n {!hasStudentExperience &&\n <ActionsComponent\n actions={videoActions.getVideoActions(props.interactive)}\n actionsDropdownClassName='btn btn-outline-dark'\n fetchMore={() => videoActions.fetchMoreActions(props.interactive)}\n />\n }\n </div>\n\n <h1 className='h3 mb-2'>\n {isDraft && (\n <div className='badge draft-badge me-2 align-bottom flex-shrink-0 h-auto lh-base'>\n <Text phrase='draft' />\n </div>\n )}\n {props.interactive.name}\n {!hasStudentExperience && (\n <RestrictionPadlock\n tooltipPlacement='right'\n className='ps-1 d-inline-block'\n video={props.interactive}\n yearGroups={props.commonVideoProps.yearGroups}\n />\n )}\n </h1>\n {VideoHelper.canViewOriginalVideo(props.interactive) &&\n <div className='mb-1 me-3 clamp-1'>\n <Text phrase='viewOriginal' /> <AppLink appLink={backToAppLink} className='text-info'>{backToName}</AppLink>\n </div>\n }\n </div>\n </div>\n </LanguageNamespaceContext.Provider>\n );\n}\n","import React from 'react';\nimport { createHtmlPortalNode, OutPortal } from 'react-reverse-portal';\n\nimport { CheckMarkStatus } from 'libs/shared/components/check-mark-button/CheckMarkButton';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { Config, CurrentUser, InteractiveMetadata, PlayerViewKey, PresentationAudience, UnionShareObject, YearGroup } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\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 { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\nimport { LitePlayerView } from 'shared/views/lite-player/LitePlayerView';\n\nimport { InteractiveTitleAndActions } from '../interactive-title-and-actions/InteractiveTitleAndActions';\n\ninterface PlayInteractiveProps {\n interactive: InteractiveMetadata;\n yearGroups: YearGroup[];\n currentUser: CurrentUser;\n token: AuthToken;\n config: Config;\n audiences: PresentationAudience[];\n queryParams: PlayViewQueryParams;\n viewKey: PlayerViewKey;\n startTime?: string;\n endTime?: string;\n relatedVideos: RelatedVideosHash;\n commonVideoProps: CommonVideoProps;\n\n // Share view only\n shareLink?: UnionShareObject;\n sharerInstanceRegion?: string;\n checkMarkStatus?: CheckMarkStatus;\n collectAnonResults?: boolean;\n\n publicName?: string;\n profileId?: string;\n}\n\nexport function PlayInteractive(props: PlayInteractiveProps): JSX.Element {\n const [ showHeading, setShowHeading ] = React.useState(true);\n\n const isArchived = VideoHelper.isVideoTypeArchived(props.interactive);\n\n const summaryPortalNode = React.useMemo(() => createHtmlPortalNode(), []);\n\n const { hasPermissions } = usePermissions();\n\n function onShowSummary(showing: boolean): void {\n setShowHeading(!showing);\n }\n\n return (\n <div className='px-3'>\n {isArchived && <ArchivedBanner typeId={props.interactive.typeId} hasStudentExperience />}\n\n <div className='mb-3'>\n <LitePlayerView\n config={props.config}\n video={props.interactive}\n currentUser={props.currentUser}\n shareLink={props.shareLink}\n viewKey={props.viewKey}\n startTime={props.startTime}\n presentationSlug={null}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n playNext={props.queryParams?.playNext}\n mode='default'\n relatedVideos={props.relatedVideos?.videos}\n onShowSummary={onShowSummary}\n summaryPortalNode={summaryPortalNode}\n token={props.token}\n collectAnonResults={props.collectAnonResults}\n />\n </div>\n\n {/* This wrapping div is here because react seems to not want to play nice\n with adding or removing a node just ahead of an OutPortal */}\n <div>\n {showHeading && (\n <InteractiveTitleAndActions\n interactive={props.interactive}\n location={VideoActionsLocation.PlayPage}\n commonVideoProps={props.commonVideoProps}\n shareId={props.shareLink?.id}\n />\n )}\n </div>\n \n <OutPortal node={summaryPortalNode}></OutPortal>\n\n {!hasPermissions(PermissionName.StudentExperience) && (\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.interactive}\n currentUser={props.currentUser}\n relatedVideos={props.relatedVideos}\n audiences={props.audiences}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareLink?.id,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n )}\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ToggleSwitch } from 'libs/shared/components/toggle-switch/ToggleSwitch';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { ArchiveSvg } from 'libs/shared/images/svg/objects/ArchiveSvg';\n\nconst namespace = 'interactives.previewInteractive';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface InteractiveAlertBannerProps {\n isPreviewPreventScrubbingEnabled: boolean;\n isPreviewingPreventScrubbing: boolean;\n toggleStudentMode: () => void;\n isArchived: boolean;\n}\n\nexport function InteractiveAlertBanner(props: InteractiveAlertBannerProps): JSX.Element {\n return (\n <div className='alert text-dark bg-light-blue px-2 rounded d-flex flex-column flex-lg-row justify-content-between mb-3 align-items-center' role='alert'>\n {!props.isArchived ? <Text phrase='alert' /> : (\n <div className='d-flex align-items-center'>\n <SvgContainer\n svg={ArchiveSvg}\n size={SvgContainerSize.Standard}\n className='me-2 svg-container'\n />\n \n <div className='w-100'>\n <p className='fw-semibold mb-0'>{getPhrase('archivedInfoTitle')}</p>\n <p className='mb-1'>{getPhrase('archivedInfo')}</p>\n </div>\n </div>\n )}\n {props.isPreviewPreventScrubbingEnabled && (\n <Tooltip\n title={getPhrase('previewPreventScrubbingExplain')}\n trigger={[ 'hover', 'focus' ]}\n spanHack\n >\n <div className='d-flex mt-1 mt-lg-0'>\n <div className='me-2'><Text phrase='previewPreventScrubbing'/></div>\n <ToggleSwitch on={props.isPreviewingPreventScrubbing} onClick={props.toggleStudentMode} />\n </div>\n </Tooltip>\n )}\n </div>\n );\n}\n","import React from 'react';\n\nexport function usePreviewPreventInteractive(\n previewPreventInteractive: boolean,\n togglePreviewPreventInteractive: () => void\n): void {\n React.useEffect(() => {\n togglePreviewPreventInteractive();\n }, [previewPreventInteractive]);\n}\n","import * as React from 'react';\nimport { OutPortal } from 'react-reverse-portal';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { ExpandableText } from 'libs/shared/components/expandable-text/ExpandableText';\nimport { InteractiveWidgetItem } from 'libs/shared/components/play-page/interactives-widget/InteractiveWidgetItem';\nimport { LanguageNamespaceContext } from 'libs/shared/components/text/Text';\nimport { FixedWidget } from 'libs/shared/components/widgets/fixed-widget';\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 { WidgetContents } from 'libs/shared/enums/WidgetContents';\nimport { CurrentUser, Interactive, InteractiveMetadata, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { CitationWidget } from 'shared/components/citations/CitationWidget';\nimport { RestrictionBanner } from 'shared/components/play-page/RestrictionBanner';\nimport { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { InteractiveAlertBanner } from 'apps/interactives/components/preview-interactive/InteractiveAlertBanner';\nimport { usePreviewPreventInteractive } from 'apps/interactives/hooks/interactiveHooks';\n\nimport { InteractiveTitleAndActions } from '../interactive-title-and-actions/InteractiveTitleAndActions';\n\nconst namespace = 'interactives.previewInteractive';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface PreviewInteractiveProps {\n interactive: InteractiveMetadata;\n interactives: InteractiveMetadata[];\n token?: AuthToken;\n currentUser: CurrentUser;\n queryParams: PlayViewQueryParams;\n audiences: PresentationAudience[];\n isPreviewPreventScrubbingEnabled: boolean;\n relatedVideos: RelatedVideosHash;\n canManageVideoAccess: boolean;\n breadcrumbs?: Breadcrumb[];\n commonVideoProps: CommonVideoProps;\n\n // Share view only\n shareId?: string;\n}\n\nexport function PreviewInteractive(props: PreviewInteractiveProps): JSX.Element {\n const playerContext = usePlayerContext();\n\n const [ isPreviewingPreventScrubbing, setIsPreviewingPreventScrubbing ] = React.useState(false);\n\n const { canConsume } = VideoHelper.getCanBeConsumed(props.interactive);\n\n usePreviewPreventInteractive(isPreviewingPreventScrubbing, togglePreviewPreventScrubbing);\n\n function togglePreviewPreventScrubbing() {\n playerContext.playerRef?.current?.togglePreviewPreventScrubbing?.();\n }\n\n function toggleStudentMode() {\n setIsPreviewingPreventScrubbing(!isPreviewingPreventScrubbing);\n }\n \n const otherInteractives: InteractiveMetadata[] = props.interactives?.filter(i => {\n return i.id.toString() !== props.interactive.id.toString();\n });\n\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <div className='px-4'>\n {!!props.breadcrumbs?.length &&\n <div className='mb-2'>\n <Breadcrumbs breadcrumbs={props.breadcrumbs} />\n </div>\n }\n\n <RestrictionBanner\n restrictions={props.interactive._restrictions}\n yearGroups={props.commonVideoProps.yearGroups}\n objectId={props.interactive.id}\n objectTypeId={MasterType.Interactive}\n canManageVideoAccess={props.canManageVideoAccess}\n />\n\n <InteractiveAlertBanner\n isPreviewPreventScrubbingEnabled={props.isPreviewPreventScrubbingEnabled}\n isPreviewingPreventScrubbing={isPreviewingPreventScrubbing}\n toggleStudentMode={toggleStudentMode}\n isArchived={VideoHelper.isVideoTypeArchived(props.interactive)}\n />\n\n <div className='mb-3'>\n {canConsume && (\n <GlobalPlayerConsumer\n key={props.interactive.id}\n objectId={props.interactive.id}\n objectTypeId={props.interactive.typeId}\n shareId={props.shareId}\n startTime={props.queryParams.t ?? props.queryParams.startTime}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n playNext={props.queryParams?.playNext}\n mode='default'\n location='play-page'\n token={props.token}\n />\n )}\n </div>\n \n <InteractiveTitleAndActions\n interactive={props.interactive}\n location={VideoActionsLocation.PlayPage}\n shareId={props.shareId}\n commonVideoProps={props.commonVideoProps}\n />\n\n {props.interactive.description && (\n <ExpandableText lines={5}>\n {() => <p className='mb-0 d-inline'>{props.interactive.description}</p>}\n </ExpandableText>\n )}\n\n <div className='mb-3'>\n <OutPortal node={playerContext.questionListPortalNode}></OutPortal>\n </div>\n\n {!!otherInteractives?.length && (\n <div className='pb-3'>\n \n <FixedWidget\n name={getPhrase('otherInteractives', { count: otherInteractives.length })}\n contents={WidgetContents.Interactives}\n collection={otherInteractives}\n prefetched\n getChildAppLink={(interactive: Interactive) => {\n return {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.VIEW_INTERACTIVE,\n args: [ interactive.id, TextHelper.slugify(interactive.name) ]\n };\n }}\n childComponent={InteractiveWidgetItem}\n extraChildComponentProps={{\n questionsAppLink: {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.PREVIEW_QUESTIONS\n },\n commonVideoProps: props.commonVideoProps\n }}\n analyticsData={{ widgetId: 'interactives' }}\n />\n </div>\n )}\n\n {!VideoHelper.isUgc(props.interactive) && (\n <CitationWidget\n media={props.interactive}\n parentVideo={props.interactive._parentClip || props.interactive._parentVideo}\n contentRegion={props.currentUser.contentRegion}\n shareId={props.shareId}\n presentationSlug={null}\n />\n )}\n\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.interactive}\n currentUser={props.currentUser}\n audiences={props.audiences}\n relatedVideos={props.relatedVideos}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareId,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n </div>\n </LanguageNamespaceContext.Provider>\n );\n}\n"],"mappings":"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CAAA,CACE,GAC4B,CAAA,CAEvC"}
|
|
1
|
+
{"version":3,"file":"CX6c7KRp2.chunk.js","names":[],"sources":["../../src/shared/hooks/useShouldPreviewInteractive.ts","../../src/apps/interactives/components/interactive-title-and-actions/InteractiveTitleAndActions.tsx","../../src/apps/interactives/components/play-interactive/PlayInteractive.tsx","../../src/apps/interactives/components/preview-interactive/InteractiveAlertBanner.tsx","../../src/apps/interactives/hooks/interactiveHooks.tsx","../../src/apps/interactives/components/preview-interactive/PreviewInteractive.tsx"],"sourcesContent":["import { Flight } from 'libs/common/flight';\n\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useProducts } from 'libs/shared/hooks/UseProducts';\nimport { CurrentUser, UnionShareObject } from 'libs/shared/interfaces';\n\nexport function useShouldPreviewInteractive(shareLink?: UnionShareObject) {\n const { hasPermissions } = usePermissions();\n const { hasProduct } = useProducts();\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n\n return !hasPermissions(PermissionName.StudentExperience) &&\n hasProduct(ProductId.Primary) &&\n currentUser.data.isAuthenticated &&\n (!shareLink || shareLink.version === 'v1'); // Previewing shares is not supported for Share 2.0 links\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Actions as ActionsComponent } from 'libs/shared/components/actions/Actions';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\nimport { RestrictionPadlock } from 'libs/shared/components/video-list/components/restriction-padlock/RestrictionPadlock';\nimport { CurationStatus } from 'libs/shared/enums/CurationStatus';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { InteractiveMetadata } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\n\nconst namespace = 'interactives.interactiveTitleAndActions';\n\nfunction getBackToData(interactive: InteractiveMetadata): [name: string, appLink: Core.AppLink] {\n let name: string;\n let appLink: Core.AppLink;\n \n if (interactive._parentClip) {\n name = interactive._parentClip.name;\n appLink = {\n application: AppChannels.CLIPS,\n action: Actions.Clips.PLAY_CLIP,\n args: [ interactive._parentClip.id, TextHelper.slugify(interactive._parentClip.name) ]\n };\n } else {\n name = interactive._parentVideo.name;\n appLink = {\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PLAY_VIDEO,\n args: [\n null,\n interactive._parentVideo.id,\n TextHelper.slugify(interactive._parentVideo.name)\n ]\n };\n }\n\n return [ name, appLink ];\n}\n\ninterface InteractiveTitleAndActionsProps {\n interactive: InteractiveMetadata;\n location: VideoActionsLocation;\n shareId?: string;\n commonVideoProps: CommonVideoProps;\n}\n\nexport function InteractiveTitleAndActions(props: InteractiveTitleAndActionsProps): JSX.Element {\n const { hasPermissions } = usePermissions();\n const videoActions = useVideoActions({\n location: props.location,\n shareId: props.shareId,\n presentationSlug: null\n });\n\n const hasStudentExperience = hasPermissions(PermissionName.StudentExperience);\n\n const isDraft = props.interactive.status === CurationStatus.Draft;\n const [ backToName, backToAppLink ] = getBackToData(props.interactive);\n \n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <div className='d-flex justify-content-between align-items-center'>\n <div className='inline-block w-100'>\n <div className='ms-2 float-end'>\n {!hasStudentExperience &&\n <ActionsComponent\n actions={videoActions.getVideoActions(props.interactive)}\n actionsDropdownClassName='btn btn-outline-dark'\n fetchMore={() => videoActions.fetchMoreActions(props.interactive)}\n />\n }\n </div>\n\n <h1 className='h3 mb-2'>\n {isDraft && (\n <div className='badge draft-badge me-2 align-bottom flex-shrink-0 h-auto lh-base'>\n <Text phrase='draft' />\n </div>\n )}\n {props.interactive.name}\n {!hasStudentExperience && (\n <RestrictionPadlock\n tooltipPlacement='right'\n className='ps-1 d-inline-block'\n video={props.interactive}\n yearGroups={props.commonVideoProps.yearGroups}\n />\n )}\n </h1>\n {VideoHelper.canViewOriginalVideo(props.interactive) &&\n <div className='mb-1 me-3 clamp-1'>\n <Text phrase='viewOriginal' /> <AppLink appLink={backToAppLink} className='text-info'>{backToName}</AppLink>\n </div>\n }\n </div>\n </div>\n </LanguageNamespaceContext.Provider>\n );\n}\n","import React from 'react';\nimport { createHtmlPortalNode, OutPortal } from 'react-reverse-portal';\n\nimport { CheckMarkStatus } from 'libs/shared/components/check-mark-button/CheckMarkButton';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { Config, CurrentUser, InteractiveMetadata, PlayerViewKey, PresentationAudience, UnionShareObject, YearGroup } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\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 { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\nimport { LitePlayerView } from 'shared/views/lite-player/LitePlayerView';\n\nimport { InteractiveTitleAndActions } from '../interactive-title-and-actions/InteractiveTitleAndActions';\n\ninterface PlayInteractiveProps {\n interactive: InteractiveMetadata;\n yearGroups: YearGroup[];\n currentUser: CurrentUser;\n token: AuthToken;\n config: Config;\n audiences: PresentationAudience[];\n queryParams: PlayViewQueryParams;\n viewKey: PlayerViewKey;\n startTime?: string;\n endTime?: string;\n relatedVideos: RelatedVideosHash;\n commonVideoProps: CommonVideoProps;\n\n // Share view only\n shareLink?: UnionShareObject;\n sharerInstanceRegion?: string;\n checkMarkStatus?: CheckMarkStatus;\n collectAnonResults?: boolean;\n\n publicName?: string;\n profileId?: string;\n}\n\nexport function PlayInteractive(props: PlayInteractiveProps): JSX.Element {\n const [ showHeading, setShowHeading ] = React.useState(true);\n\n const isArchived = VideoHelper.isVideoTypeArchived(props.interactive);\n\n const summaryPortalNode = React.useMemo(() => createHtmlPortalNode(), []);\n\n const { hasPermissions } = usePermissions();\n\n function onShowSummary(showing: boolean): void {\n setShowHeading(!showing);\n }\n\n return (\n <div className='px-3'>\n {isArchived && <ArchivedBanner typeId={props.interactive.typeId} hasStudentExperience />}\n\n <div className='mb-3'>\n <LitePlayerView\n config={props.config}\n video={props.interactive}\n currentUser={props.currentUser}\n shareLink={props.shareLink}\n viewKey={props.viewKey}\n startTime={props.startTime}\n presentationSlug={null}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n playNext={props.queryParams?.playNext}\n mode='default'\n relatedVideos={props.relatedVideos?.videos}\n onShowSummary={onShowSummary}\n summaryPortalNode={summaryPortalNode}\n token={props.token}\n collectAnonResults={props.collectAnonResults}\n />\n </div>\n\n {/* This wrapping div is here because react seems to not want to play nice\n with adding or removing a node just ahead of an OutPortal */}\n <div>\n {showHeading && (\n <InteractiveTitleAndActions\n interactive={props.interactive}\n location={VideoActionsLocation.PlayPage}\n commonVideoProps={props.commonVideoProps}\n shareId={props.shareLink?.id}\n />\n )}\n </div>\n \n <OutPortal node={summaryPortalNode}></OutPortal>\n\n {!hasPermissions(PermissionName.StudentExperience) && (\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.interactive}\n currentUser={props.currentUser}\n relatedVideos={props.relatedVideos}\n audiences={props.audiences}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareLink?.id,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n )}\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { SvgContainer, SvgContainerSize } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ToggleSwitch } from 'libs/shared/components/toggle-switch/ToggleSwitch';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { ArchiveSvg } from 'libs/shared/images/svg/objects/ArchiveSvg';\n\nconst namespace = 'interactives.previewInteractive';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface InteractiveAlertBannerProps {\n isPreviewPreventScrubbingEnabled: boolean;\n isPreviewingPreventScrubbing: boolean;\n toggleStudentMode: () => void;\n isArchived: boolean;\n}\n\nexport function InteractiveAlertBanner(props: InteractiveAlertBannerProps): JSX.Element {\n return (\n <div className='alert text-dark bg-light-blue px-2 rounded d-flex flex-column flex-lg-row justify-content-between mb-3 align-items-center' role='alert'>\n {!props.isArchived ? <Text phrase='alert' /> : (\n <div className='d-flex align-items-center'>\n <SvgContainer\n svg={ArchiveSvg}\n size={SvgContainerSize.Standard}\n className='me-2 svg-container'\n />\n \n <div className='w-100'>\n <p className='fw-semibold mb-0'>{getPhrase('archivedInfoTitle')}</p>\n <p className='mb-1'>{getPhrase('archivedInfo')}</p>\n </div>\n </div>\n )}\n {props.isPreviewPreventScrubbingEnabled && (\n <Tooltip\n title={getPhrase('previewPreventScrubbingExplain')}\n trigger={[ 'hover', 'focus' ]}\n spanHack\n >\n <div className='d-flex mt-1 mt-lg-0'>\n <div className='me-2'><Text phrase='previewPreventScrubbing'/></div>\n <ToggleSwitch on={props.isPreviewingPreventScrubbing} onClick={props.toggleStudentMode} />\n </div>\n </Tooltip>\n )}\n </div>\n );\n}\n","import React from 'react';\n\nexport function usePreviewPreventInteractive(\n previewPreventInteractive: boolean,\n togglePreviewPreventInteractive: () => void\n): void {\n React.useEffect(() => {\n togglePreviewPreventInteractive();\n }, [previewPreventInteractive]);\n}\n","import * as React from 'react';\nimport { OutPortal } from 'react-reverse-portal';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { ExpandableText } from 'libs/shared/components/expandable-text/ExpandableText';\nimport { InteractiveWidgetItem } from 'libs/shared/components/play-page/interactives-widget/InteractiveWidgetItem';\nimport { LanguageNamespaceContext } from 'libs/shared/components/text/Text';\nimport { FixedWidget } from 'libs/shared/components/widgets/fixed-widget';\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 { WidgetContents } from 'libs/shared/enums/WidgetContents';\nimport { CurrentUser, Interactive, InteractiveMetadata, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { CitationWidget } from 'shared/components/citations/CitationWidget';\nimport { RestrictionBanner } from 'shared/components/play-page/RestrictionBanner';\nimport { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { InteractiveAlertBanner } from 'apps/interactives/components/preview-interactive/InteractiveAlertBanner';\nimport { usePreviewPreventInteractive } from 'apps/interactives/hooks/interactiveHooks';\n\nimport { InteractiveTitleAndActions } from '../interactive-title-and-actions/InteractiveTitleAndActions';\n\nconst namespace = 'interactives.previewInteractive';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface PreviewInteractiveProps {\n interactive: InteractiveMetadata;\n interactives: InteractiveMetadata[];\n token?: AuthToken;\n currentUser: CurrentUser;\n queryParams: PlayViewQueryParams;\n audiences: PresentationAudience[];\n isPreviewPreventScrubbingEnabled: boolean;\n relatedVideos: RelatedVideosHash;\n canManageVideoAccess: boolean;\n breadcrumbs?: Breadcrumb[];\n commonVideoProps: CommonVideoProps;\n\n // Share view only\n shareId?: string;\n}\n\nexport function PreviewInteractive(props: PreviewInteractiveProps): JSX.Element {\n const playerContext = usePlayerContext();\n\n const [ isPreviewingPreventScrubbing, setIsPreviewingPreventScrubbing ] = React.useState(false);\n\n const { canConsume } = VideoHelper.getCanBeConsumed(props.interactive);\n\n usePreviewPreventInteractive(isPreviewingPreventScrubbing, togglePreviewPreventScrubbing);\n\n function togglePreviewPreventScrubbing() {\n playerContext.playerRef?.current?.togglePreviewPreventScrubbing?.();\n }\n\n function toggleStudentMode() {\n setIsPreviewingPreventScrubbing(!isPreviewingPreventScrubbing);\n }\n \n const otherInteractives: InteractiveMetadata[] = props.interactives?.filter(i => {\n return i.id.toString() !== props.interactive.id.toString();\n });\n\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <div className='px-4'>\n {!!props.breadcrumbs?.length &&\n <div className='mb-2'>\n <Breadcrumbs breadcrumbs={props.breadcrumbs} />\n </div>\n }\n\n <RestrictionBanner\n restrictions={props.interactive._restrictions}\n yearGroups={props.commonVideoProps.yearGroups}\n objectId={props.interactive.id}\n objectTypeId={MasterType.Interactive}\n canManageVideoAccess={props.canManageVideoAccess}\n />\n\n <InteractiveAlertBanner\n isPreviewPreventScrubbingEnabled={props.isPreviewPreventScrubbingEnabled}\n isPreviewingPreventScrubbing={isPreviewingPreventScrubbing}\n toggleStudentMode={toggleStudentMode}\n isArchived={VideoHelper.isVideoTypeArchived(props.interactive)}\n />\n\n <div className='mb-3'>\n {canConsume && (\n <GlobalPlayerConsumer\n key={props.interactive.id}\n objectId={props.interactive.id}\n objectTypeId={props.interactive.typeId}\n shareId={props.shareId}\n startTime={props.queryParams.t ?? props.queryParams.startTime}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n playNext={props.queryParams?.playNext}\n mode='default'\n location='play-page'\n token={props.token}\n />\n )}\n </div>\n \n <InteractiveTitleAndActions\n interactive={props.interactive}\n location={VideoActionsLocation.PlayPage}\n shareId={props.shareId}\n commonVideoProps={props.commonVideoProps}\n />\n\n {props.interactive.description && (\n <ExpandableText lines={5}>\n {() => <p className='mb-0 d-inline'>{props.interactive.description}</p>}\n </ExpandableText>\n )}\n\n <div className='mb-3'>\n <OutPortal node={playerContext.questionListPortalNode}></OutPortal>\n </div>\n\n {!!otherInteractives?.length && (\n <div className='pb-3'>\n \n <FixedWidget\n name={getPhrase('otherInteractives', { count: otherInteractives.length })}\n contents={WidgetContents.Interactives}\n collection={otherInteractives}\n prefetched\n getChildAppLink={(interactive: Interactive) => {\n return {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.VIEW_INTERACTIVE,\n args: [ interactive.id, TextHelper.slugify(interactive.name) ]\n };\n }}\n childComponent={InteractiveWidgetItem}\n extraChildComponentProps={{\n questionsAppLink: {\n application: AppChannels.INTERACTIVES,\n action: Actions.Interactives.PREVIEW_QUESTIONS\n },\n commonVideoProps: props.commonVideoProps\n }}\n analyticsData={{ widgetId: 'interactives' }}\n />\n </div>\n )}\n\n {!VideoHelper.isUgc(props.interactive) && (\n <CitationWidget\n media={props.interactive}\n parentVideo={props.interactive._parentClip || props.interactive._parentVideo}\n contentRegion={props.currentUser.contentRegion}\n shareId={props.shareId}\n presentationSlug={null}\n />\n )}\n\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.interactive}\n currentUser={props.currentUser}\n audiences={props.audiences}\n relatedVideos={props.relatedVideos}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareId,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n </div>\n </LanguageNamespaceContext.Provider>\n );\n}\n"],"mappings":"s1CASA,SAAgB,EAA4B,EAA8B,CACxE,GAAM,CAAE,kBAAmB,EAAe,EACpC,CAAE,cAAe,EAAY,EAC7B,EAAc,EAAkC,EAAa,YAAY,CAAC,EAEhF,MAAO,CAAC,EAAe,EAAe,iBAAiB,GACrD,EAAW,EAAU,OAAO,GAC5B,EAAY,KAAK,kBAChB,CAAC,GAAa,EAAU,UAAY,KACzC,sBCEM,EAAY,0CAElB,SAAS,EAAc,EAAyE,CAC9F,IAAI,EACA,EAsBJ,OApBI,EAAY,aACd,EAAO,EAAY,YAAY,KAC/B,EAAU,CACR,YAAa,EAAY,MACzB,OAAQ,EAAQ,MAAM,UACtB,KAAM,CAAE,EAAY,YAAY,GAAI,EAAW,QAAQ,EAAY,YAAY,IAAI,CAAE,CACvF,IAEA,EAAO,EAAY,aAAa,KAChC,EAAU,CACR,YAAa,EAAY,OACzB,OAAQ,EAAQ,OAAO,WACvB,KAAM,CACJ,KACA,EAAY,aAAa,GACzB,EAAW,QAAQ,EAAY,aAAa,IAAI,CAClD,CACF,GAGK,CAAE,EAAM,CAAQ,CACzB,CASA,SAAgB,EAA2B,EAAqD,CAC9F,GAAM,CAAE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MAAO,EAAM,YACb,YAAa,EAAM,YAAY,aAAe,EAAM,YAAY,aAChE,cAAe,EAAM,YAAY,cACjC,QAAS,EAAM,QACf,iBAAkB,IACnB,CAAA,GAGH,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,iBAAkB,KAClB,aAAc,EAAM,YACpB,YAAa,EAAM,YACnB,UAAW,EAAM,UACjB,cAAe,EAAM,cACrB,iBAAkB,EAAG,IAAS,EAAmB,WAAW,EAAG,CAC7D,GAAG,EACH,QAAS,EAAM,YAAY,QAC3B,UAAW,EAAM,YAAY,UAC7B,SAAU,EAAM,YAAY,SAC5B,QAAS,EAAM,QACf,YAAa,EAAM,YAAY,IAC/B,eAAgB,EAAM,aAAa,eACrC,EAAG,IAAI,EACP,YAAa,EAAM,YAAY,IAC/B,iBAAkB,EAAM,gBACzB,CAAA,CACE,GAC4B,CAAA,CAEvC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./DAXXjFlN.chunk.js";import{t as e}from"./DMnm3Ewv.chunk.js";import{n as t}from"./B785hxeE.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{u as i}from"./BX0wDJmp.chunk.js";import{y as a}from"./NlCAcBdo.chunk.js";import{t as o}from"./xwiwWcv12.chunk.js";import{t as s}from"./DbSUQ2A12.chunk.js";import{t as c}from"./BC8PeYqm.chunk.js";import{t as l}from"./CqrjHjAN.chunk.js";import{t as u}from"./D_gWf2lC.chunk.js";import{n as d,t as f}from"./C6-aC3vu.chunk.js";import{n as p,t as m}from"./BGhJ8TEx.chunk.js";import{t as h}from"./7LGxCHGV.chunk.js";import{t as g}from"./Bbv3vbm7.chunk.js";import{t as _}from"./B3gsVN-_.chunk.js";import{r as v}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import"./DAXXjFlN.chunk.js";import{t as e}from"./DMnm3Ewv.chunk.js";import{n as t}from"./B785hxeE.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{u as i}from"./BX0wDJmp.chunk.js";import{y as a}from"./NlCAcBdo.chunk.js";import{t as o}from"./xwiwWcv12.chunk.js";import{t as s}from"./DbSUQ2A12.chunk.js";import{t as c}from"./BC8PeYqm.chunk.js";import{t as l}from"./CqrjHjAN.chunk.js";import{t as u}from"./D_gWf2lC.chunk.js";import{n as d,t as f}from"./C6-aC3vu.chunk.js";import{n as p,t as m}from"./BGhJ8TEx.chunk.js";import{t as h}from"./7LGxCHGV.chunk.js";import{t as g}from"./Bbv3vbm7.chunk.js";import{t as _}from"./B3gsVN-_.chunk.js";import{r as v}from"./D-iyHqNw2.chunk.js";import{t as y}from"./CgW21-1J.chunk.js";import{n as b}from"./ChnNWPOK2.chunk.js";import{t as x}from"./C9XBZFiR.chunk.js";import{t as S}from"./BnuuRu_J2.chunk.js";import{t as C}from"./CC5Dr9aG.chunk.js";import{t as w}from"./BYaCUOEW2.chunk.js";import{t as T}from"./DNuJUXpr2.chunk.js";import{n as E,r as D,t as O}from"./CX6c7KRp2.chunk.js";n();var k=r(),A={notFound:y,forbidden:{privacy:g}};function j(e){return e?._parentClip||e?._parentVideo}function M(n){let{hasPermissions:r}=_(),g=i(u.config()),y=i(l.token()),M=i(l.currentUser()),N=i(M.data?.isAuthenticated&&o.yearGroups(M.data.customerId)),P=i(c.interactiveMetadata(n.id)),F=D(),I=i(P.statusCode===e.Forbidden&&c.interactiveMetadata(n.id,s.StripMetadata)),L=i(F&&P.data&&c.interactive(P.data.interactiveId)),R=i(F&&P.data&&c.videoInteractives(j(P.data).id)),z=w(),B=i(m.createViewKey(n.id,p.MasterObject)),V=v({video:P.data,context:n.queryParams.context,contextId:n.queryParams.contextId,moviesAndTv:n.queryParams.mtv,currentUser:M.data}),{commonVideoProps:H,hasCommonVideoPropsCompleted:U}=S({locationContext:F?a.PreviewInteractive:a.PlayInteractive,mtv:n.queryParams.mtv});b({id:n.id,app:`interactives`}),x(P,A,{forbidden:!0}),h(I),f(d.getInteractiveMetadata({content:P.data})),T(V.videos??[]);let W=C({name:P.data?.name});return P.data&&g.hasCompleted&&M.hasCompleted&&(!F||L.hasCompleted)&&B.hasCompleted&&y.hasCompleted&&U?F?(0,k.jsx)(O,{currentUser:M.data,queryParams:n.queryParams,interactive:P.data,interactives:R.data?.data,isPreviewPreventScrubbingEnabled:L.data.preventScrubbing,audiences:z.data,relatedVideos:V,canManageVideoAccess:r(t.ManageVideoAccess),breadcrumbs:W,token:y.data,commonVideoProps:H}):(0,k.jsx)(E,{interactive:P.data,currentUser:M.data,config:g.data,yearGroups:N.data,audiences:z.data,queryParams:n.queryParams,viewKey:B.data,relatedVideos:V,startTime:n.queryParams?.t??n.queryParams?.startTime,token:y.data,commonVideoProps:H}):(0,k.jsx)(k.Fragment,{})}export{M as InteractiveView};
|
|
2
|
+
//# sourceMappingURL=CaCm4N_d2.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"CaCm4N_d2.chunk.js","names":[],"sources":["../../src/apps/interactives/views/interactive-view/InteractiveView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { HttpStatus } from 'libs/common/backbone/enums/HttpStatus';\nimport { Flight } from 'libs/common/flight';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { MediaIdType } from 'libs/shared/enums/MediaIdType';\nimport { PermissionFilterOption } from 'libs/shared/enums/PermissionFilterOption';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { VideoNotFoundError } from 'libs/shared/errors/videos/video-not-found/VideoNotFoundError';\nimport { VideoPrivateError } from 'libs/shared/errors/videos/video-private/VideoPrivateError';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { CustomerRequests } from 'libs/shared/flight-requests/CustomerRequests';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { PlayerRequests } from 'libs/shared/flight-requests/PlayerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCannotConsumeError } from 'libs/shared/hooks/useCannotConsumeError';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Clip, Config, CurrentUser, Interactive, InteractiveCollection, InteractiveMetadata, PlayerViewKey, Video, YearGroup } from 'libs/shared/interfaces';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useGetRelatedVideos } from 'shared/hooks/useGetRelatedVideos';\nimport { usePresentationAudiences } from 'shared/hooks/usePresentationAudiences';\nimport { useShouldPreviewInteractive } from 'shared/hooks/useShouldPreviewInteractive';\nimport { useVideoMixin } from 'shared/hooks/useVideoMixin';\n\nimport { PlayInteractive } from 'apps/interactives/components/play-interactive/PlayInteractive';\nimport { PreviewInteractive } from 'apps/interactives/components/preview-interactive/PreviewInteractive';\n\nconst videoErrors = {\n notFound: VideoNotFoundError,\n forbidden: {\n privacy: VideoPrivateError\n }\n};\n\nfunction getSourceVideo(interactive?: InteractiveMetadata): Clip | Video {\n return interactive?._parentClip || interactive?._parentVideo;\n}\ninterface InteractiveViewProps {\n id: string;\n queryParams: PlayViewQueryParams;\n}\n\nexport function InteractiveView(props: InteractiveViewProps): JSX.Element {\n const { hasPermissions } = usePermissions();\n\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const token = Flight.useBasicFetch<AuthToken>(UserRequests.token());\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const yearGroups = Flight.useBasicFetch<YearGroup[]>(\n currentUser.data?.isAuthenticated && CustomerRequests.yearGroups(currentUser.data.customerId)\n );\n\n const interactiveMetadata = Flight.useBasicFetch<InteractiveMetadata>(\n InteractiveRequests.interactiveMetadata(props.id)\n );\n const shouldPreviewInteractive = useShouldPreviewInteractive();\n const strippedInteractiveMetadata = Flight.useBasicFetch<InteractiveMetadata>(\n interactiveMetadata.statusCode === HttpStatus.Forbidden &&\n InteractiveRequests.interactiveMetadata(props.id, PermissionFilterOption.StripMetadata)\n );\n const interactive = Flight.useBasicFetch<Interactive>(\n shouldPreviewInteractive && interactiveMetadata.data &&\n InteractiveRequests.interactive(interactiveMetadata.data.interactiveId)\n );\n const interactives = Flight.useBasicFetch<InteractiveCollection>(\n shouldPreviewInteractive && interactiveMetadata.data &&\n InteractiveRequests.videoInteractives(getSourceVideo(interactiveMetadata.data).id)\n );\n \n const audiences = usePresentationAudiences();\n const viewKey = Flight.useBasicFetch<PlayerViewKey>(PlayerRequests.createViewKey(props.id, MediaIdType.MasterObject));\n\n const relatedVideos = useGetRelatedVideos({\n video: interactiveMetadata.data,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n moviesAndTv: props.queryParams.mtv,\n currentUser: currentUser.data\n });\n\n const locationContext = shouldPreviewInteractive ?\n LocationContext.PreviewInteractive :\n LocationContext.PlayInteractive;\n \n const {\n commonVideoProps,\n hasCommonVideoPropsCompleted\n } = useCommonVideoProps({ locationContext, mtv: props.queryParams.mtv });\n\n useDeepLinks({ id: props.id, app: 'interactives' });\n\n useHandleObjectError(interactiveMetadata, videoErrors, { forbidden: true });\n useCannotConsumeError(strippedInteractiveMetadata);\n useSetPageMetadata(PageMetadataHelper.getInteractiveMetadata({ content: interactiveMetadata.data }));\n\n useVideoMixin(relatedVideos.videos ?? []);\n\n const breadcrumbs = useBreadcrumbs({ name: interactiveMetadata.data?.name });\n\n const hasLoaded = (\n interactiveMetadata.data &&\n config.hasCompleted &&\n currentUser.hasCompleted &&\n (!shouldPreviewInteractive || interactive.hasCompleted) &&\n viewKey.hasCompleted &&\n token.hasCompleted &&\n hasCommonVideoPropsCompleted\n );\n\n if (!hasLoaded)\n return <></>;\n\n if (shouldPreviewInteractive) {\n return (\n <PreviewInteractive\n currentUser={currentUser.data}\n queryParams={props.queryParams}\n interactive={interactiveMetadata.data}\n interactives={interactives.data?.data}\n isPreviewPreventScrubbingEnabled={interactive.data.preventScrubbing}\n audiences={audiences.data}\n relatedVideos={relatedVideos}\n canManageVideoAccess={hasPermissions(PermissionName.ManageVideoAccess)}\n breadcrumbs={breadcrumbs}\n token={token.data}\n commonVideoProps={commonVideoProps}\n />\n );\n }\n\n return (\n <PlayInteractive\n interactive={interactiveMetadata.data}\n currentUser={currentUser.data}\n config={config.data}\n yearGroups={yearGroups.data}\n audiences={audiences.data}\n queryParams={props.queryParams}\n viewKey={viewKey.data}\n relatedVideos={relatedVideos}\n startTime={props.queryParams?.t ?? props.queryParams?.startTime}\n token={token.data}\n commonVideoProps={commonVideoProps}\n />\n );\n}\n"],"mappings":"sjCAqCM,EAAc,CAClB,SAAU,EACV,UAAW,CACT,QAAS,CACX,CACF,EAEA,SAAS,EAAe,EAAiD,CACvE,OAAO,GAAa,aAAe,GAAa,YAClD,CAMA,SAAgB,EAAgB,EAA0C,CACxE,GAAM,CAAE,kBAAmB,EAAe,EAEpC,EAAS,EAA6B,EAAe,OAAO,CAAC,EAC7D,EAAQ,EAAgC,EAAa,MAAM,CAAC,EAC5D,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAa,EACjB,EAAY,MAAM,iBAAmB,EAAiB,WAAW,EAAY,KAAK,UAAU,CAC9F,EAEM,EAAsB,EAC1B,EAAoB,oBAAoB,EAAM,EAAE,CAClD,EACM,EAA2B,EAA4B,EACvD,EAA8B,EAClC,EAAoB,aAAe,EAAW,WAC5C,EAAoB,oBAAoB,EAAM,GAAI,EAAuB,aAAa,CAC1F,EACM,EAAc,EAClB,GAA4B,EAAoB,MAChD,EAAoB,YAAY,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YAAa,EAAM,YACnB,QAAS,EAAQ,KACF,gBACf,UAAW,EAAM,aAAa,GAAK,EAAM,aAAa,UACtD,MAAO,EAAM,KACK,kBACnB,CAAA,GAjCM,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CAmCf"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./DAXXjFlN.chunk.js";import{y as t}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{n}from"./B785hxeE.chunk.js";import{t as r}from"./CQyJ7YGa.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./BXTI9cmX.chunk.js";import{u as s}from"./BX0wDJmp.chunk.js";import{t as c}from"./e1lz2ERJ2.chunk.js";import{t as l}from"./DGmmTRu72.chunk.js";import{t as u}from"./xwiwWcv12.chunk.js";import{t as d}from"./CVHQXNzi2.chunk.js";import{t as f}from"./BrbeV-Gn2.chunk.js";import{t as p}from"./BC8PeYqm.chunk.js";import{t as m}from"./CqrjHjAN.chunk.js";import{t as h}from"./eoAypzU3.chunk.js";import{t as g}from"./Kx-r9MXT.chunk.js";import{t as _}from"./CgCqPbjJ.chunk.js";import{t as v}from"./D_gWf2lC.chunk.js";import{t as y}from"./DruDe9vI.chunk.js";import{t as b}from"./7-GJWRH82.chunk.js";import{t as x}from"./dLd5d3X22.chunk.js";import{t as S}from"./C6-aC3vu.chunk.js";import{n as C,t as w}from"./BGhJ8TEx.chunk.js";import{t as T}from"./B3gsVN-_.chunk.js";import{n as E}from"./CpFtf-tI2.chunk.js";import{t as D}from"./DdwKMgn92.chunk.js";import{t as O}from"./9Eq3j62K.chunk.js";import{a as k,c as A,o as j,r as M}from"./DPySWa_g.chunk.js";import{t as N}from"./1pA_p8rV2.chunk.js";import{t as P}from"./j_TnVVKr.chunk.js";import{t as F}from"./C9XBZFiR.chunk.js";import{t as I}from"./DDmUhpUA.chunk.js";import{i as L,n as R,r as z}from"./0O76oUkQ.chunk.js";import{i as B,s as V}from"./B3ox8pZ0.chunk.js";import{n as H}from"./BLdZUAm2.chunk.js";import{t as ee}from"./CXN0_XjU.chunk.js";import{n as U,r as W,t as G}from"./DxCMdeNc2.chunk.js";import{o as K}from"./DUp_s5eM2.chunk.js";import{a as te,c as q,i as ne,n as re,o as ie,s as ae,t as oe}from"./DLGQjoMi2.chunk.js";import{t as se}from"./OuLaT5ha2.chunk.js";import{t as ce}from"./viauQ7-w2.chunk.js";var J=e(i());function Y(e){let{getGatedPermission:r,isLoaded:i}=T();J.useEffect(()=>{i&&r(n.ViewInsights)===`hard-gate`&&t.trigger({application:o.MY_SHARES,action:h.MyShares.HARD_GATE_INSIGHTS,args:[e]})},[i])}function le(e){let[t]=x(g.HIDE_STAFF_RESULTS),n=s(D.shareHeatMap(e)),r=W(e),i=n.data?.map(e=>e.userId).filter(e=>!!e)||[],a=N(i,m.getById);function o(e){return e.userId?a.items?.[e.userId]||{id:e.userId,deleted:!0}:r.items?.[e.sessionId]||{sessionId:e.sessionId}}let c={...r.items,...a.items};return{engagement:n.data?.filter(e=>{let n=c[e.userId||e.sessionId];return n&&n.userType===1&&t?null:e}).filter(e=>!!e),users:n.data?.map(e=>({...o(e),percentage:e.engagementRate})),hasCompleted:n.hasCompleted&&r.hasCompleted&&(!i?.length||a.hasCompleted)}}var X=a(),ue=r.encloseNamespace(`shared.insightsHeatmap`);function Z(e){let[t]=x(_.ANONYMISE_USERS),[r]=x(_.HIDE_STAFF_RESULTS);I();let{hasPermissions:i,getGatedPermission:a}=T(),o=s(y.getShare(e.shareId)),l=O.getClassroomIdFromShare(o.data),p=s(l&&c.getClassroom(l)),h=U(e.shareId),g=s(o.data&&f.getVideoRequest(o.data.objectId,o.data.objectTypeId)),b=s(v.config()),E=s(m.currentUser()),k=s(E.data&&u.yearGroups(E.data.customerId)),A=s(f.isInteractive(g.data)&&P.pendingReviews({interactives:[g.data].map(t=>({interactiveId:t.interactiveId,metadataId:t.id,shareId:e.shareId})),filters:{currentCustomerId:E.data.customerId,currentUserId:E.data.id}})).data?.[0]?.pendingReviewCount>0,j=s(D.shareHeatMapAggregation(e.shareId)),{users:M,engagement:N,hasCompleted:B}=le(e.shareId),V=s(D.shareAggregation(e.shareId,`year_group`)),H=s(o.data?.objectId&&w.createViewKey(o.data.objectId,C.MasterObject));S({title:g.data?ue(`pageTitle`,{video:g.data?.name}):null}),F([o,g]),Y(e.shareId);let W=o.hasCompleted&&g.hasCompleted&&b.hasCompleted&&j.hasCompleted&&V.hasCompleted&&H.hasCompleted&&k.hasCompleted;function G(){return o.data?.objectTypeId===d.Interactive?R(o.data,`heatmap`):z(o.data,`heatmap`)}return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{video:g.data,tabs:G(),hasSchoolAnalytics:i(n.ViewSchoolAnalytics),analyticsWebUrl:b.data?.analyticsWebUrl,share:o.data,yearGroups:k.data,classroom:p.data,markingRequired:A,hasData:!!N?.length,viewInsightsGatedPermission:a(n.ViewInsights)}),(0,X.jsx)(ee,{aggregateEngagement:j.data,individualEngagement:N,yearGroups:V.data,config:b.data,users:M,viewKey:H.data,hasDataLoaded:W,tableDataLoaded:B,anonymiseUsers:t,classroomStudents:h.items,hideStaffResults:r})]})}function de(e,t){return{resultsAppLink:j(e,null,t),questionsAppLink:k(e,null,t),heatmapAppLink:M(e,null,t)}}var fe=r.encloseNamespace(`insights.interactiveInsightsOverviewView`);function pe(e){let[t]=x(g.ANONYMISE_USERS);I();let{hasPermissions:r,getGatedPermission:i}=T(),a=s(v.config()),o=s(m.currentUser()),l=s(o.data&&u.yearGroups(o.data.customerId)),d=s(y.getShare(e.shareId)),f=O.getClassroomIdFromShare(d.data),h=s(f&&c.getClassroom(f)),_=U(e.shareId),b=s(d.data?.objectId&&p.interactiveMetadata(d.data.objectId)),C=s(b.data?.interactiveId&&p.interactive(b.data.interactiveId)),w=G(e.shareId),E=s(D.shareHeatMap(e.shareId)),k=s(D.shareHeatMapAggregation(e.shareId)),A=s(D.shareAggregation(e.shareId,`os_name`));S({title:b.data?fe(`pageTitle`,{video:b.data?.name}):null}),F([d,C,b]),Y(e.shareId);let j=a.hasCompleted&&b.hasCompleted&&C.data&&k.hasCompleted&&E.hasCompleted&&A.hasCompleted&&w.hasCompleted&&l.hasCompleted,M=de(d.data),N=j&&K(C.data,w.data,H),P=N&&N.markingRequired.length>0;return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{video:b.data,tabs:R(d.data,`insights`),hasSchoolAnalytics:r(n.ViewSchoolAnalytics),analyticsWebUrl:a.data?.analyticsWebUrl,share:d.data,yearGroups:l.data,classroom:h.data,markingRequired:P,hasData:!!w.data?.students.length,viewInsightsGatedPermission:i(n.ViewInsights)}),(0,X.jsx)(oe,{aggregateEngagement:k.data,individualEngagement:E.data,interactive:C.data,interactiveMetadata:b.data,interactiveInsightsAppLinks:M,classroomStudents:_.items,results:w.data,osCount:A.data,config:a.data,anonymiseUsers:t,hasDataLoaded:j,share:d.data})]})}var me=r.encloseNamespace(`shared.interactiveInsightsQuestionsView`);function he(e){let[t]=x(g.ANONYMISE_USERS);I();let{hasPermissions:r,getGatedPermission:i}=T(),a=s(m.currentUser()),o=s(v.config()),l=s(a.data&&u.yearGroups(a.data.customerId)),d=s(y.getShare(e.shareId)),f=O.getClassroomIdFromShare(d.data),h=s(f&&c.getClassroom(f)),_=s(d.data?.objectId&&p.interactiveMetadata(d.data?.objectId)),b=s(_.data?.interactiveId&&p.interactive(_.data.interactiveId)),C=G(e.shareId);S({title:_.data?me(`pageTitle`,{video:_.data?.name}):null}),F([d,b,_]),Y(e.shareId);let w=b.data&&_.data&&!!C.data&&!!l.data,E=w&&K(b.data,C.data,H),D=E&&E.markingRequired.length>0;return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{tabs:R(d.data,`questions`),video:_.data,hasSchoolAnalytics:r(n.ViewSchoolAnalytics),analyticsWebUrl:o.data?.analyticsWebUrl,share:d.data,yearGroups:l.data,classroom:h.data,markingRequired:D,hasData:!!C.data?.students.length,viewInsightsGatedPermission:i(n.ViewInsights)}),(0,X.jsx)(se,{interactive:b.data,interactiveMetadata:_.data,interactionId:e.interactionId,config:o.data,sortBy:e.sortBy,isFetching:!C.hasCompleted||b.isFetching,anonymiseUsers:t,results:C.data,hasDataLoaded:w})]})}var ge=r.encloseNamespace(`insights.interactiveInsightsStudents`);function _e(e){let[r]=x(g.ANONYMISE_USERS),[i]=x(g.HIDE_STAFF_RESULTS),{hasPermissions:a,getGatedPermission:l}=T(),d=s(m.currentUser()),f=s(v.config()),_=s(d.data&&u.yearGroups(d.data.customerId)),b=s(y.getShare(e.shareId)),C=O.getClassroomIdFromShare(b.data),w=s(C&&c.getClassroom(C)),E=s(b.data?.objectId&&p.interactiveMetadata(b.data.objectId)),D=s(E.data?.interactiveId&&p.interactive(E.data.interactiveId)),k=G(e.shareId),A=D.data&&E.data&&!!k.data&&!!_.data,j=A&&K(D.data,k.data,H),M=j&&j.markingRequired.length>0;S({title:E.data?ge(`pageTitle`,{video:E.data?.name}):null}),F([b,D,E]),Y(e.shareId);function N(n,r,i){t.trigger({application:o.MY_SHARES,action:h.MyShares.INTERACTIVE_STUDENT_RESULTS,params:{studentId:n.id,shareId:e.shareId,interactionId:i,sessionId:n.sessionId}})}return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{tabs:R(b.data,`results`),video:E.data,hasSchoolAnalytics:a(n.ViewSchoolAnalytics),analyticsWebUrl:f.data?.analyticsWebUrl,share:b.data,yearGroups:_.data,classroom:w.data,markingRequired:M,hasData:!!k.data?.students.length,viewInsightsGatedPermission:l(n.ViewInsights)}),(0,X.jsx)(ce,{interactiveMetadata:E.data,viewStudentResults:N,interactive:D.data,results:k.data,filterBy:e.filterBy,sortBy:e.sortBy,isFetching:k.isFetching,anonymiseUsers:r,hasDataLoaded:A,config:f.data,hideStaffResults:i})]})}var ve=r.encloseNamespace(`shared.insightStudentsNotWatched`);function ye(e){let t=e.students?.filter(t=>!e.watchedIds?.includes(t.id))||[];return(0,X.jsx)(B,{title:ve(`title`),svg:ne,svgClassName:`bg-light-teal text-teal`,children:(0,X.jsx)(q,{students:t,imageCdnUrl:e.imageCdnUrl,imageUrl:e.imageUrl,description:ve(`studentsDisplay`),anonymiseUsers:e.anonymiseUsers})})}var Q=r.encloseNamespace(`shared.insightStudentsWatched`);function be(e){return(0,X.jsx)(B,{title:Q(`title`),svg:ae,svgClassName:`bg-light-indigo text-indigo`,count:e.students.length,children:(0,X.jsx)(q,{students:e.students,imageCdnUrl:e.imageCdnUrl,imageUrl:e.imageUrl,description:Q(`studentsDisplay`),appLink:e.heatmapAppLink,appLinkText:Q(`viewAll`),anonymiseUsers:e.anonymiseUsers})})}var $={partialInsights:`_partialInsights_sk6kv_1`};function xe(){return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`h4 w-25 partial-loading-background`,children:`\xA0`}),(0,X.jsx)(`div`,{className:`row g-3 mb-5`,children:(0,X.jsx)(`div`,{className:`col-12`,children:(0,X.jsx)(`div`,{className:`${$.partialInsights} rounded partial-loading-background`})})}),(0,X.jsx)(`h2`,{className:`h4 w-25 partial-loading-background`,children:`\xA0`}),(0,X.jsxs)(`div`,{className:`row g-3 mb-5`,children:[(0,X.jsx)(`div`,{className:`col-6`,children:(0,X.jsx)(`div`,{className:`${$.partialInsights} rounded partial-loading-background`})}),(0,X.jsx)(`div`,{className:`col-6`,children:(0,X.jsx)(`div`,{className:`${$.partialInsights} rounded partial-loading-background`})})]})]})}var Se=`insights.videoInsightsOverview`;function Ce(e){let t=e.hasDataLoaded&&!!e.viewers?.length;function n(){return e.viewers?Object.values(e.viewers):[]}return(0,X.jsxs)(X.Fragment,{children:[!e.hasDataLoaded&&(0,X.jsx)(xe,{}),e.hasDataLoaded&&(0,X.jsxs)(re,{video:e.video,hasData:t,share:e.share,children:[(0,X.jsxs)(`section`,{className:`mb-5`,children:[(0,X.jsxs)(`h2`,{className:`h4`,children:[(0,X.jsx)(E,{namespace:Se,phrase:`studentViewing`}),(0,X.jsxs)(`span`,{children:[`: `,n().length,e.classroomStudents?`/${e.classroomStudents.length}`:``]})]}),(0,X.jsxs)(`div`,{className:`row g-3`,children:[!!e.classroomStudents?.length&&(0,X.jsx)(`div`,{className:`col-12 col-md`,children:(0,X.jsx)(ye,{students:e.classroomStudents,watchedIds:e.viewers?.map(e=>e.id),imageCdnUrl:e.config.imageCdnUrl,heatmapAppLink:e.videoInsightsAppLinks.heatmapAppLink,imageUrl:b.Insights.AVATAR,anonymiseUsers:e.anonymiseUsers})}),(0,X.jsx)(`div`,{className:`col-12 col-md`,children:(0,X.jsx)(be,{students:n(),imageCdnUrl:e.config.imageCdnUrl,heatmapAppLink:e.videoInsightsAppLinks.heatmapAppLink,imageUrl:b.Insights.AVATAR,anonymiseUsers:e.anonymiseUsers})})]})]}),(0,X.jsxs)(`section`,{className:`mb-5`,children:[(0,X.jsx)(`h2`,{className:`h4`,children:(0,X.jsx)(E,{namespace:Se,phrase:e.hasClassrooms?`classEngagement`:`engagement`})}),(0,X.jsxs)(`div`,{className:`row g-3`,children:[(0,X.jsx)(`div`,{className:`col-12 col-md-6`,children:(0,X.jsx)(ie,{osCount:e.osCount})}),(0,X.jsx)(`div`,{className:`col-12 col-md-6`,children:(0,X.jsx)(te,{engagement:e.aggregateEngagement,heatmapAppLink:e.videoInsightsAppLinks.heatmapAppLink,engagementRate:V(e.individualEngagement)})})]})]})]})]})}function we(e,t){return{heatmapAppLink:M(e,null,t)}}var Te=r.encloseNamespace(`insights.videoInsightsOverviewView`);function Ee(e){let[t]=x(g.ANONYMISE_USERS);I();let{hasClassrooms:r}=l(null),{hasPermissions:i,getGatedPermission:a}=T(),o=s(v.config()),d=s(m.currentUser()),p=s(d.data&&u.yearGroups(d.data.customerId)),h=s(y.getShare(e.shareId)),_=O.getClassroomIdFromShare(h.data),b=s(_&&c.getClassroom(_)),C=U(e.shareId),w=s(h.data&&f.getVideoRequest(h.data.objectId,h.data.objectTypeId));S({title:w.data?Te(`pageTitle`,{video:w.data?.name}):null}),F([h,w]),Y(e.shareId);let E=s(D.shareHeatMap(e.shareId)),k=s(D.shareHeatMapAggregation(e.shareId)),A=s(D.shareAggregation(e.shareId,`os_name`)),{users:j,hasCompleted:M}=le(e.shareId),N=o.hasCompleted&&w.hasCompleted&&E.hasCompleted&&k.hasCompleted&&A.hasCompleted&&p.data&&M,P=we(h.data);return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{video:w.data,classroom:b.data,tabs:z(h.data,`insights`),hasSchoolAnalytics:i(n.ViewSchoolAnalytics),analyticsWebUrl:o.data?.analyticsWebUrl,share:h.data,yearGroups:p.data,hasData:N&&!!j?.length,viewInsightsGatedPermission:a(n.ViewInsights)}),(0,X.jsx)(Ce,{hasDataLoaded:!!N,hasClassrooms:r,anonymiseUsers:t,videoInsightsAppLinks:P,config:o.data,video:w.data,classroomStudents:C.items,viewers:j,individualEngagement:E.data,aggregateEngagement:k.data,share:h.data,osCount:A.data})]})}var De={[d.Video]:{insights:e=>(0,X.jsx)(Ee,{shareId:e.share.shareId}),heatmap:e=>(0,X.jsx)(Z,{shareId:e.share.shareId})},[d.Clip]:{insights:e=>(0,X.jsx)(Ee,{shareId:e.share.shareId}),heatmap:e=>(0,X.jsx)(Z,{shareId:e.share.shareId})},[d.Interactive]:{insights:e=>(0,X.jsx)(pe,{shareId:e.share.shareId}),heatmap:e=>(0,X.jsx)(Z,{shareId:e.share.shareId}),questions:e=>(0,X.jsx)(he,{interactionId:e.interactionId,sortBy:e.sortBy,shareId:e.share.shareId}),results:e=>(0,X.jsx)(_e,{filterBy:e.filterBy,sortBy:e.sortBy,shareId:e.share.shareId})}};function Oe(e){let{share:t,tab:n}=e,r=De[t?.objectTypeId]?.[n];return r?r(e):(0,X.jsx)(X.Fragment,{})}function ke(e){let r=s(y.getShare(e.shareId)),{hasPermissions:i,isLoaded:a}=T(),c=Oe({share:r.data,tab:e.tab,interactionId:e.interactionId,sortBy:e.sortBy,filterBy:e.filterBy});return J.useEffect(()=>{if(!e.showShareOptions||!r.data)return;let n=A(r.data);n&&t.trigger(n)},[r.data,e.showShareOptions]),J.useEffect(()=>{a&&(i([n.ViewInsights,n.ViewAnalytics])||t.trigger({application:o.MY_SHARES,action:h.MyShares.HOME}))},[a]),a?(0,X.jsx)(X.Fragment,{children:c}):(0,X.jsx)(X.Fragment,{})}export{ke as BaseInsightsView};
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{y as t}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{n}from"./B785hxeE.chunk.js";import{t as r}from"./CQyJ7YGa.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./BXTI9cmX.chunk.js";import{u as s}from"./BX0wDJmp.chunk.js";import{t as c}from"./e1lz2ERJ2.chunk.js";import{t as l}from"./DGmmTRu72.chunk.js";import{t as u}from"./xwiwWcv12.chunk.js";import{t as d}from"./CVHQXNzi2.chunk.js";import{t as f}from"./BrbeV-Gn2.chunk.js";import{t as p}from"./BC8PeYqm.chunk.js";import{t as m}from"./CqrjHjAN.chunk.js";import{t as h}from"./eoAypzU3.chunk.js";import{t as g}from"./Kx-r9MXT.chunk.js";import{t as _}from"./CgCqPbjJ.chunk.js";import{t as v}from"./D_gWf2lC.chunk.js";import{t as y}from"./DruDe9vI.chunk.js";import{t as b}from"./7-GJWRH82.chunk.js";import{t as x}from"./dLd5d3X22.chunk.js";import{t as S}from"./C6-aC3vu.chunk.js";import{n as C,t as w}from"./BGhJ8TEx.chunk.js";import{t as T}from"./B3gsVN-_.chunk.js";import{n as E}from"./CpFtf-tI2.chunk.js";import{t as D}from"./DdwKMgn92.chunk.js";import{t as O}from"./9Eq3j62K.chunk.js";import{a as k,c as A,o as j,r as M}from"./DPySWa_g.chunk.js";import{t as N}from"./1pA_p8rV2.chunk.js";import{t as P}from"./j_TnVVKr.chunk.js";import{t as F}from"./C9XBZFiR.chunk.js";import{t as I}from"./DDmUhpUA.chunk.js";import{i as L,n as R,r as z}from"./0O76oUkQ.chunk.js";import{i as B,s as V}from"./B3ox8pZ0.chunk.js";import{n as H}from"./BLdZUAm2.chunk.js";import{t as ee}from"./-KvTbeQV.chunk.js";import{n as U,r as W,t as G}from"./DxCMdeNc2.chunk.js";import{o as K}from"./DUp_s5eM2.chunk.js";import{a as te,c as q,i as ne,n as re,o as ie,s as ae,t as oe}from"./DLGQjoMi2.chunk.js";import{t as se}from"./OuLaT5ha2.chunk.js";import{t as ce}from"./viauQ7-w2.chunk.js";var J=e(i());function Y(e){let{getGatedPermission:r,isLoaded:i}=T();J.useEffect(()=>{i&&r(n.ViewInsights)===`hard-gate`&&t.trigger({application:o.MY_SHARES,action:h.MyShares.HARD_GATE_INSIGHTS,args:[e]})},[i])}function le(e){let[t]=x(g.HIDE_STAFF_RESULTS),n=s(D.shareHeatMap(e)),r=W(e),i=n.data?.map(e=>e.userId).filter(e=>!!e)||[],a=N(i,m.getById);function o(e){return e.userId?a.items?.[e.userId]||{id:e.userId,deleted:!0}:r.items?.[e.sessionId]||{sessionId:e.sessionId}}let c={...r.items,...a.items};return{engagement:n.data?.filter(e=>{let n=c[e.userId||e.sessionId];return n&&n.userType===1&&t?null:e}).filter(e=>!!e),users:n.data?.map(e=>({...o(e),percentage:e.engagementRate})),hasCompleted:n.hasCompleted&&r.hasCompleted&&(!i?.length||a.hasCompleted)}}var X=a(),ue=r.encloseNamespace(`shared.insightsHeatmap`);function Z(e){let[t]=x(_.ANONYMISE_USERS),[r]=x(_.HIDE_STAFF_RESULTS);I();let{hasPermissions:i,getGatedPermission:a}=T(),o=s(y.getShare(e.shareId)),l=O.getClassroomIdFromShare(o.data),p=s(l&&c.getClassroom(l)),h=U(e.shareId),g=s(o.data&&f.getVideoRequest(o.data.objectId,o.data.objectTypeId)),b=s(v.config()),E=s(m.currentUser()),k=s(E.data&&u.yearGroups(E.data.customerId)),A=s(f.isInteractive(g.data)&&P.pendingReviews({interactives:[g.data].map(t=>({interactiveId:t.interactiveId,metadataId:t.id,shareId:e.shareId})),filters:{currentCustomerId:E.data.customerId,currentUserId:E.data.id}})).data?.[0]?.pendingReviewCount>0,j=s(D.shareHeatMapAggregation(e.shareId)),{users:M,engagement:N,hasCompleted:B}=le(e.shareId),V=s(D.shareAggregation(e.shareId,`year_group`)),H=s(o.data?.objectId&&w.createViewKey(o.data.objectId,C.MasterObject));S({title:g.data?ue(`pageTitle`,{video:g.data?.name}):null}),F([o,g]),Y(e.shareId);let W=o.hasCompleted&&g.hasCompleted&&b.hasCompleted&&j.hasCompleted&&V.hasCompleted&&H.hasCompleted&&k.hasCompleted;function G(){return o.data?.objectTypeId===d.Interactive?R(o.data,`heatmap`):z(o.data,`heatmap`)}return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{video:g.data,tabs:G(),hasSchoolAnalytics:i(n.ViewSchoolAnalytics),analyticsWebUrl:b.data?.analyticsWebUrl,share:o.data,yearGroups:k.data,classroom:p.data,markingRequired:A,hasData:!!N?.length,viewInsightsGatedPermission:a(n.ViewInsights)}),(0,X.jsx)(ee,{aggregateEngagement:j.data,individualEngagement:N,yearGroups:V.data,config:b.data,users:M,viewKey:H.data,hasDataLoaded:W,tableDataLoaded:B,anonymiseUsers:t,classroomStudents:h.items,hideStaffResults:r})]})}function de(e,t){return{resultsAppLink:j(e,null,t),questionsAppLink:k(e,null,t),heatmapAppLink:M(e,null,t)}}var fe=r.encloseNamespace(`insights.interactiveInsightsOverviewView`);function pe(e){let[t]=x(g.ANONYMISE_USERS);I();let{hasPermissions:r,getGatedPermission:i}=T(),a=s(v.config()),o=s(m.currentUser()),l=s(o.data&&u.yearGroups(o.data.customerId)),d=s(y.getShare(e.shareId)),f=O.getClassroomIdFromShare(d.data),h=s(f&&c.getClassroom(f)),_=U(e.shareId),b=s(d.data?.objectId&&p.interactiveMetadata(d.data.objectId)),C=s(b.data?.interactiveId&&p.interactive(b.data.interactiveId)),w=G(e.shareId),E=s(D.shareHeatMap(e.shareId)),k=s(D.shareHeatMapAggregation(e.shareId)),A=s(D.shareAggregation(e.shareId,`os_name`));S({title:b.data?fe(`pageTitle`,{video:b.data?.name}):null}),F([d,C,b]),Y(e.shareId);let j=a.hasCompleted&&b.hasCompleted&&C.data&&k.hasCompleted&&E.hasCompleted&&A.hasCompleted&&w.hasCompleted&&l.hasCompleted,M=de(d.data),N=j&&K(C.data,w.data,H),P=N&&N.markingRequired.length>0;return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{video:b.data,tabs:R(d.data,`insights`),hasSchoolAnalytics:r(n.ViewSchoolAnalytics),analyticsWebUrl:a.data?.analyticsWebUrl,share:d.data,yearGroups:l.data,classroom:h.data,markingRequired:P,hasData:!!w.data?.students.length,viewInsightsGatedPermission:i(n.ViewInsights)}),(0,X.jsx)(oe,{aggregateEngagement:k.data,individualEngagement:E.data,interactive:C.data,interactiveMetadata:b.data,interactiveInsightsAppLinks:M,classroomStudents:_.items,results:w.data,osCount:A.data,config:a.data,anonymiseUsers:t,hasDataLoaded:j,share:d.data})]})}var me=r.encloseNamespace(`shared.interactiveInsightsQuestionsView`);function he(e){let[t]=x(g.ANONYMISE_USERS);I();let{hasPermissions:r,getGatedPermission:i}=T(),a=s(m.currentUser()),o=s(v.config()),l=s(a.data&&u.yearGroups(a.data.customerId)),d=s(y.getShare(e.shareId)),f=O.getClassroomIdFromShare(d.data),h=s(f&&c.getClassroom(f)),_=s(d.data?.objectId&&p.interactiveMetadata(d.data?.objectId)),b=s(_.data?.interactiveId&&p.interactive(_.data.interactiveId)),C=G(e.shareId);S({title:_.data?me(`pageTitle`,{video:_.data?.name}):null}),F([d,b,_]),Y(e.shareId);let w=b.data&&_.data&&!!C.data&&!!l.data,E=w&&K(b.data,C.data,H),D=E&&E.markingRequired.length>0;return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{tabs:R(d.data,`questions`),video:_.data,hasSchoolAnalytics:r(n.ViewSchoolAnalytics),analyticsWebUrl:o.data?.analyticsWebUrl,share:d.data,yearGroups:l.data,classroom:h.data,markingRequired:D,hasData:!!C.data?.students.length,viewInsightsGatedPermission:i(n.ViewInsights)}),(0,X.jsx)(se,{interactive:b.data,interactiveMetadata:_.data,interactionId:e.interactionId,config:o.data,sortBy:e.sortBy,isFetching:!C.hasCompleted||b.isFetching,anonymiseUsers:t,results:C.data,hasDataLoaded:w})]})}var ge=r.encloseNamespace(`insights.interactiveInsightsStudents`);function _e(e){let[r]=x(g.ANONYMISE_USERS),[i]=x(g.HIDE_STAFF_RESULTS),{hasPermissions:a,getGatedPermission:l}=T(),d=s(m.currentUser()),f=s(v.config()),_=s(d.data&&u.yearGroups(d.data.customerId)),b=s(y.getShare(e.shareId)),C=O.getClassroomIdFromShare(b.data),w=s(C&&c.getClassroom(C)),E=s(b.data?.objectId&&p.interactiveMetadata(b.data.objectId)),D=s(E.data?.interactiveId&&p.interactive(E.data.interactiveId)),k=G(e.shareId),A=D.data&&E.data&&!!k.data&&!!_.data,j=A&&K(D.data,k.data,H),M=j&&j.markingRequired.length>0;S({title:E.data?ge(`pageTitle`,{video:E.data?.name}):null}),F([b,D,E]),Y(e.shareId);function N(n,r,i){t.trigger({application:o.MY_SHARES,action:h.MyShares.INTERACTIVE_STUDENT_RESULTS,params:{studentId:n.id,shareId:e.shareId,interactionId:i,sessionId:n.sessionId}})}return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{tabs:R(b.data,`results`),video:E.data,hasSchoolAnalytics:a(n.ViewSchoolAnalytics),analyticsWebUrl:f.data?.analyticsWebUrl,share:b.data,yearGroups:_.data,classroom:w.data,markingRequired:M,hasData:!!k.data?.students.length,viewInsightsGatedPermission:l(n.ViewInsights)}),(0,X.jsx)(ce,{interactiveMetadata:E.data,viewStudentResults:N,interactive:D.data,results:k.data,filterBy:e.filterBy,sortBy:e.sortBy,isFetching:k.isFetching,anonymiseUsers:r,hasDataLoaded:A,config:f.data,hideStaffResults:i})]})}var ve=r.encloseNamespace(`shared.insightStudentsNotWatched`);function ye(e){let t=e.students?.filter(t=>!e.watchedIds?.includes(t.id))||[];return(0,X.jsx)(B,{title:ve(`title`),svg:ne,svgClassName:`bg-light-teal text-teal`,children:(0,X.jsx)(q,{students:t,imageCdnUrl:e.imageCdnUrl,imageUrl:e.imageUrl,description:ve(`studentsDisplay`),anonymiseUsers:e.anonymiseUsers})})}var Q=r.encloseNamespace(`shared.insightStudentsWatched`);function be(e){return(0,X.jsx)(B,{title:Q(`title`),svg:ae,svgClassName:`bg-light-indigo text-indigo`,count:e.students.length,children:(0,X.jsx)(q,{students:e.students,imageCdnUrl:e.imageCdnUrl,imageUrl:e.imageUrl,description:Q(`studentsDisplay`),appLink:e.heatmapAppLink,appLinkText:Q(`viewAll`),anonymiseUsers:e.anonymiseUsers})})}var $={partialInsights:`_partialInsights_sk6kv_1`};function xe(){return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`h4 w-25 partial-loading-background`,children:`\xA0`}),(0,X.jsx)(`div`,{className:`row g-3 mb-5`,children:(0,X.jsx)(`div`,{className:`col-12`,children:(0,X.jsx)(`div`,{className:`${$.partialInsights} rounded partial-loading-background`})})}),(0,X.jsx)(`h2`,{className:`h4 w-25 partial-loading-background`,children:`\xA0`}),(0,X.jsxs)(`div`,{className:`row g-3 mb-5`,children:[(0,X.jsx)(`div`,{className:`col-6`,children:(0,X.jsx)(`div`,{className:`${$.partialInsights} rounded partial-loading-background`})}),(0,X.jsx)(`div`,{className:`col-6`,children:(0,X.jsx)(`div`,{className:`${$.partialInsights} rounded partial-loading-background`})})]})]})}var Se=`insights.videoInsightsOverview`;function Ce(e){let t=e.hasDataLoaded&&!!e.viewers?.length;function n(){return e.viewers?Object.values(e.viewers):[]}return(0,X.jsxs)(X.Fragment,{children:[!e.hasDataLoaded&&(0,X.jsx)(xe,{}),e.hasDataLoaded&&(0,X.jsxs)(re,{video:e.video,hasData:t,share:e.share,children:[(0,X.jsxs)(`section`,{className:`mb-5`,children:[(0,X.jsxs)(`h2`,{className:`h4`,children:[(0,X.jsx)(E,{namespace:Se,phrase:`studentViewing`}),(0,X.jsxs)(`span`,{children:[`: `,n().length,e.classroomStudents?`/${e.classroomStudents.length}`:``]})]}),(0,X.jsxs)(`div`,{className:`row g-3`,children:[!!e.classroomStudents?.length&&(0,X.jsx)(`div`,{className:`col-12 col-md`,children:(0,X.jsx)(ye,{students:e.classroomStudents,watchedIds:e.viewers?.map(e=>e.id),imageCdnUrl:e.config.imageCdnUrl,heatmapAppLink:e.videoInsightsAppLinks.heatmapAppLink,imageUrl:b.Insights.AVATAR,anonymiseUsers:e.anonymiseUsers})}),(0,X.jsx)(`div`,{className:`col-12 col-md`,children:(0,X.jsx)(be,{students:n(),imageCdnUrl:e.config.imageCdnUrl,heatmapAppLink:e.videoInsightsAppLinks.heatmapAppLink,imageUrl:b.Insights.AVATAR,anonymiseUsers:e.anonymiseUsers})})]})]}),(0,X.jsxs)(`section`,{className:`mb-5`,children:[(0,X.jsx)(`h2`,{className:`h4`,children:(0,X.jsx)(E,{namespace:Se,phrase:e.hasClassrooms?`classEngagement`:`engagement`})}),(0,X.jsxs)(`div`,{className:`row g-3`,children:[(0,X.jsx)(`div`,{className:`col-12 col-md-6`,children:(0,X.jsx)(ie,{osCount:e.osCount})}),(0,X.jsx)(`div`,{className:`col-12 col-md-6`,children:(0,X.jsx)(te,{engagement:e.aggregateEngagement,heatmapAppLink:e.videoInsightsAppLinks.heatmapAppLink,engagementRate:V(e.individualEngagement)})})]})]})]})]})}function we(e,t){return{heatmapAppLink:M(e,null,t)}}var Te=r.encloseNamespace(`insights.videoInsightsOverviewView`);function Ee(e){let[t]=x(g.ANONYMISE_USERS);I();let{hasClassrooms:r}=l(null),{hasPermissions:i,getGatedPermission:a}=T(),o=s(v.config()),d=s(m.currentUser()),p=s(d.data&&u.yearGroups(d.data.customerId)),h=s(y.getShare(e.shareId)),_=O.getClassroomIdFromShare(h.data),b=s(_&&c.getClassroom(_)),C=U(e.shareId),w=s(h.data&&f.getVideoRequest(h.data.objectId,h.data.objectTypeId));S({title:w.data?Te(`pageTitle`,{video:w.data?.name}):null}),F([h,w]),Y(e.shareId);let E=s(D.shareHeatMap(e.shareId)),k=s(D.shareHeatMapAggregation(e.shareId)),A=s(D.shareAggregation(e.shareId,`os_name`)),{users:j,hasCompleted:M}=le(e.shareId),N=o.hasCompleted&&w.hasCompleted&&E.hasCompleted&&k.hasCompleted&&A.hasCompleted&&p.data&&M,P=we(h.data);return(0,X.jsxs)(`div`,{className:`px-3`,children:[(0,X.jsx)(L,{video:w.data,classroom:b.data,tabs:z(h.data,`insights`),hasSchoolAnalytics:i(n.ViewSchoolAnalytics),analyticsWebUrl:o.data?.analyticsWebUrl,share:h.data,yearGroups:p.data,hasData:N&&!!j?.length,viewInsightsGatedPermission:a(n.ViewInsights)}),(0,X.jsx)(Ce,{hasDataLoaded:!!N,hasClassrooms:r,anonymiseUsers:t,videoInsightsAppLinks:P,config:o.data,video:w.data,classroomStudents:C.items,viewers:j,individualEngagement:E.data,aggregateEngagement:k.data,share:h.data,osCount:A.data})]})}var De={[d.Video]:{insights:e=>(0,X.jsx)(Ee,{shareId:e.share.shareId}),heatmap:e=>(0,X.jsx)(Z,{shareId:e.share.shareId})},[d.Clip]:{insights:e=>(0,X.jsx)(Ee,{shareId:e.share.shareId}),heatmap:e=>(0,X.jsx)(Z,{shareId:e.share.shareId})},[d.Interactive]:{insights:e=>(0,X.jsx)(pe,{shareId:e.share.shareId}),heatmap:e=>(0,X.jsx)(Z,{shareId:e.share.shareId}),questions:e=>(0,X.jsx)(he,{interactionId:e.interactionId,sortBy:e.sortBy,shareId:e.share.shareId}),results:e=>(0,X.jsx)(_e,{filterBy:e.filterBy,sortBy:e.sortBy,shareId:e.share.shareId})}};function Oe(e){let{share:t,tab:n}=e,r=De[t?.objectTypeId]?.[n];return r?r(e):(0,X.jsx)(X.Fragment,{})}function ke(e){let r=s(y.getShare(e.shareId)),{hasPermissions:i,isLoaded:a}=T(),c=Oe({share:r.data,tab:e.tab,interactionId:e.interactionId,sortBy:e.sortBy,filterBy:e.filterBy});return J.useEffect(()=>{if(!e.showShareOptions||!r.data)return;let n=A(r.data);n&&t.trigger(n)},[r.data,e.showShareOptions]),J.useEffect(()=>{a&&(i([n.ViewInsights,n.ViewAnalytics])||t.trigger({application:o.MY_SHARES,action:h.MyShares.HOME}))},[a]),a?(0,X.jsx)(X.Fragment,{children:c}):(0,X.jsx)(X.Fragment,{})}export{ke as BaseInsightsView};
|
|
2
|
+
//# sourceMappingURL=CfNYFxJl2.chunk.js.map
|