function DefaultAjaxErrorAlert(){Ext.Msg.alert("Error","There was an error processing your request.&nbsp;")}function DefaultAjaxTimeoutAlert(){Ext.Msg.alert("Error","The request to the server was received, but the server took too long to respond.<br>The operation timed out.&nbsp;")}function DefaultAjaxCommunicationAlert(){Ext.Msg.alert("Error","The request to the server failed.<br>This can happen if the server is not responding.&nbsp;")}function TimeoutDialog(){var t=function(){Ext.defer(function(){try{NPS.Common.Utils.showLoadMask();Ext.Ajax.request({url:_validToUrl,timeout:_ajaxTimeout,method:"GET",async:!0,success:function(){try{Ext.Ajax.request({url:_touchUrl,timeout:_ajaxTimeout,method:"GET",async:!0,success:function(){tid=sessionCheckLoop();NPS.Common.Utils.hideLoadMask();Ext.getCmp(timeoutDialogID).close()},failure:function(n){NPS.Common.Utils.hideLoadMask();n.timeout?DefaultAjaxTimeoutAlert():n.status===0||n.status===503?DefaultAjaxCommunicationAlert():n.status===403?(Ext.getCmp(timeoutDialogID).close(),openSigninDialog()):DefaultAjaxErrorAlert()}})}catch(n){NPS.Common.Utils.hideLoadMask();n.code===19?DefaultAjaxCommunicationAlert():DefaultAjaxErrorAlert()}},failure:function(n){NPS.Common.Utils.hideLoadMask();n.timeout?DefaultAjaxTimeoutAlert():n.status===0||n.status===503?DefaultAjaxCommunicationAlert():n.status===403?(Ext.getCmp(timeoutDialogID).close(),openSigninDialog()):DefaultAjaxErrorAlert()}})}catch(n){NPS.Common.Utils.hideLoadMask();n.code===19?DefaultAjaxCommunicationAlert():DefaultAjaxErrorAlert()}},10)},n=Ext.getCmp(timeoutDialogID);if(n){n.show();return}n=Ext.create("Ext.window.Window",{id:timeoutDialogID,width:500,height:180,layout:"form",title:"Session Timeout",bodyStyle:"background-color:#FFFFFF",items:[{xtype:"container",margin:"0 0 0 0",padding:5,layout:{type:"table",columns:2},defaults:{},items:[{xtype:"image",margin:"0 10 0 10",src:Nps.icons.warn,height:30,width:30},{xtype:"displayfield",margin:"10 10 10 10",value:'<strong>Your session is about to expire due to inactivity.<\/strong><br><br>Click the "Keep Alive" button to continue.<br><br>Note: If your session has already expired, you will need to sign in again.&nbsp;'}]}],buttons:[{text:"Keep Alive",cls:"mainActionButton",type:"submit",handler:function(){t()}}]});n.show()}function abortSessionCheckLoop(){clearInterval(tid)}function checkTimout(){try{Ext.Ajax.request({url:_validToUrl,timeout:_ajaxTimeout,method:"GET",async:!0,success:function(n){const t=Ext.decode(n.responseText);t.SecondsRemaining<=_timeoutWindow*60&&(abortSessionCheckLoop(),TimeoutDialog())},failure:function(){}})}catch(n){}return null}function sessionCheckLoop(){if(!timeoutEnabled)return-1;const n=_timeoutWindow*6e4;return setInterval(checkTimout,n)}function openSigninDialog(){if(Ext.getCmp(signinDialogID)){Ext.getCmp(signinDialogID).show();return}const n=Ext.create("Ext.window.Window",{id:signinDialogID,width:500,height:150,layout:"form",title:"Session Expired",bodyStyle:"background-color:#FFFFFF",items:[{xtype:"container",margin:"0 0 0 0",padding:5,layout:{type:"table",columns:2},items:[{xtype:"image",margin:"0 10 0 10",src:Nps.icons.warn,height:30,width:30},{xtype:"displayfield",margin:"10 10 10 10",value:`<strong>Your session has expired.</strong><br><br><a onclick="restartSessionCheckLoop();" href="${_signInUrl}" target="_blank">Click here</a> to open an new window where your credentials will be verified. After verification, you can return to this window and continue.`}]}]});n.show()}function restartSessionCheckLoop(){Ext.getCmp(signinDialogID)&&Ext.getCmp(signinDialogID).close();tid=sessionCheckLoop()}function expandCollapseText(n){Ext.ComponentQuery.query("#descriptionCitationItemIdC")[0].setVisible(!n);Ext.ComponentQuery.query("#descriptionCitationItemIdE")[0].setVisible(n)}function expandCollapseText2(n){Ext.ComponentQuery.query("#fullContactCitationItemIdC")[0].setVisible(!n);Ext.ComponentQuery.query("#fullContactCitationItemIdE")[0].setVisible(n)}Ext.define("Ext.ux.PagingToolbarResizer",{extend:"Ext.AbstractPlugin",alias:"plugin.pagingtoolbarresizer",options:[25,50,100,250,500],mode:"remote",displayText:"Records per Page",constructor:function(n){Ext.apply(this,n);this.callParent(arguments)},init:function(n){const u=this.options;var t=n.store,i=Ext.create("Ext.form.field.ComboBox",{typeAhead:!1,triggerAction:"all",forceSelection:!0,lazyRender:!0,editable:!1,mode:this.mode,value:t.pageSize,width:50,store:u,listeners:{afterfirstlayout:function(){return!0},beforechange:function(){return!0},select:function(n,i){t.pageSize=i.data.field1;t.loadPage(1)}}}),r=n.items.indexOf(n.items.map.refresh);n.insert(++r,this.displayText);n.insert(++r,i);n.on({beforedestroy:function(){i.destroy()}})}});Ext.ns("NPS.DataStore.Constants");Ext.ns("NPS.DataStore.ReferenceGridColumns");Ext.ns("NPS.DataStore.util");Ext.namespace("NPS.Common.Utils");NPS.DataStore.util={validateDoi:function(n,t,i){const r=n.find(n=>n.Key===t),u=new RegExp(r.Value,"i");return u.test(i)},validateDoiPattern:function(n,t){var i=!1;for(let r=0;r<n.length;r++){const u=new RegExp(n[r].Value,"i");if(i=u.test(t),i===!0)break}return i},DataStoreAlert:{manageOwnershipSummary:function(n,t){if(!n||!t)return"";const r=function(n,t){var i="";switch(t){case 1:i="References:<br>";i+=n.ReferencesAffected+" successful<br>";i+=n.ReferencesSoleOwnerIgnored+" failed<br>";break;case 2:i="<br>Collections:<br>";i+=n.CollectionsAffected+" successful<br>";i+=n.CollectionsSoleOwnerIgnored+" failed<br>";break;case 3:i="<br>Saved Searches:<br>";i+=n.SavedSearchesAffected+" successful<br>";i+=n.SavedSearchesSoleOwnerIgnored+" failed<br>"}return i};var i="";const u=Array.isArray(t);if(u===!0)for(let u=0;u<t.length;u++)i+=r(n,t[u]);else i+=r(n,t);return i}},ToolTip:{singleHtmlTextFormat:function(n){return n?Ext.util.Format.htmlEncode(n).replace(/(\r\n|\n|\r)/g,"&nbsp;"):""},htmlTextFormat:function(n){return n?Ext.util.Format.htmlEncode(Ext.util.Format.htmlEncode(n)).replace(/(\r\n|\n|\r)/g,"&nbsp;"):""},simpleToolTipLink:function(n){return n?`<a data-qtip="${this.htmlTextFormat(n)}">${Ext.util.Format.htmlEncode(n)}</a>`:""},toolTipLink:function(n,t,i){return i?`<a href="${Ext.util.Format.htmlEncode(n)}" data-qtip="${this.htmlTextFormat(t)}" target="${i}">${Ext.util.Format.htmlEncode(t)}</a>`:`<a href="${Ext.util.Format.htmlEncode(n)}" data-qtip="${this.htmlTextFormat(t)}">${Ext.util.Format.htmlEncode(t)}</a>`},simpleToolTipSpan:function(n){return`<span data-qtip="${this.htmlTextFormat(n)}">${Ext.String.htmlEncode(n)}</span>`}},Format:{qtipFormattedNameRenderer:function(){return function(n,t,i){const r=i.data.FirstName+" "+i.data.LastName;return t.tdAttr=`data-qtip="${NPS.DataStore.util.ToolTip.htmlTextFormat(r)}"`,Ext.String.htmlEncode(r)+""}},qtipRenderer:function(){return function(n,t){return t.tdAttr=`data-qtip="${NPS.DataStore.util.ToolTip.htmlTextFormat(n)}"`,Ext.String.htmlEncode(n)+""}}},Holding:{holdingTypeText:function(n){switch(n){case 0:return"Digital File";case 1:return"External Link";case 2:return"Web Service "}return""},fileExtension:function(n){const t=n.split("."),i=t[0]===""&&t.length===2;return t.length===1||i?"":t.pop()}},EncodeCheck:{validate:function(n){var t=!0;if(n&&n.length>0){const i=n.replace(/\s/g,"");let r=i.replace(/<script/igm,"");t=r===i;t===!0&&(r=i.replace(/<form/igm,""),t=r===i)}return t},deOutline:function(n){var t="";return n&&n.length>0&&(t=n.replace(/<ul>/igm,""),t=t.replace(/<\/ul>/igm,""),t=t.replace(/<li>/igm,""),t=t.replace(/<\/li>/igm,"")),t}},Encoder:{encode:function(n){return n&&n.length>0&&(n=n.replace(/</g,"&lt;").replace(/>/g,"&gt;")),n}},SaveWarnings:{getDraftWarningMsg:function(n){if(!n)return"";var t="";const i=function(){t.length>0&&(t+="<br>")};switch(!0){case n.IsOlderVersion===!0:i();t+="Note: Until you re-activate this reference, users redirected<br>to this reference from older versions will not have<br>permission to view the profile.";break;case n.IsReadOnly===!0:i();t+="The Reference is read only. Editing is not permitted";break;case n.ChildCount>0:i();t+=`Note: This reference has ${n.ChildCount} related ${n.ChildType}(s).<br>Until you re-activate this reference, other users will not have access to this profile.`;break;case n.ProductCount>0:i();t+="Note: Until you re-active this project reference,<br>the related products will not be presented as being associated with this project.";break;case n.IsCollectionItem===!0:i();t+="The Reference belongs to a collection.";break;case n.PointedToByXRef>0:i();t+=n.PointedToByXRef>1?`Note: There are ${n.PointedToByXRef} references `:"Note: There is a reference";t+=" pointing to this reference (through cross-referencing).<br>Until you re-activate this reference, users redirected to this reference will not have permission to view the profile.";break;case n.PointsToXRef===!0:i();t+="";break;case n.IsLatestVersion===!0:t+="Note: Until you re-activate this reference, users redirected to this reference from older versions will not have permission to view the profile."}return t.length>0&&(t+="<br><br>Do you want to save the Reference to Draft?"),t},getInactivateWarningMsg:function(n){if(!n)return"";var r={},i="",t=function(){i.length>0&&(i+="<br>")};return n.IsDoi===!0&&(i+="You may not inactivate this reference because it has a digital object identifier managed by NPS.",t(),t()),n.IsLatestVersion===!0?(i+="You may not inactivate this reference because it is the most recent version, linked to an older version. If you still deem it necessary to inactivate this reference, you must first remove the version link from the previous reference.",t()):(n.IsOlderVersion===!0&&(i+='You may not edit this reference because it is an older version. If you still deem it necessary to edit this reference, you must first remove the version links. Use the "Break Link" button.',t()),n.HasApprovedUnits===!0&&(i+=`You may not inactivate this reference because it has at least one approved ${NPS.DataStore.Constants.TitleCaseSingularUnit} link. If you still deem it necessary to inactivate this reference, the ${NPS.DataStore.Constants.TitleCaseSingularUnit} link must first be deleted, or denied by the ${NPS.DataStore.Constants.TitleCaseSingularUnit} Point of Contact.`,t()),n.HasProject===!0&&(n.CanInactivate===!1?(i+="You may not inactivate this reference because it is linked to a Project. If you still deem it necessary to inactivate this reference, the Project owner must first unlink it.",t()):(t(),i+="Note: This reference is linked to a project. Inactivating this reference will unlink it from the project.",t())),n.IsReadOnly===!0&&n.IsOlderVersion===!1&&(i+="The Reference is read only. Editing is not permitted",t()),n.HasParent===!0&&(i+=`You may not inactivate this reference because it is linked to a ${n.ParentType}. To inactivate this reference, you must first remove the link to the ${n.ParentType}.`,t()),n.ChildCount>0&&(i+=`You may not inactivate this reference because it has ${n.ChildCount} related ${n.ChildType}(s).`,t(),i+=`To inactivate this reference, you must first remove the links from the ${n.ChildCount} ${n.ChildType}(s).`,t()),n.IsMaster===!0&&(t(),i+="Note: This reference is flagged as the current master by one or more duplicate references. Inactivating this reference will restrict redirect access from any designated duplicate references.",t()),n.IsDuplicate===!0&&(t(),i+="Note: This reference has been flagged as a duplicate. Edits may be saved, but only in the current Inactive state.",t()),n.ProductCount>0&&(t(),i+=`Note: Inactivating this project reference will remove the link to the ${n.ProductCount} related products.`,t()),n.IsCollectionItem===!0&&(t(),i+="Note: This Reference belongs to one or more collections that users have set up for their own personal needs. Inactivating this reference will prevent those other users from accessing this reference and associated content.",t()),n.PointedToByXRef>0&&(t(),i+=n.PointedToByXRef>1?`Note: There are ${n.PointedToByXRef} references`:"Note: There is a reference",i+=" pointing to this reference (through cross-referencing).",t(),i+="Inactivating this reference will permanently remove the cross-reference.",t()),n.IsHardDelete===!0&&n.IsDuplicate===!1&&n.IsMaster===!1&&(t(),i+="Note: Because this reference has never been activated, inactivating this reference will result in a permanent delete.",t())),i.length===0&&(i="Soft-delete this Record. Edits will be saved.<br>"),r.msg=i,r}},ReferenceLabel:{getFieldLabel:function(n,t){return(t===undefined||t===null)&&(t=!1),n===undefined||n===null?"None Provided":n.Required&&t===!1?`* ${n.DisplayName}`:n.DisplayName}},Browser:{doBrowserCheck:function(n){const i=n||"this";var t;const r=Ext.isGecko&&!(Ext.isGecko3||Ext.isGecko2);if(!Ext.isChrome&&!r&&(t=Ext.isIE7||Ext.isIE8||Ext.isIE9||Ext.isIE10p?"an older version of Internet Explorer":Ext.isGecko&&(Ext.isGecko3||Ext.isGecko2)?"an older version of Firefox":Ext.isOpera?"Opera":Ext.isSafari?"Safari":"an unknown, non supported browser",t.length>0)){t=`<span class="ttHeaderCss" style="padding-left: 0px;">Are you using ${t}?</span>`;t+=`<br><br><br>Some features of ${i} application may not function properly with your current browser.<br><br>`;t+="We  suggest you to switch to a different browser, like ";t+='<a href="https://www.google.com/intl/en/chrome/" target="_blank">Chrome<\/a>, ';t+='<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">Firefox<\/a>, or ';t+='<a href="https://support.microsoft.com/en-us/windows/internet-explorer-downloads-d49e1f0d-571c-9a7b-d97e-be248806ca70" target="_blank">Internet Explorer 10 or higher<\/a>.<br>';try{const n=Ext.util.Cookies.get("NrpcDisableBrowserCheck");n&&n==="true"||this.showBrowserUnsupportedWindow(t)}catch(u){alert(text)}}},showBrowserUnsupportedWindow:function(n){Ext.util.Cookies.set("NrpcDisableBrowserCheck",!1);Ext.create("Ext.window.Window",{modal:!0,width:700,title:"Unsupported Browser",bodyStyle:"padding: 10px 30px 10px 30px",draggable:!1,resizable:!1,constrain:!0,items:[{xtype:"label",html:n},{xtype:"checkbox",boxLabel:"Don’t show me again during this session.",id:"dontShowCb",margin:"35 0 0 0"}],listeners:{close:function(){Ext.getCmp("dontShowCb").checked&&Ext.util.Cookies.set("NrpcDisableBrowserCheck",!0)}}}).show()}},ExternalSite:{showOffSiteWarning:function(n){Ext.create("Ext.window.Window",{modal:!0,title:"Thank you for visiting our site",bodyStyle:"padding: 10px 30px 10px 30px",draggable:!1,resizable:!0,constrain:!0,items:[{xtype:"displayfield",value:`<strong>You are exiting the ${NPS.DataStore.Constants.DepartmentHeading}</strong><br><br>Click the link below to redirect to the external site.<br>`},{xtype:"displayfield",value:`<a href="${decodeURI(n)}" target="_blank">${n}</a>`},{xtype:"displayfield",value:"<br>We hope your visit was informative and enjoyable."}]}).show()}},cleanStringForResponse:function(n){return n?(n=n.replace(/[^0-9,]/g,","),n=n.replace(/,+/g,","),n.replace(/(^,)/g,"")):""},convertUTCDateToLocalDate:function(n){try{const t=new Date(n.getTime()+n.getTimezoneOffset()*6e4),i=n.getTimezoneOffset()/60,r=n.getHours();return t.setHours(r-i),t}catch(t){return n}},ignoreTimeZone:function(n){if(n===null||n===undefined||n.length===0)return null;if(Ext.isDate(n))return NPS.DataStore.util.convertUTCDateToLocalDate(new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate())));const t=Ext.Date.parse(n,"MS",!1);return t===null||t==undefined?null:new Date(t.getFullYear(),t.getMonth(),t.getDate())},timeZoneShifter:function(n,t){if(!n)return n;var i=null;return(n instanceof Date&&!isNaN(n.valueOf())&&(i=new Date(n.getFullYear(),n.getMonth(),n.getDate())),t&&i)?Ext.util.Format.date(i,t):i}};NPS.Common.Utils={registerEnterSubmit:function(n,t){return new Ext.KeyMap({target:n?n:document,key:13,fn:t})},submitForm:function(n,t,i){const r=$("<form />",{method:i,action:t});for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)){const i=$("<input />",{type:"hidden",id:t,name:t,val:n[t]});r.append(i)}r.hide().appendTo("body").submit().remove()},showLoadMask:function(n,t){(!n||n.length<1)&&(n="Please wait...");t&&t.target||(t=Ext.getBody());const i=t.mask(n);i.show()},hideLoadMask:function(){Ext.getBody().unmask()}};Ext.define("HelpFieldContainer",{extend:"Ext.form.FieldContainer",xtype:"helpfieldcontainer",constructor:function(n){Ext.apply(this,{layout:"hbox",labelSeparator:" ",labelStyle:n.labelStyle||"color: #663c00",listeners:{beforerender:function(){const t={xtype:"image",src:n.helpIconUrl||Nps.icons.help,height:10,width:12,alt:"Help"};n.iconPos==="left"?(t.margin="0 3 0 0",this.insert(0,t)):(t.margin="0 0 0 3",this.add(t))},afterrender:function(){function i(n){if(!n.npsTooltip)return null;const t=n.npsTooltip,r=$("<div>"),i=$("<div>").addClass("helpTooltip").appendTo(r);$("<div>").html(t.text).addClass("ttipText").css("margin-bottom","1em").appendTo(i);$("<div>").html(t.subtext).addClass("ttipSubtext").appendTo(i);const u=$("<div>").appendTo(i);return $("<a>").attr("href",t.linkUrl).attr("target","_blank").css("float","right").html(t.linkText).appendTo(u),r.html()}const t=this.items.items.length,r=n.tooltip||{html:i(n),autoHide:!1,anchor:"left",anchorOffset:-5,target:this.items.get(t-1).id,width:n.tooltipWidth||"auto",minWidth:200},u=Ext.create("Ext.tip.ToolTip",r);u.setTarget(this.items.get(t-1).id)}}});this.callParent(arguments)}});Ext.define("HelpTextField",{extend:"HelpFieldContainer",xtype:"helptextfield",constructor:function(n){Ext.apply(this,{layout:"hbox",fieldLabel:"",labelSeparator:" ",items:[{xtype:"displayfield",value:n.text||"",fieldCls:n.textCls||"plainLabel"}]});this.callParent(arguments)}});Ext.define("NPS.Common.Controls.HomeHeaderWidget",{extend:"Ext.Container",constructor:function(n){n=n||{};n.prepend=n.prepend+" - ";n.renderTo=n.renderTo||"theTitle";n.headerText=n.headerText||"";n.headerCls=n.bodyText?n.headerCls||"infoHomePageHeaderCss":n.headerCls||"infoHomePageHeaderNoBodyCss";n.bodyText=n.bodyText||"";n.bodyCls=n.bodyCls||"infoHomePageBodyCss";n.helpIcon=n.helpIcon||Nps.icons.help2;n.helpUrl=n.helpUrl||"";n.helpIconCls="headerHomePageWidgetIcon";n.imgCls="infoHomePageHeaderImg";n.imgText=n.imgText||"";n.scaleImg=n.scaleImg!==null?n.scaleImg:!1;n.collapsed=n.collapsed!==null?n.collapsed:!0;this._c=n.collapsed;this.insertDOM.call(this,n);document.title=n.prepend+n.headerText;Ext.apply(this,{})},insertDOM:function(n){var i,t,r;const e=n.helpIcon;i="";n.img&&(i=$("<img alt='header widget image'><\/img>").attr({src:n.img,alt:n.imgText}).addClass(n.imgCls).css({float:"left","margin-right":"10px"}),n.scaleImg&&i.attr({height:"40",width:"40"}));n.bodyText?(r=this,t=n.collapsed?$("<h2><\/h2>").text(n.headerText+" »"):$("<h2><\/h2>").text(n.headerText),t.click(function(){$(`#${n.id}_bodyPart`).toggle("fast");r._c?t.text(n.headerText):t.text(n.headerText+" »");r._c=!r._c})):t=$("<h2><\/h2>").text(n.headerText);const u=$("<div><\/div>").addClass(n.headerCls).append(i);if(n.helpUrl){const t=$("<img alt='help icon image'><\/img>").attr({src:e,alt:"Get Help on this page",id:n.id+"_imgHelp"}).addClass(n.helpIconCls).click(function(){const t=n.helpUrl;window.open(t,"_blank")});u.append(t)}u.append(t);const o=$(`#${n.renderTo}`).append(u),f=$("<div><\/div>").attr("id",n.id+"_bodyPart").addClass(n.bodyCls).html(n.bodyText);n.bodyText&&n.collapsed&&f.css("display","none");o.append(f)},setTitle:function(n){$("#theTitle h2").html(n);document.title=config.prepend+n}});var timeoutDialogID="timeoutDialogID",signinDialogID="signinDialogID",tid,timeoutEnabled=!0;Ext.apply(Ext.form.field.VTypes,{encodeValidate:function(n){return NPS.DataStore.util.EncodeCheck.validate(n)},encodeValidateText:"Not valid text."});Ext.event.publisher.Dom.prototype.unsubscribe=function(n,t,i,r){const f=this;var o,s,u,e;i&&!f.directEvents[t]?(o=f.captureSubscribers,s=f.bubbleSubscribers,u=r?o:s,u!=null&&u[t]&&--u[t],s==null||o==null||f.handles[t]||s[t]||o[t]||this.removeDelegatedListener(t)):(u=r?f.directCaptureSubscribers:f.directSubscribers,e=n.id,u=u[t],u[e]&&--u[e],u[e]||(delete u[e],f.removeDirectListener(t,n,r)))}