text: System.register(["react","react-dom"],function(a){'use strict';var b,c;return{setters:[function(a){b=a.default},function(a){c=a.default}],execute:function(){function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function f(a,b,c){return b&&e(a.prototype,b),c&&e(a,c),a}function g(a){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},g(a)}function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function i(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function j(a,b,c){return b&&i(a.prototype,b),c&&i(a,c),a}function k(a,b){return b&&("object"===g(b)||"function"==typeof b)?b:l(a)}function l(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function m(a){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},m(a)}function n(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&q(a,b)}function q(a,b){return q=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a},q(a,b)}function r(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function s(a){for(var b=1;b<arguments.length;b++){var c=null==arguments[b]?{}:arguments[b],d=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&(d=d.concat(Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable}))),d.forEach(function(b){t(a,b,c[b])})}return a}function t(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function u(a){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},u(a)}function v(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function w(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function x(a,b,c){return b&&w(a.prototype,b),c&&w(a,c),a}var y=function(){function a(b){d(this,a),this.url=null,this.name=null,this.settings={},this.title="",this.isRoot=void 0,this.params=void 0,this.regex=void 0,this.url=b.url,this.name=b.name,this.title=b.title,this.settings=b.settings,this.isRoot="/"==this.url,this.params={},this.regex=new RegExp(this.url.concat("$").toLowerCase().replace(/\{\w+\}/g,"([\\w-]+)")),this._extractUrlParamsKey()}return f(a,[{key:"_extractUrlParamsKey",value:function(){for(var a,b=new RegExp(/\{(\w+)\}/g);a=b.exec(this.url);)this.params[a[1]]=null}},{key:"load",value:function(){alert("not implemented")}},{key:"_loadResource",value:function(a){return new Promise(function(b,c){SystemJS||(console.error("we need systemjs  as a dependency to load modules pls setup systemjs for that"),c("systemjs is not defined")),SystemJS.import(a).then(function(a){b(a)}).catch(function(a){c(a)})})}}]),a}(),z=function(a){function d(a){var b;return h(this,d),b=k(this,m(d).call(this,a)),b.componentPath=null,b.componentPath=a.reactComponentPath,b}return n(d,a),j(d,[{key:"load",value:function(){var a=this;return new Promise(function(b,c){a._loadResource(a.componentPath).then(function(a){a.default?b(a.default):c({message:"the react component you want to load and initiate does not export defualt class to initiate. please add <export defualt ClassName> in your js file"})}).catch(function(a){c(a)})})}},{key:"loadge",value:function(a,d){return new Promise(function(e){c.unmountComponentAtNode(d),c.render(b.createElement(a,null),d,function(){e(a)})})}}]),d}(y),A=function a(b){switch(r(this,a),b.type){case"REACT":return new z(b);break;case void 0:return new y(b);}},B=[],C=Symbol(),D=function(){function a(b,c){var d=this;if(v(this,a),this.treeBaseRoutes=[],this.routes=[],this.errorRoutes={},this.routeGroupsName=[],this.basePath=void 0,this.matchedRoute={},this.componentsPathPrefix="/",this.pageContainerTagId=void 0,this.isPageContainerMounted=!1,this.params={},this.currentPage={routeDataObject:{},params:{},jsClass:null},this.pagesTitlePrefix="",this.loadState=void 0,this.config={instanceName:"defualt",events:{onLoadStateChange:null}},this.newException=c?c.newException:this.createVirtualExceptionHandler(),"object"==u(b)&&Object.assign(this.config,b),!B[this.config.instanceName])B[this.config.instanceName]=this;else return B[this.config.instanceName];return this.treeBaseRoutes=this.config.routes,this.basePath=this.config.basePath,this.pageContainerTagId=this.config.pageContainerTagId,this.componentsPathPrefix=this.config.componentsPathPrefix,this.pagesTitlePrefix=this.config.pagesTitlePrefix,this._initLoadState(),this._normalizeAndOptimazeRoutes(),window.addEventListener("popstate",function(a){return d._onBrowserPopState(a)}),B[this.config.instanceName]}return x(a,[{key:"pageContainerDidMount",value:function(){return this.containerDom=document.getElementById(this.pageContainerTagId),this.containerDom?void(this.isPageContainerMounted=!0):(this.newException("router can't find dom with "+this.pageContainerTagId+" ID maybe your html page is not ready yet"),!1)}},{key:"_initLoadState",value:function(){this[C]=null}},{key:"_callLoadStateChange",value:function(a,b){this.config.events.onLoadStateChange&&this.config.events.onLoadStateChange(a,b)}},{key:"_onBrowserPopState",value:function(a){var b=a.state;return b&&b.pushedByJBRouter&&this.loadPage(b.absolutePath,!1),!0}},{key:"_normalizeAndOptimazeRoutes",value:function(){var a=this;(function b(c,d,e){var f=!0,g=!1,h=void 0;try{for(var i,j,k=c[Symbol.iterator]();!(f=(i=k.next()).done);f=!0){j=i.value,j.settings=Object.assign(j.settings||{},e),j.url=d+j.url,j.reactComponentPath&&(j.reactComponentPath=a.componentsPathPrefix+j.reactComponentPath);var l=new A(j);a.routes.push(l),j.childRoutes&&b(j.childRoutes,l.url,l.settings)}}catch(a){g=!0,h=a}finally{try{f||null==k.return||k.return()}finally{if(g)throw h}}})(this.treeBaseRoutes,"",{}),this.config.standardPageRoutes[404]&&(this.errorRoutes[404]=new A(this.config.standardPageRoutes[404])),this.config.standardPageRoutes[424]&&(this.errorRoutes[424]=new A(this.config.standardPageRoutes[424]))}},{key:"_matchPathToOneRoute",value:function(a){var b,c=!0,d=!1,e=void 0;try{for(var f,g,h=this.routes[Symbol.iterator]();!(c=(f=h.next()).done);c=!0)if(g=f.value,"/"==a&&g.isRoot){b=g;break}else if("/"!=a&&!g.isRoot&&(b=a.match(g.regex),b)){var j=1;for(var k in g.params)g.params[k]=b[j++];b=g,this.params=g.params;break}}catch(a){d=!0,e=a}finally{try{c||null==h.return||h.return()}finally{if(d)throw e}}return this.matchedRoute=b?b:this.errorRoutes[404],this.matchedRoute}},{key:"loadPage",value:function(a,b){if(!this.isPageContainerMounted)return this.newException("router can`t load route and render it before 'pageContainerDidMount' function called"),!1;var c=this._normalizePath(a);if(-1!=c){var d=this._matchPathToOneRoute(c);if(d){var e=!0;if(null!=d.componentPath&&null!=d.componentPath||(e=!1,this.newException(new Error(d),"the matched Route we find dosent have any component path to load. /n please define component path so we can load and place it")),e)return this._callLoadStateChange(this[C],0),this[C]=0,this._loadComponent(d),this._setPageAttributes(d.title,a,b),d}else return this.newException(new Error(a),"\u0622\u062F\u0631\u0633 \u0648\u0627\u0631\u062F \u0634\u062F\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"),-1}else return this.newException(new Error(a,"\u0622\u062F\u0631\u0633 \u0648\u0627\u0631\u062F \u0634\u062F\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F")),-1}},{key:"_loadComponent",value:function(a){var b=this;a.load().then(function(c){b._onRouteLoadComplete(a,c)}).catch(function(c){b._onRouteLoadError(c,a)})}},{key:"_setPageAttributes",value:function(a,b){var c=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];if(document.title=a+" | "+this.pagesTitlePrefix,c){var d={pushedByJBRouter:!0,routeObject:this.matchedRoute,absolutePath:b};window.history.pushState(d,this.pagesTitlePrefix+a,b)}}},{key:"_onRouteLoadComplete",value:function(a,b){var c=this;this._callLoadStateChange(this[C],1),this[C]=1,a.loadge(b,this.containerDom).then(function(a){c._onRouteLoadgeComplete(a)}).catch(function(a){c.newException(a,"we have exception in loadge the page. \n"),c._onRouteLoadError(a,reactRoute)})}},{key:"_onRouteLoadError",value:function(a,b){var c=this;this.newException(a,"we had a problem to load component"),this.loadComponentTryCount?this.loadComponentTryCount++:this.loadComponentTryCount=1,6>this.loadComponentTryCount?setTimeout(function(){c._loadComponent(b)},2e3*this.loadComponentTryCount):this._loadComponent(this.errorRoutes[424])}},{key:"_onRouteLoadgeComplete",value:function(a){this.currentPage.routeDataObject=s({},this.matchedRoute),this.currentPage.jsClass=s({},a),this.currentPage.params=s({},this.params),this._callLoadStateChange(this[C],5),this[C]=5}},{key:"_normalizePath",value:function(a){var b=a.toLowerCase(),c=b.indexOf(this.basePath.toLowerCase());if(-1==c)return-1;var d=b.substring(this.basePath.length,b.length);return"/"==d[d.length-1]&&"/"!=d?d=d.substring(0,d.length-1):""==d&&(d="/"),-1!=d.lastIndexOf("?")&&(d=d.slice(0,d.lastIndexOf("?"))),d}},{key:"createVirtualExceptionHandler",value:function(){return function(a,b){console.error(b,null,a)}}},{key:"loadState",get:function(){return this[C]},set:function(a){4<a&&10>a?(this._callLoadStateChange(this[C],a),this[C]=a):this.newException({invalidValue:a},"\u0645\u0642\u062F\u0627\u0631 \u0633\u062A \u0634\u062F\u0647 \u0628\u0631\u0627\u06CC \u0648\u0636\u0639\u06CC\u062A \u0644\u0648\u062F\u06CC\u0646\u06AF \u0646\u0645\u06CC\u062A\u0648\u0627\u0646\u062F \u06A9\u0645\u062A\u0631 \u067E\u0646\u062C \u0648 \u0628\u06CC\u0634\u062A\u0631 \u0627\u0632 \u062F\u0647 \u0628\u0627\u0634\u062F \n")}}]),a}();a("default",D)}}});
  