@htmlguyllc/jpack
Advanced tools
Comparing version 9.0.9 to 9.0.10
@@ -1,2 +0,2 @@ | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=22)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t,e,n){var r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t,e){e=void 0!==e&&e;var n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t,e){var n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e,n){if("string"!=typeof e)throw"".concat(e," is not a string");var r=this.getElement(t);if(!t){if(n)throw'Could not find "'.concat(t,'"');return null}var o=(new DOMParser).parseFromString(e,"text/html");return o=r.parentNode.insertBefore(o.documentElement.querySelector("body").childNodes[0],r),r.remove(),o},isVisible(t,e,n){if(null===(t=this.getElement(t,e,n))){if(e)throw'Could not find "'.concat(t,'"');return!1}var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var o=t.getBoundingClientRect(),i={"top-left":{x:o.left,y:o.top},"top-right":{x:o.right,y:o.top},"bottom-left":{x:o.left,y:o.bottom},"bottom-right":{x:o.right,y:o.bottom},center:{x:o.left+t.offsetWidth/2,y:o.top+t.offsetHeight/2}},s=!0;return Object.keys(i).forEach(function(t){var e=i[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";var r=n(11),o=n(24),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return a(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n(5),o=n.n(r),i=n(0),s=n(6),a={storeHistory:!0,getHistory:function(){return this._history},getLastHistoryRecord(){return this._history.pop()},_addHistoryItem(t,e){return!!this._storeHistory&&(this._history.push({url:t,route:e}),this)},_history:[],setData:function(t){if("object"!=typeof t||null===t)throw"".concat(t," is not an object");return this._data=t,this},getData:function(){return this._data},setDataItem:function(t,e){if("string"!=typeof t)throw"".concat(t," is not a string");return this._data[t]=e,this},getDataItem:function(t){return void 0!==this._data[t]?this._data[t]:null},clearData:function(){return this.setData({}),this},clearDataItem:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");return void 0!==this._data[t]&&delete this._data[t],this},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._incomingElementSelector=t},_incomingElementSelector:"body",getIncomingElement:function(){return this._incomingElementSelector},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._replaceElementSelector=t},_replaceElementSelector:"body",getReplaceElement:function(){return this._replaceElementSelector},load:function(t,e,n,r,i){var s=this;if("string"!=typeof t)throw"Provided URL (".concat(t,") is not a string");if(n=void 0!==n&&n?n:s.getIncomingElement(),r=void 0!==r&&r?r:s.getReplaceElement(),i=void 0===i||i,"string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");var a=s.getData(),u=this.getRouteFromMeta();s.showLoader(),o.a.get(t).then(function(o){s.hideLoader(),s._replacePageContent(o.data,t,n,r,i,u,a,e)}).catch(function(e){s.hideLoader();var n="object"==typeof e&&null!==e&&e.isAxiosError?e:null;throw e=null!==n?n.response.statusText:e,s._triggerFail(e,t,a,n),e})},loaderEnabled:!0,setLoaderDelay:function(t){if("number"!=typeof t)throw"".concat(t," is not an integer");return this._loaderDelay=t,this},_loaderDelay:300,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:"progress page-navigation-loader",_loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated",_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=i.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(t){var e=(t=void 0===t?document.head:t).querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){return this._onloadCallbacks.push(t),this},removeOnload:function(t){this._onloadCallbacks.filter(function(e){return e!==t})},_onUnloadCallbacks:[],onUnload:function(t){return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){this._onUnloadCallbacks.filter(function(e){return e!==t})},_onFailCallbacks:[],onFail:function(t){return this._onFailCallbacks.push(t),this},removeOnFail:function(t){this._onFailCallbacks.filter(function(e){return e!==t})},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),null,null,null,!1)},this},_replacePageContent(t,e,n,r,o,s,a,u){if(o=void 0===o||o,n=void 0!==n&&n?n:this.getIncomingElement(),r=void 0!==r&&r?r:this.getReplaceElement(),"string"!=typeof e)throw"Provided url (".concat(e,") is not a string");if("string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");this._triggerUnload(i.a.getElement(r),r,s,a);var c=this._parseHTML(t,n);if(c.html.length){i.a.remove("meta"),document.head.append(c.metas),i.a.remove('[rel="canonical"]'),Array.from(c.links).forEach(function(t){document.head.append(t)}),document.body.classList=c.body_classes,o&&history.pushState({url:e},c.title,e),this._setTitle(c.title);var l=i.a.replaceElWithHTML(r,c.html);this._triggerOnload(l,n,r,c.route,a),"function"==typeof u&&u(l,n,r,s,a),this._addHistoryItem(e,c.route),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t,e){if("string"!=typeof(e=void 0===e?null:e)&&null!==e)throw"Provided parent_el (".concat(e,") is not a string or null");if(l=null,"object"==typeof t&&null!==t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(l=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),o=r.querySelector("title");o=o?o.innerText:null;var i=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList,u=t;if(e){var c=r.querySelector(e);if(!c)throw"Could not find parent selector ".concat(e);u=c.outerHTML}var l=l||this.getRouteFromMeta(r);return n=r=null,{title:o,route:l,metas:i,links:s,body_classes:a,html:u}},_triggerOnload:function(t,e,n,r,o){return this._onloadCallbacks.forEach(function(i){i(t,e,n,r,o)}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(o){o(t,e,n,r)}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(o){o(t,e,n,r)}),this},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e,n,r,o){o=void 0!==o&&o,n=void 0!==n&&n;var i=JSON.stringify(t),s="".concat(i," is not an object");if(void 0===t){if(o)throw s;return!1}if(!("object"==typeof t&&null!==t)||Array.isArray(t)){if(o)throw s;return!1}if(Array.isArray(e)){var a=!1,u=[],c=Object.keys(t);if(e.forEach(function(t){c.includes(t)?a=!0:u.push(t)}),!a){if(o)throw"".concat(i," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&u.length){if(o)throw"".concat(i," is missing data: ")+u.join(", ");return!1}if(r){var l=[];if(c.forEach(function(t){e.includes(t)||l.push(t)}),l.length){if(o)throw"".concat(i," contains invalid data: ")+l.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),o={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return o.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return o.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var o=r.a.getElements(t);if(!o.length)return t;var i=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return o.forEach(function(t){t.addEventListener(e,i,!1)}),i},on:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.addEventListener(e,n)}),o):t},off:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.removeEventListener(e,n)}),o):t},trigger:function(t,e,n,o){var i=r.a.getElements(t);return i.length?(n=void 0===n?null:n,(o=void 0===o?{}:o).detail=n,e=new CustomEvent(e,o),i.forEach(function(t){t.dispatchEvent(e)}),i):t}}},function(t,e,n){t.exports=n(23)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(40);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return"https:"===window.location.protocol},getDomain:function(){return window.location.hostname||window.location.host},getDomainWithProtocol:function(){return window.location.origin},getURI:function(){return window.location.pathname},getURIWithQueryString:function(){return window.location.pathname+window.location.search},getFullURL:function(){return window.location.href},appendSlash:function(t){return"/"!==t[t.length-1]?t+"/":t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(3),o=n(8);class i{constructor(){}populate(t){var e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[o.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(t){return"get"+this.ucfirst(t)},setter:function(t){return"set"+this.ucfirst(t)},ucfirst:function(t){return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(5),s=n.n(i);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(41);var c={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class l{constructor(t,e){if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){u(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},c,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," is not a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," is not a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," is not a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;o.a.showLoader();var i=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:i}).then(function(n){o.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var i=o.a.parseHTML(r,e.getIncomingElementSelector());return i.html.length?e.insertForm(i,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r&&null!==r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw o.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function f(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class p extends l{constructor(t,e){if(super(null,e),"string"!=typeof t)throw"".concat(t," is not a string");if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(n,!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," is not a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," is not a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;o.a.showLoader(),s.a.get(this.getURL()).then(function(e){o.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=o.a.parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&null!==n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw o.a.hideLoader(),t})}insertForm(t,e,n){var o=this.getInsertIntoElement();if(null===o)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(o=r.a.getElement(o,!0)).innerHTML=t.html,n=o.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),o}onload(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return l}),n.d(e,"a",function(){return p})},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(1);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var s=[];r.forEach(e,function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(o(e)+"="+o(t))}))}),i=s.join("&")}if(i){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";(function(e){var r=n(1),o=n(30),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,u={adapter:(void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?a=n(15):"undefined"!=typeof XMLHttpRequest&&(a=n(15)),a),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(i)}),t.exports=u}).call(this,n(29))},function(t,e,n){"use strict";var r=n(1),o=n(31),i=n(12),s=n(33),a=n(34),u=n(16);t.exports=function(t){return new Promise(function(e,c){var l=t.data,f=t.headers;r.isFormData(l)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",p=t.auth.password||"";f.Authorization="Basic "+btoa(d+":"+p)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:t,request:h};o(e,c,r),h=null}},h.onabort=function(){h&&(c(u("Request aborted",t,"ECONNABORTED",h)),h=null)},h.onerror=function(){c(u("Network Error",t,null,h)),h=null},h.ontimeout=function(){c(u("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(35),g=(t.withCredentials||a(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;g&&(f[t.xsrfHeaderName]=g)}if("setRequestHeader"in h&&r.forEach(f,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete f[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),c(t),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(t,e,n){"use strict";var r=n(32);t.exports=function(t,e,n,o,i){var s=new Error(t);return r(s,e,n,o,i)}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e){e=e||{};var n={};return r.forEach(["url","method","params","data"],function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),o=n(7);function i(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,name:null,config:{}};class u extends o.a{constructor(t){if(super(),this._keys=["id","name","config"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}getId(){return this._id}setId(t){return this._id=t,this}getName(){return this._name}setName(t){return this._name=t,this}getConfig(){return this._config}setConfig(t){return r.a.isDataObject(t,null,!1,!1,!0),this._config=t,this}getConfigItem(t){return void 0===this._config[t]?null:this._config[t]}setConfigItem(t,e){return this._config[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),o=n(7);function i(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class u extends o.a{constructor(t){if(super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}setId(t){return this._id=t,this}getId(){return this._id}setIsGuest(t){return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(t){return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(t){return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(t){return this._fname=t,this}getLname(){return this._lname}setLname(t){return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(t){return this._email=t,this}getPhone(){return this._phone}setPhone(t){return this._phone=t,this}getPermissions(){return this._permissions}setPermissions(t){if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=t,this}addPermission(t){return this._permissions.push(t),this}removePermission(t){return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){return this.getPermissions().includes(t)}getAdditionalData(){return this._additionalData}setAdditionalData(t){return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=t,this}getDataItem(t){return void 0===this._additionalData[t]?null:this._additionalData[t]}setDataItem(t,e){return this._additionalData[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(4),o=n(0);class i{constructor(t,e,n,r){this.btn=o.a.getElement(t,!0,!0),this.toggle_el=o.a.getElement(e,!0,!0),this.hide_on_outside_click="boolean"!=typeof r||r,this.toggle_class="string"!=typeof n?"visible":n}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){o.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return g});var r=n(0),o=n(4),i=n(10),s=n(2),a=n(6),u=n(19),c=n(8),l=n(3),f=n(20),h=n(21);function d(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m={dom:r.a,events:o.a,XHRForm:i.b,FormFromURL:i.a,navigation:s.a,request:a.a,Site:u.a,strings:c.a,type_checks:l.a,User:f.a,ToggleOnMobile:h.a},g=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(n,!0).forEach(function(e){p(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},m,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,m)t?(void 0===window[t]&&(window[t]={}),window[t][e]=m[e]):window[e]=m[e]}});t.jpack=g}.call(this,n(9))},function(t,e,n){"use strict";var r=n(1),o=n(11),i=n(25),s=n(17);function a(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var u=a(n(14));u.Axios=i,u.create=function(t){return a(s(u.defaults,t))},u.Cancel=n(18),u.CancelToken=n(38),u.isCancel=n(13),u.all=function(t){return Promise.all(t)},u.spread=n(39),t.exports=u,t.exports.default=u},function(t,e){ | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=23)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e)throw"".concat(e," must be a string");var r=this.getElement(t);if(!t){if(n)throw'Could not find "'.concat(t,'"');return null}var o=(new DOMParser).parseFromString(e,"text/html");return o=r.parentNode.insertBefore(o.documentElement.querySelector("body").childNodes[0],r),r.remove(),o},isVisible(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null===(t=this.getElement(t,e,n))){if(e)throw'Could not find "'.concat(t,'"');return!1}var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var o=t.getBoundingClientRect(),i={"top-left":{x:o.left,y:o.top},"top-right":{x:o.right,y:o.top},"bottom-left":{x:o.left,y:o.bottom},"bottom-right":{x:o.right,y:o.bottom},center:{x:o.left+t.offsetWidth/2,y:o.top+t.offsetHeight/2}},s=!0;return Object.keys(i).forEach(function(t){var e=i[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",function(){return i});var i={getValueOrClone:function(t){return null==t?null:"object"==typeof t?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(n,!0).forEach(function(e){o(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t):Array.isArray(t)?[...t]:t}}},function(t,e,n){"use strict";var r=n(12),o=n(25),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return a(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(6),o=n.n(r),i=n(0),s=n(7),a=n(1),u={storeHistory:!0,getHistory:function(){return a.a.getValueOrClone(this._history)},getLastHistoryRecord(){return this._history.pop()},_addHistoryItem(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getRouteFromMeta();if(!this.storeHistory)return!1;if("string"!=typeof t)throw"".concat(t," must be a string");return this._history.push({url:t,route:e}),this},_history:[],setData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!=typeof t||null===t)throw"".concat(t," must be an object");return this._data=a.a.getValueOrClone(t),this},getData:function(){return a.a.getValueOrClone(this._data)},setDataItem:function(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._data[t]=a.a.getValueOrClone(e),this},getDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._data[t]||null===this._data[t]?null:a.a.getValueOrClone(this._data[t])},clearData:function(){return this.setData({}),this},clearDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0!==this._data[t]&&delete this._data[t],this},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._incomingElementSelector=t},_incomingElementSelector:"body",getIncomingElement:function(){return this._incomingElementSelector},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._replaceElementSelector=t},_replaceElementSelector:"body",getReplaceElement:function(){return this._replaceElementSelector},load:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getIncomingElement(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.getReplaceElement(),i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this;if("string"!=typeof t)throw"Provided URL (".concat(t,") must be a string");if("string"!=typeof n)throw"incoming_el (".concat(n,") must be a string");if("string"!=typeof r)throw"replace_el (".concat(r,") must be a string");var a=s.getData(),u=this.getRouteFromMeta();s.showLoader(),o.a.get(t).then(function(o){s.hideLoader(),s._replacePageContent(o.data,t,n,r,i,u,a,e)}).catch(function(e){s.hideLoader();var n="object"==typeof e&&null!==e&&e.isAxiosError?e:null;throw e=null!==n?n.response.statusText:e,s._triggerFail(e,t,a,n),e})},loaderEnabled:!0,setLoaderDelay:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;if("number"!=typeof t)throw"".concat(t," must be an integer");return this._loaderDelay=t,this},_loaderDelay:300,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:"progress page-navigation-loader",_loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated",_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=i.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.head,e=t.querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){return this._onloadCallbacks.push(t),this},removeOnload:function(t){this._onloadCallbacks.filter(function(e){return e!==t})},_onUnloadCallbacks:[],onUnload:function(t){return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){this._onUnloadCallbacks.filter(function(e){return e!==t})},_onFailCallbacks:[],onFail:function(t){return this._onFailCallbacks.push(t),this},removeOnFail:function(t){this._onFailCallbacks.filter(function(e){return e!==t})},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),null,null,null,!1)},this},_replacePageContent(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getIncomingElement(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.getReplaceElement(),o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;if(r=void 0!==r&&r?r:this.getReplaceElement(),"string"!=typeof e)throw"Provided url (".concat(e,") must be a string");if("string"!=typeof n)throw"incoming_el (".concat(n,") must be a string");if("string"!=typeof r)throw"replace_el (".concat(r,") must be a string");this._triggerUnload(i.a.getElement(r),r,s,a);var c=this._parseHTML(t,n);if(c.html.length){i.a.remove("meta"),document.head.append(c.metas),i.a.remove('[rel="canonical"]'),Array.from(c.links).forEach(function(t){document.head.append(t)}),document.body.classList=c.body_classes,o&&history.pushState({url:e},c.title,e),this._setTitle(c.title);var l=i.a.replaceElWithHTML(r,c.html);this._triggerOnload(l,n,r,c.route,a),"function"==typeof u&&u(l,n,r,s,a),this._addHistoryItem(e,c.route),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"!=typeof e&&null!==e)throw"Provided parent_el (".concat(e,") must be a string or null");if(l=null,"object"==typeof t&&null!==t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(l=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),o=r.querySelector("title");o=o?o.innerText:null;var i=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList,u=t;if(e){var c=r.querySelector(e);if(!c)throw"Could not find parent selector ".concat(e);u=c.outerHTML}var l=l||this.getRouteFromMeta(r);return n=r=null,{title:o,route:l,metas:i,links:s,body_classes:a,html:u}},_triggerOnload:function(t,e,n,r,o){return this._onloadCallbacks.forEach(function(i){i(t,e,n,r,o)}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(o){o(t,e,n,r)}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(o){o(t,e,n,r)}),this},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=JSON.stringify(t),s="".concat(i," must be an object");if(void 0===t){if(o)throw s;return!1}var a="object"==typeof t&&null!==t;if(!a||Array.isArray(t)){if(o)throw s;return!1}if(Array.isArray(e)){var u=!1,c=[],l=Object.keys(t);if(e.forEach(function(t){l.includes(t)?u=!0:c.push(t)}),!u){if(o)throw"".concat(i," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&c.length){if(o)throw"".concat(i," is missing data: ")+c.join(", ");return!1}if(r){var f=[];if(l.forEach(function(t){e.includes(t)||f.push(t)}),f.length){if(o)throw"".concat(i," contains invalid data: ")+f.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),o={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return o.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return o.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var o=r.a.getElements(t);if(!o.length)return t;var i=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return o.forEach(function(t){t.addEventListener(e,i,!1)}),i},on:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.addEventListener(e,n)}),o):t},off:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.removeEventListener(e,n)}),o):t},trigger:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.a.getElements(t);return i.length?(o.detail=n,e=new CustomEvent(e,o),i.forEach(function(t){t.dispatchEvent(e)}),i):t}}},function(t,e,n){t.exports=n(24)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(41);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return"https:"===window.location.protocol},getDomain:function(){return window.location.hostname||window.location.host},getDomainWithProtocol:function(){return window.location.origin},getURI:function(){return window.location.pathname},getURIWithQueryString:function(){return window.location.pathname+window.location.search},getFullURL:function(){return window.location.href},appendSlash:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"/"!==t[t.length-1]?t+"/":t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(4),o=n(9);class i{constructor(){}populate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[o.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"get"+this.ucfirst(t)},setter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"set"+this.ucfirst(t)},ucfirst:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(0),o=n(3),i=n(6),s=n.n(i);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(42);var c={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class l{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof e||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){u(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},c,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," must be a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;o.a.showLoader();var i=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:i}).then(function(n){o.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var i=o.a.parseHTML(r,e.getIncomingElementSelector());return i.html.length?e.insertForm(i,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r&&null!==r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw o.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function f(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class p extends l{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(null,e),"string"!=typeof t)throw"".concat(t," must be a string");if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(n,!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," must be a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;o.a.showLoader(),s.a.get(this.getURL()).then(function(e){o.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=o.a.parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&null!==n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw o.a.hideLoader(),t})}insertForm(t,e,n){var o=this.getInsertIntoElement();if(null===o)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(o=r.a.getElement(o,!0)).innerHTML=t.html,n=o.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),o}onload(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return l}),n.d(e,"a",function(){return p})},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(2);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var s=[];r.forEach(e,function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(o(e)+"="+o(t))}))}),i=s.join("&")}if(i){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";(function(e){var r=n(2),o=n(31),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,u={adapter:(void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?a=n(16):"undefined"!=typeof XMLHttpRequest&&(a=n(16)),a),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(i)}),t.exports=u}).call(this,n(30))},function(t,e,n){"use strict";var r=n(2),o=n(32),i=n(13),s=n(34),a=n(35),u=n(17);t.exports=function(t){return new Promise(function(e,c){var l=t.data,f=t.headers;r.isFormData(l)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",p=t.auth.password||"";f.Authorization="Basic "+btoa(d+":"+p)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:t,request:h};o(e,c,r),h=null}},h.onabort=function(){h&&(c(u("Request aborted",t,"ECONNABORTED",h)),h=null)},h.onerror=function(){c(u("Network Error",t,null,h)),h=null},h.ontimeout=function(){c(u("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(36),g=(t.withCredentials||a(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;g&&(f[t.xsrfHeaderName]=g)}if("setRequestHeader"in h&&r.forEach(f,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete f[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),c(t),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(t,e,n){"use strict";var r=n(33);t.exports=function(t,e,n,o,i){var s=new Error(t);return r(s,e,n,o,i)}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t,e){e=e||{};var n={};return r.forEach(["url","method","params","data"],function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(4),o=n(8),i=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u={id:null,name:null,config:{}};class c extends o.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","name","config"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,{},t),this.populate(t)}getId(){return this._id}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getName(){return this._name}setName(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._name=t,this}getConfig(){return i.a.getValueOrClone(this._config)}setConfig(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._config=i.a.getValueOrClone(t),this}getConfigItem(t){return void 0===this._config[t]?null:i.a.getValueOrClone(this._config[t])}setConfigItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._config[t]=i.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(4),o=n(8),i=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class c extends o.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,{},t),this.populate(t)}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getId(){return this._id}setIsGuest(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._fname=t,this}getLname(){return this._lname}setLname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._email=t,this}getPhone(){return this._phone}setPhone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._phone=t,this}getPermissions(){return i.a.getValueOrClone(this._permissions)}setPermissions(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=i.a.getValueOrClone(t),this}addPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._permissions.push(t),this}removePermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.getPermissions().includes(t)}getAdditionalData(){return i.a.getValueOrClone(this._additionalData)}setAdditionalData(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=i.a.getValueOrClone(t),this}getDataItem(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._additionalData[t]?null:i.a.getValueOrClone(this._additionalData[t])}setDataItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._additionalData[t]=i.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(5),o=n(0);class i{constructor(t,e){arguments.length>2&&void 0!==arguments[2]&&arguments[2],!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.btn=o.a.getElement(t,!0,!0),this.toggle_el=o.a.getElement(e,!0,!0)}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){o.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return v});var r=n(0),o=n(5),i=n(11),s=n(3),a=n(7),u=n(20),c=n(9),l=n(4),f=n(21),h=n(22),d=n(1);function p(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g={dom:r.a,events:o.a,XHRForm:i.b,FormFromURL:i.a,navigation:s.a,request:a.a,Site:u.a,strings:c.a,type_checks:l.a,User:f.a,ToggleOnMobile:h.a,clone:d.a},v=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(n,!0).forEach(function(e){m(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},g,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,g)t?(void 0===window[t]&&(window[t]={}),window[t][e]=g[e]):window[e]=g[e]}});t.jpack=v}.call(this,n(10))},function(t,e,n){"use strict";var r=n(2),o=n(12),i=n(26),s=n(18);function a(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var u=a(n(15));u.Axios=i,u.create=function(t){return a(s(u.defaults,t))},u.Cancel=n(19),u.CancelToken=n(39),u.isCancel=n(14),u.all=function(t){return Promise.all(t)},u.spread=n(40),t.exports=u,t.exports.default=u},function(t,e){ | ||
/*! | ||
@@ -8,2 +8,2 @@ * Determine if an object is a Buffer | ||
*/ | ||
t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},function(t,e,n){"use strict";var r=n(1),o=n(12),i=n(26),s=n(27),a=n(17);function u(t){this.defaults=t,this.interceptors={request:new i,response:new i}}u.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method=t.method?t.method.toLowerCase():"get";var e=[s,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},u.prototype.getUri=function(t){return t=a(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(t){u.prototype[t]=function(e,n){return this.request(r.merge(n||{},{method:t,url:e}))}}),r.forEach(["post","put","patch"],function(t){u.prototype[t]=function(e,n,o){return this.request(r.merge(o||{},{method:t,url:e,data:n}))}}),t.exports=u},function(t,e,n){"use strict";var r=n(1);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,n){"use strict";var r=n(1),o=n(28),i=n(13),s=n(14),a=n(36),u=n(37);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!a(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=a(h);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(16);t.exports=function(t,e,n){var o=n.config.validateStatus;!o||o(n.status)?t(n):e(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,n){"use strict";var r=n(1),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,s={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(s[e]&&o.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}}),s):s}},function(t,e,n){"use strict";var r=n(1);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(1);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(18);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){(function(t){!function(t){"use strict";var e,n=t.URLSearchParams&&t.URLSearchParams.prototype.get?t.URLSearchParams:null,r=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),i="__URLSearchParams__",s=!n||((e=new n).append("s"," &"),"s=+%26"===e.toString()),a=f.prototype,u=!(!t.Symbol||!t.Symbol.iterator);if(!(n&&r&&o&&s)){a.append=function(t,e){g(this[i],t,e)},a.delete=function(t){delete this[i][t]},a.get=function(t){var e=this[i];return t in e?e[t][0]:null},a.getAll=function(t){var e=this[i];return t in e?e[t].slice(0):[]},a.has=function(t){return t in this[i]},a.set=function(t,e){this[i][t]=[""+e]},a.toString=function(){var t,e,n,r,o=this[i],s=[];for(e in o)for(n=h(e),t=0,r=o[e];t<r.length;t++)s.push(n+"="+h(r[t]));return s.join("&")};var c=!!o&&n&&!r&&t.Proxy;Object.defineProperty(t,"URLSearchParams",{value:c?new Proxy(n,{construct:function(t,e){return new t(new f(e[0]).toString())}}):f});var l=t.URLSearchParams.prototype;l.polyfill=!0,l.forEach=l.forEach||function(t,e){var n=m(this.toString());Object.getOwnPropertyNames(n).forEach(function(r){n[r].forEach(function(n){t.call(e,n,r,this)},this)},this)},l.sort=l.sort||function(){var t,e,n,r=m(this.toString()),o=[];for(t in r)o.push(t);for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++){var i=o[e],s=r[i];for(n=0;n<s.length;n++)this.append(i,s[n])}},l.keys=l.keys||function(){var t=[];return this.forEach(function(e,n){t.push(n)}),p(t)},l.values=l.values||function(){var t=[];return this.forEach(function(e){t.push(e)}),p(t)},l.entries=l.entries||function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),p(t)},u&&(l[t.Symbol.iterator]=l[t.Symbol.iterator]||l.entries)}function f(t){((t=t||"")instanceof URLSearchParams||t instanceof f)&&(t=t.toString()),this[i]=m(t)}function h(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,function(t){return e[t]})}function d(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,function(t){return decodeURIComponent(t)})}function p(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return u&&(n[t.Symbol.iterator]=function(){return n}),n}function m(t){var e={};if("object"==typeof t)if(v(t))for(var n=0;n<t.length;n++){var r=t[n];if(!v(r)||2!==r.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");g(e,r[0],r[1])}else for(var o in t)t.hasOwnProperty(o)&&g(e,o,t[o]);else{0===t.indexOf("?")&&(t=t.slice(1));for(var i=t.split("&"),s=0;s<i.length;s++){var a=i[s],u=a.indexOf("=");-1<u?g(e,d(a.slice(0,u)),d(a.slice(u+1))):a&&g(e,d(a),"")}}return e}function g(t,e,n){var r="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);e in t?t[e].push(r):t[e]=[r]}function v(t){return!!t&&"[object Array]"===Object.prototype.toString.call(t)}}(void 0!==t?t:"undefined"!=typeof window?window:this)}).call(this,n(9))},function(t,e,n){(function(t){!function(){var e;function n(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},o="undefined"!=typeof window&&window===this?this:void 0!==t&&null!=t?t:this;function i(){i=function(){},o.Symbol||(o.Symbol=c)}function s(t,e){this.s=t,r(this,"description",{configurable:!0,writable:!0,value:e})}s.prototype.toString=function(){return this.s};var a,u,c=(a=0,function t(e){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new s("jscomp_symbol_"+(e||"")+"_"+a++,e)});function l(){i();var t=o.Symbol.iterator;t||(t=o.Symbol.iterator=o.Symbol("Symbol.iterator")),"function"!=typeof Array.prototype[t]&&r(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return function(t){return l(),(t={next:t})[o.Symbol.iterator]=function(){return this},t}(n(this))}}),l=function(){}}function f(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:n(t)}}if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var h;t:{var d={};try{d.__proto__={v:!0},h=d.v;break t}catch(t){}h=!1}u=h?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var p=u;function m(){this.h=!1,this.c=null,this.o=void 0,this.b=1,this.m=this.w=0,this.g=null}function g(t){if(t.h)throw new TypeError("Generator is already running");t.h=!0}function v(t,e,n){return t.b=n,{value:e}}function y(t){for(var e in this.C=t,this.l=[],t)this.l.push(e);this.l.reverse()}function b(t){this.a=new m,this.D=t}function w(t,e,n,r){try{var o=e.call(t.a.c,n);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return t.a.h=!1,o;var i=o.value}catch(e){return t.a.c=null,t.a.j(e),_(t)}return t.a.c=null,r.call(t.a,i),_(t)}function _(t){for(;t.a.b;)try{var e=t.D(t.a);if(e)return t.a.h=!1,{value:e.value,done:!1}}catch(e){t.a.o=void 0,t.a.j(e)}if(t.a.h=!1,t.a.g){if(e=t.a.g,t.a.g=null,e.B)throw e.A;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function E(t){this.next=function(e){return t.i(e)},this.throw=function(e){return t.j(e)},this.return=function(e){return function(t,e){g(t.a);var n=t.a.c;return n?w(t,"return"in n?n.return:function(t){return{value:t,done:!0}},e,t.a.return):(t.a.return(e),_(t))}(t,e)},l(),this[Symbol.iterator]=function(){return this}}function S(t,e){var n=new E(new b(e));return p&&p(n,t.prototype),n}if(m.prototype.i=function(t){this.o=t},m.prototype.j=function(t){this.g={A:t,B:!0},this.b=this.w||this.m},m.prototype.return=function(t){this.g={return:t},this.b=this.m},b.prototype.i=function(t){return g(this.a),this.a.c?w(this,this.a.c.next,t,this.a.i):(this.a.i(t),_(this))},b.prototype.j=function(t){return g(this.a),this.a.c?w(this,this.a.c.throw,t,this.a.i):(this.a.j(t),_(this))},"function"==typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var O=function(t,e){for(var n=0;n<t.length;n++)e(t[n])},j=function(t,e,n){return e instanceof Blob?[String(t),e,void 0!==n?n+"":"string"==typeof e.name?e.name:"blob"]:[String(t),String(e)]},x=function(t,e){if(t.length<e)throw new TypeError(e+" argument required, but only "+t.length+" present.")},L=function(t){var e=f(t);return t=e.next().value,e=e.next().value,t instanceof Blob&&(t=new File([t],e,{type:t.type,lastModified:t.lastModified})),t},P="object"==typeof window?window:"object"==typeof self?self:this,R=P.FormData,C=P.XMLHttpRequest&&P.XMLHttpRequest.prototype.send,D=P.Request&&P.fetch,k=P.navigator&&P.navigator.sendBeacon;i();var F=P.Symbol&&Symbol.toStringTag;F&&(Blob.prototype[F]||(Blob.prototype[F]="Blob"),"File"in P&&!File.prototype[F]&&(File.prototype[F]="File"));try{new File([],"")}catch(t){P.File=function(t,e,n){return t=new Blob(t,n),n=n&&void 0!==n.lastModified?new Date(n.lastModified):new Date,Object.defineProperties(t,{name:{value:e},lastModifiedDate:{value:n},lastModified:{value:+n},toString:{value:function(){return"[object File]"}}}),F&&Object.defineProperty(t,F,{value:"File"}),t}}i(),l();var T=function(t){if(this.f=Object.create(null),!t)return this;var e=this;O(t.elements,function(t){if(t.name&&!t.disabled&&"submit"!==t.type&&"button"!==t.type)if("file"===t.type){var n=t.files&&t.files.length?t.files:[new File([],"",{type:"application/octet-stream"})];O(n,function(n){e.append(t.name,n)})}else"select-multiple"===t.type||"select-one"===t.type?O(t.options,function(n){!n.disabled&&n.selected&&e.append(t.name,n.value)}):"checkbox"===t.type||"radio"===t.type?t.checked&&e.append(t.name,t.value):(n="textarea"===t.type?t.value.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"):t.value,e.append(t.name,n))})};if((e=T.prototype).append=function(t,e,n){x(arguments,2);var r=f(j.apply(null,arguments));t=r.next().value,e=r.next().value,n=r.next().value,(r=this.f)[t]||(r[t]=[]),r[t].push([e,n])},e.delete=function(t){x(arguments,1),delete this.f[String(t)]},e.entries=function t(){var e,n,r,o,i,s,a=this;return S(t,function(t){switch(t.b){case 1:e=a.f,r=new y(e);case 2:var u;t:{for(u=r;0<u.l.length;){var c=u.l.pop();if(c in u.C){u=c;break t}}u=null}if(null==(n=u)){t.b=0;break}o=f(e[n]),i=o.next();case 5:if(i.done){t.b=2;break}return s=i.value,v(t,[n,L(s)],6);case 6:i=o.next(),t.b=5}})},e.forEach=function(t,e){x(arguments,1);for(var n=f(this),r=n.next();!r.done;r=n.next()){var o=f(r.value);r=o.next().value,o=o.next().value,t.call(e,o,r,this)}},e.get=function(t){x(arguments,1);var e=this.f;return e[t=String(t)]?L(e[t][0]):null},e.getAll=function(t){return x(arguments,1),(this.f[String(t)]||[]).map(L)},e.has=function(t){return x(arguments,1),String(t)in this.f},e.keys=function t(){var e,n,r,o,i=this;return S(t,function(t){if(1==t.b&&(e=f(i),n=e.next()),3!=t.b)return n.done?void(t.b=0):(r=n.value,o=f(r),v(t,o.next().value,3));n=e.next(),t.b=2})},e.set=function(t,e,n){x(arguments,2);var r=j.apply(null,arguments);this.f[r[0]]=[[r[1],r[2]]]},e.values=function t(){var e,n,r,o,i=this;return S(t,function(t){if(1==t.b&&(e=f(i),n=e.next()),3!=t.b)return n.done?void(t.b=0):(r=n.value,(o=f(r)).next(),v(t,o.next().value,3));n=e.next(),t.b=2})},T.prototype._asNative=function(){for(var t=new R,e=f(this),n=e.next();!n.done;n=e.next()){var r=f(n.value);n=r.next().value,r=r.next().value,t.append(n,r)}return t},T.prototype._blob=function(){for(var t="----formdata-polyfill-"+Math.random(),e=[],n=f(this),r=n.next();!r.done;r=n.next()){var o=f(r.value);r=o.next().value,o=o.next().value,e.push("--"+t+"\r\n"),o instanceof Blob?e.push('Content-Disposition: form-data; name="'+r+'"; filename="'+o.name+'"\r\n',"Content-Type: "+(o.type||"application/octet-stream")+"\r\n\r\n",o,"\r\n"):e.push('Content-Disposition: form-data; name="'+r+'"\r\n\r\n'+o+"\r\n")}return e.push("--"+t+"--"),new Blob(e,{type:"multipart/form-data; boundary="+t})},T.prototype[Symbol.iterator]=function(){return this.entries()},T.prototype.toString=function(){return"[object FormData]"},F&&(T.prototype[F]="FormData"),C){var U=P.XMLHttpRequest.prototype.setRequestHeader;P.XMLHttpRequest.prototype.setRequestHeader=function(t,e){return"content-type"===t.toLowerCase()&&(this.u=!0),U.call(this,t,e)},P.XMLHttpRequest.prototype.send=function(t){t instanceof T?(t=t._blob(),this.u||this.setRequestHeader("Content-Type",t.type),C.call(this,t)):C.call(this,t)}}if(D){var A=P.fetch;P.fetch=function(t,e){return e&&e.body&&e.body instanceof T&&(e.body=e.body._blob()),A.call(this,t,e)}}k&&(P.navigator.sendBeacon=function(t,e){return e instanceof T&&(e=e._asNative()),k.call(this,t,e)}),P.FormData=T}}()}).call(this,n(9))}]); | ||
t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},function(t,e,n){"use strict";var r=n(2),o=n(13),i=n(27),s=n(28),a=n(18);function u(t){this.defaults=t,this.interceptors={request:new i,response:new i}}u.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method=t.method?t.method.toLowerCase():"get";var e=[s,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},u.prototype.getUri=function(t){return t=a(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(t){u.prototype[t]=function(e,n){return this.request(r.merge(n||{},{method:t,url:e}))}}),r.forEach(["post","put","patch"],function(t){u.prototype[t]=function(e,n,o){return this.request(r.merge(o||{},{method:t,url:e,data:n}))}}),t.exports=u},function(t,e,n){"use strict";var r=n(2);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,n){"use strict";var r=n(2),o=n(29),i=n(14),s=n(15),a=n(37),u=n(38);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!a(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=a(h);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(17);t.exports=function(t,e,n){var o=n.config.validateStatus;!o||o(n.status)?t(n):e(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,s={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(s[e]&&o.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}}),s):s}},function(t,e,n){"use strict";var r=n(2);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(2);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(19);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){(function(t){!function(t){"use strict";var e,n=t.URLSearchParams&&t.URLSearchParams.prototype.get?t.URLSearchParams:null,r=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),i="__URLSearchParams__",s=!n||((e=new n).append("s"," &"),"s=+%26"===e.toString()),a=f.prototype,u=!(!t.Symbol||!t.Symbol.iterator);if(!(n&&r&&o&&s)){a.append=function(t,e){g(this[i],t,e)},a.delete=function(t){delete this[i][t]},a.get=function(t){var e=this[i];return t in e?e[t][0]:null},a.getAll=function(t){var e=this[i];return t in e?e[t].slice(0):[]},a.has=function(t){return t in this[i]},a.set=function(t,e){this[i][t]=[""+e]},a.toString=function(){var t,e,n,r,o=this[i],s=[];for(e in o)for(n=h(e),t=0,r=o[e];t<r.length;t++)s.push(n+"="+h(r[t]));return s.join("&")};var c=!!o&&n&&!r&&t.Proxy;Object.defineProperty(t,"URLSearchParams",{value:c?new Proxy(n,{construct:function(t,e){return new t(new f(e[0]).toString())}}):f});var l=t.URLSearchParams.prototype;l.polyfill=!0,l.forEach=l.forEach||function(t,e){var n=m(this.toString());Object.getOwnPropertyNames(n).forEach(function(r){n[r].forEach(function(n){t.call(e,n,r,this)},this)},this)},l.sort=l.sort||function(){var t,e,n,r=m(this.toString()),o=[];for(t in r)o.push(t);for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++){var i=o[e],s=r[i];for(n=0;n<s.length;n++)this.append(i,s[n])}},l.keys=l.keys||function(){var t=[];return this.forEach(function(e,n){t.push(n)}),p(t)},l.values=l.values||function(){var t=[];return this.forEach(function(e){t.push(e)}),p(t)},l.entries=l.entries||function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),p(t)},u&&(l[t.Symbol.iterator]=l[t.Symbol.iterator]||l.entries)}function f(t){((t=t||"")instanceof URLSearchParams||t instanceof f)&&(t=t.toString()),this[i]=m(t)}function h(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,function(t){return e[t]})}function d(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,function(t){return decodeURIComponent(t)})}function p(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return u&&(n[t.Symbol.iterator]=function(){return n}),n}function m(t){var e={};if("object"==typeof t)if(v(t))for(var n=0;n<t.length;n++){var r=t[n];if(!v(r)||2!==r.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");g(e,r[0],r[1])}else for(var o in t)t.hasOwnProperty(o)&&g(e,o,t[o]);else{0===t.indexOf("?")&&(t=t.slice(1));for(var i=t.split("&"),s=0;s<i.length;s++){var a=i[s],u=a.indexOf("=");-1<u?g(e,d(a.slice(0,u)),d(a.slice(u+1))):a&&g(e,d(a),"")}}return e}function g(t,e,n){var r="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);e in t?t[e].push(r):t[e]=[r]}function v(t){return!!t&&"[object Array]"===Object.prototype.toString.call(t)}}(void 0!==t?t:"undefined"!=typeof window?window:this)}).call(this,n(10))},function(t,e,n){(function(t){!function(){var e;function n(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},o="undefined"!=typeof window&&window===this?this:void 0!==t&&null!=t?t:this;function i(){i=function(){},o.Symbol||(o.Symbol=c)}function s(t,e){this.s=t,r(this,"description",{configurable:!0,writable:!0,value:e})}s.prototype.toString=function(){return this.s};var a,u,c=(a=0,function t(e){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new s("jscomp_symbol_"+(e||"")+"_"+a++,e)});function l(){i();var t=o.Symbol.iterator;t||(t=o.Symbol.iterator=o.Symbol("Symbol.iterator")),"function"!=typeof Array.prototype[t]&&r(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return function(t){return l(),(t={next:t})[o.Symbol.iterator]=function(){return this},t}(n(this))}}),l=function(){}}function f(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:n(t)}}if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var h;t:{var d={};try{d.__proto__={v:!0},h=d.v;break t}catch(t){}h=!1}u=h?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var p=u;function m(){this.h=!1,this.c=null,this.o=void 0,this.b=1,this.m=this.w=0,this.g=null}function g(t){if(t.h)throw new TypeError("Generator is already running");t.h=!0}function v(t,e,n){return t.b=n,{value:e}}function y(t){for(var e in this.C=t,this.l=[],t)this.l.push(e);this.l.reverse()}function b(t){this.a=new m,this.D=t}function w(t,e,n,r){try{var o=e.call(t.a.c,n);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return t.a.h=!1,o;var i=o.value}catch(e){return t.a.c=null,t.a.j(e),_(t)}return t.a.c=null,r.call(t.a,i),_(t)}function _(t){for(;t.a.b;)try{var e=t.D(t.a);if(e)return t.a.h=!1,{value:e.value,done:!1}}catch(e){t.a.o=void 0,t.a.j(e)}if(t.a.h=!1,t.a.g){if(e=t.a.g,t.a.g=null,e.B)throw e.A;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function O(t){this.next=function(e){return t.i(e)},this.throw=function(e){return t.j(e)},this.return=function(e){return function(t,e){g(t.a);var n=t.a.c;return n?w(t,"return"in n?n.return:function(t){return{value:t,done:!0}},e,t.a.return):(t.a.return(e),_(t))}(t,e)},l(),this[Symbol.iterator]=function(){return this}}function E(t,e){var n=new O(new b(e));return p&&p(n,t.prototype),n}if(m.prototype.i=function(t){this.o=t},m.prototype.j=function(t){this.g={A:t,B:!0},this.b=this.w||this.m},m.prototype.return=function(t){this.g={return:t},this.b=this.m},b.prototype.i=function(t){return g(this.a),this.a.c?w(this,this.a.c.next,t,this.a.i):(this.a.i(t),_(this))},b.prototype.j=function(t){return g(this.a),this.a.c?w(this,this.a.c.throw,t,this.a.i):(this.a.j(t),_(this))},"function"==typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var S=function(t,e){for(var n=0;n<t.length;n++)e(t[n])},j=function(t,e,n){return e instanceof Blob?[String(t),e,void 0!==n?n+"":"string"==typeof e.name?e.name:"blob"]:[String(t),String(e)]},x=function(t,e){if(t.length<e)throw new TypeError(e+" argument required, but only "+t.length+" present.")},L=function(t){var e=f(t);return t=e.next().value,e=e.next().value,t instanceof Blob&&(t=new File([t],e,{type:t.type,lastModified:t.lastModified})),t},P="object"==typeof window?window:"object"==typeof self?self:this,C=P.FormData,R=P.XMLHttpRequest&&P.XMLHttpRequest.prototype.send,D=P.Request&&P.fetch,k=P.navigator&&P.navigator.sendBeacon;i();var F=P.Symbol&&Symbol.toStringTag;F&&(Blob.prototype[F]||(Blob.prototype[F]="Blob"),"File"in P&&!File.prototype[F]&&(File.prototype[F]="File"));try{new File([],"")}catch(t){P.File=function(t,e,n){return t=new Blob(t,n),n=n&&void 0!==n.lastModified?new Date(n.lastModified):new Date,Object.defineProperties(t,{name:{value:e},lastModifiedDate:{value:n},lastModified:{value:+n},toString:{value:function(){return"[object File]"}}}),F&&Object.defineProperty(t,F,{value:"File"}),t}}i(),l();var T=function(t){if(this.f=Object.create(null),!t)return this;var e=this;S(t.elements,function(t){if(t.name&&!t.disabled&&"submit"!==t.type&&"button"!==t.type)if("file"===t.type){var n=t.files&&t.files.length?t.files:[new File([],"",{type:"application/octet-stream"})];S(n,function(n){e.append(t.name,n)})}else"select-multiple"===t.type||"select-one"===t.type?S(t.options,function(n){!n.disabled&&n.selected&&e.append(t.name,n.value)}):"checkbox"===t.type||"radio"===t.type?t.checked&&e.append(t.name,t.value):(n="textarea"===t.type?t.value.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"):t.value,e.append(t.name,n))})};if((e=T.prototype).append=function(t,e,n){x(arguments,2);var r=f(j.apply(null,arguments));t=r.next().value,e=r.next().value,n=r.next().value,(r=this.f)[t]||(r[t]=[]),r[t].push([e,n])},e.delete=function(t){x(arguments,1),delete this.f[String(t)]},e.entries=function t(){var e,n,r,o,i,s,a=this;return E(t,function(t){switch(t.b){case 1:e=a.f,r=new y(e);case 2:var u;t:{for(u=r;0<u.l.length;){var c=u.l.pop();if(c in u.C){u=c;break t}}u=null}if(null==(n=u)){t.b=0;break}o=f(e[n]),i=o.next();case 5:if(i.done){t.b=2;break}return s=i.value,v(t,[n,L(s)],6);case 6:i=o.next(),t.b=5}})},e.forEach=function(t,e){x(arguments,1);for(var n=f(this),r=n.next();!r.done;r=n.next()){var o=f(r.value);r=o.next().value,o=o.next().value,t.call(e,o,r,this)}},e.get=function(t){x(arguments,1);var e=this.f;return e[t=String(t)]?L(e[t][0]):null},e.getAll=function(t){return x(arguments,1),(this.f[String(t)]||[]).map(L)},e.has=function(t){return x(arguments,1),String(t)in this.f},e.keys=function t(){var e,n,r,o,i=this;return E(t,function(t){if(1==t.b&&(e=f(i),n=e.next()),3!=t.b)return n.done?void(t.b=0):(r=n.value,o=f(r),v(t,o.next().value,3));n=e.next(),t.b=2})},e.set=function(t,e,n){x(arguments,2);var r=j.apply(null,arguments);this.f[r[0]]=[[r[1],r[2]]]},e.values=function t(){var e,n,r,o,i=this;return E(t,function(t){if(1==t.b&&(e=f(i),n=e.next()),3!=t.b)return n.done?void(t.b=0):(r=n.value,(o=f(r)).next(),v(t,o.next().value,3));n=e.next(),t.b=2})},T.prototype._asNative=function(){for(var t=new C,e=f(this),n=e.next();!n.done;n=e.next()){var r=f(n.value);n=r.next().value,r=r.next().value,t.append(n,r)}return t},T.prototype._blob=function(){for(var t="----formdata-polyfill-"+Math.random(),e=[],n=f(this),r=n.next();!r.done;r=n.next()){var o=f(r.value);r=o.next().value,o=o.next().value,e.push("--"+t+"\r\n"),o instanceof Blob?e.push('Content-Disposition: form-data; name="'+r+'"; filename="'+o.name+'"\r\n',"Content-Type: "+(o.type||"application/octet-stream")+"\r\n\r\n",o,"\r\n"):e.push('Content-Disposition: form-data; name="'+r+'"\r\n\r\n'+o+"\r\n")}return e.push("--"+t+"--"),new Blob(e,{type:"multipart/form-data; boundary="+t})},T.prototype[Symbol.iterator]=function(){return this.entries()},T.prototype.toString=function(){return"[object FormData]"},F&&(T.prototype[F]="FormData"),R){var U=P.XMLHttpRequest.prototype.setRequestHeader;P.XMLHttpRequest.prototype.setRequestHeader=function(t,e){return"content-type"===t.toLowerCase()&&(this.u=!0),U.call(this,t,e)},P.XMLHttpRequest.prototype.send=function(t){t instanceof T?(t=t._blob(),this.u||this.setRequestHeader("Content-Type",t.type),R.call(this,t)):R.call(this,t)}}if(D){var A=P.fetch;P.fetch=function(t,e){return e&&e.body&&e.body instanceof T&&(e.body=e.body._blob()),A.call(this,t,e)}}k&&(P.navigator.sendBeacon=function(t,e){return e instanceof T&&(e=e._asNative()),k.call(this,t,e)}),P.FormData=T}}()}).call(this,n(10))}]); |
@@ -1,1 +0,1 @@ | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t,e,n){var r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t,e){e=void 0!==e&&e;var n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t,e){var n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e,n){if("string"!=typeof e)throw"".concat(e," is not a string");var r=this.getElement(t);if(!t){if(n)throw'Could not find "'.concat(t,'"');return null}var i=(new DOMParser).parseFromString(e,"text/html");return i=r.parentNode.insertBefore(i.documentElement.querySelector("body").childNodes[0],r),r.remove(),i},isVisible(t,e,n){if(null===(t=this.getElement(t,e,n))){if(e)throw'Could not find "'.concat(t,'"');return!1}var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var i=t.getBoundingClientRect(),o={"top-left":{x:i.left,y:i.top},"top-right":{x:i.right,y:i.top},"bottom-left":{x:i.left,y:i.bottom},"bottom-right":{x:i.right,y:i.bottom},center:{x:i.left+t.offsetWidth/2,y:i.top+t.offsetHeight/2}},s=!0;return Object.keys(o).forEach(function(t){var e=o[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n(4),i=n.n(r),o=n(0),s=n(5),a={storeHistory:!0,getHistory:function(){return this._history},getLastHistoryRecord(){return this._history.pop()},_addHistoryItem(t,e){return!!this._storeHistory&&(this._history.push({url:t,route:e}),this)},_history:[],setData:function(t){if("object"!=typeof t||null===t)throw"".concat(t," is not an object");return this._data=t,this},getData:function(){return this._data},setDataItem:function(t,e){if("string"!=typeof t)throw"".concat(t," is not a string");return this._data[t]=e,this},getDataItem:function(t){return void 0!==this._data[t]?this._data[t]:null},clearData:function(){return this.setData({}),this},clearDataItem:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");return void 0!==this._data[t]&&delete this._data[t],this},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._incomingElementSelector=t},_incomingElementSelector:"body",getIncomingElement:function(){return this._incomingElementSelector},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._replaceElementSelector=t},_replaceElementSelector:"body",getReplaceElement:function(){return this._replaceElementSelector},load:function(t,e,n,r,o){var s=this;if("string"!=typeof t)throw"Provided URL (".concat(t,") is not a string");if(n=void 0!==n&&n?n:s.getIncomingElement(),r=void 0!==r&&r?r:s.getReplaceElement(),o=void 0===o||o,"string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");var a=s.getData(),c=this.getRouteFromMeta();s.showLoader(),i.a.get(t).then(function(i){s.hideLoader(),s._replacePageContent(i.data,t,n,r,o,c,a,e)}).catch(function(e){s.hideLoader();var n="object"==typeof e&&null!==e&&e.isAxiosError?e:null;throw e=null!==n?n.response.statusText:e,s._triggerFail(e,t,a,n),e})},loaderEnabled:!0,setLoaderDelay:function(t){if("number"!=typeof t)throw"".concat(t," is not an integer");return this._loaderDelay=t,this},_loaderDelay:300,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:"progress page-navigation-loader",_loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated",_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=o.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(t){var e=(t=void 0===t?document.head:t).querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){return this._onloadCallbacks.push(t),this},removeOnload:function(t){this._onloadCallbacks.filter(function(e){return e!==t})},_onUnloadCallbacks:[],onUnload:function(t){return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){this._onUnloadCallbacks.filter(function(e){return e!==t})},_onFailCallbacks:[],onFail:function(t){return this._onFailCallbacks.push(t),this},removeOnFail:function(t){this._onFailCallbacks.filter(function(e){return e!==t})},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),null,null,null,!1)},this},_replacePageContent(t,e,n,r,i,s,a,c){if(i=void 0===i||i,n=void 0!==n&&n?n:this.getIncomingElement(),r=void 0!==r&&r?r:this.getReplaceElement(),"string"!=typeof e)throw"Provided url (".concat(e,") is not a string");if("string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");this._triggerUnload(o.a.getElement(r),r,s,a);var l=this._parseHTML(t,n);if(l.html.length){o.a.remove("meta"),document.head.append(l.metas),o.a.remove('[rel="canonical"]'),Array.from(l.links).forEach(function(t){document.head.append(t)}),document.body.classList=l.body_classes,i&&history.pushState({url:e},l.title,e),this._setTitle(l.title);var u=o.a.replaceElWithHTML(r,l.html);this._triggerOnload(u,n,r,l.route,a),"function"==typeof c&&c(u,n,r,s,a),this._addHistoryItem(e,l.route),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t,e){if("string"!=typeof(e=void 0===e?null:e)&&null!==e)throw"Provided parent_el (".concat(e,") is not a string or null");if(u=null,"object"==typeof t&&null!==t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(u=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),i=r.querySelector("title");i=i?i.innerText:null;var o=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList,c=t;if(e){var l=r.querySelector(e);if(!l)throw"Could not find parent selector ".concat(e);c=l.outerHTML}var u=u||this.getRouteFromMeta(r);return n=r=null,{title:i,route:u,metas:o,links:s,body_classes:a,html:c}},_triggerOnload:function(t,e,n,r,i){return this._onloadCallbacks.forEach(function(o){o(t,e,n,r,i)}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(i){i(t,e,n,r)}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(i){i(t,e,n,r)}),this},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e,n,r,i){i=void 0!==i&&i,n=void 0!==n&&n;var o=JSON.stringify(t),s="".concat(o," is not an object");if(void 0===t){if(i)throw s;return!1}if(!("object"==typeof t&&null!==t)||Array.isArray(t)){if(i)throw s;return!1}if(Array.isArray(e)){var a=!1,c=[],l=Object.keys(t);if(e.forEach(function(t){l.includes(t)?a=!0:c.push(t)}),!a){if(i)throw"".concat(o," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&c.length){if(i)throw"".concat(o," is missing data: ")+c.join(", ");return!1}if(r){var u=[];if(l.forEach(function(t){e.includes(t)||u.push(t)}),u.length){if(i)throw"".concat(o," contains invalid data: ")+u.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return i.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return i.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var i=r.a.getElements(t);if(!i.length)return t;var o=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return i.forEach(function(t){t.addEventListener(e,o,!1)}),o},on:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.addEventListener(e,n)}),i):t},off:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.removeEventListener(e,n)}),i):t},trigger:function(t,e,n,i){var o=r.a.getElements(t);return o.length?(n=void 0===n?null:n,(i=void 0===i?{}:i).detail=n,e=new CustomEvent(e,i),o.forEach(function(t){t.dispatchEvent(e)}),o):t}}},function(t,e){t.exports=axios},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(14);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return"https:"===window.location.protocol},getDomain:function(){return window.location.hostname||window.location.host},getDomainWithProtocol:function(){return window.location.origin},getURI:function(){return window.location.pathname},getURIWithQueryString:function(){return window.location.pathname+window.location.search},getFullURL:function(){return window.location.href},appendSlash:function(t){return"/"!==t[t.length-1]?t+"/":t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(2),i=n(7);class o{constructor(){}populate(t){var e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[i.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(t){return"get"+this.ucfirst(t)},setter:function(t){return"set"+this.ucfirst(t)},ucfirst:function(t){return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(4),s=n.n(o);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(15);var l={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class u{constructor(t,e){if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},l,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," is not a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," is not a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," is not a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;i.a.showLoader();var o=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:o}).then(function(n){i.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var o=i.a.parseHTML(r,e.getIncomingElementSelector());return o.html.length?e.insertForm(o,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r&&null!==r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw i.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function h(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class g extends u{constructor(t,e){if(super(null,e),"string"!=typeof t)throw"".concat(t," is not a string");if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(n,!0).forEach(function(e){f(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," is not a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," is not a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;i.a.showLoader(),s.a.get(this.getURL()).then(function(e){i.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=i.a.parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&null!==n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw i.a.hideLoader(),t})}insertForm(t,e,n){var i=this.getInsertIntoElement();if(null===i)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(i=r.a.getElement(i,!0)).innerHTML=t.html,n=i.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),i}onload(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return u}),n.d(e,"a",function(){return g})},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(2),i=n(6);function o(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,name:null,config:{}};class c extends i.a{constructor(t){if(super(),this._keys=["id","name","config"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}getId(){return this._id}setId(t){return this._id=t,this}getName(){return this._name}setName(t){return this._name=t,this}getConfig(){return this._config}setConfig(t){return r.a.isDataObject(t,null,!1,!1,!0),this._config=t,this}getConfigItem(t){return void 0===this._config[t]?null:this._config[t]}setConfigItem(t,e){return this._config[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(2),i=n(6);function o(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class c extends i.a{constructor(t){if(super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}setId(t){return this._id=t,this}getId(){return this._id}setIsGuest(t){return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(t){return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(t){return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(t){return this._fname=t,this}getLname(){return this._lname}setLname(t){return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(t){return this._email=t,this}getPhone(){return this._phone}setPhone(t){return this._phone=t,this}getPermissions(){return this._permissions}setPermissions(t){if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=t,this}addPermission(t){return this._permissions.push(t),this}removePermission(t){return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){return this.getPermissions().includes(t)}getAdditionalData(){return this._additionalData}setAdditionalData(t){return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=t,this}getDataItem(t){return void 0===this._additionalData[t]?null:this._additionalData[t]}setDataItem(t,e){return this._additionalData[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(3),i=n(0);class o{constructor(t,e,n,r){this.btn=i.a.getElement(t,!0,!0),this.toggle_el=i.a.getElement(e,!0,!0),this.hide_on_outside_click="boolean"!=typeof r||r,this.toggle_class="string"!=typeof n?"visible":n}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){i.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return p});var r=n(0),i=n(3),o=n(8),s=n(1),a=n(5),c=n(9),l=n(7),u=n(2),h=n(10),f=n(11);function d(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m={dom:r.a,events:i.a,XHRForm:o.b,FormFromURL:o.a,navigation:s.a,request:a.a,Site:c.a,strings:l.a,type_checks:u.a,User:h.a,ToggleOnMobile:f.a},p=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(n,!0).forEach(function(e){g(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},m,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,m)t?(void 0===window[t]&&(window[t]={}),window[t][e]=m[e]):window[e]=m[e]}});t.jpack=p}.call(this,n(13))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=url-search-params-polyfill},function(t,e){t.exports=formdata-polyfill}]); | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=13)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e)throw"".concat(e," must be a string");var r=this.getElement(t);if(!t){if(n)throw'Could not find "'.concat(t,'"');return null}var i=(new DOMParser).parseFromString(e,"text/html");return i=r.parentNode.insertBefore(i.documentElement.querySelector("body").childNodes[0],r),r.remove(),i},isVisible(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null===(t=this.getElement(t,e,n))){if(e)throw'Could not find "'.concat(t,'"');return!1}var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var i=t.getBoundingClientRect(),o={"top-left":{x:i.left,y:i.top},"top-right":{x:i.right,y:i.top},"bottom-left":{x:i.left,y:i.bottom},"bottom-right":{x:i.right,y:i.bottom},center:{x:i.left+t.offsetWidth/2,y:i.top+t.offsetHeight/2}},s=!0;return Object.keys(o).forEach(function(t){var e=o[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",function(){return o});var o={getValueOrClone:function(t){return null==t?null:"object"==typeof t?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(n,!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t):Array.isArray(t)?[...t]:t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(5),i=n.n(r),o=n(0),s=n(6),a=n(1),l={storeHistory:!0,getHistory:function(){return a.a.getValueOrClone(this._history)},getLastHistoryRecord(){return this._history.pop()},_addHistoryItem(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getRouteFromMeta();if(!this.storeHistory)return!1;if("string"!=typeof t)throw"".concat(t," must be a string");return this._history.push({url:t,route:e}),this},_history:[],setData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!=typeof t||null===t)throw"".concat(t," must be an object");return this._data=a.a.getValueOrClone(t),this},getData:function(){return a.a.getValueOrClone(this._data)},setDataItem:function(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._data[t]=a.a.getValueOrClone(e),this},getDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._data[t]||null===this._data[t]?null:a.a.getValueOrClone(this._data[t])},clearData:function(){return this.setData({}),this},clearDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0!==this._data[t]&&delete this._data[t],this},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._incomingElementSelector=t},_incomingElementSelector:"body",getIncomingElement:function(){return this._incomingElementSelector},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._replaceElementSelector=t},_replaceElementSelector:"body",getReplaceElement:function(){return this._replaceElementSelector},load:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getIncomingElement(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.getReplaceElement(),o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this;if("string"!=typeof t)throw"Provided URL (".concat(t,") must be a string");if("string"!=typeof n)throw"incoming_el (".concat(n,") must be a string");if("string"!=typeof r)throw"replace_el (".concat(r,") must be a string");var a=s.getData(),l=this.getRouteFromMeta();s.showLoader(),i.a.get(t).then(function(i){s.hideLoader(),s._replacePageContent(i.data,t,n,r,o,l,a,e)}).catch(function(e){s.hideLoader();var n="object"==typeof e&&null!==e&&e.isAxiosError?e:null;throw e=null!==n?n.response.statusText:e,s._triggerFail(e,t,a,n),e})},loaderEnabled:!0,setLoaderDelay:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;if("number"!=typeof t)throw"".concat(t," must be an integer");return this._loaderDelay=t,this},_loaderDelay:300,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:"progress page-navigation-loader",_loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated",_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=o.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.head,e=t.querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){return this._onloadCallbacks.push(t),this},removeOnload:function(t){this._onloadCallbacks.filter(function(e){return e!==t})},_onUnloadCallbacks:[],onUnload:function(t){return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){this._onUnloadCallbacks.filter(function(e){return e!==t})},_onFailCallbacks:[],onFail:function(t){return this._onFailCallbacks.push(t),this},removeOnFail:function(t){this._onFailCallbacks.filter(function(e){return e!==t})},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),null,null,null,!1)},this},_replacePageContent(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getIncomingElement(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.getReplaceElement(),i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;if(r=void 0!==r&&r?r:this.getReplaceElement(),"string"!=typeof e)throw"Provided url (".concat(e,") must be a string");if("string"!=typeof n)throw"incoming_el (".concat(n,") must be a string");if("string"!=typeof r)throw"replace_el (".concat(r,") must be a string");this._triggerUnload(o.a.getElement(r),r,s,a);var u=this._parseHTML(t,n);if(u.html.length){o.a.remove("meta"),document.head.append(u.metas),o.a.remove('[rel="canonical"]'),Array.from(u.links).forEach(function(t){document.head.append(t)}),document.body.classList=u.body_classes,i&&history.pushState({url:e},u.title,e),this._setTitle(u.title);var c=o.a.replaceElWithHTML(r,u.html);this._triggerOnload(c,n,r,u.route,a),"function"==typeof l&&l(c,n,r,s,a),this._addHistoryItem(e,u.route),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"!=typeof e&&null!==e)throw"Provided parent_el (".concat(e,") must be a string or null");if(c=null,"object"==typeof t&&null!==t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(c=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),i=r.querySelector("title");i=i?i.innerText:null;var o=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList,l=t;if(e){var u=r.querySelector(e);if(!u)throw"Could not find parent selector ".concat(e);l=u.outerHTML}var c=c||this.getRouteFromMeta(r);return n=r=null,{title:i,route:c,metas:o,links:s,body_classes:a,html:l}},_triggerOnload:function(t,e,n,r,i){return this._onloadCallbacks.forEach(function(o){o(t,e,n,r,i)}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(i){i(t,e,n,r)}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(i){i(t,e,n,r)}),this},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=JSON.stringify(t),s="".concat(o," must be an object");if(void 0===t){if(i)throw s;return!1}var a="object"==typeof t&&null!==t;if(!a||Array.isArray(t)){if(i)throw s;return!1}if(Array.isArray(e)){var l=!1,u=[],c=Object.keys(t);if(e.forEach(function(t){c.includes(t)?l=!0:u.push(t)}),!l){if(i)throw"".concat(o," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&u.length){if(i)throw"".concat(o," is missing data: ")+u.join(", ");return!1}if(r){var h=[];if(c.forEach(function(t){e.includes(t)||h.push(t)}),h.length){if(i)throw"".concat(o," contains invalid data: ")+h.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return i.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return i.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var i=r.a.getElements(t);if(!i.length)return t;var o=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return i.forEach(function(t){t.addEventListener(e,o,!1)}),o},on:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.addEventListener(e,n)}),i):t},off:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.removeEventListener(e,n)}),i):t},trigger:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.a.getElements(t);return o.length?(i.detail=n,e=new CustomEvent(e,i),o.forEach(function(t){t.dispatchEvent(e)}),o):t}}},function(t,e){t.exports=axios},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(15);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return"https:"===window.location.protocol},getDomain:function(){return window.location.hostname||window.location.host},getDomainWithProtocol:function(){return window.location.origin},getURI:function(){return window.location.pathname},getURIWithQueryString:function(){return window.location.pathname+window.location.search},getFullURL:function(){return window.location.href},appendSlash:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"/"!==t[t.length-1]?t+"/":t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(3),i=n(8);class o{constructor(){}populate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[i.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"get"+this.ucfirst(t)},setter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"set"+this.ucfirst(t)},ucfirst:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(5),s=n.n(o);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(16);var u={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class c{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof e||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){l(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," must be a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;i.a.showLoader();var o=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:o}).then(function(n){i.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var o=i.a.parseHTML(r,e.getIncomingElementSelector());return o.html.length?e.insertForm(o,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r&&null!==r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw i.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function h(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class g extends c{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(null,e),"string"!=typeof t)throw"".concat(t," must be a string");if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(n,!0).forEach(function(e){f(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," must be a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;i.a.showLoader(),s.a.get(this.getURL()).then(function(e){i.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=i.a.parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&null!==n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw i.a.hideLoader(),t})}insertForm(t,e,n){var i=this.getInsertIntoElement();if(null===i)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(i=r.a.getElement(i,!0)).innerHTML=t.html,n=i.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),i}onload(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return c}),n.d(e,"a",function(){return g})},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),i=n(7),o=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l={id:null,name:null,config:{}};class u extends i.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","name","config"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},l,{},t),this.populate(t)}getId(){return this._id}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getName(){return this._name}setName(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._name=t,this}getConfig(){return o.a.getValueOrClone(this._config)}setConfig(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._config=o.a.getValueOrClone(t),this}getConfigItem(t){return void 0===this._config[t]?null:o.a.getValueOrClone(this._config[t])}setConfigItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._config[t]=o.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),i=n(7),o=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class u extends i.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},l,{},t),this.populate(t)}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getId(){return this._id}setIsGuest(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._fname=t,this}getLname(){return this._lname}setLname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._email=t,this}getPhone(){return this._phone}setPhone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._phone=t,this}getPermissions(){return o.a.getValueOrClone(this._permissions)}setPermissions(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=o.a.getValueOrClone(t),this}addPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._permissions.push(t),this}removePermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.getPermissions().includes(t)}getAdditionalData(){return o.a.getValueOrClone(this._additionalData)}setAdditionalData(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=o.a.getValueOrClone(t),this}getDataItem(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._additionalData[t]?null:o.a.getValueOrClone(this._additionalData[t])}setDataItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._additionalData[t]=o.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(4),i=n(0);class o{constructor(t,e){arguments.length>2&&void 0!==arguments[2]&&arguments[2],!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.btn=i.a.getElement(t,!0,!0),this.toggle_el=i.a.getElement(e,!0,!0)}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){i.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return b});var r=n(0),i=n(4),o=n(9),s=n(2),a=n(6),l=n(10),u=n(8),c=n(3),h=n(11),f=n(12),d=n(1);function g(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p={dom:r.a,events:i.a,XHRForm:o.b,FormFromURL:o.a,navigation:s.a,request:a.a,Site:l.a,strings:u.a,type_checks:c.a,User:h.a,ToggleOnMobile:f.a,clone:d.a},b=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(n,!0).forEach(function(e){m(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},p,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,p)t?(void 0===window[t]&&(window[t]={}),window[t][e]=p[e]):window[e]=p[e]}});t.jpack=b}.call(this,n(14))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=url-search-params-polyfill},function(t,e){t.exports=formdata-polyfill}]); |
@@ -13,3 +13,3 @@ import {type_checks} from "./type_checks"; | ||
*/ | ||
populate(data){ | ||
populate(data = {}){ | ||
const self = this; | ||
@@ -16,0 +16,0 @@ |
@@ -13,3 +13,3 @@ /** | ||
*/ | ||
getElement: function(el, error_on_none, error_on_multiple){ | ||
getElement: function(el, error_on_none = false, error_on_multiple = false){ | ||
const foundEl = this.getElements(el, error_on_none); | ||
@@ -31,6 +31,3 @@ | ||
*/ | ||
getElements: function(el, error_on_none){ | ||
//default to false | ||
error_on_none = typeof error_on_none === "undefined" ? false : error_on_none; | ||
getElements: function(el, error_on_none = false){ | ||
//default to empty | ||
@@ -85,3 +82,3 @@ let el_array = []; | ||
*/ | ||
remove: function(el, error_if_not_found){ | ||
remove: function(el, error_if_not_found = false){ | ||
let el_array = this.getElements(el); | ||
@@ -108,4 +105,4 @@ if( !el_array.length ){ | ||
*/ | ||
replaceElWithHTML: function(el, html, error_if_not_found){ | ||
if( typeof html !== 'string' ) throw `${html} is not a string`; | ||
replaceElWithHTML: function(el, html, error_if_not_found = false){ | ||
if( typeof html !== 'string' ) throw `${html} must be a string`; | ||
@@ -140,3 +137,3 @@ const foundEl = this.getElement(el); | ||
*/ | ||
isVisible(el, error_if_not_found, error_on_multiple) { | ||
isVisible(el, error_if_not_found = false, error_on_multiple = false) { | ||
el = this.getElement(el, error_if_not_found, error_on_multiple); | ||
@@ -143,0 +140,0 @@ |
@@ -144,3 +144,3 @@ import {dom} from "../dom"; | ||
*/ | ||
trigger: function(el, event, data_to_pass, event_options){ | ||
trigger: function(el, event, data_to_pass = {}, event_options = {}){ | ||
const el_array = dom.getElements(el); | ||
@@ -152,5 +152,2 @@ | ||
event_options = typeof event_options === "undefined" ? {} : event_options; | ||
data_to_pass = typeof data_to_pass === "undefined" ? null : data_to_pass; | ||
event_options.detail = data_to_pass; | ||
@@ -157,0 +154,0 @@ |
@@ -28,10 +28,10 @@ import {navigation} from "../navigation"; | ||
*/ | ||
constructor(url, options){ | ||
constructor(url, options = {}){ | ||
super(null, options); | ||
if( typeof url !== "string" ) throw `${url} is not a string`; | ||
if( typeof url !== "string" ) throw `${url} must be a string`; | ||
//if options are undefined, set them | ||
options = typeof options === "undefined" ? {} : options; | ||
if( typeof options !== "object" || options === null ) throw `${options} is not an object`; | ||
if( typeof options !== "object" || options === null ) throw `${options} must be an object`; | ||
@@ -67,3 +67,3 @@ //extend defaults with provided options | ||
setURL(url){ | ||
if( typeof url !== 'string' ) throw `${url} is not a string`; | ||
if( typeof url !== 'string' ) throw `${url} must be a string`; | ||
this._url = url; | ||
@@ -121,3 +121,3 @@ return this; | ||
setIncomingElementSelector(selector){ | ||
if( selector !== null && typeof selector !== 'string' ) throw `${selector} is not a string or null value`; | ||
if( selector !== null && typeof selector !== 'string' ) throw `${selector} must be a string or null value`; | ||
this._incomingElementSelector = selector; | ||
@@ -260,3 +260,3 @@ return this; | ||
onload(callback){ | ||
if( typeof callback !== 'function' ) throw `${callback} is not a function`; | ||
if( typeof callback !== 'function' ) throw `${callback} must be a function`; | ||
if( typeof this._onload === "undefined" ) this._onload = []; | ||
@@ -263,0 +263,0 @@ this._onload.push(callback); |
@@ -45,7 +45,6 @@ import {dom} from "../dom"; | ||
*/ | ||
constructor(form, options){ | ||
constructor(form, options = {}){ | ||
//if options are undefined, set them | ||
options = typeof options === "undefined" ? {} : options; | ||
if( typeof options !== "object" || options === null ) throw `${options} is not an object`; | ||
if( typeof options !== "object" || options === null ) throw `${options} must be an object`; | ||
@@ -70,3 +69,3 @@ //extend defaults with provided options | ||
setValidateCallback(callback){ | ||
if( typeof callback !== "function" ) throw `${callback} is not a function`; | ||
if( typeof callback !== "function" ) throw `${callback} must be a function`; | ||
this._validateCallback = callback; | ||
@@ -130,3 +129,3 @@ return this; | ||
setSubmitMethod(method){ | ||
if( typeof method !== "string" && method !== null ) throw `${method} is not a string or null`; | ||
if( typeof method !== "string" && method !== null ) throw `${method} must be a string or null`; | ||
this._submitMethod = method; | ||
@@ -159,3 +158,3 @@ return this; | ||
&& typeof url !== "function" | ||
&& url !== null ) throw `${url} is not a string, function, or null`; | ||
&& url !== null ) throw `${url} must be a string, function, or null`; | ||
@@ -234,3 +233,3 @@ this._submitURL = url; | ||
onSuccess(callback){ | ||
if( typeof callback !== "function" ) throw `${callback} is not a function`; | ||
if( typeof callback !== "function" ) throw `${callback} must be a function`; | ||
if( typeof this._onSuccess === "undefined" ) this._onSuccess = []; | ||
@@ -270,3 +269,3 @@ this._onSuccess.push(callback); | ||
onError(callback){ | ||
if( typeof callback !== "function" ) throw `${callback} is not a function`; | ||
if( typeof callback !== "function" ) throw `${callback} must be a function`; | ||
if( typeof this._onError === "undefined" ) this._onError = []; | ||
@@ -273,0 +272,0 @@ this._onError.push(callback); |
import axios from 'axios'; | ||
import {dom} from "../dom"; | ||
import {request} from "../request"; | ||
import {clone} from "../clone"; | ||
@@ -24,3 +25,3 @@ /** | ||
getHistory: function(){ | ||
return this._history; | ||
return clone.getValueOrClone(this._history); | ||
}, | ||
@@ -35,4 +36,5 @@ /** | ||
}, | ||
_addHistoryItem(url, route){ | ||
if( !this._storeHistory ) return false; | ||
_addHistoryItem(url, route = this.getRouteFromMeta()){ | ||
if( !this.storeHistory ) return false; | ||
if( typeof url !== 'string' ) throw `${url} must be a string`; | ||
this._history.push({'url':url, 'route':route}); | ||
@@ -51,5 +53,5 @@ return this; | ||
*/ | ||
setData: function (data) { | ||
if( typeof data !== 'object' || data === null ) throw `${data} is not an object`; | ||
this._data = data; | ||
setData: function (data = {}) { | ||
if( typeof data !== 'object' || data === null ) throw `${data} must be an object`; | ||
this._data = clone.getValueOrClone(data); | ||
return this; | ||
@@ -60,6 +62,6 @@ }, | ||
* | ||
* @returns {null} | ||
* @returns object | ||
*/ | ||
getData: function () { | ||
return this._data; | ||
return clone.getValueOrClone(this._data); | ||
}, | ||
@@ -73,4 +75,4 @@ /** | ||
setDataItem: function(key, val){ | ||
if( typeof key !== 'string' ) throw `${key} is not a string`; | ||
this._data[key] = val; | ||
if( typeof key !== 'string' ) throw `${key} must be a string`; | ||
this._data[key] = clone.getValueOrClone(val); | ||
return this; | ||
@@ -82,6 +84,9 @@ }, | ||
* @param key | ||
* @returns {null} | ||
* @returns mixed | ||
*/ | ||
getDataItem: function(key){ | ||
return typeof this._data[key] !== 'undefined' ? this._data[key] : null; | ||
if( typeof key !== 'string' ) throw `${key} must be a string`; | ||
//if not defined or null, return null | ||
if( typeof this._data[key] === 'undefined' || this._data[key] === null ) return null; | ||
return clone.getValueOrClone(this._data[key]); | ||
}, | ||
@@ -104,3 +109,3 @@ /** | ||
clearDataItem: function(key){ | ||
if( typeof key !== 'string' ) throw `${key} is not a string`; | ||
if( typeof key !== 'string' ) throw `${key} must be a string`; | ||
if( typeof this._data[key] !== 'undefined' ){ | ||
@@ -119,3 +124,3 @@ delete this._data[key]; | ||
setIncomingElement: function (selector_string) { | ||
if (typeof selector_string !== 'string') throw `${selector_string} is not a string`; | ||
if (typeof selector_string !== 'string') throw `${selector_string} must be a string`; | ||
this._incomingElementSelector = selector_string; | ||
@@ -137,3 +142,3 @@ }, | ||
setReplaceElement: function (selector_string) { | ||
if (typeof selector_string !== 'string') throw `${selector_string} is not a string`; | ||
if (typeof selector_string !== 'string') throw `${selector_string} must be a string`; | ||
this._replaceElementSelector = selector_string; | ||
@@ -165,15 +170,11 @@ }, | ||
*/ | ||
load: function (url, callback, incoming_el, replace_el, push_state) { | ||
load: function (url, callback, incoming_el = this.getIncomingElement(), replace_el = this.getReplaceElement(), push_state = true) { | ||
const self = this; | ||
if (typeof url !== 'string') throw `Provided URL (${url}) is not a string`; | ||
if (typeof url !== 'string') throw `Provided URL (${url}) must be a string`; | ||
incoming_el = typeof incoming_el == 'undefined' || !incoming_el ? self.getIncomingElement() : incoming_el; | ||
replace_el = typeof replace_el === 'undefined' || !replace_el ? self.getReplaceElement() : replace_el; | ||
push_state = typeof push_state === 'undefined' ? true : push_state; | ||
if (typeof incoming_el !== 'string') throw `incoming_el (${incoming_el}) must be a string`; | ||
if (typeof replace_el !== 'string') throw `replace_el (${replace_el}) must be a string`; | ||
if (typeof incoming_el !== 'string') throw `Provided incoming_el (${incoming_el}) is not a string`; | ||
if (typeof replace_el !== 'string') throw `Provided replace_el (${replace_el}) is not a string`; | ||
//cache in case it changes during this process | ||
//cache in case it changes during this process because axios is async | ||
const data = self.getData(); | ||
@@ -186,3 +187,2 @@ const current_route = this.getRouteFromMeta(); | ||
self.hideLoader(); | ||
self._replacePageContent(response.data, url, incoming_el, replace_el, push_state, current_route, data, callback); | ||
@@ -215,4 +215,4 @@ }).catch(function (error) { | ||
*/ | ||
setLoaderDelay: function (delay_in_ms) { | ||
if (typeof delay_in_ms !== "number") throw `${delay_in_ms} is not an integer`; | ||
setLoaderDelay: function (delay_in_ms = 300) { | ||
if (typeof delay_in_ms !== "number") throw `${delay_in_ms} must be an integer`; | ||
this._loaderDelay = delay_in_ms; | ||
@@ -298,4 +298,3 @@ return this; | ||
*/ | ||
getRouteFromMeta: function (html) { | ||
html = typeof html === 'undefined' ? document.head : html; | ||
getRouteFromMeta: function (html = document.head) { | ||
var route = html.querySelector('[name="current_route"]'); | ||
@@ -432,13 +431,10 @@ route = route ? route.content : null; | ||
*/ | ||
_replacePageContent(html, url, incoming_el, replace_el, push_state, current_route, data, one_time_callback) { | ||
_replacePageContent(html, url, incoming_el = this.getIncomingElement(), replace_el = this.getReplaceElement(), push_state = true, current_route = null, data = {}, one_time_callback = null) { | ||
const self = this; | ||
push_state = typeof push_state === 'undefined' ? true : push_state; | ||
incoming_el = typeof incoming_el === 'undefined' || !incoming_el ? self.getIncomingElement() : incoming_el; | ||
replace_el = typeof replace_el === 'undefined' || !replace_el ? self.getReplaceElement() : replace_el; | ||
if (typeof url !== 'string') throw `Provided url (${url}) is not a string`; | ||
if (typeof incoming_el !== 'string') throw `Provided incoming_el (${incoming_el}) is not a string`; | ||
if (typeof replace_el !== 'string') throw `Provided replace_el (${replace_el}) is not a string`; | ||
if (typeof url !== 'string') throw `Provided url (${url}) must be a string`; | ||
if (typeof incoming_el !== 'string') throw `incoming_el (${incoming_el}) must be a string`; | ||
if (typeof replace_el !== 'string') throw `replace_el (${replace_el}) must be a string`; | ||
@@ -507,10 +503,7 @@ self._triggerUnload(dom.getElement(replace_el), replace_el, current_route, data); | ||
*/ | ||
_parseHTML(html, parent_el) { | ||
_parseHTML(html, parent_el = null) { | ||
var self = this; | ||
//default to null if not provided | ||
parent_el = typeof parent_el === 'undefined' ? null : parent_el; | ||
//must be a string or null | ||
if (typeof parent_el !== 'string' && parent_el !== null) throw `Provided parent_el (${parent_el}) is not a string or null`; | ||
if (typeof parent_el !== 'string' && parent_el !== null) throw `Provided parent_el (${parent_el}) must be a string or null`; | ||
@@ -613,3 +606,2 @@ route = null; | ||
* @param data | ||
* @param route | ||
* @param axios_error | ||
@@ -616,0 +608,0 @@ * @returns {navigation} |
@@ -87,5 +87,5 @@ require('url-search-params-polyfill'); | ||
*/ | ||
appendSlash: function(url){ | ||
appendSlash: function(url = ''){ | ||
return url[url.length-1] !== '/' ? url+'/' : url; | ||
}, | ||
}; |
import {type_checks} from "../type_checks"; | ||
import {AbstractClass} from "../AbstractClass"; | ||
import {clone} from "../clone"; | ||
@@ -19,3 +20,3 @@ //create an object of default values | ||
export class Site extends AbstractClass { | ||
constructor(data){ | ||
constructor(data = {}){ | ||
super(); | ||
@@ -25,4 +26,2 @@ | ||
if( typeof data === "undefined" ) return this; | ||
//extend user_defaults with incoming data | ||
@@ -39,2 +38,3 @@ data = {...site_defaults, ...data}; | ||
setId(id) { | ||
if( typeof id !== 'number' && id !== null ) throw `${id} must be a number or null`; | ||
this._id = id; | ||
@@ -50,2 +50,3 @@ return this; | ||
setName(name) { | ||
if( typeof name !== 'string' && name !== null ) throw `${name} must be a string or null`; | ||
this._name = name; | ||
@@ -57,11 +58,10 @@ return this; | ||
getConfig() { | ||
return this._config; | ||
return clone.getValueOrClone(this._config); | ||
} | ||
//sets all config data using the provided object | ||
setConfig(config) { | ||
setConfig(config = {}) { | ||
//must be a data object, even if it's empty | ||
type_checks.isDataObject(config, null, false, false, true); | ||
this._config = config; | ||
this._config = clone.getValueOrClone(config); | ||
return this; | ||
@@ -72,3 +72,3 @@ } | ||
getConfigItem(key) { | ||
return typeof this._config[key] === "undefined" ? null : this._config[key]; | ||
return typeof this._config[key] === "undefined" ? null : clone.getValueOrClone(this._config[key]); | ||
} | ||
@@ -78,5 +78,6 @@ | ||
setConfigItem(key, val) { | ||
this._config[key] = val; | ||
if( typeof key !== 'string' ) throw `${key} must be a string`; | ||
this._config[key] = clone.getValueOrClone(val); | ||
return this; | ||
} | ||
} |
@@ -14,3 +14,3 @@ /** | ||
*/ | ||
getter: function(string){ | ||
getter: function(string = ''){ | ||
return 'get'+this.ucfirst(string); | ||
@@ -27,3 +27,3 @@ }, | ||
*/ | ||
setter: function(string){ | ||
setter: function(string = ''){ | ||
return 'set'+this.ucfirst(string); | ||
@@ -38,5 +38,5 @@ }, | ||
*/ | ||
ucfirst: function(string){ | ||
ucfirst: function(string = ''){ | ||
return string && string[0].toUpperCase()+string.slice(1); | ||
} | ||
}; |
@@ -28,12 +28,6 @@ import {events} from "../events"; | ||
*/ | ||
constructor(btn, toggle_el, toggle_class, hide_on_outside_click){ | ||
constructor(btn, toggle_el, toggle_class = 'visible', hide_on_outside_click = true){ | ||
//set the elements | ||
this.btn = dom.getElement(btn, true, true); | ||
this.toggle_el = dom.getElement(toggle_el, true, true); | ||
//default to true | ||
this.hide_on_outside_click = typeof hide_on_outside_click !== "boolean" ? true : hide_on_outside_click; | ||
//if not a string, default to "visible" | ||
this.toggle_class = typeof toggle_class !== 'string' ? 'visible' : toggle_class; | ||
} | ||
@@ -40,0 +34,0 @@ |
@@ -20,9 +20,3 @@ /** | ||
*/ | ||
isDataObject: function(value, keys, require_all_keys, block_other_keys, throw_error){ | ||
//default for throw_error is false | ||
throw_error = typeof throw_error !== "undefined" ? throw_error : false; | ||
//default for require_all_keys is false | ||
require_all_keys = typeof require_all_keys !== "undefined" ? require_all_keys : false; | ||
isDataObject: function(value, keys, require_all_keys = false, block_other_keys = false, throw_error = false){ | ||
//for error messages | ||
@@ -32,3 +26,3 @@ var stringified_val = JSON.stringify(value); | ||
//default error_msg | ||
const error_msg = `${stringified_val} is not an object`; | ||
const error_msg = `${stringified_val} must be an object`; | ||
@@ -35,0 +29,0 @@ //if not provided |
import {type_checks} from "../type_checks"; | ||
import {AbstractClass} from "../AbstractClass"; | ||
import {clone} from "../clone"; | ||
@@ -26,3 +27,3 @@ //create an object of default values | ||
export class User extends AbstractClass{ | ||
constructor(data) { | ||
constructor(data = {}) { | ||
super(); | ||
@@ -32,4 +33,2 @@ | ||
if( typeof data === "undefined" ) return this; | ||
//extend user_defaults with incoming data | ||
@@ -42,2 +41,3 @@ data = {...user_defaults, ...data}; | ||
setId(id){ | ||
if( typeof id !== 'number' && id !== null ) throw `${id} must be a number or null`; | ||
this._id = id; | ||
@@ -50,3 +50,3 @@ return this; | ||
setIsGuest(is_guest){ | ||
setIsGuest(is_guest = false){ | ||
this._isGuest = is_guest; | ||
@@ -59,3 +59,3 @@ return this; | ||
setIsAdmin(is_admin){ | ||
setIsAdmin(is_admin = false){ | ||
this._isAdmin = is_admin; | ||
@@ -68,3 +68,4 @@ return this; | ||
setUsername(username){ | ||
setUsername(username = null){ | ||
if( typeof username !== 'string' && username !== null ) throw `${username} must be a string or null`; | ||
this._username = username; | ||
@@ -80,3 +81,4 @@ return this; | ||
} | ||
setFname(first_name){ | ||
setFname(first_name = null){ | ||
if( typeof first_name !== 'string' && first_name !== null ) throw `${first_name} must be a string or null`; | ||
this._fname = first_name; | ||
@@ -89,3 +91,4 @@ return this; | ||
} | ||
setLname(last_name){ | ||
setLname(last_name = null){ | ||
if( typeof last_name !== 'string' && last_name !== null ) throw `${last_name} must be a string or null`; | ||
this._lname = last_name; | ||
@@ -103,3 +106,4 @@ return this; | ||
} | ||
setEmail(email){ | ||
setEmail(email = null){ | ||
if( typeof email !== 'string' && email !== null ) throw `${email} must be a string or null`; | ||
this._email = email; | ||
@@ -112,3 +116,4 @@ return this; | ||
} | ||
setPhone(phone){ | ||
setPhone(phone = null){ | ||
if( typeof phone !== 'string' && phone !== null ) throw `${phone} must be a string or null`; | ||
this._phone = phone; | ||
@@ -120,9 +125,8 @@ return this; | ||
getPermissions(){ | ||
return this._permissions; | ||
return clone.getValueOrClone(this._permissions); | ||
} | ||
//sets all permissions for this user | ||
setPermissions(permissions){ | ||
setPermissions(permissions = []){ | ||
if( !Array.isArray(permissions) ) throw "setPermissions requires an array"; | ||
this._permissions = permissions; | ||
this._permissions = clone.getValueOrClone(permissions); | ||
return this; | ||
@@ -132,2 +136,3 @@ } | ||
addPermission(permission){ | ||
if( typeof permission !== 'string' ) throw `${permission} must be a string`; | ||
this._permissions.push(permission); | ||
@@ -138,2 +143,3 @@ return this; | ||
removePermission(permission){ | ||
if( typeof permission !== 'string' ) throw `${permission} must be a string`; | ||
this.setPermissions(this._permissions.filter(function(ele){ | ||
@@ -146,2 +152,3 @@ return ele !== permission; | ||
hasPermission(permission){ | ||
if( typeof permission !== 'string' ) throw `${permission} must be a string`; | ||
return this.getPermissions().includes(permission); | ||
@@ -152,10 +159,9 @@ } | ||
getAdditionalData(){ | ||
return this._additionalData; | ||
return clone.getValueOrClone(this._additionalData); | ||
} | ||
//sets all additional data for this user | ||
setAdditionalData(additional_data){ | ||
setAdditionalData(additional_data = {}){ | ||
//must be a data object, even if it's empty | ||
type_checks.isDataObject(additional_data, null, false, false, true); | ||
this._additionalData = additional_data; | ||
this._additionalData = clone.getValueOrClone(additional_data); | ||
return this; | ||
@@ -165,9 +171,11 @@ } | ||
getDataItem(key){ | ||
return typeof this._additionalData[key] === "undefined" ? null : this._additionalData[key]; | ||
if( typeof key !== 'string' ) throw `${key} must be a string`; | ||
return typeof this._additionalData[key] === "undefined" ? null : clone.getValueOrClone(this._additionalData[key]); | ||
} | ||
//sets a single additional data value for this user | ||
setDataItem(key, val){ | ||
this._additionalData[key] = val; | ||
if( typeof key !== 'string' ) throw `${key} must be a string`; | ||
this._additionalData[key] = clone.getValueOrClone(val); | ||
return this; | ||
} | ||
} |
{ | ||
"name": "@htmlguyllc/jpack", | ||
"version": "9.0.9", | ||
"version": "9.0.10", | ||
"description": "Core Javascript Library of Everyday Objects, Events, and Utilities", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -11,2 +11,3 @@ import {dom} from "../es/dom"; | ||
import {ToggleOnMobile} from "../es/toggle/ToggleOnMobile"; | ||
import {clone} from "../es/clone"; | ||
@@ -25,3 +26,4 @@ //create a key:val object of all components | ||
User:User, | ||
ToggleOnMobile:ToggleOnMobile | ||
ToggleOnMobile:ToggleOnMobile, | ||
clone: clone, | ||
}; | ||
@@ -28,0 +30,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
656024
39
7145