{"version":3,"file":"e6ed5b82/mha.js","mappings":"+JAaA,IAAIA,EACAC,EAYJ,SAASC,EAAaC,GAClB,IAAE,WAAWC,KAAKD,GACA,OAAdH,IACAA,EAAUK,OAASF,GAGvBF,EAAMK,uBACV,CAIA,SAASC,IAEA,MACL,IAAYC,WAAW,CAAEC,KAAM,mBAC/BT,EAAY,IAAI,IAAY,IAAE,iBAAiBU,OAC/CT,EAAMU,cAzBN,IAAE,aAAaC,IAAI,mBAAoB,gCACvC,IAAE,aAAaA,IAAI,oBAAqB,aACxC,IAAE,aAAaA,IAAI,sBAAuB,UA0B1CV,EAAa,IAAWW,YAExBZ,EAAMa,cAAcd,GACpBE,EAAa,IAzBb,IAAE,aAAaU,IAAI,aAAc,QA4BrC,CAEA,SAASG,IACL,IAAE,iBAAiBL,IAAI,IAEvBV,EAAY,IAAI,IAChBC,EAAMU,cACNV,EAAMe,gBAAgBhB,GACtBiB,SAASC,eAAe,iBAAiBC,OAC7C,CAEA,SAASC,IACL,IAAQC,gBAAgBrB,EAAUsB,YAClCL,SAASC,eAAe,eAAeC,OAC3C,CAEI,KACA,KAAE,WACE,IAAYI,IAAI,WAAY,cAC5BvB,EAAY,IAAI,IAChBC,EAAQ,IAAI,IACZA,EAAMuB,kBAAkBxB,GACxBC,EAAMwB,kBAAkB,eAAgB,gBAAiB,IAAWC,WAAW,KAAM,IAEpFT,SAASU,cAAc,kBAAwCC,QAAUrB,EACzEU,SAASU,cAAc,gBAAsCC,QAAUb,EACvEE,SAASU,cAAc,eAAqCC,QAAUR,CAC3E,G","sources":["webpack://mha/./src/Scripts/ui/mha.ts"],"sourcesContent":["import \"office-ui-fabric-js/dist/css/fabric.min.css\";\r\nimport \"office-ui-fabric-js/dist/css/fabric.components.min.css\";\r\nimport \"../../Content/fabric.css\";\r\nimport \"../../Content/Office.css\";\r\nimport \"../../Content/classicDesktopFrame.css\";\r\nimport $ from \"jquery\";\r\n\r\nimport { diagnostics } from \"../Diag\";\r\nimport { HeaderModel } from \"../HeaderModel\";\r\nimport { mhaStrings } from \"../mhaStrings\";\r\nimport { Strings } from \"../Strings\";\r\nimport { Table } from \"./Table\";\r\n\r\nlet viewModel: HeaderModel;\r\nlet table: Table;\r\n\r\nfunction enableSpinner() {\r\n $(\"#response\").css(\"background-image\", \"url(../Resources/loader.gif)\");\r\n $(\"#response\").css(\"background-repeat\", \"no-repeat\");\r\n $(\"#response\").css(\"background-position\", \"center\");\r\n}\r\n\r\nfunction disableSpinner() {\r\n $(\"#response\").css(\"background\", \"none\");\r\n}\r\n\r\nfunction updateStatus(statusText: string) {\r\n $(\"#status\").text(statusText);\r\n if (viewModel !== null) {\r\n viewModel.status = statusText;\r\n }\r\n\r\n table.recalculateVisibility();\r\n}\r\n\r\n// Do our best at recognizing RFC 2822 headers:\r\n// http://tools.ietf.org/html/rfc2822\r\nfunction analyze() {\r\n // Can't do anything without jQuery\r\n if (!$) return;\r\n diagnostics.trackEvent({ name: \"analyzeHeaders\" });\r\n viewModel = new HeaderModel($(\"#inputHeaders\").val() as string);\r\n table.resetArrows();\r\n\r\n enableSpinner();\r\n updateStatus(mhaStrings.mhaLoading);\r\n\r\n table.rebuildTables(viewModel);\r\n updateStatus(\"\");\r\n\r\n disableSpinner();\r\n}\r\n\r\nfunction clear() {\r\n $(\"#inputHeaders\").val(\"\");\r\n\r\n viewModel = new HeaderModel();\r\n table.resetArrows();\r\n table.rebuildSections(viewModel);\r\n document.getElementById(\"inputHeaders\")?.focus();\r\n}\r\n\r\nfunction copy() {\r\n Strings.copyToClipboard(viewModel.toString());\r\n document.getElementById(\"copyButton\")?.focus();\r\n}\r\n\r\nif ($) {\r\n $(function() {\r\n diagnostics.set(\"API used\", \"standalone\");\r\n viewModel = new HeaderModel();\r\n table = new Table();\r\n table.initializeTableUI(viewModel);\r\n table.makeResizablePane(\"inputHeaders\", \"sectionHeader\", mhaStrings.mhaPrompt, () => true);\r\n\r\n (document.querySelector(\"#analyzeButton\") as HTMLButtonElement).onclick = analyze;\r\n (document.querySelector(\"#clearButton\") as HTMLButtonElement).onclick = clear;\r\n (document.querySelector(\"#copyButton\") as HTMLButtonElement).onclick = copy;\r\n });\r\n}\r\n"],"names":["viewModel","table","updateStatus","statusText","text","status","recalculateVisibility","analyze","trackEvent","name","val","resetArrows","css","mhaLoading","rebuildTables","clear","rebuildSections","document","getElementById","focus","copy","copyToClipboard","toString","set","initializeTableUI","makeResizablePane","mhaPrompt","querySelector","onclick"],"sourceRoot":""}