{"version":3,"sources":["../LuV.LUMAS.Services/scripts/app.configure.ts"],"names":["AppRouting","Configure","app","routeConfig","$routeProvider","$locationProvider","templateHelperService","ths","TemplateHelperService","caseInsensitiveMatch","when","templateUrl","getTemplateUrl","controller","otherwise","$inject","config","exports","AppModule","lumasContext","service","ls","LumasService","environment","lc","LumasController","spss","SearchService","sac","InternalDocumentsAggregationController","olc","md","MaterialDetailviewController","pdc","PublishedDocumentsAggregationController","cpc","CustomerProjectsAggregationController","cdc","CompetitorDocumentsAggregationController","cld","CopyLinkDialogController","directive","MaterialDetailview","CopyLinkDialogDirective","factory","filter","input","start","isNaN","slice","$filter","itemId","array","property","customId","defaultValue","item","ProductCode","Id","value","strValue","length","indexOf","precisionString","replace","substr","console","log","releaseDate","Date","nowDate","setFullYear","getFullYear","getTime","char","reg","RegExp"],"mappings":"2iBAYA,IAAAA,GACeA,EAAAC,UAAd,SAAwBC,GAGvB,SAASC,EAAYC,EAAyCC,GAC7D,IAAIC,EAAwB,IAAIC,EAAIC,kEACpCJ;EAAeK,sBAAuB,EACtCL,EACEM,KAAK,uBAAwB,CAC7BC,YAAaL,EAAsBM,eAAe,qBAClDC,WAAY,oBAEZH,KAAK,0BAA2B,CAChCC,YAAaL,EAAsBM,eAAe,yBAClDC,WAAY,oBAEZC,UAAU,CACVH,YAAaL,EAAsBM,eAAe,qBAClDC,WAAY;;AAffV,EAAYY,QAAU,CAAC,iBAAkB,qBAmBzCb,EAAIc,OAAOb,IAEbH,GAxBA,SAAAA,KAAaiB,EAAAjB,WAAAA,EA0Bb,IAAAkB,GACeA,EAAAjB,UAAd,SAAwBC,EAAiBiB,GACxCjB,EACEkB,QAAQ,eAAgBC,EAAGC,cAC3BF,QAAQ,wBAAyBb,EAAIC,uBACP,UAA5BW,EAAaI,YAChBrB,EACEW,WAAW,kBAAmBW,EAAGC,iBACjCL,QAAQ,gBAAiBM,EAAKC,eAC9Bd,WAAW,yCAA0Ce,EAAIC,wCAG3D3B,EACEW,WAAW,kB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,CAAEM,GAAIP,IAAU,GACpD,OAAIK,EAAK,GACJA,EAAK,GAAGH,GACJG,EAAK,GAAGH,IAEXa,SAAWA,QAAQC,KACtBD,QAAQC,IAAI,iBAAiBhB,EAAM,oBAAoBE,GAEjD,OAGJa,SAAWA,QAAQC,KACtBD,QAAQC,IAAI,iBAAiBhB,EAAM,uBAE7B,UAKVN,OAAO,yBAA0B,WACjC,OAAO,SAAUc,GAChB,OAAQA,GACP,KAAM,EACL,MAAO,KACR,KAAK,EACJ,MAAO,MACR,QACC,MAAO,mBAIVd,OAAO,wBAAyB,WAChC,OAAO,SAAUc,GAChB,IAAIS,EAAc,IAAIC,KAAKV,GACvBW,EAAU,IAAID,KAElB,OADAC,EAAQC,YAAYD,EAAQE,cAAgB,GACxCJ,EAAYK,UAAYH,EAAQG,UAC5B,cAEA,MAIT5B,OAAO,kBAAmB,CAC1B,UACA,SAAUK,GACT,OAAO,SAAUS,EAAOe,GACvB,GAAIf,EAAO,CACV,IAAIgB,EAAM,IAAIC,OAAOF,EAAM,KAC3B,OAAOf,EAAMK,QAAQW,EAAKD,EAAO,SAElC,OAAOf,OAKbzC,GA5IA,SAAAA,KAAaD,EAAAC,UAAAA","file":"app.configure.js","sourcesContent":["import * as olc from './controls/online-lumasController';\r\nimport * as lc from './controls/lumasController';\r\nimport * as ls from './services/lumasService';\r\nimport * as md from './controls/materialDetailviewDirective';\r\nimport * as sac from './controls/searchAggregationController';\r\nimport * as cpc from './controls/customerProjectsAggregationController';\r\nimport * as cdc from './controls/competitorDocumentsAggregationController';\r\nimport * as pdc from './controls/publishedDocumentsAggregationController';\r\nimport * as spss from './spext/services/spSearchService';\r\nimport * as ths from './helpers/templateHelperService';\r\nimport * as cld from './controls/copyLinkDialog';\r\n\r\nexport class AppRouting {\r\n\tpublic static Configure(app: ng.IModule) {\r\n\t\t// routing\r\n\t\trouteConfig.$inject = [`$routeProvider`, `$locationProvider`];\r\n\t\tfunction routeConfig($routeProvider: ng.route.IRouteProvider, $locationProvider: ng.ILocationProvider): void {\r\n\t\t\tvar templateHelperService = new ths.TemplateHelperService(); // i was unable to pass it with the injector\r\n\t\t\t$routeProvider.caseInsensitiveMatch = true;\r\n\t\t\t$routeProvider\r\n\t\t\t\t.when(`/findProducts/:query`, {\r\n\t\t\t\t\ttemplateUrl: templateHelperService.getTemplateUrl('searchFilter.html'),\r\n\t\t\t\t\tcontroller: 'lumasController',\r\n\t\t\t\t})\r\n\t\t\t\t.when(`/compareProducts/:query`, {\r\n\t\t\t\t\ttemplateUrl: templateHelperService.getTemplateUrl('compareSelection.html'),\r\n\t\t\t\t\tcontroller: 'lumasController',\r\n\t\t\t\t})\r\n\t\t\t\t.otherwise({\r\n\t\t\t\t\ttemplateUrl: templateHelperService.getTemplateUrl('searchFilter.html'),\r\n\t\t\t\t\tcontroller: 'lumasController',\r\n\t\t\t\t});\r\n\t\t}\r\n\r\n\t\tapp.config(routeConfig);\r\n\t}\r\n}\r\n\r\nexport class AppModule {\r\n\tpublic static Configure(app: ng.IModule, lumasContext: ILumasContext) {\r\n\t\tapp\r\n\t\t\t.service(`lumasService`, ls.LumasService)\r\n\t\t\t.service('templateHelperService', ths.TemplateHelperService)\r\n\t\tif (lumasContext.environment == 'onPrem') {\r\n\t\t\tapp\r\n\t\t\t\t.controller(`lumasController`, lc.LumasController)\r\n\t\t\t\t.service(`searchService`, spss.SearchService)\r\n\t\t\t\t.controller(`internalDocumentsAggregationController`, sac.InternalDocumentsAggregationController)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tapp\r\n\t\t\t\t.controller(`lumasController`, olc.LumasController)\r\n\t\t}\r\n\t\tapp\r\n\t\t\t.controller(`materialDetailviewController`, md.MaterialDetailviewController)\r\n\t\t\t.controller(`publishedDocumentsAggregationController`, pdc.PublishedDocumentsAggregationController)\r\n\t\t\t.controller(`customerProjectsAggregationController`, cpc.CustomerProjectsAggregationController)\r\n\t\t\t.controller(`competitorDocumentsAggregationController`, cdc.CompetitorDocumentsAggregationController)\r\n\t\t\t.controller(`linkCopyDialogController`, cld.CopyLinkDialogController)\r\n\t\t\t.directive(`materialDetailview`, () => new md.MaterialDetailview())\r\n\t\t\t.directive(`linkCopyDialog`, cld.CopyLinkDialogDirective.factory())\r\n\t\t\t// filter for search aggregation paging\r\n\t\t\t.filter('startFrom', function () {\r\n\t\t\t\treturn function (input, start) {\r\n\t\t\t\t\tif (isNaN(start) || !input) return input;\r\n\r\n\t\t\t\t\tstart = +start; //parse to int\r\n\t\t\t\t\treturn input.slice(start);\r\n\t\t\t\t};\r\n\t\t\t})\r\n\t\t\t.filter('filterForPropertyById', [\r\n\t\t\t\t'$filter',\r\n\t\t\t\tfunction ($filter) {\r\n\t\t\t\t\treturn function (itemId, array, property, customId, defaultValue) {\r\n\t\t\t\t\t\tvar item = [];\r\n\t\t\t\t\t\tswitch (customId) {\r\n\t\t\t\t\t\t\tcase 'ProductCode':\r\n\t\t\t\t\t\t\t\titem = $filter('filter')(array, { ProductCode: itemId });\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\titem = $filter('filter')(array, { Id: itemId }, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (item && item[0]) {\r\n\t\t\t\t\t\t\tif (item[0][property]) {\r\n\t\t\t\t\t\t\t\treturn item[0][property];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t/*if (console && console.log) {\r\n\t\t\t\t\t\t\t\t\tconsole.log(`Item with ID: ${itemId} has no property ${property}`);\r\n\t\t\t\t\t\t\t\t}*/\r\n\t\t\t\t\t\t\t\treturn defaultValue != null ? defaultValue : null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t/*if (console && console.log) {\r\n\t\t\t\t\t\t\t\tconsole.log(`Item with ID: ${itemId} not found in array`);\r\n\t\t\t\t\t\t\t}*/\r\n\t\t\t\t\t\t\treturn defaultValue != null ? defaultValue : null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t])\r\n\t\t\t.filter('toScientificNotation', [\r\n\t\t\t\t'$filter',\r\n\t\t\t\tfunction ($filter) {\r\n\t\t\t\t\treturn function (value) {\r\n\t\t\t\t\t\tif (value == null) return;\r\n\t\t\t\t\t\tvar strValue = '' + value;\r\n\t\t\t\t\t\tif (strValue.length > 3 && strValue.indexOf('.') == -1) {\r\n\t\t\t\t\t\t\tvar precisionString = '' + (strValue.length - 1);\r\n\t\t\t\t\t\t\tstrValue = strValue.replace(/0+$/g, '');\r\n\t\t\t\t\t\t\tif (strValue.length > 1) strValue = strValue.substr(0, 1) + '.' + strValue.substr(1);\r\n\t\t\t\t\t\t\tstrValue += 'e' + precisionString;\r\n\t\t\t\t\t\t\treturn strValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t])\r\n\t\t\t// for capabilities need to look in capabilitygroup array for right capabilites and than in this array read the properties\r\n\t\t\t.filter('filterForPropertyByIdInArray', [\r\n\t\t\t\t'$filter',\r\n\t\t\t\tfunction ($filter) {\r\n\t\t\t\t\treturn function (array, itemId, property) {\r\n\t\t\t\t\t\tvar item = $filter('filter')(array, { Id: itemId }, true);\r\n\t\t\t\t\t\tif (item[0]) {\r\n\t\t\t\t\t\t\tif (item[0][property]) {\r\n\t\t\t\t\t\t\t\treturn item[0][property];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tif (console && console.log) {\r\n\t\t\t\t\t\t\t\t\tconsole.log(`Item with ID: ${itemId} has no property ${property}`);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (console && console.log) {\r\n\t\t\t\t\t\t\t\tconsole.log(`Item with ID: ${itemId} not found in array`);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t])\r\n\t\t\t.filter('getCapabilityValueById', function () {\r\n\t\t\t\treturn function (value) {\r\n\t\t\t\t\tswitch (value) {\r\n\t\t\t\t\t\tcase -1:\r\n\t\t\t\t\t\t\treturn 'no';\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\treturn 'yes';\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\treturn 'not relevant';\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t})\r\n\t\t\t.filter('isOlderThanThreeYears', function () {\r\n\t\t\t\treturn function (value) {\r\n\t\t\t\t\tvar releaseDate = new Date(value);\r\n\t\t\t\t\tvar nowDate = new Date();\r\n\t\t\t\t\tnowDate.setFullYear(nowDate.getFullYear() - 3);\r\n\t\t\t\t\tif (releaseDate.getTime() < nowDate.getTime()) {\r\n\t\t\t\t\t\treturn 'llImportant';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn '';\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t})\r\n\t\t\t.filter('addWbrAfterChar', [\r\n\t\t\t\t'$filter',\r\n\t\t\t\tfunction ($filter) {\r\n\t\t\t\t\treturn function (value, char) {\r\n\t\t\t\t\t\tif (value) {\r\n\t\t\t\t\t\t\tvar reg = new RegExp(char, 'g');\r\n\t\t\t\t\t\t\treturn value.replace(reg, char + '') \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t]);\r\n\t}\r\n}\r\n"]}