{"version":3,"sources":["Honeywell.ClientModel.SolutionTab.ts"],"names":["tabDataPromise","camlTabDetails","_","template","tabMapping","field","propertyName","getTabData","selectedSolution","utils","getCurrentWebListData","GenericHandler","slnTitle","loadTab","templatePromise","Honeywell_ClientModel_TemplateService_1","TemplateService","getTemplate","Q","all","spread","model","$","html","Honeywell_ClientModel_Events_1","spLoad","then","window","location","search","querystringParam","decodeURIComponent","substring","split","filter","param","indexOf","map","parts"],"mappings":"6NASA,IAaIA,GAbAC,EAAyDC,EAAEC,SAAS,oTAGpEC,IACEC,MAAO,QAASC,aAAc,aAC9BD,MAAO,cAAeC,aAAc,mBACpCD,MAAO,QAASC,aAAc,aAC9BD,MAAO,KAAMC,aAAc,UAC3BD,MAAO,SAAUC,aAAc,cAGjCC,EAAa,SAACC,GAAqB,MAAAC,GAAMC,sBAAsB,oBAAoB,GAAID,GAAME,eAAeP,IAAaH,GAAiBW,SAAYJ,MAItJK,EAAU,SAACL,GAEXR,EAAiBO,EAAWC,EAE5B,IAAIM,GAAkB,GAAIC,GAAAC,gBAAgB,yBAAyBC,aAEnEC,GAAEC,KAAUnB,EAAgBc,IAAkBM,OAAO,SAACC,EAAqBlB,GACvEmB,EAAE,gBAAgBC,KAAKpB,EAASkB,MAIxCG,GAAAC,SAASC,KAAK,WACV,GAAIlB,GAAmB,EAG1B,IAA+B,KAA3BmB,OAAOC,SAASC,OAAe,CAClC,GAAIC,GAAmBC,mBAAmBJ,OAAOC,SAASC,OAAOG,UAAU,GAAGC,MAAM,KAAKC,OAAO,SAACC,GAAU,MAAiC,KAAjCA,EAAMC,QAF9F,cAGjBC,IAAI,SAACF,GACL,GAAIG,GAAQH,EAAMF,MAAM,IACxB,OAAOF,oBAAmBO,EAAM,MAEhC,GACF9B,GAAwC,KAArBsB,EAA0B,GAAKA,EAG3C9B,GACGa,EAAQL","file":"Honeywell.ClientModel.SolutionTab.js","sourcesContent":["import {compose2, map} from \"Honeywell.ClientModel.Functional\";\r\nimport * as utils from \"Honeywell.ClientModel.Utilities\";\r\nimport * as Q from \"q\";\r\nimport {TemplateService} from \"Honeywell.ClientModel.TemplateService\";\r\nimport {spLoad} from \"Honeywell.ClientModel.Events\";\r\n\r\n//Type SolutionDataModel\r\ntype TabDataModel = { tabTitle: string, tabDescription: string, tabImage: HTMLImageElement, tabId: string, tabActive: string }[];\r\n\r\nvar camlTabDetails: (term: { slnTitle: string }) => string = _.template(\"<View><Query><Where><And><Eq><FieldRef Name='WebpartType'></FieldRef><Value Type='Choice'>Tab</Value></Eq><Eq><FieldRef Name='SolutionTitle'></FieldRef><Value Type='Lookup'><%= slnTitle %></Value></Eq></And></Where><OrderBy><FieldRef Name='Order' Type='Number' Ascending='TRUE'/></OrderBy></Query></View>\");\r\n\r\n\r\nvar tabMapping: utils.SPFieldMapping[] = [\r\n    { field: \"Title\", propertyName: \"tabTitle\" },\r\n    { field: \"Description\", propertyName: \"tabDescription\" },\r\n    { field: \"Image\", propertyName: \"tabImage\" },\r\n    { field: \"ID\", propertyName: \"tabId\" },\r\n    { field: \"Active\", propertyName: \"tabActive\" }\r\n];\r\n\r\nvar getTabData = (selectedSolution) => utils.getCurrentWebListData('Solution Details')(new utils.GenericHandler(tabMapping))(camlTabDetails({ 'slnTitle': selectedSolution }));\r\n\r\nvar tabDataPromise: Q.Promise<any>;\r\n\r\nvar loadTab = (selectedSolution) => {\r\n\r\n    tabDataPromise = getTabData(selectedSolution);\r\n\r\n    var templatePromise = new TemplateService(\"tpl_HoneywellTab.html\").getTemplate();\r\n\r\n    Q.all(<any>[tabDataPromise, templatePromise]).spread((model: TabDataModel, template: any) => {\r\n        $(\"#SolutionTab\").html(template(model));\r\n    });\r\n};\r\n\r\nspLoad().then(() => {\r\n    var selectedSolution = '';\r\n\r\n\tlet parameterName = 'Solution';\r\n\tif (window.location.search !== '') {\r\n\t\tvar querystringParam = decodeURIComponent(window.location.search.substring(1).split('&').filter((param) => param.indexOf(parameterName) === 0)\r\n\t\t\t.map((param) => {\r\n\t\t\t\tlet parts = param.split('=');\r\n\t\t\t\treturn decodeURIComponent(parts[1])\r\n\t\t\t}\r\n\t\t)[0]);\r\n\t\tselectedSolution = querystringParam === '' ? '' : querystringParam;\r\n\t}\r\n\t\r\n    if (!tabDataPromise) {\r\n            loadTab(selectedSolution);\r\n    }\r\n}); \r\n\r\n\r\n\r\n"]}