vendor: 4,783 bytes, line 1
1!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StatusWidget=e():t.StatusWidget=e()}(this,(function(){return function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e={};t.d(e,{default:function(){return L}});function n(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))}Object.create;Object.create;function r(){r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new L(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function v(){}var y={};u(y,a,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(j([])));w&&w!==e&&n.call(w,a)&&(y=w);var m=v.prototype=d.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var s=h(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return S()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=k(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=h(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function k(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=h(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,f;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function F(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(F,this),this.reset(!0)}function j(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=v,o(m,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:p,configurable:!0}),p.displayName=u(v,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(_.prototype),u(_.prototype,c,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,o,i){void 0===i&&(i=Prom
1ise);var a=new _(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(m),u(m,s,"Generator"),u(m,a,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=j,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,a;return e=t,(i=[{key:"getStatus",value:function(){return n(this,void 0,void 0,r().mark((function e(){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("".concat(t.STATUS_API_URL,"/status_pages/").concat("altegio","/status"),{cache:"no-cache"});case 3:if(200!==(n=e.sent).status){e.next=6;break}return e.abrupt("return",n.json());case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(0);case 10:return console.error("Failed to receive current service status"),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[0,8]])})))}}])&&o(e.prototype,i),a&&o(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();i.STATUS_API_URL="https://statuspal.eu/api/v1";var a,c,s,u;function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}!function(t){t.SHOW="view:show",t.HIDE="view:hide"}(a||(a={})),function(t){t.SHOW="onShow",t.HIDE="onHide"}(c||(c={}));var h,f="status-widget",d="status-widget__close",p="status-widget-is-hidden",v="status-widget_visible",y=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.areCssVariablesAttached=!1,this.isVisible=!1,this.isRendered=!1,this.shadowContainer=document.createElement("div"),this.shadowRoot=this.shadowContainer.attachShadow({mode:"closed"}),this.currentCssVars=[],this.currentText="",this[s]=null,this[u]=null,this.closeHandler=this.onCloseClick.bind(this),this.initialize()}var e,n,r;return e=t,n=[{key:"isHiddenManually",get:function(){return"1"===localStorage.getItem(p)},set:function(t){t?localStorage.setItem(p,"1"):localStorage.removeItem(p)}},{key:"initialize",value:function(){this.attachStyles(),this.attachHtml()}},{key:"attachStyles",value:function(){var t=document.createElement("style"),e=document.createTextNode("#status-widget {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n display: flex;\n z-index: 99999;\n justify-content: space-between;
1\n align-items: flex-start;\n padding: 12px 16px;\n background-color: var(--background-color, #2B3134);\n visibility: hidden;\n transform: translateY(-100%);\n transition: transform 0.4s ease;\n}\n\n#status-widget.status-widget_visible {\n visibility: visible;\n transform: translateY(0);\n}\n\n#status-widget__text {\n flex: 1;\n padding: 12px 16px 8px;\n font-family: Arial, Helvetica, sans-serif;\n font-size: var(--font-size, 16px);\n color: var(--text-color, #FFFFFF);\n font-style: normal;\n font-weight: 400;\n line-height: 24px;\n word-wrap: break-word;\n word-break: break-word;\n}\n\n#status-widget__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n stroke: var(--icon-color, #FFFFFF);\n background-color: var(--icon-background-color, inherit);\n border-radius: 50%;\n}\n\n#status-widget__close {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 36px;\n height: 36px;\n padding: 6px;\n border-radius: 8px;\n stroke: var(--close-color, #71757F);\n}\n\n#status-widget__close:hover {\n background-color: rgba(0, 0, 0, 0.2);\n cursor: pointer;\n}\n\n#status-widget a {\n text-decoration: underline;\n color: inherit;\n}\n\n#status-widget a:hover {\n text-decoration: none;\n}\n\n@media (max-width: 600px) {\n #status-widget {\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n padding: 24px 16px 16px;\n }\n\n #status-widget__text {\n flex: auto;\n text-align: center;\n padding: 16px 0 0;\n }\n\n #status-widget__icon {\n background-color: var(--icon-background-color, #71757F);\n }\n\n #status-widget__close {\n position: absolute;\n top: 8px;\n right: 8px;\n }\n}\n");t.append(e),this.shadowRoot.appendChild(t)}},{key:"attachHtml",value:function(){this.shadowRoot.innerHTML="".concat(this.shadowRoot.innerHTML,"\n").concat('<div id="status-widget"> <div id="status-widget__icon"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M11.0088 11.2495H12.1593V15.5013" stroke="inherit" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path d="M11 15.5017H13.3103" stroke="inherit" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path d="M21.0036 11.9998C21.0036 16.9725 16.9725 21.0036 11.9998 21.0036C7.02721 21.0036 2.99609 16.9725 2.99609 11.9998C2.99609 7.02721 7.02721 2.99609 11.9998 2.99609C16.9725 2.99609 21.0036 7.02721 21.0036 11.9998Z" stroke="inherit" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path d="M12.0999 8.24613C12.0997 8.38418 11.9878 8.49598 11.8497 8.49592C11.7117 8.49586 11.5998 8.38397 11.5997 8.24592C11.5997 8.10788 11.7115 7.99589 11.8495 7.99571C11.9159 7.99562 11.9797 8.02198 12.0267 8.06896C12.0737 8.11595 12.1 8.17969 12.0999 8.24613" stroke="inherit" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> </div> <div id="status-widget__text">{{ text }}</div> <div id="status-widget__close"> <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4 4L12 12" stroke="inherit" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path d="M12 4L4 12" stroke="inherit" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> </div> </div> ')}},{key:"onCloseClick",value:function(){this.isHiddenManually=!0,this.hide()}},{key:"addCloseEvent",value:function(){var t;null===(t=this.shadowRoot.getElementById(d))||void 0===t||t.addEventListener("click",this.closeHandler)}},{key:"removeCloseEvent",value:function(){var t;null===(t=this.shadowRoot.getElementById(d))||void 0===t||t.removeEventListener("click",this.closeHandler)}},{key:"attachCssVariables",value:function(t){var e=this.areCssVariablesAttached?this.shadowRoot.children[0]:document.createElement("style"),n=[];for(var r in t){var o=t[r];o&&n.push(" --".concat(r.replaceAll("_","-"),": ").concat(o,";"))}this.currentCssVars.length===n.length&&this.currentCssVars.every((function(t){return n.includes(t)}))||(e.textContent="",e.appendChild(document.createTextNode("#".concat(f," {\n").concat(n.join("\n"),"\n}
1"))),this.areCssVariablesAttached||(this.shadowRoot.prepend(e),this.areCssVariablesAttached=!0),this.currentCssVars=n)}},{key:"renderText",value:function(t){if(this.currentText!==t){var e=this.shadowRoot.getElementById("status-widget__text");e&&(e.innerHTML=t.replace(/\n/g,"<br />"),this.currentText=t)}}},{key:"render",value:function(t,e){return this.renderText(t),this.attachCssVariables(e),this.isRendered||(document.body.append(this.shadowContainer),this.addCloseEvent(),this.isRendered=!0),this}},{key:"show",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(this.isHiddenManually&&e||!this.isVisible&&!this.isHiddenManually)&&(this.isHiddenManually=!1,window.requestAnimationFrame((function(){var e,n=t.shadowRoot.getElementById(f);n&&(n.classList.add(v),t.isVisible=!0,null===(e=t[c.SHOW])||void 0===e||e.call(t))}))),this}},{key:"hide",value:function(){var t=this;return this.isVisible&&window.requestAnimationFrame((function(){var e,n=t.shadowRoot.getElementById(f);n&&(n.classList.remove(v),t.isVisible=!1,null===(e=t[c.HIDE])||void 0===e||e.call(t))})),this}},{key:"destroy",value:function(){this.removeCloseEvent(),this.shadowContainer.remove()}}],n&&l(e.prototype,n),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function g(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}s=c.HIDE,u=c.SHOW,function(t){t.MINOR="minor",t.MAJOR="major",t.SCHEDULED="scheduled",t.ESSENTIAL="essential"}(h||(h={}));var b="status-widget-template-update-key",_={[a.HIDE]:c.HIDE,[a.SHOW]:c.SHOW},x=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.project=e,this.view=new y}var e,n,r;return e=t,n=[{key:"updateKey",get:function(){var t;return null!==(t=localStorage.getItem(b))&&void 0!==t?t:""},set:function(t){localStorage.setItem(b,t)}},{key:"lang",get:function(){return window.navigator.language.slice(0,2)}},{key:"configProjectName",get:function(){return this.project.replace(".","_")}},{key:"getTextRenderParams",value:function(t,e){return Object.assign(Object.assign({},t),{status_url:"https://status.alteg.io",brand:"Altegio",timezone:e.time_zone})}},{key:"getConfig",value:function(t){var e,n=t.type===h.ESSENTIAL?h.SCHEDULED:t.type;return null!==(e={name:"Altegio",status_url:"https://status.alteg.io",status_page:"altegio",default_lang:"en",api_poll_interval:0,incidents:{minor:{style:{biz_erp:{background_color:"#2B3134",text_color:"#FFFFFF",font_size:"16px",icon_color:"#FFFFFF"},biz_erp_mobile:{background_color:"#2B3134",text_color:"#FFFFFF",font_size:"16px",icon_color:"#FFFFFF"},client_widget:{background_color:"#2B3134",text_color:"#FFFFFF",font_size:"16px",icon_color:"#FFFFFF"},client_booking:{background_color:"#2B3134",text_color:"#FFFFFF",font_size:"16px",icon_color:"#FFFFFF"}},text:{biz_erp:{en:'We are experiencing minor difficulties with the service. We know the issue and are working to fix this as soon as possible. Please check our <a href="{{ status_url }}" target="_blank">status page</a>
1 for the system updates.\n'},biz_erp_mobile:{en:null},client_booking:{en:null},client_widget:{en:null}}},major:{style:{biz_erp:{background_color:"#FEDFE0",text_color:"#2B3134",font_size:"16px",icon_color:"#FFFFFF",icon_background_color:"#D1050B"},biz_erp_mobile:{background_color:"#FEDFE0",text_color:"#2B3134",font_size:"16px",icon_color:"#FFFFFF",icon_background_color:"#D1050B"},client_widget:{background_color:"#FEDFE0",text_color:"#2B3134",font_size:"16px",icon_color:"#FFFFFF",icon_background_color:"#D1050B"},client_booking:{background_color:"#FEDFE0",text_color:"#2B3134",font_size:"16px",icon_color:"#FFFFFF",icon_background_color:"#D1050B"}},text:{biz_erp:{en:'There\'s a glitch with our system but the duty team is already looking into it. Support may take a bit of time to respond. Please check our <a href="{{ status_url }}" target="_blank">status page</a> for the system updates.\n'},biz_erp_mobile:{en:null},client_booking:{en:"The online booking service is temporarily unavailable. We'll do our best to fix this issue as soon as possible. To schedule an appointment, please give us a call.\n"},client_widget:{en:"The online booking service is temporarily unavailable. We'll do our best to fix this issue as soon as possible. To schedule an appointment, please give us a call.\n"}}}},maintenance:{scheduled:{style:{biz_erp:{background_color:"#F7F9FC",text_color:"#2B3134",font_size:"16px",icon_color:"#2B3134"},biz_erp_mobile:{background_color:"#F7F9FC",text_color:"#2B3134",font_size:"16px",icon_color:"#2B3134"},client_widget:{background_color:"#F7F9FC",text_color:"#2B3134",font_size:"16px",icon_color:"#2B3134"},client_booking:{background_color:"#F7F9FC",text_color:"#2B3134",font_size:"16px",icon_color:"#2B3134"}},text:{biz_erp:{en:'From {{ services.starts_at }} to {{ current_status.ends_at }} ({{ timezone }}), we will be carrying out scheduled maintenance to improve the stability of the service. Please note that there may be Interruptions with the service. Check our <a href="{{ status_url }}" target="_blank">status page</a> for the system updates.\n'},biz_erp_mobile:{en:null},client_booking:{en:null},client_widget:{en:null}}}}}[n===h.SCHEDULED?"maintenance":"incidents"][n])&&void 0!==e?e:null}},{key:"getMessage",value:function(t){var e,n,r=t.text[this.configProjectName];return null!==(n=null!==(e=r[this.lang])&&void 0!==e?e:r.en)&&void 0!==n?n:""}},{key:"getParamValue",value:function(t,e){var n,r,o=g(t.split("."));try{for(o.s();!(r=o.n()).done&&(n=e[r.value]););}catch(t){o.e(t)}finally{o.f()}return n?String(n):""}},{key:"isDateString",value:function(t){return/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(t)}},{key:"parseMessage",value:function(t,e){var n=this;return t.replace(/{{\s(.*?)\s}}/g,(function(t,r){var o=n.getParamValue(r,e);return n.isDateString(o)?new Date(o+"Z").toLocaleString(void 0,{timeZone:e.timezone}):o}))}},{key:"showView",value:function(t,e){var n=this.getConfig(e);if(!n)return!1;var r=this.getMessage(n);if(!r)return!1;var o=this.parseMessage(r,this.getTextRenderParams(e,t.status_page)),i=this.updateKey,a="".concat(e.updated_at,"_").concat(o);return this.updateKey=a,this.view.render(o,n.style[this.configProjectName]).show(i!==a),!0}},{key:"getActiveIncident",value:function(t){var e=t.incidents.find((function(t){return[h.MAJOR,h.MINOR].includes(t.type)}));return e||null}},{key:"getActiveMaintenance",value:function(t){var e=t.incidents.find((function(t){return[h.SCHEDULED,h.ESSENTIAL].includes(t.type)}));return e||null}},{key:"getUpcomingMaintenance",value:function(t){var e=t.maintenances.find((function(t){return[h.SCHEDULED,h.ESSENTIAL].includes(t.type)}));return null!=e?e:null}},{key:"render",value:function(t){var e;if(t){var n=this.getActiveIncident(t);if(n&&this.showView(t,n))return;var r=null!==(e=this.getActiveMaintenance(t))&&void 0!==e?e:this.getUpcomingMaintenance(t);if(r&&this.showView(t,r))return}this.view.hide()}},{key:"subscribeTo",value:function(t,e){_[t]&&(this.view[_[t]]=e)}},{key:"unsubscribeTo",value:function(t){_[t]&&(this.view[_[t]]=null)}},{key:"destroy",value:function(){this.view.destroy()}}],n&&m(e.prototype,n),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function k(){k=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),c=new L(o||[]);return r(a,"_invoke",{value:_(t,n,c)}),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function f(){}function d(){}function p(){}var v={};s(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(j([])));
vendor: 4,359 bytes, line 1
1g&&g!==e&&n.call(g,i)&&(v=g);var w=p.prototype=f.prototype=Object.create(v);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(r,i,a,c){var s=l(t[r],t,i);if("throw"!==s.type){var u=s.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,c)}))}c(s.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function _(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return S()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=x(a,n);if(c){if(c===h)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function F(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(F,this),this.reset(!0)}function j(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return d.prototype=p,r(w,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=s(p,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},m(b.prototype),s(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(w),s(w,c,"Generator"),s(w,i,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=j,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");
1if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function F(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var E=null,L=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.timeoutId=-1,null!==E)return E;window?(this.renderer=new x(e.project),this.api=new i,E=this,this.updateStatus()):console.error("We do serve only browser clients")}var e,r,o;return e=t,(r=[{key:"updateStatusInfinite",value:function(){return n(this,void 0,void 0,k().mark((function t(){var e=this;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==E){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,this.updateStatus();case 4:this.timeoutId=setTimeout((function(){return e.updateStatusInfinite()}),0);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"updateStatus",value:function(){return n(this,void 0,void 0,k().mark((function t(){return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=this.renderer,t.next=3,this.api.getStatus();case 3:t.t1=t.sent,t.t0.render.call(t.t0,t.t1);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"subscribeTo",value:function(t,e){return this.renderer.subscribeTo(t,e),this}},{key:"unsubscribeTo",value:function(t){return this.renderer.unsubscribeTo(t),this}},{key:"destroy",value:function(){E=null,clearTimeout(this.timeoutId),this.renderer.destroy()}}])&&F(e.prototype,r),o&&F(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();return e=e.default}()}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.