text: "use strict";!function(){function xplConfig($sceDelegateProvider){$sceDelegateProvider.resourceUrlWhitelist(["self","http://static*.ieee.org/**"])}window.Xplore=window.Xplore||{},window.Xplore.ngscopes={};var xplDependencies=["ui.router","ui.bootstrap","templates.xpl","ngAria","ngAnimate","ngSanitize","xpl.common","xpl.ads","xpl.widget","ui-rangeSlider","xpl.tags","vcRecaptcha"];angular.module("templates.xpl",[]),angular.module("xpl",xplDependencies).config(xplConfig),xplConfig.$inject=["$sceDelegateProvider"]}(),function(){angular.module("xpl").constant("api",{document:{"abstract":"/rest/document/{0}/abstract",addCitationAlert:"/xpl/add_citation_alerts.jsp?documentid={0}",authors:"/rest/document/{0}/authors",citations:"/rest/document/{0}/citations",disclaimer:"/rest/document/{0}/disclaimer",definitions:"/rest/document/{0}/definitions",evolution:"/rest/document/{0}/versions",figures:"/rest/document/{0}/figures",footnotes:"/rest/document/{0}/footnotes",keywords:"/rest/document/{0}/keywords",media:"/rest/document/{0}/multimedia",metrics:"/rest/document/{0}/metrics",references:"/rest/document/{0}/references",relatedArticles:"/rest/document/{0}/similar",searchInDocument:"/rest/document/{0}/search",sectionList:"/rest/document/{0}/part/{1}",sectionListNoParts:"/rest/document/{0}",snippet:"/rest/document/{0}/snippet",toc:"/rest/document/{0}/toc",updateChgbkInfo:"/rest/document/{0}/chgbk",versions:"/rest/document/{0}/versions"},browse:{getProgramPackages:"/rest/standard/packages/program/GET_PROGRAM",getProgramArticles:"/rest/standard/packages/{0}/get-std-versions",getProgramSponsors:"/rest/standard/sponsors/{0}",readingRoomViewerUrl:"/rest/reading-room/get-url?arnumber={0}",readingRoomStandards:"/rest/reading-room/articles"},courses:{categories:"/rest/courses/categories/{0}"},virtualJournals:{about:"/rest/vj/{0}/about",related:"/rest/min-publication-list?{0}",topics:"/rest/vj/{0}/topics",pastIssues:"/rest/vj/{0}/past-issues",partialIssue:"/rest/vj/{0}/partial/{1}",fullIssue:"/rest/vj/{0}/full/{1}"},user:{info:"/rest/user/info",documents:{list:"/rest/user/documents/list",document:"/rest/user/documents/document"}},citations:{download:"/xpl/downloadCitations"},dwnldRefUrl:"/xpl/dwnldReferences?arnumber=",ics:"/rest/ics",directPdfUrl:"/stampPDF/getPDF.jsp?tp=&arnumber={0}",product:{details:"/rest/document/"},publication:"/rest/publication",search:"/rest/search",standardPackages:"/rest/standard/packages",typeahead:{browse:"/rest/publication/typeahead",search:"/rest/search/typeahead"}}).constant("layoutConstants",{responsiveBodyClassName:"body-resp",mobileBreakpoint:768})}(),function(){angular.module("xpl").filter("encodeURIComponent",function(){return function(item){return window.encodeURIComponent(item)}})}(),function(){function ComponentRouterProvider(){function component(componentName,$stateParams){return["<"+componentName,paramsToAttributes($stateParams),"/>"].join(" ")}function paramsToAttributes(params){function toDashCase(camelCaseString){return camelCaseString.replace(/([A-Z])/g,function(g){return"-"+g[0].toLowerCase()})}if(!params)return"";var attributes="";return Object.keys(params).forEach(function(key){attributes+=toDashCase(key)+'="'+(params[key]?params[key]:"")+'" '}),attributes}this.$get=function(){return{component:component,paramsToAttributes:paramsToAttributes}}}angular.module("xpl").provider("$componentRouter",ComponentRouterProvider)}(),function(){angular.module("xpl.common",[])}(),function(){angular.module("xpl.widget",["ngAnimate","ngSanitize"]).config(["$httpProvider",function($httpProvider){$httpProvider.defaults.cache=!1,$httpProvider.defaults.headers.get||($httpProvider.defaults.headers.get={}),$httpProvider.defaults.headers.get["If-Modified-Since"]="0"}])}(),function(){angular.module("xpl.ads",[])}(),function(){angular.module("xpl.tags",["xpl.tags.tealium","xpl.tags.tealium.directive"]).config(["tealiumPrvdrProvider",function(tealiumPrvdrProvider){tealiumPrvdrProvider.setConfig({enabled:TEALIUM_CONFIG_TAGGING_ENABLED,tealium_cdn_url:TEALIUM_CONFIG_CDN_URL,account_profile_environment:TEALIUM_CONFIG_ACCOUNT_PROFILE_ENV,suppress_first_view:!0});var search=function(){var data={sheet_name:"SERP search page - default",sheet_type:"search - default"};return data},home=search,browse=function(){var data={sheet_name:"Browse page - default",sheet_type:"browse - default"};return data},courses=function(){var data={sheet_name:"Courses page - default",sheet_type:"courses - default"};return data};tealiumPrvdrProvider.setViewIdMap({"":home,"/searchresult.jsp":search,"/browse":browse,"/courses":courses})}])}(),function(){angular.module("xpl.tags.tealium",["xpl.tags.tealium.data"]).provider("tealiumPrvdr",["tealiumDataPrvdrProvider",function(tealiumDataPrvdrProvider){var config={enabled:!1,tealium_cdn_url:"",account_profile_environment:"",suppress_first_view:!0},isValidAccountProfileEnvironmentStr=function(account_profile_environment){return"string"==typeof account_profile_environment&&account_profile_environment.split(/\//).length>=3&&account_profile_environment.split(/\//)[0].length>0&&account_profile_environment.split(/\//)[1].length>0&&account_profile_environment.split(/\//)[2].length>0};return{getConfig:function(){return config},setConfig:function(newConfig){config=newConfig},setConfigValue:function(key,value){config[key]=value},getViewIdMap:tealiumDataPrvdrProvider.getViewIdMap,setViewIdMap:tealiumDataPrvdrProvider.setViewIdMap,setViewIdMapEntry:tealiumDataPrvdrProvider.setViewIdMapEntry,$get:["tealiumDataPrvdr","$location","$log",function(tealiumDataPrvdr,$location,$log){config?config.enabled?isValidAccountProfileEnvironmentStr(config.account_profile_environment)?this.setConfigValue("script_src",config.tealium_cdn_url+config.account_profile_environment+"/utag.js"):($log.error("ERROR - Please configure Tealium properly. Disabling tealium. Not valid account_profile_environment value of;",config.account_profile_environment),config.enabled=!1):$log.warn("WARNING - Tealium tagging was disabled"):($log.error("ERROR - Please configure Tealium properly. Disabling tealium. Not valid config value of;",config),config={enabled:!1});var isTealiumEnabled=function(){return!(!config||config.enabled!==!0)},getViewIdMap=tealiumDataPrvdr.getViewIdMap,setViewIdMapEntry=tealiumDataPrvdr.setViewIdMapEntry,view=function(data){if(config.enabled){var data=data||tealiumDataPrvdr.getDataLayer($location.path());track("view",data)}},link=function(data){if(config.enabled){var data=data||tealiumDataPrvdr.getDataLayer($location.path());track("link",data)}},track=function(ev,data){if(config.enabled){var data=data||tealiumDataPrvdr.getDataLayer($location.path()),ev=ev||"view",src=config.script_src;"undefined"==typeof utag?getScript(src,function(){utag.track(ev,data)}):utag.track(ev,data)}},getScript=function(src,callback){if(config.enabled){var s,t,d=document,o={callback:callback||function(){}};"undefined"!=typeof src&&("undefined"!=typeof jQuery?(jQuery.ajaxSetup({cache:!0}),jQuery.getScript(src,o.callback)):(s=d.createElement("script"),s.language="javascript",s.type="text/javascript",s.async=1,s.charset="utf-8",s.src=src,"function"==typeof o.callback&&(d.addEventListener?s.addEventListener("load",function(){o.callback()},!1):s.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,o.callback())}),t=d.getElementsByTagName("script")[0],t.parentNode.insertBefore(s,t)))}};return{isTealiumEnabled:isTealiumEnabled,getViewIdMap:getViewIdMap,setViewIdMapEntry:setViewIdMapEntry,view:view,link:link,track:track,run:function(){"undefined"==typeof utag_data&&(window.utag_data=tealiumDataPrvdr.getDataLayer($location.path())||{}),config.suppress_first_view?window.utag_cfg_ovrd={noview:!0}:getScript(config.script_src)}}}]}}]).run(["tealiumPrvdr",function(tealiumPrvdr){tealiumPrvdr.run()}])}(),function(){angular.module("xpl.tags.tealium.data",[]).provider("tealiumDataPrvdr",function(){var view_id_map={};return{getViewIdMap:function(){return view_id_map},setViewIdMap:function(map){view_id_map=map},setViewIdMapEntry:function(id,dataFunc){view_id_map=view_id_map||{},view_id_map[id]=dataFunc},$get:function(){var getViewIdMap=function(){return view_id_map},setViewIdMapEntry=function(id,dataFunc){view_id_map=view_id_map||{},view_id_map[id]=dataFunc},getDataLayer=function(view_id){var dataLayer;try{dataLayer=view_id_map[view_id]?view_id_map[view_id]():view_id_map.generic?view_id_map.generic():{}}catch(err){data={},data.page_type="generic dataLayer error",data.error_name=err.name,data.error_message=err.message,dataLayer=data}return dataLayer};return{getViewIdMap:getViewIdMap,setViewIdMapEntry:setViewIdMapEntry,getDataLayer:getDataLayer}}}})}(),function(){function ActionBarComponent(downloadPdfService,pagingConstants){function $onInit(){$ctrl.showDownloadPdfsLink=setShowDownloadPdfsLink(),$ctrl.showPagingFilter=$ctrl.totalRecords>1&&$ctrl.totalRecords>=(pagingConstants.options[0]?pagingConstants.options[0].value:10)}function setShowDownloadPdfsLink(){return $ctrl.user.institute&&!$ctrl.user.institutionalFileCabinetUser}var $ctrl=this;$ctrl.showDownloadPdfsLink=!1,$ctrl.showPagingFilter=!1,$ctrl.$onInit=$onInit}var xplCmptActionBar={bindings:{bulkSelectedItems:"=",records:"=",selectedItems:"=",user:"<",totalRecords:"<",toggleMobileFacets:"&"},controller:ActionBarComponent,templateUrl:"common/components/action-bar-component.html"};ActionBarComponent.$inject=["downloadPdfService","pagingConstants"],angular.module("xpl.common").component("xplCmptActionBar",xplCmptActionBar)}(),function(){function xplCmptAdsLeaderboard(){return{bindToController:{googleAdTargeting:"="},controller:AdsLeaderboardComponent,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"common/components/ads-leaderboard-component.html",transclude:!0}}function AdsLeaderboardComponent($element,$scope){function closeAds(){$scope.$destroy(),$element.remove()}var vm=this;vm.closeAds=closeAds}angular.module("xpl.common").directive("xplCmptAdsLeaderboard",xplCmptAdsLeaderboard),AdsLeaderboardComponent.$inject=["$element","$scope"]}(),function(){function xplCmptAdsSidebar(){return{bindToController:{loading:"=",googleAdTargeting:"="},controller:AdsSidebarComponent,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"common/components/ads-sidebar-component.html",transclude:!0}}function AdsSidebarComponent(){}angular.module("xpl.common").directive("xplCmptAdsSidebar",xplCmptAdsSidebar)}(),function(){function xplCmptAuthortabBio(){return{bindToController:{bioParagraphs:"=",hashedName:"@"},controller:AuthortabBioComponent,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"common/components/authortab-bio-component.html"}}function AuthortabBioComponent($rootScope,$state,documentConstants,utilsService){function initialize(){}function viewMoreBio(anchor){$state.includes("document.full",{ctx:"authors"})?utilsService.scrollTo(anchor,120):$state.go("document.full",{ctx:"authors",tab:"authors",anchor:anchor,q:null,part:null,section:null,tabFilter:null})}var vm=this;vm.viewMoreBio=viewMoreBio,vm.charlimit=425,vm.charlimitExceeded=vm.bioParagraphs.reduce(function(prevLength,currParagraph){return prevLength+currParagraph.length},0)>vm.charlimit,initialize()}angular.module("xpl.common").directive("xplCmptAuthortabBio",xplCmptAuthortabBio),AuthortabBioComponent.$inject=["$rootScope","$state","documentConstants","utilsService"]}(),function(){function xplCmptDashboard(){return{bindToController:{breadcrumbs:"=",endRecord:"=",loading:"=",startRecord:"=",terms:"=",totalRecords:"=",contentTypeFacet:"="},controller:DashboardComponent,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"common/components/dashboard-component.html",transclude:!0}}function DashboardComponent(){function toggleTermsExpandedMobile(){vm.isTermsExpandedMobile=!vm.isTermsExpandedMobile}var vm=this;vm.isTermsExpandedMobile=!0,vm.toggleTermsExpandedMobile=toggleTermsExpandedMobile}angular.module("xpl.common").directive("xplCmptDashboard",xplCmptDashboard)}(),function(){function FacetsComponent(searchConstants){var $ctrl=this;$ctrl.facetsDrawerIdName=searchConstants.facetsDrawerIdName}var xplCmptFacets={bindings:{facets:"<",contentTypeFacet:"<",error:"<",loading:"<",resultLength:"<",closeMobileFacets:"&",shouldResizeContainer:"<"},controller:FacetsComponent,templateUrl:"common/components/facets-component.html"};angular.module("xpl.common").component("xplCmptFacets",xplCmptFacets),FacetsComponent.$inject=["searchConstants"]}(),function(){function xplCmptResultList(){return{bindToController:{error:"=",loading:"=",length:"=",suggestions:"=",terms:"="},controller:ResultListComponent,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"common/components/result-list-component.html",transclude:!0}}function ResultListComponent(){}angular.module("xpl.common").directive("xplCmptResultList",xplCmptResultList)}(),function(){function xplCmptToolbar(){return{bindToController:{id:"="},controller:ToolbarComponent,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"common/components/toolbar-component.html",transclude:!0}}function ToolbarComponent(){}angular.module("xpl.common").directive("xplCmptToolbar",xplCmptToolbar)}(),function(){function BrowseSortFilterService(DataFilterService,userService,$state,searchState){function BrowseSortFilterService(totalRecords,label){DataFilterService.apply(this,[totalRecords,label]),this.user=userService.getUser(),this.options=this.setOptions()}var OPTION_SET=[{value:"newest",name:"Newest First",order:0,standards:!0,pub:!0},{value:"pub-title-asc",name:"Publication Title A - Z",order:1,pub:!0,isDefault:!0},{value:"pub-title-desc",name:"Publication Title Z - A",order:2,pub:!0},{value:"std-number",name:"Standard Number",order:3,standards:!0,isDefault:!0}];return BrowseSortFilterService.prototype=new DataFilterService,BrowseSortFilterService.prototype.defaultItem=function(){if($state.params.sortType){var definedSortType=$state.params.sortType;return _.find(this.options,function(option){return option.value===definedSortType})}return _.find(this.options,function(option){return option.isDefault})},BrowseSortFilterService.prototype.onChange=function(newVal){return searchState.push(searchState.$facets.sort,newVal.value).update(),newVal},BrowseSortFilterService.prototype.setOptions=function(){var options=OPTION_SET.slice(0);return"standards"===$state.params.browseContentType?_.remove(options,function(o){return o.standards}):_.remove(options,function(o){return o.pub})},BrowseSortFilterService}angular.module("xpl.common").service("BrowseSortFilterService",BrowseSortFilterService),BrowseSortFilterService.$inject=["DataFilterService","userService","$state","searchState"]}(),function(){function DataFilterService(){function DataFilterService(totalRecords,label){this.totalRecords=totalRecords,this.label=label}return DataFilterService.prototype.defaultItem=function(){throw"No options available. Cannot set default item."},DataFilterService.prototype.onChange=function(newVal){return newVal},DataFilterService.prototype.enabled=function(){return this.totalRecords>1},DataFilterService}angular.module("xpl.common").factory("DataFilterService",DataFilterService)}(),function(){angular.module("xpl.common").constant("pagingConstants",{options:[{name:"10",value:10,order:0},{name:"25",value:25,order:1,isDefault:!0},{name:"50",value:50,order:2},{name:"75",value:75,order:3},{name:"100",value:100,order:4}]})}(),function(){function PagingFilterService(DataFilterService,pagingConstants,userService,searchState,$stateParams){function PagingFilterService(totalRecords,label){DataFilterService.apply(this,[totalRecords,label]),this.user=userService.getUser(),this.options=this.setOptions(this.totalRecords)}return PagingFilterService.prototype=new DataFilterService,PagingFilterService.prototype.defaultItem=function(){if(searchState.$params[searchState.$facets.rowsPerPage]){var definedItemCount=searchState.$params[searchState.$facets.rowsPerPage];return definedItemCount>this.totalRecords?this.options[this.options.length-1]:_.find(this.options,function(option){return option.name===definedItemCount})}if(this.user.userPreferencesInfo&&this.user.userPreferencesInfo.rowsPerPage){var userItemCount=this.user.userPreferencesInfo.rowsPerPage;return userItemCount>this.totalRecords?this.options[this.options.length-1]:_.find(this.options,function(option){return option.value===userItemCount})}var defaultItemCount=_.find(this.options,function(option){return option.isDefault});return defaultItemCount?defaultItemCount:this.options[this.options.length-1]},PagingFilterService.prototype.onChange=function(newVal){return searchState.push(searchState.$facets.rowsPerPage,newVal.value).update(),newVal},PagingFilterService.prototype.enabled=function(){return this.totalRecords>this.options[0].value},PagingFilterService.prototype.setOptions=function(){var options=pagingConstants.options.slice(0);if(this.totalRecords>=options[options.length-1].value)return options;for(var i=options.length-1;i>0;i--)if(options[i].value>this.totalRecords){if(!(options[i-1].value>=this.totalRecords))break;options.pop()}return options},PagingFilterService}angular.module("xpl.common").service("PagingFilterService",PagingFilterService),PagingFilterService.$inject=["DataFilterService","pagingConstants","userService","searchState","$stateParams"]}(),function(){angular.module("xpl.common").constant("showTypeConstants",{options:[{value:"allResults",name:"All Results",order:0,isDefault:!0},{value:"subscribed",name:"My Subscribed Content",order:1,isSubscribed:!0},{value:"openAccess",name:"Open Access",order:2},{value:"fileCabinet",name:"File Cabinet",order:3}]})}(),function(){function ShowTypeFilterService($stateParams,DataFilterService,showTypeConstants,userService,searchState){function ShowTypeFilterService(totalRecords,label){DataFilterService.apply(this,[totalRecords,label]),this.user=userService.getUser(),this.options=setOptions(this.user)}function setOptions(user){return user.subscribedContent||(showTypeConstants.options=_.remove(showTypeConstants.options,function(option){return!option.isSubscribed})),user.fileCabinetContent||(showTypeConstants.options=_.remove(showTypeConstants.options,function(option){return"fileCabinet"!==option.value})),showTypeConstants.options}return ShowTypeFilterService.prototype=new DataFilterService,ShowTypeFilterService.prototype.defaultItem=function(){var definedContentFilter=_.find(showTypeConstants.options,function(option){return searchState.$params[option.value]&&"true"===searchState.$params[option.value]});return definedContentFilter?definedContentFilter:_.find(this.options,function(option){return option.isDefault})},ShowTypeFilterService.prototype.onChange=function(newVal){return this.options.forEach(function(o){$stateParams[o.value]=void 0}),newVal.isDefault||($stateParams[newVal.value]=!0),searchState.update(),newVal},ShowTypeFilterService}angular.module("xpl.common").service("ShowTypeFilterService",ShowTypeFilterService),ShowTypeFilterService.$inject=["$stateParams","DataFilterService","showTypeConstants","userService","searchState"]}(),function(){angular.module("xpl.common").constant("sortByConstants",{options:[{name:"Relevance",value:"relevance",order:0,isDefault:!0},{name:"Newest First",value:"desc_p_Publication_Year",order:1},{name:"Oldest First",value:"asc_p_Publication_Year",order:2},{name:"Most Cited [By Papers]",value:"desc_p_Citation_Count",order:3},{name:"Most Cited [By Patents]",value:"desc_p_Patent_Count",order:4,isPatentCount:!0},{name:"Publication Title A-Z",value:"asc_p_Publication_Title",order:5},{name:"Publication Title Z-A",value:"desc_p_Publication_Title",order:6}]})}(),function(){function SortByFilterService(DataFilterService,sortByConstants,userService,searchState){function SortByFilterService(totalRecords,label){DataFilterService.apply(this,[totalRecords,label]),this.user=userService.getUser(),this.options=this.setOptions(this.user)}return SortByFilterService.prototype=new DataFilterService,SortByFilterService.prototype.defaultItem=function(){if(searchState.$params[searchState.$facets.sort]){var definedSortType=searchState.$params[searchState.$facets.sort];return _.find(this.options,function(option){return option.value===definedSortType})}if(this.user.userPreferencesInfo&&this.user.userPreferencesInfo.sortType){var userSortType=this.user.userPreferencesInfo.sortType;return _.find(this.options,function(option){return option.value===userSortType})}return _.find(this.options,function(option){return option.isDefault})},SortByFilterService.prototype.onChange=function(newVal){return newVal.isDefault?searchState.clear(searchState.$facets.sort).update():searchState.push(searchState.$facets.sort,newVal.value).update(),newVal},SortByFilterService.prototype.setOptions=function(user){return user.showPatentCitations?sortByConstants.options:sortByConstants.options.filter(function(option){return option.isPatentCount!==!0})},SortByFilterService}angular.module("xpl.common").service("SortByFilterService",SortByFilterService),SortByFilterService.$inject=["DataFilterService","sortByConstants","userService","searchState"]}(),function(){function xplCmptAdsLeaderboardMiddle(){return{bindToController:{googleAdTargeting:"="},controller:AdsLeaderboardComponentMiddle,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"common/components/ads-leaderboard-middle/ads-leaderboard-middle-component.html",transclude:!0}}function AdsLeaderboardComponentMiddle($element,$scope){function closeAds(){$scope.$destroy(),$element.remove()}var vm=this;vm.closeAds=closeAds}angular.module("xpl.common").directive("xplCmptAdsLeaderboardMiddle",xplCmptAdsLeaderboardMiddle),AdsLeaderboardComponentMiddle.$inject=["$element","$scope"]}(),function(){function bindHtmlCompile($compile){return{restrict:"A",link:function(scope,element,attrs){scope.$watch(function(){return scope.$eval(attrs.bindHtmlCompile)},function(value){element.html(value),$compile(element.contents())(scope)})}}}angular.module("xpl.common").directive("bindHtmlCompile",bindHtmlCompile),bindHtmlCompile.$inject=["$compile"]}(),function(){function breadcrumbService(){function getBreadcrumb(key,value){if(breadcrumbService.breadcrumbs){var breadcrumb=breadcrumbService.breadcrumbs.filter(function(x){return x.key==value});return breadcrumb.length?breadcrumb[0]:void 0}}function removeBreadcrumb(value){var breadcrumb=_.remove(breadcrumbService.breadcrumbs,function(b){return b.type.toLowerCase()===value.toLowerCase()});return breadcrumb.length?breadcrumb[0]:void 0}var breadcrumbService={breadcrumbs:void 0,getBreadcrumb:getBreadcrumb,removeBreadcrumb:removeBreadcrumb};return breadcrumbService}angular.module("xpl.common").factory("breadcrumbService",breadcrumbService)}(),function(){function collabratecService($http,$q,$log){function exportRecords(ids){var deferred=$q.defer();return $http({method:"POST",url:COLLABRATEC_ENDPOINT,data:$.param({id:ids}),headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).then(function(response){if(!response.data.message)return $q.reject("A response with no message was returned.");try{response.data.message=angular.fromJson(response.data.message)}catch(e){return $q.reject(response.data.message)}getExportSuccess(response.data),deferred.resolve(response.data)})["catch"](function(error){getExportFailure(error),deferred.reject(error)}),deferred.promise}function getExportSuccess(response){$log.log("Collabratec Response:",response)}function getExportFailure(error){$log.error("Collabratec Error:",error)}var COLLABRATEC_ENDPOINT="/rest/search/export/",COLLABRATEC_URL=xpl.properties.collabratec.url,collabratecService={exportRecords:exportRecords,url:COLLABRATEC_URL};return collabratecService}angular.module("xpl.common").factory("collabratecService",collabratecService),collabratecService.$inject=["$http","$q","$log"]}(),function(){function addBreakAtSpace(){function addBreakAtSpaceFilter(input){if(input&&input.length)return input.replace(" ","<br>")}return addBreakAtSpaceFilter}function authorSearchLink($filter,$log){function authorSearchLinkFilter(input){"string"!=typeof input&&$log.error("Author name is not of type string for link filter. ",input);var output=input;return filters.forEach(function(filterName){output=$filter(filterName)(output)}),output=authorSearchURL.replace("{0}",output)}var filters=["htmlEntitiesDecode","endecaSearchValues","encodeURIComponent"],authorSearchURL='/search/searchresult.jsp?searchWithin="Authors":.QT.{0}.QT.&newsearch=true';return authorSearchLinkFilter}function cdnSrc($window){function cdnSrcFilter(input){input="string"==typeof input?input:"number"==typeof input?input.toString():"";var output=$window.ASSETS_RELATIVE_PATH+input+"?cv="+$window.ASSETS_VERSION;return output}return cdnSrcFilter}function charlimit($filter){function charlimitFilter(input,maxLimit,disable){input="string"==typeof input?input:"number"==typeof input?input.toString():"",maxLimit="number"==typeof maxLimit?maxLimit:48,disable="boolean"==typeof disable&&disable;var output="";return output=disable||input.length<=maxLimit?input:$filter("limitTo")(input,maxLimit).trim()+"..."}return charlimitFilter}function charlimitHtml(){function charlimitHtmlFilter(input,maxLimit,disable,maxLimitExceededCallback){if(input="string"==typeof input?input:"number"==typeof input?input.toString():"",maxLimit="number"==typeof maxLimit?maxLimit:48,disable="boolean"==typeof disable&&disable,maxLimitExceededCallback="function"==typeof maxLimitExceededCallback?maxLimitExceededCallback:function(){},disable)return input;for(var output="",count=0,parsedHtml=j$.parseHTML(input)||[],i=0;i<parsedHtml.length;i++){var domNode=parsedHtml[i],nodeName=domNode.nodeName,isMathjaxNode="INLINE-FORMULA"===nodeName||"FORMULA"===nodeName,isTextNode=3===domNode.nodeType,nodeText=domNode.textContent,nodeContentLength=isMathjaxNode?1:nodeText.length,nodeHtml=domNode.outerHTML;if(maxLimit<nodeContentLength+count){if(isTextNode){var lengthToMaxLimit=maxLimit-count;count+=lengthToMaxLimit,output+=nodeText.substring(0,lengthToMaxLimit)}else isMathjaxNode&&(count+=nodeContentLength,output+=nodeHtml);output+="...",maxLimitExceededCallback(!0);break}count+=nodeContentLength,output+=isTextNode?nodeText:nodeHtml}return output}return charlimitHtmlFilter}function charlimitAuthorBio($filter){function charlimitAuthorBioFilter(input,maxLimit){input=Array.isArray(input)?input:[],maxLimit="number"==typeof maxLimit?maxLimit:48;for(var output=[],i=0,inputLength=input.length;i<inputLength;i++){var inputElem=input[i];if(!(inputElem.length<=maxLimit)){inputElem=$filter("charlimit")(inputElem,maxLimit),output.push(inputElem);break}output.push(inputElem),maxLimit-=inputElem.length}return output}return charlimitAuthorBioFilter}function charlimitAuthorConcat($filter){function charlimitAuthorConcatFilter(input,maxLimit){input=Array.isArray(input)?input:[],maxLimit="number"==typeof maxLimit?maxLimit:25;for(var output="",i=0,inputLength=input.length;i<inputLength;i++){var inputElem=input[i];output+=inputElem+"; "}return output=output.slice(0,-2),output.length>maxLimit&&(output=$filter("charlimit")(output,maxLimit)),output}return charlimitAuthorConcatFilter}function convertMinutesToHours(){function convertMinutesToHoursFilter(minutes){if(minutes){var hours=parseInt(minutes,10)/60;return hours>=1?hours:minutes}}return convertMinutesToHoursFilter}function convertMinutesToHoursWithLabel(){function convertMinutesToHoursWithLabelFilter(minutes){if(minutes){minutes=parseInt(minutes,10);var value,label,hours=minutes/60;return minutes>=60?(value=hours,label=hours>1?"Hours":"Hour"):(value=minutes,label=minutes>1?"Minutes":"Minute"),value+" "+label}}return convertMinutesToHoursWithLabelFilter}function correctlyEncodeForwardSlash(){function correctlyEncodeForwardSlashFilter(str){return str.replace(/(%252F)/g,"%2F")}return correctlyEncodeForwardSlashFilter}function dehighlight(){function dehighlightFilter(str){return str.replace(/(\[::)|(::\])/g,"")}return dehighlightFilter}function encodeURIComponent(){function encodeURIComponentFilter(item){return window.encodeURIComponent(item)}return encodeURIComponentFilter}function endecaSearchValues(){function endecaSearchValuesFilter(str){return str.replace(/\&amp;/g,".AND.").replace(/\&/g,".AND.").replace(/\=/g,".EQ.").replace(/\+/g,".PLS.").replace(/\#/g,".HSH.").replace(/\(/g,".LB.").replace(/\)/g,".RB.").replace(/\"/g,".QT.")}return endecaSearchValuesFilter}function fileSize(){function fileSizeFilter(input){var numInput=Math.round(Math.abs(+input)),output="";return Number.isNaN(numInput)||(output+=numInput>999e3?Math.round(numInput/1e5)+"Mb":numInput>1e3?Math.round(numInput/1e3)+"Kb":numInput+"b"),output}return fileSizeFilter}function filenameSanitize($filter){function filenameSanitizeFilter(input){input="string"==typeof input?input:"number"==typeof input?input.toString():"";var output="";return output=$filter("xmlTagToDash")(input),output=output.replace(/[^a-zA-Z0-9 _\-.]/g,"-")}return filenameSanitizeFilter}function htmlEntitiesDecode($filter){function htmlEntitiesDecodeFilter(input){input="string"==typeof input?input:"number"==typeof input?input.toString():"";var output="";return output=angular.element("<textarea />").html(input).text()}return htmlEntitiesDecodeFilter}function joinWithComma(){function joinWithCommaFilter(input){return(input||[]).join(", ")}return joinWithCommaFilter}function labelForDuration(){function labelForDurationFilter(minutes){if(minutes){minutes=parseInt(minutes,10);var label,hours=minutes/60;return label=minutes>=60?hours>1?"Hours":"Hour":minutes>1?"Minutes":"Minute"}}return labelForDurationFilter}function letterFromNumber(){return function(input){return"abcdefghijklmnopqrstuvwxyz".charAt(input).toUpperCase()}}function slug(){function slugFilter(str){return str.trim().toLowerCase().replace(/^%20|%20$/g,"").replace(/%20|[^a-z0-9]+/g,"-")}return slugFilter}function toTitleCase(){function toTitleCaseFilter(str){return str.replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()})}return toTitleCaseFilter}function unslug($filter,utilService){function unslugFilter(str){return str=utilService.convertToString(str),$filter("toTitleCase")(str.trim().replace(/-/g," "))}return unslugFilter}function xmlTagToDash(){function xmlTagToDashFilter(input){input="string"==typeof input?input:"number"==typeof input?input.toString():"";for(var output="",parsedHtml=j$.parseHTML(input)||[],i=0;i<parsedHtml.length;i++){var domNode=parsedHtml[i],isTextNode=3===domNode.nodeType,nodeText=domNode.textContent;output+=isTextNode?nodeText:"-"}return output}return xmlTagToDashFilter}angular.module("xpl.common").filter("addBreakAtSpace",addBreakAtSpace).filter("authorSearchLink",authorSearchLink).filter("cdnSrc",cdnSrc).filter("charlimit",charlimit).filter("charlimitAuthorBio",charlimitAuthorBio).filter("charlimitAuthorConcat",charlimitAuthorConcat).filter("charlimitHtml",charlimitHtml).filter("convertMinutesToHours",convertMinutesToHours).filter("convertMinutesToHoursWithLabel",convertMinutesToHoursWithLabel).filter("correctlyEncodeForwardSlash",correctlyEncodeForwardSlash).filter("dehighlight",dehighlight).filter("encodeURIComponent",encodeURIComponent).filter("endecaSearchValues",endecaSearchValues).filter("fileSize",fileSize).filter("filenameSanitize",filenameSanitize).filter("htmlEntitiesDecode",htmlEntitiesDecode).filter("joinWithComma",joinWithComma).filter("labelForDuration",labelForDuration).filter("letterFromNumber",letterFromNumber).filter("slug",slug).filter("toTitleCase",toTitleCase).filter("unslug",unslug).filter("xmlTagToDash",xmlTagToDash),authorSearchLink.$inject=["$filter","$log"],cdnSrc.$inject=["$window"],charlimit.$inject=["$filter"],charlimitAuthorBio.$inject=["$filter"],charlimitAuthorConcat.$inject=["$filter"],filenameSanitize.$inject=["$filter"],htmlEntitiesDecode.$inject=["$filter"],unslug.$inject=["$filter","utilService"]}(),function(){function facetService(){
  function extractContentTypeFacet(facetsArray){if(Array.isArray(facetsArray)&&facetsArray.length){var contentTypeFacetIndex=-1;return facetsArray.some(function(facet,index){facet&&facet.name&&"Content Type"===facet.name&&(contentTypeFacetIndex=index)}),contentTypeFacetIndex>-1?facetsArray.splice(contentTypeFacetIndex,1)[0]:void 0}}function getFacet(value){if(facetService.facets){var facet=facetService.facets.filter(function(x){return x.name==value});return facet.length?facet[0]:void 0}}function removeFacet(value){var facet=_.remove(facetService.facets,function(f){return f.name.toLowerCase()===value.toLowerCase()});return facet.length?facet[0]:void 0}var facetService={facets:void 0,extractContentTypeFacet:extractContentTypeFacet,getFacet:getFacet,removeFacet:removeFacet};return facetService}angular.module("xpl.common").factory("facetService",facetService)}(),function(){angular.module("xpl.common").constant("publisherConstants",{OUP:"OUP"})}(),function(){function getParameters(){var parameters={};return parameters[QUERY_PARAMETERS.within]={array:!0},parameters[QUERY_PARAMETERS.refinements]={array:!0},parameters[QUERY_PARAMETERS.range]={array:!0},parameters}function generateUrl(isSearchModule){var url="?";return Object.keys(QUERY_PARAMETERS).forEach(function(key){url+="{"+QUERY_PARAMETERS[key]+"}&"}),isSearchModule&&(url+="{"+CONTENT_TYPE+"}&"),url}var QUERY_PARAMETERS={query:"queryText",refinements:"refinements",range:"ranges",sort:"sortType",combineQuery:"combineQuery",matchBoolean:"matchBoolean",page:"pageNumber",rowsPerPage:"rowsPerPage",within:"searchWithin",openAccess:"openAccess",subscribed:"subscribed",fileCabinet:"fileCabinet",newsearch:"newsearch",punumber:"punumber",searchField:"searchField",promo:"promo",history:"history",selectedValue:"selectedValue",selectActive:"showActiveTitlesOnly"},CONTENT_TYPE="contentType",BROWSE_CONTENT_TYPE="browseContentType";angular.module("xpl.common").constant("queryConstants",{appendRouteUrl:generateUrl,parameters:getParameters,CONTENT_TYPE:CONTENT_TYPE,BROWSE_CONTENT_TYPE:BROWSE_CONTENT_TYPE})}(),function(){function sceDecorator($delegate){function parseAsText(html){return decodeURI($("<p>"+encodeURI(html)+"</p>").text())}return $delegate.parseAsText=parseAsText,$delegate}angular.module("xpl.common").config(["$provide",function($provide){$provide.decorator("$sce",sceDecorator)}]),sceDecorator.$inject=["$delegate"]}(),function(){function typeaheadService($http,$log,api,queryConstants,utilService){function getSuggestions(params,term,name,id){var requestData=cleanUpContentType(params),endpoint=api.typeahead.browse,success=getSuggestionsSuccess;return requestData.searchRefinementTerm=term,id&&(endpoint=api.typeahead.search,success=getSearchSuggestionsSuccess,requestData.searchRefinementId=id,name&&(requestData.refinementName=name)),$http.post(endpoint,requestData).then(success)["catch"](getSuggestionsFailure)}function getSuggestionsSuccess(response){return response.data}function getSearchSuggestionsSuccess(response){return response.data[0]?response.data[0].children:{}}function getSuggestionsFailure(error){$log.error(error)}function cleanUpContentType(params){var convertedParams=utilService.clone(params),browseContentTypeParam=convertedParams[queryConstants.BROWSE_CONTENT_TYPE];return browseContentTypeParam&&(convertedParams[queryConstants.CONTENT_TYPE]=browseContentTypeParam,delete convertedParams[queryConstants.BROWSE_CONTENT_TYPE]),convertedParams}var typeaheadService={getSuggestions:getSuggestions};return typeaheadService}angular.module("xpl.common").factory("typeaheadService",typeaheadService),typeaheadService.$inject=["$http","$log","api","queryConstants","utilService"]}(),function(){function unauthorizedInterceptor($q,$window){function responseError(rejection){return 401===rejection.status&&$window.location.reload(),$q.reject(rejection)}var unauthorizedInterceptor={responseError:responseError};return unauthorizedInterceptor}angular.module("xpl.common").factory("unauthorizedInterceptor",unauthorizedInterceptor),unauthorizedInterceptor.$inject=["$q","$window"]}(),function(){function userService($http,$log,$q){function getUser(){return userService.user?userService.user:{institute:!1,member:!1,guest:!1}}function setUser(user){user&&(user.preferences=user.userPreferencesInfo||{},userService.user=user)}function setPreferences(){angular.noop()}function getUserType(userInfo){if(userInfo=userInfo||userService.user,"undefined"!=typeof userInfo){if(userInfo.institute===!0)return"Institute";if(userInfo.individual===!0)return"Individual";if(userInfo.member===!0)return"Member";if(userInfo.guest===!0)return"Guest"}return"Anonymous"}function getUserInstitutionId(userInfo){if(userInfo=userInfo||userService.user,"undefined"!=typeof userInfo&&userInfo.userIds instanceof Array&&userInfo.userIds.length>0&&userInfo.institute===!0)return userInfo.userIds[0]}function getUserId(userInfo){if(userInfo=userInfo||userService.user,"undefined"!=typeof userInfo&&userInfo.userIds instanceof Array&&userInfo.userIds.length>0){if(userInfo.institute===!1&&userInfo.individual===!0)return userInfo.userIds[0];if(userInfo.institute===!0&&userInfo.individual===!0)return userInfo.userIds[1]}}function getProducts(userInfo){return userInfo=userInfo||userService.user,"undefined"!=typeof userInfo&&userInfo.products instanceof Array&&userInfo.products.length>0?userInfo.products.toString():"undefined"!=typeof userInfo?userInfo.products:void 0}function fetchUserInfo(){return $http({method:"GET",url:USER_INFO_URL,cache:!1}).then(function(response){return setUser(response.data),response.data},function(errorResponse){$log.error("ERROR in fetching user info;",errorResponse)})}function getUserInfo(unCache){return _userInfo&&!unCache?$q(function(resolve,reject){resolve(_userInfo)}):$http({method:"POST",url:USER_INFO_URL,cache:!1}).then(getUserInfoSuccess)["catch"](getUserInfoFailure)}function getUserInfoSuccess(response){var userInfo=response.data;return userInfo.preferences=userInfo.userPreferencesInfo||{},_userInfo=userInfo}function getUserInfoFailure(error){$log.error(error)}var _userInfo,USER_INFO_URL="/rest/user/info",userService={user:void 0,getUser:getUser,setUser:setUser,setPreferences:setPreferences,getUserType:getUserType,getUserInstitutionId:getUserInstitutionId,getUserId:getUserId,getProducts:getProducts,fetchUserInfo:fetchUserInfo,getUserInfo:getUserInfo};return userService}angular.module("xpl.common").factory("userService",userService),userService.$inject=["$http","$log","$q"]}(),function(){function utilService(){function brackets2customHtmlEntity(str){return isEmptyStr(str)?str:str.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function brackets2htmlEntity(str){return isEmptyStr(str)?str:str.replace(/</g,"&#60;").replace(/>/g,"&#62;")}function clone(obj){return JSON.parse(JSON.stringify(obj))}function convertToKebabCase(input){return input=convertToString(input),input.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase()}function convertToString(input){var output="";return"string"==typeof input?output=input:"number"==typeof input&&(output=input.toString()),output}function decodeHtmlEntity(str){return str.replace(/&#(\d+);/g,function(match,dec){return String.fromCharCode(dec)})}function encodeHtmlEntity(str){for(var buf=[],i=str.length-1;i>=0;i--)buf.unshift(["&#",str[i].charCodeAt(),";"].join(""));return buf.join("")}function equalsIgnoreCase4str(str1,str2){return!(!isTruty4str(str1)||!isTruty4str(str2))&&!(!isTruty4str(str1)||!isTruty4str(str2)||str1.toLowerCase()!==str2.toLowerCase())}function findKey(obj,predicate){for(var keys=Object.keys(obj),i=0;i<keys.length;i++)if(predicate(obj[keys[i]]))return keys[i]}function flattenArrayObject(ary,props){if(!props.length)return ary;var prop=props.shift(),newAry=ary.reduce(function(acc,current){var curr="undefined"==typeof current[prop]?current:current[prop];return acc.concat(curr)},[]);return flattenArrayObject(newAry,props)}function get(obj,str,notFound){if(!obj||!str)return notFound;var value=searchValue(obj,str.split("."));return value?value:notFound}function searchValue(obj,props){if(obj){var p=props.shift();return props.length<1?obj[p]:searchValue(obj[p],props)}}function isEmpty(value){return!value||(Array.isArray(value)?!value.length:!Object.keys(value).length)}function isEmptyStr(str){return!!("string"==typeof str&&str||"").match(/^\s*$/)}function isTruty4str(str){return!(!str||"string"!=typeof str)}function string2Hash(str){var i,chr,len,hash=0;if(0===str.length)return hash;for(i=0,len=str.length;i<len;i++)chr=str.charCodeAt(i),hash=(hash<<5)-hash+chr,hash|=0;return Math.abs(hash)}function words(string,pattern){var reWords=function(){var upper="[A-Z\\xc0-\\xd6\\xd8-\\xde]",lower="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(upper+"+(?="+upper+lower+")|"+upper+"?"+lower+"|"+upper+"+|[0-9]+","g")}();return string=baseToString(string),string.match(pattern||reWords)||[]}function baseToString(value){return null==value?"":value+""}var utilService={brackets2customHtmlEntity:brackets2customHtmlEntity,brackets2htmlEntity:brackets2htmlEntity,clone:clone,convertToKebabCase:convertToKebabCase,convertToString:convertToString,decodeHtmlEntity:decodeHtmlEntity,encodeHtmlEntity:encodeHtmlEntity,equalsIgnoreCase4str:equalsIgnoreCase4str,findKey:findKey,flattenArrayObject:flattenArrayObject,get:get,isEmpty:isEmpty,isEmptyStr:isEmptyStr,isTruty4str:isTruty4str,string2Hash:string2Hash,words:words};return utilService}angular.module("xpl.common").factory("utilService",utilService)}(),function(){angular.module("xpl.widget").directive("addthisToolbox",function(){return{restrict:"A",transclude:!0,replace:!0,template:"<div ng-transclude></div>",scope:{share:"=",config:"="},link:function($scope,element,attrs){return!1}}})}(),function(){function appendToHref($window){function link(scope,element,attrs){function initialize(){element.on("click",onClick)}function onClick(e){return e.preventDefault(),$window.location.href=e.currentTarget.href+scope.appendToHref,!1}initialize()}var directive={link:link,restrict:"A",scope:{appendToHref:"@"}};return directive}angular.module("xpl.widget").directive("appendToHref",appendToHref),appendToHref.$inject=["$window"]}(),function(){function xplDisplayer($timeout,xplDisplayerOptions){function link(scope,element){var opt=xplDisplayerOptions;$timeout(function(){var control=element.find("."+opt.controlClass),content=element.find("."+opt.contentClass);control.on("click",function(){control.hasClass(opt.activeClass)?(control.removeClass(opt.activeClass),content.slideUp(opt.animateSpeed)):(control.addClass(opt.activeClass),content.slideDown(opt.animateSpeed))})})}var directive={link:link,restrict:"A"};return directive}angular.module("xpl.widget").directive("xplDisplayer",xplDisplayer).constant("xplDisplayerOptions",{controlClass:"js-displayer-control",contentClass:"js-displayer-content",activeClass:"active",animateSpeed:250}),xplDisplayer.$inject=["$timeout","xplDisplayerOptions"]}(),function(){function xplDisqus($window){return{restrict:"E",scope:{config:"="},template:'<div id="disqus_thread"></div><a href="http://disqus.com" class="dsq-brlink"></a>',link:function(scope){function configChanged(){if(scope.config.disqus_shortname&&scope.config.disqus_identifier&&scope.config.disqus_url)if($window.disqus_shortname=scope.config.disqus_shortname,$window.disqus_identifier=scope.config.disqus_identifier,$window.disqus_url=scope.config.disqus_url,$window.disqus_title=scope.config.disqus_title,$window.disqus_category_id=scope.config.disqus_category_id,$window.disqus_disable_mobile=scope.config.disqus_disable_mobile,$window.disqus_config=function(){this.language=scope.config.disqus_config_language,this.page.remote_auth_s3=scope.config.disqus_remote_auth_s3,this.page.api_key=scope.config.disqus_api_key,this.sso=scope.config.disqus_sso,scope.config.disqus_on_ready&&(this.callbacks.onReady=[function(){scope.config.disqus_on_ready()}])},$window.DISQUS)$window.DISQUS.reset({reload:!0,config:function(){this.page.identifier=scope.config.disqus_identifier,this.page.url=scope.config.disqus_url,this.page.title=scope.config.disqus_title,this.language=scope.config.disqus_config_language,this.page.remote_auth_s3=scope.config.disqus_remote_auth_s3,this.page.api_key=scope.config.disqus_api_key}});else{var dsq=document.createElement("script");dsq.type="text/javascript",dsq.async=!0,dsq.src="//"+scope.config.disqus_shortname+".disqus.com/embed.js",(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(dsq)}}scope.$watch("config",configChanged,!0)}}}angular.module("xpl.widget").directive("xplDisqus",xplDisqus),xplDisqus.$inject=["$window"]}(),function(){function xplHighlight($timeout){function link(scope,element){$timeout(function(){var highlightedText,text=element.html();highlightedText=text.replace(/\[::/g,'<span class="highlight">').replace(/::\]/g,"</span>"),element.html(highlightedText)})}var directive={link:link,restrict:"A"};return directive}angular.module("xpl.widget").directive("xplHighlight",xplHighlight),xplHighlight.$inject=["$timeout"]}(),function(){function events(){return{priority:200,restrict:"A",controller:["$scope","$element","$attrs","$anchorScroll","$state","$location",function($scope,$element,$attrs,$anchorScroll,$state,$location){$scope.$watch($attrs.bindEvents,function(texExpression){function inlineReferences(referenceData){function findReference(referenceArray,anchor){return $.grep(referenceArray,function(item){return item.id==anchor})}function clearPopup(){window.hidePopupTimeout&&clearTimeout(window.hidePopupTimeout)}function hidePopupDelay(){window.hidePopupTimeout=setTimeout(hidePopup,750)}function hidePopup(){ref_pop.removeClass("flip").hide(),all_refs.removeClass("popup_active")}var all_refs=jQuery("#BodyWrapper").find('a[ref-type^="bibr"]');if(all_refs.length){jQuery("body").append('<div id="ref_popup" class="ref"></div>');var ref_pop=jQuery("#ref_popup"),max=jQuery("#article").offset().left+jQuery("#article").width(),width=ref_pop.width();all_refs.click(function(){jQuery("#references-section").find(".toggle-btn").parent().siblings("div.content").slideDown(),clearPopup(),hidePopup()}),all_refs.hover(function(e){var anchor=jQuery(this).attr("anchor"),reference=findReference(referenceData.references,anchor);clearPopup(),hidePopup();var left=jQuery(this).offset().left+19;left+width/2>max&&(left-=width+30,ref_pop.addClass("flip")),jQuery(this).addClass("popup_active"),ref_pop.show().css({top:jQuery(this).offset().top+"px",left:left+"px"}).html('<div class="header"></div><div class="body"></div><div class="footer"></div>');var html=(ref_pop.find("div.footer"),"<p><b>"+reference[0].order+".</b> "+reference[0].text+"</p>");jQuery("#ref_popup .body").append(html),jQuery("#ref_popup .footer").append('<a class="reference-link">View All References</a>'),jQuery("#ref_popup").on("click",".reference-link",function(){$state.go("document.full",{q:null,ctx:"references",part:null,tab:"references",section:null,anchor:null,tabfilter:null})})},function(e){hidePopupDelay()}),ref_pop.hover(function(e){clearPopup(),jQuery(this).show()},function(e){hidePopupDelay()})}}function addTableZoom(){function zoom_table(table_src){var layout_el=jQuery("#LayoutWrapper"),new_win=jQuery('<div class="table-win" />'),close_btn=jQuery('<span class="button"><span>X CLOSE</span></span>');close_btn.click(function(){jQuery(this).parent(".table-win").remove()}),new_win.append(close_btn);var new_img=jQuery(table_src);new_win.append(new_img),layout_el.prepend(new_win)}var parent_el=jQuery("#BodyWrapper"),all_tables=parent_el.find("div.figure.figure-full.table"),tbl_lnks=all_tables.find("div.zoom");tbl_lnks.click(function(){return zoom_table(jQuery(this.closest("div.figure.figure-full.table")).html()),!1})}function addImageZoom(){function zoom(img_src,alt_txt){var layout_el=jQuery("#LayoutWrapper"),new_win=jQuery('<div class="fig-win" />'),close_btn=jQuery('<span class="button"><span>X CLOSE</span></span>');layout_el.find("div.fig-win").remove(),close_btn.click(function(){jQuery(this).parent(".fig-win").remove()}),new_win.append(close_btn);var new_img=jQuery('<img src="'+img_src+'" alt="'+alt_txt+'" />');new_win.append(new_img),layout_el.prepend(new_win)}var parent_el=jQuery("#BodyWrapper"),all_figs_tables=parent_el.find("div.figure"),fig_lnks=all_figs_tables.find("div.img-wrap a");fig_lnks.click(function(){return zoom(jQuery(this).attr("href"),jQuery(this).find("img").attr("alt")),!1})}function linkNavigation(){function fullTextLink(){var link=j$(this),id=link.attr("anchor"),part=link.attr("part");id=id.replace("#",""),part==currentPart?($location.hash(id),$anchorScroll()):$state.go("document.full",{section:null,part:part+"|"+id,q:null,ctx:null,anchor:null})}function footNoteLink(){$state.go("document.full",{q:null,ctx:"footnotes",part:null,section:null,anchor:null})}jQuery("#article").on("click",".fulltext-link",fullTextLink),jQuery("#article").on("click",".footnote-link",footNoteLink),jQuery("#ref_popup").on("click",".fulltext-link",fullTextLink)}$element.html(texExpression);var currentPart=$scope.$eval($attrs.currentPart),referenceData=$scope.$eval($attrs.referenceData);$element.on("click","span.formula span.link",function(){var this_frml_trig=j$(this);this_frml_trig.toggleClass("open_lnk"),this_frml_trig.siblings("span.tex2jax_ignore").toggle()}),linkNavigation(),inlineReferences(referenceData),addImageZoom(),addTableZoom()})}]}}function footnoteEvents(){return{priority:200,restrict:"A",controller:["$scope","$element","$attrs","$anchorScroll","$state","$location",function($scope,$element,$attrs,$anchorScroll,$state,$location){function fullTextLink(){var link=j$(this),id=link.attr("anchor"),part=link.attr("part");id=id.replace("#",""),$state.go("document.full",{section:null,part:part+"|"+id,q:null,ctx:null,anchor:null})}function referenceLink(){$state.go("document.full",{q:null,ctx:"references",part:null,section:null,anchor:null})}jQuery("#footnotes-section").on("click",".reference-section",referenceLink),jQuery("#footnotes-section").on("click",".fulltext-link",fullTextLink)}]}}angular.module("xpl.widget").directive("bindEvents",events),angular.module("xpl.widget").directive("contextEvents",footnoteEvents)}(),function(){function jwplayerAngular($compile){return{restrict:"EC",scope:{playerId:"@",setupVars:"=setup"},link:function(scope,element,attrs){var id=scope.playerId||"random_player_"+Math.floor(999999999*Math.random()+1),getTemplate=function(playerId){return'<div id="'+playerId+'"></div>'};element.html(getTemplate(id)),$compile(element.contents())(scope),jwplayer(id).setup(scope.setupVars)}}}angular.module("xpl.widget").directive("jwplayer",jwplayerAngular),jwplayerAngular.$inject=["$compile"]}(),function(){function xplLazyLoad($window){function link(scope,element,attrs){var originalHeight=angular.element($window)[0].screen.height,toggleHeight=.9*originalHeight;angular.element($window).bind("scroll",function(){var y=angular.element($window)[0].scrollY||angular.element($window)[0].pageYOffset;y>=toggleHeight&&angular.element($window)[0].requestAnimationFrame(function(){scope.$apply(attrs.xplLazyLoad),toggleHeight+=1.5*originalHeight})})}var directive={link:link,restrict:"A"};return directive}angular.module("xpl.widget").directive("xplLazyLoad",xplLazyLoad),xplLazyLoad.$inject=["$window"]}(),function(){function mathjax($timeout){function postLink(scope,elem,attrs){MathJax.Hub.Config({"HTML-CSS":{styles:{".MathJax_Display":{"overflow-x":"auto"}}}}),scope.$watch(attrs.mathjaxBind,function(newVal,oldVal,scope){$timeout(function(){MathJax.Hub.Queue(["Typeset",MathJax.Hub,elem[0]])},0)})}return{priority:100,restrict:"A",link:{post:postLink}}}angular.module("xpl.widget").directive("mathjaxBind",mathjax),mathjax.$inject=["$timeout"]}(),function(){function overflowEllipsis(){return{priority:100,restrict:"A",link:overFlowEllipsisLink}}function overFlowEllipsisLink(scope,elem,attr){function getDomElemWidth(){return domElem.scrollWidth}function watchForOverflow(){var jqliteElem=angular.element(domElem),className="overflow-ellipsis-parent";domElem.offsetWidth<domElem.scrollWidth?jqliteElem.parent().addClass(className):jqliteElem.parent().removeClass(className)}var domElem=elem[0];scope.$watch(getDomElemWidth,watchForOverflow)}angular.module("xpl.widget").directive("overflowEllipsis",overflowEllipsis)}(),function(){function xplAccordion($state,documentConstants,accordionService){return{priority:100,controller:xplAccordionController,restrict:"A"}}function xplAccordionController($scope,documentConstants,accordionService){$scope.selected=accordionService.selectedElem,$scope.resetSideScroll=function(){$scope.$root.$broadcast(documentConstants.events.resetFullTextRightRailScroll)},$scope.toggleSection=function(section){j$("#"+section+"-section-container");$scope.selected.section===section?$scope.selected.section="":$scope.selected.section=section}}angular.module("xpl.widget").directive("xplAccordion",xplAccordion),xplAccordion.$inject=["$state","documentConstants","accordionService"],xplAccordionController.$inject=["$scope","documentConstants","accordionService"]}(),function(){function CollabratecController($element,$scope,collabratecService){function onExportClick(){Xplore.component.globalNotification.options.autoHide=!1,collabratecService.exportRecords(selectedItems.join(",")).then(onExportSuccess,onExportFailure)}function onExportSuccess(response){Xplore.component.globalNotification.show(composeNotification(response.message))}function onExportFailure(error){Xplore.component.globalNotification.show('<div class="Notification-collabratec"><span class="Notification-collabratec-total-failed">IEEE Collabratec&trade; is currently unavailable. Please try again later.</span></div>')}function composeNotification(response){var notification='<div class="Notification-collabratec">',totalSuccess=response.totalSucceeded+response.totalDuplicates,totalFailed=response.totalFailed;return totalSuccess>0&&(notification+='<span class="Notification-collabratec-total">'+totalSuccess+(totalSuccess>1?" records":" record")+" successfully exported.</span>"),totalFailed>0&&(notification+='<span class="Notification-collabratec-total Notification-collabratec-total-failed">'+totalFailed+(totalFailed>1?" records":" record")+" failed to export.</span>"),notification+='<a href="'+collabratecService.url+'" target="_blank" class="Notification-collabratec-link stats-ppct-notification">View in IEEE Collabratec&trade;</a></div>'}var selectedItems=$scope.selectedItems;this.selectedItemsLength=selectedItems.length,this.noItemsSelected=selectedItems.length<1,this.render,this.onExportClick=onExportClick,this.onClose=$scope.close,$element.addTag({tagNode:".stats-search-ppct",tagName:"EXPORT_COLLABRATEC",analyticType:"unica"})}angular.module("xpl.widget").controller("CollabratecController",CollabratecController),CollabratecController.$inject=["$element","$scope","collabratecService"]}(),function(){function DocumentFigureController($scope,$element){var vm=this,attrs=$scope.$parent.attrs;vm.figure=JSON.parse(attrs.figure)}angular.module("xpl.widget").controller("DocumentFigureController",DocumentFigureController),DocumentFigureController.$inject=["$scope","$element"]}(),function(){function DocumentSearchController($element,$scope,$state,searchService,userService){function validate(){return ssc.param.length<3?(ssc.hasErrors=!0,ssc.validationErrors="Minimum search length is 3 characters.",!1):(ssc.hasErrors=!1,ssc.validationErrors=null,!0)}function onEnter($event){13==$event.keyCode&&onGoClick()}function onGoClick(){validate()&&(search(ssc.param),$element.trigger("qtip-popover-close"))}function search(str){$state.go($state.current.name,{q:str,ctx:null,part:null,anchor:null})}var ssc=this;ssc.param="",ssc.hasErrors=!1,ssc.validationErrors=null,ssc.onGoClick=onGoClick,ssc.onEnter=onEnter}angular.module("xpl.widget").controller("DocumentSearchController",DocumentSearchController),DocumentSearchController.$inject=["$element","$scope","$state","searchService","userService"]}(),function(){function DocumentTextResizerController($scope,$element){var vm=this,attrs=$scope.$parent.attrs,$content=$(attrs.contentSelector);vm.value=$content.css("font-size").replace("px",""),vm.min=parseInt(attrs.minSize||"12"),vm.max=parseInt(attrs.maxSize||"18"),vm.minStyle={"font-size":vm.min+"px"},vm.maxStyle={"font-size":vm.max+"px"},vm.reset=function(){$content.removeAttr("style"),vm.value=$content.css("font-size").replace("px","")},vm.onChange=function(){$content.css({"font-size":vm.value+"px"})}}angular.module("xpl.widget").controller("DocumentTextResizerController",DocumentTextResizerController),DocumentTextResizerController.$inject=["$scope","$element"]}(),function(){function DownloadCitationsController($scope,userService,downloadCitationsService){function initFormat(){return userPreferences?userPreferences.dowloadFormat:FORMAT_DEFAULT}function initInclude(format){return userPreferences?userPreferences.dowloadCitationFormat:INCLUDE_DEFAULT}function download(){downloadCitationsService.getCitations($ctrl.formData.items.value,$ctrl.formData.include,$ctrl.formData.format).then(downloadCitationsService.loadNewWindowCitationResponse)}var FORMAT_DEFAULT="download-ascii",INCLUDE_DEFAULT="citation-only",selectedItems=$scope.selectedItems&&$scope.selectedItems.length>0?$scope.selectedItems:[],userPreferences=userService.getUser().userPreferencesInfo,$ctrl=this;$ctrl.selectedItemsLength=selectedItems.length,$ctrl.disableInputs=0===$ctrl.selectedItemsLength,$ctrl.formData={items:{name:"recordIds",value:selectedItems.join(",")},format:initFormat(),include:initInclude(initFormat())},$ctrl.download=download,$ctrl.close=$scope.close}angular.module("xpl.widget").controller("DownloadCitationsController",DownloadCitationsController),DownloadCitationsController.$inject=["$scope","userService","downloadCitationsService"]}(),function(){function DownloadSearchResultsController($scope){function download(){j$("form#DownloadSearchResults").submit()}var selectedItems=$scope.selectedItems&&$scope.selectedItems.length>0?$scope.selectedItems:[],$ctrl=this;$ctrl.selectedItemsLength=selectedItems.length,$ctrl.formData={name:$ctrl.selectedItemsLength>0?"ar":"bulkSetSize",value:$ctrl.selectedItemsLength>0?selectedItems.join(","):"2000"},$ctrl.download=download,$ctrl.close=$scope.close}angular.module("xpl.widget").controller("DownloadSearchResultsController",DownloadSearchResultsController),DownloadSearchResultsController.$inject=["$scope"]}(),function(){function EmailPopoverController($scope,$state,$http,vcRecaptchaService){function onClick(form){return $scope.emailer.errorMessage="",$scope.submitted=!0,""===vcRecaptchaService.getResponse()||void 0===vcRecaptchaService.getResponse()||null===vcRecaptchaService.getResponse()?($scope.emailer.errorMessage="Please resolve the captcha and other required fields before submit.",void($scope.emailer.showNotification=!0)):void(form.$invalid||this.sendEmail())}function sendEmail(){$http.get(EMAILER_ENDPOINT,{params:{your_name:this.name,your_email:this.myemail,recipients_email:this.recipient,recordIds:selectedItem,optional_message:this.optional_message,"g-recaptcha-response":vcRecaptchaService.getResponse()}}).error(function(data,status,headers,config){onResponse(data)}).success(function(data,status,headers,config){onResponse(data)})}function onResponse(responseData){responseData.status?(Xplore.component.globalNotification.show(responseData.message),$scope.close()):(vcRecaptchaService.reload(),$scope.emailer.errorMessage=responseData.message,$scope.emailer.showNotification=!0)}var EMAILER_ENDPOINT="/xpl/ngCaptchaEmailArticles",selectedItem=$state.params.id;this.name="",this.myemail="",this.recipient="",this.optional_message="",this.showNotification=!1,this.errorMessage,this.publicKey=RECAPTCHA_PUBLIC_KEY,this.onClick=onClick,this.sendEmail=sendEmail,this.onResponse=onResponse}angular.module("xpl.widget").controller("EmailPopoverController",EmailPopoverController),EmailPopoverController.$inject=["$scope","$state","$http","vcRecaptchaService"]}(),function(){function ManageAlertsPopoverController($scope,$element,$log,documentService,userService){function addCitationAlert(artnum){var user=userService.getUser();user&&(user.member||user.guest||user.individual)?documentService.addCitationAlert(artnum).then(addCitationAlertSuccess)["catch"](addCitationAlertFailure):Xplore.component.globalNotification.show("Login with an individual account to add Citation Alerts")}function addCitationAlertSuccess(data){var confirmMsg="<span>This document has been added to Citation Alerts</span>&nbsp;&nbsp;";confirmMsg+='<a class="Notification-button-link" href="/xpl/citation_alerts.jsp">Manage Citation Alerts</a>',Xplore.component.globalNotification.options.autoHide=!1,Xplore.component.globalNotification.show(confirmMsg)}function addCitationAlertFailure(error){Xplore.component.globalNotification.show("An unexpected error occurred. Try again or contact customer service."),$log.error(error)}var vm=this,attrs=$scope.$parent.attrs;vm.artnum=attrs.artnum,vm.addCitationAlert=addCitationAlert}angular.module("xpl.widget").controller("ManageAlertsPopoverController",ManageAlertsPopoverController),ManageAlertsPopoverController.$inject=["$scope","$element","$log","documentService","userService"]}(),function(){function SearchAlertController($scope,searchService,userService){function onSaveClick(){this.alertName.trim().length<1?(this.errorMessage=NULL_ALERT_ERROR,this.showNotification=!0):!this.alertName.match(ALERT_NAME_REGEX)||this.alertName.length>40?(this.errorMessage=INVALID_NAME_ERROR,this.showNotification=!0):(this.showNotification=!1,searchService.setAlert(this.alertName).then(onSetAlert))}function onSetAlert(response){response.data.status?(Xplore.component.globalNotification.show(response.data.message),$scope.close()):($scope.searchAlert.errorMessage=response.data.message,$scope.searchAlert.showNotification=!0)}var ALERT_NAME_REGEX=/^[A-Za-z0-9\s]+$/,INVALID_NAME_ERROR="Alert name can contain up to 40 alpha-numeric characters.",NULL_ALERT_ERROR="Alert Name is a required field.";this.email=userService.getUser().emailAddress,this.alertName="",this.showNotification=!1,this.errorMessage="",this.onSaveClick=onSaveClick,this.onSetAlert=onSetAlert}angular.module("xpl.widget").controller("SearchAlertController",SearchAlertController),SearchAlertController.$inject=["$scope","searchService","userService"]}(),function(){function xplBreadcrumb($timeout,searchState){function link(scope,element){$timeout(function(){function onClick(node){var crumb=generateFacet(node);isLastCrumb()?removeCollection():removeCrumb(this),searchState.pop(crumb.facet,crumb.value),"Content Type"===scope.breadcrumb.key&&searchState.pop(searchState.$facets.contentType),searchState.update()}function removeCrumb(crumb){var $crumb=$(crumb).parents(".js-crumb");$crumb.animate({opacity:0},250),$timeout(function(){$crumb.animate({width:0},{easing:"easeInOutCubic",duration:500,complete:function(){$crumb.remove()}})},500)}function removeCollection(){element.animate({height:0},{easing:"easeInOutCubic",duration:250,complete:function(){element.remove()}})}function isLastCrumb(){return 1===element.find(".js-crumb").length}function generateFacet(crumb){return crumb.id=crumb.id.toString(),"refinement"===crumb.type&&(crumb.type="refinements"),"search"===crumb.type&&(crumb.type=searchState.$params[searchState.$facets.query]===crumb.id?"query":"within"),{facet:searchState.$facets[crumb.type],value:crumb.id}}scope.onClick=onClick})}var directive={link:link,replace:!0,restrict:"EA",templateUrl:"widget/breadcrumbs/breadcrumb.html",scope:{breadcrumb:"=",noLabel:"="}};return directive}angular.module("xpl.widget").directive("xplBreadcrumb",xplBreadcrumb),xplBreadcrumb.$inject=["$timeout","searchState"]}(),function(){function xplCmptBreadcrumb(){return{bindToController:{first:"=",active:"=",value:"=",link:"=",onClick:"="},controller:BreadcrumbComponent,controllerAs:"$ctrl",replace:!0,restrict:"E",
  scope:{},template:['<li class="widget-crumb" ng-class="{\'widget-crumb-first\': $ctrl.first, active: $ctrl.active}">','<a ng-click="$ctrl.activateCrumb()">{{$ctrl.value}}</a>',"</li>"].join("")}}function BreadcrumbComponent($window){function init(){$ctrl.activateCrumb=activateCrumb}function activateCrumb(){$ctrl.active||($ctrl.onClick&&$ctrl.onClick(),$ctrl.link&&($window.location.href=$ctrl.link))}var $ctrl=this;init()}angular.module("xpl.widget").directive("xplCmptBreadcrumb",xplCmptBreadcrumb),BreadcrumbComponent.$inject=["$window"]}(),function(){function xplCmptBreadcrumbs(){return{bindToController:{breadcrumbs:"="},controller:BreadcrumbsComponent,controllerAs:"$ctrl",replace:!0,restrict:"E",scope:{},template:['<div class="widget-breadcrumbs">',"<ul>",'<xpl-cmpt-breadcrumb ng-repeat="crumb in $ctrl.breadcrumbs track by $index"',' active="crumb.active" value="crumb.value" link="crumb.link" on-click="crumb.onClick" first="$index === 0">',"</xpl-cmpt-breadcrumb>","</ul>","</div>"].join("")}}function BreadcrumbsComponent(){function init(){}init()}angular.module("xpl.widget").directive("xplCmptBreadcrumbs",xplCmptBreadcrumbs)}(),function(){function xplBreadstick(){function link(scope,element,attrs){}var directive={link:link,restrict:"EA",templateUrl:"widget/breadstick/breadstick.html",scope:{crumbs:"="}};return directive}angular.module("xpl").directive("xplBreadstick",xplBreadstick)}(),function(){function xplButtonGroup(searchState,$sce,$stateParams,userService){function link(scope,element){function toggleContent(){scope.allContent=!scope.allContent}function showButtonGroup(){var user=userService.getUser();return!(!user.institute&&!user.member||!user.guest)&&void("standards"===$stateParams.browseContentType)}scope.showButtonGroup=showButtonGroup(),scope.allContent=!0,scope.toggleContent=toggleContent}var directive={link:link,restrict:"EA",scope:{keyword:"="},templateUrl:"widget/button-group/button-group.html"};return directive}angular.module("xpl").directive("xplButtonGroup",xplButtonGroup),xplButtonGroup.$inject=["searchState","$sce","$stateParams","userService"]}(),function(){function xplCarousel(documentConstants){function controller($log,$scope,$state,documentConstants,utilsService,accordionService){$scope.prevPage=function(){$scope.currentPage<=0||($scope.currentPage-=1,setPagingStates())},$scope.nextPage=function(){$scope.currentPage>=$scope.totalPages-1||($scope.currentPage+=1,setPagingStates())},$scope.gotoPage=function(page){page<0||page>$scope.totalPages-1||($scope.currentPage=page,setPagingStates())},$scope.isCurrentPage=function(page){return $scope.currentPage===page};var setPagingStates=function(){$scope.hasPrevPage=$scope.currentPage>0,$scope.hasNextPage=$scope.totalPages-1>$scope.currentPage};$scope.navToViewAllState=function(viewAllState,anchor){if(!viewAllState.name)return void $log.error("View All State name not provided");viewAllState.params||(viewAllState.params={});var anchorToUse="undefined"==typeof anchor?viewAllState.params.anchor:anchor;"citations"===viewAllState.params.tab||"references"===viewAllState.params.tab||"authors"===viewAllState.params.tab?(utilsService.scrollTo(viewAllState.params.tab+"-anchor",120),accordionService.selectedElem.section=viewAllState.params.tab,$scope.$root.$broadcast(documentConstants.events.resetFullTextRightRailScroll)):$state.current.name===viewAllState.name&&$state.params.ctx==viewAllState.params.ctx&&$state.params.section==viewAllState.params.section?anchorToUse?($state.go(viewAllState.name,{anchor:anchorToUse},{notify:!1}),utilsService.scrollTo(anchorToUse,80)):utilsService.scrollTo("full-text-section",80):(anchorToUse&&(viewAllState.params.anchor=anchorToUse),$state.go(viewAllState.name,viewAllState.params))};var init=function(){$scope.currentPage=0,$scope.pageSize=parseInt($scope.pageSize||3),$scope.totalItems=$scope.items.length||0,$scope.totalPages=Math.ceil($scope.totalItems/$scope.pageSize),$scope.pages=Array.apply(null,Array($scope.totalPages)).map(function(x,i){return i}),$scope.carouselSizeClass="carousel-size-"+$scope.pageSize,setPagingStates()};init(),$scope.$watchGroup(["items","pageSize"],init)}var directive={controller:controller,replace:!0,restrict:"EA",templateUrl:"widget/carousel/carousel.html",transclude:!0,scope:{items:"=",itemTemplateUrl:"@",pageSize:"@",viewAllState:"="}};return directive}angular.module("xpl.widget").directive("xplCarousel",xplCarousel),xplCarousel.$inject=["documentConstants"]}(),function(){function xplCollectionTabs(browseConstants){function link(scope,element){function getCurIndex(){return curCollectionIndex}function switchCollectionTab(index){curCollectionIndex=index,scope.curCollectionTopics=scope.collectionTabs[curCollectionIndex].topics}scope.switchCollectionTab=switchCollectionTab,scope.getCurIndex=getCurIndex;var curCollectionIndex=0;scope.collectionTabs=browseConstants.standardsCollections,switchCollectionTab(curCollectionIndex)}var directive={link:link,scope:{user:"="},restrict:"EA",replace:!0,templateUrl:"widget/collection-tabs/collection-tabs.html"};return directive}angular.module("xpl").directive("xplCollectionTabs",xplCollectionTabs),xplCollectionTabs.$inject=["browseConstants"]}(),function(){function xplDocumentSearchItems($injector){function prelink($scope){$scope.getContextUrl=function(){return"widget/document/"+$scope.context+".html"}}function postlink($scope){var $jumpLink=$("#jump-link");$jumpLink.qtip({content:{text:$jumpLink.next("div")},hide:{event:"unfocus"},position:{my:"top center",at:"bottom center"},show:{event:"click",solo:!0},style:{classes:"qtip-popover all-figures-jump-toc document-toc"}})}function xplDocumentContext($anchorScroll,$location,$log,$state,productService){function initialize(){"citations"===vm.context&&(vm.loadCitationType=void 0,vm.loadMoreCitations=loadMoreCitations)}function gotoFullText(id){$state.go("document.full",{q:null,section:id,ctx:null,anchor:null})}function scrollTo(id){$location.hash(id),$anchorScroll(),$jumpLink.qtip().hide()}function loadMoreCitations(type){vm.loading=!0,type=type||"ieee",vm.loadCitationType=type;var citations;citations="ieee"===type||"nonIeee"===type?vm.contextData.paperCitations[type]:vm.contextData[type+"Citations"];var params={type:type,start:citations.length+1,count:100};productService.getProductDetail(vm.articleNumber,vm.context,params).then(getProductDetailSuccess)["catch"](catchPromiseFailure)}function getProductDetailSuccess(data){"ieee"===vm.loadCitationType||"nonIeee"===vm.loadCitationType?vm.contextData.paperCitations[vm.loadCitationType]=vm.contextData.paperCitations[vm.loadCitationType].concat(data.paperCitations[vm.loadCitationType]):"patent"===vm.loadCitationType&&(vm.contextData[vm.loadCitationType+"Citations"]=vm.contextData[vm.loadCitationType+"Citations"].concat(data[vm.loadCitationType+"Citations"])),vm.loading=!1}function catchPromiseFailure(error){$log.error(error),vm.error=!0,vm.loading=!1}var vm=this,$jumpLink=$("#jump-link");vm.loading=!1,vm.error=!1,vm.gotoFullText=gotoFullText,vm.scrollTo=scrollTo,initialize()}var directive={bindToController:{articleNumber:"@",context:"@",contextData:"="},link:{post:postlink,pre:prelink},replace:!0,restrict:"EA",controllerAs:"vm",controller:xplDocumentContext,scope:{context:"@"},template:'<div ng-include="getContextUrl()"></div>'};return xplDocumentContext.$inject=["$anchorScroll","$location","$log","$state","productService"],directive}angular.module("xpl.widget").directive("xplDocumentContext",xplDocumentSearchItems),xplDocumentSearchItems.$inject=["$injector"]}(),function(){function xplReferenceItem(){return{bindToController:{item:"="},controller:ReferenceItemComponent,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"widget/document/reference-item.html",transclude:!0}}function ReferenceItemComponent(){}angular.module("xpl.common").directive("xplReferenceItem",xplReferenceItem)}(),function(){function xplDocumentSearchItems($injector){function link($scope){}function xplDocumentSearchController($state,$location,$anchorScroll,$stateParams){function gotoFullText(part,id){$state.go("document.full",{part:part+"|"+id,section:null,ctx:null,q:vm.queryText,anchor:null})}var vm=this;vm.items=vm.searchReferences.response.result,vm.count=vm.searchReferences.response.count,vm.gotoFullText=gotoFullText,vm.queryText=$stateParams.q}var directive={bindToController:{searchReferences:"="},link:link,replace:!0,restrict:"EA",controllerAs:"vm",controller:xplDocumentSearchController,scope:{},templateUrl:"widget/document/search-items.html"};return directive}angular.module("xpl.widget").directive("xplDocumentSearchItems",xplDocumentSearchItems),xplDocumentSearchItems.$inject=["$injector"]}(),function(){function xplDynamicContent($compile){function link(scope,element,attrs){var el;attrs.$observe("content",function(tpl){angular.isDefined(tpl)&&(el=$compile(tpl)(scope),element.html(el))})}var directive={replace:!0,restrict:"A",scope:!0,link:link};return directive}angular.module("xpl.widget").directive("xplDynamicContent",xplDynamicContent),xplDynamicContent.$inject=["$compile"]}(),function(){function FacetContentTypeComponent(searchState){function $onInit(){}function onContentTypeToggle(toggledCtypeId){var toggleCtypeIndex=$ctrl.selectedContentTypes.indexOf(toggledCtypeId);toggleCtypeIndex>-1?$ctrl.selectedContentTypes.splice(toggleCtypeIndex,1):$ctrl.selectedContentTypes.push(toggledCtypeId)}function updateRefinements(){searchState.push(searchState.$facets.refinements,$ctrl.selectedContentTypes).update()}var $ctrl=this;$ctrl.selectedContentTypes=[],$ctrl.onContentTypeToggle=onContentTypeToggle,$ctrl.updateRefinements=updateRefinements,$ctrl.$onInit=$onInit}var xplFacetContentType={bindings:{facet:"<"},controller:FacetContentTypeComponent,templateUrl:"widget/facets/facet-content-type.component.html"};FacetContentTypeComponent.$inject=["searchState"],angular.module("xpl.widget").component("xplFacetContentType",xplFacetContentType)}(),function(){function xplFacetDate(resultsContainerResizerService,searchState){function link(scope,element){function onClickButton(){var queryParam=scope.range[0]+"_"+scope.range[1]+"_"+scope.name.replace(/\ /g,"_");searchState.clear(searchState.$facets.range).push(searchState.$facets.range,queryParam).update()}function watchRange(newValue,oldValue){newValue!==oldValue&&(scope.showApply=!0,resultsContainerResizerService.resizeContainer())}function updateRange(){var range0=parseInt(scope.sliderRange[0]),range1=parseInt(scope.sliderRange[1]);scope.sliderRange[0]=getClosestValue(range0),scope.sliderRange[1]=getClosestValue(range1),scope.range=angular.copy(scope.sliderRange),scope.$apply()}function onKeyUpInput(e){scope.range[0]>scope.range[1]||8!==e.keyCode&&(38!==e.keyCode&&40!==e.keyCode||getPreviousOrNext(e),e.shiftKey||e.keyCode>57&&e.keyCode<91||e.keyCode>105&&e.keyCode<112||e.keyCode>145?e.preventDefault():scope.isRange?scope.sliderRange=angular.copy(scope.range):scope.range[1]=scope.range[0])}function syncSlider(e){var currentValue=e.currentTarget.value,rangeID="from"===e.currentTarget.name?0:1;scope.range[rangeID]=getClosestValue(currentValue),scope.range[0]>scope.range[1]&&(scope.range[1]=scope.range[0]),scope.sliderRange=angular.copy(scope.range)}function onBlurInput(e){syncSlider(e)}function getClosestValue(input){if(!scope.values.indexOf(parseInt(input))!==-1){var previous,length=scope.values.length;if(length<2)return scope.values[length-1];for(previous=Math.abs(scope.values[--length]-input);length--&&!(previous<(previous=Math.abs(scope.values[length]-input))););return scope.values[length+1]}return input}function getPreviousOrNext(e){var currentIndex=scope.values.indexOf(parseInt(getClosestValue(e.currentTarget.value))),rangeID="from"===e.currentTarget.name?0:1;38===e.keyCode?currentIndex<scope.values.length-1&&(scope.range[rangeID]=scope.values[currentIndex+1]):currentIndex>0&&(scope.range[rangeID]=scope.values[currentIndex-1]),e.preventDefault()}function toggleRange(){scope.isRange=!scope.isRange,scope.isRange?(scope.range[1]=scope.values[scope.values.length-1],scope.sliderRange=angular.copy(scope.range)):scope.range[1]=scope.range[0]}function toNumber(entry){var num=parseInt(entry.name);if("number"==typeof num&&isFinite(num))return num}scope.values=scope.entries.map(toNumber),scope.range=[scope.values[0],scope.values[scope.values.length-1]],scope.sliderRange=angular.copy(scope.range),scope.toggleRange=toggleRange,scope.$watchCollection("range",watchRange),scope.showApply=!1,scope.onKeyUpInput=onKeyUpInput,scope.onBlurInput=onBlurInput,scope.updateRange=updateRange,scope.isRange=!0,element.find("button[type=submit]").on("click",onClickButton)}var directive={link:link,templateUrl:"widget/facets/facet-date.html",scope:{entries:"=",name:"="},replace:!0,requires:"^xplFacet",restrict:"EA"};return directive}angular.module("xpl.widget").directive("xplFacetDate",xplFacetDate),xplFacetDate.$inject=["resultsContainerResizerService","searchState"]}(),function(){function xplFacetList($state,resultsContainerResizerService,typeaheadService){function link(scope,element,attrs){function getSuggestions(term,refinement){return typeaheadService.getSuggestions($state.params,term,refinement.name,refinement.id)}function onClick(id,state){toggleSelection(id,state)}function onSelect(item){toggleSelection(item.id,item.isChecked)}function getDisplayLimit(){return"Publisher"===refinement.name||"Content Type"===refinement.name?refinement.children.length:attrs.displayLimit}function getPlaceholderText(){var placeholder="Enter ",refinementName=refinement.name.split(/[, ]+/).pop();return placeholder+="Author"===refinementName||"Country"===refinementName?refinementName+" Name":refinementName}function toggleSelection(id,state){state?scope.$parent.selected.push(id):scope.$parent.selected.pop(id),resultsContainerResizerService.resizeContainer()}function viewMore(){scope.displayLimit=refinement.children.length,resultsContainerResizerService.resizeContainer()}var refinement=scope.$parent.refinement;scope.displayLimit=getDisplayLimit(),scope.placeholder=getPlaceholderText(),scope.searchThreshold=24,scope.showMore=refinement.children.length>scope.displayLimit,scope.onClick=onClick,scope.onSelect=onSelect,scope.getSuggestions=getSuggestions,scope.viewMore=viewMore}var directive={link:link,replace:!0,requires:"^xplFacet",restrict:"EA",scope:!1,templateUrl:"widget/facets/facet-list.html"};return directive}angular.module("xpl.widget").directive("xplFacetList",xplFacetList),xplFacetList.$inject=["$state","resultsContainerResizerService","typeaheadService"]}(),function(){function xplFacetNest(){function link(scope,element,attrs){}var directive={link:link,replace:!0,requires:"^xplFacet",restrict:"EA",scope:!1,templateUrl:"widget/facets/facet-nest.html"};return directive}angular.module("xpl.widget").directive("xplFacetNest",xplFacetNest)}(),function(){function FacetsCtrl($scope,$log,$filter,searchState){function updateRefinements(){searchState.push(searchState.$facets.refinements,$scope.selected).update()}function init(){$scope.refinement=$scope.$parent.refinement||$scope.FacetsCtrl.refinement,$scope.refinement.name.indexOf("Year")!==-1?$scope.facetType="date":"nest"===$scope.refinement.type&&($scope.facetType="nest")}$scope.active=!1,$scope.selected=[],$scope.facetType="list",$scope.parseInt=parseInt,$scope.updateRefinements=updateRefinements,init()}angular.module("xpl.widget").controller("FacetsCtrl",FacetsCtrl),FacetsCtrl.$inject=["$scope","$log","$filter","searchState"]}(),function(){function xplFacet(resultsContainerResizerService){function link(scope,element,attrs,controller){var $displayToggle=element.find(".js-toggle"),$displayTitle=element.find(".js-header"),$content=element.find(".js-content");controller.facetId<1&&($content.show(),scope.active=!0),$displayTitle.on("click",function(){var slideCompleteFunc=controller.shouldResizeContainer?resultsContainerResizerService.resizeContainer:void 0;$displayToggle.hasClass("fa-angle-down")?$content.slideDown(250,slideCompleteFunc):$content.slideUp(250,slideCompleteFunc)})}var xplFacet={link:link,templateUrl:"widget/facets/facet.html",controller:"FacetsCtrl as FacetsCtrl",bindToController:!0,replace:!0,restrict:"EA",scope:{refinement:"=",facetId:"<",shouldResizeContainer:"<"}};return xplFacet}angular.module("xpl.widget").directive("xplFacet",xplFacet),xplFacet.$inject=["resultsContainerResizerService"]}(),function(){var MODULE_NAME,SLIDER_TAG,angularize,contain,events,gap,halfWidth,hide,module,offset,offsetLeft,pixelize,qualifiedDirectiveDefinition,roundStep,show,sliderDirective,width;MODULE_NAME="ui.slider",SLIDER_TAG="slider",angularize=function(element){return angular.element(element)},pixelize=function(position){return""+position+"px"},hide=function(element){return element.css({opacity:0})},show=function(element){return element.css({opacity:1})},offset=function(element,position){return element.css({left:position})},halfWidth=function(element){return element[0].offsetWidth/2},offsetLeft=function(element){return element[0].offsetLeft},width=function(element){return element[0].offsetWidth},gap=function(element1,element2){return offsetLeft(element2)-offsetLeft(element1)-width(element1)},contain=function(value){return isNaN(value)?value:Math.min(Math.max(0,value),100)},roundStep=function(value,precision,step,floor){var decimals,remainder,roundedValue,steppedValue;return null===floor&&(floor=0),null===step&&(step=1/Math.pow(10,precision)),remainder=(value-floor)%step,steppedValue=remainder>step/2?value+step-remainder:value-remainder,decimals=Math.pow(10,precision),roundedValue=steppedValue*decimals/decimals,parseFloat(roundedValue.toFixed(precision))},events={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend"}},sliderDirective=function($timeout){return{restrict:"E",scope:{floor:"@",ceiling:"@",values:"=?",step:"@",highlight:"@",precision:"@",buffer:"@",dragstop:"@",ngModel:"=?",ngModelLow:"=?",ngModelHigh:"=?"},template:'<div class="bar"><div class="selection"></div></div>\n<div class="handle low"></div><div class="handle high"></div>\n<div class="bubble limit low">{{ values.length ? values[floor || 0] : floor }}</div>\n<div class="bubble limit high">{{ values.length ? values[ceiling || values.length - 1] : ceiling }}</div>\n<div class="bubble value low">{{ values.length ? values[local.ngModelLow || local.ngModel || 0] : local.ngModelLow || local.ngModel || 0 }}</div>\n<div class="bubble value high">{{ values.length ? values[local.ngModelHigh] : local.ngModelHigh }}</div>',compile:function(element,attributes){var high,low,range,watchables;return range=null===attributes.ngModel&&null!==attributes.ngModelLow&&null!==attributes.ngModelHigh,low=range?"ngModelLow":"ngModel",high="ngModelHigh",watchables=["floor","ceiling","values",low],range&&watchables.push(high),{post:function(scope,element,attributes){var bar,barWidth,bound,ceilBub,dimensions,e,flrBub,handleHalfWidth,highBub,lowBub,maxOffset,maxPtr,maxValue,minOffset,minPtr,minValue,ngDocument,offsetRange,selection,updateDOM,upper,valueRange,w,_i,_j,_len,_len1,_ref,_ref1;if(_ref=function(){var _i,_len,_ref,_results;for(_ref=element.children(),_results=[],_i=0,_len=_ref.length;_i<_len;_i++)e=_ref[_i],_results.push(angularize(e));return _results}(),bar=_ref[0],minPtr=_ref[1],maxPtr=_ref[2],flrBub=_ref[3],ceilBub=_ref[4],lowBub=_ref[5],highBub=_ref[6],selection=angularize(bar.children()[0]),!range){for(_ref1=[maxPtr,highBub],_i=0,_len=_ref1.length;_i<_len;_i++)upper=_ref1[_i],upper.remove();attributes.highlight||selection.remove()}for(scope.local={},scope.local[low]=scope[low],scope.local[high]=scope[high],bound=!1,ngDocument=angularize(document),handleHalfWidth=barWidth=minOffset=maxOffset=minValue=maxValue=valueRange=offsetRange=void 0,dimensions=function(){var value,_j,_len1,_ref2;for(null===scope.step&&(scope.step=1),null===scope.floor&&(scope.floor=0),null===scope.precision&&(scope.precision=0),range||(scope.ngModelLow=scope.ngModel),(null!==(_ref2=scope.values)?_ref2.length:void 0)&&null===scope.ceiling&&(scope.ceiling=scope.values.length-1),scope.local[low]=scope[low],scope.local[high]=scope[high],_j=0,_len1=watchables.length;_j<_len1;_j++)value=watchables[_j],"number"==typeof value&&(scope[value]=roundStep(parseFloat(scope[value]),parseInt(scope.precision),parseFloat(scope.step),parseFloat(scope.floor)));return handleHalfWidth=halfWidth(minPtr),barWidth=width(bar),minOffset=0,maxOffset=barWidth-width(minPtr),minValue=parseFloat(scope.floor),maxValue=parseFloat(scope.ceiling),valueRange=maxValue-minValue,offsetRange=maxOffset-minOffset},updateDOM=function(){var bind,percentOffset,percentValue,pixelsToOffset,setBindings,setPointers;return dimensions(),percentOffset=function(offset){return contain((offset-minOffset)/offsetRange*100)},percentValue=function(value){return contain((value-minValue)/valueRange*100)},pixelsToOffset=function(percent){return pixelize(percent*offsetRange/100)},setPointers=function(){var newHighValue,newLowValue;switch(offset(ceilBub,pixelize(barWidth-width(ceilBub))),newLowValue=percentValue(scope.local[low]),offset(minPtr,pixelsToOffset(newLowValue)),offset(lowBub,pixelize(offsetLeft(minPtr)-halfWidth(lowBub)+handleHalfWidth)),offset(selection,pixelize(offsetLeft(minPtr)+handleHalfWidth)),!0){case range:return newHighValue=percentValue(scope.local[high]),offset(maxPtr,pixelsToOffset(newHighValue)),offset(highBub,pixelize(offsetLeft(maxPtr)-halfWidth(highBub)+handleHalfWidth)),selection.css({width:pixelsToOffset(newHighValue-newLowValue)});case"right"===attributes.highlight:return selection.css({width:pixelsToOffset(110-newLowValue)});case"left"===attributes.highlight:return selection.css({width:pixelsToOffset(newLowValue)}),offset(selection,0)}},bind=function(handle,bubble,ref,events){var currentRef,onEnd,onMove,onStart;return currentRef=ref,onEnd=function(){return bubble.removeClass("active"),handle.removeClass("active"),ngDocument.unbind(events.move),ngDocument.unbind(events.end),scope.dragstop&&(scope[high]=scope.local[high],scope[low]=scope.local[low]),currentRef=ref,scope.$apply()},onMove=function(event){var eventX,newOffset,newPercent,newValue,_ref2,_ref3,_ref4,_ref5;if(eventX=event.clientX||(null!==(_ref2=event.touches)&&null!==(_ref3=_ref2[0])?_ref3.clientX:void 0)||(null!==(_ref4=event.originalEvent)&&null!==(_ref5=_ref4.changedTouches)?_ref5[0].clientX:void 0)||0,newOffset=eventX-element[0].getBoundingClientRect().left-handleHalfWidth,newOffset=Math.max(Math.min(newOffset,maxOffset),minOffset),newPercent=percentOffset(newOffset),newValue=minValue+valueRange*newPercent/100,range)switch(currentRef){case low:newValue>scope.local[high]?(currentRef=high,minPtr.removeClass("active"),lowBub.removeClass("active"),maxPtr.addClass("active"),highBub.addClass("active"),setPointers()):scope.buffer>0&&(newValue=Math.min(newValue,scope.local[high]-scope.buffer));break;case high:newValue<scope.local[low]?(currentRef=low,maxPtr.removeClass("active"),highBub.removeClass("active"),minPtr.addClass("active"),lowBub.addClass("active"),setPointers()):scope.buffer>0&&(newValue=Math.max(newValue,parseInt(scope.local[low])+parseInt(scope.buffer)))}return newValue=roundStep(newValue,parseInt(scope.precision),parseFloat(scope.step),parseFloat(scope.floor)),scope.local[currentRef]=newValue,scope.dragstop||(scope[currentRef]=newValue),setPointers(),scope.$apply()},onStart=function(event){return dimensions(),bubble.addClass("active"),handle.addClass("active"),setPointers(),event.stopPropagation(),event.preventDefault(),ngDocument.bind(events.move,onMove),ngDocument.bind(events.end,onEnd)},handle.bind(events.start,onStart)},setBindings=function(){var method,_j,_len1,_ref2;for(_ref2=["touch","mouse"],_j=0,_len1=_ref2.length;_j<_len1;_j++)method=_ref2[_j],bind(minPtr,lowBub,low,events[method]),bind(maxPtr,highBub,high,events[method]);return bound=!0},bound||setBindings(),setPointers()},$timeout(updateDOM),_j=0,_len1=watchables.length;_j<_len1;_j++)w=watchables[_j],scope.$watch(w,updateDOM,!0);return window.addEventListener("resize",updateDOM)}}}}},qualifiedDirectiveDefinition=["$timeout",sliderDirective],(module=function(window,angular){return angular.module(MODULE_NAME,[]).directive(SLIDER_TAG,qualifiedDirectiveDefinition)})(window,window.angular)}.call(void 0),function(){function xplFigure($injector){function link($scope){$scope.figureTypeClass="figure-"+$scope.layout}var directive={link:link,replace:!0,restrict:"EA",scope:{figure:"=",layout:"@"},controllerAs:"vm",controller:function($state,$location,$anchorScroll){var vm=this;vm.scrollTo=function(part,id){id=id.replace("#",""),$state.go("document.full",{part:part+"|"+id,section:null,ctx:null,q:null,anchor:null})}},templateUrl:"widget/figures/figure.html"};return directive}angular.module("xpl.widget").directive("xplFigure",xplFigure),xplFigure.$inject=["$injector"]}(),function(){function xplFigures(){function Figurescontroller($scope,$attrs){function initialize(){if(void 0!==vm.figures){var mediaPath="";null!==vm.mediaPath&&""!==vm.mediaPath&&(mediaPath=vm.mediaPath+"/");var maxlimit=30;vm.figures.length>maxlimit&&"all"!==$attrs.layout&&vm.figures.splice(30,vm.figures.length-30);for(var i=0;i<vm.figures.length;i++){var figure=vm.figures[i];figure.graphic.glance=mediaPath+figure.graphic.glance,figure.graphic.large=mediaPath+figure.graphic.large,figure.graphic.hires=mediaPath+figure.graphic.hires,figure.graphic.small=mediaPath+figure.graphic.small}}}var vm=this;vm.figuresTypeClass="figures-"+$scope.layout,initialize()}var directive={controller:Figurescontroller,bindToController:{figures:"=",layout:"@",mediaPath:"@"},replace:!0,controllerAs:"vm",restrict:"EA",templateUrl:"widget/figures/figures.html",transclude:!0,scope:{}};return directive}angular.module("xpl.widget").directive("xplFigures",xplFigures)}(),function(){function FilterPopoverContentController($injector,$scope){function $onInit(){$ctrl.xariaAttrs.ariaOwns&&($ctrl.xariaAttrs.ariaOwns.enabled=!0)}function $onDestroy(){$ctrl.xariaAttrs.ariaOwns&&($ctrl.xariaAttrs.ariaOwns.enabled=!1),$scope.$apply()}function onOptionSelect(newOption){$ctrl.service.onChange(newOption),$ctrl.onNgChange&&"function"==typeof $ctrl.onNgChange&&$ctrl.onNgChange(),$ctrl.close&&"function"==typeof $ctrl.close&&$ctrl.close()}var $ctrl=this;$ctrl.$onInit=$onInit,$ctrl.$onDestroy=$onDestroy,$ctrl.onOptionSelect=onOptionSelect}var xplCmptFilterPopoverContent={bindings:{selectedValue:"=",service:"=",onNgChange:"&",xariaAttrs:"=",isKeyboardNavigated:"<",close:"<"},controller:FilterPopoverContentController,templateUrl:"widget/filter/filter-popover-content.component.html"};FilterPopoverContentController.$inject=["$injector","$scope"],angular.module("xpl.widget").component("xplFilterPopoverContent",xplCmptFilterPopoverContent)}(),function(){function xplFilterPopoverTabbableOption(){function link(scope,element,attrs,xplFilterPopoverContentController){scope.selected&&xplFilterPopoverContentController.isKeyboardNavigated&&element.focus(),scope.first&&element.on("keydown",function(e){e.shiftKey&&9===e.which&&xplFilterPopoverContentController.close()}),scope.last&&element.on("keydown",function(e){e.shiftKey||9!==e.which||xplFilterPopoverContentController.close()})}var directive={require:"^xplFilterPopoverContent",link:link,scope:{selected:"<",first:"<",last:"<"}};return directive}angular.module("xpl.widget").directive("xplFilterPopoverTabbableOption",xplFilterPopoverTabbableOption)}(),function(){function FilterPopoverController($injector,userService){function $onInit(){var mappedStyling=serviceNameToStyleMap[$ctrl.serviceName];$ctrl.styling=mappedStyling?mappedStyling:sortbyStyling,$ctrl.xariaAttrs={ariaOwns:{name:$ctrl.serviceName+"Listbox",enabled:!1}}}function $onChanges(changes){var changedTotalRecords=changes.totalRecords;changedTotalRecords.currentValue!==changedTotalRecords.previousValue&&($ctrl.service=new($injector.get($ctrl.serviceName))(changedTotalRecords.currentValue,$ctrl.label),$ctrl.selectedValue=$ctrl.service.defaultItem())}var sortbyStyling={qTipClassName:"qtip-filter-sortby",isLabelBolded:!1,mobileIconClassName:"action-bar-icon-sort"},user=userService.getUser(),serviceNameToStyleMap={ShowTypeFilterService:{qTipClassName:user.subscribedContent?"qtip-filter-showtype-subscribed":"qtip-filter-showtype",isLabelBolded:!0,mobileIconClassName:"action-bar-icon-show"},PagingFilterService:{qTipClassName:"qtip-filter-paging",isLabelBolded:!0,mobileIconClassName:"action-bar-icon-page"},SortByFilterService:sortbyStyling},$ctrl=this;$ctrl.selectedValue={},$ctrl.qtipStyle={},$ctrl.xariaAttrs={},$ctrl.$onInit=$onInit,$ctrl.$onChanges=$onChanges}var xplCmptFilterPopover={bindings:{serviceName:"@",onNgChange:"&",totalRecords:"<",label:"@",mobileLabel:"@"},controller:FilterPopoverController,templateUrl:"widget/filter/filter-popover.component.html"};FilterPopoverController.$inject=["$injector","userService"],angular.module("xpl.widget").component("xplFilterPopover",xplCmptFilterPopover)}(),function(){function FilterController($injector){function $onInit(){$ctrl.onChange=function(newVal){$ctrl.service.onChange(newVal),$ctrl.onNgChange&&$ctrl.onNgChange()}}function $onChanges(changes){var changedTotalRecords=changes.totalRecords;changedTotalRecords.currentValue!==changedTotalRecords.previousValue&&($ctrl.service=new($injector.get($ctrl.serviceName))(changedTotalRecords.currentValue,$ctrl.label),$ctrl.selectedValue=$ctrl.service.defaultItem())}var $ctrl=this;$ctrl.selectedValue,$ctrl.$onInit=$onInit,$ctrl.$onChanges=$onChanges}var xplCmptFilter={bindings:{serviceName:"@",onNgChange:"&",totalRecords:"<",label:"@"},controller:FilterController,templateUrl:"widget/filter/filter.component.html"};FilterController.$inject=["$injector"],angular.module("xpl.widget").component("xplFilter",xplCmptFilter)}(),function(){function directive($state,$timeout,browseConstants){function link(scope,element,attrs){var content,contentType=scope.record.contentType;$timeout(function(){content=element.find(".js-history-content"),scope.showHistory&&content.slideDown()}),"conferences"===contentType&&void 0!==scope.record.titleHistory&&(contentType+="Home"),scope.historyUri=browseConstants.historyUris[contentType],scope.showHistory=!!$state.params.queryText,scope.toggleHistory=function(){scope.showHistory?(scope.showHistory=!1,content.slideUp()):(scope.showHistory=!0,content.slideDown())}}var directive={link:link,restrict:"E",scope:{record:"="},templateUrl:"widget/items/browse-result.html"};return directive}angular.module("xpl.widget").directive("xplBrowseResult",directive),directive.$inject=["$state","$timeout","browseConstants"]}(),function(){function xplLittleLinks($rootScope,$stateParams){function link(scope){scope.title=$stateParams.browseContentType&&"standards"===$stateParams.browseContentType?"Browse Standard Range":"Browse Titles"}var directive={link:link,restrict:"EA",scope:{index:"=",selected:"="},templateUrl:"widget/little-links/little-links.html"};return directive}angular.module("xpl").directive("xplLittleLinks",xplLittleLinks),xplLittleLinks.$inject=["$rootScope","$stateParams"]}(),function(){angular.module("xpl.widget").constant("xplPaginationConstants",{itemsPerPage:25,boundaryLinks:!0,directionLinks:!0,firstText:"« First",previousText:"<",nextText:">",lastText:"Last »",rotate:!0,maxSize:5})}(),function(){function xplPagination($parse,xplPaginationConstants){function link(scope,element,attrs,ctrls){function getConfigParameter(parameter){return angular.isDefined(attrs[parameter])?scope.$parent.$eval(attrs[parameter]):xplPaginationConstants[parameter]}function getPages(currentPage,totalPages){var pages=[],startPage=1,endPage=totalPages,isMaxSized=angular.isDefined(maxSize)&&maxSize<totalPages;isMaxSized&&(rotate?(startPage=Math.max(currentPage-Math.floor(maxSize/2),1),endPage=startPage+maxSize-1,endPage>totalPages&&(endPage=totalPages,startPage=endPage-maxSize+1)):(startPage=(Math.ceil(currentPage/maxSize)-1)*maxSize+1,endPage=Math.min(startPage+maxSize-1,totalPages)));
  for(var number=startPage;number<=endPage;number++){var page=makePage(number,number,number===currentPage);pages.push(page)}if(isMaxSized&&!rotate){if(startPage>1){var previousPageSet=makePage(startPage-1,"...",!1);pages.unshift(previousPageSet)}if(endPage<totalPages){var nextPageSet=makePage(endPage+1,"...",!1);pages.push(nextPageSet)}}return pages}function makePage(number,text,isActive){return{number:number,text:text,active:isActive}}function newRender(){originalRender(),scope.page>0&&scope.page<=scope.totalPages&&(scope.pages=getPages(scope.page,scope.totalPages))}function watchMaxSize(value){maxSize=parseInt(value,10),xplPaginationCtrl.render()}var xplPaginationCtrl=ctrls[0],ngModelCtrl=ctrls[1];if(ngModelCtrl){var maxSize=getConfigParameter("maxSize"),rotate=getConfigParameter("rotate");scope.boundaryLinks=getConfigParameter("boundaryLinks"),scope.directionLinks=getConfigParameter("directionLinks"),attrs.maxSize&&scope.$parent.$watch($parse(attrs.maxSize),watchMaxSize),xplPaginationCtrl.init(ngModelCtrl,xplPaginationConstants);var originalRender=xplPaginationCtrl.render;xplPaginationCtrl.render=newRender}}var directive={controller:"xplPaginationController",link:link,replace:!0,require:["xplPagination","?ngModel"],restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},templateUrl:"widget/pagination/pagination.html"};return directive}function xplPaginationController($scope,$attrs,$parse){function getText(key){return $scope[key+"Text"]||self.config[key+"Text"]}function noNext(){return $scope.page===$scope.totalPages}function noPrevious(){return 1===$scope.page}function selectPage(page){$scope.page!==page&&page>0&&page<=$scope.totalPages&&(ngModelCtrl.$setViewValue(page),ngModelCtrl.$render())}function watchTotalItems(){$scope.totalPages=self.calculateTotalPages()}function watchTotalPages(value){setNumPages($scope.$parent,value),$scope.page>value?$scope.selectPage(value):ngModelCtrl.$render()}var self=this,ngModelCtrl={$setViewValue:angular.noop},setNumPages=$attrs.numPages?$parse($attrs.numPages).assign:angular.noop;$scope.selectPage=selectPage,$scope.getText=getText,$scope.noPrevious=noPrevious,$scope.noNext=noNext,$scope.$watch("totalItems",watchTotalItems),$scope.$watch("totalPages",watchTotalPages),this.init=function(ngModelCtrl_,config){ngModelCtrl=ngModelCtrl_,this.config=config,ngModelCtrl.$render=function(){self.render()},$attrs.itemsPerPage?$scope.$parent.$watch($parse($attrs.itemsPerPage),function(value){self.itemsPerPage=parseInt(value,10),$scope.totalPages=self.calculateTotalPages()}):this.itemsPerPage=config.itemsPerPage},this.calculateTotalPages=function(){var totalPages=this.itemsPerPage<1?1:Math.ceil($scope.totalItems/this.itemsPerPage);return Math.max(totalPages||0,1)},this.render=function(){$scope.page=parseInt(ngModelCtrl.$viewValue,10)||1}}angular.module("xpl.widget").controller("xplPaginationController",xplPaginationController).directive("xplPagination",xplPagination),xplPagination.$inject=["$parse","xplPaginationConstants"],xplPaginationController.$inject=["$scope","$attrs","$parse"]}(),function(){function postrenderAction($timeout){function link(scope,element,attrs){$timeout(function(){scope.$evalAsync(attrs.postrenderAction)},0)}var directive={restrict:"A",priority:101,link:link};return directive}angular.module("xpl.widget").directive("postrenderAction",postrenderAction),postrenderAction.$inject=["$timeout"]}(),function(){function qtipPopover($templateCache,$compile,$log,$window,layoutConstants,utilService){function link(scope,element,attrs){function initialize(){var _angular,defaultConfig={content:{text:void 0===scope.qtipText?"<div></div>":"<div>"+scope.qtipText+"</div>",button:!!scope.qtipButtonClose&&jQuery('<div class="qtip-xpl-close"><i class="icon qtip-xpl-close-icon"></i></div>')},style:{classes:"qtip-popover",tip:{width:12,height:7}},show:{event:void 0===scope.qtipEventShow?"click keypress":scope.qtipEventShow,solo:!0,effect:function(e){show(this,!e.mouse)}},hide:{event:!scope.qtipButtonClose&&(void 0===scope.qtipEventHide?"unfocus":scope.qtipEventHide),effect:function(){hide(this,!!scope.focusTriggerOnClose)}},position:{my:"top center",at:"bottom center"}},customConfig={},mobileConfig={},useMobileConfig=jQuery("body").hasClass(layoutConstants.responsiveBodyClassName)&&$window.innerWidth<(scope.qtipConfigMobileMaxViewport+1||layoutConstants.mobileBreakpoint)&&scope.qtipConfigMobile;try{customConfig=angular.fromJson(scope.qtipConfig),useMobileConfig&&(mobileConfig=angular.fromJson(scope.qtipConfigMobile))}catch(e){$log.error(e)}var configsToMerge=[defaultConfig,customConfig];useMobileConfig&&configsToMerge.push(mobileConfig);var config=(_angular=angular).merge.apply(_angular,[{}].concat(configsToMerge));"top left"===config.position.my&&angular.merge(config,{style:{tip:{offset:12,mimic:"center"}},position:{adjust:{x:-6}}}),config.position.target=element,element.qtip(config)}function bindCloseEvents(popover){var closePopover=close(popover);popover.find(".js-popover-close").on("click",closePopover),popover.on("qtip-popover-close",closePopover),element.on("qtip-popover-close",closePopover),scope.close=closePopover}function constructTemplate(popover,isKeyboardNavigated){var template,params={attrs:attrs,close:close(popover)};template=scope.component?"<"+scope.component+" attrs='attrs' close='close' is-keyboard-navigated='"+isKeyboardNavigated+"' "+getCompPropsBindingStr()+"/>":$templateCache.get(PATH_PREFIX+scope.content+".html"),scope.qtipText&&(template=popover.qtip("option","content.text"));var isolateScope=angular.extend(scope.$new(),params);return $compile(template)(isolateScope)}function show(popover,isKeyboardNavigated){var popoverTemplate=constructTemplate(popover,isKeyboardNavigated);popover.qtip("option","content.text",popoverTemplate),bindCloseEvents(popover),element.addClass("js-popover-active"),popover.show(),popover.find("script").hide()}function hide(popover,focusTriggerOnClose){var popoverTemplate=popover.qtip("option","content.text");popoverTemplate&&popoverTemplate.scope()&&popoverTemplate.scope().$destroy(),popover.find(".qtip-content").empty(),popover.hide(),element.removeClass("js-popover-active"),focusTriggerOnClose&&element.focus()}function close(popover){return function(){popover.qtip().hide()}}function getCompPropsBindingStr(){var compPropsBindingStr="",compPropsKeys=scope.componentProps?Object.keys(scope.componentProps):[];return compPropsKeys.length>0&&(compPropsBindingStr+=compPropsKeys.reduce(function(prevStr,propKey){return""+prevStr+utilService.convertToKebabCase(propKey)+"='componentProps."+propKey+"' "},"")),compPropsBindingStr}var PATH_PREFIX="widget/actionbar/";initialize()}var directive={link:link,restrict:"A",scope:{selectedItems:"=",content:"@",component:"@",componentProps:"=",focusTriggerOnClose:"<",individualUser:"=",qtipText:"@",qtipEventShow:"@",qtipEventHide:"@",qtipButtonClose:"=",qtipConfig:"@",qtipConfigMobile:"@",qtipConfigMobileMaxViewport:"<"}};return directive}angular.module("xpl.widget").directive("qtipPopover",qtipPopover),qtipPopover.$inject=["$templateCache","$compile","$log","$window","layoutConstants","utilService"]}(),function(){function xplSearchWithin(){return{bindToController:{placeholder:"@"},controller:SearchWithin,controllerAs:"vm",restrict:"E",scope:{},templateUrl:"widget/search-within/search-within.html"}}function SearchWithin($filter,$sce,$state,searchState,typeaheadService){function searchWithinResults(){if(vm.searchWithin.length>2){var searchWithinFacet=searchState.$facets.within,newSearchFacet=searchState.$facets.newsearch,pageNumberFacet=searchState.$facets.page,sanitizedInput=$filter("endecaSearchValues")($sce.parseAsText(vm.searchWithin));searchState.clear(newSearchFacet).clear(pageNumberFacet).push(searchWithinFacet,sanitizedInput).update()}}function getSuggestions(){return typeaheadService.getSuggestions($state.params,vm.searchWithin,void 0,3410)}var vm=this;vm.searchWithinResults=searchWithinResults,vm.getSuggestions=getSuggestions}angular.module("xpl.widget").directive("xplSearchWithin",xplSearchWithin),SearchWithin.$inject=["$filter","$sce","$state","searchState","typeaheadService"]}();var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};!function(){function xplSearchbar($sce,$state,$window,searchService,searchState,typeaheadService,utilService){function controller($window){function initializeAdditionalFields(){$window.location.href.indexOf("virtual-journals")>-1&&$window.location.href.indexOf("browse")===-1&&($ctrl.withinPublication.isActive=!0)}var $ctrl=this;$ctrl.withinPublication={isActive:!1,checked:!1},initializeAdditionalFields()}function link(scope,element,attrs,$ctrl){function getSuggestions(){return typeaheadService.getSuggestions({newsearch:$state.params.newsearch},scope.search.basic.input.query,void 0,3410)}function onTypeaheadReturn(e){return e.preventDefault(),!1}function submitQuery(e){return e.preventDefault(),!!validate(scope.activeSearchType.input)&&(removeInputs(),void submitSearchForm())}function removeInputs(){Object.keys(scope.search).forEach(function(key){var searchType=scope.search[key];searchType.isActive||Object.keys(searchType.input).forEach(function(key2){searchType.input[key2]=""})})}function validate(inputObj){sanitizeInputObj(inputObj);var flattenedInputs=flattenInputObjToArray(inputObj),validation=Xplore.search.ngTestValidity(flattenedInputs);return validation.isValid?(notification.hide(),!0):(notification.show(Xplore.search.config.warningIcon+Xplore.search.getMessage(validation.errorType)).updateState("error"),!1)}function sanitizeInputObj(inputObj){Object.keys(inputObj).forEach(function(k){var inputValue=inputObj[k];"object"===("undefined"==typeof inputValue?"undefined":_typeof(inputValue))?sanitizeInputObj(inputValue):inputObj[k]=$sce.parseAsText(inputValue)})}function flattenInputObjToArray(inputObj){var output=[];return Object.keys(inputObj).forEach(function(k){var inputValue=inputObj[k];"object"===("undefined"==typeof inputValue?"undefined":_typeof(inputValue))?output=output.concat(flattenInputObjToArray(inputValue)):output.push($sce.parseAsText(inputValue))}),output}function toggleSearchType(searchType){Object.keys(scope.search).forEach(function(key){scope.search[key].isActive=!1}),searchType.isActive=!0,scope.activeSearchType=searchType,notification.hide()}function watchSearchResults(results){if(void 0===results||$state.params.matchBoolean&&"false"!==$state.params.matchBoolean)toggleSearchType(scope.search.basic);else{unbindSearchResults();var breadcrumbs=searchService.searchBreadcrumb,searchType=searchService.queryResult.searchType||"basic";breadcrumbs&&initializeInputs(breadcrumbs,searchType),toggleSearchType(scope.search[searchType])}}function initializeInputs(breadcrumbs,searchType){var inputObj=scope.search[searchType].input;breadcrumbs.forEach(function(breadcrumb){var cleanedBreadcrumbValue=$sce.parseAsText(breadcrumb.value);!inputObj.searchWithin&&breadcrumbMappings[breadcrumb.key]||breadcrumbMappings[breadcrumb.key]&&(inputObj.searchWithin[breadcrumbMappings[breadcrumb.key]]=cleanedBreadcrumbValue)}),inputObj.query=$sce.parseAsText(breadcrumbs[0].value)}function submitSearchForm(){var activeSearchType=scope.activeSearchType;if(searchState.clearAll().push(searchState.$facets.newsearch,"true"),activeSearchType.input.searchWithin&&searchState.push(searchState.$facets.within,crumbInputs()),activeSearchType.input.query){var queryText=activeSearchType.input.query;queryText&&queryText.length>0&&searchState.push(searchState.$facets.query,Xplore.search.replaceSpecialChars(queryText))}activeSearchType.contentType&&searchState.push(searchState.$facets.contentType,activeSearchType.contentType),$ctrl.withinPublication.checked&&searchWithinVirtualJournal(),updateState()}function crumbInputs(){var breadcrumbs=[];return Object.keys(scope.activeSearchType.input.searchWithin).forEach(function(keyValue){var crumb=scope.activeSearchType.input.searchWithin[keyValue];if(crumb.length>0){var key=utilService.findKey(breadcrumbMappings,function(value){return value===keyValue});breadcrumbs.push(key+":"+Xplore.search.replaceSpecialChars(crumb))}}),breadcrumbs}function searchWithinVirtualJournal(){var vjTitle=$window.global&&$window.global.virtualJournals?$window.global.virtualJournals.config.publication_title:null;vjTitle&&searchState.push(searchState.$facets.within,'"Publication Title":'+vjTitle)}function updateState(){"results"===$state.$current.name?searchState.refresh():window.location.href="/search/searchresult.jsp?"+searchState.getSearchQueryString()}function getActiveSearchType(searchObj){for(var searchTypeNames=Object.keys(searchObj),i=0;i<searchTypeNames.length;i++){var searchType=searchObj[searchTypeNames[i]];if(searchType.isActive)return searchType}}var unbindSearchResults,breadcrumbMappings={'"First Name"':"firstName",'"Last Name"':"lastName",'"Publication Title"':"title",'"Volume"':"volume",'"Issue"':"issue",'"Start Page"':"startPage"},notification=new Xplore.Notification(".Search .Notification",{showAnimation:"transition.fadeIn",hideAnimation:"transition.fadeOut"});scope.showCount=!!scope.showCount&&scope.showCount,scope.search={basic:{isActive:!0,input:{query:""},name:"All"},books:{isActive:!1,input:{query:""},contentType:"books",name:"Books"},conferences:{isActive:!1,input:{query:""},contentType:"conferences",name:"Conferences"},courses:{isActive:!1,input:{query:""},contentType:"courses",name:"Courses"},periodicals:{isActive:!1,input:{query:""},contentType:"periodicals",name:"Journals & Magazines"},standards:{isActive:!1,input:{query:""},contentType:"standards",name:"Standards"},author:{isActive:!1,input:{searchWithin:{firstName:"",lastName:""}},name:"Authors"},publication:{isActive:!1,input:{searchWithin:{title:"",volume:"",issue:"",startPage:""}},name:"Citations"}},scope.activeSearchType=getActiveSearchType(scope.search),scope.onTypeaheadReturn=onTypeaheadReturn,scope.onToggle=toggleSearchType,scope.getSuggestions=getSuggestions,element.find("form").on("submit",submitQuery),unbindSearchResults=scope.$watch(function(){return searchService.queryResult},watchSearchResults)}var directive={controller:controller,link:link,replace:!0,restrict:"EA",controllerAs:"$ctrl",scope:{showCount:"="},templateUrl:"widget/searchbar/searchbar.html"};return controller.$inject=["$window"],directive}angular.module("xpl.widget").directive("xplSearchbar",xplSearchbar),xplSearchbar.$inject=["$sce","$state","$window","searchService","searchState","typeaheadService","utilService"]}(),function(){function xplCmptSipModalTrigger(){return{restrict:"A",bindToController:{article:"=",userInfo:"=",purchaseNow:"=",redirectUrl:"@",modalSource:"@"},controller:SipModalTriggerComponent,controllerAs:"$ctrl",scope:{},link:link}}function link(scope,element,attr,ctrl){element.on("click",ctrl.openModal)}function SipModalTriggerComponent($log,$state,$uibModal,$window,sipModalConstants){function init(){$ctrl.purchaseNow&&($ctrl.openModal(),$ctrl.clearPurchaseNow())}function openModal(){if(isReadingRoomAndTermsAccepted())return $window.location.href=$ctrl.redirectUrl,!1;$uibModal.open({templateUrl:"widget/signin-purchase/sip-modal.component.html",controller:"SipModalComponentController",controllerAs:"vm",backdrop:"static",windowClass:"sip-modal-content",resolve:{buttonViewmodel:function(){return{article:$ctrl.article,userInfo:$ctrl.userInfo,redirectUrl:$ctrl.redirectUrl,modalSource:$ctrl.modalSource}}}});return!1}function clearPurchaseNow(){$state.go($state.current,{purchaseNow:void 0},{notify:!1,reload:!1,location:"replace",inherit:!0})}function isReadingRoomAndTermsAccepted(){return $ctrl.modalSource===sipModalConstants.modalSource.readingRoom&&$ctrl.userInfo.rrAcceptTerms}var $ctrl=this;$ctrl.openModal=openModal,$ctrl.clearPurchaseNow=clearPurchaseNow,init()}angular.module("xpl.widget").directive("xplCmptSipModalTrigger",xplCmptSipModalTrigger),SipModalTriggerComponent.$inject=["$log","$state","$uibModal","$window","sipModalConstants"]}(),function(){function SipModalComponentController($uibModalInstance,$window,buttonViewmodel,sipModalConstants){function initialize(){vm.openTab("signin"),vm.marketingInfo.isFormOpen=getMarketingInfoFormOpen(),vm.marketingInfo.isCaptured=!!vm.userInfo&&(!!vm.userInfo.marketingInfoCaptured&&vm.userInfo.marketingInfoCaptured),vm.loading=!1}function closeModal(){$uibModalInstance.close()}function openTab(tab){tab=tab||"signin",vm.activeTab=tab}function addToCartConfirmation(){vm.isAddToCartConfirmation=!0}function proceedToCheckout(){$window.location.href=$window.IBP_WS_ASSETS+"/cart/checkout/page.html?refSite="+window.location.href}function getMarketingInfoFormOpen(){return!(!vm.userInfo||!vm.userInfo.individual||(vm.modalSource!==sipModalConstants.modalSource.readingRoom||vm.userInfo.rrAcceptTerms)&&(vm.modalSource!==sipModalConstants.modalSource.getProgram||vm.userInfo.gpAcceptTerms))}var vm=this;vm.error=!1,vm.loading=!0,vm.activeTab="",vm.isAddToCartConfirmation=!1,vm.proceedToCheckout=proceedToCheckout,vm.article=buttonViewmodel.article?buttonViewmodel.article:{},vm.publisher=vm.article.publisher,vm.chorusPdfPath=vm.article.chorusPdfPath,vm.purchaseOptions=vm.article.purchaseOptions,vm.userInfo=buttonViewmodel.userInfo,vm.redirectUrl=buttonViewmodel.redirectUrl,vm.modalSource=buttonViewmodel.modalSource,vm.marketingInfo={isFormOpen:!1,isCaptured:!1,hasReadingRoomAccess:!1,hasGetProgramAccess:!1},vm.$uibModalInstance=$uibModalInstance,vm.addToCartConfirmation=addToCartConfirmation,vm.closeModal=closeModal,vm.openTab=openTab,initialize()}angular.module("xpl.widget").controller("SipModalComponentController",SipModalComponentController),SipModalComponentController.$inject=["$uibModalInstance","$window","buttonViewmodel","sipModalConstants"]}(),function(){angular.module("xpl").constant("sipModalConstants",{api:{login:"/servlet/LoginModalController",loginCorporate:"/servlet/getWayflessURLByEmail.jsp"},modalSource:{getProgram:"getProgram",loginModalWindow:"loginModalWindow",readingRoom:"readingRoom"}})}(),function(){function sipModalService($http,$q,$window,sipModalConstants){function signIn(username,password,successRedirectUrl,modalSource){if(!username||!password){var errorMessage="Unexpected values for username/password.";throw new TypeError(errorMessage)}successRedirectUrl="string"==typeof successRedirectUrl&&successRedirectUrl.length>0?successRedirectUrl:$window.location.pathname+$window.location.search,modalSource="string"==typeof modalSource&&modalSource.length>0?modalSource:sipModalConstants.modalSource.loginModalWindow;var loginData={},formData="",deferred=$q.defer();loginData.username=$window.encodeURIComponent(username),loginData.password=$window.encodeURIComponent(password),loginData.src2="loginModalWindow",loginData.url2=$window.encodeURIComponent($window.location.pathname+$window.location.search),loginData.successRedirectUrl=$window.encodeURIComponent(successRedirectUrl),modalSource!==sipModalConstants.modalSource.readingRoom&&modalSource!==sipModalConstants.modalSource.getProgram||(loginData.src3=modalSource),formData+="username="+loginData.username+"&password="+loginData.password,loginData.src2&&(formData+="&src2="+loginData.src2),loginData.url2&&(formData+="&url2="+loginData.url2),loginData.successRedirectUrl&&(formData+="&successRedirectUrl="+loginData.successRedirectUrl),loginData.src3&&(formData+="&src3="+loginData.src3);var canMakeSSOAuthRequest=$window.IBP_WS_ENABLED_FLAG&&"function"==typeof $window.a_authenticateUser,ssoWaitTime=$window.IBP_MEMBEER_SIGNIN_TIME_WAIT_IN_MILLIES?$window.IBP_MEMBEER_SIGNIN_TIME_WAIT_IN_MILLIES:1e3;return canMakeSSOAuthRequest?makeSSOAuthRequest(loginData,ssoWaitTime)["finally"](function(){makeSignInRequest(formData,deferred)}):makeSignInRequest(formData,deferred),deferred.promise}function signInCorporate(email){if(!email){var errorMessage="Unexpected value for email.";throw new TypeError(errorMessage)}var loginData={};return loginData.email=email,loginData.url=$window.location.href,$http({method:"GET",url:sipModalConstants.api.loginCorporate+buildUrlQueryParams(loginData)}).then(function(response){return response.data})}function getDocumentModalSource(doc,userInfo){var modalSource;return isDocumentGetProgramAccessible(doc,userInfo)&&(modalSource=sipModalConstants.modalSource.getProgram),modalSource}function makeSSOAuthRequest(loginData,msDelay){return $q(function(resolve,reject){$window.a_authenticateUser($window.decodeURIComponent(loginData.username),$window.decodeURIComponent(loginData.password)),$window.setTimeout(function(){resolve()},msDelay)})}function makeSignInRequest(formData,deferred){return $http({method:"POST",url:"https://"+$window.location.hostname+sipModalConstants.api.login,headers:{"Content-Type":"application/x-www-form-urlencoded"},withCredentials:!0,data:formData}).then(function(response){deferred.resolve(response.data)})["catch"](function(error){deferred.reject(error)})}function isDocumentGetProgramAccessible(doc,userInfo){var isGetDenial=!doc.fullTextAccess&&("LICENSE"===doc.denialReason||"undefined"==typeof doc.denialReason),isValidGetUser=!userInfo.institute||userInfo.institute&&userInfo.individual;return doc.isGetArticle&&isGetDenial&&isValidGetUser}function buildUrlQueryParams(dataObj){for(var queryString="?",keys=Object.keys(dataObj),i=0;i<keys.length;i++)queryString+=keys[i]+"="+$window.encodeURIComponent(dataObj[keys[i]])+"&";return queryString.substring(0,queryString.length-1)}var sipModalService={signIn:signIn,signInCorporate:signInCorporate,getDocumentModalSource:getDocumentModalSource};return sipModalService}angular.module("xpl.widget").factory("sipModalService",sipModalService),sipModalService.$inject=["$http","$q","$window","sipModalConstants"]}(),function(){function SimpleCarousel(){function init(){angular.extend($ctrl,{startIndex:0,endLength:3,pages:Array.isArray($ctrl.items)?new Array(Math.round($ctrl.items.length/3)):0,hasNextPage:Array.isArray($ctrl.items)&&$ctrl.items.length>3,hasPrevPage:!1}),activatePage($ctrl.initPage||0)}function activatePage(i){$ctrl.startIndex=3*i,$ctrl.endLength=$ctrl.startIndex+3,$ctrl.hasNextPage=$ctrl.endLength<$ctrl.items.length,$ctrl.hasPrevPage=$ctrl.startIndex>0,$ctrl.activePage=i}function next(){activatePage($ctrl.activePage+1)}function prev(){activatePage($ctrl.activePage-1)}var $ctrl=this;$ctrl.$onInit=init,$ctrl.activatePage=activatePage,$ctrl.next=next,$ctrl.prev=prev}var xplCmptSimpleCarousel={bindings:{items:"<",initPage:"<",action:"<"},controller:SimpleCarousel,templateUrl:"widget/simple-carousel/simple-carousel-component.html"};angular.module("xpl.widget").component("xplCmptSimpleCarousel",xplCmptSimpleCarousel)}(),function(){function xplCmptTab(){return{bindToController:{value:"=",active:"=",activate:"&",hide:"=",stats:"="},controller:TabComponent,controllerAs:"$ctrl",replace:!0,restrict:"E",scope:{},templateUrl:"widget/tabs/tab-component.html"}}function TabComponent($state){function init(){}init()}angular.module("xpl.widget").directive("xplCmptTab",xplCmptTab),TabComponent.$inject=["$state"]}(),function(){function xplCmptTabs(){return{bindToController:{tabs:"=",onTabClick:"=",contentTop:"@"},controller:TabsComponent,controllerAs:"$ctrl",replace:!0,restrict:"E",scope:{},transclude:!0,templateUrl:"widget/tabs/tabs-component.html"}}function TabsComponent($state,$log,$scope,$location,$anchorScroll){function init(){$ctrl.go=go,$ctrl.tabs&&updateTabs($ctrl.tabs),$scope.$on("$stateChangeSuccess",function(){updateTabs($ctrl.tabs)})}function go(tab,tabs,isNested){var options=tab.tabs?{reload:!0}:{};$state.go(tab.state,tab.params,options),$ctrl.onTabClick&&angular.isFunction($ctrl.onTabClick)&&$ctrl.onTabClick(tab.state,tab.params,options),scrollToContentTop()}function updateTabs(tabs,isNested){var activeTab=getActiveTab(tabs);activateTab(activeTab,tabs,isNested)}function activateTab(tab,tabs,isNested){setInactive(tabs),setActive(tab),hasCurrentActiveStates(tab)&&(tab=getTabByState(tabs,$state.current.name)),!isNested&&tab.tabs?($ctrl.nestedTabs=tab.tabs,updateTabs($ctrl.nestedTabs,!0)):isNested||($ctrl.nestedTabs=null)}function setActive(tab){tab.active=!0}function setInactive(tabs){Array.isArray(tabs)||(tabs=[tabs]),tabs.forEach(function(currentTab){currentTab.active=!1,currentTab.tabs&&setInactive(currentTab.tabs)})}function getActiveTab(tabs){var stateTabs=tabs.filter(checkActive);return Array.isArray(stateTabs)&&stateTabs.length>0?stateTabs[0]:tabs[0]}function checkActive(tab){return!(!$state.includes(tab.state,tab.params)&&!hasCurrentActiveStates(tab))}function hasCurrentActiveStates(tab){if(!tab.hasOwnProperty("activeStates"))return!1;Array.isArray(tab.activeStates)||(tab.activeStates=[tab.activeStates]);var isActive=!1;return tab.activeStates.forEach(function(state){if(state.indexOf("(")){var sref=parseStateRef(state);$state.includes(sref.state,sref.params)&&(isActive=!0)}else tab.activeStates.indexOf($state.current.name)>-1&&(isActive=!0)}),isActive}function parseStateRef(ref){var parsed,paramsOnly=ref.match(/^\s*({[^}]*})\s*$/);if(paramsOnly&&(ref="("+paramsOnly[1]+")"),parsed=ref.replace(/\n/g," ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/),!parsed||4!==parsed.length)throw new Error("Invalid state ref '"+ref+"'");return{state:parsed[1]||null,params:$scope.$eval(parsed[3]||null)}}function getTabByState(tabs,state){var filteredTabs=tabs.filter(function(tab){return tab.state==state});if(filteredTabs.length<1)throw new Error("'"+state+"' tab state was not found.");return filteredTabs[0]}function scrollToContentTop(){var id=$ctrl.contentTop||"widgetTabs",old=$location.hash();$location.hash(id),$anchorScroll(),$location.hash(old)}var $ctrl=this;init()}angular.module("xpl.widget").directive("xplCmptTabs",xplCmptTabs),TabsComponent.$inject=["$state","$log","$scope","$location","$anchorScroll"]}(),function(){function TabsService(){function hideTabIf(tabs,condition,tabValue,isNested){condition&&(isNested&&(tabs=getNested(tabs)),tabs.forEach(function(tab){tab.value===tabValue&&(tab.hide=!0)}))}function getNested(tabs){return tabs.reduce(function(ary,tab){return tab.tabs?ary.concat(tab.tabs):ary},[])}var TabsService={hideTabIf:hideTabIf,getNested:getNested};return TabsService}angular.module("xpl.widget").factory("TabsService",TabsService)}(),function(){function xplTimeline(){var directive={templateUrl:"widget/timeline/timeline.html",replace:!0,restrict:"EA",scope:{history:"="}};return directive}angular.module("xpl.widget").directive("xplTimeline",xplTimeline)}(),function(){function xplTocDoc($state){var directive={bindToController:{currentPart:"@"},link:link,templateUrl:"widget/toc/toc-doc.html",replace:!0,restrict:"EA",scope:{toc:"=",param:"="},controllerAs:"vm",controller:tocController};return directive}function tocController($scope,$state,utilsService,$location){$scope.state=$state;var vm=this;vm.fullTextAccess=global.document.fullTextAccess||global.document.metadata.isFreeDocument&&!global.document.denialReason,vm.scrollTo=function(id,part,qtip){id=id.replace("#",""),part!=vm.currentPart||$state.params.q||$state.params.ctx?$state.go(".",{part:part+"|"+id,section:null,ctx:null,q:null,anchor:null,tabfilter:null}):utilsService.scrollToDynamicDom(id,110),qtip&&$(qtip).qtip().hide()}}function link(scope,element,attr,$state){function setParam(id){scope.param=id,scope.state.go(scope.state.current.name,{tab:scope.state.params.tab,section:id})}scope.toc=scope.toc?scope.toc:{},scope.popoverDirection=scope.popoverDirection?scope.popoverDirection:"bottom",scope.setParam=setParam;var trigger=(scope.popoverDirection,element.find(".toc-link")),qtipConfig={content:{text:trigger.next("div")},hide:{event:1==scope.closeButton?"false":"click mouseleave",delay:300,fixed:($(this).hover,!0),leave:!1},show:{event:"click"},style:{classes:"qtip-popover document-toc"}};trigger.qtip(qtipConfig)}angular.module("xpl.widget").directive("xplTocDoc",xplTocDoc),xplTocDoc.$inject=["$state"]}(),function(){function xplToc(){var directive={bindToController:{toc:"=",scrollFunction:"&"},link:link,templateUrl:"widget/toc/toc.html",replace:!0,restrict:"E",scope:{},controllerAs:"$ctrl",controller:tocController,priority:100};return directive}function link(scope,element,attr,ctrl){var trigger=element.find(".toc-link"),qtipConfig={content:{text:trigger.next("div")},hide:{event:"click mouseleave",delay:300,fixed:($(this).hover,!0),leave:!1},show:{event:"click"},style:{classes:"qtip-popover document-toc"},position:{my:"top center",at:"bottom center"}};trigger.qtip(qtipConfig)}function tocController($scope,$state,$location){function scrollTo(id){$ctrl.scrollFunction()(id),$(".toc-link").qtip().hide()}var $ctrl=this;$ctrl.toc=$ctrl.toc?$ctrl.toc:{},$ctrl.scrollTo=scrollTo}angular.module("xpl.widget").directive("xplToc",xplToc)}(),function(){function xplTypeahead($sce,$timeout,utilService){function link(scope,element,attr){function onBlur(e){hasUrl||scope.multiselect||($timeout.cancel(loadResults),scope.currentIndex=-1,scope.items={})}function onItemSelect(item){hasUrl=!!item.typeAheadLinkUrl,scope.multiselect||(scope.ngModel=$sce.parseAsText(item.name)),scope.onSelect&&scope.onSelect({seletedRefinement:item})}function onKeyDown(e){if(!scope.multiselect)switch(e.keyCode){case 9:!utilService.isEmpty(scope.items)&&scope.items[scope.currentIndex]&&(scope.ngModel=$sce.parseAsText(scope.items[scope.currentIndex].name)),onBlur(e);break;case 40:utilService.isEmpty(scope.items)||(scope.currentIndex++,scope.currentIndex===scope.items.length&&(scope.currentIndex=0),scope.ngModel=$sce.parseAsText(scope.items[scope.currentIndex].name));break;case 38:utilService.isEmpty(scope.items)||(scope.currentIndex--,scope.currentIndex===-1&&(scope.currentIndex=scope.items.length-1),scope.ngModel=$sce.parseAsText(scope.items[scope.currentIndex].name));break;case 13:!utilService.isEmpty(scope.items)&&scope.items[scope.currentIndex]&&(scope.ngModel=$sce.parseAsText(scope.items[scope.currentIndex].name),scope.onReturn&&scope.onReturn({$event:e})),onBlur(e)}}function onKeyUp(e){e.keyCode>36&&e.keyCode<41||13===e.keyCode||scope.ngModel&&scope.ngModel.length<scope.minChars||(loadResults&&$timeout.cancel(loadResults),scope.items=[],loadResults=$timeout(function(){return scope.serviceMethod()},scope.delay),loadResults.then(onLoadResultsSuccess,angular.noop))}function onMouseEnter(index){scope.currentIndex=index}function onLoadResultsSuccess(data){scope.items=data}var loadResults,hasUrl;scope.minChars=scope.minChars>2?scope.minChars:2,scope.delay=scope.delay?scope.delay:500,scope.currentIndex=-1,element.find("input").attr("placeholder",attr.placeholder),element.find("ul").addClass(attr.ulClass),scope.onBlur=onBlur,scope.onItemSelect=onItemSelect,scope.onKeyUp=onKeyUp,scope.onKeyDown=onKeyDown,scope.onMouseEnter=onMouseEnter}var directive={link:link,templateUrl:"widget/typeahead/typeahead.html",replace:!0,restrict:"EA",scope:{delay:"@",minChars:"@",multiselect:"=",ngModel:"=",onSelect:"&",onReturn:"&",serviceMethod:"&"}};return directive}angular.module("xpl.widget").directive("xplTypeahead",xplTypeahead),xplTypeahead.$inject=["$sce","$timeout","utilService"]}(),function(){function directive($window,$stateParams,$timeout,$rootScope){function link($scope,el,attrs){function getBottomBoundary(){if($scope.scrollTillElementId)var scrollTillElement=angular.element("#"+$scope.scrollTillElementId);var scrollTillOffset=-1;return scrollTillElement&&(scrollTillOffset=scrollTillElement.offset().top,scrollTillOffset&&$scope.scrollTillOffset&&(scrollTillOffset-=$scope.scrollTillOffset)),scrollTillOffset}function getTopBoundary(){if($scope.scrollFromElementId)var scrollFromElement=angular.element("#"+$scope.scrollFromElementId);var scrollFromOffset=0;return scrollFromElement&&(scrollFromOffset=scrollFromElement.offset().top,scrollFromOffset&&$scope.scrollFromOffset&&(scrollFromOffset+=+$scope.scrollFromOffset)),scrollFromOffset;
  }function handleSnapping(totaloffset){var windowTop=windowEle.scrollTop();(scrollFromTop>=scrollTillTop||!$rootScope)&&(scrollFromTop=getTopBoundary(),scrollTillTop=getBottomBoundary()),windowTop>totaloffset&&(scrollTillTop<0||windowTop<scrollTillTop)?el.addClass($scope.cssClass):el.removeClass($scope.cssClass)}function adjustToZoom(){var windowLeft=$window.pageXOffset?$window.pageXOffset:document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;windowLeft>0?el.css("right",0):el.css("right","")}var windowEle=angular.element($window),firstTime=!0,resetScroll=!1,scrollFromTop=0,scrollTillTop=-1;$scope.$on($scope.scrollResetEventName,function(event,args){resetScroll=!0}),windowEle.bind("resize",_.debounce(adjustToZoom)),windowEle.bind("scroll",_.debounce(function(){(firstTime||resetScroll)&&(scrollFromTop=getTopBoundary(),scrollTillTop=getBottomBoundary(),scrollFromTop&&(firstTime=resetScroll=!1)),handleSnapping(scrollFromTop),adjustToZoom()}))}var directive={link:link,restrict:"A",replace:"false",scope:{cssClass:"@",scrollFromElementId:"@",scrollFromOffset:"@",scrollResetEventName:"@",scrollTillElementId:"@",scrollTillOffset:"@"}};return directive}angular.module("xpl.widget").directive("xplScrollSnap",directive),directive.$inject=["$window","$stateParams","$timeout","$rootScope"]}(),function(){function utilsService($log,$timeout,documentConstants){function scrollToDynamicDom(id,margin){var sec=document.getElementById(id),top=cumulativeOffset(sec).top;scrollToX(top-margin)}function scrollTo(id,margin,closure){$timeout(function(){id.startsWith("#")||(id="#"+id);var $target=$(id),x=$target.offset().top-margin;scrollToX(x,closure)})}function cumulativeOffset(element){var top=0,left=0;do top+=element.offsetTop||0,left+=element.offsetLeft||0,element=element.offsetParent;while(element);return{top:top,left:left}}function scrollToX(xaxis,closure){$("html,body").animate({scrollTop:xaxis},"slow",closure)}var utilsService={scrollTo:scrollTo,scrollToDynamicDom:scrollToDynamicDom};return utilsService}angular.module("xpl.widget").factory("utilsService",utilsService),utilsService.$inject=["$log","$timeout","documentConstants"]}(),function(){function DownloadCitationsPopoverController($state,downloadCitationsService,userService,downloadCitationsConstants){function $onInit(){var userPreferences=userService.getUser().userPreferencesInfo,includeFormat=void 0,downloadFormat=void 0;userPreferences&&(includeFormat=userPreferences.dowloadCitationFormat,downloadFormat=userPreferences.dowloadFormat),$ctrl.citations={include:includeFormat||downloadCitationsConstants.includeDefault,format:downloadFormat||downloadCitationsConstants.formatDefault}}function downloadCitations(ids){downloadCitationsService.getCitations(ids,$ctrl.citations.include,$ctrl.citations.format).then(downloadCitationsService.loadNewWindowCitationResponse).then(closePopover)}function closePopover(){$ctrl.close&&"function"==typeof $ctrl.close&&$ctrl.close()}var $ctrl=this;$ctrl.$onInit=$onInit,$ctrl.downloadCitations=downloadCitations,$ctrl.closePopover=closePopover}var xplCmptDownloadCitationsPopover={bindings:{attrs:"=",close:"="},controller:DownloadCitationsPopoverController,templateUrl:"widget/actionbar/download-citations-popover/download-citations-popover-component.html"};DownloadCitationsPopoverController.$inject=["$state","downloadCitationsService","userService","downloadCitationsConstants"],angular.module("xpl.widget").component("xplCmptDownloadCitationsPopover",xplCmptDownloadCitationsPopover)}(),function(){angular.module("xpl.widget").constant("downloadCitationsConstants",{includeDefault:"citation-only",formatDefault:"download-ascii"})}(),function(){function downloadCitationsService($http,$httpParamSerializer,$window,$log,api,downloadCitationsConstants){function getCitations(articleNumbers,includeFormat,downloadFormat){Array.isArray(articleNumbers)&&(articleNumbers=articleNumbers.join(","));var citation={recordIds:articleNumbers,"citations-format":includeFormat||downloadCitationsConstants.includeDefault,"download-format":downloadFormat||downloadCitationsConstants.formatDefault},options={headers:{"Content-Type":"application/x-www-form-urlencoded"}};return $http.post(api.citations.download,$httpParamSerializer(citation),options).then(function(response){return angular.merge(response,citation)})["catch"](handleRequestFailure)}function loadNewWindowCitationResponse(citation){if(citation&&citation.data)if("download-refworks"!==citation["download-format"])if("download-ris"===citation["download-format"]){var blob=new Blob([citation.data],{type:citation.headers("Content-Type")});saveAs(blob,parseFilenameFromContentDisposition(citation.headers("Content-Disposition"))||"citation.txt")}else{var _w=$window.open();_w.document.title=$window.document.title,_w.document.body.innerHTML=citation.data}else{$window.open(citation.data)}}function handleRequestFailure(response){$log.error(response)}function parseFilenameFromContentDisposition(contentDisposition){if(!contentDisposition)return null;var matches=/filename="(.*?)"/g.exec(contentDisposition);return matches&&matches.length>1?matches[1]:null}var service={getCitations:getCitations,loadNewWindowCitationResponse:loadNewWindowCitationResponse};return service}angular.module("xpl.widget").factory("downloadCitationsService",downloadCitationsService),downloadCitationsService.$inject=["$http","$httpParamSerializer","$window","$log","api","downloadCitationsConstants"]}(),function(){function xplCmptDownloadPDF(){function PDFDownloadController($log,$uibModal,downloadPdfService){function checkArticleSize(article){return article.hasAccess?article.size>$ctrl.maxDownloadSize?(article.maxSizeExceeded=!0,void(article.checked=!1)):void updateDownloadSize():void(article.checked=!1)}function closePredlModal(){resetSelectedItems(),$ctrl.close()}function download(articles){if(!articles.length||!hasItemsChecked())return $log.warn("PDF Bulk Download: No articles selected.");$ctrl.loading=!0;var checkedArticles=articles.filter(function(article){return article.checked}),noAccessArticles=articles.filter(function(article){return!article.hasAccess});downloadPdfService.download(checkedArticles,"bulk-download.zip").then(downloadPdfSuccess)["catch"](downloadPdfFailure).then(function(){downloadPdfService.trackNoAccessArticles(noAccessArticles)})}function hasItemsChecked(){return $ctrl.bulkSelectedItems.some(function(article){return article.checked})}function initialize(){initialFileSizeCheck(),$ctrl.loading=!1}function initialFileSizeCheck(){for(var maxSize=$ctrl.maxDownloadSize,currentSize=0,i=0;i<$ctrl.bulkSelectedItems.length;i++){var article=$ctrl.bulkSelectedItems[i];article.hasAccess&&(article.size<maxSize?(article.checked=!0,currentSize+=article.size):article.maxSizeExceeded=!0)}updateDownloadSize()}function setError(errorName){clearError(),$ctrl.error[errorName]=!0}function clearError(){Object.keys($ctrl.error).forEach(function(error){$ctrl.error[error]=!1})}function resetSelectedItems(){$ctrl.selectedItems.forEach(function(i){delete i.checked,delete i.maxSizeExceeded})}function updateDownloadSize(){var checkedItems=$ctrl.bulkSelectedItems.filter(function(item){return item.checked}),currentDownloadSize=checkedItems.reduce(function(totalSize,item){return totalSize+item.size},0),maxDownloadSizeExceeded=currentDownloadSize>$ctrl.maxDownloadSize;$ctrl.currentDownloadSize=currentDownloadSize,maxDownloadSizeExceeded?setError("size"):clearError()}function downloadPdfSuccess(response){$log.log(response),$ctrl.loading=!1,openPostDownloadModal(response),$ctrl.close()}function downloadPdfFailure(error){setError("unexpected"),$log.error(error),$ctrl.loading=!1}function openPostDownloadModal(downloadResponse){function PostDownloadPdfConfirmation($uibModalInstance){function closeModal(){resetSelectedItems(),$uibModalInstance.close()}var vm=this;vm.maxItemsCount=$ctrl.maxItemsCount,vm.exceededDownloadsToShow=2,vm.completedDownloads=downloadResponse.completed,vm.noAccessArticles=$ctrl.bulkSelectedItems.filter(function(a){return!a.hasAccess}),vm.erroredDownloads=downloadResponse.errored.concat(vm.noAccessArticles),vm.closeModal=closeModal}$uibModal.open({templateUrl:"widget/actionbar/download-pdf/post-download-pdf-confirmation.html",controller:PostDownloadPdfConfirmation,controllerAs:"vm",backdrop:!0,backdropClass:"modal-backdrop-transparent",windowClass:"downloadpdf-postdl-modal-container"});PostDownloadPdfConfirmation.$inject=["$uibModalInstance"]}var $ctrl=this;$ctrl.maxDownloadSize=5e5,$ctrl.currentDownloadSize=0,$ctrl.maxItemsCount=10,$ctrl.bulkSelectedItems=$ctrl.selectedItems.filter(function(item,index){return index<$ctrl.maxItemsCount}),$ctrl.exceededItems=$ctrl.selectedItems.filter(function(item,index){return index>$ctrl.maxItemsCount-1}),$ctrl.hasItemsSelected=$ctrl.bulkSelectedItems&&$ctrl.bulkSelectedItems.length>0,$ctrl.error={size:!1,unexpected:!1,throttled:!1},$ctrl.loading=!0,$ctrl.checkArticleSize=checkArticleSize,$ctrl.closePredlModal=closePredlModal,$ctrl.download=download,$ctrl.hasItemsChecked=hasItemsChecked,initialize()}return PDFDownloadController.$inject=["$log","$uibModal","downloadPdfService"],{replace:!0,restrict:"E",bindToController:{selectedItems:"=",close:"="},scope:{},controller:PDFDownloadController,controllerAs:"$ctrl",templateUrl:"widget/actionbar/download-pdf/download-pdf-component.html"}}angular.module("xpl.widget").directive("xplCmptDownloadPdf",xplCmptDownloadPDF)}(),function(){function downloadPdfService($q,$filter,$http,$log,api){function download(articles,zipName){var deferred=$q.defer(),directPdfUrls=articles.map(function(article){return article.directPdfUrl}),requests=createRequests(directPdfUrls);return _articles=articles,zipName=zipName||"ieee-download.zip",requestFiles(requests,!0).then(zipFiles).then(function(response){response.results.completed.length>0&&saveAs(response.blob,zipName),deferred.resolve(response.results)}),deferred.promise}function getBulkSelectedItem(articleNumber,title,size,accessType,directBookPdfUrl){var deHighlightedtitle=title.replace(/[\[\:\:|\:\:\]]/g,""),parsedSize=parseInt(size);return{articleNumber:articleNumber,size:isNaN(parsedSize)?0:parsedSize,title:deHighlightedtitle,strippedTitle:$filter("filenameSanitize")(deHighlightedtitle),directPdfUrl:directBookPdfUrl?directBookPdfUrl:api.directPdfUrl.replace("{0}",articleNumber),hasAccess:checkAccess(accessType),checked:!1}}function trackNoAccessArticles(articles){var deferred=$q.defer(),directPdfUrls=articles.map(function(article){return article.directPdfUrl}),requests=createRequests(directPdfUrls);return requestFiles(requests,!1).then(function(){deferred.resolve()}),deferred.promise}function createRequests(directPdfUrls){return directPdfUrls.map(function(url){return $http({method:"GET",url:url+"&isBulkDownload=true",responseType:"arraybuffer"})})}function requestFiles(requests,shouldSaveFiles){var callbackToUse=shouldSaveFiles?requestFilesCallback:requestFilesForTrackingCallback,responses=requests.map(function(request,i){return request.then(callbackToUse)["catch"](callbackToUse)});return $q.all(responses)}function zipFiles(files){var zip=new JSZip,completed=[],errored=[],dupFilenameHash={};return files.forEach(function(response){var downloadCompleted=response.downloadCompleted&&!!response.data&&response.data instanceof ArrayBuffer,filename=response.filename,pdfExtIndex=filename.indexOf(".pdf");if(pdfExtIndex===-1)throw new Error("Unexpected or missing file extension in zipFiles() method");if(downloadCompleted){var filenameToUse=filename;dupFilenameHash[filename]?(filenameToUse=filename.substring(0,pdfExtIndex)+" ("+dupFilenameHash[filename]+")"+filename.substring(pdfExtIndex),dupFilenameHash[filename]++):dupFilenameHash[filename]=1,zip.file(filenameToUse,response.data),completed.push(response)}else errored.push(response)}),zip.generateAsync({type:"blob"}).then(function(blob){return{blob:blob,results:{completed:completed,errored:errored}}})}function requestFilesCallback(response){var articleNumber=getArticleNumberFromResponse(response),matchedArticleArray=_articles.filter(function(article){return article.articleNumber==articleNumber}),matchedArticle=matchedArticleArray.length>0?matchedArticleArray[0]:void 0,pdfDownloaded="%PDF-"===arraybufferToString(response.data,5);return{articleNumber:articleNumber,title:matchedArticle.title,filename:matchedArticle.strippedTitle+".pdf",downloadCompleted:pdfDownloaded,data:response.data,status:response.status,statusText:response.statusText}}function requestFilesForTrackingCallback(response){var articleNumber=getArticleNumberFromResponse(response);return{articleNumber:articleNumber,data:response.data,status:response.status,statusText:response.statusText}}function getArticleNumberFromResponse(response){var url=response.config.url,paramName="arnumber",arNumber=getParameterByName(paramName,url);if(!arNumber&&url.indexOf(".pdf")>-1){for(var queryStringValues=url.substring(url.indexOf("?")+1).split("&"),queryStringObj={},i=0;i<queryStringValues.length;i++){var singleValue=queryStringValues[i].split("=");queryStringObj[singleValue[0]]=decodeURIComponent(singleValue[1])}arNumber="chapter"===queryStringObj.pdfType?url.substring(url.lastIndexOf("/")+1,url.indexOf(".pdf")):queryStringObj.bkn}return arNumber}function getParameterByName(name,url){var match=RegExp("[?&]"+name+"=([^&]*)").exec(url);return match&&decodeURIComponent(match[1].replace(/\+/g," "))}function arraybufferToString(arraybuffer,length){return arraybuffer instanceof ArrayBuffer?("number"==typeof length&&length%1===0||(length=5),String.fromCharCode.apply(null,new Int8Array(arraybuffer,0,length))):""}function checkAccess(accessType){if(!accessType||!accessType.type)return!1;var type=accessType.type;return"ephemera"===type||"promotional"===type||"open-access"===type||"subscribed"===type||"in-file-cabinet"===type||"plagiarized"===type}var _articles=[],pdfService={download:download,getBulkSelectedItem:getBulkSelectedItem,trackNoAccessArticles:trackNoAccessArticles};return pdfService}angular.module("xpl.widget").factory("downloadPdfService",downloadPdfService),downloadPdfService.$inject=["$q","$filter","$http","$log","api"]}(),function(){function xplCmptExportContent($compile,$log){function link(scope,elem,attrs){scope.$watchGroup(["selectedItems","content"],function(newValues){var isolateScope=angular.merge(scope.$new(),{selectedItems:newValues[0],close:scope.close});elem.html(newValues[1]),$compile(elem.contents())(isolateScope)}),scope.$on("$destroy",function(){elem.contents().scope().$destroy(),elem.remove()})}return{replace:!0,restrict:"E",scope:{selectedItems:"=",content:"=",close:"="},link:link}}angular.module("xpl.widget").directive("xplCmptExportContent",xplCmptExportContent),xplCmptExportContent.$inject=["$compile","$log"]}(),function(){function xplCmptExportDownload(){function ExportDownloadController($templateCache){function init(){$ctrl.updateContent("download-search-results")}var $ctrl=this,PATH_PREFIX="widget/actionbar/";$ctrl.updateContent=function(templateName,isIndividual){$ctrl.active=templateName,angular.isDefined(isIndividual)&&!isIndividual&&(templateName="access-denied"),$ctrl.content=$templateCache.get(PATH_PREFIX+templateName+".html")},init()}return ExportDownloadController.$inject=["$templateCache"],{replace:!0,restrict:"E",bindToController:{selectedItems:"=",close:"=",individualUser:"="},scope:{},controller:ExportDownloadController,controllerAs:"$ctrl",templateUrl:"widget/actionbar/export-download/export-download-component.html"}}angular.module("xpl.widget").directive("xplCmptExportDownload",xplCmptExportDownload)}(),function(){function MarketingFormComponent($http,$log,$q,$scope,$state,$window,marketingFormConstants,marketingFormService,sipModalConstants){function initialize(){marketingFormService.getInstitutionUserTypes().then(getUserTypesSuccess,getUserTypesError)}function closeModal(){$ctrl.modalInstanceService.close()}function onUserTypeChange(){$ctrl.otherUserTypeEnabled=$ctrl.formData.userType===marketingFormConstants.institutionUserTypes.other}function onFormSubmit(){if($ctrl.error=getFormValidationError(),$ctrl.error)return!1;$ctrl.loading.submit=!0;var finalFormData=getFinalFormData();marketingFormService.setMarketingInfo(finalFormData).then(setMarketingInfoSuccess,setMarketingInfoError)}function getUserTypesSuccess(data){$ctrl.userTypes=data,$ctrl.loading.main=!1}function getUserTypesError(error){$ctrl.error=error.statusText?error.statusText:marketingFormConstants.formErrorMessages.getInstitutionUserTypesError,$ctrl.loading.main=!1}function getFormValidationError(){var error="";return $ctrl.marketingInfo.isCaptured||$ctrl.formData.userType&&(!$ctrl.otherUserTypeEnabled||$ctrl.formData.otherUserType)&&$ctrl.formData.organizationName&&$ctrl.formData.streetAddressLine1&&$ctrl.formData.country&&$ctrl.formData.city&&$ctrl.formData.state&&$ctrl.formData.postalCode||(error+=marketingFormConstants.formErrorMessages.requiredFieldsMissing),($ctrl.isFromGetProgram&&!$ctrl.formData.gpAcceptTerms||$ctrl.isFromReadingRoom&&!$ctrl.formData.rrAcceptTerms)&&(error+=marketingFormConstants.formErrorMessages.acceptTermsMissing),error}function getFinalFormData(){var finalForm={},formData=$ctrl.formData;for(var prop in formData)formData.hasOwnProperty(prop)&&"otherUserType"!==prop&&"undefined"!=typeof formData[prop]&&("userType"===prop&&formData[prop]===marketingFormConstants.institutionUserTypes.other?finalForm[prop]=formData[prop]+"-"+formData.otherUserType:finalForm[prop]=formData[prop]);return finalForm}function setMarketingInfoSuccess(data){$ctrl.redirectUrl?$window.location.href=$ctrl.redirectUrl:$window.location.reload()}function setMarketingInfoError(error){$ctrl.error=error.data&&"string"==typeof error.data?error.data:error.statusText?error.statusText:marketingFormConstants.formErrorMessages.generic,$ctrl.loading.submit=!1}var $ctrl=this;$ctrl.isFromGetProgram=$ctrl.modalSource===sipModalConstants.modalSource.getProgram,$ctrl.isFromReadingRoom=$ctrl.modalSource===sipModalConstants.modalSource.readingRoom,$ctrl.error=void 0,$ctrl.loading={main:!0,submit:!1},$ctrl.formData={userType:void 0,otherUserType:void 0,organizationName:void 0,streetAddressLine1:void 0,streetAddressLine2:void 0,suiteNumber:void 0,country:void 0,city:void 0,state:void 0,postalCode:void 0,rrAcceptTerms:void 0,gpAcceptTerms:void 0,marketingOptIn:!!$ctrl.marketingInfo.isCaptured&&void 0,captured:$ctrl.marketingInfo.isCaptured},$ctrl.userTypes=[],$ctrl.otherUserTypeEnabled=!1,$ctrl.closeModal=closeModal,$ctrl.onUserTypeChange=onUserTypeChange,$ctrl.onFormSubmit=onFormSubmit,initialize()}var xplCmptMarketingForm={bindings:{userInfo:"=",modalInstanceService:"=",redirectUrl:"<",modalSource:"<",marketingInfo:"="},controller:MarketingFormComponent,templateUrl:"widget/signin-purchase/marketing-form/marketing-form.component.html"};MarketingFormComponent.$inject=["$http","$log","$q","$scope","$state","$window","marketingFormConstants","marketingFormService","sipModalConstants"],angular.module("xpl.widget").component("xplCmptMarketingForm",xplCmptMarketingForm)}(),function(){angular.module("xpl").constant("marketingFormConstants",{api:{institutionUserTypes:"/rest/user/types/progId/1",setMarketingInfo:"/rest/user/terms/accept"},formErrorMessages:{acceptTermsMissing:"Terms of Use has not been accepted. ",generic:'Please try again or <a href="http://ieeexplore.ieee.org.ezproxy.lib.ryerson.ca/xpl/techform.jsp">contact us</a> for more information. ',getInstitutionUserTypesError:'Please re-open modal and try again or <a href="http://ieeexplore.ieee.org.ezproxy.lib.ryerson.ca/xpl/techform.jsp">contact us</a> for more information. ',requiredFieldsMissing:"Required fields are missing. "},institutionUserTypes:{other:"Other (Please explain)"}})}(),function(){function marketingFormService($http,$q,$window,marketingFormConstants){function getInstitutionUserTypes(){return $http.get(marketingFormConstants.api.institutionUserTypes,{cache:!0}).then(function(resp){var data=[];return resp.data.forEach(function(elem){data.push(elem.userType)}),data})}function setMarketingInfo(formData){return $http.post(marketingFormConstants.api.setMarketingInfo,formData).then(function(resp){return resp.data})}var marketingFormService={getInstitutionUserTypes:getInstitutionUserTypes,setMarketingInfo:setMarketingInfo};return marketingFormService}angular.module("xpl.widget").factory("marketingFormService",marketingFormService),marketingFormService.$inject=["$http","$q","$window","marketingFormConstants"]}(),function(){function xplCmptBundleDetailsLink(){return{restrict:"A",bindToController:{bundleDetails:"="},controller:BundleDetailsLinkComponent,controllerAs:"lvm",scope:{},link:link}}function link(scope,element,attr,ctrl){function openModal(){ctrl.openModal()}element.on("click",openModal)}function BundleDetailsLinkComponent($log,$state,$uibModal){function openModal(){function closedResolve(){angular.element(sipModalSelector).removeClass("u-hide-important")}var sipModalSelector=".sip-modal-content";angular.element(sipModalSelector).addClass("u-hide-important");var modalInstance=$uibModal.open({templateUrl:"widget/signin-purchase/modal-tabs/bundle-details-modal.component.html",controller:BundleDetailsModalComponent,controllerAs:"vm",backdrop:"static"});modalInstance.closed.then(closedResolve)}function BundleDetailsModalComponent($scope,$uibModalInstance){function initialize(){vm.loading=!1}function closeModal(){$uibModalInstance.close()}var vm=this;vm.error=!1,vm.loading=!0,vm.bundleDetails=lvm.bundleDetails,vm.closeModal=closeModal,initialize()}var lvm=this;lvm.openModal=openModal,BundleDetailsModalComponent.$inject=["$scope","$uibModalInstance"]}angular.module("xpl.widget").directive("xplCmptBundleDetailsLink",xplCmptBundleDetailsLink),BundleDetailsLinkComponent.$inject=["$log","$state","$uibModal"]}(),function(){function xplCmptSipModalPurchaseTab(){return{bindToController:{purchaseOptions:"=",publisher:"@",userInfo:"=",addToCartConfirmation:"&",modalInstanceService:"="},controller:SipModalPurchaseTabComponent,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"widget/signin-purchase/modal-tabs/sip-modal-purchase-tab.component.html"}}function SipModalPurchaseTabComponent($log,$scope,$state){function initialize(){vm.purchaseOptions.showPdfFormatPricingTab?vm.applyFormat("pdfHtml"):vm.purchaseOptions.showOtherFormatPricingTab&&vm.applyFormat("other"),vm.loading=!1}function closeModal(){vm.modalInstanceService.close()}function applyFormat(format){format=format||"pdfHtml",clearError(),vm.activeFormat=format,"pdfHtml"===format&&vm.purchaseOptions.pdfPricingInfoAvailable?(vm.activePurchables=vm.purchaseOptions.pdfPricingInfo,vm.selectedPartNumber=vm.activePurchables[0].partNumber):"other"===format&&vm.purchaseOptions.otherPricingInfoAvailable&&(vm.activePurchables=vm.purchaseOptions.otherFormatPricingInfo,vm.selectedPartNumber=vm.activePurchables[0].partNumber)}function addToCart(){if(clearError(),vm.loading=!0,"other"===vm.activeFormat)return void(window.location=vm.purchaseOptions.purchasePartnerUrl);var itemData='[{"partNum":"'+vm.selectedPartNumber+'","quantity":"1","membershipType":"","country":""}]';"function"==typeof mc_addItems?mc_addItems(itemData,addToCartSuccess,catchPromiseFailure):vm.error.unavailable=!0}function clearError(){for(var key in vm.error)vm.error.hasOwnProperty(key)&&(vm.error[key]=!1)}function addToCartSuccess(data){setCurrentCartCount(),$scope.$apply(function(){vm.loading=!1,vm.addToCartConfirmation()})}function catchPromiseFailure(error){$scope.$apply(function(){$log.error(error),error&&error.indexOf("You have requested quantity more than what is allowed")>-1?vm.error.alreadyInCart=!0:(vm.error.failure=!0,error&&error.length>0&&(vm.error.message=error)),vm.loading=!1})}var vm=this;vm.error={unavailable:!1,failure:!1,alreadyInCart:!1},vm.loading=!0,vm.activeFormat="",vm.activePurchables=[],vm.selectedPartNumber=null,vm.closeModal=closeModal,vm.applyFormat=applyFormat,vm.addToCart=addToCart,initialize()}angular.module("xpl.widget").directive("xplCmptSipModalPurchaseTab",xplCmptSipModalPurchaseTab),SipModalPurchaseTabComponent.$inject=["$log","$scope","$state"]}(),function(){function xplCmptSipModalSigninTab(){return{bindToController:{userInfo:"=",modalInstanceService:"=",redirectUrl:"@",modalSource:"@",marketingInfo:"="},controller:SipModalSigninTabComponent,controllerAs:"vm",replace:!0,restrict:"E",scope:{},templateUrl:"widget/signin-purchase/modal-tabs/sip-modal-signin-tab.component.html"}}function SipModalSigninTabComponent($http,$log,$q,$scope,$state,$window,sipModalConstants,sipModalService){function initialize(){vm.applyFormat("regular"),vm.loading=!1}function showForgotPasswordModal(){return Modal.show("/xpl/mwForgotPassword.jsp"),!1}function closeModal(){vm.modalInstanceService.close()}function applyFormat(format){format=format||"regular",clearError(),resetUser(),vm.activeFormat=format}function signIn(){return clearError(),vm.user.username&&vm.user.password?(vm.loading=!0,void sipModalService.signIn(vm.user.username,vm.user.password,vm.redirectUrl,vm.modalSource).then(signInSuccess,signInFail)):void(vm.error.message='"Username" and "Password" are required fields.')}function ssoSignIn(){return clearError(),vm.user.email?(vm.loading=!0,void sipModalService.signInCorporate(vm.user.email).then(signInCorporateSuccess,signInCorporateFail)):void(vm.error.message='"Email" is required field.')}function navToWayf(entity){var navUrl="/servlet/wayf.jsp";entity&&(navUrl+="?entityId="+entity+"&url="+getWayfRedirectUrl()),$window.location.href=navUrl}function clearError(){vm.error.message=null}function resetUser(){for(var key in vm.user)vm.user.hasOwnProperty(key)&&(vm.user[key]=null)}function getWayfRedirectUrl(){var url=$window.location.href;return url.indexOf("guesthome.jsp")>=0&&(url="/Xplore/home.jsp"),url=$window.encodeURIComponent(url)}function signInSuccess(resp){resp?resp.errorReason?signInFail(resp.errorReason):resp.successRedirectUrl?$window.location.href=resp.successRedirectUrl:(vm.marketingInfo.isCaptured=resp.isMarketingInfoCaptured,vm.marketingInfo.hasReadingRoomAccess=resp.hasReadingRoomAccess,vm.marketingInfo.hasGetProgramAccess=resp.hasGetProgramAccess,vm.modalSource===sipModalConstants.modalSource.readingRoom&&!resp.hasReadingRoomAccess||vm.modalSource===sipModalConstants.modalSource.getProgram&&!resp.hasGetProgramAccess?(vm.marketingInfo.isFormOpen=!0,vm.modalInstanceService.closed.then(function(){$window.location.reload()})):$window.location.reload(),vm.loading=!1):signInFail("Unexpected response from login service.")}function signInFail(error){$log.error(error),vm.error.message="string"==typeof error?error:"Unexpected error occurred. Please try again or contact customer service.",vm.loading=!1}function signInCorporateSuccess(resp){resp?resp.errorMessage?signInCorporateFail(resp.errorMessage):resp.wayflessURL?$window.location.href=resp.wayflessURL:$window.location.reload():signInCorporateFail("Unexpected response from login service.")}function signInCorporateFail(error){$log.error(error),vm.error.message=error+" "+vm.genericErrorMessage,vm.loading=!1}var vm=this;vm.error={message:null},vm.loading=!0,vm.activeFormat="",vm.user={username:null,password:null,email:null},vm.genericErrorMessage='Please try again or <a href="http://ieeexplore.ieee.org.ezproxy.lib.ryerson.ca/xpl/techform.jsp">contact us</a> for more information.',vm.closeModal=closeModal,vm.applyFormat=applyFormat,vm.signIn=signIn,vm.ssoSignIn=ssoSignIn,vm.navToWayf=navToWayf,vm.showForgotPasswordModal=showForgotPasswordModal,initialize()}angular.module("xpl.widget").directive("xplCmptSipModalSigninTab",xplCmptSipModalSigninTab),SipModalSigninTabComponent.$inject=["$http","$log","$q","$scope","$state","$window","sipModalConstants","sipModalService"]}(),function(){function xplSigninPurchaseOverlay(){function link(scope){scope.pricingMap=scope.$parent.ctrl.pricingMap,scope.userInfo=scope.$parent.ctrl.userInfo,scope.courseId=scope.$parent.ctrl.courseId,scope.hideSigninPurchaseOverlay=scope.$parent.hideSigninPurchaseOverlay}var directive={link:link,restrict:"E",templateUrl:"widget/signin-purchase/overlay/overlay.html",replace:!0,scope:{}};return directive}angular.module("xpl.widget").directive("xplSigninPurchaseOverlay",xplSigninPurchaseOverlay)}(),function(){function netInsightsService($window){function inject(){var scriptElement=document.createElement("script");scriptElement.src=SOURCE,scriptElement.id=ID,document.body.appendChild(scriptElement)}function retract(){var scriptElement=document.getElementById(ID);scriptElement&&document.body.removeChild(scriptElement)}var SOURCE=$window.ASSETS_RELATIVE_PATH+"/js/analytics/ntpagetag.min.js",ID="ntpagetag",netInsightsService={inject:inject,retract:retract};return netInsightsService}angular.module("xpl.ads").factory("netInsightsService",netInsightsService),netInsightsService.$inject=["$window"]}(),function(){function xplCustomerSurvey($filter){function link(scope,element){function watchUser(user){void 0!==user&&(unbindUserWatch(),element.append(generateAd()))}function generateAd(){return scope.user.customerSurvey?'<section class="CustomerSurvey"><a href="'+scope.user.customerSurvey+'" target="_blank"><img class="fullsize" src="'+$filter("cdnSrc")("/img/surveygraphic.gif")+'"/></a></section>':""}var unbindUserWatch=scope.$watch("user",watchUser)}var directive={link:link,replace:!0,restrict:"EA",scope:{user:"="}};return directive}angular.module("xpl.ads").directive("xplCustomerSurvey",xplCustomerSurvey),xplCustomerSurvey.$inject=["$filter"]}(),function(){function xplGoogleAd($injector,$state,breadcrumbService,googleAdSlots){function link(scope,element){function watchUser(user){"undefined"!=typeof user&&element.append(generateAd())}function generateAd(){var slot=defineSlot(element[0].className.split(" "));if(!slot)return"<div><small>No ad definition found.</small></div>";var slotExists=checkSlotExists(slot.id),adGeneratedCode='<script type="text/javascript">Xplore = Xplore || {}; Xplore.googleAdSlotsStore = Xplore.googleAdSlotsStore || {}; googletag.cmd.push(function() {';return adGeneratedCode+=slotExists?'Xplore.googleAdSlotsStore["'+slot.id+'"]':'Xplore.googleAdSlotsStore["'+slot.id+'"] = googletag.defineSlot("'+googleAdSlots.slotNamePrefix+slot.name+'", ['+slot.dimensions.toString()+'], "'+slot.id+'").addService(googletag.pubads())',adGeneratedCode+=addUserTargeting(),adGeneratedCode+=addSearchTargeting(),adGeneratedCode+=addPublisherTargeting()+";",adGeneratedCode+=addShowHiddenClass(slot),slotExists?(adGeneratedCode+='});</script><div id="'+slot.id+'" style="width:'+slot.dimensions[0]+"px; height:"+slot.dimensions[1]+'; display:block;">',adGeneratedCode+='<script type="text/javascript">googletag.cmd.push(function() { googletag.pubads().refresh([Xplore.googleAdSlotsStore["'+slot.id+'"]]); });</script>'):adGeneratedCode+='googletag.pubads().collapseEmptyDivs();googletag.pubads().enableSingleRequest();googletag.enableServices();});</script><div id="'+slot.id+'" style="width:'+slot.dimensions[0]+"px; height:"+slot.dimensions[1]+'; display:block;"><script type="text/javascript">googletag.cmd.push(function() { googletag.display("'+slot.id+'"); });</script></div>',adGeneratedCode}function defineSlot(classes){var slot;return classes.forEach(function(className){className.indexOf("Ads-")!==-1&&(slot=googleAdSlots[className.split("-")[1]])}),slot}function checkSlotExists(slotId){return!!Xplore.googleAdSlotsStore&&!!Xplore.googleAdSlotsStore[slotId]}function addUserTargeting(){var userTargeting,user=scope.googleAdTargeting.user,userDetails={type:getUserType(user),products:user.products?user.products.toString():"",instituteType:user.instType?user.instType:"",ip:user.ip?user.ip:"",userID:user.userIds?user.userIds[0]:"",institute:user.institute===!0?"true":""};return userTargeting='.setTargeting("usertype", "'+userDetails.type+'")',userTargeting+='.setTargeting("sub_type", "'+userDetails.products+'")',userTargeting+='.setTargeting("cust_type", "'+userDetails.instituteType+'")',userTargeting+='.setTargeting("geoip", "'+userDetails.ip+'")',
  userTargeting+='.setTargeting("userid", "'+userDetails.userID+'")',userTargeting+='.setTargeting("isinst", "'+userDetails.institute+'")'}function addPublisherTargeting(){if(scope.googleAdTargeting.publisher)return'.setTargeting("publisher",["'+scope.googleAdTargeting.publisher+'"])';if($state.params.publisher)return'.setTargeting("publisher",["'+$state.params.publisher+'"])';var publishers=breadcrumbService.getBreadcrumb("key","Publisher");return publishers?(publishers=Array.isArray(publishers.children)?publishers.children.map(function(x){return x.key}):"",'.setTargeting("publisher",'+JSON.stringify(publishers)+")"):""}function addSearchTargeting(){"undefined"==typeof scope.googleAdTargeting.search?scope.googleAdTargeting.search="":"string"!=typeof scope.googleAdTargeting.search&&(scope.googleAdTargeting.search=JSON.stringify(scope.googleAdTargeting.search));var searchTargeting='.setTargeting("search", "'+scope.googleAdTargeting.search.replace(/[\/"]/g,'\\"')+'")';return searchTargeting+='.setTargeting("pu_number", "'+scope.googleAdTargeting.puNumber+'")',searchTargeting+='.setTargeting("content_ID", "'+scope.googleAdTargeting.contentId+'")'}function getUserType(user){return user.institute?"inst":user.member||user.guest?"guest":"anonymous"}function addShowHiddenClass(slot){if(!slot.showHiddenClass)return"";var valueExists=["function valueExists(obj, value){","for (key in obj){","if (obj[key].indexOf(value) > -1) {","return true;","}","}","return false;","};"].join(""),googleTagSuccessCallback=["function googleTagSuccessCallback(event){",valueExists,'if (valueExists(event.slot, "'+googleAdSlots.slotNamePrefix+slot.name+'")) {','angular.element("'+slot.showHiddenClass+'").show();',"}","}"].join("");return"googletag.pubads().addEventListener('slotRenderEnded', "+googleTagSuccessCallback+");"}scope.$watch("googleAdTargeting.user",watchUser)}var directive={link:link,replace:!0,restrict:"EA",scope:{googleAdTargeting:"="}};return directive}angular.module("xpl.ads").directive("xplGoogleAd",xplGoogleAd),xplGoogleAd.$inject=["$injector","$state","breadcrumbService","googleAdSlots"]}(),function(){function xplGoogleAdServices($location){function link(){window.googletag=window.googletag||{},window.googletag.cmd=window.googletag.cmd||[],function(){var gads=document.createElement("script"),node=document.getElementsByTagName("script")[0];gads.async=!0,gads.src=$location.protocol()+"://www.googletagservices.com/tag/js/gpt.js",node.parentNode.insertBefore(gads,node)}()}var directive={link:link,replace:!0,restrict:"EA"};return directive}angular.module("xpl.ads").directive("xplGoogleAdServices",xplGoogleAdServices),xplGoogleAdServices.$inject=["$location"]}(),function(){angular.module("xpl.ads").constant("googleAdSlots",{slotNamePrefix:"/3890430/",books:{name:"xplore_books",dimensions:[180,150],id:"div-gpt-ad-1366327280661-0"},conferences:{name:"xplore_conferences",dimensions:[180,150],id:"div-gpt-ad-1366327280661-1"},leadGen:{name:"xplore_subscription_leadgen",dimensions:[180,150],id:"div-gpt-ad-1366327280661-2"},periodicals:{name:"xplore_journals",dimensions:[180,150],id:"div-gpt-ad-1366327280661-3"},standards:{name:"xplore_standards",dimensions:[180,150],id:"div-gpt-ad-1366327280661-4"},thirdParty:{name:"xplore_third_party",dimensions:[160,600],id:"div-gpt-ad-1366327280661-5"},leaderBoard:{name:"xplore_leader_board",dimensions:[728,90],id:"div-gpt-ad-1366327280661-6"},leaderBoardMiddle:{name:"xplore_leaderboard_articledetails_slot2",dimensions:[728,90],id:"div-gpt-ad-1485377759460-0",showHiddenClass:".Ads-leaderboard.middle"}})}(),function(){function googleAdTargetingService(){function getContentIdFromContentType(contentType){var contentId;switch(contentType){case"books":contentId="Books & eBooks";break;case"conferences":contentId="Conference Publications";break;case"periodicals":contentId="Journals & Magazines";break;case"standards":contentId="Standards";break;default:contentId=""}return contentId}function getSearchArrayFromDocument(abstract,keywords){var searchString,searchArray=[];return searchArray=searchArray.concat(getSearchArrayFromDocumentAbstract(abstract)),searchArray=searchArray.concat(getSearchArrayFromDocumentKeywords(keywords)),searchString=searchArray.length>0?JSON.stringify(searchArray):"",searchString=searchString.replace(/"/g,"'")}function getTargetingInfo(user,search,puNumber,contentId,publisher){var targetingInfo={};return targetingInfo.user=user,targetingInfo.search=search,targetingInfo.puNumber=puNumber,targetingInfo.contentId=contentId,targetingInfo.publisher=publisher,targetingInfo}function getSearchArrayFromDocumentAbstract(abstract){var searchString,searchArray=[];return"string"!=typeof abstract&&(abstract=""),searchString=abstract.replace(/[^\w\s-]/g,"").replace(/\s+/g," "),searchArray=searchString.split(" ")}function getSearchArrayFromDocumentKeywords(keywords){var searchArray=[];if(Array.isArray(keywords)&&keywords.length>0)for(var i=0;i<keywords.length;i++)Object.keys(keywords[i]).indexOf("kwd")>-1&&(searchArray=searchArray.concat(keywords[i].kwd));return searchArray}return{getContentIdFromContentType:getContentIdFromContentType,getSearchArrayFromDocument:getSearchArrayFromDocument,getTargetingInfo:getTargetingInfo}}angular.module("xpl.ads").factory("googleAdTargetingService",googleAdTargetingService)}(),function(){function xplTealium($location,tealiumDataPrvdr,tealiumPrvdr,$state){function link(scope,element){var link=function(dataLayer){var d=scope.data||"{}",b={};try{b=angular.extend({},dataLayer,JSON.parse(d))}catch(error){}tealiumPrvdr.track("link",b)};element.bind("click",function(e){var event_type,event_text,event_source,dataLayer=tealiumDataPrvdr.getDataLayer($location.path()),target=e.target;switch(target.nodeName&&(event_type=""+(target.nodeName.toLowerCase()||target.localName||target.tagName.toLowerCase()),"a"===event_type?event_type="link":"img"==event_type&&(event_type="image"),dataLayer.event_type=event_type+" click"),dataLayer.event_target=event_type,event_text=target.title||target.innerText||target.innerHTML.trim(),""===event_text&&target.value&&""!==target.value?event_text=target.value:""===event_text&&target.alt&&""!==target.alt&&(event_text=target.alt),dataLayer.event_attr1=event_text,event_type){case"link":event_source=target.href;break;case"button":event_source=target.type||"";break;case"input":event_source=target.value||"";break;default:target.src&&""!==target.src&&(event_source=target.src)}dataLayer.event_attr2=event_source,link(dataLayer)})}var directive={link:link,restrict:"A",scope:{data:"@utagDataStr"}};return directive}angular.module("xpl.tags.tealium.directive",["xpl.tags.tealium"]).directive("xplTealium",xplTealium),xplTealium.$inject=["$location","tealiumDataPrvdr","tealiumPrvdr","$state"]}();var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};!function(){function tealiumService(tealiumPrvdr,tealiumDataPrvdr,$state,breadcrumbService,userService,utilService,$log){function view(data,setUserData){setUserData&&"boolean"==typeof setUserData&&(data=tealiumService.setUserdata2data(data)),tealiumPrvdr.view(data)}function link(data){tealiumPrvdr.link(data)}function isTealiumEnabled(){return tealiumPrvdr.isTealiumEnabled()}function setUserdata2data(data){var userData=tealiumService.getUserData(),dataWithUserData=tealiumService.copySrcObjs2data(data,userData);return dataWithUserData}function copySrcObjs2data(data,srcObj1,srcObj2){data=data||{},srcObj1=srcObj1||{},srcObj2=srcObj2||{};var retObj={};try{"string"==typeof data&&(data=JSON.parse(data)),"string"==typeof srcObj1&&(srcObj1=JSON.parse(srcObj1)),"string"==typeof srcObj2&&(srcObj2=JSON.parse(srcObj2)),retObj=angular.extend(data,srcObj1,srcObj2)}catch(error){return $log.error("ERROR - copySrcObjs2data returning original data back. Can not copy srcObj1:",srcObj1," and srcObj2:",srcObj2,"on to data:",data,"got error:",error),data}return retObj}function getUserData(){return{user_id:userService.getUserId(),user_institution_id:userService.getUserInstitutionId(),user_product:userService.getProducts(),user_third_party:TEALIUM_user_third_party,user_type:userService.getUserType()}}function getPublisher(useJSONstringify){if(useJSONstringify=!!(useJSONstringify===!0||useJSONstringify&&"true"===useJSONstringify),$state.params.publisher)return $state.params.publisher;var publishers=breadcrumbService.getBreadcrumb("key","Publisher");return publishers?(publishers=publishers.children.map(function(){return publishers.key}),useJSONstringify?JSON.stringify(publishers):publishers.join("|")):void 0}function getSearchWithin(useJSONstringify){if(useJSONstringify=!!(useJSONstringify===!0||useJSONstringify&&"true"===useJSONstringify),$state.params)return strOrArray2str($state.params.searchWithin,useJSONstringify)}function getRefinements(responseData,useJSONstringify){if(useJSONstringify=!!(useJSONstringify===!0||useJSONstringify&&"true"===useJSONstringify),$state.params){var id2match,refinements=$state.params.refinements,breadCrumbs=responseData.breadCrumbs,breadCrumbsChildren=breadCrumbs?breadCrumbs.map(function(x){return x.children}):[],func4map=function(children){return _.result(_.find(children,function(child){return child.value===id2match}),"key")};return refinements=refinements?refinements.map(function(refinementId){return id2match=refinementId,_.find(breadCrumbsChildren.map(func4map),function(val){return void 0!==val})}):void 0,strOrArray2str(refinements,useJSONstringify)}}function getSelectedValue(responseData,useJSONstringify){if(useJSONstringify=!!(useJSONstringify===!0||useJSONstringify&&"true"===useJSONstringify),$state.params){var selectedValue_FROM_state_params=$state.params.selectedValue,selectedValue_FROM_responseData_meta_queryParams=utilService.get(responseData,"meta.queryParams.selectedValue"),selectedValue=decodeURIComponent(selectedValue_FROM_state_params),selectedValue_parsedInt=parseInt(selectedValue);return!isNaN(selectedValue_parsedInt)&&isFinite(selectedValue_parsedInt)&&void 0!==selectedValue_FROM_responseData_meta_queryParams&&(selectedValue=selectedValue_FROM_responseData_meta_queryParams),strOrArray2str(selectedValue,useJSONstringify)}}function getCollection(useJSONstringify){if(useJSONstringify=!!(useJSONstringify===!0||useJSONstringify&&"true"===useJSONstringify),$state.params)return strOrArray2str($state.params.collection,useJSONstringify)}function strOrArray2str(val,useJSONstringify){if(useJSONstringify=!!(useJSONstringify===!0||useJSONstringify&&"true"===useJSONstringify),void 0!==val){var valStr="";return"string"==typeof val||val instanceof String?valStr=encodeURIComponent(val):Array.isArray(val)&&(val=val.map(function(v){return encodeURIComponent(v)}),valStr=useJSONstringify?JSON.stringify(val):val.join("|")),valStr}}var tealiumService={view:view,link:link,isTealiumEnabled:isTealiumEnabled,setViewIdMapEntry:tealiumPrvdr.setViewIdMapEntry,setUserdata2data:setUserdata2data,copySrcObjs2data:copySrcObjs2data,getUserData:getUserData,getPublisher:getPublisher,getSearchWithin:getSearchWithin,getRefinements:getRefinements,getSelectedValue:getSelectedValue,getCollection:getCollection};return tealiumService}angular.module("xpl.tags").factory("tealiumService",tealiumService),tealiumService.$inject=["tealiumPrvdr","tealiumDataPrvdr","$state","breadcrumbService","userService","utilService","$log"]}();