@salla.sa/twilight 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/twilight.js +1239 -2
- package/package.json +1 -1
- package/dist/twilight.js.LICENSE.txt +0 -27
package/dist/twilight.js
CHANGED
|
@@ -1,2 +1,1239 @@
|
|
|
1
|
-
|
|
2
|
-
(()=>{var __webpack_modules__={4559:(e,t,n)=>{e.exports=n(9335)},1786:(e,t,n)=>{"use strict";var r=n(8266),i=n(5608),s=n(9568),o=n(3943),a=n(8201),l=n(1745),c=n(7979);e.exports=function(e){return new Promise((function(t,u){var h=e.data,d=e.headers;r.isFormData(h)&&delete d["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",m=e.auth.password||"";d.Authorization="Basic "+btoa(p+":"+m)}var g=o(e.baseURL,e.url);if(f.open(e.method.toUpperCase(),s(g,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,f.onreadystatechange=function(){if(f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in f?a(f.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:e,request:f};i(t,u,r),f=null}},f.onabort=function(){f&&(u(c("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){u(c("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),u(c(t,e,"ECONNABORTED",f)),f=null},r.isStandardBrowserEnv()){var v=n(159),y=(e.withCredentials||l(g))&&e.xsrfCookieName?v.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in f&&r.forEach(d,(function(e,t){void 0===h&&"content-type"===t.toLowerCase()?delete d[t]:f.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),e.responseType)try{f.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),u(e),f=null)})),void 0===h&&(h=null),f.send(h)}))}},9335:(e,t,n)=>{"use strict";var r=n(8266),i=n(4345),s=n(7929),o=n(650);function a(e){var t=new s(e),n=i(s.prototype.request,t);return r.extend(n,s.prototype,t),r.extend(n,t),n}var l=a(n(9046));l.Axios=s,l.create=function(e){return a(o(l.defaults,e))},l.Cancel=n(9760),l.CancelToken=n(7510),l.isCancel=n(8825),l.all=function(e){return Promise.all(e)},l.spread=n(4346),e.exports=l,e.exports.default=l},9760:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},7510:(e,t,n)=>{"use strict";var r=n(9760);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},8825:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},7929:(e,t,n)=>{"use strict";var r=n(8266),i=n(9568),s=n(6252),o=n(6029),a=n(650);function l(e){this.defaults=e,this.interceptors={request:new s,response:new s}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[o,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},l.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(r.merge(n||{},{method:e,url:t}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,i){return this.request(r.merge(i||{},{method:e,url:t,data:n}))}})),e.exports=l},6252:(e,t,n)=>{"use strict";var r=n(8266);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},3943:(e,t,n)=>{"use strict";var r=n(406),i=n(5027);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},7979:(e,t,n)=>{"use strict";var r=n(2050);e.exports=function(e,t,n,i,s){var o=new Error(e);return r(o,t,n,i,s)}},6029:(e,t,n)=>{"use strict";var r=n(8266),i=n(2661),s=n(8825),o=n(9046);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return a(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(a(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},2050:e=>{"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.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}},e}},650:(e,t,n)=>{"use strict";var r=n(8266);e.exports=function(e,t){t=t||{};var n={},i=["url","method","params","data"],s=["headers","auth","proxy"],o=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(i,(function(e){void 0!==t[e]&&(n[e]=t[e])})),r.forEach(s,(function(i){r.isObject(t[i])?n[i]=r.deepMerge(e[i],t[i]):void 0!==t[i]?n[i]=t[i]:r.isObject(e[i])?n[i]=r.deepMerge(e[i]):void 0!==e[i]&&(n[i]=e[i])})),r.forEach(o,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var a=i.concat(s).concat(o),l=Object.keys(t).filter((function(e){return-1===a.indexOf(e)}));return r.forEach(l,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n}},5608:(e,t,n)=>{"use strict";var r=n(7979);e.exports=function(e,t,n){var i=n.config.validateStatus;!i||i(n.status)?e(n):t(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},2661:(e,t,n)=>{"use strict";var r=n(8266);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},9046:(e,t,n)=>{"use strict";var r=n(8266),i=n(1490),s={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,l={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(a=n(1786)),a),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(s)})),e.exports=l},4345:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},9568:(e,t,n)=>{"use strict";var r=n(8266);function i(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(r.isURLSearchParams(t))s=t.toString();else{var o=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),o.push(i(t)+"="+i(e))})))})),s=o.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},5027:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},159:(e,t,n)=>{"use strict";var r=n(8266);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,s,o){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},406:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},1745:(e,t,n)=>{"use strict";var r=n(8266);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(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 e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},1490:(e,t,n)=>{"use strict";var r=n(8266);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},8201:(e,t,n)=>{"use strict";var r=n(8266),i=["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"];e.exports=function(e){var t,n,s,o={};return e?(r.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},4346:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},8266:(e,t,n)=>{"use strict";var r=n(4345),i=Object.prototype.toString;function s(e){return"[object Array]"===i.call(e)}function o(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function l(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isUndefined:o,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:l,isStream:function(e){return a(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e 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 e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return t},deepMerge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]="object"==typeof n?e({},n):n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,(function(t,i){e[i]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},7138:function(e){var t,n;t="undefined"!=typeof window?window:this,n=function(){function e(){}let t=e.prototype;return t.on=function(e,t){if(!e||!t)return this;let n=this._events=this._events||{},r=n[e]=n[e]||[];return r.includes(t)||r.push(t),this},t.once=function(e,t){if(!e||!t)return this;this.on(e,t);let n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this},t.off=function(e,t){let n=this._events&&this._events[e];if(!n||!n.length)return this;let r=n.indexOf(t);return-1!=r&&n.splice(r,1),this},t.emitEvent=function(e,t){let n=this._events&&this._events[e];if(!n||!n.length)return this;n=n.slice(0),t=t||[];let r=this._onceEvents&&this._onceEvents[e];for(let i of n)r&&r[i]&&(this.off(e,i),delete r[i]),i.apply(this,t);return this},t.allOff=function(){return delete this._events,delete this._onceEvents,this},e},e.exports?e.exports=n():t.EvEmitter=n()},35:(e,t,n)=>{var r;!function(i){var s=Object.hasOwnProperty,o=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},a="object"==typeof process&&"function"==typeof process.nextTick,l="function"==typeof Symbol,c="object"==typeof Reflect,u="function"==typeof setImmediate?setImmediate:setTimeout,h=l?c&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(e){var t=Object.getOwnPropertyNames(e);return t.push.apply(t,Object.getOwnPropertySymbols(e)),t}:Object.keys;function d(){this._events={},this._conf&&f.call(this,this._conf)}function f(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners!==i&&(this._maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(e,t){var n="(node) warning: possible EventEmitter memory leak detected. "+e+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(n+=" Event name: "+t+"."),"undefined"!=typeof process&&process.emitWarning){var r=new Error(n);r.name="MaxListenersExceededWarning",r.emitter=this,r.count=e,process.emitWarning(r)}else console.error(n),console.trace&&console.trace()}var m=function(e,t,n){var r=arguments.length;switch(r){case 0:return[];case 1:return[e];case 2:return[e,t];case 3:return[e,t,n];default:for(var i=new Array(r);r--;)i[r]=arguments[r];return i}};function g(e,t){for(var n={},r=e.length,s=t?value.length:0,o=0;o<r;o++)n[e[o]]=o<s?t[o]:i;return n}function v(e,t,n){var r,i;if(this._emitter=e,this._target=t,this._listeners={},this._listenersCount=0,(n.on||n.off)&&(r=n.on,i=n.off),t.addEventListener?(r=t.addEventListener,i=t.removeEventListener):t.addListener?(r=t.addListener,i=t.removeListener):t.on&&(r=t.on,i=t.off),!r&&!i)throw Error("target does not implement any known event API");if("function"!=typeof r)throw TypeError("on method must be a function");if("function"!=typeof i)throw TypeError("off method must be a function");this._on=r,this._off=i;var s=e._observers;s?s.push(this):e._observers=[this]}function y(e,t,n,r){var o=Object.assign({},t);if(!e)return o;if("object"!=typeof e)throw TypeError("options must be an object");var a,l,c,u=Object.keys(e),h=u.length;function d(e){throw Error('Invalid "'+a+'" option value'+(e?". Reason: "+e:""))}for(var f=0;f<h;f++){if(a=u[f],!r&&!s.call(t,a))throw Error('Unknown "'+a+'" option');(l=e[a])!==i&&(c=n[a],o[a]=c?c(l,d):l)}return o}function _(e,t){return"function"==typeof e&&e.hasOwnProperty("prototype")||t("value must be a constructor"),e}function b(e){var t="value must be type of "+e.join("|"),n=e.length,r=e[0],i=e[1];return 1===n?function(e,n){if(typeof e===r)return e;n(t)}:2===n?function(e,n){var s=typeof e;if(s===r||s===i)return e;n(t)}:function(r,i){for(var s=typeof r,o=n;o-- >0;)if(s===e[o])return r;i(t)}}Object.assign(v.prototype,{subscribe:function(e,t,n){var r=this,i=this._target,s=this._emitter,o=this._listeners,a=function(){var r=m.apply(null,arguments),o={data:r,name:t,original:e};if(n){var a=n.call(i,o);!1!==a&&s.emit.apply(s,[o.name].concat(r))}else s.emit.apply(s,[t].concat(r))};if(o[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,s._newListener&&s._removeListener&&!r._onNewListener?(this._onNewListener=function(n){n===t&&null===o[e]&&(o[e]=a,r._on.call(i,e,a))},s.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===t&&!s.hasListeners(n)&&o[e]&&(o[e]=null,r._off.call(i,e,a))},o[e]=null,s.on("removeListener",this._onRemoveListener)):(o[e]=a,r._on.call(i,e,a))},unsubscribe:function(e){var t,n,r,i=this,s=this._listeners,o=this._emitter,a=this._off,l=this._target;if(e&&"string"!=typeof e)throw TypeError("event must be a string");function c(){i._onNewListener&&(o.off("newListener",i._onNewListener),o.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var e=x.call(o,i);o._observers.splice(e,1)}if(e){if(!(t=s[e]))return;a.call(l,e,t),delete s[e],--this._listenersCount||c()}else{for(r=(n=h(s)).length;r-- >0;)e=n[r],a.call(l,e,s[e]);this._listeners={},this._listenersCount=0,c()}}});var w=b(["function"]),S=b(["object","function"]);function E(e,t,n){var r,i,s,o=0,a=new e((function(l,c,u){function h(){i&&(i=null),o&&(clearTimeout(o),o=0)}n=y(n,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),r=!n.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof u;var d=function(e){h(),l(e)},f=function(e){h(),c(e)};r?t(d,f,u):(i=[function(e){f(e||Error("canceled"))}],t(d,f,(function(e){if(s)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");i.push(e)})),s=!0),n.timeout>0&&(o=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",o=0,a.cancel(e),c(e)}),n.timeout))}));return r||(a.cancel=function(e){if(i){for(var t=i.length,n=1;n<t;n++)i[n](e);i[0](e),i=null}}),a}function x(e){var t=this._observers;if(!t)return-1;for(var n=t.length,r=0;r<n;r++)if(t[r]._target===e)return r;return-1}function k(e,t,n,r,i){if(!n)return null;if(0===r){var s=typeof t;if("string"===s){var o,a,l=0,c=0,u=this.delimiter,d=u.length;if(-1!==(a=t.indexOf(u))){o=new Array(5);do{o[l++]=t.slice(c,a),c=a+d}while(-1!==(a=t.indexOf(u,c)));o[l++]=t.slice(c),t=o,i=l}else t=[t],i=1}else"object"===s?i=t.length:(t=[t],i=1)}var f,p,m,g,v,y,_,b=null,w=t[r],S=t[r+1];if(r===i)n._listeners&&("function"==typeof n._listeners?(e&&e.push(n._listeners),b=[n]):(e&&e.push.apply(e,n._listeners),b=[n]));else{if("*"===w){for(a=(y=h(n)).length;a-- >0;)"_listeners"!==(f=y[a])&&(_=k(e,t,n[f],r+1,i))&&(b?b.push.apply(b,_):b=_);return b}if("**"===w){for((v=r+1===i||r+2===i&&"*"===S)&&n._listeners&&(b=k(e,t,n,i,i)),a=(y=h(n)).length;a-- >0;)"_listeners"!==(f=y[a])&&("*"===f||"**"===f?(n[f]._listeners&&!v&&(_=k(e,t,n[f],i,i))&&(b?b.push.apply(b,_):b=_),_=k(e,t,n[f],r,i)):_=k(e,t,n[f],f===S?r+2:r,i),_&&(b?b.push.apply(b,_):b=_));return b}n[w]&&(b=k(e,t,n[w],r+1,i))}if((p=n["*"])&&k(e,t,p,r+1,i),m=n["**"])if(r<i)for(m._listeners&&k(e,t,m,i,i),a=(y=h(m)).length;a-- >0;)"_listeners"!==(f=y[a])&&(f===S?k(e,t,m[f],r+2,i):f===w?k(e,t,m[f],r+1,i):((g={})[f]=m[f],k(e,t,{"**":g},r+1,i)));else m._listeners?k(e,t,m,i,i):m["*"]&&m["*"]._listeners&&k(e,t,m["*"],i,i);return b}function L(e,t,n){var r,i,s=0,o=0,a=this.delimiter,l=a.length;if("string"==typeof e)if(-1!==(r=e.indexOf(a))){i=new Array(5);do{i[s++]=e.slice(o,r),o=r+l}while(-1!==(r=e.indexOf(a,o)));i[s++]=e.slice(o)}else i=[e],s=1;else i=e,s=e.length;if(s>1)for(r=0;r+1<s;r++)if("**"===i[r]&&"**"===i[r+1])return;var c,u=this.listenerTree;for(r=0;r<s;r++)if(u=u[c=i[r]]||(u[c]={}),r===s-1)return u._listeners?("function"==typeof u._listeners&&(u._listeners=[u._listeners]),n?u._listeners.unshift(t):u._listeners.push(t),!u._listeners.warned&&this._maxListeners>0&&u._listeners.length>this._maxListeners&&(u._listeners.warned=!0,p.call(this,u._listeners.length,c))):u._listeners=t,!0;return!0}function A(e,t,n,r){for(var i,s,o,a,l=h(e),c=l.length,u=e._listeners;c-- >0;)i=e[s=l[c]],o="_listeners"===s?n:n?n.concat(s):[s],a=r||"symbol"==typeof s,u&&t.push(a?o:o.join(this.delimiter)),"object"==typeof i&&A.call(this,i,t,o,a);return t}function P(e){for(var t,n,r,i=h(e),s=i.length;s-- >0;)(t=e[n=i[s]])&&(r=!0,"_listeners"===n||P(t)||delete e[n]);return r}function F(e,t,n){this.emitter=e,this.event=t,this.listener=n}function j(e,t,n){if(!0===n)s=!0;else if(!1===n)r=!0;else{if(!n||"object"!=typeof n)throw TypeError("options should be an object or true");var r=n.async,s=n.promisify,o=n.nextTick,l=n.objectify}if(r||o||s){var c=t,h=t._origin||t;if(o&&!a)throw Error("process.nextTick is not supported");s===i&&(s="AsyncFunction"===t.constructor.name),t=function(){var e=arguments,t=this,n=this.event;return s?o?Promise.resolve():new Promise((function(e){u(e)})).then((function(){return t.event=n,c.apply(t,e)})):(o?process.nextTick:u)((function(){t.event=n,c.apply(t,e)}))},t._async=!0,t._origin=h}return[t,l?new F(this,e,t):this]}function q(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,f.call(this,e)}F.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},q.EventEmitter2=q,q.prototype.listenTo=function(e,t,n){if("object"!=typeof e)throw TypeError("target musts be an object");var r=this;function s(t){if("object"!=typeof t)throw TypeError("events must be an object");var i,s=n.reducers,o=x.call(r,e);i=-1===o?new v(r,e,n):r._observers[o];for(var a,l=h(t),c=l.length,u="function"==typeof s,d=0;d<c;d++)a=l[d],i.subscribe(a,t[a]||a,u?s:s&&s[a])}return n=y(n,{on:i,off:i,reducers:i},{on:w,off:w,reducers:S}),o(t)?s(g(t)):s("string"==typeof t?g(t.split(/\s+/)):t),this},q.prototype.stopListeningTo=function(e,t){var n=this._observers;if(!n)return!1;var r,i=n.length,s=!1;if(e&&"object"!=typeof e)throw TypeError("target should be an object");for(;i-- >0;)r=n[i],e&&r._target!==e||(r.unsubscribe(t),s=!0);return s},q.prototype.delimiter=".",q.prototype.setMaxListeners=function(e){e!==i&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},q.prototype.getMaxListeners=function(){return this._maxListeners},q.prototype.event="",q.prototype.once=function(e,t,n){return this._once(e,t,!1,n)},q.prototype.prependOnceListener=function(e,t,n){return this._once(e,t,!0,n)},q.prototype._once=function(e,t,n,r){return this._many(e,1,t,n,r)},q.prototype.many=function(e,t,n,r){return this._many(e,t,n,!1,r)},q.prototype.prependMany=function(e,t,n,r){return this._many(e,t,n,!0,r)},q.prototype._many=function(e,t,n,r,i){var s=this;if("function"!=typeof n)throw new Error("many only accepts instances of Function");function o(){return 0==--t&&s.off(e,o),n.apply(this,arguments)}return o._origin=n,this._on(e,o,r,i)},q.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var e,t,n,r,i,s,o=arguments[0],a=this.wildcard;if("newListener"===o&&!this._newListener&&!this._events.newListener)return!1;if(a&&(e=o,"newListener"!==o&&"removeListener"!==o&&"object"==typeof o)){if(n=o.length,l)for(r=0;r<n;r++)if("symbol"==typeof o[r]){s=!0;break}s||(o=o.join(this.delimiter))}var c,u=arguments.length;if(this._all&&this._all.length)for(r=0,n=(c=this._all.slice()).length;r<n;r++)switch(this.event=o,u){case 1:c[r].call(this,o);break;case 2:c[r].call(this,o,arguments[1]);break;case 3:c[r].call(this,o,arguments[1],arguments[2]);break;default:c[r].apply(this,arguments)}if(a)c=[],k.call(this,c,e,this.listenerTree,0,n);else{if("function"==typeof(c=this._events[o])){switch(this.event=o,u){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(t=new Array(u-1),i=1;i<u;i++)t[i-1]=arguments[i];c.apply(this,t)}return!0}c&&(c=c.slice())}if(c&&c.length){if(u>3)for(t=new Array(u-1),i=1;i<u;i++)t[i-1]=arguments[i];for(r=0,n=c.length;r<n;r++)switch(this.event=o,u){case 1:c[r].call(this);break;case 2:c[r].call(this,arguments[1]);break;case 3:c[r].call(this,arguments[1],arguments[2]);break;default:c[r].apply(this,t)}return!0}if(!this.ignoreErrors&&!this._all&&"error"===o)throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},q.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var e,t,n,r,i,s,o=arguments[0],a=this.wildcard;if("newListener"===o&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(a&&(e=o,"newListener"!==o&&"removeListener"!==o&&"object"==typeof o)){if(r=o.length,l)for(i=0;i<r;i++)if("symbol"==typeof o[i]){t=!0;break}t||(o=o.join(this.delimiter))}var c,u=[],h=arguments.length;if(this._all)for(i=0,r=this._all.length;i<r;i++)switch(this.event=o,h){case 1:u.push(this._all[i].call(this,o));break;case 2:u.push(this._all[i].call(this,o,arguments[1]));break;case 3:u.push(this._all[i].call(this,o,arguments[1],arguments[2]));break;default:u.push(this._all[i].apply(this,arguments))}if(a?(c=[],k.call(this,c,e,this.listenerTree,0)):c=this._events[o],"function"==typeof c)switch(this.event=o,h){case 1:u.push(c.call(this));break;case 2:u.push(c.call(this,arguments[1]));break;case 3:u.push(c.call(this,arguments[1],arguments[2]));break;default:for(n=new Array(h-1),s=1;s<h;s++)n[s-1]=arguments[s];u.push(c.apply(this,n))}else if(c&&c.length){if(c=c.slice(),h>3)for(n=new Array(h-1),s=1;s<h;s++)n[s-1]=arguments[s];for(i=0,r=c.length;i<r;i++)switch(this.event=o,h){case 1:u.push(c[i].call(this));break;case 2:u.push(c[i].call(this,arguments[1]));break;case 3:u.push(c[i].call(this,arguments[1],arguments[2]));break;default:u.push(c[i].apply(this,n))}}else if(!this.ignoreErrors&&!this._all&&"error"===o)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(u)},q.prototype.on=function(e,t,n){return this._on(e,t,!1,n)},q.prototype.prependListener=function(e,t,n){return this._on(e,t,!0,n)},q.prototype.onAny=function(e){return this._onAny(e,!1)},q.prototype.prependAny=function(e){return this._onAny(e,!0)},q.prototype.addListener=q.prototype.on,q.prototype._onAny=function(e,t){if("function"!=typeof e)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),t?this._all.unshift(e):this._all.push(e),this},q.prototype._on=function(e,t,n,r){if("function"==typeof e)return this._onAny(e,t),this;if("function"!=typeof t)throw new Error("on only accepts instances of Function");this._events||d.call(this);var s,o=this;return r!==i&&(t=(s=j.call(this,e,t,r))[0],o=s[1]),this._newListener&&this.emit("newListener",e,t),this.wildcard?(L.call(this,e,t,n),o):(this._events[e]?("function"==typeof this._events[e]&&(this._events[e]=[this._events[e]]),n?this._events[e].unshift(t):this._events[e].push(t),!this._events[e].warned&&this._maxListeners>0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,p.call(this,this._events[e].length,e))):this._events[e]=t,o)},q.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var n,r=[];if(this.wildcard){var i="string"==typeof e?e.split(this.delimiter):e.slice();if(!(r=k.call(this,null,i,this.listenerTree,0)))return this}else{if(!this._events[e])return this;n=this._events[e],r.push({_listeners:n})}for(var s=0;s<r.length;s++){var a=r[s];if(n=a._listeners,o(n)){for(var l=-1,c=0,u=n.length;c<u;c++)if(n[c]===t||n[c].listener&&n[c].listener===t||n[c]._origin&&n[c]._origin===t){l=c;break}if(l<0)continue;return this.wildcard?a._listeners.splice(l,1):this._events[e].splice(l,1),0===n.length&&(this.wildcard?delete a._listeners:delete this._events[e]),this._removeListener&&this.emit("removeListener",e,t),this}(n===t||n.listener&&n.listener===t||n._origin&&n._origin===t)&&(this.wildcard?delete a._listeners:delete this._events[e],this._removeListener&&this.emit("removeListener",e,t))}return this.listenerTree&&P(this.listenerTree),this},q.prototype.offAny=function(e){var t,n=0,r=0;if(e&&this._all&&this._all.length>0){for(n=0,r=(t=this._all).length;n<r;n++)if(e===t[n])return t.splice(n,1),this._removeListener&&this.emit("removeListenerAny",e),this}else{if(t=this._all,this._removeListener)for(n=0,r=t.length;n<r;n++)this.emit("removeListenerAny",t[n]);this._all=[]}return this},q.prototype.removeListener=q.prototype.off,q.prototype.removeAllListeners=function(e){if(e===i)return!this._events||d.call(this),this;if(this.wildcard){var t,n=k.call(this,null,e,this.listenerTree,0);if(!n)return this;for(t=0;t<n.length;t++)n[t]._listeners=null;this.listenerTree&&P(this.listenerTree)}else this._events&&(this._events[e]=null);return this},q.prototype.listeners=function(e){var t,n,r,s,o,a=this._events;if(e===i){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!a)return[];for(s=(t=h(a)).length,r=[];s-- >0;)"function"==typeof(n=a[t[s]])?r.push(n):r.push.apply(r,n);return r}if(this.wildcard){if(!(o=this.listenerTree))return[];var l=[],c="string"==typeof e?e.split(this.delimiter):e.slice();return k.call(this,l,c,o,0),l}return a&&(n=a[e])?"function"==typeof n?[n]:n:[]},q.prototype.eventNames=function(e){var t=this._events;return this.wildcard?A.call(this,this.listenerTree,[],null,e):t?h(t):[]},q.prototype.listenerCount=function(e){return this.listeners(e).length},q.prototype.hasListeners=function(e){if(this.wildcard){var t=[],n="string"==typeof e?e.split(this.delimiter):e.slice();return k.call(this,t,n,this.listenerTree,0),t.length>0}var r=this._events,s=this._all;return!!(s&&s.length||r&&(e===i?h(r).length:r[e]))},q.prototype.listenersAny=function(){return this._all?this._all:[]},q.prototype.waitFor=function(e,t){var n=this,r=typeof t;return"number"===r?t={timeout:t}:"function"===r&&(t={filter:t}),E((t=y(t,{timeout:0,filter:i,handleError:!1,Promise,overload:!1},{filter:w,Promise:_})).Promise,(function(r,i,s){function o(){var s=t.filter;if(!s||s.apply(n,arguments))if(n.off(e,o),t.handleError){var a=arguments[0];a?i(a):r(m.apply(null,arguments).slice(1))}else r(m.apply(null,arguments))}s((function(){n.off(e,o)})),n._on(e,o,!1)}),{timeout:t.timeout,overload:t.overload})};var O=q.prototype;Object.defineProperties(q,{defaultMaxListeners:{get:function(){return O._maxListeners},set:function(e){if("number"!=typeof e||e<0||Number.isNaN(e))throw TypeError("n must be a non-negative number");O._maxListeners=e},enumerable:!0},once:{value:function(e,t,n){return E((n=y(n,{Promise,timeout:0,overload:!1},{Promise:_})).Promise,(function(n,r,i){var s;if("function"==typeof e.addEventListener)return s=function(){n(m.apply(null,arguments))},i((function(){e.removeEventListener(t,s)})),void e.addEventListener(t,s,{once:!0});var o,a=function(){o&&e.removeListener("error",o),n(m.apply(null,arguments))};"error"!==t&&(o=function(n){e.removeListener(t,a),r(n)},e.once("error",o)),i((function(){o&&e.removeListener("error",o),e.removeListener(t,a)})),e.once(t,a)}),{timeout:n.timeout,overload:n.overload})},writable:!0,configurable:!0}}),Object.defineProperties(O,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),(r=function(){return q}.call(t,n,t,e))===i||(e.exports=r)}()},3709:function(e){var t,n;t=this,n=function(e){let t={extend:function(e,t){return Object.assign(e,t)},modulo:function(e,t){return(e%t+t)%t},makeArray:function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?[...e]:[e]},removeFrom:function(e,t){let n=e.indexOf(t);-1!=n&&e.splice(n,1)},getParent:function(e,t){for(;e.parentNode&&e!=document.body;)if((e=e.parentNode).matches(t))return e},getQueryElement:function(e){return"string"==typeof e?document.querySelector(e):e},handleEvent:function(e){let t="on"+e.type;this[t]&&this[t](e)},filterFindElements:function(e,n){return(e=t.makeArray(e)).filter((e=>e instanceof HTMLElement)).reduce(((e,t)=>{if(!n)return e.push(t),e;t.matches(n)&&e.push(t);let r=t.querySelectorAll(n);return e.concat(...r)}),[])},debounceMethod:function(e,t,n){n=n||100;let r=e.prototype[t],i=t+"Timeout";e.prototype[t]=function(){clearTimeout(this[i]);let e=arguments;this[i]=setTimeout((()=>{r.apply(this,e),delete this[i]}),n)}},docReady:function(e){let t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},toDashed:function(e){return e.replace(/(.)([A-Z])/g,(function(e,t,n){return t+"-"+n})).toLowerCase()}},n=e.console;return t.htmlInit=function(r,i){t.docReady((function(){let s="data-"+t.toDashed(i),o=document.querySelectorAll(`[${s}]`),a=e.jQuery;[...o].forEach((e=>{let t,o=e.getAttribute(s);try{t=o&&JSON.parse(o)}catch(t){return void(n&&n.error(`Error parsing ${s} on ${e.className}: ${t}`))}let l=new r(e,t);a&&a.data(e,i,l)}))}))},t},e.exports?e.exports=n(t):t.fizzyUIUtils=n(t)},2345:(e,t,n)=>{!function(t,r){e.exports?e.exports=r(0,n(7192),n(3709)):r(0,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(e,t,n){class r{constructor(e,t){this.element=e,this.infScroll=t,this.clickHandler=this.onClick.bind(this),this.element.addEventListener("click",this.clickHandler),t.on("request",this.disable.bind(this)),t.on("load",this.enable.bind(this)),t.on("error",this.hide.bind(this)),t.on("last",this.hide.bind(this))}onClick(e){e.preventDefault(),this.infScroll.loadNextPage()}enable(){this.element.removeAttribute("disabled")}disable(){this.element.disabled="disabled"}hide(){this.element.style.display="none"}destroy(){this.element.removeEventListener("click",this.clickHandler)}}return t.create.button=function(){let e=n.getQueryElement(this.options.button);e&&(this.button=new r(e,this))},t.destroy.button=function(){this.button&&this.button.destroy()},t.Button=r,t}))},7192:(e,t,n)=>{!function(t,r){e.exports?e.exports=r(t,n(7138),n(3709)):t.InfiniteScroll=r(t,t.EvEmitter,t.fizzyUIUtils)}(window,(function(e,t,n){let r=e.jQuery,i={};function s(e,t){let o=n.getQueryElement(e);if(o){if((e=o).infiniteScrollGUID){let n=i[e.infiniteScrollGUID];return n.option(t),n}this.element=e,this.options={...s.defaults},this.option(t),r&&(this.$element=r(this.element)),this.create()}else console.error("Bad element for InfiniteScroll: "+(o||e))}s.defaults={},s.create={},s.destroy={};let o=s.prototype;Object.assign(o,t.prototype);let a=0;o.create=function(){let e=this.guid=++a;if(this.element.infiniteScrollGUID=e,i[e]=this,this.pageIndex=1,this.loadCount=0,this.updateGetPath(),this.getPath&&this.getPath()){this.updateGetAbsolutePath(),this.log("initialized",[this.element.className]),this.callOnInit();for(let e in s.create)s.create[e].call(this)}else console.error("Disabling InfiniteScroll")},o.option=function(e){Object.assign(this.options,e)},o.callOnInit=function(){let e=this.options.onInit;e&&e.call(this,this)},o.dispatchEvent=function(e,t,n){this.log(e,n);let i=t?[t].concat(n):n;if(this.emitEvent(e,i),!r||!this.$element)return;let s=e+=".infiniteScroll";if(t){let n=r.Event(t);n.type=e,s=n}this.$element.trigger(s,n)};let l={initialized:e=>`on ${e}`,request:e=>`URL: ${e}`,load:(e,t)=>`${e.title||""}. URL: ${t}`,error:(e,t)=>`${e}. URL: ${t}`,append:(e,t,n)=>`${n.length} items. URL: ${t}`,last:(e,t)=>`URL: ${t}`,history:(e,t)=>`URL: ${t}`,pageIndex:function(e,t){return`current page determined to be: ${e} from ${t}`}};o.log=function(e,t){if(!this.options.debug)return;let n=`[InfiniteScroll] ${e}`,r=l[e];r&&(n+=". "+r.apply(this,t)),console.log(n)},o.updateMeasurements=function(){this.windowHeight=e.innerHeight;let t=this.element.getBoundingClientRect();this.top=t.top+e.scrollY},o.updateScroller=function(){let t=this.options.elementScroll;if(t){if(this.scroller=!0===t?this.element:n.getQueryElement(t),!this.scroller)throw new Error(`Unable to find elementScroll: ${t}`)}else this.scroller=e},o.updateGetPath=function(){let e=this.options.path;if(!e)return void console.error(`InfiniteScroll path option required. Set as: ${e}`);let t=typeof e;"function"!=t?"string"==t&&e.match("{{#}}")?this.updateGetPathTemplate(e):this.updateGetPathSelector(e):this.getPath=e},o.updateGetPathTemplate=function(e){this.getPath=()=>{let t=this.pageIndex+1;return e.replace("{{#}}",t)};let t=e.replace(/(\\\?|\?)/,"\\?").replace("{{#}}","(\\d\\d?\\d?)"),n=new RegExp(t),r=location.href.match(n);r&&(this.pageIndex=parseInt(r[1],10),this.log("pageIndex",[this.pageIndex,"template string"]))};let c=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/],u=s.getPathParts=function(e){if(e)for(let t of c){let n=e.match(t);if(n){let[,e,t,r]=n;return{begin:e,index:t,end:r}}}};o.updateGetPathSelector=function(e){let t=document.querySelector(e);if(!t)return void console.error(`Bad InfiniteScroll path option. Next link not found: ${e}`);let n=t.getAttribute("href"),r=u(n);if(!r)return void console.error(`InfiniteScroll unable to parse next link href: ${n}`);let{begin:i,index:s,end:o}=r;this.isPathSelector=!0,this.getPath=()=>i+(this.pageIndex+1)+o,this.pageIndex=parseInt(s,10)-1,this.log("pageIndex",[this.pageIndex,"next link"])},o.updateGetAbsolutePath=function(){let e=this.getPath();if(e.match(/^http/)||e.match(/^\//))return void(this.getAbsolutePath=this.getPath);let{pathname:t}=location,n=e.match(/^\?/),r=t.substring(0,t.lastIndexOf("/")),i=n?t:r+"/";this.getAbsolutePath=()=>i+this.getPath()},s.create.hideNav=function(){let e=n.getQueryElement(this.options.hideNav);e&&(e.style.display="none",this.nav=e)},s.destroy.hideNav=function(){this.nav&&(this.nav.style.display="")},o.destroy=function(){this.allOff();for(let e in s.destroy)s.destroy[e].call(this);delete this.element.infiniteScrollGUID,delete i[this.guid],r&&this.$element&&r.removeData(this.element,"infiniteScroll")},s.throttle=function(e,t){let n,r;return t=t||200,function(){let i=+new Date,s=arguments,o=()=>{n=i,e.apply(this,s)};n&&i<n+t?(clearTimeout(r),r=setTimeout(o,t)):o()}},s.data=function(e){let t=(e=n.getQueryElement(e))&&e.infiniteScrollGUID;return t&&i[t]},s.setJQuery=function(e){r=e},n.htmlInit(s,"infinite-scroll"),o._init=function(){};let{jQueryBridget:h}=e;return r&&h&&h("infiniteScroll",s,r),s}))},7944:(e,t,n)=>{!function(t,r){e.exports?e.exports=r(t,n(7192),n(3709)):r(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(e,t,n){let r=t.prototype;Object.assign(t.defaults,{history:"replace"});let i=document.createElement("a");return t.create.history=function(){this.options.history&&(i.href=this.getAbsolutePath(),(i.origin||i.protocol+"//"+i.host)==location.origin?this.options.append?this.createHistoryAppend():this.createHistoryPageLoad():console.error(`[InfiniteScroll] cannot set history with different origin: ${i.origin} on ${location.origin} . History behavior disabled.`))},r.createHistoryAppend=function(){this.updateMeasurements(),this.updateScroller(),this.scrollPages=[{top:0,path:location.href,title:document.title}],this.scrollPage=this.scrollPages[0],this.scrollHistoryHandler=this.onScrollHistory.bind(this),this.unloadHandler=this.onUnload.bind(this),this.scroller.addEventListener("scroll",this.scrollHistoryHandler),this.on("append",this.onAppendHistory),this.bindHistoryAppendEvents(!0)},r.bindHistoryAppendEvents=function(t){let n=t?"addEventListener":"removeEventListener";this.scroller[n]("scroll",this.scrollHistoryHandler),e[n]("unload",this.unloadHandler)},r.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},t.destroy.history=r.destroyHistory=function(){this.options.history&&this.options.append&&this.bindHistoryAppendEvents(!1)},r.onAppendHistory=function(e,t,n){if(!n||!n.length)return;let r=n[0],s=this.getElementScrollY(r);i.href=t,this.scrollPages.push({top:s,path:i.href,title:e.title})},r.getElementScrollY=function(t){return this.options.elementScroll?t.offsetTop-this.top:t.getBoundingClientRect().top+e.scrollY},r.onScrollHistory=function(){let e=this.getClosestScrollPage();e!=this.scrollPage&&(this.scrollPage=e,this.setHistory(e.title,e.path))},n.debounceMethod(t,"onScrollHistory",150),r.getClosestScrollPage=function(){let t,n;t=this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:e.scrollY+this.windowHeight/2;for(let e of this.scrollPages){if(e.top>=t)break;n=e}return n},r.setHistory=function(e,t){let n=this.options.history;n&&history[n+"State"]&&(history[n+"State"](null,e,t),this.options.historyTitle&&(document.title=e),this.dispatchEvent("history",null,[e,t]))},r.onUnload=function(){if(0===this.scrollPage.top)return;let t=e.scrollY-this.scrollPage.top+this.top;this.destroyHistory(),scrollTo(0,t)},r.onPageLoadHistory=function(e,t){this.setHistory(e.title,t)},t}))},9280:(e,t,n)=>{var r;window,e.exports&&(e.exports=(r=n(7192),n(8130),n(9801),n(7944),n(2345),n(3080),r))},8130:(e,t,n)=>{!function(t,r){e.exports?e.exports=r(t,n(7192)):r(t,t.InfiniteScroll)}(window,(function(e,t){let n=t.prototype;Object.assign(t.defaults,{loadOnScroll:!0,checkLastPage:!0,responseBody:"text",domParseResponse:!0}),t.create.pageLoad=function(){this.canLoad=!0,this.on("scrollThreshold",this.onScrollThresholdLoad),this.on("load",this.checkLastPage),this.options.outlayer&&this.on("append",this.onAppendOutlayer)},n.onScrollThresholdLoad=function(){this.options.loadOnScroll&&this.loadNextPage()};let r=new DOMParser;function i(e){let t=document.createDocumentFragment();return e&&t.append(...e),t}return n.loadNextPage=function(){if(this.isLoading||!this.canLoad)return;let{responseBody:e,domParseResponse:t,fetchOptions:n}=this.options,i=this.getAbsolutePath();this.isLoading=!0,"function"==typeof n&&(n=n());let s=fetch(i,n).then((n=>{if(!n.ok){let e=new Error(n.statusText);return this.onPageError(e,i,n),{response:n}}return n[e]().then((s=>("text"==e&&t&&(s=r.parseFromString(s,"text/html")),204==n.status?(this.lastPageReached(s,i),{body:s,response:n}):this.onPageLoad(s,i,n))))})).catch((e=>{this.onPageError(e,i)}));return this.dispatchEvent("request",null,[i,s]),s},n.onPageLoad=function(e,t,n){return this.options.append||(this.isLoading=!1),this.pageIndex++,this.loadCount++,this.dispatchEvent("load",null,[e,t,n]),this.appendNextPage(e,t,n)},n.appendNextPage=function(e,t,n){let{append:r,responseBody:s,domParseResponse:o}=this.options;if("text"!=s||!o||!r)return{body:e,response:n};let a=e.querySelectorAll(r),l={body:e,response:n,items:a};if(!a||!a.length)return this.lastPageReached(e,t),l;let c=i(a),u=()=>(this.appendItems(a,c),this.isLoading=!1,this.dispatchEvent("append",null,[e,t,a,n]),l);return this.options.outlayer?this.appendOutlayerItems(c,u):u()},n.appendItems=function(e,t){e&&e.length&&(function(e){let t=e.querySelectorAll("script");for(let e of t){let t=document.createElement("script"),n=e.attributes;for(let e of n)t.setAttribute(e.name,e.value);t.innerHTML=e.innerHTML,e.parentNode.replaceChild(t,e)}}(t=t||i(e)),this.element.appendChild(t))},n.appendOutlayerItems=function(n,r){let i=t.imagesLoaded||e.imagesLoaded;return i?new Promise((function(e){i(n,(function(){let t=r();e(t)}))})):(console.error("[InfiniteScroll] imagesLoaded required for outlayer option"),void(this.isLoading=!1))},n.onAppendOutlayer=function(e,t,n){this.options.outlayer.appended(n)},n.checkLastPage=function(e,t){let n,{checkLastPage:r,path:i}=this.options;if(r){if("function"==typeof i&&!this.getPath())return void this.lastPageReached(e,t);"string"==typeof r?n=r:this.isPathSelector&&(n=i),n&&e.querySelector&&(e.querySelector(n)||this.lastPageReached(e,t))}},n.lastPageReached=function(e,t){this.canLoad=!1,this.dispatchEvent("last",null,[e,t])},n.onPageError=function(e,t,n){return this.isLoading=!1,this.canLoad=!1,this.dispatchEvent("error",null,[e,t,n]),e},t.create.prefill=function(){if(!this.options.prefill)return;let e=this.options.append;e?(this.updateMeasurements(),this.updateScroller(),this.isPrefilling=!0,this.on("append",this.prefill),this.once("error",this.stopPrefill),this.once("last",this.stopPrefill),this.prefill()):console.error(`append option required for prefill. Set as :${e}`)},n.prefill=function(){let e=this.getPrefillDistance();this.isPrefilling=e>=0,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},n.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},n.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},t}))},9801:(e,t,n)=>{!function(t,r){e.exports?e.exports=r(t,n(7192),n(3709)):r(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(e,t,n){let r=t.prototype;return Object.assign(t.defaults,{scrollThreshold:400}),t.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);let e=this.options.scrollThreshold;(e||0===e)&&this.enableScrollWatch()},t.destroy.scrollWatch=function(){this.disableScrollWatch()},r.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},r.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},r.bindScrollWatchEvents=function(t){let n=t?"addEventListener":"removeEventListener";this.scroller[n]("scroll",this.pageScrollHandler),e[n]("resize",this.resizeHandler)},r.onPageScroll=t.throttle((function(){this.getBottomDistance()<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")})),r.getBottomDistance=function(){let t,n;return this.options.elementScroll?(t=this.scroller.scrollHeight,n=this.scroller.scrollTop+this.scroller.clientHeight):(t=this.top+this.element.clientHeight,n=e.scrollY+this.windowHeight),t-n},r.onResize=function(){this.updateMeasurements()},n.debounceMethod(t,"onResize",150),t}))},3080:(e,t,n)=>{!function(t,r){e.exports?e.exports=r(0,n(7192),n(3709)):r(0,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(e,t,n){let r=t.prototype;function i(e){o(e,"none")}function s(e){o(e,"block")}function o(e,t){e&&(e.style.display=t)}return t.create.status=function(){let e=n.getQueryElement(this.options.status);e&&(this.statusElement=e,this.statusEventElements={request:e.querySelector(".infinite-scroll-request"),error:e.querySelector(".infinite-scroll-error"),last:e.querySelector(".infinite-scroll-last")},this.on("request",this.showRequestStatus),this.on("error",this.showErrorStatus),this.on("last",this.showLastStatus),this.bindHideStatus("on"))},r.bindHideStatus=function(e){let t=this.options.append?"append":"load";this[e](t,this.hideAllStatus)},r.showRequestStatus=function(){this.showStatus("request")},r.showErrorStatus=function(){this.showStatus("error")},r.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},r.showStatus=function(e){s(this.statusElement),this.hideStatusEventElements(),s(this.statusEventElements[e])},r.hideAllStatus=function(){i(this.statusElement),this.hideStatusEventElements()},r.hideStatusEventElements=function(){for(let e in this.statusEventElements)i(this.statusEventElements[e])},t}))},2257:function(e,t){var n,r,i;!function(s,o){"use strict";r=[],void 0===(i="function"==typeof(n=function(){function e(e){return"-Inf"===e?-1/0:"+Inf"===e||"Inf"===e||"*"===e?1/0:parseInt(e,10)}var t=/^({\s*(\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*)\s*})|([\[\]])\s*(-Inf|\*|\-?\d+(\.\d+)?)\s*,\s*(\+?Inf|\*|\-?\d+(\.\d+)?)\s*([\[\]])$/,n=/({\s*(\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*)\s*})|([\[\]])\s*(-Inf|\*|\-?\d+(\.\d+)?)\s*,\s*(\+?Inf|\*|\-?\d+(\.\d+)?)\s*([\[\]])/,r="en",i=function(e){e=e||{},this.locale=e.locale||function(){if("undefined"!=typeof document&&document.documentElement)return document.documentElement.lang}()||r,this.fallback=e.fallback,this.messages=e.messages};return i.prototype.setMessages=function(e){this.messages=e},i.prototype.getLocale=function(){return this.locale||this.fallback},i.prototype.setLocale=function(e){this.locale=e},i.prototype.getFallback=function(){return this.fallback},i.prototype.setFallback=function(e){this.fallback=e},i.prototype.has=function(e,t){return!("string"!=typeof e||!this.messages)&&null!==this._getMessage(e,t)},i.prototype.get=function(e,t,n){if(!this.has(e,n))return e;var r=this._getMessage(e,n);return null===r?e:(t&&(r=this._applyReplacements(r,t)),r)},i.prototype.trans=function(e,t){return this.get(e,t)},i.prototype.choice=function(e,t,r,i){(r=void 0!==r?r:{}).count=t;var s=this.get(e,r,i);if(null==s)return s;for(var o=s.split("|"),a=[],l=0;l<o.length;l++)if(o[l]=o[l].trim(),n.test(o[l])){var c=o[l].split(/\s/);a.push(c.shift()),o[l]=c.join(" ")}if(1===o.length)return s;for(var u=0;u<a.length;u++)if(this._testInterval(t,a[u]))return o[u];return i=i||this._getLocale(e),o[this._getPluralForm(t,i)]},i.prototype.transChoice=function(e,t,n){return this.choice(e,t,n)},i.prototype._parseKey=function(e,t){if("string"!=typeof e||"string"!=typeof t)return null;var n=e.split("."),r=n[0].replace(/\//g,".");return{source:t+"."+r,sourceFallback:this.getFallback()+"."+r,entries:n.slice(1)}},i.prototype._getMessage=function(e,t){if(t=t||this.getLocale(),e=this._parseKey(e,t),void 0===this.messages[e.source]&&void 0===this.messages[e.sourceFallback])return null;var n=this.messages[e.source],r=e.entries.slice(),i=r.join(".");if("string"!=typeof(n=void 0!==n?this._getValueInKey(n,i):void 0)&&this.messages[e.sourceFallback])for(n=this.messages[e.sourceFallback],r=e.entries.slice(),i="";r.length&&void 0!==n;)n[i=i?i.concat(".",r.shift()):r.shift()]&&(n=n[i],i="");return"string"!=typeof n?null:n},i.prototype._getValueInKey=function(e,t){if("string"==typeof e[t])return e[t];for(var n=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),r=0,i=n.length;r<i;++r){var s=n.slice(0,r+1).join("."),o=n.slice(r+1,n.length).join(".");if(e[s])return this._getValueInKey(e[s],o)}return e},i.prototype._getLocale=function(e){return e=this._parseKey(e,this.locale),this.messages[e.source]?this.locale:this.messages[e.sourceFallback]?this.fallback:null},i.prototype._findMessageInTree=function(e,t){for(;e.length&&void 0!==t;){var n=e.join(".");if(t[n]){t=t[n];break}t=t[e.shift()]}return t},i.prototype._sortReplacementKeys=function(e,t){return t.length-e.length},i.prototype._applyReplacements=function(e,t){return Object.keys(t).sort(this._sortReplacementKeys).forEach((function(n){e=e.replace(new RegExp(":"+n,"gi"),(function(e){var r=t[n];return e===e.toUpperCase()?r.toUpperCase():e===e.replace(/\w/i,(function(e){return e.toUpperCase()}))?r.charAt(0).toUpperCase()+r.slice(1):r}))})),e},i.prototype._testInterval=function(n,r){if("string"!=typeof r)throw"Invalid interval: should be a string.";var i=(r=r.trim()).match(t);if(!i)throw"Invalid interval: "+r;if(!i[2]){var s=(i=i.filter((function(e){return!!e})))[1],o=e(i[2]);o===1/0&&(o=-1/0);var a=e(i[3]),l=i[4];return("["===s?n>=o:n>o)&&("]"===l?n<=a:n<a)}for(var c=i[2].split(","),u=0;u<c.length;u++)if(parseInt(c[u],10)===n)return!0;return!1},i.prototype._getPluralForm=function(e,t){switch(t){case"az":case"bo":case"dz":case"id":case"ja":case"jv":case"ka":case"km":case"kn":case"ko":case"ms":case"th":case"tr":case"vi":case"zh":default:return 0;case"af":case"bn":case"bg":case"ca":case"da":case"de":case"el":case"en":case"eo":case"es":case"et":case"eu":case"fa":case"fi":case"fo":case"fur":case"fy":case"gl":case"gu":case"ha":case"he":case"hu":case"is":case"it":case"ku":case"lb":case"ml":case"mn":case"mr":case"nah":case"nb":case"ne":case"nl":case"nn":case"no":case"om":case"or":case"pa":case"pap":case"ps":case"pt":case"so":case"sq":case"sv":case"sw":case"ta":case"te":case"tk":case"ur":case"zu":return 1==e?0:1;case"am":case"bh":case"fil":case"fr":case"gun":case"hi":case"hy":case"ln":case"mg":case"nso":case"xbr":case"ti":case"wa":return 0===e||1===e?0:1;case"be":case"bs":case"hr":case"ru":case"sr":case"uk":return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2;case"cs":case"sk":return 1==e?0:e>=2&&e<=4?1:2;case"ga":return 1==e?0:2==e?1:2;case"lt":return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2;case"sl":return e%100==1?0:e%100==2?1:e%100==3||e%100==4?2:3;case"mk":return e%10==1?0:1;case"mt":return 1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3;case"lv":return 0===e?0:e%10==1&&e%100!=11?1:2;case"pl":return 1==e?0:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?1:2;case"cy":return 1==e?0:2==e?1:8==e||11==e?2:3;case"ro":return 1==e?0:0===e||e%100>0&&e%100<20?1:2;case"ar":return 0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11&&e%100<=99?4:5}},i})?n.apply(t,r):n)||(e.exports=i)}()},3230:(e,t,n)=>{var r=n(5173),i=n(2046),s=[n(2807)];e.exports=r.createStore(i,s)},2807:(e,t,n)=>{e.exports=function(){return n(4233),{}}},4233:()=>{"object"!=typeof JSON&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta,rep;function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,(function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o,a=gap,l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),"function"==typeof rep&&(l=rep.call(t,e,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,o=[],"[object Array]"===Object.prototype.toString.apply(l)){for(s=l.length,n=0;n<s;n+=1)o[n]=str(n,l)||"null";return i=0===o.length?"[]":gap?"[\n"+gap+o.join(",\n"+gap)+"\n"+a+"]":"["+o.join(",")+"]",gap=a,i}if(rep&&"object"==typeof rep)for(s=rep.length,n=0;n<s;n+=1)"string"==typeof rep[n]&&(i=str(r=rep[n],l))&&o.push(quote(r)+(gap?": ":":")+i);else for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(i=str(r,l))&&o.push(quote(r)+(gap?": ":":")+i);return i=0===o.length?"{}":gap?"{\n"+gap+o.join(",\n"+gap)+"\n"+a+"}":"{"+o.join(",")+"}",gap=a,i}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value),"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){var j;function walk(e,t){var n,r,i=e[t];if(i&&"object"==typeof i)for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(void 0!==(r=walk(i,n))?i[n]=r:delete i[n]);return reviver.call(e,t,i)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},5173:(e,t,n)=>{var r=n(2476),i=r.slice,s=r.pluck,o=r.each,a=r.bind,l=r.create,c=r.isList,u=r.isFunction,h=r.isObject;e.exports={createStore:f};var d={version:"2.0.12",enabled:!1,get:function(e,t){var n=this.storage.read(this._namespacePrefix+e);return this._deserialize(n,t)},set:function(e,t){return void 0===t?this.remove(e):(this.storage.write(this._namespacePrefix+e,this._serialize(t)),t)},remove:function(e){this.storage.remove(this._namespacePrefix+e)},each:function(e){var t=this;this.storage.each((function(n,r){e.call(t,t._deserialize(n),(r||"").replace(t._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(e){return this._namespacePrefix=="__storejs_"+e+"_"},createStore:function(){return f.apply(this,arguments)},addPlugin:function(e){this._addPlugin(e)},namespace:function(e){return f(this.storage,this.plugins,e)}};function f(e,t,n){n||(n=""),e&&!c(e)&&(e=[e]),t&&!c(t)&&(t=[t]);var r=n?"__storejs_"+n+"_":"",f=n?new RegExp("^"+r):null;if(!/^[a-zA-Z0-9_\-]*$/.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var p={_namespacePrefix:r,_namespaceRegexp:f,_testStorage:function(e){try{var t="__storejs__test__";e.write(t,t);var n=e.read(t)===t;return e.remove(t),n}catch(e){return!1}},_assignPluginFnProp:function(e,t){var n=this[t];this[t]=function(){var t=i(arguments,0),r=this;function s(){if(n)return o(arguments,(function(e,n){t[n]=e})),n.apply(r,t)}var a=[s].concat(t);return e.apply(r,a)}},_serialize:function(e){return JSON.stringify(e)},_deserialize:function(e,t){if(!e)return t;var n="";try{n=JSON.parse(e)}catch(t){n=e}return void 0!==n?n:t},_addStorage:function(e){this.enabled||this._testStorage(e)&&(this.storage=e,this.enabled=!0)},_addPlugin:function(e){var t=this;if(c(e))o(e,(function(e){t._addPlugin(e)}));else if(!s(this.plugins,(function(t){return e===t}))){if(this.plugins.push(e),!u(e))throw new Error("Plugins must be function values that return objects");var n=e.call(this);if(!h(n))throw new Error("Plugins must return an object of function properties");o(n,(function(n,r){if(!u(n))throw new Error("Bad plugin property: "+r+" from plugin "+e.name+". Plugins should only return functions.");t._assignPluginFnProp(n,r)}))}},addStorage:function(e){!function(){var e="undefined"==typeof console?null:console;e&&(e.warn?e.warn:e.log).apply(e,arguments)}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(e)}},m=l(p,d,{plugins:[]});return m.raw={},o(m,(function(e,t){u(e)&&(m.raw[t]=a(m,e))})),o(e,(function(e){m._addStorage(e)})),o(t,(function(e){m._addPlugin(e)})),m}},2476:(e,t,n)=>{var r=Object.assign?Object.assign:function(e,t,n,r){for(var i=1;i<arguments.length;i++)l(Object(arguments[i]),(function(t,n){e[n]=t}));return e},i=function(){if(Object.create)return function(e,t,n,i){var s=a(arguments,1);return r.apply(this,[Object.create(e)].concat(s))};{function e(){}return function(t,n,i,s){var o=a(arguments,1);return e.prototype=t,r.apply(this,[new e].concat(o))}}}(),s=String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},o="undefined"!=typeof window?window:n.g;function a(e,t){return Array.prototype.slice.call(e,t||0)}function l(e,t){c(e,(function(e,n){return t(e,n),!1}))}function c(e,t){if(u(e)){for(var n=0;n<e.length;n++)if(t(e[n],n))return e[n]}else for(var r in e)if(e.hasOwnProperty(r)&&t(e[r],r))return e[r]}function u(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}e.exports={assign:r,create:i,trim:s,bind:function(e,t){return function(){return t.apply(e,Array.prototype.slice.call(arguments,0))}},slice:a,each:l,map:function(e,t){var n=u(e)?[]:{};return c(e,(function(e,r){return n[r]=t(e,r),!1})),n},pluck:c,isList:u,isFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)},isObject:function(e){return e&&"[object Object]"==={}.toString.call(e)},Global:o}},2046:(e,t,n)=>{e.exports=[n(4290),n(1468),n(8540),n(1236),n(2842),n(6126)]},1236:(e,t,n)=>{var r=n(2476),i=r.Global,s=r.trim;e.exports={name:"cookieStorage",read:function(e){if(!e||!c(e))return null;var t="(?:^|.*;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(o.cookie.replace(new RegExp(t),"$1"))},write:function(e,t){e&&(o.cookie=escape(e)+"="+escape(t)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")},each:a,remove:l,clearAll:function(){a((function(e,t){l(t)}))}};var o=i.document;function a(e){for(var t=o.cookie.split(/; ?/g),n=t.length-1;n>=0;n--)if(s(t[n])){var r=t[n].split("="),i=unescape(r[0]);e(unescape(r[1]),i)}}function l(e){e&&c(e)&&(o.cookie=escape(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function c(e){return new RegExp("(?:^|;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(o.cookie)}},4290:(e,t,n)=>{var r=n(2476).Global;function i(){return r.localStorage}function s(e){return i().getItem(e)}e.exports={name:"localStorage",read:s,write:function(e,t){return i().setItem(e,t)},each:function(e){for(var t=i().length-1;t>=0;t--){var n=i().key(t);e(s(n),n)}},remove:function(e){return i().removeItem(e)},clearAll:function(){return i().clear()}}},6126:e=>{e.exports={name:"memoryStorage",read:function(e){return t[e]},write:function(e,n){t[e]=n},each:function(e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},remove:function(e){delete t[e]},clearAll:function(e){t={}}};var t={}},1468:(e,t,n)=>{var r=n(2476).Global;e.exports={name:"oldFF-globalStorage",read:function(e){return i[e]},write:function(e,t){i[e]=t},each:s,remove:function(e){return i.removeItem(e)},clearAll:function(){s((function(e,t){delete i[e]}))}};var i=r.globalStorage;function s(e){for(var t=i.length-1;t>=0;t--){var n=i.key(t);e(i[n],n)}}},8540:(e,t,n)=>{var r=n(2476).Global;e.exports={name:"oldIE-userDataStorage",write:function(e,t){if(!a){var n=c(e);o((function(e){e.setAttribute(n,t),e.save(i)}))}},read:function(e){if(!a){var t=c(e),n=null;return o((function(e){n=e.getAttribute(t)})),n}},each:function(e){o((function(t){for(var n=t.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var i=n[r];e(t.getAttribute(i.name),i.name)}}))},remove:function(e){var t=c(e);o((function(e){e.removeAttribute(t),e.save(i)}))},clearAll:function(){o((function(e){var t=e.XMLDocument.documentElement.attributes;e.load(i);for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save(i)}))}};var i="storejs",s=r.document,o=function(){if(!s||!s.documentElement||!s.documentElement.addBehavior)return null;var e,t,n;try{(t=new ActiveXObject("htmlfile")).open(),t.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></iframe>'),t.close(),e=t.w.frames[0].document,n=e.createElement("div")}catch(t){n=s.createElement("div"),e=s.body}return function(t){var r=[].slice.call(arguments,0);r.unshift(n),e.appendChild(n),n.addBehavior("#default#userData"),n.load(i),t.apply(this,r),e.removeChild(n)}}(),a=(r.navigator?r.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./),l=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function c(e){return e.replace(/^\d/,"___$&").replace(l,"___")}},2842:(e,t,n)=>{var r=n(2476).Global;function i(){return r.sessionStorage}function s(e){return i().getItem(e)}e.exports={name:"sessionStorage",read:s,write:function(e,t){return i().setItem(e,t)},each:function(e){for(var t=i().length-1;t>=0;t--){var n=i().key(t);e(s(n),n)}},remove:function(e){return i().removeItem(e)},clearAll:function(){return i().clear()}}},7541:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},4338:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=class{constructor(e,t){this.api=e,this.event=t}}},6151:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{constructor(e,t){super(e,t),this.total=this.getElement("total"),this.badge=this.getElement("badge")}getElement(e){return document.querySelector("[data-cart-"+e+"]")}}const s=i},6986:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},7666:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},8963:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},3759:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},2138:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},6799:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},7547:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(4338),i=n(9280),s=n.n(i);class o extends r.Z{constructor(e,t){super(e,t),this.options={path:".pagination__next",history:"push",status:".loader-status",append:".product-block"},this.fetchOptions={headers:{"S-INFINITE-SCROLL":!0}},this.instances=[]}initiate(e,t,n){if(n=this.getCustomOptions(t,n),!this.canSetup(e,n))return;n.button=n.path;let r=new(s())(e,n);return r.on("scrollThreshold",salla.infiniteScroll.event.scrollThreshold),r.on("request",salla.infiniteScroll.event.request),r.on("load",salla.infiniteScroll.event.load),r.on("append",salla.infiniteScroll.event.append),r.on("error",salla.infiniteScroll.event.error),r.on("last",salla.infiniteScroll.event.last),r.on("history",salla.infiniteScroll.event.history),this.instances.push(r),r}canSetup(e,t){return("string"!=typeof e||document.querySelector(e))&&t.path&&("string"!=typeof t.path||document.querySelector(t.path))}getCustomOptions(e,t){return(t="object"==typeof e&&e||t||this.options).fetchOptions=this.fetchOptions,t.path=t.path||this.options.path,t.status=t.status||this.options.status,t.hasOwnProperty("history")||(t.history=this.options.history),t.append="string"==typeof e&&e||t.append||this.options.append,t}}const a=o},4109:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},9472:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},3069:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},1620:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},4555:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(4338);class i extends r.Z{}const s=i},9415:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});class BaseApi{constructor(e){this.parent=e,this.endpoints={},this.hooksSelectores={},this.endpointsMethods={},this.endpointsHeaders={};var t=/function (.{1,})\(/.exec(this.constructor.toString());this.className=(t&&t.length>1?t[1]:"").toLowerCase(),this.debounce={request:void 0,time:300,enabled:!0,exclude:[]}}after_init(){}normalRequest(e,t,n){let r=this,i=Array.isArray(e),s=i?this.getUrl(...e):this.getUrl(e);e=i?e[0]:e,n=n||this.endpointsMethods[e]||"post";let o=this.endpointsHeaders[e];if("get"==n&&t instanceof FormData){var a={};Array.from(t.entries()).forEach((function(e){a[e[0]]=e[1]})),t={params:a}}return o&&"get"==n&&(t=t?Object.assign(t,o):o),salla.event.document.request(s,t,n,o),this.parent[n](s,t,o).then((function(e){return e.data&&e.request&&(e=e.data),r.handleAfterResponseActions(e),e})).catch((function(e){throw r.handleErrorResponse(e),e}))}request(e,t,n){return!this.isfastRequestsAllowed()&&this.debounce.enabled?(this.debounce.request||(this.debounce.request=salla.helpers.debounce(this.normalRequest.bind(this),this.debounce.time)),this.debounce.request(e,t,n)):this.normalRequest(e,t,n)}getUrl(e){let t=this.endpoints[e]||e;const n=/{[^{}]+}/i;for(let e=1;e<arguments.length;e++)t=t.replace(n,arguments[e]);return t}withInjectData(e,t){return{element:e,data:e.getElementSallaData(t)}}handleAfterResponseActions(response){if(!response)return;let{data,googleTags=null}=response,withGoogleTags=data&&data.googleTags?data.googleTags:googleTags;if(dataLayer&&withGoogleTags&&(dataLayer.push(withGoogleTags),dataLayer.push(withGoogleTags)),this.randerSections(response),response.events||response.error&&response.error.events){let e=response.events||response.error.events;e=JSON.parse(e),Object.keys(e).forEach((function(t){salla.event.dispatch(t,e[t])}))}if(this.showAlert(response),response.runJavascript)try{eval(response.runJavascript)}catch(e){salla.log(e)}}randerSections(e){e.sections&&Object.keys(e.sections).forEach((t=>{document.querySelectorAll(t.toSelector()).forEach((function(n){n.innerHTML=e.sections[t]}))}))}handleErrorResponse(e){if(e.response&&e.response.data)return e.response.data.error&&e.response.data.error.fields?this.handleInvalidFields(e):this.handleAfterResponseActions(e.response.data)}showAlert(e){if(e)return e.case&&e.msg?salla.notify.fire(e.msg,e.case,e):e.message&&e.hasOwnProperty("success")?salla.notify.fire(e.message,e.success?salla.notify.types.success:salla.notify.types.error,e):e.error&&e.error.message?salla.notify.error(e.error.message,e):void 0}handleInvalidFields(e){let t=e.response.data.error.fields,n=[];Object.keys(t).forEach((e=>{let r=t[e];Array.isArray(r)?r.forEach((e=>n.push(e))):n.push(r)}));let r=(n.length>1?"* ":"")+n.join("\n* ");salla.error(r,e)}event(){return salla.event[this.className]}getPossibleValue(e,t,n){if("object"!=typeof e)return e;if(e){let r;for(let n=0;n<t.length&&!(r=e[t[n]])&&!(e instanceof FormData&&(r=e.get(t[n])));n++);return r=r||e,"object"!=typeof r||n?r:void 0}}isfastRequestsAllowed(){return salla.config.fastRequests}}const __WEBPACK_DEFAULT_EXPORT__=BaseApi},8908:(e,t,n)=>{"use strict";n.d(t,{Z:()=>O});var r=n(9415);class i extends r.Z{constructor(e){super(e),this.endpoints={addItem:"cart/item/{id}/add",quickAdd:"cart/item/{id}/quick-add",deleteItem:"cart/item/{id}",updateItem:"cart/item/{id}",submit:"cart",deleteFile:"cart/image/{image_id}",fetchSummary:"cart/fetch-summary"},this.endpointsMethods={deleteItem:"delete",updateItem:"put",deleteFile:"delete"},this.hooksSelectores={addItem:"cart::add-item",quickAdd:"cart::quick-add",deleteItem:"cart::delete-item",updateItem:"cart::update-item",submit:"cart::submit",deleteFile:"cart::delete-file"},this.after_init()}addItem(e){let t=this.getCartRequestData(e);if(!t.id)return salla.cart.event.itemAddedFailed('There is no "id"!'),!1;let n=this.getPossibleValue(t.formData,["quantity"])?"addItem":"quickAdd";return this.request([n,t.id],t.formData).then((function(e){return salla.cart.event.itemAdded(e,t.id),e})).catch((function(e){throw salla.cart.event.itemAddedFailed(e,t.id),e}))}quickAdd(e){return this.addItem(e)}deleteItem(e){let t=this.getCartRequestData(e);return t.id?this.request(["deleteItem",t.id]).then((function(e){return salla.cart.event.itemDeleted(e,t.id),e})).catch((function(e){throw salla.cart.event.itemDeletedFailed(e,t.id),e})):(salla.cart.event.itemDeletedFailed('There is no "id"!'),!1)}updateItem(e){let t=this.getCartRequestData(e);return t.id?this.request(["updateItem",t.id],t.formData).then((function(e){return salla.cart.event.itemUpdated(e,t.id),e})).catch((function(e){throw salla.cart.event.itemUpdatedFailed(e,t.id),e})):(salla.cart.event.itemUpdatedFailed('There is no "id"!'),!1)}submit({data:e}){return this.request("submit",e).then((function(e){return salla.cart.event.submitted(e),e})).catch((function(e){throw salla.cart.event.submitFailed(e),e}))}deleteFile(e){return(e=this.getPossibleValue(e,["id","image_id","photo_id"]))?this.request(["deleteFile",e]).then((function(t){return salla.cart.event.fileDeleted(t,e),t})).catch((function(t){throw salla.cart.event.fileDeletedFailed(t,e),t})):(salla.cart.event.fileDeletedFailed('There is no "id"!'),!1)}fetchSummary(){return this.request("fetchSummary").then((function(e){return salla.cart.event.summaryFetched(e),e})).catch((function(e){throw salla.cart.event.summaryNotFetched(e),e}))}getCartRequestData(e){let t=e.data||("object"==typeof e?e:void 0);return e=t?this.getPossibleValue(t,["prod_id","item_id","id"]):e,t="object"==typeof t?t:void 0,{id:e,formData:t}}}const s=i;class o extends r.Z{constructor(e){super(e),this.endpoints={buy:"{id}/buy-as-gift"},this.hooksSelectores={buy:"gift::buy"},this.after_init()}buy(e){let t=this.getGiftRequestData(e);return t.id?this.request(["buy",t.id],t.formData).then((function(e){return salla.gift.event.buyingSucceeded(e,t.id),e})).catch((function(e){throw salla.gift.event.buyingFailed(e,t.id),e})):(salla.gift.event.buyingFailed('There is no "id"!'),!1)}getGiftRequestData(e){let t=e.data||("object"==typeof e?e:void 0);return e=t?this.getPossibleValue(t,["prod_id","item_id","id"]):e,t="object"==typeof t?t:void 0,{id:e,formData:t}}}const a=o;class l extends r.Z{constructor(e){super(e),this.endpoints={login:"auth/{type}/send_verification",verify:"auth/{type}/verify",register:"auth/register",logout:"logout"},this.endpointsMethods={logout:"get"},this.hooksSelectores={login:"auth::login",verify:"auth::verify",register:"auth::register",logout:"auth::logout"},this.after_init()}login(e,t){let n;return e.data&&(n=e.element,t=e.data,e=this.getPossibleValue(t,["type"])),e?this.request(["login",e],t).then((function(t){return salla.auth.event.codeSent.call(n,t,e),t})).catch((function(t){throw salla.auth.event.codeNotSent.call(n,t,e),t})):(salla.auth.event.codeNotSent("Failed to know what's login type!"),!1)}verify(e,t){return e.data&&(t=e.data,e=this.getPossibleValue(t,["type"])),e?this.request(["verify",e],t).then((function(t){return salla.auth.event.verified(t,e),t})).catch((function(t){throw salla.auth.event.verificationFailed(t,e),t})):(salla.auth.event.verificationFailed("Failed to know what's login type!"),!1)}register(e){let t;return e.data&&(t=e.element,e=e.data),this.request("register",e).then((function(e){return salla.auth.event.registered.call(t,e),e})).catch((function(e){throw salla.auth.event.registrationFailed.call(t,e),e}))}logout(){return this.request("logout").then((function(e){return salla.auth.event.loggedOut(e),e})).catch((function(e){throw salla.auth.event.failedLogout(e),e}))}}const c=l;class u extends r.Z{constructor(e){super(e),this.endpoints={cancel:"order/{id}/cancel",reOrder:"reorder/{id}"},this.after_init()}cancel(e){return this.request(["cancel",e]).then((function(t){return salla.event.order.canceled(t,e),t})).catch((function(t){throw salla.event.order.notCanceled(t,e),t}))}reOrder(e){return this.request(["reOrder",e]).then((function(t){return salla.event.order.reOrdered(t,e),t})).catch((function(t){throw salla.event.order.reOrderFailed(t,e),t}))}}const h=u;class d extends r.Z{constructor(e){super(e),this.endpoints={popup:"products/special-offer-popup/{product_id}",increase:"products/special-offer-popup/{product_id}/increase"},this.endpointsMethods={increase:"get"},this.endpointsHeaders={popup:{headers:{"s-ajax-view":!0}}},this.hooksSelectores={popup:"offer::popup",increase:"offer::increase"},this.after_init()}popup(e,t){return t=t||e.data,(e=this.getPossibleValue(e,["product_id"]))?this.request(["popup",e],t).then((function(e){return e.events?(salla.offer.event.popupFailed(e,t),e):(salla.offer.event.popuped(e,t),e)})).catch((function(e){throw salla.offer.event.popupFailed(e,t),e})):(salla.offer.event.popupFailed('There is no "prodId"!'),!1)}increase(e){let t;return e.data&&(t=e.data,e=this.getPossibleValue(t,["id","product_id"])),e?this.request(["increase",e],t).then((function(e){return salla.offer.event.increased(e,t),e})).catch((function(e){throw salla.offer.event.increaseFailed(e,t),e})):(salla.offer.event.increaseFailed('There is no "prodId"!'),!1)}}const f=d;class p extends r.Z{constructor(e){super(e),this.endpoints={search:"search"},this.endpointsMethods={search:"get"},this.hooksSelectores={search:"search::products"},this.after_init()}search(e){let t=e.data||{params:{q:e}};if(e=t instanceof FormData?t.get("q"):t.q||t.params.q){if(e!=this.previousQuery)return this.previousQuery=e,this.request("search",t).then((function(t){return salla.search.event.finished(t,e),t})).catch((function(t){throw salla.search.event.failed(t,e),t}));salla.search.event.failed("Query Same As Previous!")}else salla.search.event.failed('There is no "query"!')}}const m=p;class g extends r.Z{constructor(e){super(e),this.endpoints={add:"checkout/{id}/coupons",remove:"checkout/{id}/coupons"},this.endpointsMethods={remove:"put"},this.hooksSelectores={add:"coupon::add",remove:"coupon::remove"},this.after_init()}add(e){e=e.data||e;let t=this.getPossibleValue(e,["id","cart_id"]);if(!t){let e=new Error('There is no "id"!');return e.name="MissingParameter",salla.event.coupon.addedFailed(e),!1}if(!this.getPossibleValue(e.data||e,["coupon"])){let e=new Error('There is no "Coupon Code"!');return e.name="EmptyCoupon",salla.event.coupon.addedFailed(e),!1}return this.request(["add",t],e).then((function(e){return salla.event.coupon.added(e,t),e})).catch((function(e){throw salla.event.coupon.addedFailed(e,t),e}))}remove(e){let t=this.getPossibleValue(e.data||e,["id","cart_id"]);return t?this.request(["remove",t],{}).then((function(e){return salla.event.coupon.removed(e,t),e})).catch((function(e){throw salla.event.coupon.removedFailed(e,t),e})):(salla.event.coupon.removedFailed('There is no "id"!'),!1)}}const v=g;class y extends r.Z{constructor(e){super(e),this.endpoints={price:"product-price/{id}",availabilityNotify:"{id}/out-of-stock-notify"},this.hooksSelectores={price:"product::price",availabilityNotify:"product::availability-notify"},this.after_init()}price(e){let t=e.data||e;return e=this.getPossibleValue(t,["id","prod_id"]),this.request(["price",e],"object"==typeof t?t:void 0).then((function(t){return salla.product.event.price(t,e),t})).catch((function(t){throw salla.product.event.priceFailed(t,e),t}))}availabilityNotify(e){let t=e.data||e;return e=this.getPossibleValue(t,["id","prod_id"]),this.request(["availabilityNotify",e],"object"==typeof t?t:void 0).then((function(t){return salla.product.event.availabilitySubscribed(t,e),t})).catch((function(t){throw salla.product.event.availabilityFailed(t,e),t}))}}const _=y;class b extends r.Z{constructor(e){super(e),this.endpoints={addProduct:"{id}/comment",addPage:"{id}/comment"},this.hooksSelectores={addProduct:"comment::product-add",addPage:"comment::page-add"},this.after_init()}addProduct(e,t){return this.addComment(e,t,"product")}addPage(e,t){return this.addComment(e,t,"page")}addComment(e,t,n){let r;return e.data&&(t=e.data,r=e.element,e=this.getPossibleValue(t,["id","itemId"])),e?t&&"object"==typeof t?["product","page"].includes(n)?(t instanceof FormData?formData.append("type",n):t.type=n,this.request([{product:"addProduct",page:"addPage"}[n],e],t).then((function(t){return salla.event.comment.added.call(r,t,e),t})).catch((function(t){throw salla.event.comment.additionFailed.call(r,t,e),t}))):(salla.event.comment.additionFailed("Failed to get type!"),!1):(salla.event.comment.additionFailed("Failed to get formdata!"),!1):(salla.event.comment.additionFailed("Failed to get id!"),!1)}}const w=b;class S extends r.Z{constructor(e){super(e),this.endpoints={change:"/?currency={currency}"},this.endpointsMethods={change:"get"},this.endpointsHeaders={change:{headers:{"s-is-change-currency":!0}}},this.hooksSelectores={change:"currency::change"},this.after_init()}change(e){return(e=this.getPossibleValue(e.data||e,["currency","code"]))?this.request(["change",e],e).then((function(t){return salla.currency.event.changed(t,e),t})).catch((function(t){throw salla.currency.event.failed(t,e),t})):(salla.currency.event.failed("There is Currency Code!"),!1)}}const E=S;class x extends r.Z{constructor(e){super(e)}}const k=x;class L extends r.Z{constructor(e){super(e),this.endpoints={store:"rate_store",product:"rate_product",shipping:"rate_shipping"},this.hooksSelectores={store:"feedback::store",product:"feedback::product",shipping:"feedback::shipping"},this.after_init()}store(e){return(e=e.data||e)?this.request("store",e).then((function(t){return salla.event.feedback.storeRated(t,e),t})).catch((function(t){throw salla.event.feedback.storeFailed(t,e),t})):(salla.event.coupon.addedFailed('There is no "data"!'),!1)}product(e){return(e=e.data||e)?this.request("product",e).then((function(t){return salla.event.feedback.productRated(t,e),t})).catch((function(t){throw salla.event.feedback.productFailed(t,e),t})):(salla.event.feedback.storeFailed('There is no "data"!'),!1)}shipping(e){return(e=e.data||e)?this.request("shipping",e).then((function(t){return salla.event.feedback.shippingRated(t,e),t})).catch((function(t){throw salla.event.feedback.shippingFailed(t,e),t})):(salla.event.feedback.shippingFailed('There is no "data"!'),!1)}}const A=L;class P extends r.Z{constructor(e){super(e),this.endpoints={add:"wishlist/add/{id}",remove:"wishlist/{id}"},this.endpointsMethods={remove:"delete"},this.hooksSelectores={add:"wishlist::add",remove:"wishlist::remove"},this.after_init()}add(e){let t;return e.data&&(t=e.element,e=this.getPossibleValue(e.data,["id","prod_id"])),e?this.request(["add",e]).then((function(n){return salla.wishlist.event.added.call(t,n,e),n})).catch((function(n){throw salla.wishlist.event.additionFailed.call(t,n,e),n})):(salla.wishlist.event.additionFailed("Failed to get id!"),!1)}remove(e){let t;return e.data&&(t=e.element,e=this.getPossibleValue(e.data,["id","prod_id"])),e?this.request(["remove",e]).then((function(n){return salla.wishlist.event.removed.call(t,n,e),n})).catch((function(n){throw salla.wishlist.event.removingFailed.call(t,n,e),n})):(salla.wishlist.event.removingFailed("Failed to get id!"),!1)}}const F=P;var j=n(4559),q=n.n(j);const O=new class extends class{constructor(){let e=document.head.querySelector('meta[name="_token"]'),t={"X-Requested-With":"XMLHttpRequest"};return e?t["X-CSRF-TOKEN"]=e.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token"),q().create({baseURL:window.baseUrl,headers:{common:t,"S-SOURCE":"sallaApi"}})}}{constructor(){super(),this.apis={auth:new c(this),cart:new s(this),gift:new a(this),order:new h(this),offer:new f(this),search:new m(this),coupon:new v(this),product:new _(this),comment:new w(this),currency:new E(this),document:new k(this),feedback:new A(this),wishlist:new F(this)},this.hooksPrefix="data-on-",this.hooksSelectores=[],Object.assign(this,this.apis)}}},7868:(e,t,n)=>{"use strict";n.d(t,{Z:()=>w});const r=class{constructor(e){this.parent=e,this.events={},this.namespace="";var t=/function (.{1,})\(/.exec(this.constructor.toString());this.className=(t&&t.length>1?t[1]:"").toLowerCase()}after_init(){this.createDynamicFunctions()}createDynamicFunctions(){Object.keys(this.events).forEach((e=>{this.createDynamicEventFuns(e),this.createDynamicListenerFuns(e)}))}createDynamicEventFuns(e){if(this[e])return;let t=this;this[e]=function(...n){return t.dispatch(e,...n)}}createDynamicListenerFuns(e){let t="on"+e.charAt(0).toUpperCase()+e.slice(1);if(this[t])return;let n=this;this[t]=function(t){return n.on(e,t)}}getEventName(e){return e=this.events[e]||e,!this.namespace||e.includes("::")?e:this.namespace+this.parent.delimiter+e}dispatch(e,...t){return this.parent.dispatch(this.getEventName(e),...t)}on(e,t){this.parent.addListener(this.getEventName(e),t)}register(e,t){this.on(e,t)}registerEventTemporary(e,t,n){n||(n=1),emitter.many(e,n,t)}},i=class extends r{constructor(e){super(e),this.namespace="cart",this.events={updated:"updated",itemUpdated:"item-updated",itemUpdatedFailed:"item-updated-failed",itemAdded:"item-added",itemAddedFailed:"item-added-failed",itemDeleted:"item-deleted",itemDeletedFailed:"item-deleted-failed",submitted:"submitted",submitFailed:"submit-failed",fileDeleted:"file-deleted",fileDeletedFailed:"file-deleted-failed",summaryFetched:"summary-fetched",summaryNotFetched:"summary-not-fetched"},this.after_init()}getCartResults(e){return e?e.data?this.getCartResults(e.data):e.cart||e:e}updated(e){let t=this.getCartResults(e);if(t){t.hasOffer&&salla.offer.event.existed(e.data||e);try{localStore.set("cart_widget_summary",t)}catch(e){salla.notify.log(e)}}this.dispatch("updated",localStore.get("cart_widget_summary"),e)}itemAdded(e,t){return this.updated(e),this.dispatch("itemAdded",e,t)}itemDeleted(e,t){return this.updated(e),this.dispatch("itemDeleted",e,t)}itemUpdated(e,t){return this.updated(e),this.dispatch("itemUpdated",e,t)}summaryFetched(e){this.updated(e)}clearCartSummary(){let e=localStore.get("cart_widget_summary");e&&(e.count||e.items)&&salla.cart.api.fetchSummary()}},s=class extends r{constructor(e){super(e),this.namespace="gift",this.events={buyingSucceeded:"buying-succeeded",buyingFailed:"buying-failed"},this.after_init()}},o=class extends r{constructor(e){super(e),this.namespace="auth",this.events={login:"login",logout:"logout",codeSent:"code-sent",codeNotSent:"code-not-sent",verified:"verified",verificationFailed:"verification-failed",loggedIn:"logged-in",registered:"registered",registrationFailed:"registration-failed",loggedOut:"logged-out",failedLogout:"failed-logout"},this.after_init()}},a=class extends r{constructor(e){super(e),this.namespace="search",this.events={finished:"finished",failed:"failed"},this.after_init()}},l=class extends r{constructor(e){super(e),this.namespace="wishlist",this.events={added:"added",removed:"removed",additionFailed:"addition-failed",removingFailed:"removing-failed"},this.after_init()}},c=class extends r{constructor(e){super(e),this.namespace="comment",this.events={added:"added",additionFailed:"addition-failed"},this.after_init()}},u=class extends r{constructor(e){super(e),this.namespace="order",this.events={canceled:"canceled",notCanceled:"not-canceled",reOrdered:"re-ordered",reOrderFailed:"re-order-failed"},this.after_init()}},h=class extends r{constructor(e){super(e),this.namespace="infiniteScroll",this.events={scrollThreshold:"scroll-threshold",request:"request",load:"load",append:"append",error:"error",last:"last",history:"history"},this.after_init()}},d=class extends r{constructor(e){super(e),this.namespace="document",this.events={click:"click",change:"change",submit:"submit",keyup:"keyup",leaving:"leaving",request:"request"},this.after_init()}onClick(e,t){this.fireCallableFuns("click",e,t)}onChange(e,t){this.fireCallableFuns("change",e,t)}onSubmit(e,t){this.fireCallableFuns("submit",e,t)}onKeyup(e,t){this.fireCallableFuns("keyup",e,t)}fireCallableFuns(e,t,n){this.on(e,(e=>{"function"!=typeof t?"function"==typeof n&&e.target.matches(t)&&n(e):t(e)}))}fireEvent(e,t,...n){return this.fireEventForElements(e,t,!1,...n)}fireEventForAll(e,t,...n){return this.fireEventForElements(e,t,!0,...n)}fireEventForElements(e,t,n,...r){if("string"==typeof e){if(n)return document.querySelectorAll(e).forEach((e=>this.fireEventForElements(e,t,!1,...r)));e=document.querySelector(e)}if(!e)return void salla.log("Faild To get element to fire event: "+t);const i=new CustomEvent(t,...r);return e.dispatchEvent(i)}},f=class extends r{constructor(e){super(e),this.namespace="product",this.events={price:"price",priceFailed:"price-failed",availabilitySubscribed:"availability-subscribed",availabilityFailed:"availability-failed"},this.after_init()}},p=class extends r{constructor(e){super(e),this.namespace="offer",this.events={existed:"existed",popuped:"popuped",popupFailed:"popup-failed",increased:"increase",increaseFailed:"increase-failed"},this.after_init()}},m=class extends r{constructor(e){super(e),this.namespace="coupon",this.events={added:"added",removed:"removed",addedFailed:"added-failed",removedFailed:"removed-failed"},this.after_init()}},g=class extends r{constructor(e){super(e),this.namespace="feedback",this.events={storeRated:"store-rated",storeFailed:"store-failed",productRated:"product-rated",productFailed:"product-failed",shippingRated:"shipping-rated",shippingFailed:"shipping-failed"},this.after_init()}},v=class extends r{constructor(e){super(e),this.namespace="currency",this.events={changed:"changed",failed:"failed"},this.after_init()}changed(...e){return salla.cart.api.fetchSummary().then((()=>this.dispatch("changed",...e)))}};var y=n(35),_=n.n(y);class b extends(_()){constructor(){super({wildcard:!0,delimiter:"::",newListener:!1,removeListener:!1,maxListeners:10,verboseMemoryLeak:!1,ignoreErrors:!1}),this.globalListners={},this.delimiter="::",this.cart=new i(this),this.gift=new s(this),this.auth=new o(this),this.search=new a(this),this.wishlist=new l(this),this.comment=new c(this),this.order=new u(this),this.infiniteScroll=new h(this),this.document=new d(this),this.product=new f(this),this.offer=new p(this),this.coupon=new m(this),this.feedback=new g(this),this.currency=new v(this),this.body=document.querySelector("body"),this.logAbleEvents=["cart::item-added-failed","cart::item-deleted-failed"],this.ingoreLogEvents=["document::click","document::keyup","document::change"],this.on("salla::initiated",this.initiateSallaInAllClasses)}initiateSallaInAllClasses(){let e=this;Object.keys(salla).forEach((t=>{"object"==typeof(t=salla[t])&&(e.callSallaInitiate(t),Object.keys(t).forEach((n=>{e.callSallaInitiate(t[n])})))}))}callSallaInitiate(e){e&&e.sallaInitiated&&!e.initiated&&(e.sallaInitiated(),e.initiated=!0)}createAndDispatch(e,...t){this.dispatch(e,...t)}dispatch(e,...t){this.emit(e,...t),window.dataLayer=window.dataLayer||[],window.dataLayer.push(Object.assign({event:e},...t.values())),this.ingoreLogEvents.includes(e)||!salla.config.debug&&!this.logAbleEvents.includes(e)||salla.notify.log(e,...t);let n=this;Object.keys(this.globalListners).forEach((function(r){n.globalListners[r](e,...t)})),this.dispatchMobileEvent(e,{...t.values()})}dispatchEvents(e){if(e&&"object"==typeof e)for(const[t,n]of Object.entries(e))this.dispatch(t,n);else salla.log("No Events To Dispatch!",e)}addListener(e,t){this.on(e,t)}listen(e,t){this.addListener(e,t)}registerGlobalListener(e,t){this.globalListners[e]=t}dispatchMobileEvent(e,t={}){if(!(window.dataLayer&&dataLayer[0]&&dataLayer[0].page&&dataLayer[0].page.mobileApp))return"";if(window.webkit)try{window.webkit.messageHandlers.callbackHandler.postMessage(JSON.stringify({event:e,details:t}))}catch(e){console.log(e),console.log("The native context does not exist yet")}else if(Android)try{Android.customEventWithData(e,JSON.stringify({details:t}))}catch(e){console.log(e),console.log("The native context does not exist yet")}}}const w=new b},714:()=>{function e(e,t,n){return n=n||e.dataset,["filterBeforeSubmit","filterBeforeSend"].forEach((r=>{let i=e.dataset[r];if(i){var s=window[i];if("function"==typeof s)return s(n,e,t);salla.log("window."+i+"() not founded!")}})),n}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){for(var t=this;t;){if(t.matches(e))return t;t=t.parentElement}}),Element.prototype.getElementSallaData=function(e,...t){if(!this.getAttribute)return;if(this.hasAttribute("data-json"))try{return JSON.parse(this.getAttribute("data-json"))}catch(e){}let n=this.getAttribute("data-function");if(!n||!window[n]){let e;if(e=this.hasAttribute("data-form-selector")?document.querySelector(this.getAttribute("data-form-selector")):this.closest("[salla-form-data]"),!e&&(e=this.closest("form")))return new FormData(e);e=this.closest("[salla-form-data]")||this;let t=e.querySelectorAll("[name]");if(!t.length)return this.dataset;let n=Object.assign({},this.dataset);return t.forEach((e=>{if(!["checkbox","radio"].includes(e.type)||e.checked)try{let t=salla.helpers.inputData(e.name,e.value,n);n[t.name]=t.value}catch(t){salla.log(e.name+" can't be send")}})),n}return"function"==typeof window[n]?window[n].call(this,...t):window[n]},Element.prototype.canEventFireHook=function(e){return!!this.hasAttribute&&this.hasAttribute(salla.api.hooksPrefix+e.type)},Element.prototype.hasAttributeStartsWith=function(e,t){e=e.toLowerCase();for(var n=0;n<this.attributes.length;n++){let r=this.attributes[n].name.toLowerCase();if(0==r.indexOf(e))return!t||r}return!1},HTMLFormElement.prototype.getAjaxFormData=function(t){var n=this.querySelectorAll('input[type="file"]');n.forEach((e=>{e.files.length||e.setAttribute("disabled","")}));var r=new FormData(this);return n.forEach((e=>{e.files.length||e.removeAttribute("disabled")})),{formData:e(this,t,r),url:this.getAttribute("action"),method:this.getAttribute("method")||"post",events:{success:this.dataset.onSuccess,fail:this.dataset.onFail}}},HTMLAnchorElement.prototype.getAjaxFormData=function(t){return{formData:e(this,t),url:this.getAttribute("href"),method:this.dataset.type||"get",events:{success:this.dataset.onSuccess,fail:this.dataset.onFail}}}},7023:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r,helpers:()=>o}),n(5009),n(714);const r=n(3520).Z;function i(e){let t=(e.match(/\./g)||[]).length;return t&&1!=t?i(e.replace(/\.(.+)\./g,".$1")):e}function s(e,t,n){let r=e[0];return n&&0==e.length?Array.isArray(n)?(n.push(t),n):[n,t]:Array.isArray(n)?(n.push(t),n):"string"==typeof n?[n,t]:n?(n[r]=s(e.slice(1),t,n[r]),n):r?{[r]:s(e.slice(1),t)}:""===r?[t]:t}var o={digitsOnly:function(e,t){let n=document.getElementById(e);if(!n)return void salla.log("Can't find Object With Id: "+e);let r=n.value.toArabicDigits().replace(/[^0-9.]/g,"").replace("..",".");return n.min&&r<n.min?n.value=n.min:n.max&&r>n.max?n.value=n.max:n.maxLength>=1&&r.toString().length>n.maxLength?n.value=r.toString().substring(0,n.maxLength):n.value=t||n.dataset.hasOwnProperty("digitsWithDecimal")?i(r):r.replace(/\D/g,"")},debounce:function(e,t){t=t||100;let n,r=[];return function(...i){return clearTimeout(n),n=setTimeout((()=>{let t=e(...i);r.forEach((e=>e(t))),r=[]}),t),new Promise((e=>r.push(e)))}},inputData:function(e,t,n={}){if(e.includes("[")){let r=e.split("]").join("").split("[");return{name:r[0],value:s(r.slice(1),t,n[r[0]])}}return{name:e,value:t}}}},3520:(e,t,n)=>{"use strict";function r(e,t){if(!(t instanceof HTMLFormElement||t instanceof HTMLAnchorElement))return!1;e.preventDefault();var n=t.getAjaxFormData(e),r=n.method?n.method.toLowerCase():void 0;salla.api.document.request(n.url,n.formData,r).then((function(e){return e.data&&e.request&&(e=e.data),salla.api.document.handleAfterResponseActions(e),i(n.events.success,e,n.formData),e})).catch((function(e){throw salla.api.document.handleErrorResponse(e),i(n.events.fail,e,n.formData),e}))}function i(e,t,n){if(e){if(n instanceof FormData){var r={};Array.from(n.entries()).forEach((function(e){r[e[0]]=e[1]})),n=r}window[e]?window[e](t,n):salla.event.dispatch(e,t,n)}}n.d(t,{Z:()=>s}),window.onbeforeunload=function(e){if(salla.document.event.leaving(e),!salla.config.canLeave)return e.preventDefault(),!1};const s=function(e){"object"==typeof e&&(salla.config=Object.assign(salla.config,e),e.token&&(salla.api.defaults.headers.common["X-CSRF-TOKEN"]=e.token)),salla.config.token=salla.api.defaults.headers.common["X-CSRF-TOKEN"],salla.event.dispatch("salla::initiated"),function(e){let t=["click","change","submit","keyup"],n=salla.api.hooksPrefix;for(let e=0;e<4;e++)document.addEventListener(t[e],(function(i){let s=t[e];if(salla.event.document[s](i),i.target.matches(".ajax")&&("click"==s&&i.target instanceof HTMLAnchorElement||"submit"==s&&i.target instanceof HTMLFormElement))return void r(i,i.target);let o=!0;for(let{target:e}=i;e&&e!==this&&o;e=e.parentNode){let t=n+s,r=e.getAttribute(t);if(!r)continue;let a=r.split("::")[0],l=salla.api.apis[a];l&&Object.keys(l.hooksSelectores).forEach((t=>{l.hooksSelectores[t]===r&&(e.hasAttribute("data-allow-default")||i.preventDefault(),l[t].call(l,l.withInjectData(e,r))||i.stopPropagation(),o=!1)}))}}))}()}},5009:()=>{String.prototype.toStudlyCase=function(){return this.trim().replace(/([^a-zA-Z\d].)/g,(function(e){return e.toUpperCase().replace(/[^a-zA-Z\d]/g,"")}))},String.prototype.toDatasetName=function(){return this.startsWith("data-")?this.substr(5).toStudlyCase():this.toStudlyCase()},String.prototype.toSelector=function(){return this.trim().startsWith(".")||this.trim().startsWith("#")?this:"#"+this},String.prototype.replaceArray=function(e,t){for(var n,r=this,i=0;i<e.length;i++)n=new RegExp(e[i],"g"),r=r.replace(n,t[i]);return r},String.prototype.toArabicDigits=function(){return this.replaceArray(["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"," ","-","/","|","~"],["0","1","2","3","4","5","6","7","8","9","","","","",""])}},2489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(2257),i=n.n(r);class s extends(i()){constructor(e){(e=e||{}).messages=e.messages||window.translations,e.locale=e.locale||window.locale||"en",e.fallback=e.fallback||"en",e.messages||console.warn('You should load Salla Translations Before!\nUse: <script src="{{ link("languages/assets/#{store.theme.translations_hash}.js") }}"><\/script>\nor: salla.lang.setMessages({....}), see https://github.com/rmariuzzo/Lang.js for more informations.'),super(e)}get(e,t,n){return window.translations&&(e="trans."+e),super.get(e,t,n)}}const o=new s},6308:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fire:()=>s,setNotifier:()=>i,log:()=>h,setLogger:()=>u,error:()=>o,success:()=>l,info:()=>a,sallaInitiated:()=>d,types:()=>f});let r=function(e,t,n){return alert(e,t,n)},i=function(e){r=e},s=function(e,t,n){return r(e,t,n)},o=function(e,t){return r(e,f.error,t)},a=function(e,t){return r(e,f.info,t)},l=function(e,t){return r(e,f.success,t)},c=function(...e){return console.log(...e)},u=function(e){c=e},h=function(...e){return c(...e)};var d=function(){var e=window.location.href.match(/([\?\&]danger=)[^&]+/g);e&&e.forEach((e=>{o(decodeURI(e.replace("?danger=","").replace("&danger=","")))}))},f={error:"error",success:"success",info:"info"}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";window.localStore||(window.localStore=__webpack_require__(3230));var e=__webpack_require__(7023),t=__webpack_require__(6308),n=__webpack_require__(7868).Z,r=__webpack_require__(8908).Z,i=__webpack_require__(6151).Z,s=__webpack_require__(7541).Z,o=__webpack_require__(9472).Z,a=__webpack_require__(6799).Z,l=__webpack_require__(4109).Z,c=__webpack_require__(1620).Z,u=__webpack_require__(7666).Z,h=__webpack_require__(6986).Z,d=__webpack_require__(3069).Z,f=__webpack_require__(8963).Z,p=__webpack_require__(3759).Z,m=__webpack_require__(2138).Z,g=__webpack_require__(4555).Z,v=__webpack_require__(7547).Z;window.Salla=window.salla={config:{debug:!1,token:null,fastRequests:!0,canLeave:!0},notify:t,api:r,event:n,infiniteScroll:new v(void 0,n.infiniteScroll),helpers:e.helpers,lang:__webpack_require__(2489).Z,cart:new i(r.cart,n.cart),auth:new s(r.auth,n.auth),order:new o(r.order,n.order),gift:new a(r.gift,n.gift),offer:new l(r.offer,n.offer),search:new c(r.search,n.search),coupon:new u(r.coupon,n.coupon),comment:new h(r.comment,n.comment),product:new d(r.product,n.product),currency:new f(r.currency,n.currency),document:new p(r.document,n.document),feedback:new m(r.feedback,n.feedback),wishlist:new g(r.wishlist,n.wishlist),log:t.log,success:t.success,error:t.error,init:e.default}})()})();
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
9
|
+
/******/ (() => { // webpackBootstrap
|
|
10
|
+
/******/ var __webpack_modules__ = ({
|
|
11
|
+
|
|
12
|
+
/***/ "./node_modules/axios/index.js":
|
|
13
|
+
/*!*************************************!*\
|
|
14
|
+
!*** ./node_modules/axios/index.js ***!
|
|
15
|
+
\*************************************/
|
|
16
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
17
|
+
|
|
18
|
+
eval("module.exports = __webpack_require__(/*! ./lib/axios */ \"./node_modules/axios/lib/axios.js\");\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/index.js?");
|
|
19
|
+
|
|
20
|
+
/***/ }),
|
|
21
|
+
|
|
22
|
+
/***/ "./node_modules/axios/lib/adapters/xhr.js":
|
|
23
|
+
/*!************************************************!*\
|
|
24
|
+
!*** ./node_modules/axios/lib/adapters/xhr.js ***!
|
|
25
|
+
\************************************************/
|
|
26
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
27
|
+
|
|
28
|
+
"use strict";
|
|
29
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nvar settle = __webpack_require__(/*! ./../core/settle */ \"./node_modules/axios/lib/core/settle.js\");\n\nvar buildURL = __webpack_require__(/*! ./../helpers/buildURL */ \"./node_modules/axios/lib/helpers/buildURL.js\");\n\nvar buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ \"./node_modules/axios/lib/core/buildFullPath.js\");\n\nvar parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ \"./node_modules/axios/lib/helpers/parseHeaders.js\");\n\nvar isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ \"./node_modules/axios/lib/helpers/isURLSameOrigin.js\");\n\nvar createError = __webpack_require__(/*! ../core/createError */ \"./node_modules/axios/lib/core/createError.js\");\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest(); // HTTP basic authentication\n\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); // Set the request timeout in MS\n\n request.timeout = config.timeout; // Listen for ready state\n\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n } // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n\n\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n } // Prepare the response\n\n\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n settle(resolve, reject, response); // Clean up request\n\n request = null;\n }; // Handle browser request cancellation (as opposed to a manual cancellation)\n\n\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request)); // Clean up request\n\n request = null;\n }; // Handle low level network errors\n\n\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request)); // Clean up request\n\n request = null;\n }; // Handle timeout\n\n\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', request)); // Clean up request\n\n request = null;\n }; // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n\n if (utils.isStandardBrowserEnv()) {\n var cookies = __webpack_require__(/*! ./../helpers/cookies */ \"./node_modules/axios/lib/helpers/cookies.js\"); // Add xsrf header\n\n\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n } // Add headers to the request\n\n\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n } // Add withCredentials to request if needed\n\n\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n } // Add responseType to request if needed\n\n\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n } // Handle progress if needed\n\n\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n } // Not all browsers support upload events\n\n\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel); // Clean up request\n\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n } // Send the request\n\n\n request.send(requestData);\n });\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/adapters/xhr.js?");
|
|
30
|
+
|
|
31
|
+
/***/ }),
|
|
32
|
+
|
|
33
|
+
/***/ "./node_modules/axios/lib/axios.js":
|
|
34
|
+
/*!*****************************************!*\
|
|
35
|
+
!*** ./node_modules/axios/lib/axios.js ***!
|
|
36
|
+
\*****************************************/
|
|
37
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
38
|
+
|
|
39
|
+
"use strict";
|
|
40
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/axios/lib/utils.js\");\n\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/axios/lib/helpers/bind.js\");\n\nvar Axios = __webpack_require__(/*! ./core/Axios */ \"./node_modules/axios/lib/core/Axios.js\");\n\nvar mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ \"./node_modules/axios/lib/core/mergeConfig.js\");\n\nvar defaults = __webpack_require__(/*! ./defaults */ \"./node_modules/axios/lib/defaults.js\");\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\n\n\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context); // Copy axios.prototype to instance\n\n utils.extend(instance, Axios.prototype, context); // Copy context to instance\n\n utils.extend(instance, context);\n return instance;\n} // Create the default instance to be exported\n\n\nvar axios = createInstance(defaults); // Expose Axios class to allow class inheritance\n\naxios.Axios = Axios; // Factory for creating new instances\n\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n}; // Expose Cancel & CancelToken\n\n\naxios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ \"./node_modules/axios/lib/cancel/Cancel.js\");\naxios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ \"./node_modules/axios/lib/cancel/CancelToken.js\");\naxios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ \"./node_modules/axios/lib/cancel/isCancel.js\"); // Expose all/spread\n\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = __webpack_require__(/*! ./helpers/spread */ \"./node_modules/axios/lib/helpers/spread.js\");\nmodule.exports = axios; // Allow use of default import syntax in TypeScript\n\nmodule.exports[\"default\"] = axios;\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/axios.js?");
|
|
41
|
+
|
|
42
|
+
/***/ }),
|
|
43
|
+
|
|
44
|
+
/***/ "./node_modules/axios/lib/cancel/Cancel.js":
|
|
45
|
+
/*!*************************************************!*\
|
|
46
|
+
!*** ./node_modules/axios/lib/cancel/Cancel.js ***!
|
|
47
|
+
\*************************************************/
|
|
48
|
+
/***/ ((module) => {
|
|
49
|
+
|
|
50
|
+
"use strict";
|
|
51
|
+
eval("\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\n\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\nmodule.exports = Cancel;\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/cancel/Cancel.js?");
|
|
52
|
+
|
|
53
|
+
/***/ }),
|
|
54
|
+
|
|
55
|
+
/***/ "./node_modules/axios/lib/cancel/CancelToken.js":
|
|
56
|
+
/*!******************************************************!*\
|
|
57
|
+
!*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
|
|
58
|
+
\******************************************************/
|
|
59
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
60
|
+
|
|
61
|
+
"use strict";
|
|
62
|
+
eval("\n\nvar Cancel = __webpack_require__(/*! ./Cancel */ \"./node_modules/axios/lib/cancel/Cancel.js\");\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\n\n\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\n\n\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n\n\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/cancel/CancelToken.js?");
|
|
63
|
+
|
|
64
|
+
/***/ }),
|
|
65
|
+
|
|
66
|
+
/***/ "./node_modules/axios/lib/cancel/isCancel.js":
|
|
67
|
+
/*!***************************************************!*\
|
|
68
|
+
!*** ./node_modules/axios/lib/cancel/isCancel.js ***!
|
|
69
|
+
\***************************************************/
|
|
70
|
+
/***/ ((module) => {
|
|
71
|
+
|
|
72
|
+
"use strict";
|
|
73
|
+
eval("\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/cancel/isCancel.js?");
|
|
74
|
+
|
|
75
|
+
/***/ }),
|
|
76
|
+
|
|
77
|
+
/***/ "./node_modules/axios/lib/core/Axios.js":
|
|
78
|
+
/*!**********************************************!*\
|
|
79
|
+
!*** ./node_modules/axios/lib/core/Axios.js ***!
|
|
80
|
+
\**********************************************/
|
|
81
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
82
|
+
|
|
83
|
+
"use strict";
|
|
84
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nvar buildURL = __webpack_require__(/*! ../helpers/buildURL */ \"./node_modules/axios/lib/helpers/buildURL.js\");\n\nvar InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ \"./node_modules/axios/lib/core/InterceptorManager.js\");\n\nvar dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ \"./node_modules/axios/lib/core/dispatchRequest.js\");\n\nvar mergeConfig = __webpack_require__(/*! ./mergeConfig */ \"./node_modules/axios/lib/core/mergeConfig.js\");\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\n\n\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\n\n\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config); // Set config.method\n\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n } // Hook up interceptors middleware\n\n\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n}; // Provide aliases for supported request methods\n\n\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\nmodule.exports = Axios;\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/core/Axios.js?");
|
|
85
|
+
|
|
86
|
+
/***/ }),
|
|
87
|
+
|
|
88
|
+
/***/ "./node_modules/axios/lib/core/InterceptorManager.js":
|
|
89
|
+
/*!***********************************************************!*\
|
|
90
|
+
!*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
|
|
91
|
+
\***********************************************************/
|
|
92
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
93
|
+
|
|
94
|
+
"use strict";
|
|
95
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n\n\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\n\n\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\n\n\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/core/InterceptorManager.js?");
|
|
96
|
+
|
|
97
|
+
/***/ }),
|
|
98
|
+
|
|
99
|
+
/***/ "./node_modules/axios/lib/core/buildFullPath.js":
|
|
100
|
+
/*!******************************************************!*\
|
|
101
|
+
!*** ./node_modules/axios/lib/core/buildFullPath.js ***!
|
|
102
|
+
\******************************************************/
|
|
103
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
104
|
+
|
|
105
|
+
"use strict";
|
|
106
|
+
eval("\n\nvar isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ \"./node_modules/axios/lib/helpers/isAbsoluteURL.js\");\n\nvar combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ \"./node_modules/axios/lib/helpers/combineURLs.js\");\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\n\n\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n\n return requestedURL;\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/core/buildFullPath.js?");
|
|
107
|
+
|
|
108
|
+
/***/ }),
|
|
109
|
+
|
|
110
|
+
/***/ "./node_modules/axios/lib/core/createError.js":
|
|
111
|
+
/*!****************************************************!*\
|
|
112
|
+
!*** ./node_modules/axios/lib/core/createError.js ***!
|
|
113
|
+
\****************************************************/
|
|
114
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
115
|
+
|
|
116
|
+
"use strict";
|
|
117
|
+
eval("\n\nvar enhanceError = __webpack_require__(/*! ./enhanceError */ \"./node_modules/axios/lib/core/enhanceError.js\");\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\n\n\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/core/createError.js?");
|
|
118
|
+
|
|
119
|
+
/***/ }),
|
|
120
|
+
|
|
121
|
+
/***/ "./node_modules/axios/lib/core/dispatchRequest.js":
|
|
122
|
+
/*!********************************************************!*\
|
|
123
|
+
!*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
|
|
124
|
+
\********************************************************/
|
|
125
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
126
|
+
|
|
127
|
+
"use strict";
|
|
128
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nvar transformData = __webpack_require__(/*! ./transformData */ \"./node_modules/axios/lib/core/transformData.js\");\n\nvar isCancel = __webpack_require__(/*! ../cancel/isCancel */ \"./node_modules/axios/lib/cancel/isCancel.js\");\n\nvar defaults = __webpack_require__(/*! ../defaults */ \"./node_modules/axios/lib/defaults.js\");\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\n\n\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\n\n\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config); // Ensure headers exist\n\n config.headers = config.headers || {}; // Transform request data\n\n config.data = transformData(config.data, config.headers, config.transformRequest); // Flatten headers\n\n config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);\n utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) {\n delete config.headers[method];\n });\n var adapter = config.adapter || defaults.adapter;\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config); // Transform response data\n\n response.data = transformData(response.data, response.headers, config.transformResponse);\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config); // Transform response data\n\n if (reason && reason.response) {\n reason.response.data = transformData(reason.response.data, reason.response.headers, config.transformResponse);\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/core/dispatchRequest.js?");
|
|
129
|
+
|
|
130
|
+
/***/ }),
|
|
131
|
+
|
|
132
|
+
/***/ "./node_modules/axios/lib/core/enhanceError.js":
|
|
133
|
+
/*!*****************************************************!*\
|
|
134
|
+
!*** ./node_modules/axios/lib/core/enhanceError.js ***!
|
|
135
|
+
\*****************************************************/
|
|
136
|
+
/***/ ((module) => {
|
|
137
|
+
|
|
138
|
+
"use strict";
|
|
139
|
+
eval("\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\n\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function () {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n\n return error;\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/core/enhanceError.js?");
|
|
140
|
+
|
|
141
|
+
/***/ }),
|
|
142
|
+
|
|
143
|
+
/***/ "./node_modules/axios/lib/core/mergeConfig.js":
|
|
144
|
+
/*!****************************************************!*\
|
|
145
|
+
!*** ./node_modules/axios/lib/core/mergeConfig.js ***!
|
|
146
|
+
\****************************************************/
|
|
147
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
148
|
+
|
|
149
|
+
"use strict";
|
|
150
|
+
eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/axios/lib/utils.js\");\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\n\n\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];\n var defaultToConfig2Keys = ['baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer', 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken', 'socketPath'];\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n }\n });\n utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {\n if (utils.isObject(config2[prop])) {\n config[prop] = utils.deepMerge(config1[prop], config2[prop]);\n } else if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (utils.isObject(config1[prop])) {\n config[prop] = utils.deepMerge(config1[prop]);\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys);\n var otherKeys = Object.keys(config2).filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n return config;\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/core/mergeConfig.js?");
|
|
151
|
+
|
|
152
|
+
/***/ }),
|
|
153
|
+
|
|
154
|
+
/***/ "./node_modules/axios/lib/core/settle.js":
|
|
155
|
+
/*!***********************************************!*\
|
|
156
|
+
!*** ./node_modules/axios/lib/core/settle.js ***!
|
|
157
|
+
\***********************************************/
|
|
158
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
159
|
+
|
|
160
|
+
"use strict";
|
|
161
|
+
eval("\n\nvar createError = __webpack_require__(/*! ./createError */ \"./node_modules/axios/lib/core/createError.js\");\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\n\n\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n\n if (!validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError('Request failed with status code ' + response.status, response.config, null, response.request, response));\n }\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/core/settle.js?");
|
|
162
|
+
|
|
163
|
+
/***/ }),
|
|
164
|
+
|
|
165
|
+
/***/ "./node_modules/axios/lib/core/transformData.js":
|
|
166
|
+
/*!******************************************************!*\
|
|
167
|
+
!*** ./node_modules/axios/lib/core/transformData.js ***!
|
|
168
|
+
\******************************************************/
|
|
169
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
170
|
+
|
|
171
|
+
"use strict";
|
|
172
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\n\n\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n return data;\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/core/transformData.js?");
|
|
173
|
+
|
|
174
|
+
/***/ }),
|
|
175
|
+
|
|
176
|
+
/***/ "./node_modules/axios/lib/defaults.js":
|
|
177
|
+
/*!********************************************!*\
|
|
178
|
+
!*** ./node_modules/axios/lib/defaults.js ***!
|
|
179
|
+
\********************************************/
|
|
180
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
181
|
+
|
|
182
|
+
"use strict";
|
|
183
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/axios/lib/utils.js\");\n\nvar normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ \"./node_modules/axios/lib/helpers/normalizeHeaderName.js\");\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = __webpack_require__(/*! ./adapters/xhr */ \"./node_modules/axios/lib/adapters/xhr.js\");\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = __webpack_require__(/*! ./adapters/http */ \"./node_modules/axios/lib/adapters/xhr.js\");\n }\n\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {\n return data;\n }\n\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n\n return data;\n }],\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) {\n /* Ignore */\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n maxContentLength: -1,\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\nmodule.exports = defaults;\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/defaults.js?");
|
|
184
|
+
|
|
185
|
+
/***/ }),
|
|
186
|
+
|
|
187
|
+
/***/ "./node_modules/axios/lib/helpers/bind.js":
|
|
188
|
+
/*!************************************************!*\
|
|
189
|
+
!*** ./node_modules/axios/lib/helpers/bind.js ***!
|
|
190
|
+
\************************************************/
|
|
191
|
+
/***/ ((module) => {
|
|
192
|
+
|
|
193
|
+
"use strict";
|
|
194
|
+
eval("\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n return fn.apply(thisArg, args);\n };\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/helpers/bind.js?");
|
|
195
|
+
|
|
196
|
+
/***/ }),
|
|
197
|
+
|
|
198
|
+
/***/ "./node_modules/axios/lib/helpers/buildURL.js":
|
|
199
|
+
/*!****************************************************!*\
|
|
200
|
+
!*** ./node_modules/axios/lib/helpers/buildURL.js ***!
|
|
201
|
+
\****************************************************/
|
|
202
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
203
|
+
|
|
204
|
+
"use strict";
|
|
205
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nfunction encode(val) {\n return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n}\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\n\n\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/helpers/buildURL.js?");
|
|
206
|
+
|
|
207
|
+
/***/ }),
|
|
208
|
+
|
|
209
|
+
/***/ "./node_modules/axios/lib/helpers/combineURLs.js":
|
|
210
|
+
/*!*******************************************************!*\
|
|
211
|
+
!*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
|
|
212
|
+
\*******************************************************/
|
|
213
|
+
/***/ ((module) => {
|
|
214
|
+
|
|
215
|
+
"use strict";
|
|
216
|
+
eval("\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\n\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '') : baseURL;\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/helpers/combineURLs.js?");
|
|
217
|
+
|
|
218
|
+
/***/ }),
|
|
219
|
+
|
|
220
|
+
/***/ "./node_modules/axios/lib/helpers/cookies.js":
|
|
221
|
+
/*!***************************************************!*\
|
|
222
|
+
!*** ./node_modules/axios/lib/helpers/cookies.js ***!
|
|
223
|
+
\***************************************************/
|
|
224
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
225
|
+
|
|
226
|
+
"use strict";
|
|
227
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nmodule.exports = utils.isStandardBrowserEnv() ? // Standard browser envs support document.cookie\nfunction standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return match ? decodeURIComponent(match[3]) : null;\n },\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n}() : // Non standard browser env (web workers, react-native) lack needed support.\nfunction nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() {\n return null;\n },\n remove: function remove() {}\n };\n}();\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/helpers/cookies.js?");
|
|
228
|
+
|
|
229
|
+
/***/ }),
|
|
230
|
+
|
|
231
|
+
/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
|
|
232
|
+
/*!*********************************************************!*\
|
|
233
|
+
!*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
|
|
234
|
+
\*********************************************************/
|
|
235
|
+
/***/ ((module) => {
|
|
236
|
+
|
|
237
|
+
"use strict";
|
|
238
|
+
eval("\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\n\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/helpers/isAbsoluteURL.js?");
|
|
239
|
+
|
|
240
|
+
/***/ }),
|
|
241
|
+
|
|
242
|
+
/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
|
|
243
|
+
/*!***********************************************************!*\
|
|
244
|
+
!*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
|
|
245
|
+
\***********************************************************/
|
|
246
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
247
|
+
|
|
248
|
+
"use strict";
|
|
249
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\");\n\nmodule.exports = utils.isStandardBrowserEnv() ? // Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\nfunction standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href); // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n\n return function isURLSameOrigin(requestURL) {\n var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;\n return parsed.protocol === originURL.protocol && parsed.host === originURL.host;\n };\n}() : // Non standard browser envs (web workers, react-native) lack needed support.\nfunction nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n}();\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/helpers/isURLSameOrigin.js?");
|
|
250
|
+
|
|
251
|
+
/***/ }),
|
|
252
|
+
|
|
253
|
+
/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
|
|
254
|
+
/*!***************************************************************!*\
|
|
255
|
+
!*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
|
|
256
|
+
\***************************************************************/
|
|
257
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
258
|
+
|
|
259
|
+
"use strict";
|
|
260
|
+
eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"./node_modules/axios/lib/utils.js\");\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/helpers/normalizeHeaderName.js?");
|
|
261
|
+
|
|
262
|
+
/***/ }),
|
|
263
|
+
|
|
264
|
+
/***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
|
|
265
|
+
/*!********************************************************!*\
|
|
266
|
+
!*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
|
|
267
|
+
\********************************************************/
|
|
268
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
269
|
+
|
|
270
|
+
"use strict";
|
|
271
|
+
eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"./node_modules/axios/lib/utils.js\"); // Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\n\n\nvar ignoreDuplicateOf = ['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'];\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\n\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) {\n return parsed;\n }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n return parsed;\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/helpers/parseHeaders.js?");
|
|
272
|
+
|
|
273
|
+
/***/ }),
|
|
274
|
+
|
|
275
|
+
/***/ "./node_modules/axios/lib/helpers/spread.js":
|
|
276
|
+
/*!**************************************************!*\
|
|
277
|
+
!*** ./node_modules/axios/lib/helpers/spread.js ***!
|
|
278
|
+
\**************************************************/
|
|
279
|
+
/***/ ((module) => {
|
|
280
|
+
|
|
281
|
+
"use strict";
|
|
282
|
+
eval("\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\n\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/helpers/spread.js?");
|
|
283
|
+
|
|
284
|
+
/***/ }),
|
|
285
|
+
|
|
286
|
+
/***/ "./node_modules/axios/lib/utils.js":
|
|
287
|
+
/*!*****************************************!*\
|
|
288
|
+
!*** ./node_modules/axios/lib/utils.js ***!
|
|
289
|
+
\*****************************************/
|
|
290
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
291
|
+
|
|
292
|
+
"use strict";
|
|
293
|
+
eval("\n\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"./node_modules/axios/lib/helpers/bind.js\");\n/*global toString:true*/\n// utils is a library of generic helper functions non-specific to axios\n\n\nvar toString = Object.prototype.toString;\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\n\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\n\n\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\n\n\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\n\n\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\n\n\nfunction isFormData(val) {\n return typeof FormData !== 'undefined' && val instanceof FormData;\n}\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\n\n\nfunction isArrayBufferView(val) {\n var result;\n\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n result = ArrayBuffer.isView(val);\n } else {\n result = val && val.buffer && val.buffer instanceof ArrayBuffer;\n }\n\n return result;\n}\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\n\n\nfunction isString(val) {\n return typeof val === 'string';\n}\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\n\n\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\n\n\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\n\n\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\n\n\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\n\n\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\n\n\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\n\n\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\n\n\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\n\n\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\n\n\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\n\n\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n } // Force an array if not already something iterable\n\n\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\n\n\nfunction\n /* obj1, obj2, obj3, ... */\nmerge() {\n var result = {};\n\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n\n return result;\n}\n/**\n * Function equal to merge with the difference being that no reference\n * to original objects is kept.\n *\n * @see merge\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\n\n\nfunction\n /* obj1, obj2, obj3, ... */\ndeepMerge() {\n var result = {};\n\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = deepMerge(result[key], val);\n } else if (typeof val === 'object') {\n result[key] = deepMerge({}, val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n\n return result;\n}\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\n\n\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n deepMerge: deepMerge,\n extend: extend,\n trim: trim\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/axios/lib/utils.js?");
|
|
294
|
+
|
|
295
|
+
/***/ }),
|
|
296
|
+
|
|
297
|
+
/***/ "./node_modules/ev-emitter/ev-emitter.js":
|
|
298
|
+
/*!***********************************************!*\
|
|
299
|
+
!*** ./node_modules/ev-emitter/ev-emitter.js ***!
|
|
300
|
+
\***********************************************/
|
|
301
|
+
/***/ (function(module) {
|
|
302
|
+
|
|
303
|
+
eval("/**\n * EvEmitter v2.0.0\n * Lil' event emitter\n * MIT License\n */\n(function (global, factory) {\n // universal module definition\n if ( true && module.exports) {\n // CommonJS - Browserify, Webpack\n module.exports = factory();\n } else {\n // Browser globals\n global.EvEmitter = factory();\n }\n})(typeof window != 'undefined' ? window : this, function () {\n function EvEmitter() {}\n\n let proto = EvEmitter.prototype;\n\n proto.on = function (eventName, listener) {\n if (!eventName || !listener) return this; // set events hash\n\n let events = this._events = this._events || {}; // set listeners array\n\n let listeners = events[eventName] = events[eventName] || []; // only add once\n\n if (!listeners.includes(listener)) {\n listeners.push(listener);\n }\n\n return this;\n };\n\n proto.once = function (eventName, listener) {\n if (!eventName || !listener) return this; // add event\n\n this.on(eventName, listener); // set once flag\n // set onceEvents hash\n\n let onceEvents = this._onceEvents = this._onceEvents || {}; // set onceListeners object\n\n let onceListeners = onceEvents[eventName] = onceEvents[eventName] || {}; // set flag\n\n onceListeners[listener] = true;\n return this;\n };\n\n proto.off = function (eventName, listener) {\n let listeners = this._events && this._events[eventName];\n if (!listeners || !listeners.length) return this;\n let index = listeners.indexOf(listener);\n\n if (index != -1) {\n listeners.splice(index, 1);\n }\n\n return this;\n };\n\n proto.emitEvent = function (eventName, args) {\n let listeners = this._events && this._events[eventName];\n if (!listeners || !listeners.length) return this; // copy over to avoid interference if .off() in listener\n\n listeners = listeners.slice(0);\n args = args || []; // once stuff\n\n let onceListeners = this._onceEvents && this._onceEvents[eventName];\n\n for (let listener of listeners) {\n let isOnce = onceListeners && onceListeners[listener];\n\n if (isOnce) {\n // remove listener\n // remove before trigger to prevent recursion\n this.off(eventName, listener); // unset once flag\n\n delete onceListeners[listener];\n } // trigger listener\n\n\n listener.apply(this, args);\n }\n\n return this;\n };\n\n proto.allOff = function () {\n delete this._events;\n delete this._onceEvents;\n return this;\n };\n\n return EvEmitter;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/ev-emitter/ev-emitter.js?");
|
|
304
|
+
|
|
305
|
+
/***/ }),
|
|
306
|
+
|
|
307
|
+
/***/ "./node_modules/eventemitter2/lib/eventemitter2.js":
|
|
308
|
+
/*!*********************************************************!*\
|
|
309
|
+
!*** ./node_modules/eventemitter2/lib/eventemitter2.js ***!
|
|
310
|
+
\*********************************************************/
|
|
311
|
+
/***/ ((module, exports, __webpack_require__) => {
|
|
312
|
+
|
|
313
|
+
eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * EventEmitter2\n * https://github.com/hij1nx/EventEmitter2\n *\n * Copyright (c) 2013 hij1nx\n * Licensed under the MIT license.\n */\n;\n!function (undefined) {\n var hasOwnProperty = Object.hasOwnProperty;\n var isArray = Array.isArray ? Array.isArray : function _isArray(obj) {\n return Object.prototype.toString.call(obj) === \"[object Array]\";\n };\n var defaultMaxListeners = 10;\n var nextTickSupported = typeof process == 'object' && typeof process.nextTick == 'function';\n var symbolsSupported = typeof Symbol === 'function';\n var reflectSupported = typeof Reflect === 'object';\n var setImmediateSupported = typeof setImmediate === 'function';\n\n var _setImmediate = setImmediateSupported ? setImmediate : setTimeout;\n\n var ownKeys = symbolsSupported ? reflectSupported && typeof Reflect.ownKeys === 'function' ? Reflect.ownKeys : function (obj) {\n var arr = Object.getOwnPropertyNames(obj);\n arr.push.apply(arr, Object.getOwnPropertySymbols(obj));\n return arr;\n } : Object.keys;\n\n function init() {\n this._events = {};\n\n if (this._conf) {\n configure.call(this, this._conf);\n }\n }\n\n function configure(conf) {\n if (conf) {\n this._conf = conf;\n conf.delimiter && (this.delimiter = conf.delimiter);\n\n if (conf.maxListeners !== undefined) {\n this._maxListeners = conf.maxListeners;\n }\n\n conf.wildcard && (this.wildcard = conf.wildcard);\n conf.newListener && (this._newListener = conf.newListener);\n conf.removeListener && (this._removeListener = conf.removeListener);\n conf.verboseMemoryLeak && (this.verboseMemoryLeak = conf.verboseMemoryLeak);\n conf.ignoreErrors && (this.ignoreErrors = conf.ignoreErrors);\n\n if (this.wildcard) {\n this.listenerTree = {};\n }\n }\n }\n\n function logPossibleMemoryLeak(count, eventName) {\n var errorMsg = '(node) warning: possible EventEmitter memory ' + 'leak detected. ' + count + ' listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.';\n\n if (this.verboseMemoryLeak) {\n errorMsg += ' Event name: ' + eventName + '.';\n }\n\n if (typeof process !== 'undefined' && process.emitWarning) {\n var e = new Error(errorMsg);\n e.name = 'MaxListenersExceededWarning';\n e.emitter = this;\n e.count = count;\n process.emitWarning(e);\n } else {\n console.error(errorMsg);\n\n if (console.trace) {\n console.trace();\n }\n }\n }\n\n var toArray = function (a, b, c) {\n var n = arguments.length;\n\n switch (n) {\n case 0:\n return [];\n\n case 1:\n return [a];\n\n case 2:\n return [a, b];\n\n case 3:\n return [a, b, c];\n\n default:\n var arr = new Array(n);\n\n while (n--) {\n arr[n] = arguments[n];\n }\n\n return arr;\n }\n };\n\n function toObject(keys, values) {\n var obj = {};\n var key;\n var len = keys.length;\n var valuesCount = values ? value.length : 0;\n\n for (var i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = i < valuesCount ? values[i] : undefined;\n }\n\n return obj;\n }\n\n function TargetObserver(emitter, target, options) {\n this._emitter = emitter;\n this._target = target;\n this._listeners = {};\n this._listenersCount = 0;\n var on, off;\n\n if (options.on || options.off) {\n on = options.on;\n off = options.off;\n }\n\n if (target.addEventListener) {\n on = target.addEventListener;\n off = target.removeEventListener;\n } else if (target.addListener) {\n on = target.addListener;\n off = target.removeListener;\n } else if (target.on) {\n on = target.on;\n off = target.off;\n }\n\n if (!on && !off) {\n throw Error('target does not implement any known event API');\n }\n\n if (typeof on !== 'function') {\n throw TypeError('on method must be a function');\n }\n\n if (typeof off !== 'function') {\n throw TypeError('off method must be a function');\n }\n\n this._on = on;\n this._off = off;\n var _observers = emitter._observers;\n\n if (_observers) {\n _observers.push(this);\n } else {\n emitter._observers = [this];\n }\n }\n\n Object.assign(TargetObserver.prototype, {\n subscribe: function (event, localEvent, reducer) {\n var observer = this;\n var target = this._target;\n var emitter = this._emitter;\n var listeners = this._listeners;\n\n var handler = function () {\n var args = toArray.apply(null, arguments);\n var eventObj = {\n data: args,\n name: localEvent,\n original: event\n };\n\n if (reducer) {\n var result = reducer.call(target, eventObj);\n\n if (result !== false) {\n emitter.emit.apply(emitter, [eventObj.name].concat(args));\n }\n\n return;\n }\n\n emitter.emit.apply(emitter, [localEvent].concat(args));\n };\n\n if (listeners[event]) {\n throw Error('Event \\'' + event + '\\' is already listening');\n }\n\n this._listenersCount++;\n\n if (emitter._newListener && emitter._removeListener && !observer._onNewListener) {\n this._onNewListener = function (_event) {\n if (_event === localEvent && listeners[event] === null) {\n listeners[event] = handler;\n\n observer._on.call(target, event, handler);\n }\n };\n\n emitter.on('newListener', this._onNewListener);\n\n this._onRemoveListener = function (_event) {\n if (_event === localEvent && !emitter.hasListeners(_event) && listeners[event]) {\n listeners[event] = null;\n\n observer._off.call(target, event, handler);\n }\n };\n\n listeners[event] = null;\n emitter.on('removeListener', this._onRemoveListener);\n } else {\n listeners[event] = handler;\n\n observer._on.call(target, event, handler);\n }\n },\n unsubscribe: function (event) {\n var observer = this;\n var listeners = this._listeners;\n var emitter = this._emitter;\n var handler;\n var events;\n var off = this._off;\n var target = this._target;\n var i;\n\n if (event && typeof event !== 'string') {\n throw TypeError('event must be a string');\n }\n\n function clearRefs() {\n if (observer._onNewListener) {\n emitter.off('newListener', observer._onNewListener);\n emitter.off('removeListener', observer._onRemoveListener);\n observer._onNewListener = null;\n observer._onRemoveListener = null;\n }\n\n var index = findTargetIndex.call(emitter, observer);\n\n emitter._observers.splice(index, 1);\n }\n\n if (event) {\n handler = listeners[event];\n if (!handler) return;\n off.call(target, event, handler);\n delete listeners[event];\n\n if (! --this._listenersCount) {\n clearRefs();\n }\n } else {\n events = ownKeys(listeners);\n i = events.length;\n\n while (i-- > 0) {\n event = events[i];\n off.call(target, event, listeners[event]);\n }\n\n this._listeners = {};\n this._listenersCount = 0;\n clearRefs();\n }\n }\n });\n\n function resolveOptions(options, schema, reducers, allowUnknown) {\n var computedOptions = Object.assign({}, schema);\n if (!options) return computedOptions;\n\n if (typeof options !== 'object') {\n throw TypeError('options must be an object');\n }\n\n var keys = Object.keys(options);\n var length = keys.length;\n var option, value;\n var reducer;\n\n function reject(reason) {\n throw Error('Invalid \"' + option + '\" option value' + (reason ? '. Reason: ' + reason : ''));\n }\n\n for (var i = 0; i < length; i++) {\n option = keys[i];\n\n if (!allowUnknown && !hasOwnProperty.call(schema, option)) {\n throw Error('Unknown \"' + option + '\" option');\n }\n\n value = options[option];\n\n if (value !== undefined) {\n reducer = reducers[option];\n computedOptions[option] = reducer ? reducer(value, reject) : value;\n }\n }\n\n return computedOptions;\n }\n\n function constructorReducer(value, reject) {\n if (typeof value !== 'function' || !value.hasOwnProperty('prototype')) {\n reject('value must be a constructor');\n }\n\n return value;\n }\n\n function makeTypeReducer(types) {\n var message = 'value must be type of ' + types.join('|');\n var len = types.length;\n var firstType = types[0];\n var secondType = types[1];\n\n if (len === 1) {\n return function (v, reject) {\n if (typeof v === firstType) {\n return v;\n }\n\n reject(message);\n };\n }\n\n if (len === 2) {\n return function (v, reject) {\n var kind = typeof v;\n if (kind === firstType || kind === secondType) return v;\n reject(message);\n };\n }\n\n return function (v, reject) {\n var kind = typeof v;\n var i = len;\n\n while (i-- > 0) {\n if (kind === types[i]) return v;\n }\n\n reject(message);\n };\n }\n\n var functionReducer = makeTypeReducer(['function']);\n var objectFunctionReducer = makeTypeReducer(['object', 'function']);\n\n function makeCancelablePromise(Promise, executor, options) {\n var isCancelable;\n var callbacks;\n var timer = 0;\n var subscriptionClosed;\n var promise = new Promise(function (resolve, reject, onCancel) {\n options = resolveOptions(options, {\n timeout: 0,\n overload: false\n }, {\n timeout: function (value, reject) {\n value *= 1;\n\n if (typeof value !== 'number' || value < 0 || !Number.isFinite(value)) {\n reject('timeout must be a positive number');\n }\n\n return value;\n }\n });\n isCancelable = !options.overload && typeof Promise.prototype.cancel === 'function' && typeof onCancel === 'function';\n\n function cleanup() {\n if (callbacks) {\n callbacks = null;\n }\n\n if (timer) {\n clearTimeout(timer);\n timer = 0;\n }\n }\n\n var _resolve = function (value) {\n cleanup();\n resolve(value);\n };\n\n var _reject = function (err) {\n cleanup();\n reject(err);\n };\n\n if (isCancelable) {\n executor(_resolve, _reject, onCancel);\n } else {\n callbacks = [function (reason) {\n _reject(reason || Error('canceled'));\n }];\n executor(_resolve, _reject, function (cb) {\n if (subscriptionClosed) {\n throw Error('Unable to subscribe on cancel event asynchronously');\n }\n\n if (typeof cb !== 'function') {\n throw TypeError('onCancel callback must be a function');\n }\n\n callbacks.push(cb);\n });\n subscriptionClosed = true;\n }\n\n if (options.timeout > 0) {\n timer = setTimeout(function () {\n var reason = Error('timeout');\n reason.code = 'ETIMEDOUT';\n timer = 0;\n promise.cancel(reason);\n reject(reason);\n }, options.timeout);\n }\n });\n\n if (!isCancelable) {\n promise.cancel = function (reason) {\n if (!callbacks) {\n return;\n }\n\n var length = callbacks.length;\n\n for (var i = 1; i < length; i++) {\n callbacks[i](reason);\n } // internal callback to reject the promise\n\n\n callbacks[0](reason);\n callbacks = null;\n };\n }\n\n return promise;\n }\n\n function findTargetIndex(observer) {\n var observers = this._observers;\n\n if (!observers) {\n return -1;\n }\n\n var len = observers.length;\n\n for (var i = 0; i < len; i++) {\n if (observers[i]._target === observer) return i;\n }\n\n return -1;\n } // Attention, function return type now is array, always !\n // It has zero elements if no any matches found and one or more\n // elements (leafs) if there are matches\n //\n\n\n function searchListenerTree(handlers, type, tree, i, typeLength) {\n if (!tree) {\n return null;\n }\n\n if (i === 0) {\n var kind = typeof type;\n\n if (kind === 'string') {\n var ns,\n n,\n l = 0,\n j = 0,\n delimiter = this.delimiter,\n dl = delimiter.length;\n\n if ((n = type.indexOf(delimiter)) !== -1) {\n ns = new Array(5);\n\n do {\n ns[l++] = type.slice(j, n);\n j = n + dl;\n } while ((n = type.indexOf(delimiter, j)) !== -1);\n\n ns[l++] = type.slice(j);\n type = ns;\n typeLength = l;\n } else {\n type = [type];\n typeLength = 1;\n }\n } else if (kind === 'object') {\n typeLength = type.length;\n } else {\n type = [type];\n typeLength = 1;\n }\n }\n\n var listeners = null,\n branch,\n xTree,\n xxTree,\n isolatedBranch,\n endReached,\n currentType = type[i],\n nextType = type[i + 1],\n branches,\n _listeners;\n\n if (i === typeLength) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (tree._listeners) {\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n listeners = [tree];\n } else {\n handlers && handlers.push.apply(handlers, tree._listeners);\n listeners = [tree];\n }\n }\n } else {\n if (currentType === '*') {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n branches = ownKeys(tree);\n n = branches.length;\n\n while (n-- > 0) {\n branch = branches[n];\n\n if (branch !== '_listeners') {\n _listeners = searchListenerTree(handlers, type, tree[branch], i + 1, typeLength);\n\n if (_listeners) {\n if (listeners) {\n listeners.push.apply(listeners, _listeners);\n } else {\n listeners = _listeners;\n }\n }\n }\n }\n\n return listeners;\n } else if (currentType === '**') {\n endReached = i + 1 === typeLength || i + 2 === typeLength && nextType === '*';\n\n if (endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = searchListenerTree(handlers, type, tree, typeLength, typeLength);\n }\n\n branches = ownKeys(tree);\n n = branches.length;\n\n while (n-- > 0) {\n branch = branches[n];\n\n if (branch !== '_listeners') {\n if (branch === '*' || branch === '**') {\n if (tree[branch]._listeners && !endReached) {\n _listeners = searchListenerTree(handlers, type, tree[branch], typeLength, typeLength);\n\n if (_listeners) {\n if (listeners) {\n listeners.push.apply(listeners, _listeners);\n } else {\n listeners = _listeners;\n }\n }\n }\n\n _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);\n } else if (branch === nextType) {\n _listeners = searchListenerTree(handlers, type, tree[branch], i + 2, typeLength);\n } else {\n // No match on this one, shift into the tree but not in the type array.\n _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);\n }\n\n if (_listeners) {\n if (listeners) {\n listeners.push.apply(listeners, _listeners);\n } else {\n listeners = _listeners;\n }\n }\n }\n }\n\n return listeners;\n } else if (tree[currentType]) {\n listeners = searchListenerTree(handlers, type, tree[currentType], i + 1, typeLength);\n }\n }\n\n xTree = tree['*'];\n\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i + 1, typeLength);\n }\n\n xxTree = tree['**'];\n\n if (xxTree) {\n if (i < typeLength) {\n if (xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength, typeLength);\n } // Build arrays of matching next branches and others.\n\n\n branches = ownKeys(xxTree);\n n = branches.length;\n\n while (n-- > 0) {\n branch = branches[n];\n\n if (branch !== '_listeners') {\n if (branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i + 2, typeLength);\n } else if (branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i + 1, typeLength);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, {\n '**': isolatedBranch\n }, i + 1, typeLength);\n }\n }\n }\n } else if (xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength, typeLength);\n } else if (xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength, typeLength);\n }\n }\n\n return listeners;\n }\n\n function growListenerTree(type, listener, prepend) {\n var len = 0,\n j = 0,\n i,\n delimiter = this.delimiter,\n dl = delimiter.length,\n ns;\n\n if (typeof type === 'string') {\n if ((i = type.indexOf(delimiter)) !== -1) {\n ns = new Array(5);\n\n do {\n ns[len++] = type.slice(j, i);\n j = i + dl;\n } while ((i = type.indexOf(delimiter, j)) !== -1);\n\n ns[len++] = type.slice(j);\n } else {\n ns = [type];\n len = 1;\n }\n } else {\n ns = type;\n len = type.length;\n } //\n // Looks for two consecutive '**', if so, don't add the event at all.\n //\n\n\n if (len > 1) {\n for (i = 0; i + 1 < len; i++) {\n if (ns[i] === '**' && ns[i + 1] === '**') {\n return;\n }\n }\n }\n\n var tree = this.listenerTree,\n name;\n\n for (i = 0; i < len; i++) {\n name = ns[i];\n tree = tree[name] || (tree[name] = {});\n\n if (i === len - 1) {\n if (!tree._listeners) {\n tree._listeners = listener;\n } else {\n if (typeof tree._listeners === 'function') {\n tree._listeners = [tree._listeners];\n }\n\n if (prepend) {\n tree._listeners.unshift(listener);\n } else {\n tree._listeners.push(listener);\n }\n\n if (!tree._listeners.warned && this._maxListeners > 0 && tree._listeners.length > this._maxListeners) {\n tree._listeners.warned = true;\n logPossibleMemoryLeak.call(this, tree._listeners.length, name);\n }\n }\n\n return true;\n }\n }\n\n return true;\n }\n\n function collectTreeEvents(tree, events, root, asArray) {\n var branches = ownKeys(tree);\n var i = branches.length;\n var branch, branchName, path;\n var hasListeners = tree['_listeners'];\n var isArrayPath;\n\n while (i-- > 0) {\n branchName = branches[i];\n branch = tree[branchName];\n\n if (branchName === '_listeners') {\n path = root;\n } else {\n path = root ? root.concat(branchName) : [branchName];\n }\n\n isArrayPath = asArray || typeof branchName === 'symbol';\n hasListeners && events.push(isArrayPath ? path : path.join(this.delimiter));\n\n if (typeof branch === 'object') {\n collectTreeEvents.call(this, branch, events, path, isArrayPath);\n }\n }\n\n return events;\n }\n\n function recursivelyGarbageCollect(root) {\n var keys = ownKeys(root);\n var i = keys.length;\n var obj, key, flag;\n\n while (i-- > 0) {\n key = keys[i];\n obj = root[key];\n\n if (obj) {\n flag = true;\n\n if (key !== '_listeners' && !recursivelyGarbageCollect(obj)) {\n delete root[key];\n }\n }\n }\n\n return flag;\n }\n\n function Listener(emitter, event, listener) {\n this.emitter = emitter;\n this.event = event;\n this.listener = listener;\n }\n\n Listener.prototype.off = function () {\n this.emitter.off(this.event, this.listener);\n return this;\n };\n\n function setupListener(event, listener, options) {\n if (options === true) {\n promisify = true;\n } else if (options === false) {\n async = true;\n } else {\n if (!options || typeof options !== 'object') {\n throw TypeError('options should be an object or true');\n }\n\n var async = options.async;\n var promisify = options.promisify;\n var nextTick = options.nextTick;\n var objectify = options.objectify;\n }\n\n if (async || nextTick || promisify) {\n var _listener = listener;\n\n var _origin = listener._origin || listener;\n\n if (nextTick && !nextTickSupported) {\n throw Error('process.nextTick is not supported');\n }\n\n if (promisify === undefined) {\n promisify = listener.constructor.name === 'AsyncFunction';\n }\n\n listener = function () {\n var args = arguments;\n var context = this;\n var event = this.event;\n return promisify ? nextTick ? Promise.resolve() : new Promise(function (resolve) {\n _setImmediate(resolve);\n }).then(function () {\n context.event = event;\n return _listener.apply(context, args);\n }) : (nextTick ? process.nextTick : _setImmediate)(function () {\n context.event = event;\n\n _listener.apply(context, args);\n });\n };\n\n listener._async = true;\n listener._origin = _origin;\n }\n\n return [listener, objectify ? new Listener(this, event, listener) : this];\n }\n\n function EventEmitter(conf) {\n this._events = {};\n this._newListener = false;\n this._removeListener = false;\n this.verboseMemoryLeak = false;\n configure.call(this, conf);\n }\n\n EventEmitter.EventEmitter2 = EventEmitter; // backwards compatibility for exporting EventEmitter property\n\n EventEmitter.prototype.listenTo = function (target, events, options) {\n if (typeof target !== 'object') {\n throw TypeError('target musts be an object');\n }\n\n var emitter = this;\n options = resolveOptions(options, {\n on: undefined,\n off: undefined,\n reducers: undefined\n }, {\n on: functionReducer,\n off: functionReducer,\n reducers: objectFunctionReducer\n });\n\n function listen(events) {\n if (typeof events !== 'object') {\n throw TypeError('events must be an object');\n }\n\n var reducers = options.reducers;\n var index = findTargetIndex.call(emitter, target);\n var observer;\n\n if (index === -1) {\n observer = new TargetObserver(emitter, target, options);\n } else {\n observer = emitter._observers[index];\n }\n\n var keys = ownKeys(events);\n var len = keys.length;\n var event;\n var isSingleReducer = typeof reducers === 'function';\n\n for (var i = 0; i < len; i++) {\n event = keys[i];\n observer.subscribe(event, events[event] || event, isSingleReducer ? reducers : reducers && reducers[event]);\n }\n }\n\n isArray(events) ? listen(toObject(events)) : typeof events === 'string' ? listen(toObject(events.split(/\\s+/))) : listen(events);\n return this;\n };\n\n EventEmitter.prototype.stopListeningTo = function (target, event) {\n var observers = this._observers;\n\n if (!observers) {\n return false;\n }\n\n var i = observers.length;\n var observer;\n var matched = false;\n\n if (target && typeof target !== 'object') {\n throw TypeError('target should be an object');\n }\n\n while (i-- > 0) {\n observer = observers[i];\n\n if (!target || observer._target === target) {\n observer.unsubscribe(event);\n matched = true;\n }\n }\n\n return matched;\n }; // By default EventEmitters will print a warning if more than\n // 10 listeners are added to it. This is a useful default which\n // helps finding memory leaks.\n //\n // Obviously not all Emitters should be limited to 10. This function allows\n // that to be increased. Set to zero for unlimited.\n\n\n EventEmitter.prototype.delimiter = '.';\n\n EventEmitter.prototype.setMaxListeners = function (n) {\n if (n !== undefined) {\n this._maxListeners = n;\n if (!this._conf) this._conf = {};\n this._conf.maxListeners = n;\n }\n };\n\n EventEmitter.prototype.getMaxListeners = function () {\n return this._maxListeners;\n };\n\n EventEmitter.prototype.event = '';\n\n EventEmitter.prototype.once = function (event, fn, options) {\n return this._once(event, fn, false, options);\n };\n\n EventEmitter.prototype.prependOnceListener = function (event, fn, options) {\n return this._once(event, fn, true, options);\n };\n\n EventEmitter.prototype._once = function (event, fn, prepend, options) {\n return this._many(event, 1, fn, prepend, options);\n };\n\n EventEmitter.prototype.many = function (event, ttl, fn, options) {\n return this._many(event, ttl, fn, false, options);\n };\n\n EventEmitter.prototype.prependMany = function (event, ttl, fn, options) {\n return this._many(event, ttl, fn, true, options);\n };\n\n EventEmitter.prototype._many = function (event, ttl, fn, prepend, options) {\n var self = this;\n\n if (typeof fn !== 'function') {\n throw new Error('many only accepts instances of Function');\n }\n\n function listener() {\n if (--ttl === 0) {\n self.off(event, listener);\n }\n\n return fn.apply(this, arguments);\n }\n\n listener._origin = fn;\n return this._on(event, listener, prepend, options);\n };\n\n EventEmitter.prototype.emit = function () {\n if (!this._events && !this._all) {\n return false;\n }\n\n this._events || init.call(this);\n var type = arguments[0],\n ns,\n wildcard = this.wildcard;\n var args, l, i, j, containsSymbol;\n\n if (type === 'newListener' && !this._newListener) {\n if (!this._events.newListener) {\n return false;\n }\n }\n\n if (wildcard) {\n ns = type;\n\n if (type !== 'newListener' && type !== 'removeListener') {\n if (typeof type === 'object') {\n l = type.length;\n\n if (symbolsSupported) {\n for (i = 0; i < l; i++) {\n if (typeof type[i] === 'symbol') {\n containsSymbol = true;\n break;\n }\n }\n }\n\n if (!containsSymbol) {\n type = type.join(this.delimiter);\n }\n }\n }\n }\n\n var al = arguments.length;\n var handler;\n\n if (this._all && this._all.length) {\n handler = this._all.slice();\n\n for (i = 0, l = handler.length; i < l; i++) {\n this.event = type;\n\n switch (al) {\n case 1:\n handler[i].call(this, type);\n break;\n\n case 2:\n handler[i].call(this, type, arguments[1]);\n break;\n\n case 3:\n handler[i].call(this, type, arguments[1], arguments[2]);\n break;\n\n default:\n handler[i].apply(this, arguments);\n }\n }\n }\n\n if (wildcard) {\n handler = [];\n searchListenerTree.call(this, handler, ns, this.listenerTree, 0, l);\n } else {\n handler = this._events[type];\n\n if (typeof handler === 'function') {\n this.event = type;\n\n switch (al) {\n case 1:\n handler.call(this);\n break;\n\n case 2:\n handler.call(this, arguments[1]);\n break;\n\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n\n default:\n args = new Array(al - 1);\n\n for (j = 1; j < al; j++) args[j - 1] = arguments[j];\n\n handler.apply(this, args);\n }\n\n return true;\n } else if (handler) {\n // need to make copy of handlers because list can change in the middle\n // of emit call\n handler = handler.slice();\n }\n }\n\n if (handler && handler.length) {\n if (al > 3) {\n args = new Array(al - 1);\n\n for (j = 1; j < al; j++) args[j - 1] = arguments[j];\n }\n\n for (i = 0, l = handler.length; i < l; i++) {\n this.event = type;\n\n switch (al) {\n case 1:\n handler[i].call(this);\n break;\n\n case 2:\n handler[i].call(this, arguments[1]);\n break;\n\n case 3:\n handler[i].call(this, arguments[1], arguments[2]);\n break;\n\n default:\n handler[i].apply(this, args);\n }\n }\n\n return true;\n } else if (!this.ignoreErrors && !this._all && type === 'error') {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n }\n\n return !!this._all;\n };\n\n EventEmitter.prototype.emitAsync = function () {\n if (!this._events && !this._all) {\n return false;\n }\n\n this._events || init.call(this);\n var type = arguments[0],\n wildcard = this.wildcard,\n ns,\n containsSymbol;\n var args, l, i, j;\n\n if (type === 'newListener' && !this._newListener) {\n if (!this._events.newListener) {\n return Promise.resolve([false]);\n }\n }\n\n if (wildcard) {\n ns = type;\n\n if (type !== 'newListener' && type !== 'removeListener') {\n if (typeof type === 'object') {\n l = type.length;\n\n if (symbolsSupported) {\n for (i = 0; i < l; i++) {\n if (typeof type[i] === 'symbol') {\n containsSymbol = true;\n break;\n }\n }\n }\n\n if (!containsSymbol) {\n type = type.join(this.delimiter);\n }\n }\n }\n }\n\n var promises = [];\n var al = arguments.length;\n var handler;\n\n if (this._all) {\n for (i = 0, l = this._all.length; i < l; i++) {\n this.event = type;\n\n switch (al) {\n case 1:\n promises.push(this._all[i].call(this, type));\n break;\n\n case 2:\n promises.push(this._all[i].call(this, type, arguments[1]));\n break;\n\n case 3:\n promises.push(this._all[i].call(this, type, arguments[1], arguments[2]));\n break;\n\n default:\n promises.push(this._all[i].apply(this, arguments));\n }\n }\n }\n\n if (wildcard) {\n handler = [];\n searchListenerTree.call(this, handler, ns, this.listenerTree, 0);\n } else {\n handler = this._events[type];\n }\n\n if (typeof handler === 'function') {\n this.event = type;\n\n switch (al) {\n case 1:\n promises.push(handler.call(this));\n break;\n\n case 2:\n promises.push(handler.call(this, arguments[1]));\n break;\n\n case 3:\n promises.push(handler.call(this, arguments[1], arguments[2]));\n break;\n\n default:\n args = new Array(al - 1);\n\n for (j = 1; j < al; j++) args[j - 1] = arguments[j];\n\n promises.push(handler.apply(this, args));\n }\n } else if (handler && handler.length) {\n handler = handler.slice();\n\n if (al > 3) {\n args = new Array(al - 1);\n\n for (j = 1; j < al; j++) args[j - 1] = arguments[j];\n }\n\n for (i = 0, l = handler.length; i < l; i++) {\n this.event = type;\n\n switch (al) {\n case 1:\n promises.push(handler[i].call(this));\n break;\n\n case 2:\n promises.push(handler[i].call(this, arguments[1]));\n break;\n\n case 3:\n promises.push(handler[i].call(this, arguments[1], arguments[2]));\n break;\n\n default:\n promises.push(handler[i].apply(this, args));\n }\n }\n } else if (!this.ignoreErrors && !this._all && type === 'error') {\n if (arguments[1] instanceof Error) {\n return Promise.reject(arguments[1]); // Unhandled 'error' event\n } else {\n return Promise.reject(\"Uncaught, unspecified 'error' event.\");\n }\n }\n\n return Promise.all(promises);\n };\n\n EventEmitter.prototype.on = function (type, listener, options) {\n return this._on(type, listener, false, options);\n };\n\n EventEmitter.prototype.prependListener = function (type, listener, options) {\n return this._on(type, listener, true, options);\n };\n\n EventEmitter.prototype.onAny = function (fn) {\n return this._onAny(fn, false);\n };\n\n EventEmitter.prototype.prependAny = function (fn) {\n return this._onAny(fn, true);\n };\n\n EventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n EventEmitter.prototype._onAny = function (fn, prepend) {\n if (typeof fn !== 'function') {\n throw new Error('onAny only accepts instances of Function');\n }\n\n if (!this._all) {\n this._all = [];\n } // Add the function to the event listener collection.\n\n\n if (prepend) {\n this._all.unshift(fn);\n } else {\n this._all.push(fn);\n }\n\n return this;\n };\n\n EventEmitter.prototype._on = function (type, listener, prepend, options) {\n if (typeof type === 'function') {\n this._onAny(type, listener);\n\n return this;\n }\n\n if (typeof listener !== 'function') {\n throw new Error('on only accepts instances of Function');\n }\n\n this._events || init.call(this);\n var returnValue = this,\n temp;\n\n if (options !== undefined) {\n temp = setupListener.call(this, type, listener, options);\n listener = temp[0];\n returnValue = temp[1];\n } // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n\n\n if (this._newListener) {\n this.emit('newListener', type, listener);\n }\n\n if (this.wildcard) {\n growListenerTree.call(this, type, listener, prepend);\n return returnValue;\n }\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else {\n if (typeof this._events[type] === 'function') {\n // Change to array.\n this._events[type] = [this._events[type]];\n } // If we've already got an array, just add\n\n\n if (prepend) {\n this._events[type].unshift(listener);\n } else {\n this._events[type].push(listener);\n } // Check for listener leak\n\n\n if (!this._events[type].warned && this._maxListeners > 0 && this._events[type].length > this._maxListeners) {\n this._events[type].warned = true;\n logPossibleMemoryLeak.call(this, this._events[type].length, type);\n }\n }\n\n return returnValue;\n };\n\n EventEmitter.prototype.off = function (type, listener) {\n if (typeof listener !== 'function') {\n throw new Error('removeListener only takes instances of Function');\n }\n\n var handlers,\n leafs = [];\n\n if (this.wildcard) {\n var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice();\n leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0);\n if (!leafs) return this;\n } else {\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events[type]) return this;\n handlers = this._events[type];\n leafs.push({\n _listeners: handlers\n });\n }\n\n for (var iLeaf = 0; iLeaf < leafs.length; iLeaf++) {\n var leaf = leafs[iLeaf];\n handlers = leaf._listeners;\n\n if (isArray(handlers)) {\n var position = -1;\n\n for (var i = 0, length = handlers.length; i < length; i++) {\n if (handlers[i] === listener || handlers[i].listener && handlers[i].listener === listener || handlers[i]._origin && handlers[i]._origin === listener) {\n position = i;\n break;\n }\n }\n\n if (position < 0) {\n continue;\n }\n\n if (this.wildcard) {\n leaf._listeners.splice(position, 1);\n } else {\n this._events[type].splice(position, 1);\n }\n\n if (handlers.length === 0) {\n if (this.wildcard) {\n delete leaf._listeners;\n } else {\n delete this._events[type];\n }\n }\n\n if (this._removeListener) this.emit(\"removeListener\", type, listener);\n return this;\n } else if (handlers === listener || handlers.listener && handlers.listener === listener || handlers._origin && handlers._origin === listener) {\n if (this.wildcard) {\n delete leaf._listeners;\n } else {\n delete this._events[type];\n }\n\n if (this._removeListener) this.emit(\"removeListener\", type, listener);\n }\n }\n\n this.listenerTree && recursivelyGarbageCollect(this.listenerTree);\n return this;\n };\n\n EventEmitter.prototype.offAny = function (fn) {\n var i = 0,\n l = 0,\n fns;\n\n if (fn && this._all && this._all.length > 0) {\n fns = this._all;\n\n for (i = 0, l = fns.length; i < l; i++) {\n if (fn === fns[i]) {\n fns.splice(i, 1);\n if (this._removeListener) this.emit(\"removeListenerAny\", fn);\n return this;\n }\n }\n } else {\n fns = this._all;\n\n if (this._removeListener) {\n for (i = 0, l = fns.length; i < l; i++) this.emit(\"removeListenerAny\", fns[i]);\n }\n\n this._all = [];\n }\n\n return this;\n };\n\n EventEmitter.prototype.removeListener = EventEmitter.prototype.off;\n\n EventEmitter.prototype.removeAllListeners = function (type) {\n if (type === undefined) {\n !this._events || init.call(this);\n return this;\n }\n\n if (this.wildcard) {\n var leafs = searchListenerTree.call(this, null, type, this.listenerTree, 0),\n leaf,\n i;\n if (!leafs) return this;\n\n for (i = 0; i < leafs.length; i++) {\n leaf = leafs[i];\n leaf._listeners = null;\n }\n\n this.listenerTree && recursivelyGarbageCollect(this.listenerTree);\n } else if (this._events) {\n this._events[type] = null;\n }\n\n return this;\n };\n\n EventEmitter.prototype.listeners = function (type) {\n var _events = this._events;\n var keys, listeners, allListeners;\n var i;\n var listenerTree;\n\n if (type === undefined) {\n if (this.wildcard) {\n throw Error('event name required for wildcard emitter');\n }\n\n if (!_events) {\n return [];\n }\n\n keys = ownKeys(_events);\n i = keys.length;\n allListeners = [];\n\n while (i-- > 0) {\n listeners = _events[keys[i]];\n\n if (typeof listeners === 'function') {\n allListeners.push(listeners);\n } else {\n allListeners.push.apply(allListeners, listeners);\n }\n }\n\n return allListeners;\n } else {\n if (this.wildcard) {\n listenerTree = this.listenerTree;\n if (!listenerTree) return [];\n var handlers = [];\n var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice();\n searchListenerTree.call(this, handlers, ns, listenerTree, 0);\n return handlers;\n }\n\n if (!_events) {\n return [];\n }\n\n listeners = _events[type];\n\n if (!listeners) {\n return [];\n }\n\n return typeof listeners === 'function' ? [listeners] : listeners;\n }\n };\n\n EventEmitter.prototype.eventNames = function (nsAsArray) {\n var _events = this._events;\n return this.wildcard ? collectTreeEvents.call(this, this.listenerTree, [], null, nsAsArray) : _events ? ownKeys(_events) : [];\n };\n\n EventEmitter.prototype.listenerCount = function (type) {\n return this.listeners(type).length;\n };\n\n EventEmitter.prototype.hasListeners = function (type) {\n if (this.wildcard) {\n var handlers = [];\n var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice();\n searchListenerTree.call(this, handlers, ns, this.listenerTree, 0);\n return handlers.length > 0;\n }\n\n var _events = this._events;\n var _all = this._all;\n return !!(_all && _all.length || _events && (type === undefined ? ownKeys(_events).length : _events[type]));\n };\n\n EventEmitter.prototype.listenersAny = function () {\n if (this._all) {\n return this._all;\n } else {\n return [];\n }\n };\n\n EventEmitter.prototype.waitFor = function (event, options) {\n var self = this;\n var type = typeof options;\n\n if (type === 'number') {\n options = {\n timeout: options\n };\n } else if (type === 'function') {\n options = {\n filter: options\n };\n }\n\n options = resolveOptions(options, {\n timeout: 0,\n filter: undefined,\n handleError: false,\n Promise: Promise,\n overload: false\n }, {\n filter: functionReducer,\n Promise: constructorReducer\n });\n return makeCancelablePromise(options.Promise, function (resolve, reject, onCancel) {\n function listener() {\n var filter = options.filter;\n\n if (filter && !filter.apply(self, arguments)) {\n return;\n }\n\n self.off(event, listener);\n\n if (options.handleError) {\n var err = arguments[0];\n err ? reject(err) : resolve(toArray.apply(null, arguments).slice(1));\n } else {\n resolve(toArray.apply(null, arguments));\n }\n }\n\n onCancel(function () {\n self.off(event, listener);\n });\n\n self._on(event, listener, false);\n }, {\n timeout: options.timeout,\n overload: options.overload\n });\n };\n\n function once(emitter, name, options) {\n options = resolveOptions(options, {\n Promise: Promise,\n timeout: 0,\n overload: false\n }, {\n Promise: constructorReducer\n });\n var _Promise = options.Promise;\n return makeCancelablePromise(_Promise, function (resolve, reject, onCancel) {\n var handler;\n\n if (typeof emitter.addEventListener === 'function') {\n handler = function () {\n resolve(toArray.apply(null, arguments));\n };\n\n onCancel(function () {\n emitter.removeEventListener(name, handler);\n });\n emitter.addEventListener(name, handler, {\n once: true\n });\n return;\n }\n\n var eventListener = function () {\n errorListener && emitter.removeListener('error', errorListener);\n resolve(toArray.apply(null, arguments));\n };\n\n var errorListener;\n\n if (name !== 'error') {\n errorListener = function (err) {\n emitter.removeListener(name, eventListener);\n reject(err);\n };\n\n emitter.once('error', errorListener);\n }\n\n onCancel(function () {\n errorListener && emitter.removeListener('error', errorListener);\n emitter.removeListener(name, eventListener);\n });\n emitter.once(name, eventListener);\n }, {\n timeout: options.timeout,\n overload: options.overload\n });\n }\n\n var prototype = EventEmitter.prototype;\n Object.defineProperties(EventEmitter, {\n defaultMaxListeners: {\n get: function () {\n return prototype._maxListeners;\n },\n set: function (n) {\n if (typeof n !== 'number' || n < 0 || Number.isNaN(n)) {\n throw TypeError('n must be a non-negative number');\n }\n\n prototype._maxListeners = n;\n },\n enumerable: true\n },\n once: {\n value: once,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperties(prototype, {\n _maxListeners: {\n value: defaultMaxListeners,\n writable: true,\n configurable: true\n },\n _observers: {\n value: null,\n writable: true,\n configurable: true\n }\n });\n\n if (true) {\n // AMD. Register as an anonymous module.\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return EventEmitter;\n }).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else { var _global; }\n}();\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/eventemitter2/lib/eventemitter2.js?");
|
|
314
|
+
|
|
315
|
+
/***/ }),
|
|
316
|
+
|
|
317
|
+
/***/ "./node_modules/fizzy-ui-utils/utils.js":
|
|
318
|
+
/*!**********************************************!*\
|
|
319
|
+
!*** ./node_modules/fizzy-ui-utils/utils.js ***!
|
|
320
|
+
\**********************************************/
|
|
321
|
+
/***/ (function(module) {
|
|
322
|
+
|
|
323
|
+
eval("/**\n * Fizzy UI utils v3.0.0\n * MIT license\n */\n(function (global, factory) {\n // universal module definition\n if ( true && module.exports) {\n // CommonJS\n module.exports = factory(global);\n } else {\n // browser global\n global.fizzyUIUtils = factory(global);\n }\n})(this, function factory(global) {\n let utils = {}; // ----- extend ----- //\n // extends objects\n\n utils.extend = function (a, b) {\n return Object.assign(a, b);\n }; // ----- modulo ----- //\n\n\n utils.modulo = function (num, div) {\n return (num % div + div) % div;\n }; // ----- makeArray ----- //\n // turn element or nodeList into an array\n\n\n utils.makeArray = function (obj) {\n // use object if already an array\n if (Array.isArray(obj)) return obj; // return empty array if undefined or null. #6\n\n if (obj === null || obj === undefined) return [];\n let isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; // convert nodeList to array\n\n if (isArrayLike) return [...obj]; // array of single index\n\n return [obj];\n }; // ----- removeFrom ----- //\n\n\n utils.removeFrom = function (ary, obj) {\n let index = ary.indexOf(obj);\n\n if (index != -1) {\n ary.splice(index, 1);\n }\n }; // ----- getParent ----- //\n\n\n utils.getParent = function (elem, selector) {\n while (elem.parentNode && elem != document.body) {\n elem = elem.parentNode;\n if (elem.matches(selector)) return elem;\n }\n }; // ----- getQueryElement ----- //\n // use element as selector string\n\n\n utils.getQueryElement = function (elem) {\n if (typeof elem == 'string') {\n return document.querySelector(elem);\n }\n\n return elem;\n }; // ----- handleEvent ----- //\n // enable .ontype to trigger from .addEventListener( elem, 'type' )\n\n\n utils.handleEvent = function (event) {\n let method = 'on' + event.type;\n\n if (this[method]) {\n this[method](event);\n }\n }; // ----- filterFindElements ----- //\n\n\n utils.filterFindElements = function (elems, selector) {\n // make array of elems\n elems = utils.makeArray(elems);\n return elems // check that elem is an actual element\n .filter(elem => elem instanceof HTMLElement).reduce((ffElems, elem) => {\n // add elem if no selector\n if (!selector) {\n ffElems.push(elem);\n return ffElems;\n } // filter & find items if we have a selector\n // filter\n\n\n if (elem.matches(selector)) {\n ffElems.push(elem);\n } // find children\n\n\n let childElems = elem.querySelectorAll(selector); // concat childElems to filterFound array\n\n ffElems = ffElems.concat(...childElems);\n return ffElems;\n }, []);\n }; // ----- debounceMethod ----- //\n\n\n utils.debounceMethod = function (_class, methodName, threshold) {\n threshold = threshold || 100; // original method\n\n let method = _class.prototype[methodName];\n let timeoutName = methodName + 'Timeout';\n\n _class.prototype[methodName] = function () {\n clearTimeout(this[timeoutName]);\n let args = arguments;\n this[timeoutName] = setTimeout(() => {\n method.apply(this, args);\n delete this[timeoutName];\n }, threshold);\n };\n }; // ----- docReady ----- //\n\n\n utils.docReady = function (onDocReady) {\n let readyState = document.readyState;\n\n if (readyState == 'complete' || readyState == 'interactive') {\n // do async to allow for other scripts to run. metafizzy/flickity#441\n setTimeout(onDocReady);\n } else {\n document.addEventListener('DOMContentLoaded', onDocReady);\n }\n }; // ----- htmlInit ----- //\n // http://bit.ly/3oYLusc\n\n\n utils.toDashed = function (str) {\n return str.replace(/(.)([A-Z])/g, function (match, $1, $2) {\n return $1 + '-' + $2;\n }).toLowerCase();\n };\n\n let console = global.console; // allow user to initialize classes via [data-namespace] or .js-namespace class\n // htmlInit( Widget, 'widgetName' )\n // options are parsed from data-namespace-options\n\n utils.htmlInit = function (WidgetClass, namespace) {\n utils.docReady(function () {\n let dashedNamespace = utils.toDashed(namespace);\n let dataAttr = 'data-' + dashedNamespace;\n let dataAttrElems = document.querySelectorAll(`[${dataAttr}]`);\n let jQuery = global.jQuery;\n [...dataAttrElems].forEach(elem => {\n let attr = elem.getAttribute(dataAttr);\n let options;\n\n try {\n options = attr && JSON.parse(attr);\n } catch (error) {\n // log error, do not initialize\n if (console) {\n console.error(`Error parsing ${dataAttr} on ${elem.className}: ${error}`);\n }\n\n return;\n } // initialize\n\n\n let instance = new WidgetClass(elem, options); // make available via $().data('namespace')\n\n if (jQuery) {\n jQuery.data(elem, namespace, instance);\n }\n });\n });\n }; // ----- ----- //\n\n\n return utils;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/fizzy-ui-utils/utils.js?");
|
|
324
|
+
|
|
325
|
+
/***/ }),
|
|
326
|
+
|
|
327
|
+
/***/ "./node_modules/infinite-scroll/js/button.js":
|
|
328
|
+
/*!***************************************************!*\
|
|
329
|
+
!*** ./node_modules/infinite-scroll/js/button.js ***!
|
|
330
|
+
\***************************************************/
|
|
331
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
332
|
+
|
|
333
|
+
eval("// button\n(function (window, factory) {\n // universal module definition\n if ( true && module.exports) {\n // CommonJS\n module.exports = factory(window, __webpack_require__(/*! ./core */ \"./node_modules/infinite-scroll/js/core.js\"), __webpack_require__(/*! fizzy-ui-utils */ \"./node_modules/fizzy-ui-utils/utils.js\"));\n } else {\n // browser global\n factory(window, window.InfiniteScroll, window.fizzyUIUtils);\n }\n})(window, function factory(window, InfiniteScroll, utils) {\n // -------------------------- InfiniteScrollButton -------------------------- //\n class InfiniteScrollButton {\n constructor(element, infScroll) {\n this.element = element;\n this.infScroll = infScroll; // events\n\n this.clickHandler = this.onClick.bind(this);\n this.element.addEventListener('click', this.clickHandler);\n infScroll.on('request', this.disable.bind(this));\n infScroll.on('load', this.enable.bind(this));\n infScroll.on('error', this.hide.bind(this));\n infScroll.on('last', this.hide.bind(this));\n }\n\n onClick(event) {\n event.preventDefault();\n this.infScroll.loadNextPage();\n }\n\n enable() {\n this.element.removeAttribute('disabled');\n }\n\n disable() {\n this.element.disabled = 'disabled';\n }\n\n hide() {\n this.element.style.display = 'none';\n }\n\n destroy() {\n this.element.removeEventListener('click', this.clickHandler);\n }\n\n } // -------------------------- InfiniteScroll methods -------------------------- //\n // InfiniteScroll.defaults.button = null;\n\n\n InfiniteScroll.create.button = function () {\n let buttonElem = utils.getQueryElement(this.options.button);\n\n if (buttonElem) {\n this.button = new InfiniteScrollButton(buttonElem, this);\n }\n };\n\n InfiniteScroll.destroy.button = function () {\n if (this.button) this.button.destroy();\n }; // -------------------------- -------------------------- //\n\n\n InfiniteScroll.Button = InfiniteScrollButton;\n return InfiniteScroll;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/infinite-scroll/js/button.js?");
|
|
334
|
+
|
|
335
|
+
/***/ }),
|
|
336
|
+
|
|
337
|
+
/***/ "./node_modules/infinite-scroll/js/core.js":
|
|
338
|
+
/*!*************************************************!*\
|
|
339
|
+
!*** ./node_modules/infinite-scroll/js/core.js ***!
|
|
340
|
+
\*************************************************/
|
|
341
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
342
|
+
|
|
343
|
+
eval("// core\n(function (window, factory) {\n // universal module definition\n if ( true && module.exports) {\n // CommonJS\n module.exports = factory(window, __webpack_require__(/*! ev-emitter */ \"./node_modules/ev-emitter/ev-emitter.js\"), __webpack_require__(/*! fizzy-ui-utils */ \"./node_modules/fizzy-ui-utils/utils.js\"));\n } else {\n // browser global\n window.InfiniteScroll = factory(window, window.EvEmitter, window.fizzyUIUtils);\n }\n})(window, function factory(window, EvEmitter, utils) {\n let jQuery = window.jQuery; // internal store of all InfiniteScroll intances\n\n let instances = {};\n\n function InfiniteScroll(element, options) {\n let queryElem = utils.getQueryElement(element);\n\n if (!queryElem) {\n console.error('Bad element for InfiniteScroll: ' + (queryElem || element));\n return;\n }\n\n element = queryElem; // do not initialize twice on same element\n\n if (element.infiniteScrollGUID) {\n let instance = instances[element.infiniteScrollGUID];\n instance.option(options);\n return instance;\n }\n\n this.element = element; // options\n\n this.options = { ...InfiniteScroll.defaults\n };\n this.option(options); // add jQuery\n\n if (jQuery) {\n this.$element = jQuery(this.element);\n }\n\n this.create();\n } // defaults\n\n\n InfiniteScroll.defaults = {// path: null,\n // hideNav: null,\n // debug: false,\n }; // create & destroy methods\n\n InfiniteScroll.create = {};\n InfiniteScroll.destroy = {};\n let proto = InfiniteScroll.prototype; // inherit EvEmitter\n\n Object.assign(proto, EvEmitter.prototype); // -------------------------- -------------------------- //\n // globally unique identifiers\n\n let GUID = 0;\n\n proto.create = function () {\n // create core\n // add id for InfiniteScroll.data\n let id = this.guid = ++GUID;\n this.element.infiniteScrollGUID = id; // expando\n\n instances[id] = this; // associate via id\n // properties\n\n this.pageIndex = 1; // default to first page\n\n this.loadCount = 0;\n this.updateGetPath(); // bail if getPath not set, or returns falsey #776\n\n let hasPath = this.getPath && this.getPath();\n\n if (!hasPath) {\n console.error('Disabling InfiniteScroll');\n return;\n }\n\n this.updateGetAbsolutePath();\n this.log('initialized', [this.element.className]);\n this.callOnInit(); // create features\n\n for (let method in InfiniteScroll.create) {\n InfiniteScroll.create[method].call(this);\n }\n };\n\n proto.option = function (opts) {\n Object.assign(this.options, opts);\n }; // call onInit option, used for binding events on init\n\n\n proto.callOnInit = function () {\n let onInit = this.options.onInit;\n\n if (onInit) {\n onInit.call(this, this);\n }\n }; // ----- events ----- //\n\n\n proto.dispatchEvent = function (type, event, args) {\n this.log(type, args);\n let emitArgs = event ? [event].concat(args) : args;\n this.emitEvent(type, emitArgs); // trigger jQuery event\n\n if (!jQuery || !this.$element) {\n return;\n } // namespace jQuery event\n\n\n type += '.infiniteScroll';\n let $event = type;\n\n if (event) {\n // create jQuery event\n\n /* eslint-disable-next-line new-cap */\n let jQEvent = jQuery.Event(event);\n jQEvent.type = type;\n $event = jQEvent;\n }\n\n this.$element.trigger($event, args);\n };\n\n let loggers = {\n initialized: className => `on ${className}`,\n request: path => `URL: ${path}`,\n load: (response, path) => `${response.title || ''}. URL: ${path}`,\n error: (error, path) => `${error}. URL: ${path}`,\n append: (response, path, items) => `${items.length} items. URL: ${path}`,\n last: (response, path) => `URL: ${path}`,\n history: (title, path) => `URL: ${path}`,\n pageIndex: function (index, origin) {\n return `current page determined to be: ${index} from ${origin}`;\n }\n }; // log events\n\n proto.log = function (type, args) {\n if (!this.options.debug) return;\n let message = `[InfiniteScroll] ${type}`;\n let logger = loggers[type];\n if (logger) message += '. ' + logger.apply(this, args);\n console.log(message);\n }; // -------------------------- methods used amoung features -------------------------- //\n\n\n proto.updateMeasurements = function () {\n this.windowHeight = window.innerHeight;\n let rect = this.element.getBoundingClientRect();\n this.top = rect.top + window.scrollY;\n };\n\n proto.updateScroller = function () {\n let elementScroll = this.options.elementScroll;\n\n if (!elementScroll) {\n // default, use window\n this.scroller = window;\n return;\n } // if true, set to element, otherwise use option\n\n\n this.scroller = elementScroll === true ? this.element : utils.getQueryElement(elementScroll);\n\n if (!this.scroller) {\n throw new Error(`Unable to find elementScroll: ${elementScroll}`);\n }\n }; // -------------------------- page path -------------------------- //\n\n\n proto.updateGetPath = function () {\n let optPath = this.options.path;\n\n if (!optPath) {\n console.error(`InfiniteScroll path option required. Set as: ${optPath}`);\n return;\n } // function\n\n\n let type = typeof optPath;\n\n if (type == 'function') {\n this.getPath = optPath;\n return;\n } // template string: '/pages/{{#}}.html'\n\n\n let templateMatch = type == 'string' && optPath.match('{{#}}');\n\n if (templateMatch) {\n this.updateGetPathTemplate(optPath);\n return;\n } // selector: '.next-page-selector'\n\n\n this.updateGetPathSelector(optPath);\n };\n\n proto.updateGetPathTemplate = function (optPath) {\n // set getPath with template string\n this.getPath = () => {\n let nextIndex = this.pageIndex + 1;\n return optPath.replace('{{#}}', nextIndex);\n }; // get pageIndex from location\n // convert path option into regex to look for pattern in location\n // escape query (?) in url, allows for parsing GET parameters\n\n\n let regexString = optPath.replace(/(\\\\\\?|\\?)/, '\\\\?').replace('{{#}}', '(\\\\d\\\\d?\\\\d?)');\n let templateRe = new RegExp(regexString);\n let match = location.href.match(templateRe);\n\n if (match) {\n this.pageIndex = parseInt(match[1], 10);\n this.log('pageIndex', [this.pageIndex, 'template string']);\n }\n };\n\n let pathRegexes = [// WordPress & Tumblr - example.com/page/2\n // Jekyll - example.com/page2\n /^(.*?\\/?page\\/?)(\\d\\d?\\d?)(.*?$)/, // Drupal - example.com/?page=1\n /^(.*?\\/?\\?page=)(\\d\\d?\\d?)(.*?$)/, // catch all, last occurence of a number\n /(.*?)(\\d\\d?\\d?)(?!.*\\d)(.*?$)/]; // try matching href to pathRegexes patterns\n\n let getPathParts = InfiniteScroll.getPathParts = function (href) {\n if (!href) return;\n\n for (let regex of pathRegexes) {\n let match = href.match(regex);\n\n if (match) {\n let [, begin, index, end] = match;\n return {\n begin,\n index,\n end\n };\n }\n }\n };\n\n proto.updateGetPathSelector = function (optPath) {\n // parse href of link: '.next-page-link'\n let hrefElem = document.querySelector(optPath);\n\n if (!hrefElem) {\n console.error(`Bad InfiniteScroll path option. Next link not found: ${optPath}`);\n return;\n }\n\n let href = hrefElem.getAttribute('href');\n let pathParts = getPathParts(href);\n\n if (!pathParts) {\n console.error(`InfiniteScroll unable to parse next link href: ${href}`);\n return;\n }\n\n let {\n begin,\n index,\n end\n } = pathParts;\n this.isPathSelector = true; // flag for checkLastPage()\n\n this.getPath = () => begin + (this.pageIndex + 1) + end; // get pageIndex from href\n\n\n this.pageIndex = parseInt(index, 10) - 1;\n this.log('pageIndex', [this.pageIndex, 'next link']);\n };\n\n proto.updateGetAbsolutePath = function () {\n let path = this.getPath(); // path doesn't start with http or /\n\n let isAbsolute = path.match(/^http/) || path.match(/^\\//);\n\n if (isAbsolute) {\n this.getAbsolutePath = this.getPath;\n return;\n }\n\n let {\n pathname\n } = location; // query parameter #829. example.com/?pg=2\n\n let isQuery = path.match(/^\\?/); // /foo/bar/index.html => /foo/bar\n\n let directory = pathname.substring(0, pathname.lastIndexOf('/'));\n let pathStart = isQuery ? pathname : directory + '/';\n\n this.getAbsolutePath = () => pathStart + this.getPath();\n }; // -------------------------- nav -------------------------- //\n // hide navigation\n\n\n InfiniteScroll.create.hideNav = function () {\n let nav = utils.getQueryElement(this.options.hideNav);\n if (!nav) return;\n nav.style.display = 'none';\n this.nav = nav;\n };\n\n InfiniteScroll.destroy.hideNav = function () {\n if (this.nav) this.nav.style.display = '';\n }; // -------------------------- destroy -------------------------- //\n\n\n proto.destroy = function () {\n this.allOff(); // remove all event listeners\n // call destroy methods\n\n for (let method in InfiniteScroll.destroy) {\n InfiniteScroll.destroy[method].call(this);\n }\n\n delete this.element.infiniteScrollGUID;\n delete instances[this.guid]; // remove jQuery data. #807\n\n if (jQuery && this.$element) {\n jQuery.removeData(this.element, 'infiniteScroll');\n }\n }; // -------------------------- utilities -------------------------- //\n // https://remysharp.com/2010/07/21/throttling-function-calls\n\n\n InfiniteScroll.throttle = function (fn, threshold) {\n threshold = threshold || 200;\n let last, timeout;\n return function () {\n let now = +new Date();\n let args = arguments;\n\n let trigger = () => {\n last = now;\n fn.apply(this, args);\n };\n\n if (last && now < last + threshold) {\n // hold on to it\n clearTimeout(timeout);\n timeout = setTimeout(trigger, threshold);\n } else {\n trigger();\n }\n };\n };\n\n InfiniteScroll.data = function (elem) {\n elem = utils.getQueryElement(elem);\n let id = elem && elem.infiniteScrollGUID;\n return id && instances[id];\n }; // set internal jQuery, for Webpack + jQuery v3\n\n\n InfiniteScroll.setJQuery = function (jqry) {\n jQuery = jqry;\n }; // -------------------------- setup -------------------------- //\n\n\n utils.htmlInit(InfiniteScroll, 'infinite-scroll'); // add noop _init method for jQuery Bridget. #768\n\n proto._init = function () {};\n\n let {\n jQueryBridget\n } = window;\n\n if (jQuery && jQueryBridget) {\n jQueryBridget('infiniteScroll', InfiniteScroll, jQuery);\n } // -------------------------- -------------------------- //\n\n\n return InfiniteScroll;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/infinite-scroll/js/core.js?");
|
|
344
|
+
|
|
345
|
+
/***/ }),
|
|
346
|
+
|
|
347
|
+
/***/ "./node_modules/infinite-scroll/js/history.js":
|
|
348
|
+
/*!****************************************************!*\
|
|
349
|
+
!*** ./node_modules/infinite-scroll/js/history.js ***!
|
|
350
|
+
\****************************************************/
|
|
351
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
352
|
+
|
|
353
|
+
eval("// history\n(function (window, factory) {\n // universal module definition\n if ( true && module.exports) {\n // CommonJS\n module.exports = factory(window, __webpack_require__(/*! ./core */ \"./node_modules/infinite-scroll/js/core.js\"), __webpack_require__(/*! fizzy-ui-utils */ \"./node_modules/fizzy-ui-utils/utils.js\"));\n } else {\n // browser global\n factory(window, window.InfiniteScroll, window.fizzyUIUtils);\n }\n})(window, function factory(window, InfiniteScroll, utils) {\n let proto = InfiniteScroll.prototype;\n Object.assign(InfiniteScroll.defaults, {\n history: 'replace' // historyTitle: false,\n\n });\n let link = document.createElement('a'); // ----- create/destroy ----- //\n\n InfiniteScroll.create.history = function () {\n if (!this.options.history) return; // check for same origin\n\n link.href = this.getAbsolutePath(); // MS Edge does not have origin on link\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12236493/\n\n let linkOrigin = link.origin || link.protocol + '//' + link.host;\n let isSameOrigin = linkOrigin == location.origin;\n\n if (!isSameOrigin) {\n console.error('[InfiniteScroll] cannot set history with different origin: ' + `${link.origin} on ${location.origin} . History behavior disabled.`);\n return;\n } // two ways to handle changing history\n\n\n if (this.options.append) {\n this.createHistoryAppend();\n } else {\n this.createHistoryPageLoad();\n }\n };\n\n proto.createHistoryAppend = function () {\n this.updateMeasurements();\n this.updateScroller(); // array of scroll positions of appended pages\n\n this.scrollPages = [// first page\n {\n top: 0,\n path: location.href,\n title: document.title\n }];\n this.scrollPage = this.scrollPages[0]; // events\n\n this.scrollHistoryHandler = this.onScrollHistory.bind(this);\n this.unloadHandler = this.onUnload.bind(this);\n this.scroller.addEventListener('scroll', this.scrollHistoryHandler);\n this.on('append', this.onAppendHistory);\n this.bindHistoryAppendEvents(true);\n };\n\n proto.bindHistoryAppendEvents = function (isBind) {\n let addRemove = isBind ? 'addEventListener' : 'removeEventListener';\n this.scroller[addRemove]('scroll', this.scrollHistoryHandler);\n window[addRemove]('unload', this.unloadHandler);\n };\n\n proto.createHistoryPageLoad = function () {\n this.on('load', this.onPageLoadHistory);\n };\n\n InfiniteScroll.destroy.history = proto.destroyHistory = function () {\n let isHistoryAppend = this.options.history && this.options.append;\n\n if (isHistoryAppend) {\n this.bindHistoryAppendEvents(false);\n }\n }; // ----- append history ----- //\n\n\n proto.onAppendHistory = function (response, path, items) {\n // do not proceed if no items. #779\n if (!items || !items.length) return;\n let firstItem = items[0];\n let elemScrollY = this.getElementScrollY(firstItem); // resolve path\n\n link.href = path; // add page data to hash\n\n this.scrollPages.push({\n top: elemScrollY,\n path: link.href,\n title: response.title\n });\n };\n\n proto.getElementScrollY = function (elem) {\n if (this.options.elementScroll) {\n return elem.offsetTop - this.top;\n } else {\n let rect = elem.getBoundingClientRect();\n return rect.top + window.scrollY;\n }\n };\n\n proto.onScrollHistory = function () {\n // cycle through positions, find biggest without going over\n let scrollPage = this.getClosestScrollPage(); // set history if changed\n\n if (scrollPage != this.scrollPage) {\n this.scrollPage = scrollPage;\n this.setHistory(scrollPage.title, scrollPage.path);\n }\n };\n\n utils.debounceMethod(InfiniteScroll, 'onScrollHistory', 150);\n\n proto.getClosestScrollPage = function () {\n let scrollViewY;\n\n if (this.options.elementScroll) {\n scrollViewY = this.scroller.scrollTop + this.scroller.clientHeight / 2;\n } else {\n scrollViewY = window.scrollY + this.windowHeight / 2;\n }\n\n let scrollPage;\n\n for (let page of this.scrollPages) {\n if (page.top >= scrollViewY) break;\n scrollPage = page;\n }\n\n return scrollPage;\n };\n\n proto.setHistory = function (title, path) {\n let optHistory = this.options.history;\n let historyMethod = optHistory && history[optHistory + 'State'];\n if (!historyMethod) return;\n history[optHistory + 'State'](null, title, path);\n if (this.options.historyTitle) document.title = title;\n this.dispatchEvent('history', null, [title, path]);\n }; // scroll to top to prevent initial scroll-reset after page refresh\n // https://stackoverflow.com/a/18633915/182183\n\n\n proto.onUnload = function () {\n if (this.scrollPage.top === 0) return; // calculate where scroll position would be on refresh\n\n let scrollY = window.scrollY - this.scrollPage.top + this.top; // disable scroll event before setting scroll #679\n\n this.destroyHistory();\n scrollTo(0, scrollY);\n }; // ----- load history ----- //\n // update URL\n\n\n proto.onPageLoadHistory = function (response, path) {\n this.setHistory(response.title, path);\n }; // -------------------------- -------------------------- //\n\n\n return InfiniteScroll;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/infinite-scroll/js/history.js?");
|
|
354
|
+
|
|
355
|
+
/***/ }),
|
|
356
|
+
|
|
357
|
+
/***/ "./node_modules/infinite-scroll/js/index.js":
|
|
358
|
+
/*!**************************************************!*\
|
|
359
|
+
!*** ./node_modules/infinite-scroll/js/index.js ***!
|
|
360
|
+
\**************************************************/
|
|
361
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
362
|
+
|
|
363
|
+
eval("/*!\n * Infinite Scroll v4.0.1\n * Automatically add next page\n *\n * Licensed GPLv3 for open source use\n * or Infinite Scroll Commercial License for commercial use\n *\n * https://infinite-scroll.com\n * Copyright 2018-2020 Metafizzy\n */\n(function (window, factory) {\n // universal module definition\n if ( true && module.exports) {\n // CommonJS\n module.exports = factory(__webpack_require__(/*! ./core */ \"./node_modules/infinite-scroll/js/core.js\"), __webpack_require__(/*! ./page-load */ \"./node_modules/infinite-scroll/js/page-load.js\"), __webpack_require__(/*! ./scroll-watch */ \"./node_modules/infinite-scroll/js/scroll-watch.js\"), __webpack_require__(/*! ./history */ \"./node_modules/infinite-scroll/js/history.js\"), __webpack_require__(/*! ./button */ \"./node_modules/infinite-scroll/js/button.js\"), __webpack_require__(/*! ./status */ \"./node_modules/infinite-scroll/js/status.js\"));\n }\n})(window, function factory(InfiniteScroll) {\n return InfiniteScroll;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/infinite-scroll/js/index.js?");
|
|
364
|
+
|
|
365
|
+
/***/ }),
|
|
366
|
+
|
|
367
|
+
/***/ "./node_modules/infinite-scroll/js/page-load.js":
|
|
368
|
+
/*!******************************************************!*\
|
|
369
|
+
!*** ./node_modules/infinite-scroll/js/page-load.js ***!
|
|
370
|
+
\******************************************************/
|
|
371
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
372
|
+
|
|
373
|
+
eval("// page-load\n(function (window, factory) {\n // universal module definition\n if ( true && module.exports) {\n // CommonJS\n module.exports = factory(window, __webpack_require__(/*! ./core */ \"./node_modules/infinite-scroll/js/core.js\"));\n } else {\n // browser global\n factory(window, window.InfiniteScroll);\n }\n})(window, function factory(window, InfiniteScroll) {\n let proto = InfiniteScroll.prototype;\n Object.assign(InfiniteScroll.defaults, {\n // append: false,\n loadOnScroll: true,\n checkLastPage: true,\n responseBody: 'text',\n domParseResponse: true // prefill: false,\n // outlayer: null,\n\n });\n\n InfiniteScroll.create.pageLoad = function () {\n this.canLoad = true;\n this.on('scrollThreshold', this.onScrollThresholdLoad);\n this.on('load', this.checkLastPage);\n\n if (this.options.outlayer) {\n this.on('append', this.onAppendOutlayer);\n }\n };\n\n proto.onScrollThresholdLoad = function () {\n if (this.options.loadOnScroll) this.loadNextPage();\n };\n\n let domParser = new DOMParser();\n\n proto.loadNextPage = function () {\n if (this.isLoading || !this.canLoad) return;\n let {\n responseBody,\n domParseResponse,\n fetchOptions\n } = this.options;\n let path = this.getAbsolutePath();\n this.isLoading = true;\n if (typeof fetchOptions == 'function') fetchOptions = fetchOptions();\n let fetchPromise = fetch(path, fetchOptions).then(response => {\n if (!response.ok) {\n let error = new Error(response.statusText);\n this.onPageError(error, path, response);\n return {\n response\n };\n }\n\n return response[responseBody]().then(body => {\n let canDomParse = responseBody == 'text' && domParseResponse;\n\n if (canDomParse) {\n body = domParser.parseFromString(body, 'text/html');\n }\n\n if (response.status == 204) {\n this.lastPageReached(body, path);\n return {\n body,\n response\n };\n } else {\n return this.onPageLoad(body, path, response);\n }\n });\n }).catch(error => {\n this.onPageError(error, path);\n });\n this.dispatchEvent('request', null, [path, fetchPromise]);\n return fetchPromise;\n };\n\n proto.onPageLoad = function (body, path, response) {\n // done loading if not appending\n if (!this.options.append) {\n this.isLoading = false;\n }\n\n this.pageIndex++;\n this.loadCount++;\n this.dispatchEvent('load', null, [body, path, response]);\n return this.appendNextPage(body, path, response);\n };\n\n proto.appendNextPage = function (body, path, response) {\n let {\n append,\n responseBody,\n domParseResponse\n } = this.options; // do not append json\n\n let isDocument = responseBody == 'text' && domParseResponse;\n if (!isDocument || !append) return {\n body,\n response\n };\n let items = body.querySelectorAll(append);\n let promiseValue = {\n body,\n response,\n items\n }; // last page hit if no items. #840\n\n if (!items || !items.length) {\n this.lastPageReached(body, path);\n return promiseValue;\n }\n\n let fragment = getItemsFragment(items);\n\n let appendReady = () => {\n this.appendItems(items, fragment);\n this.isLoading = false;\n this.dispatchEvent('append', null, [body, path, items, response]);\n return promiseValue;\n }; // TODO add hook for option to trigger appendReady\n\n\n if (this.options.outlayer) {\n return this.appendOutlayerItems(fragment, appendReady);\n } else {\n return appendReady();\n }\n };\n\n proto.appendItems = function (items, fragment) {\n if (!items || !items.length) return; // get fragment if not provided\n\n fragment = fragment || getItemsFragment(items);\n refreshScripts(fragment);\n this.element.appendChild(fragment);\n };\n\n function getItemsFragment(items) {\n // add items to fragment\n let fragment = document.createDocumentFragment();\n if (items) fragment.append(...items);\n return fragment;\n } // replace <script>s with copies so they load\n // <script>s added by InfiniteScroll will not load\n // similar to https://stackoverflow.com/questions/610995\n\n\n function refreshScripts(fragment) {\n let scripts = fragment.querySelectorAll('script');\n\n for (let script of scripts) {\n let freshScript = document.createElement('script'); // copy attributes\n\n let attrs = script.attributes;\n\n for (let attr of attrs) {\n freshScript.setAttribute(attr.name, attr.value);\n } // copy inner script code. #718, #782\n\n\n freshScript.innerHTML = script.innerHTML;\n script.parentNode.replaceChild(freshScript, script);\n }\n } // ----- outlayer ----- //\n\n\n proto.appendOutlayerItems = function (fragment, appendReady) {\n let imagesLoaded = InfiniteScroll.imagesLoaded || window.imagesLoaded;\n\n if (!imagesLoaded) {\n console.error('[InfiniteScroll] imagesLoaded required for outlayer option');\n this.isLoading = false;\n return;\n } // append once images loaded\n\n\n return new Promise(function (resolve) {\n imagesLoaded(fragment, function () {\n let bodyResponse = appendReady();\n resolve(bodyResponse);\n });\n });\n };\n\n proto.onAppendOutlayer = function (response, path, items) {\n this.options.outlayer.appended(items);\n }; // ----- checkLastPage ----- //\n // check response for next element\n\n\n proto.checkLastPage = function (body, path) {\n let {\n checkLastPage,\n path: pathOpt\n } = this.options;\n if (!checkLastPage) return; // if path is function, check if next path is truthy\n\n if (typeof pathOpt == 'function') {\n let nextPath = this.getPath();\n\n if (!nextPath) {\n this.lastPageReached(body, path);\n return;\n }\n } // get selector from checkLastPage or path option\n\n\n let selector;\n\n if (typeof checkLastPage == 'string') {\n selector = checkLastPage;\n } else if (this.isPathSelector) {\n // path option is selector string\n selector = pathOpt;\n } // check last page for selector\n // bail if no selector or not document response\n\n\n if (!selector || !body.querySelector) return; // check if response has selector\n\n let nextElem = body.querySelector(selector);\n if (!nextElem) this.lastPageReached(body, path);\n };\n\n proto.lastPageReached = function (body, path) {\n this.canLoad = false;\n this.dispatchEvent('last', null, [body, path]);\n }; // ----- error ----- //\n\n\n proto.onPageError = function (error, path, response) {\n this.isLoading = false;\n this.canLoad = false;\n this.dispatchEvent('error', null, [error, path, response]);\n return error;\n }; // -------------------------- prefill -------------------------- //\n\n\n InfiniteScroll.create.prefill = function () {\n if (!this.options.prefill) return;\n let append = this.options.append;\n\n if (!append) {\n console.error(`append option required for prefill. Set as :${append}`);\n return;\n }\n\n this.updateMeasurements();\n this.updateScroller();\n this.isPrefilling = true;\n this.on('append', this.prefill);\n this.once('error', this.stopPrefill);\n this.once('last', this.stopPrefill);\n this.prefill();\n };\n\n proto.prefill = function () {\n let distance = this.getPrefillDistance();\n this.isPrefilling = distance >= 0;\n\n if (this.isPrefilling) {\n this.log('prefill');\n this.loadNextPage();\n } else {\n this.stopPrefill();\n }\n };\n\n proto.getPrefillDistance = function () {\n // element scroll\n if (this.options.elementScroll) {\n return this.scroller.clientHeight - this.scroller.scrollHeight;\n } // window\n\n\n return this.windowHeight - this.element.clientHeight;\n };\n\n proto.stopPrefill = function () {\n this.log('stopPrefill');\n this.off('append', this.prefill);\n }; // -------------------------- -------------------------- //\n\n\n return InfiniteScroll;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/infinite-scroll/js/page-load.js?");
|
|
374
|
+
|
|
375
|
+
/***/ }),
|
|
376
|
+
|
|
377
|
+
/***/ "./node_modules/infinite-scroll/js/scroll-watch.js":
|
|
378
|
+
/*!*********************************************************!*\
|
|
379
|
+
!*** ./node_modules/infinite-scroll/js/scroll-watch.js ***!
|
|
380
|
+
\*********************************************************/
|
|
381
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
382
|
+
|
|
383
|
+
eval("// scroll-watch\n(function (window, factory) {\n // universal module definition\n if ( true && module.exports) {\n // CommonJS\n module.exports = factory(window, __webpack_require__(/*! ./core */ \"./node_modules/infinite-scroll/js/core.js\"), __webpack_require__(/*! fizzy-ui-utils */ \"./node_modules/fizzy-ui-utils/utils.js\"));\n } else {\n // browser global\n factory(window, window.InfiniteScroll, window.fizzyUIUtils);\n }\n})(window, function factory(window, InfiniteScroll, utils) {\n let proto = InfiniteScroll.prototype; // default options\n\n Object.assign(InfiniteScroll.defaults, {\n scrollThreshold: 400 // elementScroll: null,\n\n });\n\n InfiniteScroll.create.scrollWatch = function () {\n // events\n this.pageScrollHandler = this.onPageScroll.bind(this);\n this.resizeHandler = this.onResize.bind(this);\n let scrollThreshold = this.options.scrollThreshold;\n let isEnable = scrollThreshold || scrollThreshold === 0;\n if (isEnable) this.enableScrollWatch();\n };\n\n InfiniteScroll.destroy.scrollWatch = function () {\n this.disableScrollWatch();\n };\n\n proto.enableScrollWatch = function () {\n if (this.isScrollWatching) return;\n this.isScrollWatching = true;\n this.updateMeasurements();\n this.updateScroller(); // TODO disable after error?\n\n this.on('last', this.disableScrollWatch);\n this.bindScrollWatchEvents(true);\n };\n\n proto.disableScrollWatch = function () {\n if (!this.isScrollWatching) return;\n this.bindScrollWatchEvents(false);\n delete this.isScrollWatching;\n };\n\n proto.bindScrollWatchEvents = function (isBind) {\n let addRemove = isBind ? 'addEventListener' : 'removeEventListener';\n this.scroller[addRemove]('scroll', this.pageScrollHandler);\n window[addRemove]('resize', this.resizeHandler);\n };\n\n proto.onPageScroll = InfiniteScroll.throttle(function () {\n let distance = this.getBottomDistance();\n\n if (distance <= this.options.scrollThreshold) {\n this.dispatchEvent('scrollThreshold');\n }\n });\n\n proto.getBottomDistance = function () {\n let bottom, scrollY;\n\n if (this.options.elementScroll) {\n bottom = this.scroller.scrollHeight;\n scrollY = this.scroller.scrollTop + this.scroller.clientHeight;\n } else {\n bottom = this.top + this.element.clientHeight;\n scrollY = window.scrollY + this.windowHeight;\n }\n\n return bottom - scrollY;\n };\n\n proto.onResize = function () {\n this.updateMeasurements();\n };\n\n utils.debounceMethod(InfiniteScroll, 'onResize', 150); // -------------------------- -------------------------- //\n\n return InfiniteScroll;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/infinite-scroll/js/scroll-watch.js?");
|
|
384
|
+
|
|
385
|
+
/***/ }),
|
|
386
|
+
|
|
387
|
+
/***/ "./node_modules/infinite-scroll/js/status.js":
|
|
388
|
+
/*!***************************************************!*\
|
|
389
|
+
!*** ./node_modules/infinite-scroll/js/status.js ***!
|
|
390
|
+
\***************************************************/
|
|
391
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
392
|
+
|
|
393
|
+
eval("// status\n(function (window, factory) {\n // universal module definition\n if ( true && module.exports) {\n // CommonJS\n module.exports = factory(window, __webpack_require__(/*! ./core */ \"./node_modules/infinite-scroll/js/core.js\"), __webpack_require__(/*! fizzy-ui-utils */ \"./node_modules/fizzy-ui-utils/utils.js\"));\n } else {\n // browser global\n factory(window, window.InfiniteScroll, window.fizzyUIUtils);\n }\n})(window, function factory(window, InfiniteScroll, utils) {\n let proto = InfiniteScroll.prototype; // InfiniteScroll.defaults.status = null;\n\n InfiniteScroll.create.status = function () {\n let statusElem = utils.getQueryElement(this.options.status);\n if (!statusElem) return; // elements\n\n this.statusElement = statusElem;\n this.statusEventElements = {\n request: statusElem.querySelector('.infinite-scroll-request'),\n error: statusElem.querySelector('.infinite-scroll-error'),\n last: statusElem.querySelector('.infinite-scroll-last')\n }; // events\n\n this.on('request', this.showRequestStatus);\n this.on('error', this.showErrorStatus);\n this.on('last', this.showLastStatus);\n this.bindHideStatus('on');\n };\n\n proto.bindHideStatus = function (bindMethod) {\n let hideEvent = this.options.append ? 'append' : 'load';\n this[bindMethod](hideEvent, this.hideAllStatus);\n };\n\n proto.showRequestStatus = function () {\n this.showStatus('request');\n };\n\n proto.showErrorStatus = function () {\n this.showStatus('error');\n };\n\n proto.showLastStatus = function () {\n this.showStatus('last'); // prevent last then append event race condition from showing last status #706\n\n this.bindHideStatus('off');\n };\n\n proto.showStatus = function (eventName) {\n show(this.statusElement);\n this.hideStatusEventElements();\n let eventElem = this.statusEventElements[eventName];\n show(eventElem);\n };\n\n proto.hideAllStatus = function () {\n hide(this.statusElement);\n this.hideStatusEventElements();\n };\n\n proto.hideStatusEventElements = function () {\n for (let type in this.statusEventElements) {\n let eventElem = this.statusEventElements[type];\n hide(eventElem);\n }\n }; // -------------------------- -------------------------- //\n\n\n function hide(elem) {\n setDisplay(elem, 'none');\n }\n\n function show(elem) {\n setDisplay(elem, 'block');\n }\n\n function setDisplay(elem, value) {\n if (elem) {\n elem.style.display = value;\n }\n } // -------------------------- -------------------------- //\n\n\n return InfiniteScroll;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/infinite-scroll/js/status.js?");
|
|
394
|
+
|
|
395
|
+
/***/ }),
|
|
396
|
+
|
|
397
|
+
/***/ "./node_modules/lang.js/src/lang.js":
|
|
398
|
+
/*!******************************************!*\
|
|
399
|
+
!*** ./node_modules/lang.js/src/lang.js ***!
|
|
400
|
+
\******************************************/
|
|
401
|
+
/***/ (function(module, exports) {
|
|
402
|
+
|
|
403
|
+
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * Lang.js for Laravel localization in JavaScript.\n *\n * @version 1.1.12\n * @license MIT https://github.com/rmariuzzo/Lang.js/blob/master/LICENSE\n * @site https://github.com/rmariuzzo/Lang.js\n * @author Rubens Mariuzzo <rubens@mariuzzo.com>\n */\n(function (root, factory) {\n 'use strict';\n\n if (true) {\n // AMD support.\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(this, function () {\n 'use strict';\n\n function inferLocale() {\n if (typeof document !== 'undefined' && document.documentElement) {\n return document.documentElement.lang;\n }\n }\n\n ;\n\n function convertNumber(str) {\n if (str === '-Inf') {\n return -Infinity;\n } else if (str === '+Inf' || str === 'Inf' || str === '*') {\n return Infinity;\n }\n\n return parseInt(str, 10);\n } // Derived from: https://github.com/symfony/translation/blob/460390765eb7bb9338a4a323b8a4e815a47541ba/Interval.php\n\n\n var intervalRegexp = /^({\\s*(\\-?\\d+(\\.\\d+)?[\\s*,\\s*\\-?\\d+(\\.\\d+)?]*)\\s*})|([\\[\\]])\\s*(-Inf|\\*|\\-?\\d+(\\.\\d+)?)\\s*,\\s*(\\+?Inf|\\*|\\-?\\d+(\\.\\d+)?)\\s*([\\[\\]])$/;\n var anyIntervalRegexp = /({\\s*(\\-?\\d+(\\.\\d+)?[\\s*,\\s*\\-?\\d+(\\.\\d+)?]*)\\s*})|([\\[\\]])\\s*(-Inf|\\*|\\-?\\d+(\\.\\d+)?)\\s*,\\s*(\\+?Inf|\\*|\\-?\\d+(\\.\\d+)?)\\s*([\\[\\]])/; // Default options //\n\n var defaults = {\n locale: 'en'\n /** The default locale if not set. */\n\n }; // Constructor //\n\n var Lang = function (options) {\n options = options || {};\n this.locale = options.locale || inferLocale() || defaults.locale;\n this.fallback = options.fallback;\n this.messages = options.messages;\n }; // Methods //\n\n /**\n * Set messages source.\n *\n * @param messages {object} The messages source.\n *\n * @return void\n */\n\n\n Lang.prototype.setMessages = function (messages) {\n this.messages = messages;\n };\n /**\n * Get the current locale.\n *\n * @return {string} The current locale.\n */\n\n\n Lang.prototype.getLocale = function () {\n return this.locale || this.fallback;\n };\n /**\n * Set the current locale.\n *\n * @param locale {string} The locale to set.\n *\n * @return void\n */\n\n\n Lang.prototype.setLocale = function (locale) {\n this.locale = locale;\n };\n /**\n * Get the fallback locale being used.\n *\n * @return void\n */\n\n\n Lang.prototype.getFallback = function () {\n return this.fallback;\n };\n /**\n * Set the fallback locale being used.\n *\n * @param fallback {string} The fallback locale.\n *\n * @return void\n */\n\n\n Lang.prototype.setFallback = function (fallback) {\n this.fallback = fallback;\n };\n /**\n * This method act as an alias to get() method.\n *\n * @param key {string} The key of the message.\n * @param locale {string} The locale of the message\n *\n * @return {boolean} true if the given key is defined on the messages source, otherwise false.\n */\n\n\n Lang.prototype.has = function (key, locale) {\n if (typeof key !== 'string' || !this.messages) {\n return false;\n }\n\n return this._getMessage(key, locale) !== null;\n };\n /**\n * Get a translation message.\n *\n * @param key {string} The key of the message.\n * @param replacements {object} The replacements to be done in the message.\n * @param locale {string} The locale to use, if not passed use the default locale.\n *\n * @return {string} The translation message, if not found the given key.\n */\n\n\n Lang.prototype.get = function (key, replacements, locale) {\n if (!this.has(key, locale)) {\n return key;\n }\n\n var message = this._getMessage(key, locale);\n\n if (message === null) {\n return key;\n }\n\n if (replacements) {\n message = this._applyReplacements(message, replacements);\n }\n\n return message;\n };\n /**\n * This method act as an alias to get() method.\n *\n * @param key {string} The key of the message.\n * @param replacements {object} The replacements to be done in the message.\n *\n * @return {string} The translation message, if not found the given key.\n */\n\n\n Lang.prototype.trans = function (key, replacements) {\n return this.get(key, replacements);\n };\n /**\n * Gets the plural or singular form of the message specified based on an integer value.\n *\n * @param key {string} The key of the message.\n * @param count {number} The number of elements.\n * @param replacements {object} The replacements to be done in the message.\n * @param locale {string} The locale to use, if not passed use the default locale.\n *\n * @return {string} The translation message according to an integer value.\n */\n\n\n Lang.prototype.choice = function (key, number, replacements, locale) {\n // Set default values for parameters replace and locale\n replacements = typeof replacements !== 'undefined' ? replacements : {}; // The count must be replaced if found in the message\n\n replacements.count = number; // Message to get the plural or singular\n\n var message = this.get(key, replacements, locale); // Check if message is not null or undefined\n\n if (message === null || message === undefined) {\n return message;\n } // Separate the plural from the singular, if any\n\n\n var messageParts = message.split('|'); // Get the explicit rules, If any\n\n var explicitRules = [];\n\n for (var i = 0; i < messageParts.length; i++) {\n messageParts[i] = messageParts[i].trim();\n\n if (anyIntervalRegexp.test(messageParts[i])) {\n var messageSpaceSplit = messageParts[i].split(/\\s/);\n explicitRules.push(messageSpaceSplit.shift());\n messageParts[i] = messageSpaceSplit.join(' ');\n }\n } // Check if there's only one message\n\n\n if (messageParts.length === 1) {\n // Nothing to do here\n return message;\n } // Check the explicit rules\n\n\n for (var j = 0; j < explicitRules.length; j++) {\n if (this._testInterval(number, explicitRules[j])) {\n return messageParts[j];\n }\n }\n\n locale = locale || this._getLocale(key);\n\n var pluralForm = this._getPluralForm(number, locale);\n\n return messageParts[pluralForm];\n };\n /**\n * This method act as an alias to choice() method.\n *\n * @param key {string} The key of the message.\n * @param count {number} The number of elements.\n * @param replacements {object} The replacements to be done in the message.\n *\n * @return {string} The translation message according to an integer value.\n */\n\n\n Lang.prototype.transChoice = function (key, count, replacements) {\n return this.choice(key, count, replacements);\n };\n /**\n * Parse a message key into components.\n *\n * @param key {string} The message key to parse.\n * @param key {string} The message locale to parse\n * @return {object} A key object with source and entries properties.\n */\n\n\n Lang.prototype._parseKey = function (key, locale) {\n if (typeof key !== 'string' || typeof locale !== 'string') {\n return null;\n }\n\n var segments = key.split('.');\n var source = segments[0].replace(/\\//g, '.');\n return {\n source: locale + '.' + source,\n sourceFallback: this.getFallback() + '.' + source,\n entries: segments.slice(1)\n };\n };\n /**\n * Returns a translation message. Use `Lang.get()` method instead, this methods assumes the key exists.\n *\n * @param key {string} The key of the message.\n * @param locale {string} The locale of the message\n *\n * @return {string} The translation message for the given key.\n */\n\n\n Lang.prototype._getMessage = function (key, locale) {\n locale = locale || this.getLocale();\n key = this._parseKey(key, locale); // Ensure message source exists.\n\n if (this.messages[key.source] === undefined && this.messages[key.sourceFallback] === undefined) {\n return null;\n } // Get message from default locale.\n\n\n var message = this.messages[key.source];\n var entries = key.entries.slice();\n var subKey = entries.join('.');\n message = message !== undefined ? this._getValueInKey(message, subKey) : undefined; // Get message from fallback locale.\n\n if (typeof message !== 'string' && this.messages[key.sourceFallback]) {\n message = this.messages[key.sourceFallback];\n entries = key.entries.slice();\n subKey = '';\n\n while (entries.length && message !== undefined) {\n var subKey = !subKey ? entries.shift() : subKey.concat('.', entries.shift());\n\n if (message[subKey]) {\n message = message[subKey];\n subKey = '';\n }\n }\n }\n\n if (typeof message !== 'string') {\n return null;\n }\n\n return message;\n };\n\n Lang.prototype._getValueInKey = function (obj, str) {\n // If the full key exists just return the value\n if (typeof obj[str] === 'string') {\n return obj[str];\n }\n\n str = str.replace(/\\[(\\w+)\\]/g, '.$1'); // convert indexes to properties\n\n str = str.replace(/^\\./, ''); // strip a leading dot\n\n var parts = str.split('.');\n\n for (var i = 0, n = parts.length; i < n; ++i) {\n var currentKey = parts.slice(0, i + 1).join('.');\n var restOfTheKey = parts.slice(i + 1, parts.length).join('.');\n\n if (obj[currentKey]) {\n return this._getValueInKey(obj[currentKey], restOfTheKey);\n }\n }\n\n return obj;\n };\n /**\n * Return the locale to be used between default and fallback.\n * @param {String} key\n * @return {String}\n */\n\n\n Lang.prototype._getLocale = function (key) {\n key = this._parseKey(key, this.locale);\n\n if (this.messages[key.source]) {\n return this.locale;\n }\n\n if (this.messages[key.sourceFallback]) {\n return this.fallback;\n }\n\n return null;\n };\n /**\n * Find a message in a translation tree using both dotted keys and regular ones\n *\n * @param pathSegments {array} An array of path segments such as ['family', 'father']\n * @param tree {object} The translation tree\n */\n\n\n Lang.prototype._findMessageInTree = function (pathSegments, tree) {\n while (pathSegments.length && tree !== undefined) {\n var dottedKey = pathSegments.join('.');\n\n if (tree[dottedKey]) {\n tree = tree[dottedKey];\n break;\n }\n\n tree = tree[pathSegments.shift()];\n }\n\n return tree;\n };\n /**\n * Sort replacement keys by length in descending order.\n *\n * @param a {string} Replacement key\n * @param b {string} Sibling replacement key\n * @return {number}\n * @private\n */\n\n\n Lang.prototype._sortReplacementKeys = function (a, b) {\n return b.length - a.length;\n };\n /**\n * Apply replacements to a string message containing placeholders.\n *\n * @param message {string} The text message.\n * @param replacements {object} The replacements to be done in the message.\n *\n * @return {string} The string message with replacements applied.\n */\n\n\n Lang.prototype._applyReplacements = function (message, replacements) {\n var keys = Object.keys(replacements).sort(this._sortReplacementKeys);\n keys.forEach(function (replace) {\n message = message.replace(new RegExp(':' + replace, 'gi'), function (match) {\n var value = replacements[replace]; // Capitalize all characters.\n\n var allCaps = match === match.toUpperCase();\n\n if (allCaps) {\n return value.toUpperCase();\n } // Capitalize first letter.\n\n\n var firstCap = match === match.replace(/\\w/i, function (letter) {\n return letter.toUpperCase();\n });\n\n if (firstCap) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n }\n\n return value;\n });\n });\n return message;\n };\n /**\n * Checks if the given `count` is within the interval defined by the {string} `interval`\n *\n * @param count {int} The amount of items.\n * @param interval {string} The interval to be compared with the count.\n * @return {boolean} Returns true if count is within interval; false otherwise.\n */\n\n\n Lang.prototype._testInterval = function (count, interval) {\n /**\n * From the Symfony\\Component\\Translation\\Interval Docs\n *\n * Tests if a given number belongs to a given math interval.\n *\n * An interval can represent a finite set of numbers:\n *\n * {1,2,3,4}\n *\n * An interval can represent numbers between two numbers:\n *\n * [1, +Inf]\n * ]-1,2[\n *\n * The left delimiter can be [ (inclusive) or ] (exclusive).\n * The right delimiter can be [ (exclusive) or ] (inclusive).\n * Beside numbers, you can use -Inf and +Inf for the infinite.\n */\n if (typeof interval !== 'string') {\n throw 'Invalid interval: should be a string.';\n }\n\n interval = interval.trim();\n var matches = interval.match(intervalRegexp);\n\n if (!matches) {\n throw 'Invalid interval: ' + interval;\n }\n\n if (matches[2]) {\n var items = matches[2].split(',');\n\n for (var i = 0; i < items.length; i++) {\n if (parseInt(items[i], 10) === count) {\n return true;\n }\n }\n } else {\n // Remove falsy values.\n matches = matches.filter(function (match) {\n return !!match;\n });\n var leftDelimiter = matches[1];\n var leftNumber = convertNumber(matches[2]);\n\n if (leftNumber === Infinity) {\n leftNumber = -Infinity;\n }\n\n var rightNumber = convertNumber(matches[3]);\n var rightDelimiter = matches[4];\n return (leftDelimiter === '[' ? count >= leftNumber : count > leftNumber) && (rightDelimiter === ']' ? count <= rightNumber : count < rightNumber);\n }\n\n return false;\n };\n /**\n * Returns the plural position to use for the given locale and number.\n *\n * The plural rules are derived from code of the Zend Framework (2010-09-25),\n * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd).\n * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)\n *\n * @param {Number} count\n * @param {String} locale\n * @return {Number}\n */\n\n\n Lang.prototype._getPluralForm = function (count, locale) {\n switch (locale) {\n case 'az':\n case 'bo':\n case 'dz':\n case 'id':\n case 'ja':\n case 'jv':\n case 'ka':\n case 'km':\n case 'kn':\n case 'ko':\n case 'ms':\n case 'th':\n case 'tr':\n case 'vi':\n case 'zh':\n return 0;\n\n case 'af':\n case 'bn':\n case 'bg':\n case 'ca':\n case 'da':\n case 'de':\n case 'el':\n case 'en':\n case 'eo':\n case 'es':\n case 'et':\n case 'eu':\n case 'fa':\n case 'fi':\n case 'fo':\n case 'fur':\n case 'fy':\n case 'gl':\n case 'gu':\n case 'ha':\n case 'he':\n case 'hu':\n case 'is':\n case 'it':\n case 'ku':\n case 'lb':\n case 'ml':\n case 'mn':\n case 'mr':\n case 'nah':\n case 'nb':\n case 'ne':\n case 'nl':\n case 'nn':\n case 'no':\n case 'om':\n case 'or':\n case 'pa':\n case 'pap':\n case 'ps':\n case 'pt':\n case 'so':\n case 'sq':\n case 'sv':\n case 'sw':\n case 'ta':\n case 'te':\n case 'tk':\n case 'ur':\n case 'zu':\n return count == 1 ? 0 : 1;\n\n case 'am':\n case 'bh':\n case 'fil':\n case 'fr':\n case 'gun':\n case 'hi':\n case 'hy':\n case 'ln':\n case 'mg':\n case 'nso':\n case 'xbr':\n case 'ti':\n case 'wa':\n return count === 0 || count === 1 ? 0 : 1;\n\n case 'be':\n case 'bs':\n case 'hr':\n case 'ru':\n case 'sr':\n case 'uk':\n return count % 10 == 1 && count % 100 != 11 ? 0 : count % 10 >= 2 && count % 10 <= 4 && (count % 100 < 10 || count % 100 >= 20) ? 1 : 2;\n\n case 'cs':\n case 'sk':\n return count == 1 ? 0 : count >= 2 && count <= 4 ? 1 : 2;\n\n case 'ga':\n return count == 1 ? 0 : count == 2 ? 1 : 2;\n\n case 'lt':\n return count % 10 == 1 && count % 100 != 11 ? 0 : count % 10 >= 2 && (count % 100 < 10 || count % 100 >= 20) ? 1 : 2;\n\n case 'sl':\n return count % 100 == 1 ? 0 : count % 100 == 2 ? 1 : count % 100 == 3 || count % 100 == 4 ? 2 : 3;\n\n case 'mk':\n return count % 10 == 1 ? 0 : 1;\n\n case 'mt':\n return count == 1 ? 0 : count === 0 || count % 100 > 1 && count % 100 < 11 ? 1 : count % 100 > 10 && count % 100 < 20 ? 2 : 3;\n\n case 'lv':\n return count === 0 ? 0 : count % 10 == 1 && count % 100 != 11 ? 1 : 2;\n\n case 'pl':\n return count == 1 ? 0 : count % 10 >= 2 && count % 10 <= 4 && (count % 100 < 12 || count % 100 > 14) ? 1 : 2;\n\n case 'cy':\n return count == 1 ? 0 : count == 2 ? 1 : count == 8 || count == 11 ? 2 : 3;\n\n case 'ro':\n return count == 1 ? 0 : count === 0 || count % 100 > 0 && count % 100 < 20 ? 1 : 2;\n\n case 'ar':\n return count === 0 ? 0 : count == 1 ? 1 : count == 2 ? 2 : count % 100 >= 3 && count % 100 <= 10 ? 3 : count % 100 >= 11 && count % 100 <= 99 ? 4 : 5;\n\n default:\n return 0;\n }\n };\n\n return Lang;\n});\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/lang.js/src/lang.js?");
|
|
404
|
+
|
|
405
|
+
/***/ }),
|
|
406
|
+
|
|
407
|
+
/***/ "./node_modules/store/dist/store.legacy.js":
|
|
408
|
+
/*!*************************************************!*\
|
|
409
|
+
!*** ./node_modules/store/dist/store.legacy.js ***!
|
|
410
|
+
\*************************************************/
|
|
411
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
412
|
+
|
|
413
|
+
eval("var engine = __webpack_require__(/*! ../src/store-engine */ \"./node_modules/store/src/store-engine.js\");\n\nvar storages = __webpack_require__(/*! ../storages/all */ \"./node_modules/store/storages/all.js\");\n\nvar plugins = [__webpack_require__(/*! ../plugins/json2 */ \"./node_modules/store/plugins/json2.js\")];\nmodule.exports = engine.createStore(storages, plugins);\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/dist/store.legacy.js?");
|
|
414
|
+
|
|
415
|
+
/***/ }),
|
|
416
|
+
|
|
417
|
+
/***/ "./node_modules/store/plugins/json2.js":
|
|
418
|
+
/*!*********************************************!*\
|
|
419
|
+
!*** ./node_modules/store/plugins/json2.js ***!
|
|
420
|
+
\*********************************************/
|
|
421
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
422
|
+
|
|
423
|
+
eval("module.exports = json2Plugin;\n\nfunction json2Plugin() {\n __webpack_require__(/*! ./lib/json2 */ \"./node_modules/store/plugins/lib/json2.js\");\n\n return {};\n}\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/plugins/json2.js?");
|
|
424
|
+
|
|
425
|
+
/***/ }),
|
|
426
|
+
|
|
427
|
+
/***/ "./node_modules/store/plugins/lib/json2.js":
|
|
428
|
+
/*!*************************************************!*\
|
|
429
|
+
!*** ./node_modules/store/plugins/lib/json2.js ***!
|
|
430
|
+
\*************************************************/
|
|
431
|
+
/***/ (() => {
|
|
432
|
+
|
|
433
|
+
eval("/* eslint-disable */\n// json2.js\n// 2016-10-28\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n// For example, this would serialize Dates as ISO strings.\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n// JSON.stringify(undefined) returns undefined.\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n// Example:\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n// Example:\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n eval, for, this\n*/\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n*/\n// Create a JSON object only if one does not already exist. We create the\n// methods in a closure to avoid creating global variables.\nif (typeof JSON !== \"object\") {\n JSON = {};\n}\n\n(function () {\n \"use strict\";\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? \"0\" + n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n Date.prototype.toJSON = function () {\n return isFinite(this.valueOf()) ? this.getUTCFullYear() + \"-\" + f(this.getUTCMonth() + 1) + \"-\" + f(this.getUTCDate()) + \"T\" + f(this.getUTCHours()) + \":\" + f(this.getUTCMinutes()) + \":\" + f(this.getUTCSeconds()) + \"Z\" : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n function quote(string) {\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string) ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\" : \"\\\"\" + string + \"\\\"\";\n }\n\n function str(key, holder) {\n // Produce a string from holder[key].\n var i; // The loop counter.\n\n var k; // The member key.\n\n var v; // The member value.\n\n var length;\n var mind = gap;\n var partial;\n var value = holder[key]; // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n } // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n } // What happens next depends on the value's type.\n\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n // JSON numbers must be finite. Encode non-finite numbers as null.\n return isFinite(value) ? String(value) : \"null\";\n\n case \"boolean\":\n case \"null\":\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n return String(value);\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n if (!value) {\n return \"null\";\n } // Make an array to hold the partial results of stringifying this object value.\n\n\n gap += indent;\n partial = []; // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n length = value.length;\n\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n } // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n\n v = partial.length === 0 ? \"[]\" : gap ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\" : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n } // If the replacer is an array, use it to select the members to be stringified.\n\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n\n if (v) {\n partial.push(quote(k) + (gap ? \": \" : \":\") + v);\n }\n }\n }\n } else {\n // Otherwise, iterate through all of the keys in the object.\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n\n if (v) {\n partial.push(quote(k) + (gap ? \": \" : \":\") + v);\n }\n }\n }\n } // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n\n v = partial.length === 0 ? \"{}\" : gap ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\" : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n } // If the JSON object does not yet have a stringify method, give it one.\n\n\n if (typeof JSON.stringify !== \"function\") {\n meta = {\n // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n\n JSON.stringify = function (value, replacer, space) {\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n var i;\n gap = \"\";\n indent = \"\"; // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n } // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n } // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n\n rep = replacer;\n\n if (replacer && typeof replacer !== \"function\" && (typeof replacer !== \"object\" || typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n } // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n\n return str(\"\", {\n \"\": value\n });\n };\n } // If the JSON object does not yet have a parse method, give it one.\n\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = function (text, reviver) {\n // The parse method takes a text and an optional reviver function, and returns\n // a JavaScript value if the text is a valid JSON text.\n var j;\n\n function walk(holder, key) {\n // The walk method is used to recursively walk the resulting structure so\n // that modifications can be made.\n var k;\n var v;\n var value = holder[key];\n\n if (value && typeof value === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = walk(value, k);\n\n if (v !== undefined) {\n value[k] = v;\n } else {\n delete value[k];\n }\n }\n }\n }\n\n return reviver.call(holder, key, value);\n } // Parsing happens in four stages. In the first stage, we replace certain\n // Unicode characters with escape sequences. JavaScript handles many characters\n // incorrectly, either silently deleting them, or treating them as line endings.\n\n\n text = String(text);\n rx_dangerous.lastIndex = 0;\n\n if (rx_dangerous.test(text)) {\n text = text.replace(rx_dangerous, function (a) {\n return \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n });\n } // In the second stage, we run the text against regular expressions that look\n // for non-JSON patterns. We are especially concerned with \"()\" and \"new\"\n // because they can cause invocation, and \"=\" because it can cause mutation.\n // But just to be safe, we want to reject all unexpected forms.\n // We split the second stage into 4 regexp operations in order to work around\n // crippling inefficiencies in IE's and Safari's regexp engines. First we\n // replace the JSON backslash pairs with \"@\" (a non-JSON character). Second, we\n // replace all simple value tokens with \"]\" characters. Third, we delete all\n // open brackets that follow a colon or comma or that begin the text. Finally,\n // we look to see that the remaining characters are only whitespace or \"]\" or\n // \",\" or \":\" or \"{\" or \"}\". If that is so, then the text is safe for eval.\n\n\n if (rx_one.test(text.replace(rx_two, \"@\").replace(rx_three, \"]\").replace(rx_four, \"\"))) {\n // In the third stage we use the eval function to compile the text into a\n // JavaScript structure. The \"{\" operator is subject to a syntactic ambiguity\n // in JavaScript: it can begin a block or an object literal. We wrap the text\n // in parens to eliminate the ambiguity.\n j = eval(\"(\" + text + \")\"); // In the optional fourth stage, we recursively walk the new structure, passing\n // each name/value pair to a reviver function for possible transformation.\n\n return typeof reviver === \"function\" ? walk({\n \"\": j\n }, \"\") : j;\n } // If the text is not JSON parseable, then a SyntaxError is thrown.\n\n\n throw new SyntaxError(\"JSON.parse\");\n };\n }\n})();\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/plugins/lib/json2.js?");
|
|
434
|
+
|
|
435
|
+
/***/ }),
|
|
436
|
+
|
|
437
|
+
/***/ "./node_modules/store/src/store-engine.js":
|
|
438
|
+
/*!************************************************!*\
|
|
439
|
+
!*** ./node_modules/store/src/store-engine.js ***!
|
|
440
|
+
\************************************************/
|
|
441
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
442
|
+
|
|
443
|
+
eval("var util = __webpack_require__(/*! ./util */ \"./node_modules/store/src/util.js\");\n\nvar slice = util.slice;\nvar pluck = util.pluck;\nvar each = util.each;\nvar bind = util.bind;\nvar create = util.create;\nvar isList = util.isList;\nvar isFunction = util.isFunction;\nvar isObject = util.isObject;\nmodule.exports = {\n createStore: createStore\n};\nvar storeAPI = {\n version: '2.0.12',\n enabled: false,\n // get returns the value of the given key. If that value\n // is undefined, it returns optionalDefaultValue instead.\n get: function (key, optionalDefaultValue) {\n var data = this.storage.read(this._namespacePrefix + key);\n return this._deserialize(data, optionalDefaultValue);\n },\n // set will store the given value at key and returns value.\n // Calling set with value === undefined is equivalent to calling remove.\n set: function (key, value) {\n if (value === undefined) {\n return this.remove(key);\n }\n\n this.storage.write(this._namespacePrefix + key, this._serialize(value));\n return value;\n },\n // remove deletes the key and value stored at the given key.\n remove: function (key) {\n this.storage.remove(this._namespacePrefix + key);\n },\n // each will call the given callback once for each key-value pair\n // in this store.\n each: function (callback) {\n var self = this;\n this.storage.each(function (val, namespacedKey) {\n callback.call(self, self._deserialize(val), (namespacedKey || '').replace(self._namespaceRegexp, ''));\n });\n },\n // clearAll will remove all the stored key-value pairs in this store.\n clearAll: function () {\n this.storage.clearAll();\n },\n // additional functionality that can't live in plugins\n // ---------------------------------------------------\n // hasNamespace returns true if this store instance has the given namespace.\n hasNamespace: function (namespace) {\n return this._namespacePrefix == '__storejs_' + namespace + '_';\n },\n // createStore creates a store.js instance with the first\n // functioning storage in the list of storage candidates,\n // and applies the the given mixins to the instance.\n createStore: function () {\n return createStore.apply(this, arguments);\n },\n addPlugin: function (plugin) {\n this._addPlugin(plugin);\n },\n namespace: function (namespace) {\n return createStore(this.storage, this.plugins, namespace);\n }\n};\n\nfunction _warn() {\n var _console = typeof console == 'undefined' ? null : console;\n\n if (!_console) {\n return;\n }\n\n var fn = _console.warn ? _console.warn : _console.log;\n fn.apply(_console, arguments);\n}\n\nfunction createStore(storages, plugins, namespace) {\n if (!namespace) {\n namespace = '';\n }\n\n if (storages && !isList(storages)) {\n storages = [storages];\n }\n\n if (plugins && !isList(plugins)) {\n plugins = [plugins];\n }\n\n var namespacePrefix = namespace ? '__storejs_' + namespace + '_' : '';\n var namespaceRegexp = namespace ? new RegExp('^' + namespacePrefix) : null;\n var legalNamespaces = /^[a-zA-Z0-9_\\-]*$/; // alpha-numeric + underscore and dash\n\n if (!legalNamespaces.test(namespace)) {\n throw new Error('store.js namespaces can only have alphanumerics + underscores and dashes');\n }\n\n var _privateStoreProps = {\n _namespacePrefix: namespacePrefix,\n _namespaceRegexp: namespaceRegexp,\n _testStorage: function (storage) {\n try {\n var testStr = '__storejs__test__';\n storage.write(testStr, testStr);\n var ok = storage.read(testStr) === testStr;\n storage.remove(testStr);\n return ok;\n } catch (e) {\n return false;\n }\n },\n _assignPluginFnProp: function (pluginFnProp, propName) {\n var oldFn = this[propName];\n\n this[propName] = function pluginFn() {\n var args = slice(arguments, 0);\n var self = this; // super_fn calls the old function which was overwritten by\n // this mixin.\n\n function super_fn() {\n if (!oldFn) {\n return;\n }\n\n each(arguments, function (arg, i) {\n args[i] = arg;\n });\n return oldFn.apply(self, args);\n } // Give mixing function access to super_fn by prefixing all mixin function\n // arguments with super_fn.\n\n\n var newFnArgs = [super_fn].concat(args);\n return pluginFnProp.apply(self, newFnArgs);\n };\n },\n _serialize: function (obj) {\n return JSON.stringify(obj);\n },\n _deserialize: function (strVal, defaultVal) {\n if (!strVal) {\n return defaultVal;\n } // It is possible that a raw string value has been previously stored\n // in a storage without using store.js, meaning it will be a raw\n // string value instead of a JSON serialized string. By defaulting\n // to the raw string value in case of a JSON parse error, we allow\n // for past stored values to be forwards-compatible with store.js\n\n\n var val = '';\n\n try {\n val = JSON.parse(strVal);\n } catch (e) {\n val = strVal;\n }\n\n return val !== undefined ? val : defaultVal;\n },\n _addStorage: function (storage) {\n if (this.enabled) {\n return;\n }\n\n if (this._testStorage(storage)) {\n this.storage = storage;\n this.enabled = true;\n }\n },\n _addPlugin: function (plugin) {\n var self = this; // If the plugin is an array, then add all plugins in the array.\n // This allows for a plugin to depend on other plugins.\n\n if (isList(plugin)) {\n each(plugin, function (plugin) {\n self._addPlugin(plugin);\n });\n return;\n } // Keep track of all plugins we've seen so far, so that we\n // don't add any of them twice.\n\n\n var seenPlugin = pluck(this.plugins, function (seenPlugin) {\n return plugin === seenPlugin;\n });\n\n if (seenPlugin) {\n return;\n }\n\n this.plugins.push(plugin); // Check that the plugin is properly formed\n\n if (!isFunction(plugin)) {\n throw new Error('Plugins must be function values that return objects');\n }\n\n var pluginProperties = plugin.call(this);\n\n if (!isObject(pluginProperties)) {\n throw new Error('Plugins must return an object of function properties');\n } // Add the plugin function properties to this store instance.\n\n\n each(pluginProperties, function (pluginFnProp, propName) {\n if (!isFunction(pluginFnProp)) {\n throw new Error('Bad plugin property: ' + propName + ' from plugin ' + plugin.name + '. Plugins should only return functions.');\n }\n\n self._assignPluginFnProp(pluginFnProp, propName);\n });\n },\n // Put deprecated properties in the private API, so as to not expose it to accidential\n // discovery through inspection of the store object.\n // Deprecated: addStorage\n addStorage: function (storage) {\n _warn('store.addStorage(storage) is deprecated. Use createStore([storages])');\n\n this._addStorage(storage);\n }\n };\n var store = create(_privateStoreProps, storeAPI, {\n plugins: []\n });\n store.raw = {};\n each(store, function (prop, propName) {\n if (isFunction(prop)) {\n store.raw[propName] = bind(store, prop);\n }\n });\n each(storages, function (storage) {\n store._addStorage(storage);\n });\n each(plugins, function (plugin) {\n store._addPlugin(plugin);\n });\n return store;\n}\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/src/store-engine.js?");
|
|
444
|
+
|
|
445
|
+
/***/ }),
|
|
446
|
+
|
|
447
|
+
/***/ "./node_modules/store/src/util.js":
|
|
448
|
+
/*!****************************************!*\
|
|
449
|
+
!*** ./node_modules/store/src/util.js ***!
|
|
450
|
+
\****************************************/
|
|
451
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
452
|
+
|
|
453
|
+
eval("var assign = make_assign();\nvar create = make_create();\nvar trim = make_trim();\nvar Global = typeof window !== 'undefined' ? window : __webpack_require__.g;\nmodule.exports = {\n assign: assign,\n create: create,\n trim: trim,\n bind: bind,\n slice: slice,\n each: each,\n map: map,\n pluck: pluck,\n isList: isList,\n isFunction: isFunction,\n isObject: isObject,\n Global: Global\n};\n\nfunction make_assign() {\n if (Object.assign) {\n return Object.assign;\n } else {\n return function shimAssign(obj, props1, props2, etc) {\n for (var i = 1; i < arguments.length; i++) {\n each(Object(arguments[i]), function (val, key) {\n obj[key] = val;\n });\n }\n\n return obj;\n };\n }\n}\n\nfunction make_create() {\n if (Object.create) {\n return function create(obj, assignProps1, assignProps2, etc) {\n var assignArgsList = slice(arguments, 1);\n return assign.apply(this, [Object.create(obj)].concat(assignArgsList));\n };\n } else {\n function F() {} // eslint-disable-line no-inner-declarations\n\n\n return function create(obj, assignProps1, assignProps2, etc) {\n var assignArgsList = slice(arguments, 1);\n F.prototype = obj;\n return assign.apply(this, [new F()].concat(assignArgsList));\n };\n }\n}\n\nfunction make_trim() {\n if (String.prototype.trim) {\n return function trim(str) {\n return String.prototype.trim.call(str);\n };\n } else {\n return function trim(str) {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n };\n }\n}\n\nfunction bind(obj, fn) {\n return function () {\n return fn.apply(obj, Array.prototype.slice.call(arguments, 0));\n };\n}\n\nfunction slice(arr, index) {\n return Array.prototype.slice.call(arr, index || 0);\n}\n\nfunction each(obj, fn) {\n pluck(obj, function (val, key) {\n fn(val, key);\n return false;\n });\n}\n\nfunction map(obj, fn) {\n var res = isList(obj) ? [] : {};\n pluck(obj, function (v, k) {\n res[k] = fn(v, k);\n return false;\n });\n return res;\n}\n\nfunction pluck(obj, fn) {\n if (isList(obj)) {\n for (var i = 0; i < obj.length; i++) {\n if (fn(obj[i], i)) {\n return obj[i];\n }\n }\n } else {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n if (fn(obj[key], key)) {\n return obj[key];\n }\n }\n }\n }\n}\n\nfunction isList(val) {\n return val != null && typeof val != 'function' && typeof val.length == 'number';\n}\n\nfunction isFunction(val) {\n return val && {}.toString.call(val) === '[object Function]';\n}\n\nfunction isObject(val) {\n return val && {}.toString.call(val) === '[object Object]';\n}\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/src/util.js?");
|
|
454
|
+
|
|
455
|
+
/***/ }),
|
|
456
|
+
|
|
457
|
+
/***/ "./node_modules/store/storages/all.js":
|
|
458
|
+
/*!********************************************!*\
|
|
459
|
+
!*** ./node_modules/store/storages/all.js ***!
|
|
460
|
+
\********************************************/
|
|
461
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
462
|
+
|
|
463
|
+
eval("module.exports = [// Listed in order of usage preference\n__webpack_require__(/*! ./localStorage */ \"./node_modules/store/storages/localStorage.js\"), __webpack_require__(/*! ./oldFF-globalStorage */ \"./node_modules/store/storages/oldFF-globalStorage.js\"), __webpack_require__(/*! ./oldIE-userDataStorage */ \"./node_modules/store/storages/oldIE-userDataStorage.js\"), __webpack_require__(/*! ./cookieStorage */ \"./node_modules/store/storages/cookieStorage.js\"), __webpack_require__(/*! ./sessionStorage */ \"./node_modules/store/storages/sessionStorage.js\"), __webpack_require__(/*! ./memoryStorage */ \"./node_modules/store/storages/memoryStorage.js\")];\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/storages/all.js?");
|
|
464
|
+
|
|
465
|
+
/***/ }),
|
|
466
|
+
|
|
467
|
+
/***/ "./node_modules/store/storages/cookieStorage.js":
|
|
468
|
+
/*!******************************************************!*\
|
|
469
|
+
!*** ./node_modules/store/storages/cookieStorage.js ***!
|
|
470
|
+
\******************************************************/
|
|
471
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
472
|
+
|
|
473
|
+
eval("// cookieStorage is useful Safari private browser mode, where localStorage\n// doesn't work but cookies do. This implementation is adopted from\n// https://developer.mozilla.org/en-US/docs/Web/API/Storage/LocalStorage\nvar util = __webpack_require__(/*! ../src/util */ \"./node_modules/store/src/util.js\");\n\nvar Global = util.Global;\nvar trim = util.trim;\nmodule.exports = {\n name: 'cookieStorage',\n read: read,\n write: write,\n each: each,\n remove: remove,\n clearAll: clearAll\n};\nvar doc = Global.document;\n\nfunction read(key) {\n if (!key || !_has(key)) {\n return null;\n }\n\n var regexpStr = \"(?:^|.*;\\\\s*)\" + escape(key).replace(/[\\-\\.\\+\\*]/g, \"\\\\$&\") + \"\\\\s*\\\\=\\\\s*((?:[^;](?!;))*[^;]?).*\";\n return unescape(doc.cookie.replace(new RegExp(regexpStr), \"$1\"));\n}\n\nfunction each(callback) {\n var cookies = doc.cookie.split(/; ?/g);\n\n for (var i = cookies.length - 1; i >= 0; i--) {\n if (!trim(cookies[i])) {\n continue;\n }\n\n var kvp = cookies[i].split('=');\n var key = unescape(kvp[0]);\n var val = unescape(kvp[1]);\n callback(val, key);\n }\n}\n\nfunction write(key, data) {\n if (!key) {\n return;\n }\n\n doc.cookie = escape(key) + \"=\" + escape(data) + \"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/\";\n}\n\nfunction remove(key) {\n if (!key || !_has(key)) {\n return;\n }\n\n doc.cookie = escape(key) + \"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/\";\n}\n\nfunction clearAll() {\n each(function (_, key) {\n remove(key);\n });\n}\n\nfunction _has(key) {\n return new RegExp(\"(?:^|;\\\\s*)\" + escape(key).replace(/[\\-\\.\\+\\*]/g, \"\\\\$&\") + \"\\\\s*\\\\=\").test(doc.cookie);\n}\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/storages/cookieStorage.js?");
|
|
474
|
+
|
|
475
|
+
/***/ }),
|
|
476
|
+
|
|
477
|
+
/***/ "./node_modules/store/storages/localStorage.js":
|
|
478
|
+
/*!*****************************************************!*\
|
|
479
|
+
!*** ./node_modules/store/storages/localStorage.js ***!
|
|
480
|
+
\*****************************************************/
|
|
481
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
482
|
+
|
|
483
|
+
eval("var util = __webpack_require__(/*! ../src/util */ \"./node_modules/store/src/util.js\");\n\nvar Global = util.Global;\nmodule.exports = {\n name: 'localStorage',\n read: read,\n write: write,\n each: each,\n remove: remove,\n clearAll: clearAll\n};\n\nfunction localStorage() {\n return Global.localStorage;\n}\n\nfunction read(key) {\n return localStorage().getItem(key);\n}\n\nfunction write(key, data) {\n return localStorage().setItem(key, data);\n}\n\nfunction each(fn) {\n for (var i = localStorage().length - 1; i >= 0; i--) {\n var key = localStorage().key(i);\n fn(read(key), key);\n }\n}\n\nfunction remove(key) {\n return localStorage().removeItem(key);\n}\n\nfunction clearAll() {\n return localStorage().clear();\n}\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/storages/localStorage.js?");
|
|
484
|
+
|
|
485
|
+
/***/ }),
|
|
486
|
+
|
|
487
|
+
/***/ "./node_modules/store/storages/memoryStorage.js":
|
|
488
|
+
/*!******************************************************!*\
|
|
489
|
+
!*** ./node_modules/store/storages/memoryStorage.js ***!
|
|
490
|
+
\******************************************************/
|
|
491
|
+
/***/ ((module) => {
|
|
492
|
+
|
|
493
|
+
eval("// memoryStorage is a useful last fallback to ensure that the store\n// is functions (meaning store.get(), store.set(), etc will all function).\n// However, stored values will not persist when the browser navigates to\n// a new page or reloads the current page.\nmodule.exports = {\n name: 'memoryStorage',\n read: read,\n write: write,\n each: each,\n remove: remove,\n clearAll: clearAll\n};\nvar memoryStorage = {};\n\nfunction read(key) {\n return memoryStorage[key];\n}\n\nfunction write(key, data) {\n memoryStorage[key] = data;\n}\n\nfunction each(callback) {\n for (var key in memoryStorage) {\n if (memoryStorage.hasOwnProperty(key)) {\n callback(memoryStorage[key], key);\n }\n }\n}\n\nfunction remove(key) {\n delete memoryStorage[key];\n}\n\nfunction clearAll(key) {\n memoryStorage = {};\n}\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/storages/memoryStorage.js?");
|
|
494
|
+
|
|
495
|
+
/***/ }),
|
|
496
|
+
|
|
497
|
+
/***/ "./node_modules/store/storages/oldFF-globalStorage.js":
|
|
498
|
+
/*!************************************************************!*\
|
|
499
|
+
!*** ./node_modules/store/storages/oldFF-globalStorage.js ***!
|
|
500
|
+
\************************************************************/
|
|
501
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
502
|
+
|
|
503
|
+
eval("// oldFF-globalStorage provides storage for Firefox\n// versions 6 and 7, where no localStorage, etc\n// is available.\nvar util = __webpack_require__(/*! ../src/util */ \"./node_modules/store/src/util.js\");\n\nvar Global = util.Global;\nmodule.exports = {\n name: 'oldFF-globalStorage',\n read: read,\n write: write,\n each: each,\n remove: remove,\n clearAll: clearAll\n};\nvar globalStorage = Global.globalStorage;\n\nfunction read(key) {\n return globalStorage[key];\n}\n\nfunction write(key, data) {\n globalStorage[key] = data;\n}\n\nfunction each(fn) {\n for (var i = globalStorage.length - 1; i >= 0; i--) {\n var key = globalStorage.key(i);\n fn(globalStorage[key], key);\n }\n}\n\nfunction remove(key) {\n return globalStorage.removeItem(key);\n}\n\nfunction clearAll() {\n each(function (key, _) {\n delete globalStorage[key];\n });\n}\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/storages/oldFF-globalStorage.js?");
|
|
504
|
+
|
|
505
|
+
/***/ }),
|
|
506
|
+
|
|
507
|
+
/***/ "./node_modules/store/storages/oldIE-userDataStorage.js":
|
|
508
|
+
/*!**************************************************************!*\
|
|
509
|
+
!*** ./node_modules/store/storages/oldIE-userDataStorage.js ***!
|
|
510
|
+
\**************************************************************/
|
|
511
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
512
|
+
|
|
513
|
+
eval("// oldIE-userDataStorage provides storage for Internet Explorer\n// versions 6 and 7, where no localStorage, sessionStorage, etc\n// is available.\nvar util = __webpack_require__(/*! ../src/util */ \"./node_modules/store/src/util.js\");\n\nvar Global = util.Global;\nmodule.exports = {\n name: 'oldIE-userDataStorage',\n write: write,\n read: read,\n each: each,\n remove: remove,\n clearAll: clearAll\n};\nvar storageName = 'storejs';\nvar doc = Global.document;\n\nvar _withStorageEl = _makeIEStorageElFunction();\n\nvar disable = (Global.navigator ? Global.navigator.userAgent : '').match(/ (MSIE 8|MSIE 9|MSIE 10)\\./); // MSIE 9.x, MSIE 10.x\n\nfunction write(unfixedKey, data) {\n if (disable) {\n return;\n }\n\n var fixedKey = fixKey(unfixedKey);\n\n _withStorageEl(function (storageEl) {\n storageEl.setAttribute(fixedKey, data);\n storageEl.save(storageName);\n });\n}\n\nfunction read(unfixedKey) {\n if (disable) {\n return;\n }\n\n var fixedKey = fixKey(unfixedKey);\n var res = null;\n\n _withStorageEl(function (storageEl) {\n res = storageEl.getAttribute(fixedKey);\n });\n\n return res;\n}\n\nfunction each(callback) {\n _withStorageEl(function (storageEl) {\n var attributes = storageEl.XMLDocument.documentElement.attributes;\n\n for (var i = attributes.length - 1; i >= 0; i--) {\n var attr = attributes[i];\n callback(storageEl.getAttribute(attr.name), attr.name);\n }\n });\n}\n\nfunction remove(unfixedKey) {\n var fixedKey = fixKey(unfixedKey);\n\n _withStorageEl(function (storageEl) {\n storageEl.removeAttribute(fixedKey);\n storageEl.save(storageName);\n });\n}\n\nfunction clearAll() {\n _withStorageEl(function (storageEl) {\n var attributes = storageEl.XMLDocument.documentElement.attributes;\n storageEl.load(storageName);\n\n for (var i = attributes.length - 1; i >= 0; i--) {\n storageEl.removeAttribute(attributes[i].name);\n }\n\n storageEl.save(storageName);\n });\n} // Helpers\n//////////\n// In IE7, keys cannot start with a digit or contain certain chars.\n// See https://github.com/marcuswestin/store.js/issues/40\n// See https://github.com/marcuswestin/store.js/issues/83\n\n\nvar forbiddenCharsRegex = new RegExp(\"[!\\\"#$%&'()*+,/\\\\\\\\:;<=>?@[\\\\]^`{|}~]\", \"g\");\n\nfunction fixKey(key) {\n return key.replace(/^\\d/, '___$&').replace(forbiddenCharsRegex, '___');\n}\n\nfunction _makeIEStorageElFunction() {\n if (!doc || !doc.documentElement || !doc.documentElement.addBehavior) {\n return null;\n }\n\n var scriptTag = 'script',\n storageOwner,\n storageContainer,\n storageEl; // Since #userData storage applies only to specific paths, we need to\n // somehow link our data to a specific path. We choose /favicon.ico\n // as a pretty safe option, since all browsers already make a request to\n // this URL anyway and being a 404 will not hurt us here. We wrap an\n // iframe pointing to the favicon in an ActiveXObject(htmlfile) object\n // (see: http://msdn.microsoft.com/en-us/library/aa752574(v=VS.85).aspx)\n // since the iframe access rules appear to allow direct access and\n // manipulation of the document element, even for a 404 page. This\n // document can be used instead of the current document (which would\n // have been limited to the current path) to perform #userData storage.\n\n try {\n /* global ActiveXObject */\n storageContainer = new ActiveXObject('htmlfile');\n storageContainer.open();\n storageContainer.write('<' + scriptTag + '>document.w=window</' + scriptTag + '><iframe src=\"/favicon.ico\"></iframe>');\n storageContainer.close();\n storageOwner = storageContainer.w.frames[0].document;\n storageEl = storageOwner.createElement('div');\n } catch (e) {\n // somehow ActiveXObject instantiation failed (perhaps some special\n // security settings or otherwse), fall back to per-path storage\n storageEl = doc.createElement('div');\n storageOwner = doc.body;\n }\n\n return function (storeFunction) {\n var args = [].slice.call(arguments, 0);\n args.unshift(storageEl); // See http://msdn.microsoft.com/en-us/library/ms531081(v=VS.85).aspx\n // and http://msdn.microsoft.com/en-us/library/ms531424(v=VS.85).aspx\n\n storageOwner.appendChild(storageEl);\n storageEl.addBehavior('#default#userData');\n storageEl.load(storageName);\n storeFunction.apply(this, args);\n storageOwner.removeChild(storageEl);\n return;\n };\n}\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/storages/oldIE-userDataStorage.js?");
|
|
514
|
+
|
|
515
|
+
/***/ }),
|
|
516
|
+
|
|
517
|
+
/***/ "./node_modules/store/storages/sessionStorage.js":
|
|
518
|
+
/*!*******************************************************!*\
|
|
519
|
+
!*** ./node_modules/store/storages/sessionStorage.js ***!
|
|
520
|
+
\*******************************************************/
|
|
521
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
522
|
+
|
|
523
|
+
eval("var util = __webpack_require__(/*! ../src/util */ \"./node_modules/store/src/util.js\");\n\nvar Global = util.Global;\nmodule.exports = {\n name: 'sessionStorage',\n read: read,\n write: write,\n each: each,\n remove: remove,\n clearAll: clearAll\n};\n\nfunction sessionStorage() {\n return Global.sessionStorage;\n}\n\nfunction read(key) {\n return sessionStorage().getItem(key);\n}\n\nfunction write(key, data) {\n return sessionStorage().setItem(key, data);\n}\n\nfunction each(fn) {\n for (var i = sessionStorage().length - 1; i >= 0; i--) {\n var key = sessionStorage().key(i);\n fn(read(key), key);\n }\n}\n\nfunction remove(key) {\n return sessionStorage().removeItem(key);\n}\n\nfunction clearAll() {\n return sessionStorage().clear();\n}\n\n//# sourceURL=webpack://@salla.sa/twilight/./node_modules/store/storages/sessionStorage.js?");
|
|
524
|
+
|
|
525
|
+
/***/ }),
|
|
526
|
+
|
|
527
|
+
/***/ "./twilight/Aliases/auth.js":
|
|
528
|
+
/*!**********************************!*\
|
|
529
|
+
!*** ./twilight/Aliases/auth.js ***!
|
|
530
|
+
\**********************************/
|
|
531
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
532
|
+
|
|
533
|
+
"use strict";
|
|
534
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Auth extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Auth);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/auth.js?");
|
|
535
|
+
|
|
536
|
+
/***/ }),
|
|
537
|
+
|
|
538
|
+
/***/ "./twilight/Aliases/baseAlias.js":
|
|
539
|
+
/*!***************************************!*\
|
|
540
|
+
!*** ./twilight/Aliases/baseAlias.js ***!
|
|
541
|
+
\***************************************/
|
|
542
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
543
|
+
|
|
544
|
+
"use strict";
|
|
545
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * This Class Is an alias for\n * salla.cart.api => salla.api.cart\n * salla.cart.event => salla.event.cart\n *\n * @property {BaseApi} api\n * @property {BaseEvent} event\n **/\nclass BaseAlias {\n constructor(api, event) {\n this.api = api;\n this.event = event;\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseAlias);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/baseAlias.js?");
|
|
546
|
+
|
|
547
|
+
/***/ }),
|
|
548
|
+
|
|
549
|
+
/***/ "./twilight/Aliases/cart.js":
|
|
550
|
+
/*!**********************************!*\
|
|
551
|
+
!*** ./twilight/Aliases/cart.js ***!
|
|
552
|
+
\**********************************/
|
|
553
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
554
|
+
|
|
555
|
+
"use strict";
|
|
556
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n/**\n * This Class Is Close to be an alias for\n * salla.cart.api => salla.api.cart\n * salla.cart.event => salla.event.cart\n *\n * plus other small things like elements.\n * @property {{badge: Element, total: Element}} elements\n */\n\nclass Cart extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(api, event) {\n super(api, event);\n this.total = this.getElement('total');\n this.badge = this.getElement('badge');\n }\n\n getElement(selector) {\n return document.querySelector('[data-cart-' + selector + ']');\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Cart);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/cart.js?");
|
|
557
|
+
|
|
558
|
+
/***/ }),
|
|
559
|
+
|
|
560
|
+
/***/ "./twilight/Aliases/comment.js":
|
|
561
|
+
/*!*************************************!*\
|
|
562
|
+
!*** ./twilight/Aliases/comment.js ***!
|
|
563
|
+
\*************************************/
|
|
564
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
565
|
+
|
|
566
|
+
"use strict";
|
|
567
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Comment extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Comment);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/comment.js?");
|
|
568
|
+
|
|
569
|
+
/***/ }),
|
|
570
|
+
|
|
571
|
+
/***/ "./twilight/Aliases/coupon.js":
|
|
572
|
+
/*!************************************!*\
|
|
573
|
+
!*** ./twilight/Aliases/coupon.js ***!
|
|
574
|
+
\************************************/
|
|
575
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
576
|
+
|
|
577
|
+
"use strict";
|
|
578
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Coupon extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Coupon);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/coupon.js?");
|
|
579
|
+
|
|
580
|
+
/***/ }),
|
|
581
|
+
|
|
582
|
+
/***/ "./twilight/Aliases/currency.js":
|
|
583
|
+
/*!**************************************!*\
|
|
584
|
+
!*** ./twilight/Aliases/currency.js ***!
|
|
585
|
+
\**************************************/
|
|
586
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
587
|
+
|
|
588
|
+
"use strict";
|
|
589
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Currency extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Currency);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/currency.js?");
|
|
590
|
+
|
|
591
|
+
/***/ }),
|
|
592
|
+
|
|
593
|
+
/***/ "./twilight/Aliases/document.js":
|
|
594
|
+
/*!**************************************!*\
|
|
595
|
+
!*** ./twilight/Aliases/document.js ***!
|
|
596
|
+
\**************************************/
|
|
597
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
598
|
+
|
|
599
|
+
"use strict";
|
|
600
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Document extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Document);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/document.js?");
|
|
601
|
+
|
|
602
|
+
/***/ }),
|
|
603
|
+
|
|
604
|
+
/***/ "./twilight/Aliases/feedback.js":
|
|
605
|
+
/*!**************************************!*\
|
|
606
|
+
!*** ./twilight/Aliases/feedback.js ***!
|
|
607
|
+
\**************************************/
|
|
608
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
609
|
+
|
|
610
|
+
"use strict";
|
|
611
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Feedback extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Feedback);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/feedback.js?");
|
|
612
|
+
|
|
613
|
+
/***/ }),
|
|
614
|
+
|
|
615
|
+
/***/ "./twilight/Aliases/gift.js":
|
|
616
|
+
/*!**********************************!*\
|
|
617
|
+
!*** ./twilight/Aliases/gift.js ***!
|
|
618
|
+
\**********************************/
|
|
619
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
620
|
+
|
|
621
|
+
"use strict";
|
|
622
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Gift extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Gift);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/gift.js?");
|
|
623
|
+
|
|
624
|
+
/***/ }),
|
|
625
|
+
|
|
626
|
+
/***/ "./twilight/Aliases/infiniteScroll.js":
|
|
627
|
+
/*!********************************************!*\
|
|
628
|
+
!*** ./twilight/Aliases/infiniteScroll.js ***!
|
|
629
|
+
\********************************************/
|
|
630
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
631
|
+
|
|
632
|
+
"use strict";
|
|
633
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n/* harmony import */ var infinite_scroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! infinite-scroll */ \"./node_modules/infinite-scroll/js/index.js\");\n/* harmony import */ var infinite_scroll__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(infinite_scroll__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\nclass InfiniteScroll extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(api, event) {\n super(api, event);\n this.options = {\n path: '.pagination__next',\n history: 'push',\n status: \".loader-status\",\n append: \".product-block\"\n };\n this.fetchOptions = {\n headers: {\n 'S-INFINITE-SCROLL': true\n }\n };\n this.instances = [];\n }\n /**\n * @param {string|Element} selector\n * @param {Object|string} [append=\".product-block\"] - if it's object will consider it as options\n * @param {Object|string} [customOptions=this.options]\n * @return {undefined|TheInfinitScroll}\n */\n\n\n initiate(selector, append, customOptions) {\n customOptions = this.getCustomOptions(append, customOptions);\n\n if (!this.canSetup(selector, customOptions)) {\n //salla.log('Path Option (a link that has next page link) Not Setted');\n return undefined;\n } //load more button\n\n\n customOptions.button = customOptions.path;\n let infScroll = new (infinite_scroll__WEBPACK_IMPORTED_MODULE_1___default())(selector, customOptions); // also events can be accessed directly via:\n // salla.infiniteScroll.initiate(...).on('load', func);\n\n infScroll.on('scrollThreshold', salla.infiniteScroll.event.scrollThreshold);\n infScroll.on('request', salla.infiniteScroll.event.request);\n infScroll.on('load', salla.infiniteScroll.event.load);\n infScroll.on('append', salla.infiniteScroll.event.append);\n infScroll.on('error', salla.infiniteScroll.event.error);\n infScroll.on('last', salla.infiniteScroll.event.last);\n infScroll.on('history', salla.infiniteScroll.event.history);\n this.instances.push(infScroll);\n return infScroll;\n }\n /**\n * Make Sure that all elements are existed.\n */\n\n\n canSetup(selector, customOptions) {\n return (typeof selector != 'string' || document.querySelector(selector)) && customOptions.path && (typeof customOptions.path != 'string' || document.querySelector(customOptions.path));\n }\n\n getCustomOptions(append, customOptions) {\n //if append is passed as object means it's customOptions\n customOptions = (typeof append == 'object' ? append : false) || customOptions || this.options;\n customOptions.fetchOptions = this.fetchOptions; //if customOptions passed without path.\n\n customOptions.path = customOptions.path || this.options.path;\n customOptions.status = customOptions.status || this.options.status; //if customOptions passed without history.\n\n if (!customOptions.hasOwnProperty('history')) {\n customOptions.history = this.options.history;\n }\n\n customOptions.append = (typeof append == 'string' ? append : false) || customOptions.append || this.options.append;\n return customOptions;\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InfiniteScroll);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/infiniteScroll.js?");
|
|
634
|
+
|
|
635
|
+
/***/ }),
|
|
636
|
+
|
|
637
|
+
/***/ "./twilight/Aliases/loyalty.js":
|
|
638
|
+
/*!*************************************!*\
|
|
639
|
+
!*** ./twilight/Aliases/loyalty.js ***!
|
|
640
|
+
\*************************************/
|
|
641
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
642
|
+
|
|
643
|
+
"use strict";
|
|
644
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Loyalty extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Loyalty);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/loyalty.js?");
|
|
645
|
+
|
|
646
|
+
/***/ }),
|
|
647
|
+
|
|
648
|
+
/***/ "./twilight/Aliases/offer.js":
|
|
649
|
+
/*!***********************************!*\
|
|
650
|
+
!*** ./twilight/Aliases/offer.js ***!
|
|
651
|
+
\***********************************/
|
|
652
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
653
|
+
|
|
654
|
+
"use strict";
|
|
655
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Offer extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Offer);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/offer.js?");
|
|
656
|
+
|
|
657
|
+
/***/ }),
|
|
658
|
+
|
|
659
|
+
/***/ "./twilight/Aliases/order.js":
|
|
660
|
+
/*!***********************************!*\
|
|
661
|
+
!*** ./twilight/Aliases/order.js ***!
|
|
662
|
+
\***********************************/
|
|
663
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
664
|
+
|
|
665
|
+
"use strict";
|
|
666
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Order extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Order);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/order.js?");
|
|
667
|
+
|
|
668
|
+
/***/ }),
|
|
669
|
+
|
|
670
|
+
/***/ "./twilight/Aliases/product.js":
|
|
671
|
+
/*!*************************************!*\
|
|
672
|
+
!*** ./twilight/Aliases/product.js ***!
|
|
673
|
+
\*************************************/
|
|
674
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
675
|
+
|
|
676
|
+
"use strict";
|
|
677
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Product extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Product);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/product.js?");
|
|
678
|
+
|
|
679
|
+
/***/ }),
|
|
680
|
+
|
|
681
|
+
/***/ "./twilight/Aliases/search.js":
|
|
682
|
+
/*!************************************!*\
|
|
683
|
+
!*** ./twilight/Aliases/search.js ***!
|
|
684
|
+
\************************************/
|
|
685
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
686
|
+
|
|
687
|
+
"use strict";
|
|
688
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Search extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Search);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/search.js?");
|
|
689
|
+
|
|
690
|
+
/***/ }),
|
|
691
|
+
|
|
692
|
+
/***/ "./twilight/Aliases/wishlist.js":
|
|
693
|
+
/*!**************************************!*\
|
|
694
|
+
!*** ./twilight/Aliases/wishlist.js ***!
|
|
695
|
+
\**************************************/
|
|
696
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
697
|
+
|
|
698
|
+
"use strict";
|
|
699
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseAlias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseAlias */ \"./twilight/Aliases/baseAlias.js\");\n\n\nclass Wishlist extends _baseAlias__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Wishlist);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/Aliases/wishlist.js?");
|
|
700
|
+
|
|
701
|
+
/***/ }),
|
|
702
|
+
|
|
703
|
+
/***/ "./twilight/api/auth.js":
|
|
704
|
+
/*!******************************!*\
|
|
705
|
+
!*** ./twilight/api/auth.js ***!
|
|
706
|
+
\******************************/
|
|
707
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
708
|
+
|
|
709
|
+
"use strict";
|
|
710
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass AuthApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n login: \"auth/{type}/send_verification\",\n verify: \"auth/{type}/verify\",\n register: \"auth/register\",\n logout: \"logout\"\n };\n this.endpointsMethods = {\n logout: 'get'\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n login: 'auth::login',\n verify: 'auth::verify',\n register: 'auth::register',\n logout: 'auth::logout'\n };\n this.after_init();\n }\n /**\n * login\n *\n * @param {string|{element: Element, data: {}}} type\n * @param {object} formData\n * @return {Promise}\n */\n\n\n login(type, formData) {\n let element;\n /**\n * if type is Object, get data from it;\n * @see Object.prototype.getElementSallaData\n */\n\n if (type.data) {\n element = type.element;\n formData = type.data;\n type = this.getPossibleValue(formData, ['type']);\n }\n\n if (!type) {\n salla.auth.event.codeNotSent('Failed to know what\\'s login type!');\n return false;\n }\n\n return this.request(['login', type], formData).then(function (response) {\n salla.auth.event.codeSent.call(element, response, type);\n return response;\n }).catch(function (error) {\n salla.auth.event.codeNotSent.call(element, error, type);\n throw error;\n });\n }\n /**\n * verify\n *\n * @param {string|{element: Element, data: {}}} type\n * @param {object} formData\n * @return {Promise}\n */\n\n\n verify(type, formData) {\n /**\n * if type is Object, get data from it;\n * @see Object.prototype.getElementSallaData\n */\n if (type.data) {\n formData = type.data;\n type = this.getPossibleValue(formData, ['type']);\n }\n\n if (!type) {\n salla.auth.event.verificationFailed('Failed to know what\\'s login type!');\n return false;\n }\n\n return this.request(['verify', type], formData).then(function (response) {\n salla.auth.event.verified(response, type);\n return response;\n }).catch(function (error) {\n salla.auth.event.verificationFailed(error, type);\n throw error;\n });\n }\n /**\n * register\n * @param {object|{element: Element, data: {}}} formData\n * @return {Promise}\n */\n\n\n register(formData) {\n let element;\n /**\n * @see Object.prototype.getElementSallaData\n */\n\n if (formData.data) {\n element = formData.element;\n formData = formData.data;\n }\n\n return this.request('register', formData).then(function (response) {\n salla.auth.event.registered.call(element, response);\n return response;\n }).catch(function (error) {\n salla.auth.event.registrationFailed.call(element, error);\n throw error;\n });\n }\n\n logout() {\n return this.request('logout').then(function (response) {\n salla.auth.event.loggedOut(response);\n return response;\n }).catch(function (error) {\n salla.auth.event.failedLogout(error);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AuthApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/auth.js?");
|
|
711
|
+
|
|
712
|
+
/***/ }),
|
|
713
|
+
|
|
714
|
+
/***/ "./twilight/api/baseApi.js":
|
|
715
|
+
/*!*********************************!*\
|
|
716
|
+
!*** ./twilight/api/baseApi.js ***!
|
|
717
|
+
\*********************************/
|
|
718
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
719
|
+
|
|
720
|
+
"use strict";
|
|
721
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * @property {sallaApi|axios} parent\n * @property {string} className\n * @property {Object.<string, string>} endpoints - keep urls of endpoints\n * @property {Object.<string, string>} endpointsMethods - {deleteItem:\"delete\"}\n * @property {{request: Function|undefined, time: number, enabled: boolean, exclude: Array}} debounce - keep debounce function for this api.\n *\n *\n * @property {Object.<string, string>} hooksSelectores - keep html attributes, that will fire api methods,\n * @example connect attribute 'data-cart-add-item' with action 'cart.addItem()'\n * & get method arguments from parent form, if it's not passed via the html attribute, or pass data directly\n * @example <button data-cart-add-item=\"{prod_id:2134165, quantity:1, ...restData}\">Add</button>\n * Or\n * @example <button data-cart-add-item=\"fun_name\">Add</button>\n *\n *\n */\n\n/** @typedef {{element: Element, data: {}}} DataFromHook */\nclass BaseApi {\n /**\n * @param sallaApi parent\n */\n constructor(parent) {\n /**\n * this class is the base class for api classes like (cart, auth)\n * we will initiate it from Main Salla Api/axios,\n * So we will Pass it (Main Salla Api) as an alias to be able to call it's methods from children apis,\n *\n * 💡 All axios methods will be available via it, like \"this.parent.post()\"\n */\n this.parent = parent;\n this.endpoints = {};\n /**\n * @see Object.prototype.getElementSallaData\n * @see Object.prototype.canEventFireHook\n * @type {Object.<string, string>}\n */\n // prefix will be added dynamicly, for example 'data-'\n\n this.hooksSelectores = {};\n this.endpointsMethods = {}; //\"post\" is the default, can use other method for endpoint here.\n\n this.endpointsHeaders = {}; //pass specific headers for specific endpoints\n\n var results = /function (.{1,})\\(/.exec(this.constructor.toString());\n this.className = (results && results.length > 1 ? results[1] : \"\").toLowerCase(); //we can make api debouncable or not, or change debounce time by overriding this object with wanted values.\n\n this.debounce = {\n request: undefined,\n time: 300,\n enabled: true,\n exclude: []\n };\n }\n /**\n * should be called from child class, after preparing data, to initiate things.\n */\n\n\n after_init() {}\n /**\n * @param {string|array} url - pass [url|endpoint|array(url|endpoint, urlParam)]\n * @param {Object} formData\n * @param {string} method\n * @return {Promise}\n */\n\n\n normalRequest(endPoint, formData, method) {\n let thatApi = this;\n let isArray = Array.isArray(endPoint); //if endPoint is an array pass it using (spread operator \"three dots\"), otherwise pass normal string\n\n let endPointUrl = isArray ? this.getUrl(...endPoint) : this.getUrl(endPoint); //if there is need to use different method than post, otherwise use post;\n\n endPoint = isArray ? endPoint[0] : endPoint;\n method = method || this.endpointsMethods[endPoint] || 'post';\n let headers = this.endpointsHeaders[endPoint];\n\n if (method == 'get' && formData instanceof FormData) {\n var parameters = {};\n Array.from(formData.entries()).forEach(function (data) {\n parameters[data[0]] = data[1];\n });\n formData = {\n params: parameters\n };\n }\n\n if (headers && method == 'get') {\n formData = formData ? Object.assign(formData, headers) : headers;\n }\n\n salla.event.document.request(endPointUrl, formData, method, headers);\n return this.parent[method](endPointUrl, formData, headers).then(function (response) {\n //instead of passing all axios object, we will pass response data only\n if (response.data && response.request) {\n response = response.data;\n }\n\n thatApi.handleAfterResponseActions(response);\n return response;\n }).catch(function (error) {\n thatApi.handleErrorResponse(error);\n throw error;\n });\n }\n /**\n * @param {string|array} url - pass [url|endpoint|array(url|endpoint, urlParam)]\n * @param {Object} formData\n * @param {string} method\n * @return {Promise}\n */\n\n\n request(endPoint, formData, method) {\n if (!this.isfastRequestsAllowed() && this.debounce.enabled) {\n if (!this.debounce.request) {\n this.debounce.request = salla.helpers.debounce(this.normalRequest.bind(this), this.debounce.time);\n }\n\n return this.debounce.request(endPoint, formData, method);\n }\n\n return this.normalRequest(endPoint, formData, method);\n }\n /**\n * pass all endpoints from here to be free changing endpoints without breakchange\n * @param {string} endPoint\n * @return {string|undefined}\n */\n\n\n getUrl(endPoint) {\n let endPointUrl = this.endpoints[endPoint] || endPoint;\n /**\n * in case there is parameters need to be replaced in url, user can pass them, we will handle replacement\n * @example\n * 'test/jamal/{id1}/{another}/edit'\n * we will run throw passed arguments after argument one, then replace one by one.\n * final result will be something like\n * 'test/jamal/100/56/edit'\n */\n\n const regex = /{[^{}]+}/i;\n\n for (let i = 1; i < arguments.length; i++) {\n endPointUrl = endPointUrl.replace(regex,\n /*urlParReplacement*/\n arguments[i]);\n }\n\n return endPointUrl;\n }\n /**\n *\n * @param {Element|HTMLDocument} element\n * @param {string} attribute\n * @return {{element: Element, data: {}}}\n */\n\n\n withInjectData(element, attribute) {\n return {\n element: element,\n data: element.getElementSallaData(attribute)\n };\n }\n\n handleAfterResponseActions(response) {\n if (!response) {\n return; // salla.error('There Is no response!');\n } // lets get the data from data or from the response its self ..\n\n\n let {\n data,\n googleTags = null\n } = response;\n let withGoogleTags = data && data.googleTags ? data.googleTags : googleTags;\n\n if (dataLayer && withGoogleTags) {\n // let's get going and push it ..\n dataLayer.push(withGoogleTags);\n dataLayer.push(withGoogleTags);\n } //general handling error;\n\n\n this.randerSections(response);\n\n if (response.events || response.error && response.error.events) {\n let events = response.events || response.error.events;\n events = JSON.parse(events);\n Object.keys(events).forEach(function (event) {\n salla.event.dispatch(event, events[event]);\n });\n }\n\n this.showAlert(response); //call it at the end to avoid errors, when there is an item missed.\n\n if (response.runJavascript) {\n try {\n eval(response.runJavascript);\n } catch (e) {\n salla.log(e);\n }\n }\n }\n\n randerSections(response) {\n if (!response.sections) {\n return;\n }\n\n Object.keys(response.sections).forEach(section => {\n document.querySelectorAll(section.toSelector()).forEach(function (sectionElement) {\n sectionElement.innerHTML = response.sections[section];\n });\n });\n }\n /**\n * @param {Error} error\n */\n\n\n handleErrorResponse(error) {\n //there is no response!\n if (!error.response || !error.response.data) {\n return;\n } //if there is fields means we should handl them differently\n\n\n if (error.response.data.error && error.response.data.error.fields) {\n return this.handleInvalidFields(error);\n }\n\n return this.handleAfterResponseActions(error.response.data);\n }\n\n showAlert(response) {\n //if there is no case or there is no msg, return early\n if (!response) {\n return;\n } //success response type 1\n\n\n if (response.case && response.msg) {\n return salla.notify.fire(response.msg, response.case, response);\n } //success response type 2\n\n\n if (response.message && response.hasOwnProperty('success')) {\n return salla.notify.fire(response.message, response.success ? salla.notify.types.success : salla.notify.types.error, response);\n } //error response type 1\n\n\n if (response.error && response.error.message) {\n return salla.notify.error(response.error.message, response);\n }\n }\n\n handleInvalidFields(error) {\n //lets collect fieleds errors & show them as one error list;\n let errors = error.response.data.error.fields;\n let errorsMsgs = [];\n Object.keys(errors).forEach(errorName => {\n let errorMsg = errors[errorName];\n\n if (Array.isArray(errorMsg)) {\n errorMsg.forEach(errorMsg_ => errorsMsgs.push(errorMsg_));\n } else {\n errorsMsgs.push(errorMsg);\n }\n });\n let errorMsg = (errorsMsgs.length > 1 ? '* ' : '') + errorsMsgs.join(\"\\n* \");\n salla.error(errorMsg, error);\n }\n /**\n * @return {SearchEvent|BaseEvent|AuthEvent|CartEvent}\n */\n\n\n event() {\n return salla.event[this.className];\n }\n /**\n *\n * @param {object|FromData} formData\n * @param {Array} possibleNames\n * @param {boolean|undefined} objectable - can wanted value be object? default No.\n * @return {undefined|string|*}\n */\n\n\n getPossibleValue(formData, possibleNames, objectable) {\n if (typeof formData !== 'object') {\n return formData;\n }\n\n if (formData) {\n let wantedValue;\n\n for (let i = 0; i < possibleNames.length; i++) {\n if (wantedValue = formData[possibleNames[i]]) {\n break;\n }\n\n if (formData instanceof FormData && (wantedValue = formData.get(possibleNames[i]))) {\n break;\n }\n }\n\n wantedValue = wantedValue || formData;\n return typeof wantedValue == 'object' && !objectable ? undefined : wantedValue;\n }\n\n return undefined;\n }\n\n isfastRequestsAllowed() {\n return salla.config.fastRequests;\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/baseApi.js?");
|
|
722
|
+
|
|
723
|
+
/***/ }),
|
|
724
|
+
|
|
725
|
+
/***/ "./twilight/api/cart.js":
|
|
726
|
+
/*!******************************!*\
|
|
727
|
+
!*** ./twilight/api/cart.js ***!
|
|
728
|
+
\******************************/
|
|
729
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
730
|
+
|
|
731
|
+
"use strict";
|
|
732
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass CartApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n addItem: 'cart/item/{id}/add',\n quickAdd: 'cart/item/{id}/quick-add',\n deleteItem: 'cart/item/{id}',\n updateItem: 'cart/item/{id}',\n submit: 'cart',\n deleteFile: 'cart/image/{image_id}',\n fetchSummary: 'cart/fetch-summary'\n };\n this.endpointsMethods = {\n deleteItem: 'delete',\n updateItem: 'put',\n deleteFile: 'delete'\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n addItem: 'cart::add-item',\n quickAdd: 'cart::quick-add',\n deleteItem: 'cart::delete-item',\n updateItem: 'cart::update-item',\n submit: 'cart::submit',\n deleteFile: 'cart::delete-file'\n };\n this.after_init();\n }\n /**\n * Add item to cart\n * 💡 If Quantity not passed will use 'quickAdd' ednpoint.\n *\n * @param {int|DataFromHook|FormData|Object} prodId\n * @return {Promise<unknown>|boolean}\n */\n\n\n addItem(prodId) {\n let data = this.getCartRequestData(prodId);\n\n if (!data.id) {\n salla.cart.event.itemAddedFailed('There is no \"id\"!');\n return false;\n } //if quantity is existed, change endpoint & add quantity to formData.\n\n\n let endpoint = this.getPossibleValue(data.formData, ['quantity']) ? 'addItem' : 'quickAdd';\n return this.request([endpoint, data.id], data.formData).then(function (response) {\n salla.cart.event.itemAdded(response, data.id);\n return response;\n }).catch(function (error) {\n salla.cart.event.itemAddedFailed(error, data.id);\n throw error;\n });\n }\n /**\n * An Alias For addItem, But For QuickAdd Only.\n * @param {int} prodId\n * @return {Promise}\n */\n\n\n quickAdd(prodId) {\n return this.addItem(prodId);\n }\n\n deleteItem(item_id) {\n let data = this.getCartRequestData(item_id);\n\n if (!data.id) {\n salla.cart.event.itemDeletedFailed('There is no \"id\"!');\n return false;\n }\n\n return this.request(['deleteItem', data.id]).then(function (response) {\n salla.cart.event.itemDeleted(response, data.id);\n return response;\n }).catch(function (error) {\n salla.cart.event.itemDeletedFailed(error, data.id);\n throw error;\n });\n }\n\n updateItem(item_id) {\n let data = this.getCartRequestData(item_id);\n\n if (!data.id) {\n salla.cart.event.itemUpdatedFailed('There is no \"id\"!');\n return false;\n }\n\n return this.request(['updateItem', data.id], data.formData).then(function (response) {\n salla.cart.event.itemUpdated(response, data.id);\n return response;\n }).catch(function (error) {\n salla.cart.event.itemUpdatedFailed(error, data.id);\n throw error;\n });\n }\n\n submit({\n data\n }) {\n return this.request('submit', data).then(function (response) {\n salla.cart.event.submitted(response);\n return response;\n }).catch(function (error) {\n salla.cart.event.submitFailed(error);\n throw error;\n });\n }\n\n deleteFile(fileId) {\n fileId = this.getPossibleValue(fileId, ['id', 'image_id', 'photo_id']);\n\n if (!fileId) {\n salla.cart.event.fileDeletedFailed('There is no \"id\"!');\n return false;\n }\n\n return this.request(['deleteFile', fileId]).then(function (response) {\n salla.cart.event.fileDeleted(response, fileId);\n return response;\n }).catch(function (error) {\n salla.cart.event.fileDeletedFailed(error, fileId);\n throw error;\n });\n }\n\n fetchSummary() {\n return this.request('fetchSummary').then(function (response) {\n salla.cart.event.summaryFetched(response);\n return response;\n }).catch(function (error) {\n salla.cart.event.summaryNotFetched(error);\n throw error;\n });\n }\n /**\n * Extract ProductId & formData from Passed Object\n * @param {int|Object|{element: Element, data: {}}} prodId\n * @return {{formData: *, id: *}}\n */\n\n\n getCartRequestData(prodId) {\n /**\n * if prodId is Object, get data from it;\n * @see Object.prototype.getElementSallaData\n */\n let formData = prodId.data || (typeof prodId == 'object' ? prodId : undefined); //try to get prodId from formData if it's existed\n\n prodId = formData ? this.getPossibleValue(formData, ['prod_id', 'item_id', 'id']) : prodId;\n formData = typeof formData == 'object' ? formData : undefined;\n return {\n id: prodId,\n formData: formData\n };\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CartApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/cart.js?");
|
|
733
|
+
|
|
734
|
+
/***/ }),
|
|
735
|
+
|
|
736
|
+
/***/ "./twilight/api/comment.js":
|
|
737
|
+
/*!*********************************!*\
|
|
738
|
+
!*** ./twilight/api/comment.js ***!
|
|
739
|
+
\*********************************/
|
|
740
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
741
|
+
|
|
742
|
+
"use strict";
|
|
743
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass CommentApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n addProduct: \"{id}/comment\",\n addPage: \"{id}/comment\"\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n addProduct: 'comment::product-add',\n addPage: 'comment::page-add'\n };\n this.after_init();\n }\n /**\n * Add comment\n *\n * @param {string|number|{element: Element, data: {}}} prodId\n * @param {undefined|Object} formdata\n * @return {Promise}\n */\n\n\n addProduct(prodId, formdata) {\n return this.addComment(prodId, formdata, 'product');\n }\n /**\n * Add comment\n *\n * @param {string|number|{element: Element, data: {}}} pageId\n * @param {undefined|Object} formdata\n * @return {Promise}\n */\n\n\n addPage(pageId, formdata) {\n return this.addComment(pageId, formdata, 'page');\n }\n /**\n * Add comment\n *\n * @param {string|number|{element: Element, data: {}}} itemId\n * @param {undefined|Object} formdata\n * @param {string} type\n * @return {Promise}\n */\n\n\n addComment(itemId, formdata, type) {\n let element;\n /**\n * if prod_id is Object, get data from it;\n * @see Object.prototype.getElementSallaData\n */\n\n if (itemId.data) {\n formdata = itemId.data;\n element = itemId.element;\n itemId = this.getPossibleValue(formdata, ['id', 'itemId']);\n }\n\n if (!itemId) {\n salla.event.comment.additionFailed('Failed to get id!');\n return false;\n }\n\n if (!formdata || typeof formdata != 'object') {\n salla.event.comment.additionFailed('Failed to get formdata!');\n return false;\n }\n\n if (!['product', 'page'].includes(type)) {\n salla.event.comment.additionFailed('Failed to get type!');\n return false;\n }\n\n if (formdata instanceof FormData) {\n formData.append('type', type);\n } else {\n formdata['type'] = type;\n }\n\n let endPoint = {\n product: \"addProduct\",\n page: \"addPage\"\n };\n return this.request([endPoint[type], itemId], formdata).then(function (response) {\n salla.event.comment.added.call(element, response, itemId);\n return response;\n }).catch(function (error) {\n salla.event.comment.additionFailed.call(element, error, itemId);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CommentApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/comment.js?");
|
|
744
|
+
|
|
745
|
+
/***/ }),
|
|
746
|
+
|
|
747
|
+
/***/ "./twilight/api/coupon.js":
|
|
748
|
+
/*!********************************!*\
|
|
749
|
+
!*** ./twilight/api/coupon.js ***!
|
|
750
|
+
\********************************/
|
|
751
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
752
|
+
|
|
753
|
+
"use strict";
|
|
754
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass CouponApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n add: \"checkout/{id}/coupons\",\n remove: \"checkout/{id}/coupons\"\n };\n this.endpointsMethods = {\n remove: \"put\"\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n add: 'coupon::add',\n remove: 'coupon::remove'\n };\n this.after_init();\n }\n /**\n * Add Coupon to cart*\n * @param {int|{element: Element, data: {}}|FormData|Object} data\n */\n\n\n add(data) {\n data = data.data || data;\n let cartId = this.getPossibleValue(data, ['id', 'cart_id']);\n\n if (!cartId) {\n let error = new Error('There is no \"id\"!');\n error.name = 'MissingParameter';\n salla.event.coupon.addedFailed(error);\n return false;\n }\n\n if (!this.getPossibleValue(data.data || data, ['coupon'])) {\n let error = new Error('There is no \"Coupon Code\"!');\n error.name = 'EmptyCoupon';\n salla.event.coupon.addedFailed(error);\n return false;\n }\n\n return this.request(['add', cartId], data).then(function (response) {\n salla.event.coupon.added(response, cartId);\n return response;\n }).catch(function (error) {\n salla.event.coupon.addedFailed(error, cartId);\n throw error;\n });\n }\n /**\n * remove Coupon from the cart\n * @param {int|{element: Element, data: {}}|FormData|Object} data\n */\n\n\n remove(data) {\n let cartId = this.getPossibleValue(data.data || data, ['id', 'cart_id']);\n\n if (!cartId) {\n salla.event.coupon.removedFailed('There is no \"id\"!');\n return false;\n }\n\n return this.request(['remove', cartId], {}).then(function (response) {\n salla.event.coupon.removed(response, cartId);\n return response;\n }).catch(function (error) {\n salla.event.coupon.removedFailed(error, cartId);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CouponApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/coupon.js?");
|
|
755
|
+
|
|
756
|
+
/***/ }),
|
|
757
|
+
|
|
758
|
+
/***/ "./twilight/api/currency.js":
|
|
759
|
+
/*!**********************************!*\
|
|
760
|
+
!*** ./twilight/api/currency.js ***!
|
|
761
|
+
\**********************************/
|
|
762
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
763
|
+
|
|
764
|
+
"use strict";
|
|
765
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass CurrencyApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n //TODO:: Create new Endpoint to change currency without any real response\n change: \"/?currency={currency}\"\n };\n this.endpointsMethods = {\n change: \"get\"\n };\n this.endpointsHeaders = {\n change: {\n headers: {\n 's-is-change-currency': true\n }\n }\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n change: 'currency::change'\n };\n this.after_init();\n }\n /**\n * Change Current Currency\n * @param {int|{element: Element, data: {}}|FormData|Object} prod_id\n */\n\n\n change(currencyCode) {\n currencyCode = this.getPossibleValue(currencyCode.data || currencyCode, ['currency', 'code']);\n\n if (!currencyCode) {\n salla.currency.event.failed('There is Currency Code!');\n return false;\n }\n\n return this.request(['change', currencyCode], currencyCode).then(function (response) {\n salla.currency.event.changed(response, currencyCode);\n return response;\n }).catch(function (error) {\n salla.currency.event.failed(error, currencyCode);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CurrencyApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/currency.js?");
|
|
766
|
+
|
|
767
|
+
/***/ }),
|
|
768
|
+
|
|
769
|
+
/***/ "./twilight/api/document.js":
|
|
770
|
+
/*!**********************************!*\
|
|
771
|
+
!*** ./twilight/api/document.js ***!
|
|
772
|
+
\**********************************/
|
|
773
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
774
|
+
|
|
775
|
+
"use strict";
|
|
776
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass DocumentApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DocumentApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/document.js?");
|
|
777
|
+
|
|
778
|
+
/***/ }),
|
|
779
|
+
|
|
780
|
+
/***/ "./twilight/api/feedback.js":
|
|
781
|
+
/*!**********************************!*\
|
|
782
|
+
!*** ./twilight/api/feedback.js ***!
|
|
783
|
+
\**********************************/
|
|
784
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
785
|
+
|
|
786
|
+
"use strict";
|
|
787
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass FeedbackApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n store: \"rate_store\",\n product: \"rate_product\",\n shipping: \"rate_shipping\"\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n store: 'feedback::store',\n product: 'feedback::product',\n shipping: 'feedback::shipping'\n };\n this.after_init();\n }\n /**\n * Add feedback to the Store\n * @param {{element: Element, data: {}}|FormData|Object} data\n */\n\n\n store(data) {\n data = data.data || data;\n\n if (!data) {\n salla.event.coupon.addedFailed('There is no \"data\"!');\n return false;\n }\n\n return this.request('store', data).then(function (response) {\n salla.event.feedback.storeRated(response, data);\n return response;\n }).catch(function (error) {\n salla.event.feedback.storeFailed(error, data);\n throw error;\n });\n }\n /**\n * Add feedback to the product\n * @param {{element: Element, data: {}}|FormData|Object} data\n */\n\n\n product(data) {\n data = data.data || data;\n\n if (!data) {\n salla.event.feedback.storeFailed('There is no \"data\"!');\n return false;\n }\n\n return this.request('product', data).then(function (response) {\n salla.event.feedback.productRated(response, data);\n return response;\n }).catch(function (error) {\n salla.event.feedback.productFailed(error, data);\n throw error;\n });\n }\n /**\n * Add feedback to the shipping\n * @param {{element: Element, data: {}}|FormData|Object} data\n */\n\n\n shipping(data) {\n data = data.data || data;\n\n if (!data) {\n salla.event.feedback.shippingFailed('There is no \"data\"!');\n return false;\n }\n\n return this.request('shipping', data).then(function (response) {\n salla.event.feedback.shippingRated(response, data);\n return response;\n }).catch(function (error) {\n salla.event.feedback.shippingFailed(error, data);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FeedbackApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/feedback.js?");
|
|
788
|
+
|
|
789
|
+
/***/ }),
|
|
790
|
+
|
|
791
|
+
/***/ "./twilight/api/gift.js":
|
|
792
|
+
/*!******************************!*\
|
|
793
|
+
!*** ./twilight/api/gift.js ***!
|
|
794
|
+
\******************************/
|
|
795
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
796
|
+
|
|
797
|
+
"use strict";
|
|
798
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass GiftApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n buy: '{id}/buy-as-gift'\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n buy: 'gift::buy'\n };\n this.after_init();\n }\n /**\n * Add item to cart\n * 💡 If Quantity not passed will use 'quickAdd' ednpoint.\n *\n * @param {int|{element: Element, data: {}}|FormData|Object} prod_id\n */\n\n\n buy(prodId) {\n let data = this.getGiftRequestData(prodId);\n\n if (!data.id) {\n salla.gift.event.buyingFailed('There is no \"id\"!');\n return false;\n }\n\n return this.request(['buy', data.id], data.formData).then(function (response) {\n salla.gift.event.buyingSucceeded(response, data.id);\n return response;\n }).catch(function (error) {\n salla.gift.event.buyingFailed(error, data.id);\n throw error;\n });\n }\n /**\n * Extract ProductId & formData from Passed Object\n * @param {int|Object|{element: Element, data: {}}} prodId\n * @return {{formData: *, id: *}}\n */\n\n\n getGiftRequestData(prodId) {\n /**\n * if prodId is Object, get data from it;\n * @see Object.prototype.getElementSallaData\n */\n let formData = prodId.data || (typeof prodId == 'object' ? prodId : undefined); //try to get prodId from formData if it's existed\n\n prodId = formData ? this.getPossibleValue(formData, ['prod_id', 'item_id', 'id']) : prodId;\n formData = typeof formData == 'object' ? formData : undefined;\n return {\n id: prodId,\n formData: formData\n };\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GiftApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/gift.js?");
|
|
799
|
+
|
|
800
|
+
/***/ }),
|
|
801
|
+
|
|
802
|
+
/***/ "./twilight/api/index.js":
|
|
803
|
+
/*!*******************************!*\
|
|
804
|
+
!*** ./twilight/api/index.js ***!
|
|
805
|
+
\*******************************/
|
|
806
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
807
|
+
|
|
808
|
+
"use strict";
|
|
809
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _cart__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cart */ \"./twilight/api/cart.js\");\n/* harmony import */ var _gift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./gift */ \"./twilight/api/gift.js\");\n/* harmony import */ var _loyalty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./loyalty */ \"./twilight/api/loyalty.js\");\n/* harmony import */ var _auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./auth */ \"./twilight/api/auth.js\");\n/* harmony import */ var _order__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./order */ \"./twilight/api/order.js\");\n/* harmony import */ var _offer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./offer */ \"./twilight/api/offer.js\");\n/* harmony import */ var _search__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./search */ \"./twilight/api/search.js\");\n/* harmony import */ var _coupon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./coupon */ \"./twilight/api/coupon.js\");\n/* harmony import */ var _product__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./product */ \"./twilight/api/product.js\");\n/* harmony import */ var _comment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./comment */ \"./twilight/api/comment.js\");\n/* harmony import */ var _currency__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./currency */ \"./twilight/api/currency.js\");\n/* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./document */ \"./twilight/api/document.js\");\n/* harmony import */ var _feedback__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./feedback */ \"./twilight/api/feedback.js\");\n/* harmony import */ var _wishlist__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./wishlist */ \"./twilight/api/wishlist.js\");\n/* harmony import */ var _lib_request__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../lib/request */ \"./twilight/lib/request.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @property {CartApi} cart\n * @property {GiftApi} Gift\n * @property {LoyaltyApi} Loyalty\n * @property {AuthApi} auth\n * @property {SearchApi} search\n */\n\nclass sallaApi extends _lib_request__WEBPACK_IMPORTED_MODULE_14__[\"default\"] {\n constructor() {\n super(); //to be able to get all apis at once\n\n this.apis = {\n auth: new _auth__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this),\n cart: new _cart__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this),\n gift: new _gift__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this),\n loyalty: new _loyalty__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this),\n order: new _order__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this),\n offer: new _offer__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this),\n search: new _search__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this),\n coupon: new _coupon__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this),\n product: new _product__WEBPACK_IMPORTED_MODULE_8__[\"default\"](this),\n comment: new _comment__WEBPACK_IMPORTED_MODULE_9__[\"default\"](this),\n currency: new _currency__WEBPACK_IMPORTED_MODULE_10__[\"default\"](this),\n document: new _document__WEBPACK_IMPORTED_MODULE_11__[\"default\"](this),\n feedback: new _feedback__WEBPACK_IMPORTED_MODULE_12__[\"default\"](this),\n wishlist: new _wishlist__WEBPACK_IMPORTED_MODULE_13__[\"default\"](this)\n };\n this.hooksPrefix = 'data-on-';\n this.hooksSelectores = []; //make them available directly in api.\n\n Object.assign(this, this.apis);\n }\n\n}\n\nvar api = new sallaApi();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (api);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/index.js?");
|
|
810
|
+
|
|
811
|
+
/***/ }),
|
|
812
|
+
|
|
813
|
+
/***/ "./twilight/api/loyalty.js":
|
|
814
|
+
/*!*********************************!*\
|
|
815
|
+
!*** ./twilight/api/loyalty.js ***!
|
|
816
|
+
\*********************************/
|
|
817
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
818
|
+
|
|
819
|
+
"use strict";
|
|
820
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass LoyalityApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n exchange: 'cart/prize/exchange_loyalty_point'\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n // prefix will be added dynamicly, for example 'data-'\n\n this.hooksSelectores = {\n exchange: 'loyalty::exchange'\n };\n this.after_init();\n }\n /**\n * Add item to cart\n * 💡 If Quantity not passed will use 'quickAdd' ednpoint.\n *\n * @param {int|{element: Element, data: {}}|FormData|Object} prod_id\n */\n\n\n exchange(id) {\n let data = id.data || {\n id: id\n };\n\n if (!data.id) {\n salla.loyalty.event.exchangeFailed('There is no \"id\"!');\n return false;\n }\n\n data.loyalty_prize_id = data.id;\n return this.request('exchange', data).then(function (response) {\n salla.loyalty.event.exchangeSucceeded(response, data.id);\n return response;\n }).catch(function (error) {\n salla.loyalty.event.exchangeFailed(error, data.id);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoyalityApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/loyalty.js?");
|
|
821
|
+
|
|
822
|
+
/***/ }),
|
|
823
|
+
|
|
824
|
+
/***/ "./twilight/api/offer.js":
|
|
825
|
+
/*!*******************************!*\
|
|
826
|
+
!*** ./twilight/api/offer.js ***!
|
|
827
|
+
\*******************************/
|
|
828
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
829
|
+
|
|
830
|
+
"use strict";
|
|
831
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass OfferApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n popup: \"products/special-offer-popup/{product_id}\",\n increase: \"products/special-offer-popup/{product_id}/increase\"\n };\n this.endpointsMethods = {\n // popup : 'get',\n increase: 'get'\n };\n this.endpointsHeaders = {\n popup: {\n headers: {\n 's-ajax-view': true\n }\n }\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n popup: 'offer::popup',\n increase: 'offer::increase'\n };\n this.after_init();\n }\n /**\n * Show offer popup for this product\n * @param {{element: Element, data: {}}|FormData|Object} data\n */\n\n\n popup(prodId, data) {\n data = data || prodId.data;\n var prodId = this.getPossibleValue(prodId, ['product_id']);\n\n if (!prodId) {\n salla.offer.event.popupFailed('There is no \"prodId\"!');\n return false;\n }\n\n return this.request(['popup', prodId], data).then(function (response) {\n //if events is existed, means it's popuped before\n if (response.events) {\n salla.offer.event.popupFailed(response, data);\n return response;\n }\n\n salla.offer.event.popuped(response, data);\n return response;\n }).catch(function (error) {\n salla.offer.event.popupFailed(error, data);\n throw error;\n });\n }\n /**\n * Increase Current Product to Applay offer\n * @param {{element: Element, data: {}}|FormData|Object} data\n */\n\n\n increase(prodId) {\n let formData;\n\n if (prodId.data) {\n formData = prodId.data;\n prodId = this.getPossibleValue(formData, ['id', 'product_id']);\n }\n\n if (!prodId) {\n salla.offer.event.increaseFailed('There is no \"prodId\"!');\n return false;\n }\n\n return this.request(['increase', prodId], formData).then(function (response) {\n salla.offer.event.increased(response, formData);\n return response;\n }).catch(function (error) {\n salla.offer.event.increaseFailed(error, formData);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OfferApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/offer.js?");
|
|
832
|
+
|
|
833
|
+
/***/ }),
|
|
834
|
+
|
|
835
|
+
/***/ "./twilight/api/order.js":
|
|
836
|
+
/*!*******************************!*\
|
|
837
|
+
!*** ./twilight/api/order.js ***!
|
|
838
|
+
\*******************************/
|
|
839
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
840
|
+
|
|
841
|
+
"use strict";
|
|
842
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass OrderApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n cancel: \"order/{id}/cancel\",\n reOrder: \"reorder/{id}\"\n };\n this.after_init();\n }\n /**\n * @param {int} orderId\n * @return {Promise}\n */\n\n\n cancel(orderId) {\n return this.request(['cancel', orderId]).then(function (response) {\n salla.event.order.canceled(response, orderId);\n return response;\n }).catch(function (error) {\n salla.event.order.notCanceled(error, orderId);\n throw error;\n });\n }\n /**\n * @param {int} orderId\n * @return {Promise}\n */\n\n\n reOrder(orderId) {\n return this.request(['reOrder', orderId]).then(function (response) {\n salla.event.order.reOrdered(response, orderId);\n return response;\n }).catch(function (error) {\n salla.event.order.reOrderFailed(error, orderId);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OrderApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/order.js?");
|
|
843
|
+
|
|
844
|
+
/***/ }),
|
|
845
|
+
|
|
846
|
+
/***/ "./twilight/api/product.js":
|
|
847
|
+
/*!*********************************!*\
|
|
848
|
+
!*** ./twilight/api/product.js ***!
|
|
849
|
+
\*********************************/
|
|
850
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
851
|
+
|
|
852
|
+
"use strict";
|
|
853
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass ProductApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n price: \"product-price/{id}\",\n availabilityNotify: \"{id}/out-of-stock-notify\"\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n price: 'product::price',\n availabilityNotify: 'product::availability-notify'\n };\n this.after_init();\n }\n /**\n * Getting Price Of Product\n * @param {int|{element: Element, data: {}}|Object|FormData} prodId\n * @return {Promise}\n */\n\n\n price(prodId) {\n let formData = prodId.data || prodId;\n prodId = this.getPossibleValue(formData, ['id', 'prod_id']);\n return this.request(['price', prodId], typeof formData == 'object' ? formData : undefined).then(function (response) {\n salla.product.event.price(response, prodId);\n return response;\n }).catch(function (error) {\n salla.product.event.priceFailed(error, prodId);\n throw error;\n });\n }\n /**\n * Subscribe To Notify When product is available\n * @param {int|{element: Element, data: {}}|Object|FormData} prodId\n * @return {Promise}\n */\n\n\n availabilityNotify(prodId) {\n let formData = prodId.data || prodId;\n prodId = this.getPossibleValue(formData, ['id', 'prod_id']);\n return this.request(['availabilityNotify', prodId], typeof formData == 'object' ? formData : undefined).then(function (response) {\n salla.product.event.availabilitySubscribed(response, prodId);\n return response;\n }).catch(function (error) {\n salla.product.event.availabilityFailed(error, prodId);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/product.js?");
|
|
854
|
+
|
|
855
|
+
/***/ }),
|
|
856
|
+
|
|
857
|
+
/***/ "./twilight/api/search.js":
|
|
858
|
+
/*!********************************!*\
|
|
859
|
+
!*** ./twilight/api/search.js ***!
|
|
860
|
+
\********************************/
|
|
861
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
862
|
+
|
|
863
|
+
"use strict";
|
|
864
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n/**\n * @property {string} previousQuery\n */\n\nclass SearchApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n search: \"search\"\n };\n this.endpointsMethods = {\n search: \"get\"\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n search: 'search::products'\n };\n this.after_init();\n }\n /**\n * search for products\n *\n * @param {string|{element: Element, data: {}}} query\n * @return {Promise}\n */\n\n\n search(query) {\n /**\n * if query is Object, get data from it;\n * @see Object.prototype.getElementSallaData\n */\n let formData = query.data || {\n params: {\n q: query\n }\n };\n query = formData instanceof FormData ? formData.get('q') : formData.q || formData.params.q;\n\n if (!query) {\n salla.search.event.failed('There is no \"query\"!');\n return;\n }\n\n if (query == this.previousQuery) {\n salla.search.event.failed('Query Same As Previous!');\n return;\n }\n\n this.previousQuery = query;\n return this.request('search', formData).then(function (response) {\n salla.search.event.finished(response, query);\n return response;\n }).catch(function (error) {\n salla.search.event.failed(error, query);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/search.js?");
|
|
865
|
+
|
|
866
|
+
/***/ }),
|
|
867
|
+
|
|
868
|
+
/***/ "./twilight/api/wishlist.js":
|
|
869
|
+
/*!**********************************!*\
|
|
870
|
+
!*** ./twilight/api/wishlist.js ***!
|
|
871
|
+
\**********************************/
|
|
872
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
873
|
+
|
|
874
|
+
"use strict";
|
|
875
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseApi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseApi */ \"./twilight/api/baseApi.js\");\n\n\nclass WishlistApi extends _baseApi__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.endpoints = {\n add: \"wishlist/add/{id}\",\n remove: \"wishlist/{id}\"\n };\n this.endpointsMethods = {\n remove: 'delete'\n };\n /**\n * @see Object.prototype.canEventFireHook\n */\n\n this.hooksSelectores = {\n add: 'wishlist::add',\n remove: 'wishlist::remove'\n };\n this.after_init();\n }\n /**\n * Add To User Wishlist\n *\n * @param {string|number|{element: Element, data: {}}} prod_id\n * @return {Promise}\n */\n\n\n add(prod_id) {\n let element;\n /**\n * if prod_id is Object, get data from it;\n * @see Object.prototype.getElementSallaData\n */\n\n if (prod_id.data) {\n element = prod_id.element;\n prod_id = this.getPossibleValue(prod_id.data, ['id', 'prod_id']);\n }\n\n if (!prod_id) {\n salla.wishlist.event.additionFailed('Failed to get id!');\n return false;\n }\n\n return this.request(['add', prod_id]).then(function (response) {\n salla.wishlist.event.added.call(element, response, prod_id);\n return response;\n }).catch(function (error) {\n salla.wishlist.event.additionFailed.call(element, error, prod_id);\n throw error;\n });\n }\n /**\n * Add To User Wishlist\n *\n * @param {string|number|{element: Element, data: {}}} prod_id\n * @return {Promise}\n */\n\n\n remove(prod_id) {\n let element;\n /**\n * if prod_id is Object, get data from it;\n * @see Object.prototype.getElementSallaData\n */\n\n if (prod_id.data) {\n element = prod_id.element;\n prod_id = this.getPossibleValue(prod_id.data, ['id', 'prod_id']);\n }\n\n if (!prod_id) {\n salla.wishlist.event.removingFailed('Failed to get id!');\n return false;\n }\n\n return this.request(['remove', prod_id]).then(function (response) {\n salla.wishlist.event.removed.call(element, response, prod_id);\n return response;\n }).catch(function (error) {\n salla.wishlist.event.removingFailed.call(element, error, prod_id);\n throw error;\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WishlistApi);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/api/wishlist.js?");
|
|
876
|
+
|
|
877
|
+
/***/ }),
|
|
878
|
+
|
|
879
|
+
/***/ "./twilight/event/auth.js":
|
|
880
|
+
/*!********************************!*\
|
|
881
|
+
!*** ./twilight/event/auth.js ***!
|
|
882
|
+
\********************************/
|
|
883
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
884
|
+
|
|
885
|
+
"use strict";
|
|
886
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass AuthEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'auth';\n /**\n * 💡 namespace \"auth::\" will be added dynamicly,\n * so last result will be something like: \"auth::code-sent\"\n */\n\n this.events = {\n //prepared event use it like \"salla.auth.event.login()\" or \"salla.auth.event.onLogin(func...)\"\n login: \"login\",\n logout: \"logout\",\n //events connected With auth api, also can be used separately standalone.\n codeSent: \"code-sent\",\n codeNotSent: \"code-not-sent\",\n verified: \"verified\",\n verificationFailed: \"verification-failed\",\n loggedIn: \"logged-in\",\n registered: \"registered\",\n registrationFailed: \"registration-failed\",\n loggedOut: \"logged-out\",\n failedLogout: \"failed-logout\"\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AuthEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/auth.js?");
|
|
887
|
+
|
|
888
|
+
/***/ }),
|
|
889
|
+
|
|
890
|
+
/***/ "./twilight/event/baseEvent.js":
|
|
891
|
+
/*!*************************************!*\
|
|
892
|
+
!*** ./twilight/event/baseEvent.js ***!
|
|
893
|
+
\*************************************/
|
|
894
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
895
|
+
|
|
896
|
+
"use strict";
|
|
897
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * @property {sallaEmitter|eventemitter2} parent\n * @property {array} events\n * @property {string} namespace\n *\n */\nclass BaseEvent {\n constructor(parent) {\n this.parent = parent;\n this.events = {};\n this.namespace = '';\n var results = /function (.{1,})\\(/.exec(this.constructor.toString());\n this.className = (results && results.length > 1 ? results[1] : \"\").toLowerCase();\n }\n /**\n * should be called from child class, after preparing data, to initiate things.\n */\n\n\n after_init() {\n this.createDynamicFunctions();\n }\n\n createDynamicFunctions() {\n Object.keys(this.events).forEach(eventName => {\n this.createDynamicEventFuns(eventName);\n this.createDynamicListenerFuns(eventName);\n });\n }\n /**\n * instead of hardcode all events, we can do that here\n * for example we have in cart class about 7 events\n * instead of writing some thing like:\n * @example\n * itemAdded(response, item_id) {\n * return this.dispatch('itemAdded', response, item_id);\n * }\n * for each event, we will do that dynamically here,\n * if there is need for special handling, we can just hardcode it & it will not overriden\n * @param {string} eventName\n */\n\n\n createDynamicEventFuns(eventName) {\n //if it's already existe don't override it.\n if (this[eventName]) {\n return;\n }\n\n let thatEvent = this;\n\n this[eventName] = function (...response) {\n return thatEvent.dispatch(eventName, ...response);\n };\n }\n /**\n * instead of hardcode all eventsListeners, we can do that here\n * for example we have in cart class about 7 events\n * instead of writing some thing like:\n * @example\n * onItemAdded(callback) {\n * return this.on('itemAdded', callback);\n * }\n * for each event, we will do that dynamically here,\n * if there is need for special handling, we can just hardcode it & it will not overriden\n * @param {string} eventName\n */\n\n\n createDynamicListenerFuns(eventName) {\n //will be something like 'onItemAdded'\n let listenerName = 'on' + eventName.charAt(0).toUpperCase() + eventName.slice(1);\n\n if (this[listenerName]) {\n return;\n }\n\n let thatEvent = this;\n\n this[listenerName] = function (callback) {\n return thatEvent.on(eventName, callback);\n };\n }\n /**\n * get event name by adding namespace, or saved events;\n *\n * @param {string} eventName\n * @return {string}\n */\n\n\n getEventName(eventName) {\n eventName = this.events[eventName] || eventName; //if there is no namespace or eventName has namespace, return event as is.\n\n if (!this.namespace || eventName.includes('::')) {\n return eventName;\n } //will be something like \"cart::\"\n\n\n return this.namespace + this.parent.delimiter + eventName;\n } // sallaInitiated() {\n // console.log(this.className);\n // }\n\n /**\n *\n * @param eventName\n * @param {...*} passData\n */\n\n\n dispatch(eventName, ...passData) {\n return this.parent.dispatch(this.getEventName(eventName), ...passData);\n }\n /**\n *\n * @param {string} eventName\n * @param {function} callback\n */\n\n\n on(eventName, callback) {\n this.parent.addListener(this.getEventName(eventName), callback);\n }\n /**\n * Here we will register all sall events via this method,\n * in case there is need to add special handling or change Core Logic\n * @param string eventName\n * @param function eventCallback\n */\n\n\n register(eventName, eventCallback) {\n this.on(eventName, eventCallback);\n }\n /**\n * in case there is need to add Temporary event.\n *\n * @param string eventName\n * @param function eventCallback\n * @param int times - how many times wanted to fire listen for event, if it's not passed wil fire only one time.\n */\n\n\n registerEventTemporary(eventName, eventCallback, times) {\n if (!times) {\n times = 1;\n }\n\n emitter.many(eventName, times, eventCallback);\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseEvent);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/baseEvent.js?");
|
|
898
|
+
|
|
899
|
+
/***/ }),
|
|
900
|
+
|
|
901
|
+
/***/ "./twilight/event/cart.js":
|
|
902
|
+
/*!********************************!*\
|
|
903
|
+
!*** ./twilight/event/cart.js ***!
|
|
904
|
+
\********************************/
|
|
905
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
906
|
+
|
|
907
|
+
"use strict";
|
|
908
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass CartEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'cart';\n /**\n * 💡 namespace 'cart::' will be added dynamicly,\n * so last result will be something like: 'cart::item-added'\n */\n\n this.events = {\n updated: 'updated',\n itemUpdated: 'item-updated',\n itemUpdatedFailed: 'item-updated-failed',\n itemAdded: 'item-added',\n itemAddedFailed: 'item-added-failed',\n itemDeleted: 'item-deleted',\n itemDeletedFailed: 'item-deleted-failed',\n submitted: 'submitted',\n submitFailed: 'submit-failed',\n fileDeleted: 'file-deleted',\n fileDeletedFailed: 'file-deleted-failed',\n summaryFetched: 'summary-fetched',\n summaryNotFetched: 'summary-not-fetched'\n };\n this.after_init();\n }\n /** ============ Events ============ **/\n // /**\n // * In Case There is need to check item before add it to cart, can be achived here,\n // * So, you can perevent completing action.\n // */\n // beforeAddItem() {\n //}\n\n /**\n * to be allowed to pass only cart results or normal reponse;\n * @param {object} data\n * @return {*}\n */\n\n\n getCartResults(data) {\n if (!data) {\n return data;\n }\n\n if (data.data) {\n return this.getCartResults(data.data);\n }\n\n return data.cart || data;\n }\n\n updated(data) {\n let cart_results = this.getCartResults(data);\n\n if (cart_results) {\n if (cart_results.hasOffer) {\n salla.offer.event.existed(data.data || data);\n }\n\n try {\n localStore.set('cart_widget_summary', cart_results);\n } catch (err) {\n salla.notify.log(err);\n }\n }\n\n this.dispatch('updated', localStore.get('cart_widget_summary'), data);\n }\n /**\n * fire event after item added to the cart.\n */\n\n\n itemAdded(response, item_id) {\n this.updated(response);\n return this.dispatch('itemAdded', response, item_id);\n }\n /**\n * Fire event after item deleted from the cart.\n */\n\n\n itemDeleted(response, item_id) {\n this.updated(response);\n return this.dispatch('itemDeleted', response, item_id);\n }\n /**\n * Fire event after item updated.\n */\n\n\n itemUpdated(response, item_id) {\n this.updated(response);\n return this.dispatch('itemUpdated', response, item_id);\n }\n\n summaryFetched(response) {\n this.updated(response);\n }\n /**\n * way to clear localstorage of cart_widget_summary\n */\n\n\n clearCartSummary() {\n let summary = localStore.get('cart_widget_summary'); //if there is count in local stored summary widget, fetchSummary\n\n if (summary && (summary.count || summary.items)) {\n salla.cart.api.fetchSummary();\n }\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CartEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/cart.js?");
|
|
909
|
+
|
|
910
|
+
/***/ }),
|
|
911
|
+
|
|
912
|
+
/***/ "./twilight/event/comment.js":
|
|
913
|
+
/*!***********************************!*\
|
|
914
|
+
!*** ./twilight/event/comment.js ***!
|
|
915
|
+
\***********************************/
|
|
916
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
917
|
+
|
|
918
|
+
"use strict";
|
|
919
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass CommentEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'comment';\n /**\n * 💡 namespace \"comment::\" will be added dynamicly,\n * so last result will be something like: \"comment::added\"\n */\n\n this.events = {\n added: \"added\",\n additionFailed: \"addition-failed\"\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CommentEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/comment.js?");
|
|
920
|
+
|
|
921
|
+
/***/ }),
|
|
922
|
+
|
|
923
|
+
/***/ "./twilight/event/coupon.js":
|
|
924
|
+
/*!**********************************!*\
|
|
925
|
+
!*** ./twilight/event/coupon.js ***!
|
|
926
|
+
\**********************************/
|
|
927
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
928
|
+
|
|
929
|
+
"use strict";
|
|
930
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass CouponEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'coupon';\n /**\n * 💡 namespace \"coupon::\" will be added dynamicly,\n * so last result will be something like: \"coupon::added\"\n */\n\n this.events = {\n added: \"added\",\n removed: \"removed\",\n addedFailed: \"added-failed\",\n removedFailed: \"removed-failed\"\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CouponEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/coupon.js?");
|
|
931
|
+
|
|
932
|
+
/***/ }),
|
|
933
|
+
|
|
934
|
+
/***/ "./twilight/event/currency.js":
|
|
935
|
+
/*!************************************!*\
|
|
936
|
+
!*** ./twilight/event/currency.js ***!
|
|
937
|
+
\************************************/
|
|
938
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
939
|
+
|
|
940
|
+
"use strict";
|
|
941
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass CurrencyEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'currency';\n /**\n * 💡 namespace 'currency::' will be added dynamicly,\n * so last result will be something like: \"coupon::added\"\n */\n\n this.events = {\n changed: 'changed',\n failed: 'failed'\n };\n this.after_init();\n }\n\n changed(...response) {\n return salla.cart.api.fetchSummary().then(() => this.dispatch('changed', ...response));\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CurrencyEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/currency.js?");
|
|
942
|
+
|
|
943
|
+
/***/ }),
|
|
944
|
+
|
|
945
|
+
/***/ "./twilight/event/document.js":
|
|
946
|
+
/*!************************************!*\
|
|
947
|
+
!*** ./twilight/event/document.js ***!
|
|
948
|
+
\************************************/
|
|
949
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
950
|
+
|
|
951
|
+
"use strict";
|
|
952
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass DocumentEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'document';\n /**\n * 💡 namespace \"document::\" will be added dynamicly,\n * so last result will be something like: \"document::click\"\n */\n\n this.events = {\n click: \"click\",\n change: \"change\",\n submit: \"submit\",\n keyup: \"keyup\",\n leaving: \"leaving\",\n request: \"request\"\n };\n this.after_init();\n }\n /**\n * @param {string|function} selector\n * @param {function|undefined} callback\n */\n\n\n onClick(selector, callback) {\n this.fireCallableFuns('click', selector, callback);\n }\n /**\n * @param {string|function} selector\n * @param {function|undefined} callback\n */\n\n\n onChange(selector, callback) {\n this.fireCallableFuns('change', selector, callback);\n }\n /**\n * @param {string|function} selector\n * @param {function|undefined} callback\n */\n\n\n onSubmit(selector, callback) {\n this.fireCallableFuns('submit', selector, callback);\n }\n /**\n * @param {string|function} selector\n * @param {function|undefined} callback\n */\n\n\n onKeyup(selector, callback) {\n this.fireCallableFuns('keyup', selector, callback);\n }\n /**\n * Alternative For\n * @example: $(document).on(\"click\",\"#test-element\",function(event){})\n *\n * in case selector passed as function, will work as shorthand for\n * @example: document.addEventListener(\"clcik\", function(event){});\n *\n * @param {string} eventName = [click, keyup, submit, change]\n * @param {string|function} selector\n * @param {function|undefined} callback\n */\n\n\n fireCallableFuns(eventName, selector, callback) {\n this.on(eventName, event => {\n if (typeof selector == 'function') {\n selector(event);\n return;\n }\n\n if (typeof callback == 'function' && event.target.matches(selector)) {\n callback(event);\n return;\n }\n });\n }\n /**\n * Helper method to fake firing event on element, for example, we have listener:\n * @example\n * element.addEventListener(\"countrychange\",()=>{...});\n * we want to fire this event programmatically, we can do that by:\n * @example\n * salla.document.event.fireEvent(element, 'countrychange', optionalDataPassedThrowEvent)\n * @param {string|HTMLElement} element\n * @param {string} eventName\n * @param {Object|undefined} details\n * @return {boolean}\n */\n\n\n fireEvent(element, eventName, ...details) {\n return this.fireEventForElements(element, eventName, false, ...details);\n }\n /**\n * Helper method to fake firing event on multi elements, for example, we have listener:\n * @example\n * ...('.intl-input').forEach(element=> element.addEventListener(\"countrychange\",()=>{...}));\n * we want to fire this event programmatically, we can do that by:\n * @example\n * salla.document.event.fireEventForAll('.intl-input', 'countrychange', optionalDataPassedThrowEvent)\n * @param {string} elementSelector\n * @param {string} eventName\n * @param {Object|undefined} details\n * @return {boolean}\n */\n\n\n fireEventForAll(elementSelector, eventName, ...details) {\n return this.fireEventForElements(elementSelector, eventName, true, ...details);\n }\n /**\n *\n * @param {string|HTMLElement} element\n * @param {string} eventName\n * @param {boolean} isAllSelector\n * @param {Object|undefined} details\n * @return {boolean}\n */\n\n\n fireEventForElements(element, eventName, isAllSelector, ...details) {\n //if it's srting, means it's selector, so try to get real element from the selector.\n if (typeof element == 'string') {\n if (isAllSelector) {\n return document.querySelectorAll(element).forEach(element_ => {\n return this.fireEventForElements(element_, eventName, false, ...details);\n });\n }\n\n element = document.querySelector(element);\n }\n\n if (!element) {\n salla.log('Faild To get element to fire event: ' + eventName);\n return;\n }\n\n const event = new CustomEvent(eventName, ...details);\n return element.dispatchEvent(event);\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DocumentEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/document.js?");
|
|
953
|
+
|
|
954
|
+
/***/ }),
|
|
955
|
+
|
|
956
|
+
/***/ "./twilight/event/feedback.js":
|
|
957
|
+
/*!************************************!*\
|
|
958
|
+
!*** ./twilight/event/feedback.js ***!
|
|
959
|
+
\************************************/
|
|
960
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
961
|
+
|
|
962
|
+
"use strict";
|
|
963
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass FeedbackEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'feedback';\n /**\n * 💡 namespace \"feedback::\" will be added dynamicly,\n * so last result will be something like: \"feedback::store-rated\"\n */\n\n this.events = {\n storeRated: \"store-rated\",\n storeFailed: \"store-failed\",\n productRated: \"product-rated\",\n productFailed: \"product-failed\",\n shippingRated: \"shipping-rated\",\n shippingFailed: \"shipping-failed\"\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FeedbackEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/feedback.js?");
|
|
964
|
+
|
|
965
|
+
/***/ }),
|
|
966
|
+
|
|
967
|
+
/***/ "./twilight/event/gift.js":
|
|
968
|
+
/*!********************************!*\
|
|
969
|
+
!*** ./twilight/event/gift.js ***!
|
|
970
|
+
\********************************/
|
|
971
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
972
|
+
|
|
973
|
+
"use strict";
|
|
974
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass GiftEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'gift';\n /**\n * 💡 namespace 'gift::' will be added dynamicly,\n * so last result will be something like: 'gift::item-added'\n */\n\n this.events = {\n buyingSucceeded: 'buying-succeeded',\n buyingFailed: 'buying-failed'\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GiftEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/gift.js?");
|
|
975
|
+
|
|
976
|
+
/***/ }),
|
|
977
|
+
|
|
978
|
+
/***/ "./twilight/event/index.js":
|
|
979
|
+
/*!*********************************!*\
|
|
980
|
+
!*** ./twilight/event/index.js ***!
|
|
981
|
+
\*********************************/
|
|
982
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
983
|
+
|
|
984
|
+
"use strict";
|
|
985
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _cart__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cart */ \"./twilight/event/cart.js\");\n/* harmony import */ var _gift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./gift */ \"./twilight/event/gift.js\");\n/* harmony import */ var _loyalty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./loyalty */ \"./twilight/event/loyalty.js\");\n/* harmony import */ var _auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./auth */ \"./twilight/event/auth.js\");\n/* harmony import */ var _search__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./search */ \"./twilight/event/search.js\");\n/* harmony import */ var _wishlist__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./wishlist */ \"./twilight/event/wishlist.js\");\n/* harmony import */ var _comment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./comment */ \"./twilight/event/comment.js\");\n/* harmony import */ var _order__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./order */ \"./twilight/event/order.js\");\n/* harmony import */ var _infiniteScroll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./infiniteScroll */ \"./twilight/event/infiniteScroll.js\");\n/* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./document */ \"./twilight/event/document.js\");\n/* harmony import */ var _product__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./product */ \"./twilight/event/product.js\");\n/* harmony import */ var _offer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./offer */ \"./twilight/event/offer.js\");\n/* harmony import */ var _coupon__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./coupon */ \"./twilight/event/coupon.js\");\n/* harmony import */ var _feedback__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./feedback */ \"./twilight/event/feedback.js\");\n/* harmony import */ var _currency__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./currency */ \"./twilight/event/currency.js\");\n/* harmony import */ var eventemitter2__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! eventemitter2 */ \"./node_modules/eventemitter2/lib/eventemitter2.js\");\n/* harmony import */ var eventemitter2__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(eventemitter2__WEBPACK_IMPORTED_MODULE_15__);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @namespace salla.event\n *\n * @property {Document} body\n * @property {CartEvents} cart\n * @property {GiftEvents} gift\n * @property {LoyaltyEvents} loyalty\n * @property {AuthEvents} auth\n * @property {SearchEvents} search\n * @property {string} delimiter\n * @property {Object} globalListners\n * @property {array} logAbleEvents - log errors or important events.\n */\n\nclass sallaEmitter extends (eventemitter2__WEBPACK_IMPORTED_MODULE_15___default()) {\n constructor() {\n let delimiter = '::';\n super({\n wildcard: true,\n delimiter: delimiter,\n newListener: false,\n removeListener: false,\n maxListeners: 10,\n verboseMemoryLeak: false,\n ignoreErrors: false\n });\n this.globalListners = {};\n this.delimiter = delimiter;\n this.cart = new _cart__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this);\n this.gift = new _gift__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this);\n this.loyalty = new _loyalty__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this);\n this.auth = new _auth__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this);\n this.search = new _search__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this);\n this.wishlist = new _wishlist__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this);\n this.comment = new _comment__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this);\n this.order = new _order__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this);\n this.infiniteScroll = new _infiniteScroll__WEBPACK_IMPORTED_MODULE_8__[\"default\"](this);\n this.document = new _document__WEBPACK_IMPORTED_MODULE_9__[\"default\"](this);\n this.product = new _product__WEBPACK_IMPORTED_MODULE_10__[\"default\"](this);\n this.offer = new _offer__WEBPACK_IMPORTED_MODULE_11__[\"default\"](this);\n this.coupon = new _coupon__WEBPACK_IMPORTED_MODULE_12__[\"default\"](this);\n this.feedback = new _feedback__WEBPACK_IMPORTED_MODULE_13__[\"default\"](this);\n this.currency = new _currency__WEBPACK_IMPORTED_MODULE_14__[\"default\"](this);\n this.body = document.querySelector('body');\n this.logAbleEvents = ['cart::item-added-failed', 'cart::item-deleted-failed'];\n this.ingoreLogEvents = ['document::click', 'document::keyup', 'document::change' //'document::submit',\n ];\n this.on('salla::initiated', this.initiateSallaInAllClasses);\n }\n /**\n * handy way to be able to create function that will be called after salla initated;\n * we can add 'sallaInitiated()' method to any child in salla, or one of them chidren\n * for example:\n * salla.notify.sallaInitiated()\n * salla.api.cart.sallaInitiated()\n */\n\n\n initiateSallaInAllClasses() {\n let that = this;\n Object.keys(salla).forEach(sallaSection => {\n sallaSection = salla[sallaSection];\n\n if (typeof sallaSection != 'object') {\n return;\n } //search main salla elements like (salla.api, salla.notify, salla.event)\n\n\n that.callSallaInitiate(sallaSection); //search children of salla elements like (salla.api.cart, salla.event.auth ..etc)\n\n Object.keys(sallaSection).forEach(innerSallaSection => {\n that.callSallaInitiate(sallaSection[innerSallaSection]);\n });\n });\n }\n /**\n * make sure not to re call sallaInitiated method more than once for same class;\n * like:\n * salla.cart.event\n * salla.event.cart\n * because they are the same.\n * @param sallaSection\n */\n\n\n callSallaInitiate(sallaSection) {\n if (!sallaSection || !sallaSection.sallaInitiated || sallaSection.initiated) {\n return;\n }\n\n sallaSection.sallaInitiated();\n sallaSection.initiated = true;\n }\n /**\n * @param {string} event_name\n * @data {array} data\n *\n * @deprecated , legacy code, use dispatch() instead\n */\n\n\n createAndDispatch(event_name, ...data) {\n this.dispatch(event_name, ...data);\n }\n /**\n * Fire Event with data\n *\n * @param {string} event_name\n * @data {{payload}} data\n */\n\n\n dispatch(event_name, ...data) {\n this.emit(event_name, ...data); // lets send the event to data layer\n\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(Object.assign({\n 'event': event_name\n }, ...data.values())); //if there is need to log errors, or events, lets do it here.\n\n if (!this.ingoreLogEvents.includes(event_name) && (salla.config.debug || this.logAbleEvents.includes(event_name))) {\n salla.notify.log(event_name, ...data);\n } //TODO:: add notify events.\n\n\n let sallaEvent = this;\n Object.keys(this.globalListners).forEach(function (listener) {\n sallaEvent.globalListners[listener](event_name, ...data);\n });\n this.dispatchMobileEvent(event_name, { ...data.values()\n });\n }\n /**\n * Fire multi events using object of events\n *\n * @param {{event_name:{payload}}} events\n */\n\n\n dispatchEvents(events) {\n if (!events || typeof events !== 'object') {\n salla.log('No Events To Dispatch!', events);\n return;\n }\n\n for (const [event_name, payload] of Object.entries(events)) {\n this.dispatch(event_name, payload);\n }\n }\n /**\n * Alias for this.on\n * @param {string} eventName\n * @param {function} callback\n */\n\n\n addListener(eventName, callback) {\n this.on(eventName, callback);\n }\n /**\n * Alias for this.addListener\n * @param {string} eventName\n * @param {function} callback\n */\n\n\n listen(eventName, callback) {\n this.addListener(eventName, callback);\n }\n /**\n * Register Global listener will allow you to track all events in salla,\n * all Salla events will pushed to it.\n *\n * @param {string} name\n * @param {function} callback\n */\n\n\n registerGlobalListener(name, callback) {\n this.globalListners[name] = callback;\n }\n\n dispatchMobileEvent(eventName, details = {}) {\n if (!window.dataLayer || !dataLayer[0] || !dataLayer[0].page || !dataLayer[0].page.mobileApp) {\n return '';\n }\n\n if (window.webkit) {\n try {\n window.webkit.messageHandlers.callbackHandler.postMessage(JSON.stringify({\n event: eventName,\n details: details\n }));\n } catch (err) {\n console.log(err);\n console.log('The native context does not exist yet');\n }\n\n return;\n }\n\n if (Android) {\n try {\n Android.customEventWithData(eventName, JSON.stringify({\n details: details\n }));\n } catch (err) {\n console.log(err);\n console.log('The native context does not exist yet');\n }\n\n return;\n }\n }\n\n}\n\nvar event = new sallaEmitter();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (event);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/index.js?");
|
|
986
|
+
|
|
987
|
+
/***/ }),
|
|
988
|
+
|
|
989
|
+
/***/ "./twilight/event/infiniteScroll.js":
|
|
990
|
+
/*!******************************************!*\
|
|
991
|
+
!*** ./twilight/event/infiniteScroll.js ***!
|
|
992
|
+
\******************************************/
|
|
993
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
994
|
+
|
|
995
|
+
"use strict";
|
|
996
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass InfiniteScrollEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'infiniteScroll';\n /**\n * 💡 namespace \"infiniteScroll::\" will be added dynamicly,\n * so last result will be something like: \"infiniteScroll::loaded\"\n * also you can check:\n * @see https://infinite-scroll.com/events.html#infinite-scroll-events\n */\n\n this.events = {\n // also events can be accessed directly via:\n // salla.infiniteScroll.initiate(...).on('load', func);\n scrollThreshold: 'scroll-threshold',\n request: 'request',\n load: 'load',\n append: 'append',\n error: 'error',\n last: 'last',\n history: 'history'\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InfiniteScrollEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/infiniteScroll.js?");
|
|
997
|
+
|
|
998
|
+
/***/ }),
|
|
999
|
+
|
|
1000
|
+
/***/ "./twilight/event/loyalty.js":
|
|
1001
|
+
/*!***********************************!*\
|
|
1002
|
+
!*** ./twilight/event/loyalty.js ***!
|
|
1003
|
+
\***********************************/
|
|
1004
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1005
|
+
|
|
1006
|
+
"use strict";
|
|
1007
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass LoyaltyEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'loyalty';\n /**\n * 💡 namespace 'loyalty::' will be added dynamicly,\n * so last result will be something like: 'loyalty::item-added'\n */\n\n this.events = {\n exchangeSucceeded: 'exchange-succeeded',\n exchangeFailed: 'exchange-failed'\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoyaltyEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/loyalty.js?");
|
|
1008
|
+
|
|
1009
|
+
/***/ }),
|
|
1010
|
+
|
|
1011
|
+
/***/ "./twilight/event/offer.js":
|
|
1012
|
+
/*!*********************************!*\
|
|
1013
|
+
!*** ./twilight/event/offer.js ***!
|
|
1014
|
+
\*********************************/
|
|
1015
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1016
|
+
|
|
1017
|
+
"use strict";
|
|
1018
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass OfferEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'offer';\n /**\n * 💡 namespace \"offer::\" will be added dynamicly,\n * so last result will be something like: \"offer::existed\"\n */\n\n this.events = {\n existed: \"existed\",\n popuped: \"popuped\",\n popupFailed: \"popup-failed\",\n increased: \"increase\",\n increaseFailed: \"increase-failed\"\n }; //\n\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OfferEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/offer.js?");
|
|
1019
|
+
|
|
1020
|
+
/***/ }),
|
|
1021
|
+
|
|
1022
|
+
/***/ "./twilight/event/order.js":
|
|
1023
|
+
/*!*********************************!*\
|
|
1024
|
+
!*** ./twilight/event/order.js ***!
|
|
1025
|
+
\*********************************/
|
|
1026
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1027
|
+
|
|
1028
|
+
"use strict";
|
|
1029
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass OrderEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'order';\n /**\n * 💡 namespace \"order::\" will be added dynamicly,\n * so last result will be something like: \"order::canceled\"\n */\n\n this.events = {\n canceled: \"canceled\",\n notCanceled: \"not-canceled\",\n reOrdered: \"re-ordered\",\n reOrderFailed: \"re-order-failed\"\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OrderEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/order.js?");
|
|
1030
|
+
|
|
1031
|
+
/***/ }),
|
|
1032
|
+
|
|
1033
|
+
/***/ "./twilight/event/product.js":
|
|
1034
|
+
/*!***********************************!*\
|
|
1035
|
+
!*** ./twilight/event/product.js ***!
|
|
1036
|
+
\***********************************/
|
|
1037
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1038
|
+
|
|
1039
|
+
"use strict";
|
|
1040
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass ProductEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'product';\n /**\n * 💡 namespace \"product::\" will be added dynamicly,\n * so last result will be something like: \"product::price\"\n */\n\n this.events = {\n price: \"price\",\n priceFailed: \"price-failed\",\n availabilitySubscribed: \"availability-subscribed\",\n availabilityFailed: \"availability-failed\"\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/product.js?");
|
|
1041
|
+
|
|
1042
|
+
/***/ }),
|
|
1043
|
+
|
|
1044
|
+
/***/ "./twilight/event/search.js":
|
|
1045
|
+
/*!**********************************!*\
|
|
1046
|
+
!*** ./twilight/event/search.js ***!
|
|
1047
|
+
\**********************************/
|
|
1048
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1049
|
+
|
|
1050
|
+
"use strict";
|
|
1051
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass SearchEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'search';\n /**\n * 💡 namespace \"searched::\" will be added dynamicly,\n * so last result will be something like: \"searched::finished\"\n */\n\n this.events = {\n finished: \"finished\",\n failed: \"failed\"\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/search.js?");
|
|
1052
|
+
|
|
1053
|
+
/***/ }),
|
|
1054
|
+
|
|
1055
|
+
/***/ "./twilight/event/wishlist.js":
|
|
1056
|
+
/*!************************************!*\
|
|
1057
|
+
!*** ./twilight/event/wishlist.js ***!
|
|
1058
|
+
\************************************/
|
|
1059
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1060
|
+
|
|
1061
|
+
"use strict";
|
|
1062
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _baseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseEvent */ \"./twilight/event/baseEvent.js\");\n\n\nclass WishlistEvents extends _baseEvent__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(parent) {\n super(parent);\n this.namespace = 'wishlist';\n /**\n * 💡 namespace \"wishlist::\" will be added dynamicly,\n * so last result will be something like: \"wishlist::added\"\n */\n\n this.events = {\n added: \"added\",\n removed: \"removed\",\n additionFailed: \"addition-failed\",\n removingFailed: \"removing-failed\"\n };\n this.after_init();\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WishlistEvents);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/event/wishlist.js?");
|
|
1063
|
+
|
|
1064
|
+
/***/ }),
|
|
1065
|
+
|
|
1066
|
+
/***/ "./twilight/helpers/htmlObjects.js":
|
|
1067
|
+
/*!*****************************************!*\
|
|
1068
|
+
!*** ./twilight/helpers/htmlObjects.js ***!
|
|
1069
|
+
\*****************************************/
|
|
1070
|
+
/***/ (() => {
|
|
1071
|
+
|
|
1072
|
+
eval("//support element.closest in IE\nif (!Element.prototype.matches) Element.prototype.matches = Element.prototype.msMatchesSelector;\nif (!Element.prototype.closest) Element.prototype.closest = function (selector) {\n var el = this;\n\n while (el) {\n if (el.matches(selector)) {\n return el;\n }\n\n el = el.parentElement;\n }\n};\n/**\n * In case we want to get data by attribute, lets say for example attribute \"data-cart-delete\"\n * we will try to get data for this element, by these ways:\n * 1- <a data-on-click=\"cart-delete-item\" data-form=\"12324\">x</a>\n * 2- <a data-on-click=\"cart-delete-item\" data-form='{\"id\":12324}'>x</a>\n * 3- <a data-on-click=\"cart-delete-item\" data-id=\"12324\">x</a>\n * 4- <form><input type=\"id\" name=\"id\"><a data-on-click=\"cart-delete-item\">x</a></form>\n * 5- <script>var item_id=12324;</script><a data-on-click=\"cart-delete-item\" data-form=\"item_id\">x</a>\n * 6- <script>function get_item_id(){return 12324;}</script><a data-on-click=\"cart-delete-item\" data-form=\"get_item_id\">x</a>\n * 7- <div salla-form-data><input type=\"hidden\" name=\"item_id\" value=\"12324\"><a data-on-click=\"cart-delete-item\">x</a></div>\n */\n\nElement.prototype.getElementSallaData = function (attributeName, ...restData) {\n // trying to call it for non-htmlElement object\n if (!this.getAttribute) {\n return;\n } //try to get json\n\n\n if (this.hasAttribute('data-json')) {\n try {\n return JSON.parse(this.getAttribute('data-json'));\n } catch (e) {}\n }\n\n let data = this.getAttribute('data-function'); //if there is no data, or data not existed in window Dom, try to get data from parent form, or return dataset.\n\n if (!data || !window[data]) {\n let formData;\n\n if (this.hasAttribute('data-form-selector')) {\n formData = document.querySelector(this.getAttribute('data-form-selector'));\n } else {\n formData = this.closest('[salla-form-data]');\n }\n\n if (!formData && (formData = this.closest('form'))) {\n return new FormData(formData);\n } // try to get parent form div, or just use this element as the parent, to get it's children inputes;\n\n\n formData = this.closest('[salla-form-data]') || this; //try to get children inputs;\n\n let inputs = formData.querySelectorAll(\"[name]\");\n\n if (!inputs.length) {\n return this.dataset;\n } //to get normal object instead of DOMStringMap\n\n\n let dataset = Object.assign({}, this.dataset);\n inputs.forEach(input => {\n //if it's not selected ignore it\n if (['checkbox', 'radio'].includes(input.type) && !input.checked) {\n return;\n }\n\n try {\n //TODO:: Check multiple select how it wil be.\n let inputValueWithName = salla.helpers.inputData(input.name, input.value, dataset);\n dataset[inputValueWithName.name] = inputValueWithName.value;\n } catch (e) {\n salla.log(input.name + ' can\\'t be send');\n }\n });\n return dataset;\n } //is data existed as function in window\n\n\n if (typeof window[data] == 'function') {\n //call function via call to pass element, will be accessable in function by \"this\".\n return window[data].call(this, ...restData);\n } //if data existed in window Dom, return it.\n\n\n return window[data];\n};\n/**\n * Salla Connects Api Actions By Hooks, it handle dynamic connect suitable events:\n * @example '<button type=\"submit\" data-on-click=\"auth-login\" data-form=\"...\">add</button>'\n *\n * @param {Event} event\n * @return {boolean|string}\n */\n\n\nElement.prototype.canEventFireHook = function (event) {\n return this.hasAttribute ? this.hasAttribute(salla.api.hooksPrefix + event.type) : false;\n};\n/**\n * @param {string} startsWith\n * @param {boolean|undefined} returnAttribute\n * @return {boolean|string}\n */\n\n\nElement.prototype.hasAttributeStartsWith = function (startsWith, returnAttribute) {\n //to avoid any change in letters cases\n startsWith = startsWith.toLowerCase();\n\n for (var i = 0; i < this.attributes.length; i++) {\n let name = this.attributes[i].name.toLowerCase();\n\n if (name.indexOf(startsWith) == 0) {\n return returnAttribute ? name : true;\n }\n }\n\n return false;\n};\n\nHTMLFormElement.prototype.getAjaxFormData = function (event) {\n //laravel.errors.clearValidation(event.target);\n //laravel.ajax.disabledSubmitButton(event.target);\n // get the input field with type=\"file\"\n var files = this.querySelectorAll('input[type=\"file\"]'); //add the \"disabled\" attribute to the input\n\n files.forEach(file => {\n if (!file.files.length) {\n file.setAttribute('disabled', \"\");\n }\n });\n var formData = new FormData(this); // remove the \"disabled\" attribute\n\n files.forEach(file => {\n if (!file.files.length) {\n file.removeAttribute('disabled');\n }\n });\n return {\n formData: getFilteredData(this, event, formData),\n url: this.getAttribute('action'),\n method: this.getAttribute('method') || 'post',\n events: {\n success: this.dataset.onSuccess,\n fail: this.dataset.onFail\n }\n };\n};\n/**\n * Fire The Function That Passed To Ajax <a> or <form>, with data attribute, Ex.\n * <a class=\"ajax\" href=\"...\" data-filter-before-send=\"myFunctionName\">...</a>\n * it will pass (formData, object, event) to the function.\n * @param {DOMStringMap} dataset\n * @param {Object} formData\n */\n\n\nfunction getFilteredData(object, event, formData) {\n formData = formData || object.dataset;\n ['filterBeforeSubmit', 'filterBeforeSend'].forEach(propertyName => {\n let functionName = object.dataset[propertyName];\n\n if (functionName) {\n var callback_form = window[functionName];\n\n if (typeof callback_form === 'function') {\n return callback_form(formData, object, event);\n }\n\n salla.log('window.' + functionName + '() not founded!');\n }\n });\n return formData;\n}\n\nHTMLAnchorElement.prototype.getAjaxFormData = function (event) {\n return {\n formData: getFilteredData(this, event),\n url: this.getAttribute('href'),\n method: this.dataset.type || 'get',\n events: {\n success: this.dataset.onSuccess,\n fail: this.dataset.onFail\n }\n };\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/helpers/htmlObjects.js?");
|
|
1073
|
+
|
|
1074
|
+
/***/ }),
|
|
1075
|
+
|
|
1076
|
+
/***/ "./twilight/helpers/index.js":
|
|
1077
|
+
/*!***********************************!*\
|
|
1078
|
+
!*** ./twilight/helpers/index.js ***!
|
|
1079
|
+
\***********************************/
|
|
1080
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1081
|
+
|
|
1082
|
+
"use strict";
|
|
1083
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"helpers\": () => (/* binding */ helpers)\n/* harmony export */ });\n__webpack_require__(/*! ./strings */ \"./twilight/helpers/strings.js\");\n\n__webpack_require__(/*! ./htmlObjects */ \"./twilight/helpers/htmlObjects.js\");\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((__webpack_require__(/*! ./initiateSalla */ \"./twilight/helpers/initiateSalla.js\")[\"default\"]));\n\nfunction parseArabicNumbers(id, dot) {\n let input = document.getElementById(id);\n\n if (!input) {\n salla.log('Can\\'t find Object With Id: ' + id);\n return;\n }\n\n let new_val = input.value.toArabicDigits().replace(/[^0-9.]/g, '').replace('..', '.');\n\n if (input.min && new_val < input.min) {\n return input.value = input.min;\n }\n\n if (input.max && new_val > input.max) {\n return input.value = input.max;\n }\n\n if (input.maxLength >= 1 && new_val.toString().length > input.maxLength) {\n return input.value = new_val.toString().substring(0, input.maxLength);\n }\n\n return input.value = dot || input.dataset.hasOwnProperty('digitsWithDecimal') ? getOnlyDecimal(new_val) : new_val.replace(/\\D/g, '');\n}\n\nfunction getOnlyDecimal(value) {\n let dotsCount = (value.match(/\\./g) || []).length;\n\n if (!dotsCount || dotsCount == 1) {\n return value;\n } //if there is more than one dotes, remove the last dot.\n //Ex: 123.545.66 => 123.54566\n\n\n return getOnlyDecimal(value.replace(/\\.(.+)\\./g, '.$1'));\n}\n\nfunction debounce(fn, delay) {\n delay = delay || 100;\n let resolves = [];\n let timer;\n return function (...args) {\n clearTimeout(timer);\n timer = setTimeout(() => {\n let result = fn(...args);\n resolves.forEach(r => r(result));\n resolves = [];\n }, delay);\n return new Promise(r => resolves.push(r));\n };\n}\n/**\n * Use It When You want to grab data from input names with brackets Ex.\n * <input name=\"products[0][id]\" value...>\n * <input name=\"products[0][name]\" value...>\n * <input name=\"products[1][id]\" value...>\n * <input name=\"products[1][name]\" value...>\n * will be like: {products:[{id:.., name:..},{id:.., name:..}]}\n * @param name\n * @param value\n * @param dataset\n * @return {{name, value}|{name, value: (*|[*, *]|[string, *]|{}|[*])}}\n */\n\n\nfunction getInputDataWithName(name, value, dataset = {}) {\n if (name.includes('[')) {\n let nameLevels = name.split(']').join('').split('[');\n return {\n name: nameLevels[0],\n value: getLeveledData(nameLevels.slice(1), value, dataset[nameLevels[0]])\n };\n }\n\n return {\n name: name,\n value: value\n };\n}\n/**\n * in case input name is array for example \"jamal[4655]\" let's fix it\n * This Heleper Cod to get suitable array data, Ex.\n * jamal[]=1\n * jamal[]=2\n * final result will be: {jamal:[1,2]}\n *\n * @param {String[]} nameLevels\n * @param {string|mixed} value\n * @param {{}|undefined} existedData\n * @return {*[]|*|(string|*)[]|{}}\n */\n\n\nfunction getLeveledData(nameLevels, value, existedData) {\n let currentName = nameLevels[0]; //it's an array, so add value ass array\n\n if (existedData && nameLevels.length == 0) {\n if (Array.isArray(existedData)) {\n existedData.push(value);\n return existedData;\n } //todo::handle in case it's object\n\n\n return [existedData, value];\n }\n\n if (Array.isArray(existedData)) {\n existedData.push(value);\n return existedData;\n }\n\n if (typeof existedData === 'string') {\n return [existedData, value];\n } //it's nested data\n\n\n if (existedData) {\n existedData[currentName] = getLeveledData(nameLevels.slice(1), value, existedData[currentName]);\n return existedData;\n }\n\n if (currentName) {\n return {\n [currentName]: getLeveledData(nameLevels.slice(1), value)\n };\n } //handling \"[]\" without name\n\n\n return currentName === \"\" ? [value] : value;\n}\n/**\n * @type {{debounce: (function(*, *=): function(...[*]): Promise<unknown>), inputData: ((function(*=, *=, *): ({name, value}|{name, value: (*|*[]|(string|*)[]|{})}))|*), digitsOnly: ((function(*=, *=): (undefined|*))|*)}}\n */\n\n\nvar helpers = {\n digitsOnly: parseArabicNumbers,\n debounce: debounce,\n inputData: getInputDataWithName\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/helpers/index.js?");
|
|
1084
|
+
|
|
1085
|
+
/***/ }),
|
|
1086
|
+
|
|
1087
|
+
/***/ "./twilight/helpers/initiateSalla.js":
|
|
1088
|
+
/*!*******************************************!*\
|
|
1089
|
+
!*** ./twilight/helpers/initiateSalla.js ***!
|
|
1090
|
+
\*******************************************/
|
|
1091
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1092
|
+
|
|
1093
|
+
"use strict";
|
|
1094
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nvar init = function (config) {\n if (typeof config == 'object') {\n salla.config = Object.assign(salla.config, config);\n\n if (config.token) {\n salla.api.defaults.headers.common[\"X-CSRF-TOKEN\"] = config.token;\n }\n } //for fast access to the token\n\n\n salla.config.token = salla.api.defaults.headers.common[\"X-CSRF-TOKEN\"];\n salla.event.dispatch('salla::initiated');\n connectHooksWithElements();\n};\n\nwindow.onbeforeunload = function (event) {\n salla.document.event.leaving(event);\n\n if (!salla.config.canLeave) {\n event.preventDefault();\n return false;\n }\n};\n/**\n * check JSDoc in:\n * @see BaseApi.hooksSelectores\n */\n\n\nfunction connectHooksWithElements(thatClass) {\n let defaultEvents = ['click', 'change', 'submit', 'keyup'];\n let hooksPrefix = salla.api.hooksPrefix;\n\n for (let i = 0; i < 4; i++) {\n //listen to event even for dynamic elements\n document.addEventListener(defaultEvents[i], function (event) {\n let eventType = defaultEvents[i];\n salla.event.document[eventType](event);\n\n if (event.target.matches('.ajax') && (eventType == 'click' && event.target instanceof HTMLAnchorElement || eventType == 'submit' && event.target instanceof HTMLFormElement)) {\n connectAjaxElements(event, event.target);\n return;\n } //get element/target from the event, then loop throw\n\n\n let canContinue = true;\n\n for (let {\n target: element\n } = event; //get target from event to new varabile with name \"element\".\n element && element !== this && canContinue; //loop only if \"element\" is true & \"element\" not the document object.\n element = element.parentNode //get parentNode then loop again\n ) {\n //no need to enter logic over all hooks for each element, unless this element has legalable attribute.\n //means it should have attribute that starts with \"hooksPrefix\" + current event, Ex. data-on-click;\n let attributeName = hooksPrefix + eventType; //ex. data-on-click\n\n let onEventHook = element.getAttribute(attributeName); //ex. auth-login\n\n if (!onEventHook) {\n continue;\n }\n\n let apiName = onEventHook.split('::')[0];\n /**\n * loop throw all hooks for apis\n * like: salla.api.auth.hooksSelectores, salla.api.cart.hooksSelectores\n */\n\n let apiClass = salla.api.apis[apiName];\n\n if (!apiClass) {\n continue;\n }\n\n Object.keys(apiClass.hooksSelectores).forEach(action => {\n //make sure that this element has the hook selector or not;\n if (apiClass.hooksSelectores[action] === onEventHook) {\n //in some cases we don't want to prevent default, so make it flexible\n if (!element.hasAttribute('data-allow-default')) {\n event.preventDefault();\n } //make sure to prevent any actions if the return was false\n\n\n if (!apiClass[action].call(apiClass, apiClass.withInjectData(element, onEventHook))) {\n event.stopPropagation();\n }\n\n canContinue = false;\n }\n });\n }\n });\n }\n}\n/**\n * Link Action Of forms & links that have '.ajax' class.\n *\n * @param {Event} event\n * @param {Element} element\n */\n\n\nfunction connectAjaxElements(event, element) {\n if (!(element instanceof HTMLFormElement || element instanceof HTMLAnchorElement)) {\n return false;\n }\n\n event.preventDefault();\n var data = element.getAjaxFormData(event);\n var method = data.method ? data.method.toLowerCase() : undefined;\n salla.api.document.request(data.url, data.formData, method).then(function (response) {\n //instead of passing all axios object, we will pass response data only\n if (response.data && response.request) {\n response = response.data;\n }\n\n salla.api.document.handleAfterResponseActions(response);\n callAjaxEvent(data.events.success, response, data.formData);\n return response;\n }).catch(function (error) {\n salla.api.document.handleErrorResponse(error);\n callAjaxEvent(data.events.fail, error, data.formData);\n throw error;\n });\n}\n\nfunction callAjaxEvent(event, response, formData) {\n if (!event) {\n return;\n }\n\n if (formData instanceof FormData) {\n var parameters = {};\n Array.from(formData.entries()).forEach(function (data) {\n parameters[data[0]] = data[1];\n });\n formData = parameters;\n }\n\n if (window[event]) {\n window[event](response, formData);\n return;\n }\n\n salla.event.dispatch(event, response, formData);\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (init);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/helpers/initiateSalla.js?");
|
|
1095
|
+
|
|
1096
|
+
/***/ }),
|
|
1097
|
+
|
|
1098
|
+
/***/ "./twilight/helpers/strings.js":
|
|
1099
|
+
/*!*************************************!*\
|
|
1100
|
+
!*** ./twilight/helpers/strings.js ***!
|
|
1101
|
+
\*************************************/
|
|
1102
|
+
/***/ (() => {
|
|
1103
|
+
|
|
1104
|
+
eval("String.prototype.toStudlyCase = function () {\n return this.trim() //remove first spaces\n .replace(/([^a-zA-Z\\d].)/g, function (t) {\n //get\n return t.toUpperCase().replace(/[^a-zA-Z\\d]/g, '');\n });\n};\n\nString.prototype.toDatasetName = function () {\n return this.startsWith('data-') ? this.substr(5).toStudlyCase() : this.toStudlyCase();\n}; //helper method to get string as selector, by adding (#) to the begaining if it's not start with one.\n\n\nString.prototype.toSelector = function () {\n //todo:: add html tags if it's needed.\n return this.trim().startsWith(\".\") || this.trim().startsWith(\"#\") ? this : \"#\" + this;\n};\n\nString.prototype.replaceArray = function (find, replace) {\n var replaceString = this;\n var regex;\n\n for (var i = 0; i < find.length; i++) {\n regex = new RegExp(find[i], \"g\");\n replaceString = replaceString.replace(regex, replace[i]);\n }\n\n return replaceString;\n};\n\nString.prototype.toArabicDigits = function () {\n var find = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩', ' ', '-', '/', '|', '~'];\n var replace = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '', '', '', '', ''];\n return this.replaceArray(find, replace);\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/helpers/strings.js?");
|
|
1105
|
+
|
|
1106
|
+
/***/ }),
|
|
1107
|
+
|
|
1108
|
+
/***/ "./twilight/lang/index.js":
|
|
1109
|
+
/*!********************************!*\
|
|
1110
|
+
!*** ./twilight/lang/index.js ***!
|
|
1111
|
+
\********************************/
|
|
1112
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1113
|
+
|
|
1114
|
+
"use strict";
|
|
1115
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lang.js */ \"./node_modules/lang.js/src/lang.js\");\n/* harmony import */ var lang_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lang_js__WEBPACK_IMPORTED_MODULE_0__);\n\n\nclass SallaLang extends (lang_js__WEBPACK_IMPORTED_MODULE_0___default()) {\n constructor(options) {\n options = options || {};\n options.messages = options.messages || window.translations;\n options.locale = options.locale || window.locale || 'en';\n options.fallback = options.fallback || 'en'; //TODO:: allow the developer to pass initate valuse to avoid this message even when he will add translations later.\n\n if (!options.messages) {\n console.warn(\"You should load Salla Translations Before!\\n\" + 'Use: <script src=\"{{ link(\"languages/assets/#{store.theme.translations_hash}.js\") }}\"></script>' + \"\\nor: salla.lang.setMessages({....}), see https://github.com/rmariuzzo/Lang.js for more informations.\");\n }\n\n super(options);\n }\n\n get(key, replacements, locale) {\n //if translations in window object, means it's using lang.js formatting, so lets ignore first level key.\n if (window.translations) {\n key = 'trans.' + key;\n }\n\n return super.get(key, replacements, locale);\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (new SallaLang());\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/lang/index.js?");
|
|
1116
|
+
|
|
1117
|
+
/***/ }),
|
|
1118
|
+
|
|
1119
|
+
/***/ "./twilight/lib/request.js":
|
|
1120
|
+
/*!*********************************!*\
|
|
1121
|
+
!*** ./twilight/lib/request.js ***!
|
|
1122
|
+
\*********************************/
|
|
1123
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1124
|
+
|
|
1125
|
+
"use strict";
|
|
1126
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);\n\n/**\n * @class\n * @augments axios\n */\n\nclass request {\n constructor() {\n let token = document.head.querySelector('meta[name=\"_token\"]');\n let commonOptions = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n\n if (token) {\n commonOptions['X-CSRF-TOKEN'] = token.content;\n } else {\n console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');\n }\n\n return axios__WEBPACK_IMPORTED_MODULE_0___default().create({\n baseURL: window.baseUrl,\n headers: {\n common: commonOptions,\n 'S-SOURCE': 'sallaApi'\n }\n });\n }\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (request);\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/lib/request.js?");
|
|
1127
|
+
|
|
1128
|
+
/***/ }),
|
|
1129
|
+
|
|
1130
|
+
/***/ "./twilight/main.js":
|
|
1131
|
+
/*!**************************!*\
|
|
1132
|
+
!*** ./twilight/main.js ***!
|
|
1133
|
+
\**************************/
|
|
1134
|
+
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
|
1135
|
+
|
|
1136
|
+
"use strict";
|
|
1137
|
+
eval(" //Plugins\n\nif (!window.localStore) {\n window.localStore = __webpack_require__(/*! store */ \"./node_modules/store/dist/store.legacy.js\");\n}\n\nvar helpers = __webpack_require__(/*! ./helpers */ \"./twilight/helpers/index.js\"); //Main Salla Elements\n\n\nvar notify = __webpack_require__(/*! ./notify */ \"./twilight/notify/index.js\");\n\nvar event = (__webpack_require__(/*! ./event */ \"./twilight/event/index.js\")[\"default\"]);\n\nvar api = (__webpack_require__(/*! ./api */ \"./twilight/api/index.js\")[\"default\"]); //Aliases\n\n\nvar Cart = (__webpack_require__(/*! ./Aliases/cart */ \"./twilight/Aliases/cart.js\")[\"default\"]);\n\nvar Auth = (__webpack_require__(/*! ./Aliases/auth */ \"./twilight/Aliases/auth.js\")[\"default\"]);\n\nvar Order = (__webpack_require__(/*! ./Aliases/order */ \"./twilight/Aliases/order.js\")[\"default\"]);\n\nvar Gift = (__webpack_require__(/*! ./Aliases/gift */ \"./twilight/Aliases/gift.js\")[\"default\"]);\n\nvar Loyalty = (__webpack_require__(/*! ./Aliases/loyalty */ \"./twilight/Aliases/loyalty.js\")[\"default\"]);\n\nvar Offer = (__webpack_require__(/*! ./Aliases/offer */ \"./twilight/Aliases/offer.js\")[\"default\"]);\n\nvar Search = (__webpack_require__(/*! ./Aliases/search */ \"./twilight/Aliases/search.js\")[\"default\"]);\n\nvar Coupon = (__webpack_require__(/*! ./Aliases/coupon */ \"./twilight/Aliases/coupon.js\")[\"default\"]);\n\nvar Comment = (__webpack_require__(/*! ./Aliases/comment */ \"./twilight/Aliases/comment.js\")[\"default\"]);\n\nvar Product = (__webpack_require__(/*! ./Aliases/product */ \"./twilight/Aliases/product.js\")[\"default\"]);\n\nvar Currency = (__webpack_require__(/*! ./Aliases/currency */ \"./twilight/Aliases/currency.js\")[\"default\"]);\n\nvar Document = (__webpack_require__(/*! ./Aliases/document */ \"./twilight/Aliases/document.js\")[\"default\"]);\n\nvar Feedback = (__webpack_require__(/*! ./Aliases/feedback */ \"./twilight/Aliases/feedback.js\")[\"default\"]);\n\nvar Wishlist = (__webpack_require__(/*! ./Aliases/wishlist */ \"./twilight/Aliases/wishlist.js\")[\"default\"]);\n\nvar InfiniteScroll = (__webpack_require__(/*! ./Aliases/infiniteScroll */ \"./twilight/Aliases/infiniteScroll.js\")[\"default\"]);\n\nvar sallaDefaultConfig = {\n debug: \"development\" === 'development',\n token: null,\n fastRequests: true,\n canLeave: true\n};\nwindow.Salla = window.salla = {\n config: sallaDefaultConfig,\n notify: notify,\n api: api,\n event: event,\n infiniteScroll: new InfiniteScroll(undefined, event.infiniteScroll),\n helpers: helpers.helpers,\n lang: (__webpack_require__(/*! ./lang */ \"./twilight/lang/index.js\")[\"default\"]),\n //Aliases\n cart: new Cart(api.cart, event.cart),\n auth: new Auth(api.auth, event.auth),\n order: new Order(api.order, event.order),\n gift: new Gift(api.gift, event.gift),\n loyalty: new Loyalty(api.loyalty, event.loyalty),\n offer: new Offer(api.offer, event.offer),\n search: new Search(api.search, event.search),\n coupon: new Coupon(api.coupon, event.coupon),\n comment: new Comment(api.comment, event.comment),\n product: new Product(api.product, event.product),\n currency: new Currency(api.currency, event.currency),\n document: new Document(api.document, event.document),\n feedback: new Feedback(api.feedback, event.feedback),\n wishlist: new Wishlist(api.wishlist, event.wishlist),\n log: notify.log,\n success: notify.success,\n error: notify.error,\n init: helpers.default\n};\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/main.js?");
|
|
1138
|
+
|
|
1139
|
+
/***/ }),
|
|
1140
|
+
|
|
1141
|
+
/***/ "./twilight/notify/index.js":
|
|
1142
|
+
/*!**********************************!*\
|
|
1143
|
+
!*** ./twilight/notify/index.js ***!
|
|
1144
|
+
\**********************************/
|
|
1145
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1146
|
+
|
|
1147
|
+
"use strict";
|
|
1148
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"fire\": () => (/* binding */ fire),\n/* harmony export */ \"setNotifier\": () => (/* binding */ setNotifier),\n/* harmony export */ \"log\": () => (/* binding */ log),\n/* harmony export */ \"setLogger\": () => (/* binding */ setLogger),\n/* harmony export */ \"error\": () => (/* binding */ error),\n/* harmony export */ \"success\": () => (/* binding */ success),\n/* harmony export */ \"info\": () => (/* binding */ info),\n/* harmony export */ \"sallaInitiated\": () => (/* binding */ sallaInitiated),\n/* harmony export */ \"types\": () => (/* binding */ types)\n/* harmony export */ });\nlet notifier = function (message, type, data) {\n return alert(message, type, data);\n};\n\nlet setNotifier = function (callback) {\n notifier = callback;\n};\n\nlet fire = function (message, type, data) {\n return notifier(message, type, data);\n};\n\nlet error = function (message, data) {\n return notifier(message, types.error, data);\n};\n\nlet info = function (message, data) {\n return notifier(message, types.info, data);\n};\n\nlet success = function (message, data) {\n return notifier(message, types.success, data);\n};\n\nlet logger = function (...data) {\n return console.log(...data);\n};\n\nlet setLogger = function (callback) {\n logger = callback;\n};\n\nlet log = function (...data) {\n return logger(...data);\n};\n\nvar sallaInitiated = function () {\n //get error messages\n // we can use \"(?<=[\\?\\&]danger=)[^&]+\" but it's not working in safari, so use normal regs, then replace danger.\n var results = window.location.href.match(/([\\?\\&]danger=)[^&]+/g);\n\n if (!results) {\n return;\n }\n\n results.forEach(message => {\n error(decodeURI(message.replace('?danger=', '').replace('&danger=', '')));\n });\n};\n/**\n * in case there is need to map types, it's possible from here;\n * @type {{success: string, error: string, info: string}}\n */\n\n\nvar types = {\n error: \"error\",\n success: \"success\",\n info: \"info\"\n};\n\n\n//# sourceURL=webpack://@salla.sa/twilight/./twilight/notify/index.js?");
|
|
1149
|
+
|
|
1150
|
+
/***/ })
|
|
1151
|
+
|
|
1152
|
+
/******/ });
|
|
1153
|
+
/************************************************************************/
|
|
1154
|
+
/******/ // The module cache
|
|
1155
|
+
/******/ var __webpack_module_cache__ = {};
|
|
1156
|
+
/******/
|
|
1157
|
+
/******/ // The require function
|
|
1158
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1159
|
+
/******/ // Check if module is in cache
|
|
1160
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1161
|
+
/******/ if (cachedModule !== undefined) {
|
|
1162
|
+
/******/ return cachedModule.exports;
|
|
1163
|
+
/******/ }
|
|
1164
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1165
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
1166
|
+
/******/ // no module.id needed
|
|
1167
|
+
/******/ // no module.loaded needed
|
|
1168
|
+
/******/ exports: {}
|
|
1169
|
+
/******/ };
|
|
1170
|
+
/******/
|
|
1171
|
+
/******/ // Execute the module function
|
|
1172
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
1173
|
+
/******/
|
|
1174
|
+
/******/ // Return the exports of the module
|
|
1175
|
+
/******/ return module.exports;
|
|
1176
|
+
/******/ }
|
|
1177
|
+
/******/
|
|
1178
|
+
/************************************************************************/
|
|
1179
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
1180
|
+
/******/ (() => {
|
|
1181
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
1182
|
+
/******/ __webpack_require__.n = (module) => {
|
|
1183
|
+
/******/ var getter = module && module.__esModule ?
|
|
1184
|
+
/******/ () => (module['default']) :
|
|
1185
|
+
/******/ () => (module);
|
|
1186
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
1187
|
+
/******/ return getter;
|
|
1188
|
+
/******/ };
|
|
1189
|
+
/******/ })();
|
|
1190
|
+
/******/
|
|
1191
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1192
|
+
/******/ (() => {
|
|
1193
|
+
/******/ // define getter functions for harmony exports
|
|
1194
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
1195
|
+
/******/ for(var key in definition) {
|
|
1196
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
1197
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
1198
|
+
/******/ }
|
|
1199
|
+
/******/ }
|
|
1200
|
+
/******/ };
|
|
1201
|
+
/******/ })();
|
|
1202
|
+
/******/
|
|
1203
|
+
/******/ /* webpack/runtime/global */
|
|
1204
|
+
/******/ (() => {
|
|
1205
|
+
/******/ __webpack_require__.g = (function() {
|
|
1206
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
1207
|
+
/******/ try {
|
|
1208
|
+
/******/ return this || new Function('return this')();
|
|
1209
|
+
/******/ } catch (e) {
|
|
1210
|
+
/******/ if (typeof window === 'object') return window;
|
|
1211
|
+
/******/ }
|
|
1212
|
+
/******/ })();
|
|
1213
|
+
/******/ })();
|
|
1214
|
+
/******/
|
|
1215
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1216
|
+
/******/ (() => {
|
|
1217
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1218
|
+
/******/ })();
|
|
1219
|
+
/******/
|
|
1220
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
1221
|
+
/******/ (() => {
|
|
1222
|
+
/******/ // define __esModule on exports
|
|
1223
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
1224
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
1225
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
1226
|
+
/******/ }
|
|
1227
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
1228
|
+
/******/ };
|
|
1229
|
+
/******/ })();
|
|
1230
|
+
/******/
|
|
1231
|
+
/************************************************************************/
|
|
1232
|
+
/******/
|
|
1233
|
+
/******/ // startup
|
|
1234
|
+
/******/ // Load entry module and return exports
|
|
1235
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
1236
|
+
/******/ var __webpack_exports__ = __webpack_require__("./twilight/main.js");
|
|
1237
|
+
/******/
|
|
1238
|
+
/******/ })()
|
|
1239
|
+
;
|