{"version":3,"sources":["Core/Environment.ts"],"names":["define","require","exports","Object","defineProperty","value","Notifications","UrlContext","Config","config","initialize","configFile","this","[object Object]","app","contextMappings","$","html","release","createParameterMapping","window","location","search","substring","hash","inputString","match","pl","decode","s","decodeURIComponent","replace","query","urlParams","exec","key","e","param","mapping","getQueryStringParams","message","type","duration","DevExpress","ui","notify","closeOnClick","closeOnOutsideClick","position","my","at","animation","hide","to","opacity","from","show"],"mappings":"AAAAA,OAAO,CAAC,UAAW,WAAY,SAAUC,EAASC,GAC9C,aACAC,OAAOC,eAAeF,EAAS,aAAc,CAAEG,OAAO,IACtDH,EAAQI,cAAgBJ,EAAQK,WAAaL,EAAQM,OAASN,EAAQO,YAAS,EAC/EP,EAAQQ,WACR,SAAoBC,GAChBC,KAAKH,OAAS,IAAID,EAAOG,IAE7B,MAAMH,EACFK,YAAYF,GACHA,IAELC,KAAKE,IAAMH,EAAWG,IACtBF,KAAKG,gBAAkBJ,EAAWI,gBAClCC,EAAE,iBAAiBC,KAAKN,EAAWG,IAAII,WAG/ChB,EAAQM,OAASA,EACjB,MAAMD,EACFM,8BACI,OAAON,EAAWY,uBAAuBC,OAAOC,SAASC,OAAOC,UAAU,IAE9EV,uBACI,OAAON,EAAWY,uBAAuBC,OAAOC,SAASG,KAAKD,UAAU,IAE5EV,8BAA8BY,GAC1B,IAGI,IAFA,IAAIC,EAAOC,EAAK,MAAOL,EAAS,qBAAsBM,EAAUC,GAAeC,mBAAmBD,EAAEE,QAAQJ,EAAI,MAAUK,EAAQP,EAC9HQ,EAAY,GACTP,EAAQJ,EAAOY,KAAKF,IAAQ,CAC/B,IAAIG,EAAMP,EAAOF,EAAM,IACnBrB,EAAQuB,EAAOF,EAAM,IACzBO,EAAUE,GAAO9B,EAErB,OAAO4B,EAEX,MAAOG,GACH,OAAO,MAGfvB,2BAA2BwB,GACvB,IAAIC,EAAU/B,EAAWgC,uBACzB,OAAOD,EAAQD,GAASC,EAAQD,GAAS,IAGjDnC,EAAQK,WAAaA,EAkBrBL,EAAQI,cAjBR,MACIO,wBAAwB2B,EAASC,EAAMC,EAAW,MAC9CC,WAAWC,GAAGC,OAAO,CACjBL,QAASA,EACTM,cAAc,EACdC,qBAAqB,EACrBC,SAAU,CACNC,GAAI,aACJC,GAAI,cAERC,UAAW,CACPC,KAAM,CAAEX,KAAM,OAAQC,SAAU,IAAKW,GAAI,CAAEC,QAAS,GAAKC,KAAM,CAAED,QAAS,IAC1EE,KAAM,CAAEf,KAAM,OAAQC,SAAU,OAErCD,EAAMC","sourcesContent":["import Interfaces = require(\"./Interfaces\");\n\n\nexport var config: Interfaces.IAppConfig;\n\nexport function initialize(configFile: Interfaces.IAppConfig): void {\n this.config = new Config(configFile);\n}\n\nexport class Config implements Interfaces.IAppConfig {\n constructor(configFile: Interfaces.IAppConfig) {\n if (!configFile)\n return;\n\n this.app = configFile.app;\n this.contextMappings = configFile.contextMappings;\n $('#buildVersion').html(configFile.app.release);\n }\n\n public app: Interfaces.IAppMainConfig;\n public contextMappings: Array;\n}\n\nexport class UrlContext {\n public static getQueryStringParams(): Interfaces.IUrlParamMap {\n return UrlContext.createParameterMapping(window.location.search.substring(1));\n }\n public static getHashParams(): Interfaces.IUrlParamMap {\n return UrlContext.createParameterMapping(window.location.hash.substring(1));\n }\n\n private static createParameterMapping(inputString: string): Interfaces.IUrlParamMap {\n try {\n\n var match: RegExpExecArray,\n pl = /\\+/g, // Regex for replacing addition symbol with a space\n search = /([^&=]+)=?([^&]*)/g,\n decode = (s: string) => { return decodeURIComponent(s.replace(pl, \" \")); },\n query = inputString;\n\n var urlParams = {};\n\n // ReSharper disable once AssignmentInConditionExpression\n while (match = search.exec(query)) {\n var key = decode(match[1]);\n var value = decode(match[2]);\n urlParams[key] = value;\n }\n return urlParams;\n } catch (e) {\n return null;\n }\n }\n\n static getQueryStringParam(param: string): string {\n var mapping = UrlContext.getQueryStringParams();\n return mapping[param] ? mapping[param] : \"\";\n }\n}\n\nexport class Notifications {\n public static showNotification(message: string, type: string, duration = 15000) {\n DevExpress.ui.notify({\n message: message,\n closeOnClick: true,\n closeOnOutsideClick: true,\n position: {\n my: \"center top\",\n at: \"center top\"\n },\n animation: {\n hide: { type: 'fade', duration: 400, to: { opacity: 0 }, from: { opacity: 1 } },\n show: { type: 'fade', duration: 400 }\n }\n }, type, duration);\n }\n}\n"],"file":"Environment.js"}