text: // @link https://www.dataformsjs.com
  // @version 5.10.4
  // @author Conrad Sollitt (https://conradsollitt.com)
  // @license MIT
  !function(){"use strict";var o=void 0===window.React&&void 0!==window.preact?window.preact:window.React;function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(r){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(r);return e=n?(e=l(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),t=this,!(e=e)||"object"!==w(e)&&"function"!=typeof e?s(t):e}}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if(!a(e,t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}var d={},t=(c(p,null,[{key:"get",value:function(e,t){return void 0===d[e]?t:d[e]}},{key:"set",value:function(e,t){d[e]=t}}]),p);function p(){u(this,p)}window.Cache=t;var h=(c(f,null,[{key:"ponyfill",value:function(){var e,t,r='link[rel="stylesheet"][data-css-vars-ponyfill]:not([data-css-vars-setup]),style[data-css-vars-ponyfill]:not([data-css-vars-setup])',n=document.querySelectorAll(r);0!==n.length&&(e=new D,t=window.CSS&&window.CSS.supports&&window.CSS.supports("(--a: 0)"),e.loadPolyfill(t,"https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2.4.3/dist/css-vars-ponyfill.min.js").then(function(){window.cssVars&&(cssVars({include:r}),Array.prototype.forEach.call(n,function(e){e.setAttribute("data-css-vars-setup","")}))}))}}]),f);function f(){u(this,f)}window.CssVars=h;var m=function(){e(r,o.Component);var t=i(r);function r(e){return u(this,r),(e=t.call(this,e)).state={error:null,errorInfo:null},e}return c(r,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,errorInfo:t})}},{key:"render",value:function(){return this.state.errorInfo?o.createElement("div",null,o.createElement("h2",{style:{textAlign:"left",color:"white",backgroundColor:"#bc0000",padding:"1em"}},"An error has occurred"),o.createElement("details",{style:{whiteSpace:"pre-wrap",textAlign:"left",color:"white",backgroundColor:"red",padding:"1em"}},this.state.error&&this.state.error.toString(),o.createElement("br",null),this.state.errorInfo.componentStack)):this.props.children}}]),r}();window.ErrorBoundary=m;var y=(c(v,[{key:"number",value:function(e){return this.formatNumber(e,{})}},{key:"round",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return this.formatNumber(e,{style:"decimal",maximumFractionDigits:t,minimumFractionDigits:t})}},{key:"currency",value:function(e,t){return this.formatNumber(e,{style:"currency",currency:t,maximumFractionDigits:2})}},{key:"percent",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return this.formatNumber(e,{style:"percent",maximumFractionDigits:t,minimumFractionDigits:t})}},{key:"date",value:function(e){return this.formatDateTime(e,{})}},{key:"dateTime",value:function(e){return this.formatDateTime(e,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}},{key:"time",value:function(e){return this.formatDateTime(e,{hour:"numeric",minute:"numeric",second:"numeric"})}},{key:"isNumber",value:function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},{key:"formatDateTime",value:function(t,r){if(void 0===window.Intl)return t;if(null===t||""===t)return null;try{if(a(t,Date))return new Intl.DateTimeFormat(navigator.language,r).format(t);if(/^\d{4}-\d{2}-\d{2}$/.test(t)){var e=t.split("-").map(function(e){return parseInt(e,10)}),n=new Date(e[0],e[1]-1,e[2]);return new Intl.DateTimeFormat(navigator.language,r).format(n)}var o=new Date(t);return new Intl.DateTimeFormat(navigator.language,r).format(o)}catch(e){return console.warn("Error formatting Date/Time Value:"),console.log(navigator.language),console.log(r),console.log(t),console.log(e),"Error"}}},{key:"formatNumber",value:function(t,r){var n=navigator.language||navigator.userLanguage;if(null===t||""===t)return null;if(!this.isNumber(t))return console.warn("Warning value specified in DateFormsJS function formatNumber() is not a number:"),console.log(t),t;if(void 0===window.Intl){var e=r.style||null,o=r.maximumFractionDigits||0;if("percent"===e)return(100*t).toFixed(o)+"%";var a=null,i=null,o=null;if("en-us"===n&&(a=",",i=".",o="$"),null===a)return t;a=t.toString().split(".");a[0]=a[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");i=a.join(i);return"currency"===e?o+i:i}try{return new Intl.NumberFormat(n,r).format(t)}catch(e){return console.warn("Error formatting Numeric Value:"),console.log(n),console.log(r),console.log(t),console.log(e),"Error"}}}]),v);function v(){u(this,v)}window.Format=y;var g=function(){e(r,o.Component);var t=i(r);function r(e){return u(this,r),(e=t.call(this,e)).onChange=e.onChange.bind(s(e)),e.input=o.createRef(),e}return c(r,[{key:"componentDidMount",value:function(){this.filter()}},{key:"onChange",value:function(){this.filter(),"function"==typeof this.props.afterFilter&&this.props.afterFilter()}},{key:"filter",value:function(){var e=this.input.current,t=e.value.toLowerCase().split(" "),r=t.length,n=0!==r,o=0,a=null,i=null,s=document.querySelectorAll(this.props["filter-selector"]);1===s.length&&"TABLE"===s[0].tagName&&s[0].tHead&&1===s[0].tHead.rows.length&&1===s[0].tBodies.length&&(a=(v=s[0]).getAttribute("data-sort-class-odd"),i=v.getAttribute("data-sort-class-even"),s=s[0].tBodies[0].rows);for(var l=s.length,u=i&&a,c=0,d=s.length;c<d;c++){var p=s[c],h=!0;if(n)for(var f=p.textContent.toLowerCase(),m=0;m<r;m++)if(""!==t[m]&&!f.includes(t[m])){h=!1;break}h&&(o++,u&&(o%2==0?(p.classList.add(i),p.classList.remove(a)):(p.classList.add(a),p.classList.remove(i)))),p.style.display=h?"":"none"}var y,v,g=e.getAttribute("filter-results-selector");g&&((y=document.querySelector(g))?(v=e.getAttribute("filter-results-text-all"),g=e.getAttribute("filter-results-text-filtered"),null!==v||null!==g?(e=null,o===l?e=v:null!==g&&(e=g.replace(/{displayCount}/g,o)),null===e?y.textContent="":(e=e.replace(/{totalCount}/g,l),y.textContent=e)):console.warn("Defined [filter-results-selector] without [filter-results-text-all] or [filter-results-text-filtered]")):console.warn("Defined [filter-results-selector] but element not found"))}},{key:"render",value:function(){return void 0!==window&&window.React===window.preact?o.createElement("input",Object.assign({},this.props,{onInput:this.onChange,ref:this.input})):o.createElement("input",Object.assign({},this.props,{onChange:this.onChange,ref:this.input}))}}]),r}();window.InputFilter=g;var b=[],S={};function C(e){return 0===e.fetchState&&e.children?e.children:null}function L(e){if(!(-1===e.fetchState)||!e.children)return null;var t=e.error;return"string"==typeof t&&-1===t.indexOf("Error")&&(t="Error - "+t),o.cloneElement(e.children,{error:t})}function k(e){return 1===e.fetchState&&e.children?o.cloneElement(e.children,{data:e.data,params:e.params,handleChange:e.handleChange,childProps:e.childProps}):null}var E=function(){e(n,o.Component);var r=i(n);function n(e){var t;return u(this,n),(t=r.call(this,e))._isFetching=!1,t._isMounted=!1,t.fetchData=t.fetchData.bind(s(t)),t.handleChange=t.handleChange.bind(s(t)),t._querySrc=e&&e.querySrc?e.querySrc:void 0,t._query=e&&e.query?e.query:void 0,t.state={fetchState:0,error:null,params:t.getUrlParams(),data:null},t}return c(n,[{key:"getUrlParams",value:function(){var e,t={};if(this.props&&!0===this.props.graphQL)return void 0===this.props.variables?{}:this.props.variables;for(e in this.props)"url"!==e&&"string"==typeof this.props[e]&&(t[e]=this.props[e]);return t}},{key:"componentDidMount",value:function(){if((this._isMounted=!0)===this.props.graphQL&&void 0===this._query&&void 0!==this._querySrc&&void 0!==S[this._querySrc]&&(this._query=S[this._querySrc]),this.props.loadOnlyOnce){var e=function(e,t,r){for(var n=0,o=b.length;n<o;n++){var a=b[n];if(a.url===e&&a.query===t){if(JSON.stringify(r)===a.params)return a.data;break}}return null}(this.props.url,this._query,this.getUrlParams());if(null!==e)return void this.setState({fetchState:1,data:e})}var t,r;!0!==this.props.graphQL||void 0!==this._query||void 0===this._querySrc?this.fetchData():(t=this._querySrc,r=this,fetch(t,null).then(function(e){var t=e.status;if(200<=t&&t<300||304===t)return Promise.resolve(e);e="Error loading data. Server Response Code: "+t+", Response Text: "+e.statusText;return Promise.reject(e)}).then(function(e){return e.text()}).then(function(e){S[t]=e,r._query=S[t],r.fetchData()}).catch(function(e){throw new Error("Error Downloading GraphQL Script: ["+t+"], Error: "+e.toString())}))}},{key:"componentDidUpdate",value:function(e,t){(!0===this.props.graphQL?JSON.stringify(e.variables)!==JSON.stringify(this.props.variables):this.buildUrl(t.params)!==this.buildUrl(this.props))&&this.setState({params:this.getUrlParams()},this.fetchData)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1}},{key:"buildUrl",value:function(e){var t=this.props.url;if(!0!==this.props.graphQL&&0<Object.keys(e).length)for(var r in e)-1<t.indexOf(":"+r)&&(t=t.replace(new RegExp(":"+r,"g"),encodeURIComponent(e[r])));return t}},{key:"fetchData",value:function(){var e,t,n=this,r=this.buildUrl(this.state.params);this._isFetching||(this._isFetching=!0,e={mode:"cors",cache:"no-store",credentials:"same-origin"},this.props.fetchOptions&&(e=this.props.fetchOptions),this.props.fetchHeaders&&(e.headers=this.props.fetchHeaders),!0===this.props.graphQL&&(t=void 0===this.props.variables?{}:this.props.variables,"file://"===window.location.origin||"null"===window.location.origin?(r+=-1===r.indexOf("?")?"?":"&",r+="query="+encodeURIComponent(this._query.trim()),r+="&variables="+encodeURIComponent(JSON.stringify(t))):(e.method="POST",void 0===e.headers?e.headers={"Content-Type":"application/json"}:e.headers["Content-Type"]="application/json",e.body=JSON.stringify({query:this._query,variables:t}))),this.setState({fetchState:0},function(){n.updateView(),fetch(r,e).then(function(e){var t=e.status;if(200<=t&&t<300||304===t)return Promise.resolve(e);e="Error loading data. Server Response Code: "+t+", Response Text: "+e.statusText;return Promise.reject(e)}).then(function(e){return e.json()}).then(function(e){var t,r=!0===n.props.graphQL;if(r&&(e.errors&&e.errors.length))throw t=1===e.errors.length&&e.errors[0].message?"[GraphQL Error]: "+e.errors[0].message:("string"==typeof n.props.errorTextGraphQLErrors?n.props.errorTextGraphQLErrors:"{count} GraphQL Errors occured. See console for full details.").replace("{count}",e.errors.length),console.error(e.errors),t;n._isMounted&&n.setState({fetchState:1,data:r?e.data:e}),n.props.loadOnlyOnce&&function(e,t,r,n){for(var o=0,a=b.length;o<a;o++){var i=b[o];if(i.url===e&&i.query===t)return i.params=JSON.stringify(r),i.data=n}b.push({url:e,query:t,params:JSON.stringify(r),data:n})}(n.props.url,n._query,n.getUrlParams(),r?e.data:e)}).catch(function(e){n._isMounted&&n.setState({fetchState:-1,error:e.toString()})}).finally(function(){n._isFetching=!1,n.updateView()})}))}},{key:"handleChange",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;this._isMounted&&this.setState({data:null===e?this.state.data:e})}},{key:"updateView",value:function(){if("function"==typeof this.props.onViewUpdated)try{this.props.onViewUpdated()}catch(e){console.error(e)}}},{key:"render",value:function(){return o.createElement(o.Fragment,null,o.createElement(C,{fetchState:this.state.fetchState},this.props.isLoading),o.createElement(L,{fetchState:this.state.fetchState,error:this.state.error},this.props.hasError),o.createElement(k,{fetchState:this.state.fetchState,data:this.state.data,params:this.state.params,handleChange:this.handleChange,childProps:this.props.childProps},this.props.isLoaded))}}]),n}();window.JsonData=E;var D=function(){e(r,o.Component);var t=i(r);function r(e){return u(this,r),(e=t.call(this,e)).state={isReady:!1},e}return c(r,[{key:"componentDidMount",value:function(){var e=this;this.loadScripts(this.props.scripts,this.props.loadScriptsInOrder).then(function(){e.setState({isReady:!0})})}},{key:"loadScripts",value:function(a,e){function i(a){return new Promise(function(e){for(var t=document.querySelectorAll("link"),r=0,n=t.length;r<n;r++)if("stylesheet"===t[r].rel&&t[r].getAttribute("href")===a)return void e();var o=document.createElement("link");o.rel="stylesheet",o.onload=e,o.onerror=function(){console.error("Error loading CSS File: "+a),e()},o.href=a,document.head.appendChild(o)})}function s(a){return new Promise(function(e){for(var t=document.querySelectorAll("script"),r=0,n=t.length;r<n;r++)if(t[r].getAttribute("src")===a)return void e();var o=document.createElement("script");o.onload=e,o.onerror=function(){console.error("Error loading JS File: "+a),e()},o.src=a,document.head.appendChild(o)})}function l(a){return new Promise(function(e){for(var t=document.querySelectorAll("script[data-src][data-compiler]"),r=0,n=t.length;r<n;r++)if(t[r].getAttribute("data-src")===a)return void e();var o=document.createElement("script");o.type="text/babel",o.setAttribute("src",a),document.head.appendChild(o),jsxLoader.loadScript(o).then(function(){e()})})}if("string"==typeof a)a=[a];else if(!Array.isArray(a))return console.error("Invalid prop for <LazyLoad>, expected [scripts] to be a string or an array of strings. Check console."),console.log(a),new Promise(function(e){e()});return!0===e?new Promise(function(r){var n=0,o=a.length;!function e(){var t;n!==o?(t=a[n],n++,t.endsWith(".js")?s(t).then(e):t.endsWith(".css")?i(t).then(e):t.endsWith(".jsx")?l(t).then(e):(console.error("Invalid Script for <LazyLoad>. Only scripts ending with [js, css, or jsx] can be used. Error URL: "+t),e())):r()}()}):new Promise(function(e){for(var t=[],r=0,n=a.length;r<n;r++){var o=a[r];o.endsWith(".js")?t.push(s(o)):o.endsWith(".css")?t.push(i(o)):o.endsWith(".jsx")?t.push(l(o)):console.error("Invalid Script for <LazyLoad>. Only scripts ending with [js, css, or jsx] can be used. Error URL: "+o)}Promise.all(t).then(function(){e()})})}},{key:"loadPolyfill",value:function(e,o){return!1===e||void 0===e?new Promise(function(e,t){var r,n;r=e,n=t,(t=document.createElement("script")).onload=function(){r()},t.onerror=function(){console.error("Error loading Script: "+o),n()},t.src=o,document.head.appendChild(t)}):new Promise(function(e){e()})}},{key:"render",value:function(){if(!this.state.isReady)return this.props.isLoading||null;if(this.props.children)return this.props.children;if(this.props.isLoaded){if("string"!=typeof this.props.isLoaded)return this.props.isLoaded;var e,t=this.props.isLoaded,r={};for(e in this.props)this.props.hasOwnProperty(e)&&"scripts"!==e&&"isLoaded"!==e&&"isLoading"!==e&&(r[e]=this.props[e]);if(void 0!==window&&void 0!==window[t])return o.createElement(window[t],r);if(void 0!==globalThis&&void 0!==globalThis[t])return o.createElement(globalThis[t],r);throw new TypeError("Component <LazyLoad isLoaded="+JSON.stringify(t)+"> was not found. Check if your script is missing or has a compile error.")}throw new TypeError("Missing child nodes or the [isLoaded] property for a <LazyLoad> element.")}}]),r}();window.LazyLoad=D;var x=function(){e(r,o.Component);var t=i(r);function r(e){return u(this,r),(e=t.call(this,e)).sortColumn=e.sortColumn.bind(s(e)),e.table=o.createRef(),e}return c(r,[{key:"componentDidMount",value:function(){this.setupTable()}},{key:"setupTable",value:function(){var e=this.table.current;if(null===e.tHead)return console.warn("Unable to setup sorting for table because there is no <thead> element"),void console.log(e);if(0===e.tHead.rows.length)return console.warn("Unable to setup sorting for table because the <thead> element contained now rows"),void console.log(e);if(0===e.tBodies.length)return console.warn("Unable to setup sorting for table because the <tbody> element is missing"),void console.log(e);if(1!==e.tBodies.length)return console.warn("Unable to setup sorting for table because there can only be one <tbody> element for the table"),void console.log(e);for(var t=e.tHead.rows[e.tHead.rows.length-1],r=0,n=t.cells.length;r<n;r++)t.cells[r].addEventListener("click",this.sortColumn),t.cells[r].style.cursor="pointer"}},{key:"sortColumn",value:function(e){var t=e.target,r=t&&t.parentElement&&t.parentElement.parentElement?t.parentElement.parentElement.parentElement:null;if("TH"!==t.tagName&&"TD"!==t.tagName)return console.warn("SortableTable.sortColumn() was called with an invalid element. If called manually the cell needs to be passed."),void console.log(t);if(null!=r&&"TABLE"!==r.tagName)return console.warn("SortableTable.sortColumn() was called with an invalid element. If called manually the table cell of the last row from the table header should be used."),void console.log(t);var e=r.getAttribute("data-sort-column"),n=t.cellIndex,t="asc";null!==e&&parseInt(e,10)===n&&(t="asc"===r.getAttribute("data-sort-order")?"desc":"asc");for(var o=r.tBodies[0],a=o.rows,i=[],s=0,l=a.length;s<l;s++){var u,c,d=a[s].cells[n];void 0!==d&&(c=w(u=(null!==(c=d.getAttribute("data-value"))?c:d.textContent).trim()),""===u?u=null:isNaN(u)?(d=new Date(u),isNaN(d.getTime())?u=void 0!==u.toLocaleLowerCase?u.toLocaleLowerCase():u.toLowerCase():(u=d,c="date")):u=parseFloat(u),i.push({row:a[s],value:u,type:null===u?null:c}))}i.sort(this.sortCompare),"desc"===t&&i.reverse();for(var p=r.getAttribute("data-sort-class-odd"),h=r.getAttribute("data-sort-class-even"),f=p&&h,m=0,y=0,v=i.length;y<v;y++){var g=i[y].row;f&&"none"!==g.style.display&&(++m%2==0?(g.classList.add(h),g.classList.remove(p)):(g.classList.add(p),g.classList.remove(h))),o.appendChild(g)}r.setAttribute("data-sort-column",n),r.setAttribute("data-sort-order",t)}},{key:"sortCompare",value:function(e,t){return null===e.type&&null!==t.type?-1:null===t.type&&null!==e.type?1:null===e.type&&null===t.type?0:"number"===e.type&&"number"!==t.type?-1:"number"===t.type&&"number"!==e.type?1:"number"===e.type&&"number"===t.type?e.value-t.value:"date"===e.type&&"date"!==t.type?-1:"date"===t.type&&"date"!==e.type?1:"date"===e.type&&"date"===t.type?e.value<t.value?-1:e.value>t.value?1:0:"string"===e.type&&"string"===t.type?void 0!==e.value.localeCompare?e.value.localeCompare(t.value):e.value<t.value?-1:e.value>t.value?1:0:(console.warn("A code change from [SortableTable] impacted sorting and caused an expected error so the data may appear out of order. Please review your code changes"),0)}},{key:"render",value:function(){return o.createElement("table",Object.assign({},this.props,{ref:this.table}),this.props.children)}}]),r}();window.SortableTable=x;var O=(c(T,null,[{key:"Cache",get:function(){return t}},{key:"CssVars",get:function(){return h}},{key:"ErrorBoundary",get:function(){return m}},{key:"Format",get:function(){return y}},{key:"InputFilter",get:function(){return g}},{key:"JsonData",get:function(){return E}},{key:"LazyLoad",get:function(){return D}},{key:"SortableTable",get:function(){return x}}]),T);function T(){u(this,T)}window.DataFormsJS=O}();