2 lines
22 KiB
JavaScript
2 lines
22 KiB
JavaScript
/*! For license information please see oc-advance-error-page.js.LICENSE.txt */
|
||
(()=>{var e={530:()=>{var e=Object.defineProperty,t=(t,n,r)=>(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);const n={};async function r(e){if(n.hasOwnProperty(e))return n[e];let t;return t=e.startsWith("data:")||!("caches"in self)?fetch(e).then(e=>e.text()):caches.open("gravity").then(async t=>{let n=await t.match(e);return n||(n=await fetch(e),n.ok&&await t.put(e,n.clone())),n.text()}),n[e]=t,t}class i extends HTMLElement{static get observedAttributes(){return["src"]}fetchFlag(e){e&&r(e).then(e=>this.innerHTML=e)}connectedCallback(){this.fetchFlag(this.getAttribute("src"))}attributeChangedCallback(e,t,n){"src"===e&&t!==n&&this.fetchFlag(n)}}t(i,"TAG_NAME","gv-flag");class o extends HTMLElement{static get observedAttributes(){return["src"]}fetchIcon(e){e&&r(e).then(e=>this.innerHTML=e)}connectedCallback(){this.fetchIcon(this.getAttribute("src"))}attributeChangedCallback(e,t,n){"src"===e&&t!==n&&this.fetchIcon(n)}}t(o,"TAG_NAME","gv-icon");class s extends HTMLElement{static get observedAttributes(){return["src"]}fetchIllustration(e){e&&r(e).then(e=>this.innerHTML=e)}connectedCallback(){this.fetchIllustration(this.getAttribute("src"))}attributeChangedCallback(e,t,n){"src"===e&&t!==n&&this.fetchIllustration(n)}}t(s,"TAG_NAME","gv-illustration");class a extends HTMLElement{static get observedAttributes(){return["src"]}fetchIndicator(e){e&&r(e).then(e=>this.innerHTML=e)}connectedCallback(){this.fetchIndicator(this.getAttribute("src"))}attributeChangedCallback(e,t,n){"src"===e&&t!==n&&this.fetchIndicator(n)}}t(a,"TAG_NAME","gv-indicator");class c extends HTMLElement{static get observedAttributes(){return["src"]}fetchLoader(e){e&&r(e).then(e=>this.innerHTML=e)}connectedCallback(){this.fetchLoader(this.getAttribute("src"))}attributeChangedCallback(e,t,n){"src"===e&&t!==n&&this.fetchLoader(n)}}t(c,"TAG_NAME","gv-loader");class l extends HTMLElement{static get observedAttributes(){return["src"]}fetchLogo(e){e&&r(e).then(e=>this.innerHTML=e)}connectedCallback(){this.fetchLogo(this.getAttribute("src"))}attributeChangedCallback(e,t,n){"src"===e&&t!==n&&this.fetchLogo(n)}}t(l,"TAG_NAME","gv-logo");class u extends HTMLElement{static get observedAttributes(){return["src"]}fetchPayIcon(e){e&&r(e).then(e=>this.innerHTML=e)}connectedCallback(){this.fetchPayIcon(this.getAttribute("src"))}attributeChangedCallback(e,t,n){"src"===e&&t!==n&&this.fetchPayIcon(n)}}t(u,"TAG_NAME","gv-pay-icon");class f extends HTMLElement{static get observedAttributes(){return["src"]}fetchTile(e){e&&r(e).then(e=>this.innerHTML=e)}connectedCallback(){this.fetchTile(this.getAttribute("src"))}attributeChangedCallback(e,t,n){"src"===e&&t!==n&&this.fetchTile(n)}}function d(e,t){customElements.get(e)||customElements.define(e,t)}t(f,"TAG_NAME","gv-tile"),d(i.TAG_NAME,i),d(o.TAG_NAME,o),d(s.TAG_NAME,s),d(a.TAG_NAME,a),d(c.TAG_NAME,c),d(l.TAG_NAME,l),d(u.TAG_NAME,u),d(f.TAG_NAME,f)},556:(e,t,n)=>{e.exports=n(694)()},694:(e,t,n)=>{"use strict";var r=n(925);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=wp.element;var t=n(556),r=n.n(t);const i=React;var o=n.n(i);const s=ReactDOM;n(530);var a=function(e){var t=e.children,n=e.onClick,r=e.className,i=void 0===r?"":r,o=e.disabled,s=void 0!==o&&o,a=e.type,c=void 0===a?"button":a;return React.createElement("button",{type:c,className:"gv-button ".concat(i),onClick:n,disabled:s},t)};a.propTypes={children:r().node.isRequired,onClick:r().func,className:r().string,disabled:r().bool,type:r().string},r().string,r().string,r().string,r().func,r().string,r().string,r().string,r().string,r().string,r().bool,r().bool;var c=function(e){var t=e.id,n=e.name,r=e.value,i=e.checked,s=e.onChange,a=e.label;return o().createElement("div",{className:"gv-option-inline"},o().createElement("input",{id:t,type:"radio",name:n,value:r,checked:i,onChange:s,className:"gv-radio"}),o().createElement("label",{htmlFor:t,className:"gv-label"},a))};function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}c.propTypes={id:r().string.isRequired,name:r().string.isRequired,value:r().string.isRequired,checked:r().bool,onChange:r().func.isRequired,label:r().string.isRequired},r().string.isRequired,r().func.isRequired,r().string,r().string,r().arrayOf(r().shape({value:r().string.isRequired,label:r().string.isRequired})).isRequired,r().string.isRequired,r().func.isRequired,r().string,r().bool.isRequired,r().func.isRequired,r().string.isRequired,r().bool.isRequired,r().func.isRequired,r().string,r().string,r().bool,r().bool;var f=function(e){var t=e.message,n=e.type,r=void 0===n?"info":n,a=e.containerId,c=void 0===a?"toast-root":a,l=e.closeIcon,f=e.onClose,d=e.duration,v=void 0===d?5e3:d,g=u((0,i.useState)(!1),2),h=g[0],m=g[1];if((0,i.useEffect)(function(){if(t){m(!0);var e=setTimeout(function(){m(!1),f&&f()},v);return function(){return clearTimeout(e)}}},[t,v,f]),!t)return null;var p=o().createElement("div",{className:"gv-toast gv-toast-".concat(r," ").concat(h?"gv-visible":"gv-invisible")},o().createElement("p",{className:"gv-toast-content"},t),o().createElement("button",{className:"gv-toast-close",onClick:function(){m(!1),f&&f()}},l?o().createElement("img",{src:l,alt:"Close"}):o().createElement("span",null,"×"))),y=document.getElementById(c);return y?(0,s.createPortal)(p,y):p};f.propTypes={message:r().string,type:r().oneOf(["success","error","info","warning",""]),containerId:r().string,closeIcon:r().string,onClose:r().func,duration:r().number};var d,v={exports:{}},g=new(function(){if(d)return v.exports;d=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}v.exports=i,v.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,o,c,l;if(s(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),c=o[t]),void 0===c)c=o[t]=n,++e._eventsCount;else if("function"==typeof c?c=o[t]=r?[n,c]:[c,n]:r?c.unshift(n):c.push(n),(i=a(e))>0&&c.length>i&&!c.warned){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=c.length,l=u,console&&console.warn&&console.warn(l)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):h(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function m(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){r.once&&e.removeEventListener(t,i),n(o)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,u=h(c,l);for(r=0;r<l;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,o,a;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return f(this,e,!0)},i.prototype.rawListeners=function(e){return f(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},i.prototype.listenerCount=g,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},v.exports}().EventEmitter),h=function(e){var t=e.closable,n=void 0!==t&&t,r=e.iconSrc,o=void 0===r?"":r,s=u((0,i.useState)({isVisible:!1,message:"",title:"",noticeClass:"",icon:""}),2),a=s[0],c=s[1];return(0,i.useEffect)(function(){var e=function(e){var t=e.title,n=e.message,r=e.noticeClass,i=e.icon;c({isVisible:!0,title:t,message:n,noticeClass:r,icon:i}),setTimeout(function(){var e=document.querySelector(".gv-notice");if(e){var t=e.getBoundingClientRect();(t.top<0||t.bottom>window.innerHeight)&&e.scrollIntoView({behavior:"smooth",block:"start"})}},100)},t=function(){c({isVisible:!1,message:"",noticeClass:"",icon:"",title:""})};return g.on("showNotice",e),g.on("hideNotice",t),function(){g.off("showNotice",e),g.off("hideNotice",t)}},[]),a.isVisible?React.createElement("div",{className:"gv-notice ".concat(a.noticeClass," gv-mb-lg")},a.icon&&React.createElement("gv-icon",{class:"gv-notice-icon",src:a.icon}),null!=a&&a.title?React.createElement("div",{className:"gv-notice-content"},React.createElement("div",{className:"gv-notice-title"},a.title),(null==a?void 0:a.message)&&React.createElement("p",null,a.message)):(null==a?void 0:a.message)&&React.createElement("p",{className:"gv-notice-content"},a.message),n&&React.createElement("button",{className:"gv-notice-close",onClick:function(){c({isVisible:!1,message:"",noticeClass:"",icon:""})}},""!==o&&React.createElement("gv-icon",{src:o}))):null};function m(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var c=r&&r.prototype instanceof a?r:a,l=Object.create(c.prototype);return p(l,"_invoke",function(n,r,i){var o,a,c,l=0,u=i||[],f=!1,d={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function(t,n){return o=t,a=0,c=e,d.n=n,s}};function v(n,r){for(a=n,c=r,t=0;!f&&l&&!i&&t<u.length;t++){var i,o=u[t],v=d.p,g=o[2];n>3?(i=g===r)&&(c=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=v&&((i=n<2&&v<o[1])?(a=0,d.v=r,d.n=o[1]):v<g&&(i=n<3||o[0]>r||r>g)&&(o[4]=n,o[5]=r,d.n=g,a=0))}if(i||n>1)return s;throw f=!0,r}return function(i,u,g){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&v(u,g),a=u,c=g;(t=a<2?e:c)||!f;){o||(a?a<3?(a>1&&(d.n=-1),v(a,c)):d.n=c:d.v=c);try{if(l=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?c:n.call(r,d))!==s)break}catch(t){o=e,a=1,c=t}finally{l=1}}return{value:t,done:f}}}(n,i,o),!0),l}var s={};function a(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(p(t={},r,function(){return this}),t),f=l.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,p(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=l,p(f,"constructor",l),p(l,"constructor",c),c.displayName="GeneratorFunction",p(l,i,"GeneratorFunction"),p(f),p(f,i,"Generator"),p(f,r,function(){return this}),p(f,"toString",function(){return"[object Generator]"}),(m=function(){return{w:o,m:d}})()}function p(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}p=function(e,t,n,r){function o(t,n){p(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},p(e,t,n,r)}function y(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".gv-oc-overlay{align-items:center;background:hsla(0,0%,100%,.9);display:flex;flex-direction:column;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:10}"),r().string,r().string,r().string,r().func.isRequired,r().string,r().string,r().string,r().string;var w=document.getElementById("oc-notice-placeholder");w&&(0,e.createRoot)(w).render(React.createElement(h,{closable:!1}));var C=function(){var t,n,r=b((0,e.useState)((n=null===(t=window.ErrorPage)||void 0===t?void 0:t.status,["true","1",1].includes(n)?"1":"0")),2),i=r[0],o=r[1],s=b((0,e.useState)(!1),2),l=s[0],u=s[1],d=b((0,e.useState)({message:"",type:"info"}),2),v=d[0],h=d[1],p=function(e){o(e)},E=function(){var e,t=(e=m().m(function e(){var t,n,r,s;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:return u(!0),t={action:"onecom-error-pages",type:"1"===i?"enable":"disable"},e.p=1,e.n=2,fetch(ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:new URLSearchParams(t).toString()});case 2:return n=e.v,e.n=3,n.json();case 3:r=e.v,console.log("Server response:",r),r.success?(g.emit("hideNotice"),"success"===r.data.status?h({message:r.data.message||"Your settings were saved.",type:"success"}):h({message:r.data.message||"Couldn’t save your settings.",type:"alert"})):(o("0"),g.emit("showNotice",{title:window.ErrorPage.noticeHeading,message:window.ErrorPage.noticeDescription,icon:"".concat(window.ErrorPage.imageURL,"/modules/error-page/assets/img/error.svg"),noticeClass:"gv-notice-alert"})),e.n=5;break;case 4:e.p=4,s=e.v,console.error("Error saving data:",s),h({message:"Couldn’t save your settings.",type:"alert"});case 5:return e.p=5,u(!1),e.f(5);case 6:return e.a(2)}},e,null,[[1,4,5,6]])}),function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){y(o,r,i,s,a,"next",e)}function a(e){y(o,r,i,s,a,"throw",e)}s(void 0)})});return function(){return t.apply(this,arguments)}}();return React.createElement(React.Fragment,null,React.createElement(f,{message:v.message,type:v.type,onClose:function(){return h({message:"",type:""})},containerId:"oc-error-toast",closeIcon:"".concat(window.ErrorPage.imageURL,"/assets/images/close-white.svg")}),React.createElement("div",{className:"gv-flex gv-justify-between gv-max-mob-flex-col"},React.createElement("div",{className:"oc-left"},React.createElement("p",{className:"gv-text-sm gv-text-bold gv-mb-sm"},window.ErrorPage.labelStatus),React.createElement("div",{className:"gv-mode-condensed gv-mb-md gv-form-option"},React.createElement(c,{id:"oc-active",name:"status",value:"1",checked:"1"===i,onChange:function(e){return p(e.target.value)},label:window.ErrorPage.labelActive})),React.createElement("div",{className:"gv-mode-condensed gv-form-option"},React.createElement(c,{id:"oc-inactive",name:"status",value:"0",checked:"0"===i,onChange:function(e){return p(e.target.value)},label:window.ErrorPage.labelInactive})),React.createElement(a,{className:"gv-button-primary gv-mt-md gv-max-mob-hidden",onClick:function(e){return E(e)},type:"button",children:l?window.ErrorPage.labelSaving:window.ErrorPage.labelSave})),React.createElement("div",{className:"oc-right gv-flex-auto gv-max-mob-mt-md"},"1"===i?React.createElement("img",{src:"".concat(window.ErrorPage.imageURL,"/modules/error-page/assets/img/error-active.svg")}):React.createElement("img",{src:"".concat(window.ErrorPage.imageURL,"/modules/error-page/assets/img/error-inactive.svg")})),React.createElement(a,{className:"gv-button-primary gv-mt-md gv-tab-hidden gv-desk-hidden",onClick:function(e){return E(e)},type:"button",children:l?window.ErrorPage.labelSaving:window.ErrorPage.labelSave})))},L=document.getElementById("oc-errorpage-root");L&&(0,e.createRoot)(L).render(React.createElement(e.StrictMode,null,React.createElement(C,null)))})()})(); |