{"size": 8501, "ext": "js", "max_stars_repo_path": "public/dist/app.js", "max_stars_repo_name": "MeuhMeuhConcept/js-starter", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/dist/app.js", "max_issues_repo_name": "MeuhMeuhConcept/js-starter", "max_issues_repo_issues_event_min_datetime": "2020-12-11T17:21:45.000Z", "max_issues_repo_issues_event_max_datetime": "2020-12-11T17:24:36.000Z", "max_forks_repo_path": "public/dist/app.js", "max_forks_repo_name": "MeuhMeuhConcept/js-starter", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 4250.5, "max_line_length": 8469, "alphanum_fraction": 0.7677920245}
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var r in s)("object"==typeof exports?exports:e)[r]=s[r]}}(window,(function(){return function(e){var t={};function s(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,s),o.l=!0,o.exports}return s.m=e,s.c=t,s.d=function(e,t,r){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(s.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(r,o,function(t){return e[t]}.bind(null,o));return r},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/dist/",s(s.s=1)}([function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t=!0,s=!0){this._xhr=null,this._url="",this._listeners=[],this._responseStatus=null,this._responseTextStatus="",this._responseData=null,this._status="waiting",this._progress=0,this.isAppend=!1,this.autoAppend=!0,this.callbackDone=e=>{this._xhr&&(this._responseStatus=this._xhr.status,this._responseTextStatus=this._xhr.statusText,this._responseData=this._xhr.responseText,this._progress=100,this._status=200===this._xhr.status?"done":"error",this._xhr=null,this.dispatch())},this.callbackFail=e=>{this._xhr&&(this._responseStatus=this._xhr.status,this._responseTextStatus=this._xhr.statusText,this._responseData=this._xhr.responseText,this._progress=100,this._status="error",this._xhr=null,this.dispatch())},this.callbackProgress=e=>{e.lengthComputable&&(this._progress=Math.ceil(100*e.loaded/e.total)),this.dispatch()},this.callbackAbort=e=>{this._xhr&&(this._progress=100,this._status="canceled",this._xhr=null,this.dispatch())},this._url=e,this.autoAppend=s,t&&this.load()}get status(){return this._status}get progress(){return this._progress}get responseStatus(){return this._responseStatus}get responseTextStatus(){return this._responseTextStatus}get responseData(){return this._responseData}onUpdate(e){this._listeners.push(e)}abort(){this._xhr&&this._xhr.abort()}load(){this.abort(),this._status="pending",this._xhr=new XMLHttpRequest,this._xhr.onprogress=this.callbackProgress,this._xhr.onerror=this.callbackFail,this._xhr.onload=this.callbackDone,this._xhr.onabort=this.callbackAbort,this._xhr.open("GET",this._url,!0),this._xhr.send(null),this.dispatch()}dispatch(){for(let e of this._listeners)e(this);this.autoAppend&&"done"===this.status&&this.append()}append(){"done"!==this.status||this.isAppend||(this.doAppend(),this.isAppend=!0)}doAppend(){}}},function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),s(2);const o=new(r(s(3)).default)("app");o.errorMessage="Oups...",o.addResources(window.__ENV__.resources)},function(e,t,s){},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=s(4);t.default=class{constructor(e){this._elementInDom=!1,this._errorShown=!1,this.errorMessage=null,this._loader=new r.MultiResourceLoader,e&&(this._contentElement=document.getElementById(e)),this._loader.onUpdate(e=>{this.show(),"done"!==e.status?"error"!==e.status?this._progressBarElement.setAttribute("style",`width: ${e.progress}%`):this.error():this.done()}),this._element=document.createElement("div"),this._element.className="resources-loader-layout";const t=document.createElement("div");t.className="resources-loader-box";const s=document.createElement("div");s.className="resources-loader-indicator";const o=document.createElement("div");o.className="progress resources-loader-progress",this._progressBarElement=document.createElement("div"),this._progressBarElement.className="progress-bar bg-primary",this._progressBarElement.setAttribute("style","width: 0%"),o.appendChild(this._progressBarElement),s.appendChild(o),t.appendChild(s),this._element.appendChild(t)}addResources(e){for(let t in e){let s=e[t];/\.js$/.test(s)?this._loader.addResourceLoader(t,new r.JSLoader(s,!1,!1)):/\.css$/.test(s)?this._loader.addResourceLoader(t,new r.CSSLoader(s,!1,!1)):this._loader.addResourceLoader(t,new r.SimpleResourceLoader(s,!1,!1))}this._loader.load()}show(){this._elementInDom||(this._contentElement&&this._contentElement.setAttribute("style","display: none"),document.body.appendChild(this._element),this._elementInDom=!0)}hide(){this._elementInDom&&(this._contentElement&&this._contentElement.removeAttribute("style"),document.body.removeChild(this._element),this._elementInDom=!1)}done(){this._loader.append(),this.hide()}error(){this._errorShown||(this._progressBarElement.setAttribute("style","width: 100%"),this._progressBarElement.className="progress-bar bg-danger",this.errorMessage&&(this._element.className=this._element.className+" error",this._progressBarElement.appendChild(document.createTextNode(this.errorMessage))),this._errorShown=!0)}}},function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(0));t.SimpleResourceLoader=o.default;const i=r(s(5));t.MultiResourceLoader=i.default;const n=r(s(6));t.CSSLoader=n.default;const a=r(s(7));t.JSLoader=a.default},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this._resourceLoaders={},this._nbResourceLoaders=0,this._listeners=[],this._status="waiting",this._progress=0}addResourceLoader(e,t){this._resourceLoaders[e]||(this._resourceLoaders[e]=t,t.onUpdate(e=>{this.refreshStatus(),this.refreshProgress()})),this.refreshNbResourceLoaders()}getResourceLoader(e){return this._resourceLoaders[e]?this._resourceLoaders[e]:null}onUpdate(e){this._listeners.push(e)}get status(){return this._status}get progress(){return this._progress}get responseData(){const e={};for(let t in this._resourceLoaders)e[t]=this._resourceLoaders[t].responseData;return e}abort(){for(let e in this._resourceLoaders)this._resourceLoaders[e].abort()}load(){for(let e in this._resourceLoaders)"done"!==this._resourceLoaders[e].status&&this._resourceLoaders[e].load();this._nbResourceLoaders||(this._status="done",this.dispatch())}append(){for(let e in this._resourceLoaders)this._resourceLoaders[e].append()}dispatch(){for(let e of this._listeners)e(this)}refreshStatus(){const e={waiting:0,pending:0,canceled:0,error:0,done:0};for(let t in this._resourceLoaders)e[this._resourceLoaders[t].status]++;let t=this._status;e.error>0?this._status="error":e.done===this._nbResourceLoaders?this._status="done":e.canceled===this._nbResourceLoaders?this._status="canceled":e.pending>0?this._status="pending":this._status="waiting",t!==this._status&&this.dispatch()}refreshProgress(){let e=this._progress;if(this._nbResourceLoaders){let e=0;for(let t in this._resourceLoaders)e+=this._resourceLoaders[t].progress;this._progress=Math.round(e/this._nbResourceLoaders)}else this._progress=100;e!==this._progress&&this.dispatch()}refreshNbResourceLoaders(){this._nbResourceLoaders=0;for(let e in this._resourceLoaders)this._nbResourceLoaders++}}},function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(0));class i extends o.default{constructor(){super(...arguments),this.doAppend=()=>{const e=document.createElement("style");e.appendChild(document.createTextNode(this.responseData));let t=document.head;t||(t=document.createElement("head"),document.appendChild(t)),t.appendChild(e)}}}t.default=i},function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(0));class i extends o.default{constructor(){super(...arguments),this.doAppend=()=>{const e=document.createElement("script");e.type="text/javascript",e.appendChild(document.createTextNode(this.responseData)),document.body.appendChild(e)}}}t.default=i}])}));
//# sourceMappingURL=app.js.map