-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain-es2015.3bbf7371bf28262f313d.js
1 lines (1 loc) · 17.7 KB
/
main-es2015.3bbf7371bf28262f313d.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"/3IS":function(t,e,n){"use strict";n.d(e,"a",function(){return O});var r=n("6uGs"),o=n("kZht"),s=n("Vhhf"),i=n("ulty"),u=n("47ST"),c=n("8j5Y"),a=n("4e/d"),l=n("ruxD"),p=n("J+dc"),h=n("o4/X"),d=n("SRZ4"),b=n("s037"),f=n("YSOR"),m=n("WSVK");let O=(()=>{class t extends b.a{constructor(){super(Object(o.V)(r.a),Object(o.V)(f.a),Object(o.V)(m.a),Object(o.V)(h.a))}request(t){var e,n;if(Object(s.d)(this.local))throw new Error("You must use the @RestClient('controller') decorator for work correctly");null===(n=(e=this.interceptor).onBeforeRequest)||void 0===n||n.call(e,t);const r=this.createMetaDataRequest(t),o=this.http.request(t.method,r.url,r.requestOptions),i=this.limitConcurrency.add(o,t.clientOptions.limitConcurrency);return this.wrapHttpRequestWithMeta(r,t,i)}restTemplate(t){return new d.a(t).asProxyObservable()}createMetaDataRequest(t){const{emitSuccess:e,emitFailure:n}=t.clientOptions,r=Object(i.e)(t.clientOptions,this.controllerUrl,t.path),o=this.createDataHttpRequestOptions(t),s=Object(i.a)(r);return{method:t.method,url:s,emitSuccess:e,emitFailure:n,requestOptions:o,segments:r}}wrapHttpRequestWithMeta(t,e,n){return n.pipe(Object(c.a)(n=>this.onSuccess(n,t,e),n=>this.onError(n,t,e)),Object(a.a)(e=>this.onCatch(e,t)),Object(l.a)(()=>{var e,n;return null===(n=(e=this.interceptor).onFinalizeAfterRequest)||void 0===n?void 0:n.call(e,t)}),Object(p.a)(1))}onSuccess(t,e,n){var r,o,i,u,c;Object(s.f)(n.clientOptions.emitSuccess)&&(null===(r=this.interceptor.success$)||void 0===r||r.next({options:n,meta:e}),null===(i=(o=this.interceptor).onEmitSuccess)||void 0===i||i.call(o,t,n,e)),null===(c=(u=this.interceptor).onTapAfterRequest)||void 0===c||c.call(u,t,e)}onError(t,e,n){var r,o,i,u,c;Object(s.f)(n.clientOptions.emitFailure)&&(null===(r=this.interceptor.errors$)||void 0===r||r.next({error:t,options:n,meta:e}),null===(i=(o=this.interceptor).onEmitFailure)||void 0===i||i.call(o,t,n,e)),null===(c=(u=this.interceptor).onErrorAfterRequest)||void 0===c||c.call(u,t,e)}onCatch(t,e){var n,r,o;return null!==(o=null===(r=(n=this.interceptor).onCatchErrorAfterRequest)||void 0===r?void 0:r.call(n,t,e))&&void 0!==o?o:Object(u.a)(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=o.Hb({token:t,factory:t.\u0275fac}),t})()},0:function(t,e,n){t.exports=n("2v48")},"2v48":function(t,e,n){"use strict";n.r(e);var r=n("ENSU"),o=n("kZht"),s=n("Vhhf"),i=n("6uGs"),u=n("uryd"),c=n("P0vk"),a=n("aJOL"),l=n("FxgA"),p=n("b5Xb"),h=n("1VvW"),d=n("8EXQ");let b=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Fb({type:t,selectors:[["app-root"]],decls:32,vars:0,consts:[[1,"dashboard"],["mode","side","opened","",1,"dashboard__menu"],[1,"title"],["src","assets/img/angular.svg","alt","angular",1,"logo"],["routerLink","/",1,"logo-title"],[1,"menu"],[1,"menu__item"],["routerLink","samples/guide"],[1,"dashboard__content"]],template:function(t,e){1&t&&(o.Ob(0,"mat-drawer-container",0),o.jc(1,"\n "),o.Ob(2,"mat-drawer",1),o.jc(3,"\n "),o.Ob(4,"mat-toolbar",2),o.jc(5,"\n "),o.Mb(6,"img",3),o.jc(7,"\n "),o.Ob(8,"a",4),o.jc(9,"@angular-ru/http"),o.Nb(),o.jc(10,"\n "),o.Nb(),o.jc(11,"\n\n "),o.Ob(12,"mat-list",5),o.jc(13,"\n "),o.Ob(14,"mat-list-item",6),o.jc(15,"\n "),o.Ob(16,"a",7),o.jc(17,"- "),o.Ob(18,"strong"),o.jc(19,"Guide overview"),o.Nb(),o.Nb(),o.jc(20,"\n "),o.Nb(),o.jc(21,"\n "),o.Mb(22,"mat-divider"),o.jc(23,"\n "),o.Nb(),o.jc(24,"\n "),o.Nb(),o.jc(25,"\n\n "),o.Ob(26,"mat-drawer-content",8),o.jc(27,"\n "),o.Mb(28,"router-outlet"),o.jc(29,"\n "),o.Nb(),o.jc(30,"\n"),o.Nb(),o.jc(31,"\n"))},directives:[c.b,c.a,a.a,h.b,u.a,u.b,d.a,c.c,h.d],encapsulation:2,changeDetection:0}),t})(),f=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.Jb({type:t}),t.\u0275inj=o.Ib({imports:[[h.c.forRoot([{path:"",pathMatch:"full",redirectTo:"samples"},{path:"samples",children:[{path:"",pathMatch:"full",redirectTo:"guide"},{path:"guide",loadChildren:()=>n.e(6).then(n.bind(null,"G7lC")).then(t=>t.GuideModule)}]}],{useHash:!0,scrollPositionRestoration:"enabled"})],h.c]}),t})();var m=n("Ht68");n("b2Yo");let O=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.Jb({type:t,bootstrap:[b]}),t.\u0275inj=o.Ib({imports:[[r.a,i.b,f,l.b,c.d,a.b,u.c,p.b.forRoot([m.a],{hostUrl:"https://jsonplaceholder.typicode.com",limitConcurrency:5})]]}),t})();Object(s.f)(!0)&&Object(o.T)(),r.c().bootstrapModule(O,{ngZoneEventCoalescing:!0}).catch(t=>console.error(t))},F3WU:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){return t.GET="get",t.POST="post",t.PATCH="patch",t.PUT="put",t.DELETE="delete",t}({})},Ht68:function(t,e,n){"use strict";n.d(e,"a",function(){return f});var r=n("D57K"),o=n("b5Xb"),s=n("Vhhf"),i=n("ulty"),u=n("F3WU");class c extends Error{constructor(t,e){super(`An argument with the name '${t}' already exists in the method '${e}'`)}}class a{constructor(){this.argumentsIndexMap=new Map}get size(){return this.argumentsIndexMap.size}getNameByIndex(t){var e,n;return null!==(n=null===(e=this.argumentsIndexMap.get(t))||void 0===e?void 0:e.key)&&void 0!==n?n:null}getIndexByKey(t){var e,n;return null!==(n=null===(e=this.argumentsIndexMap.get(t))||void 0===e?void 0:e.index)&&void 0!==n?n:null}putIndexByName(t,e,n){const r={key:t,index:n};this.checkDuplicateName(t,e),this.argumentsIndexMap.set(n,r),this.argumentsIndexMap.set(t,r)}checkDuplicateName(t,e){if(this.argumentsIndexMap.has(t))throw new c(t,e)}}function l(t,e){let n=function(t,e){var n,r;return null!==(r=null===(n=t)||void 0===n?void 0:n[e])&&void 0!==r?r:null}(t,e);return Object(s.d)(n)&&(n=new a,Object.defineProperties(t,{[e]:{enumerable:!0,configurable:!0,value:n}})),n}function p(t="/",e={emitFailure:!0,emitSuccess:!1}){return(n,r,o)=>function({path:t,type:e,target:n,descriptor:r,emitOptions:o}){!function(t,e){if(t.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with current decorator");if(void 0===e)throw new Error("Current decorator can only decorate a method implementation")}(n,r);const u=r.value;return r.value=function(...n){var r,c,a;let p=t.toString();const h=this,d=u.apply(h,n);let b=null!==(r=null==d?void 0:d.restTemplateRef)&&void 0!==r?r:null;if(!Object(s.e)(b))throw new Error("You must return observable from your method");{p=function(t){const{originalMethod:e,args:n,path:r,pathVariables:o}=t,u=l(e,"META_PATH_VARIABLE"),c=null!=o?o:{},a=new Map;!function(t,e,n){n.size>0&&e.forEach((e,r)=>{const o=n.getNameByIndex(r);Object(s.e)(o)&&t.set(o,e)})}(a,n,u),function(t,e){if(Object.keys(e).length>0)for(const n in e)e.hasOwnProperty(n)&&t.set(n,e[n])}(a,c);let p=r.toString();return a.size>0&&(p=Object(i.b)(p,a)),p}({args:n,path:p,originalMethod:u,pathVariables:b.options.pathVariables});const t=l(u,"META_REQUEST_BODY").getIndexByKey("KEY_REQUEST_BODY"),r=Object(s.d)(t)?null==b?void 0:b.options.body:null!==(c=null==b?void 0:b.options.body)&&void 0!==c?c:null==n?void 0:n[t],a=function(t,e,n){const r=l(e,"META_REQUEST_PARAM");if(r.size){const e={};return n.forEach((t,n)=>{const o=r.getNameByIndex(n);Object(s.e)(o)&&(e[o]=t)}),Object.assign(Object.assign({},e),t)}return t}(null==b?void 0:b.options.queryParams,u,n);b=null==b?void 0:b.setPath(p).setMethodType(e).setBody(r).setParams(a).setEmitOptions(o).setClient(h)}return null===(a=null==b?void 0:b.asObservable)||void 0===a?void 0:a.call(b)},r}({path:t,type:u.a.GET,target:n,descriptor:o,emitOptions:e})}function h(t=""){return e=>{Object.defineProperties(e.prototype,{controllerUrl:{writable:!0,enumerable:!0,configurable:!0,value:t},local:{writable:!0,enumerable:!0,configurable:!0,value:{restUrl:t}}})}}var d=n("IdLP"),b=n("kZht");let f=(()=>{let t=class extends o.a{posts(){return this.restTemplate()}comments(){return this.restTemplate()}albums(){return this.restTemplate()}photos(){return this.restTemplate()}todos(){return this.restTemplate()}users(){return this.restTemplate()}};return t.\u0275fac=function(e){return m(e||t)},t.\u0275prov=b.Hb({token:t,factory:t.\u0275fac}),Object(r.a)([p("posts"),Object(r.b)("design:type",Function),Object(r.b)("design:paramtypes",[]),Object(r.b)("design:returntype",d.a)],t.prototype,"posts",null),Object(r.a)([p("comments"),Object(r.b)("design:type",Function),Object(r.b)("design:paramtypes",[]),Object(r.b)("design:returntype",d.a)],t.prototype,"comments",null),Object(r.a)([p("albums"),Object(r.b)("design:type",Function),Object(r.b)("design:paramtypes",[]),Object(r.b)("design:returntype",d.a)],t.prototype,"albums",null),Object(r.a)([p("photos"),Object(r.b)("design:type",Function),Object(r.b)("design:paramtypes",[]),Object(r.b)("design:returntype",d.a)],t.prototype,"photos",null),Object(r.a)([p("todos"),Object(r.b)("design:type",Function),Object(r.b)("design:paramtypes",[]),Object(r.b)("design:returntype",d.a)],t.prototype,"todos",null),Object(r.a)([p("users"),Object(r.b)("design:type",Function),Object(r.b)("design:paramtypes",[]),Object(r.b)("design:returntype",d.a)],t.prototype,"users",null),t=Object(r.a)([h("")],t),t})();const m=b.Qb(f)},JN4H:function(t,e,n){"use strict";n.d(e,"a",function(){return s}),n.d(e,"b",function(){return i}),n.d(e,"c",function(){return u});var r=n("Vhhf");function o(t,e){return Object(r.b)(e)?void 0:e}function s(t){return JSON.parse(JSON.stringify(t,o))}function i(t,e,n){var o,s,i;if((null!==(o=null==e?void 0:e.length)&&void 0!==o?o:0)<1)return t;let u=t;const c=null!==(s=null==e?void 0:e.split("."))&&void 0!==s?s:[];let a=0;for(;Object(r.e)(u)&&a<c.length;++a){const t=null==c?void 0:c[a];u=null===(i=u)||void 0===i?void 0:i[t]}return null!=u?u:n}function u(t){return JSON.parse(JSON.stringify(t,function(t,e){return"object"==typeof e?e:Object(r.b)(e)?null:e}))}},SRZ4:function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n("Vhhf");class o{constructor(t={}){this.options=t,this.operators=[],this.markAsRequest=!1,this._client=null}setPath(t){return this.path=t,this}setMethodType(t){return this.methodType=t,this}setClient(t){return this._client=t,this}setEmitOptions(t){var e,n;return Object(r.f)(t.override)?(this.options.emitSuccess=t.emitSuccess,this.options.emitFailure=t.emitFailure):(this.options.emitSuccess=null!==(e=this.options.emitSuccess)&&void 0!==e?e:t.emitSuccess,this.options.emitFailure=null!==(n=this.options.emitFailure)&&void 0!==n?n:t.emitFailure),this}setBody(t){return this.options.body=t,this}setParams(t){return this.options.queryParams=t,this}setOptions(t){return this.options=Object.assign(Object.assign({},this.options),t),this}asProxyObservable(){const t=this,e={restTemplateRef:t,pipe:(...n)=>(t.operators.push(...n),e),subscribe:()=>{if(!t.markAsRequest)throw new Error("You cannot invoke observable outside data request context. \nUse only @Get, @Post, @Put, @Delete decorators for correct call http method...")}};return e}asObservable(){var t;if(this.markAsRequest=!0,Object(r.d)(this._client))throw new Error("Not found http client");if(Object(r.d)(null===(t=this._client)||void 0===t?void 0:t[this.methodType]))throw new Error(`Method ${this.methodType} not supported`);const e=this._client.createRequestOptions({path:this.path,method:this.methodType,options:this.options});let n=this._client.request(e);return this.operators.length&&this.operators.forEach(t=>{n=n.pipe(t)}),n}}},Vhhf:function(t,e,n){"use strict";function r(t){return t}function o(t){const e="string"==typeof t?t.trim():t;return[void 0,null,NaN,"",1/0].includes(e)}function s(t){return!o(t)}function i(t){return!0===t}function u(t){return null==t}function c(t){return!u(t)}function a(t){return Boolean(t)}n.d(e,"a",function(){return r}),n.d(e,"b",function(){return o}),n.d(e,"c",function(){return s}),n.d(e,"d",function(){return u}),n.d(e,"e",function(){return c}),n.d(e,"f",function(){return i}),n.d(e,"g",function(){return a})},WSVK:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n("Vhhf"),o=n("ZTXN"),s=n("TLy2"),i=n("ruxD"),u=n("kZht");let c=(()=>{class t{constructor(){this.activeRequestCount=0,this.requestQueue=[]}add(t,e){if(e===1/0)return t;if(this.validate(e),this.activeRequestCount<e)return this.activeRequestCount++,this.onComplete(t);const n=new o.a;return this.requestQueue.push(n),n.pipe(Object(s.a)(()=>this.onComplete(t)))}onComplete(t){return t.pipe(Object(i.a)(()=>{this.activeRequestCount--,this.executeFromQueue()}))}executeFromQueue(){const t=this.requestQueue.shift();Object(r.e)(t)&&(this.activeRequestCount++,t.next(!0),t.complete())}validate(t){if(t<=0)throw new Error("Limit concurrency should be more than 0")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=u.Hb({token:t,factory:t.\u0275fac}),t})()},YSOR:function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n("dRc4"),o=n("kZht");let s=(()=>{class t{constructor(t){this.config=t}mergeGlobalOptionsWith(t,e){return Object.assign(Object.assign(Object.assign({},this.config),t),e)}}return t.\u0275fac=function(e){return new(e||t)(o.Sb(r.a))},t.\u0275prov=o.Hb({token:t,factory:t.\u0275fac}),t})()},b2Yo:function(t,e,n){"use strict";n.d(e,"a",function(){return p});const r={baseUrl:null,hostUrl:null,body:null,headers:{},queryParams:{},pathVariables:{},emitSuccess:!1,emitFailure:!0,responseType:"json",reportProgress:!0,additionalOptions:{},nullInsteadEmpty:!0,limitConcurrency:255};var o=n("YSOR"),s=n("/3IS"),i=n("eAD0"),u=n("WSVK"),c=n("dRc4"),a=n("o4/X"),l=n("kZht");let p=(()=>{class t{static forRoot(e=[],n={}){return{ngModule:t,providers:[o.a,{provide:c.a,useValue:Object.assign(Object.assign({},r),n)},{provide:a.a,useClass:i.a},s.a,u.a,...e]}}static forFeature(e=[]){return{ngModule:t,providers:e}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.Jb({type:t}),t.\u0275inj=l.Ib({}),t})()},b5Xb:function(t,e,n){"use strict";var r=n("b2Yo");n.d(e,"b",function(){return r.a}),n("s037"),n("YSOR");var o=n("/3IS");n.d(e,"a",function(){return o.a}),n("eAD0"),n("dRc4"),n("o4/X"),n("SRZ4")},dRc4:function(t,e,n){"use strict";n.d(e,"a",function(){return r});const r=new(n("kZht").r)("DATA_CONFIG_SERVICE_TOKEN")},eAD0:function(t,e,n){"use strict";n.d(e,"a",function(){return s}),n("F3WU");var r=n("ZTXN"),o=n("kZht");let s=(()=>{class t{constructor(){this.success$=new r.a,this.errors$=new r.a}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=o.Hb({token:t,factory:t.\u0275fac}),t})()},"o4/X":function(t,e,n){"use strict";n.d(e,"a",function(){return r});const r=new(n("kZht").r)("DATA_HTTP_CLIENT_INTERCEPTOR")},s037:function(t,e,n){"use strict";n.d(e,"a",function(){return h});var r=n("JN4H"),o=n("Vhhf"),s=n("F3WU"),i=n("ulty"),u=n("o4/X"),c=n("YSOR"),a=n("WSVK"),l=n("kZht"),p=n("6uGs");let h=(()=>{class t{constructor(t,e,n,r){this.http=t,this.configurator=e,this.limitConcurrency=n,this.interceptor=r}get(t,e={}){return this.request(this.createRequestOptions({method:s.a.GET,path:t,options:e}))}post(t,e={}){return this.request(this.createRequestOptions({method:s.a.POST,path:t,options:e}))}put(t,e={}){return this.request(this.createRequestOptions({method:s.a.PUT,path:t,options:e}))}patch(t,e={}){return this.request(this.createRequestOptions({method:s.a.PATCH,path:t,options:e}))}delete(t,e={}){return this.request(this.createRequestOptions({method:s.a.DELETE,path:t,options:e}))}createDataHttpRequestOptions(t){var e,n,r,o,s,u,c,a;const l=Object(i.d)(t.path,t.clientOptions.queryParams),p=Object(i.c)(t.clientOptions.headers);return{withCredentials:!1,body:this.createHttpBody(t),responseType:null!==(e=t.clientOptions.responseType)&&void 0!==e?e:"json",reportProgress:null!==(n=t.clientOptions.reportProgress)&&void 0!==n&&n,headers:null!==(s=null===(o=(r=this.interceptor).onInterceptHttpHeaders)||void 0===o?void 0:o.call(r,t,p))&&void 0!==s?s:p,params:null!==(a=null===(c=(u=this.interceptor).onInterceptHttpParams)||void 0===c?void 0:c.call(u,t,l))&&void 0!==a?a:l}}createRequestOptions({method:t,path:e,options:n}){return{path:e,method:t,clientOptions:this.configurator.mergeGlobalOptionsWith(this.local,null!=n?n:{})}}createHttpBody(t){var e,n,s;const i=t.clientOptions.body;if(i instanceof FormData)return i;const u=null!==(s=null===(n=(e=this.interceptor).onInterceptBodyPayload)||void 0===n?void 0:n.call(e,t,i))&&void 0!==s?s:i;return Object(o.f)(t.clientOptions.nullInsteadEmpty)?Object(r.c)(u):u}}return t.\u0275fac=function(e){return new(e||t)(l.Sb(p.a),l.Sb(c.a),l.Sb(a.a),l.Sb(u.a))},t.\u0275prov=l.Hb({token:t,factory:t.\u0275fac}),t})()},ulty:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return u}),n.d(e,"c",function(){return a}),n.d(e,"d",function(){return p}),n.d(e,"e",function(){return d}),n.d(e,"f",function(){return s});var r=n("Vhhf"),o=n("JN4H");function s(t){return null==t?void 0:t.replace(/(https?:\/\/)|(\/)+/g,"$1$2")}function i({hostUrl:t,baseUrl:e,restUrl:n,pathUrl:o}){let i;var u,c;return i=function(t,e=/^(http|https):\/\//){const n=t.match(e);return Object(r.g)(n)}(o)?o:[t,e,n,(u=o,null!==(c=function(t,e=null){var n;return Array.isArray(t)&&t.length?null!==(n=t[0])&&void 0!==n?n:e:null}(u.split("?")))&&void 0!==c?c:"")].filter(r.c).join("/"),s(i)}function u(t,e){var n;let r=t.toString();const o=null!==(n=r.match(/\{(.*?)\}/g))&&void 0!==n?n:[];for(const s of o){const t=s.replace(/{|}/g,"");e.has(t)&&(r=r.replace(s,e.get(t)))}return r}var c=n("6uGs");function a(t={}){return new c.c(Object(o.a)(t))}var l=n("1VvW");function p(t,e){const n=function(t){return(new l.a).parse(t).queryParams}(t),r=Object(o.a)(Object.assign(Object.assign({},n),null!=e?e:{}));return new c.d({fromObject:r})}function h(t){const e=new RegExp("^\\/+|\\/+$","g");return Object(r.b)(t)?"":t.trim().replace(e,"")}function d({hostUrl:t,baseUrl:e}={},n="",r=""){return{hostUrl:h(t)||`${window.location.protocol}//${window.location.host}`,baseUrl:h(e),restUrl:h(n),pathUrl:h(r)}}},zn8P:function(t,e){function n(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="zn8P"}},[[0,0,5]]]);