@clickview/lite 0.34.3 → 0.34.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickview/lite",
3
- "version": "0.34.3",
3
+ "version": "0.34.4",
4
4
  "description": "ClickView Lite",
5
5
  "main": "dist/scripts/bundle.js",
6
6
  "types": "dist/projects/lite/src/index.d.ts",
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3042],{91053:(e,t,r)=>{r.d(t,{B:()=>i});var n=r(32735),a=2;function i(e){var t;return(null===(t=e.availableCurriculums)||void 0===t?void 0:t.length)<a||!e.selectedCurriculum?n.createElement(n.Fragment,null):n.createElement("select",{className:"mb-3 form-select ".concat(e.className),onChange:e.onChangeCurriculum,value:e.selectedCurriculum.id},e.availableCurriculums.map((function(e){return n.createElement("option",{key:e.id,id:e.id,value:e.id},e.name)})))}},3042:(e,t,r)=>{r.d(t,{j:()=>ne});var n=r(32735),a=r(23481),i=r(28400),c=r(65858),l=r(42029),o=r(83345),u=r(49439);const s={copyrightDisclaimer:"z8YoI",overlayContainer:"eJDbJ"};function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var m="shared.copyrightDisclaimer",p=150;function v(e){var t,r,a,i=(r=(0,u.L)({}),a=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,c,l=[],o=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;o=!1}else for(;!(o=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);o=!0);}catch(e){u=!0,a=e}finally{try{if(!o&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw a}}return l}}(r,a)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(r,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=i[0],v=i[1];return n.createElement("div",{ref:c,className:e.className},n.createElement("p",{className:"".concat(s.copyrightDisclaimer," mb-1")},n.createElement(o.x,{namespace:m,phrase:"copyrightDisclaimer"})),n.createElement(l.Z,{target:c.current,show:v,placement:e.overflowPlacement&&document.documentElement.clientHeight-(null===(t=c.current)||void 0===t?void 0:t.getBoundingClientRect().bottom)<p?e.overflowPlacement:e.placement},n.createElement("div",{className:"".concat(s.overlayContainer," mw-100 bg-white border rounded-3 p-2")},n.createElement("p",null,n.createElement(o.x,{namespace:m,phrase:"warning"})),n.createElement("p",{className:"fw-semibold mb-0"},n.createElement(o.x,{namespace:m,phrase:"sharing"})))))}var f=r(98495),y=r(75896),g=r(69883),h=r(44599),C=r(91053),b=r(45261),E=r(22161);function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,c,l=[],o=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;o=!1}else for(;!(o=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);o=!0);}catch(e){u=!0,a=e}finally{try{if(!o&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var w="shared.curriculumLinks",k=a.T.encloseNamespace(w);function S(e){var t=e.curriculums,r=t.hasLoaded,a=t.activeCurriculum,i=t.availableCurriculums,c=t.curriculumLinks,l=t.updateCurriculum,u=I(n.useState(!r),2),s=u[0],d=u[1],m=I(n.useState(),2),p=m[0],v=m[1],A=(0,g.Z)();n.useEffect((function(){r&&(p||v(null!=a?a:y.m.first(i)),d(!1))}),[null==a?void 0:a.id,r]);var S="function"==typeof e.onClickClose;return n.createElement("div",{className:"rounded border mb-3 position-relative"},n.createElement(f.ZP,{autoHeight:!0,autoHeightMax:e.height},n.createElement("div",{className:"p-3"},n.createElement("h2",{className:"h6 me-2 h-100"},n.createElement(o.x,{namespace:w,phrase:"heading"})),n.createElement(C.B,{availableCurriculums:i,onChangeCurriculum:function(e){var t,r,n=e.target.value,a=i.find((function(e){return e.id.toString()===n}));(null==a?void 0:a.id)&&(null===(t=null==p?void 0:p.id)||void 0===t?void 0:t.toString())!==(null===(r=null==a?void 0:a.id)||void 0===r?void 0:r.toString())&&(v(a),d(!0),l(a,null,(function(){v(p),d(!1),A.error(k("updateFailed"))})))},selectedCurriculum:p,className:E.Z.dropdown}),s?n.createElement(h.Z,null):n.createElement(b.h,{curriculumLinks:c,emptyStateUrl:e.emptyStateUrl}))),S&&n.createElement("button",{type:"button",className:"btn-close ".concat(E.Z.closeButton),"aria-label":"Close",onClick:e.onClickClose}))}var L=r(19670),N=r(32614),T=r(11518),U=r(15446),x=r(47862),R=r(26733),O=r(71063),j=r(10439),V=r(35429),P=r(4594),M=r(16714),_=r(58704),D=r(22902),G=r(13375),B=r(67753),F=r(31908),W=r(57654),Z=r(47938),H=r(81024),z=r(78166),Y=r(99719),$=r(42571),J=r(99742),K=r(14070),q=r(97291),Q=r(90102),X=r(99092);function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var te="shared.playPage",re=a.T.encloseNamespace(te);function ne(e){var t,r,a,l,u,s,d,m,p=(0,V.g)(),f=(0,D.T)().hasPermissions,y=F.M.getCanBeConsumed(e.video).canConsume,g=e.imageCdnUrl,h=n.useRef(!1),C=(0,N.Wp)(e.video,e.glanceTheme)&&e.featureAccess.canViewGlance,b=(d=n.useState({view:"loading",referrer:null}),m=2,function(e){if(Array.isArray(e))return e}(d)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,c,l=[],o=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;o=!1}else for(;!(o=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);o=!0);}catch(e){u=!0,a=e}finally{try{if(!o&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw a}}return l}}(d,m)||function(e,t){if(e){if("string"==typeof e)return ee(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ee(e,t):void 0}}(d,m)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),E=b[0],I=b[1];n.useEffect((function(){e.glanceLoaded&&I({view:e.glanceTheme?"v@g":"details",referrer:null})}),[e.glanceLoaded,e.glanceTheme]);var A=(0,X.lU)(),w=(0,X.jh)(e.video,f(M.C.StudentExperience)),k="picture-in-picture"===p.mode||e.featureAccess.canViewPublicLayout,ne=!(!e.featureAccess.canViewCurriculumLinks||!e.curriculums.customerHasCurriculumLinks);return n.createElement(o.D.Provider,{value:te},n.createElement(Z.W,{restrictions:e.video._restrictions,yearGroups:e.yearGroups,objectId:e.video.id,objectTypeId:P.E.Video,canManageVideoAccess:e.canManageVideoAccess}),n.createElement("section",{className:"mb-2 ".concat(O.M.GLOBAL_PLAYER_SELECTOR)},y&&n.createElement(j.r,{key:e.video.id,objectId:e.video.id,objectTypeId:e.video.typeId,shareId:e.shareId,context:null===(t=e.params)||void 0===t?void 0:t.context,contextId:null===(r=e.params)||void 0===r?void 0:r.contextId,playNext:null===(a=e.params)||void 0===a?void 0:a.playNext,moviesAndTv:null===(l=e.params)||void 0===l?void 0:l.mtv,startTime:null===(u=e.params)||void 0===u?void 0:u.t,mode:"default",location:"play-page"}),n.createElement("div",{className:k?"":"d-none"},n.createElement(H.S,{video:e.video,appLink:{application:q.O.SIGN_UP,action:K.e.SignUp.SIGN_UP},type:"picture-in-picture"===p.mode?"pip":"public"}))),n.createElement(W.v,{media:e.video,yearGroups:e.yearGroups,audiences:e.audiences,getSeriesAppLink:function(t){return A.getSeriesAppLink(t,e.params.mtv)},hasResources:!!(null==w?void 0:w.length),featureAccess:e.featureAccess}),n.createElement("section",{className:"".concat("v@g"===E.view?"d-block":"d-none")},n.createElement(L.o,{theme:e.glanceTheme,video:e.video,pointsOfInterest:e.pointsOfInterest,onClickShowDescription:function(){return I({view:"details",referrer:"v@g"})},onClickShowCurriculumLinks:ne&&function(){return I({view:"curriculumLinks",referrer:"v@g"})},setStartTime:function(e){var t;return null===(t=p.playerRef.current)||void 0===t?void 0:t.currentTime(e)},getTagAppLink:A.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout})),n.createElement("section",{className:"".concat("details"===E.view?"d-block":"d-none")},n.createElement(Y.X,{video:e.video,onLaunchImmersiveReader:function(){var e,t,r,n;h.current=!(null===(t=null===(e=null==p?void 0:p.playerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.isPaused()),null===(n=null===(r=null==p?void 0:p.playerRef)||void 0===r?void 0:r.current)||void 0===n||n.pause()},onExitImmersiveReader:function(){var e,t;h.current&&(null===(t=null===(e=null==p?void 0:p.playerRef)||void 0===e?void 0:e.current)||void 0===t||t.play())},onClickClose:C&&function(){return I({view:"v@g",referrer:"details"})},onClickShowCurriculumLinks:ne&&function(){return I({view:"curriculumLinks",referrer:"details"})},getTagAppLink:A.getTagAppLink,suppressInteractivity:e.featureAccess.canViewPublicLayout})),n.createElement("section",{className:"".concat("curriculumLinks"===E.view?"d-block":"d-none")},n.createElement(S,{height:Q.x,curriculums:e.curriculums,onClickClose:function(){return I({view:E.referrer,referrer:"curriculumLinks"})},emptyStateUrl:J.W.EmptyStates.CURRICULUM_LINKS})),n.createElement("section",{className:"".concat("loading"===E.view?"d-block":"d-none")},n.createElement($.H,null)),F.M.isBroadcast(e.video)&&n.createElement(v,{placement:"bottom-end",className:"d-flex justify-content-end mt-n2"}),!!(null==w?void 0:w.length)&&n.createElement("section",{className:"pb-3"},n.createElement(T.kM,{name:re("resources",{count:w.length}),contents:_.z.Resources,collection:w,prefetched:!0,childComponent:R.R,extraChildComponentProps:{imageCdnUrl:g,imageErrorFallbackUrl:J.W.Fallbacks.RESOURCE_THUMBNAIL,actionBehaviour:e.featureAccess.canViewResourceItems?"normal":"public"},getChildAppLink:A.getResourceAppLink(null===(s=e.video)||void 0===s?void 0:s.id,e.shareId,e.featureAccess.canViewResourceItems),analyticsOptions:e.featureAccess.canViewResourceItems?{}:{workflowPhase:c.eu.Start,descriptor:c.Yu.SignUp},analyticsData:{widgetId:"resources"}})),e.featureAccess.canViewInteractives&&!G.U.isEmpty(e.video.interactives)&&n.createElement("section",{className:"pb-3"},n.createElement(T.kM,{name:re("interactives",{count:G.U.length(e.video.interactives)}),contents:_.z.Interactives,collection:e.video.interactives.data,prefetched:!0,getChildAppLink:function(e){return{application:q.O.INTERACTIVES,action:K.e.Interactives.VIEW_INTERACTIVE,args:[e.id,i.m.slugify(e.name)]}},childComponent:x.K,extraChildComponentProps:{video:e.video,questionsAppLink:{application:q.O.INTERACTIVES,action:K.e.Interactives.PREVIEW_QUESTIONS},imageCdnUrl:e.imageCdnUrl},analyticsData:{widgetId:"interactives"}})),e.featureAccess.canViewClips&&!G.U.isEmpty(e.video.clips)&&n.createElement("section",{className:"pb-3"},n.createElement(T.kM,{name:re("clips",{count:G.U.length(e.video.clips)}),contents:_.z.Clips,collection:e.video.clips.data,prefetched:!0,getChildAppLink:function(e){return{application:q.O.CLIPS,action:K.e.Clips.PLAY_CLIP,args:[e.id,i.m.slugify(e.name)]}},childComponent:U.C,extraChildComponentProps:{video:e.video,imageCdnUrl:e.imageCdnUrl},analyticsData:{widgetId:"clips"}})),n.createElement("section",null,n.createElement(z.Z,{currentVideo:e.video,yearGroups:e.yearGroups,relatedVideos:e.relatedVideos,currentUser:e.currentUser,setFavourite:e.setFavourite,canFavourite:e.canFavourite,getVideoAppLink:function(t){return B.W.getAppLink(t,{context:e.params.context,contextId:e.params.contextId,playNext:e.params.playNext,shareId:e.shareId,moviesAndTv:e.params.mtv})},audiences:e.audiences,moviesAndTv:e.params.mtv})))}}}]);