{"version":3,"sources":["../index.tsx","../App.tsx","../SearchForm.tsx","../TemplateSelector.tsx","../SearchResults.tsx","ErrorSection.tsx","../RequestForm.tsx","serviceWorker.ts"],"names":["file_type_icons_1","initializeFileTypeIcons","o","_this","e","method","ErrorSection","props","state","this","ErrorMessage","length","className","React","isLocalhost","Boolean","window","location","hostname","match","register","config","navigator","URL","process","href","origin","addEventListener","swUrl","fetch","headers","then","response","contentType","get","status","indexOf","serviceWorker","ready","registration","unregister","reload","registerValidSW","catch","console","log","checkValidServiceWorker","onupdatefound","installingWorker","installing","onstatechange","controller","onUpdate","onSuccess","error","message"],"mappings":"uLASA,WACA,QACA,OACA,IAAI,EAAJ,OACA,SACA,OACA,IAAI,EAAJ,OACA,SAIA,oBAIAA,EAAkBC,0BAElB,IAAM,EAAY,IAAI,gBAAgB,OAAO,SAAS,QAEtD,EAAS,OACP,gBAAC,EAAM,WAAU,KACX,gBAAC,UAAG,CAAC,oBAAqB,EAAU,IAAI,MAAO,EAAU,IAAI,MAAkB,MAErF,SAAS,eAAe,SAM1B,EAAc,c,meC7Bd,WACA,OACA,aACA,SACA,SACA,SACA,SA4BA,cAII,WAAmB,EAAkB,GAArC,MACI,YAAM,EAAO,IAAM,K,OAEnB,EAAK,MAAQ,CACT,eAAgB,KAChB,SAAU,KACV,MAAO,GACP,aAAc,GACd,iBAAiB,G,EAsH7B,OAlIiC,OAgBtB,8BAAP,sBAGI,OAAsC,MAA7B,OAAO,SAAS,SAAmB,GAAK,OAAO,SAAS,UAAQ,qBAAqB,KAAK,iBAC9F,MAAK,YAAQ,mBAAa,YACvB,QAAQ,IAAI,GACZ,EAAK,SAAS,CAAE,SAAU,GAAI,MAAO,GAAI,aAAc,iEAE1D,MAAK,YACF,EAAK,SAAS,CAAE,eAAgB,EAAU,aAAe,EAAS,WAAa,GAAK,mEACzD,IAAvB,EAAS,WAAkD,OAAvB,EAAS,WAAoD,IAA9B,EAAS,UAAU,SACtF,OAAO,SAAS,MAAQ,EAAS,cAG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xB,GAAUA,EAAOgC,WACnBhC,EAAOgC,UAAUd,WAO5BI,OAAM,SAAAW,GACLV,QAAQU,MAAM,4CAA6CA,MAkC1D,SAASd,IACV,kBAAmBlB,WACrBA,UAAUe,cAAcC,MACrBP,MAAK,SAAAQ,GACJA,EAAaC,gBAEdG,OAAM,SAAAW,GACLV,QAAQU,MAAMA,EAAMC,e","file":"static/js/main.3b944a53.chunk.js","sourcesContent":["\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n//******************************************************************************\r\n// Copyright 2018-2020, ShareSquared Inc., All Rights Reserved.\r\n//\r\n// Author: Ted Iverson\r\n// Created: 06/22/2020\r\n//\r\n// The contents of this file are proprietary and considered trade secret.\r\n// Any disclosure outside of its intended use is expressly prohibited.\r\n//******************************************************************************\r\nvar React = require(\"react\");\r\nvar ReactDOM = require(\"react-dom\");\r\nrequire(\"./index.css\");\r\nvar App_1 = require(\"./App\");\r\nvar serviceWorker = require(\"./serviceWorker\");\r\nrequire(\"bootstrap/dist/css/bootstrap.min.css\");\r\nvar Icons_1 = require(\"@fluentui/react/lib/Icons\");\r\nvar file_type_icons_1 = require(\"@uifabric/file-type-icons\");\r\n// NOTE: this needs to be done or the icons used by the react UI control\r\n// won't be displayed\r\nIcons_1.initializeIcons();\r\n// this loads the filetype icons so they can be used in the FileType\r\n// results column\r\nfile_type_icons_1.initializeFileTypeIcons();\r\nvar urlParams = new URLSearchParams(window.location.search);\r\nReactDOM.render(React.createElement(React.StrictMode, null,\r\n React.createElement(App_1.default, { InitialTemplateName: urlParams.has(\"id\") ? urlParams.get(\"id\") : \"\" })), document.getElementById('root'));\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n//# sourceMappingURL=index.js.map","\"use strict\";\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n//******************************************************************************\r\n// Copyright 2018-2020, ShareSquared Inc., All Rights Reserved.\r\n//\r\n// Author: Ted Iverson\r\n// Created: 06/22/2020\r\n//\r\n// The contents of this file are proprietary and considered trade secret.\r\n// Any disclosure outside of its intended use is expressly prohibited.\r\n//******************************************************************************\r\nvar React = require(\"react\");\r\nrequire(\"./App.css\");\r\nvar SearchForm_1 = require(\"./SearchForm\");\r\nvar TemplateSelector_1 = require(\"./TemplateSelector\");\r\nvar SearchResults_1 = require(\"./SearchResults\");\r\nvar ErrorSection_1 = require(\"./ErrorSection\");\r\nvar RequestForm_1 = require(\"./RequestForm\");\r\nvar App = /** @class */ (function (_super) {\r\n __extends(App, _super);\r\n function App(props, state) {\r\n var _this = _super.call(this, props, state) || this;\r\n _this.state = {\r\n GlobalSettings: null,\r\n Template: null,\r\n Query: \"\",\r\n ErrorMessage: \"\",\r\n RequestFormOpen: false\r\n };\r\n return _this;\r\n }\r\n App.prototype.componentDidMount = function () {\r\n var _this = this;\r\n // After the component is loaded, request the global settings\r\n fetch((window.location.pathname === \"/\" ? \"\" : window.location.pathname) + \"/api/settings?url=\" + this.getLicenseUrl())\r\n .then(function (data) { return data.json(); }, function (e) {\r\n console.log(e);\r\n _this.setState({ Template: \"\", Query: \"\", ErrorMessage: \"A general error occurred. Contact the site administrator.\" });\r\n })\r\n .then(function (settings) {\r\n _this.setState({ GlobalSettings: settings, ErrorMessage: (settings.isLicensed ? \"\" : \"A license error occurred. Contact the site administrator.\") });\r\n if (settings.pageTitle !== undefined && settings.pageTitle !== null && settings.pageTitle.length !== 0) {\r\n window.document.title = settings.pageTitle;\r\n }\r\n })\r\n .catch(function (e) {\r\n console.log(e);\r\n _this.setState({ Template: \"\", Query: \"\", ErrorMessage: \"A general error occurred. Contact the site administrator.\" });\r\n });\r\n };\r\n App.prototype.render = function () {\r\n var _this = this;\r\n var element;\r\n if (this.state.GlobalSettings !== null) {\r\n if (this.state.GlobalSettings.isLicensed) {\r\n element =\r\n React.createElement(\"div\", { className: \"App\" },\r\n React.createElement(TemplateSelector_1.default, { InitialTemplateName: this.props.InitialTemplateName, OnTemplateChanged: function (template) {\r\n var _a;\r\n _this.setState({ Template: template, Query: \"\", ErrorMessage: \"\", RequestFormOpen: false });\r\n (_a = _this._SearchResults) === null || _a === void 0 ? void 0 : _a.clearResults();\r\n }, OnError: function (errorMessage) {\r\n _this.setState({ ErrorMessage: errorMessage });\r\n } }),\r\n React.createElement(SearchForm_1.default, { Template: this.state.Template, OnClear: function () {\r\n var _a;\r\n _this.setState({ Query: \"\", ErrorMessage: \"\", RequestFormOpen: false });\r\n (_a = _this._SearchResults) === null || _a === void 0 ? void 0 : _a.clearResults();\r\n }, OnSearch: function (query) {\r\n var _a, _b;\r\n _this.setState({ Query: query, ErrorMessage: \"\", RequestFormOpen: false });\r\n (_a = _this._SearchResults) === null || _a === void 0 ? void 0 : _a.clearResults();\r\n (_b = _this._SearchResults) === null || _b === void 0 ? void 0 : _b.search(query);\r\n }, OnError: function (errorMessage) {\r\n _this.setState({ ErrorMessage: errorMessage });\r\n } }),\r\n React.createElement(SearchResults_1.default, { Ref: function (c) { return _this._SearchResults = c; }, Query: this.state.Query, Template: this.state.Template, GlobalSettings: this.state.GlobalSettings, OnError: function (errorMessage) {\r\n _this.setState({ ErrorMessage: errorMessage });\r\n }, OnLinkError: function (errorMessage) {\r\n alert(errorMessage);\r\n }, OnManualRequest: function () {\r\n _this.setState({ RequestFormOpen: true });\r\n } }),\r\n React.createElement(RequestForm_1.default, { IsVisible: this.state.RequestFormOpen, Query: this.state.Query, Template: this.state.Template, GlobalSettings: this.state.GlobalSettings, OnClear: function () {\r\n _this.setState({ RequestFormOpen: false });\r\n }, OnSearch: function (query) {\r\n }, OnError: function (errorMessage) {\r\n _this.setState({ ErrorMessage: errorMessage });\r\n } }),\r\n React.createElement(ErrorSection_1.default, { ErrorMessage: this.state.ErrorMessage }),\r\n React.createElement(\"div\", { className: \"version\" }, \"Version 1.1.8\"));\r\n }\r\n else {\r\n console.log(\"Product is not licensed\");\r\n element =\r\n React.createElement(\"div\", { className: \"App\" },\r\n React.createElement(ErrorSection_1.default, { ErrorMessage: this.state.ErrorMessage }));\r\n }\r\n }\r\n else {\r\n element = React.createElement(\"span\", null);\r\n }\r\n return element;\r\n };\r\n App.prototype.getLicenseUrl = function () {\r\n var licensedUrl = \"\";\r\n var url = (window.parent !== window) ? document.referrer : window.location.href;\r\n console.log(\"originalUrl=\" + url);\r\n //const rx = new RegExp(\"^https?://([^/]+)(/.*)?$\");\r\n var rx = new RegExp(\"^https?://([^/]+)(/[^#\\?]*)?\");\r\n var m = rx.exec(url);\r\n if (m != null) {\r\n if (m.length < 3) {\r\n m.push(\"/\");\r\n } // if root\r\n licensedUrl = m[2].toLowerCase();\r\n }\r\n console.log(\"licenseUrl=\" + licensedUrl);\r\n return licensedUrl;\r\n };\r\n return App;\r\n}(React.Component));\r\nexports.default = App;\r\n//# sourceMappingURL=App.js.map","\"use strict\";\r\n//******************************************************************************\r\n// Copyright 2018-2020, ShareSquared Inc., All Rights Reserved.\r\n//\r\n// Author: Ted Iverson\r\n// Created: 06/22/2020\r\n//\r\n// The contents of this file are proprietary and considered trade secret.\r\n// Any disclosure outside of its intended use is expressly prohibited.\r\n//******************************************************************************\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n//#region Imports\r\nvar React = require(\"react\");\r\nrequire(\"jquery/src/jquery\");\r\nvar Label_1 = require(\"@fluentui/react/lib/Label\");\r\nvar Button_1 = require(\"@fluentui/react/lib/Button\");\r\nvar DatePicker_1 = require(\"@fluentui/react/lib/DatePicker\");\r\nvar TextField_1 = require(\"@fluentui/react/lib/TextField\");\r\nvar Dropdown_1 = require(\"@fluentui/react/lib/Dropdown\");\r\nvar react_bootstrap_1 = require(\"react-bootstrap\");\r\nvar SearchPanel = /** @class */ (function (_super) {\r\n __extends(SearchPanel, _super);\r\n function SearchPanel(props, state) {\r\n var _this = _super.call(this, props, state) || this;\r\n // tracks the properties of each field on the form so we can have the information\r\n // during the building of the query (mainly Type and Mapped Property)\r\n _this.formFieldProps = new Map();\r\n _this.state = { FormValues: {}, KeywordText: \"\" };\r\n return _this;\r\n }\r\n SearchPanel.prototype.renderField = function (field, idx) {\r\n var _this = this;\r\n var f;\r\n switch (field.fieldType.toLowerCase()) {\r\n default:\r\n case \"text\": {\r\n var id_1 = \"txt_\" + idx;\r\n this.formFieldProps.set(id_1, { Id: id_1, Type: field.fieldType, PropertyName: field.property, });\r\n f = (React.createElement(TextField_1.TextField, { id: id_1, key: id_1, label: field.label, className: \"S2Input S2TextField\", value: this.state.FormValues[id_1], onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n var o = _this.state.FormValues;\r\n o[id_1] = v;\r\n _this.setState({ FormValues: o });\r\n }\r\n } }));\r\n break;\r\n }\r\n case \"date\": {\r\n var id1_1 = \"sd_\" + idx;\r\n this.formFieldProps.set(id1_1, { Id: id1_1, Type: field.fieldType, PropertyName: field.property });\r\n var id2_1 = \"ed_\" + idx;\r\n this.formFieldProps.set(id2_1, { Id: id2_1, Type: field.fieldType, PropertyName: field.property });\r\n f = (React.createElement(\"span\", { key: \"spandt_\" + idx },\r\n React.createElement(DatePicker_1.DatePicker, { id: id1_1, key: id1_1, label: field.label, className: \"S2Input S2DateField S2ComboField\", title: \"on or after\", placeholder: \"on or after\", allowTextInput: true, value: this.state.FormValues[id1_1], onSelectDate: function (dt) {\r\n if (dt !== undefined && dt !== null) {\r\n var o = _this.state.FormValues;\r\n o[id1_1] = dt;\r\n _this.setState({ FormValues: o });\r\n }\r\n } }),\r\n React.createElement(DatePicker_1.DatePicker, { id: id2_1, key: id2_1, className: \"S2Input S2DateField\", title: \"before or on\", placeholder: \"before or on\", allowTextInput: true, textField: { onRenderLabel: function (props) { return (React.createElement(Label_1.Label, null, \"\\u00A0\")); } }, value: this.state.FormValues[id2_1], onSelectDate: function (dt) {\r\n if (dt !== undefined && dt !== null) {\r\n var o = _this.state.FormValues;\r\n o[id2_1] = dt;\r\n _this.setState({ FormValues: o });\r\n }\r\n } })));\r\n break;\r\n }\r\n case \"number\": {\r\n var id1_2 = \"ln_\" + idx;\r\n this.formFieldProps.set(id1_2, { Id: id1_2, Type: field.fieldType, PropertyName: field.property });\r\n var id2_2 = \"hn_\" + idx;\r\n this.formFieldProps.set(id2_2, { Id: id2_2, Type: field.fieldType, PropertyName: field.property });\r\n f = (React.createElement(\"span\", { key: \"spannum_\" + idx },\r\n React.createElement(TextField_1.TextField, { id: id1_2, key: id1_2, label: field.label, className: \"S2Input S2NumberField S2ComboField\", title: \"equal to or greater\", placeholder: \"equal to or greater\", value: this.state.FormValues[id1_2], onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n var o = _this.state.FormValues;\r\n o[id1_2] = v;\r\n _this.setState({ FormValues: o });\r\n }\r\n } }),\r\n React.createElement(TextField_1.TextField, { id: id2_2, key: id2_2, className: \"S2Input S2NumberField\", title: \"less than or equal\", placeholder: \"less than or equal\", onRenderLabel: function (props) { return (React.createElement(Label_1.Label, null, \"\\u00A0\")); }, value: this.state.FormValues[id2_2], onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n var o = _this.state.FormValues;\r\n o[id2_2] = v;\r\n _this.setState({ FormValues: o });\r\n }\r\n } })));\r\n break;\r\n }\r\n case \"boolean\": {\r\n var id_2 = \"bool_\" + idx;\r\n this.formFieldProps.set(id_2, { Id: id_2, Type: field.fieldType, PropertyName: field.property });\r\n f = (React.createElement(Dropdown_1.Dropdown, { id: id_2, key: id_2, label: field.label, className: \"S2Input S2BooleanField\", options: [\r\n { key: '', text: '' },\r\n { key: '1', text: 'Yes' },\r\n { key: '0', text: 'No' }\r\n ], selectedKey: this.state.FormValues[id_2], onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n var o = _this.state.FormValues;\r\n o[id_2] = v.key;\r\n _this.setState({ FormValues: o });\r\n }\r\n } }));\r\n break;\r\n }\r\n case \"list\": {\r\n var id_3 = \"lst_\" + idx;\r\n this.formFieldProps.set(id_3, { Id: id_3, Type: field.fieldType, PropertyName: field.property });\r\n f = (React.createElement(Dropdown_1.Dropdown, { id: id_3, key: id_3, className: \"S2Input S2ListField\", placeholder: \"Select option(s)\", label: field.label, multiSelect: true, options: field.options.map(function (o) {\r\n return { key: o, text: o };\r\n }), selectedKeys: this.state.FormValues[id_3] !== undefined ? this.state.FormValues[id_3].split(\";\") : [], onChange: function (evt, v) {\r\n var curOptions = _this.state.FormValues[id_3] !== undefined ? _this.state.FormValues[id_3].split(\";\") : [];\r\n var foundIndex = curOptions.indexOf(v === null || v === void 0 ? void 0 : v.key);\r\n if ((v === null || v === void 0 ? void 0 : v.selected) && foundIndex === -1)\r\n curOptions.push(v === null || v === void 0 ? void 0 : v.key);\r\n if (!(v === null || v === void 0 ? void 0 : v.selected) && foundIndex !== -1)\r\n curOptions.splice(foundIndex, 1);\r\n var o = _this.state.FormValues;\r\n o[id_3] = curOptions.join(\";\");\r\n _this.setState({ FormValues: o });\r\n } }));\r\n break;\r\n }\r\n }\r\n return f;\r\n };\r\n SearchPanel.prototype.renderCol = function (fields, rowsPerCol, colNumber) {\r\n var _this = this;\r\n return (React.createElement(react_bootstrap_1.Col, { key: \"col_\" + colNumber, lg: \"4\" }, fields.map(function (f, idx) {\r\n return _this.renderField(f, (idx + 1) + (colNumber * rowsPerCol));\r\n })));\r\n };\r\n SearchPanel.prototype.renderFormRows = function () {\r\n var template = this.props.Template;\r\n // split the fields across the 3 columns and render\r\n var RowsPerCol = Math.ceil(template.form.fields.length / 3);\r\n var rows = [];\r\n rows.push(this.renderCol(template.form.fields.slice(0, RowsPerCol), RowsPerCol, 0));\r\n rows.push(this.renderCol(template.form.fields.slice(RowsPerCol, (RowsPerCol * 2)), RowsPerCol, 1));\r\n rows.push(this.renderCol(template.form.fields.slice(RowsPerCol * 2), RowsPerCol, 2));\r\n return (React.createElement(react_bootstrap_1.Row, null, rows));\r\n };\r\n SearchPanel.prototype.render = function () {\r\n var _this = this;\r\n return (React.createElement(\"div\", { className: \"S2SearchForm\", onKeyUp: function (event) {\r\n if (event.keyCode === 13) {\r\n _this.searchClicked();\r\n }\r\n } },\r\n React.createElement(react_bootstrap_1.Container, null,\r\n React.createElement(react_bootstrap_1.Row, null,\r\n React.createElement(react_bootstrap_1.Col, { lg: \"9\" },\r\n React.createElement(TextField_1.TextField, { className: \"S2Search\", label: \"Keywords\", value: this.state.KeywordText, onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n _this.setState({ KeywordText: v });\r\n }\r\n } })),\r\n React.createElement(react_bootstrap_1.Col, { lg: \"3\" },\r\n React.createElement(\"span\", { className: \"S2SearchFormButtons\" },\r\n React.createElement(Button_1.PrimaryButton, { className: \"S2SearchButton\", text: \"Search\", onClick: function () { _this.searchClicked(); } }),\r\n React.createElement(Button_1.DefaultButton, { className: \"S2ClearButton\", text: \"Clear\", onClick: function () { _this.clearClicked(); } })))),\r\n (this.props.Template !== null) ? this.renderFormRows() : null)));\r\n };\r\n SearchPanel.prototype.setErrorMessage = function (message) {\r\n if (this.props.OnError)\r\n this.props.OnError(message);\r\n };\r\n SearchPanel.prototype.validateDateRanges = function () {\r\n var _this = this;\r\n var valid = true;\r\n this.formFieldProps.forEach(function (f) {\r\n if (f.Id.indexOf(\"sd_\") !== -1) {\r\n var sv = _this.state.FormValues[f.Id];\r\n var ev = _this.state.FormValues[f.Id.replace(\"sd\", \"ed\")];\r\n if (sv !== undefined && sv !== null && ev !== undefined && ev !== null) {\r\n var sdt = Date.parse(sv);\r\n var edt = Date.parse(ev);\r\n if (sdt > edt) {\r\n _this.setErrorMessage(\"There are date-sequencing errors\");\r\n valid = false;\r\n }\r\n }\r\n }\r\n });\r\n return valid;\r\n };\r\n SearchPanel.prototype.validateNumberRanges = function () {\r\n var _this = this;\r\n var valid = true;\r\n this.formFieldProps.forEach(function (f) {\r\n if (f.Id.indexOf(\"ln_\") !== -1) {\r\n var sv = _this.state.FormValues[f.Id];\r\n var ev = _this.state.FormValues[f.Id.replace(\"ln\", \"hn\")];\r\n if (sv !== undefined && sv !== null && ev !== undefined && ev !== null) {\r\n var sdt = parseFloat(sv);\r\n var edt = parseFloat(ev);\r\n if (sdt > edt) {\r\n _this.setErrorMessage(\"There are number-sequencing errors\");\r\n valid = false;\r\n }\r\n }\r\n }\r\n });\r\n return valid;\r\n };\r\n SearchPanel.prototype.buildQuery = function () {\r\n var _this = this;\r\n var qry = this.state.KeywordText;\r\n var prevValue = \"\";\r\n this.formFieldProps.forEach(function (f) {\r\n var value = _this.state.FormValues[f.Id];\r\n if (value !== undefined && value !== null && value.length !== 0) {\r\n if (qry.length !== 0)\r\n qry += \" \";\r\n switch (f.Type.toLowerCase()) {\r\n default:\r\n case \"text\": {\r\n qry += f.PropertyName + \":\\\"\" + value + \"\\\"\";\r\n break;\r\n }\r\n case \"date\": {\r\n // NOTE: since ranges are ANDs, we need to handle the grouping\r\n if (f.Id.indexOf(\"sd_\") !== -1) {\r\n var ev = _this.state.FormValues[f.Id.replace(\"sd\", \"ed\")];\r\n if (ev !== undefined && ev !== null)\r\n qry += \"(\";\r\n prevValue = value;\r\n }\r\n else {\r\n if (prevValue.length !== 0)\r\n qry += \"AND \";\r\n }\r\n var op = (f.Id.indexOf(\"sd_\") !== -1) ? \">=\" : \"<=\";\r\n var dt = new Date(Date.parse(value));\r\n qry += \"\" + f.PropertyName + op + (\"\" + dt.getFullYear() + \"-\" + _this.zeroPad(dt.getMonth() + 1) + \"-\" + _this.zeroPad(dt.getDate()));\r\n if (f.Id.indexOf(\"ed_\") !== -1) {\r\n if (prevValue.length !== 0)\r\n qry += \")\";\r\n prevValue = \"\";\r\n }\r\n break;\r\n }\r\n case \"number\": {\r\n // NOTE: since ranges are ANDs, we need to handle the grouping\r\n if (f.Id.indexOf(\"ln_\") !== -1) {\r\n var ev = _this.state.FormValues[f.Id.replace(\"sd\", \"ed\")];\r\n if (ev !== undefined && ev !== null)\r\n qry += \"(\";\r\n prevValue = value;\r\n }\r\n else {\r\n if (prevValue.length !== 0)\r\n qry += \"AND \";\r\n }\r\n var op = (f.Id.indexOf(\"ln_\") !== -1) ? \">=\" : \"<=\";\r\n qry += \"\" + f.PropertyName + op + value;\r\n if (f.Id.indexOf(\"hn_\") !== -1) {\r\n if (prevValue.length !== 0)\r\n qry += \")\";\r\n prevValue = \"\";\r\n }\r\n break;\r\n }\r\n case \"boolean\": {\r\n qry += f.PropertyName + \"=\" + value;\r\n break;\r\n }\r\n case \"list\": {\r\n // NOTE: lists are multi-select and are handled implicitly by\r\n // SharePoint search as ORs\r\n value.split(\";\").forEach(function (v, idx) {\r\n if (v.length !== 0) {\r\n if (idx !== 0)\r\n qry += \" \";\r\n //qry += `${f.PropertyName}:\"${v}\"`;\r\n qry += f.PropertyName + \"=\\\"\" + v + \"\\\"\";\r\n }\r\n });\r\n break;\r\n }\r\n }\r\n }\r\n });\r\n // wrap the query with the QueryTemplate if one is defined, otherwise\r\n // just use the provided query as is\r\n var Query = !this.props.Template.queryTemplate || this.props.Template.queryTemplate.length === 0 ?\r\n qry :\r\n this.props.Template.queryTemplate.replace(\"{{query}}\", qry);\r\n return Query;\r\n };\r\n SearchPanel.prototype.zeroPad = function (num) {\r\n var s = '';\r\n if (num < 10) {\r\n s = '0';\r\n }\r\n s += num.toString();\r\n return s;\r\n };\r\n SearchPanel.prototype.searchClicked = function () {\r\n if (this.validateDateRanges() && this.validateNumberRanges()) {\r\n if (this.props.OnSearch !== undefined) {\r\n var qry = this.buildQuery();\r\n //console.log(`qry: ${qry}`);\r\n this.props.OnSearch(qry);\r\n }\r\n }\r\n };\r\n SearchPanel.prototype.clearClicked = function () {\r\n var o = this.state.FormValues;\r\n this.formFieldProps.forEach(function (f) {\r\n o[f.Id] = \"\";\r\n });\r\n this.setState({ FormValues: o, KeywordText: \"\" });\r\n if (this.props.OnClear !== undefined)\r\n this.props.OnClear();\r\n };\r\n return SearchPanel;\r\n}(React.Component));\r\nexports.default = SearchPanel;\r\n//# sourceMappingURL=SearchForm.js.map","\"use strict\";\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n//******************************************************************************\r\n// Copyright 2018-2020, ShareSquared Inc., All Rights Reserved.\r\n//\r\n// Author: Ted Iverson\r\n// Created: 06/24/2020\r\n//\r\n// The contents of this file are proprietary and considered trade secret.\r\n// Any disclosure outside of its intended use is expressly prohibited.\r\n//******************************************************************************\r\nvar React = require(\"react\");\r\nvar Dropdown_1 = require(\"@fluentui/react/lib/Dropdown\");\r\nvar react_bootstrap_1 = require(\"react-bootstrap\");\r\nvar TemplateSelector = /** @class */ (function (_super) {\r\n __extends(TemplateSelector, _super);\r\n function TemplateSelector(props, state) {\r\n var _this = _super.call(this, props, state) || this;\r\n _this.state = {\r\n Templates: [], TemplateName: _this.props.InitialTemplateName\r\n };\r\n return _this;\r\n }\r\n // After the component is rendered, request the list of template\r\n // and since the dropdown is bound to the state variable, it will\r\n // be updated on load\r\n TemplateSelector.prototype.componentDidMount = function () {\r\n var _this = this;\r\n // request the list of templates\r\n // NOTE: since the dropdown is bound to the state variable, it will\r\n // be updated when this promise if fulfilled\r\n // NOTE: we also have to manually call the onTemplateChanged event since\r\n // it isn't called automatically when the control is initialized with a value\r\n fetch((window.location.pathname === \"/\" ? \"\" : window.location.pathname) + \"/api/templates\")\r\n .then(function (data) { return data.json(); })\r\n .then(function (templates) { return _this.setState({ Templates: templates }, function () {\r\n var name = (_this.props.InitialTemplateName.length !== 0 ? _this.props.InitialTemplateName : _this.state.Templates[0].name);\r\n _this.setState({ Templates: templates, TemplateName: name });\r\n _this.handleOnChange(name);\r\n }); })\r\n .catch(function (e) {\r\n console.log(e);\r\n _this.setState({ Templates: [] });\r\n if (_this.props.OnError)\r\n _this.props.OnError(\"An error occurred processing the configuration. Contact the site administrator.\");\r\n });\r\n };\r\n TemplateSelector.prototype.render = function () {\r\n var _this = this;\r\n return (React.createElement(\"div\", { className: \"S2TemplateSelector\", hidden: this.props.InitialTemplateName.length !== 0 || this.state.Templates === null || this.state.Templates.length < 2 },\r\n React.createElement(react_bootstrap_1.Container, null,\r\n React.createElement(react_bootstrap_1.Row, null,\r\n React.createElement(react_bootstrap_1.Col, { lg: \"4\" },\r\n React.createElement(Dropdown_1.Dropdown, { label: \"Search for\", className: \"S2Input S2DropdownField\", options: this.state.Templates.map(function (t) {\r\n return { key: t.name, text: t.name };\r\n }), selectedKey: this.state.TemplateName, onChange: function (evt, val) {\r\n _this.setState({ TemplateName: val === null || val === void 0 ? void 0 : val.key });\r\n _this.handleOnChange(val === null || val === void 0 ? void 0 : val.key);\r\n } }))))));\r\n };\r\n TemplateSelector.prototype.handleOnChange = function (key) {\r\n if (this.props.OnTemplateChanged) {\r\n var template = this.state.Templates.find(function (t) { return t.name === key; });\r\n this.props.OnTemplateChanged(template);\r\n }\r\n };\r\n return TemplateSelector;\r\n}(React.Component));\r\nexports.default = TemplateSelector;\r\n//# sourceMappingURL=TemplateSelector.js.map","\"use strict\";\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nvar __assign = (this && this.__assign) || function () {\r\n __assign = Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n//******************************************************************************\r\n// Copyright 2018-2020, ShareSquared Inc., All Rights Reserved.\r\n//\r\n// Author: Ted Iverson\r\n// Created: 06/25/2020\r\n//\r\n// The contents of this file are proprietary and considered trade secret.\r\n// Any disclosure outside of its intended use is expressly prohibited.\r\n//******************************************************************************\r\nvar React = require(\"react\");\r\nvar DetailsList_1 = require(\"@fluentui/react/lib/DetailsList\");\r\nvar Spinner_1 = require(\"@fluentui/react/lib/Spinner\");\r\nvar Label_1 = require(\"@fluentui/react/lib/Label\");\r\nvar date_fns_1 = require(\"date-fns\");\r\nvar Icon_1 = require(\"@fluentui/react/lib/Icon\");\r\nvar file_type_icons_1 = require(\"@uifabric/file-type-icons\");\r\nvar Button_1 = require(\"@fluentui/react/lib/Button\");\r\nvar react_1 = require(\"@fluentui/react\");\r\nvar Pager = require('rc-pager');\r\nrequire('rc-pager/assets/bootstrap.css');\r\nvar SearchResults = /** @class */ (function (_super) {\r\n __extends(SearchResults, _super);\r\n function SearchResults(props, state) {\r\n var _this = _super.call(this, props, state) || this;\r\n _this.state = {\r\n Items: [],\r\n Processing: false,\r\n ShowResults: false,\r\n MaxPages: 0,\r\n CurrentPage: 0,\r\n TotalCount: 0,\r\n ViewAll: false,\r\n DownloadProcessing: false,\r\n Action: \"0\",\r\n ZipEmail: \"\"\r\n };\r\n // if a reference callback has been provided, call it\r\n if (_this.props.Ref !== undefined)\r\n _this.props.Ref(_this);\r\n _this._Selection = new DetailsList_1.Selection({\r\n onSelectionChanged: function () { return _this.setState({}); },\r\n });\r\n return _this;\r\n }\r\n SearchResults.prototype.clearResults = function () {\r\n this.setState({\r\n Items: [],\r\n Processing: false,\r\n ShowResults: false,\r\n MaxPages: 0,\r\n CurrentPage: 0,\r\n TotalCount: 0,\r\n ViewAll: false,\r\n DownloadProcessing: false,\r\n Action: \"0\",\r\n ZipEmail: \"\"\r\n });\r\n };\r\n SearchResults.prototype.search = function (query) {\r\n var _this = this;\r\n var sort = this.state.Sort;\r\n if (sort === undefined) {\r\n sort = this.props.Template.results.sort;\r\n this.setState({ Sort: sort });\r\n }\r\n // build the select properties array\r\n var selectProperties = [];\r\n this.props.Template.results.fields.forEach(function (f, idx) {\r\n selectProperties.push(f.property);\r\n });\r\n // build the sort properties array\r\n // NOTE: we currently only support one sort property, but this code \r\n // and SharePoint API supports multiples\r\n var sortProperties = [];\r\n sortProperties.push(sort);\r\n // add the sort property to the result properties list, if specified\r\n if (selectProperties.indexOf(sort.property) === -1) {\r\n selectProperties.push(sort.property);\r\n }\r\n this.setState({ ShowResults: true, Processing: true });\r\n this._Selection.setAllSelected(false);\r\n var searchRequest = {\r\n Query: query,\r\n SelectProperties: selectProperties,\r\n ResultSource: this.props.Template.resultSource,\r\n ResultSourceScope: this.props.Template.resultSourceScope,\r\n SortProperties: sortProperties.length !== 0 ? sortProperties : undefined,\r\n StartRow: this.state.ViewAll ? 0 : this.state.CurrentPage * this.props.GlobalSettings.pageSize,\r\n RowLimit: this.state.ViewAll ? 500 : this.props.GlobalSettings.pageSize\r\n };\r\n var body = JSON.stringify(searchRequest);\r\n //console.log(`body=`, body);\r\n fetch((window.location.pathname === \"/\" ? \"\" : window.location.pathname) + \"/api/query\", {\r\n method: \"POST\",\r\n headers: { 'Content-Type': 'application/json' },\r\n body: body\r\n })\r\n .then(function (response) { return response.json(); })\r\n .then(function (data) {\r\n _this.setState({\r\n Items: data.DataLines,\r\n Processing: false,\r\n MaxPages: Math.ceil(data.TotalCount / _this.props.GlobalSettings.pageSize),\r\n TotalCount: data.TotalCount\r\n });\r\n })\r\n .catch(function (e) {\r\n _this.handleError(\"An error occured processing the search request. If the error persists, please contact the administrator.\");\r\n });\r\n };\r\n SearchResults.prototype.renderFormat = function (fieldDef, item) {\r\n var _this = this;\r\n var f = undefined;\r\n if (fieldDef.format.length !== 0) {\r\n switch (fieldDef.fieldType.toLowerCase()) {\r\n case \"date\": {\r\n try {\r\n var d = new Date(Date.parse(item[fieldDef.property]));\r\n f = (React.createElement(\"span\", null, date_fns_1.format(d, fieldDef.format)));\r\n }\r\n catch (e) { }\r\n break;\r\n }\r\n case \"number\": {\r\n try {\r\n var ft = parseFloat(item[fieldDef.property]);\r\n f = (React.createElement(\"span\", null, this.formatNumber(fieldDef.format, ft)));\r\n }\r\n catch (e) { }\r\n break;\r\n }\r\n }\r\n }\r\n if (fieldDef.property.toLowerCase() === \"title\") {\r\n // create a link to the API controller that will proxy\r\n // the requested document\r\n // NOTE: Path is assumed to be added to the return results in API controller\r\n var href_1 = item[\"Path\"];\r\n if (this.props.GlobalSettings.linkBehavior === \"PromptDownload\") {\r\n f = (React.createElement(\"a\", { href: \"api/file?url=\" + href_1, target: \"_blank\" }, item[fieldDef.property]));\r\n }\r\n else {\r\n f = (React.createElement(\"a\", { href: \"#\", onClick: function (evt) {\r\n fetch((window.location.pathname === \"/\" ? \"\" : window.location.pathname) + \"/api/link?url=\" + href_1)\r\n .then(function (response) { return response.text(); })\r\n .then(function (url) {\r\n if (url.length !== 0)\r\n window.open(url, \"_blank\");\r\n else\r\n _this.handleLinkError(\"An error occured processing the link. If the error persists, please contact the administrator.\");\r\n })\r\n .catch(function (e) {\r\n _this.handleLinkError(\"An error occured processing the link. If the error persists, please contact the administrator.\");\r\n });\r\n evt.preventDefault();\r\n } }, item[fieldDef.property]));\r\n }\r\n }\r\n else if (fieldDef.property.toLowerCase() === \"filetype\") {\r\n var ext = item[\"FileType\"].toLowerCase();\r\n if (ext.length !== 0)\r\n f = React.createElement(Icon_1.Icon, __assign({}, file_type_icons_1.getFileTypeIconProps({ extension: ext, size: 16, imageFileType: 'svg' })));\r\n }\r\n //else if (fieldDef.property.toLowerCase() === \"hithighlightedsummary\") {\r\n //var summary = item[fieldDef.property] as string;\r\n //f = ({summary.replace(//g, \"\").replace(/<\\/c0>/g, \"\")});\r\n //}\r\n return f;\r\n };\r\n SearchResults.prototype.handleError = function (errorMessage) {\r\n if (this.props.OnError) {\r\n this.props.OnError(errorMessage);\r\n this.setState({ ShowResults: false });\r\n }\r\n };\r\n SearchResults.prototype.handleLinkError = function (errorMessage) {\r\n if (this.props.OnLinkError) {\r\n this.props.OnLinkError(errorMessage);\r\n }\r\n };\r\n SearchResults.prototype.isCustomRendererNeeded = function (fieldDef) {\r\n return (fieldDef.format && fieldDef.format.length !== 0 &&\r\n (fieldDef.fieldType.toLowerCase() === \"date\" || fieldDef.fieldType.toLowerCase() === \"number\")) ||\r\n fieldDef.property.toLowerCase() === \"title\" ||\r\n //fieldDef.property.toLowerCase() === \"hithighlightedsummary\" ||\r\n fieldDef.property.toLowerCase() === \"filetype\";\r\n };\r\n SearchResults.prototype.handleSkip = function (page) {\r\n var _this = this;\r\n this.setState({ CurrentPage: page }, function () {\r\n _this.search(_this.props.Query);\r\n });\r\n };\r\n SearchResults.prototype.render = function () {\r\n var _this = this;\r\n var columns = [];\r\n // build the select properties array\r\n if (this.props.Template) {\r\n this.props.Template.results.fields.forEach(function (f, idx) {\r\n var key = \"colkey_\" + idx;\r\n columns.push({\r\n key: key,\r\n name: f.label,\r\n fieldName: f.property,\r\n minWidth: f.width,\r\n maxWidth: f.width,\r\n isResizable: false,\r\n isSorted: _this.state.Sort && _this.state.Sort.property.toLowerCase() === f.property.toLowerCase(),\r\n isSortedDescending: _this.state.Sort && _this.state.Sort.direction === 1,\r\n onColumnClick: function (evt, col) {\r\n // NOTE: we limit user-sorting to column already configured for sorting\r\n // (we can't guarantee all columns are sortable in Search)\r\n if (_this.state.Sort && _this.state.Sort.property.toLowerCase() === f.property.toLowerCase()) {\r\n _this.setState({ Sort: { property: f.property, direction: _this.state.Sort.direction === 1 ? 0 : 1 }, CurrentPage: 0 }, function () {\r\n _this.search(_this.props.Query);\r\n });\r\n }\r\n },\r\n // We only register a render handler for date and number columns where a format is specified\r\n // or the Title column so we can make it a link\r\n onRender: _this.isCustomRendererNeeded(f) ? function (item) { return _this.renderFormat(f, item); } : undefined\r\n });\r\n });\r\n }\r\n var rx = new RegExp(\"^(.+)#(.+)#\");\r\n var rxa = rx.exec(this.props.GlobalSettings.manualRequestLink);\r\n var actionOptions = [\r\n { key: \"0\", text: \"Download Zip\", selected: true },\r\n ];\r\n if (this.props.GlobalSettings.zipEmailEnabled) {\r\n actionOptions.push({ key: \"1\", text: \"Email Zip\", selected: false });\r\n }\r\n return (React.createElement(\"div\", { className: \"S2SearchResults\", hidden: !this.state.ShowResults },\r\n React.createElement(\"div\", { className: \"S2SearchResultsLabelRow\" },\r\n React.createElement(\"span\", { className: \"S2SearchResultsLabelx\" },\r\n React.createElement(Label_1.Label, { className: \"S2SearchResultsLabel\" },\r\n \"Results\",\r\n React.createElement(\"span\", { className: 'S2SearchResultsCount', hidden: this.state.Items.length === 0 },\r\n \"(\",\r\n this.formatNumber(\"###,###.\", this.state.TotalCount),\r\n \")\"),\r\n React.createElement(Spinner_1.Spinner, { size: Spinner_1.SpinnerSize.small, hidden: !this.state.Processing }))),\r\n React.createElement(\"span\", { hidden: this._Selection.getSelectedCount() === 0 },\r\n React.createElement(react_1.Dropdown, { className: \"S2ActionDropDown\", options: actionOptions, styles: { dropdown: { width: \"inherit\" } }, selectedKey: this.state.Action, onChange: function (evt, val) {\r\n _this.setState({ Action: val === null || val === void 0 ? void 0 : val.key });\r\n } }),\r\n React.createElement(\"span\", { hidden: this.state.Action === \"0\" },\r\n React.createElement(react_1.TextField, { className: \"S2Input S2TextField S2ActionZipEmail\", placeholder: \"Email\", value: this.state.ZipEmail, onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n _this.setState({ ZipEmail: v });\r\n }\r\n } })),\r\n React.createElement(Button_1.DefaultButton, { className: \"S2ActionButton\", text: this.state.Action === \"0\" ? \"Download\" : \"Send\", disabled: this.state.Action === \"1\" && this.state.ZipEmail.length === 0, onClick: function () {\r\n _this.setState({ DownloadProcessing: true });\r\n var items = _this._Selection.getSelection();\r\n var selectedItems = items.map(function (i) {\r\n return i.Path;\r\n });\r\n if (_this.state.Action === \"0\") {\r\n fetch((window.location.pathname === \"/\" ? \"\" : window.location.pathname) + \"/api/zipdownload\", {\r\n method: \"POST\",\r\n headers: { 'Content-Type': 'application/json' },\r\n body: JSON.stringify(selectedItems)\r\n }).then(function (response) {\r\n if (response.status !== 200) {\r\n var errorMessage = \"Error processing the request... (\" + response.status + \" \" + response.statusText + \")\";\r\n throw new Error(errorMessage);\r\n }\r\n else {\r\n return response.blob();\r\n }\r\n }).then(function (blob) {\r\n var element = document.createElement('a');\r\n element.setAttribute('href', URL.createObjectURL(blob));\r\n element.setAttribute('download', \"RecordsSearch.zip\");\r\n element.style.display = 'none';\r\n document.body.appendChild(element);\r\n element.click();\r\n document.body.removeChild(element);\r\n _this.setState({ DownloadProcessing: false });\r\n }).catch(function (e) {\r\n _this.setState({ DownloadProcessing: false });\r\n console.log(\"e:\", e);\r\n _this.handleError(\"An error occured processing the download request. If the error persists, please contact the administrator.\");\r\n });\r\n }\r\n else {\r\n var zr = {\r\n zipEmail: _this.state.ZipEmail,\r\n filePaths: selectedItems\r\n };\r\n fetch((window.location.pathname === \"/\" ? \"\" : window.location.pathname) + \"/api/zipemail\", {\r\n method: \"POST\",\r\n headers: { 'Content-Type': 'application/json' },\r\n body: JSON.stringify(zr)\r\n }).then(function (response) {\r\n if (response.status !== 200) {\r\n var errorMessage = \"Error processing the request... (\" + response.status + \" \" + response.statusText + \")\";\r\n throw new Error(errorMessage);\r\n }\r\n else {\r\n _this.setState({ DownloadProcessing: false });\r\n alert(_this.props.GlobalSettings.zipEmailSuccess);\r\n }\r\n }).catch(function (e) {\r\n _this.setState({ DownloadProcessing: false });\r\n console.log(\"e:\", e);\r\n _this.handleError(\"An error occured processing the email request. If the error persists, please contact the administrator.\");\r\n });\r\n }\r\n } })),\r\n React.createElement(Spinner_1.Spinner, { size: Spinner_1.SpinnerSize.small, hidden: !this.state.DownloadProcessing })),\r\n this.state.Items.length !== 0 ?\r\n (React.createElement(\"span\", null,\r\n React.createElement(DetailsList_1.DetailsList, { items: this.state.Items, columns: columns, setKey: \"set\", layoutMode: DetailsList_1.DetailsListLayoutMode.justified, compact: true, selectionMode: DetailsList_1.SelectionMode.multiple, checkboxVisibility: DetailsList_1.CheckboxVisibility.always, onShouldVirtualize: function () { return _this.state.ViewAll; }, selection: this._Selection }),\r\n !this.state.ViewAll ?\r\n (React.createElement(\"span\", { className: \"S2PagerRow\" },\r\n React.createElement(Pager, { total: this.state.MaxPages, current: this.state.CurrentPage, onSkipTo: this.handleSkip.bind(this) }),\r\n React.createElement(Button_1.DefaultButton, { text: \"View All\", onClick: function () {\r\n _this.setState({ ViewAll: true, CurrentPage: 0 }, function () {\r\n _this._Selection.setAllSelected(false);\r\n _this.search(_this.props.Query);\r\n });\r\n } })))\r\n : (React.createElement(\"span\", null)))) :\r\n (React.createElement(\"span\", { className: \"S2NoResults\", hidden: this.state.Processing }, \"No documents found\")),\r\n this.props.GlobalSettings.manualRequestsEnabled ? (React.createElement(\"div\", { className: \"S2ManualRequest\", hidden: this.state.Processing },\r\n React.createElement(\"span\", null,\r\n rxa[1],\r\n React.createElement(\"a\", { className: \"S2ManualRequestLink\", href: \"#\", onClick: function (evt) {\r\n if (_this.props.OnManualRequest) {\r\n _this.props.OnManualRequest();\r\n }\r\n evt.preventDefault();\r\n } }, rxa[2])))) : React.createElement(\"span\", null)));\r\n };\r\n // http://mottie.github.io/javascript-number-formatter/\r\n SearchResults.prototype.formatNumber = function (mask, value) {\r\n 'use strict';\r\n if (!mask || isNaN(+value)) {\r\n return value; // return as it is.\r\n }\r\n var isNegative, result, decimal, group, posLeadZero, posTrailZero, posSeparator, part, szSep, integer, \r\n // find prefix/suffix\r\n len = mask.length, start = mask.search(/[0-9\\-\\+#]/), prefix = start > 0 ? mask.substring(0, start) : '', \r\n // reverse string: not an ideal method if there are surrogate pairs\r\n str = mask.split('').reverse().join(''), end = str.search(/[0-9\\-\\+#]/), offset = len - end, indx = offset + ((mask.substring(offset, offset + 1) === '.') ? 1 : 0), suffix = end > 0 ? mask.substring(indx, len) : '';\r\n // mask with prefix & suffix removed\r\n mask = mask.substring(start, indx);\r\n // convert any string to number according to formation sign.\r\n value = mask.charAt(0) === '-' ? -value : +value;\r\n isNegative = value < 0 ? value = -value : 0; // process only abs(), and turn on flag.\r\n // search for separator for grp & decimal, anything not digit, not +/- sign, not #.\r\n result = mask.match(/[^\\d\\-\\+#]/g);\r\n decimal = (result && result[result.length - 1]) || '.'; // treat the right most symbol as decimal\r\n group = (result && result[1] && result[0]) || ','; // treat the left most symbol as group separator\r\n // split the decimal for the format string if any.\r\n mask = mask.split(decimal);\r\n // Fix the decimal first, toFixed will auto fill trailing zero.\r\n value = value.toFixed(mask[1] && mask[1].length);\r\n value = +(value) + ''; // convert number to string to trim off *all* trailing decimal zero(es)\r\n // fill back any trailing zero according to format\r\n posTrailZero = mask[1] && mask[1].lastIndexOf('0'); // look for last zero in format\r\n part = value.split('.');\r\n // integer will get !part[1]\r\n if (!part[1] || (part[1] && part[1].length <= posTrailZero)) {\r\n value = (+value).toFixed(posTrailZero + 1);\r\n }\r\n szSep = mask[0].split(group); // look for separator\r\n mask[0] = szSep.join(''); // join back without separator for counting the pos of any leading 0.\r\n posLeadZero = mask[0] && mask[0].indexOf('0');\r\n if (posLeadZero > -1) {\r\n while (part[0].length < (mask[0].length - posLeadZero)) {\r\n part[0] = '0' + part[0];\r\n }\r\n }\r\n else if (+part[0] === 0) {\r\n part[0] = '';\r\n }\r\n value = value.split('.');\r\n value[0] = part[0];\r\n // process the first group separator from decimal (.) only, the rest ignore.\r\n // get the length of the last slice of split result.\r\n posSeparator = (szSep[1] && szSep[szSep.length - 1].length);\r\n if (posSeparator) {\r\n integer = value[0];\r\n str = '';\r\n offset = integer.length % posSeparator;\r\n len = integer.length;\r\n for (indx = 0; indx < len; indx++) {\r\n str += integer.charAt(indx); // ie6 only support charAt for sz.\r\n // -posSeparator so that won't trail separator on full length\r\n /*jshint -W018 */\r\n if (!((indx - offset + 1) % posSeparator) && indx < len - posSeparator) {\r\n str += group;\r\n }\r\n }\r\n value[0] = str;\r\n }\r\n value[1] = (mask[1] && value[1]) ? decimal + value[1] : '';\r\n // remove negative sign if result is zero\r\n result = value.join('');\r\n if (result === '0' || result === '') {\r\n // remove negative sign if result is zero\r\n isNegative = false;\r\n }\r\n // put back any negation, combine integer and fraction, and add back prefix & suffix\r\n return prefix + ((isNegative ? '-' : '') + result) + suffix;\r\n };\r\n ;\r\n return SearchResults;\r\n}(React.Component));\r\nexports.default = SearchResults;\r\n//# sourceMappingURL=SearchResults.js.map","//******************************************************************************\r\n// Copyright 2018-2020, ShareSquared Inc., All Rights Reserved.\r\n//\r\n// Author: Ted Iverson\r\n// Created: 07/02/2020\r\n//\r\n// The contents of this file are proprietary and considered trade secret.\r\n// Any disclosure outside of its intended use is expressly prohibited.\r\n//******************************************************************************\r\n\r\nimport * as React from 'react';\r\nimport { Label } from '@fluentui/react/lib/Label';\r\n\r\nexport interface IErrorSectionProps {\r\n\r\n // the error message to display\r\n ErrorMessage: string;\r\n}\r\n\r\nexport interface IErrorSectionState {\r\n}\r\n\r\nexport default class ErrorSection extends React.Component {\r\n\r\n public constructor(props: IErrorSectionProps, state: IErrorSectionState) {\r\n super(props, state);\r\n\r\n this.state = { };\r\n }\r\n\r\n public render(): React.ReactElement {\r\n\r\n return this.props.ErrorMessage.length!==0 ? (\r\n
\r\n \r\n
\r\n ) : ();\r\n }\r\n}\r\n","\"use strict\";\r\n//******************************************************************************\r\n// Copyright 2018-2020, ShareSquared Inc., All Rights Reserved.\r\n//\r\n// Author: Ted Iverson\r\n// Created: 08/21/2020\r\n//\r\n// The contents of this file are proprietary and considered trade secret.\r\n// Any disclosure outside of its intended use is expressly prohibited.\r\n//******************************************************************************\r\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n//#region Imports\r\nvar React = require(\"react\");\r\nrequire(\"jquery/src/jquery\");\r\nvar Label_1 = require(\"@fluentui/react/lib/Label\");\r\nvar Button_1 = require(\"@fluentui/react/lib/Button\");\r\nvar DatePicker_1 = require(\"@fluentui/react/lib/DatePicker\");\r\nvar TextField_1 = require(\"@fluentui/react/lib/TextField\");\r\nvar Dropdown_1 = require(\"@fluentui/react/lib/Dropdown\");\r\nvar react_bootstrap_1 = require(\"react-bootstrap\");\r\nvar Spinner_1 = require(\"@fluentui/react/lib/Spinner\");\r\nvar react_1 = require(\"@fluentui/react\");\r\nvar RequestForm = /** @class */ (function (_super) {\r\n __extends(RequestForm, _super);\r\n function RequestForm(props, state) {\r\n var _this = _super.call(this, props, state) || this;\r\n // tracks the properties of each field on the form so we can have the information\r\n // during the building of the query (mainly Type and Mapped Property)\r\n _this.formFieldProps = new Map();\r\n _this.state = { FormValues: {}, InvalidControlIds: new Map(), Processing: false, Submitted: false };\r\n return _this;\r\n }\r\n RequestForm.prototype.renderField = function (field, idx) {\r\n var _this = this;\r\n var f;\r\n switch (field.fieldType.toLowerCase()) {\r\n default:\r\n case \"text\": {\r\n var id_1 = \"ftxt_\" + idx;\r\n this.formFieldProps.set(id_1, { Id: id_1, Type: field.fieldType, PropertyName: field.property, });\r\n f = (React.createElement(TextField_1.TextField, { id: id_1, key: id_1, label: field.label, required: field.required, className: \"S2Input S2TextField\", value: this.state.FormValues[id_1], onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n var o = _this.state.FormValues;\r\n o[id_1] = v;\r\n _this.setState({ FormValues: o, Submitted: false });\r\n }\r\n }, onGetErrorMessage: function (value) {\r\n return field.required ? _this.validateRequired(id_1, value) : undefined;\r\n } }));\r\n break;\r\n }\r\n case \"multitext\": {\r\n var id_2 = \"fmtxt_\" + idx;\r\n this.formFieldProps.set(id_2, { Id: id_2, Type: field.fieldType, PropertyName: field.property, });\r\n f = (React.createElement(TextField_1.TextField, { id: id_2, key: id_2, label: field.label, className: \"S2Input S2TextField\", multiline: true, resizable: true, required: field.required, value: this.state.FormValues[id_2], onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n var o = _this.state.FormValues;\r\n o[id_2] = v;\r\n _this.setState({ FormValues: o, Submitted: false });\r\n }\r\n }, onGetErrorMessage: function (value) {\r\n return field.required ? _this.validateRequired(id_2, value) : undefined;\r\n } }));\r\n break;\r\n }\r\n case \"widemultitext\": {\r\n var id_3 = \"fmtxt_\" + idx;\r\n this.formFieldProps.set(id_3, { Id: id_3, Type: field.fieldType, PropertyName: field.property, });\r\n f = (React.createElement(TextField_1.TextField, { id: id_3, key: id_3, label: field.label, className: \"S2Input S2TextField\", multiline: true, rows: 10, resizable: true, required: field.required, value: this.state.FormValues[id_3], onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n var o = _this.state.FormValues;\r\n o[id_3] = v;\r\n _this.setState({ FormValues: o, Submitted: false });\r\n }\r\n }, onGetErrorMessage: function (value) {\r\n return field.required ? _this.validateRequired(id_3, value) : undefined;\r\n } }));\r\n break;\r\n }\r\n case \"date\": {\r\n var id1_1 = \"fdt_\" + idx;\r\n this.formFieldProps.set(id1_1, { Id: id1_1, Type: field.fieldType, PropertyName: field.property });\r\n f = (React.createElement(\"span\", { key: \"spandt_\" + idx },\r\n React.createElement(DatePicker_1.DatePicker, { id: id1_1, key: id1_1, label: field.label, isRequired: field.required, className: \"S2Input S2DateField\", title: \"on or after\", placeholder: \"on or after\", value: this.state.FormValues[id1_1], onSelectDate: function (dt) {\r\n if (dt !== undefined && dt !== null) {\r\n var o = _this.state.FormValues;\r\n o[id1_1] = dt;\r\n _this.setState({ FormValues: o, Submitted: false });\r\n }\r\n } })));\r\n break;\r\n }\r\n case \"number\": {\r\n var id_4 = \"fnum_\" + idx;\r\n this.formFieldProps.set(id_4, { Id: id_4, Type: field.fieldType, PropertyName: field.property });\r\n f = (React.createElement(\"span\", { key: \"spannum_\" + idx },\r\n React.createElement(TextField_1.TextField, { id: id_4, key: id_4, label: field.label, className: \"S2Input S2NumberField\", required: field.required, title: \"equal to or greater\", placeholder: \"equal to or greater\", value: this.state.FormValues[id_4], onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n var o = _this.state.FormValues;\r\n o[id_4] = v;\r\n _this.setState({ FormValues: o, Submitted: false });\r\n }\r\n }, onGetErrorMessage: function (value) {\r\n return field.required ? _this.validateRequired(id_4, value) : undefined;\r\n } })));\r\n break;\r\n }\r\n case \"boolean\": {\r\n var id_5 = \"fbool_\" + idx;\r\n this.formFieldProps.set(id_5, { Id: id_5, Type: field.fieldType, PropertyName: field.property });\r\n f = (React.createElement(Dropdown_1.Dropdown, { id: id_5, key: id_5, label: field.label, className: \"S2Input S2BooleanField\", options: [\r\n { key: '', text: '' },\r\n { key: '1', text: 'Yes' },\r\n { key: '0', text: 'No' }\r\n ], selectedKey: this.state.FormValues[id_5], onChange: function (evt, v) {\r\n if (v !== undefined) {\r\n var o = _this.state.FormValues;\r\n o[id_5] = v.key;\r\n _this.setState({ FormValues: o, Submitted: false });\r\n }\r\n } }));\r\n break;\r\n }\r\n case \"list\": {\r\n var id_6 = \"flst_\" + idx;\r\n this.formFieldProps.set(id_6, { Id: id_6, Type: field.fieldType, PropertyName: field.property });\r\n f = (React.createElement(Dropdown_1.Dropdown, { id: id_6, key: id_6, className: \"S2Input S2ListField\", placeholder: \"Select option(s)\", label: field.label, multiSelect: true, required: field.required, options: field.options.map(function (o) {\r\n return { key: o, text: o };\r\n }), selectedKeys: this.state.FormValues[id_6] !== undefined ? this.state.FormValues[id_6].split(\";\") : [], onChange: function (evt, v) {\r\n var curOptions = _this.state.FormValues[id_6] !== undefined ? _this.state.FormValues[id_6].split(\";\") : [];\r\n var foundIndex = curOptions.indexOf(v === null || v === void 0 ? void 0 : v.key);\r\n if ((v === null || v === void 0 ? void 0 : v.selected) && foundIndex === -1)\r\n curOptions.push(v === null || v === void 0 ? void 0 : v.key);\r\n if (!(v === null || v === void 0 ? void 0 : v.selected) && foundIndex !== -1)\r\n curOptions.splice(foundIndex, 1);\r\n var o = _this.state.FormValues;\r\n o[id_6] = curOptions.join(\";\");\r\n _this.setState({ FormValues: o, Submitted: false });\r\n } }));\r\n break;\r\n }\r\n }\r\n return f;\r\n };\r\n RequestForm.prototype.renderCol = function (fields, rowsPerCol, colNumber) {\r\n var _this = this;\r\n return (React.createElement(react_bootstrap_1.Col, { key: \"col_\" + colNumber, lg: \"4\" }, fields.map(function (f, idx) {\r\n return _this.renderField(f, (idx + 1) + (colNumber * rowsPerCol));\r\n })));\r\n };\r\n RequestForm.prototype.renderWideCol = function (fields, rowsPerCol, colNumber) {\r\n var _this = this;\r\n return (React.createElement(react_bootstrap_1.Col, { key: \"col_\" + colNumber, lg: \"12\" }, fields.map(function (f, idx) {\r\n return _this.renderField(f, (idx + 1) + (colNumber * rowsPerCol));\r\n })));\r\n };\r\n RequestForm.prototype.renderFormRowsx = function () {\r\n var template = this.props.Template;\r\n // split the fields across the 3 columns and render\r\n var RowsPerCol = Math.ceil(template.requestForm.fields.length / 3);\r\n var rows = [];\r\n rows.push(this.renderCol(template.requestForm.fields.slice(0, RowsPerCol), RowsPerCol, 0));\r\n rows.push(this.renderCol(template.requestForm.fields.slice(RowsPerCol, (RowsPerCol * 2)), RowsPerCol, 1));\r\n rows.push(this.renderCol(template.requestForm.fields.slice(RowsPerCol * 2), RowsPerCol, 2));\r\n return (React.createElement(react_bootstrap_1.Row, null, rows));\r\n };\r\n RequestForm.prototype.renderFormRows = function () {\r\n var template = this.props.Template;\r\n // filter out fields that have a value supplied as they won't be\r\n // presented to the user on the form\r\n var formFields = template.requestForm.fields.filter(function (f) {\r\n return (f.value === undefined || f.value === null || f.value.length === 0) ? f : null;\r\n });\r\n // process all non-wide fields first and spread across columns\r\n var nonWideFields = formFields.filter(function (f) {\r\n return f.fieldType.toLowerCase() !== \"widemultitext\" ? f : null;\r\n });\r\n // split the fields across the 3 columns and render\r\n var RowsPerCol = Math.ceil(nonWideFields.length / 3);\r\n var rows = [];\r\n rows.push(this.renderCol(nonWideFields.slice(0, RowsPerCol), RowsPerCol, 0));\r\n rows.push(this.renderCol(nonWideFields.slice(RowsPerCol, (RowsPerCol * 2)), RowsPerCol, 1));\r\n rows.push(this.renderCol(nonWideFields.slice(RowsPerCol * 2), RowsPerCol, 2));\r\n // process all wide fields last\r\n var wideFields = formFields.filter(function (f) {\r\n return f.fieldType.toLowerCase() === \"widemultitext\" ? f : null;\r\n });\r\n rows.push(this.renderWideCol(wideFields, 1, 0));\r\n return (React.createElement(react_bootstrap_1.Row, null, rows));\r\n };\r\n RequestForm.prototype.render = function () {\r\n var _this = this;\r\n return (React.createElement(\"div\", { className: \"S2RequestForm\", hidden: !this.props.IsVisible },\r\n React.createElement(react_bootstrap_1.Container, null,\r\n React.createElement(react_bootstrap_1.Row, null,\r\n React.createElement(react_bootstrap_1.Col, { lg: \"9\" },\r\n React.createElement(Label_1.Label, { className: \"S2RequestLabel\" }, this.props.GlobalSettings.manualRequestTitle)),\r\n React.createElement(react_bootstrap_1.Col, { lg: \"3\" },\r\n React.createElement(\"span\", { className: \"S2Buttons\" },\r\n React.createElement(Spinner_1.Spinner, { size: Spinner_1.SpinnerSize.small, hidden: !this.state.Processing }),\r\n React.createElement(Button_1.PrimaryButton, { className: \"S2RequestButton\", text: \"Submit\", hidden: this.state.Processing, disabled: this.state.InvalidControlIds.size !== 0, onClick: function () { _this.requestClicked(); } }),\r\n React.createElement(Button_1.DefaultButton, { className: \"S2ClearButton\", text: \"Cancel\", onClick: function () { _this.clearClicked(); } })))),\r\n React.createElement(react_bootstrap_1.Row, { hidden: this.state.Processing || !this.state.Submitted },\r\n React.createElement(react_bootstrap_1.Col, { lg: \"12\" },\r\n React.createElement(react_1.MessageBar, { onDismiss: function () {\r\n _this.clearClicked();\r\n }, messageBarType: react_1.MessageBarType.success }, this.props.GlobalSettings.submitSuccess))),\r\n React.createElement(react_bootstrap_1.Row, null,\r\n React.createElement(react_bootstrap_1.Col, { lg: \"12\" },\r\n React.createElement(\"span\", { className: \"S2RequestDescription\" }, this.props.GlobalSettings.manualRequestDescription))),\r\n (this.props.Template !== null) ? this.renderFormRows() : null)));\r\n };\r\n RequestForm.prototype.validateRequired = function (id, value) {\r\n var notValid = value === undefined || value.length === 0;\r\n if (!notValid && this.state.InvalidControlIds.has(id)) {\r\n var i = this.state.InvalidControlIds;\r\n this.state.InvalidControlIds.delete(id);\r\n this.setState({ InvalidControlIds: i });\r\n }\r\n else if (notValid && !this.state.InvalidControlIds.has(id)) {\r\n var i = this.state.InvalidControlIds;\r\n this.state.InvalidControlIds.set(id, true);\r\n this.setState({ InvalidControlIds: i });\r\n }\r\n //this.setState({ Submitted: false });\r\n return notValid ? (React.createElement(\"span\", { style: { display: \"none\" } })) : undefined;\r\n };\r\n RequestForm.prototype.setErrorMessage = function (message) {\r\n if (this.props.OnError)\r\n this.props.OnError(message);\r\n };\r\n RequestForm.prototype.buildJSONForRequest = function () {\r\n var _this = this;\r\n var props = {\r\n Query: this.props.Query\r\n };\r\n // set the fixed submission values\r\n this.props.Template.requestForm.fields.forEach(function (f) {\r\n if (f.value !== undefined && f.value !== null && f.value.length !== 0) {\r\n props[f.property] = f.value;\r\n }\r\n });\r\n this.formFieldProps.forEach(function (f) {\r\n var value = _this.state.FormValues[f.Id];\r\n if (value !== undefined && value !== null && value.length !== 0) {\r\n switch (f.Type.toLowerCase()) {\r\n default:\r\n case \"text\": {\r\n props[f.PropertyName] = value;\r\n break;\r\n }\r\n case \"date\": {\r\n var dt = new Date(Date.parse(value));\r\n props[f.PropertyName] = \"\" + dt.getFullYear() + \"-\" + _this.zeroPad(dt.getMonth() + 1) + \"-\" + _this.zeroPad(dt.getDate());\r\n break;\r\n }\r\n case \"number\": {\r\n props[f.PropertyName] = value;\r\n break;\r\n }\r\n case \"boolean\": {\r\n props[f.PropertyName] = value;\r\n break;\r\n }\r\n case \"list\": {\r\n var listprops = [];\r\n // NOTE: lists are multi-select and are handled implicitly by\r\n // SharePoint search as ORs\r\n value.split(\";\").forEach(function (v, idx) {\r\n if (v.length !== 0) {\r\n listprops.push(v);\r\n }\r\n });\r\n props[f.PropertyName] = listprops;\r\n break;\r\n }\r\n }\r\n }\r\n });\r\n //console.log(`props: ${JSON.stringify(props)}`);\r\n return JSON.stringify(props);\r\n };\r\n RequestForm.prototype.zeroPad = function (num) {\r\n var s = '';\r\n if (num < 10) {\r\n s = '0';\r\n }\r\n s += num.toString();\r\n return s;\r\n };\r\n RequestForm.prototype.requestClicked = function () {\r\n var _this = this;\r\n this.setState({ Processing: true });\r\n fetch((window.location.pathname === \"/\" ? \"\" : window.location.pathname) + \"/api/manualrequest\", {\r\n method: \"POST\",\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify({ Text: this.buildJSONForRequest() })\r\n })\r\n .then(function (response) { return response.text(); })\r\n .then(function (response) {\r\n //console.log(`response`, response);\r\n var success = response === \"true\";\r\n if (success) {\r\n var o_1 = _this.state.FormValues;\r\n _this.formFieldProps.forEach(function (f) {\r\n o_1[f.Id] = \"\";\r\n });\r\n _this.setState({ Submitted: true, FormValues: o_1 });\r\n }\r\n else {\r\n _this.handleError(_this.props.GlobalSettings.submitError);\r\n }\r\n _this.setState({ Processing: false });\r\n })\r\n .catch(function (e) {\r\n console.log(e);\r\n _this.handleError(_this.props.GlobalSettings.submitError);\r\n _this.setState({ Processing: false });\r\n });\r\n };\r\n RequestForm.prototype.handleError = function (errorMessage) {\r\n if (this.props.OnError) {\r\n this.props.OnError(errorMessage);\r\n }\r\n };\r\n RequestForm.prototype.clearClicked = function () {\r\n var o = this.state.FormValues;\r\n this.formFieldProps.forEach(function (f) {\r\n o[f.Id] = \"\";\r\n });\r\n this.setState({ FormValues: o });\r\n if (this.props.OnClear !== undefined)\r\n this.props.OnClear();\r\n };\r\n return RequestForm;\r\n}(React.Component));\r\nexports.default = RequestForm;\r\n//# sourceMappingURL=RequestForm.js.map","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\ntype Config = {\r\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\r\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\r\n};\r\n\r\nexport function register(config?: Config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(\r\n process.env.PUBLIC_URL,\r\n window.location.href\r\n );\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string, config?: Config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' }\r\n })\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then(registration => {\r\n registration.unregister();\r\n })\r\n .catch(error => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n"],"sourceRoot":""}