var __extends,app;(function(n){var t;(function(n){var v=function(){function n(){}return n.CartService="cartService",n}(),t,i,r,u,f,e,o,s,h,c,l,a,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot;n.ServiceConstant=v;t=function(){function n(){}return n.ShoppingCartController="shoppingCartController",n.ShoppingCartCheckoutController="shoppingCartCheckOutController",n}();n.ControllerConstant=t;i=function(){function n(){}return n.TylerShoppingCart="tylerShoppingCart",n.EnerGovCart="energovCart",n}();n.DirectiveConstant=i;r=function(){function n(){}return n.PaidInFull="Paid In Full",n.Void="Void",n}();n.InvoiceStatus=r;u=function(){function n(){}return n.ShoppingCartModule="app.ShoppingCart",n.AppDirectiveShoppingCart="app.Directives.ShoppingCart",n.AppEnerGovCommonDirectiveCart="app.EnerGov.Common.Directives.Cart",n.EnerGovCommonDirectiveMapAddress="app.EnerGov.Directives.Map",n.CalendarModule="app.calendar",n.UserModule="app.Users",n.ConditionModule="app.EnerGov.Condition",n.TaxRemittanceModule="enerGov.TaxRemittance",n.TemplateModule="enerGov.Template",n.EscrowAccountModule="enerGov.EscrowAccount",n}();n.AppModule=u;f=function(){function n(){}return n.ShoppingCartApiController="/shoppingcart/",n.MyTotalCartItemApiAction="my/totalcartitems",n.MyCartItemsApiAction="my/cartitems",n.MyRemoveCartItemApiAction="my/removecartitem",n.MyAddToCartItemApiAction="my/addcartitem",n.AddTylerCartItemsApiAction="my/addTylerCartItems",n.AddCartItemsApiAction="my/addcartitems",n.GetCartItemApiAction="my/cartitem",n.TylerPaymentRequest="/payment/TylerPaymentRequest",n.CheckTylerPendingInvoices="my/checkpendinginvoices",n}();n.ApiRouteConstant=f;e=function(){function n(){}return n.mapSearchCompletedEventName="mapSearchCompleted",n.parcelPinCompletedEventName="parcelPinCompleted",n}();n.MapConstants=e;o=function(){function n(){}return n.Meeting="Meeting",n.Holiday="Holiday",n.Hearing="Hearing",n.Inspection="Inspection",n.Plan="Plan",n.Permit="Permit",n.Invoice="Invoice",n.None="None",n.License="License",n}();n.CalendarConstants=o;s=function(){function n(){}return n.UseDefault="Use Default",n.Yes="Yes",n.YesOverrideMidnightTime="Yes - Override Midnight Time",n.No="No",n.NoShowStaticText="No - Show Static Text",n.AM="AM",n}();n.InspectionConstants=s;h=function(){function n(){}return n.DateFormat="MM/DD/YYYY",n.DateFormatForSearch="MM/dd/yyyy",n.DateFormatWithTime="MM/DD/YYYY - hh:mm a",n.DateFormatWithTimeForSearch="MM/dd/yyyy - hh:mm a",n.DateFormatOnlyTime="hh:mm a",n.DateFormatOnlyTimeForInspection="hh:mm A",n.DateFormatOnlyMeridian="A",n}();n.GlobalConstants=h;c=function(){function n(){}return n.Permit="permits",n.Plan="plans",n.Inspection="inspections",n.License="licenses",n.Invoice="invoices",n}();n.ViewMenuConstants=c;l=function(){function n(){}return n.Summary="summary",n.Locations="locations",n.Fees="fees",n.Reviews="reviews",n.Inspections="inspections",n.Attachments="attachments",n.Contacts="contacts",n.Subrecords="subrecords",n.Holds="holds",n.Meetings="meetings",n.Moreinfo="moreinfo",n.Checklists="checklists",n.Previous="previous",n.Violations="violations",n.Primaryfees="primaryfees",n.Miscfees="miscfees",n.Payments="payments",n.Businesstypes="businesstypes",n.Business="business",n.Ereviews="ereviews",n.PersonalInfo="personalinfo",n.Addresses="addresses",n.MyAssociations="myassociations",n.MyFavorites="myfavorites",n.SubContacts="subcontacts",n.MyBusinesses="mybusinesses",n.MyDrafts="mydrafts",n.MyTemplates="mytemplates",n.MyCertificates="mycertificates",n.MyEscrowAccounts="myescrowaccounts",n.Comments="comments",n.MyPermits="mypermits",n.MyPlans="myplans",n.MyLicenses="mylicenses",n.MyInvoices="myinvoices",n.MyInspections="inspection",n.MyRemainingInspections="myremaininginspections",n.MyRequests="myrequests",n.Conditions="conditions",n.MyAccount="MyAccount",n.ContactManager="ContactManager",n.SavedWork="SavedWork",n.Projects="Projects",n.OperationalPermits="OperationalPermits",n.CodeCases="codecases",n.LinkedLicenses="licenses",n}();n.TabConstants=l;a=function(){function n(){}return n.License="License",n.Permit="Permit",n.Plan="Plan",n.Application="Application",n.OperationalPermit="Operational Permit",n}();n.DraftType=a,function(n){n[n.US=0]="US";n[n.International=1]="International";n[n.Canada=2]="Canada"}(y=n.UserAddressCountryType||(n.UserAddressCountryType={})),function(n){n[n.BusinessPhone=1]="BusinessPhone";n[n.HomePhone=2]="HomePhone";n[n.MobilePhone=3]="MobilePhone";n[n.OtherPhone=4]="OtherPhone";n[n.Fax=5]="Fax";n[n.Email=6]="Email";n[n.Address=7]="Address"}(p=n.PreferredCommunicationMethod||(n.PreferredCommunicationMethod={})),function(n){n[n.summary=0]="summary";n[n.locations=1]="locations";n[n.fees=2]="fees";n[n.reviews=3]="reviews";n[n.inspections=4]="inspections";n[n.ereviews=5]="ereviews";n[n.attachments=6]="attachments";n[n.contacts=7]="contacts";n[n.subrecords=8]="subrecords";n[n.holds=9]="holds";n[n.meetings=10]="meetings";n[n.moreinfo=11]="moreinfo";n[n.conditions=12]="conditions";n[n.comments=13]="comments"}(w=n.PermitTabs||(n.PermitTabs={})),function(n){n[n.summary=0]="summary";n[n.locations=1]="locations";n[n.fees=2]="fees";n[n.reviews=3]="reviews";n[n.inspections=4]="inspections";n[n.ereviews=5]="ereviews";n[n.attachments=6]="attachments";n[n.contacts=7]="contacts";n[n.subrecords=8]="subrecords";n[n.holds=9]="holds";n[n.meetings=10]="meetings";n[n.moreinfo=11]="moreinfo";n[n.conditions=12]="conditions";n[n.comments=13]="comments"}(b=n.PlanTabs||(n.PlanTabs={})),function(n){n[n.summary=0]="summary";n[n.locations=1]="locations";n[n.fees=2]="fees";n[n.attachments=3]="attachments";n[n.contacts=4]="contacts";n[n.holds=5]="holds";n[n.moreinfo=6]="moreinfo";n[n.conditions=7]="conditions"}(k=n.ProjectTabs||(n.ProjectTabs={})),function(n){n[n.locations=0]="locations";n[n.contacts=1]="contacts";n[n.checklists=2]="checklists";n[n.fees=3]="fees";n[n.attachments=4]="attachments";n[n.previous=5]="previous";n[n.moreinfo=6]="moreinfo"}(d=n.InspectionTabs||(n.InspectionTabs={})),function(n){n[n.locations=0]="locations";n[n.contacts=1]="contacts";n[n.fees=2]="fees";n[n.attachments=3]="attachments";n[n.meetings=10]="meetings";n[n.moreinfo=11]="moreinfo"}(g=n.ApplicationTabs||(n.ApplicationTabs={})),function(n){n[n.locations=0]="locations";n[n.inspections=1]="inspections";n[n.fees=2]="fees";n[n.attachments=3]="attachments";n[n.contacts=4]="contacts";n[n.holds=5]="holds";n[n.moreinfo=6]="moreinfo";n[n.violations=8]="violations"}(nt=n.CodeCaseTabs||(n.CodeCaseTabs={})),function(n){n[n.locations=0]="locations";n[n.codecases=2]="codecases";n[n.attachments=3]="attachments";n[n.contacts=4]="contacts";n[n.moreinfo=5]="moreinfo"}(tt=n.RequestTabs||(n.RequestTabs={})),function(n){n[n.locations=0]="locations";n[n.inspections=1]="inspections";n[n.fees=2]="fees";n[n.attachments=3]="attachments";n[n.contacts=4]="contacts";n[n.holds=5]="holds";n[n.moreinfo=6]="moreinfo"}(it=n.ProfLicenseTabs||(n.ProfLicenseTabs={})),function(n){n[n.business=0]="business";n[n.locations=1]="locations";n[n.inspections=2]="inspections";n[n.fees=3]="fees";n[n.attachments=4]="attachments";n[n.contacts=5]="contacts";n[n.holds=6]="holds";n[n.businesstypes=7]="businesstypes";n[n.moreinfo=8]="moreinfo"}(rt=n.BLLicenseTabs||(n.BLLicenseTabs={})),function(n){n[n.primaryfees=0]="primaryfees";n[n.miscfees=1]="miscfees";n[n.payments=2]="payments";n[n.attachments=3]="attachments";n[n.contacts=4]="contacts"}(ut=n.InvoiceTabs||(n.InvoiceTabs={})),function(n){n[n.locations=0]="locations";n[n.inspections=1]="inspections";n[n.attachments=2]="attachments";n[n.contacts=3]="contacts";n[n.holds=4]="holds";n[n.businesstypes=5]="businesstypes";n[n.moreinfo=6]="moreinfo";n[n.licenses=7]="licenses"}(ft=n.BusinessTabs||(n.BusinessTabs={})),function(n){n[n.personalinfo=0]="personalinfo";n[n.addresses=1]="addresses";n[n.myassociations=2]="myassociations";n[n.myfavorites=3]="myfavorites";n[n.mybusinesses=4]="mybusinesses";n[n.mytemplates=5]="mytemplates";n[n.mydrafts=6]="mydrafts";n[n.mycertificates=7]="mycertificates";n[n.subcontacts=8]="subcontacts"}(et=n.MyAccountTabs||(n.MyAccountTabs={})),function(n){n[n.mypermits=0]="mypermits";n[n.myplans=1]="myplans";n[n.mylicenses=2]="mylicenses";n[n.myinvoices=3]="myinvoices";n[n.myinspections=4]="myinspections";n[n.myremaininginspections=5]="myremaininginspections";n[n.myrequests=6]="myrequests"}(ot=n.MyWorkTabs||(n.MyWorkTabs={}))})(t=n.Constants||(n.Constants={}))})(app||(app={})),function(n){var t;(function(t){var i;(function(t){"use strict";var i=n.Common.MenuActionType,r=function(){function t(){}return t.setRouteProvider=function(n){n.caseInsensitiveMatch=!0;this.routeProvider=n},t.processRoutes=function(n,t){var r=this,i=undefined;return this.routeProvider&&angular.forEach(t,function(t){if(r.addOneMenuItem(t,n),(!i||t.DisplaySequence<i.DisplaySequence)&&!t.IsCustom){i=t;var u=r.getNavigationUrl(i);r.routeProvider.otherwise({redirectTo:u})}}),i},t.getNavigationUrl=function(n){var t="",r;if(n.Route&&n.Route!=="")try{r=JSON.parse(n.Route);t=r.NavigationUrl;t=t.replace(":menuId",n.MenuID.toString().trim());t=t.replace(":draftId","0");t=t.replace(":actionTypeId",i.Apply.toString())}catch(u){t=""}return t},t.addOneMenuItem=function(t,i){if(!t.IsCustom&&t.Route&&t.Route!==""){var r;try{r=JSON.parse(t.Route)}catch(u){r=undefined}r&&r.NavigationUrl&&r.ViewUrl!==""&&this.routeProvider.when("/"+r.NavigationUrl,{controller:r.ControllerName,controllerAs:r.ControllerAs,templateUrl:i.baseUrl+i.tenantUrl+"/"+r.ViewUrl+"?v="+i.version,pageTitle:r.PageTitle,reloadOnSearch:r.ReloadOnSearch==="false"?!1:!0})}t.SubMenus&&t.SubMenus.length>0&&angular.forEach(t.SubMenus,function(t){n.Common.Helpers.RouteHelper.addOneMenuItem(t,i)})},t}();t.RouteHelper=r})(i=t.Helpers||(t.Helpers={}))})(t=n.Common||(n.Common={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(){}return n.processMultiTenants=function(n,t,i){var u,r;if(i.length===0&&!n.isRunningUnitTest)return window.location.href=n.baseUrl+"selectTenant?v="+n.version,!1;if(i.length===1&&t.tenantUrl===""&&(t.isSingleTenant=!0,t.tenantUrl=i[0].TenantUrl,t.tenant=i[0].FriendlyTenantName!=null&&i[0].FriendlyTenantName!=""?i[0].FriendlyTenantName:i[0].TenantName,t.cultures=i[0].Cultures,n.tenantId=i[0].TenantID,n.tenantName=i[0].TenantName,n.tenantUrl=i[0].TenantUrl,n.cultures=i[0].Cultures,n.countryTypeId=i[0].CountryTypeId),i.length===1&&t.tenantUrl!=="")if(u=i[0].TenantUrl,u===t.tenantUrl)t.isSingleTenant=!0,t.tenant=i[0].FriendlyTenantName!=null&&i[0].FriendlyTenantName!=""?i[0].FriendlyTenantName:i[0].TenantName,t.cultures=i[0].Cultures,n.tenantId=i[0].TenantID,n.tenantUrl=i[0].TenantUrl,n.tenantName=i[0].TenantName,n.cultures=i[0].Cultures,n.countryTypeId=i[0].CountryTypeId;else if(!n.isRunningUnitTest)return window.location.href=n.baseUrl+"selectTenant?v="+n.version,!1;return i.length>1&&t.tenantUrl===""&&(t.isSingleTenant=!1,t.tenantUrl="",t.tenant="",!n.isRunningUnitTest)?(window.location.href=n.baseUrl+"selectTenant?v="+n.version,!1):i.length>1&&t.tenantUrl!==""&&(r=!1,t.isSingleTenant=!1,angular.forEach(i,function(i){i.TenantUrl===t.tenantUrl&&(t.tenant=i.FriendlyTenantName!=null&&i.FriendlyTenantName!=""?i.FriendlyTenantName:i.TenantName,t.cultures=i.Cultures,n.tenantId=i.TenantID,n.tenantName=i.TenantName,n.cultures=i.Cultures,n.countryTypeId=i.CountryTypeId,r=!0)}),!r&&!n.isRunningUnitTest)?(window.location.href=n.baseUrl+"selectTenant?v="+n.version,!1):!0},n}();n.TenantHelper=t})(t=n.Helpers||(n.Helpers={}))})(t=n.Common||(n.Common={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t){var r=n.call(this)||this,i,u,f,e,o;return r.restrict="A",r.replace=!0,r.template="",i="",u=null,r.scope={item:"=",cssClass:"@?",isAttachment:"<"},f=function(n,t,r){o(t);switch(n){case"pdf":i="<span class='"+r.cssClass+" pdf-icon mdi mdi-file-pdf-box'><\/span>";break;case"doc":case"docx":i="<span class='"+r.cssClass+" doc-icon mdi mdi-file-word-box'><\/span>";break;case"xls":case"xlsx":case"csv":i="<span class='"+r.cssClass+" xls-icon mdi mdi-file-excel-box'><\/span>";break;case"ppt":case"pptx":i="<span class='"+r.cssClass+" ppt-icon mdi mdi-file-powerpoint-box'><\/span>";break;case"tiff":case"tif":case"jpg":case"jpeg":case"gif":case"png":case"bmp":i="<span class='"+r.cssClass+" mdi mdi-image image-icon'><\/span>";break;default:i="<span class='"+r.cssClass+" txt-icon mdi mdi-file-document-box'><\/span>"}u=angular.element(i).appendTo(t)},e=function(n,r){if(n.item.file){var f=new FileReader;f.readAsDataURL(n.item.file.file);f.onload=function(){i='<img src="'+f.result+'" class="image-preview '+n.cssClass+'">';u=angular.element(i).appendTo(r);t(u)(n)}}else o(r),i='<img src="'+n.item.ThumbnailUrl+'&width=180&height=100" class="image-preview '+n.cssClass+'">',u=angular.element(i).appendTo(r),t(u)(n)},r.link=function(n,t){n.$watch("item",function(){var i=!1,u;if(n.cssClass||(n.cssClass="file-preview-size"),n.item&&n.item.file){var o=n.item.file,r=o.getExtension();r.toLowerCase()!="tiff"&&r.toLowerCase()!="tif"&&o.file.type.match(/image.*/)?e(n,t):f(r.toLowerCase(),t,n)}else u=n.isAttachment?n.item.FileName.substr(n.item.FileName.lastIndexOf(".")+1):n.item.SaveFileName.substr(n.item.SaveFileName.lastIndexOf(".")+1),angular.forEach(["jpg","jpeg","gif","png","bmp"],function(t){if(t==u.toLowerCase()&&n.item.ThumbnailUrl!==null)return i=!0}),i?e(n,t):f(u.toLowerCase(),t,n)})},o=function(n){var i=n[0].getElementsByTagName("span")[0],t;i&&n[0].removeChild(i);t=n[0].getElementsByTagName("img")[0];t&&n[0].removeChild(t)},r}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.AttachmentThumbnailDirective=i;angular.module("app.Common.Directives.AttachmentThumbnail",["app.Common.Directives"]).directive("attachmentThumbnail",["$compile",function(n){return new i(n)}])})(i=t.Directives||(t.Directives={}))})(t=n.Common||(n.Common={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(t){"use strict";var r=function(n){function t(){var t=n.call(this)||this;return t.restrict="E",t.replace=!0,t.scope={bindingSource:"=",bindingTarget:"="},t.link=function(n){n.$watch("bindingSource",function(t){n.bindingTarget=t})},t}return __extends(t,n),t}(n.Core.BaseDirective),i;t.BindCustomFieldsDirective=r;i=function(n){function t(t,i){var r=n.call(this)||this,u,f;return r.editLabel="Edit",r.deleteLabel="Delete",r.restrict="A",r.replace=!0,r.scope={tylerTableCustomFieldReadOnlyRow:"=",retiredColumns:"=",tabIndex:"=",headers:"=",tableCellCssClass:"@",isSummaryView:"=",groupIndex:"=",fieldIndex:"=",editRow:"&",removeRow:"&",allowRemoveRow:"="},u="Yes",f="No",i.clientSiteResources&&(u=i.clientSiteResources.filter(function(n){return n.Key=="TableCheckBoxTrue"})[0].Value,f=i.clientSiteResources.filter(function(n){return n.Key=="TableCheckBoxFalse"})[0].Value),r.link=function(n,i){for(var s,o,l,c,h=null,e=0;e<n.tylerTableCustomFieldReadOnlyRow.CustomFieldTableRowColumnCount;e++)n.retiredColumns.indexOf(e)>=0||(s="",o="",n.tylerTableCustomFieldReadOnlyRow["Column"+e]!==null&&n.tylerTableCustomFieldReadOnlyRow["Column"+e].CustomFieldTableCellType===7?(o=n.tylerTableCustomFieldReadOnlyRow["Column"+e].Value===!0||n.tylerTableCustomFieldReadOnlyRow["Column"+e].Value==="True"?u:f,s="<td class='"+n.tableCellCssClass+" custom-table-cell' tabindex='"+n.tabIndex+"' aria-label='"+n.headers[e].displayName+o+"'>"+o+"<\/td>"):n.tylerTableCustomFieldReadOnlyRow["Column"+e]!==null&&n.tylerTableCustomFieldReadOnlyRow["Column"+e].CustomFieldTableCellType===8&&n.tylerTableCustomFieldReadOnlyRow["Column"+e].Value!==null?(angular.forEach(n.tylerTableCustomFieldReadOnlyRow["Column"+e].PickListItems,function(t){t.CustomFieldPickListItemID===n.tylerTableCustomFieldReadOnlyRow["Column"+e].Value&&(o=t.Value);n.tylerTableCustomFieldReadOnlyRow["Column"+e].Value===n.tylerTableCustomFieldReadOnlyRow["Column"+e].Defaultvalue&&t.Value===n.tylerTableCustomFieldReadOnlyRow["Column"+e].Value&&(n.tylerTableCustomFieldReadOnlyRow["Column"+e].Value=t.CustomFieldPickListItemID,o=t.Value)}),s="<td class='"+n.tableCellCssClass+" custom-table-cell' tabindex='"+n.tabIndex+"' aria-label='"+n.headers[e].displayName+o+"'>"+o+"<\/td>"):s=n.tylerTableCustomFieldReadOnlyRow["Column"+e]!==null&&n.tylerTableCustomFieldReadOnlyRow["Column"+e].CustomFieldTableCellType===6&&n.tylerTableCustomFieldReadOnlyRow["Column"+e].Value!==null?"<td class='"+n.tableCellCssClass+" custom-table-cell' tabindex='"+n.tabIndex+"' aria-label='"+n.headers[e].displayName+"{{tylerTableCustomFieldReadOnlyRow.Column"+e+".Value}}'><div class='ellipses'>{{tylerTableCustomFieldReadOnlyRow.Column"+e+".Value}}<\/div><\/td>":"<td class='"+n.tableCellCssClass+" custom-table-cell ' tabindex='"+n.tabIndex+"' aria-label='"+n.headers[e].displayName+"{{tylerTableCustomFieldReadOnlyRow.Column"+e+".Value}}'><div ng-class=\"{'ellipses' : tylerTableCustomFieldReadOnlyRow.Column"+e+".CustomFieldTableCellType == '6'}\" >{{tylerTableCustomFieldReadOnlyRow.Column"+e+".Value}}<\/div><\/td>",h=angular.element(s).appendTo(i),c=t(h)(n));n.isSummaryView||(l="<td style='min-width:70px;'><div class='float-right'><button id='btnEditRow_"+n.groupIndex+"_"+n.fieldIndex+"_"+n.tylerTableCustomFieldReadOnlyRow.CustomFieldTableRowNumber+"' name ='btnEditRow_"+n.groupIndex+"_"+n.fieldIndex+"_"+n.tylerTableCustomFieldReadOnlyRow.CustomFieldTableRowNumber+"'type='button' aria-label='"+r.editLabel+"' ng-click='editRow({ event: $event, currentRow: tylerTableCustomFieldReadOnlyRow, groupIndex: groupIndex, fieldIndex: fieldIndex })' class='btn-icon'> <i class='fa fa-pencil-alt' aria-hidden='true'><\/i> <\/button> <button id='btnRemoveRow_"+n.groupIndex+"_"+n.fieldIndex+"_"+n.tylerTableCustomFieldReadOnlyRow.CustomFieldTableRowNumber+"' name ='btnRemoveRow_"+n.groupIndex+"_"+n.fieldIndex+"_"+n.tylerTableCustomFieldReadOnlyRow.CustomFieldTableRowNumber+"'type='button' ng-show='allowRemoveRow' aria-label='"+r.deleteLabel+"' ng-click='removeRow({ currentRow: tylerTableCustomFieldReadOnlyRow, groupIndex: groupIndex, fieldIndex: fieldIndex })' class='btn-icon' > <i class='fa fa-trash-alt' aria-hidden='true'><\/i> <\/button> <\/div><\/td>",h=angular.element(l).appendTo(i),c=t(h)(n))},r}return __extends(t,n),t}(n.Core.BaseDirective);t.TylerTableCustomFieldRowDirective=i;angular.module("app.Directives.CustomFields",[]).directive("tylerBindCustomFields",[function(){return new r}]).directive("tylerTableCustomFieldReadOnlyRow",["$compile","globalsService",function(n,t){return new i(n,t)}])})(t=n.CustomFields||(n.CustomFields={}))})(t=n.Directives||(n.Directives={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i){var u=n.call(this)||this,r;return r="",u.scope={dirtyCheckCondition:"=",dirtyCheckMessage:"@"},i.getSpecificKeyValues("SelfService.Resources.SelfService",["DirtyCheckDefaultMessage"],function(n){r=n.DirtyCheckDefaultMessage}),u.link=function(n){function i(t){if(n.dirtyCheckCondition===!0){var i=n.dirtyCheckMessage===undefined?r:n.dirtyCheckMessage;t.defaultPrevented||!i||confirm(i)||t.preventDefault()}}n.$on("$locationChangeStart",function(n,t,r){var u=t.split("?")[0],f=r.split("?")[0];u!==f&&i(n)});angular.element(t).on("beforeunload",function(){if(n.dirtyCheckCondition)return r});t.addEventListener("onbeforeunload",function(){if(n.dirtyCheckCondition)return r})},u.restrict="A",u}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.TylerDirtyTrackingLocationChangeDirective=i;angular.module("app.Directives.DirtyTracking",[]).directive("tylerOnbeforeunload",["$window","resourceService",function(n,t){return new i(n,t)}])})(i=t.DirtyTraking||(t.DirtyTraking={}))})(t=n.Directive||(n.Directive={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var v=function(n){function t(t,i,r,u){var f=n.call(this)||this;return f.$window=t,f.restrict="A",f.replace=!0,f.templateUrl=r.baseUrl+"x/directiveTemplate/Template?templateName=_MainMenu&v="+r.version,f.scope={vm:"=",menuItems:"="},f.link=function(n,r){n.$watch("menuItems",function(t){var o=$(r).find("#mainMenuLeft"),s=null;if(o.length){o.empty();var c=angular.element('<ul class="mainMenuNav-ul navbar-nav navbar-left" role="list"><\/ul>').appendTo(o),f=1,h="menu",e;t&&(t=t.filter(function(n){return!n.IsHidden}));angular.forEach(t,function(t){var r=angular.element(t.Element),o=n.$new();o.menuItem=t;c.append(r);u.menuTabIndices.push({Key:t.Details?t.Details:t.Label,Value:f});s==null?(s=i(r)(o),$(s).children().first().attr("id","default-main-menu-item"),e=h+"-"+f.toString(),r.children().first().attr("name",e),r.children().attr("tabIndex",f),f=f+1):(i(r)(o),e=h+"-"+f.toString(),r.children().attr("name",e),r.children().attr("tabIndex",f),n.assignLevel(t,e),f=f+1)})}n.assignLevel=function(t,i){var r=0;t.SubMenus.length>0?angular.forEach(t.SubMenus,function(t){r=r+1;t.levelNo=i.toString()+"-"+r.toString();n.assignLevel(t,t.levelNo)}):t.levelNo=i.toString()}});angular.element(t).bind("resize",function(){var e=$("#main-menu-content-wrapper").width(),o=$("#mainMenuLeft").width(),n,t,i,r,u,f;$("#map_root")&&(n=$(window).width(),t=n>767?$(window).height()-160:$(window).height()-60,i="height: "+t+"px !important;",$("#map_root").css("height",""),$("#map_root").attr("style",function(n,t){return t+i}),r=$(window).height()-221,u="height: "+r+"px !important;",$("#legendDiv").css("height",""),$("#legendDiv").attr("style",function(n,t){return t+u}),$("#legendDiv").attr("style")&&(f=$("#legendDiv").attr("style").replace("undefined",""),$("#legendDiv").attr("style",f)))})},f}return __extends(t,n),t}(n.Directives.Core.BaseDirective),i,r,u,f,e,o,s,h,c,l,a;t.MainMenuDirective=v;i=function(n){function t(t,i,r){var u=n.call(this)||this;return u.$window=t,u.restrict="A",u.replace=!0,u.templateUrl=r.baseUrl+"x/directiveTemplate/Template?templateName=_MainMenuSidebar&v="+r.version,u.scope={vm:"=",menuItems:"="},u.link=function(n,t){$("#menu-toggle").click(function(n){n.preventDefault();$("#wrapper").toggleClass("toggled");$("#footer-content-wrapper").toggleClass("toggled");$("#Carousel").toggleClass("toggled")});n.$watch("menuItems",function(r){var u=$(t).find("#sidebarMenu"),f;u.length&&(u.empty(),f=angular.element('<ul class="mainMenuNav-ul navbar-nav navbar-left" role="list"><\/ul>').appendTo(u),r&&(r=r.filter(function(n){return!n.IsHidden})),angular.forEach(r,function(t){var r=angular.element(t.Element),u=n.$new();u.menuItem=t;f.append(r);i(r)(u)}))})},u}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.MainMenuSidebarDirective=i;r=function(n){function t(){var t=n.call(this)||this;return t.restrict="A",t.link=function(n,t){$(t).click(function(){$("#wrapper").removeClass("toggled");$("#footer-content-wrapper").removeClass("toggled");$("#Carousel").removeClass("toggled")})},t}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.MenuItemDirective=r;u=function(n){function t(t){var i=n.call(this)||this;return i.$window=t,i.restrict="A",i.replace=!0,i.template='<li tyler-menu-item tabindex="-1" class="mainMenuNav-li" ng-class="{  mainMenuNavActive: vm.activeState(menuItem)===\'active\', mainMenuNavActiveDisabled: vm.activeState(menuItem)===\'active-disabled\' }" ng-click="vm.navigate(menuItem)" role="listitem"><a tabindex="0" class="mainMenuNav-a" data-no-click href="{{vm.getNavigationUrl(menuItem)}}">{{menuItem.Label}}<\/a><\/li>',i.link=function(n,t){var i="link-Menu-"+n.menuItem.Label.replace(/ /g,"");t.find("a").attr("id",i)},i}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.MainMenuNavDirective=u;f=function(n){function t(t){var i=n.call(this)||this;return i.$window=t,i.restrict="A",i.replace=!0,i.template='<li tyler-menu-item tabindex="-1" ng-class="{  mainMenuNavActive: vm.activeState(menuItem)===\'active\', mainMenuNavActiveDisabled: vm.activeState(menuItem)===\'active-disabled\' }" role="listitem"><a target="{{menuItem.Target == vm.targetOptions.OpenInNewTab ? \'_blank\' : menuItem.Target == vm.targetOptions.OpenOnSameWindow ? \'_self\' : \'_self\'}}" tabindex="0" class="mainMenuNav-a" ng-href="{{menuItem.Target <= vm.targetOptions.OpenOnSameWindow ? menuItem.Link : \'#/i/\'+menuItem.MenuID}}">{{menuItem.Label}}<\/a><\/li>\'',i.link=function(n,t){var i="link-Menu-"+n.menuItem.Label.replace(/ /g,"");t.find("a").attr("id",i)},i}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.CustomMainMenuNavDirective=f;e=function(n){function t(t){var i=n.call(this)||this;return i.$window=t,i.restrict="A",i.replace=!0,i.template='<li tyler-menu-item="" class="subMenuItem" tabindex="0" ng-click="vm.navigate(subMenuItem)" role="listitem"><a class="subMenuItem-a ng-binding"><span class="fa fa-angle-right"><\/span> {{subMenuItem.Label}} ({{subMenuItem.PackageData}})<\/a><\/li>',i}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.SubMenuItemWithPackageDataDirective=e;o=function(n){function t(t){var i=n.call(this)||this;return i.$window=t,i.restrict="A",i.replace=!0,i.template='<li tabindex="-1" dropdown class="mainMenuNav-li" dropdown clearfix is-open="status.isopen" ng-class="{ mainMenuNavActive: vm.isActive(menuItem) }" ng-click="vm.navigate(menuItem)" role="listitem">  <a id="link-Menu-{{menuItem.Label}}" tabindex="0" dropdown-toggle class="mainMenuNav-a dropdown-toggle" dropdown-toggle data-no-click href="">{{menuItem.Label}} <span class="fa fa-caret-down"><\/span><\/a>  <div dropdown-menu class="dropdown-menu mainMenuDropdownContent" role="menu" aria-labelledby="dropdownMenu">      <div class="mainMenuDropdowContentInner" tyler-main-menu-dropdown-content><\/div>  <\/div><\/li>',i}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.MainMenuDropdownDirective=o;s=function(n){function t(t,i){var r=n.call(this)||this;return r.$window=t,r.restrict="A",r.replace=!0,r.template='<li tyler-menu-item tabindex="-1" class="mainMenuNav-li" ng-class="{  mainMenuNavActive: vm.activeState(menuItem)===\'active\', mainMenuNavActiveDisabled: vm.activeState(menuItem)===\'active-disabled\' }" ng-click="vm.navigate(menuItem)" role="listitem"><a id="link-Menu-{{menuItem.Label}}" class="mainMenuNav-a" data-no-click href="{{vm.getNavigationUrl(menuItem)}}">{{menuItem.Label}}   <span role="img" aria-roledescription="icon" id="calendarSpan" aria-label="" class="badge badge-important jscalendarSpan"><\/span><\/a><\/li>',r.link=function(){i.getCalendarEventCountForToday(function(n){if(n.Success){var t=n.Result;$(".jscalendarSpan").html(t.toString());$(".jscalendarSpan").attr("aria-label","Total number of events for today "+t)}})},r}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.MainMenuNewsCalendarDirective=s;h=function(n){function t(t){var i=n.call(this)||this;return i.$window=t,i.restrict="A",i.replace=!0,i.template='<li tyler-menu-item tabindex="-1" class="mainMenuNav-li" ng-class="{  mainMenuNavActive: vm.activeState(menuItem)===\'active\', mainMenuNavActiveDisabled: vm.activeState(menuItem)===\'active-disabled\' }" ng-click="vm.navigate(menuItem)" role="listitem"><a id="link-Menu-{{menuItem.Label}}" class="mainMenuNav-a" data-no-click href="{{vm.getNavigationUrl(menuItem)}}">{{menuItem.Label}}   <span class="fa fa-search"><\/span><\/a><\/li>',i}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.MainMenuSearchDirective=h;c=function(n){function t(t,i){var r=n.call(this)||this;return r.$window=t,r.restrict="A",r.replace=!0,r.templateUrl=i.baseUrl+"x/directiveTemplate/Template?templateName=_MainMenuDropdownContent&v="+i.version,r}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.MainMenuDropdownContentDirective=c;l=function(n){function t(t){var i=n.call(this)||this;return i.$window=t,i.restrict="A",i.replace=!0,i.template='<li tyler-menu-item class="subMenuItem" ng-click="vm.navigate(subMenuItem)"><a class="subMenuItem-a" name="{{subMenuItem.levelNo}}" id="{{ subMenuItem.Label | removeSpaces }}"><span class="fa fa-angle-right"><\/span>  {{ subMenuItem.Label }}<\/a><\/li>',i}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.SubMenuItemDirective=l;a=function(n){function t(t){var i=n.call(this)||this;return i.$window=t,i.restrict="A",i.replace=!0,i.template="<li><a tyler-menu-item  class=\"subMenuItem subMenuItem-a\" target=\"{{subMenuItem.Target == 1 ? '_blank' : subMenuItem.Target == 2 ? '_self' : '_self'}}\" class='subMenuItem-a' href=\"{{subMenuItem.Target <= 2 ? subMenuItem.Link : '#/i/'+subMenuItem.MenuID}}\"><span class=\"fa fa-angle-right\"><\/span>  {{subMenuItem.Label }}<\/a><\/li>",i}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.CustomSubMenuItemDirective=a;angular.module("app.Directives.Menu",["app.Services.Utilities"]).directive("tylerMainMenu",["$window","$compile","globalsService","menuService",function(t,i,r,u){return new n.Directives.Menu.MainMenuDirective(t,i,r,u)}]).directive("tylerMainMenuSidebar",["$window","$compile","globalsService",function(t,i,r){return new n.Directives.Menu.MainMenuSidebarDirective(t,i,r)}]).directive("tylerMenuItem",[function(){return new n.Directives.Menu.MenuItemDirective}]).directive("tylerMainMenuNav",["$window",function(t){return new n.Directives.Menu.MainMenuNavDirective(t)}]).directive("tylerMainMenuDropdown",["$window",function(t){return new n.Directives.Menu.MainMenuDropdownDirective(t)}]).directive("tylerCustomMainMenuNav",["$window",function(t){return new n.Directives.Menu.CustomMainMenuNavDirective(t)}]).directive("tylerCustomSubMenuItem",["$window",function(t){return new n.Directives.Menu.CustomSubMenuItemDirective(t)}]).directive("tylerMainMenuNewsCalendar",["$window","menuService","http","globalsService",function(t,i,r,u){return new n.Directives.Menu.MainMenuNewsCalendarDirective(t,i,r,u)}]).directive("tylerMainMenuSearch",["$window",function(t){return new n.Directives.Menu.MainMenuSearchDirective(t)}]).directive("tylerSubMenuItem",["$window",function(t){return new n.Directives.Menu.SubMenuItemDirective(t)}]).directive("tylerMainMenuDropdownContent",["$window","globalsService",function(t,i){return new n.Directives.Menu.MainMenuDropdownContentDirective(t,i)}]).directive("subMenuItemWithPackageData",["$window",function(t){return new n.Directives.Menu.SubMenuItemWithPackageDataDirective(t)}])})(i=t.Menu||(t.Menu={}))})(t=n.Directives||(n.Directives={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var r=function(n){function t(t){var i=n.call(this)||this;return i.$window=t,i.restrict="A",i.replace=!0,i.link=function(n,t){t.bind("keydown",function(n){n.which===13&&(n.preventDefault(),n.stopPropagation())})},i}return __extends(t,n),t}(n.Directives.Core.BaseDirective),i;t.ModalStopPropagationDirective=r;i=function(n){function t(t,i){var r=n.call(this)||this,o;r.$modal=t;r.modalTemplate='<div class="modal-header">\n                     <h3 class="modal-title">{{headerText}}<\/h3>\n                    <\/div>\n                    <div tabindex="0" id="modal-body" class="modal-body">\n                       <div ng-if="!showRawHtml"> {{bodyText}} <\/div>\n                       <p ng-if="showRawHtml" ng-bind-html="bodyText"><\/p>\n                    <\/div>\n                    <div class="modal-footer">\n                        <button tabindex="0" id="modalOkBtn" name="modalOkBtn" ng-if="confirmBox" ng-click="ok()" class="btn btn-primary css-btn-primary tyler-transition-popup-ok-btn">{{okLabel}}<\/button>\n                        <button tabindex="0" id="modalCancelBtn" name="modalCancelBtn" ng-if="confirmBox" ng-click="cancel()" class="btn btn-primary selfservice-draftbtn">{{cancelLabel}}<\/button>\n                        <button tabindex="0" id="modalCloseBtn" name="modalCloseBtn" ng-if="alertBox" ng-click="close()" class="btn btn-primary css-btn-primary">{{closeLabel}}<\/button>\n                    <\/div>';o=r;r.template="";r.restrict="E";r.replace=!1;r.scope={headerText:"@",okLabel:"@",cancelLabel:"@",bodyText:"@",confirmBox:"@",alertBox:"@",ok:"&",cancel:"&",showCondition:"@",showRawHtml:"=",close:"&"};var u="",f="",e="";return i.getSpecificKeyValues("SelfService.EnerGov.Resources.Common.CommonResource",["ModalOk","ModalCancel","ModalClose"],function(n){u=n.ModalOk;f=n.ModalCancel;e=n.ModalClose},!0),r.link=function(n,i,o){angular.element(document).on("keydown",function(t){t.keyCode!=9||t.shiftKey||t.target.id!="modalCancelBtn"&&t.target.id!="modalCloseBtn"?t.shiftKey&&t.keyCode==9&&(t.target.id=="modal-body"&&n.alertBox?(angular.element("#modalCloseBtn").focus(),t.preventDefault()):t.target.id=="modal-body"&&(angular.element("#modalCancelBtn").focus(),t.preventDefault())):(angular.element("#modal-body").focus(),t.preventDefault())});n.$watch("showCondition",function(i){if(i==="true"){var s=t.open({template:r.modalTemplate,backdrop:"static",keyboard:!1,controller:["$scope",function(t){t.bodyText=n.bodyText;t.okLabel=n.okLabel!==undefined&&n.okLabel!==""?n.okLabel:u;t.cancelLabel=n.cancelLabel!==undefined&&n.cancelLabel!==""?n.cancelLabel:f;t.closeLabel=e;t.headerText=n.headerText;t.confirmBox=n.confirmBox;t.showRawHtml=n.showRawHtml;t.alertBox=n.alertBox;setTimeout(function(){angular.element("#modal-body").focus()},2e3);t.ok=function(){n.ok();n.closebox()};t.cancel=function(){n.cancel();n.closebox()};t.close=function(){n.close();n.closebox()};o.$observe("bodyText",function(n){t.bodyText=n});o.$observe("headerText",function(n){t.headerText=n})}]});n.closebox=function(){s.dismiss("cancel")}}})},r}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.ModalDirective=i;angular.module("app.Directives.Modal",["ui.bootstrap.modal"]).directive("modalPopup",["$modal","resourceService",function(t,i){return new n.Directives.Modal.ModalDirective(t,i)}]).directive("modalStopPropagation",["$window",function(t){return new n.Directives.Modal.ModalStopPropagationDirective(t)}])})(i=t.Modal||(t.Modal={}))})(t=n.Directives||(n.Directives={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var u=function(t){function i(i,r){var u=t.call(this)||this;return u.$window=i,u.restrict="A",u.replace=!0,u.scope={vm:"=",cartItems:"="},u.link=function(t,i){t.$watch("cartItems",function(f){$(i).empty();angular.forEach(f,function(f){var e=angular.element("<div "+f.CartDirectiveName+' cart-amount="'+f.Amount+'" cart-data="cartData" cart-remove-item="vm.removeItem(cartItemId)" cart-item-id="'+f.CartItemId+'"hide-license="vm.hideLicense"date-format="'+n.Constants.GlobalConstants.DateFormatForSearch+'"> <\/div>'),o=t.$new();o.cartData=u.getCartData(f.CartData);i.append(e);r(e)(o)})})},u}return __extends(i,t),i.prototype.getCartData=function(n){return JSON.parse(n)},i}(n.Directives.Core.BaseDirective),i,r;t.ShoppingCartDirective=u;i=function(n){function t(){var t=n.call(this)||this;return t.restrict="A",t.replace=!1,t.priority=-1,t.link=function(n,t){function r(n){i&&(n.preventDefault(),n.stopImmediatePropagation())}function u(){i=!1}function f(){i=!1}function e(){i=!0}var i=!0;n.$on("$destroy",function(){t.off("click",r)});n.$on("$destroy",function(){t.off("mousedown",u)});n.$on("$destroy",function(){t.off("contextmenu",e)});n.$on("$destroy",function(){t.off("keydown",f)});t.on("mousedown",u);t.on("contextmenu",e);t.on("keydown",f);t.on("click",r)},t}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.TylerClickOneDirective=i;r=function(){function n(n){this.link=function(t,i,r){r.ngShow&&t.$watch(r.ngShow,function(t){t&&n(function(){i.focus()},0)});r.ngHide&&t.$watch(r.ngHide,function(t){t||n(function(){i.focus()},0)})}}return n}();t.AutoFocusOnShowDirective=r;angular.module(n.Constants.AppModule.AppDirectiveShoppingCart,["app.Services.Utilities"]).directive("tylerClickOne",function(){return new n.Directives.ShoppingCart.TylerClickOneDirective}).directive("autoFocusOnShow",["$timeout",function(t){return new n.Directives.ShoppingCart.AutoFocusOnShowDirective(t)}]).directive(n.Constants.DirectiveConstant.TylerShoppingCart,["$window","$compile","globalsService",function(t,i,r){return new n.Directives.ShoppingCart.ShoppingCartDirective(t,i,r)}])})(i=t.ShoppingCart||(t.ShoppingCart={}))})(t=n.Directives||(n.Directives={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i){var r=n.call(this)||this,c;r.$modal=t;r.modalTemplate='<form name="requestaccess"><div tabindex="0" id="modal-header" class="modal-header">\n                     <h3 id="modal-title" class="modal-title">{{headerText}}<\/h3>\n                    <\/div>\n                    <div tabindex="0" id="modal-body" class="modal-body">\n                       <div class="row form-group">\n                          <label class="control-label col-sm-offset-1 col-sm-2" for="To">{{toText}}<\/label>\n                          <div class="col-md-8" tabindex="0">\n                              <input name="To" id="To" type="text" class="form-control" ng-class="{\'has-error\':!isEmailExist}" readonly ng-model="data.To">\n                          <\/div>\n                          \n                       <\/div>\n                        <div class="row form-group">\n                          <label class="control-label col-sm-offset-1 col-sm-2" for="Subject"><abbr class="requiredIndicator">*<\/abbr> {{subjectText}}<\/label>\n                          <div class="col-md-8" tabindex="0">\n                              <input name="Subject" id="Subject" type="text" class="form-control" required ng-model="data.Subject">\n                          <\/div>\n                          <div class="col-md-offset-3 col-md-8 text-danger text-danger" role="alert">\n                                <span class="error" ng-show="requestaccess.Subject.$dirty && requestaccess.Subject.$error.required">\n                                        {{subjectText}} is required.\n                                <\/span>\n                           <\/div>\n                       <\/div>\n                       <div class="row form-group">\n                          <label class="control-label col-sm-offset-1 col-sm-2" for="Message"><abbr class="requiredIndicator">*<\/abbr> {{messageText}}<\/label>\n                          <div class="col-md-8" tabindex="0">\n                              <textarea name="Message" id="Message" class="form-control" ng-model="data.Message" rows="5" required><\/textarea>\n                          <\/div>\n                          <div class="col-md-offset-3 col-md-8 text-danger text-danger" role="alert">\n                                <span class="error" ng-show="requestaccess.Message.$dirty && requestaccess.Message.$error.required">\n                                        {{messageText}} {{isRequiredText}}\n                                <\/span>\n                          <\/div>\n                       <\/div>\n                        <div class="form-group" ng-if="!isEmailExist">\n                            <div class="col-md-offset-3 col-md-8 text-danger text-danger" role="alert">\n                                                        <span class="error">\n                                                                {{data.To}} {{emailDoesNotExistMessage}}\n                                                        <\/span>\n                             <\/div>\n                        <\/div>\n                    <\/div>\n                    <div class="modal-footer">\n                        <button tabindex="0" id="modalSendBtn" name="modalSendBtn" ng-click="sendRequest()" data-ng-disabled="requestaccess.$invalid || !isEmailExist" class="btn btn-primary css-btn-primary tyler-transition-popup-ok-btn">{{sendLabel}}<\/button>\n                        <button tabindex="0" id="modalCancelBtn" name="modalCancelBtn" ng-click="cancelRequest()" class="btn btn-primary selfservice-draftbtn">{{cancelLabel}}<\/button>\n                    <\/div><\/form>';c=r;r.template="";r.restrict="E";r.replace=!0;r.scope={data:"=",headerText:"@",sendLabel:"@",cancelLabel:"@",sendRequest:"&",cancelRequest:"&",showCondition:"@",isEmailExist:"=?"};var u="",f="",e="",o="",s="",h="";return i.getSpecificKeyValues("SelfService.EnerGov.Resources.Common.CommonResource",["ModalSend","ModalCancel","ModalFormSubject","ModalFormTo","ModalFormMessage","ModalPopupFieldIsRequired"],function(n){u=n.ModalSend;f=n.ModalCancel;e=n.ModalFormSubject;o=n.ModalFormTo;s=n.ModalFormMessage;h=n.ModalPopupFieldIsRequired},!0),r.link=function(n){angular.element(document).on("keydown",function(n){n.keyCode!=9||n.shiftKey||n.target.id!="modalCancelBtn"?n.shiftKey&&n.keyCode==9&&n.target.id=="modal-body"&&(angular.element("#modalCancelBtn").focus(),n.preventDefault()):(angular.element("#modal-header").focus(),n.preventDefault())});n.$watch("showCondition",function(c){if(c==="true"){var l=t.open({template:r.modalTemplate,backdrop:"static",keyboard:!1,windowClass:"mod-class",controller:["$scope",function(t){t.sendLabel=n.sendLabel!==undefined&&n.sendLabel!==""?n.sendLabel:u;t.cancelLabel=n.cancelLabel!==undefined&&n.cancelLabel!==""?n.cancelLabel:f;t.data=n.data;t.headerText=n.headerText;t.toText=o;t.subjectText=e;t.messageText=s;t.isEmailExist=n.isEmailExist;t.isRequiredText=h;t.isEmailExist||i.getSpecificKeyValues("SelfService.EnerGov.Resources.Common.CommonResource",["EmailDoesNotExistToRequestAccess"],function(n){t.emailDoesNotExistMessage=n.EmailDoesNotExistToRequestAccess},!0);setTimeout(function(){angular.element("#modal-header").focus()},2e3);t.sendRequest=function(){n.sendRequest(n.data);n.closebox()};t.cancelRequest=function(){n.cancelRequest();n.closebox()}}]});n.closebox=function(){l.dismiss("cancel")}}})},r}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.SubContactRequestAccessModalDirective=i;angular.module("app.Directives.SubContactRequestAccessModal",["ui.bootstrap.modal"]).directive("requestAccessModalPopup",["$modal","resourceService",function(t,i){return new n.Directives.SubContactRequestAccessModal.SubContactRequestAccessModalDirective(t,i)}])})(i=t.SubContactRequestAccessModal||(t.SubContactRequestAccessModal={}))})(t=n.Directives||(n.Directives={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t){var i=n.call(this)||this;return i.$timeout=t,i.restrict="A",i.replace=!1,i.scope={initialHeight:"@?"},i.link=function(n,i){var u=n.initialHeight?n.initialHeight:"35px",r;n.initialHeight=n.initialHeight||u;r=function(){i[0].style.height=n.initialHeight;i[0].scrollHeight&&(i[0].style.height=i[0].scrollHeight+"px")};i.on("keyup",r);i.on("click",r);t(r,0)},i}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.TylerAutoGrowDirective=i;angular.module("app.Directives.TylerAutoGrow",["app.Services.Utilities"]).directive("tylerAutoGrow",["$timeout",function(t){return new n.Directives.TylerAutoGrow.TylerAutoGrowDirective(t)}])})(i=t.TylerAutoGrow||(t.TylerAutoGrow={}))})(t=n.Directives||(n.Directives={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var i=function(){function n(n,t){var r=this,i;this.resourceService=n;this.attachmentCommonCardService=t;i=["Attachment_FileName","Attachment_FileType","Attachment_FileSize","Attachment_RemoveCard","Attachment_RemoveCard_Aria","Attachment_SelectedFiles"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Attachment.AttachmentResource",i,function(n){r.resourceValues=n})}return n}(),t;n.AttachmentCommonCardController=i;t=function(){function n(){this.controllerAs="vm";this.bindings={fileImage:"<",index:"<",tooBig:"<",fileType:"<",fileName:"<",hideSize:"<",fileSize:"<",footerButtonClick:"&",footerButtonLabel:"<",totalFilesCount:"<",isFileCategory:"<",tabIndex:"<"};this.controller=["resourceService","attachmentCommonCardService",function(n,t){return new i(n,t)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/attachmentCommonCardTemplate.html"}]}return n}();n.AttachmentCommonCardComponent=t;angular.module("app.Common.Components.AttachmentCommonCard",["app.Common.Components"]).component("attachmentCommonCard",new t)})(t=n.Components||(n.Components={}))})(t=n.Common||(n.Common={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var i=function(){function n(n,t,i,r){var u=this,f,e;this.resourceService=n;this.enerGovAttachmentCardsService=t;this.tenantSettingService=i;this.attachmentCommonCardService=r;f=["EReview_EReviewFileName","Ereview_Resubmit"];e=["ClickToDownloadLabel","Attachment_FileSize","EnerGovEntityAttachmentSearch_UploadDateHeader","Attachment_FileType","EnerGovEntityAttachmentSearch_AttachmentNotesHeader","Attachment_ShowFiles","Attachment_Files","Attachment_Category_Needs_Attention","Attachment_Category_Needs_Resubmission","Attachment_Files_Pending"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.EReview.EReviewResource",f,function(n){return u.eReviewResourceValues=n});this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Attachment.AttachmentResource",e,function(n){return u.attachmentResourceValues=n});this.getShowCaseAttachmentNoteSetting()}return n.prototype.$doCheck=function(){this.item&&(this.categoryMetaData=this.getMetaDataForCategoryItems(this.item))},n.prototype.getShowCaseAttachmentNoteSetting=function(){var n=this;this.tenantSettingService.getSoftwarePackageSetting("ShowCaseAttachmentNotes",function(t){n.showCaseAttachmentNotes=t&&t.SettingValue==="true"})},n.prototype.formattedSize=function(n){return this.attachmentCommonCardService.displaySize(n)},n.prototype.getMetaDataForCategoryItems=function(n){var t={newlyUploadedCount:0,submittalId:null};if(this.enerGovAttachmentCardsService){var r=this.enerGovAttachmentCardsService.ereviewAttachments.filter(function(t){return t.fileType===n.Name}),u=r.filter(function(n){return n.isNewlyUploaded}),i=r.map(function(n){return n.ereviewProjectFile&&n.ereviewProjectFile.LatestVersion&&n.ereviewProjectFile.LatestVersion.SubmittalID?n.ereviewProjectFile.LatestVersion.SubmittalID:null});t.newlyUploadedCount=u.length;t.submittalId=i&&i[0]?i[0]:null}return t},n}(),t;n.AttachmentRecordDetailCardController=i;t=function(){function n(){this.controllerAs="vm";this.bindings={item:"<",index:"<",isAttachmentFile:"<",tabIndex:"<",fileSize:"<",showFilesClicked:"&",markupClicked:"&",resubmitClicked:"&",historyClicked:"&",removeClicked:"&"};this.controller=["resourceService","enerGovAttachmentCardsService","tenantSettingService","attachmentCommonCardService",function(n,t,r,u){return new i(n,t,r,u)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/attachmentRecordDetailCardTemplate.html"}]}return n}();n.AttachmentRecordDetailCardComponent=t;angular.module("app.Common.Components.AttachmentRecordDetailCard",["app.Common.Components"]).component("attachmentRecordDetailCard",new t)})(t=n.Components||(n.Components={}))})(t=n.Common||(n.Common={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var i=function(){function n(n,t){var i=this,r,u;this.resourceService=n;this.eReviewsService=t;r=["Attachment_WaitingStateLabel","Attachment_Refresh"];u=["SaveTemplatePleaseWaitMessage"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Attachment.AttachmentResource",r,function(n){return i.attachmentResourceValues=n});this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Common.CommonResource",u,function(n){return i.commonResourceValues=n})}return n}(),t;n.AttachmentWaitingStateController=i;t=function(){function n(){this.controllerAs="vm";this.bindings={entityId:"<",moduleId:"<",refreshClicked:"&"};this.controller=["resourceService","eReviewsService",function(n,t){return new i(n,t)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/attachmentWaitingStateTemplate.html"}]}return n}();n.AttachmentWaitingStateComponent=t;angular.module("app.Common.Components.AttachmentWaitingState",["app.Common.Components"]).component("attachmentWaitingState",new t)})(t=n.Components||(n.Components={}))})(t=n.Common||(n.Common={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var i=function(){function n(n,t){var i=this;this.mapService=n;this.$q=t;this.initMap=function(){var t=i,n=i.$q.defer();return i.mapService.getConfiguration(function(r){t.mapConfigurationInfo=r;t.mapConfigurationInfo.ArcGisUseAuthentication?i.mapService.getAuthentication(t.mapConfigurationInfo).then(function(){n.resolve()},function(t){n.reject(t)}):n.resolve()}),n.promise};this.getSuggestions=function(n){var t=this;if(t.mapConfigurationInfo.ArcGisLocatorUseAutoComplete)return t.suggestionCriteria={SearchText:n,PageSize:5,PageNumber:1,IsSortedInAscendingOrder:!1},t.mapService.getAddressSuggestionsFromMapService(t.suggestionCriteria,t.mapConfigurationInfo).then(function(n){return n.slice(0,t.suggestionCriteria.PageSize*t.suggestionCriteria.PageNumber)})};this.initMap().then(function(){})}return n}(),t;n.AutoCompleteAddressController=i;t=function(){function n(){this.controllerAs="vm";this.bindings={searchText:"=",boxStyle:"@",isRequired:"@",searchBoxId:"@",searchBoxName:"@",searchPlaceholderText:"@",isFocusRequired:"@?"};this.controller=["mapService","$q",function(n,t){return new i(n,t)}];this.template='<input ng-if="vm.isFocusRequired" ng-attr-id="{{vm.searchBoxId}}" name="{{vm.searchBoxName}}" set-initial-focus="" autocomplete="off" ng-required="{{vm.isRequired}}" ng-class="vm.boxStyle" placeholder="{{vm.searchPlaceholderText}}"aria-label="{{vm.searchPlaceholderText}}" selected-address="vm.searchText" ng-model="vm.searchText" typeahead="Result for Result in vm.getSuggestions($viewValue)" <\/input> <input ng-if="!vm.isFocusRequired" ng-attr-id="{{vm.searchBoxId}}" name="{{vm.searchBoxName}}" autocomplete="off" ng-required="{{vm.isRequired}}" ng-class="vm.boxStyle" placeholder="{{vm.searchPlaceholderText}}"aria-label="{{vm.searchPlaceholderText}}" selected-address="vm.searchText" ng-model="vm.searchText" typeahead="Result for Result in vm.getSuggestions($viewValue)" <\/input>'}return n}();n.AutoCompleteAddressComponent=t;angular.module("app.Component.AutoCompleteAddress",[]).component("autoCompleteAddress",new t)})(t=n.AutoCompleteAddress||(n.AutoCompleteAddress={}))})(t=n.Component||(n.Component={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t,i,r;(function(n){n.Ascending="ASC";n.Descending="DESC"})(t||(t={}));i=function(){function n(n,t,i,r){this.enerGovAttachmentCardsService=n;this.scope=t;this.$compile=i;this.resourceService=r;this.headerCellStyle={fontSize:"16px"};this.caseSubmissionFilesCellHeaders=["File Name","Status","Type"];this.caseSubmissionFilesHeaderCount=0;this.caseSubmissionFilesRowCount=0;var u=this;u.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.EReview.EReviewResource",["EReview_SubmissionFileName","EReview_SubmissionStatus","EReview_SubmissionType"],function(n){u.eReviewResourceValues=n;var t=document.getElementById("caseSubmissionFilesTableId");t.addEventListener("tcw-table-sort",function(n){return u.onSortTable(n)});u.scope.$watchCollection("vm.enerGovAttachmentCardsService.currentCaseSubmissionFileList",u.renderCaseSubmissionFilesTable.bind(u))})}return n.prototype.onSortTable=function(n){var r=n.detail,i=r.direction,u=r.columnIndex;switch(u){case 0:this.caseSubmissionFilesData.sort(function(n,r){return i===t.Ascending?n.FileName.localeCompare(r.FileName):r.FileName.localeCompare(n.FileName)});break;case 1:this.caseSubmissionFilesData.sort(function(n,r){return i===t.Ascending?n.Status.localeCompare(r.Status):r.Status.localeCompare(n.Status)});break;case 2:this.caseSubmissionFilesData.sort(function(n,r){return i===t.Ascending?n.Type.localeCompare(r.Type):r.Type.localeCompare(n.Type)})}this.renderCaseSubmissionFilesTable()},n.prototype.renderCaseSubmissionFilesTable=function(){var n=document.getElementById("caseSubmissionFilesTableId");this.caseSubmissionFilesData&&this.eReviewResourceValues&&(n.columnConfigurations=[{property:"FileName",header:this.eReviewResourceValues.EReview_SubmissionFileName,align:"left",sortable:!0,headerCellStyle:this.headerCellStyle},{property:"Status",header:this.eReviewResourceValues.EReview_SubmissionStatus,align:"left",sortable:!0,headerCellStyle:this.headerCellStyle},{property:"Type",header:this.eReviewResourceValues.EReview_SubmissionType,align:"left",sortable:!0,headerCellStyle:this.headerCellStyle}],n.data=this.caseSubmissionFilesData)},n}();n.CaseSubmissionFilesTableController=i;r=function(){function n(){this.controllerAs="vm";this.bindings={caseSubmissionFilesData:"="};this.controller=["enerGovAttachmentCardsService","$scope","$compile","resourceService",function(n,t,r,u){return new i(n,t,r,u)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/caseSubmissionFilesTableTemplate.html"}]}return n}();n.CaseSubmissionFilesTableComponent=r;angular.module("app.Component.CaseSubmissionFilesTable",[]).component("caseSubmissionFilesTable",new r)})(t=n.CaseSubmissionFilesTable||(n.CaseSubmissionFilesTable={}))})(t=n.Component||(n.Component={}))}(app||(app={})),function(n){var t;(function(t){var i;(function(t){var r=n.Core.Controllers.CoreController,i,u,f;(function(n){n.Ascending="ASC";n.Descending="DESC"})(i||(i={}));u=function(){function n(n,t,i,r,u){var f=this,s,e,o;this.enerGovAttachmentCardsService=n;this.$scope=t;this.resourceService=i;this.attachmentCommonCardService=r;this.eReviewsService=u;this.files=[];this.fileRowCount=0;this.selectedAttachment=null;this.pendingFiles=[];this.moduleName="";this.warnings={duplicateFiles:[],notSupportedFiles:[],categoryOnlyOneCanSelected:""};this.cellStyle={width:"100px"};this.headerCellStyle={fontSize:"16px"};this.fileRowCreated=function(n){f.fileRowCount===f.files.length&&(f.fileRowCount=0);n.setAttribute("id","file-"+f.fileRowCount++)};s=["EReview_NeedsAttentionMessage","EReview_FileNeedsToBeResubmitted_Message","Ereview_Resubmit","EReview_EReviewFileMarkup","EReview_EReviewFileHistory","EReview_EReviewFileName","EReview_EReviewFileVersion","EReview_EReviewFileUploadedOn","EReview_NewFiles_FileSizeHeader","EReview_EReviewStatusColumnHeader","EReview_EReviewActions","Ereview_ResubmitInstructions","EReview_ViewMarkups","EReview_ViewHistory","EReview_FileHistoryHeader","EReview_Pending"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.EReview.EReviewResource",s,function(n){return f.eReviewResourceValues=n});e=document.getElementById("existingFileListTableId");e.addEventListener("tcw-table-sort",function(n){return f.onSortEvent(n)});e.allowRowClick=!0;e.addEventListener("tcw-table-row-click",function(n){return f.onRowSelectedEvent(n)});this.moduleName=window.location.hash.split("/")[1].toUpperCase();this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.categoryEreviewFiles",this.constructFileListAndDetailTable.bind(this));this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.currentEreviewPopupTitle",this.constructFileListAndDetailTable.bind(this));this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Attachment.AttachmentResource",["Attachment_CanAddOnlyOneFile_Message","Attachment_FileAlreadyExists_Message","AttachmentAlertMessage"],function(n){f.attachmentsResourceValues=n});o=this;o.$scope.$on("onCloseShowFilesModal",function(){o.attachmentCommonCardService.resetWarnings(o.warnings)})}return n.prototype.onRowSelectedEvent=function(n){var t=n.detail;this.selectedAttachment=t.data;this.selectedAttachment.formattedSize=this.attachmentCommonCardService.displaySize(this.selectedAttachment.ereviewSubmissionInfo.FileSize);this.$scope.$$phase||this.$scope.$root.$$phase||this.$scope.$apply()},Object.defineProperty(n.prototype,"displayAddAttachments",{get:function(){return this.enerGovAttachmentCardsService.fileSetInfo!==null&&this.enerGovAttachmentCardsService.filesDropDown.length>0&&(this.enerGovAttachmentCardsService.hasAuthorizedContactForAttachment||this.enerGovAttachmentCardsService.hasAuthorizedContact)||this.enerGovAttachmentCardsService.fileSetInfo===null&&(this.enerGovAttachmentCardsService.hasAuthorizedContactForAttachment||this.enerGovAttachmentCardsService.hasAuthorizedContact)},enumerable:!0,configurable:!0}),n.prototype.addFiles=function(n,t){var a=this,f,s,e,i,c,o,u,l;if(n.length!==0){this.attachmentCommonCardService.resetWarnings(this.warnings);f="";s=this.files.filter(function(n){return n.ereviewProjectFile&&n.ereviewProjectFile.FileCategories&&n.ereviewProjectFile.FileCategories.length});s.length&&(f=s[0].ERProjectFileCategoryId);var h=this.files[0].fileType,v={categoryId:f,files:this.files,warnings:this.warnings};if(this.attachmentCommonCardService.verifyNumberOfFilesAllowed({},v,t,n),n.length!==0&&t.files.length!==0){for(e=0;e<n.length;e++){if(i=n[e],this.enerGovAttachmentCardsService.ereviewAttachments.filter(function(n){return!n.attachment&&!n.ereviewProjectFile&&n.isNewlyUploaded&&n.name.toLowerCase()===i.name.toLowerCase()}).length>0){this.warnings.duplicateFiles.push(i.name);continue}c=this.eReviewsService.ereviewsSecondaryData.ERProjectFileCategories.filter(function(n){return n.Name===h})[0].AllowedFileTypes;o=this.enerGovAttachmentCardsService.getFilteredFileTypes(this.enerGovAttachmentCardsService.allowedFileTypes.SettingValue,c);this.pendingFiles=[];o.match(i.getType())&&r.isNotNullEmptyUndefined(i.getType())||o.match(i.getExtension())&&r.isNotNullEmptyUndefined(i.getExtension())||o.indexOf(".*")>-1&&r.isNotNullEmptyUndefined(i.getExtension())?(u={name:i.name,fileType:h,size:i.size,file:i,attachment:null,ereviewProjectFile:null,ereviewSubmissionInfo:this.getEreviewSubmissionInfo(),type:EnerGov.Attachment.Models.AttachmentType.EReview,ERProjectFileCategoryId:f,cssFileName:i.name,isNewlyUploaded:!0},u.ereviewSubmissionInfo.SaveFileName=i.name,u.ereviewSubmissionInfo.UploadDate=new Date,u.ereviewSubmissionInfo.FileSize=i.size,u.ereviewSubmissionInfo.ReviewStatus=this.eReviewResourceValues.EReview_Pending,u.ereviewSubmissionInfo.NeedsAttention=!0,this.enerGovAttachmentCardsService.ereviewAttachments.push(u),this.enerGovAttachmentCardsService.$ereviewFlow.addFile(i.file),this.pendingFiles.push(u)):this.warnings.notSupportedFiles.push(i.name);this.files=this.pendingFiles.concat(this.files);l=document.getElementById("existingFileListTableId");l.data=this.files}this.enerGovAttachmentCardsService.getCombinedCardsForExistingFiles();t.files=[];n.forEach(function(n){a.enerGovAttachmentCardsService.$files.push(n)})}}},n.prototype.onSortEvent=function(n){var r=this,u=n.detail,t=u.direction,e=u.columnIndex,f;switch(e){case 0:this.files.sort(function(n,u){var f="",e="";return n.ereviewSubmissionInfo.AllowResubmission&&r.enerGovAttachmentCardsService.hasAuthorizedContact?f="ResubmitIcon":n.ereviewSubmissionInfo.NeedsAttention&&r.enerGovAttachmentCardsService.hasAuthorizedContact&&(f="NeedAttentionIcon"),u.ereviewSubmissionInfo.AllowResubmission&&r.enerGovAttachmentCardsService.hasAuthorizedContact?e="ResubmitIcon":u.ereviewSubmissionInfo.NeedsAttention&&r.enerGovAttachmentCardsService.hasAuthorizedContact&&(e="NeedAttentionIcon"),t===i.Ascending?f.localeCompare(e):e.localeCompare(f)});break;case 1:this.files.sort(function(n,r){return t===i.Ascending?n.cssFileName.localeCompare(r.cssFileName):r.cssFileName.localeCompare(n.cssFileName)});break;case 2:this.files.sort(function(n,r){return t===i.Ascending?n.ereviewSubmissionInfo.FileVersion-r.ereviewSubmissionInfo.FileVersion:r.ereviewSubmissionInfo.FileVersion-n.ereviewSubmissionInfo.FileVersion});break;case 3:this.files.sort(function(n,r){var u=new Date(n.createdDate.toString()),f=new Date(r.createdDate.toString());return t===i.Ascending?u.getTime()-f.getTime():f.getTime()-u.getTime()});break;case 4:this.totalSizeIsZero?this.files.sort(function(n,r){return t===i.Ascending?n.ereviewSubmissionInfo.ReviewStatus.localeCompare(r.ereviewSubmissionInfo.ReviewStatus):r.ereviewSubmissionInfo.ReviewStatus.localeCompare(n.ereviewSubmissionInfo.ReviewStatus)}):this.files.sort(function(n,r){return t===i.Ascending?n.size-r.size:r.size-n.size});break;case 5:this.totalSizeIsZero?this.files.sort(function(n,u){var f="",e="";return n.ereviewSubmissionInfo.AllowResubmission&&r.enerGovAttachmentCardsService.hasAuthorizedContact?f="Resubmit":n.ereviewSubmissionInfo.Markups.length>0?f="Markups":n.ereviewSubmissionInfo.History.length>0&&(f="History"),u.ereviewSubmissionInfo.AllowResubmission&&r.enerGovAttachmentCardsService.hasAuthorizedContact?e="Resubmit":u.ereviewSubmissionInfo.Markups.length>0?e="Markups":u.ereviewSubmissionInfo.History.length>0&&(e="History"),f&&!e?-1:!f&&e?1:t===i.Ascending?f.localeCompare(e):e.localeCompare(f)}):this.files.sort(function(n,r){return t===i.Ascending?n.ereviewSubmissionInfo.ReviewStatus.localeCompare(r.ereviewSubmissionInfo.ReviewStatus):r.ereviewSubmissionInfo.ReviewStatus.localeCompare(n.ereviewSubmissionInfo.ReviewStatus)});break;case 6:this.files.sort(function(n,u){var f="",e="";return n.ereviewSubmissionInfo.AllowResubmission&&r.enerGovAttachmentCardsService.hasAuthorizedContact?f="Resubmit":n.ereviewSubmissionInfo.Markups.length>0?f="Markups":n.ereviewSubmissionInfo.History.length>0&&(f="History"),u.ereviewSubmissionInfo.AllowResubmission&&r.enerGovAttachmentCardsService.hasAuthorizedContact?e="Resubmit":u.ereviewSubmissionInfo.Markups.length>0?e="Markups":u.ereviewSubmissionInfo.History.length>0&&(e="History"),f&&!e?-1:!f&&e?1:t===i.Ascending?f.localeCompare(e):e.localeCompare(f)})}f=document.getElementById("existingFileListTableId");f.data=this.files},n.prototype.constructFileListAndDetailTable=function(){var n=this,t,i,r,u;this.selectedAttachment=null;this.fileRowCount=0;this.files=[];t=document.getElementById("existingFileListTableId");i=[];this.pendingFiles=[];r={};this.enerGovAttachmentCardsService.categoryEreviewFiles.length>0&&(i=this.enerGovAttachmentCardsService.categoryEreviewFiles.map(function(n){return n.EReviewProjectFileId}));i.length>0?(this.files=this.enerGovAttachmentCardsService.ereviewAttachments.filter(function(n){if(n.ereviewProjectFile){var t=n.ereviewProjectFile.ERProjectFileID;return i.indexOf(t)!==-1}}),this.files.map(function(t){var i=n.enerGovAttachmentCardsService.categoryEreviewFiles.filter(function(n){return n.EReviewProjectFileId===t.ereviewProjectFile.ERProjectFileID});t.ereviewSubmissionInfo=i[0]}),u=this.enerGovAttachmentCardsService.categoryEreviewFiles.filter(function(n){return n.FileStatus==="Approved"}),u.forEach(function(t){var i={name:t.FileName,fileType:t.CategoryName,size:t.FileSize,erProjectFileVersionId:t.EReviewProjectFileVersionId,type:1,cssFileName:t.SaveFileName,createdDate:t.UploadDate,ereviewSubmissionInfo:t};n.files.push(i)})):this.files=[];this.pendingFiles=this.enerGovAttachmentCardsService.ereviewAttachments.filter(function(t){return t.isNewlyUploaded&&t.fileType===n.enerGovAttachmentCardsService.currentEreviewPopupTitle});this.pendingFiles.length>0&&(this.pendingFiles.forEach(function(t){t.ereviewSubmissionInfo=n.getEreviewSubmissionInfo();t.ereviewSubmissionInfo.SaveFileName=t.cssFileName;t.ereviewSubmissionInfo.UploadDate=new Date;t.ereviewSubmissionInfo.FileSize=t.size;t.ereviewSubmissionInfo.ReviewStatus=n.eReviewResourceValues.EReview_Pending;t.ereviewSubmissionInfo.NeedsAttention=!0}),this.pendingFiles.forEach(function(n){r[n.cssFileName]=n.file;n.file=null}),this.files=this.pendingFiles.concat(this.files));t.data=this.files;t.data.length>0&&this.eReviewResourceValues&&(t.columnConfigurations=[{sortable:!0,template:function(t){return n.createIcons(t)},headerCellStyle:this.headerCellStyle},{property:"ereviewSubmissionInfo.SaveFileName",header:this.eReviewResourceValues.EReview_EReviewFileName,sortable:!0,headerCellStyle:this.headerCellStyle},{property:"ereviewSubmissionInfo.FileVersion",header:this.eReviewResourceValues.EReview_EReviewFileVersion,sortable:!0,headerCellStyle:this.headerCellStyle},{property:"ereviewSubmissionInfo.UploadDate",header:this.eReviewResourceValues.EReview_EReviewFileUploadedOn,sortable:!0,transform:function(n){return n instanceof Object?n.toISOString().split("T")[0]:n.toString().split("T")[0]},headerCellStyle:this.headerCellStyle},{property:"ereviewSubmissionInfo.FileSize",header:this.eReviewResourceValues.EReview_NewFiles_FileSizeHeader,align:"center",sortable:!0,transform:function(t){return n.attachmentCommonCardService.displaySize(t)},cellStyle:this.cellStyle,headerCellStyle:this.headerCellStyle,hidden:this.totalSizeIsZero()},{property:"ereviewSubmissionInfo.ReviewStatus",header:this.eReviewResourceValues.EReview_EReviewStatusColumnHeader,sortable:!0,headerCellStyle:this.headerCellStyle},{property:"actions",header:this.eReviewResourceValues.EReview_EReviewActions,sortable:!0,align:"center",template:function(t){return n.createButtons(t)},cellStyle:this.cellStyle,headerCellStyle:this.headerCellStyle}],this.pendingFiles.forEach(function(n){n.file=r[n.cssFileName]}))},n.prototype.getEreviewSubmissionInfo=function(){return{AttachmentId:null,EReviewProjectFileId:null,EReviewProjectFileVersionId:null,FileName:null,SaveFileName:null,NeedsAttention:null,NeedsResubmission:null,ReviewStatus:null,FileVersion:null,ResubmitInstructions:null,AttachmentNotes:null,UploadDate:null,FileSize:null,HasHistory:null,HasMarkup:null,CanUploadFiles:null,RequiresFiles:null,History:[],Markups:[],FileMarkups:[],SubmittalId:null,AllowResubmission:null,AllowRevisionFileUpload:null,Comments:null,CategoryName:null,FileStatus:null,ThumbnailUrl:null}},n.prototype.totalSizeIsZero=function(){var n=0;return this.files.forEach(function(t){n+=t.ereviewSubmissionInfo.FileSize}),this.pendingFiles.forEach(function(t){n+=t.size}),n===0},n.prototype.createIcons=function(n){var i=document.createElement("div"),r=this.files[n],t;return r.ereviewSubmissionInfo.AllowResubmission&&this.enerGovAttachmentCardsService.hasAuthorizedContact?(t=document.createElement("icon"),t.classList.add("resubmit-icon","fa","fa-exclamation-circle"),t.title=this.eReviewResourceValues.EReview_FileNeedsToBeResubmitted_Message,i.appendChild(t),i):r.ereviewSubmissionInfo.NeedsAttention&&this.enerGovAttachmentCardsService.hasAuthorizedContact?(t=document.createElement("icon"),t.classList.add("need-attention-icon","fa","fa-exclamation-triangle"),t.title=this.eReviewResourceValues.EReview_NeedsAttentionMessage,i.appendChild(t),i):i},n.prototype.createButtons=function(n){var t=this.files[n];return t.ereviewSubmissionInfo.AllowResubmission&&this.enerGovAttachmentCardsService.hasAuthorizedContact?this.createIconButton("actionResubmit_"+n,this.eReviewResourceValues.Ereview_Resubmit,t,this.resubmitAttachment.bind(this)):t.ereviewSubmissionInfo.Markups.length>0?this.createIconButton("actionMarkup_"+n,this.eReviewResourceValues.EReview_EReviewFileMarkup,t,this.getFileMarkups.bind(this)):t.ereviewSubmissionInfo.History.length>0?this.createIconButton("actionHistory_"+n,this.eReviewResourceValues.EReview_EReviewFileHistory,t,this.getHistory.bind(this)):t.isNewlyUploaded?this.createIconButton("actionRemove_"+n,"Remove",t,this.removeFile.bind(this)):void 0},n.prototype.createIconButton=function(n,t,i,r){var f=document.createElement("div"),e=document.createElement("tcw-button"),u=document.createElement("button");return u.classList.add("tyl-button--outlined"),u.id=n,u.innerText=t,u.addEventListener("click",function(){r(i)}),e.appendChild(u),f.appendChild(e),f},n.prototype.resubmitAttachment=function(n){angular.element("#showFilesModalId").modal("hide");$("body").removeClass("modal-open");$(".modal-backdrop").remove();this.enerGovAttachmentCardsService.toResubmitStepper(n.ereviewProjectFile.LatestVersion.SubmittalID);this.getBindingToUpdate()},n.prototype.getFileMarkups=function(n){$("#showFilesModalId").modal("hide");this.enerGovAttachmentCardsService.currentCategoryTitle=this.enerGovAttachmentCardsService.currentEreviewPopupTitle;this.enerGovAttachmentCardsService.currentEreviewPopupTitle=this.eReviewResourceValues.EReview_EReviewFileMarkup+" - "+n.cssFileName;this.enerGovAttachmentCardsService.markupPopupData=n.ereviewSubmissionInfo.FileMarkups;$("#markupsModalId").modal("show");this.getBindingToUpdate()},n.prototype.getHistory=function(n){$("#showFilesModalId").modal("hide");this.enerGovAttachmentCardsService.currentCategoryTitle=this.enerGovAttachmentCardsService.currentEreviewPopupTitle;this.enerGovAttachmentCardsService.currentEreviewPopupTitle=this.eReviewResourceValues.EReview_FileHistoryHeader+" - "+n.cssFileName;var t=n.ereviewSubmissionInfo.EReviewProjectFileVersionId;this.enerGovAttachmentCardsService.historyPopupData=n.ereviewSubmissionInfo.History.filter(function(n){return n.EReviewProjectFileVersionId!==t});$("#historyModalId").modal("show");this.getBindingToUpdate()},n.prototype.removeFile=function(n){this.enerGovAttachmentCardsService.$files=this.enerGovAttachmentCardsService.$files.filter(function(t){return t.name!==n.name});this.enerGovAttachmentCardsService.removeFlowAttachmentCard(n,null,this.moduleName,!1);this.files=this.files.filter(function(t){return t.name!==n.name});var t=document.getElementById("existingFileListTableId");t.data=this.files;this.selectedAttachment&&n.name===this.selectedAttachment.name&&(this.selectedAttachment=null);this.files.length===0&&$("#showFilesModalId").modal("hide");this.getBindingToUpdate()},n.prototype.getBindingToUpdate=function(){this.$scope.$$phase||this.$scope.$root.$$phase||this.$scope.$apply()},n}();t.ExistingFileListAndDetailController=u;f=function(){function n(){this.controllerAs="vm";this.controller=["enerGovAttachmentCardsService","$scope","resourceService","attachmentCommonCardService","eReviewsService",function(n,t,i,r,f){return new u(n,t,i,r,f)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/existingFileListAndDetailTemplate.html"}]}return n}();t.ExistingFileListAndDetailComponent=f;angular.module("app.Component.ExistingFileListAndDetail",[]).component("existingFileListAndDetail",new f)})(i=t.ExistingFileListAndDetail||(t.ExistingFileListAndDetail={}))})(t=n.Component||(n.Component={}))}(app||(app={})),function(n){var t;(function(t){var i;(function(t){var i=n.Core.Controllers.CoreController,r,u,f;(function(n){n.Ascending="ASC";n.Descending="DESC"})(r||(r={}));u=function(){function n(n,t,i,r,u){var f=this,s,e,o;this.enerGovAttachmentCardsService=n;this.eReviewsService=t;this.resourceService=i;this.attachmentCommonCardService=r;this.$scope=u;this.fileType="";this.moduleName="";this.files=[];this.selectedAttachment=null;this.hideActionColumn=!0;this.fileRowCount=0;this.warnings={duplicateFiles:[],notSupportedFiles:[],categoryOnlyOneCanSelected:""};this.displaySize=function(n){return n>1048576?(Math.round(n*100/1048576)/100).toString()+" MB":(Math.round(n*100/1024)/100).toString()+" KB"};this.fileRowCreated=function(n){f.fileRowCount===f.files.length&&(f.fileRowCount=0);n.setAttribute("id","file-"+f.fileRowCount++)};s=["Attachment_CanAddOnlyOneFile_Message","Attachment_FileAlreadyExists_Message","AttachmentAlertMessage"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Attachment.AttachmentResource",s,function(n){f.resourceValues=n});e=document.getElementById("fileListTableId");e.addEventListener("tcw-table-sort",function(n){return f.onSortEvent(n)});e.allowRowClick=!0;e.addEventListener("tcw-table-row-click",function(n){return f.onRowSelectedEvent(n)});e.wrapContent=!1;this.moduleName=window.location.hash.split("/")[1].toUpperCase();this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.hideActionColumnOnSummary",this.setHideActionColoumnFlag.bind(this));this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.currentEreviewPopupTitle",this.setFileTypeAndTable.bind(this));this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.currentEreviewFileList",this.setFileTypeAndTable.bind(this));o=this;o.$scope.$on("onCloseShowFilesModal",function(){o.attachmentCommonCardService.resetWarnings(o.warnings)})}return n.prototype.setHideActionColoumnFlag=function(){this.hideActionColumn=this.enerGovAttachmentCardsService.hideActionColumnOnSummary},n.prototype.addFiles=function(n,t){var o=this,u,r,h,f,e,c;if(n.length!==0){this.attachmentCommonCardService.resetWarnings(this.warnings);var s=this.files[0].ERProjectFileCategoryId,l={categoryId:s,files:this.files,warnings:this.warnings};if(this.attachmentCommonCardService.verifyNumberOfFilesAllowed({},l,t,n),n.length!==0&&t.files.length!==0){for(u=0;u<n.length;u++){if(r=n[u],this.enerGovAttachmentCardsService.ereviewAttachments.filter(function(n){return!n.attachment&&!n.ereviewProjectFile&&n.isNewlyUploaded&&n.name.toLowerCase()===r.name.toLowerCase()}).length>0){this.warnings.duplicateFiles.push(r.name);continue}h=this.eReviewsService.ereviewsSecondaryData.ERProjectFileCategories.filter(function(n){return n.Name===o.fileType})[0].AllowedFileTypes;f=this.enerGovAttachmentCardsService.getFilteredFileTypes(this.enerGovAttachmentCardsService.allowedFileTypes.SettingValue,h);f.match(r.getType())&&i.isNotNullEmptyUndefined(r.getType())||f.match(r.getExtension())&&i.isNotNullEmptyUndefined(r.getExtension())||f.indexOf(".*")>-1&&i.isNotNullEmptyUndefined(r.getExtension())?(e={name:r.name,fileType:this.fileType,size:r.size,file:r,attachment:null,ereviewProjectFile:null,type:EnerGov.Attachment.Models.AttachmentType.EReview,ERProjectFileCategoryId:s,cssFileName:r.name,isNewlyUploaded:!0},this.enerGovAttachmentCardsService.ereviewAttachments.push(e),this.enerGovAttachmentCardsService.$ereviewFlow.addFile(r.file),this.files.push(e),c=document.getElementById("fileListTableId"),c.data=this.files):this.warnings.notSupportedFiles.push(r.name)}this.enerGovAttachmentCardsService.getCombinedCardsForExistingFiles();t.files=[];n.forEach(function(n){o.enerGovAttachmentCardsService.$files.push(n)})}}},n.prototype.onRowSelectedEvent=function(n){var t=n.detail;this.selectedAttachment=t.data;this.selectedAttachment.formattedSize=this.displaySize(this.selectedAttachment.size);this.$scope.$apply()},n.prototype.onSortEvent=function(n){var i=n.detail,f=i.direction,t=i.columnIndex,u;f===r.Ascending?t===0?this.files.sort(function(n,t){return n.name.localeCompare(t.name)}):t===1&&this.files.sort(function(n,t){return n.size-t.size}):t===0?this.files.sort(function(n,t){return t.name.localeCompare(n.name)}):t===1&&this.files.sort(function(n,t){return t.size-n.size});u=document.getElementById("fileListTableId");u.data=this.files},n.prototype.setFileTypeAndTable=function(){var n=this,i,t;this.selectedAttachment=null;this.fileRowCount=0;this.fileType=this.enerGovAttachmentCardsService.currentEreviewPopupTitle;this.hideActionColumn=this.enerGovAttachmentCardsService.hideActionColumnOnSummary;i=this.enerGovAttachmentCardsService.currentEreviewFileList.filter(function(t){return t.fileType===n.fileType})[0];i&&(this.files=i.files,t=document.getElementById("fileListTableId"),t.data=this.files,t.columnConfigurations=[{property:"name",header:"File Name",sortable:!0,headerCellStyle:{fontSize:"16px"},cellStyle:{maxWidth:"600px"}},{property:"size",header:"Size",align:"center",sortable:!0,template:function(t){if(n.files[t])return n.displaySize(n.files[t].size)},cellStyle:{width:"100px"},headerCellStyle:{fontSize:"16px"}},{property:"actions",header:"Actions",align:"center",template:function(i){var r=function(){var r=n.files[i];n.enerGovAttachmentCardsService.$files=n.enerGovAttachmentCardsService.$files.filter(function(n){return n.name!==r.name});n.enerGovAttachmentCardsService.removeFlowAttachmentCard(r,null,n.moduleName,!1);n.files=n.files.filter(function(n){return n.name!==r.name});t.data=n.files;n.selectedAttachment&&r.name===n.selectedAttachment.name&&(n.selectedAttachment=null);n.files.length===0&&($("#showFilesModalId").modal("hide"),n.enerGovAttachmentCardsService.getCombinedCardsForExistingFiles())};return n.createRemoveButton(r)},cellStyle:{width:"100px"},headerCellStyle:{fontSize:"16px"},hidden:this.hideActionColumn}])},n.prototype.createRemoveButton=function(n){var u=this,i=document.createElement("div"),r=document.createElement("tcw-button"),t=document.createElement("button");return t.classList.add("tyl-button--outlined"),t.title="Remove",t.id="removeBtn",t.innerText="Remove",t.addEventListener("click",function(){u.$scope.$apply(function(){n()})}),r.appendChild(t),i.appendChild(r),i},n}();t.FileListAndDetailController=u;f=function(){function n(){this.controllerAs="vm";this.controller=["enerGovAttachmentCardsService","eReviewsService","resourceService","attachmentCommonCardService","$scope",function(n,t,i,r,f){return new u(n,t,i,r,f)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/fileListAndDetailTemplate.html"}]}return n}();t.FileListAndDetailComponent=f;angular.module("app.Component.FileListAndDetail",[]).component("fileListAndDetail",new f)})(i=t.FileListAndDetail||(t.FileListAndDetail={}))})(t=n.Component||(n.Component={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var i=function(){function n(n){var i=this,t;this.resourceService=n;t=["Attachment_FileListWaitingStateLabel"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Attachment.AttachmentResource",t,function(n){return i.attachmentResourceValues=n})}return n}(),t;n.FileListWaitingStateController=i;t=function(){function n(){this.controllerAs="vm";this.bindings={};this.controller=["resourceService",function(n){return new i(n)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/fileListWaitingStateTemplate.html"}]}return n}();n.FileListWaitingStateComponent=t;angular.module("app.Common.Components.FileListWaitingState",["app.Common.Components"]).component("fileListWaitingState",new t)})(t=n.Components||(n.Components={}))})(t=n.Common||(n.Common={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t,i,r;(function(n){n.Ascending="ASC";n.Descending="DESC"})(t||(t={}));i=function(){function n(n,t,i,r){var u=this,f,e;this.enerGovAttachmentCardsService=n;this.$scope=t;this.$compile=i;this.resourceService=r;this.headerCellStyle={fontSize:"16px"};this.historyCellHeaders=["File Name","Date Uploaded","Version","Has Corrections"];this.historyHeaderCount=0;this.historyRowCount=0;this.historyCellCreated=function(n){n.setAttribute("id",u.historyCellHeaders[u.historyHeaderCount++]+"-"+u.historyRowCount)};this.historyRowCreated=function(){u.historyRowCount++;u.historyRowCount===u.historyData.length&&(u.historyRowCount=0);u.historyHeaderCount=0};f=["EReview_EReviewFileName","EReview_EReviewFileLastUpdatedOn","EReview_EReviewFileVersion","EReview_EReviewHasCorrections"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.EReview.EReviewResource",f,function(n){return u.eReviewResourceValues=n});e=document.getElementById("historyListTableId");e.addEventListener("tcw-table-sort",function(n){return u.onSortTable(n)});this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.historyPopupData",this.renderHistoryTable.bind(this))}return n.prototype.onSortTable=function(n){var r=n.detail,i=r.direction,u=r.columnIndex;switch(u){case 0:this.historyData.sort(function(n,r){return i===t.Ascending?n.SaveFileName.localeCompare(r.SaveFileName):r.SaveFileName.localeCompare(n.SaveFileName)});break;case 1:this.historyData.sort(function(n,r){var u=new Date(n.UploadDate.toString()),f=new Date(r.UploadDate.toString());return i===t.Ascending?u.getTime()-f.getTime():f.getTime()-u.getTime()});break;case 2:this.historyData.sort(function(n,r){return i===t.Ascending?n.FileVersion-r.FileVersion:r.FileVersion-n.FileVersion});break;case 3:this.historyData.sort(function(n,r){var u=n.HasMarkups?"Yes":"No",f=r.HasMarkups?"Yes":"No";return i===t.Ascending?u.localeCompare(f):f.localeCompare(u)})}this.renderHistoryTable()},n.prototype.renderHistoryTable=function(){var t=this,n=document.getElementById("historyListTableId");this.historyData&&this.eReviewResourceValues&&(n.columnConfigurations=[{property:"SaveFileName",header:this.eReviewResourceValues.EReview_EReviewFileName,sortable:!0,template:function(n){return t.createDownloadableFileName(n)},headerCellStyle:this.headerCellStyle},{property:"UploadDate",header:this.eReviewResourceValues.EReview_EReviewFileLastUpdatedOn,align:"center",sortable:!0,transform:function(n){return n.toString().split("T")[0]},headerCellStyle:this.headerCellStyle},{property:"FileVersion",header:this.eReviewResourceValues.EReview_EReviewFileVersion,align:"center",sortable:!0,headerCellStyle:this.headerCellStyle},{property:"HasMarkups",header:this.eReviewResourceValues.EReview_EReviewHasCorrections,align:"center",sortable:!0,transform:function(n){return n?"Yes":"No"},headerCellStyle:this.headerCellStyle},],n.data=this.historyData)},n.prototype.createDownloadableFileName=function(n){var t=angular.element("<downloadattachment \n                    attachment-id='vm.historyData["+n+"].EReviewProjectFileVersionId'\n                    file-type=\"'ereview'\"\n                    attachment-name='vm.historyData["+n+"].SaveFileName'\n                    title='{{vm.historyData["+n+"].SaveFileName}}'>\n                <\/downloadattachment>");return this.$compile(t)(this.$scope),this.$scope.$$phase||this.$scope.$root.$$phase||this.$scope.$apply(),t[0]},n}();n.HistoryListTableController=i;r=function(){function n(){this.controllerAs="vm";this.bindings={historyData:"="};this.controller=["enerGovAttachmentCardsService","$scope","$compile","resourceService",function(n,t,r,u){return new i(n,t,r,u)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/historyListTableTemplate.html"}]}return n}();n.HistoryListTableComponent=r;angular.module("app.Component.HistoryListTable",[]).component("historyListTable",new r)})(t=n.HistoryListTable||(n.HistoryListTable={}))})(t=n.Component||(n.Component={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t,i,r;(function(n){n.Ascending="ASC";n.Descending="DESC"})(t||(t={}));i=function(){function n(n,t,i,r,u){var f=this;this.enerGovAttachmentCardsService=n;this.$scope=t;this.$compile=i;this.tenantSettingService=r;this.resourceService=u;this.markupCellHeaders=["Text","Added By","Page","Actions"];this.markupHeaderCount=0;this.markupRowCount=0;this.markupCellCreated=function(n){n.setAttribute("id",f.markupCellHeaders[f.markupHeaderCount++]+"-"+f.markupRowCount)};this.markupRowCreated=function(){f.markupRowCount++;f.markupRowCount===f.markupData.length&&(f.markupRowCount=0);f.markupHeaderCount=0};this.tenantSettingService.getSoftwarePackageSetting("EReviewAllowResponses",function(n){f.showResponseButton=n&&n.SettingValue==="true";f.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.EReview.EReviewResource",["EReview_Resubmit_Markup_Label","EReview_Resubmit_AddedBy_Label","EReview_Resubmit_Page_Label","EReview_Respond_BtnTxt","EReview_EReviewActions","Ereview_Response_Ghost_Text"],function(n){f.eReviewResourceValues=n;var t=document.getElementById("markupListTableId");t.addEventListener("tcw-table-sort",function(n){return f.onSortTable(n)});f.$scope.$watchCollection("vm.enerGovAttachmentCardsService.markupPopupData",f.renderMarkupsTable.bind(f))})})}return n.prototype.onSortTable=function(n){var r=n.detail,f=r.direction,i=r.columnIndex,u;f===t.Ascending?i===0?this.markupData.sort(function(n,t){return n.Comments.localeCompare(t.Comments)}):i===1?this.markupData.sort(function(n,t){return n.AuthorDisplayName.localeCompare(t.AuthorDisplayName)}):i===2&&this.markupData.sort(function(n,t){return n.PageNumber-t.PageNumber}):i===0?this.markupData.sort(function(n,t){return t.Comments.localeCompare(n.Comments)}):i===1?this.markupData.sort(function(n,t){return t.AuthorDisplayName.localeCompare(n.AuthorDisplayName)}):i===2&&this.markupData.sort(function(n,t){return t.PageNumber-n.PageNumber});u=document.getElementById("markupListTableId");u.data=this.markupData},n.prototype.renderMarkupsTable=function(){var n=this,t=document.getElementById("markupListTableId");t.data=this.markupData;t.columnConfigurations=[{property:"Comments",header:this.eReviewResourceValues.EReview_Resubmit_Markup_Label,sortable:!0,headerCellStyle:{fontSize:"16px"}},{property:"AuthorDisplayName",header:this.eReviewResourceValues.EReview_Resubmit_AddedBy_Label,align:"center",sortable:!0,headerCellStyle:{fontSize:"16px"}},{property:"PageNumber",header:this.eReviewResourceValues.EReview_Resubmit_Page_Label,align:"center",sortable:!0,headerCellStyle:{fontSize:"16px"}},{property:"Response",header:this.eReviewResourceValues.EReview_EReviewActions,align:"center",template:function(t){var i=document.getElementById("markupListTableId"),r=function(){var r=document.getElementById("respondBtn-"+t);i.isRowExpanded(t)?(r.classList.remove("markup-respond-expanded-button"),i.collapseRow(t)):(r.classList.add("markup-respond-expanded-button"),i.expandRow(t,n.buildRowTemplate(t)))};return n.respondButtonTemplate(r,t)},cellStyle:{width:"100px"},headerCellStyle:{fontSize:"16px"},hidden:!this.showResponseButton}]},n.prototype.respondButtonTemplate=function(n,t){var r=document.createElement("div"),u=document.createElement("tcw-button"),i=document.createElement("button");return i.classList.add("tyl-button--outlined"),i.setAttribute("title",this.eReviewResourceValues.EReview_Respond_BtnTxt),i.setAttribute("id","respondBtn-"+t),i.innerText=this.eReviewResourceValues.EReview_Respond_BtnTxt,i.addEventListener("click",function(){return n()}),u.appendChild(i),r.appendChild(u),r},n.prototype.buildRowTemplate=function(n){var f="vm.markupData["+n+"].Response.UserResponse",u=document.createElement("div"),i,r,t;return u.classList.add("tyl-table-expandable-row"),i=document.createElement("tcw-card"),u.appendChild(i),i.outlined="true",r=document.createElement("div"),r.className="review-response-txtarea",t=document.createElement("textarea"),t.className="form-control review-response-submital-textarea",t.setAttribute("type","text"),t.setAttribute("id","responseInput-"+n),t.setAttribute("rows","2"),t.setAttribute("placeholder",this.eReviewResourceValues.Ereview_Response_Ghost_Text),t.setAttribute("aria-label","{{"+f+"}}"),t.setAttribute("ng-model",""+f),this.$compile(t)(this.$scope),r.appendChild(t),i.appendChild(r),u},n}();n.MarkupsListTableController=i;r=function(){function n(){this.controllerAs="vm";this.bindings={markupData:"="};this.controller=["enerGovAttachmentCardsService","$scope","$compile","tenantSettingService","resourceService",function(n,t,r,u,f){return new i(n,t,r,u,f)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/markupsListTableTemplate.html"}]}return n}();n.MarkupsListTableComponent=r;angular.module("app.Component.MarkupsListTable",[]).component("markupsListTable",new r)})(t=n.MarkupsListTable||(n.MarkupsListTable={}))})(t=n.Component||(n.Component={}))}(app||(app={})),function(n){var t;(function(t){var i;(function(t){var r=function(){function t(t,i,r,u){var f=this,e,o;this.resourceService=t;this.enerGovAttachmentCardsService=i;this.tenantSettingService=r;this.attachmentCommonCardService=u;this.dateFormat=n.Constants.GlobalConstants.DateFormatForSearch;e=["EReview_EReviewFileName","Ereview_Resubmit","EReview_FileNeedsToBeResubmitted_Message","EReview_NeedsAttentionMessage","Ereview_ResubmitInstructions","EReview_EReviewFileVersion","Ereview_FileStatus","EReview_EReviewFileHistory","EReview_EReviewFileMarkup"];o=["ClickToDownloadLabel","Attachment_FileSize","EnerGovEntityAttachmentSearch_UploadDateHeader","Attachment_FileType","EnerGovEntityAttachmentSearch_AttachmentNotesHeader","Attachment_ShowFiles","Attachment_Files","Attachment_Category_Needs_Attention","Attachment_Category_Needs_Resubmission","Attachment_Files_Pending","Attachment_RemoveCard"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.EReview.EReviewResource",e,function(n){return f.eReviewResourceValues=n});this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Attachment.AttachmentResource",o,function(n){return f.attachmentResourceValues=n});this.getShowCaseAttachmentNoteSetting()}return Object.defineProperty(t.prototype,"cards",{get:function(){return this.enerGovAttachmentCardsService.nonCategoryCards?this.enerGovAttachmentCardsService.nonCategoryCards:[]},enumerable:!0,configurable:!0}),t.prototype.getShowCaseAttachmentNoteSetting=function(){var n=this;this.tenantSettingService.getSoftwarePackageSetting("ShowCaseAttachmentNotes",function(t){n.showCaseAttachmentNotes=t&&t.SettingValue==="true"})},t.prototype.formattedSize=function(n){return this.attachmentCommonCardService.displaySize(n)},t.prototype.removeCard=function(n){var i=this.enerGovAttachmentCardsService.nonCategoryCards.indexOf(n),t;this.enerGovAttachmentCardsService.nonCategoryCards.splice(i,1);t=this.enerGovAttachmentCardsService.cards.filter(function(t){return t.name===n.FileName});this.enerGovAttachmentCardsService.$files=this.enerGovAttachmentCardsService.$files.filter(function(n){return n.name!==t[0].name});this.enerGovAttachmentCardsService.removeFlowAttachmentCard(t[0],!1,null)},t.prototype.prepareHistory=function(n){n.History.forEach(function(t){t.CategoryName=n.CategoryName});this.showHistory({$data:n})},t.prototype.prepareMarkups=function(n,t){this.showMarkups({$data:n,$event:t})},t}(),i;t.NonCategoryAttachmentCardsController=r;i=function(){function n(){this.controllerAs="vm";this.bindings={datasource:"<",tabIndex:"<",showHistory:"&",showMarkups:"&"};this.controller=["resourceService","enerGovAttachmentCardsService","tenantSettingService","attachmentCommonCardService",function(n,t,i,u){return new r(n,t,i,u)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/nonCategoryAttachmentCardsTemplate.html"}]}return n}();t.NonCategoryAttachmentCardsComponent=i;angular.module("app.Common.Components.NonCategoryAttachmentCards",["app.Common.Components"]).component("nonCategoryAttachmentCards",new i)})(i=t.Components||(t.Components={}))})(t=n.Common||(n.Common={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var i=function(){function n(n,t,i){var u=this,r;this.enerGovAttachmentCardsService=n;this.$scope=t;this.resourceService=i;this.title="";this.moduleName="";r=["ModalClose"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Common.CommonResource",r,function(n){return u.commonResourceValues=n});this.moduleName=window.location.hash.split("/")[1].toUpperCase();this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.currentCaseSubmissionStatusPopupTitle",this.setTitle.bind(this))}return n.prototype.setTitle=function(){this.title=this.enerGovAttachmentCardsService.currentCaseSubmissionStatusPopupTitle},n.prototype.onLoad=function(){this.backupModalData=angular.copy(this.modalData)},n.prototype.onClose=function(){if(!this.isBusy){this.modalData=angular.copy(this.backupModalData);this.onModalClose({$modalData:{isFromClose:!0,data:null}});$("#"+this.modalId).modal("hide")}this.$scope.$broadcast("onCloseShowCaseSubmissionFilesModal")},n}(),t;n.ShowCaseSubmissionFilesModalController=i;t=function(){function n(){this.controllerAs="vm";this.bindings={modalId:"@",modalData:"<",onModalClose:"&",isBusy:"<"};this.controller=["enerGovAttachmentCardsService","$scope","resourceService",function(n,t,r){return new i(n,t,r)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/showCaseSubmissionFilesModalTemplate.html"}]}return n}();n.ShowCaseSubmissionFilesModalComponent=t;angular.module("app.Component.ShowCaseSubmissionFilesModal",[]).component("showCaseSubmissionFilesModal",new t)})(t=n.ShowCaseSubmissionFilesModal||(n.ShowCaseSubmissionFilesModal={}))})(t=n.Component||(n.Component={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var i=function(){function n(n,t,i){var r=this,u,f,e;this.enerGovAttachmentCardsService=n;this.$scope=t;this.resourceService=i;this.title="";this.moduleName="";this.showOrHideClearAllFilesButton=!1;u=["Attachment_ClearAllFiles"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Attachment.AttachmentResource",u,function(n){r.resourceValues=n});f=["ModalClose","SaveTemplatePleaseWaitMessage"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Common.CommonResource",f,function(n){return r.commonResourceValues=n});e=["EReview_UpdateResponse"];this.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.EReview.EReviewResource",e,function(n){return r.eReviewResourceValues=n});this.moduleName=window.location.hash.split("/")[1].toUpperCase();this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.currentEreviewPopupTitle",this.setTitle.bind(this));this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.markupPopupData",function(){return r.onLoad()});this.$scope.$watchCollection("vm.enerGovAttachmentCardsService.hideActionColumnOnSummary",this.setClearAllFilesButton.bind(this))}return n.prototype.setClearAllFilesButton=function(){this.showOrHideClearAllFilesButton=this.enerGovAttachmentCardsService.hideActionColumnOnSummary},Object.defineProperty(n.prototype,"isMarkupsDataChanged",{get:function(){var t=this,n=!1;return this.markupsListTable&&this.modalData&&this.backupModalData&&angular.forEach(this.modalData,function(i){var r=t.backupModalData.filter(function(n){return n.ERFileMarkupId==i.ERFileMarkupId})[0];i.Response&&(!i.Response.ResponseID&&i.Response.UserResponse||i.Response.ResponseID)&&(r.Response==null&&i.Response.UserResponse||i.Response.UserResponse!==r.Response.UserResponse)&&(n=!0)}),n},enumerable:!0,configurable:!0}),n.prototype.setTitle=function(){this.title=this.enerGovAttachmentCardsService.currentEreviewPopupTitle},n.prototype.clearAllFiles=function(){var n=this,i=this.enerGovAttachmentCardsService.currentEreviewFileList.filter(function(t){return t.fileType===n.title})[0],t,r;i&&(t=i.files,t.map(function(t){n.enerGovAttachmentCardsService.$files=n.enerGovAttachmentCardsService.$files.filter(function(n){return n.name!==t.name});n.enerGovAttachmentCardsService.removeFlowAttachmentCard(t,null,n.moduleName)}),r=document.getElementById("fileListTableId"),t=[],r.data=t,$("#"+this.modalId).modal("hide"));this.$scope.$broadcast("onCloseShowFilesModal")},n.prototype.onLoad=function(){this.backupModalData=angular.copy(this.modalData)},n.prototype.onClose=function(){if(!this.isBusy){this.modalData=angular.copy(this.backupModalData);this.onModalClose({$modalData:{isFromClose:!0,data:null}});$("#"+this.modalId).modal("hide")}(this.historyListTable||this.markupsListTable)&&(this.enerGovAttachmentCardsService.currentEreviewPopupTitle=this.enerGovAttachmentCardsService.currentCategoryTitle,$("#showFilesModalId").modal("show"));this.$scope.$broadcast("onCloseShowFilesModal")},n.prototype.onUpdateResponse=function(){if(this.modalData&&this.isMarkupsDataChanged&&this.markupsListTable&&!this.isBusy){$("#"+this.modalId).modal("hide");this.onModalClose({$modalData:{isFromClose:!1,data:this.modalData}});this.backupModalData=angular.copy(this.modalData)}},n}(),t;n.ShowFilesModalController=i;t=function(){function n(){this.controllerAs="vm";this.bindings={modalId:"@",fileListAndDetail:"@",existingFileListAndDetail:"@",markupsListTable:"@",historyListTable:"@",modalData:"<",onModalClose:"&",isBusy:"<"};this.controller=["enerGovAttachmentCardsService","$scope","resourceService",function(n,t,r){return new i(n,t,r)}];this.templateUrl=["globalsService",function(n){return n.baseUrl+"app/common/components/showFilesModalTemplate.html"}]}return n}();n.ShowFilesModalComponent=t;angular.module("app.Component.ShowFilesModal",[]).component("showFilesModal",new t)})(t=n.ShowFilesModal||(n.ShowFilesModal={}))})(t=n.Component||(n.Component={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var i=function(){function n(){}return n}(),t;n.TylerProgressBarController=i;t=function(){function n(){this.controllerAs="vm";this.bindings={progressPercentage:"="};this.controller=[function(){return new i}];this.template='<div layout="column" class="eg-progress-container"> <span name = "eg-progress-bar-progress-percentage" class="eg-progress-container-text eg-fill">{{vm.progressPercentage}}%<\/span> <md-progress-linear name="eg-progress-bar-completed" ng-if="vm.progressPercentage === 100" class="eg-progress-container-bar-completed" md-mode="determinate" value="{{vm.progressPercentage}}"><\/md-progress-linear> <md-progress-linear name="eg-progress-bar-inprogress" ng-if="vm.progressPercentage >= 0 && vm.progressPercentage < 100" class="eg-progress-container-bar-in-progress" md-mode="determinate" value="{{vm.progressPercentage}}"><\/md-progress-linear> <md-progress-linear name="eg-progress-bar-notstarted" ng-if="vm.progressPercentage === 0" class="eg-progress-container-bar-not-started" md-mode="determinate" value="{{vm.progressPercentage}}"><\/md-progress-linear> <\/div>'}return n}();n.TylerProgressBarComponent=t;angular.module("app.Component.TylerProgressBar",[]).component("tylerProgressBar",new t)})(t=n.TylerProgressBar||(n.TylerProgressBar={}))})(t=n.Component||(n.Component={}))}(app||(app={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=n.Common.SelfServiceModules,r=function(){function n(n,t,i,r){var u=this;this.enerGovPermitService=n;this.enerGovPlanSecondaryDataService=t;this.$location=i;this.enerGovAttachmentCardsService=r;this.stackedCardsData=[];this.normalCardsData=[];this.loadDataForCards=function(n){var t=u,r=[],i=[],f;r=n.filter(function(n){return n.fileType==u.enerGovAttachmentCardsService.attachmentFileType});i=n.filter(function(n){return n.fileType!==u.enerGovAttachmentCardsService.attachmentFileType});r!=null&&r!=undefined&&(t.normalCardsData=r);i.length>0&&t.useFileCategoryForResubmission?(f=t.itemGroupBy(i,"fileType"),t.stackedCardsData=t.getStackCardDetails(f)):i.length==0&&t.useFileCategoryForResubmission?t.stackedCardsData=i:i.length>0&&!t.useFileCategoryForResubmission&&(t.normalCardsData=i)}}return Object.defineProperty(n.prototype,"useFileCategoryForResubmission",{get:function(){var t=this.$location.path().split("/")[1].toUpperCase(),n;return t===i[i.Permit].toUpperCase()&&this.enerGovPermitService&&this.enerGovPermitService.secondaryData?(n=this.enerGovPermitService.secondaryData,n.PermitTypes.map(function(n){return n.UseFileCategoryForResubmission})[0]):t===i[i.Plan].toUpperCase()&&this.enerGovPlanSecondaryDataService&&this.enerGovPlanSecondaryDataService.secondaryData?(n=this.enerGovPlanSecondaryDataService.secondaryData,n.PlanTypes.map(function(n){return n.UseFileCategoryForResubmission})[0]):!1},enumerable:!0,configurable:!0}),n.prototype.openShowFilesModal=function(n,t){this.enerGovAttachmentCardsService.currentEreviewPopupTitle=n;this.enerGovAttachmentCardsService.currentEreviewFileList=this.stackedCardsData;this.enerGovAttachmentCardsService.hideActionColumnOnSummary=t;$("#showFilesModalId").modal("show")},n.prototype.openCaseSubmissionStatusPopup=function(n,t){this.enerGovAttachmentCardsService.currentCaseSubmissionStatusPopupTitle=n;this.enerGovAttachmentCardsService.currentCaseSubmissionFileList=t;$("#showCaseSubmissionFilesModalId").modal("show")},n.prototype.itemGroupBy=function(n,t){var i=this;return n.reduce(function(n,r){return i.getCategoryBasedData(t,n,r)},{})},n.prototype.getCategoryBasedData=function(n,t,i){var r=i[n];return t[r]||(t[r]=[]),t[r].push(i),t},n.prototype.getStackCardDetails=function(n){var t=this;return Object.keys(n).map(function(i){var u=i,r=n[u],f=r.map(function(n){return n.size}).reduce(function(n,t){return n+t},0);return{fileType:u,files:r,totalSize:t.displaySize(f),totalCount:r.length}})},n.prototype.displaySize=function(n){return n==null?"":n>1048576?(Math.round(n*100/1048576)/100).toString()+" MB":(Math.round(n*100/1024)/100).toString()+" KB"},n.prototype.verifyNumberOfFilesAllowed=function(n,t,i,r){if(this.enerGovAttachmentCardsService.fileSetInfo!==null){if(n=this.enerGovAttachmentCardsService.fileSetInfo.FileSetFileCategories.filter(function(n){return n.FileCategoryId===t.categoryId})[0],t.files.length===n.NumberOfFilesAllowed){t.warnings.categoryOnlyOneCanSelected=n.FileCategoryName;i.files=[];r=[];return}r.length>n.NumberOfFilesAllowed&&(r.splice(n.NumberOfFilesAllowed),t.warnings.categoryOnlyOneCanSelected=n.FileCategoryName)}},n.prototype.resetWarnings=function(n){n.duplicateFiles=[];n.notSupportedFiles=[];n.categoryOnlyOneCanSelected=""},n}();t.AttachmentCommonCardService=r;angular.module("app.Common.Services.AttachmentCommonCard",["app.Common.Services"]).service("attachmentCommonCardService",["enerGovPermitService","enerGovPlanSecondaryDataService","$location","enerGovAttachmentCardsService",r,])})(i=t.AttachmentCommonCard||(t.AttachmentCommonCard={}))})(i=t.Services||(t.Services={}))})(t=n.Common||(n.Common={}))}(app||(app={})),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(){function n(n,t){this.http=n;this.globalsService=t;this.menuTabIndices=[]}return n.prototype.getMenuItemsByParentId=function(n,t){var r,i,u;for(t===void 0&&(t=!1),r=t?this.menuForSubrecord:this.menu,i=0;i<r.length;i++){if(r[i].MenuID==n)return r[i].SubMenus;if(r[i].SubMenus!=null)for(u=0;u<r[i].SubMenus.length;u++)if(r[i].SubMenus[u].MenuID==n)return r[i].SubMenus[u].SubMenus}},n.prototype.getHomeMenu=function(){var n=this.menu.filter(function(n){return(n.Details=="Home"||n.Label=="Home"||n.Route.indexOf("homeController")>0)&&!n.IsCustom&&n.Link==null&&n.ParentMenuID==null});return n!=null&&n.length==1?n[0]:null},n.prototype.getApplyMenu=function(){var n=this.menu.filter(function(n){return(n.Details=="Apply"||n.Label=="Apply")&&n.IsCustom==!1&&n.Link==null&&n.ParentMenuID==null});return n!=null&&n.length==1?n[0]:null},n.prototype.getViewMenu=function(){var n=this.menu.filter(function(n){return(n.Details=="View"||n.Label=="View")&&n.IsCustom==!1&&n.Link==null&&n.ParentMenuID==null});return n!=null&&n.length==1?n[0]:null},n.prototype.getMyWorkMenu=function(){var n=this.menu.filter(function(n){return(n.Details=="My Work"||n.Label=="My Work")&&n.IsCustom==!1&&n.Link==null&&n.ParentMenuID==null});return n!=null&&n.length==1?n[0]:null},n.prototype.getTodaysInspectionsMenu=function(){var n=this.menu.filter(function(n){return(n.Details=="Today's Inspections"||n.Label=="Today's Inspections")&&n.IsCustom==!1&&n.Link==null&&n.ParentMenuID==null});return n!=null&&n.length==1?n[0]:null},n.prototype.setSelectedMenuItem=function(n){this.selectedMenuItem=n},n.prototype.getSelectedMenuItem=function(){var n=this.selectedMenuItem;return this.selectedMenuItem=undefined,n},n.prototype.getCalendarEventCountForToday=function(n){this.http.get("/calendar/eventsCountForToday",function(t){n(t)},!0)},n.prototype.getMenu=function(n){var t=this;this.http.get("/Home/Menu",function(i){i.Success&&(t.menu=i.Result.Menus);n(i)})},n.prototype.getMenuWithSubRecordData=function(n){var t=this;this.globalsService.showProcessingForDelayedApi=!0;this.http.get("/Home/MenuWithSubRecordsData",function(i){i.Success&&(t.globalsService.showProcessingForDelayedApi=!1,t.menuForSubrecord=i.Result.Menus);n(i)})},n.prototype.getCaseTypeMenu=function(n,t){this.http.get("/Home/CaseTypeMenu/?caseType="+n,function(n){n.Success&&t(n.Result)})},n.prototype.getMenuByDetails=function(n,t){function r(t){if(!i&&t.length!==0)for(var f=0;f<t.length;f++)if(!i){if(t[f].Details===n){i=!0;u=t[f];break}r(t[f].SubMenus)}}t===void 0&&(t=!1);var i=!1,u;return t===!0?r(this.menuForSubrecord):r(this.menu),u},n.prototype.getMenuById=function(n,t){function r(t){if(!i&&t.length!==0)for(var f=0;f<t.length;f++)if(!i){if(t[f].MenuID===n){i=!0;u=t[f];break}r(t[f].SubMenus)}}t===void 0&&(t=!1);var i=!1,u;return t===!0?r(this.menuForSubrecord):r(this.menu),u},n}();t.MenuService=i;angular.module("app.Services.Menu",["app.Common.Services"]).service("menuService",["http","globalsService",n.Services.Menu.MenuService])})(i=t.Menu||(t.Menu={}))})(t=n.Services||(n.Services={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.$window=n}return n.prototype.loadScript=function(n,t){var i,r;t===void 0&&(t=!1);i=document.createElement("script");i.type="text/javascript";i.async=t;i.src=n;r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(i,r)},n}();n.ScriptLoadService=t;angular.module("app.Services.ScriptLoadService",["app.Common.Services"]).service("scriptLoadService",["$window",t])})(t=n.ScriptLoadService||(n.ScriptLoadService={}))})(t=n.Services||(n.Services={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i,r){this.http=n;this.globalService=t;this.$window=i;this.$location=r;this.googleAnalyticsId="";this.googleAnalytics4Id="";this.globalService.applicationName="Citizen Self Service";this.globalService.isRunningUnitTest=!1;this.globalService.enerGovAPIVersion="0";this.globalService.tylerSearchVersion="0"}return n.prototype.setEnerGovAPIVersion=function(){var n=this;this.http.get("/systemwide/systeminfo/energovapiversion",function(t){t.Success?(n.globalService.enerGovAPIVersion=t.Result.Version,sessionStorage.setItem("enerGovAPIVersion",n.globalService.enerGovAPIVersion)):n.globalService.enerGovAPIVersion="0"},!1)},n.prototype.getRequestInspections=function(){return localStorage.getItem("requestInspections")},n.prototype.storeRequestInspections=function(n){localStorage.setItem("requestInspections",JSON.stringify(n))},n.prototype.setTylerSearchVersion=function(){var n=this;n.globalService.tylerSearchVersion="0";this.http.get("/systemwide/systeminfo",function(t){angular.forEach(t.Result,function(t){t.TenantId===n.globalService.tenantId&&angular.forEach(t.SystemInfo,function(t){t.Name==="EnerGov CSS API"&&angular.forEach(t.ConnectionInfo,function(t){t.Name==="Tyler Search"&&t.IfConnected&&(n.globalService.tylerSearchVersion=t.ErrorMessage,sessionStorage.setItem("tylerSearchVersion",n.globalService.tylerSearchVersion))})})})},!1)},n.prototype.setGlobals=function(){this.setEnerGovAPIVersion();this.setTylerSearchVersion()},n.prototype.getRemoveRegistrationInFeeEstimatorSoftwarePackageSetting=function(n){return this.http.get("/tenantSettings/SoftwarePackageSettings",function(t){t.Success&&n(t.Result)},!1,{settingName:"RemoveRegistrationInFeeEstimator"})},n.prototype.getAllowFeeEstimatorSoftwarePackageSetting=function(n){return this.http.get("/tenantSettings/SoftwarePackageSettings",function(t){t.Success&&n(t.Result)},!1,{settingName:"AllowFeeEstimator"})},n.prototype.getAllowPayInvoiceNotLoggedInSetting=function(n){var t=this,i;if(t.allowPayInvoiceNotLoggedInSetting){n(t.allowPayInvoiceNotLoggedInSetting);return}return i={softwarePackageName:"EnerGov",settingName:"AllowPayInvoiceNotLoggedIn",tenantId:t.globalService.tenantId},t.http.get("/tenantSettings/SoftwarePackageSettings",function(i){i.Success&&(t.allowPayInvoiceNotLoggedInSetting=i.Result,n(i.Result))},!1,i)},n.prototype.getHideLicenseFeatureSetting=function(n){var t={softwarePackageName:"EnerGov",settingName:"HideAllLicense",tenantId:this.globalService.tenantId};return this.http.get("/tenantSettings/SoftwarePackageSettings",function(t){t.Success&&n(t.Result)},!1,t)},n.prototype.getHideOperationalPermitFeatureSetting=function(n){var t={softwarePackageName:"EnerGov",settingName:"HideAllOperationalPermit",tenantId:this.globalService.tenantId};return this.http.get("/tenantSettings/SoftwarePackageSettings",function(t){t.Success&&n(t.Result)},!1,t)},n.prototype.getWalkMeFeatureSetting=function(n){return this.http.get("/walkmesetting/gettenantwalkmesetting",function(t){t.Success&&n(t.Result)},!1)},n.prototype.getAllowPayInvoiceNotContactSetting=function(n){var t=this,i;if(t.allowPayInvoiceNotContactSetting)n(t.allowPayInvoiceNotContactSetting);else return i={settingName:"AllowPayInvoiceNotContact",tenantId:t.globalService.tenantId},t.http.get("/tenantSettings/SoftwarePackageSettings",function(i){i.Success&&(t.allowPayInvoiceNotContactSetting=i.Result,n(i.Result))},!1,i)},n.prototype.getSoftwarePackageSetting=function(n,t){var i={settingName:n};return this.http.get("/tenantSettings/SoftwarePackageSettings",function(n){n.Success&&t(n.Result)},!1,i)},n.prototype.getTenantUserSetting=function(n,t){this.http.get("/tenantSettings/usersetting/"+n,function(n){n.Success&&t(n.Result)},!1)},n.prototype.getGoogleAnalyticsGlobalSetting=function(n){this.http.get("/globalsetting/getglobalsetting",function(t){t.Success&&n(t.Result.GoogleAnalyticsId)},!1)},n.prototype.getGoogleAnalyticsTenantSetting=function(n){this.http.get("/googleanalyticssetting/gettenantgoogleanalyticssetting",function(t){t.Success&&n(t.Result)},!1)},n.prototype.getTylerIdSettings=function(n){this.http.get("/tyleridsetting/gettidsetting",function(t){t.Success&&n(t.Result)},!1)},n.prototype.getIsInCloudApp=function(n){this.http.get("/tyleridsetting/isincloudapp",function(t){n(t)})},n.prototype.CreateGoogleAnalytics=function(n){this.$window.ga&&this.$window.ga("create",n,"auto")},n.prototype.SendGoogleAnalytics=function(){this.$window.ga&&this.$window.ga("send","pageview",this.$location.path())},n.prototype.CreateGoogleAnalytics4=function(n){this.$window.gtag&&this.$window.gtag("config",n)},n.prototype.SendGoogleAnalytics4=function(){this.$window.gtag&&this.$window.gtag("event",this.$location.path()+" loaded")},n.prototype.getFileDownloadChunkSize=function(n){this.http.get("/tyleridsetting/fileDownloadChunkSize",function(t){n(t)})},n}();n.SettingsService=t;angular.module("app.Services.SettingsService",["app.Common.Services"]).service("settingsService",["http","globalsService","$window","$location",t])})(t=n.SettingsService||(n.SettingsService={}))})(t=n.Services||(n.Services={}))}(app||(app={})),function(n){var t;(function(t){var i;(function(t){var r=n.Constants.TabConstants,i=function(){function t(n,t,i,u,f,e,o){this.$location=n;this.$route=t;this.$routeParams=i;this.tenantSettingService=u;this.tenantService=f;this.$q=e;this.$window=o;this.selectedTab=0;this.tabConstant=r;this.showPublicCommentsTab=null;this.hideMyBusinessesTab=null;this.commentsTabRequested=!1;this.scrollIntoViewIsNeeded=!1;this.showSubContactsTab=!1}return t.prototype.navigate=function(n){this.addTab(n);this.selectTab(n)},t.prototype.navigateMdTab=function(n){this.addTab(n)},t.prototype.selectTab=function(n,t){var i=this;t?this.selectTabBasedOnSetting(n,t):this.isTabDisabled(n).then(function(t){i.selectTabBasedOnSetting(n,t)})},t.prototype.selectTabBasedOnSetting=function(t,i){var r=0,u;if(i)r=0,t=n.Constants.TabConstants.Summary,this.$location.path().toLowerCase().indexOf("/managemyuser")!==-1&&(this.hideMyBusinessesTab||!this.showSubContactsTab)&&this.$location.url("manageMyUser");else if(this.$routeParams.id){u=n.Common.Helpers.ModuleHelper.getSelfServiceModuleId(this.$location,this.$routeParams.id);switch(u){case n.Common.SelfServiceModules.Permit:r=n.Constants.PermitTabs[t];break;case n.Common.SelfServiceModules.Plan:r=n.Constants.PlanTabs[t];break;case n.Common.SelfServiceModules.Inspection:r=n.Constants.InspectionTabs[t];break;case n.Common.SelfServiceModules.Code:r=n.Constants.CodeCaseTabs[t];break;case n.Common.SelfServiceModules.Request:r=n.Constants.RequestTabs[t];break;case n.Common.SelfServiceModules.ProfLicense:r=n.Constants.ProfLicenseTabs[t];break;case n.Common.SelfServiceModules.Cashier:r=n.Constants.InvoiceTabs[t];break;case n.Common.SelfServiceModules.BusinessEntity:r=n.Constants.BusinessTabs[t];break;case n.Common.SelfServiceModules.BusinessLicense:case n.Common.SelfServiceModules.OperationalPermit:r=n.Constants.BLLicenseTabs[t];break;case n.Common.SelfServiceModules.Application:r=n.Constants.ApplicationTabs[t];break;case n.Common.SelfServiceModules.Project:r=n.Constants.ProjectTabs[t]}}else r=n.Constants.MyAccountTabs[t];this.selectedTab=r===undefined?0:r;t&&(this.setFocusByTab(t),this.setTabRequestedByTab(t))},t.prototype.getSelectedTabForEntityTabs=function(){var t;if(this.$routeParams.id){t=n.Common.Helpers.ModuleHelper.getSelfServiceModuleId(this.$location,this.$routeParams.id);switch(t){case n.Common.SelfServiceModules.Permit:return n.Constants.PermitTabs[this.selectedTab];case n.Common.SelfServiceModules.Plan:return n.Constants.PlanTabs[this.selectedTab];case n.Common.SelfServiceModules.Inspection:return n.Constants.InspectionTabs[this.selectedTab];case n.Common.SelfServiceModules.Code:return n.Constants.CodeCaseTabs[this.selectedTab];case n.Common.SelfServiceModules.Request:return n.Constants.RequestTabs[this.selectedTab];case n.Common.SelfServiceModules.ProfLicense:return n.Constants.ProfLicenseTabs[this.selectedTab];case n.Common.SelfServiceModules.Cashier:return n.Constants.InvoiceTabs[this.selectedTab];case n.Common.SelfServiceModules.BusinessEntity:return n.Constants.BusinessTabs[this.selectedTab];case n.Common.SelfServiceModules.BusinessLicense:case n.Common.SelfServiceModules.OperationalPermit:return n.Constants.BLLicenseTabs[this.selectedTab];case n.Common.SelfServiceModules.Application:return n.Constants.ApplicationTabs[this.selectedTab];case n.Common.SelfServiceModules.Project:return n.Constants.ProjectTabs[this.selectedTab]}}else return n.Constants.MyAccountTabs[this.selectedTab]},t.prototype.getShowPublicCommentsTabSetting=function(n){var t=this;t.showPublicCommentsTab?n(t.showPublicCommentsTab):t.tenantService.getTenantCommentsSetting(function(i){t.showPublicCommentsTab=i&&i.ShowPublicComment===!0;n(t.showPublicCommentsTab)})},t.prototype.getHideMyBusinessesTabSetting=function(n){var t=this;t.hideMyBusinessesTab?n(t.hideMyBusinessesTab):t.tenantSettingService.getSoftwarePackageSetting("HideMyBusinessesTab",function(i){t.hideMyBusinessesTab=i?i.SettingValue==="true":!1;n(t.hideMyBusinessesTab)})},t.prototype.getShowSubContactsTabSetting=function(n){var t=this;t.showSubContactsTab?n(t.showSubContactsTab):t.tenantSettingService.getSoftwarePackageSetting("EnableSubContactManagementOnline",function(i){t.showSubContactsTab=i?i.SettingValue==="true":!1;n(t.showSubContactsTab)})},t.prototype.setTabRequestedByTab=function(t){switch(t){case n.Constants.TabConstants.Comments:this.commentsTabRequested=!0}},t.prototype.addTab=function(t){var r,i,u;t===n.Constants.TabConstants.MyDrafts?(r=this.oldType?this.oldType:"all",this.$location.search({tab:t,type:r}).replace()):(i=this.$location.search(),u=i.tab,u===n.Constants.TabConstants.MyDrafts&&(this.oldType=i.type),this.$location.search({tab:t}).replace())},t.prototype.setFocusByTab=function(t){var i="",r,u;switch(t){case n.Constants.TabConstants.Summary:i="button-TabButton-Summary";break;case n.Constants.TabConstants.Locations:i="button-TabButton-Address";break;case n.Constants.TabConstants.Fees:i="button-TabButton-Fees";break;case n.Constants.TabConstants.Reviews:i="button-TabButton-Submittals";break;case n.Constants.TabConstants.Inspections:i="button-TabButton-Inspections";break;case n.Constants.TabConstants.Attachments:i="button-TabButton-Files";break;case n.Constants.TabConstants.Contacts:i="button-TabButton-Contacts";break;case n.Constants.TabConstants.Subrecords:i="button-TabButton-SubRecords";break;case n.Constants.TabConstants.Holds:i="button-TabButton-Holds";break;case n.Constants.TabConstants.Meetings:i="button-TabButton-Events";break;case n.Constants.TabConstants.Moreinfo:i="button-TabButton-MoreInfo";break;case n.Constants.TabConstants.Checklists:i="button-TabButton-CheckList";break;case n.Constants.TabConstants.Previous:i="button-TabButton-PreviousInspections";break;case n.Constants.TabConstants.Violations:i="button-TabButton-Violations";break;case n.Constants.TabConstants.Primaryfees:i="button-TabButton-PrimaryFees";break;case n.Constants.TabConstants.Miscfees:i="button-TabButton-MiscFees";break;case n.Constants.TabConstants.Payments:i="button-TabButton-Payments";break;case n.Constants.TabConstants.Businesstypes:i="button-TabButton-BusinessTypes";break;case n.Constants.TabConstants.Business:i="button-TabButton-BusinessDetails";break;case n.Constants.TabConstants.Ereviews:i="button-TabButton-EReviews";break;case n.Constants.TabConstants.PersonalInfo:i="button-Information";break;case n.Constants.TabConstants.Addresses:i="button-Addresses";break;case n.Constants.TabConstants.MyFavorites:i="button-Favorites";break;case n.Constants.TabConstants.SubContacts:i="button-SubContacts";break;case n.Constants.TabConstants.MyBusinesses:i="button-MyBusinesses";break;case n.Constants.TabConstants.MyTemplates:i="button-MyTemplates";break;case n.Constants.TabConstants.MyDrafts:i="button-MyDrafts";break;case n.Constants.TabConstants.MyCertificates:i="button-MyCertificates";break;case n.Constants.TabConstants.Comments:i="button-TabButton-Comments";break;case n.Constants.TabConstants.MyPermits:i="permit";break;case n.Constants.TabConstants.MyPlans:i="plan";break;case n.Constants.TabConstants.MyInspections:i="inspection";break;case n.Constants.TabConstants.MyInvoices:i="invoice";break;case n.Constants.TabConstants.MyLicenses:i="license";break;case n.Constants.TabConstants.MyRemainingInspections:i="remaininginspection";break;case n.Constants.TabConstants.MyRequests:i="request"}r=document.getElementById(i);r&&(this.scrollIntoViewIsNeeded&&(this.scrollIntoViewIsNeeded=!1,u=window.navigator.userAgent,u.match("CriOS")||u.indexOf("Chrome")?r.scrollIntoView():r.scrollIntoView({behavior:"smooth"})),r.focus())},t.prototype.isTabDisabled=function(t){var i=this.$q.defer();switch(t){case n.Constants.TabConstants.Comments:this.getShowPublicCommentsTabSetting(function(n){i.resolve(!n)});break;case n.Constants.TabConstants.MyBusinesses:this.getHideMyBusinessesTabSetting(function(n){i.resolve(n)});break;case n.Constants.TabConstants.SubContacts:case n.Constants.TabConstants.MyAssociations:this.getShowSubContactsTabSetting(function(n){i.resolve(!n)});break;default:i.resolve(!1)}return i.promise},t.prototype.cleanUp=function(){this.selectedTab=0;this.oldType=undefined;this.commentsTabRequested=!1},t}();t.TabNavigatorService=i;angular.module("app.Services.TabNavigatorService",["app.Common.Services","app.Services.Tenant"]).service("tabNavigatorService",["$location","$route","$routeParams","tenantSettingService","tenantService","$q",i])})(i=t.TabNavigatorService||(t.TabNavigatorService={}))})(t=n.Services||(n.Services={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){var i=this;this.http=n;this.$q=t;this.isTylerPaymentUsed=null;this.isTylerPaymentUsedPromise=null;this.getTyler311SettingPromise=null;this.tyler311Setting=null;this.getTenantApplicationAssistantIconSetting=function(n){i.http.get("/tenants/tenantapplicationassistanticonsetting",function(t){t.Success&&n(t.Result)},!1)};this.getTenantSecondaryData=function(n){i.http.get("/tenants/gettenantSecondaryData",function(t){t.Success&&n(t.Result)},!1)};this.getTenantCommentsSetting=function(n){i.http.get("/tenants/getTenantCommentsSetting",function(t){t.Success&&n(t.Result)},!1)};this.getTenantAppNavigatorSetting=function(n){i.http.get("/tenants/getTenantAppNavigatorSetting",function(t){t.Success&&n(t.Result)},!1)};this.getTenantTyler311Setting=function(n){i.getTyler311SettingPromise||(i.getTyler311SettingPromise=i.http.get("/tyler311setting",function(n){n.Success&&(i.tyler311Setting=n.Result)},!1));i.$q.all([i.getTyler311SettingPromise]).then(function(){n(i.tyler311Setting)})};this.getTenantFavicon=function(n,t){i.http.get("/tenants/tenantfavicon/"+n,function(n){n.Success&&t(n.Result)},!1)}}return n.prototype.getTenants=function(n){this.http.get("/Home/GetTenants",function(t){t.Success&&n(t.Result)})},n.prototype.getSelectedTenantCulture=function(n,t,i,r){this.http.get("/Home/GetSelectedTenantCulture/?loadHeader="+n+"&loadBody="+t+"&loadFooter="+i,function(n){n.Success&&r(n.Result)})},n.prototype.isTylerPaymentsUsed=function(n){var t=this;t.isTylerPaymentUsedPromise||(t.isTylerPaymentUsedPromise=t.http.get("/TcpSetting/isTylerPaymentsUsed/",function(n){n.Success&&(t.isTylerPaymentUsed=n.Result)},!0));t.$q.all([t.isTylerPaymentUsedPromise]).then(function(){n(t.isTylerPaymentUsed)})},n}();n.TenantService=t;angular.module("app.Services.Tenant",["app.Common.Services"]).service("tenantService",["http","$q",t])})(t=n.Tenant||(n.Tenant={}))})(t=n.Services||(n.Services={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.http=n;this.rootUrl="/CommonSetting/"}return n.prototype.getTenantCommonSetting=function(n){this.http.get(this.rootUrl,function(t){t.Success&&n(t.Result)})},n}();n.TenantCommonSettingService=t;angular.module("app.Services.TenantCommonSetting",[]).service("tenantCommonSettingService",["http",t])})(t=n.TenantCommonSetting||(n.TenantCommonSetting={}))})(t=n.Services||(n.Services={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){this.$window=n;this.scriptLoadService=t}return n.prototype.loadWalkMeScript=function(n,t,i){if(n&&n.WalkmeKey&&n.WalkmeKey!==""){var r="";r=n.WalkmeTestEnvironment?"https://cdn.walkme.com/users/"+n.WalkmeKey+"/test/walkme_"+n.WalkmeKey+"_https.js":"https://cdn.walkme.com/users/"+n.WalkmeKey+"/walkme_"+n.WalkmeKey+"_https.js";this.scriptLoadService.loadScript(r,!0);window._walkmeConfig={smartLoad:!0};window.TylerUniversity={ClientId:n.WalkmeApplicationId,UserName:t,EnerGov:{Version:i,ApplicationName:"CSS",ApplicationId:n.WalkmeApplicationId}}}},n}();n.WalkMeService=t;angular.module("app.Services.WalkMeService",["app.Common.Services","app.Services.ScriptLoadService"]).service("walkMeService",["$window","scriptLoadService",t])})(t=n.WalkMeService||(n.WalkMeService={}))})(t=n.Services||(n.Services={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Business=1]="Business";n[n.Individual=2]="Individual";n[n.Both=3]="Both"})(t=n.AccountType||(n.AccountType={}))})(t=n.AccountTypeEnums||(n.AccountTypeEnums={}))})(t=n.Common||(n.Common={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t,i,r,u,f,e,o;(function(n){n[n.BothEstimationAndApplication=0]="BothEstimationAndApplication";n[n.EstimationOnly=1]="EstimationOnly";n[n.ApplicationOnly=2]="ApplicationOnly"})(t=n.CaseTypeUse||(n.CaseTypeUse={})),function(n){n[n.All=1]="All";n[n.Permit=2]="Permit";n[n.Plan=3]="Plan";n[n.Inspection=4]="Inspection";n[n.CodeCase=5]="CodeCase";n[n.Request=6]="Request";n[n.Business=7]="Business";n[n.BusinessLicense=8]="BusinessLicense";n[n.ProfessionalLicense=9]="ProfessionalLicense";n[n.License=10]="License"}(i=n.FilterModule||(n.FilterModule={})),function(n){n[n.Permit=1]="Permit";n[n.Plan=2]="Plan";n[n.BusinessLicense=3]="BusinessLicense";n[n.ProfessionalLicense=4]="ProfessionalLicense";n[n.Registration=5]="Registration"}(r=n.AgreementType||(n.AgreementType={})),function(n){n[n.None=0]="None";n[n.OpenInNewTab=1]="OpenInNewTab";n[n.OpenOnSameWindow=2]="OpenOnSameWindow";n[n.OpenWithinCSS=3]="OpenWithinCSS"}(u=n.TargetOptions||(n.TargetOptions={})),function(n){n[n.Slow=1]="Slow";n[n.Medium=3]="Medium";n[n.Fast=5]="Fast"}(f=n.BannerSpeedInterval||(n.BannerSpeedInterval={})),function(n){n[n.Inspection=1]="Inspection";n[n.HealthInspection=2]="HealthInspection"}(e=n.InspectionTypeModule||(n.InspectionTypeModule={})),function(n){n[n.BusinessLicense=1]="BusinessLicense";n[n.RentalProperty=2]="RentalProperty";n[n.OperationalPermit=3]="OperationalPermit"}(o=n.BusinessLicenseTypeModule||(n.BusinessLicenseTypeModule={}))})(t=n.CaseTypeEnums||(n.CaseTypeEnums={}))})(t=n.Common||(n.Common={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){"use strict";var i=n.Common.Helpers.RouteHelper,e=n.Common.Helpers.TenantHelper,r=n.Common.CaseTypeEnums.FilterModule,o=n.Common.CaseTypeEnums.CaseTypeUse,u=n.Common.CaseTypeEnums.BannerSpeedInterval,f=function(t){function f(r,u,f,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt){var ft=t.call(this,null)||this,st,ut,at,et,ht,ot,ct,lt;ft.menuService=r;ft.$timeout=u;ft.$route=f;ft.tenantService=o;ft.userService=s;ft.$interval=h;ft.cartService=c;ft.dashboardService=l;ft.resourceService=a;ft.globalService=v;ft.eventService=y;ft.locationService=p;ft.settingService=w;ft.$q=b;ft.$rootScope=k;ft.walkMeService=d;ft.oidcService=g;ft.$routeParams=nt;ft.tcpSettingsService=tt;ft.tenantCommonSettingService=it;ft.escrowAccountsSettingService=rt;ft.isMenuVisible=!1;ft.isLoggedIn=!1;ft.selectedDistrictName="";ft.selectedDistrictId=0;ft.tenant="";ft.tenantUrl="";ft.isSingleTenant=!1;ft.currentLocation="/";ft.dropDownItemLimit=1;ft.menuState="";ft.isiFrameViewer=!1;ft.isMapViewer=!1;ft.isApplicationMapViewer=!1;ft.isContainerFluid=!1;ft.isGoogleTranslateEnabled=!1;ft.hideLoginOrRegisterLink=!1;ft.removeRegistrationInFeeEstimator=!1;ft.allowFeeEstimator=!0;ft.allowPayInvoiceNotLoggedIn=!1;ft.allowPayInvoiceNotContact=!1;ft.hideLicenseFeature=!1;ft.applyText="applicationAssistant";ft.loginUrl="/login";ft.hideMyBusinesses=!1;ft.backFromTid=!1;ft.targetOptions=n.Common.CaseTypeEnums.TargetOptions;ft.defaultFavicon="https://cdn.forge.tylertech.com/v1/images/branding/tyler/talking-t-logo.svg";ft.linkToMyCart="";ft.hasMenuWithSubRecord=!1;ft.showGoogleTranslate=!1;ft.hideOperationalPermitFeature=!1;ft.hasLoadedSelectedTenantCulture=!1;ft.globals.tylerIdEnabled&&(ft.loginUrl="/sso.html");st=ft.$location.url();ut=ft;ft.$rootScope.$on("$locationChangeStart",function(n,t,i){var r,u;i.indexOf("/callback.html")>-1&&(ut.backFromTid=!0,ut.hideLoginOrRegisterLink=!0);t.indexOf("/sso.html")>-1&&i.indexOf("/callback.html")===-1&&(ut.userService.userReffererUrlTylerId=ut.$location.search().redirectUrl?ut.$location.absUrl().split("#")[0]+"#"+ut.$location.search().redirectUrl:i);ut.userService.isUserLoggedIn||ut.$routeParams.signin!=="true"||ut.login();ut.backFromTid&&(ut.hideLoginOrRegisterLink=ut.userService.isUserLoggedIn?!1:!0);ut.userService&&ut.userService.tylerId&&!ut.userService.isUserLoggedIn&&ut.userService.isUserPartialLoggedIn&&!ut.parseRoute()?ut.$location.path("/pendingapproval"):ut.userService&&ut.userService.tylerId&&ut.userService.tylerId!==""&&!ut.userService.isUserLoggedIn&&!ut.parseRoute()?ut.$location.path("/register"):ut.parseRoute()||ut.$location.path()==="/"||t.indexOf("/home")>-1||i.indexOf("/forgetPassword")>-1||i.indexOf("/resetpassword")>-1||i.indexOf("/callback.html")>-1||i.indexOf(ut.loginUrl)>-1||ut.$location.search().redirectUrl||!ut.$route.routes["null"]?t.indexOf("/sso.html")>-1||i.indexOf("/callback.html")>-1||!(t.indexOf(ut.loginUrl)>-1)||ut.$location.search().redirectUrl||!ut.$route.routes["null"]||i.indexOf("/forgetPassword")>-1||i.indexOf("/resetpassword")>-1?i.indexOf(ut.loginUrl)>-1&&ut.$location.search().redirectUrl?ut.locationService.handleRedirection():ut.locationService.attemptUrl="":(u=i.split("#")[1],r=u.indexOf("/estimate")>-1?ut.locationService.attemptUrl:u,r.indexOf("redirectUrl")>-1?(r=r.split("=")[1],ut.$location.path("/"+r)):ut.$location.path(ut.loginUrl).search({redirectUrl:r})):(r=ut.$location.path(),ut.$location.path(ut.loginUrl).search({redirectUrl:r}))});at=["EnerGovCommonStatusReason_Fail","EnerGovCommonStatusReason_OnHold","EnerGovCommonStatusReason_UnpaidFees","EnerGovCommonStatusReason_FailedInspections","EnerGovCommonStatusReason_FailedSubmittals","EnerGovCommonStatusReason_FailedEReviewFiles"];a.getSpecificKeyValues("SelfService.EnerGov.Resources.Common.CommonResource",at,function(n){v.enerGovCommonStatusReasonFail=n.EnerGovCommonStatusReason_Fail;v.enerGovCommonStatusReasonOnHold=n.EnerGovCommonStatusReason_OnHold;v.enerGovCommonStatusReasonUnpaidFees=n.EnerGovCommonStatusReason_UnpaidFees;v.enerGovCommonStatusReasonFailedInspections=n.EnerGovCommonStatusReason_FailedInspections;v.enerGovCommonStatusReasonFailedSubmittals=n.EnerGovCommonStatusReason_FailedSubmittals;v.enerGovCommonStatusReasonFailedEReviewFiles=n.EnerGovCommonStatusReason_FailedEReviewFiles});et=ft.$location.url();ht=et.split("?");ht.length==2&&(ot=ht[1].split("="),ot.length==2&&(ct=ot[0].toLowerCase(),(ct=="ordernumber"||ct=="ordernum")&&(lt=ot[1],lt.length>0&&(ft.cartService.orderNumber=Number(lt)))));ft.isMapViewer=et==="/map"?!0:!1;ft.isiFrameViewer=et==="/i"||et.indexOf("/i/")>=0||et=="/guidedapplication"?!0:!1;ft.isContainerFluid=et==="/calendar/Index"||et==="/map"||et==="/i"||et.indexOf("/i/")>=0||et=="/guidedapplication"?!0:!1;ft.tenantUrl=ft.globals.tenantUrl;ft.culture=ft.globals.culture;ft.selectedDistrictId=0;ft.selectedDistrictName="Select Tenant";ft.isMenuVisible=!1;ft.greetingText="";y.on("$locationChangeSuccess",function(n,t){t.indexOf("/map")>=0?ut.isMapViewer=!0:t.indexOf("/addressmap")>=0?(ut.isApplicationMapViewer=!0,ut.isMapViewer=!0):(ut.isMapViewer=!1,ut.isApplicationMapViewer=!1);ft.isiFrameViewer=t.indexOf("/i/")>=0||t.indexOf("/guidedapplication")>=0?!0:!1;ft.isContainerFluid=t.indexOf("/calendar/Index")>=0||t.indexOf("/map")>=0||t.indexOf("/home")>=0||t.indexOf("/i/")>=0||t.indexOf("/guidedapplication")>=0?!0:!1});return h(function(){ft.welcomeGreeting()},6e4),ft.utilities.showPleaseWait(),ft.tenantService.getTenants(function(n){ut.globals.tenants=n;ut.tenants=n;ut.isGoogleTranslateEnabled=n[0].IsGoogleTranslateEnabled;e.processMultiTenants(ut.globals,ut,n)&&(ut.getTenantCommonSetting(),ut.welcomeGreeting(),ut.getNotifications(),ut.getSelectedTenantCulture(),w.getGoogleAnalyticsGlobalSetting(function(n){w.CreateGoogleAnalytics4(n)}),w.getGoogleAnalyticsTenantSetting(function(n){w.googleAnalyticsId=n.GoogleAnalyticsId;w.CreateGoogleAnalytics(n.GoogleAnalyticsId);w.googleAnalytics4Id=n.GoogleAnalytics4Id;w.CreateGoogleAnalytics4(n.GoogleAnalytics4Id);k.$on("$routeChangeSuccess",function(){w.googleAnalyticsId&&w.SendGoogleAnalytics();w.googleAnalytics4Id&&w.SendGoogleAnalytics4()})}),ut.setFavicon(ut.globals.tenantId),ut.ValidateLogin(function(n){ut.isLoggedIn=n;var t,r=ut.settingService.getAllowFeeEstimatorSoftwarePackageSetting(function(n){ut.allowFeeEstimator=n&&n.SettingValue==="true";ft.allowFeeEstimator&&(i.routeProvider.when("/estimate/permit",{controller:"enerGovPermitApplyController",controllerAs:"vm",templateUrl:ft.globals.baseUrl+ft.globals.tenantUrl+"/EnergovPermit/apply?v="+ft.globals.version,pageTitle:"PageTitle_Estimate_Permit_Fees"}).when("/estimate/plan",{controller:"enerGovPlanApplyController",controllerAs:"vm",templateUrl:ft.globals.baseUrl+ft.globals.tenantUrl+"/EnergovPlan/apply?v="+ft.globals.version,pageTitle:"PageTitle_Estimate_Plan_Fees"}),ft.isLoggedIn||(ft.removeRegistrationInFeeEstimator=!1,t=ft.settingService.getRemoveRegistrationInFeeEstimatorSoftwarePackageSetting(function(n){ft.removeRegistrationInFeeEstimator=n&&n.SettingValue==="true"})))}),f=ut.settingService.getWalkMeFeatureSetting(function(n){ut.walkMeSetting=n}),e=ut.settingService.getAllowPayInvoiceNotLoggedInSetting(function(n){ut.allowPayInvoiceNotLoggedIn=n&&n.SettingValue==="true"}),o=ut.settingService.getHideLicenseFeatureSetting(function(n){ut.hideLicenseFeature=n&&n.SettingValue==="true"}),s=ut.settingService.getHideOperationalPermitFeatureSetting(function(n){ut.hideOperationalPermitFeature=n&&n.SettingValue==="true"}),h=ut.settingService.getAllowPayInvoiceNotContactSetting(function(n){ut.allowPayInvoiceNotContact=n&&n.SettingValue==="true"}),c=ut.settingService.getSoftwarePackageSetting("HideMyBusinessesTab",function(n){ut.hideMyBusinesses=n?n.SettingValue==="true":!1});ft.$q.all([e,h,r,t,o,f,c,s]).then(function(){ut.getMenu(function(){u(function(){ut.getCartItemsCount(ut.userService.isUserLoggedIn)},1e3);ut.userService.listenToLoginStatusChange(function(){u(function(){ut.getCartItemsCount(ut.userService.isUserLoggedIn)},1e3);ut.getMenu(function(){ut.globalService.tylerIdEnabled||ut.userService.userReffererUrlTylerId?ut.globalService.tylerIdEnabled&&ut.userService.isUserLoggedIn&&ut.userService.userReffererUrlTylerId&&ut.$location.url(ut.userService.userReffererUrlTylerId.split("#")[1]):ut.locationService.attemptUrl?(ut.locationService.withUrl?ut.$location.url(ut.locationService.attemptUrl):ut.$location.path(ut.locationService.attemptUrl),ut.locationService.withUrl=!1,ut.locationService.attemptUrl=""):ut.navigate(ut.defaultMenu)})});st===""&&ut.defaultMenu?ut.navigate(ut.defaultMenu):u(function(){ut.parseRoute()||ut.$location.path()==="/"?ut.$route.reload():ut.$location.path(ut.loginUrl).search({redirectUrl:st})},1e3);ut.utilities.hidePleaseWait()});ut.walkMeService.loadWalkMeScript(ut.walkMeSetting,ut.userService.userName,ut.globals.version)})}))}),ft}return __extends(f,t),f.prototype.toggleGoogleTranslate=function(){this.showGoogleTranslate=!this.showGoogleTranslate},f.prototype.showProcessing=function(){return this.globalService.showProcessing||this.globalService.showProcessingForDelayedApi},f.prototype.activeState=function(n){if(n)if(n.IsMenu){if(this.menuState==="dropdown-selected"&&this.dropDownMenuItem&&n.MenuID===this.dropDownMenuItem.MenuID)return"active"}else{var t=i.getNavigationUrl(n);if(this.$location.path()==="/"+t)return this.menuState==="dropdown-selected"?"active-disabled":"active"}return""},f.prototype.listFilterLeft=function(n){return n.DisplaySequence<=100},f.prototype.listFilterRight=function(n){return n.DisplaySequence>100},f.prototype.goHome=function(){this.$location.url("/")},f.prototype.goToLocation=function(n){this.currentLocation=n;this.$location.url(this.currentLocation)},f.prototype.currentDate=function(){var n=this;return this.userService.isUserLoggedIn&&!this.cartService.didCallGetTotalItem&&(this.cartService.didCallGetTotalItem=!0,this.cartService.updateTotalNumOfItems(),this.tcpSettingsService.getTenantTCPSettings(function(t){t&&t.UseTylerPayments&&n.cartService.getTylerCartItems()})),(new Date).getDate().toString()},f.prototype.showMenu=function(){this.isMenuVisible=!this.isMenuVisible},f.prototype.editUser=function(){this.isLoggedIn||this.$location.url(this.loginUrl)},f.prototype.navigate=function(n){if(n)if(n.IsMenu&&n.Route==="")this.dropDownMenuItem?this.dropDownMenuItem.MenuID===n.MenuID?this.menuState="":(this.dropDownMenuItem=n,this.menuState="dropdown-selected"):(this.dropDownMenuItem=n,this.menuState="dropdown-selected");else if(!n.IsCustom){var t=i.getNavigationUrl(n);this.dropDownMenuItem=undefined;this.menuService.setSelectedMenuItem(n);t!==""&&(t.indexOf("applicationAssistant")>-1?(this.$location.url("/"+t),this.$route.current.templateUrl.toString().indexOf("ApplicationAssistant")>-1&&this.$route.reload()):!this.userService.isUserLoggedIn&&t.indexOf("apply")>-1?this.login():this.$location.url("/"+t));this.currentMenuItem=n;this.menuState="navigation-selected"}},f.prototype.getNavigationUrl=function(n){return this.globals.baseUrl+this.globals.tenantUrl+"#/"+i.getNavigationUrl(n)},f.prototype.selectCulture=function(){window.location.href=this.globals.baseUrl+this.globals.tenantUrl+"/home/index/"+this.culture},f.prototype.setLinkToMyCart=function(){var n=this;this.globals.tylerIdEnabled?this.tcpSettingsService.getTenantTCPSettings(function(t){n.linkToMyCart=t&&t.UseTylerPayments?t.TylerPaymentCheckoutCartUrl+"?signin=true":"#/mycart"}):this.linkToMyCart="#/mycart"},f.prototype.selectDistrict=function(t){var i=n.Core.Controllers.CoreController.findItemInArray(this.tenants,"TenantID",t);i?(this.selectedDistrictName=i.TenantName,this.selectedDistrictId=t):(this.selectedDistrictName="",this.selectedDistrictId=0)},f.prototype.logout=function(){this.cartService.clearTotalNumOfItems();this.globals.tylerIdEnabled?this.oidcService.userManager&&this.oidcService.signout():(this.userService.logout(),window.location.replace(this.globals.baseUrl+this.globals.tenantUrl))},f.prototype.returnToTylerIDLink=function(){var n=this.$location.absUrl();return this.globalService.authority.replace(/\/$/,"")+"/account/?referrer_uri="+encodeURIComponent(n)},f.prototype.showCompleteRegistrationLink=function(){var n=!0;return this.$location.path().toLowerCase().indexOf("/callback.html")>-1&&(n=!1),this.userService.tylerId&&n&&!this.userService.isUserLoggedIn&&!this.userService.isUserPartialLoggedIn&&this.$location.path().toLowerCase().indexOf("/register")==-1},f.prototype.showCancelRegistrationLink=function(){return this.userService.tylerId&&!this.userService.isUserLoggedIn&&!this.userService.isUserPartialLoggedIn&&this.$location.path().toLowerCase().indexOf("/register")>-1},f.prototype.completeRegistration=function(){this.$location.url("register")},f.prototype.register=function(){this.globals.tylerIdEnabled?this.$location.url(this.loginUrl):this.$location.url("register")},f.prototype.login=function(){this.$location.url(this.loginUrl)},f.prototype.manageMyUser=function(){this.$location.url("manageMyUser")},f.prototype.managePersonalInformation=function(){this.$location.url("manageMyUser?tab=personalinfo");this.$route.reload()},f.prototype.manageAddresses=function(){this.$location.url("manageMyUser?tab=addresses");this.$route.reload()},f.prototype.manageInvoices=function(){this.$location.url("manageMyUser?tab=myinvoices");this.$route.reload()},f.prototype.manageContactManager=function(){this.$location.url("contactManager")},f.prototype.manageSavedWork=function(){this.$location.url("savedWork")},f.prototype.manageMyBusinesses=function(){this.$location.url("manageMyUser?tab=mybusinesses");this.$route.reload()},f.prototype.welcomeGreeting=function(){if(this.greetingTextModel==null){var n=this;this.resourceService.getSpecificKeyValues("SelfService.Resources.SelfService",["GreetingText_GoodMorning","GreetingText_GoodAfternoon","GreetingText_GoodEvening"],function(t){n.greetingTextModel={GoodMorning:t.GreetingText_GoodMorning,GoodAfternoon:t.GreetingText_GoodAfternoon,GoodEvening:t.GreetingText_GoodEvening};n.setGreeting()})}else this.setGreeting()},f.prototype.setDefaultUserName=function(){var n=this;this.userService.getDefaultUserName(this.globals.tenantUrl,this.globals.culture,function(t){n.userService.userName=t})},f.prototype.setGreeting=function(){var t=new Date,n=t.getHours();n<12?this.greetingText=this.greetingTextModel!=null?this.greetingTextModel.GoodMorning:"Good Morning,":n>=12&&n<17?this.greetingText=this.greetingTextModel!=null?this.greetingTextModel.GoodAfternoon:"Good Afternoon,":n>=17&&n<=24&&(this.greetingText=this.greetingTextModel!=null?this.greetingTextModel.GoodEvening:"Good Evening,")},f.prototype.getMenu=function(n){var r=this,t;this.getUserRoutes();this.menuItems=[];t=this;this.menuService.getMenu(function(u){var f,e;u.Success&&(t.dropDownItemLimit=u.Result.DropDownItemLimit,f=u.Result.Menus,t.allowFeeEstimator||(f=u.Result.Menus.filter(function(n){return n.Details!=="Estimate Fees"})),e=!1,(t.allowPayInvoiceNotLoggedIn||t.allowPayInvoiceNotContact&&t.userService.isUserLoggedIn)&&(e=!0),e||(f=f.filter(function(n){return n.Details!=="Pay Invoices"})),angular.forEach(f,function(n){n.Details==="Apply"&&angular.forEach(n.SubMenus,function(n){n.SubMenus=n.SubMenus.filter(function(n){if(n.CaseTypeInfo!==null)return n.CaseTypeInfo.CaseTypeUse!==o.EstimationOnly})})}),t.menuItems=f,t.buildApplyAllMenus(),t.defaultMenu=i.processRoutes(r.globals,r.menuItems));n()});this.menuService.getMenuWithSubRecordData(function(){r.hasMenuWithSubRecord||(r.utilities.showPleaseWait(),r.hasMenuWithSubRecord=!0)})},f.prototype.buildApplyAllMenus=function(){var n,t,i;this.globalService.applyAllMenus=[];n=this.menuItems.filter(function(n){return(n.Details=="Apply"||n.Label=="Apply")&&n.IsCustom==!1&&n.Link==null&&n.ParentMenuID==null});n!=null&&n.length==1&&(t=n[0].SubMenus.filter(function(n){return n.Details=="PERMITS"||n.Label=="PERMITS"}),t!=null&&t.length==1&&this.globalService.applyAllMenus.push({Key:"Permit",Value:"applicationAssistant?sectionName=All&moduleId="+r.Permit+"&categoryName=All"}),i=n[0].SubMenus.filter(function(n){return n.Details=="PLANS"||n.Label=="PLANS"}),i!=null&&i.length==1&&this.globalService.applyAllMenus.push({Key:"Plan",Value:"applicationAssistant?sectionName=All&moduleId="+r.Plan+"&categoryName=All"}))},f.prototype.getUserRoutes=function(){for(var t=this,u=[this.loginUrl,"/register","/manageMyUser","/myInvoices","/myBusinesses","/myTemplates","/myDrafts","/pendingapproval"],r=0;r<u.length;r++)delete this.$route.routes[u[r]],delete this.$route.routes[u[r]+"/"];!this.hideLicenseFeature&&this.userService.isUserLoggedIn&&i.routeProvider.when("/dashboard/my/licenses",{controller:"enerGovViewMyLicensesController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/dashboardDetail/viewMyLicenses?v="+this.globals.version,pageTitle:"PageTitle_MyLicenses"});this.hideLicenseFeature&&this.hideOperationalPermitFeature||i.routeProvider.when("/businessLicense/:id",{controller:"enerGovBusinessLicenseViewController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/energovLicense/businessDetail?v="+this.globals.version,reloadOnSearch:!1}).when("/profLicense/:id",{controller:"enerGovProfessionalLicenseViewController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/energovLicense/professionalDetail?v="+this.globals.version,reloadOnSearch:!1}).when("/operationalPermit/:id",{controller:"enerGovBusinessLicenseViewController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/energovLicense/businessDetail?v="+this.globals.version,reloadOnSearch:!1});this.userService.isUserLoggedIn&&(this.escrowAccountsSettingService.getTenantEscrowAccountsSettings(function(){t.escrowAccountsSettingService.escrowAccountSettings.AccountsVisible&&i.routeProvider.when("/account/:id",{controller:"enerGovEscrowAccountDetailController",controllerAs:"vm",templateUrl:t.globals.baseUrl+t.globals.tenantUrl+"/energovescrowaccount/detail?v="+t.globals.version,reloadOnSearch:!1})}),i.routeProvider.when("/contactManager",{templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/contactManager?v="+this.globals.version,pageTitle:"MenuContactManager",reloadOnSearch:!1}).when("/savedWork",{templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/savedWork?v="+this.globals.version,pageTitle:"MenuSavedWork",reloadOnSearch:!1}).when("/manageMyUser",{templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/manageMyUser?v="+this.globals.version,pageTitle:"PageTitle_ManageAccount",reloadOnSearch:!1}).when("/manageMyUser/subcontact/:action/:parentContactId/:subContactId",{controller:"acceptRejectSubContactController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/AcceptRejectSubContact?v="+this.globals.version,reloadOnSearch:!1}).when("/mycart",{controller:n.Constants.ControllerConstant.ShoppingCartController,controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/shoppingcart/Cart?v="+this.globals.version,pageTitle:"PageTitle_ShoppingCart"}).when("/myInvoices",{controller:"enerGovMyInvoiceViewController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/EnerGovInvoice/myInvoice?v="+this.globals.version,pageTitle:"PageTitle_MyInvoices"}).when("/myDrafts",{templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/dashboardDetail/viewMyDrafts?v="+this.globals.version,pageTitle:"PageTitle_MyDrafts"}).when("/myTemplates",{templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/EnerGovTemplate/myTemplates?v="+this.globals.version,pageTitle:"PageTitle_MyTemplates"}).when("/myBusinesses",{templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/manageMyUser?v="+this.globals.version+"tab=mybusinesses",pageTitle:"PageTitle_MyBusinesses",reloadOnSearch:!1}).when("/myInvoices/useElastic?/:id?",{controller:"enerGovMyInvoiceViewController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/EnerGovInvoice/myInvoice?v="+this.globals.version,pageTitle:"My Invoices"}).when("/summary/my/permit/:id/attentionSummary/:statusReasonCode?",{controller:"enerGovViewMyAttentionSummaryController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/attentionSummary/viewMyAttentionSummary?v="+this.globals.version}).when("/summary/my/plan/:id/attentionSummary/:statusReasonCode?",{controller:"enerGovViewMyAttentionSummaryController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/attentionSummary/viewMyAttentionSummary?v="+this.globals.version}).when("/permit/:id/resubmitAttachment/:submittalId?",{controller:"enerGovEReviewResubmitController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/energovereview/resubmitAttachment?v="+this.globals.version+"&entity=permit",pageTitle:"PageTitle_ResubmitAttachment"}).when("/plan/:id/resubmitAttachment/:submittalId?",{controller:"enerGovEReviewResubmitController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/energovereview/resubmitAttachment?v="+this.globals.version+"&entity=plan",pageTitle:"PageTitle_ResubmitAttachment"}).when("/business/:id/taxremittance",{controller:"taxRemittanceController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/energovtaxremittance/taxremittancereport?v="+this.globals.version}).when("/business/:id/taxremittancefee",{controller:"taxRemittanceFeeController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/energovtaxremittance/taxremittancefees?v="+this.globals.version}).when("/project/:id/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/energovapply/contact?v="+this.globals.version+"&entity=project"}));this.userService.isUserLoggedIn||(i.routeProvider.when("/pendingapproval",{templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/pendingApproval?v="+this.globals.version}),this.globals.tylerIdEnabled?i.routeProvider.when("/sso.html",{controller:"SSOController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/SSO?v="+this.globals.version,pageTitle:"PageTitle_Login"}):i.routeProvider.when("/login",{controller:"userController",controllerAs:"vm",templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/login?v="+this.globals.version,pageTitle:"PageTitle_Login"}),(this.globals.tylerIdEnabled&&this.backFromTid||!this.globalService.tylerIdEnabled)&&i.routeProvider.when("/register",{templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/register?v="+this.globals.version,pageTitle:"PageTitle_Register"}),i.routeProvider.when("/callback.html/:id",{templateUrl:this.globals.baseUrl+this.globals.tenantUrl+"/home/CallbackClient?v="+this.globals.version,pageTitle:"PageTitle_Login"}))},f.prototype.getNotifications=function(){var n=this;this.dashboardService.notificationCallCount===0&&(this.dashboardService.getNotification(function(t){n.notifications=t.filter(function(n){return!n.IsExpired});n.notifications&&(n.notifications=n.notifications.filter(function(t){return n.filterNotificationsByDate(t.StartDate,t.EndDate)}))}),this.dashboardService.notificationCallCount++)},f.prototype.filterNotificationsByDate=function(n,t){var f=!1,e=(new Date).toDateString(),u="ddd MMM DD YYYY",r=n?moment(n,moment.defaultFormat).toDate():n,i;return r=moment(r,u).toDate().toDateString(),i=t?moment(t,moment.defaultFormat).toDate():t,i=moment(i,u).toDate().toDateString(),r&&i&&(moment(e,u).isBetween(r,i)||moment(e,u).isSame(r)||moment(e,u).isSame(i))?f=!0:r&&r!=="Invalid Date"&&!i&&moment(r,u).isSameOrBefore(e)?f=!0:!r&&i&&i!=="Invalid Date"&&moment(i,u).isSameOrAfter(e)?f=!0:r!="Invalid Date"||n||i!="Invalid Date"||t||(f=!0),f},f.prototype.getTenantCommonSetting=function(){var n=this;this.tenantCommonSettingService.getTenantCommonSetting(function(t){var i=5e3;switch(t.BannerSpeedInterval){case u.Slow:i=1e4;break;case u.Fast:i=2e3}n.carouselInterval=i})},f.prototype.pauseCarousel=function(){$(".carousel").carousel("pause")},f.prototype.playCarousel=function(){$(".carousel").carousel("cycle")},f.prototype.playNext=function(){$(".carousel").carousel("next")},f.prototype.playPrevious=function(){$(".carousel").carousel("prev")},f.prototype.toggleCarousel=function(){$("#carouselIcon").hasClass("fa fa-pause")?($(".carousel").carousel("pause"),$("#carouselIcon").removeClass("fa fa-pause").addClass("fa fa-play").attr("aria-label","Play")):($("#carouselIcon").hasClass("fa fa-play"),$(".carousel").carousel("cycle"),$("#carouselIcon").removeClass("fa fa-play").addClass("fa fa-pause").attr("aria-label","Pause"))},f.prototype.setFocusForHomePage=function(){var n=document.getElementById("tenantLogo");n&&n.focus()},f.prototype.getSelectedTenantCulture=function(){var n=this;n.hasLoadedSelectedTenantCulture=!1;n.tenantService.getSelectedTenantCulture(!0,!1,!0,function(t){n.selectedTenantCulture=t;n.hasLoadedSelectedTenantCulture=!0;n.settingService.setEnerGovAPIVersion();n.settingService.setTylerSearchVersion()})},f.prototype.showTenantHeader=function(){return this.selectedTenantCulture&&this.selectedTenantCulture.HeaderHtml&&this.selectedTenantCulture.HeaderHtml!==""?!0:!1},f.prototype.showTenantFooter=function(){return this.selectedTenantCulture&&this.selectedTenantCulture.FooterHtml&&this.selectedTenantCulture.FooterHtml!==""?!0:!1},f.prototype.parseRoute=function(){var n=this,i,t,r;return n.$location.path().indexOf("/apply")>-1&&!n.userService.isUserLoggedIn?null:(r=n.$route.routes,angular.forEach(n.$route.routes,function(r){!t&&(i=n.switchRouteMatcher(n.$location.path(),r))&&(t=n.inherit(r,{params:angular.extend({},n.$location.search(),i),pathParams:i}),t.$$route=r)}),t)},f.prototype.switchRouteMatcher=function(n,t){var s=t.keys,e={},r,i,o,u,f;if(!t.regexp||(r=t.regexp.exec(n),!r))return null;for(i=1,o=r.length;i<o;++i)u=s[i-1],f=r[i],u&&f&&(e[u.name]=f);return e},f.prototype.inherit=function(n,t){return angular.extend(Object.create(n),t)},f.prototype.ValidateLogin=function(n){var t=this;this.globals.tylerIdEnabled?(t.utilities.showPleaseWait(),this.oidcService.validateUser().then(function(){if(t.userService.token&&t.userService.token!=""){var i={TylerId:t.userService.tylerId,UserName:t.userService.userName,EmailAddress:t.userService.emailAddress,Password:"",RememberMe:!1};t.userService.getUserApprovalInfo(i).then(function(i){i&&!i.ValidationErrorMessage&&i.Result?t.userService.getUserByTylerId(function(i){i&&i.Result?(t.userService.isUserLoggedIn=!0,n(!0)):t.userService.checkWithEmailAndAttachTid(function(i){i&&i.Result?(t.userService.isUserLoggedIn=!0,n(!0)):(n(!1),t.$location.path("/register"))})}):t.resourceService.getSpecificKeyValues("SelfService.Resources.SelfService",["UserAccountPendingApproval"],function(r){var u=r.UserAccountPendingApproval;u&&u===i.ValidationErrorMessage&&(t.userService.isUserPartialLoggedIn=!0,t.userService.isUserLoggedIn=!1,n(!0))})})}else n(!1)})):this.userService.validationLogin(function(t){n(t)})},f.prototype.getCartItemsCount=function(n){var t=this;n&&(this.cartService.updateTotalNumOfItems(),this.tcpSettingsService.getTenantTCPSettings(function(n){n&&n.UseTylerPayments&&t.cartService.getTylerCartItems()}),this.setLinkToMyCart())},f.prototype.setFavicon=function(n){var t=this;t.tenantService.getTenantFavicon(n,function(n){var i=n,r;i||(i=t.defaultFavicon);localStorage.setItem("TenantFavicon",i);r=document.getElementById("faviconLink");r.setAttribute("href",i)})},f.prototype.skipToMainContent=function(){var r={payinvoice:"focusText",map:"map-viewer",report:"selectModule",estimate:"PermitEstimator",search:"button-Search"},t="main-content",i,n;for(i in r)if(this.$route.current.templateUrl.toString().toLowerCase().indexOf(i)>-1){t=r[i];break}this.$route.current.templateUrl.toString().toLowerCase().indexOf("applicationassistant")>-1&&document.getElementById("appAssistCurtainBtnNo")&&(t="appAssistCurtainBtnNo");n=document.getElementById(t);n&&(n.focus(),n.scrollIntoView({behavior:"smooth"}))},f}(n.Core.Controllers.CoreController);t.ShellController=f;angular.module("app.Controllers.Shell",["app.globalsModule","app.Services.Menu","app.Services.Utilities","app.Services.Tenant","app.Common.Services.Resource","app.Common.Services.Event","app.Common.Services.Location","app.Services.SettingsService","app.Services.WalkMeService","app.tcpSettings","app.Services.TenantCommonSetting"]).controller("shellController",["menuService","$timeout","$route","tenantService","userService","$interval",n.Constants.ServiceConstant.CartService,"dashboardService","resourceService","globalsService","eventService","locationService","settingsService","$q","$rootScope","walkMeService","OidcService","$routeParams","tcpSettingsService","tenantCommonSettingService","escrowAccountsSettingService",f])})(t=n.Controllers||(n.Controllers={}))}(app||(app={})),function(n){var t;(function(){angular.module("app.Filters",[]).filter("unique",function(){return function(n,t){if(t===!1)return n;if((t||angular.isUndefined(t))&&angular.isArray(n)){var i=[],r=function(n){return angular.isObject(n)&&angular.isString(t)?n[t]:n};angular.forEach(n,function(n){for(var u=!1,t=0;t<i.length;t++)if(angular.equals(r(i[t]),r(n))){u=!0;break}u||i.push(n)});n=i}return n}}).filter("tylerDate",["$filter",function(n){var t=n("date");return function(n,i){return n?t(n,i):"None"}}]).filter("tylerTime",["$filter",function(n){return function(t){if(t==null)return"";var i=t.split(":"),r=new Date(0,0,0,i[0],i[1],i[2]);return n("date")(r,"h:mm a")}}]).filter("tylerBoolean",[function(){return function(n,t){return n?t.split("|")[0]:t.split("|")[1]}}]).filter("tylerCurrency",["$filter",function(n){var t=n("currency");return function(n,i){return n!==undefined&&n!==null?t(n,i):null}}]).filter("UtcToLocal",[function(){return function(n){return window.moment.utc(n).toDate()}}]).filter("removeSpaces",function(){return function(n){if(n)return n.replace(/ /g,"")}})})(t=n.Filters||(n.Filters={}))}(app||(app={})),function(n){var t;(function(){"use strict";angular.module("app.Common.Controllers",[]).controller("coreController",[n.Core.Controllers.CoreController]);angular.module("app.Common.Services",["app.Common.Services.Event","app.Common.Services.Http","app.Common.Services.Auth","app.Common.Services.Resource","app.Common.Services.TenantSettingsService","app.Common.Services.Location","app.Common.Services.AttachmentCommonCard","app.Services.SettingsService"]);angular.module("app.Common.Components",["app.Common.Components.AttachmentCommonCard","app.Common.Components.AttachmentRecordDetailCard","app.Common.Components.AttachmentWaitingState","app.Common.Components.FileListWaitingState","app.Common.Components.NonCategoryAttachmentCards"]);angular.module("app.Common.Directives",["app.Common.Directives.AttachmentThumbnail"]);angular.module("app.Common",["app.Common.Services","app.Common.Controllers","app.Common.Components","app.Common.Directives"])})(t=n.Common||(n.Common={}))}(app||(app={})),function(n){var t;(function(n){var t=function(){function n(n){this.http=n;this.rootUrl="/welcome"}return n.prototype.getTenantTileDetails=function(n,t){if(n){var i=this;this.http.get(i.rootUrl+"/tiles/tenanttiledetail/"+n,function(n){n.Success&&t(n.Result)},!1)}},n.prototype.getFastLink=function(n){this.http.get("/home/getfastlinks",function(t){t.Success&&n(t.Result)},!1)},n.prototype.getAllTileLayout=function(n){var t=this;this.http.get(t.rootUrl+"/tileslayout/",function(t){t.Success&&n(t.Result)},!1)},n.prototype.getTileIcons=function(n){var t=this;this.http.get(t.rootUrl+"/tileicons/",function(t){t.Success&&n(t.Result)},!1)},n.prototype.getAllTileType=function(n){var t=this;this.http.get(t.rootUrl+"/tiletype/",function(t){t.Success&&n(t.Result)},!1)},n}();n.HomeService=t})(t=n.Home||(n.Home={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){"use strict";var i=n.Common.Helpers.TenantHelper,r=function(n){function t(t,i,r,u,f,e,o,s){var h=n.call(this,s)||this,a,l,c;return h.homeService=t,h.globalService=i,h.locationService=r,h.tenantService=u,h.$window=f,h.userService=e,h.menuService=o,h.fastLinks=[],h.tenant="",h.tenantUrl="",h.currentLocation="/",h.isSingleTenant=!1,h.hasLoadedSelectedTenantCulture=!1,h.tileIconList=[],h.allTiles=[],h.associatedTenantTiles=[],h.tenantUrl=h.globals.tenantUrl,a=h,h.setup(),h.getAllTileDetails(),h.getTileIcons(),h.getAllTileType(),l=h,angular.element(f).resize(function(){l.init()}),h.menuTabIndex=h.menuService.menuTabIndices.filter(function(n){return n.Key=="Home"})[0].Value,c=h.menuService.getHomeMenu().Label,h.$timeout(function(){var n=document.getElementById("default-main-menu-item");n.innerHTML!==c&&(n=document.getElementById("link-Menu-"+c));angular.element(n).focus().click()},300),h}return __extends(t,n),t.prototype.getSelectedTenantCulture=function(){var n=this;n.hasLoadedSelectedTenantCulture=!1;n.tenantService.getSelectedTenantCulture(!1,!0,!1,function(t){n.selectedTenantCulture=t;n.hasLoadedSelectedTenantCulture=!0})},t.prototype.showTenantBody=function(){return this.selectedTenantCulture&&this.selectedTenantCulture.BodyHtml&&this.selectedTenantCulture.BodyHtml!==""?!0:!1},t.prototype.setup=function(){var n=this;this.homeService.getFastLink(function(t){n.fastLinks=t});this.tenantService.getTenants(function(t){n.globals.tenants=t;n.tenants=t;i.processMultiTenants(n.globals,n,t)&&n.getSelectedTenantCulture()})},t.prototype.viewTodayInspection=function(){this.$location.path("inspection/todaysinspections")},t.prototype.signUp=function(){this.$location.path("register")},t.prototype.goTologin=function(){this.$location.path("login")},t.prototype.getAllTileDetails=function(){var n=this;n.homeService.getAllTileLayout(function(t){n.homeService.getTenantTileDetails(n.globalService.tenantId,function(i){n.associatedTenantTiles=i.TenantTiles.filter(function(n){return n.AssociatedTileId!==0});i.TenantTiles=i.TenantTiles.filter(function(n){return n.AssociatedTileId===0});n.tileDetails=i;n.userService.isUserLoggedIn&&n.associatedTenantTiles.length>0&&angular.forEach(n.tileDetails.TenantTiles,function(t){var r=n.associatedTenantTiles.filter(function(n){return n.AssociatedTileId==t.TenantTileId})[0],i;r!=undefined&&(i=n.allTiles.filter(function(n){return n.Link==r.Link})[0],i!=undefined&&(t.Description=i.Description,t.TileName=i.Name,t.Link=i.Link,t.TileIconId=i.TileIconId))});n.createProperLink(n.tileDetails.TenantTiles);n.selectedLayout=t.filter(function(n){return n.TileLayoutId==i.TenantTileLayout.TileLayoutId})[0]})})},t.prototype.createProperLink=function(n){var t=this;angular.forEach(n,function(n){if(!(n.Link.toLowerCase().indexOf("http")>-1||n.Link.toLowerCase().indexOf("https")>-1||n.Link.toLowerCase().indexOf("www")>-1)){var i=n.Link;n.Link=t.$location.absUrl().split("#")[0]+"#"+i}})},t.prototype.getNumberArray=function(n){return new Array(n)},t.prototype.getClassName=function(n){var i=this,t=i.tileIconList.filter(function(t){return t.TileIconId==n})[0];return t?t.Tag:""},t.prototype.getTileIcons=function(){var n=this;n.homeService.getTileIcons(function(t){n.tileIconList=t})},t.prototype.cardClick=function(n){var i=this,t=this.$location,r=this.allTiles.filter(function(t){return t.TileId===n.TileId})[0];n.OpenInNewTab?n.Link.toLowerCase().indexOf("http")>-1||n.Link.toLowerCase().indexOf("https")>-1||n.Link.toLowerCase().indexOf("www")>-1?window.open(n.Link,"_blank"):window.open(t.$$absUrl.split("#")[0]+"#"+n.Link,"_blank"):n.Link.toLowerCase().indexOf("http")>-1||n.Link.toLowerCase().indexOf("https")>-1||n.Link.toLowerCase().indexOf("www")>-1?window.open(n.Link,"_self"):this.$location.path(n.Link)},t.prototype.getAllTileType=function(){var n=this;n.homeService.getAllTileType(function(t){n.allTiles=t})},t.prototype.isTwoByTwo=function(){return this.selectedLayout&&this.selectedLayout.ColumnCount===2&&this.selectedLayout.RowCount===2?!0:!1},t.prototype.getTileLayoutClass=function(n){switch(n){case 2:return"col-sm-6";case 3:return"col-sm-4";case 4:return"col-sm-3";default:return""}},t.prototype.init=function(){var n=this.$window.screen.height,t=angular.element(".aboveBodyContent").height(),i=angular.element(".adjustments"),r=n-t-95;i.css("min-height",r)},t}(n.Core.Controllers.CoreController);t.HomeController=r})(t=n.Home||(n.Home={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){"use strict";var i=function(n){function t(){var t=n.call(this)||this,i;return t.path="",i=t,i.path=i.globals.baseUrl+"/analytics.html",t}return __extends(t,n),t}(n.Core.Controllers.CoreController);t.AnalyticsController=i})(t=n.Home||(n.Home={}))}(app||(app={})),function(n){var t;(function(t){"use strict";angular.module("app.Home",["app.Common.Services.Location"]).service("homeService",["http",n.Home.HomeService]).controller("homeController",["homeService","globalsService","locationService","tenantService","$window","userService","menuService",t.HomeController]).controller("analyticsController",[t.AnalyticsController])})(t=n.Home||(n.Home={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n){this.http=n;this.rootUrl="/favoritecontact/";this.isSelectAll=!1}return n.prototype.searchByCriteria=function(n,t){var i=this;n!==null&&this.http.post(this.rootUrl,n,function(n){n.Success&&(i.isSelectAll=!1,t(n))},!0)},n.prototype.removeContacts=function(n,t){this.http.post(this.rootUrl+"remove/",n,function(n){n.Success&&t(n.Result)},!0)},n}();n.FavoriteContactService=t})(t=n.Services||(n.Services={}))})(t=n.Users||(n.Users={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u,f){this.userService=n;this.$location=t;this.globalsService=i;this.resourceService=r;this.utilities=u;this.cartService=f;this.settings=this.loadSettings();var e=this}return n.prototype.loadSettings=function(){return{authority:this.globalsService.authority,client_id:this.globalsService.client_id,response_type:"id_token token",redirect_uri:this.createUrl(this.globalsService.redirect_uri),scope:this.globalsService.scope,post_logout_redirect_uri:this.createUrl(this.globalsService.post_logout_redirect_uri),silent_redirect_uri:this.createUrl(this.globalsService.silent_redirect_uri),clockSkew:5400,automaticSilentRenew:!0,accessTokenExpiringNotificationTime:this.globalsService.accessTokenExpiringNotificationTime,post_redirect_uri:this.createUrl(this.globalsService.post_redirect_uri),require_authentication:this.globalsService.require_authentication,userStore:new Oidc.WebStorageStateStore({store:window.localStorage})}},n.prototype.createUrl=function(n){var t=n,i=this.$location.absUrl().split("/").filter(function(n){return n.indexOf("#")>-1})[0];return t=this.globalsService.tenantUrl.length>0?n.replace("{host}",this.$location.protocol()+"://"+this.$location.host()+this.globalsService.baseUrl.slice(0,-1))+"/"+this.globalsService.tenantUrl:n.replace("{host}",this.$location.protocol()+"://"+this.$location.host()+this.globalsService.baseUrl.slice(0,-1)),t.toLowerCase()},n.prototype.init=function(n){var i=this,t;n===void 0&&(n=!0);t=this;t.utilities.showPleaseWait();Oidc.Log.logger=console;Oidc.Log.level=Oidc.Log.INFO;this.waitForLoadPromise=function(n){t.loadResolver=n};this.userManager=new Oidc.UserManager(this.settings);this.userManager.events.addUserLoaded(function(n){t.setUser(n)});this.userManager.events.addUserSignedOut(function(){t.userManager.getUser().then(function(n){n||(t.removeUser(),t.gotoPostLogoutUrl())})});this.userManager.events.addAccessTokenExpired(function(){t.userManager.getUser().then(function(n){n&&(t.cartService.clearTotalNumOfItems(),t.signout())})});this.userManager.events.addUserUnloaded(function(){i.userService.onUserLoggedOut()})},n.prototype.signin=function(n){n||(n=this.userService.userReffererUrlTylerId);this.userManager.signinRedirectCallback();this.userManager.signinRedirect({data:{referrer:n}}).catch(function(n){console.log("oidcHelper.signinRedirect error: "+n)})},n.prototype.signinCallback=function(){var n=this;n.utilities.showPleaseWait();n.userService.userReffererUrlTylerId?n.userService.getUserByTylerId(function(t){t&&n.userService.userReffererUrlTylerId?n.loginToEnergovAndRedirect():n.userService.checkWithEmailAndAttachTid(function(t){t&&t.Result?n.loginToEnergovAndRedirect():n.$location.path("/register")})}):n.gotoPostLogoutUrl()},n.prototype.loginToEnergovAndRedirect=function(){var n=this,t={TylerId:n.userService.tylerId,UserName:n.userService.userName,EmailAddress:n.userService.emailAddress,Password:"",RememberMe:!1};n.userService.getEnerGovUser(t,function(t){if(n.utilities.hidePleaseWait(),t&&!t.ValidationErrorMessage&&t.Result)n.userService.isUserLoggedIn=!0;else{var i="";n.resourceService.getSpecificKeyValues("SelfService.Resources.SelfService",["UserAccountPendingApproval"],function(r){i=r.UserAccountPendingApproval;i&&i===t.ValidationErrorMessage&&(n.userService.isUserPartialLoggedIn=!0,n.$location.url("/pendingapproval"))})}})},n.prototype.signinSilent=function(){this.userManager.signinSilentCallback().catch(function(n){console.log("oidcHelper.signinSilentCallback error: "+n)})},n.prototype.signout=function(){this.userManager.signoutRedirect().catch(function(n){console.log("oidcHelper.signoutRedirect error: "+n)})},n.prototype.setUser=function(n){!n||n.expired?this.removeUser():this.userService&&(this.userService.token=n.access_token,this.userService.appToken=n.access_token,n.profile&&(this.userService.emailAddress=n.profile.email,this.userService.tylerId=n.profile.sub,this.userService.tylerUsername=n.profile.email,this.userService.userName=n.profile.given_name+" "+n.profile.family_name,this.userService.firstName=n.profile.given_name,this.userService.lastName=n.profile.family_name,this.userService.userReffererUrlTylerId=n.state.referrer))},n.prototype.removeUser=function(){this.userManager.removeUser();this.userService&&(this.userService.token="",this.userService.appToken="",this.userService.isUserLoggedIn=!1,this.userService.userName="",this.userService.emailAddress="",this.userService.tylerId="",this.userService.tylerUsername="");this.settings.require_authentication&&this.checkAutoLogin()},n.prototype.removeTylerIdUser=function(){this.userService&&(this.userService.token="",this.userService.appToken="",this.userService.isUserLoggedIn=!1,this.userService.userName="");this.userManager.removeUser()},n.prototype.checkAutoLogin=function(){var n=this;n.userManager.getUser().then(function(t){t&&n.processUser(t)})},n.prototype.processUser=function(n){var t=this;n?this.loadApp():t.settings.require_authentication?t.signin(window.location.href):this.userManager.signinSilent().then(function(){t.loadApp()}).catch(function(){t.loadApp()})},n.prototype.gotoPostLogoutUrl=function(){if(this.settings.post_redirect_uri){var n=this.settings.post_redirect_uri.split("home"),t=n[0]+n[1]+"#/home";this.$location.url(t)}else window.location.reload()},n.prototype.loadApp=function(){this.loadResolver&&this.loadResolver()},n.prototype.GetUser=function(){var n=this;return this.userManager.getUser().then(function(t){t?n.setUser(t):n.userManager.signinRedirectCallback()}).catch(function(n){console.log("oidcHelper.getUser error: "+n)})},n.prototype.BeginSSo=function(n){n===void 0&&(n=!1);var t=this;this.init();n||t.signin(window.sessionStorage.getItem("referrer"))},n.prototype.validateUser=function(n){return n===void 0&&(n=!1),this.init(!1),this.GetUser()},n}();n.OidcService=t})(t=n.Services||(n.Services={}))})(t=n.Users||(n.Users={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n,t,i){this.http=n;this.authService=t;this.utilities=i;this.rootUrl="/user/";this.defaultLabelList={}}return n.prototype.register=function(n,t){var i=this;this.http.post(this.rootUrl+"register",n,function(n){t(n.Result)},!1)},n.prototype.tylerIdregister=function(n,t){var i=this;this.http.post(this.rootUrl+"tylerid/register",n,function(n){t(n.Result)},!1)},n.prototype.getDefaultPlaceholderValues=function(){var n;return n={},n.unitorsuite="Apartment, suite, unit, floor, (optional)",n.addressline1="Street address, P.O. box. (required)",n.state="Select a state",n},n.prototype.fillDefaultLableValues=function(){var n,t=this;t.defaultLabelList=(n={},n.parcelnumber={value:"Parcel Number",isHide:!1},n.unitorsuite={value:"Unit Or Suite",isHide:!1},n.addressline1={value:"Address Line 1",isHide:!1},n.addressline2={value:"Address Line 2",isHide:!1},n["apartment;addressline3"]={value:"Address Line 3",isHide:!1},n.city={value:"City",isHide:!1},n["zip;postalcode"]={value:"Postal Code",isHide:!1},n.county={value:"County",isHide:!1},n.state={value:"State",isHide:!1},n.addresstype={value:"Address Type",isHide:!1},n.predirection={value:"Pre Direction",isHide:!1},n.postdirection={value:"Post Direction",isHide:!1},n.country={value:"Country",isHide:!1},n.main={value:"Main",isHide:!1},n.mailingaddressstreettypeid={value:"Street Type",isHide:!1},n.simpleaddressline1={value:"Address",isHide:!1},n)},n.prototype.setLableValue=function(n){var t=this;angular.forEach(n,function(n){t.defaultLabelList[n.KeyBindingPropertyName.toLowerCase()]&&(t.defaultLabelList[n.KeyBindingPropertyName.toLowerCase()].isHide=n.IsHide,n.NewLabel&&n.NewLabel!==""&&(t.defaultLabelList[n.KeyBindingPropertyName.toLowerCase()].value=n.NewLabel))})},n.prototype.checkExistAccount=function(n,t){this.http.post(this.rootUrl+"checkExistAccount",{Email:n},function(n){n.Success&&t(n.Result)},!1)},n.prototype.getExistUserAccountInfos=function(n,t,i){this.http.post(this.rootUrl+"getExistUserAccountInfos",{Email:n,GlobalEntityId:t},function(n){n.Success&&i(n.Result)},!1)},n.prototype.getExistUserAccountInfo=function(n,t){this.http.post(this.rootUrl+"getExistUserAccountInfo",{Email:n},function(n){n.Success&&t(n.Result)},!1)},n.prototype.getSecondaryData=function(n){this.http.get(this.rootUrl+"setup",function(t){t.Success&&n(t.Result)},!1)},n.prototype.verifyGoogleCaptcha=function(n,t){this.http.post(this.rootUrl+"verify-captcha",{Response:n},function(n){n.Success&&t(n.Result)},!1)},n}();n.RegisterUserService=t})(t=n.Services||(n.Services={}))})(t=n.Users||(n.Users={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n){this.http=n;this.rootUrl="/FavoriteContact/";this.isSelectAll=!1}return n.prototype.searchByCriteria=function(n,t){var i=this;n!==null&&this.http.post(this.rootUrl+"SearchContacts/",n,function(n){n.Success&&(i.isSelectAll=!1,t(n))},!0)},n.prototype.addContacts=function(n,t){this.http.post(this.rootUrl+"Add/",n,function(n){n.Success&&t(n.Result)},!0)},n}();n.SearchContactsService=t})(t=n.Services||(n.Services={}))})(t=n.Users||(n.Users={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n){this.http=n;this.rootUrl="/SubContacts/";this.isSelectAll=!1}return n.prototype.searchByCriteria=function(n,t){n!==null&&this.http.post(this.rootUrl+"SearchContacts/",n,function(n){n.Success&&t(n)},!0)},n.prototype.addSubContact=function(n,t){this.http.post(this.rootUrl+"Add/",n,function(n){n.Success&&t(n.Result)},!0)},n.prototype.getPendingSubContactRequest=function(n,t,i){this.http.get("/AssociatedContacts/pending/"+n+"/"+t,function(n){n.Success&&i(n.Result)},!0)},n.prototype.getSubContactRequest=function(n,t,i){this.http.get("/AssociatedContacts/request/"+n+"/"+t,function(n){n.Success&&i(n.Result)},!0)},n.prototype.approveSubContactRequest=function(n,t){this.http.post(this.rootUrl+"Approve/",n,function(n){n.Success&&t(n.Result)},!0)},n.prototype.denySubContactRequest=function(n,t){this.http.post(this.rootUrl+"Deny/",n,function(n){n.Success&&t(n.Result)},!0)},n.prototype.getSubContactById=function(n,t){this.http.get(this.rootUrl+"subcontactbyid/"+n,function(n){n.Success&&t(n.Result)},!0)},n}();n.SearchSubContactsService=t})(t=n.Services||(n.Services={}))})(t=n.Users||(n.Users={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n){this.http=n;this.rootUrl="/subcontacts/";this.isSelectAll=!1}return n.prototype.searchByCriteria=function(n,t){n!==null&&this.http.post(this.rootUrl,n,function(n){n.Success&&t(n)},!0)},n.prototype.searchPendingParentContacts=function(n,t){n!==null&&this.http.post(this.rootUrl+"PendingParentContacts/",n,function(n){n.Success&&t(n)},!0)},n.prototype.removeSubContact=function(n,t){this.http.post(this.rootUrl+"Remove/",n,function(n){n.Success&&t(n.Result)},!0)},n}();n.SubContactsService=t})(t=n.Services||(n.Services={}))})(t=n.Users||(n.Users={}))}(app||(app={})),function(n){var t;(function(t){var i;(function(t){var i=n.Common.Services.Event.EventService,r=function(){function n(n,t,i,r,u,f){this.http=n;this.authService=t;this.eventService=i;this.globals=r;this.$location=u;this.$q=f;this.myAccountTabNumber=0;this.emailAddress="";this.rootUrl="/user/";this.isUserPartialLoggedIn=!1;this.tylerId="";this.tylerUsername="";this.middleName="";this.returnToUrl="";this.returnUserAddressUrl="";this.returnSubContactsUrl="";this.userReffererUrlTylerId="";var e=this;this.isUserLoggedIn=!1;this.isUserPartialLoggedIn=!1}return n.prototype.updateUserName=function(n){this.userName=n},n.prototype.onUserLoggedOut=function(){this.lastName="";this.firstName="";this.user=null;this.$location.path().indexOf("/pendingapproval")>-1||this.$location.path().indexOf("/thankyoureview")>-1||(this.tylerId="");this.tylerUsername="";this.isUserLoggedIn=!1;this.appToken="";this.logout()},n.prototype.createFullNameFromUser=function(n){return this.createFullName(n.LastName,n.FirstName,n.MiddleName)},n.prototype.createFullName=function(n,t,i){return i&&0!==i.length?t+" "+i[0]+". "+n+" ":t+" "+n+" "},n.prototype.checkWithEmailAndAttachTid=function(n){var i=this,t=this;this.http.post(this.rootUrl+"checkWithEmailAndAttachTid",{Email:t.emailAddress},function(r){r&&r.Success?r.Result?(i.setUserState(!0),t.user=r.Result,t.isUserLoggedIn=!0,n(r)):n(null):n(null)})},n.prototype.login=function(n,t){var i=this;this.http.post(this.rootUrl+"login",n,function(r){r.Success&&(r.Result?i.authService.setToken(n,function(){i.setUserState(!0);t(r)}):t(r))},null)},n.prototype.getUserSignatureAndSave=function(n,t){this.http.get(this.rootUrl+"usersignature/"+n,function(n){n.Success?t(n):t(null)})},n.prototype.getUserByTylerId=function(n){var t=this;return this.http.get(this.rootUrl+"getUserByTylerId",function(t){t.Success&&(t&&t.Result?n(t):n(null))},!0)},n.prototype.getEnerGovUser=function(n,t){var i=this,r=this;return this.http.post(this.rootUrl+"tylerid/login",n,function(n){n.Success&&(n&&n.Result?(i.setUserState(!0),r.user=n.Result,r.isUserLoggedIn=!0,t(n)):(i.setUserState(!1),t(n)))},!0)},n.prototype.getUserApprovalInfo=function(n){var t=this.$q.defer();return this.http.post(this.rootUrl+"tylerid/login",n,function(n){t.resolve(n)},!0),t.promise},n.prototype.logout=function(){this.authService.removeToken();this.setDefaultUserName();this.setUserState(!1);for(var n=0;n<localStorage.length;n++)localStorage.key(n).search("IncludeParentRecords_")!==-1&&(localStorage.removeItem(localStorage.key(n)),n--)},n.prototype.setDefaultUserName=function(){var n=this;this.getDefaultUserName(this.globals.tenantUrl,this.globals.culture,function(t){n.userName=t})},n.prototype.getUser=function(n){var t=this;t.user?n(t.user):t.getUserDetails(function(i){t.user=i;n(i)})},n.prototype.getUserDetails=function(n){this.http.get(this.rootUrl+"my/",function(t){t.Success&&n(t.Result)},!1)},n.prototype.getPackageUserId=function(){return null},n.prototype.getUserInfo=function(n){var t=this;this.http.get(this.rootUrl+"my/info/",function(t){n(t.Result)})},n.prototype.saveMyUser=function(n,t){var i=this;this.http.put(this.rootUrl+"my/",n,function(i){i.Success&&t(n)},null)},n.prototype.updateApplicationAssistantCurtainInfo=function(n){var t=this;this.http.put(this.rootUrl+"updateApplicationAssistantCurtainInfo",null,function(t){n(t.Result)})},n.prototype.saveMyUserAddresses=function(n,t){var i=this;n.ParentContacts=[];this.http.put(this.rootUrl+"my/addresses",n,function(i){i.Success&&(i.Result.Addresses&&(n.Addresses=i.Result.Addresses),t(n))},null)},n.prototype.sendForgetPasswordResetCode=function(n,t){this.http.post(this.rootUrl+"sendForgetPasswordResetCode",n,function(n){n.Success&&t(n.Result)},null)},n.prototype.sendConfirmEmail=function(n,t){this.http.post(this.rootUrl+"sendemailconfirm",n,function(n){n.Success&&t(n.Result)},null)},n.prototype.confirmEmail=function(n,t){this.http.post(this.rootUrl+"confirmemail",n,function(n){n.Success&&t(n.Result)},null)},n.prototype.resetPassword=function(n,t){this.http.post(this.rootUrl+"resetpassword",n,function(n){n.Success&&t(n.Result)},null)},n.prototype.getResetPasswordInfo=function(n,t){this.http.get(this.rootUrl+"getResetPasswordInfo/"+n,function(n){n.Success&&t(n.Result)},null)},n.prototype.getPreferredForgetPasswordCommunicationMethods=function(n){this.http.get(this.rootUrl+"preferredForgetPasswordCommunicationMethod",function(t){t.Success&&n(t.Result)},!1)},n.prototype.validationLogin=function(n){if(this.authService.isAuth()){var t=this;this.getUserInfo(function(i){i?(t.isUserLoggedIn=!0,t.getUser(function(r){t.setUserNameForGreeting(i,r);n(!0)})):(t.authService.removeToken(),n(!1))})}else n(!1)},n.prototype.setUserNameForGreeting=function(n,t){var i=this;t.IsCompany?i.userName=t.Company:t.IsContact&&(i.userName=n.FirstName?i.createFullNameFromUser(n):i.createFullNameFromUser(t))},n.prototype.listenToLoginStatusChange=function(n){this.eventService.on(i.eventNames.userInfo,n)},n.prototype.getDefaultUserName=function(n,t,i){var r="/Home/GetDefaultUserName";n!=null&&t!=null&&(r=r+"?tenantUrl="+n+"&culture="+t);this.http.get(r,function(n){n.Success&&i(n.Result)})},n.prototype.setUserState=function(n){this.isUserLoggedIn=n;this.eventService.boradcast(i.eventNames.userInfo,n)},n.prototype.sendUsername=function(n,t){this.http.post(this.rootUrl+"sendUsername",n,function(n){n.Success&&t(n.Result)},null)},n.prototype.saveGlobalEntityCertifications=function(n,t){this.http.post(this.rootUrl+"addGlobalEntityCertifications",n,function(n){n.Success&&t(n.Result)},!1)},n}();t.UserService=r})(i=t.Services||(t.Services={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var u=function(n){function t(t,i,r,u,f,e,o){var h=n.call(this,o)||this,s;return h.$routeParams=t,h.resourceService=r,h.userService=u,h.searchSubContactsService=f,h.$q=e,h.actionComplete=!1,s=h,s.resourceService.getSpecificKeyValues("SelfService.Energov.Resources.Contact.ContactResource",["DifferentLoginMessage","Warning"],function(n){s.differentLoginMessage=n.DifferentLoginMessage;s.warning=n.Warning}),s.userService.user?(s.loggedInGlobalEntityId=u.user.GlobalEntityId,s.processRequest()):u.getUser(function(n){n&&(s.loggedInGlobalEntityId=n.GlobalEntityId,s.processRequest())}),h}return __extends(t,n),Object.defineProperty(t.prototype,"subContactActions",{get:function(){return r},enumerable:!0,configurable:!0}),t.prototype.backToSubContacts=function(){this.$location.url("/contactManager?tab=subcontacts")},t.prototype.processRequest=function(){var n=this,t;t=n.setActionMessage();n.$q.all([t]).then(function(){if(n.parentContactId=n.$routeParams.parentContactId,n.loggedInGlobalEntityId!=n.parentContactId)n.utilities.showMessageOKButton(n.differentLoginMessage,n.warning,function(t){t&&(n.successMessage=n.differentLoginMessage,n.actionComplete=!1);n.$timeout(function(){n.$location.url("/home")},100)});else{n.action=n.$routeParams.action;n.subContactId=n.$routeParams.subContactId;switch(n.action){case r.Approve:n.searchSubContactsService.getSubContactRequest(n.parentContactId,n.subContactId,function(t){t.StatusId==i.Pending?n.searchSubContactsService.approveSubContactRequest(t,function(t){t&&(n.successMessage="Request from "+t.FirstName+" "+t.LastName+" as an associated contact has been approved.",n.actionComplete=!0)}):(n.setSuccessMessageForRepost(t.StatusId),n.actionComplete=!0)});break;case r.Deny:n.searchSubContactsService.getSubContactRequest(n.parentContactId,n.subContactId,function(t){t.StatusId==i.Pending?n.searchSubContactsService.denySubContactRequest(t,function(t){t&&(n.successMessage="Request from "+t.FirstName+" "+t.LastName+" as an associated contact has been denied.",n.actionComplete=!0)}):(n.setSuccessMessageForRepost(t.StatusId),n.actionComplete=!0)});break;default:n.action=""}}})},t.prototype.setSuccessMessageForRepost=function(n){var t=this;switch(n){case i.Approved:t.successMessage="This request has already been approved.";t.actionComplete=!0;break;case i.Rejected:t.successMessage="This request has already been denied.";t.actionComplete=!0;break;case i.Canceled:t.successMessage="This request has already been cancelled.";t.actionComplete=!0}},t.prototype.setActionMessage=function(){var i=this,t=this.$q.defer(),n=this;return n.action=n.$routeParams.action,n.subContactId=n.$routeParams.subContactId,n.searchSubContactsService.getSubContactById(n.subContactId,function(r){if(r!=null)return n.actionMessage=n.action===i.subContactActions.Approve?"Adding "+r.FirstName+" "+r.LastName+" as an associated contact.":"",t.resolve(),t.promise}),t.promise},t}(n.Core.Controllers.CoreController),r,i;t.AcceptRejectSubContactController=u,function(n){n.Approve="approve";n.Deny="deny"}(r=t.SubContactAction||(t.SubContactAction={})),function(n){n[n.Pending=0]="Pending";n[n.Approved=1]="Approved";n[n.Rejected=2]="Rejected";n[n.Canceled=3]="Canceled"}(i=t.SubContactRequestStatus||(t.SubContactRequestStatus={}))})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i){var r=n.call(this)||this;return r.userService=t,r.addressCardsService=i,r.userService.returnUserAddressUrl&&r.userService.returnUserAddressUrl!=""||r.$location.url("/manageMyUser?tab=addresses"),r}return __extends(t,n),t.prototype.backToUserAddresses=function(){this.$location.url(this.userService.returnUserAddressUrl)},t}(n.Core.Controllers.CoreController);t.AddressController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n){var t=this;n.BeginSSo(!0);n.signinCallback()}return n}();n.CallbackController=t})(t=n.Controllers||(n.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(t){function i(n,i,r,u,f){var e=t.call(this,n,i,r,f,null,!1)||this;return e.eventService=u,e.favoriteContactService=f,e.selectedContacts=[],e}return __extends(i,t),i.prototype.init=function(){var t=this;this.initializeSearchCritaria();this.search(this.searchCriteria,n.Events.SearchEvents.SearchCompleted);this.eventService.on("FavoriteContactsAdded",function(){t.search(t.searchCriteria,n.Events.SearchEvents.PageLoadCompleted);t.favoriteContactService.isSelectAll=!1})},i.prototype.selectAllOrNone=function(){var n=this;angular.forEach(this.searchResult,function(t){t.IsSelected=n.favoriteContactService.isSelectAll;n.changeSelectStatus(t,n.favoriteContactService.isSelectAll)})},i.prototype.changeSelectStatus=function(n,t){var r,i;if(t){for(i=0;i<this.selectedContacts.length;i++)if(this.selectedContacts[i].ContactNumber===n.ContactNumber)return;for(this.selectedContacts.push(n),r=!0,i=0;i<this.searchResult.length;i++)if(!this.searchResult[i].IsSelected){r=!1;break}r&&(this.favoriteContactService.isSelectAll=!0)}else{for(i=0;i<this.selectedContacts.length;i++)if(this.selectedContacts[i].ContactNumber===n.ContactNumber){this.selectedContacts.splice(i,1);break}this.favoriteContactService.isSelectAll=!1}this.updateCheckedValuesList(this.selectedContacts,"ContactNumber")},i.prototype.disableRemoveContactsButton=function(){return this.selectedContacts.length===0},i.prototype.removeContacts=function(){var t=this;this.favoriteContactService.removeContacts(this.selectedContacts,function(){t.search(t.searchCriteria,n.Events.SearchEvents.PageLoadCompleted);t.eventService.boradcast("FavoriteContactsRemoved")});this.selectedContacts=[];this.updateCheckedValuesList(this.selectedContacts,"ContactNumber");this.favoriteContactService.isSelectAll=!1},i.prototype.initializeSearchCritaria=function(){this.criteria={IsSortedInAscendingOrder:!0,PageNumber:1,PageSize:10,SortField:"ContactNumber"};this.searchCriteria=this.criteria},i}(n.Common.Controllers.PagedSearchController);t.FavoriteContactController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i){var r=n.call(this,i)||this,u,f;return r.userService=t,r.currentEmail="",u="",t!=null&&t.emailAddress!=null&&(u=t.emailAddress),f=r,f.model={EmailAddress:u,CurrentUrl:r.$location.absUrl()},r}return __extends(t,n),t.prototype.sendForgetPasswordResetCode=function(){this.currentEmail=this.model.EmailAddress;var n=this;this.userService.sendForgetPasswordResetCode(this.model,function(t){n.forgetPasswordResult=t})},t.prototype.goToElement=function(t){n.prototype.goToElement.call(this,t)},t.prototype.resetMessage=function(){this.forgetPasswordResult=null},t}(n.Core.Controllers.CoreController);t.ForgetPasswordController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i){var r=n.call(this,i)||this,u;return r.userService=t,r.isSubmit=!1,r.oldEmailAddress="",u=r,u.model={EmailAddress:t!=null&&t.emailAddress!=null?t.emailAddress:""},r}return __extends(t,n),t.prototype.sendUsername=function(){var n=this;n.userService.sendUsername(n.model,function(t){t!=null&&(n.forgotUsernameResult=t,n.oldEmailAddress=n.model.EmailAddress,n.isSubmit=!0)})},t.prototype.goToLogin=function(){this.userService.emailAddress=this.model.EmailAddress;this.$location.path("/");window.location.href=this.$location.absUrl()+"login"},t.prototype.resetMessage=function(){this.forgotUsernameResult=null},t}(n.Core.Controllers.CoreController);t.ForgotUsernameController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var r=n.Common.AccountTypeEnums.AccountType,u=function(t){function u(i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){var b=t.call(this,w)||this,k;b.$location=i;b.registerUserService=r;b.userService=u;b.globalService=f;b.$routeParams=e;b.tabNavigatorService=o;b.settingsService=s;b.enerGovSettingsService=h;b.certificationService=c;b.addressCardsService=l;b.$q=a;b.tenantSettingService=v;b.resourceService=y;b.enerGovMyEscrowAccountsService=p;b.selectedAddressType="";b.defaultlabellist={};b.allowMultipleAddresses=!1;b.isCompany=null;b.tabData=[];b.selected=0;b.isMyAccount=!1;b.isContactManager=!1;b.isSavedWork=!1;b.useSimpleUserAddress=!0;b.isCertificationEnabled=!1;b.changeContactPreference=function(){if(this.secondaryData&&this.secondaryData.PrefferredCommunicationMethods)for(var n=0;n<this.secondaryData.PrefferredCommunicationMethods.length;n++)if(this.model.PrefferedCommunicationMethod===this.secondaryData.PrefferredCommunicationMethods[n].PrefferedMethodName){this.model.PrefferedMethodId=this.secondaryData.PrefferredCommunicationMethods[n].PrefferedMethodId;break}};k=b;y.getSpecificKeyValues("SelfService.EnerGov.Resources.Common.CommonResource",["SelectType_Option"],function(n){k.defaultAddressTypeName=n.SelectType_Option});k.isMyAccount=k.$location.path().toLowerCase().indexOf("/managemyuser")>-1;k.isContactManager=k.$location.path().toLowerCase().indexOf("/contactmanager")>-1;k.isSavedWork=k.$location.path().toLowerCase().indexOf("/savedwork")>-1;k.defaultTab=k.isContactManager?n.Constants.TabConstants.MyFavorites:k.isSavedWork?n.Constants.TabConstants.MyTemplates:n.Constants.TabConstants.PersonalInfo;k.tabNavigatorService.cleanUp();k.registerUserService.fillDefaultLableValues();var d=!1,g=!1,nt=k.enerGovSettingsService.getUserSetting("ManageCertificatesOnline",function(n){d=n&&n.toLowerCase()==="true"}),tt=k.certificationService.getEnerGovIsLicenseIntegratedSetting(function(n){g=n});return k.$q.all([nt,tt]).then(function(){k.isCertificationEnabled=g&&d;k.setup();var n;n=k.SetTenantUserAddressSetting();k.$q.all([n]).then(function(){k.tabNavigatorService.getHideMyBusinessesTabSetting(function(){});k.isCompany&&k.tabNavigatorService.getShowSubContactsTabSetting(function(){})})}),b}return __extends(u,t),u.prototype.strToBool=function(n){return n==="True"?!1:n==="False"?!0:void 0},u.prototype.setAddress=function(){if(this.selectedAddress!=null){var n=this.getCountryTypeInfo(this.selectedAddress.country);this.countryType!=null&&n!=null&&this.countryType.CountryTypeId!==n.CountryTypeId&&(this.countryType=n);this.model.Address.City=this.selectedAddress.city;this.model.Address.AddressLine1=this.selectedAddress.streetNumber;this.model.Address.AddressLine2=this.selectedAddress.streetName;this.model.Address.City=this.selectedAddress.city;this.model.Address.State=this.selectedAddress.state;this.model.Address.Province=this.selectedAddress.province;this.model.Address.PostalCode=this.selectedAddress.postalCode;this.model.Address.Country=this.selectedAddress.country;this.model.Address.County=this.selectedAddress.county;this.model.Address.PreDirection=this.selectedAddress.preDirection;this.model.Address.PostDirection=this.selectedAddress.postDirection}},u.prototype.clearAddressField=function(){this.model.Address.City="";this.model.Address.County="";this.model.Address.AddressLine1="";this.model.Address.AddressLine2="";this.model.Address.AddressLine3="";this.model.Address.ATTN="";this.model.Address.State="";this.model.Address.Province="";this.model.Address.PostalCode="";this.model.Address.FullAddress="";this.model.Address.UnitOrSuite="";this.model.Address.PreDirection="";this.model.Address.PostDirection=""},u.prototype.getCountryTypeInfo=function(n){var t,r,i,u;if(this.secondaryData!=null&&this.secondaryData.CountryTypes!=null){for(t=0;t<this.secondaryData.CountryTypes.length;t++)if(r=this.secondaryData.CountryTypes[t],r.CountryTypeName===n)return r;for(i=0;i<this.secondaryData.CountryTypes.length;i++)if(u=this.secondaryData.CountryTypes[i],u.CountryTypeName==="International")return u}return null},u.prototype.save=function(){var n=this;this.model.Address&&this.model.Address.CountryType&&(this.model.Address.CountryType=this.countryType.CountryTypeId);this.model.ParentContacts=[];this.userService.saveMyUser(this.model,function(t){n.model=t;n.utilities.showMessage(n.utilities.getResourceMessage("ClientSiteResource_SaveHasBeenSuccessful","Save has been successful"),n.utilities.getResourceMessage("ClientSiteResource_Success","Success"))})},u.prototype.getSecondaryData=function(){var t=this,n=this;this.registerUserService.getSecondaryData(function(i){var r,u,f;n.secondaryData=i;n.setSelectedCountryType();n.secondaryData&&(n.registerUserService.setLableValue(n.secondaryData.AddressLayoutSetupList),n.defaultlabellist=n.registerUserService.defaultLabelList,n.secondaryData.UseSimpleUserAddress?(r=n.secondaryData.MailingAddressTypes.filter(function(t){return t.MailingAddressTypeId===n.secondaryData.SelfserviceDefaultMailingAddressTypeId}),r&&r.length>0&&(n.selectedAddressType=r[0].Name)):(u=n.secondaryData.MailingAddressTypes.filter(function(n){return n.IsDefault===!0}),u!=null&&u.length>0?n.selectedAddressType=u[0].Name:n.secondaryData.MailingAddressTypes.length>0&&(n.secondaryData.MailingAddressTypes=n.secondaryData.MailingAddressTypes.filter(function(n){return n.MailingAddressTypeId!="0"}),f={MailingAddressTypeId:"0",Name:t.defaultAddressTypeName,IsDefault:!0},n.secondaryData.MailingAddressTypes.unshift(f),n.selectedAddressType=n.secondaryData.MailingAddressTypes[0].Name)))})},u.prototype.SetTenantUserAddressSetting=function(){var t=this,n=this.$q.defer();return this.tenantSettingService.getTenantUserSetting("UseSimpleUserAddress",function(i){return i?(t.useSimpleUserAddress=i.toLowerCase()==="true",n.resolve(),n.promise):n.promise}),n.promise},u.prototype.getPrefferedCommunication=function(){var n=this;angular.forEach(this.secondaryData.PrefferredCommunicationMethods,function(t){t.PrefferedMethodId===n.prefferedCommunicationId&&(n.prefferedCommunicationMethod=t.PrefferedMethodName)})},u.prototype.getAllowMultipleAddressesSetting=function(){var n=this;this.settingsService.getTenantUserSetting("AllowMultipleAddresses",function(t){t&&(n.allowMultipleAddresses=t.toLowerCase()==="true")})},u.prototype.setSelectedCountryType=function(){if(this.secondaryData&&this.secondaryData.CountryTypes)for(var n=0;n<this.secondaryData.CountryTypes.length;n++)this.model&&this.model.Address&&this.secondaryData.CountryTypes[n].CountryTypeId===this.model.Address.CountryType&&(this.countryType=this.secondaryData.CountryTypes[n])},u.prototype.setFullAddress=function(){this.selectedAddress&&this.model&&this.model.Address&&(this.model.Address.FullAddress=this.addressCardsService.getFullAddress(this.model.Address))},u.prototype.getUserData=function(){var n=this,t=this;this.userService.getUser(function(i){t.model=i;t.setFullAddress();t.setSelectedCountryType();t.prefferedCommunicationId=t.model.PrefferedMethodId;t.model.PrefferedCommunicationMethod==""&&t.getPrefferedCommunication();n.isCompany=i.AccountType===r.Business.toString()||i.AccountType===r.Both.toString();n.tabNavigatorService.getShowSubContactsTabSetting(function(){n.enerGovMyEscrowAccountsService.showMyEscrowAccount(function(){n.createMyUserTabData();n.$routeParams.tab?n.setSelectedMdTab(n.$routeParams.tab):n.setSelectedMdTab(t.defaultTab)})})})},u.prototype.setup=function(){this.getAllowMultipleAddressesSetting();this.getSecondaryData();this.getUserData()},u.prototype.addAddressLocation=function(){if(this.selectedAddressType===this.defaultAddressTypeName){angular.element("#addressTypeSelect").addClass("border-dropdown");angular.element("#addressTypeSelect").removeAttr("aria-label");angular.element("#addressTypeSelect").attr("aria-label",this.defaultAddressTypeName.toString());angular.element("#addressTypeSelect").focus();return}this.upsertAddressLocation(i.Add,null)},u.prototype.editAddressLocation=function(n){this.upsertAddressLocation(i.Update,n)},u.prototype.upsertAddressLocation=function(n,t){var f=this,u,r;this.userService.returnUserAddressUrl=this.$location.url();this.userService.secondaryData=this.secondaryData;this.userService.currentAddress=t;this.userService.user=this.model;this.userService.isAddAction=n==i.Add;u=this.model.Addresses;n==i.Add?(r=this.secondaryData.MailingAddressTypes.filter(function(n){return n.Name==f.selectedAddressType}),this.userService.selectedAddressType=r[0],this.addressCardsService.setUserAddressFields(!0,t,u),this.$location.url("/manageMyUser/address/add")):(r=this.secondaryData.MailingAddressTypes.filter(function(n){return n.Name==t.AddressType}),this.userService.selectedAddressType=r[0],this.addressCardsService.setUserAddressFields(!1,t,u),this.$location.url("/manageMyUser/address/update"))},u.prototype.isSimpleUserAddress=function(t){var i=this;return t&&i.useSimpleUserAddress&&t.CountryType==n.Constants.UserAddressCountryType.US?!0:!1},u.prototype.createMyUserTabData=function(){var t=this;t.isContactManager?(t.tabData.push({Tab:n.Constants.TabConstants.MyFavorites,Label:"My Favorites"}),t.isCompany&&t.tabNavigatorService.showSubContactsTab&&t.tabData.push({Tab:n.Constants.TabConstants.SubContacts,Label:"Associates"}),t.tabNavigatorService.showSubContactsTab&&t.tabData.push({Tab:n.Constants.TabConstants.MyAssociations,Label:"My Associations"})):t.isSavedWork?(t.tabData.push({Tab:n.Constants.TabConstants.MyTemplates,Label:"My Templates"}),t.tabData.push({Tab:n.Constants.TabConstants.MyDrafts,Label:"My Drafts"})):(t.tabData.push({Tab:n.Constants.TabConstants.PersonalInfo,Label:"Personal Info"}),t.tabData.push({Tab:n.Constants.TabConstants.Addresses,Label:"Addresses"}),t.tabData.push({Tab:n.Constants.TabConstants.MyInvoices,Label:"My Invoices"}),t.tabNavigatorService.hideMyBusinessesTab||t.tabData.push({Tab:n.Constants.TabConstants.MyBusinesses,Label:"My Businesses"}),t.isCertificationEnabled&&t.tabData.push({Tab:n.Constants.TabConstants.MyCertificates,Label:"My Certificates"}),t.enerGovMyEscrowAccountsService.isEscrowAccountExist&&t.tabData.push({Tab:n.Constants.TabConstants.MyEscrowAccounts,Label:t.enerGovMyEscrowAccountsService.escrowAccountsSettingService.escrowAccountSettings.AccountTerminology}))},u.prototype.setSelectedMdTab=function(t){var i,r;this.selected=0;this.tabData&&this.tabData.length>0&&t?(i=this.tabData.filter(function(n){return n.Tab===t.toLocaleLowerCase()}),i.length>0?(this.selected=this.tabData.indexOf(i[0]),this.selectedTabName=i[0].Tab):(this.selectedTabName=this.tabData[0].Tab,t=this.defaultTab)):(this.selectedTabName=this.defaultTab,t=this.defaultTab);t===n.Constants.TabConstants.MyDrafts&&(r=this.$location.search(),this.tabNavigatorService.oldType=r.type);this.tabNavigatorService.navigateMdTab(t)},u.prototype.removeClass=function(){angular.element("#addressTypeSelect").removeClass("border-dropdown");this.secondaryData.MailingAddressTypes=this.secondaryData.MailingAddressTypes.filter(function(n){return n.MailingAddressTypeId!="0"})},u}(n.Core.Controllers.CoreController),i;t.ManageMyUserController=u,function(n){n[n.Add=1]="Add";n[n.Update=2]="Update"}(i||(i={}))})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i,r){var u=n.call(this)||this;return u.menuService=r,u.$routeParams.id!=null&&(u.menuId=+t.id),u}return __extends(t,n),t.prototype.Init=function(){var n=this;n.menuItem=n.menuService.getMenuById(n.menuId);n.url=n.menuItem.Link},t}(n.Core.Controllers.CoreController);t.MenuIframeController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=n.Constants.TabConstants,r=n.Common.CaseTypeEnums.BusinessLicenseTypeModule,u=function(n){function t(t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){var b=n.call(this,w)||this;return b.http=t,b.$scope=i,b.$q=r,b.$timeout=u,b.menuService=f,b.tabNavigatorService=e,b.globalService=o,b.userService=s,b.enerGovViewMyEntityCriteriaService=h,b.enerGovMyProjectService=c,b.enerGovMyOperationalPermitService=l,b.resourceService=a,b.enerGovSettingsService=v,b.settingsService=y,b.intentsService=p,b.menuTabIndex=0,b.noRecordsFound=!1,b.tabData=[],b.viewMenus=[],b.selected=0,b.selectedTabName="",b.myWorkTitle="",b.includeParentRecords=!1,b.isSubContact=!1,b.parentName="",b.useNewRequestInspections=!1,b.requestInspectionUri="",b.permitHasRecords=!1,b.planHasRecords=!1,b.licenseHasRecords=!1,b.remainInspectionHasRecords=!1,b.existingInspectionHasRecords=!1,b.requestHasRecords=!1,b.invoiceHasRecords=!1,b.projectHasRecords=!1,b.projectLabel="",b.operationalPermitsHasRecords=!1,b.operationalPermitsLabel="",b.isHideAllOperationalPermits=!1,b.enerGovSettingsService.getSoftwareSetting("energov","HideAllOperationalPermit",function(n){b.isHideAllOperationalPermits=n.SettingValue==="true"?!0:!1}),b}return __extends(t,n),t.prototype.updateLocalStorage=function(){localStorage["IncludeParentRecords_"+this.globalService.tenantId]=this.includeParentRecords},t.prototype.getProjectLabel=function(){var n=this,t=n.$q.defer();return n.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Dashboard.DashboardResource",["Dashboard_ViewMy_Projects"],function(i){n.projectLabel=i.Dashboard_ViewMy_Projects;t.resolve()}),t.promise},t.prototype.checkProjectHasRecords=function(n){var t=this,i=t.$q.defer();return t.enerGovMyProjectService.getProjectHasRecords(n,function(n){t.projectHasRecords=n;i.resolve()}),i.promise},t.prototype.getOperationalPermitLabel=function(){var n=this,t=n.$q.defer();return n.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Dashboard.DashboardResource",["Dashboard_ViewMy_OperationalPermits"],function(i){n.operationalPermitsLabel=i.Dashboard_ViewMy_OperationalPermits;t.resolve()}),t.promise},t.prototype.checkPermitHasRecords=function(n){var t=this,i=t.$q.defer(),r=t.isViewMenuVisible(EnerGov.Common.Constant.MyMenusConstants.MyPermitsLabel);if(r)t.enerGovViewMyEntityCriteriaService.getViewMyPermitsDetailCriteria(function(r){r.IncludeParentRecords=n;t.http.post("/energov/mypermits/search/permithasrecords",r,function(n){n.Success&&(t.permitHasRecords=n.Result,i.resolve())},!0)});else return t.permitHasRecords=!1,null;return i.promise},t.prototype.checkPlanHasRecords=function(n){var t=this,i=t.$q.defer(),r=t.isViewMenuVisible(EnerGov.Common.Constant.MyMenusConstants.MyPlansLabel);if(r)t.enerGovViewMyEntityCriteriaService.getViewMyPlansDetailCriteria(function(r){r.IncludeParentRecords=n;t.http.post("/energov/myplans/search/planhasrecords",r,function(n){n.Success&&(t.planHasRecords=n.Result,i.resolve())},!0)});else return t.planHasRecords=!1,null;return i.promise},t.prototype.isViewMenuVisible=function(n,t){t===void 0&&(t=null);var r=this,i=!1;return t=t?t:n,r.viewMenu.SubMenus.forEach(function(r){r.Details.toLowerCase().indexOf(n.toLowerCase())>-1&&r.SubMenus.forEach(function(n){n.Route.toLowerCase().indexOf(t.toLowerCase())>-1&&(i=!0)})}),i},t.prototype.checkOperationalPermitHasRecords=function(n){var t=this,i=t.$q.defer();return t.enerGovMyOperationalPermitService.getOperationalPermitDefaultCriteria(function(u){var f=u.Result,e;f.IncludeParentRecords=n;f.LicenseTypeModule=r.OperationalPermit;e="/energov/mylicenses/search/licensehasrecords";t.http.post(e,f,function(n){t.operationalPermitsHasRecords=n.Result;i.resolve()},!0)}),i.promise},t.prototype.checkLicenseHasRecords=function(n){var t=this,i=t.$q.defer(),r=t.isViewMenuVisible(EnerGov.Common.Constant.MyMenusConstants.MyLicensesLabel);if(r)t.enerGovViewMyEntityCriteriaService.getViewMyLicensesDetailCriteria(function(r){r.IncludeParentRecords=n;t.http.post("/energov/mylicenses/search/licensehasrecords",r,function(n){n.Success&&(t.licenseHasRecords=n.Result,i.resolve())},!0)});else return t.licenseHasRecords=!1,null;return i.promise},t.prototype.checkRemainingInspectionHasRecords=function(n){var t=this,i=t.$q.defer(),r=t.isViewMenuVisible(EnerGov.Common.Constant.MyMenusConstants.MyInspectionsLabel,EnerGov.Common.Constant.MyMenusConstants.MyRemainingInspectionsLabel);if(r)t.enerGovViewMyEntityCriteriaService.getViewMyRemainingInspectionsDetailCriteria(function(r){r.IncludeParentRecords=n;t.http.post("/energov/inspections/myremaininginspections/remaininspectionhasrecords",r,function(n){n.Success&&(t.remainInspectionHasRecords=n.Result,i.resolve())},!0)});else return t.remainInspectionHasRecords=!1,null;return i.promise},t.prototype.checkExistingInspectionHasRecords=function(n){var t=this,i=t.$q.defer(),r=t.isViewMenuVisible(EnerGov.Common.Constant.MyMenusConstants.MyInspectionsLabel,EnerGov.Common.Constant.MyMenusConstants.MyExistingInspectionsLabel);if(r)t.enerGovViewMyEntityCriteriaService.getViewMyExistingInspectionsDetailCriteria(function(r){r.IncludeParentRecords=n;t.http.post("/energov/dashboard/my/existinginspections/existinspectionhasrecords",r,function(n){n.Success&&(t.existingInspectionHasRecords=n.Result,i.resolve())},!0)});else return t.existingInspectionHasRecords=!1,null;return i.promise},t.prototype.checkRequestHasRecords=function(n){var t=this,i=t.$q.defer(),r=t.isViewMenuVisible(EnerGov.Common.Constant.MyMenusConstants.MyRequestsLabel);if(r)t.enerGovViewMyEntityCriteriaService.getViewMyRequestsDetailCriteria(function(r){r.IncludeParentRecords=n;t.http.post("/energov/myrequests/search/requesthasrecords",r,function(n){n.Success&&(t.requestHasRecords=n.Result,i.resolve())},!0)});else return t.requestHasRecords=!1,null;return i.promise},t.prototype.checkInvoiceHasRecords=function(n){var t=this,i=t.$q.defer(),r=t.isViewMenuVisible(EnerGov.Common.Constant.MyMenusConstants.MyInvoicesLabel);if(r)t.enerGovViewMyEntityCriteriaService.getViewMyUnpaidInvoicesDetailCriteria(function(r){r.IncludeParentRecords=n;t.http.post("/energov/invoice/invoicehasrecords",r,function(n){n.Success&&(t.invoiceHasRecords=n.Result,i.resolve())},!0)});else return t.invoiceHasRecords=!1,null;return i.promise},t.prototype.createMyWorkTabData=function(n){var t=this,r="";n&&n.SubMenus.forEach(function(n){if(n.SubMenus.length>0){var u=n.Details;angular.forEach(n.SubMenus,function(n){var f=!0;if(n.Label&&!(n.Label.toLowerCase().indexOf("today")>-1)){r=n.Label.replace(/ +/g,"");switch(!0){case n.Route.toLowerCase().indexOf(EnerGov.Common.Constant.MyMenusConstants.MyPermitsLabel)>-1:f=t.permitHasRecords;u=i.MyPermits;break;case n.Route.toLowerCase().indexOf(EnerGov.Common.Constant.MyMenusConstants.MyPlansLabel)>-1:f=t.planHasRecords;u=i.MyPlans;break;case n.Route.toLowerCase().indexOf(EnerGov.Common.Constant.MyMenusConstants.MyLicensesLabel)>-1:f=t.licenseHasRecords;u=i.MyLicenses;break;case n.Route.toLowerCase().indexOf(EnerGov.Common.Constant.MyMenusConstants.MyRemainingInspectionsLabel)>-1:f=t.remainInspectionHasRecords;u=i.MyRemainingInspections;break;case n.Route.toLowerCase().indexOf(EnerGov.Common.Constant.MyMenusConstants.MyRequestsLabel)>-1:f=t.requestHasRecords;u=i.MyRequests;break;case n.Route.toLowerCase().indexOf(EnerGov.Common.Constant.MyMenusConstants.MyInvoicesLabel)>-1:f=t.invoiceHasRecords;u=i.MyInvoices;break;case n.Route.toLowerCase().indexOf(EnerGov.Common.Constant.MyMenusConstants.MyInspectionsLabel)>-1:f=t.existingInspectionHasRecords;u=i.MyInspections;break;default:u=""}f&&(t.tabData.push({Label:n.Label,Module:u,Tab:r}),t.viewMenus.push(n))}})}});t.projectHasRecords&&t.tabData.push({Label:t.projectLabel,Module:i.Projects,Tab:i.Projects});t.operationalPermitsHasRecords&&!t.isHideAllOperationalPermits&&t.tabData.push({Label:t.operationalPermitsLabel,Module:i.OperationalPermits,Tab:i.OperationalPermits})},t.prototype.setSelectedTab=function(n,t){if(this.tabData&&this.tabData.length>0&&n){var r=this.tabData.filter(function(t){return t.Tab.toLowerCase()===n.toLowerCase()})[0];r?n===i.Projects?(this.selected=this.viewMenus.length,this.selectedTabName=i.Projects,this.tabNavigatorService.navigateMdTab(n)):n===i.OperationalPermits?(this.selected=this.viewMenus.length+1,this.selectedTabName=i.OperationalPermits,this.tabNavigatorService.navigateMdTab(n)):(this.selected=this.viewMenus.indexOf(this.viewMenus.filter(function(n){return n.Label.toLowerCase()===r.Label.toLowerCase()})[0]),this.selectedTabName=r.Module,t||this.tabNavigatorService.navigateMdTab(n)):(this.selected=0,this.selectedTabName=this.tabData[0].Module,this.tabNavigatorService.navigateMdTab(this.tabData[0].Tab))}},t.prototype.init=function(){var n=this;n.userService.getUser(function(t){n.isSubContact=t.IsSubContact.valueOf();n.parentName=t.ParentName;n.includeParentRecords=n.isSubContact&&localStorage["IncludeParentRecords_"+n.globalService.tenantId]||!1});n.viewMenu=n.menuService.getViewMenu();n.$scope.$watch("vm.includeParentRecords",function(t){n.settingsService.getSoftwarePackageSetting("UseUpdatedInspectionRequests",function(i){n.useNewRequestInspections=i&&i.SettingValue==="true";n.useNewRequestInspections&&n.intentsService.getIntent("View","RequestInspections","Default",function(t){n.requestInspectionUri=t.URI});var r=n.checkPermitHasRecords(t),u=n.checkPlanHasRecords(t),f=n.checkLicenseHasRecords(t),e=n.checkRemainingInspectionHasRecords(t),o=n.checkExistingInspectionHasRecords(t),s=n.checkRequestHasRecords(t),h=n.checkInvoiceHasRecords(t),c=n.checkProjectHasRecords(t),l=n.checkOperationalPermitHasRecords(t),a=n.getProjectLabel(),v=n.getOperationalPermitLabel();NProgress.start();n.globalService.showProcessingForDelayedApi=!0;n.$q.all([r,u,f,e,o,s,h,c,l,a,v]).then(function(){var t=n.menuService.getMyWorkMenu(),i;t?(n.tabNavigatorService.cleanUp(),n.tabData=[],n.viewMenus=[],n.createMyWorkTabData(n.viewMenu),n.myWorkTitle=t.Label,n.tabData&&n.tabData.length>0?(n.noRecordsFound=!1,n.$routeParams.tab?n.setSelectedTab(n.$routeParams.tab,!0):n.setSelectedTab(n.tabData[0].Tab)):n.noRecordsFound=!0,NProgress.done(),n.globalService.showProcessingForDelayedApi=!1,n.menuTabIndex=n.menuService.menuTabIndices.filter(function(n){return n.Key=="My Work"})[0].Value,i=document.getElementsByName("menu-"+n.menuTabIndex)[0],angular.element(i).focus()):n.$location.path("/dashboard").search({})})})})},t}(n.Core.Controllers.CoreController);t.MyWorkController=u})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=n.Common.AccountTypeEnums.AccountType,r=n.Common.Helpers.VersionSupport,u=n.Constants.PreferredCommunicationMethod,f=function(t){function f(n,f,e,o,s,h,c,l,a,v,y,p,w,b,k){var d=t.call(this,k)||this,g,nt,tt,ut,ft,et;d.registerUserService=n;d.userService=f;d.oidcService=e;d.tenantSettingService=o;d.settingsService=s;d.globalService=h;d.certificationService=c;d.enerGovSettingsService=l;d.tylerSignaturePadService=a;d.enerGovCustomFieldsService=v;d.customFieldsService=y;d.enerGovAddressService=p;d.$routeParams=w;d.$q=b;d.preferredCommunicationMethod=u;d.showAdditionalContactInfo=!1;d.signatureAgreement="";d.registerStepNumber=1;d.emailAddress="";d.previousEmailAddress="";d.shouldRemember=!1;d.isContinueClick=!1;d.showConfirmEmailMessage=!1;d.confirmEmailModel=null;d.enabledSendConfirmEmail=!0;d.invalidCaptcha=!1;d.agreeToTerm=!1;d.agreeToTermText="";d.isCaptchaVerified=!1;d.registerTotalSteps=d.globalService.tylerIdEnabled?3:4;d.isStepTwoVisible=!1;d.isCustomFieldStepVisible=!1;d.isCustomFieldSupported=!1;d.defaultlabellist={};d.defaultPlaceholderList={};d.isReadOnlyAddress=!1;d.disableExistingAddress=!1;d.existUsers=[];d.isUserProfileFieldsEditable=!1;d.readOnlyContactData={};d.selectedAddress={streetNumber:"",streetName:"",state:"",province:"",postalCode:"",country:"",city:"",county:"",postDirection:"",preDirection:""};d.existUser={IsEnergov:!1,IsSelfService:!1,FirstName:"",MiddleName:"",LastName:"",Email:"",Phone:"",Company:"",Address:null,ContactId:"",PrefferedCommunicationMethod:"",MobilePhone:"",BusinessPhone:"",OtherPhone:"",Fax:"",UserId:0,CustomFieldLayoutID:"",CustomLayout:null};d.userEmailAsyncValidation=!0;d.agreementId="";d.imageData="";d.entitySignatureMetaDataCriteria=null;d.globalEntityId="";d.entityMetaDataId="";d.emailInUse=!1;d.isCertificationEnabled=!1;d.addCertificationsStepperEnabled=!1;d.isInCloudApp=!1;g=d;g.isCustomFieldSupported=r(g.globalService.enerGovAPIVersion,"2021.1.1.35");g.defaultPlaceholderList=g.registerUserService.getDefaultPlaceholderValues();nt=g.$routeParams.confirmemailtoken;g.getIsInCloudApp();g.invalidCaptcha=!1;f!=null&&f.emailAddress!=null&&(tt=f.emailAddress,g.emailAddress=tt);g.tenantSettingService.getSignatureAgreement(0,function(n){n!=null&&(g.signatureAgreement=n.SignatureAgreementText)});g.registerUserService.fillDefaultLableValues();var it=!1,rt=!1,ot=g.enerGovSettingsService.getUserSetting("ManageCertificatesOnline",function(n){it=n&&n.toLowerCase()==="true"});return g.settingsService.getTenantUserSetting("ManageMyUserReadOnly",function(n){n&&(g.isUserProfileFieldsEditable=n.toLowerCase()==="true")}),ut=g.certificationService.getEnerGovIsLicenseIntegratedSetting(function(n){rt=n}),g.$q.all([ot,ut]).then(function(){g.isCertificationEnabled=rt&&it}),ft=g.globals.countryTypeId===1?0:g.globals.countryTypeId===3?1:g.globals.countryTypeId,g.isEnerGovApiAvailable=r(g.globalService.enerGovAPIVersion,"2019.0.3.0")?!0:!1,g.model={UserId:0,FirstName:g.globalService.tylerIdEnabled?g.userService.firstName:"",MiddleName:"",LastName:g.globalService.tylerIdEnabled?g.userService.lastName:"",Email:"",UserName:g.globalService.tylerIdEnabled?g.userService.tylerUsername:"",ConfirmEmail:"",Password:"",ConfirmPassword:"",Phone:"",Fax:"",BusinessPhone:"",MobilePhone:"",OtherPhone:"",Company:"",PrefferedMethodId:0,PrefferedCommunicationMethod:"",ContactId:"",IsActive:!0,Address:{MailingAddressID:"",CountryType:ft,AddressType:"",AddressSystemType:"",Main:!1,FullAddress:"",AddressLine1:"",AddressLine2:"",AddressLine3:"",City:"",State:"",County:"",Country:"",PostalCode:"",PreDirection:"",PostDirection:"",StreetType:"",UnitOrSuite:"",Province:"",POBox:"",CompSite:"",RuralRoute:"",Station:"",ATTN:"",GeneralDelivery:!1,IsNew:!0,IsDeleted:!1,AddressProtected:!1},Addresses:[],CaptchaResponse:"",IsNew:!0,IsDeleted:!1,ConfirmEmailToken:nt,OtherData:null,AccountType:i.Individual.toString(),TylerId:f.tylerId,EnerGovUserId:"",IsSignatureUploadPending:!1,Visited:!1,IsSubContact:!1,ParentName:"",ParentContacts:[],CustomFieldLayoutID:"",CustomLayout:null,Certifications:[]},g.confirmEmailModel={Email:g.emailAddress,CurrentUrl:g.$location.absUrl(),Token:nt},g.globalService.tylerIdEnabled?g.registerUserService.checkExistAccount(g.emailAddress,function(n){g.existUsers=n;n!=null&&n.length>1&&(g.registerTotalSteps=4,g.isStepTwoVisible=!0);g.setup()}):(et=g.getSecondaryData(),g.$q.resolve(et).then(function(){nt&&nt.length>0&&g.confirmEmail()})),g.tylerSignaturePadService&&g.tylerSignaturePadService.cleanUp(),g.setReadOnlyAddressSetting(),d}return __extends(f,t),f.prototype.forgetPassword=function(){this.userService.emailAddress=this.emailAddress;this.$location.url("/forgetPassword")},f.prototype.register=function(){var t=this;this.registerUserService.checkExistAccount(this.emailAddress,function(r){if(r!=null&&r.length>0&&r[0].IsSelfService&&r[0].IsEnergov)t.existUser=r[0],t.existUsers=r,t.goToStepTwo();else{if(t.secondaryData.RequireSignature&&(!t.tylerSignaturePadService.isSignatureAddded||!t.tylerSignaturePadService.imageData.consentName))return;t.countryType&&(t.secondaryData.UseSimpleUserAddress&&t.countryType.CountryTypeId==n.Constants.UserAddressCountryType.US&&(JSON.stringify(t.model.Address)!==JSON.stringify(t.simpleAddress)&&t.enerGovAddressService.setSimpleUserAddress(t.simpleAddress),t.model.Address=angular.copy(t.simpleAddress)),t.model.Address.CountryType=t.countryType.CountryTypeId,t.countryType.CountryTypeId==n.Constants.UserAddressCountryType.Canada&&(t.model.Address.Country=t.countryType.Name));t.model.AccountType=i.Individual.toString();t.model.PrefferedCommunicationMethod=t.secondaryData.PrefferredCommunicationMethods.filter(function(n){return n.PrefferedMethodId==t.model.PrefferedMethodId})[0].PrefferedMethodName;t.isCustomFieldSupported&&t.secondaryData.EnableCustomFields&&(t.model.CustomFieldLayoutID=t.model.CustomFieldLayoutID||t.secondaryData.CustomFieldLayoutID,t.model.CustomLayout=t.customFieldsService.customLayout);var u=t;t.secondaryData.GlobalSetting.DisableGoogleRecaptcha||u.isInCloudApp||u.globals.tylerIdEnabled||t.model.CaptchaResponse!=null&&t.model.CaptchaResponse.length>0?u.globals.tylerIdEnabled?t.registerUserService.tylerIdregister(t.model,function(n){return u.registrationTylerIdCallback(n)}):t.registerUserService.register(t.model,function(n){return u.registrationCallback(n)}):u.resetCaptcha()}})},f.prototype.collapseAddtionalContactInfoPanel=function(){this.showAdditionalContactInfo=!this.showAdditionalContactInfo},f.prototype.getRegisterStep=function(){return this.registerStepNumber},f.prototype.enableDisableAddCertificationsStepper=function(){this.addCertificationsStepperEnabled?this.registerTotalSteps+=1:this.registerTotalSteps-=1},f.prototype.registrationCallback=function(n){var r=this,t=this,i;t.resetCaptcha();n!=null?(t.model=n,i=!1,this.tenantSettingService.getTenantUserSetting("UserAutoRegistration",function(u){u==null&&t.goToThankYouPage();u.toLowerCase()==="true"&&(i=!0,t.loginAfterRegistration(n,function(){t.secondaryData.RequireSignature&&t.saveSignatureDetail(n,function(n){n?t.saveSignatureMetaData(t.model):t.saveSignatureMetaData(t.model,!1);r.$location.url("/home")})}));i||(t.secondaryData.RequireSignature&&t.saveSignatureMetaData(t.model,!1),t.goToThankYouReviewPage())})):(this.invalidCaptcha=!0,t.goToStepTwo())},f.prototype.loginAfterRegistration=function(n,t){var i=this,r=this,u={UserName:n.UserName,EmailAddress:n.Email,Password:n.Password,RememberMe:!1};this.userService.login(u,function(){i.userService.getUser(function(n){r.userService.userName=i.userService.createFullNameFromUser(n);t(n)})})},f.prototype.saveSignatureMetaData=function(t,i){var u=this,r;i===void 0&&(i=!0);this.agreementType=n.Common.CaseTypeEnums.AgreementType.Registration;r={AgreementId:this.agreementId,AgreementType:this.agreementType,Author:this.tylerSignaturePadService.imageData.consentName,Image:this.tylerSignaturePadService.imageData.imageBlob,MetaData:"",RecordId:t.ContactId,TenantId:this.globalService.tenantId,UserId:t.OtherData,IsFileUploaded:i};this.tenantSettingService.saveSignatureAgreementMetaData(r,function(n){u.entityMetaDataId=n})},f.prototype.registrationTylerIdCallback=function(n){var i=this,t=this;t.resetCaptcha();n!=null?(t.model=n,t.setSimpleAddressModel(),this.tenantSettingService.getTenantUserSetting("UserAutoRegistration",function(r){r.toLowerCase()==="true"?(i.secondaryData.RequireSignature&&t.saveSignatureDetail(n,function(n){n?i.saveSignatureMetaData(t.model):i.saveSignatureMetaData(t.model,!1)}),n&&(t.utilities.showPleaseWait(),i.userService.getUserByTylerId(function(n){if(n.Result){var i={TylerId:t.model.TylerId,UserName:t.model.UserName,EmailAddress:t.model.Email,Password:t.model.Password,RememberMe:!1};t.userService.getEnerGovUser(i,function(){t.utilities.hidePleaseWait();t.$location.path("/dashboard")})}}))):(t.secondaryData.RequireSignature&&t.saveSignatureMetaData(t.model,!1),t.userService.isUserPartialLoggedIn=!0,t.goToThankYouReviewPage())})):this.invalidCaptcha=!0},f.prototype.saveSignatureDetail=function(n,t){var i=this;this.tylerSignaturePadService.isSignatureAddded&&(i.tylerSignaturePadService.imageData.caseId=n.ContactId,i.tylerSignaturePadService.imageData.cssUserGuid=n.UserId.toString(),i.tylerSignaturePadService.imageData.agreementIdentifierGuid=i.agreementId,i.tylerSignaturePadService.imageData.subject=n.Company&&n.Company!==""?n.FirstName+" "+n.LastName+" ,"+n.Company:n.FirstName+" "+n.LastName,this.tylerSignaturePadService.setImageMetadata(this.tylerSignaturePadService.imageData,function(n){t(n)}))},f.prototype.sendConfirmEmail=function(){var n=this;this.enabledSendConfirmEmail&&(this.enabledSendConfirmEmail=!1,this.confirmEmailModel.Token&&this.confirmEmailModel.Token.length!=0?this.checkExistAccount():(n.confirmEmailModel.Email=n.emailAddress,this.userService.sendConfirmEmail(n.confirmEmailModel,function(t){n.confirmEmailResult=t;n.showConfirmEmailMessage=!0})))},f.prototype.confirmEmail=function(){var n=this;n.previousEmailAddress=n.emailAddress;this.userService.confirmEmail(n.confirmEmailModel,function(t){t.Success===!1?(n.confirmEmailResult=t,n.showConfirmEmailMessage=!0):(n.emailAddress=t.Email,n.checkExistAccount())})},f.prototype.goToElement=function(n){t.prototype.goToElement.call(this,n)},f.prototype.resetRegistration=function(){this.emailAddress&&this.previousEmailAddress.toLowerCase()!=this.emailAddress.toLowerCase()&&(this.confirmEmailModel.Token=null,this.enabledSendConfirmEmail=!0);this.showConfirmEmailMessage=!1},f.prototype.checkExistAccount=function(){$("#focusText").focus();var n=this;(this.isContinueClick=!1,this.previousEmailAddress!=this.emailAddress&&(this.clearModel(),this.shouldRemember=!1),this.previousEmailAddress=this.emailAddress,this.registerStepNumber!=3)&&(n.globalService.tylerIdEnabled?n.isContactExist()?n.existUsers.length>1?n.goToStepTwo():n.getExistUserAndGoToStepThreeFromContinue(n.existUsers[0]):n.goNextWithoutEnerGovAndCssInfo(!0):this.registerUserService.checkExistAccount(this.emailAddress,function(t){t!=null&&(n.existUser=t[0],n.existUsers=t,n.goToStepTwo())}))},f.prototype.isAccountExist=function(){return this.existUser!=null&&(this.existUser.IsEnergov||this.existUser.IsSelfService)?!0:!1},f.prototype.isContactExist=function(){return this.existUsers.length===0?!1:this.existUsers.some(function(n){return n.IsSelfService.valueOf()===!0||n.IsEnergov.valueOf()===!0})},f.prototype.goToStepOne=function(){$("#focusText").focus();this.existUser={IsEnergov:!1,IsSelfService:!1,FirstName:this.globalService.tylerIdEnabled?this.userService.firstName:"",MiddleName:"",LastName:this.globalService.tylerIdEnabled?this.userService.lastName:"",Email:"",Phone:"",Company:"",Address:null,ContactId:"",PrefferedCommunicationMethod:"",MobilePhone:"",BusinessPhone:"",Fax:"",OtherPhone:"",UserId:0,CustomFieldLayoutID:"",CustomLayout:null};this.registerStepNumber=1},f.prototype.goToStepTwo=function(){var n=this;$("#focusText").focus();this.registerStepNumber=2;n.isInCloudApp||n.secondaryData.GlobalSetting.DisableGoogleRecaptcha||setTimeout(function(){n.renderRecaptcha();n.invalidCaptcha&&($("#captchaError").removeClass("hidden"),$("#captchaError").focus())},500)},f.prototype.goBackFromCertifications=function(){var n=this;n.globalService.tylerIdEnabled?n.goToStepOne():n.goToStepTwo()},f.prototype.goNextFromStepTwo=function(){this.addCertificationsStepperEnabled?($("#focusText").focus(),this.registerStepNumber=22):this.goToStepThree()},f.prototype.goBackFromStepThree=function(){this.addCertificationsStepperEnabled?($("#focusText").focus(),this.registerStepNumber=22):this.goToStepTwo()},f.prototype.goToStepThree=function(){$("#focusText").focus();this.registerStepNumber=3;this.shouldRemember=!0},f.prototype.goToStepFour=function(n){if(n||this.registerStepNumber!=3)$("#focusText").focus(),this.registerStepNumber=4;else return},f.prototype.goToStepFive=function(n){if(n||this.registerStepNumber!=4)this.registerStepNumber!=4||this.isCustomFieldStepVisible?this.registerStepNumber!=6||this.isCustomFieldStepVisible?($("#focusText").focus(),this.registerStepNumber=5):this.goToStepFour(n):this.goToStepSix(n);else return},f.prototype.goToStepSix=function(n,t){if(n||this.registerStepNumber!=5)$("#focusText").focus(),this.registerStepNumber=6;else{t&&this.markFieldsAsDirty(t);return}},f.prototype.goNextWithoutEnerGovAndCssInfo=function(n){var t=this;if(n)this.globalService.tylerIdEnabled||this.secondaryData.GlobalSetting.DisableGoogleRecaptcha||this.isInCloudApp?(this.shouldRemember||(this.model.Email=this.emailAddress),this.model.ConfirmEmail="",this.goNextFromStepTwo()):this.verifyCaptcha(function(n){n?(t.shouldRemember||(t.model.Email=t.emailAddress),t.model.ConfirmEmail="",t.goNextFromStepTwo()):(t.resetCaptcha(),t.invalidCaptcha=!0,$("#captchaError").removeClass("hidden"),$("#captchaError").focus())});else return},f.prototype.goToThankYouPage=function(){this.$location.url("/thankyou")},f.prototype.goToThankYouReviewPage=function(){this.$location.url("/thankyoureview")},f.prototype.goToLogin=function(){this.userService.emailAddress=this.emailAddress;this.$location.url("/login")},f.prototype.clearModel=function(){this.model.FirstName=this.globalService.tylerIdEnabled?this.userService.firstName:"";this.model.LastName=this.globalService.tylerIdEnabled?this.userService.lastName:"";this.model.MiddleName="";this.model.Company="";this.model.Phone="";this.model.MobilePhone="";this.model.BusinessPhone="";this.model.OtherPhone="";this.model.Fax="";this.model.Email="";this.model.ConfirmEmail="";this.model.Password="";this.model.ConfirmPassword="";this.model.ContactId="";this.model.PrefferedCommunicationMethod="";this.model.PrefferedMethodId=null;this.model.Address.StreetType="";this.model.Address.UnitOrSuite="";this.model.Address.PreDirection="";this.model.Address.PostDirection="";this.model.Address.City="";this.model.Address.County="";this.model.Address.AddressLine1="";this.model.Address.AddressLine2="";this.model.Address.AddressLine3="";this.model.Address.ATTN="";this.model.Address.State="";this.model.Address.Province="";this.model.Address.PostalCode="";this.model.Address.FullAddress="";this.model.AccountType=i.Individual.toString();this.setSimpleAddressModel();this.model.CustomFieldLayoutID="";this.model.CustomLayout=null;this.model.Certifications=[]},f.prototype.goToStepThreeWithEnerGovAndCssInfo=function(){var n=this;this.registerUserService.getExistUserAccountInfo(this.emailAddress,function(t){t!=null&&(n.existUser=t,n.shouldRemember||n.initializeModelWithoutRemember(t),(n.existUser.IsSelfService||n.existUser.IsEnergov)&&n.model.Email==n.emailAddress&&(!n.shouldRemember||n.isContinueClick)&&(n.model.Email=""),n.isContinueClick=!1,n.goToStepThree())})},f.prototype.getExistUserAndGoToStepThreeFromContinue=function(n){var i=this,t=this;t.globalService.tylerIdEnabled||t.secondaryData.GlobalSetting.DisableGoogleRecaptcha||t.isInCloudApp?t.getExistUser(n):t.verifyCaptcha(function(r){r?t.getExistUser(n):(i.resetCaptcha(),i.invalidCaptcha=!0,$("#captchaError").removeClass("hidden"),$("#captchaError").focus())})},f.prototype.markFieldsAsDirty=function(n){n.fieldForm&&n.fieldForm.$$controls.length>0&&n.fieldForm.$$controls.forEach(function(n){n.$$attr.ariaRequired&&n.$$attr.ariaRequired==="true"&&(n.$setDirty(),n.$setTouched())})},f.prototype.getExistUser=function(n){var i=this,t=this;t.registerUserService.getExistUserAccountInfos(n.Email,n.ContactId,function(n){if(n!=null){t.existUser=n;t.existUser.Address.AddressProtected&&!t.secondaryData.UserAddressesEditable&&(t.disableExistingAddress=t.existUser.Address.AddressProtected.valueOf());t.isCustomFieldSupported&&t.secondaryData.EnableCustomFields&&t.existUser&&t.existUser.CustomLayout&&(t.customFieldsService.setLayout(t.existUser.CustomLayout,!1,!0),i.model.CustomFieldLayoutID=t.existUser.CustomFieldLayoutID,t.isCustomFieldStepVisible||(t.registerTotalSteps++,t.isCustomFieldStepVisible=!0));var r="",u=t.model.Password!=""&&t.model.Password===t.model.ConfirmPassword;u&&(r=t.model.Password);t.initializeModelWithoutRemember(n);t.existUser.IsEnergov&&(t.model.Email=t.model.Email!=t.emailAddress||t.shouldRemember||t.isContinueClick?t.emailAddress:"");t.model.UserId=t.existUser.UserId;u&&(t.model.Password=r,t.model.ConfirmPassword=r);t.isContinueClick=!0;t.setReadOnlyAddressSetting();t.isUserProfileFieldsEditable&&(t.readOnlyContactData.isReadOnlyFirstName=t.model.FirstName!=null&&t.model.FirstName!="",t.readOnlyContactData.isReadOnlyLastName=t.model.LastName!=null&&t.model.LastName!="",t.readOnlyContactData.isReadOnlyMiddleName=t.model.MiddleName!=null&&t.model.MiddleName!="",t.readOnlyContactData.isReadOnlyCompany=t.model.Company!=null&&t.model.Company!="",t.readOnlyContactData.isReadOnlyPrefferedMethod=t.model.PrefferedMethodId!=null,t.readOnlyContactData.isReadOnlyBusinessPhone=t.model.BusinessPhone!=null&&t.model.BusinessPhone!="",t.readOnlyContactData.isReadOnlyHomePhone=t.model.Phone!=null&&t.model.Phone!="",t.readOnlyContactData.isReadOnlyMobilePhone=t.model.MobilePhone!=null&&t.model.MobilePhone!="",t.readOnlyContactData.isReadOnlyFax=t.model.Fax!=null&&t.model.Fax!="",t.readOnlyContactData.isReadOnlyOtherPhone=t.model.OtherPhone!=null&&t.model.OtherPhone!="");t.goNextFromStepTwo()}else t.readOnlyContactData.isReadOnlyFirstName=!1,t.readOnlyContactData.isReadOnlyLastName=!1,t.readOnlyContactData.isReadOnlyMiddleName=!1,t.readOnlyContactData.isReadOnlyCompany=!1,t.readOnlyContactData.isReadOnlyPrefferedMethod=!1,t.readOnlyContactData.isReadOnlyBusinessPhone=!1,t.readOnlyContactData.isReadOnlyHomePhone=!1,t.readOnlyContactData.isReadOnlyMobilePhone=!1,t.readOnlyContactData.isReadOnlyFax=!1,t.readOnlyContactData.isReadOnlyOtherPhone=!1})},f.prototype.clearAddressField=function(){this.model.Address.CountryType=this.countryType.CountryTypeId;this.simpleAddress.CountryType=this.countryType.CountryTypeId},f.prototype.removeEmptyRecordFromState=function(){var n,t;this.secondaryData&&this.secondaryData.UseSimpleUserAddress&&this.secondaryData.States.some(function(n){return n.Name==""&&n.StateAbbreviationId==""})&&(n=this.secondaryData.States.filter(function(n){return n.Name==""&&n.StateAbbreviationId==""}),n&&n.length>0&&(t=this.secondaryData.States.indexOf(n[0]),this.secondaryData.States.splice(t,1)))},f.prototype.renderRecaptcha=function(){this.recaptchaWidget==null&&window.grecaptcha!=null&&(this.recaptchaWidget=window.grecaptcha.render("regRecaptcha",{sitekey:this.siteKey,callback:this.verifyCallback,theme:"light"}))},f.prototype.verifyCallback=function(n){var t=this;n!=null&&n.length>0&&($("#captchaError").addClass("hidden"),t.invalidCaptcha=!1)},f.prototype.initializeModelWithoutRemember=function(n){var t=this,i;this.model.AccountType=n.AccountType;this.model.FirstName=n.FirstName;this.model.LastName=n.LastName;this.model.MiddleName=n.MiddleName;this.model.Company=n.Company;this.model.Phone=n.Phone;this.model.ContactId=n.ContactId;this.model.PrefferedCommunicationMethod=n.PrefferedCommunicationMethod;this.model.PrefferedMethodId=this.model.PrefferedCommunicationMethod?this.secondaryData.PrefferredCommunicationMethods.filter(function(n){return n.PrefferedMethodName==t.model.PrefferedCommunicationMethod})[0].PrefferedMethodId:null;this.model.MobilePhone=n.MobilePhone;this.model.BusinessPhone=n.BusinessPhone;this.model.OtherPhone=n.OtherPhone;this.model.Fax=n.Fax;this.model.Address.StreetType=n.Address.StreetType;this.model.Address.UnitOrSuite=n.Address.UnitOrSuite;this.model.Address.PreDirection=n.Address.PreDirection;this.model.Address.PostDirection=n.Address.PostDirection;this.model.Address.City=n.Address.City;this.model.Address.County=n.Address.County;this.model.Address.AddressLine1=n.Address.AddressLine1;this.model.Address.AddressLine2=n.Address.AddressLine2;this.model.Address.AddressLine3=n.Address.AddressLine3;this.model.Address.ATTN=n.Address.ATTN;this.model.Address.State=n.Address.State;this.model.Address.Province=n.Address.Province;this.model.Address.PostalCode=n.Address.PostalCode;this.model.Address.Country=n.Address.Country;this.model.Address.AddressType=n.Address.AddressType?n.Address.AddressType:this.model.Address.AddressType;i=r(this.globalService.enerGovAPIVersion,"2021.2");i?n.Address.MailingAddressID?(this.countryType=this.secondaryData.CountryTypes.filter(function(t){return t.CountryTypeId==n.Address.CountryType})[0],this.model.Address.CountryType=n.Address.CountryType):this.model.Address.CountryType=this.countryType.CountryTypeId:this.model.Address.CountryType=n.Address.CountryType;this.model.Address.FullAddress="";this.model.Address.MailingAddressID=n.Address.MailingAddressID;this.setSimpleAddressModel();this.model.ConfirmEmail="";this.model.Password="";this.model.ConfirmPassword="";this.model.Certifications.length==0&&this.certificationService.getGlobalEntityCertificates(n.ContactId,function(n){t.model.Certifications=n})},f.prototype.setSimpleAddressModel=function(){this.secondaryData&&this.secondaryData.UseSimpleUserAddress&&this.model&&(this.model.Address.CountryType==n.Constants.UserAddressCountryType.US&&this.enerGovAddressService.setSimpleUserAddress(this.model.Address),this.simpleAddress=angular.copy(this.model.Address))},f.prototype.getUserFullName=function(){return this.existUser!=null&&(this.existUser.IsEnergov||this.existUser.IsSelfService)?this.createFullName(this.existUser):""},f.prototype.getExistUserFullName=function(n){return n!=null&&(n.IsEnergov||n.IsSelfService)?this.createFullName(n):""},f.prototype.createFullName=function(n){var t;return(n.FirstName.length>0||n.LastName.length>0)&&(t=n.MiddleName&&0!==n.MiddleName.length?n.FirstName+" "+n.MiddleName[0]+". "+n.LastName+" ":n.FirstName+" "+n.LastName+" "),t},f.prototype.setAddress=function(){if(this.selectedAddress!=null){var n=this.getCountryTypeInfo(this.selectedAddress.country);this.countryType!=null&&n!=null&&this.countryType.CountryTypeId!=n.CountryTypeId&&(this.countryType=n);this.model.Address.City=this.selectedAddress.city;this.model.Address.AddressLine1=this.selectedAddress.streetNumber;this.model.Address.AddressLine2=this.selectedAddress.streetName;this.model.Address.City=this.selectedAddress.city;this.model.Address.State=this.selectedAddress.state;this.model.Address.Province=this.selectedAddress.province;this.model.Address.PostalCode=this.selectedAddress.postalCode;this.model.Address.Country=this.selectedAddress.country;this.model.Address.County=this.selectedAddress.county;this.setSimpleAddressModel()}},f.prototype.getCountryTypeInfo=function(n){var t,r,i,u;if(this.secondaryData!=null&&this.secondaryData.CountryTypes!=null){for(t=0;t<this.secondaryData.CountryTypes.length;t++)if(r=this.secondaryData.CountryTypes[t],r.CountryTypeName==n)return r;for(i=0;i<this.secondaryData.CountryTypes.length;i++)if(u=this.secondaryData.CountryTypes[i],u.CountryTypeName=="International")return u}return null},f.prototype.resetCaptcha=function(){if(!this.secondaryData.GlobalSetting.DisableGoogleRecaptcha&&!this.isInCloudApp&&window.grecaptcha!=null)try{window.grecaptcha.reset()}catch(n){$("#captchaError").removeClass("hidden")}},f.prototype.verifyCaptcha=function(n){var t=this,i=window.grecaptcha.getResponse();if(this.isCaptchaVerified&&!this.invalidCaptcha&&i==this.model.CaptchaResponse)n(!0);else if(!this.secondaryData.GlobalSetting.DisableGoogleRecaptcha&&!this.isInCloudApp&&window.grecaptcha!=null)try{i!=null&&i.length>0?(this.model.CaptchaResponse=i,this.registerUserService.verifyGoogleCaptcha(this.model.CaptchaResponse,function(i){i?(t.invalidCaptcha=!1,$("#captchaError").addClass("hidden")):(t.resetCaptcha(),t.invalidCaptcha=!0,$("#captchaError").removeClass("hidden"),$("#captchaError").focus());t.isCaptchaVerified=!0;n(!t.invalidCaptcha)})):(this.model.CaptchaResponse="",this.invalidCaptcha=!0,this.isCaptchaVerified=!0,n(!1))}catch(r){$("#captchaError").removeClass("hidden");this.isCaptchaVerified=!0;n(!1)}},f.prototype.passwordStrength=function(){return this.getStrength(this.model.Password)},f.prototype.isPasswordWeak=function(){var n=this.passwordStrength();return n<40},f.prototype.isPasswordOk=function(){var n=this.passwordStrength();return n>=40&&n<=70},f.prototype.isPasswordStrong=function(){var n=this.passwordStrength();return n>70},f.prototype.passwordWord=function(){return this.isPasswordWeak()?"Weak":this.isPasswordOk()?"OK":"Strong"},f.prototype.getStrength=function(n){var t=0,r,i,u,f,e;if(!n)return t;for(r={},i=0;i<n.length;i++)r[n[i]]=(r[n[i]]||0)+1,t+=5/r[n[i]];u={digits:/\d/.test(n),lower:/[a-z]/.test(n),upper:/[A-Z]/.test(n),nonWords:/\W/.test(n)};f=0;for(e in u)f+=u[e]==!0?1:0;return t+=(f-1)*10,t>100&&(t=100),t},f.prototype.showPasswordIndicator=function(){return this.model!=null&&this.model.Password!=null&&this.model.Password.length>0?!0:!1},f.prototype.getSecondaryData=function(){var i=this,n=this,t=n.$q.defer();return this.registerUserService.getSecondaryData(function(r){var e,u,o,f;if(n.secondaryData=r,n.agreeToTerm=!n.secondaryData.RequireAcknowledgement,n.agreeToTermText=n.secondaryData.RequireAcknowledgementText,e={PrefferedMethodId:null,PrefferedMethodName:"--Select Contact Preference--"},n.secondaryData.PrefferredCommunicationMethods.unshift(e),n.secondaryData.RequireSignature&&n.registerTotalSteps++,r&&r.CountryTypes)for(u=0;u<r.CountryTypes.length;u++)r.CountryTypes[u].CountryTypeId==n.model.Address.CountryType&&(n.countryType=r.CountryTypes[u]);n.model.Address.CountryType=n.countryType.CountryTypeId;n.secondaryData==null||n.secondaryData.GlobalSetting==null||n.secondaryData.GlobalSetting.DisableGoogleRecaptcha||n.isInCloudApp||(n.siteKey=n.secondaryData.GlobalSetting.GoogleRecaptchaSiteKey);n.removeEmptyRecordFromState();n.model.PrefferedMethodId=r.PrefferredCommunicationMethods[0].PrefferedMethodId;n.model.PrefferedCommunicationMethod=r.PrefferredCommunicationMethods[0].PrefferedMethodName;n.secondaryData.UseSimpleUserAddress&&n.secondaryData.SelfserviceDefaultMailingAddressTypeId&&n.secondaryData.MailingAddressTypes.filter(function(n){return n.MailingAddressTypeId===r.SelfserviceDefaultMailingAddressTypeId}).length>0?n.model.Address.AddressType=n.secondaryData.MailingAddressTypes.filter(function(n){return n.MailingAddressTypeId===r.SelfserviceDefaultMailingAddressTypeId})[0].Name:(o=r.MailingAddressTypes.filter(function(n){return n.IsDefault==!0}).length>0,f=undefined,o&&(f=r.MailingAddressTypes.filter(function(n){return n.IsDefault==!0})[0].Name),n.model.Address.AddressType=f!=undefined?f:r.MailingAddressTypes[0].Name);n.setSimpleAddressModel();n.secondaryData&&(n.registerUserService.setLableValue(n.secondaryData.AddressLayoutSetupList),n.defaultlabellist=n.registerUserService.defaultLabelList,n.secondaryData.RequireSignature&&n.tenantSettingService.getAgreementIdForRegistration(n.globalService.tenantId,function(t){n.agreementId=t}));n.isCustomFieldSupported&&n.secondaryData.EnableCustomFields&&n.secondaryData.CustomFieldLayoutID&&(n.isCustomFieldStepVisible=!0,n.registerTotalSteps++,i.model.CustomFieldLayoutID=n.secondaryData.CustomFieldLayoutID,n.enerGovCustomFieldsService.getCustomLayout(n.secondaryData.CustomFieldLayoutID,n.secondaryData.CustomFieldLayoutID,function(t){n.customFieldsService.setLayout(t,!0)}));n.globalService.tylerIdEnabled&&n.existUsers.length>1&&n.registerTotalSteps--;t.resolve()}),t.promise},f.prototype.setup=function(){this.getSecondaryData()},f.prototype.getAddressLine1Label=function(){return this.secondaryData&&this.secondaryData.UseSimpleUserAddress?this.defaultlabellist.simpleaddressline1.value:this.defaultlabellist.addressline1.value},f.prototype.getPlaceholder=function(n){return this.secondaryData&&this.secondaryData.UseSimpleUserAddress?this.defaultPlaceholderList[n]:" "},f.prototype.setReadOnlyAddressSetting=function(){var n=this;n.model&&n.model.Address&&n.model.Address.AddressLine1&&n.secondaryData&&(n.isReadOnlyAddress=!n.secondaryData.UserAddressesEditable)},f.prototype.fillCertificate=function(n){this.model.Certifications.push(n)},f.prototype.removeCertification=function(n){var t=this,i=t.model.Certifications.filter(function(t){return t.CertificationTypeId==n.CertificationTypeId}).length;t.model.Certifications.splice(t.model.Certifications.indexOf(n),1)},f.prototype.getIsInCloudApp=function(){var n=this;this.settingsService.getIsInCloudApp(function(t){n.isInCloudApp=t})},f}(n.Core.Controllers.CoreController);t.RegisterUserController=f})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i,r){var u=n.call(this,r)||this,f;return u.$routeParams=t,u.userService=i,u.userId=t.id,u.resetPasswordToken=t.token,f=u,u.getResetPasswordInfo(),u}return __extends(t,n),t.prototype.resetPassword=function(){var n=this;this.userService.resetPassword(this.model,function(t){n.resetPasswordResult=t;n.goToElement("resetPasswordMessage")})},t.prototype.goToLogin=function(){this.userService.emailAddress=this.model.Email;this.$location.url("/login")},t.prototype.getResetPasswordInfo=function(){var t=this,n=this;this.userService.getResetPasswordInfo(n.userId,function(i){n.model=i;n.model.Token=t.resetPasswordToken})},t.prototype.goToElement=function(t){n.prototype.goToElement.call(this,t)},t}(n.Core.Controllers.CoreController);t.ResetPasswordController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(t){function i(n,i,r,u,f){var e=t.call(this,n,i,r,f,null,!1)||this;return e.eventService=u,e.searchContactsService=f,e.selectedContacts=[],e}return __extends(i,t),i.prototype.init=function(){var t=this;this.initializeSearchCriteria();this.searchEvent=n.Events.SearchEvents.PageLoadCompleted;this.eventService.on("FavoriteContactsRemoved",function(){t.searchResult&&t.searchResult.length>0&&t.search(t.searchCriteria,n.Events.SearchEvents.PageLoadCompleted)})},i.prototype.searchContacts=function(){this.syncCriteria();this.search(this.searchCriteria,n.Events.SearchEvents.SearchCompleted)},i.prototype.hasResult=function(){var n=this;return n.searchResult&&n.searchResult.length>0},i.prototype.selectAllOrNone=function(){var n=this;angular.forEach(this.searchResult,function(t){t.IsExcluded||(t.IsSelected=n.searchContactsService.isSelectAll,n.changeSelectStatus(t,n.searchContactsService.isSelectAll))})},i.prototype.changeSelectStatus=function(n,t){var r,i;if(t){for(i=0;i<this.selectedContacts.length;i++)if(this.selectedContacts[i].ContactNumber===n.ContactNumber)return;for(this.selectedContacts.push(n),r=!0,i=0;i<this.searchResult.length;i++)if(!this.searchResult[i].IsExcluded&&!this.searchResult[i].IsSelected){r=!1;break}r&&(this.searchContactsService.isSelectAll=!0)}else{for(i=0;i<this.selectedContacts.length;i++)if(this.selectedContacts[i].ContactNumber===n.ContactNumber){this.selectedContacts.splice(i,1);break}this.searchContactsService.isSelectAll=!1}this.updateCheckedValuesList(this.selectedContacts,"ContactNumber")},i.prototype.disableAddContactsButton=function(){return this.selectedContacts.length===0},i.prototype.addContacts=function(){var t=this;this.searchContactsService.addContacts(this.selectedContacts,function(){t.search(t.searchCriteria,n.Events.SearchEvents.PageLoadCompleted);t.eventService.boradcast("FavoriteContactsAdded")});this.selectedContacts=[];this.updateCheckedValuesList(this.selectedContacts,"ContactNumber");this.searchContactsService.isSelectAll=!1},i.prototype.syncCriteria=function(){this.criteria.PageSize=this.searchCriteria.PageSize;this.criteria.PageNumber=this.searchCriteria.PageNumber;this.searchCriteria=angular.copy(this.criteria)},i.prototype.initializeSearchCriteria=function(){this.criteria={IsSortedInAscendingOrder:!0,PageNumber:1,PageSize:10,SortField:"",Keyword:"",ExactMatch:!1};this.searchCriteria=this.criteria},i}(n.Common.Controllers.PagedSearchController);t.SearchContactController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(t){function i(n,i,r,u,f,e){var o=t.call(this,n,r,u,e,null,!1)||this,s;return o.$scope=i,o.eventService=f,o.searchSubContactsService=e,o.loggedInGlobalEntityId="",o.addingContactNumber="",s=i.$parent,o.parent=s.vm,o.loggedInGlobalEntityId=o.parent.model.GlobalEntityId,o}return __extends(i,t),i.prototype.init=function(){var t=this;t.loggedInGlobalEntityId=t.parent.model.GlobalEntityId;t.initializeSearchCriteria();t.searchEvent=n.Events.SearchEvents.PageLoadCompleted;this.eventService.on("SubContactRemoved",function(){t.searchResult&&t.searchResult.length>0&&t.search(t.searchCriteria,n.Events.SearchEvents.SearchCompleted)})},i.prototype.searchContacts=function(){this.syncCriteria();this.search(this.searchCriteria,n.Events.SearchEvents.SearchCompleted)},i.prototype.hasResult=function(){var n=this;return n.searchResult&&n.searchResult.length>0},i.prototype.addSubContact=function(t){var i=this;this.addingContactNumber=t.ContactNumber;this.subContactAddRemoveDto={GlobalEntityId:this.loggedInGlobalEntityId,SubContact:t};this.searchSubContactsService.addSubContact(this.subContactAddRemoveDto,function(){i.addingContactNumber="";i.search(i.searchCriteria,n.Events.SearchEvents.SearchCompleted);i.eventService.boradcast("SubContactAdded")})},i.prototype.syncCriteria=function(){this.criteria.PageSize=this.searchCriteria.PageSize;this.criteria.PageNumber=this.searchCriteria.PageNumber;this.criteria.GlobalEntityId=this.loggedInGlobalEntityId;this.searchCriteria=angular.copy(this.criteria)},i.prototype.initializeSearchCriteria=function(){this.criteria={IsSortedInAscendingOrder:!0,PageNumber:1,PageSize:10,SortField:"",Keyword:"",ExactMatch:!1,GlobalEntityId:this.loggedInGlobalEntityId};this.searchCriteria=this.criteria},i}(n.Common.Controllers.PagedSearchController);t.SearchSubContactsController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i,r,u,f,e){var o=n.call(this)||this,s,h;return o.oidcService=t,o.locationService=i,o.userService=r,o.settingService=u,o.resourceService=f,o.$q=e,o.showPopup=!1,o.okLevelText="",s=o,h=s.getResourceValue(),o.$q.all([h]).then(function(){u.getTylerIdSettings(function(n){s.tylerIdSettings=n;n.ShowTransitionMessage&&!localStorage.IsTransectionMessageShown?s.showPopup=!0:s.init()})}),o}return __extends(t,n),t.prototype.getResourceValue=function(){var n=this.$q.defer(),t=this;return t.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Common.CommonResource",["TylerTransitionContinueText"],function(i){return t.okLevelText=i.TylerTransitionContinueText,n.resolve(),n.promise}),n.promise},t.prototype.init=function(){var n=this;n.tylerIdSettings.ShowTransitionMessage&&!localStorage.IsTransectionMessageShown&&(localStorage.IsTransectionMessageShown=!0);n.userService.isUserLoggedIn?this.handleRedirection():n.oidcService.BeginSSo()},t.prototype.cancel=function(){window.location.href=this.userService.userReffererUrlTylerId},t.prototype.handleRedirection=function(){var n=this;n.locationService.attemptUrl!==""?n.locationService.returnBack():n.$location.search().redirectUrl?(n.locationService.attemptUrl=n.$location.search().redirectUrl,n.locationService.withUrl=!0):n.$location.path("/")},t}(n.Core.Controllers.CoreController);t.SSOController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(t){function i(n,i,r,u,f,e,o){var s=t.call(this,n,r,u,o,null,!1)||this,h;return s.$scope=i,s.eventService=f,s.userService=e,s.subContactsService=o,s.loggedInGlobalEntityId="",s.removingContactNumber="",s.acceptingContactNumber="",s.rejectingContactNumber="",h=i.$parent,s.parent=h.vm,s.loggedInGlobalEntityId=s.parent.model.GlobalEntityId,s.userService.returnSubContactsUrl=s.$location.url(),s}return __extends(i,t),i.prototype.init=function(){var t=this;this.loggedInGlobalEntityId=this.parent.model.GlobalEntityId;this.initializeSearchCritaria();this.search(this.searchCriteria,n.Events.SearchEvents.SearchCompleted);this.eventService.on("SubContactAdded",function(){t.search(t.searchCriteria,n.Events.SearchEvents.PageLoadCompleted)})},i.prototype.removeSubContact=function(t){var i=this;this.removingContactNumber=t.ContactNumber;this.subContactAddRemoveDto={GlobalEntityId:this.loggedInGlobalEntityId,SubContact:t};this.subContactsService.removeSubContact(this.subContactAddRemoveDto,function(){i.removingContactNumber="";i.search(i.searchCriteria,n.Events.SearchEvents.PageLoadCompleted);i.eventService.boradcast("SubContactRemoved")})},i.prototype.acceptSubContact=function(n){this.$location.url("/manageMyUser/subcontact/approve/"+this.loggedInGlobalEntityId+"/"+n.EntityId)},i.prototype.rejectSubContact=function(n){this.$location.url("/manageMyUser/subcontact/deny/"+this.loggedInGlobalEntityId+"/"+n.EntityId)},i.prototype.initializeSearchCritaria=function(){this.criteria={IsSortedInAscendingOrder:!0,PageNumber:1,PageSize:10,SortField:"ContactNumber",GlobalEntityId:this.loggedInGlobalEntityId};this.searchCriteria=this.criteria},i}(n.Common.Controllers.PagedSearchController);t.SubContactsController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(){var t=n.call(this)||this,i=t;return t}return __extends(t,n),t.prototype.goToHome=function(){this.$location.url("/home")},t.prototype.goToLogin=function(){this.$location.path("/");window.location.href=this.$location.absUrl()+"login"},t}(n.Core.Controllers.CoreController);t.ThankYouController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t,i,r,u,f){var e=n.call(this,f)||this,s,o;return e.userService=t,e.cartService=i,e.locationService=r,e.resourceService=u,s="",t!=null&&t.emailAddress!=null,o=e,o.model={UserName:"",EmailAddress:s,Password:"",RememberMe:(!0).valueOf()},o.tenantName=e.globals.tenantName,o.tenantId=e.globals.tenantId,o.tenantUrl=e.globals.tenantUrl,e}return __extends(t,n),t.prototype.login=function(){var n=this,t=this;this.loginResult=null;this.userService.login(this.model,function(i){if(i.ValidationErrorMessage){if(i.ValidationErrorMessage){var r="";n.resourceService.getSpecificKeyValues("SelfService.Resources.SelfService",["UserAccountPendingApproval"],function(t){r=t.UserAccountPendingApproval;r&&r===i.ValidationErrorMessage&&n.$location.url("/pendingapproval")})}}else i.Result.IsSignatureUploadPending&&n.userService.getUserSignatureAndSave(i.Result.UserName,function(){}),n.userService.getUser(function(t){n.userService.setUserNameForGreeting(i.Result,t)}),t.loginResult=i,t.locationService.handleRedirection(),t.cartService.updateTotalNumOfItems()})},t.prototype.register=function(){this.userService.emailAddress=this.model.EmailAddress;this.$location.url("/register")},t.prototype.isFailedLogin=function(){return this.loginResult!=null&&this.loginResult.ErrorMessage!=null&&this.loginResult.ErrorMessage.length>0?!0:!1},t.prototype.forgetPassword=function(){this.userService.emailAddress=this.model.EmailAddress;this.$location.url("/forgetPassword")},t.prototype.forgotUsername=function(){this.userService.emailAddress=this.model.EmailAddress;this.$location.url("/forgotUsername")},t.prototype.changeTenant=function(){window.location.href=this.globals.baseUrl},t}(n.Core.Controllers.CoreController);t.UserController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Users||(n.Users={}))}(app||(app={})),function(n){var t;(function(){"use strict";var t=n.Users.Controllers.RegisterUserController,i=n.Users.Controllers.UserController,r=n.Users.Controllers.ForgetPasswordController,u=n.Users.Controllers.ForgotUsernameController,f=n.Users.Controllers.ResetPasswordController,e=n.Users.Controllers.ManageMyUserController,o=n.Users.Controllers.AddressController,s=n.Users.Controllers.ThankYouController,h=n.Users.Controllers.MenuIframeController,c=n.Users.Controllers.MyWorkController;angular.module("app.Users",["app.Services.Utilities","app.Common.Services","app.Common.Services.Auth","app.Common.Services.TenantSettingsService","app.globalsModule","enerGov.Address","enerGov.Common","app.Certification"]).service("userService",["http","authService","eventService","globalsService","$location","$q",n.Users.Services.UserService]).service("OidcService",["userService","$location","globalsService","resourceService","utilities","cartService",n.Users.Services.OidcService]).service("registerUserService",["http","authService","utilities",n.Users.Services.RegisterUserService]).service("favoriteContactService",["http",n.Users.Services.FavoriteContactService]).service("subContactsService",["http",n.Users.Services.SubContactsService]).service("searchContactService",["http",n.Users.Services.SearchContactsService]).service("searchSubContactsService",["http",n.Users.Services.SearchSubContactsService]).controller("userController",["userService","cartService","locationService","resourceService",i]).controller("forgetPasswordController",["userService",r]).controller("forgotUsernameController",["userService",u]).controller("resetPasswordController",["$routeParams","userService",f]).controller("registerUserController",["registerUserService","userService","OidcService","tenantSettingService","settingsService","globalsService","certificationService","enerGovSettingsService","tylerSignaturePadService","enerGovCustomFieldsService","customFieldsService","enerGovAddressService","$routeParams","$q",t]).controller("manageMyUserController",["$location","registerUserService","userService","globalsService","$routeParams","tabNavigatorService","settingsService","enerGovSettingsService","certificationService","enerGovAddressCardsService","$q","tenantSettingService","resourceService","enerGovMyEscrowAccountsService",e]).controller("myWorkController",["http","$scope","$q","$timeout","menuService","tabNavigatorService","globalsService","userService","enerGovViewMyEntityCriteriaService","enerGovMyProjectService","enerGovMyOperationalPermitService","resourceService","enerGovSettingsService","settingsService","intentsService",c]).controller("addressController",["userService","enerGovAddressCardsService",o]).controller("thankYouController",[s]).controller("menuIframeController",["$routeParams","$sce","menuService",h]).controller("favoriteContactController",["$routeParams","$location","globalsService","eventService","favoriteContactService",n.Users.Controllers.FavoriteContactController]).controller("subContactsController",["$routeParams","$scope","$location","globalsService","eventService","userService","subContactsService",n.Users.Controllers.SubContactsController]).controller("acceptRejectSubContactController",["$routeParams","$location","resourceService","userService","searchSubContactsService","$q",n.Users.Controllers.AcceptRejectSubContactController]).controller("searchContactController",["$routeParams","$location","globalsService","eventService","searchContactService",n.Users.Controllers.SearchContactController]).controller("searchSubContactsController",["$routeParams","$scope","$location","globalsService","eventService","searchSubContactsService",n.Users.Controllers.SearchSubContactsController]).controller("SSOController",["OidcService","locationService","userService","settingsService","resourceService","$q",n.Users.Controllers.SSOController]).controller("callbackController",["OidcService",n.Users.Controllers.CallbackController])})(t=n.Users||(n.Users={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n){this.http=n;this.rootUrl="/AssociatedContacts/"}return n.prototype.searchByCriteria=function(n,t){n!==null&&this.http.post(this.rootUrl+"SearchContacts/",n,function(n){n.Success&&t(n)},!0)},n}();n.AssociatedContactSearchService=t})(t=n.Services||(n.Services={}))})(t=n.AssociatedContacts||(n.AssociatedContacts={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n,t,i,r){this.http=n;this.globalService=t;this.$location=i;this.resourceService=r;this.rootUrl="/AssociatedContacts/";var u=this;u.resourceService.getSpecificKeyValues("SelfService.EnerGov.Resources.Contact.ContactResource",["ApproveButtonLabel","DenyButtonLabel"],function(n){u.resourceModel=n})}return n.prototype.searchByCriteria=function(n,t){n!==null&&this.http.post(this.rootUrl,n,function(n){n.Success&&t(n)},!0)},n.prototype.getPendingContactRequests=function(n){this.http.get(this.rootUrl+"pending",function(t){t.Success&&n(t.Result)},!0)},n.prototype.requestCreateSubContact=function(n,t){this.http.post(this.rootUrl+"request",n,function(n){n.Success&&t(n.Result)},!0)},n.prototype.requestCancelSubContact=function(n,t){this.http.post(this.rootUrl+"cancel",n,function(n){n.Success&&t(!0)},!1)},n.prototype.requestUpdateSubContact=function(n,t){this.http.put(this.rootUrl+"request",n,function(n){n.Success&&t(n.Result)},!0)},n.prototype.removeParentContact=function(n,t,i){this.http.post(this.rootUrl+"Remove/"+n+"/"+t,null,function(n){n.Success&&i(n.Result)},!0)},n.prototype.formatEmailBody=function(n,t,i){var r=this;return n+'<br /> <br /><a style="background-color: #5cb85c;border: none;color: white;padding: 12px;text-align: center;text-decoration: none;display: inline-block;cursor: pointer;" target="_blank" href = "'+r.createApproveDenyUrlForSubContact(!0,t,i)+'/">'+r.resourceModel.ApproveButtonLabel+'<\/a>&nbsp;<a style="background-color: #d9534f;border: none;color: white;padding: 12px;text-align: center;text-decoration: none;display: inline-block;cursor: pointer;" target="_blank" href = "'+r.createApproveDenyUrlForSubContact(!1,t,i)+'/">'+r.resourceModel.DenyButtonLabel+"<\/a>"},n.prototype.createApproveDenyUrlForSubContact=function(n,t,i){var r=this;return n?r.$location.absUrl().split("#")[0]+"#/manageMyUser/subcontact/approve/"+t+"/"+i:r.$location.absUrl().split("#")[0]+"#/manageMyUser/subcontact/deny/"+t+"/"+i},n}();n.AssociatedContactsService=t})(t=n.Services||(n.Services={}))})(t=n.AssociatedContacts||(n.AssociatedContacts={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(t){function i(n,i,r,u,f,e,o,s){var h=t.call(this,n,r,u,e,null,!1)||this,c;return h.$scope=i,h.eventService=f,h.associatedContactsService=e,h.userService=o,h.subContactsService=s,h.openRequestModalPopup=!1,h.showSpinner=!1,h.loggedInGlobalEntityId="",h.removingContactNumber="",h.isSelectedContactEmailExist=!1,c=i.$parent,h.parent=c.vm,h.loggedInGlobalEntityId=h.parent.model.GlobalEntityId,h.userData=h.parent.model,h}return __extends(i,t),i.prototype.init=function(){var t=this;t.initializeSearchCriteria();t.userService.getUser(function(n){t.userData=n});t.search(t.searchCriteria,n.Events.SearchEvents.SearchCompleted,function(){t.associatedContactsService.getPendingContactRequests(function(n){t.pendingRequests=n})});t.eventService.on("RequestSent",function(){t.associatedContactsService.getPendingContactRequests(function(n){t.pendingRequests=n})})},i.prototype.searchContacts=function(){var t=this;t.syncCriteria();t.search(t.searchCriteria,n.Events.SearchEvents.SearchCompleted)},i.prototype.hasResult=function(){var n=this;return n.searchResult&&n.searchResult.length>0},i.prototype.cancelRequest=function(n){var t=this;t.associatedContactsService.requestCancelSubContact(n,function(){t.init()})},i.prototype.resendRequest=function(n){var t=this,r=n.ParentContactId,i;t.subContactRequest=n;i={IsSortedInAscendingOrder:!0,PageNumber:1,PageSize:10,SortField:"ContactNumber",GlobalEntityId:t.userData.OtherData};this.subContactsService.searchPendingParentContacts(i,function(n){if(t.openRequestModalPopup=!0,n.Success){var i=n.Result.filter(function(n){return n.EntityId==r})[0];t.selectedContact=i;t.isSelectedContactEmailExist=t.selectedContact.Email&&!0}t.emailMessage={From:t.userData.Email,To:t.selectedContact.CompanyName,Subject:t.userData.FirstName+" "+t.userData.LastName+" is Requesting Access",Body:t.userData.FirstName+" "+t.userData.LastName+" is requesting access to records associated with "+t.selectedContact.CompanyName+" in our "+t.globals.tenantName+" portal.",Message:t.userData.FirstName+" "+t.userData.LastName+" is requesting access to records associated with "+t.selectedContact.CompanyName+" in our "+t.globals.tenantName+" portal.",IsBodyHtml:!1}})},i.prototype.resetRequestModalPopup=function(){var n=this;n.openRequestModalPopup=!1},i.prototype.resendSubContactRequestAccess=function(){var n=this;n.emailMessage.To=n.selectedContact.Email;n.emailMessage.IsBodyHtml=!0;n.emailMessage.Body=n.associatedContactsService.formatEmailBody(n.emailMessage.Message,n.selectedContact.ContactId,n.userData.OtherData);n.showSpinner=!0;n.requestSubContactEmailData={EmailMessage:n.emailMessage,SubContactRequest:n.subContactRequest};n.associatedContactsService.requestUpdateSubContact(n.requestSubContactEmailData,function(t){n.subContactRequest=t;n.searchContacts();n.eventService.boradcast("RequestSent");n.showSpinner=!1});n.openRequestModalPopup=!1;n.utilities.showMessage(n.utilities.getResourceMessage("ClientSiteResource_RequestAccesstSuccessful","Access request sent successfully."),n.utilities.getResourceMessage("ClientSiteResource_Success","Success"))},i.prototype.removeParentContact=function(t){var i=this;this.removingContactNumber=t.ContactNumber;this.associatedContactsService.removeParentContact(t.EntityId,this.loggedInGlobalEntityId,function(){i.removingContactNumber="";i.search(i.searchCriteria,n.Events.SearchEvents.PageLoadCompleted);i.eventService.boradcast("ParentContactRemoved")})},i.prototype.syncCriteria=function(){this.criteria.PageSize=this.searchCriteria.PageSize;this.criteria.PageNumber=this.searchCriteria.PageNumber;this.searchCriteria=angular.copy(this.criteria)},i.prototype.initializeSearchCriteria=function(){this.criteria={IsSortedInAscendingOrder:!0,PageNumber:1,PageSize:10,SortField:"",Keyword:"",ExactMatch:!1,GlobalEntityId:this.userData.OtherData};this.searchCriteria=this.criteria},i}(n.Common.Controllers.PagedSearchController);t.AssociatedContactsController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.AssociatedContacts||(n.AssociatedContacts={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(t){function i(n,i,r,u,f,e,o,s){var h=t.call(this,n,r,u,e,null,!1)||this,c;return h.$scope=i,h.eventService=f,h.contactSearchService=e,h.associatedContactsService=o,h.userService=s,h.isSearchExecuted=!1,h.openRequestModalPopup=!1,h.isSelectedContactEmailExist=!1,h.showSpinner=!1,c=i.$parent,h.parent=c.vm,h.userData=h.parent.model,h}return __extends(i,t),i.prototype.init=function(){var t=this;t.initializeSearchCriteria();this.searchEvent=n.Events.SearchEvents.PageLoadCompleted;this.eventService.on("ParentContactRemoved",function(){t.searchResult&&t.searchResult.length>0&&t.search(t.searchCriteria,n.Events.SearchEvents.PageLoadCompleted)})},i.prototype.searchContacts=function(){var t=this;this.syncCriteria();this.search(this.searchCriteria,n.Events.SearchEvents.SearchCompleted,function(){t.isSearchExecuted=!0})},i.prototype.hasResult=function(){var n=this;return n.searchResult&&n.searchResult.length>0},i.prototype.sendContactRequest=function(n){var t=this;t.openRequestModalPopup=!0;t.selectedContact=n;t.isSelectedContactEmailExist=t.selectedContact.Email&&!0;t.emailMessage={From:t.userData.Email,To:n.CompanyName,Subject:t.userData.FirstName+" "+t.userData.LastName+" is Requesting Access",Body:t.userData.FirstName+" "+t.userData.LastName+" is requesting access to records associated with "+n.CompanyName+" in our "+t.globals.tenantName+" portal.",Message:t.userData.FirstName+" "+t.userData.LastName+" is requesting access to records associated with "+n.CompanyName+" in our "+t.globals.tenantName+" portal.",IsBodyHtml:!1}},i.prototype.resetRequestModalPopup=function(){var n=this;n.openRequestModalPopup=!1},i.prototype.saveSubContactRequestAccess=function(){var n=this;n.emailMessage.To=n.selectedContact.Email;n.emailMessage.IsBodyHtml=!0;n.emailMessage.Body=n.associatedContactsService.formatEmailBody(n.emailMessage.Message,n.selectedContact.ContactId,n.userData.OtherData);n.showSpinner=!0;n.subContactRequest={ParentContactId:n.selectedContact.ContactId,SubContactId:n.userData.OtherData,ParentContactName:n.selectedContact.CompanyName,UserId:n.userData.UserId,Id:0,LastUpdated:null,RequestedDate:null,StatusId:0,TenantId:n.globals.tenantId};n.requestSubContactEmailData={EmailMessage:n.emailMessage,SubContactRequest:n.subContactRequest};n.associatedContactsService.requestCreateSubContact(n.requestSubContactEmailData,function(t){n.subContactRequest=t;n.searchContacts();n.eventService.boradcast("RequestSent");n.showSpinner=!1});n.openRequestModalPopup=!1;n.utilities.showMessage(n.utilities.getResourceMessage("ClientSiteResource_RequestAccesstSuccessful","Access request sent successfully."),n.utilities.getResourceMessage("ClientSiteResource_Success","Success"))},i.prototype.syncCriteria=function(){this.criteria.PageSize=this.searchCriteria.PageSize;this.criteria.PageNumber=this.searchCriteria.PageNumber;this.searchCriteria=angular.copy(this.criteria)},i.prototype.initializeSearchCriteria=function(){this.criteria={IsSortedInAscendingOrder:!0,PageNumber:1,PageSize:10,SortField:"",Keyword:"",ExactMatch:!1,GlobalEntityId:this.userData.OtherData};this.searchCriteria=this.criteria},i}(n.Common.Controllers.PagedSearchController);t.AssociatedContactsSearchController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.AssociatedContacts||(n.AssociatedContacts={}))}(app||(app={})),function(n){var t;(function(){"use strict";angular.module("app.AssociatedContacts",["app.Services.Utilities","app.Common.Services","app.globalsModule"]).service("associatedContactSearchService",["http",n.AssociatedContacts.Services.AssociatedContactSearchService]).service("associatedContactsService",["http","globalsService","$location","resourceService",n.AssociatedContacts.Services.AssociatedContactsService]).controller("associatedContactsSearchController",["$routeParams","$scope","$location","globalsService","eventService","associatedContactSearchService","associatedContactsService","userService",n.AssociatedContacts.Controllers.AssociatedContactsSearchController]).controller("associatedContactsController",["$routeParams","$scope","$location","globalsService","eventService","associatedContactsService","userService","subContactsService",n.AssociatedContacts.Controllers.AssociatedContactsController])})(t=n.AssociatedContacts||(n.AssociatedContacts={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i){this.$q=n;this.$http=t;this.globalsService=i}return n.prototype.getNonTylerPaymentRequestPageUrl=function(n){var t=this,i=t.$q.defer();return t.$http.post(t.globalsService.webApiBaseUrl+"/payment/PaymentRequest",n).then(function(n){i.resolve(n.data)}).catch(function(n){i.reject(n)}),i.promise},n.prototype.getTylerPaymentRequestPageUrl=function(n){var t=this,i=t.$q.defer();return t.$http.post(t.globalsService.webApiBaseUrl+"/payment/TylerPaymentDepositeRequest",n).then(function(n){i.resolve(n.data)}).catch(function(n){i.reject(n)}),i.promise},n.prototype.getTenantEscrowAccountsSettings=function(){var n=this,t=n.$q.defer();return n.$http.get(n.globalsService.webApiBaseUrl+"/escrowaccounts/admin/tenant/").then(function(n){t.resolve(n.data)}).catch(function(n){t.reject(n)}),t.promise},n.prototype.testPaymentGatewayUrl=function(n){var t=this,i=t.$q.defer();return t.$http.get(t.globalsService.webApiBaseUrl+"/paymentgateway/healthcheck/?baseUrl="+n).then(function(n){i.resolve(n.data)}).catch(function(n){i.reject(n)}),i.promise},n}();n.AddFundToEscrowAccountService=t})(t=n.Services||(n.Services={}))})(t=n.ShoppingCart||(n.ShoppingCart={}))}(app||(app={})),function(n){var t;(function(t){var i;(function(t){var i=n.Constants.ApiRouteConstant,r=function(){function n(n){var t=this;this.http=n;this.rootUrl=i.ShoppingCartApiController;this.totalNumOfCartItems=0;this.didCallGetTotalItem=!1;this.orderNumber=null;this.tylerCartItems=[];this.getInCartStatus=function(n){var r=!1,i;return t.tylerCartItems&&n.length>0&&(i=[],angular.forEach(n,function(n){var r=t.tylerCartItems.filter(function(t){return t===n});r!==null&&r.length>0&&i.push(n)}),r=JSON.stringify(i)==JSON.stringify(n)),r}}return n.prototype.getTylerCartItems=function(){var n=this;this.http.get(this.rootUrl+i.CheckTylerPendingInvoices,function(t){t.Success&&(n.tylerCartItems=t.Result)},!1)},n.prototype.updateTotalNumOfItems=function(){var n=this;this.http.get(this.rootUrl+i.MyTotalCartItemApiAction,function(t){t.Success&&(n.totalNumOfCartItems=t.Result)},!1)},n.prototype.clearTotalNumOfItems=function(){this.totalNumOfCartItems=0},n.prototype.getMyCartItems=function(n){this.http.get(this.rootUrl+i.MyCartItemsApiAction,function(t){t.Success&&n(t.Result)},!1)},n.prototype.getPaymentPageUrl=function(n,t,i,r){this.http.post("/payment/PaymentRequest",{CurrentUrl:n,CartItems:i,DepositAccountInfo:r},function(n){n.Success&&t(n.Result)},!1)},n.prototype.getTylerPaymentPageUrl=function(n,t){this.http.post(i.TylerPaymentRequest,n,function(n){n.Success&&t(n.Result)},!1)},n.prototype.addCartItem=function(n,t){this.http.post(this.rootUrl+i.MyAddToCartItemApiAction,n,function(n){n.Success&&t(!0)},!1)},n.prototype.addCartItems=function(n,t){this.http.post(this.rootUrl+i.AddCartItemsApiAction,n,function(n){n.Success&&t(!0)},!1)},n.prototype.addTylerCartItems=function(n,t){this.http.post(this.rootUrl+i.AddTylerCartItemsApiAction,n,function(n){n.Success&&t(n.Result)},!1)},n.prototype.updateCartItems=function(n,t,i){var r=t?"my/updatecartitemsuseelastic":"my/updatecartitems";this.http.post(this.rootUrl+r,n,function(n){n.Success&&i(n.Result)},!1)},n.prototype.getCartItem=function(n,t){this.http.get(this.rootUrl+i.GetCartItemApiAction+"/"+n,function(n){n.Success&&t(n.Result)},!1)},n.prototype.removeMyCartItem=function(n,t){this.http.delete(this.rootUrl+i.MyRemoveCartItemApiAction,function(n){n.Success&&t(n.Result)},!1,{CartItemId:n})},n.prototype.removeMyCartItems=function(n,t){this.http.post(this.rootUrl+"my/removecartitems",n,function(n){n.Success&&t(n.Result)},!1)},n.prototype.removeMyPaymentRequestCartItem=function(n,t){var i=this;this.http.post(this.rootUrl+"my/removepaymentrequestcartitem",n,function(n){n.Success&&(i.orderNumber=null,t(!0))},!1)},n.prototype.getPaymentErrorInfo=function(n,t){this.http.post("/payment/PaymentError",n,function(n){n.Success&&t(n.Result)},!1)},n.prototype.getPendingInvoices=function(n,t){this.http.post("/payment/checkpendinginvoices",n,function(n){n.Success&&t(n.Result)},!1)},n.prototype.getTylerPendingInvoices=function(n){this.http.get(this.rootUrl+i.CheckTylerPendingInvoices,function(t){t.Success&&n(t.Result)},!1)},n.prototype.isPendingInvoice=function(n,t){this.http.get("/payment/ispendinginvoice",function(n){n.Success&&t(n.Result)},!1,{Invoice:n})},n}();t.CartService=r})(i=t.Services||(t.Services={}))})(t=n.ShoppingCart||(n.ShoppingCart={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Plan=1,n.Permit=2,n.Inspection=3,n}();n.CartEntityType=t})(t=n.Services||(n.Services={}))})(t=n.ShoppingCart||(n.ShoppingCart={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n,t,i){this.$http=n;this.globalService=t;this.$q=i}return n.prototype.getTenantPaymentSettings=function(){var n=this.$q.defer();return this.$http.get(this.globalService.webApiBaseUrl+"/payment/configuration/tenant/").then(function(t){n.resolve(t.data)}).catch(function(t){n.reject(t)}),n.promise},n.prototype.getPaymentRequestInfo=function(n){var t=this.$q.defer();return this.$http.get(this.globalService.webApiBaseUrl+"/payment/getPaymentRequest/"+n).then(function(n){t.resolve(n.data.Result)}).catch(function(n){t.reject(n)}),t.promise},n}();n.TenantPaymentSettingService=t})(t=n.Services||(n.Services={}))})(t=n.ShoppingCart||(n.ShoppingCart={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i,r,u,f){var e=n.call(this,f)||this;return e.dashboardService=t,e.globalService=i,e.userService=r,e.menuService=u,e.sectionInfo=[],e.includeParentRecords=!1,e.isSubContact=!1,e.parentName="",e.menuTabIndex=0,e}return __extends(t,n),t.prototype.init=function(){var t=this,n=this;n.getTenantDashboardSettings();n.userService.getUser(function(i){n.isSubContact=i.IsSubContact.valueOf();n.parentName=i.ParentName;n.includeParentRecords=n.isSubContact&&localStorage["IncludeParentRecords_"+t.globalService.tenantId]||!1;n.menuTabIndex=n.menuService.menuTabIndices.filter(function(n){return n.Key=="Dashboard"})[0].Value;var r=document.getElementsByName("menu-"+n.menuTabIndex)[0];angular.element(r).focus().click()})},t.prototype.updateLocalStorage=function(){localStorage["IncludeParentRecords_"+this.globalService.tenantId]=this.includeParentRecords},t.prototype.getTenantDashboardSettings=function(){var n=this;n.dashboardService.getTenantDashboardSettings(function(t){n.tenantDashBoardSettings=t;n.tenantDashBoardSettings.forEach(function(t){var i={SectionName:t.DashboardSectionName,Hidden:t.Hidden,Seperator:!t.Hidden};n.sectionInfo.push(i)});var i=n.sectionInfo.filter(function(n){return n.Seperator==!0});i.forEach(function(n,t){t>i.length-2&&(n.Seperator=!1)})})},t}(n.Core.Controllers.CoreController);t.DashboardController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Dashboard||(n.Dashboard={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n){this.notificationService=n;var t=this;n.getNotification(function(n){t.model=n})}return n.prototype.pauseCarousel=function(){$(".carousel").carousel("pause")},n.prototype.playCarousel=function(){$(".carousel").carousel("cycle")},n}();n.NotificationCarouselController=t})(t=n.Controllers||(n.Controllers={}))})(t=n.Dashboard||(n.Dashboard={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){var t=this;this.http=n;this.notificationCallCount=0;this.rootUrl="/dashboard/";this.getNotification=function(n){t.http.get(t.rootUrl+"notifications",function(t){t.Success&&n(t.Result)},!0)};this.getTenantDashboardSettings=function(n){t.http.get(t.rootUrl+"gettenantdashboardsettings",function(t){t.Success&&n(t.Result)},!1)}}return n}();n.DashboardService=t})(t=n.Services||(n.Services={}))})(t=n.Dashboard||(n.Dashboard={}))}(app||(app={})),function(n){var t;(function(){"use strict";var t=n.Dashboard.Controllers.DashboardController,i=n.Dashboard.Controllers.NotificationCarouselController;angular.module("app.Dashboard",["app.Services.Utilities","app.Common.Services"]).service("dashboardService",["http",n.Dashboard.Services.DashboardService]).controller("dashboardController",["dashboardService","globalsService","userService","menuService",t]).controller("notificationCarouselController",["dashboardService",i])})(t=n.Dashboard||(n.Dashboard={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i){var r=n.call(this)||this,u;return r.$routeParams=t,r.cartService=i,r.orderNumber=null,r.foundError=!1,r.errorMessage="",r.paymentError=null,u=r,r.$routeParams.id!=null&&(r.orderNumber=r.$routeParams.id),r.getPaymentErrorInfo(),r}return __extends(t,n),t.prototype.getPaymentErrorInfo=function(){var n=this;this.orderNumber!=null&&this.cartService.getPaymentErrorInfo(this.orderNumber,function(t){t!=null?(n.paymentError=t,n.foundError=!0):n.foundError=!1})},t}(n.Core.Controllers.CoreController);t.PaymentErrorController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.ShoppingCart||(n.ShoppingCart={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i,r,u,f){var e=n.call(this,f)||this;return e.$routeParams=t,e.cartService=i,e.tenantPaymentSettingService=r,e.userService=u,e.orderNumber=null,e.tenantPaymentSettings=null,e.displayWarning=!1,e.$routeParams.id?e.orderNumber=e.$routeParams.id:e.$routeParams.invoiceNumber?e.orderNumber=e.$routeParams.invoiceNumber:e.$routeParams.orderNumber&&(e.orderNumber=e.$routeParams.orderNumber),e.removePaymentRequestCartItem(),e.getDataTenantPaymentSettings(),e.getPaymentRequestInfo(),e}return __extends(t,n),t.prototype.getDataTenantPaymentSettings=function(){var n=this;n.tenantPaymentSettingService.getTenantPaymentSettings().then(function(t){t&&(n.tenantPaymentSettings=t.Result,(n.tenantPaymentSettings.SuccessfulPaymentMessage==null||n.tenantPaymentSettings.SuccessfulPaymentMessage.replace(/&nbsp;/g,"").trim().length==0)&&(n.tenantPaymentSettings.SuccessfulPaymentMessage=""))})},t.prototype.removePaymentRequestCartItem=function(){var t=this,n;this.orderNumber?n=this.orderNumber:this.cartService.orderNumber&&(n=this.cartService.orderNumber);n&&this.userService.isUserLoggedIn&&this.cartService.removeMyPaymentRequestCartItem(n,function(n){n&&t.cartService.updateTotalNumOfItems()})},t.prototype.getPaymentRequestInfo=function(){var n=this;this.orderNumber&&this.tenantPaymentSettingService.getPaymentRequestInfo(this.orderNumber).then(function(t){t&&t.Paid&&t.IsDeposit&&t.ErrorMessage&&(n.displayWarning=!0)})},t}(n.Core.Controllers.CoreController);t.PaymentSuccessController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.ShoppingCart||(n.ShoppingCart={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i,r,u){var f=n.call(this,null)||this,e;return f.cartService=i,f.globalsService=r,f.settingService=u,f.cartItems=null,f.nextFocusElementId="cartTitleElement",f.showUpdateAlert=!1,f.useElastic=!0,f.cartItemsToRemove=[],f.hideLicense=!0,f.alertMessage="",e=f,e.useElastic=!0,e.settingService.getHideLicenseFeatureSetting(function(n){e.hideLicense=n&&n.SettingValue==="true"}),f.setup(),f}return __extends(t,n),t.prototype.removeItem=function(n){var t=this;this.cartService.removeMyCartItem(n,function(n){if(n){t.cartService.updateTotalNumOfItems();t.getCartItems();var i=document.getElementById(t.nextFocusElementId);i!=null&&i.focus()}})},t.prototype.removeItems=function(n){var t=this;this.cartService.removeMyCartItems(n,function(n){if(n){t.cartService.updateTotalNumOfItems();t.getCartItems();var i=document.getElementById(t.nextFocusElementId);i!=null&&i.focus()}})},t.prototype.setup=function(){this.showUpdateAlert=!1;this.getCartItems()},t.prototype.goToMyInvoice=function(){this.$location.path("myInvoices")},t.prototype.back=function(){window.history.back()},t.prototype.getCartItems=function(){var n=this;this.cartService.getMyCartItems(function(t){var r,i;if(t!=null&&t.length>0)for(n.cartItems=t,r=[],i=0;i<n.cartItems.length;i++)r.push(n.cartItems[i].CartDataId);else n.cartItems=null;n.cartService.updateTotalNumOfItems()})},t.prototype.getCartData=function(n){return JSON.parse(n)},t.prototype.checkout=function(){var n=this;NProgress.start();n.globalsService.showProcessing=!0;$("#overlay").focus().click();n.cartService.getPaymentPageUrl(n.$location.absUrl(),function(t){NProgress.done();n.globalsService.showProcessing=!1;switch(t.StatusCode){case 1:window.location.href=t.PaymentPageUrl;break;case 2:n.alertMessage=t.Message;n.showUpdateAlert=!0;n.getCartItems();break;case 3:n.alertMessage=t.Message;n.showUpdateAlert=!0}})},t.prototype.cartTotal=function(){var n=0;return angular.forEach(this.cartItems,function(t){n=n+t.Amount}),n},t.prototype.hasCartItem=function(){if(this.cartItems!=null&&this.cartItems.length>0)return!0},t.prototype.hasEmptyCartItem=function(){if(!this.cartItems||this.cartItems.length===0)return!0},t}(n.Core.Controllers.CoreController);t.ShoppingCartController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.ShoppingCart||(n.ShoppingCart={}))}(app||(app={})),function(n){var t;(function(){"use strict";var t=n.ShoppingCart.Controllers.ShoppingCartController,i=n.ShoppingCart.Controllers.PaymentSuccessController,r=n.ShoppingCart.Controllers.PaymentErrorController;angular.module(n.Constants.AppModule.ShoppingCartModule,["app.Common.Services"]).service(n.Constants.ServiceConstant.CartService,["http",n.ShoppingCart.Services.CartService]).service("tenantPaymentSettingService",["$http","globalsService","$q",n.ShoppingCart.Services.TenantPaymentSettingService]).controller(n.Constants.ControllerConstant.ShoppingCartController,["$routeParams",n.Constants.ServiceConstant.CartService,"globalsService","settingsService",t]).controller("paymentSuccessController",["$routeParams",n.Constants.ServiceConstant.CartService,"tenantPaymentSettingService","userService","$injector",i]).controller("paymentErrorController",["$routeParams",n.Constants.ServiceConstant.CartService,r])})(t=n.ShoppingCart||(n.ShoppingCart={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){"use strict";var i=n.Constants.MapConstants,r=function(n){function t(t,i,r,u,f,e,o){var s=n.call(this)||this;return s.$scope=t,s.mapService=i,s.userService=u,s.localStorageService=f,s.eventService=e,s.mapApplyService=o,s.records="",s.canGoPrevious=!1,s.canGoNext=!1,s.noSearchResults=!0,s.mapApplyService.resetMapApplyData(),s}return __extends(t,n),t.prototype.processEvent=function(n){var e=this,t=this,i,u,r,f;n!==null&&n!=undefined&&(n.result.length&&(i=n.result.filter(function(n){return n.geometry}),u=i&&i.length>0,n.result&&!u?n.result.length===1&&n.result[0].address===""?(r=[{Addresses:[],ParcelNumber:n.result[0].parcel,Range:n.result[0].range,Section:n.result[0].section,Township:n.result[0].township}],t.globals.tylerIdEnabled&&!t.userService.isUserLoggedIn?this.localStorageService.set("mapLocation",r,"sessionStorage"):t.mapApplyService.mapLocations=r,t.$location.url("/applicationAssistant?sectionName=All&showTemplates=false")):this.mapService.getCssFormatLocations(n.result.map(function(n){return{Parcel:n.parcel,Address:n.address?n.address:null,Attributes:n.attributes}}),function(n){t.globals.tylerIdEnabled&&!t.userService.isUserLoggedIn?e.localStorageService.set("mapLocation",n,"sessionStorage"):t.mapApplyService.mapLocations=n;t.$location.url("/applicationAssistant?sectionName=All&showTemplates=false")}):(f=n.result.map(function(n){return{geometry:n.geometry}}),t.mapApplyService.mapSPCollections=f,t.$location.url("/applicationAssistant?sectionName=All&showTemplates=false"))),this.$scope.$apply())},t.prototype.previousPage=function(){this.criteria.PageNumber>1&&(this.criteria.PageNumber-=1,this.getSearchResults(!0))},t.prototype.nextPage=function(){this.canGoNext&&(this.criteria.PageNumber+=1,this.getSearchResults(!0))},t.prototype.getSearchResults=function(n){var t=this;t.criteria.Address&&(t.isSearching=!0,t.showDetails=!1,t.showMapLocations=!1,t.shapeCreated=!1,t.mapApplyLocations=[],n||(t.criteria.PageNumber=1,t.criteria.TotalFound=0,t.searchResults=[]),t.mapService.searchAddress(t.criteria,function(n){t.searchResults=n.Result;t.isSearching=!1;t.criteria.TotalFound=n.TotalFound;var r=(t.criteria.PageNumber-1)*t.criteria.PageSize+1;t.records=r.toString(10)+" - "+(r+n.Result.length-1).toString(10);t.canGoPrevious=t.criteria.PageNumber!==1;t.canGoNext=t.criteria.PageNumber!==n.PageCount;t.hidePagination=!1;t.criteria.TotalFound===0&&t.mapService.searchParcelPoint(t.criteria,function(n){if(n.Result&&n.Result.length>0){t.hidePagination=!0;var r=n.Result[0];t.eventService.boradcast(i.parcelPinCompletedEventName,{data:r})}else t.showDetails=!0})}))},t}(n.Core.Controllers.CoreController);t.MapController=r})(t=n.Map||(n.Map={}))}(app||(app={})),function(n){var t;(function(n){"use strict";var t=function(){function n(n,t,i,r,u){var f=this;this.esriLoader=n;this.http=t;this.resourceService=i;this.globalsService=r;this.$q=u;this.searchAddress=function(n,t){var i=function(n){n.Success&&t({PageCount:n.PageCount,Result:n.Result,TotalFound:n.TotalFound,StatusCode:n.StatusCode})};f.http.post("/map/search/address",n,i,!0)};this.searchParcelPoint=function(n,t){var i=function(n){n.Success&&t({PageCount:n.PageCount,Result:n.Result,TotalFound:n.TotalFound,StatusCode:n.StatusCode})};f.http.post("/map/search/parcelpoint",n,i,!0)};this.getSuggestions=function(n){var t=function(){};return f.http.post("/locator/locate/suggest",n,t,!0)};this.getAddressSuggestionsFromMapService=function(n,t){var u=f.$q.defer(),i=f,r=[];return i.suggestionCriteria=n,i.mapConfig=t,f.esriLoader.require(["esri/rest/query","esri/rest/support/Query"],function(n,t){var e=i.mapConfig.MapLayerUrl.replace(/\/$/,"")+"/"+i.mapConfig.ArcGisAddressLayerNumber,f=new t;f.returnGeometry=!1;f.outFields=[i.mapConfig.ArcGisAddressField];f.orderByFields=[i.mapConfig.ArcGisAddressField];f.where="(UPPER("+i.mapConfig.ArcGisAddressField+") like '%"+i.suggestionCriteria.SearchText+"%')";n.executeQueryJSON(e,f).then(function(n){for(var f,e,o=n.features.length,t=0;t<o;t++)f=n.features[t].attributes,e=f[i.mapConfig.ArcGisAddressField],r.push(e);u.resolve(r)}).catch(function(){r.push("No Suggestions Found.");u.resolve(r)})}),u.promise};this.initMap=function(){var t=f,n=f.$q.defer();return f.getConfiguration(function(i){t.mapConfig=i;t.mapConfig.ArcGisUseAuthentication?f.getAuthentication(t.mapConfig).then(function(){n.resolve()},function(t){n.reject(t)}):n.resolve()}),n.promise};this.getAddressesFromParcels=function(n){var t=function(){};return f.http.post("/map/search/addressfromparcel",n,t,!0)};this.getAuthentication=function(n){var t=f.$q.defer();return f.esriLoader.require(["esri/identity/IdentityManager","dojo/json"],function(i,r){var u;i.initialize({serverInfos:[],credentials:[]});i.destroyCredentials();u=4320;f.getEsriToken(!1,function(f){var e=r.parse(f.toString()),s,o,h,c,l;t.resolve();s=(new Date).getTime();o=s+u*6e4;n.ArcGisIsOnline?i.registerToken({server:"https://www.arcgis.com/sharing/rest",ssl:!0,token:e.token,expires:o}):(h={server:n.ArcGisServer,tokenServiceUrl:n.ArcGisTokenServiceUrl,hasPortal:n.ArcGisHasPortal},i.registerServers([h]),c={expires:o,server:n.ArcGisServer,ssl:e.ssl,token:e.token,userId:n.ArcGisCredentialsUserId},i.registerToken(c),l={serverInfos:[h],credentials:[{userId:n.ArcGisCredentialsUserId,server:n.ArcGisServer,token:e.token,expires:o,validity:u,ssl:e.ssl,creationTime:s,scope:n.ArcGisCredentialsScope,resources:[n.ArcGisCredentialsResources]}]},i.initialize(r.stringify(l)))})}),t.promise};this.getAddressesFromParcel=function(n,t){var i=function(n){n.Success&&t(n.Result)};f.http.post("/map/search/addressfromparcel",n,i,!0)};this.getCssFormatLocations=function(n,t){var i=function(i){i.Success&&i.Result&&(n.forEach(function(n,t){i.Result[t].Range=n.Range;i.Result[t].Section=n.Section;i.Result[t].Township=n.Township}),t(i.Result))};f.http.post("/arcgis/search/getcssformatlocation",n,i,!0)};this.getEsriToken=function(n,t){var i=function(n){n.Success&&t(n.Result)};f.http.get("/map/esritoken/"+n,i,!0)};this.getConfiguration=function(n){var t=function(t){t.Success&&n(t.Result)};f.http.get("/map/configuration",t,!0)};this.getArcGisMappings=function(n){var t=function(t){t.Success&&n(t.Result)};f.http.get("/map/integration/getTenantArcGisMappings",t,!0)};this.getMapWidgetManagement=function(n){var t=function(t){t.Success&&n(t.Result)};f.http.get("/map/configuration/widgetmanagement",t,!0)};this.getTenantMapWidgetManagementSettings=function(n){var t=function(t){t.Success&&n(t.Result)};f.http.get("/map/configuration/editablewidgetmanagement",t,!0)};this.searchSpatialCollectionData=function(n,t){f.http.post("/arcgis/search/spatialCollection",n,function(n){n&&t(n)},!0)};this.searchCaseFilter=function(n,t){f.http.post("/energov/spatialsearch/bufferredmodulesearch",n,function(n){n.Success&&t(n.Result)},!0)};this.searchCaseByShapeFilter=function(n,t){f.http.post("/energov/spatialsearch/shapemodulesearch",n,function(n){n.Success&&t(n.Result)},!0)}}return n}();n.MapService=t})(t=n.Map||(n.Map={}))}(app||(app={})),function(n){var t;(function(n){"use strict";angular.module("app.Map",["app.Services.Utilities","app.Common.Services","app.Common.Services.Resource","esri.map"]).service("mapService",["esriLoader","http","resourceService","globalsService","$q",n.MapService]).controller("mapController",["$scope","mapService","globalsService","userService","localStorageService","eventService","mapApplyService",n.MapController])})(t=n.Map||(n.Map={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){"use strict";var i=n.Constants.GlobalConstants,r=function(n){function t(t,i,r,u,f,e,o){var s=n.call(this,o)||this;return s.customFieldsService=t,s.telerikCFGridService=i,s.resourceService=r,s.$timeout=u,s.$modal=f,s.$scope=e,s.currentGroupIndex=-1,s.currentTableFieldIndex=-1,s.currentRowIndex=-1,s.isFormOpen=!1,s.previouslyFocusedButtonId="",s}return __extends(t,n),t.prototype.createGridOptions=function(n,t){var i=this,r=n.tableData.rows;n.ClonedCustomFieldTableColumnRefItems=this.getCloneedCustomFieldTableColumns(n.CustomFieldTableColumnRefItems);var e=n.ClonedCustomFieldTableColumnRefItems.filter(function(n){return!n.Retire}),o=new kendo.data.DataSource({transport:{read:function(n){n.success(r)},update:function(t){var u=r.filter(function(n){return n.RowID===t.data.RowID})[0];angular.forEach(n.ClonedCustomFieldTableColumnRefItems,function(n,r){var f="Column"+r;t.data[f]&&i.telerikCFGridService.updateRowModel(t.data,u,f,n)});t.success(t.data);i.$scope.$apply()},create:function(t){var u=i.customFieldsService.getNewCustomFieldTableRow(),f=r.length>0?Math.max.apply(Math,r.map(function(n){return n.CustomFieldTableRowNumber}))+1:0;r.forEach(function(n,t){n.RowID=t+1});t.data.RowID=f+1;u.RowID=f+1;u.CustomFieldTableRowColumnCount=n.ClonedCustomFieldTableColumnRefItems.length;u.CustomFieldTableRowNumber=f;angular.forEach(n.ClonedCustomFieldTableColumnRefItems,function(n,r){var f="Column"+r;u[f]=i.customFieldsService.getCustomFieldTableCell(n,r,u.CustomFieldTableRowNumber);t.data[f]&&i.telerikCFGridService.updateRowModel(t.data,u,f,n)});r.push(u);t.success(t.data);i.$scope.$apply()},destroy:function(n){var t=r.filter(function(t){return t.RowID===n.data.RowID})[0],u=r.indexOf(t);r.splice(u,1);n.success();i.$scope.$apply()}},batch:!1,schema:{model:n.ClonedCustomFieldTableColumnRefItems?this.telerikCFGridService.generateGridModel(n.ClonedCustomFieldTableColumnRefItems,[],t):{}}}),u=Boolean(kendo.support.mobileOS),f={dataSource:o,sortable:!0,resizable:!0,mobile:!0,columns:e.length>0?this.telerikCFGridService.generateGridColumns(e):[],editable:{mode:"popup",confirmation:!1},save:function(){u||($("body").css("overflow-y","auto"),document.body.scrollTop=i.prevScrollPosition);this.refresh()},edit:function(n){if(!u){var t=n.container.find("div:last");t.html('<div><a role="button" id="updateBtn" class="k-button k-button-icontext k-primary k-grid-update" href="#"><span class="k-icon k-i-check"><\/span>Update<\/a><a role="button" id="cancelBtn" class="k-button k-button-icontext k-grid-cancel" href="#"><span class="k-icon k-i-cancel"><\/span>Cancel<\/a><\/div>');i.prevScrollPosition=document.body.scrollTop;document.body.scrollTop=0;$("body").css("overflow-y","hidden")}},cancel:function(){u||($("body").css("overflow-y","auto"),document.body.scrollTop=i.prevScrollPosition)}};return t||(f.toolbar=[{name:"create",template:"<a id='a-addRow' role='button' class='k-button k-button-icontext k-grid-add' href='\\#'><span id='s-addRow' class='k-icon k-i-plus'><\/span>Add Row<\/a>"}],f.columns.unshift({command:[{name:"edit",template:"<a role='button' id='a-editBtn' class='k-button k-button-icontext k-grid-edit' href='\\#'><span id='s-editBtn' class='k-icon k-i-edit'><\/span>Edit<\/a>"},{name:"destroy",template:"<a role='button' id='a-deleteBtn' class='k-button k-button-icontext k-grid-delete trash-a-button' href='\\#'><span id='s-deleteBtn' class='k-icon k-i-trash trash-icon'><\/span><\/a>"}],title:"&nbsp;",width:"135px",locked:!0})),f},t.prototype.onValidateMessages=function(n,t,i){return i===undefined?this.$scope.$eval(n+"."+t.typeData.id+".$error"):this.$scope.$eval(n+"['"+i+"']."+t.typeData.id+".$error")},t.prototype.isFieldTouched=function(n,t,i){return i===undefined?this.$scope.$eval(n+"."+t.typeData.id+".$touched"):this.$scope.$eval(n+"['"+i+"']."+t.typeData.id+".$touched")},t.prototype.isAnyVisibleFiledPresent=function(n){return n.CustomFields.filter(function(n){return n.HideField!=!0}).length>0},t.prototype.someSelected=function(n,t){var i=!1;return t===!0?angular.forEach(n,function(n){n.IsSelected===!0&&(i=!0)}):i=!0,i},t.prototype.comboBoxValueChange=function(n){var t=n.CustomPickListItems.filter(function(t){return t.PackageId===n.Value})[0];n.ShowValueComboBox=t?t.Value:""},t.prototype.showFormToInsertNewRow=function(n,t,i,r){this.currentGroupIndex=i;this.currentTableFieldIndex=r;this.currentRowIndex=-1;this.isFormOpen=!0;t.ClonedCustomFieldTableColumnRefItems=this.getCloneedCustomFieldTableColumns(t.CustomFieldTableColumnRefItems);this.previouslyFocusedButtonId=n.currentTarget.id;this.setFocus(t.CustomFieldTableColumnRefItems[0].typeData.id)},t.prototype.setFocus=function(n){var t=this;this.$timeout(function(){$("#"+n).focus()})},t.prototype.isCurrentTableForm=function(n,t){return this.currentGroupIndex==n&&this.currentTableFieldIndex==t},t.prototype.refineDate=function(n){var t=this;(n.typeData.elementType="date")&&n.Value!==null&&n.Value!==""&&(n.Value=moment(new Date(n.Value)).format(i.DateFormat))},t.prototype.saveFormToTable=function(n){var t=this,i;n.CustomFieldTableRows==null&&(n.CustomFieldTableRows=[]);this.currentRowIndex==-1&&(this.currentRowIndex=n.CustomFieldTableRows.length);i=this.customFieldsService.getNewCustomFieldTableRow();i.CustomFieldTableRowColumnCount=n.ClonedCustomFieldTableColumnRefItems.length;i.CustomFieldTableRowNumber=this.currentRowIndex;angular.forEach(n.ClonedCustomFieldTableColumnRefItems,function(n,r){i["Column"+r]=t.customFieldsService.getCustomFieldTableCell(n,r,t.currentRowIndex)});n.CustomFieldTableRows[t.currentRowIndex]==null?n.CustomFieldTableRows[t.currentRowIndex]=i:n.CustomFieldTableRows.splice(t.currentRowIndex,1,i);n.tableData.rows=n.CustomFieldTableRows;this.currentGroupIndex=-1;this.currentTableFieldIndex=-1;this.currentRowIndex=-1;this.isFormOpen=!1;this.setFocus(t.previouslyFocusedButtonId)},t.prototype.allowRemoveRow=function(n){return!n.IsRequired||n.IsRequired&&n.CustomFieldTableRows.length>1?!0:!1},t.prototype.editRow=function(n,t,i,r){this.currentGroupIndex=i;this.currentTableFieldIndex=r;this.currentRowIndex=t.CustomFieldTableRowNumber;var u=this.customFieldsService.customLayout.CustomGroups[i].CustomFields[r];u.ClonedCustomFieldTableColumnRefItems=this.getCloneedCustomFieldTableColumns(u.CustomFieldTableColumnRefItems);angular.forEach(u.ClonedCustomFieldTableColumnRefItems,function(n,i){n.Value=t["Column"+i].Value});this.isFormOpen=!0;this.previouslyFocusedButtonId=n.currentTarget.id;this.setFocus(u.CustomFieldTableColumnRefItems[0].typeData.id)},t.prototype.getCloneedCustomFieldTableColumns=function(n){var t=angular.copy(n);return angular.forEach(t,function(t,i){t.typeData=n[i].typeData}),t},t.prototype.isUpdatingCurrentRow=function(n,t,i){return this.currentGroupIndex==n&&this.currentTableFieldIndex==t&&this.currentRowIndex==i},t.prototype.removeRow=function(n,t,i){var u=this,r=this.customFieldsService.customLayout.CustomGroups[t].CustomFields[i];(!r.IsRequired||r.IsRequired&&r.CustomFieldTableRows.length>1)&&(this.modalInstance=this.$modal.open({templateUrl:"removeContact.html",controller:["$scope",function(f){f.onOk=function(){r.CustomFieldTableRows.splice(n.CustomFieldTableRowNumber,1);angular.forEach(r.CustomFieldTableRows,function(f,e){f.CustomFieldTableRowNumber=e;n.CustomFieldTableRowNumber<u.currentRowIndex&&u.isUpdatingCurrentRow(t,i,e+1)&&(u.currentRowIndex=e);angular.forEach(r.ClonedCustomFieldTableColumnRefItems,function(n,t){f["Column"+t].CustomFieldTableRowNumber=e})});u.cancel();f.isOpen=!1};f.onCancel=function(){u.cancel();f.isOpen=!1}}]}))},t.prototype.cancel=function(){this.modalInstance.dismiss("cancel")},t.prototype.cancelCustomTableForm=function(){var n=this.customFieldsService.customLayout.CustomGroups[this.currentGroupIndex].CustomFields[this.currentTableFieldIndex];this.currentGroupIndex=-1;this.currentTableFieldIndex=-1;this.currentRowIndex=-1;this.isFormOpen=!1;this.setFocus(this.previouslyFocusedButtonId)},t}(n.Core.Controllers.CoreController);t.CustomFieldsController=r})(t=n.CustomFields||(n.CustomFields={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){"use strict";var i=n.Constants.GlobalConstants,r=function(n){function t(t,r,u,f,e,o){var s=n.call(this)||this;return s.customFieldsService=t,s.telerikCFGridService=r,s.resourceService=u,s.$timeout=f,s.$modal=e,s.globalService=o,s.restrict="E",s.templateUrl=o.baseUrl+o.tenantUrl+"/customfields/taxremitdataentry",s.scope={customLayout:"="},s.previouslyFocusedButtonId="",s.link=function(n){n.isFormOpen=!1;n.currentGroupIndex=-1;n.currentRowIndex=-1;n.currentTableFieldIndex=-1;n.modalInstance=null;n.previouslyFocusedButtonId="";n.onValidateMessages=function(t,i,r){return r===undefined?n.$eval(t+"."+i.typeData.id+".$error"):n.$eval(t+"['"+r+"']."+i.typeData.id+".$error")};n.someSelected=function(n,t){var i=!1;return t===!0?angular.forEach(n,function(n){n.IsSelected===!0&&(i=!0)}):i=!0,i};n.comboBoxValueChange=function(n){var t=n.CustomPickListItems.filter(function(t){return t.PackageId===n.Value})[0];n.ShowValueComboBox=t?t.Value:""};n.showFormToInsertNewRow=function(t,i,r,u){n.currentGroupIndex=r;n.currentTableFieldIndex=u;n.currentRowIndex=-1;n.isFormOpen=!0;i.ClonedCustomFieldTableColumnRefItems=this.getCloneedCustomFieldTableColumns(i.CustomFieldTableColumnRefItems);this.previouslyFocusedButtonId=t.currentTarget.id;this.setFocus(i.CustomFieldTableColumnRefItems[0].typeData.id)};n.setFocus=function(n){f(function(){$("#"+n).focus()})};n.isCurrentTableForm=function(t,i){return n.currentGroupIndex==t&&n.currentTableFieldIndex==i};n.refineDate=function(n){(n.typeData.elementType="date")&&n.Value!==null&&n.Value!==""&&(n.Value=moment(new Date(n.Value)).format(i.DateFormat))};n.saveFormToTable=function(i){i.CustomFieldTableRows==null&&(i.CustomFieldTableRows=[]);n.currentRowIndex==-1&&(n.currentRowIndex=i.CustomFieldTableRows.length);var r=t.getNewCustomFieldTableRow();r.CustomFieldTableRowColumnCount=i.ClonedCustomFieldTableColumnRefItems.length;r.CustomFieldTableRowNumber=n.currentRowIndex;angular.forEach(i.ClonedCustomFieldTableColumnRefItems,function(i,u){r["Column"+u]=t.getCustomFieldTableCell(i,u,n.currentRowIndex)});i.CustomFieldTableRows[n.currentRowIndex]==null?i.CustomFieldTableRows[n.currentRowIndex]=r:i.CustomFieldTableRows.splice(n.currentRowIndex,1,r);i.tableData.rows=i.CustomFieldTableRows;n.currentGroupIndex=-1;n.currentTableFieldIndex=-1;n.currentRowIndex=-1;n.isFormOpen=!1;this.setFocus(this.previouslyFocusedButtonId)};n.allowRemoveRow=function(n){return!n.IsRequired||n.IsRequired&&n.CustomFieldTableRows.length>1?!0:!1};n.editRow=function(t,i,r,u){n.currentGroupIndex=r;n.currentTableFieldIndex=u;n.currentRowIndex=i.CustomFieldTableRowNumber;var f=n.customLayout.CustomGroups[r].CustomFields[u];f.ClonedCustomFieldTableColumnRefItems=this.getCloneedCustomFieldTableColumns(f.CustomFieldTableColumnRefItems);angular.forEach(f.ClonedCustomFieldTableColumnRefItems,function(n,t){n.Value=i["Column"+t].Value});n.isFormOpen=!0;this.previouslyFocusedButtonId=t.currentTarget.id;this.setFocus(f.CustomFieldTableColumnRefItems[0].typeData.id)};n.getCloneedCustomFieldTableColumns=function(n){var t=angular.copy(n);return angular.forEach(t,function(t,i){t.typeData=n[i].typeData}),t};n.isUpdatingCurrentRow=function(t,i,r){return n.currentGroupIndex==t&&n.currentTableFieldIndex==i&&n.currentRowIndex==r};n.removeRow=function(t,i,r){var u=n.customLayout.CustomGroups[i].CustomFields[r];(!u.IsRequired||u.IsRequired&&u.CustomFieldTableRows.length>1)&&(n.modalInstance=e.open({templateUrl:"removeContact.html",controller:["$scope",function(f){f.onOk=function(){u.CustomFieldTableRows.splice(t.CustomFieldTableRowNumber,1);angular.forEach(u.CustomFieldTableRows,function(f,e){f.CustomFieldTableRowNumber=e;t.CustomFieldTableRowNumber<n.currentRowIndex&&n.isUpdatingCurrentRow(i,r,e+1)&&(n.currentRowIndex=e);angular.forEach(u.ClonedCustomFieldTableColumnRefItems,function(n,t){f["Column"+t].CustomFieldTableRowNumber=e})});n.cancel();f.isOpen=!1};f.onCancel=function(){n.cancel();f.isOpen=!1}}]}))};n.cancel=function(){n.modalInstance.dismiss("cancel")};n.cancelCustomTableForm=function(){var t=n.customLayout.CustomGroups[n.currentGroupIndex].CustomFields[n.currentTableFieldIndex];n.currentGroupIndex=-1;n.currentTableFieldIndex=-1;n.currentRowIndex=-1;this.setFocus(this.previouslyFocusedButtonId);n.isFormOpen=!1};n.createGridOptions=function(t,i){var u=s,r=t.tableData.rows;t.ClonedCustomFieldTableColumnRefItems=n.getCloneedCustomFieldTableColumns(t.CustomFieldTableColumnRefItems);var h=t.ClonedCustomFieldTableColumnRefItems.filter(function(n){return!n.Retire}),c=new kendo.data.DataSource({transport:{read:function(n){n.success(r);f(function(){$(window).trigger("resize")})},update:function(i){var f=r.filter(function(n){return n.RowID===i.data.RowID})[0];angular.forEach(t.ClonedCustomFieldTableColumnRefItems,function(n,t){var r="Column"+t;i.data[r]&&u.telerikCFGridService.updateRowModel(i.data,f,r,n)});i.success();n.$apply()},create:function(i){var f=u.customFieldsService.getNewCustomFieldTableRow(),e=r.length+1;r.forEach(function(n,t){n.CustomFieldTableRowNumber=t;n.RowID=t+1});i.data.RowID=e;f.RowID=e;f.CustomFieldTableRowColumnCount=t.ClonedCustomFieldTableColumnRefItems.length;f.CustomFieldTableRowNumber=e-1;angular.forEach(t.ClonedCustomFieldTableColumnRefItems,function(n,t){var r="Column"+t;f[r]=u.customFieldsService.getCustomFieldTableCell(n,t,f.CustomFieldTableRowNumber);i.data[r]&&u.telerikCFGridService.updateRowModel(i.data,f,r,n)});r.push(f);i.success(i.data);n.$apply()},destroy:function(t){var i=r.filter(function(n){return n.RowID===t.data.RowID})[0],u=r.indexOf(i);r.splice(u,1);t.success();n.$apply()}},batch:!1,schema:{model:t.ClonedCustomFieldTableColumnRefItems?s.telerikCFGridService.generateGridModel(t.ClonedCustomFieldTableColumnRefItems,[],i):{}}}),e=Boolean(kendo.support.mobileOS),o={dataSource:c,sortable:!0,resizable:!0,mobile:!0,columns:h.length>0?s.telerikCFGridService.generateGridColumns(h):[],editable:{mode:"popup",confirmation:!1},save:function(){e||($("body").css("overflow-y","auto"),document.body.scrollTop=n.prevScrollPosition);this.refresh()},edit:function(t){if(!e){var i=t.container.find("div:last");i.html('<div><a role="button" id="updateBtn" class="k-button k-button-icontext k-primary k-grid-update" href="#"><span class="k-icon k-i-check"><\/span>Update<\/a><a role="button" id="cancelBtn" class="k-button k-button-icontext k-grid-cancel" href="#"><span class="k-icon k-i-cancel"><\/span>Cancel<\/a><\/div>');n.prevScrollPosition=document.body.scrollTop;document.body.scrollTop=0;$("body").css("overflow-y","hidden")}},cancel:function(){e||($("body").css("overflow-y","auto"),document.body.scrollTop=n.prevScrollPosition)}};return i||(o.toolbar=[{name:"create",template:"<a id='a-addRow' role='button' class='k-button k-button-icontext k-grid-add' href='\\#'><span id='s-addRow' class='k-icon k-i-plus'><\/span>Add Row<\/a>"}],o.columns.unshift({command:[{name:"edit",template:"<a role='button' id='a-editBtn' class='k-button k-button-icontext k-grid-edit' href='\\#'><span id='s-editBtn' class='k-icon k-i-edit'><\/span>Edit<\/a>"},{name:"destroy",template:"<a role='button' id='a-deleteBtn' class='k-button k-button-icontext k-grid-delete trash-a-button' href='\\#'><span id='s-deleteBtn' class='k-icon k-i-trash trash-icon'><\/span><\/a>"}],title:"&nbsp;",width:"135px",locked:!0})),o};n.isMinimumRowRequired=function(n){return r.isMinimumRowRequired(n)};n.checkForInvalidRow=function(n){return r.checkForInvalidRow(n)}},s}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.GenericModuleCustomFieldsDirective=r})(t=n.CustomFields||(n.CustomFields={}))}(app||(app={})),function(n){var t;(function(t){"use strict";var i=function(){function i(){this.dateFormat=n.Constants.GlobalConstants.DateFormat}return i.prototype.isInvalidRowPresent=function(n){var i=this,t=!1;return angular.forEach(n.CustomGroups,function(n){angular.forEach(n.CustomFields,function(n){n.IsTable&&!n.HideField&&angular.forEach(n.CustomFieldTableRows,function(n){n.IsValidRow||(t=!0)})})}),t},i.prototype.hasInvalidTable=function(n){var t=!1;return angular.forEach(n.CustomGroups,function(n){angular.forEach(n.CustomFields,function(n){n.IsTable&&!n.HideField&&n.IsRequired&&n.CustomFieldTableRows.length===0&&(t=!0)})}),t},i.prototype.checkForRequiredTable=function(n){var t=this;n.CustomFieldTableRows.length>0&&angular.forEach(n.CustomFieldTableColumnRefItems,function(i,r){var u=n.CustomFieldTableRows[0]["Column"+r];if(u.IsRequired&&(u.Value==null||u.Value=="")){n.HideField=!1;n.CustomFieldTableRows=[];t.formatDateForExistingRows(n);n.tableData.rows=n.CustomFieldTableRows;return}})},i.prototype.setLayout=function(n,t){var r=this,i;return t===void 0&&(t=0),i="c_"+t,n&&n.CustomGroups&&angular.forEach(n.CustomGroups,function(n,t){n.hasValue=!1;var u=i+"_g_"+t,f=$.grep(n.CustomFields,function(n){return n.IsFooter});angular.forEach(n.CustomFields,function(t,i){t.Value!==undefined&&t.Value!==null&&t.Value!==""&&(n.hasValue=!0);var e=u+"_f_"+i;t.typeData=r.getTypeData(t,f,e)})}),n},i.prototype.getTypeData=function(n,i,r){var o=this,u={id:r,elementType:"text",isMulti:!1,maxLength:"50"},e,f;switch(n.FieldTypeId){case 1:u.isMulti=!0;break;case 2:u.pattern=/^(-?)\d*(?:\.\d+)?$/;u.maxLength="15";break;case 3:u.pattern=/^(-?)[1]{0,1}[0-9]{0,9}$/;u.maxLength="10";break;case 4:u.elementType="checkbox";n.Value=n.Value&&(n.Value.toString().toUpperCase()==="TRUE"||n.Value==="1")?!0:!1;break;case 5:u.elementType="date";u.controller=new t.DateController;break;case 6:n.IsReadOnly?angular.forEach(n.CustomPickListItems,function(t){t.Value===n.Value&&(u.altValue=t.Value)}):n.Value&&(n.ShowValueComboBox=n.Value,e=n.CustomPickListItems.filter(function(t){return t.Value===n.Value})[0],e&&(n.Value=e.PackageId));u.elementType="select";break;case 7:u.elementType="many";break;case 8:u.elementType="currency";u.pattern=/^(-?)(\$?)(\d*)(?:\.[0-9]{1,2})?$/;u.inputGroup={pre:"$"};u.maxLength="18";break;case 10:u.elementType="table";f={};f.label=n.Label;f.headers=[];f.rows=[];angular.forEach(n.CustomFieldTableColumnRefItems,function(n,t){n.Value=n.DefaultValue;n.typeData=o.getTypeDataForCustomTableColumn(n,r+"_"+t);n.Label=n.DisplayName;var u={};u.footer={};u.displayName=n.DisplayName;n.HasFooter&&angular.forEach(i,function(t){t.FieldName==n.FooterFieldName&&(u.footer.label=t.Label,u.footer.value=t.Value)});f.headers.push(u)});n.CustomFieldTableRows=[];n.retiredColumns=o.getRetiredColumnIndexes(n);n.tableData=f;n.tableData.rows=n.CustomFieldTableRows;break;case 11:u.elementType="hyperlink"}return u},i.prototype.getTypeDataForCustomTableColumn=function(n,i){var u=this,r={id:i,elementType:"text",isMulti:!1,maxLength:"50"};if(n.ControlTypeID==2)r.elementType="select",n.CustomPickListItems=[],angular.forEach(n.PickListItems,function(t){t.Retire||(n.CustomPickListItems.push({Label:t.Value,Value:t.Value,PackageId:t.CustomFieldPickListItemID}),t.CustomFieldPickListItemID===n.Value&&(r.altValue=t.Value))});else if(n.ControlTypeID==3)r.elementType="checkbox",n.Value=n.Value&&(n.Value.toString().toUpperCase()==="TRUE"||n.Value==="1")?!0:!1;else if(n.ControlTypeID==1)switch(n.CustomFieldTypeID){case 1:r.pattern=/^(-?)\d*(?:\.\d+)?$/;r.maxLength="15";break;case 2:r.elementType="currency";r.pattern=/^(-?)(\$?)(\d*)(?:\.[0-9]{1,2})?$/;r.inputGroup={pre:"$"};r.maxLength="18";break;case 3:r.elementType="date";r.controller=new t.DateController;break;case 4:r.pattern=/^(-?)[1]{0,1}[0-9]{0,9}$/;r.maxLength="10";break;case 6:r.isMulti=!0}return r},i.prototype.addDefaultRows=function(n){var i=this,t;if(n.CustomFieldTableRows==null&&(n.CustomFieldTableRows=[]),n.IsRequired&&n.DefaultTableRows==0&&(n.DefaultTableRows=1),n.DefaultTableRows>n.CustomFieldTableRows.length)while(n.DefaultTableRows>n.CustomFieldTableRows.length)t=n.CustomFieldTableRows.length,n.CustomFieldTableRows[t]=i.getNewCustomFieldTableRow(),n.CustomFieldTableRows[t].CustomFieldTableRowColumnCount=n.CustomFieldTableColumnRefItems.length,n.CustomFieldTableRows[t].CustomFieldTableRowNumber=t,angular.forEach(n.CustomFieldTableColumnRefItems,function(r,u){n.CustomFieldTableRows[t]["Column"+u]=i.getCustomFieldTableCell(r,u,t);i.isColumnValid(n.CustomFieldTableRows[t]["Column"+u],r)||(n.CustomFieldTableRows[t].IsValidRow=!1)})},i.prototype.formatDateForExistingRows=function(n){var t=this;n.CustomFieldTableRows!=null&&angular.forEach(n.CustomFieldTableRows,function(i){angular.forEach(n.CustomFieldTableColumnRefItems,function(n,r){n.CustomFieldTypeID==3&&(i["Column"+r].Value==null||i["Column"+r].Value==""?i["Column"+r].Value="":moment(i["Column"+r].Value).isValid()&&(i["Column"+r].Value=moment(new Date(i["Column"+r].Value)).format(t.dateFormat)))})})},i.prototype.getRetiredColumnIndexes=function(n){var i=this,t=[];return angular.forEach(n.CustomFieldTableColumnRefItems,function(i,r){var u=!0;i.Retire&&(u=!1,angular.forEach(n.CustomFieldTableRows,function(n){n["Column"+r].Value!=null&&(u=!0)}));u||t.push(r)}),t},i.prototype.isColumnValid=function(n,t){if(t.IsRequired&&(n.Value==null||n.Value==""))return!1;if(t.typeData.pattern!=undefined){var i=t.typeData.pattern;if(n.Value!=null&&n.Value!=""&&!i.test(n.Value))return!1}return t.typeData.elementType=="date"&&n.Value!=null&&n.Value!=""&&!moment(n.Value,[this.dateFormat]).isValid()?!1:n.Value!=null&&n.Value.length>t.typeData.maxLength?!1:!0},i.prototype.getCustomFieldTableCell=function(t,i,r){var u={CustomField:t.FieldName,CustomFieldLayoutControlType:t.ControlTypeID,CustomFieldTableCellColumnRefID:t.CustomFieldTableColumnRefID,CustomFieldTableCellType:t.ControlTypeID===n.Common.CustomFieldsControlTypes.ComboBox?n.Common.CustomFieldCellTypes.GID:t.CustomFieldTypeID,CustomFieldTableRowNumber:r,CustomFieldType:t.CustomFieldTypeID,Defaultvalue:t.DefaultValue,FieldName:"Column"+i,Formula:t.Formula,IsReadOnly:t.HasFormula,IsRequired:t.IsRequired,Label:t.DisplayName,Value:t.Value,PickListItems:t.PickListItems,Retire:t.Retire};return t.CustomFieldTypeID==3&&(u.Value==null||u.Value==""?u.Value="":moment(u.Value).isValid()&&(u.Value=moment(new Date(u.Value)).format(this.dateFormat))),t.ControlTypeID==3&&(u.CustomFieldTableCellType=7,u.Value=u.Value==!0),u},i.prototype.getNewCustomFieldTableRow=function(){return{CustomFieldTableObjectID:null,CustomFieldTableRowNumber:0,CustomFieldTableRowColumnCount:0,IsValidRow:!0,RowID:0,Column0:null,Column1:null,Column2:null,Column3:null,Column4:null,Column5:null,Column6:null,Column7:null,Column8:null,Column9:null,Column10:null,Column11:null,Column12:null,Column13:null,Column14:null,Column15:null,Column16:null,Column17:null,Column18:null,Column19:null,Column20:null,Column21:null,Column22:null,Column23:null,Column24:null,Column25:null,Column26:null,Column27:null,Column28:null,Column29:null,Column30:null,Column31:null,Column32:null,Column33:null,Column34:null,Column35:null,Column36:null,Column37:null,Column38:null,Column39:null,Column40:null,Column41:null,Column42:null,Column43:null,Column44:null,Column45:null,Column46:null,Column47:null,Column48:null,Column49:null,Column50:null}},i}();t.GenericModuleCustomFieldsService=i})(t=n.CustomFields||(n.CustomFields={}))}(app||(app={})),function(n){var t;(function(t){"use strict";var i=function(){function t(){this.ValidationRegEx_SolarAppApprovalID="SA[0-9a-zA-Z]+-[0-9a-zA-Z]+-[0-9a-zA-Z]+-[0-9a-zA-Z]+-[a-zA-Z]{1}";this.TableFieldName_SolarAppApprovalID="SolarAppApprovalID";this.TableFieldPlaceholder_SolarAppApprovalID="SA12Ab34cD-1a-B2-3cD4-Z";this.TableValidation_SolarAppApprovalID="SolarAppApprovalID should have format like e.g. SA12Ab34cD-1a-B2-3cD4-Z."}return t.prototype.generateGridModel=function(n,t,i){var u=this,f={},r={};return n.forEach(function(n,f){var e=n.FieldName,s="Column"+f,o=u.getEquivalentGridType(n);i?r[e]={from:s+".Value",type:o}:(r[e]={from:s+".Value",defaultValue:n.ControlType==="ComboBox"&&n.typeData.elementType==="select"?n.DefaultValue?n.CustomPickListItems.filter(function(t){return t.Value===n.DefaultValue})[0].PackageId:"":n.DefaultValue,validation:{required:n.IsRequired,validationMessage:n.Label+" is a required field"},editable:!n.HasFormula,type:o},r[s]={defaultValue:{}},o==="date"?t.push(s):o==="number"||(o==="boolean"?r[e].defaultValue=n.DefaultValue.toUpperCase()==="TRUE":o==="string"&&(n.CustomFieldTypeID==6?r[e].validation.maxLength=2e3:e===u.TableFieldName_SolarAppApprovalID?(r[e].validation.pattern=u.ValidationRegEx_SolarAppApprovalID,r[e].validation.placeholder=u.TableFieldPlaceholder_SolarAppApprovalID,r[e].validation.validationMessage=u.TableValidation_SolarAppApprovalID,r[e].validation.maxLength=50):r[e].validation.maxLength=50)))}),r.RowID={editable:!1,nullable:!0},f.id="RowID",f.fields=r,f},t.prototype.generateGridColumns=function(n){var r=this,t=0,u=angular.element(document.getElementById("customFields"))[0].clientWidth-30,i;return n.forEach(function(n){t+=n.ColumnWidth}),i=t<u-135,n.map(function(u){var e=u.FieldName,f={field:e,width:i?(u.ColumnWidth/t*100).toFixed(1)+"%":u.ColumnWidth+"px",title:u.DisplayName,format:r.getFieldFormat(u),attributes:{id:e+"-#=RowID#"}};return n.indexOf(u)===n.length-1&&i&&(f.width="auto"),u.ControlType==="CheckBox"?f.template="#="+e+" ? 'Yes' : 'No'#":u.ControlType==="ComboBox"&&u.typeData.elementType==="select"?(f.editor=function(n,t){$("<input "+(u.IsRequired?"required ":"")+'name="'+u.Label+'" data-text-field="Label" data-value-field="PackageId" data-bind="value:'+t.field+'" /> ').appendTo(n).kendoDropDownList({autoBind:!1,dataTextField:"Label",dataValueField:"PackageId",dataSource:{data:u.CustomPickListItems},valuePrimitive:!0,change:function(){}})},f.template=function(n){var t=n[u.FieldName],i;return t?(i=u.CustomPickListItems.filter(function(n){return n.PackageId===t}),i.length>0)?i[0].Label:u.CustomPickListItems.filter(function(n){return n.Value===t})[0].Label:""}):u.CustomFieldTypeID==6&&(f.editor=function(n,t){$("<textarea "+(u.IsRequired?"required ":"")+'name="'+u.Label+'" rows="4" cols="31" data-bind="value:'+t.field+'" /> ').appendTo(n)}),f})},t.prototype.getFieldFormat=function(t){switch(t.CustomFieldType.toLocaleUpperCase()){case"CURRENCY":return"{0:c}";case"WHOLE NUMBER":return"{0:n0}";case"DATE":return"{0:"+n.Constants.GlobalConstants.DateFormatForSearch+"}";default:return""}},t.prototype.getEquivalentGridType=function(n){if(n.ControlType.toLocaleUpperCase()==="TEXTBOX")switch(n.CustomFieldType.toLocaleUpperCase()){case"CURRENCY":case"NUMBER":case"WHOLE NUMBER":return"number";case"DATE":return"date";default:return"string"}else return n.ControlType.toLocaleUpperCase()==="CHECKBOX"?"boolean":"string"},t.prototype.isMinimumRowRequired=function(n){return n.IsRequired&&n.CustomFieldTableRows.length===0},t.prototype.checkForInvalidRow=function(n){return n.length===0?!1:n.some(function(n){return!n.IsValidRow})},t.prototype.updateRowModel=function(t,i,r,u){if(t[r].Value instanceof Date)i[r].Value=kendo.toString(t[r].Value,n.Constants.GlobalConstants.DateFormatForSearch);else if(u.ControlType==="ComboBox"&&u.typeData.elementType==="select"&&t[r].Value===u.DefaultValue){var f=u.CustomPickListItems.filter(function(n){return n.Value===t[r].Value});f.length>0&&(i[r].Value=f[0].PackageId)}else i[r].Value=t[r].Value},t}();t.TelerikCustomFieldGridService=i})(t=n.CustomFields||(n.CustomFields={}))}(app||(app={})),function(n){var t;(function(n){"use strict";angular.module("app.CustomFields",["app.Common.Services","ui.bootstrap.modal","kendo.directives"]).service("customFieldsService",["http",n.CustomFieldsService]).service("genericModuleCustomFieldsService",[n.GenericModuleCustomFieldsService]).service("telerikCustomFieldGridService",[n.TelerikCustomFieldGridService]).controller("customFieldsController",["customFieldsService","telerikCustomFieldGridService","resourceService","$timeout","$modal","$scope",n.CustomFieldsController]).directive("genericModuleCustomFields",["genericModuleCustomFieldsService","telerikCustomFieldGridService","resourceService","$timeout","$modal","globalsService",function(t,i,r,u,f,e){return new n.GenericModuleCustomFieldsDirective(t,i,r,u,f,e)}])})(t=n.CustomFields||(n.CustomFields={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n,t,i){this.http=n;this.$location=t;this.utilities=i;this.isDraftResumed=!1}return n.prototype.saveDraft=function(n,t){var i=this;this.http.post("/draft",n,function(n){n.Success&&(i.utilities.showMessage(i.utilities.getResourceMessage("DraftSaveSuccessfulMessage","Save Has Been Successful."),i.utilities.getResourceMessage("ClientSiteResource_Success","Success")),t(n.Result.DraftId))})},n.prototype.getDraftById=function(n,t){var i=this;this.http.get("/draft/"+n,function(n){n.Success?n.Result!==null&&t(n.Result):t(null)})},n.prototype.deleteDraftById=function(n,t,i){this.http.delete("/draft/"+n,function(n){n.Success&&typeof t!="undefined"&&t(n.Result)},i)},n}();n.DraftService=t})(t=n.Services||(n.Services={}))})(t=n.Draft||(n.Draft={}))}(app||(app={})),function(n){var t;(function(){"use strict";var t=n.Draft.Services.DraftService;angular.module("app.Draft",["app.globalsModule","app.Common.Services","app.Services.Utilities"]).service("draftService",["http","$location","utilities",t])})(t=n.Draft||(n.Draft={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i,r){var u=n.call(this,r)||this;return u.systemInfoService=t,u.registerUserService=i,u.retryCount=10,u.showNoRecaptchaMessage=!1,u.showReCaptchaCard=!1,u.arcGisIntegrationInfo=u.getDefaultSystemInfo(),u.selfServiceInfo=u.getDefaultSystemInfo(),u.selfServiceWebAPIInfo=u.getDefaultSystemInfo(),u.getDate(),u.getTenantDiagnostics(),u.getArcGisIntegrationDiagonstics(),u.getSelfServiceWebAPIDiagonistics(),u.getSelfServiceDiagonistics(),u.getSecondaryData(),u}return __extends(t,n),t.prototype.getDefaultSystemInfo=function(){return{Name:"Unavailable",Version:"Unavailable",ConnectionInfo:[],MiscInfo:[],EnerGovDataVersion:""}},t.prototype.getTenantDiagnostics=function(){var n=this;n.systemInfoService.getTenantSystemInfo(function(t){t!==null&&(n.tenantInfo=t)})},t.prototype.getArcGisIntegrationDiagonstics=function(){var n=this;n.systemInfoService.getArcGisIntegrationSystemInfo(function(t){t!=null&&(n.arcGisIntegrationInfo=t)})},t.prototype.getSelfServiceWebAPIDiagonistics=function(){var n=this;n.systemInfoService.getSelfServiceWebAPISystemInfo(function(t){t!=null&&(n.selfServiceWebAPIInfo=t)})},t.prototype.getSelfServiceDiagonistics=function(){var n=this;n.systemInfoService.getSelfServiceSystemInfo(function(t){t!=null&&(n.selfServiceInfo=t)})},t.prototype.getDate=function(){this.currentDate=(new Date).toLocaleString()},t.prototype.getSecondaryData=function(){var n=this;n.registerUserService.getSecondaryData(function(t){n.secondaryData=t;n.secondaryData!=null&&n.secondaryData.GlobalSetting!=null&&(n.showReCaptchaCard=!n.secondaryData.GlobalSetting.DisableGoogleRecaptcha,n.siteKey=n.secondaryData.GlobalSetting.GoogleRecaptchaSiteKey,n.renderRecaptcha())})},t.prototype.renderRecaptcha=function(){var n=this;window.grecaptcha?this.recaptchaWidget=window.grecaptcha.render("regRecaptcha",{sitekey:this.siteKey,theme:"light"}):(n.retryCount--,n.retryCount>0?setTimeout(function(){n.renderRecaptcha()},500):n.showNoRecaptchaMessage=!0)},t}(n.Core.Controllers.CoreController);t.SystemInfoController=i})(i=t.Controllers||(t.Controllers={}))})(t=n.Systemwide||(n.Systemwide={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n,t){this.http=n;this.globalService=t;var i=this}return n.prototype.getTenantSystemInfo=function(n){var t={tenantId:this.globalService.tenantId};this.http.get("/systemwide/systeminfo/tenant-system-info",function(t){t.Success&&n(t.Result)},!1,t)},n.prototype.getSelfServiceWebAPISystemInfo=function(n){this.http.get("/systemwide/systeminfo/selfservicewebapi",function(t){t.Success&&n(t.Result)},!1)},n.prototype.getSelfServiceSystemInfo=function(n){this.http.get("/selfservice/systemsupport/systeminfo",function(t){t.Success&&n(t.Result)},!1)},n.prototype.getArcGisIntegrationSystemInfo=function(n){this.http.get("/map/integration/getSystemInfo",function(t){t.Success&&n(t.Result)},!1)},n}();n.systemInfoService=t})(t=n.Services||(n.Services={}))})(t=n.systemwide||(n.systemwide={}))}(app||(app={})),function(n){var t;(function(){"use strict";var t=n.Systemwide.Controllers.SystemInfoController;angular.module("app.Systemwide",["app.Common.Services","app.Common.Services.Http"]).service("systemInfoService",["http","globalsService",n.systemwide.Services.systemInfoService]).controller("systemInfoController",["systemInfoService","registerUserService",t])})(t=n.Systemwide||(n.Systemwide={}))}(app||(app={})),function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n){this.http=n;this.rootUrl="/energov/certification/types";this.contactCertificateUrl="/energov/entity/contacts/search/contactcertificates";this.globalEntityCertificateUrl="/energov/entity/contacts/search/globalentitycertificates";this.certificateValidateUpdateByCertificateUrl="/certification/validate-update-by-certificate";this.certificateValidateUpdateByEntityIdsUrl="/certification/validate-update-by-entity"}return n.prototype.getDefaultCertification=function(n,t){return{CertificationTypeId:n,LicenseNumber:t,CertificationId:null,CertificationTypeName:null,Comments:null,CompanyName:null,CertificationGroupId:null,ClassificationList:[],CertificationGroupName:null,MaxCommercialValue:null,MaxResidentialValue:null,IsNew:!1,IsDeleted:!1,ClientId:null}},n.prototype.verifyCertificate=function(n,t,i){var r=this,u=r.getDefaultCertification(n,t),f={Certifications:[u]};r.http.post("/StateLicense/validate-global-entity-certifications",f,function(t){var e=null,f,r,u;t.Success&&t.Result.ValidationResults&&t.Result.ValidationResults.length>0&&(f="",r=t.Result.ValidationResults[0].LicenseForDisplay.InfoGroups.filter(function(n){return n.Title.toLowerCase()==="contacts"}),r&&r.length>0&&(u=r[0].InfoFields.filter(function(n){return n.FieldName.toLowerCase()==="company"}),u&&u.length>0&&(f=u[0].FieldStringValue)),e={CertificationId:"",CertificationGroupId:"",CertificationGroupName:"",ClassificationList:[],Comments:t.Result.ValidationResults[0].LicenseForUpdate.Comments,CertificationTypeId:n,CertificationTypeName:"",LicenseNumber:t.Result.ValidationResults[0].LicenseForUpdate.LicenseNumber,ExpireDate:t.Result.ValidationResults[0].LicenseForUpdate.ExpireDate,IssueDate:t.Result.ValidationResults[0].LicenseForUpdate.IssueDate,CompanyName:f,MaxCommercialValue:null,MaxResidentialValue:null,IsNew:!1,IsDeleted:!1,ClientId:null});i(e)})},n.prototype.isCertificateSubjectToStateValidate=function(n,t){var i=this;i.http.get(i.rootUrl,function(i){var r=i.filter(function(t){return t.CertificationTypeID==n})[0].SubjectToLicenseValidation;t(r)})},n.prototype.getCertificateTypes=function(n){var t=this;t.certificationTypes&&t.certificationTypes.length>0&&n(t.certificationTypes);t.http.get(t.rootUrl,function(i){t.certificationTypes=i.Result;n(i.Result)})},n.prototype.getCertificateAndTypeInformation=function(n,t){this.http.post(this.contactCertificateUrl,n,function(n){t(n)})},n.prototype.getGlobalEntityCertificates=function(n,t){var i=this;i.http.get(i.globalEntityCertificateUrl+"/"+n,function(n){t(n.Result)})},n.prototype.checkAndUpdateContactCertificates=function(n,t){var i=this,r={PageNumber:1,SortField:"",IsSortedInAscendingOrder:!0,PageSize:100,EntityId:n,ModuleId:0};i.getCertificateAndTypeInformation(r,function(n){if(n.Success){i.certificatesSubjectToLicenseValidation=[];n.Result.forEach(function(n){if(n.SubjectToLicenseValidation){var t={CertificationId:n.CertificationId,CertificationTypeId:n.CertificationTypeId,CertificationTypeName:n.CertificationType,LicenseNumber:n.CertificationNumber,Comments:"",CompanyName:"",IssueDate:null,ExpireDate:null,ClassificationList:[],CertificationGroupId:"",CertificationGroupName:"",MaxCommercialValue:0,MaxResidentialValue:0,IsNew:!1,IsDeleted:!1,ClientId:null};i.certificatesSubjectToLicenseValidation.push(t)}});var r={Certifications:i.certificatesSubjectToLicenseValidation};i.http.post(i.certificateValidateUpdateByCertificateUrl,r,function(n){t(n)})}})},n.prototype.checkAndUpdateContactsCertificatesByEntityIds=function(n,t){var i=this,r={GlobalEntityIds:n};i.getEnerGovIsLicenseIntegratedSetting(function(n){n?i.http.post(i.certificateValidateUpdateByEntityIdsUrl,r,function(n){t(n)}):t(null)})},n.prototype.getEnerGovIsLicenseIntegratedSetting=function(n){var t=this;return t.http.get("/energovsetting/islicenseintegrated",function(t){t.Success&&n(t.Result)},!0)},n}();n.CertificationService=t})(t=n.Services||(n.Services={}))})(t=n.Certification||(n.Certification={}))}(app||(app={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t,i,r,u){var f=n.call(this)||this,e;return f.$modal=t,f.certificationService=i,f.$timeout=u,f.replace=!0,e=f,f.templateUrl=r.baseUrl+"x/directiveTemplate/Template?templateName=_CertificationValidation&v="+r.version,f.restrict="AE",f.scope={fillCertificate:"&",requiredCertTypeId:"=?",useButton:"=?"},f.link=function(n,r){function f(){var i=t.open({templateUrl:"certificateValidationForm.html",backdrop:"static",windowClass:"certificate-validation",size:"lg",keyboard:!1,controller:["$scope",function(t){t.stateCertificateTypes=n.stateCertificateTypes;t.requiredCertTypeId=n.requiredCertTypeId;t.showDetailsSection=!1;t.datePickerOptions={formatYear:"yy",startingDay:0,showWeeks:!1,maxDate:null};t.contactCertificate=e.certificationService.getDefaultCertification(t.requiredCertTypeId);t.saveCertificate=function(){var i=n.stateCertificateTypes.filter(function(n){return n.CertificationTypeID===t.verifiedContactCertificate.CertificationTypeId});t.verifiedContactCertificate.CertificationTypeName=i[0].Name;t.verifiedContactCertificate.IsNew=!0;n.fillCertificate({certificate:t.verifiedContactCertificate});n.closeBox()};t.closeBox=function(){n.closeBox()};t.clear=function(){t.contactCertificate=e.certificationService.getDefaultCertification(t.requiredCertTypeId);t.showDetailsSection=!1;t.invalidLicenseNumber=null;t.certificateValidationForm.$setPristine();t.certificateValidationForm.$setUntouched()};t.verifyCertificate=function(){t.invalidLicenseNumber=null;t.isVerifying=!0;e.certificationService.verifyCertificate(t.contactCertificate.CertificationTypeId,t.contactCertificate.LicenseNumber,function(n){t.isVerifying=!1;n?(t.verifiedContactCertificate=n,t.contactCertificate=e.certificationService.getDefaultCertification(t.contactCertificate.CertificationTypeId,t.contactCertificate.LicenseNumber),t.contactCertificate.Comments=n.Comments,t.contactCertificate.ExpireDate=n.ExpireDate,t.contactCertificate.IssueDate=n.IssueDate,t.contactCertificate.CompanyName=n.CompanyName,t.showDetailsSection=!0,t.setNewFocus("#saveBtn",0)):(t.invalidLicenseNumber=t.contactCertificate.LicenseNumber,t.setNewFocus("#invalidLicenseError",300))})};t.modalPopupLastElementKeyDown=function(n,i){i.stopPropagation();i.shiftKey||i.keyCode!==9||(i.preventDefault(),t.setNewFocus("#"+n,0))};t.modalPopupFirstElementKeyDown=function(n,i){i.stopPropagation();i.shiftKey&&i.keyCode===9&&(i.preventDefault(),t.showDetailsSection?t.setNewFocus("#saveBtn",0):t.certificateValidationForm.$invalid?t.setNewFocus("#cancelBtn",0):t.setNewFocus("#verifyBtn",0))};t.keyDownOnCancelButton=function(n,i){t.certificateValidationForm.$invalid&&(i.stopPropagation(),i.shiftKey||i.keyCode!==9||(i.preventDefault(),t.setNewFocus("#"+n,0)))};t.setNewFocus=function(n,t){var r=this,i=angular.element(n);i&&u(function(){i.focus()},t)};t.licenseNumberChanged=function(){t.contactCertificate.LicenseNumber&&t.contactCertificate.LicenseNumber!==""||(t.invalidLicenseNumber=null)}}]});n.useButton=n.useButton;n.closeBox=function(){i.dismiss("cancel")}}i.getCertificateTypes(function(t){if(n.stateCertificateTypes=t.filter(function(n){return n.SubjectToLicenseValidation}),n.requiredCertTypeId){var i=n.stateCertificateTypes.filter(function(t){return t.CertificationTypeID===n.requiredCertTypeId});i&&i.length>0&&(n.requiredCertTypeName=i[0].Name)}});r.on("click",function(){f()})},f}return __extends(t,n),t}(n.Directives.Core.BaseDirective);t.CertificationValidationDirective=i;angular.module("app.Certification.Directives",["ui.bootstrap.modal","app.Common.Services","enerGov.Common","app.Certification"]).directive("certification",["$modal","certificationService","globalsService","$timeout",function(n,t,r,u){return new i(n,t,r,u)}])})(i=t.Directives||(t.Directives={}))})(t=n.Certification||(n.Certification={}))}(app||(app={})),function(n){var t;(function(){"use strict";angular.module("app.Certification",["ui.bootstrap.modal","app.Common.Services","enerGov.Common"]).service("certificationService",["http",n.Certification.Services.CertificationService])})(t=n.Certification||(n.Certification={}))}(app||(app={})),function(n){"use strict";angular.module("app.main",["ngCookies","ngMessages","ngRoute","ngSanitize","ngAria","ngFileUpload","ngMaterial","mdSteppers","app.globalsModule","app.Services.Utilities","app.Directives.Common","app.Directives.Pagination","app.Directives.EnergovPagination","app.Directives.EnergovCaseApply","app.Directives.Menu","app.Directives.TylerAutoGrow","app.Directives.Modal","app.Directives.SubContactRequestAccessModal","app.Directives.CustomFields","app.EnerGov.Common.Directive.AttentionReason","EnerGov.Directives.TylerFileIcon","EnerGov.Directives.TylerSignaturePad","EnerGov.Directives.TylerHighlight","EnerGov.Directives.TylerStaffEmail","EnerGov.Directives.TylerTimeZoneFormatter","EnerGov.Directives.DonutChart","EnerGov.Directives.AddToCart","EnerGov.Directives.AddToTylerCart","EnerGov.Directives.IFrame","EnerGov.Directives.EReviewFileMarkupInfo","EnerGov.Directives.EReviewFileInfo","app.Common","app.Services.Menu","app.Services.TabNavigatorService","app.Filters","app.Controllers.Shell","app.Home","app.Directives.Validation","app.Directives.Address","app.Map","css.Map","app.tcpSettings",n.Constants.AppModule.ShoppingCartModule,n.Constants.AppModule.ConditionModule,"app.CustomFields","app.Systemwide","app.Users","app.AssociatedContacts","app.Dashboard","app.Draft","enerGov.Permit","enerGov.Plan","enerGov.Search","enerGov.Contact","enerGov.CheckList","enerGov.Hold","enerGov.Note","enerGov.Violation","enerGov.Address","enerGov.Inspection","enerGov.Submittal","enerGov.EReview","enerGov.Dashboard","enerGov.Summary","enerGov.WorkflowSummary","enerGov.Fee","enerGov.Invoice","enerGov.Common","enerGov.Attachment","enerGov.GlobalSearch","enerGov.CustomFields","enerGov.CodeCase","app.Services.Tenant","app.Services.SettingsService","enerGov.Map","errorCatcher",n.Constants.AppModule.AppEnerGovCommonDirectiveCart,n.Constants.AppModule.AppDirectiveShoppingCart,n.Constants.AppModule.EnerGovCommonDirectiveMapAddress,"app.EnerGov.Common.Directives.ExportToExcel","app.EnerGov.Common.Directives.AccessLevel","app.EnerGov.Common.Directives.GeoRuleNotificationModel","ui.bootstrap","ui.bootstrap.tpls","mwl.calendar","enerGov.calendar","enerGov.Event","enerGov.Report","enerGov.requests","enerGov.license","enerGov.business","app.pageTitle","app.Directives.DirtyTracking","app.Component.TylerProgressBar","app.Component.AutoCompleteAddress","app.Component.ShowFilesModal","app.Component.FileListAndDetail","app.Component.ShowCaseSubmissionFilesModal","app.Component.CaseSubmissionFilesTable","app.Component.ExistingFileListAndDetail","app.Component.MarkupsListTable","app.Component.HistoryListTable","enerGov.ApplicationAssistant","enerGov.TwilioServiceRequest",n.Constants.AppModule.TaxRemittanceModule,n.Constants.AppModule.TemplateModule,"angularUtils.directives.dirDisqus","enerGov.Comments","enerGov.Application","app.Certification","app.Certification.Directives","enerGov.project",n.Constants.AppModule.EscrowAccountModule,"EnerGov.Directives.AddFundToEscrowAccount"]).config(["$mdThemingProvider",function(n){var t=n.extendPalette("blue",{"400":"#0073c5"});n.definePalette("customBlue",t);n.theme("default").primaryPalette("customBlue",{"default":"400"}).accentPalette("orange")}]).config(["$routeProvider","globalsServiceProvider","localStorageServiceProvider","$locationProvider",function(t,i,r){var u=i.$get(),f=angular.injector(["ng","app.Services.Menu","app.Services.Tenant"]),e=f.get("tenantService");r.setNotify(!1,!1);n.Common.Helpers.RouteHelper.setRouteProvider(t);e.getTenants(function(i){u.tenants=i;i.length===1&&(u.tenantUrl=i[0].TenantUrl,u.tenantName=i[0].TenantName);t.when("/code/:id",{controller:"EnerGovCodeCaseViewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovcodecase/detail?v="+u.version,reloadOnSearch:!1}).when("/:module/apply/:menuId/success/:id",{controller:"enerGovApplySuccessController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/success?v="+u.version}).when("/application/:id",{controller:"enerGovApplicationViewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapplication/detail?v="+u.version,reloadOnSearch:!1}).when("/permits",{controller:"enerGovPermitSearchController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovpermit/search?v="+u.version}).when("/permit/:id",{controller:"enerGovPermitViewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovpermit/detail?v="+u.version,reloadOnSearch:!1}).when("/request/:id",{controller:"enerGovRequestsViewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovrequests/detail?v="+u.version,reloadOnSearch:!1}).when("/dashboard/my/permits/:filterIndex",{templateUrl:u.baseUrl+u.tenantUrl+"/dashboardDetail/viewMyPermits?v="+u.version,pageTitle:"PageTitle_MyPermits"}).when("/dashboard/my/permits/:filterIndex/:caseTypeFilter/:workClassFilter?",{templateUrl:u.baseUrl+u.tenantUrl+"/dashboardDetail/viewMyPermits?v="+u.version,pageTitle:"PageTitle_MyPermits"}).when("/permit/:id/submittal/:submittalId",{controller:"enerGovEntitySubmittalController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovsubmittal/detail?v="+u.version}).when("/permit/request/inspections/:id?/:isOptionalInspections?",{controller:"enerGovEntityRequestInspectionController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovinspection/RequestInspections?v="+u.version,pageTitle:"PageTitle_Request_Inspections"}).when("/plan/request/inspections/:id?/:isOptionalInspections?",{controller:"enerGovEntityRequestInspectionController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovinspection/RequestInspections?v="+u.version,pageTitle:"PageTitle_Request_Inspections"}).when("/businessLicense/request/inspections/:id?/:isOptionalInspections?",{controller:"enerGovEntityRequestInspectionController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovinspection/RequestInspections?v="+u.version,pageTitle:"PageTitle_Request_Inspections"}).when("/profLicense/request/inspections/:id?/:isOptionalInspections?",{controller:"enerGovEntityRequestInspectionController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovinspection/RequestInspections?v="+u.version,pageTitle:"PageTitle_Request_Inspections"}).when("/permit/apply/address",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/address?v="+u.version+"&entity=permit",pageTitle:"PageTitle_ApplyForPermit"}).when("/permit/apply/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=permit",pageTitle:"PageTitle_ApplyForPermit"}).when("/operationalPermit/apply/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_ApplyForOperationalPermit"}).when("/permit/:id/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=permit"}).when("/plan/apply/address",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/address?v="+u.version+"&entity=plan",pageTitle:"PageTitle_ApplyForPlan"}).when("/businessLicense/renew/address",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/address?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_RenewLicense"}).when("/businessLicense/renew/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_RenewLicense"}).when("/businessLicense/renew/businessType",{controller:"enerGovBusinessTypeCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/businessType?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_RenewLicense"}).when("/businessLicense/apply/businessType",{controller:"enerGovBusinessTypeCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/businessType?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_ApplyForBusinessLicense"}).when("/operationalPermit/apply/businessType",{controller:"enerGovBusinessTypeCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/businessType?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_ApplyForOperationalPermit"}).when("/profLicense/renew/address",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/address?v="+u.version+"&entity=professionalLicense",pageTitle:"PageTitle_RenewLicense"}).when("/profLicense/renew/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=professionalLicense",pageTitle:"PageTitle_RenewLicense"}).when("/profLicense/apply/address",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/address?v="+u.version+"&entity=professionalLicense",pageTitle:"PageTitle_ApplyForProfessionalLicense"}).when("/profLicense/apply/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=professionalLicense",pageTitle:"PageTitle_ApplyForProfessionalLicense"}).when("/businessLicense/apply/address",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/address?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_ApplyForBusinessLicense"}).when("/businessLicense/apply/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_ApplyForBusinessLicense"}).when("/plan/apply/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=plan",pageTitle:"PageTitle_ApplyForPlan"}).when("/plan/:id/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=plan"}).when("/permit/apply/addressmap",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/mapaddress?v="+u.version+"&entity=permit",pageTitle:"PageTitle_ApplyForPermit"}).when("/operationalPermit/apply/addressmap",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/mapaddress?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_ApplyForOperationalPermit"}).when("/plan/apply/addressmap",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/mapaddress?v="+u.version+"&entity=plan",pageTitle:"PageTitle_ApplyForPlan"}).when("/profLicense/apply/addressmap",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/mapaddress?v="+u.version+"&entity=professionalLicense",pageTitle:"PageTitle_ApplyForProfessionalLicense"}).when("/businessLicense/apply/addressmap",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/mapaddress?v="+u.version+"&entity=businessLicense",pageTitle:"PageTitle_ApplyForBusinessLicense"}).when("/invoice/:id/:isPayInvoice?",{controller:"enerGovInvoiceViewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovinvoice/detail?v="+u.version,reloadOnSearch:!1}).when("/plan/:id",{controller:"enerGovPlanViewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovplan/detail?v="+u.version,reloadOnSearch:!1}).when("/plan/:id/submittal/:submittalId",{controller:"enerGovEntitySubmittalController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovsubmittal/detail?v="+u.version}).when("/checkout",{controller:n.Constants.ControllerConstant.ShoppingCartCheckoutController,controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/shoppingcart/Checkout?v="+u.version}).when("/thankyou",{controller:"thankYouController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/home/thankyou?v="+u.version}).when("/i/:id",{controller:"menuIframeController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/home/menuiframe"}).when("/thankyoureview",{controller:"thankYouController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/home/thankyoureview?v="+u.version}).when("/inspection/todaysinspections",{templateUrl:u.baseUrl+u.tenantUrl+"/EnerGovInspection/TodaysInspections?v="+u.version,pageTitle:"PageTitle_TodaysInspections"}).when("/forgetPassword",{controller:"forgetPasswordController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/home/forgetpassword?v="+u.version}).when("/forgotUsername",{controller:"forgotUsernameController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/home/forgotusername?v="+u.version}).when("/resetpassword/:id",{controller:"resetPasswordController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/home/resetpassword?v="+u.version}).when("/paymentsuccess",{controller:"paymentSuccessController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/shoppingcart/PaymentSuccess?v="+u.version}).when("/paymentsuccess/:id",{controller:"paymentSuccessController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/shoppingcart/PaymentSuccess?v="+u.version}).when("/paymenterror/:id",{controller:"paymentErrorController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/shoppingcart/PaymentError?v="+u.version}).when("/dashboard/my/plans/:filterIndex",{templateUrl:u.baseUrl+u.tenantUrl+"/dashboardDetail/viewMyPlans?v="+u.version,pageTitle:"PageTitle_MyPlans"}).when("/dashboard/my/plans/:filterIndex/:caseTypeFilter/:workClassFilter?",{templateUrl:u.baseUrl+u.tenantUrl+"/dashboardDetail/viewMyPlans?v="+u.version,pageTitle:"PageTitle_MyPlans"}).when("/dashboard/my/existinginspections/:filterIndex",{templateUrl:u.baseUrl+u.tenantUrl+"/dashboardDetail/viewMyExistingInspections?v="+u.version,pageTitle:"PageTitle_MyRemainingInspections"}).when("/dashboard/my/existinginspections/:filterIndex/:inspectionTypeFilter",{templateUrl:u.baseUrl+u.tenantUrl+"/dashboardDetail/viewMyExistingInspections?v="+u.version,pageTitle:"PageTitle_MyRemainingInspections"}).when("/systemsupport/systeminfo",{controller:"systemInfoController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/systeminfo/Index?v="+u.version,caseInsensitiveMatch:!0}).when("/inspectionDetail/inspection/:id",{controller:"enerGovInspectionViewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/EnerGovInspection/InspectionDetail?v="+u.version,reloadOnSearch:!1}).when("/business/:id",{controller:"enerGovBusinessViewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/enerGovBusiness/businessEntityDetail?v="+u.version,reloadOnSearch:!1}).when("/businessLicense/renew/:id/:typeId/:classId",{controller:"enerGovBusinessLicenseRenewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovLicense/RenewBusinessLicense?v="+u.version,pageTitle:"PageTitle_RenewLicense"}).when("/businessLicense/apply/business/:menuId",{controller:"enerGovBusinessCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/enerGovBusiness/BusinessCards?v="+u.version,pageTitle:"PageTitle_ApplyForBusinessLicense"}).when("/businessLicense/apply/all/:menuId",{controller:"enerGovApplyAllController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovLicense/ApplyBusinessLicense?v="+u.version,pageTitle:"PageTitle_ApplyForBusinessLicense"}).when("/businessLicense/apply/:id/:menuId/:draftId/:actionTypeId",{controller:"enerGovBusinessLicenseApplyController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovLicense/ApplyBusinessLicense?v="+u.version,pageTitle:"PageTitle_ApplyForBusinessLicense"}).when("/businessLicense/apply/:menuId/:draftId/:actionTypeId",{controller:"enerGovBusinessLicenseApplyController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovLicense/ApplyBusinessLicense?v="+u.version,pageTitle:"PageTitle_ApplyForBusinessLicense"}).when("/operationalPermit/apply/:id/:menuId/:draftId/:actionTypeId",{controller:"enerGovBusinessLicenseApplyController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovLicense/ApplyBusinessLicense?v="+u.version,pageTitle:"PageTitle_ApplyForOperationalPermit"}).when("/operationalPermit/renew/:id/:typeId/:classId",{controller:"enerGovBusinessLicenseRenewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovLicense/RenewBusinessLicense?v="+u.version,pageTitle:"PageTitle_RenewLicense"}).when("/profLicense/renew/:id/:typeId/:classId",{controller:"enerGovProfessionalLicenseRenewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovLicense/RenewProfessionalLicense?v="+u.version,pageTitle:"PageTitle_RenewLicense"}).when("/analytics",{controller:"analyticsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/home/analytics?v="+u.version}).when("/callback.html",{templateUrl:u.baseUrl+u.tenantUrl+"/home/Callback?v="+u.version}).when("/applicationAssistant",{controller:"enerGovApplicationAssistantController",controllerAs:"vm",reloadOnSearch:!1,templateUrl:u.baseUrl+u.tenantUrl+"/home/ApplicationAssistant?v="+u.version,pageTitle:"PageTitle_ApplicationAssistant"}).when("/guidedapplication",{controller:"navigatorController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/home/Navigator?v="+u.version}).when("/joinmeeting/:id",{controller:"enerGovTwilioJoinMeetingController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovtwilioservicerequests/joinmeeting?v="+u.version}).when("/manageMyUser/address/:action",{controller:"addressController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/home/UpsertUserAddress?v="+u.version}).when("/application/apply/address",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/address?v="+u.version+"&entity=application",pageTitle:"PageTitle_ApplyForApplication"}).when("/application/apply/contact",{controller:"enerGovContactCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/contact?v="+u.version+"&entity=application",pageTitle:"PageTitle_ApplyForApplication"}).when("/application/apply/addressmap",{controller:"enerGovAddressCardsController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovapply/mapaddress?v="+u.version+"&entity=application",pageTitle:"PageTitle_ApplyForApplication"}).when("/project/:id",{controller:"enerGovProjectViewController",controllerAs:"vm",templateUrl:u.baseUrl+u.tenantUrl+"/energovproject/detail?v="+u.version,reloadOnSearch:!1})})}]).config(["$locationProvider",function(n){n.hashPrefix("")}]).run(["pageTitleService",function(){}]).run(["$rootScope","utilities","tabNavigatorService","$timeout",function(t,i,r,u){t.$on("$routeChangeStart",function(t,u){var f=document.getElementById("skip-to-content");f&&(f.style.position="absolute");u&&u.params&&u.params.tab&&Object.values(n.Constants.TabConstants).includes(u.params.tab)&&(r.scrollIntoViewIsNeeded=!0);i.showPleaseWait()});t.$on("$viewContentLoaded",function(){var n=i.$window.location.href,t=n.indexOf("search")>0&&n.indexOf("login")>0;(n.indexOf("callback.html")<0&&n.indexOf("search")===-1||t)&&u(function(){i.hidePleaseWait()},300)})}])}(app||(app={}))