@openveo/portal
Version:
OpenVeo Portal gives access to medias exposed by OpenVeo server associated to an OpenVeo Publish plugin
1 lines • 32.5 kB
JavaScript
module("opa.i18n",[]),function(){function e(r,s){return function(e,t,o){if(e){var a=(e=e.toUpperCase()).split("."),n=e,i=s;t=parseInt(t);for(var l=0;l<a.length;l++)i[a[l]]&&(i=i[a[l]]);return n="string"==typeof(i="object"==typeof i&&!isNaN(t)&&"SINGLE"in i&&"PLURAL"in i?1<t?i.PLURAL:i.SINGLE:i)?i:e,o&&(e=new RegExp(Object.keys(o).join("|"),"gi"),n=n.replace(e,function(e){return o[e]})),r.trustAsHtml(n)}return null}}angular.module("opa.i18n").filter("opaTranslate",e),e.$inject=["$sce","opaTranslations"]}(),function(e){var t=e.module("opa",["ngRoute","ngAnimate","ngMaterial","ngAria","ngCookies","ngMessages","opa.i18n","opa.locale"]);t.constant("opaWebServiceBasePath","/ws/"),t.config(["$routeProvider","$locationProvider","$logProvider","$httpProvider","$mdThemingProvider",function(e,t,o,a,n){e.when("/",{template:'<opa-dashboard flex layout="row"></opa-dashboard>',pageTitle:"DASHBOARD.PAGE_TITLE",title:"DASHBOARD.TITLE",pageInfo:"DASHBOARD.INFO"}).otherwise("/"),e.when("/promoted-videos",{template:'<opa-promoted-videos flex layout="row"></opa-promoted-videos>',pageTitle:"PROMOTED_VIDEOS.PAGE_TITLE",title:"PROMOTED_VIDEOS.TITLE",pageInfo:"PROMOTED_VIDEOS.INFO"}),e.when("/settings",{template:'<opa-settings flex layout="row"></opa-settings>',pageTitle:"SETTINGS.PAGE_TITLE",title:"SETTINGS.TITLE",pageInfo:"SETTINGS.INFO"}),t.html5Mode(!0),o.debugEnabled(!1),a.interceptors.push("opaInterceptor"),n.definePalette("opaBlue",{50:"f5f8ff",100:"e5eeff",200:"bde1f5",300:"7ec2e7",400:"58b3e4",500:"1a91d1",600:"1a8dcb",700:"1f7bad",800:"1a6c99",900:"155d84",A100:"80d2ff",A200:"52c2ff",A400:"1aafff",A700:"008bd6",contrastDefaultColor:"dark",contrastLightColors:["500","700","800","900"]}),n.definePalette("opaPink",{50:"fff5fe",100:"ffe5eb",200:"f5bddc",300:"e77eb8",400:"e458a5",500:"e6007e",600:"cb1a7c",700:"ad1f6d",800:"991a60",900:"841552",A100:"ff80c6",A200:"ff52b1",A400:"ff1a98",A700:"d60076",contrastDefaultColor:"dark",contrastLightColors:["500","600","700","800","900","A700"]}),n.theme("default").primaryPalette("opaBlue",{default:"500","hue-1":"300","hue-2":"800","hue-3":"A100"}),n.theme("default").accentPalette("opaPink",{default:"A200","hue-1":"A100","hue-2":"A400","hue-3":"A700"})}]),t.run(["$filter","opaInfoConfiguration","opaNotificationConfiguration",function(e,t,o){t.setOptions({closeLabel:e("opaTranslate")("INFO.CLOSE"),closeAriaLabel:e("opaTranslate")("INFO.CLOSE_ACCESSIBILITY")}),o.setOptions({closeLabel:e("opaTranslate")("NOTIFICATION.CLOSE"),closeAriaLabel:e("opaTranslate")("NOTIFICATION.CLOSE_ACCESSIBILITY")})}]),e.element(document).ready(function(){e.bootstrap(document,["opa"],{strictDi:!0})})}(angular),function(){function e(){var t=this;return Object.defineProperties(this,{options:{value:{}},setOptions:{value:function(e){e.closeLabel&&(t.options.closeLabel=e.closeLabel),e.closeAriaLabel&&(t.options.closeAriaLabel=e.closeAriaLabel)}},getOptions:{value:function(){return t.options}}}),{getOptions:this.getOptions,setOptions:this.setOptions}}angular.module("opa").factory("opaNotificationConfiguration",e),e.$inject=[]}(),function(){function e(e,t){return{getInfo:function(){return e.get(t+"version")}}}angular.module("opa").factory("opaAboutFactory",e),e.$inject=["$http","opaWebServiceBasePath"]}(),function(){function e(){return{setUrlParameter:function(e,t,o){var a,n,i={},l=[],r=e.match(/([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);if(!r)throw new TypeError(e+" is not a valid URL");for(n in a=r[1],e=r[2],r=r[3],e&&(l=e.split("&")).forEach(function(e){e=e.split("=");i[e[0]]=e[1]}),i[t]=o,l=[],i)l.push(n+"="+i[n]);return l.length&&(a+="?"+l.join("&")),r&&(a+="#"+r),a}}}angular.module("opa").factory("opaUrlFactory",e),e.$inject=[]}(),function(){function e(e){Object.defineProperties(this,{$onInit:{value:function(){e.$emit("opaViewLoaded")}}})}angular.module("opa").controller("OpaDashboardController",e),e.$inject=["$scope"]}(),function(){function e(e){var o=this;Object.defineProperties(o,{settings:{value:null,writable:!0},$onChanges:{value:function(e){e.opaSettings&&e.opaSettings.currentValue&&(e=angular.copy(e.opaSettings.currentValue),o.settings={pois:void 0!==e.pois&&e.pois},o.callUpdate())}},$postLink:{value:function(){e.$emit("opaSearchSettingsLinked",{controller:o})}},callUpdate:{value:function(){setTimeout(function(){o.isValid()&&o.opaOnUpdate&&o.opaOnUpdate({settings:o.settings})})}},isValid:{value:function(){return!e.opaSearchSettings||e.opaSearchSettings.$valid}}}),e.$watch("$ctrl.opaSettings",function(e,t){o.callUpdate()},!0)}angular.module("opa").controller("OpaSearchSettingsController",e),e.$inject=["$scope"]}(),function(){function e(e){var o=this;Object.defineProperties(o,{availablePlayers:{value:[{id:"wowza",name:"SETTINGS.LIVE.WOWZA"},{id:"youtube",name:"SETTINGS.LIVE.YOUTUBE"},{id:"vimeo",name:"SETTINGS.LIVE.VIMEO"},{id:"vodalys",name:"SETTINGS.LIVE.VODALYS"}]},liveSwitchMessage:{value:null,writable:!0},urlErrorMessage:{value:null,writable:!0},settings:{value:null,writable:!0},$onChanges:{value:function(e){e.opaSettings&&e.opaSettings.currentValue&&(e=angular.copy(e.opaSettings.currentValue),o.settings={activated:void 0!==e.activated&&e.activated,playerType:e.playerType||o.availablePlayers[0].id,url:e.url||null,private:void 0!==e.private&&e.private,groups:e.groups||[]},o.updateLiveSwitchMessage(o.settings.activated),o.updateUrlErrorMessage(o.settings.playerType),o.callUpdate())}},$postLink:{value:function(){e.$emit("opaLiveSettingsLinked",{controller:o})}},callUpdate:{value:function(){setTimeout(function(){o.isValid()&&o.opaOnUpdate&&o.opaOnUpdate({settings:o.settings})})}},updateLiveSwitchMessage:{value:function(e){o.liveSwitchMessage=e?"SETTINGS.LIVE.ACTIVATED_LABEL":"SETTINGS.LIVE.DEACTIVATED_LABEL"}},updateUrlErrorMessage:{value:function(e){o.urlErrorMessage="SETTINGS.LIVE.URL_"+e.toUpperCase()+"_ERROR"}},isValid:{value:function(){return!e.opaLiveSettings||e.opaLiveSettings.$valid}}}),e.$watch("$ctrl.opaSettings",function(e,t){o.callUpdate()},!0)}angular.module("opa").controller("OpaLiveSettingsController",e),e.$inject=["$scope"]}(),function(){function e(a,n,e){var i=this;Object.defineProperties(i,{isOpened:{value:!1,writable:!0},toggleActions:{value:function(){var e,t,o=a[0].querySelector(".opa-actions-wrapper");i.isOpened=!i.isOpened,i.isOpened?(e=a.find("ul")[0],t=n.getComputedStyle(e),t=(t=parseFloat(t.getPropertyValue("height")||t.height))||e.offsetHeight,o.style.height=t+"px"):o.style.height="0px"}},handleActionKeypress:{value:function(e,t){13===e.keyCode&&t.action(t)}}})}angular.module("opa").controller("OpaActionsButtonController",e),e.$inject=["$element","$window","$document"]}(),function(){function e(){var t=this;return Object.defineProperties(this,{options:{value:{}},setOptions:{value:function(e){e.closeLabel&&(t.options.closeLabel=e.closeLabel),e.closeAriaLabel&&(t.options.closeAriaLabel=e.closeAriaLabel)}},getOptions:{value:function(){return t.options}}}),{getOptions:this.getOptions,setOptions:this.setOptions}}angular.module("opa").factory("opaInfoConfiguration",e),e.$inject=[]}(),function(){function e(){}angular.module("opa").controller("OpaInfoButtonController",e),e.$inject=[]}(),angular.module("opa").controller("OpaMediaContainerController",function(){var t=this;Object.defineProperties(t,{onClick:{value:function(){t.opaEdit()}},onRemove:{value:function(e){e.stopImmediatePropagation(),t.opaRemove()}}})}),function(){function e(){Object.defineProperties(this,{handleItemKeypress:{value:function(e,t){13===e.keyCode&&t.action(t)}}})}angular.module("opa").controller("OpaNavController",e),e.$inject=[]}(),function(){function e(e,t){var a,n,i,l=this,o=e.controller("ngModel"),r=e.controller("mdInputContainer"),s=-1,u=!1;function c(){l.opaAvailableTags=void 0===l.opaAvailableTags?null:l.opaAvailableTags}function p(){if(!l.opaAvailableTags)return angular.copy(l.tags);var o=[];return l.tags.forEach(function(e){for(var t=0;t<l.opaAvailableTags.length;t++)if(l.opaAvailableTags[t].name===e){o.push(l.opaAvailableTags[t].value);break}}),o}function d(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()}Object.defineProperties(l,{tag:{value:"",writable:!0},tags:{value:[],writable:!0},autoCompleteValues:{value:[]},isAutoCompleteDisplayed:{value:!1,writable:!0},$onInit:{value:function(){c(),n=angular.element(e[0].querySelector(".ov-field-tags-auto-complete")),(i=e.find("input")).on("focus",function(){l.isAutoCompleteDisplayed=!0})}},$postLink:{value:function(){(a=angular.element(e.find("input")[0]).controller("ngModel")).$validators.opaTags=function(e,t){var o=!l.tags||0===l.tags.length;return!a.$touched||!u||!o}}},$onDestroy:{value:function(){i.off("focus"),i.off("blur"),n.off("keydown")}},$onChanges:{value:function(e){e.ngRequired&&(u=!!e.ngRequired.currentValue,r&&r.label&&r.label.toggleClass("md-required",u));e=!l.tags||0===l.tags.length;r&&r.setInvalid(u&&e&&a&&a.$touched)}},autoComplete:{value:function(){l.opaAvailableTags&&(l.autoCompleteValues.splice(0,l.autoCompleteValues.length),l.tag&&l.opaAvailableTags.forEach(function(e){0===e.name.toLowerCase().indexOf(l.tag.toLowerCase())&&l.autoCompleteValues.push(e)}),l.autoCompleteValues.length?l.isAutoCompleteDisplayed=!0:(s=-1,n.off("keydown")))}},removeTag:{value:function(e,t){l.tags.splice(t,1),o.$setViewValue(p()),e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),o.$validate(),l.tags.length||i[0].focus()}},handleAutoCompleteKeys:{value:function(e,t){var o;l.autoCompleteValues.length&&(40===e.keyCode||38===e.keyCode?(1==(o=40===e.keyCode?1:-1)&&s+1>=l.autoCompleteValues.length||-1==o&&s<=0?(s=-1,i[0].focus()):(s+=o,n[0].querySelectorAll("li")[s].focus()),d(e)):13===e.keyCode&&t&&(l.addTag(t),d(e)))}},handleInputKeys:{value:function(e){13===e.keyCode?(l.addTag(l.tag),d(e)):9===e.keyCode?l.isAutoCompleteDisplayed=!1:l.autoCompleteValues.length&&(40===e.keyCode?n[s=0].querySelector("li").focus():38===e.keyCode&&(s=l.autoCompleteValues.length-1,n[0].querySelectorAll("li")[s].focus()),38!==e.keyCode&&40!==e.keyCode||(d(e),n.off("keydown"),n.on("keydown",l.handleAutoCompleteKeys)))}},addTag:{value:function(e){if(!l.opaAvailableTags&&e&&-1===l.tags.indexOf(e))return l.tag="",l.tags.push(e),o.$setViewValue(p()),void o.$validate();if(l.opaAvailableTags)for(var t=0;t<l.opaAvailableTags.length;t++)if(l.opaAvailableTags[t].name===e){e&&-1===l.tags.indexOf(l.opaAvailableTags[t].name)&&(l.tags.push(e),o.$setViewValue(p()),o.$validate()),l.tag="",l.autoComplete(),i[0].focus();break}}},invalidateUntouched:{value:function(){var e=p(),e=!e||0===e.length;!a.$touched&&u&&e&&r.setInvalid(!0)}}}),o.$isEmpty=function(e){e=!e||0===e.length;return r&&r.setInvalid(u&&e&&a&&a.$touched),e},o.$render=function(){l.opaAvailableTags?(l.tags=[],(o.$viewValue||[]).forEach(function(e){for(var t=0;t<l.opaAvailableTags.length;t++)if(l.opaAvailableTags[t].value===e){l.tags.push(l.opaAvailableTags[t].name);break}})):l.tags=angular.copy(o.$viewValue)||[]},t.$watch("$ctrl.opaAvailableTags",c)}angular.module("opa").controller("OpaTagsController",e),e.$inject=["$element","$scope"]}(),function(){function e(e){Object.defineProperties(this,{$mdMedia:{value:e}})}angular.module("opa").controller("OpaToolbarController",e),e.$inject=["$mdMedia"]}(),function(){function e(a){var o,n=this;Object.defineProperties(n,{selection:{value:[],writable:!0},multiple:{value:!1,writable:!0},checkboxesStates:{value:[],writable:!0},focusStates:{value:[],writable:!0},keepFocus:{value:!1,writable:!0},isInitialized:{value:!1,writable:!0},$onInit:{value:function(){n.multiple=n.opaMultiple||Array.isArray(n.ngModel),n.ngModel&&(n.selection=n.multiple?n.ngModel:[n.ngModel]),n.setCheckboxesStates(),n.isInitialized=!0}},$onChanges:{value:function(e){Object.prototype.hasOwnProperty.call(e,"opaMedias")&&n.isInitialized&&(n.setCheckboxesStates(),n.setFocusStates())}},check:{value:function(e){if(o=n.opaMedias.indexOf(e),n.multiple)-1===n.selection.indexOf(e.id)&&(n.selection.push(e.id),n.ngModel=n.selection,n.checkboxesStates[o]=!0);else{n.selection=[e.id],n.ngModel=e.id;for(var t=0;t<n.checkboxesStates.length;t++)n.checkboxesStates[t]=t===o}}},uncheck:{value:function(e){-1!==(o=n.selection.indexOf(e.id))&&n.selection.splice(o,1),-1!==(o=n.opaMedias.indexOf(e))&&(n.checkboxesStates[o]=!1),n.ngModel=n.multiple?n.selection:""}},setCheckboxesStates:{value:function(){n.checkboxesStates=[],n.opaMedias.forEach(function(e){n.checkboxesStates.push(-1!==n.selection.indexOf(e.id))})}},setFocusStates:{value:function(){n.focusStates=[],n.opaMedias.forEach(function(e){n.focusStates.push(!1)})}},optionFocus:{value:function(e){if(Object.prototype.isPrototypeOf.call(KeyboardEvent.prototype,e)&&n.focusStates.length)if(9===e.keyCode)n.keepFocus=!0,n.focusStates[0]=!0,a.children().addClass("opa-focused");else{var t,o=n.focusStates.indexOf(!0);if(-1!==o){switch(e.keyCode){case 37:t=o-1;break;case 39:t=o+1;break;default:return}t>=n.focusStates.length?t=0:t<0&&(t=n.focusStates.length-1),t!==o&&(n.keepFocus=!0,n.focusStates[o]=!1,n.focusStates[t]=!0)}}}},onBlur:{value:function(){var e;n.keepFocus?n.keepFocus=!1:(-1!==(e=n.focusStates.indexOf(!0))&&(n.focusStates[e]=!1),a.children().removeClass("opa-focused"))}}})}angular.module("opa").controller("OpaMediaSelectController",e),e.$inject=["$element"]}(),function(){function e(t){var o=this;Object.defineProperties(o,{isChecked:{value:!1,writable:!0},$onChanges:{value:function(e){Object.prototype.hasOwnProperty.call(e,"opaChecked")&&(o.isChecked=o.opaChecked),Object.prototype.hasOwnProperty.call(e,"opaFocus")&&!0===o.opaFocus&&t.find("md-checkbox")[0].focus()}},updateSelect:{value:function(){o.isChecked?o.selectCtrl.check(o.opaMedia):o.selectCtrl.uncheck(o.opaMedia)}},onBlur:{value:function(){o.opaBlur()}}})}angular.module("opa").controller("OpaMediaOptionController",e),e.$inject=["$element"]}(),function(){function e(e,t){return{getGroups:function(){return e.get(t+"groups")}}}angular.module("opa").factory("opaGroupsFactory",e),e.$inject=["$http","opaWebServiceBasePath"]}(),function(){function e(t,o,a){function n(e){var t;return e.data&&e.data.error&&(t=e.data.error.code),403===e.status?o("opaTranslate")("ERRORS.FORBIDDEN"):400===e.status?o("opaTranslate")("ERRORS.CLIENT"):t?o("opaTranslate")("ERRORS.SERVER")+" (code="+t+")":o("opaTranslate")("ERRORS.SERVER")}return{request:function(e){return e.url&&!/^.*\.html$/.test(e.url)&&(e.url="/be/"+e.url.replace(/^\/(.*)/,"$1")),e},responseError:function(e){return 401===e.status?t.$broadcast("opaHttpError",{authenticationError:!0}):-1===e.status&&e.config&&e.config.timeout&&e.config.timeout.status||t.$broadcast("opaHttpError",{message:n(e)}),a.reject(e)}}}angular.module("opa").factory("opaInterceptor",e),e.$inject=["$rootScope","$filter","$q"]}(),function(){function e(o,a){return{getSetting:function(e){return o.get(a+"settings/"+e)},updateSetting:function(e,t){return o.post(a+"settings/"+e,{value:t})}}}angular.module("opa").factory("opaSettingsFactory",e),e.$inject=["$http","opaWebServiceBasePath"]}(),function(){function e(e,t,o){var a=(t.get("language")||navigator.language||navigator.browserLanguage).split("-")[0];return{getUserInfo:function(){return openVeoPortalSettings.user},isAuthenticated:function(){return!!openVeoPortalSettings.user},logout:function(){return e.post(o+"logout")},getLanguage:function(){return a},setLanguage:function(e){a=e,t.put("language",a)}}}angular.module("opa").factory("opaUserFactory",e),e.$inject=["$http","$cookies","opaWebServiceBasePath"]}(),function(){function e(t,o){return{getVideo:function(e){return t.get(o+"videos/"+e)},getPromotedVideos:function(){return t.get(o+"videos/promoted")}}}angular.module("opa").factory("opaVideosFactory",e),e.$inject=["$http","opaWebServiceBasePath"]}(),function(){function e(){return{getLanguages:function(){return openVeoPortalSettings.languages}}}angular.module("opa").factory("opaI18nFactory",e),e.$inject=[]}(),angular.module("opa").directive("opaInfo",function(){return{restrict:"A",scope:{message:"<opaInfo",closeLabel:"@opaClose",closeAriaLabel:"@opaCloseAria"},controller:"OpaInfoController",controllerAs:"ctrl",bindToController:!0}}),function(){function e(e){var o=this,t=e.controller("ngModel");Object.defineProperties(this,{isValid:{value:function(e){return/^([a-zA-Z0-9]{5}-)*[a-zA-Z0-9]{5}$/.test(e)}},$onChanges:{value:function(){t.$validate()}}}),t.$validators.opaLicenseKey=function(e,t){return!e||(!o.opaLicenseKeyValidator||o.isValid(e))}}angular.module("opa").controller("OpaLicenseKeyValidatorController",e),e.$inject=["$element"]}(),angular.module("opa").directive("opaLicenseKeyValidator",function(){return{restrict:"A",require:["^ngModel"],controller:"OpaLicenseKeyValidatorController",controllerAs:"ctrl",bindToController:!0,scope:{opaLicenseKeyValidator:"<"}}}),function(){function e(e,t,o,a){var n=this;Object.defineProperties(n,{value:{value:null,writable:!0},multiple:{value:null,writable:!0},$onInit:{value:function(){n.value=o,n.multiple=a}},dialogSizeClass:{value:function(){return t("xs")?"opa-dialog-100":t("sm")?"opa-dialog-80":t("md")?"opa-dialog-55":t("gt-md")?"opa-dialog-40":void 0}},cancel:{value:function(){e.cancel()}},close:{value:function(){e.hide({value:n.value})}}})}angular.module("opa").controller("OpaMediaLibraryDialogController",e),e.$inject=["$mdDialog","$mdMedia","value","multiple"]}(),function(){function e(e,t){Object.defineProperties(this,{$mdMedia:{value:t},hide:{value:function(){e.hide()}}})}angular.module("opa").controller("OpaNotificationController",e),e.$inject=["$mdToast","$mdMedia"]}(),function(){function e(e){var o=this,t=e.controller("ngModel");Object.defineProperties(this,{isValidYoutubeStreamUrl:{value:function(e){return/^https:\/\/www\.youtube\.com\/watch\?v=[&=\w-]+$/.test(e)}},isValidWowzaStreamUrl:{value:function(e){return/^https?:\/\/[\w-.]*(:[0-9]+)?\/[\w-._]+\/[\w-._]+\/playlist.m3u8$/.test(e)}},isValidVimeoStreamUrl:{value:function(e){return/^https:\/\/vimeo\.com\/event\/\w+$/.test(e)}},isValidVodalysStreamUrl:{value:function(e){return/^https?:\/\/console\.vodalys\.studio\/[^#?=]+$/.test(e)}},$onChanges:{value:function(){t.$validate()}}}),t.$validators.opaStreamUrl=function(e,t){return!e||(!o.opaStreamUrlValidator||("youtube"===o.opaType?o.isValidYoutubeStreamUrl(e):"wowza"===o.opaType?o.isValidWowzaStreamUrl(e):"vimeo"===o.opaType?o.isValidVimeoStreamUrl(e):"vodalys"===o.opaType?o.isValidVodalysStreamUrl(e):void 0))}}angular.module("opa").controller("OpaStreamUrlValidatorController",e),e.$inject=["$element"]}(),angular.module("opa").directive("opaStreamUrlValidator",function(){return{restrict:"A",require:["^ngModel"],controller:"OpaStreamUrlValidatorController",controllerAs:"ctrl",bindToController:!0,scope:{opaStreamUrlValidator:"<",opaType:"<"}}}),function(){function e(n,e){var i=e.getOptions();return{displayNotification:function(e,t,o,a){e&&(t=Math.max(t,0)||0,n.show(n.build({hideDelay:t,templateUrl:"opa-notification.html",controller:"OpaNotificationController",controllerAs:"ctrl",bindToController:!0,locals:{message:e,closeButton:0===t,closeLabel:o||i.closeLabel,closeAriaLabel:a||i.closeAriaLabel}})))}}}angular.module("opa").factory("opaNotificationFactory",e),e.$inject=["$mdToast","opaNotificationConfiguration"]}(),function(){function e(a,o,n,t,i,l,r,s){var u=this;Object.defineProperties(u,{isError:{value:!1,writable:!0},isSaving:{value:!1,writable:!0},promotedVideos:{value:null,writable:!0},containers:{value:[],writable:!0},containersClass:{value:"",writable:!0},$onInit:{value:function(){l.getPromotedVideos().then(function(e){u.promotedVideos=e.data&&e.data||new Array(9);for(var t=0;t<u.promotedVideos.length;t++){var o=0===t?"publish-16by9-300":"publish-16by9-142";u.promotedVideos[t]&&(u.promotedVideos[t].preview=s.setUrlParameter(u.promotedVideos[t].thumbnail,"style",o)),u.containers[t]={title:t+1,style:o,media:u.promotedVideos[t]}}a.$emit("opaViewLoaded")},function(e){u.isError=!0,a.$emit("opaViewLoaded")})}},getContainersTemplate:{value:function(){var e=t("xs")?(u.containersClass="opa-xs","opa-promotedVideos-containers-2And4Cols.html"):t("sm")?(u.containersClass="opa-sm","opa-promotedVideos-containers-3Cols.html"):(u.containersClass="opa-gt-sm","opa-promotedVideos-containers-2And4Cols.html");return e}},openMediaLibraryDialog:{value:function(e){var t=u.containers[e];n.show({controller:"OpaMediaLibraryDialogController",controllerAs:"$ctrl",templateUrl:"opa-mediaLibraryDialog.html",locals:{value:t.media?t.media.id:void 0,multiple:!1}}).then(function(e){e=e.value;e?l.getVideo(e).then(function(e){t.media=e.data.entity,t.media.preview=s.setUrlParameter(e.data.entity.thumbnail,"style",t.style)}):t.media=void 0},function(){})}},clearContainer:{value:function(e){u.containers[e].media=void 0}},save:{value:function(){u.isSaving=!0;for(var e=new Array(9),t=0;t<e.length;t++)e[t]=u.containers[t].media&&u.containers[t].media.id||void 0;i.updateSetting("promoted-videos",e).then(function(){u.isSaving=!1,r.displayNotification(o("opaTranslate")("PROMOTED_VIDEOS.SAVE_SUCCESS"),1e3)},function(e){u.isSaving=!1})}}})}angular.module("opa").controller("OpaPromotedVideosController",e),e.$inject=["$scope","$filter","$mdDialog","$mdMedia","opaSettingsFactory","opaVideosFactory","opaNotificationFactory","opaUrlFactory"]}(),function(){function e(o,e,t,a,n,i,l){var r,s,u=this,c=a.controller&&a.controller("mdContent");Object.defineProperties(u,{isError:{value:!1,writable:!0},availableGroups:{value:[]},liveSettings:{value:null,writable:!0},searchSettings:{value:null,writable:!0},$onInit:{value:function(){e.all([n.getSetting("live"),n.getSetting("search"),i.getGroups()]).then(function(e){var t=e[2].data&&e[2].data.entities;u.liveSettings=e[0].data&&e[0].data.entity&&e[0].data.entity.value||{},u.searchSettings=e[1].data&&e[1].data.entity&&e[1].data.entity.value||{},t&&t.forEach(function(e){u.availableGroups.push({name:e.name,value:e.id})}),o.$emit("opaViewLoaded")},function(e){u.isError=!0,o.$emit("opaViewLoaded")}),o.$on("opaLiveSettingsLinked",function(e,t){r=t.controller}),o.$on("opaSearchSettingsLinked",function(e,t){s=t.controller}),c&&c.$element.addClass("opa-settings-wrapper")}},save:{value:function(){u.isSaving=!0,e.all([n.updateSetting("live",u.liveSettings),n.updateSetting("search",u.searchSettings)]).then(function(){u.isSaving=!1,l.displayNotification(t("opaTranslate")("SETTINGS.SAVE_SUCCESS"),1e3)},function(e){u.isSaving=!1})}},updateLiveSettings:{value:function(e){e&&u.liveSettings&&(u.liveSettings.activated=e.activated,u.liveSettings.playerType=e.playerType,u.liveSettings.url=e.url,u.liveSettings.private=e.private,u.liveSettings.groups=e.groups)}},updateSearchSettings:{value:function(e){e&&u.searchSettings&&(u.searchSettings.pois=e.pois)}},isValid:{value:function(){return!(!r||!s)&&(r.isValid()&&s.isValid())}}})}angular.module("opa").controller("OpaSettingsController",e),e.$inject=["$scope","$q","$filter","$element","opaSettingsFactory","opaGroupsFactory","opaNotificationFactory"]}(),function(){function e(e,t,o,a,n,i,l,r,s,u){var c=this,p=n("opaTranslate");Object.defineProperties(c,{page:{value:{}},adminTitle:{value:"HEADER.TITLE"},$mdMedia:{value:i},menuLinks:{value:[]},toolbarLeftActions:{value:[]},toolbarRightActions:{value:[]},advancedToolbarRightActions:{value:[]},advancedToolbarLanguageActions:{value:[]},toolbarPageInfo:{value:{type:"info",message:null,accessibility:p("HEADER.INFO_ACCESSIBILITY"),help:p("HEADER.INFO_TOOLTIP")}},navMenu:{value:[]},advancedNavMenu:{value:[]},userLanguage:{value:r.getLanguage()||s.getLanguages()[0]},isViewLoaded:{value:!1,writable:!0},init:{value:function(){var t=[],e={label:p("NAV.DASHBOARD"),icon:"dashboard",action:c.goTo,href:"/"},o={label:p("NAV.SETTINGS"),icon:"settings",action:c.goTo,href:"/settings"},a={label:p("NAV.PROMOTED_VIDEOS"),icon:"view_quilt",action:c.goTo,href:"/promoted-videos"};s.getLanguages().forEach(function(e){c.advancedToolbarLanguageActions.push({label:p("HEADER.LANGUAGES."+e),accessibility:p("HEADER.LANGUAGES."+e+"_ACCESSIBILITY"),code:e,action:c.setLanguage,selected:e===c.userLanguage}),t.push({label:p("NAV.LANGUAGES."+e),code:e,action:c.setLanguage,selected:e===c.userLanguage})}),c.toolbarLeftActions.push({type:"icon",accessibility:p("HEADER.TOGGLE_MENU_ACCESSIBILITY"),help:p("HEADER.TOGGLE_MENU_TOOLTIP"),icon:"menu",action:c.toggleSideNavigation}),c.toolbarRightActions.push(c.toolbarPageInfo),c.advancedToolbarRightActions.push({type:"icon",accessibility:p("HEADER.VIEW_PORTAL_ACCESSIBILITY"),help:p("HEADER.VIEW_PORTAL_TOOLTIP"),icon:"visibility",action:c.goToPortal},{type:"list",accessibility:p("HEADER.TOGGLE_LANGUAGES_ACCESSIBILITY"),help:p("HEADER.TOGGLE_LANGUAGES_TOOLTIP"),icon:"language",menu:c.advancedToolbarLanguageActions},{type:"list",accessibility:p("HEADER.TOGGLE_USER_ACTIONS_ACCESSIBILITY"),help:p("HEADER.TOGGLE_USER_ACTIONS_TOOLTIP"),icon:"account_circle",menu:[{label:p("HEADER.USER_ACTIONS.DISCONNECT"),accessibility:p("HEADER.USER_ACTIONS.DISCONNECT_ACCESSIBILITY"),action:c.logout}]}),c.navMenu.push(e,a,o),c.advancedNavMenu.push(e,a,o,{divider:!0},{label:p("NAV.VIEW_PORTAL"),icon:"visibility",action:c.goToPortal},{label:p("NAV.LANGUAGE"),icon:"language",actions:t},{divider:!0},{label:p("NAV.LOGOUT"),icon:"power_settings_new",action:c.logout})}},logout:{value:function(){r.logout().then(function(){c.goToPortal()})}},goTo:{value:function(e){a.path(e.href),c.closeSideNavigation()}},goToPortal:{value:function(){o.location.href="/"}},setLanguage:{value:function(e){r.setLanguage(e.code),o.location.href="/be"+a.path()}},closeSideNavigation:{value:function(){l("opa").close()}},toggleSideNavigation:{value:function(){l("opa").toggle()}},selectMenuItem:{value:function(t){function e(e){e.href===t?e.selected=!0:e.selected=!1}c.navMenu.forEach(e),c.advancedNavMenu.forEach(e)}}}),e.$on("$routeChangeStart",function(e,t){c.isViewLoaded=!1,r.isAuthenticated()||c.goToPortal()}),e.$on("$routeChangeSuccess",function(e,t){c.page.title=t&&t.title,c.page.pageTitle=t&&t.pageTitle,c.toolbarPageInfo.message=t&&t.pageInfo?p(t.pageInfo):null,c.selectMenuItem(t.originalPath)}),e.$on("opaViewLoaded",function(){c.isViewLoaded=!0}),e.$on("opaHttpError",function(e,t){t&&t.authenticationError?c.logout():u.displayNotification(t.message,0)}),c.init()}angular.module("opa").controller("OpaIndexController",e),e.$inject=["$scope","$route","$window","$location","$filter","$mdMedia","$mdSidenav","opaUserFactory","opaI18nFactory","opaNotificationFactory"]}(),angular.module("opa").component("opaPromotedVideos",{templateUrl:"opa-promotedVideos.html",controller:"OpaPromotedVideosController",bindings:{}}),angular.module("opa").component("opaSettings",{templateUrl:"opa-settings.html",controller:"OpaSettingsController",require:["?^mdContent"],bindings:{}}),function(){function e(t,e){var o=this;Object.defineProperties(o,{information:{value:{},writable:!0},message:{value:"",writable:!0},isLoaded:{value:!1,writable:!0},$onInit:{value:function(){e.getInfo().then(function(e){o.isLoaded=!0,o.information=e.data,o.message=t("opaTranslate")(o.information.updateAvailable?"DASHBOARD.ABOUT.NEED_UPGRADE_DESCRIPTION":"DASHBOARD.ABOUT.UP_TO_DATE_DESCRIPTION",0,{"%version%":o.information.version,"%versionUrl%":o.information.versionReleaseUrl,"%latestVersion%":o.information.latestVersion,"%latestVersionUrl%":o.information.latestVersionReleaseUrl})},function(e){o.isLoaded=!0})}}})}angular.module("opa").controller("OpaAboutController",e),e.$inject=["$filter","opaAboutFactory"]}(),angular.module("opa").component("opaAbout",{templateUrl:"opa-about.html",controller:"OpaAboutController",bindings:{}}),function(){function e(e,o,a,n){var i=this;Object.defineProperties(i,{medias:{value:[],writable:!0},keyword:{value:null,writable:!0},sortField:{value:"date",writable:!0},sortDirection:{value:"desc",writable:!0},triggered:{value:!1,writable:!0},limit:{value:null,writable:!0},currentPage:{value:null,writable:!0},totalPages:{value:null,writable:!0},isLoading:{value:!1,writable:!0},$onInit:{value:function(){i.limit=i.opaResultsPerPage||25,i.init(),e.find("opa-media-select").parent().on("scroll",function(){var e=this.scrollTop/(this.scrollHeight-this.clientHeight);e<.7?i.triggered=!1:.8<e&&!1===i.triggered&&(i.triggered=!0,i.addNextPage())})}},init:{value:function(){i.keyword=null,i.search()}},search:{value:function(){i.currentPage=null,i.totalPages=null,i.fetch(function(e){i.currentPage=1,i.totalPages=e.data.pagination.pages,i.medias=e.data.entities})}},addNextPage:{value:function(){i.currentPage!==i.totalPages&&i.fetch(function(e){i.currentPage++,i.medias=i.medias.concat(e.data.entities)})}},fetch:{value:function(t){var e;i.isLoading||(i.isLoading=!0,e={filter:{sortBy:i.sortField,sortOrder:i.sortDirection,include:["id","title","date","thumbnail"]},pagination:{limit:i.limit}},i.keyword&&(e.filter.query=i.keyword),i.currentPage&&(e.pagination.page=i.currentPage),o.post(a+"videos",e).then(function(e){return i.isLoading=!1,i.triggered=!1,e.data.entities.forEach(function(e){e.preview=n.setUrlParameter(e.thumbnail,"style","publish-square-142")}),t(e)},function(e){i.isLoading=!1}))}}})}angular.module("opa").controller("OpaMediaLibraryController",e),e.$inject=["$element","$http","opaWebServiceBasePath","opaUrlFactory"]}(),angular.module("opa").component("opaMediaLibrary",{templateUrl:"opa-mediaLibrary.html",controller:"OpaMediaLibraryController",bindings:{opaMultiple:"<",opaResultsPerPage:"<",ngModel:"="}}),angular.module("opa").component("opaDashboard",{templateUrl:"opa-dashboard.html",controller:"OpaDashboardController",bindings:{}}),angular.module("opa").component("opaSearchSettings",{templateUrl:"opa-searchSettings.html",controller:"OpaSearchSettingsController",bindings:{opaSettings:"<",opaOnUpdate:"&"}}),angular.module("opa").component("opaLiveSettings",{templateUrl:"opa-liveSettings.html",controller:"OpaLiveSettingsController",bindings:{opaSettings:"<",opaGroups:"<",opaOnUpdate:"&"}}),angular.module("opa").component("opaActionsButton",{templateUrl:"opa-actionsButton.html",controller:"OpaActionsButtonController",bindings:{opaLabel:"@",opaIcon:"@",opaActions:"<"}}),function(){function e(e,t,o,a,n,i){var l=this,r=null,s=null,u=n.newPanelPosition(),c=i.getOptions();Object.defineProperties(l,{open:{value:function(){r||s||(s=n.open({templateUrl:"opa-info.html",controller:function(){this.close=l.close},controllerAs:"ctrl",locals:{message:l.message,closeLabel:l.closeLabel,closeAriaLabel:l.closeAriaLabel},attachTo:o[0].body,escapeToClose:!0,clickOutsideToClose:!0,position:u,onCloseSuccess:function(){r=null,t[0].focus()}}).then(function(e){s=null,r=e,a(function(){o[0].querySelector(".opa-info button").focus()},1)}))}},close:{value:function(){r&&r.close()}},$onInit:{value:function(){u.relativeTo(t).addPanelPosition(n.xPosition.ALIGN_START,n.yPosition.BELOW)}},$onChanges:{value:function(e){e.closeLabel&&(l.closeLabel=e.closeLabel.currentValue||c.closeLabel),e.closeAriaLabel&&(l.closeAriaLabel=e.closeAriaLabel.currentValue||c.closeAriaLabel)}}}),t.on("click",l.open),e.$on("$destroy",function(){l.close(),t.off("click",l.open)})}angular.module("opa").controller("OpaInfoController",e),e.$inject=["$scope","$element","$document","$timeout","$mdPanel","opaInfoConfiguration"]}(),angular.module("opa").component("opaInfoButton",{templateUrl:"opa-infoButton.html",controller:"OpaInfoButtonController",bindings:{opaMessage:"<",opaAccessibility:"@",opaHelp:"@"}}),angular.module("opa").component("opaMediaContainer",{templateUrl:"opa-mediaContainer.html",controller:"OpaMediaContainerController",controllerAs:"ctrl",bindings:{opaTitle:"@",opaMedia:"<",opaEdit:"&",opaRemove:"&"}}),angular.module("opa").component("opaNav",{templateUrl:"opa-nav.html",controller:"OpaNavController",bindings:{opaMenu:"<"}}),angular.module("opa").component("opaTags",{templateUrl:"opa-tags.html",controller:"OpaTagsController",require:["?ngModel","^?mdInputContainer"],bindings:{opaAvailableTags:"<",ngRequired:"<"}}),angular.module("opa").component("opaToolbar",{templateUrl:"opa-toolbar.html",controller:"OpaToolbarController",bindings:{opaTitle:"@",opaLeftActions:"<",opaRightActions:"<"}}),angular.module("opa").component("opaMediaSelect",{templateUrl:"opa-mediaSelect.html",controller:"OpaMediaSelectController",bindings:{ngModel:"=",opaMedias:"<",opaMultiple:"<"}}),angular.module("opa").component("opaMediaOption",{templateUrl:"opa-mediaOption.html",controller:"OpaMediaOptionController",controllerAs:"ctrl",require:{selectCtrl:"^opaMediaSelect"},bindings:{opaChecked:"<",opaMedia:"<",opaFocus:"<",opaBlur:"&"}});
;angular.