import{c as n,a as t,b as r}from"./p-56cafef4.js";import{c as e}from"./p-4528e464.js";import{l as o,a as i,b as a}from"./p-6f78ea17.js";import{A as u}from"./p-bc71b894.js";import{n as f,s as c}from"./p-a7724efa.js";import{p as s}from"./p-56b80293.js";import{I as l,i as v,a as d,b as h,L as p,l as y,c as m,d as b,F as w,f as E,e as S,g as _,S as g,s as A,h as T,j as I,k as N,m as R,n as L,o as D,p as O,U as B,u as j,q as C,r as U,t as k,v as F,w as M,x as G}from"./p-4d3f8c91.js";import{s as P}from"./p-f4d2e8f3.js";import{g as x}from"./p-a53c9466.js";import{u as z,a as W}from"./p-1bab3be7.js";import{t as H}from"./p-eeabbeed.js";import{e as q,a as J}from"./p-ab98ab7b.js";import{a as Q}from"./p-308f51a0.js";import{f as K,c as V,l as X}from"./p-c5a78206.js";import{t as Z}from"./p-9e2b7d7c.js";import{e as Y}from"./p-713517a8.js";const nn="GET_PAGES_CONTENT_SUCCESS",tn=()=>n=>(n(e("GET_PAGES_CONTENT_REQUEST")()),(()=>{const n=u.injector().tokenService.userAuthToken;return Amplify.configure({API:{graphql_headers:async()=>({Authorization:"Bearer "+n,SiteName:"Resourceville"})}}),Amplify.API.graphql(Amplify.graphqlOperation(o)).then(n=>(n.data.listPages.forEach(n=>{n.id=n.path.substr(1),n.id.length||(n.id="home"),n.details=JSON.parse(n.details)}),{items:n.data.listPages}))})().then(t=>{const r=f(t,s);var o;return n((o=r,e("GET_PAGES_CONTENT_SUCCESS")(o))),t}).catch(t=>{throw n((n=>e("GET_PAGES_CONTENT_ERROR")(n))(t)),t})),rn="GET_AUTHORIZED_DATA_SUCCESS",en="GET_NAVIGATION_MENUS_LIST_SUCCESS";var on=n((function(n){ /*! localForage -- Offline Storage, Improved Version 1.7.3 https://localforage.github.io/localForage (c) 2013-2017 Mozilla, Apache License 2.0 */ n.exports=function n(t,e,o){function i(u,f){if(!e[u]){if(!t[u]){var c="function"==typeof r&&r;if(!f&&c)return c(u,!0);if(a)return a(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=e[u]={exports:{}};t[u][0].call(l.exports,(function(n){return i(t[u][1][n]||n)}),l,l.exports,n,t,e,o)}return e[u].exports}for(var a="function"==typeof r&&r,u=0;u<o.length;u++)i(o[u]);return i}({1:[function(n,r){(function(n){var t,e,o=n.MutationObserver||n.WebKitMutationObserver;if(o){var i=0,a=new o(s),u=n.document.createTextNode("");a.observe(u,{characterData:!0}),t=function(){u.data=i=++i%2}}else if(n.setImmediate||void 0===n.MessageChannel)t="document"in n&&"onreadystatechange"in n.document.createElement("script")?function(){var t=n.document.createElement("script");t.onreadystatechange=function(){s(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},n.document.documentElement.appendChild(t)}:function(){setTimeout(s,0)};else{var f=new n.MessageChannel;f.port1.onmessage=s,t=function(){f.port2.postMessage(0)}}var c=[];function s(){var n,t;e=!0;for(var r=c.length;r;){for(t=c,c=[],n=-1;++n<r;)t[n]();r=c.length}e=!1}r.exports=function(n){1!==c.push(n)||e||t()}}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(n,t){var r=n(1);function e(){}var o={},i=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function f(n){if("function"!=typeof n)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,n!==e&&v(this,n)}function c(n,t,r){this.promise=n,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function s(n,t,e){r((function(){var r;try{r=t(e)}catch(i){return o.reject(n,i)}r===n?o.reject(n,new TypeError("Cannot resolve promise with itself")):o.resolve(n,r)}))}function l(n){var t=n&&n.then;if(n&&("object"==typeof n||"function"==typeof n)&&"function"==typeof t)return function(){t.apply(n,arguments)}}function v(n,t){var r=!1;function e(t){r||(r=!0,o.reject(n,t))}function i(t){r||(r=!0,o.resolve(n,t))}var a=d((function(){t(i,e)}));"error"===a.status&&e(a.value)}function d(n,t){var r={};try{r.value=n(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}t.exports=f,f.prototype.catch=function(n){return this.then(null,n)},f.prototype.then=function(n,t){if("function"!=typeof n&&this.state===a||"function"!=typeof t&&this.state===i)return this;var r=new this.constructor(e);return this.state!==u?s(r,this.state===a?n:t,this.outcome):this.queue.push(new c(r,n,t)),r},c.prototype.callFulfilled=function(n){o.resolve(this.promise,n)},c.prototype.otherCallFulfilled=function(n){s(this.promise,this.onFulfilled,n)},c.prototype.callRejected=function(n){o.reject(this.promise,n)},c.prototype.otherCallRejected=function(n){s(this.promise,this.onRejected,n)},o.resolve=function(n,t){var r=d(l,t);if("error"===r.status)return o.reject(n,r.value);var e=r.value;if(e)v(n,e);else{n.state=a,n.outcome=t;for(var i=-1,u=n.queue.length;++i<u;)n.queue[i].callFulfilled(t)}return n},o.reject=function(n,t){n.state=i,n.outcome=t;for(var r=-1,e=n.queue.length;++r<e;)n.queue[r].callRejected(t);return n},f.resolve=function(n){return n instanceof this?n:o.resolve(new this(e),n)},f.reject=function(n){var t=new this(e);return o.reject(t,n)},f.all=function(n){var t=this;if("[object Array]"!==Object.prototype.toString.call(n))return this.reject(new TypeError("must be an array"));var r=n.length,i=!1;if(!r)return this.resolve([]);for(var a=new Array(r),u=0,f=-1,c=new this(e);++f<r;)s(n[f],f);return c;function s(n,e){t.resolve(n).then((function(n){a[e]=n,++u!==r||i||(i=!0,o.resolve(c,a))}),(function(n){i||(i=!0,o.reject(c,n))}))}},f.race=function(n){if("[object Array]"!==Object.prototype.toString.call(n))return this.reject(new TypeError("must be an array"));var t=n.length,r=!1;if(!t)return this.resolve([]);for(var i=-1,a=new this(e);++i<t;)this.resolve(n[i]).then((function(n){r||(r=!0,o.resolve(a,n))}),(function(n){r||(r=!0,o.reject(a,n))}));return a}},{1:1}],3:[function(n){(function(t){"function"!=typeof t.Promise&&(t.Promise=n(2))}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(n,t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(n){return}}();function o(n,t){n=n||[],t=t||{};try{return new Blob(n,t)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),e=0;e<n.length;e+=1)r.append(n[e]);return r.getBlob(t.type)}}"undefined"==typeof Promise&&n(3);var i=Promise;function a(n,t){t&&n.then((function(n){t(null,n)}),(function(n){t(n)}))}function u(n,t,r){"function"==typeof t&&n.then(t),"function"==typeof r&&n.catch(r)}function f(n){return"string"!=typeof n&&(console.warn(n+" used as a key, but it is not a string."),n=String(n)),n}function c(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var s=void 0,l={},v=Object.prototype.toString;function d(n){var t=l[n.name],r={};r.promise=new i((function(n,t){r.resolve=n,r.reject=t})),t.deferredOperations.push(r),t.dbReady=t.dbReady?t.dbReady.then((function(){return r.promise})):r.promise}function h(n){var t=l[n.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function p(n,t){var r=l[n.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function y(n,t){return new i((function(r,o){if(l[n.name]=l[n.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},n.db){if(!t)return r(n.db);d(n),n.db.close()}var i=[n.name];t&&i.push(n.version);var a=e.open.apply(e,i);t&&(a.onupgradeneeded=function(t){var r=a.result;try{r.createObjectStore(n.storeName),t.oldVersion<=1&&r.createObjectStore("local-forage-detect-blob-support")}catch(e){if("ConstraintError"!==e.name)throw e;console.warn('The database "'+n.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+n.storeName+'" already exists.')}}),a.onerror=function(n){n.preventDefault(),o(a.error)},a.onsuccess=function(){r(a.result),h(n)}}))}function m(n){return y(n,!1)}function b(n){return y(n,!0)}function w(n,t){if(!n.db)return!0;var r=!n.db.objectStoreNames.contains(n.storeName),e=n.version>n.db.version;if(n.version<n.db.version&&(n.version!==t&&console.warn('The database "'+n.name+"\" can't be downgraded from version "+n.db.version+" to version "+n.version+"."),n.version=n.db.version),e||r){if(r){var o=n.db.version+1;o>n.version&&(n.version=o)}return!0}return!1}function E(n){return o([function(n){for(var t=n.length,r=new ArrayBuffer(t),e=new Uint8Array(r),o=0;o<t;o++)e[o]=n.charCodeAt(o);return r}(atob(n.data))],{type:n.type})}function S(n){return n&&n.__local_forage_encoded_blob}function _(n){var t=this,r=t._initReady().then((function(){var n=l[t._dbInfo.name];if(n&&n.dbReady)return n.dbReady}));return u(r,n,n),r}function g(n,t,r,e){void 0===e&&(e=1);try{var o=n.db.transaction(n.storeName,t);r(null,o)}catch(a){if(e>0&&(!n.db||"InvalidStateError"===a.name||"NotFoundError"===a.name))return i.resolve().then((function(){if(!n.db||"NotFoundError"===a.name&&!n.db.objectStoreNames.contains(n.storeName)&&n.version<=n.db.version)return n.db&&(n.version=n.db.version+1),b(n)})).then((function(){return function(n){d(n);for(var t=l[n.name],r=t.forages,e=0;e<r.length;e++){var o=r[e];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return n.db=null,m(n).then((function(t){return n.db=t,w(n)?b(n):t})).then((function(e){n.db=t.db=e;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=e})).catch((function(t){throw p(n,t),t}))}(n).then((function(){g(n,t,r,e-1)}))})).catch(r);r(a)}}var A={_driver:"asyncStorage",_initStorage:function(n){var t=this,r={db:null};if(n)for(var e in n)r[e]=n[e];var o=l[r.name];o||(l[r.name]=o={forages:[],db:null,dbReady:null,deferredOperations:[]}),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=_);var a=[];function u(){return i.resolve()}for(var f=0;f<o.forages.length;f++){var c=o.forages[f];c!==t&&a.push(c._initReady().catch(u))}var s=o.forages.slice(0);return i.all(a).then((function(){return r.db=o.db,m(r)})).then((function(n){return r.db=n,w(r,t._defaultConfig.version)?b(r):n})).then((function(n){r.db=o.db=n,t._dbInfo=r;for(var e=0;e<s.length;e++){var i=s[e];i!==t&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}}))},_support:function(){try{if(!e)return!1;var n="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!n||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(r){return!1}}(),iterate:function(n,t){var r=this,e=new i((function(t,e){r.ready().then((function(){g(r._dbInfo,"readonly",(function(o,i){if(o)return e(o);try{var a=i.objectStore(r._dbInfo.storeName).openCursor(),u=1;a.onsuccess=function(){var r=a.result;if(r){var e=r.value;S(e)&&(e=E(e));var o=n(e,r.key,u++);void 0!==o?t(o):r.continue()}else t()},a.onerror=function(){e(a.error)}}catch(f){e(f)}}))})).catch(e)}));return a(e,t),e},getItem:function(n,t){var r=this;n=f(n);var e=new i((function(t,e){r.ready().then((function(){g(r._dbInfo,"readonly",(function(o,i){if(o)return e(o);try{var a=i.objectStore(r._dbInfo.storeName).get(n);a.onsuccess=function(){var n=a.result;void 0===n&&(n=null),S(n)&&(n=E(n)),t(n)},a.onerror=function(){e(a.error)}}catch(u){e(u)}}))})).catch(e)}));return a(e,t),e},setItem:function(n,t,r){var e=this;n=f(n);var u=new i((function(r,a){var u;e.ready().then((function(){return u=e._dbInfo,"[object Blob]"===v.call(t)?function(n){return"boolean"==typeof s?i.resolve(s):function(n){return new i((function(t){var r=n.transaction("local-forage-detect-blob-support","readwrite"),e=o([""]);r.objectStore("local-forage-detect-blob-support").put(e,"key"),r.onabort=function(n){n.preventDefault(),n.stopPropagation(),t(!1)},r.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!n||parseInt(n[1],10)>=43)}})).catch((function(){return!1}))}(n).then((function(n){return s=n}))}(u.db).then((function(n){return n?t:(r=t,new i((function(n,t){var e=new FileReader;e.onerror=t,e.onloadend=function(t){var e=btoa(t.target.result||"");n({__local_forage_encoded_blob:!0,data:e,type:r.type})},e.readAsBinaryString(r)})));var r})):t})).then((function(t){g(e._dbInfo,"readwrite",(function(o,i){if(o)return a(o);try{var u=i.objectStore(e._dbInfo.storeName);null===t&&(t=void 0);var f=u.put(t,n);i.oncomplete=function(){void 0===t&&(t=null),r(t)},i.onabort=i.onerror=function(){a(f.error?f.error:f.transaction.error)}}catch(c){a(c)}}))})).catch(a)}));return a(u,r),u},removeItem:function(n,t){var r=this;n=f(n);var e=new i((function(t,e){r.ready().then((function(){g(r._dbInfo,"readwrite",(function(o,i){if(o)return e(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(n);i.oncomplete=function(){t()},i.onerror=function(){e(a.error)},i.onabort=function(){e(a.error?a.error:a.transaction.error)}}catch(u){e(u)}}))})).catch(e)}));return a(e,t),e},clear:function(n){var t=this,r=new i((function(n,r){t.ready().then((function(){g(t._dbInfo,"readwrite",(function(e,o){if(e)return r(e);try{var i=o.objectStore(t._dbInfo.storeName).clear();o.oncomplete=function(){n()},o.onabort=o.onerror=function(){r(i.error?i.error:i.transaction.error)}}catch(a){r(a)}}))})).catch(r)}));return a(r,n),r},length:function(n){var t=this,r=new i((function(n,r){t.ready().then((function(){g(t._dbInfo,"readonly",(function(e,o){if(e)return r(e);try{var i=o.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){n(i.result)},i.onerror=function(){r(i.error)}}catch(a){r(a)}}))})).catch(r)}));return a(r,n),r},key:function(n,t){var r=this,e=new i((function(t,e){n<0?t(null):r.ready().then((function(){g(r._dbInfo,"readonly",(function(o,i){if(o)return e(o);try{var a=i.objectStore(r._dbInfo.storeName),u=!1,f=a.openCursor();f.onsuccess=function(){var r=f.result;r?0===n||u?t(r.key):(u=!0,r.advance(n)):t(null)},f.onerror=function(){e(f.error)}}catch(c){e(c)}}))})).catch(e)}));return a(e,t),e},keys:function(n){var t=this,r=new i((function(n,r){t.ready().then((function(){g(t._dbInfo,"readonly",(function(e,o){if(e)return r(e);try{var i=o.objectStore(t._dbInfo.storeName).openCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):n(a)},i.onerror=function(){r(i.error)}}catch(u){r(u)}}))})).catch(r)}));return a(r,n),r},dropInstance:function(n,t){t=c.apply(this,arguments);var r=this.config();(n="function"!=typeof n&&n||{}).name||(n.name=n.name||r.name,n.storeName=n.storeName||r.storeName);var o,u=this;if(n.name){var f=n.name===r.name&&u._dbInfo.db,s=f?i.resolve(u._dbInfo.db):m(n).then((function(t){var r=l[n.name],e=r.forages;r.db=t;for(var o=0;o<e.length;o++)e[o]._dbInfo.db=t;return t}));o=s.then(n.storeName?function(t){if(t.objectStoreNames.contains(n.storeName)){var r=t.version+1;d(n);var o=l[n.name],a=o.forages;t.close();for(var u=0;u<a.length;u++){var f=a[u];f._dbInfo.db=null,f._dbInfo.version=r}return new i((function(t,o){var i=e.open(n.name,r);i.onerror=function(n){i.result.close(),o(n)},i.onupgradeneeded=function(){i.result.deleteObjectStore(n.storeName)},i.onsuccess=function(){var n=i.result;n.close(),t(n)}})).then((function(n){o.db=n;for(var t=0;t<a.length;t++){var r=a[t];r._dbInfo.db=n,h(r._dbInfo)}})).catch((function(t){throw(p(n,t)||i.resolve()).catch((function(){})),t}))}}:function(t){d(n);var r=l[n.name],o=r.forages;t.close();for(var a=0;a<o.length;a++)o[a]._dbInfo.db=null;return new i((function(t,r){var o=e.deleteDatabase(n.name);o.onerror=o.onblocked=function(n){var t=o.result;t&&t.close(),r(n)},o.onsuccess=function(){var n=o.result;n&&n.close(),t(n)}})).then((function(n){r.db=n;for(var t=0;t<o.length;t++)h(o[t]._dbInfo)})).catch((function(t){throw(p(n,t)||i.resolve()).catch((function(){})),t}))})}else o=i.reject("Invalid arguments");return a(o,t),o}},T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=/^~~local_forage_type~([^~]+)~/,N="__lfsc__:".length,R=N+"arbf".length,L=Object.prototype.toString;function D(n){var t,r,e,o,i,a=.75*n.length,u=n.length,f=0;"="===n[n.length-1]&&(a--,"="===n[n.length-2]&&a--);var c=new ArrayBuffer(a),s=new Uint8Array(c);for(t=0;t<u;t+=4)r=T.indexOf(n[t]),e=T.indexOf(n[t+1]),o=T.indexOf(n[t+2]),i=T.indexOf(n[t+3]),s[f++]=r<<2|e>>4,s[f++]=(15&e)<<4|o>>2,s[f++]=(3&o)<<6|63&i;return c}function O(n){var t,r=new Uint8Array(n),e="";for(t=0;t<r.length;t+=3)e+=T[r[t]>>2],e+=T[(3&r[t])<<4|r[t+1]>>4],e+=T[(15&r[t+1])<<2|r[t+2]>>6],e+=T[63&r[t+2]];return r.length%3==2?e=e.substring(0,e.length-1)+"=":r.length%3==1&&(e=e.substring(0,e.length-2)+"=="),e}var B={serialize:function(n,t){var r="";if(n&&(r=L.call(n)),n&&("[object ArrayBuffer]"===r||n.buffer&&"[object ArrayBuffer]"===L.call(n.buffer))){var e,o="__lfsc__:";n instanceof ArrayBuffer?(e=n,o+="arbf"):(e=n.buffer,"[object Int8Array]"===r?o+="si08":"[object Uint8Array]"===r?o+="ui08":"[object Uint8ClampedArray]"===r?o+="uic8":"[object Int16Array]"===r?o+="si16":"[object Uint16Array]"===r?o+="ur16":"[object Int32Array]"===r?o+="si32":"[object Uint32Array]"===r?o+="ui32":"[object Float32Array]"===r?o+="fl32":"[object Float64Array]"===r?o+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(o+O(e))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r="~~local_forage_type~"+n.type+"~"+O(this.result);t("__lfsc__:blob"+r)},i.readAsArrayBuffer(n)}else try{t(JSON.stringify(n))}catch(a){console.error("Couldn't convert value into a JSON string: ",n),t(null,a)}},deserialize:function(n){if("__lfsc__:"!==n.substring(0,N))return JSON.parse(n);var t,r=n.substring(R),e=n.substring(N,R);if("blob"===e&&I.test(r)){var i=r.match(I);t=i[1],r=r.substring(i[0].length)}var a=D(r);switch(e){case"arbf":return a;case"blob":return o([a],{type:t});case"si08":return new Int8Array(a);case"ui08":return new Uint8Array(a);case"uic8":return new Uint8ClampedArray(a);case"si16":return new Int16Array(a);case"ur16":return new Uint16Array(a);case"si32":return new Int32Array(a);case"ui32":return new Uint32Array(a);case"fl32":return new Float32Array(a);case"fl64":return new Float64Array(a);default:throw new Error("Unkown type: "+e)}},stringToBuffer:D,bufferToString:O};function j(n,t,r,e){n.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,e)}function C(n,t,r,e,o,i){n.executeSql(r,e,o,(function(n,a){a.code===a.SYNTAX_ERR?n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(n,u){u.rows.length?i(n,a):j(n,t,(function(){n.executeSql(r,e,o,i)}),i)}),i):i(n,a)}),i)}function U(n,t,r,e){var o=this;n=f(n);var u=new i((function(i,a){o.ready().then((function(){void 0===t&&(t=null);var u=t,f=o._dbInfo;f.serializer.serialize(t,(function(t,c){c?a(c):f.db.transaction((function(r){C(r,f,"INSERT OR REPLACE INTO "+f.storeName+" (key, value) VALUES (?, ?)",[n,t],(function(){i(u)}),(function(n,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(e>0)return void i(U.apply(o,[n,u,r,e-1]));a(t)}}))}))})).catch(a)}));return a(u,r),u}function k(n){return new i((function(t,r){n.transaction((function(e){e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,e){for(var o=[],i=0;i<e.rows.length;i++)o.push(e.rows.item(i).name);t({db:n,storeNames:o})}),(function(n,t){r(t)}))}),(function(n){r(n)}))}))}var F={_driver:"webSQLStorage",_initStorage:function(n){var t=this,r={db:null};if(n)for(var e in n)r[e]="string"!=typeof n[e]?n[e].toString():n[e];var o=new i((function(n,e){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(o){return e(o)}r.db.transaction((function(o){j(o,r,(function(){t._dbInfo=r,n()}),(function(n,t){e(t)}))}),e)}));return r.serializer=B,o},_support:"function"==typeof openDatabase,iterate:function(n,t){var r=this,e=new i((function(t,e){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){C(r,o,"SELECT * FROM "+o.storeName,[],(function(r,e){for(var i=e.rows,a=i.length,u=0;u<a;u++){var f=i.item(u),c=f.value;if(c&&(c=o.serializer.deserialize(c)),void 0!==(c=n(c,f.key,u+1)))return void t(c)}t()}),(function(n,t){e(t)}))}))})).catch(e)}));return a(e,t),e},getItem:function(n,t){var r=this;n=f(n);var e=new i((function(t,e){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){C(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[n],(function(n,r){var e=r.rows.length?r.rows.item(0).value:null;e&&(e=o.serializer.deserialize(e)),t(e)}),(function(n,t){e(t)}))}))})).catch(e)}));return a(e,t),e},setItem:function(n,t,r){return U.apply(this,[n,t,r,1])},removeItem:function(n,t){var r=this;n=f(n);var e=new i((function(t,e){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){C(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[n],(function(){t()}),(function(n,t){e(t)}))}))})).catch(e)}));return a(e,t),e},clear:function(n){var t=this,r=new i((function(n,r){t.ready().then((function(){var e=t._dbInfo;e.db.transaction((function(t){C(t,e,"DELETE FROM "+e.storeName,[],(function(){n()}),(function(n,t){r(t)}))}))})).catch(r)}));return a(r,n),r},length:function(n){var t=this,r=new i((function(n,r){t.ready().then((function(){var e=t._dbInfo;e.db.transaction((function(t){C(t,e,"SELECT COUNT(key) as c FROM "+e.storeName,[],(function(t,r){var e=r.rows.item(0).c;n(e)}),(function(n,t){r(t)}))}))})).catch(r)}));return a(r,n),r},key:function(n,t){var r=this,e=new i((function(t,e){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){C(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[n+1],(function(n,r){var e=r.rows.length?r.rows.item(0).key:null;t(e)}),(function(n,t){e(t)}))}))})).catch(e)}));return a(e,t),e},keys:function(n){var t=this,r=new i((function(n,r){t.ready().then((function(){var e=t._dbInfo;e.db.transaction((function(t){C(t,e,"SELECT key FROM "+e.storeName,[],(function(t,r){for(var e=[],o=0;o<r.rows.length;o++)e.push(r.rows.item(o).key);n(e)}),(function(n,t){r(t)}))}))})).catch(r)}));return a(r,n),r},dropInstance:function(n,t){t=c.apply(this,arguments);var r=this.config();(n="function"!=typeof n&&n||{}).name||(n.name=n.name||r.name,n.storeName=n.storeName||r.storeName);var e,o=this;return a(e=n.name?new i((function(t){var e;e=n.name===r.name?o._dbInfo.db:openDatabase(n.name,"","",0),t(n.storeName?{db:e,storeNames:[n.storeName]}:k(e))})).then((function(n){return new i((function(t,r){n.db.transaction((function(e){function o(n){return new i((function(t,r){e.executeSql("DROP TABLE IF EXISTS "+n,[],(function(){t()}),(function(n,t){r(t)}))}))}for(var a=[],u=0,f=n.storeNames.length;u<f;u++)a.push(o(n.storeNames[u]));i.all(a).then((function(){t()})).catch((function(n){r(n)}))}),(function(n){r(n)}))}))})):i.reject("Invalid arguments"),t),e}};function M(n,t){var r=n.name+"/";return n.storeName!==t.storeName&&(r+=n.storeName+"/"),r}var G={_driver:"localStorageWrapper",_initStorage:function(n){var t={};if(n)for(var r in n)t[r]=n[r];return t.keyPrefix=M(n,this._defaultConfig),!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(n){return!0}}()||localStorage.length>0?(this._dbInfo=t,t.serializer=B,i.resolve()):i.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(n){return!1}}(),iterate:function(n,t){var r=this,e=r.ready().then((function(){for(var t=r._dbInfo,e=t.keyPrefix,o=e.length,i=localStorage.length,a=1,u=0;u<i;u++){var f=localStorage.key(u);if(0===f.indexOf(e)){var c=localStorage.getItem(f);if(c&&(c=t.serializer.deserialize(c)),void 0!==(c=n(c,f.substring(o),a++)))return c}}}));return a(e,t),e},getItem:function(n,t){var r=this;n=f(n);var e=r.ready().then((function(){var t=r._dbInfo,e=localStorage.getItem(t.keyPrefix+n);return e&&(e=t.serializer.deserialize(e)),e}));return a(e,t),e},setItem:function(n,t,r){var e=this;n=f(n);var o=e.ready().then((function(){void 0===t&&(t=null);var r=t;return new i((function(o,i){var a=e._dbInfo;a.serializer.serialize(t,(function(t,e){if(e)i(e);else try{localStorage.setItem(a.keyPrefix+n,t),o(r)}catch(u){"QuotaExceededError"!==u.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==u.name||i(u),i(u)}}))}))}));return a(o,r),o},removeItem:function(n,t){var r=this;n=f(n);var e=r.ready().then((function(){localStorage.removeItem(r._dbInfo.keyPrefix+n)}));return a(e,t),e},clear:function(n){var t=this,r=t.ready().then((function(){for(var n=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var e=localStorage.key(r);0===e.indexOf(n)&&localStorage.removeItem(e)}}));return a(r,n),r},length:function(n){var t=this.keys().then((function(n){return n.length}));return a(t,n),t},key:function(n,t){var r=this,e=r.ready().then((function(){var t,e=r._dbInfo;try{t=localStorage.key(n)}catch(o){t=null}return t&&(t=t.substring(e.keyPrefix.length)),t}));return a(e,t),e},keys:function(n){var t=this,r=t.ready().then((function(){for(var n=t._dbInfo,r=localStorage.length,e=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(n.keyPrefix)&&e.push(i.substring(n.keyPrefix.length))}return e}));return a(r,n),r},dropInstance:function(n,t){if(t=c.apply(this,arguments),!(n="function"!=typeof n&&n||{}).name){var r=this.config();n.name=n.name||r.name,n.storeName=n.storeName||r.storeName}var e,o=this;return a(e=n.name?new i((function(t){t(n.storeName?M(n,o._defaultConfig):n.name+"/")})).then((function(n){for(var t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(n)&&localStorage.removeItem(r)}})):i.reject("Invalid arguments"),t),e}},P=function(n,t){for(var r,e,o=n.length,i=0;i<o;){if((r=n[i])===(e=t)||"number"==typeof r&&"number"==typeof e&&isNaN(r)&&isNaN(e))return!0;i++}return!1},x=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},z={},W={},H={INDEXEDDB:A,WEBSQL:F,LOCALSTORAGE:G},q=[H.INDEXEDDB._driver,H.WEBSQL._driver,H.LOCALSTORAGE._driver],J=["dropInstance"],Q=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(J),K={description:"",driver:q.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function V(n,t){n[t]=function(){var r=arguments;return n.ready().then((function(){return n[t].apply(n,r)}))}}function X(){for(var n=1;n<arguments.length;n++){var t=arguments[n];if(t)for(var r in t)t.hasOwnProperty(r)&&(arguments[0][r]=x(t[r])?t[r].slice():t[r])}return arguments[0]}var Z=new(function(){function n(t){for(var r in function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),H)if(H.hasOwnProperty(r)){var e=H[r],o=e._driver;this[r]=o,z[o]||this.defineDriver(e)}this._defaultConfig=X({},K),this._config=X({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return n.prototype.config=function(n){if("object"===(void 0===n?"undefined":r(n))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in n){if("storeName"===t&&(n[t]=n[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof n[t])return new Error("Database version must be a number.");this._config[t]=n[t]}return!("driver"in n)||!n.driver||this.setDriver(this._config.driver)}return"string"==typeof n?this._config[n]:this._config},n.prototype.defineDriver=function(n,t,r){var e=new i((function(t,r){try{var e=n._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!n._driver)return void r(o);for(var u=Q.concat("_initStorage"),f=0,c=u.length;f<c;f++){var s=u[f];if((!P(J,s)||n[s])&&"function"!=typeof n[s])return void r(o)}!function(){for(var t=function(n){return function(){var t=new Error("Method "+n+" is not implemented by the current driver"),r=i.reject(t);return a(r,arguments[arguments.length-1]),r}},r=0,e=J.length;r<e;r++){var o=J[r];n[o]||(n[o]=t(o))}}();var l=function(r){z[e]&&console.info("Redefining LocalForage driver: "+e),z[e]=n,W[e]=r,t()};"_support"in n?n._support&&"function"==typeof n._support?n._support().then(l,r):l(!!n._support):l(!0)}catch(v){r(v)}}));return u(e,t,r),e},n.prototype.driver=function(){return this._driver||null},n.prototype.getDriver=function(n,t,r){var e=z[n]?i.resolve(z[n]):i.reject(new Error("Driver not found."));return u(e,t,r),e},n.prototype.getSerializer=function(n){var t=i.resolve(B);return u(t,n),t},n.prototype.ready=function(n){var t=this,r=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return u(r,n,n),r},n.prototype.setDriver=function(n,t,r){var e=this;x(n)||(n=[n]);var o=this._getSupportedDrivers(n);function a(){e._config.driver=e.driver()}function f(n){return e._extend(n),a(),e._ready=e._initStorage(e._config),e._ready}var c=null!==this._driverSet?this._driverSet.catch((function(){return i.resolve()})):i.resolve();return this._driverSet=c.then((function(){var n=o[0];return e._dbInfo=null,e._ready=null,e.getDriver(n).then((function(n){e._driver=n._driver,a(),e._wrapLibraryMethodsWithReady(),e._initDriver=function(n){return function(){var t=0;return function r(){for(;t<n.length;){var o=n[t];return t++,e._dbInfo=null,e._ready=null,e.getDriver(o).then(f).catch(r)}a();var u=new Error("No available storage method found.");return e._driverSet=i.reject(u),e._driverSet}()}}(o)}))})).catch((function(){a();var n=new Error("No available storage method found.");return e._driverSet=i.reject(n),e._driverSet})),u(this._driverSet,t,r),this._driverSet},n.prototype.supports=function(n){return!!W[n]},n.prototype._extend=function(n){X(this,n)},n.prototype._getSupportedDrivers=function(n){for(var t=[],r=0,e=n.length;r<e;r++){var o=n[r];this.supports(o)&&t.push(o)}return t},n.prototype._wrapLibraryMethodsWithReady=function(){for(var n=0,t=Q.length;n<t;n++)V(this,Q[n])},n.prototype.createInstance=function(t){return new n(t)},n}());t.exports=Z},{3:3}]},{},[4])(4)}));const an={operationsList:{items:[new c.Entity("operations")]},toDosList:H,toDoSubmissionsList:Z,eventsList:q,eventTypesList:J,announcementsList:Q,forumTopicsList:K,usersList:z,commentsList:V,likesList:X,eventFollowUpSubmissionsList:Y};let un;un={apiKey:"AIzaSyAEfWLUiJQxspkSK1j_XvM01pJzH_ADiDI",authDomain:"resourceville-com.firebaseapp.com",databaseURL:"https://resourceville-com.firebaseio.com",projectId:"resourceville-com",storageBucket:"resourceville-com.appspot.com",messagingSenderId:"482640812130",appId:"1:482640812130:web:9e9181c6e9b34b3e22993b",measurementId:"G-97M9J5V38K"};const fn=window.firebase&&!window.firebase.apps.length?window.firebase.initializeApp(un):window.firebase,cn=n=>{const t=u.injector().tokenService.userAuthToken;return Amplify.configure({API:{graphql_headers:async()=>({Authorization:"Bearer "+t,SiteName:"Resourceville"})}}),Amplify.API.graphql(Amplify.graphqlOperation(P,{token:n})).then(()=>null)},sn=()=>on.getItem("pushNotificationsRejection").then(n=>(console.log("timestamp",n),!n||Date.now()-n>2592e6)),ln=()=>{$.fancybox.close()},vn=()=>{navigator.serviceWorker.ready.then(()=>{$.fancybox.open({src:"#push-notifications-modal",type:"inline"})})},dn=()=>on.setItem("pushNotificationsRejection",Date.now()),hn=()=>{if("Notification"in window&&"serviceWorker"in navigator)try{if(fn){const n=fn.messaging();navigator.serviceWorker.ready.then(t=>{n.useServiceWorker(t),Notification.requestPermission().then(t=>{"granted"===t&&n.getToken().then(n=>{cn(n).then(()=>{}).catch(n=>{console.error("saveFcmToken error",n)})}).catch(n=>{console.log("getToken() error",n)})}).catch(n=>{console.log("Notification permissions error "+n)}),n.onTokenRefresh(()=>{n.getToken().then(n=>cn(n)).catch(n=>{console.log("push notifications is blocked",n)})})})}}catch(n){console.log("push notifications not supported")}else console.log("Push Notifications are not supported")},pn=new c.Entity("navigationMenus",{},{idAttribute:"name"}),yn={items:[pn]},mn=()=>n=>(n(e("GET_NAVIGATION_MENUS_LIST_REQUEST")()),(()=>{const n=u.injector().tokenService.userAuthToken;return Amplify.configure({API:{graphql_headers:async()=>({Authorization:"Bearer "+n,SiteName:"Resourceville"})}}),Amplify.API.graphql(Amplify.graphqlOperation(a)).then(n=>({items:n.data.listMenus}))})().then(t=>{const r=f(t,yn);var o;return n((o=r,e("GET_NAVIGATION_MENUS_LIST_SUCCESS")(o))),t}).catch(t=>{throw n((n=>e("GET_NAVIGATION_MENUS_LIST_ERROR")(n))(t)),t})),bn=n=>t=>(t(e(g)()),A(n).then(()=>{t(e(T)())}).catch(n=>{throw t((n=>e(I)(n))(n)),n})),wn=()=>e(N)(),En=n=>e(L)(n),Sn=n=>e(D)(n),_n=n=>t=>(t(wn()),O(n).then(()=>x()).then(n=>{const r=f(n,W);return t(En(r)),t(tn()),"undefined"!=typeof Notification&&("granted"===Notification.permission?hn():"default"===Notification.permission&&sn().then(n=>{n&&vn()})),t(mn()),n}).catch(n=>{throw t(Sn(n)),n})),gn=n=>t=>(t(wn()),R(n).then(n=>{const r=f(n,W);return t(En(r)),t(n=>(n(e("GET_AUTHORIZED_DATA_REQUEST")()),(()=>{const n=u.injector().tokenService.userAuthToken;return Amplify.configure({API:{graphql_headers:async()=>({Authorization:"Bearer "+n,SiteName:"Resourceville"})}}),Amplify.API.graphql(Amplify.graphqlOperation(i)).then(n=>({operationsList:{items:n.data.listOperations},toDosList:{items:[]},pagesList:{items:n.data.listPages},toDoSubmissionsList:{items:[]},eventsList:{items:[]},eventTypesList:{items:[]},announcementsList:{items:[]},forumTopicsList:{items:[]},usersList:{items:[]},commentsList:{items:[]},likesList:{items:[]},eventFollowUpSubmissionsList:{items:[]}}))})().then(t=>{const r=f(t,an);var o;return n((o=r,e("GET_AUTHORIZED_DATA_SUCCESS")(o))),t}).catch(t=>{throw n((n=>e("GET_AUTHORIZED_DATA_ERROR")(n))(t)),t}))),"undefined"!=typeof Notification&&("granted"===Notification.permission?hn():"default"===Notification.permission&&sn().then(n=>{n&&vn()})),t(mn()),n}).catch(n=>{throw t(Sn(n)),n})),An=n=>e(d)(n),Tn=()=>n=>(n(e(l)()),v().then(t=>{if(t){const r=f(t,W);n(An(r))}else n(An(null));return t}).catch(t=>{throw n((n=>e(h)(n))(t)),t})),In=n=>t=>(t(e(w)()),E(n).then(()=>{t(e(S)())}).catch(n=>{throw t((n=>e(_)(n))(n)),n})),Nn=(n,t,r)=>o=>(o(e(k)()),F(n,t,r).then(()=>{o(e(M)())}).catch(n=>{throw o((n=>e(G)(n))(n)),n})),Rn=()=>n=>(n(e(p)()),y().then(()=>{n(e(m)()),n(tn()),n(mn())}).catch(t=>{throw n((n=>e(b)(n))(t)),t})),Ln=n=>t=>(t(e(B)()),j(n).then(n=>(t(e(C)()),n)).catch(n=>{throw t((n=>e(U)(n))(n)),n}));export{nn as G,rn as a,en as b,Rn as c,mn as d,hn as e,vn as f,tn as g,ln as h,Tn as i,In as j,bn as k,on as l,gn as m,_n as n,Nn as o,pn as p,dn as r,sn as s,Ln as u}