webpackJsonp([2,20],[function(t,exports,e){t.exports=e(26)},function(t,exports,e){"use strict";var o=e(2);e(4),e(5),e(6)(o),e(7)(o),e(8)(o),o.loadAngularConstantsForApp=function(t){if(window.bepress.page_context&&window.bepress.page_context.angular_constants)for(var e in window.bepress.page_context.angular_constants)t.constant(e,window.bepress.page_context.angular_constants[e])},t.exports=o},function(t,exports,e){"use strict";e(3);var o=window.bepress=window.bepress||{};t.exports=o},function(t,exports){"use strict";!function(){function t(t){var e=null;if(document.cookie&&""!==document.cookie)for(var o=document.cookie.split(";"),n=0;n").addClass("modal-header").html(t),e=$("
").addClass("modal-body").html(e),o=$("").addClass("modal-footer btn-group-spaced").html(o);var n=$("").addClass("modal-content").append(t).append(e).append(o),i=$("").addClass("modal-dialog").append(n),r=$("").addClass("modal user-input-dialog").append(i);return $(r)},i=function(t){if(!t)return null;var e=$("");return $.each(t,function(t,o){var n=o.text||t,i=o.class||"btn btn-small btn-default",r=o.attrs||{},a=o.data||{},s=o.click||$.noop(),l=o.html,u=$("").text(n).addClass(i).on("click",s).data(a);l&&u.html(l),$.each(r,function(t,e){u.attr(t,e)}),e.append(u)}),e},r=function(t){"string"!=typeof t.message&&(t.message=t.message.html());var e=t.title||"",r=t.buttons?i(t.buttons):t.footer||"";t=$.extend({},o,t);var a=n(e,t.message,r);return a.modal(a),a};t.modals={ERROR_TITLE:e,error:function(t){var o,n=$.Deferred();t=t||{},t.message=t.message||"Something is wrong with the server. Please wait a moment and try again.",t=$.extend({},{title:e,modal_classes:"error-dialog",buttons:{OK:{click:function(){o.modal("hide"),o.remove(),n.resolve()}}}},t),o=r(t),o.modal("show");var i=n.promise();return i._modal=o,i},authorizationError:function(t){return this.error({title:t.title||"Authorization Error
",message:t.message||"Your session has expired. The page will now reload.
"}).done(function(){window.location.reload()})},jqAuthorizationError:function(t,e){return 401===t.status?this.authorizationError():void(e&&e(t))},confirm:function(t,e,o){e=e||"Cancel",o=o||"Continue";var n,i=$.Deferred(),a={title:"Are you sure?
",buttons:{cancelText:{click:function(){n.modal("hide"),n.remove(),i.reject()},text:e},continueText:{click:function(){n.modal("hide"),n.remove(),i.resolve()},text:o,class:"btn btn-primary"}}};t=$.extend({},a,t),n=r(t),n.modal("show");var s=i.promise();return s._modal=n,s},success:function(t,e){e=e||"OK";var o,n=$.Deferred(),i={title:"Success!
",buttons:{confirmText:{click:function(){o.modal("hide"),o.remove(),n.resolve()},text:e,class:"btn btn-primary"}}};t=$.extend({},i,t),o=r(t),o.modal("show");var a=n.promise();return a._modal=o,a}}}},function(t,exports){"use strict";t.exports=function(t){t.angularInit=function(t){return t.config(["$httpProvider","$interpolateProvider","$provide",function(t,e,o){t.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",e.startSymbol("{$"),e.endSymbol("$}"),o.decorator("$browser",["$delegate",function(t){return t.onUrlChange=function(){},t.url=function(){return""},t}])}]).run(["$http","$cookies",function(t,e){t.defaults.headers.post["X-CSRFToken"]=e.csrftoken,t.defaults.headers.put["X-CSRFToken"]=e.csrftoken,t.defaults.headers.delete={},t.defaults.headers.delete["X-CSRFToken"]=e.csrftoken}]).filter("markHTMLSafe",["$sce",function(t){return function(e){return e?t.trustAsHtml(e):e}}])}}},,,,,,,,,,,function(t,exports){(function(){"use strict";var t,e;t=jQuery,e=function(e,o){var n,i,r,a=this;return this.options=t.extend({title:null,footer:null,remote:null},t.fn.ekkoLightbox.defaults,o||{}),this.$element=t(e),n="",this.modal_id=this.options.modal_id?this.options.modal_id:"ekkoLightbox-"+Math.floor(1e3*Math.random()+1),r='",i='",t(document.body).append('"),this.modal=t("#"+this.modal_id),this.modal_dialog=this.modal.find(".modal-dialog").first(),this.modal_content=this.modal.find(".modal-content").first(),this.modal_body=this.modal.find(".modal-body").first(),this.lightbox_container=this.modal_body.find(".ekko-lightbox-container").first(),this.lightbox_body=this.lightbox_container.find("> div:first-child").first(),this.showLoading(),this.modal_arrows=null,this.border={top:parseFloat(this.modal_dialog.css("border-top-width"))+parseFloat(this.modal_content.css("border-top-width"))+parseFloat(this.modal_body.css("border-top-width")),right:parseFloat(this.modal_dialog.css("border-right-width"))+parseFloat(this.modal_content.css("border-right-width"))+parseFloat(this.modal_body.css("border-right-width")),bottom:parseFloat(this.modal_dialog.css("border-bottom-width"))+parseFloat(this.modal_content.css("border-bottom-width"))+parseFloat(this.modal_body.css("border-bottom-width")),left:parseFloat(this.modal_dialog.css("border-left-width"))+parseFloat(this.modal_content.css("border-left-width"))+parseFloat(this.modal_body.css("border-left-width"))},this.padding={top:parseFloat(this.modal_dialog.css("padding-top"))+parseFloat(this.modal_content.css("padding-top"))+parseFloat(this.modal_body.css("padding-top")),right:parseFloat(this.modal_dialog.css("padding-right"))+parseFloat(this.modal_content.css("padding-right"))+parseFloat(this.modal_body.css("padding-right")),bottom:parseFloat(this.modal_dialog.css("padding-bottom"))+parseFloat(this.modal_content.css("padding-bottom"))+parseFloat(this.modal_body.css("padding-bottom")),left:parseFloat(this.modal_dialog.css("padding-left"))+parseFloat(this.modal_content.css("padding-left"))+parseFloat(this.modal_body.css("padding-left"))},this.modal.on("show.bs.modal",this.options.onShow.bind(this)).on("shown.bs.modal",function(){return a.modal_shown(),a.options.onShown.call(a)}).on("hide.bs.modal",this.options.onHide.bind(this)).on("hidden.bs.modal",function(){return a.gallery&&t(document).off("keydown.ekkoLightbox"),a.modal.remove(),a.options.onHidden.call(a)}).modal("show",o),this.modal},e.prototype={modal_shown:function(){var e,o=this;return this.options.remote?(this.gallery=this.$element.data("gallery"),this.gallery&&(this.gallery_items="document.body"===this.options.gallery_parent_selector||""===this.options.gallery_parent_selector?t(document.body).find('*[data-toggle="lightbox"][data-gallery="'+this.gallery+'"]'):this.$element.parents(this.options.gallery_parent_selector).first().find('*[data-toggle="lightbox"][data-gallery="'+this.gallery+'"]'),this.gallery_index=this.gallery_items.index(this.$element),t(document).on("keydown.ekkoLightbox",this.navigate.bind(this)),this.options.directional_arrows&&this.gallery_items.length>1&&(this.lightbox_container.append(''),this.modal_arrows=this.lightbox_container.find("div.ekko-lightbox-nav-overlay").first(),this.lightbox_container.find("a"+this.strip_spaces(this.options.left_arrow_class)).on("click",function(t){return t.preventDefault(),o.navigate_left()}),this.lightbox_container.find("a"+this.strip_spaces(this.options.right_arrow_class)).on("click",function(t){return t.preventDefault(),o.navigate_right()}))),this.options.type?"image"===this.options.type?this.preloadImage(this.options.remote,!0):"youtube"===this.options.type&&(e=this.getYoutubeId(this.options.remote))?this.showYoutubeVideo(e):"vimeo"===this.options.type?this.showVimeoVideo(this.options.remote):"instagram"===this.options.type?this.showInstagramVideo(this.options.remote):"url"===this.options.type?this.loadRemoteContent(this.options.remote):"video"===this.options.type?this.showVideoIframe(this.options.remote):this.error('Could not detect remote target type. Force the type using data-type="image|youtube|vimeo|instagram|url|video"'):this.detectRemoteType(this.options.remote)):this.error("No remote target given")},strip_stops:function(t){return t.replace(/\./g,"")},strip_spaces:function(t){return t.replace(/\s/g,"")},isImage:function(t){return t.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSwf:function(t){return t.match(/\.(swf)((\?|#).*)?$/i)},getYoutubeId:function(t){var e;return e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/),!(!e||11!==e[2].length)&&e[2]},getVimeoId:function(t){return t.indexOf("vimeo")>0&&t},getInstagramId:function(t){return t.indexOf("instagram")>0&&t},navigate:function(t){if(t=t||window.event,39===t.keyCode||37===t.keyCode){if(39===t.keyCode)return this.navigate_right();if(37===t.keyCode)return this.navigate_left()}},navigateTo:function(e){var o,n;return 0>e||e>this.gallery_items.length-1?this:(this.showLoading(),this.gallery_index=e,this.$element=t(this.gallery_items.get(this.gallery_index)),this.updateTitleAndFooter(),n=this.$element.attr("data-remote")||this.$element.attr("href"),this.detectRemoteType(n,this.$element.attr("data-type")||!1),this.gallery_index+1'+this.options.loadingMessage+""),this},showYoutubeVideo:function(t){var e,o;return o=this.checkDimensions(this.$element.data("width")||560),e=o/(560/315),this.showVideoIframe("//www.youtube.com/embed/"+t+"?badge=0&autoplay=1&html5=1",o,e)},showVimeoVideo:function(t){var e,o;return o=this.checkDimensions(this.$element.data("width")||560),e=o/(500/281),this.showVideoIframe(t+"?autoplay=1",o,e)},showInstagramVideo:function(t){var e,o;return o=this.checkDimensions(this.$element.data("width")||612),this.resize(o),e=o+80,this.lightbox_body.html(''),this.options.onContentLoaded.call(this),this.modal_arrows?this.modal_arrows.css("display","none"):void 0},showVideoIframe:function(t,e,o){return o=o||e,this.resize(e),this.lightbox_body.html(''),this.options.onContentLoaded.call(this),this.modal_arrows&&this.modal_arrows.css("display","none"),this},loadRemoteContent:function(e){var o,n,i=this;return n=this.$element.data("width")||560,this.resize(n),o=this.$element.data("disableExternalCheck")||!1,o||this.isExternal(e)?(this.lightbox_body.html(''),this.options.onContentLoaded.call(this)):this.lightbox_body.load(e,t.proxy(function(){return i.$element.trigger("loaded.bs.modal")})),this.modal_arrows&&this.modal_arrows.css("display","none"),this},isExternal:function(t){var e;return e=t.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/),"string"==typeof e[1]&&e[1].length>0&&e[1].toLowerCase()!==location.protocol||"string"==typeof e[2]&&e[2].length>0&&e[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host},error:function(t){return this.lightbox_body.html(t),this},preloadImage:function(e,o){var n,i=this;return n=new Image,(null==o||o===!0)&&(n.onload=function(){var e;return e=t(""),e.attr("src",n.src),e.addClass("img-responsive"),i.lightbox_body.html(e),i.modal_arrows&&i.modal_arrows.css("display","block"),i.resize(n.width),i.options.onContentLoaded.call(i)},n.onerror=function(){return i.error("Failed to load image: "+e)}),n.src=e,n},resize:function(e){var o;return o=e+this.border.left+this.padding.left+this.padding.right+this.border.right,this.modal_dialog.css("width","auto").css("max-width",o),this.lightbox_container.find("a").css("line-height",function(){return t(this).parent().height()+"px"}),this},checkDimensions:function(t){var e,o;return o=t+this.border.left+this.padding.left+this.padding.right+this.border.right,e=document.body.clientWidth,o>e&&(t=this.modal_body.width()),t},close:function(){return this.modal.modal("hide")},addTrailingSlash:function(t){return"/"!==t.substr(-1)&&(t+="/"),t}},t.fn.ekkoLightbox=function(o){return this.each(function(){var n;return n=t(this),o=t.extend({remote:n.attr("data-remote")||n.attr("href"),gallery_parent_selector:n.attr("data-parent"),type:n.attr("data-type")},o,n.data()),new e(this,o),this})},t.fn.ekkoLightbox.defaults={gallery_parent_selector:"document.body",left_arrow_class:".glyphicon .glyphicon-chevron-left",right_arrow_class:".glyphicon .glyphicon-chevron-right",directional_arrows:!0,type:null,always_show_close:!0,loadingMessage:"Loading...",onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}}}).call(this)},function(t,exports,e){"use strict";!function(o){var $=window.jQuery,n=e(21),i=function(t){t.setRequestHeader("Authorization","JWT "+window.bepress.page_context.current_user.web_token)},r=function(t){var e={method:"GET",contentType:"application/json",beforeSend:i,dataType:"json"},n=$.extend({},e,t);return"POST"!==n.method&&"PUT"!==n.method||(n.data=JSON.stringify(n.data)),$.ajax(n).fail(function(t){return o.modals.jqAuthorizationError(t)})},a=function(t){var e={transport:r};this.clientConf=$.extend({},e,t)},s=function(t,e){return e=e||"id",angular.isString(t)||angular.isNumber(t)?t:t[e]},l=function(t,e){t=t||!1;var o={};return t&&(o.include_crop=1),e&&(o.display_type=e),o},u=function(t){var e={};return t?($.each(t,function(t,o){e[t]=o?1:0}),e):e},d={makeRequest:function(t,e){return e=e||2,t.url=this.clientConf.base_url+"/v"+e+t.url,this.clientConf.transport(t)},profileWorks:function(t,e){var o={};return"undefined"!=typeof e&&(o={status:e}),this.makeRequest({url:"/profiles/"+t+"/works/",params:o})},profileWorkById:function(t,e){var o=window.bepress.page_context.profilesapi_works_id_api_version;return this.makeRequest({url:"/profiles/"+t+"/works/"+e+"/"},o)},withdrawProfileWorkByWorkId:function(t,e){var o=window.bepress.page_context.profilesapi_works_id_api_version;return this.makeRequest({method:"DELETE",url:"/profiles/"+t+"/works/"+e+"/"},o)},works:function(t){return this.makeRequest({url:"/works/",params:{owner:t}})},getWork:function(t){var e=s(t);return this.makeRequest({method:"GET",url:"/works/"+e+"/",data:t})},createWork:function(t){return this.makeRequest({method:"POST",url:"/works/",data:t})},updateWork:function(t,e){var o=s(t),n=u(e);return this.makeRequest({method:"PUT",url:"/works/"+o+"/",data:t,params:n})},createFile:function(t,e){return this.makeRequest({method:"POST",url:"/files/",data:t,params:l(e)})},getFile:function(t,e){return this.makeRequest({method:"GET",url:"/files/"+t+"/",params:l(e)})},updateFile:function(t,e,o){return e=e||!1,this.makeRequest({method:"PUT",url:"/files/"+t.id+"/",data:t,params:l(e,o)})},attachFileToWork:function(t,e){var o=s(t);return this.makeRequest({method:"POST",url:"/works/"+o+"/files/",data:e})},addWorkToProfile:function(t,e){var o=s(t);return this.makeRequest({method:"POST",url:"/profiles/"+o+"/works/",data:e})},createAuthor:function(t){return this.makeRequest({method:"POST",url:"/authors/",data:t})},getAuthorById:function(t){return this.makeRequest({url:"/authors/"+t+"/"})},getAuthorAliases:function(t){var e=s(t);return this.makeRequest({url:"/authors/"+e+"/aliases/"})},getAuthorName:function(t){var e=s(t);return this.makeRequest({url:"/authors/"+e+"/name/"},3)},createAuthorAlias:function(t,e){var o=s(t);return this.makeRequest({method:"POST",url:"/authors/"+o+"/aliases/",data:e})},updateAuthor:function(t,e){var o=s(t);return e=e||{},this.makeRequest({method:"PUT",url:"/authors/"+o+"/",data:t,params:e})},updateAuthorAliasAuthorId:function(t,e){var o=s(t);return this.makeRequest({method:"PUT",url:"/aliases/"+o+"/",data:{author_id:e}})},createProfileWork:function(t,e){var o=s(t);return this.makeRequest({method:"POST",url:"/profiles/"+o+"/works/",data:e})},updateProfileWork:function(t,e){var o=s(t);return this.makeRequest({method:"PUT",url:"/profiles/"+o+"/works/",data:e})},deleteProfileWork:function(t){var e=s(t);return this.makeRequest({method:"DELETE",url:"/profile-works/"+e+"/"})},collectWork:function(t){return this.makeRequest({method:"GET",url:"/works/collect/",params:t})},getInstitution:function(t){var e=s(t),o=window.bepress.page_context.institutionsapi_api_version;return this.makeRequest({method:"GET",url:"/institutions/"+e+"/"},o)},searchInstitution:function(t){var e=window.bepress.page_context.institutionsapi_api_version;return this.makeRequest({method:"GET",url:"/institutions/",params:{display_in_ui:1,search:t}},e)},updateInstitution:function(t,e){var o=s(t),n=window.bepress.page_context.institutionsapi_api_version;return this.makeRequest({method:"PUT",url:"/institutions/"+o+"/",data:e},n)},updateInstitutionPartial:function(t,e){var o={id:t.id,name:t.name,url:t.url,branded:t.branded};return o=angular.extend(o,e),this.updateInstitution(t,o)},getInstitutionRoles:function(t,e){var o=s(t),n=window.bepress.page_context.api_version_rolesapi;return e=e||{},this.makeRequest({method:"GET",url:"/institutions/"+o+"/roles/",params:e},n)},updateInstitutionRoles:function(t,e){var o=s(t),n=e.kind,i=window.bepress.page_context.api_version_rolesapi;return this.makeRequest({method:"PUT",url:"/institutions/"+o+"/roles/"+n+"/",data:e},i)},getOrganizationsForInstitution:function(t,e){var o=s(t),n=window.bepress.page_context.organizations_api_version;return this.makeRequest({method:"GET",url:"/institutions/"+o+"/organizations/",params:e},n)},createInstitutionOrg:function(t,e){var o=s(t),n=window.bepress.page_context.organizations_api_version;return e.institution_id=o,this.makeRequest({method:"POST",url:"/institutions/"+o+"/organizations/",data:e},n)},getInstitutionProfiles:function(t){return this.makeRequest({method:"GET",url:"/profiles/",params:t})},getInstitutionProfileMemberships:function(t,e){var o=s(t),n=window.bepress.page_context.institutionsapi_api_version;return this.makeRequest({method:"GET",url:"/institutions/"+o+"/memberships/",params:e},n)},membershipDetailsRequest:function(t,e,o){var n=s(t),i=s(e),r=window.bepress.page_context.institutionsapi_api_version;return this.makeRequest({method:o,url:"/institutions/"+n+"/memberships/"+i+"/"},r)},approveMembership:function(t,e){return this.membershipDetailsRequest(t,e,"POST")},destroyMembership:function(t,e){return this.membershipDetailsRequest(t,e,"DELETE")},listUserContentCategories:function(t,e){var o=s(t);return this.makeRequest({method:"GET",url:"/users/"+o+"/content-categories/",params:e})},createUserContentCategory:function(t,e){var o=s(t);return this.makeRequest({method:"POST",url:"/users/"+o+"/content-categories/",data:e})},createProfile:function(t,e){var o={},n=window.bepress.page_context.profilesapi_api_version;return e&&(o.Authorization="JWT "+e),this.makeRequest({method:"POST",url:"/profiles/",data:t,headers:o},n)},getProfile:function(t,e){var o=s(t),n=window.bepress.page_context.profilesapi_api_version;return e=e||{},this.makeRequest({method:"GET",url:"/profiles/"+o+"/",params:e},n)},checkProfileExists:function(t){return this.makeRequest({method:"GET",url:"/profiles/",params:t})},followProfileId:function(t){return this.makeRequest({method:"POST",url:"/profiles/"+t+"/follows/",data:null})},unfollowProfileId:function(t){return this.makeRequest({method:"DELETE",url:"/profiles/"+t+"/follows/",data:null})},updateProfile:function(t,e){var o=window.bepress.page_context.profilesapi_api_version,n=s(t);return this.makeRequest({method:"PUT",url:"/profiles/"+n+"/",params:e,data:t},o)},updateProfilePartial:function(t,e,o){var n={id:t};return n=angular.extend(n,e),this.updateProfile(n,o)},getProfileFollows:function(){return this.makeRequest({method:"GET",url:"/users/follows/"})},getProfileRole:function(t,e){return this.makeRequest({method:"GET",url:"/users/"+t+"/roles/"+e+"/"})},addUserRole:function(t,e){var o=s(t),n="/users/"+o+"/roles/";return null===e.organization&&delete e.organization,this.makeRequest({method:"POST",url:n,data:e})},updateUserRole:function(t,e){var o=s(t),n=s(e),i="/users/"+o+"/roles/"+n+"/";return e.organization||delete e.organization,this.makeRequest({method:"PUT",url:i,data:e})},deleteUserRole:function(t,e){var o=s(t),n=s(e),i="/users/"+o+"/roles/"+n+"/";return this.makeRequest({method:"DELETE",url:i})},createInstitution:function(t){var e=window.bepress.page_context.institutionsapi_api_version;return this.makeRequest({method:"POST",url:"/institutions/",data:t},e)},findProfileWorks:function(t){return this.makeRequest({method:"GET",url:"/profile-works/",params:t})},recordStat:function(t){return this.makeRequest({method:"POST",url:"/stats/",data:t})},getProfileMetadata:function(t,e){var o=s(t);return e=e||{},this.makeRequest({method:"GET",url:"/profiles/"+o+"/metadata/",params:e},3)},createProfileMetadata:function(t,e){var o=s(t);return e=n.dropEmpty(e),this.makeRequest({method:"POST",url:"/profiles/"+o+"/metadata/",data:e},3)},updateProfileMetadata:function(t,e,o){var i=s(t);return o=n.dropEmpty(o),this.makeRequest({method:"PUT",url:"/profiles/"+i+"/metadata/"+e+"/",data:o},3)},deleteProfileMetadata:function(t,e){var o=s(t);return this.makeRequest({method:"DELETE",url:"/profiles/"+o+"/metadata/"+e+"/"},3)},getContactFormSettings:function(t){var e=s(t),o=window.bepress.page_context.institutionsapi_api_version;return this.makeRequest({method:"GET",url:"/institutions/"+e+"/admin/contact/"},o)},addContact:function(t,e,o){var n=s(t);return this.makeRequest({method:"PUT",url:"/institutions/"+n+"/groups/"+o+"/admins/"+e+"/"},3)},deleteContact:function(t,e,o){var n=s(t);return this.makeRequest({method:"DELETE",url:"/institutions/"+n+"/groups/"+o+"/admins/"+e+"/"},3)},updateContactFormSettings:function(t,e){var o=s(t),n=window.bepress.page_context.institutionsapi_api_version;return this.makeRequest({method:"PUT",url:"/institutions/"+o+"/admin/contact/",data:e},n)},listAffiliationsForHarvest:function(){return this.makeRequest({method:"GET",url:"/harvest/ma/affiliations/"},3)},putMaAffiliationSelection:function(t,e,o){return o.ma_id=e,this.makeRequest({method:"PUT",url:"/harvest/ma/affiliations/"+t+"/selections/"+e+"/",data:o},3)},putMaPaperSelection:function(t,e,o){return o.ma_id=e,this.makeRequest({method:"PUT",url:"/harvest/ma/papers/"+t+"/selections/"+e+"/",data:o},3)},deleteMaPaperSelection:function(t,e){return this.makeRequest({method:"DELETE",url:"/harvest/ma/papers/"+t+"/selections/"+e+"/"},3)},listWorksForHarvest:function(t){return this.makeRequest({method:"GET",url:"/harvest/ma/works/",params:t},3)},getWorksForHarvestCount:function(t){return this.makeRequest({method:"GET",url:"/harvest/ma/works/summary/",params:t},3)},harvestWork:function(t){return this.makeRequest({method:"POST",url:"/harvest/ma/works/",data:t},3)},generateProfileReportAndSendEmail:function(t,e){var o=s(t);return this.makeRequest({method:"POST",url:"/reports/institutions/"+o+"/profiles/",data:{recipient:e}},3)},createMetadataObject:function(t,e,o){var i=o.key,r={};return r[i]=e,r=n.dropEmpty(r),this.makeRequest({method:"POST",url:"/profiles/"+t+"/metadata/",data:{data:r,kind:o.kind}},3)},updateMetadataObject:function(t,e,o,i){var r=i.key,a={};return a[r]=o,a=n.dropEmpty(a),this.makeRequest({method:"PUT",url:"/profiles/"+t+"/metadata/"+e,data:{data:a,kind:i.kind}},3)},deleteMetadataObject:function(t,e){return this.makeRequest({method:"DELETE",url:"/profiles/"+t+"/metadata/"+e},3)}};$.extend(a.prototype,d),o.workApiClient=new a({base_url:o.page_context.WORKS_SERVICE_URL}),t.exports=o.WorksApiClient=a}(window.bepress)},function(t,exports,e){"use strict";var o=e(16),n=function t(e){if(o.isArray(e)){var n=[];return o.each(e,function(e){var o=t(e);null!==o&&n.push(o)}),n}if(o.isObject(e)){var i={};return o.forOwn(e,function(e,o){var n=t(e);null!==n&&(i[o]=n)}),o.isEmpty(i)?null:i}return o.isBoolean(e)?e:""===e?null:e};t.exports.dropEmpty=n},function(t,exports,e){"use strict";var o=e(2),n=e(20),i=e(23);!function(t,e){var o=function(e,$q,o,n){var i=function(e){var o=$q.defer(),n=o.promise;return e.success(function(t){o.resolve(t)}).error(function(e){return e&&e.meta&&401===e.meta.code?void t.modals.authorizationError():void o.reject(e)}),n.success=function(t){return n.then(t),n},n.error=function(t){return n.then(null,t),n},n},r=function(t){var o={Authorization:"JWT "+window.bepress.page_context.current_user.web_token};return t.headers=$.extend({},o,t.headers||{}),i(e(t))};return new o({transport:r,base_url:n})},r=e.module("bpAngularApi",[]);r.factory("worksApiClient",["$http","$q",function(e,$q){return o(e,$q,n,t.page_context.WORKS_SERVICE_URL)}]),r.factory("opusApiClient",["$http","$q",function(t,$q){return o(t,$q,i,"/api")}])}(o,window.angular),t.exports="bpAngularApi"},function(t,exports){"use strict";!function(e){var $=window.jQuery,o=function(t){var o={method:"GET",dataType:"json",headers:{"Content-Type":"application/json",Authorization:"JWT "+window.bepress.page_context.current_user.web_token}},n=$.extend({},o,t);return"POST"===n.method&&n.data&&(n.data=JSON.stringify(n.data)),$.ajax(n).fail(function(t){return e.modals.jqAuthorizationError(t)})},n=function(t){var e={transport:o};this.clientConf=$.extend({},e,t)},i={makeRequest:function(t,e){return e=e||2,t.url=this.clientConf.base_url+"/v"+e+t.url,this.clientConf.transport(t)},createUser:function(t){return this.makeRequest({method:"POST",url:"/users/",data:t})},getEmails:function(t){return t=t||{},this.makeRequest({method:"GET",url:"/users/emails/",params:t},3)},checkUserExists:function(t){return this.makeRequest({method:"GET",url:"/users/",params:t})},checkBPUserExists:function(t){return this.makeRequest({method:"GET",url:"/users/"+t+"/bp_user/"})},getInstitutionAdmins:function(t){return this.makeRequest({method:"GET",url:"/institutions/"+t+"/admins/"})},createInstitutionAdmin:function(t,e){return this.makeRequest({method:"POST",url:"/institutions/"+t+"/admins/",data:e})},saveInstitutionAdmin:function(t,e){return this.makeRequest({method:"PUT",url:"/institutions/"+t+"/admins/"+e.uuid+"/",data:e})},deleteInstitutionAdmin:function(t,e){return this.makeRequest({method:"DELETE",url:"/institutions/"+t+"/admins/"+e.uuid+"/"})},createNotificationEvent:function(t){return this.makeRequest({method:"POST",url:"/events/",data:t})},getAvatar:function(t){return this.makeRequest({method:"GET",url:"/users/"+t+"/avatars/"})},updateAvatar:function(t,e){return this.makeRequest({method:"POST",url:"/users/"+t+"/avatars/",data:e})},deleteAvatar:function(t){return this.makeRequest({method:"DELETE",url:"/users/"+t+"/avatars/"})},impersonateUser:function(t){return this.makeRequest({method:"POST",url:"/account/impersonate/",data:t})},getDelegates:function(t){return this.makeRequest({method:"GET",url:"/users/"+t+"/delegates/"})},addDelegate:function(t,e){return this.makeRequest({method:"POST",url:"/users/"+t+"/delegates/"+e.uuid+"/",data:e})},deleteDelegate:function(t,e){return this.makeRequest({method:"DELETE",url:"/users/"+t+"/delegates/",data:e.uuid})},pingBack:function(t){return this.makeRequest({method:"POST",url:"/ping-back/",data:t})},createContact:function(t,e){return this.makeRequest({url:"/profiles/"+t+"/contact/",method:"POST",data:e},3)}};$.extend(n.prototype,i),e.opusApiClient=new n({base_url:"/api"}),t.exports=e.OpusApiClient=n}(window.bepress)},,,function(t,exports,e){"use strict";!function(){var t=e(1),o=e(16),n=angular.module("bpProfileViewApp",["ngCookies","ui.bootstrap","vcRecaptcha",e(22)]);n=t.angularInit(n);var i={};i.profile_id=t.page_context.profile_id,i.profile_name=t.page_context.profile_name,void 0!==t.page_context.current_institution&&(i.institution_id=t.page_context.current_institution.id,i.institution_name=t.page_context.current_institution.name,i.branded=t.page_context.current_institution.branded),n.controller("profileHeaderCtrl",["$scope","$modal","worksApiClient","opusApiClient",function($scope,e,worksApiClient,n){$scope.display_name=t.page_context.profile_display_name,$scope.isDisabled=function(){return!o.isNil($scope.display_name)&&0===$scope.display_name.length},$scope.save=function(){var e=window.bepress.page_context.current_user.profile_id,o={display_name:$scope.display_name};worksApiClient.updateProfilePartial(e,o).then(function(e){var o=e.data;$scope.display_name=o.display_name,t.page_context.profile_display_name=o.display_name,o&&!o.hidden&&n.createNotificationEvent({event_id:window.bepress.page_context.AUDIT_PROFILE_UPDATE,target_type:"Profile",target_uuid:o.id})})},$scope.cancel=function(){$scope.display_name=t.page_context.profile_display_name},$scope.openContactFormModal=function(){e.open({templateUrl:"contact_form_modal.html",
size:"md",keyboard:!1,controller:"contactFormModalCtrl",windowClass:"contact-form"}),t.logEvent("profile.contact.open",i)}}]),n.controller("contactFormModalCtrl",["$scope","$modalInstance","$timeout","opusApiClient",function($scope,$modalInstance,$timeout,e){$scope.inquiry={group:"general"},$scope.buttonText=function(){return $scope.busy?"Sending...":"Send Message"},$scope.submit=function(){var o=window.bepress.page_context.profile_name;$scope.busy=!0,e.createContact(o,$scope.inquiry).then(function(){$timeout(function(){$scope.success=!0})}).catch(window.bepress.modals.error).finally(function(){$scope.busy=!1}),i.organization_name=$scope.inquiry.organization,t.logEvent("profile.contact.submit",i)},$scope.close=function(){$modalInstance.close()}}]),e(27)(),e(28),e(29)}()},function(t,exports,e){"use strict";var o=e(2);e(20),e(23),t.exports=function(){var t=o.page_context.ping_backs||[];$.each(t,function(t,e){o.opusApiClient.pingBack(e)})}},function(t,exports,e){"use strict";!function(){function t(t,e){e="undefined"==typeof e||e;var o=t.split(":");e?window.bepress.workApiClient.followProfileId(o[1]).then(function(){i()}):window.bepress.workApiClient.unfollowProfileId(o[1]).then(function(){i()})}function o(t){t.removeClass("disabled"),t.addClass("isFollowing"),t.html(a)}function n(t){t.removeClass("disabled"),t.removeClass("isFollowing"),t.html(s)}function i(){var t=$(".followable");t.length&&window.bepress.workApiClient.getProfileFollows().then(function(t){var e=t.data,o=$.map(e,function(t){return t.data_follow_set});r(o)})}function r(t){var e=$(".followable");e.each(function(){var e=$(this),i=e.attr("data-follow-set");t.indexOf(i)>-1?o(e):n(e)})}e(20);var a=' Following',s=' Follow',l=' Unfollow',u=' Login to Follow';$(document).ready(function(){if(window.bepress.page_context.current_user&&window.bepress.page_context.current_user.is_authenticated)d.bindEventHandlers(),i();else if(window.bepress.page_context.send_follows_to_login_page){var t=$(".followable");t.each(function(){var t=$(this);t.addClass("loginToFollow"),t.removeClass("disabled")}),d.bindEventHandlers()}});var d={bindEventHandlers:function(){$(".followable").mouseover(this.onMouseOver).mouseout(this.onMouseOut).click(this.onClickFollow)},onClickFollow:function(e){e.preventDefault();var o=$(this).attr("data-follow-set");if(window.bepress.page_context.send_follows_to_login_page&&$(this).hasClass("loginToFollow")){var n=window.bepress.page_context.profile_name;window.location.href="/login/?next=/"+n+"/token/"+window.bepress.page_context.follow_token+"/"}else $(this).hasClass("isFollowing")?t(o,!1):t(o,!0)},onMouseOver:function(){window.bepress.page_context.send_follows_to_login_page&&$(this).hasClass("loginToFollow")?$(this).html(u):$(this).hasClass("isFollowing")?$(this).html(l):$(this).html(s)},onMouseOut:function(){window.bepress.page_context.send_follows_to_login_page&&$(this).hasClass("loginToFollow")?$(this).html(s):$(this).hasClass("isFollowing")?$(this).html(a):$(this).html(s)}}}(),t.exports="follow"},function(t,exports,e){"use strict";e(30),function(){function t(){i(),r();var t=function(){e(34);var t=window.History;return!!t.enabled&&($(window).bind("load statechange",function(e){var o=t.getState();o.data&&o.data.target||(o.data.target=window.bepress.page_context.active_tab),$('[data-target="'+o.data.target+'"]').tab("show"),"load"===e.type&&t.replaceState({target:o.data.target},null,o.url)}),void $("body").on("click",'[data-bp-toggle="tab"]',function(e){e.preventDefault();var o=$(this),n=o.data("target");o.tab("show");var i=t.getState();i.data.target!==n&&t.pushState({target:n},null,this.href)}))};t()}function o(){$.embedly?n():setTimeout(n,1e3)}function n(){$.embedly&&($.embedly.defaults.key="156798000f1c11e186fe4040d3dc5c07",$("a.embedly-card").embedly())}function i(){$(document).delegate('*[data-toggle="lightbox"]:not([data-gallery="navigateTo"])',"click",function(t){return t.preventDefault(),$(this).ekkoLightbox()}),$("#open-image").click(function(t){t.preventDefault(),$(this).ekkoLightbox()}),$("#open-youtube").click(function(t){t.preventDefault(),$(this).ekkoLightbox()}),$(document).delegate('*[data-gallery="navigateTo"]',"click",function(t){return t.preventDefault(),$(this).ekkoLightbox({onShown:function(){var t=this.modal_content.find(".modal-footer a");t.length>0&&t.click(function(t){t.preventDefault(),this.navigateTo(2)}.bind(this))}})})}function r(){if($(".contact-info-email").length){var t=window.bepress.page_context.contact_info_email;$(".contact-info-email").html(t)}}var $=e(15);e(19);var a=e(33);$(document).ready(function(){t(),o(),a()})}(),t.exports="profile_view"},function(t,exports,e){"use strict";!function(){e(31);var t=e(2);if(t.page_context.infinite_scroll){var o=window.Waypoint,n=".tab-works-contents",i=".category-works-item",r=$(n),a=new o.BPInfinite({element:n,items:i,more:".more-category-works",offset:function(){return this.context.innerHeight()-this.adapter.outerHeight()+300},onInsert:function(t){var e=t.filter("section");$.each(e,function(t,e){e=$(e);var o='[data-category="'+e.data("category")+'"]',n=r.find(o);n.length?n.find(".category-works-container").append(e.find(i)):r.find(".insert-before").before(e)})},onAfterPageLoad:function(){var t=angular.element($(".tab-works-contents")),e=t.injector(),o=t.scope();e.get("$compile")($(".category-works-item"))(o)}}),s=$(".jump-to-category"),l=$("button",s),u=l.html(),d=function(t){var e=window.location.pathname+"?paginate=1";return t&&(e+="&"+t),e},c=function(t){a.$nextPage=t,a.$container.find("section").remove(),a.handling=!1,a.options.handler()};$("body").on("click",".jump-to-category li a",function(t){t.preventDefault();var e,o=$(this),n=o.data("reset");if(n)e=d(),c(e),l.html(u);else{var i=o.data("category-id"),r=o.text();l.html("Viewing "+r+' '),e=d("content_category="+i),c(e)}window.scrollTo(0,0)})}}(),t.exports="bpProfileScroll"},function(t,exports,e){"use strict";!function(){function t(e){this.options=$.extend({},t.defaults,e),this.container=this.options.element,"auto"!==this.options.container&&(this.container=this.options.container),this.$container=$(this.container),this.$more=$(this.options.more),this.handling=!1,this.setupHandler(),this.$more.length&&(this.$nextPage=this.$container.data("next-page"),this.waypoint=new o(this.options))}e(32);var $=window.jQuery,o=window.Waypoint;t.prototype.setupHandler=function(){this.options.handler=$.proxy(function(){this.handling||(this.handling=!0,this.options.onBeforePageLoad(),this.destroy(),this.$container.addClass(this.options.loadingClass),$.get(this.$nextPage,$.proxy(function(t){var e=$($.parseHTML(t)),n=e.find(this.container),i=n.data("next-page"),r=e.find(this.container).children();r.length||(r=e.filter(this.options.items)),this.options.onInsert?this.options.onInsert.call(this,r):this.$container.append(r),this.$container.removeClass(this.options.loadingClass),i&&(this.$nextPage=i,this.waypoint=new o(this.options)),this.options.onAfterPageLoad(r),this.handling=!1},this)))},this)},t.prototype.destroy=function(){this.waypoint&&this.waypoint.destroy()},t.defaults={container:"auto",items:".infinite-item",more:".infinite-more-link",offset:"bottom-in-view",loadingClass:"infinite-loading",onBeforePageLoad:$.noop,onAfterPageLoad:$.noop,onInsert:null},o.BPInfinite=t}()},function(t,exports){!function(){"use strict";function t(n){if(!n)throw new Error("No options passed to Waypoint constructor");if(!n.element)throw new Error("No element option passed to Waypoint constructor");if(!n.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,n),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=n.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),o[this.key]=this,e+=1}var e=0,o={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete o[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var n in o)e.push(o[n]);for(var i=0,r=e.length;in.oldScroll,r=i?n.forward:n.backward;for(var a in this.waypoints[o]){var s=this.waypoints[o][a];if(null!==s.triggerPoint){var l=n.oldScroll=s.triggerPoint,d=l&&u,c=!l&&!u;(d||c)&&(s.queueTrigger(r),t[s.group.id]=s.group)}}}for(var h in t)t[h].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?i.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?i.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var o in this.waypoints[e])t.push(this.waypoints[e][o]);for(var n=0,i=t.length;n-1&&(f=Math.ceil(a.contextDimension*f/100))),l=a.contextScroll-a.contextOffset,p.triggerPoint=Math.floor(m+l-f),u=g=a.oldScroll,c=u&&d,h=!u&&!d,!y&&c?(p.queueTrigger(a.backward),n[p.group.id]=p.group):!y&&h?(p.queueTrigger(a.forward),n[p.group.id]=p.group):y&&a.oldScroll>=p.triggerPoint&&(p.queueTrigger(a.forward),n[p.group.id]=p.group)}}return i.requestAnimationFrame(function(){for(var t in n)n[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in n)n[t].refresh()},e.findByElement=function(t){return n[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},i.requestAnimationFrame=function(e){var o=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;o.call(window,e)},i.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function o(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),n[this.axis][this.name]=this}var n={vertical:{},horizontal:{}},i=window.Waypoint;o.prototype.add=function(t){this.waypoints.push(t)},o.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},o.prototype.flushTriggers=function(){for(var o in this.triggerQueues){var n=this.triggerQueues[o],i="up"===o||"left"===o;n.sort(i?e:t);for(var r=0,a=n.length;r-1&&this.waypoints.splice(e,1)},o.prototype.first=function(){return this.waypoints[0]},o.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},o.findOrCreate=function(t){return n[t.axis][t.name]||new o(t)},i.Group=o}(),function(){"use strict";function t(t){this.$element=$(t)}var $=window.jQuery,e=window.Waypoint;$.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,o){t.prototype[o]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[o].apply(this.$element,t)}}),$.each(["extend","inArray","isEmptyObject"],function(e,o){t[o]=$[o]}),e.adapters.push({name:"jquery",Adapter:t}),e.Adapter=t}(),function(){"use strict";function t(t){return function(){var o=[],n=arguments[0];return t.isFunction(arguments[0])&&(n=t.extend({},arguments[1]),n.handler=arguments[0]),this.each(function(){var i=t.extend({},n,{element:this});"string"==typeof i.context&&(i.context=t(this).closest(i.context)[0]),o.push(new e(i))}),o}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}()},function(t,exports){"use strict";!function(){t.exports=function(){$(window).scroll(function(){var t=0<$("#back-to-top").css("opacity");$(window).scrollTop()<400?$("#back-to-top").css("opacity","0"):t||$("#back-to-top").css("opacity","1")}),$("body").on("click","#back-to-top",function(t){t.preventDefault(),$("html, body").animate({scrollTop:0},"slow")})}}()},function(module,exports){"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return t<10?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var o,n,i,r,a,s=gap,l=e[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof rep&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(l)){for(r=l.length,o=0;o")&&o[0];);return t>4&&t}();return t},h.isInternetExplorer=function(){var t=h.isInternetExplorer.cached="undefined"!=typeof h.isInternetExplorer.cached?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return t},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(t.history&&t.history.pushState&&t.history.replaceState&&!(/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)||/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent))),hashChange:Boolean(!("onhashchange"in t||"onhashchange"in n)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&"Apple Computer, Inc."===i.vendor&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&"Apple Computer, Inc."===i.vendor&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},h.cloneObject=function(t){var e,o;return t?(e=d.stringify(t),o=d.parse(e)):o={},o},h.getRootUrl=function(){var t=n.location.protocol+"//"+(n.location.hostname||n.location.host);return n.location.port&&(t+=":"+n.location.port),t+="/"},h.getBaseHref=function(){var t=n.getElementsByTagName("base"),e=null,o="";return 1===t.length&&(e=t[0],o=e.href.replace(/[^\/]+$/,"")),o=o.replace(/\/+$/,""),o&&(o+="/"),o},h.getBaseUrl=function(){var t=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return t},h.getPageUrl=function(){var t,e=h.getState(!1,!1),o=(e||{}).url||h.getLocationHref();return t=o.replace(/\/+$/,"").replace(/[^\/]+$/,function(t,e,o){return/\./.test(t)?t:t+"/"})},h.getBasePageUrl=function(){var t=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(t,e,o){return/[^\/]$/.test(t)?"":t}).replace(/\/+$/,"")+"/";return t},h.getFullUrl=function(t,e){var o=t,n=t.substring(0,1);return e="undefined"==typeof e||e,/[a-z]+\:\/\//.test(t)||(o="/"===n?h.getRootUrl()+t.replace(/^\/+/,""):"#"===n?h.getPageUrl().replace(/#.*/,"")+t:"?"===n?h.getPageUrl().replace(/[\?#].*/,"")+t:e?h.getBaseUrl()+t.replace(/^(\.\/)+/,""):h.getBasePageUrl()+t.replace(/^(\.\/)+/,"")),o.replace(/\#$/,"")},h.getShortUrl=function(t){var e=t,o=h.getBaseUrl(),n=h.getRootUrl();return h.emulated.pushState&&(e=e.replace(o,"")),e=e.replace(n,"/"),h.isTraditionalAnchor(e)&&(e="./"+e),e=e.replace(/^(\.\/)+/g,"./").replace(/\#$/,"")},h.getLocationHref=function(t){return t=t||n,t.URL===t.location.href?t.location.href:t.location.href===decodeURIComponent(t.URL)?t.URL:t.location.hash&&decodeURIComponent(t.location.href.replace(/^[^#]+/,""))===t.location.hash?t.location.href:t.URL.indexOf("#")==-1&&t.location.href.indexOf("#")!=-1?t.location.href:t.URL||t.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(t,e){"undefined"==typeof t&&(t=!0),"undefined"==typeof e&&(e=!0);var o=h.getLastSavedState();return!o&&e&&(o=h.createStateObject()),t&&(o=h.cloneObject(o),o.url=o.cleanUrl||o.url),o},h.getIdByState=function(t){var e,o=h.extractId(t.url);if(!o)if(e=h.getStateString(t),"undefined"!=typeof h.stateToId[e])o=h.stateToId[e];else if("undefined"!=typeof h.store.stateToId[e])o=h.store.stateToId[e];else{for(;;)if(o=(new Date).getTime()+String(Math.random()).replace(/\D/g,""),"undefined"==typeof h.idToState[o]&&"undefined"==typeof h.store.idToState[o])break;h.stateToId[e]=o,h.idToState[o]=t}return o},h.normalizeState=function(t){var e,o;return t&&"object"==typeof t||(t={}),"undefined"!=typeof t.normalized?t:(t.data&&"object"==typeof t.data||(t.data={}),e={},e.normalized=!0,e.title=t.title||"",e.url=h.getFullUrl(t.url?t.url:h.getLocationHref()),e.hash=h.getShortUrl(e.url),e.data=h.cloneObject(t.data),e.id=h.getIdByState(e),e.cleanUrl=e.url.replace(/\??\&_suid.*/,""),e.url=e.cleanUrl,o=!h.isEmptyObject(e.data),(e.title||o)&&h.options.disableSuid!==!0&&(e.hash=h.getShortUrl(e.url).replace(/\??\&_suid.*/,""),/\?/.test(e.hash)||(e.hash+="?"),e.hash+="&_suid="+e.id),e.hashedUrl=h.getFullUrl(e.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(e)&&(e.url=e.hashedUrl),e)},h.createStateObject=function(t,e,o){var n={data:t,title:e,url:o};return n=h.normalizeState(n)},h.getStateById=function(t){t=String(t);var o=h.idToState[t]||h.store.idToState[t]||e;return o},h.getStateString=function(t){var e,o,n;return e=h.normalizeState(t),o={data:e.data,title:t.title,url:t.url},n=d.stringify(o)},h.getStateId=function(t){var e,o;return e=h.normalizeState(t),o=e.id},h.getHashByState=function(t){var e,o;return e=h.normalizeState(t),o=e.hash},h.extractId=function(t){var e,o,n,i;return i=t.indexOf("#")!=-1?t.split("#")[0]:t,o=/(.*)\&_suid=([0-9]+)$/.exec(i),n=o?o[1]||t:t,e=o?String(o[2]||""):"",e||!1;
},h.isTraditionalAnchor=function(t){var e=!/[\/\?\.]/.test(t);return e},h.extractState=function(t,e){var o,n,i=null;return e=e||!1,o=h.extractId(t),o&&(i=h.getStateById(o)),i||(n=h.getFullUrl(t),o=h.getIdByUrl(n)||!1,o&&(i=h.getStateById(o)),i||!e||h.isTraditionalAnchor(t)||(i=h.createStateObject(null,null,n))),i},h.getIdByUrl=function(t){var o=h.urlToId[t]||h.store.urlToId[t]||e;return o},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||e},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||e},h.hasUrlDuplicate=function(t){var e,o=!1;return e=h.extractState(t.url),o=e&&e.id!==t.id},h.storeState=function(t){return h.urlToId[t.url]=t.id,h.storedStates.push(h.cloneObject(t)),t},h.isLastSavedState=function(t){var e,o,n,i=!1;return h.savedStates.length&&(e=t.id,o=h.getLastSavedState(),n=o.id,i=e===n),i},h.saveState=function(t){return!h.isLastSavedState(t)&&(h.savedStates.push(h.cloneObject(t)),!0)},h.getStateByIndex=function(t){var e=null;return e="undefined"==typeof t?h.savedStates[h.savedStates.length-1]:t<0?h.savedStates[h.savedStates.length+t]:h.savedStates[t]},h.getCurrentIndex=function(){var t=null;return t=h.savedStates.length<1?0:h.savedStates.length-1},h.getHash=function(t){var e,o=h.getLocationHref(t);return e=h.getHashByUrl(o)},h.unescapeHash=function(t){var e=h.normalizeHash(t);return e=decodeURIComponent(e)},h.normalizeHash=function(t){var e=t.replace(/[^#]*#/,"").replace(/#.*/,"");return e},h.setHash=function(t,e){var o,i;return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:e}),!1):(h.busy(!0),o=h.extractState(t,!0),o&&!h.emulated.pushState?h.pushState(o.data,o.title,o.url,!1):h.getHash()!==t&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+t,!1)):n.location.hash=t),h)},h.escapeHash=function(e){var o=h.normalizeHash(e);return o=t.encodeURIComponent(o),h.bugs.hashEscape||(o=o.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),o},h.getHashByUrl=function(t){var e=String(t).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return e=h.unescapeHash(e)},h.setTitle=function(t){var e,o=t.title;o||(e=h.getStateByIndex(0),e&&e.url===t.url&&(o=e.title||h.options.initialTitle));try{n.getElementsByTagName("title")[0].innerHTML=o.replace("<","<").replace(">",">").replace(" & "," & ")}catch(t){}return n.title=o,h},h.queues=[],h.busy=function(t){if("undefined"!=typeof t?h.busy.flag=t:"undefined"==typeof h.busy.flag&&(h.busy.flag=!1),!h.busy.flag){s(h.busy.timeout);var e=function(){var t,o,n;if(!h.busy.flag)for(t=h.queues.length-1;t>=0;--t)o=h.queues[t],0!==o.length&&(n=o.shift(),h.fireQueueItem(n),h.busy.timeout=a(e,h.options.busyDelay))};h.busy.timeout=a(e,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(t){return t.callback.apply(t.scope||h,t.args||[])},h.pushQueue=function(t){return h.queues[t.queue||0]=h.queues[t.queue||0]||[],h.queues[t.queue||0].push(t),h},h.queue=function(t,e){return"function"==typeof t&&(t={callback:t}),"undefined"!=typeof e&&(t.queue=e),h.busy()?h.pushQueue(t):h.fireQueueItem(t),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(s(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(t){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=a(function(){return h.doubleCheckClear(),h.stateChanged||t(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var e,o=h.extractState(h.getLocationHref());if(!h.isLastSavedState(o))return e=o,e||(e=h.createStateObject()),h.Adapter.trigger(t,"popstate"),h},h.back=function(t){return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:t}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(t){return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:t}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(t,e){var o;if(t>0)for(o=1;o<=t;++o)h.forward(e);else{if(!(t<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(o=-1;o>=t;--o)h.back(e)}return h},h.emulated.pushState){var g=function(){};h.pushState=h.pushState||g,h.replaceState=h.replaceState||g}else h.onPopState=function(e,o){var n,i,r=!1,a=!1;return h.doubleCheckComplete(),(n=h.getHash())?(i=h.extractState(n||h.getLocationHref(),!0),i?h.replaceState(i.data,i.title,i.url,!1):(h.Adapter.trigger(t,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",e,o)||!1,a=r?h.getStateById(r):h.expectedStateId?h.getStateById(h.expectedStateId):h.extractState(h.getLocationHref()),a||(a=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(a)?(h.busy(!1),!1):(h.storeState(a),h.saveState(a),h.setTitle(a),h.Adapter.trigger(t,"statechange"),h.busy(!1),!0))},h.Adapter.bind(t,"popstate",h.onPopState),h.pushState=function(e,o,n,i){if(h.getHashByUrl(n)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var r=h.createStateObject(e,o,n);return h.isLastSavedState(r)?h.busy(!1):(h.storeState(r),h.expectedStateId=r.id,p.pushState(r.id,r.title,r.url),h.Adapter.trigger(t,"popstate")),!0},h.replaceState=function(e,o,n,i){if(h.getHashByUrl(n)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var r=h.createStateObject(e,o,n);return h.isLastSavedState(r)?h.busy(!1):(h.storeState(r),h.expectedStateId=r.id,p.replaceState(r.id,r.title,r.url),h.Adapter.trigger(t,"popstate")),!0};if(r){try{h.store=d.parse(r.getItem("History.store"))||{}}catch(t){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(t,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),r&&(h.onUnload=function(){var t,e,o;try{t=d.parse(r.getItem("History.store"))||{}}catch(e){t={}}t.idToState=t.idToState||{},t.urlToId=t.urlToId||{},t.stateToId=t.stateToId||{};for(e in h.idToState)h.idToState.hasOwnProperty(e)&&(t.idToState[e]=h.idToState[e]);for(e in h.urlToId)h.urlToId.hasOwnProperty(e)&&(t.urlToId[e]=h.urlToId[e]);for(e in h.stateToId)h.stateToId.hasOwnProperty(e)&&(t.stateToId[e]=h.stateToId[e]);h.store=t,h.normalizeStore(),o=d.stringify(t);try{r.setItem("History.store",o)}catch(t){if(t.code!==DOMException.QUOTA_EXCEEDED_ERR)throw t;r.length&&(r.removeItem("History.store"),r.setItem("History.store",o))}},h.intervalList.push(l(h.onUnload,h.options.storeInterval)),h.Adapter.bind(t,"beforeunload",h.onUnload),h.Adapter.bind(t,"unload",h.onUnload)),h.emulated.pushState||(h.bugs.safariPoll&&h.intervalList.push(l(h.safariStatePoll,h.options.safariPollInterval)),"Apple Computer, Inc."!==i.vendor&&"Mozilla"!==(i.appCodeName||"")||(h.Adapter.bind(t,"hashchange",function(){h.Adapter.trigger(t,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(t,"hashchange")})))},h.options&&h.options.delayInit||h.init()}(window)}]);