(function(){var n=angular.module("mapsdevcenter",["ngRoute","ui.bootstrap","ngSanitize","angularFileUpload"]),t;n.directive("spinner",function(){return{restrict:"E",templateUrl:"/templates/spinner.html"}});n.directive("ngEnter",function(){return function(n,t,i){t.bind("keydown keypress",function(t){t.which===13&&(n.$apply(function(){n.$eval(i.ngEnter)}),t.preventDefault())})}});n.config(["$routeProvider",function(n){n.when("/",{controller:"DataSourceController",templateUrl:"/templates/dataSourcesView.html"});n.when("/editdatasource/:name/:accessId/:masterKey/:entityTypeName/:queryKey?",{controller:"EditDataSourceController",templateUrl:"/templates/editDataSourceView.html"});n.when("/editschema/:name/:accessId/:masterKey/:queryKey?",{controller:"EditSchemaController",templateUrl:"/templates/editSchemaView.html"});n.otherwise({redirectTo:"/"})}]);n.factory("accountService",["$http","$q",function(n,t){var u={},i=[],f={},e=0,r=!1,o=[],s=function(){return r},h=function(){var i=t.defer();return n.get("/api/account").then(function(n){angular.copy(n.data,u);r=!0;i.resolve()},function(n){i.reject(n)}),i.promise},c=function(i){var r=t.defer(),u=$("#_accountForm"),f=u.data().validationtoken;return n({method:"post",url:"/api/account",dataType:"json",data:i,headers:{RequestVerificationToken:f}}).then(function(){r.resolve()},function(n){r.reject(n)}),r.promise},l=function(i){var r=t.defer(),f=$("#_accountForm"),e=f.data().validationtoken;return n({method:"put",url:"/api/account",dataType:"json",data:i,headers:{RequestVerificationToken:e}}).then(function(n){angular.copy(n.data,u);r.resolve()},function(n){r.reject(n)}),r.promise},a=function(){var i=t.defer();return n.get("/api/countryconsent").then(function(n){i.resolve(n)},function(n){i.reject(n)}),i.promise},v=function(i){var r=t.defer(),u=$("#_consentForm"),f=u.data().validationtoken;return n({method:"post",url:"/api/account/consent",dataType:"json",data:i,headers:{RequestVerificationToken:f}}).then(function(n){r.resolve(n)},function(n){r.reject(n)}),r.promise},y=function(i){var r=t.defer(),f=$("#_accountForm"),e=f.data().validationtoken;return n({method:"put",url:"/api/account/accountState",dataType:"json",data:i,headers:{RequestVerificationToken:e}}).then(function(n){angular.copy(n.data,u);r.resolve()},function(n){r.reject(n)}),r.promise},p=function(){return e},w=function(){var u=t.defer();return n.get("/api/account/additionalContacts").then(function(n){angular.copy(n.data.additionalContacts,i);e=n.data.primaryId;r=!0;u.resolve()},function(n){u.reject(n)}),u.promise},b=function(i,u,f,e){var o=t.defer(),s=$("#_contactForm"),h=s.data().validationtoken;return n({method:"delete",url:"/api/account/additionalContacts",dataType:"json",data:{primaryId:i,name:u,email:f,phoneNumber:e},headers:{"Content-Type":"application/json",RequestVerificationToken:h}}).then(function(){d(u,f,e);r=!0;o.resolve()},function(n){o.reject(n)}),o.promise},k=function(r){var u=t.defer(),f=$("#_contactForm"),e=f.data().validationtoken;return n({method:"post",url:"/api/account/additionalContacts",dataType:"json",data:r,headers:{"Content-Type":"application/json",RequestVerificationToken:e}}).then(function(n){var t=n.data;i.splice(0,0,t);u.resolve(t)},function(n){u.reject(n)}),u.promise},d=function(n,t,r){for(var f=0,u=0;u<i.length;u++){if(i[u].name===n&&i[u].email===t&&i[u].phoneNumber===r)break;++f}i.splice(f,1)},g=function(){var i=t.defer();return n.get("/api/application").then(function(n){angular.copy(n.data,f);r=!0;i.resolve()},function(n){i.reject(n)}),i.promise},nt=function(i){var r=t.defer(),u=$("#_applicationForm"),f=u.data().validationtoken;return n({method:"post",url:"/api/application",dataType:"json",data:i,headers:{RequestVerificationToken:f}}).then(function(n){r.resolve(n)},function(n){r.reject(n)}),r.promise},tt=function(i){var r=t.defer(),u=$("#_applicationForm"),f=u.data().validationtoken;return n({method:"put",url:"/api/application",dataType:"json",data:i,headers:{RequestVerificationToken:f}}).then(function(n){r.resolve(n)},function(n){r.reject(n)}),r.promise},it=function(i){var r=t.defer();return n.put("/api/application/keytype",i).then(function(n){r.resolve(n)},function(n){r.reject(n)}),r.promise},rt=function(){var i=t.defer();return n.get("/api/keys").then(function(n){angular.copy(n.data,o);r=!0;i.resolve()},function(n){i.reject(n)}),i.promise},ut=function(i){var r=t.defer(),u=$("#_applicationForm"),f=u.data().validationtoken;let e={secondaryId:i};return n({method:"put",url:"/api/application/toggleKeyPreview",dataType:"json",data:e,headers:{RequestVerificationToken:f}}).then(function(n){r.resolve(n)},function(n){r.reject(n)}),r.promise},ft=function(){var i=t.defer(),r=$("#_applicationForm"),u=r.data().validationtoken;return n({method:"put",url:"/api/application/toggleAccountPreview",dataType:"json",headers:{RequestVerificationToken:u}}).then(function(n){i.resolve(n)},function(n){i.reject(n)}),i.promise};return{primaryId:p,account:u,additionalContacts:i,applicationData:f,keys:o,getAccountDetails:h,updateAccount:l,getAccountCountryConsent:a,setAccountConsent:v,updateAccountState:y,createAccount:c,getAdditionalContacts:w,deleteAdditionalContact:b,addAdditionalContact:k,getApplications:g,createApplication:nt,updateApplication:tt,updateKeytype:it,getKeys:rt,toggleKeyPreview:ut,toggleAccountPreview:ft,isReady:s}}]);n.factory("dataService",["$http","$q",function(n,t){var i={dataSources:[]},r=!1,e={},o=[],s=[],u={entities:[]},h=function(){return r},f=function(u){var f=t.defer();return n.get(u).then(function(n){n.status===200&&(angular.copy(n.data.data,i.dataSources),i.totalCount=n.data.totalCount,i.currentPage=n.data.currentPage,i.pageSize=n.data.pageSize,i.gotRequestedData=n.data.gotRequestedData);r=!0;f.resolve()},function(n){f.reject(n)}),f.promise},c=function(i,u,f){var o=t.defer();return n.get("/api/datasourceschema/"+i+"/"+u+"/"+f).then(function(n){var i,u,t;if(n.status===200){angular.copy(n.data,e);i={};for(u in n.data.optionalProperties)for(t=0;t<n.data.properties.length;++t)n.data.properties[t].toLowerCase()===u.toLowerCase()&&(i[n.data.properties[t]]=n.data.optionalProperties[u]);e.optionalProperties=i}r=!0;o.resolve()},function(n){o.reject(n)}),o.promise},l=function(i,u,f){var e=t.defer();return n.get("/api/datasource/getproperties/"+i+"/"+u+"/"+f).then(function(n){n.status===200&&angular.copy(n.data,o);r=!0;e.resolve()},function(n){e.reject(n)}),e.promise},a=function(i,r,u){var f=t.defer(),e=$("#_datasourcesForm"),o=e.data().validationtoken;return n({method:"delete",url:"/api/datasource/delete/"+i+"/"+r+"/"+u,dataType:"json",headers:{"Content-Type":"application/json",RequestVerificationToken:o}}).then(function(n){f.resolve(n)},function(n){f.reject(n)}),f.promise},v=function(u,f,e,o){var s=t.defer(),h=$("#_datasourcesForm"),c=h.data().validationtoken;return n({method:"patch",url:"/api/datasource/changeaccess/"+u+"/"+f+"/"+e+"/"+o,dataType:"json",headers:{"Content-Type":"application/json",RequestVerificationToken:c}}).then(function(n){var t=0,f;for(f in i.dataSources){if(i.dataSources[f].dataSourceName===u)break;++t}i.dataSources[t].isDataSourcePublic=o;r=!0;s.resolve(n)},function(n){s.reject(n)}),s.promise},y=function(i,f,e,o,s,h,c){var l=t.defer();return n.get("/api/datasource/getentities/"+i+"/"+f+"/"+e+"/"+o+"/"+s+"/"+h+"/"+c).then(function(n){n.status===200&&(angular.copy(n.data.data,u.entities),u.totalCount=n.data.totalCount,u.currentPage=n.data.currentPage,u.pageSize=n.data.pageSize,u.gotRequestedData=n.data.gotRequestedData);r=!0;l.resolve()},function(n){l.reject(n)}),l.promise},p=function(){var i=t.defer();return n.get("/api/datasource/getconfidencevalues").then(function(n){n.status===200&&angular.copy(n.data,s);r=!0;i.resolve()},function(n){i.reject(n)}),i.promise},w=function(n){var t="/api/datasources/published?publicDataSource=false&page="+n;return f(t)},b=function(n){var t="/api/datasources/published?publicDataSource=true&page="+n;return f(t)},k=function(n,t){var i="/api/datasources?geocoded=false&page="+n+"&isInitial="+t;return f(i)},d=function(n,t){var i="/api/datasources?geocoded=true&page="+n+"&isInitial="+t;return f(i)},g=function(i){var r=t.defer(),u=$("#_datasourcesForm"),f=u.data().validationtoken;return n({method:"post",url:"/api/datasourceschema",data:i,headers:{RequestVerificationToken:f}}).then(function(n){r.resolve(n)},function(n){r.reject(n)}),r.promise},nt=function(i,r,u){var f=t.defer(),e=$("#_datasourcesForm"),o=e.data().validationtoken;return n({method:"post",url:"/api/datasource/publish/"+i+"/"+r+"/"+u,headers:{RequestVerificationToken:o}}).then(function(n){f.resolve(n)},function(n){f.reject(n)}),f.promise},tt=function(i,r,u,f,e,o){var s=t.defer(),h=$("#_datasourcesForm"),c=h.data().validationtoken;return n({method:"post",url:"/api/datasource/geocodeentity/"+i+"/"+r+"/"+u+"/"+f+"/"+e,dataType:"json",data:o,headers:{RequestVerificationToken:c}}).then(function(n){s.resolve(n.data)},function(n){s.reject(n)}),s.promise},it=function(i,r,u,f,e){var o=t.defer(),s=$("#_datasourcesForm"),h=s.data().validationtoken;return n({method:"post",url:"/api/datasource/incrementalupload/"+i+"/"+r+"/"+u+"/"+f,dataType:"json",data:e,headers:{RequestVerificationToken:h}}).then(function(n){o.resolve(n)},function(n){o.reject(n)}),o.promise};return{data:i,dataSourceSchema:e,dataSourceProperties:o,confidenceValues:s,dataSourceEntities:u,getAllDataSources:k,getGeocodedDataSources:d,getPublishedDataSources:w,getPublicDataSources:b,getDataSourceSchema:c,getDataSourceProperties:l,getConfidenceValues:p,getDataSourceEntities:y,updateDataSourceSchema:g,deleteDataSource:a,changeDataSourceAccess:v,geocodeEntity:tt,publishGeocodedDataSource:nt,incrementalUpload:it,isReady:h}}]);t=["$scope",function(n){n.myInterval=7e3;n.slides=[{image:"/Content/images/carusel-imag-1.jpg",text:"Stunning Imagery",color:"#ffffff"},{image:"/Content/images/carusel-imag-2.jpg",text:"Manage & share your geospatial information",color:"#ffffff"},{image:"/Content/images/carusel-imag-3.jpg",text:"Create a common operational picture",color:"#ffffff"},{image:"/Content/images/carusel-imag-4.jpg",text:"Gain deeper insights into your data",color:"#ffffff"}]}];n.controller("HomeController",t)})(),function(){var n=angular.module("mapsdevcenter");n.constant("DEFAULTSUBTYPEID",{BASIC:35,ENTERPRISE:40,INTERNAL:28});n.constant("KEYTYPEID",{TRIAL:1,BASIC:2,ENTERPRISE:3,INTERNAL:4});var t=["$scope","$window","accountService",function(n,t,i){n.account=i.account;n.additionalContacts=i.additionalContacts;n.errors=[];n.contact={};n.confirmMessage="The contact will be permanently deleted";var r=function(){n.isBusy=!0;n.errors=[];n.updateAccountStatusButtonText="Disable Account";i.getAccountDetails().then(function(){n.updateAccountStatusButtonText=n.account.isEnabled?"Disable Account":"Enable Account";u()},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})},u=function(){n.isBusy=!0;n.errors=[];i.getAdditionalContacts().then(function(){n.additionalContacts=i.additionalContacts},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})},f=function(){n.isBusy=!0;n.errors=[];i.deleteAdditionalContact(n.account.primaryId,n.contact.accountName,n.contact.accountEmail,n.contact.phoneNumber).then(function(){n.errors=[]},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};n.confirmAction=function(){$("#modalConfirm").modal("hide");n.contact.primaryId&&n.contact.accountName&&n.contact.accountEmail&&f()};n.updateAccountStatusAction=function(){n.updateAccountStatus()};n.openUpdateAccountStatusModal=function(){$("#modalUpdateAccountStatus").modal();n.account.isEnabled?$("#updateAccountStatusMessage").html("By disabling this account, all transactions using any key associated to this account will respond with access denied.  This process could take up to 1 hour to take effect after this change is submitted."):$("#updateAccountStatusMessage").html('By enabling this account, you are agreeing to the <a href="/terms" target="blank">Bing Maps Platform API Terms of Use<\/a>. This process could take up to 1 hour to take effect after this change is submitted.')};n.deleteContact=function(t,i,r){n.contact={primaryId:n.account.primaryId,accountName:t,accountEmail:i,phoneNumber:r};$("#modalConfirm").modal()};n.updateAccount=function(){n.isBusy=!0;n.errors=[];i.updateAccount(n.account).then(function(){t.location.href="/account"},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};n.updateAccountStatus=function(){n.account&&(n.isBusy=!0,n.account.isEnabled=!n.account.isEnabled,i.updateAccountState(n.account).then(function(){n.updateAccountStatusButtonText=n.account.isEnabled?"Disable Account":"Enable Account"},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1;$("#modalUpdateAccountStatus").modal("hide")}))};$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()});r()}],i=["$scope","accountService",function(n,t){n.errors=[];n.contact={};n.confirmMessage="The contact will be permanently deleted";var i=function(){n.isBusy=!0;t.getAdditionalContacts().then(function(){n.additionalContacts=t.additionalContacts;n.primaryId=t.primaryId()},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})},r=function(){n.isBusy=!0;n.errors=[];t.deleteAdditionalContact(n.primaryId,n.contact.name,n.contact.email,n.contact.phoneNumber).then(function(){n.errors=[]},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};n.deleteContact=function(t,i,r){n.contact={primaryId:n.primaryId,name:t,email:i,phoneNumber:r};$("#modalConfirm").modal()};n.addContact=function(){n.isBusy=!0;cleanName=n.contact.name.replace(/</g,"&lt;").replace(/>/g,"&gt;");var i={primaryId:n.primaryId,name:cleanName,email:n.contact.email,phoneNumber:n.contact.phoneNumber};t.addAdditionalContact(i).then(function(){n.contact={};n.errors=[]},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1;n.contactForm.$setPristine(!0)})};n.confirmAction=function(){$("#modalConfirm").modal("hide");n.primaryId&&n.contact.name&&n.contact.email&&r()};$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()});i()}],r=["$scope","$http","accountService","DEFAULTSUBTYPEID","KEYTYPEID",function(n,t,i,r,u){n.applicationData=i.applicationData;n.applicationSubtypes=[];n.errors=[];n.accountTypes=[1,2,3];n.applicationData.showTickets=!0;n.applicationToUpdate={};n.responseInfo={};n.hideForm=!0;n.isPreviewEnabled=!1;n.applicationsToShow=[];n.currentPage=1;n.maxPaginationTabsToShow=10;n.applicationsPerPage=10;n.searchMode=!1;n.keyToSearch="";n.foundSearchKey=!1;n.defaultSubtypeId=0;n.defaultKeyTypeId=-9999;n.newApplication={};n.keySubtypeCreationUpdateWhitelist=[3,6,9,16,28,35,39,40,41];n.uwpKeySubtypes=[29,32,36,39,40,41];n.keySubtypeNameMapping={3:"Mobile Application",6:"Website",9:"Website",16:"Mobile Application",28:"General Use",35:"Dev/Test",39:"Windows Application",40:"Windows Application",41:"Windows Application"};var f=function(){n.isBusy=!0;n.applicationSubtypes=[];n.applicationData.applications=[];i.getApplications().then(function(){n.isPreviewEnabled=n.applicationData.account.isPreviewEnabled;n.isAccountTransitioned=n.applicationData.account.isAccountTransitioned;n.applicationsPerPage=n.applicationData.applicationsPerPage;n.applicationData.keyTypes.length>0&&(n.defaultKeyTypeId=n.applicationData.keyTypes[0].keyTypeId,n.applicationData.account.accountType==3?n.defaultKeyTypeId=u.INTERNAL:n.applicationData.account.accountType==2&&(n.defaultKeyTypeId=u.BASIC),n.newApplication.keyTypeId=n.defaultKeyTypeId,n.applicationData.keyTypes.forEach(function(t){t.keyTypeId==n.newApplication.keyTypeId&&(n.newApplication.keyTypeText=t.keyTypeText)}));n.loadKeySubtype();for(var t in n.applicationData.applications)n.applicationData.applications[t].keyVisible=!1,n.applicationData.applications[t].keySubtypeId in n.keySubtypeNameMapping&&(n.applicationData.applications[t].keySubtypeText=n.keySubtypeNameMapping[n.applicationData.applications[t].keySubtypeId]),n.applicationData.applications[t].keyStatus!=="Enabled"&&(n.applicationData.applications[t].color="#FF0000"),n.applicationData.applications[t].keyStatus==="DeniedByToU"&&(n.applicationData.applications[t].keyStatus="Blocked - Key has exceeded the <a href='/terms' target='blank'>Terms of Use<\/a> limits");n.applicationData&&n.applicationData.applications.length>0&&n.hideForm?$("#applicationFormDiv").hide():($("#applicationFormDiv").show(),n.hideForm=!1);n.buildPagination()},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};n.buildPagination=function(){n.$watch("currentPage + applicationsPerPage",function(){var t=(n.currentPage-1)*n.applicationsPerPage,i=t+n.applicationsPerPage;n.applicationsToShow=n.applicationData.applications.slice(t,i)})};n.findApplicationKey=function(){if(n.searchMode=!0,n.foundSearchKey=!1,n.keyToSearch==""){n.applicationsToShow=[];return}for(var t=0;t<n.applicationData.applications.length;t++)if(n.applicationData.applications[t].key==n.keyToSearch){n.foundSearchKey=!0;break}n.applicationsToShow=n.foundSearchKey?[n.applicationData.applications[t]]:[]};n.returnToNonSearchMode=function(){n.searchMode=!1;n.foundSearchKey=!1;n.buildPagination()};n.loadKeySubtype=function(){n.applicationSubtypes=[];n.applicationData.keySubtypes.forEach(function(t){t.typeId==n.newApplication.keyTypeId&&n.keySubtypeCreationUpdateWhitelist.indexOf(t.keySubtypeId)>=0&&(t.keySubtypeId in n.keySubtypeNameMapping&&(t.keySubtypeText=n.keySubtypeNameMapping[t.keySubtypeId]),n.applicationSubtypes.push(t))});n.applicationData.keySubtypes.sort(function(n,t){return n.keySubtypeText>t.keySubtypeText?1:t.keySubtypeText>n.keySubtypeText?-1:0});n.applicationData.keySubtypes.length>0&&(n.defaultSubtypeId=n.newApplication.keyTypeId==u.ENTERPRISE?r.ENTERPRISE:n.newApplication.keyTypeId==u.INTERNAL?r.INTERNAL:r.BASIC);n.newApplication.keySubtypeId=n.defaultSubtypeId;for(var t=0;t<n.applicationData.keySubtypes.length;t++)if(n.applicationData.keySubtypes[t].keySubtypeId==n.newApplication.keySubtypeId){n.newApplication.keySubtypeText=n.applicationData.keySubtypes[t].keySubtypeText;break}};n.loadMutableKeySubtype=function(t){var r,i,u;n.applicationSubtypes=[];for(r in n.applicationData.keySubtypes)n.applicationToUpdate.keySubtypeId==n.applicationData.keySubtypes[r].keySubtypeId&&n.applicationToUpdate.keyTypeId==n.applicationData.keySubtypes[r].KeyTypeId?n.applicationSubtypes.push(n.applicationData.keySubtypes[r]):n.keySubtypeCreationUpdateWhitelist.indexOf(n.applicationData.keySubtypes[r].keySubtypeId)>=0&&n.applicationData.keySubtypes[r].typeId==n.applicationToUpdate.keyTypeId&&(n.uwpKeySubtypes.indexOf(n.applicationToUpdate.keySubtypeId)<0?n.uwpKeySubtypes.indexOf(n.applicationData.keySubtypes[r].keySubtypeId)<0&&(i=n.applicationData.keySubtypes[r],i.keySubtypeId in n.keySubtypeNameMapping&&(i.keySubtypeText=n.keySubtypeNameMapping[i.keySubtypeId]),n.applicationSubtypes.push(i)):n.uwpKeySubtypes.indexOf(n.applicationData.keySubtypes[r].keySubtypeId)>=0&&(i=n.applicationData.keySubtypes[r],i.keySubtypeId in n.keySubtypeNameMapping&&(i.keySubtypeText=n.keySubtypeNameMapping[i.keySubtypeId]),n.applicationSubtypes.push(i)));n.applicationSubtypes.length>0&&(u=n.applicationSubtypes.findIndex(function(n){return n.keySubtypeId==t.keySubtypeId}),n.applicationToUpdate.selectedKeySubtypeId=u>=0?t.keySubtypeId:n.applicationSubtypes[0].keySubtypeId);n.applicationToUpdate.keySubtypeId=n.applicationToUpdate.selectedKeySubtypeId};n.createKey=function(t){t.which===13&&n.createApplication()};n.createApplication=function(){var t;n.isBusy=!0;n.responseInfo={};for(t in n.applicationData.keyTypes)if(n.applicationData.keyTypes[t].keyTypeId==n.newApplication.keyTypeId){n.newApplication.keyTypeText=n.applicationData.keyTypes[t].keyTypeText;break}for(t in n.applicationData.keySubtypes)if(n.applicationData.keySubtypes[t].keySubtypeId==n.newApplication.keySubtypeId){n.newApplication.keySubtypeText=n.applicationData.keySubtypes[t].keySubtypeText;break}i.createApplication(n.newApplication).then(function(t){n.errors=[];n.responseInfo.status=t.status;n.responseInfo.message=t.data;f()},function(t){n.errors.push(t.data.message);n.isBusy=!1}).then(function(){n.hideForm=!0;n.applicationForm.$setPristine(!0)})};n.closeCreateApplicationForm=function(){$("#applicationFormDiv").hide();n.hideForm=!0};n.switchKeyStatusAction=function(){n.switchKeyStatus()};n.openSwitchKeyStatusModal=function(){$("#modalSwitchKeyStatus").modal();n.applicationToUpdate.showButtonTextEnable?$("#switchKeyStatusMessage").html('By enabling this key all transactions using this key will count towards <a href="/terms" target="blank">Bing Maps Platform API Terms of Use<\/a>. This process could take up to 1 hour to take effect after this change is submitted.'):$("#switchKeyStatusMessage").html("By disabling this key, all transactions using this key will respond with access denied. This process could take up to 1 hour to take effect after this change is submitted.")};n.openSecurityUpdateForm=function(n,t){showSecurityInfo(n,t)};n.openReferrerHelp=function(){showReferrerHelp()};n.openPreviewHelp=function(){showPreviewHelp()};n.openTransitionInfo=function(){showTransitionInfo()};$("#previewEnableModal").on("hide.bs.modal",function(){const n=$("#inputAccountPreviewToggle"),t=!n.prop("checked");n.prop("checked",t)});n.openUpdateForm=function(t){n.applicationToUpdate=t;n.responseInfo={};n.switchKeyStatusButtonText=n.applicationToUpdate.showButtonTextEnable?"Enable Key":"Disable Key";var r=t.keyTypeId,i=t.keySubtypeId;n.loadMutableKeySubtype(t);n.applicationToUpdate.selectedKeySubtypeId=i;n.applicationToUpdate.selectedKeyTypeId=r;n.applicationToUpdate.keySubtypeId=i;$("#modalUpdate").modal()};n.showKey=function(n){n.keyVisible=!n.keyVisible};n.toggleKeyPreview=function(t,r){n.isBusy=!0;n.responseInfo={};i.toggleKeyPreview(t).then(function(t){n.errors=[];n.responseInfo.status=t.status;n.responseInfo.message=t.data;const i=!r.isKeyPreviewed;r.isKeyPreviewed=i;i==!1&&n.isPreviewEnabled&&(n.isPreviewEnabled=!1)},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1;n.hideForm=!0;n.applicationForm.$setPristine(!0)})};n.toggleAccountPreview=function(t){if(n.isBusy=!0,n.responseInfo={},t)hideEnablePreviewInfo();else{showEnablePreviewInfo();n.isBusy=!1;return}i.toggleAccountPreview().then(function(t){n.errors=[];n.responseInfo.status=t.status;n.responseInfo.message=t.data;f()},function(t){n.errors.push(t.data.message);n.isBusy=!1}).then(function(){n.hideForm=!0;n.applicationForm.$setPristine(!0)})};n.updateApplication=function(){n.applicationToUpdate&&(n.isBusy=!0,n.responseInfo={},i.updateApplication(n.applicationToUpdate).then(function(t){n.errors=[];n.responseInfo.status=t.status;n.responseInfo.message=t.data;n.hideForm=!0},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1;n.updateForm.$setPristine(!0);$("#modalUpdate").modal("hide");$("#modalUpdateKeyType").modal("hide");f()}))};n.switchKeyStatus=function(){n.applicationToUpdate.showButtonTextEnable=!n.applicationToUpdate.showButtonTextEnable;n.switchKeyStatusButtonText=n.applicationToUpdate.showButtonTextEnable?"Enable Key":"Disable Key";$("#modalSwitchKeyStatus").modal("hide")};n.copyTicket=function(n){let t=document.createElement("textArea");t.classList.add("no-render");t.value=n;document.body.appendChild(t);t.select();try{document.execCommand("copy")}catch(i){alert("Your browser was unable to copy.")}document.body.removeChild(t)};$("#createKey").click(function(){$("#applicationFormDiv").toggle();n.hideForm=!n.hideForm;n.$apply(function(){n.applicationForm.$setPristine(!0);n.responseInfo={}})});$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()});f()}],u=["$scope","$window","accountService",function(n,t,i){n.errors=[];n.newAccount={};n.getCountryConsent=function(){n.isBusy=!0;i.getAccountCountryConsent().then(function(t){var i=t.data;i=="1"||i=="2"?(n.newAccount.enableEmailCommunication=!0,n.newAccount.enablePhoneCommunication=!0):(n.newAccount.enableEmailCommunication=!1,n.newAccount.enablePhoneCommunication=!1)},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};n.createAccount=function(){n.isBusy=!0;i.createAccount(n.newAccount).then(function(){t.location.href="/announcement"},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()})}],f=["$scope","$window","accountService",function(n,t,i){n.errors=[];n.consentBits={};n.userConsenting=!1;n.consentOptions=[{label:"Contact me by email or phone",id:"0"},{label:"Contact me by email",id:"1"},{label:"Contact me by phone",id:"2"}];n.consentTypeSelected=0;n.submitConsent=function(){n.isBusy=!0;n.consentBits=n.userConsenting==!1?{AllowCommunication:!1,AllowPhoneCommunication:!1}:n.consentTypeSelected=="0"?{AllowCommunication:!0,AllowPhoneCommunication:!0}:n.consentTypeSelected=="1"?{AllowCommunication:!0,AllowPhoneCommunication:!1}:n.consentTypeSelected=="2"?{AllowCommunication:!1,AllowPhoneCommunication:!0}:{AllowCommunication:!1,AllowPhoneCommunication:!1};i.setAccountConsent(n.consentBits).then(function(){t.location.href="/announcement"},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()})}];n.controller("AdditionalContactController",i);n.controller("AccountController",t);n.controller("ApplicationController",r);n.controller("RegisterAccountController",u);n.controller("ConsentController",f)}(),function(){var n=angular.module("mapsdevcenter"),t=["$scope","$rootScope","dataService",function(n,t,i){n.dataSources=i.data.dataSources;n.tab=0;n.isInitial=!0;n.responseInfo={};n.confirmMessage="";n.dataSource={};n.errors=[];var r="Data source will be publicly accessible to anyone with a Bing Maps Key. Do you want to continue?",u="Data source will no longer be publicly accessible. Do you want to continue?",f="The data source and its data will be permanently deleted.";n.setPage=function(t){n.currentPage=t};n.pageChanged=function(){n.dataSources=[];n.getDataSources(n.tab,n.currentPage-1)};n.deleteDataSource=function(t,i,r){n.dataSource={dataSourceName:t,accessId:i,masterKey:r,action:"deleteDS"};n.confirmMessage=f;$("#modalConfirm").modal()};n.changeDataSourceAccess=function(t,i,f,e){n.dataSource={dataSourceName:t,accessId:i,masterKey:f,makePublic:e,action:"changeAccess"};n.confirmMessage=e?r:u;$("#modalConfirm").modal()};n.confirmAction=function(){$("#modalConfirm").modal("hide");n.dataSource&&n.dataSource.dataSourceName&&n.dataSource.accessId&&n.dataSource.masterKey&&n.dataSource.action&&(n.dataSource.action==="changeAccess"?s():o())};n.getStatus=function(n){return n.status.toUpperCase()==="PENDING"?n.status:n.masterKeyExpirationDate?n.masterKeyExpirationDate:"None"};n.getDataSources=function(t,r){n.isBusy=!0;var u=null;n.responseInfo={};n.dataSources=[];n.errors=[];u=t==0?i.getGeocodedDataSources(r,n.isInitial):i.getAllDataSources(r,n.isInitial);u.then(function(){n.dataSources=i.data.dataSources;n.totalItems=i.data.totalCount;n.currentPage=i.data.currentPage+1;n.itemsPerPage=i.data.pageSize},function(t){t.status===404?(n.responseInfo.status=t.status,n.responseInfo.message=t.data):n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};n.publishGeocodedDataSource=function(t,r,u){n.isBusy=!0;n.responseInfo={};i.publishGeocodedDataSource(t,r,u).then(function(){n.getDataSources(n.tab,n.currentPage-1)},function(t){n.responseInfo.status=t.status;n.responseInfo.message=t.data.message}).then(function(){n.isBusy=!1})};var e=function(){n.isBusy=!0;i.getGeocodedDataSources(0,!0).then(function(){n.dataSources=i.data.dataSources;n.totalItems=i.data.totalCount;n.currentPage=i.data.currentPage+1;n.itemsPerPage=i.data.pageSize;n.gotRequestedData=i.data.gotRequestedData;n.gotRequestedData?($("#dataSourceTab a:first").tab("show"),n.tab=0,n.isInitial=!1):($("#dataSourceTab a:eq( 1 )").tab("show"),n.tab=1,n.isInitial=!1)},function(t){t.status===404&&n.isInitial?n.noDataSources=!0:t.status===400?n.errors.push(t.data):n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})},o=function(){n.isBusy=!0;n.responseInfo={};n.dataSource&&n.dataSource.dataSourceName&&n.dataSource.accessId&&n.dataSource.masterKey&&(n.dataSources=[],i.deleteDataSource(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey).then(function(t){n.getDataSources(n.tab,n.currentPage-1);n.responseInfo.status=t.status;n.responseInfo.message=t.data;n.errors=[]},function(t){n.getDataSources(n.tab,n.currentPage-1);n.responseInfo.status=t.status;n.responseInfo.message=t.data.message}).then(function(){n.dataSource={}}))},s=function(){n.isBusy=!0;n.responseInfo={};n.dataSource&&n.dataSource.dataSourceName&&n.dataSource.accessId&&n.dataSource.masterKey&&i.changeDataSourceAccess(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.makePublic).then(function(t){n.responseInfo.status=t.status;n.responseInfo.message=t.data;n.errors=[]},function(t){n.responseInfo.status=t.status;n.responseInfo.message=t.data.message}).then(function(){n.isBusy=!1;n.dataSource={}})};$("#tabDiv").on("click","a",function(n){n.currentTarget.id!="editDsLink"&&n.currentTarget.id!="editSchemaLink"&&n.currentTarget.id!="downloadDsLink"&&n.currentTarget.id!="downloadSucceeded"&&n.currentTarget.id!="downloadFailed"&&n.preventDefault()});$("#tabDiv").on("show.bs.tab","a[data-toggle='tab']",function(t){if(!n.isInitial){n.dataSources=[];n.isBusy=!0;var r=t.target,u=t.relatedTarget,i=0,f=$(r).attr("href"),e=$(u).attr("href");f=="#published"&&(i=1);n.tab=i;n.getDataSources(i,0)}});$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()});t.$on("$routeChangeStart",function(){n.dataSources=[];i.data.dataSources=[]});e()}],i=["$scope","dataService",function(n,t){n.dataSources=t.data.dataSources;n.errors=[];n.setPage=function(t){n.currentPage=t};n.pageChanged=function(){n.dataSources=[];i(n.currentPage-1)};var i=function(i){n.isBusy=!0;n.errors=[];t.getPublishedDataSources(i).then(function(){n.dataSources=t.data.dataSources;n.totalItems=t.data.totalCount;n.currentPage=t.data.currentPage+1;n.itemsPerPage=t.data.pageSize},function(t){t.status===404?n.errors.push(t.data):n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()});i(0)}],r=["$scope","dataService",function(n,t){n.dataSources=t.data.dataSources;n.errors=[];n.setPage=function(t){n.currentPage=t};n.pageChanged=function(){n.dataSources=[];i(n.currentPage-1)};var i=function(i){n.isBusy=!0;n.errors=[];t.getPublicDataSources(i).then(function(){n.dataSources=t.data.dataSources;n.totalItems=t.data.totalCount;n.currentPage=t.data.currentPage+1;n.itemsPerPage=t.data.pageSize},function(t){t.status===404?n.errors.push(t.data):n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()});i(0)}],u=["$scope","accountService","FileUploader",function(n,t,i){var r,u;n.keys=t.keys;n.dataSource={};n.dataSource.isDataSourcePublic=!1;n.fileName="";n.responseInfo={};n.updateFileFormatHelp=function(){var n=$('[name="fileFormat"]:radio:checked').val();n==="kml"?$("#shpkmlhelp").html("<small class='help-block'>Only geometry types of Point, LineString,  Polygon, and MultiGeometry (that contain one or more of the primitive geometry types) are supported. Hierarchy, document, or folder structure preservation are currently not supported. Network links are currently not supported and will be ignored.<\/small>"):n==="shp"?$("#shpkmlhelp").html("<small class='help-block'>SHP data must be contained in a ZIP archive. The root of the archive must include the following three file types: SHP, SHX, and DBF. Shape types of elevation (such as PolylineZ/PolygonZ) and measure (such as PolylineM/PolygonM) are currently not supported. If your spatial coordinate system is not WGS84, you will also need to include the PRJ file in the archive. The projection string in the PRJ file should follow ESRI Well-known-text (WKT) standard. Vertical projections and vertical datums are currently not supported.<\/small>"):$("#shpkmlhelp").html("")};r=n.uploader=new i({url:"api/upload",headers:{RequestVerificationToken:$("#_uploadForm").data().validationtoken}});r.onAfterAddingFile=function(t){n.fileName=t.file.name;r.queue.length>1&&r.removeFromQueue(0)};r.onCompleteItem=function(t,i,u){r.clearQueue();$("#fileuploader").val("");n.uploadForm.$setPristine(!0);n.responseInfo.status=u;n.fileName="";u===200?(n.responseInfo.message=i,n.dataSource={}):n.responseInfo.message=i.message;n.isBusy=!1};r.onBeforeUploadItem=function(t){n.responseInfo.status="";n.isBusy=!0;var i=[{name:n.dataSource.name,masterKey:n.dataSource.masterKey,queryKey:n.dataSource.queryKey?n.dataSource.queryKey:"",fileFormat:n.dataSource.fileFormat,isDataSourcePublic:n.dataSource.isDataSourcePublic,uploadOnly:n.dataSource.uploadOnly}];Array.prototype.push.apply(t.formData,i)};u=function(){n.isBusy=!0;t.getKeys().then(function(){for(var t in n.keys)n.keys[t].keyToDisplay=n.keys[t].keyType+" ("+n.keys[t].applicationName+" - "+n.keys[t].key.substring(0,40)+"...)"},function(t){n.responseInfo.message=t.data.message;n.responseInfo.status=t.status}).then(function(){n.isBusy=!1})};n.uploadOnlyChecked=function(){n.dataSource.uploadOnly&&(n.dataSource.isDataSourcePublic=!1)};u()}],f=["$scope","$routeParams","$location","dataService",function(n,t,i,r){n.dataSourceName=t.name;n.dataSourceSchema=r.dataSourceSchema;n.dataTypes=["string","long/Int64","double","boolean","dateTime"];n.property={};n.optionalPropertiesKey=[];n.duplicateProperty=!1;n.propertyLimitExceeded=!1;n.errors=[];var u=function(t,i,u){n.isBusy=!0;r.getDataSourceSchema(t,i,u).then(function(){for(var t in n.dataSourceSchema.optionalProperties)n.optionalPropertiesKey.push(t);n.propertyLimitExceeded=n.dataSourceSchema.maxPropertiesCount==n.dataSourceSchema.properties.length;n.property.dataType=n.dataTypes[0]},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};n.publish=function(){n.errors=[];n.isBusy=!0;n.dataSourceSchema.dataSourceName=t.name;n.dataSourceSchema.accessId=t.accessId;n.dataSourceSchema.masterKey=t.masterKey;n.dataSourceSchema.queryKey=t.queryKey;r.updateDataSourceSchema(n.dataSourceSchema).then(function(){i.path("/")},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};n.addProperty=function(){var i,t;if(n.errors=[],n.propertyForm.$valid){for(i=n.property.name.toUpperCase(),t=0;t<n.dataSourceSchema.properties.length;++t)if(n.dataSourceSchema.properties[t].toUpperCase()==i){duplicateProperty=!0;n.errors.push("Property already exist");return}n.errors=[];n.dataSourceSchema.properties.push(n.property.name);n.optionalPropertiesKey.push(n.property.name);n.dataSourceSchema.optionalProperties[n.property.name]=n.property.dataType;n.property={};n.propertyForm.$setPristine(!0);n.property.dataType=n.dataTypes[0]}};n.cancelSchemaEdit=function(){window.onbeforeunload=null};n.$on("$locationChangeStart",function(n){i.path()===""&&(confirm("You will lose any information that has not been published. Are you sure you want to leave this page?","Confirm Navigation")?window.onbeforeunload=null:n.preventDefault())});$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()});window.onbeforeunload=function(n){return n=n||window.event,n&&(n.returnValue="You will lose any information that has not been published"),"You will lose any information that has not been published"};u(n.dataSourceName,t.accessId,t.masterKey)}],e=["$scope","$routeParams","$location","dataService",function(n,t,i,r){var h;n.dataSourceProperties=r.dataSourceProperties;n.confidenceValues=r.confidenceValues;n.dataSourceEntities=r.dataSourceEntities.entities;n.searchOptions={};n.entityPage=!1;n.entity={};n.dataSource={dataSourceName:t.name,accessId:t.accessId,masterKey:t.masterKey,queryKey:t.queryKey,entityTypeName:t.entityTypeName};n.optionalPropertiesKey=[];n.entities=[];n.errors=[];n.entityIdName="";n.actions={none:0,added:1,deleted:2,updated:3,noAction:4};var c=17,e=5,o=function(){r.getDataSourceProperties(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey).then(function(){n.searchOptions.propertyName=n.dataSourceProperties[0]},function(t){n.errors.push(t.data.message)})},s=function(){r.getConfidenceValues().then(function(){n.searchOptions.confidence=n.confidenceValues[0]},function(t){n.errors.push(t.data.message)})},u=function(t,i,u,e,o,s,h){n.isBusy=!0;n.dataSourceEntities=[];n.errors=[];n.noEntity="";r.getDataSourceEntities(t,i,u,e,o,s,h).then(function(){var u,i,t;n.dataSourceEntities=r.dataSourceEntities.entities;n.totalItems=r.dataSourceEntities.totalCount;n.currentPage=r.dataSourceEntities.currentPage+1;n.itemsPerPage=r.dataSourceEntities.pageSize;n.totalPages=n.totalItems%n.itemsPerPage>0?Math.ceil(n.totalItems/n.itemsPerPage):n.totalItems/n.itemsPerPage;for(u in n.dataSourceEntities[0].optionalElements)n.optionalPropertiesKey.push(u);for(i in n.dataSourceEntities)for(t in n.entities)n.dataSourceEntities[i].entityId===n.entities[t].entityId&&(n.dataSourceEntities[i]=n.entities[t]);for(t in n.entities)n.entities[t].action===n.actions.added&&n.dataSourceEntities.unshift(n.entities[t]);n.dataSourceEntities.length>0&&(f(n.dataSourceEntities[0].latitude,n.dataSourceEntities[0].longitude),n.entityIdName=n.dataSourceEntities[0].entityIdName)},function(t){t.status===404?n.noEntity=t.data:n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})},f=function(n,t,i){var r,u,f;try{r=n?n:0;u=t?t:0;f=r==0||u==0||!i||i<e||i>c?e:i;var o=new Microsoft.Maps.Map(document.getElementById("mapDiv"),{credentials:$("#_mapMetadata").data().mapmetadata,center:new Microsoft.Maps.Location(r,u),mapTypeId:Microsoft.Maps.MapTypeId.road,zoom:f,enableClickableLogo:!1,enableSearchLogo:!1}),h=o.getCenter(),s=new Microsoft.Maps.Pushpin(h,{text:"",draggable:!0});o.entities.push(s);Microsoft.Maps.Events.addHandler(s,"drag",l)}catch(a){}},l=function(t){var i=t.entity.getLocation();n.$apply(function(){n.entity.latitude=i.latitude.toFixed(6);n.entity.longitude=i.longitude.toFixed(6)})};n.searchEntity=function(){n.dataSourceEntities=[];u(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,0,n.searchOptions.propertyName,n.searchOptions.searchText?n.searchOptions.searchText:null)};n.filterEntity=function(){n.dataSourceEntities=[];u(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,0,"Confidence",n.searchOptions.confidence?n.searchOptions.confidence:null)};n.pageChanged=function(){n.dataSourceEntities=[];u(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,n.currentPage-1,n.searchOptions.propertyName,n.searchOptions.searchText?n.searchOptions.searchText:null)};n.getEntity=function(t){n.entityPage=!0;n.entity=t;n.entity.isNew=!1};n.cancelEntityAddEdit=function(){n.entityPage=!1;n.entityForm.$setPristine(!0);n.entity={};u(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,n.currentPage-1,null,null)};n.updateEntity=function(){n.isBusy=!0;n.errors=[];r.geocodeEntity(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,n.currentPage,n.entity).then(function(t){var r,i,f;n.entity.action=n.actions.updated;r=!1;for(i in n.entities)if(n.entities[i].entityId===t.entityId){f=n.entities[i].action;n.entities[i]=t;f===n.actions.added&&(n.entities[i].action=n.actions.added);r=!0;break}r||(t.action=n.actions.updated,n.entities.push(t));u(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,n.currentPage-1,null,null)},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1;n.entityPage=!1;n.entityForm.$setPristine(!0)})};n.loadAddEntityPage=function(){n.entityPage=!0;n.entity={};n.entity.isNew=!0};n.deleteEntity=function(t){var i,r;switch(t.action){case n.actions.added:t.action=n.actions.noAction;break;default:t.action=n.actions.deleted}i=!1;for(r in n.entities)if(n.entities[r].entityId===t.entityId){n.entities[r]=t;i=!0;break}i||n.entities.push(t)};n.addEntity=function(){n.isBusy=!0;n.errors=[];n.entity.action=n.actions.added;n.entity.entityIdName=n.entityIdName;r.geocodeEntity(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,n.currentPage,n.entity).then(function(t){var r=!1,i,f;for(i in n.entities)if(n.entities[i].entityId===t.entityId){f=n.entities[i].action;n.entities[i]=t;f===n.actions.added&&(n.entities[i].action=n.actions.added);r=!0;break}r||n.entities.push(t);n.entityPage=!1;u(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,n.currentPage-1,null,null)},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1;n.entityForm.$setPristine(!0)})};n.getClass=function(t){switch(t.action){case n.actions.none:return"";case n.actions.added:return"success";case n.actions.deleted:return"danger";case n.actions.updated:return"warning";case n.actions.noAction:return""}return""};n.resetEntities=function(){n.searchOptions={};n.errors=[];n.searchForm.$setPristine(!0);o();s();u(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,0,null,null)};n.incrementalUpload=function(){n.errors=[];n.isBusy=!0;r.incrementalUpload(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.queryKey,n.entities).then(function(){window.onbeforeunload=null;i.path("/")},function(t){n.errors.push(t.data.message)}).then(function(){n.isBusy=!1})};n.$on("$locationChangeStart",function(n){i.path()===""&&(confirm("You will lose any information that has not been published. Are you sure you want to leave this page?","Confirm Navigation")?window.onbeforeunload=null:n.preventDefault())});n.cancelDataSourceEdit=function(){window.onbeforeunload=null};$("#entitiesTable").on("click","a",function(n){n.preventDefault()});$("#entitiesTable").on("click","tbody > tr",function(t){var u=jQuery(t.currentTarget).attr("data-entityid"),i=0,r=0,t;for(t in n.dataSourceEntities)if(n.dataSourceEntities[t].entityId===u){i=n.dataSourceEntities[t].latitude;r=n.dataSourceEntities[t].longitude;break}f(i,r);$("#entitiesTable tbody > tr").css("background-color","#ffffff");$(this).css("background-color","#ebebeb")});$(".close").on("click",function(t){n.$apply(function(){n.errors=[]});t.preventDefault()});h=function(n){return n=n||window.event,n&&(n.returnValue="You will lose any information that has not been published"),"You will lose any information that has not been published"};window.onbeforeunload=h;o();s();u(n.dataSource.dataSourceName,n.dataSource.accessId,n.dataSource.masterKey,n.dataSource.entityTypeName,0,null,null);f()}];n.controller("DataSourceController",t);n.controller("PublishedDataSourceController",i);n.controller("PublicDataSourceController",r);n.controller("UploadDataSourceController",u);n.controller("EditSchemaController",f);n.controller("EditDataSourceController",e)}()