PageSourceSearch

https://www.energytcm.cz/2850.82129ad53e300e80.js

js energytcm.cz collected 2026-10-07 20:06:01 UTC 143,885 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkenergy_tcm=self.webpackChunkenergy_tcm||[]).push([[2850],{35119:(Q,I,a)=>{a.d(I,{w:()=>T});var d=a(76965),s=a(45286),l=a(7605),p=a(58728),m=a(47292),_=a(54438),b=a(59788),$=a(83891);function F(C,R){if(1&C&&(_.j41(0,"mcrai-option",2),_.EFF(1),_.k0s()),2&C){const h=R.$implicit;_.Y8G("value",h.id),_.R7$(),_.SpI(" ",h.name," ")}}function u(C,R){if(1&C){const h=_.RV6();_.j41(0,"mcrai-select",1),_.bIt("pageChange",function(S){_.eBV(h);const g=_.XpG();return _.Njj(g.onPageChange(S))}),_.nrm(1,"mcrai-option",2),_.Z7z(2,F,2,2,"mcrai-option",2,_.fX1),_.k0s()}if(2&C){const h=_.XpG();_.Mz_("placeholder","Role",h.required?" *":"",""),_.Y8G("control",h.control)("multiple",h.multiple)("paginator",h.paginator),_.R7$(),_.Y8G("value",null),_.R7$(),_.Dyx(h.roles)}}let T=(()=>{class C{get control(){return this._control}set control(h){this._control=h}get roles(){const h=this.rolesContainer?this.rolesContainer.items:[];return h.some(S=>"no_role"===S.id)||h.unshift({id:"no_role",name:"Role nep\u0159i\u0159azena",description:"Speci\xe1ln\xed role ur\u010den\xe1 pro filtraci u\u017eivatel\u016f bez p\u0159i\u0159azen\xe9 role",permissions:[]}),h}get paginator(){return this.rolesContainer?this.rolesContainer.paginator:null}constructor(h){this.store=h,this.destroy=new s.B7}ngOnInit(){this.getRoles(),this.selectRoles()}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}getRoles(h=1){this.store.dispatch(new m.gh({page:h}))}selectRoles(){this.store.pipe((0,d.Lt)(h=>h.aegisxBaseRoles.roles),(0,l.Q)(this.destroy),(0,p.p)(h=>!!h)).subscribe(h=>this.rolesContainer=h)}onPageChange(h){this.getRoles(h)}static#t=this.\u0275fac=function(D){return new(D||C)(_.rXU(d.il))};static#e=this.\u0275cmp=_.VBU({type:C,selectors:[["aegisx-select-role"]],inputs:{control:"control",multiple:"multiple",required:"required"},decls:1,vars:1,consts:[[3,"placeholder","control","multiple","paginator"],[3,"pageChange","placeholder","control","multiple","paginator"],[3,"value"]],template:function(D,S){1&D&&_.DNE(0,u,4,6,"mcrai-select",0),2&D&&_.vxM(0,null!=S.roles&&S.roles.length?0:-1)},dependencies:[b.w,$.P],styles:["[_nghost-%COMP%]{display:block;width:100%}"]})}return C})()},94793:(Q,I,a)=>{a.d(I,{J:()=>h});var d=a(54438),s=a(76965),l=a(45286),p=a(7605),m=a(95006),_=a(58728),b=a(69207),$=a(95894),F=a(59788),u=a(83891);function T(D,S){1&D&&d.nrm(0,"mcrai-option",1),2&D&&d.Y8G("value",null)}function C(D,S){if(1&D){const g=d.RV6();d.j41(0,"mcrai-option",2),d.bIt("selection",function(j){d.eBV(g);const ot=d.XpG();return d.Njj(ot.onSelection(j))}),d.EFF(1),d.k0s()}if(2&D){const g=S.$implicit;d.Y8G("value",g.id),d.R7$(),d.Lme(" ",g.username," - ",g.nickname," ")}}let R=0,h=(()=>{class D{get control(){return this._control}set control(g){this._control=g}get placeholder(){let g="U\u017eivatel";return g+=this.multiple?"\xe9":"",g+=this.required?" *":"",g}get users(){return this._users?this._users.items:[]}get paginator(){return this._users?this._users.paginator:null}constructor(g){this.store=g,this.destroy=new l.B7,this.id=++R+"",this.nullable=!0,this.required=!1,this.selection=new d.bkB}ngOnInit(){this.store.dispatch(new b.GP({id:this.id})),this.getUsers(),this.selectUsers()}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}ngOnChanges(g){g.hasOwnProperty("roles")&&(this.store.dispatch(new b.HP({id:this.id,filter:{q:null,roles:this.roles}})),this.getUsers())}getUsers(g=1){this.store.dispatch(new b.TB({id:this.id,page:g}))}selectUsers(){this.store.pipe((0,s.Lt)($.VR),(0,p.Q)(this.destroy),(0,m.T)(g=>g[this.id]),(0,_.p)(g=>!!g)).subscribe(g=>this._users=g)}onPageChange(g){this.getUsers(g)}onQueryChange(g){this.store.dispatch(new b.HP({id:this.id,filter:{q:g,roles:this.roles}})),this.getUsers()}onSelection(g){this.selection.emit(g.value?this.users.find(P=>P.id===g.value):null)}static#t=this.\u0275fac=function(P){return new(P||D)(d.rXU(s.il))};static#e=this.\u0275cmp=d.VBU({type:D,selectors:[["aegisx-select-user"]],inputs:{control:"control",roles:"roles",multiple:"multiple",nullable:"nullable",required:"required"},outputs:{selection:"selection"},features:[d.OA$],decls:4,vars:5,consts:[[3,"pageChange","queryChange","placeholder","control","paginator","multiple"],[3,"value"],[3,"selection","value"]],template:function(P,j){1&P&&(d.j41(0,"mcrai-select",0),d.bIt("pageChange",function(nt){return j.onPageChange(nt)})("queryChange",function(nt){return j.onQueryChange(nt)}),d.DNE(1,T,1,1,"mcrai-option",1),d.Z7z(2,C,2,3,"mcrai-option",1,d.fX1),d.k0s()),2&P&&(d.Y8G("placeholder",j.placeholder)("control",j.control)("paginator",j.paginator)("multiple",j.multiple),d.R7$(),d.vxM(1,j.nullable?1:-1),d.R7$(),d.Dyx(j.users))},dependencies:[F.w,u.P],styles:["[_nghost-%COMP%]{display:block;width:100%}"]})}return D})()},67453:(Q,I,a)=>{a.r(I),a.d(I,{CategoriesModule:()=>Fa});var d=a(60177),s=a(89417),l=a(41635),p=a(76965),m=a(29262),_=a(27105),b=a(63040),$=a(97309),F=a(45286),u=a(7605),T=a(58728),C=a(62399),R=a(88393),h=a(70083),D=a(85375),S=a(33203),g=a(78810),P=a(7603),j=a(62438);const ot=["n\xe1zev","n\xe1zev + obr\xe1zek","n\xe1zev + obr\xe1zek + popis"];var nt=a(8264);const wt=["seznam","dla\u017edice"];var Mt=a(34351),v=a(7772),t=a(54438),O=a(63649),se=a(40040),Ft=a(52070),J=a(31992),K=a(46346),W=a(94300),q=a(54444),tt=a(97519),$t=a(28520),It=a(11815),at=a(59788),st=a(83891),V=a(33579),z=a(33555),X=a(23509),N=a(90113),U=a(36001),Pt=a(75483),Ot=a(37282),Bt=a(73955);function ce(i,r){if(1&i&&(t.j41(0,"mcrai-option",7),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",e),t.R7$(),t.SpI(" ",e," ")}}function le(i,r){if(1&i&&(t.j41(0,"mcrai-option",7),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",r.$index),t.R7$(),t.SpI(" ",e," ")}}function de(i,r){if(1&i&&(t.j41(0,"mcrai-option",7),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",r.$index),t.R7$(),t.SpI(" ",e," ")}}function me(i,r){if(1&i&&(t.j41(0,"mcrai-option",7),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",r.$index),t.R7$(),t.SpI(" ",e," ")}}function pe(i,r){if(1&i&&(t.j41(0,"mcrai-option",7),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",r.$index),t.R7$(),t.SpI(" ",t.bMT(2,2,e)," ")}}let ue=(()=>{class i{get controls(){return this.form.controls}constructor(e,o,n,c){this.store=e,this.builder=o,this.modalService=n,this.data=c,this.destroy=new F.B7,this.CATEGORIES_LAYOUTS=ot,this.PRODUCTS_LAYOUTS=nt.D,this.ARTICLES_LAYOUTS=wt,this.PRODUCTS_ORDER=Mt.o,this.ERRORS={name:{required:"Kategorie mus\xed m\xedt n\xe1zev."}},this.special_ids=[],this.buildForm()}ngOnInit(){this.store.pipe((0,p.Lt)(_.Gf),(0,u.Q)(this.destroy),(0,T.p)(e=>!!e.length)).subscribe(e=>this.special_ids=e),this.fetchSpecialIds()}fetchSpecialIds(){this.store.dispatch(new v.kD)}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}buildForm(){this.form=this.builder.group({language:["CZ"],tree:[this.data.tree?this.data.tree.id:null],name:[null,s.k0.required],name_detail:[null],url:[null],description:[null],special_id:new s.hs,seo_title:[null],seo_description:[null],preview_image:[],background_image:[],icon:[],hidden:[!1],enable_banners:[!0],enable_categories:[!0],enable_articles:[!0],enable_products:[!0],enable_filter:[!0],enable_map:[!1],enable_brands:[!1],enable_top:[!1],layout:[],products_layout:[],articles_layout:[],products_order:[],preferred_brands:[[]],order:[]})}
1isAddButtonDisabled(){return this.form.invalid}add(){this.isAddButtonDisabled()||(this.store.dispatch(new j.zK({category:this.form.value,tree:this.data.tree})),this.close())}close(){this.modalService.close()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(s.ze),t.rXU(m.mO),t.rXU(m._P))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-add-category-modal"]],decls:126,vars:46,consts:[[3,"formGroup"],["collapsable","",3,"collapsed"],[3,"control","required","nullable"],["type","text","placeholder","N\xe1zev *",3,"control","errors"],["type","text","placeholder","N\xe1zev ve v\xfdpisu",3,"control"],["type","category",3,"control"],["placeholder","Speci\xe1ln\xed ID",3,"control"],[3,"value"],["type","text","placeholder","SEO Title",3,"control"],["type","text","placeholder","SEO Description",3,"control"],[3,"control"],["color","secondary"],["type","file",3,"control"],["type","text","placeholder","Po\u0159ad\xed",3,"control"],["type","checkbox",3,"control","value"],["placeholder","Preferovan\xed v\xfdrobci",3,"control","multiple","nullable"],["placeholder","\u0160ablona kategori\xed",3,"control"],["placeholder","\u0160ablona produkt\u016f",3,"control"],["placeholder","\u0160ablona \u010dl\xe1nk\u016f",3,"control"],["placeholder","\u0158azen\xed produkt\u016f",3,"control"],["mcrai-button","negative",3,"click"],["mcrai-button","positive",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-modal")(1,"mcrai-modal-header")(2,"h1"),t.EFF(3,"P\u0159idat kategorii"),t.k0s()(),t.j41(4,"mcrai-modal-content")(5,"form",0)(6,"mcrai-row")(7,"mcrai-col")(8,"mcrai-panel",1)(9,"mcrai-panel-header")(10,"h2"),t.EFF(11,"Prvn\xed jazykov\xe1 mutace"),t.k0s()(),t.j41(12,"mcrai-panel-content"),t.nrm(13,"aegisx-select-language",2)(14,"mcrai-input",3)(15,"mcrai-input",4)(16,"aegisx-url-input",5),t.j41(17,"mcrai-select",6),t.nrm(18,"mcrai-option",7),t.Z7z(19,ce,2,2,"mcrai-option",7,t.fX1),t.k0s(),t.nrm(21,"mcrai-input",8)(22,"mcrai-input",9),t.j41(23,"div"),t.nrm(24,"br"),t.EFF(25," Popis "),t.nrm(26,"aegisx-smd-editor",10),t.k0s()()()()(),t.j41(27,"mcrai-row")(28,"mcrai-col")(29,"mcrai-panel",1)(30,"mcrai-panel-header")(31,"h2"),t.EFF(32,"Obr\xe1zky"),t.k0s()(),t.j41(33,"mcrai-panel-content")(34,"mcrai-row")(35,"mcrai-col")(36,"mcrai-panel",11)(37,"mcrai-panel-header")(38,"h3"),t.EFF(39,"N\xe1hledov\xfd obr\xe1zek"),t.k0s()(),t.j41(40,"mcrai-panel-content"),t.nrm(41,"mcrai-input",12),t.k0s()()()(),t.j41(42,"mcrai-row")(43,"mcrai-col")(44,"mcrai-panel",11)(45,"mcrai-panel-header")(46,"h3"),t.EFF(47,"Pozad\xed"),t.k0s()(),t.j41(48,"mcrai-panel-content"),t.nrm(49,"mcrai-input",12),t.k0s()()()(),t.j41(50,"mcrai-row")(51,"mcrai-col")(52,"mcrai-panel",11)(53,"mcrai-panel-header")(54,"h3"),t.EFF(55,"Ikona"),t.k0s()(),t.j41(56,"mcrai-panel-content"),t.nrm(57,"mcrai-input",12),t.k0s()()()()()()()(),t.j41(58,"mcrai-row")(59,"mcrai-col")(60,"mcrai-panel",1)(61,"mcrai-panel-header")(62,"h2"),t.EFF(63,"Nastaven\xed"),t.k0s()(),t.j41(64,"mcrai-panel-content")(65,"mcrai-row")(66,"mcrai-col")(67,"mcrai-panel",11)(68,"mcrai-panel-header")(69,"h3"),t.EFF(70,"Kategorie"),t.k0s()(),t.j41(71,"mcrai-panel-content"),t.nrm(72,"mcrai-input",13)(73,"br"),t.j41(74,"mcrai-input",14),t.EFF(75,"Skr\xfdt kategorii"),t.k0s(),t.j41(76,"mcrai-input",14),t.EFF(77,"Zobrazit bannery"),t.k0s(),t.j41(78,"mcrai-input",14),t.EFF(79,"Zobrazit kategorie"),t.k0s(),t.j41(80,"mcrai-input",14),t.EFF(81,"Zobrazit \u010dl\xe1nky"),t.k0s(),t.j41(82,"mcrai-input",14),t.EFF(83,"Zobrazit produkty"),t.k0s(),t.j41(84,"mcrai-input",14),t.EFF(85,"Zobrazit nejprod\xe1van\u011bj\u0161\xed produkty"),t.k0s(),t.j41(86,"mcrai-input",14),t.EFF(87,"Zobrazit filtr"),t.k0s(),t.j41(88,"mcrai-input",14),t.EFF(89,"Zobrazit zna\u010dky"),t.k0s(),t.j41(90,"mcrai-input",14),t.EFF(91,"Zobrazit mapu"),t.k0s()()()(),t.j41(92,"mcrai-col")(93,"mcrai-panel",11)(94,"mcrai-panel-header")(95,"h3"),t.EFF(96,"Ostatn\xed"),t.k0s()(),t.j41(97,"mcrai-panel-content"),t.nrm(98,"shared-select-brand",15),t.k0s()()()(),t.j41(99,"mcrai-row")(100,"mcrai-col")(101,"mcrai-panel",11)(102,"mcrai-panel-header")(103,"h3"),t.EFF(104,"Za\u0159azen\xe9 polo\u017eky"),t.k0s()(),t.j41(105,"mcrai-panel-content")(106,"mcrai-row")(107,"mcrai-col")(108,"mcrai-select",16),t.Z7z(109,le,2,2,"mcrai-option",7,t.fX1),t.k0s(),t.j41(111,"mcrai-select",17),t.Z7z(112,de,2,2,"mcrai-option",7,t.fX1),t.k0s(),t.j41(114,"mcrai-select",18),t.Z7z(115,me,2,2,"mcrai-option",7,t.fX1),t.k0s()(),t.j41(117,"mcrai-col")(118,"mcrai-select",19),t.Z7z(119,pe,3,4,"mcrai-option",7,t.fX1),t.k0s()()()()()()()()()()()()(),t.j41(121,"mcrai-modal-actions")(122,"button",20),t.bIt("click",function(){return n.close()}),t.EFF(123,"Zav\u0159\xedt"),t.k0s(),t.j41(124,"button",21),t.bIt("click",function(){return n.add()}
1),t.EFF(125,"Vytvo\u0159it"),t.k0s()()()),2&o&&(t.R7$(5),t.Y8G("formGroup",n.form),t.R7$(3),t.Y8G("collapsed",!1),t.R7$(5),t.Y8G("control",n.controls.language)("required",!0)("nullable",!1),t.R7$(),t.Y8G("control",n.controls.name)("errors",n.ERRORS.name),t.R7$(),t.Y8G("control",n.controls.name_detail),t.R7$(),t.Y8G("control",n.controls.url),t.R7$(),t.Y8G("control",n.controls.special_id),t.R7$(),t.Y8G("value",null),t.R7$(),t.Dyx(n.special_ids),t.R7$(2),t.Y8G("control",n.controls.seo_title),t.R7$(),t.Y8G("control",n.controls.seo_description),t.R7$(4),t.Y8G("control",n.controls.description),t.R7$(3),t.Y8G("collapsed",!0),t.R7$(12),t.Y8G("control",n.controls.preview_image),t.R7$(8),t.Y8G("control",n.controls.background_image),t.R7$(8),t.Y8G("control",n.controls.icon),t.R7$(3),t.Y8G("collapsed",!0),t.R7$(12),t.Y8G("control",n.controls.order),t.R7$(2),t.Y8G("control",n.controls.hidden)("value",!0),t.R7$(2),t.Y8G("control",n.controls.enable_banners)("value",!0),t.R7$(2),t.Y8G("control",n.controls.enable_categories)("value",!0),t.R7$(2),t.Y8G("control",n.controls.enable_articles)("value",!0),t.R7$(2),t.Y8G("control",n.controls.enable_products)("value",!0),t.R7$(2),t.Y8G("control",n.controls.enable_top)("value",!0),t.R7$(2),t.Y8G("control",n.controls.enable_filter)("value",!0),t.R7$(2),t.Y8G("control",n.controls.enable_brands)("value",!0),t.R7$(2),t.Y8G("control",n.controls.enable_map)("value",!0),t.R7$(8),t.Y8G("control",n.controls.preferred_brands)("multiple",!0)("nullable",!1),t.R7$(10),t.Y8G("control",n.controls.layout),t.R7$(),t.Dyx(n.CATEGORIES_LAYOUTS),t.R7$(2),t.Y8G("control",n.controls.products_layout),t.R7$(),t.Dyx(n.PRODUCTS_LAYOUTS),t.R7$(2),t.Y8G("control",n.controls.articles_layout),t.R7$(),t.Dyx(n.ARTICLES_LAYOUTS),t.R7$(3),t.Y8G("control",n.controls.products_order),t.R7$(),t.Dyx(n.PRODUCTS_ORDER),t.R7$(5),t.Y8G("disabled",n.isAddButtonDisabled()))},dependencies:[O.Q,s.qT,s.cb,s.j4,se.h,Ft.$,J.h,K.l,W.J,q.f,tt.N,$t.e,It.u,at.w,st.P,V.o,z.g,X.g,N.l,U.B,Pt.Q,Ot.N,Bt.D9]})}return i})(),_e=(()=>{class i{constructor(e,o,n){this.store=e,this.modalService=o,this.data=n}ngOnInit(){}deleteCategories(){this.store.dispatch(new S.k6({branches:this.data.branches,tree:this.data.tree})),this.close()}close(){this.modalService.close()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(m.mO),t.rXU(m._P))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-confirm-delete-modal"]],decls:12,vars:0,consts:[["mcrai-button","negative",3,"click"],["mcrai-button","positive",3,"click"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-modal")(1,"mcrai-modal-header")(2,"h1"),t.EFF(3,"Opravdu smazat?"),t.k0s()(),t.j41(4,"mcrai-modal-content")(5,"p"),t.EFF(6,"Ve vybran\xfdch kategori\xedch jsou za\u0159azeny produkty nebo \u010dl\xe1nky. Chcete opravdu smazat zvolen\xe9 kategorie?"),t.k0s()(),t.j41(7,"mcrai-modal-actions")(8,"button",0),t.bIt("click",function(){return n.close()}),t.EFF(9,"Zav\u0159\xedt "),t.k0s(),t.j41(10,"button",1),t.bIt("click",function(){return n.deleteCategories()}),t.EFF(11,"Potvrdit"),t.k0s()()())},dependencies:[O.Q,J.h,K.l,W.J,q.f]})}return i})();var rt=a(1173),he=a(63836);let ge=(()=>{class i{constructor(e,o){this.store=e,this.modalService=o}ngOnInit(){}export(e){this.store.dispatch(new he.X2({body:{category:!0,category_id:e}})),this.close()}close(){this.modalService.close()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(m.mO))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-export-modal-categories"]],decls:12,vars:0,consts:[["mcrai-button","positive",3,"click"],["mcrai-button","negative",3,"click"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-modal")(1,"mcrai-modal-header")(2,"h1"),t.EFF(3,"Exportovat kategorie na FTP"),t.k0s()(),t.j41(4,"mcrai-modal-content")(5,"button",0),t.bIt("click",function(){return n.export("root")}),t.EFF(6,"Exportovat norm\xe1ln\xed kategorie"),t.k0s(),t.j41(7,"button",0),t.bIt("click",function(){return n.export("specials")}),t.EFF(8,"Exportovat speci\xe1ln\xed kategorie"),t.k0s()(),t.j41(9,"mcrai-modal-actions")(10,"button",1),t.bIt("click",function(){return n.close()}),t.EFF(11,"Zav\u0159\xedt"),t.k0s()()())},dependencies:[O.Q,J.h,K.l,W.J,q.f]})}return i})();
1var fe=a(46594),et=a(71829),L=a(65382),At=a(70014),Ce=a(77246),ye=a(25551),Xt=a(77617),Nt=a(52699),H=a(92721),ve=a(40253),Ut=a(48872),Yt=a(26588),Vt=a(48390),be=a(42974);const Ee=["wrapper"],Fe=["content"],ke=["*"],Re=i=>({transform:i});let xe=(()=>{class i{constructor(e,o){this.renderer=e,this.elRef=o,this.STICKY_CONTENT_CLASS="mcrai-sticky-content",this.marginTop=0,this.wrapperPosition=0}ngOnInit(){this.renderer.addClass(this.elRef.nativeElement,this.STICKY_CONTENT_CLASS)}isContentFixed(e){return this.wrapper.nativeElement.getBoundingClientRect().top-this.marginTop<=0}wrapperYPosition(e){this.wrapperPosition=this.wrapper.nativeElement.getBoundingClientRect().top.valueOf()}get contentPosition(){if(!this.isContentFixed())return 0;switch(!0){case this.wrapperPosition<=0&&!this.isOnEnd:return this.marginTop+Math.abs(this.wrapperPosition);case this.wrapperPosition>0&&!this.isOnEnd:return this.marginTop-this.wrapperPosition;case this.isOnEnd:return this.wrapperHeight-this.contentHeight;default:return 0}}get wrapperHeight(){return this.wrapper.nativeElement.offsetHeight}get contentHeight(){return this.content.nativeElement.offsetHeight}get isOnEnd(){return this.wrapperPosition<=-this.wrapperHeight+this.marginTop+this.contentHeight}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(t.sFG),t.rXU(t.aKT))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["mcrai-sticky-content"]],viewQuery:function(o,n){if(1&o&&(t.GBs(Ee,7,t.aKT),t.GBs(Fe,7,t.aKT)),2&o){let c;t.mGM(c=t.lsd())&&(n.wrapper=c.first),t.mGM(c=t.lsd())&&(n.content=c.first)}},hostBindings:function(o,n){1&o&&t.bIt("scroll",function(y){return n.wrapperYPosition(y)},!1,t.tSv)},inputs:{marginTop:"marginTop"},ngContentSelectors:ke,decls:5,vars:3,consts:[["wrapper",""],["content",""],[1,"sticky-content__wrapper"],[1,"sticky-content__content",3,"ngStyle"]],template:function(o,n){1&o&&(t.NAR(),t.j41(0,"div",2,0)(2,"div",3,1),t.SdG(4),t.k0s()()),2&o&&(t.R
17$(2),t.Y8G("ngStyle",t.eq3(1,Re,"translate3d(0, "+n.contentPosition+"px, 0)")))},dependencies:[d.B3],styles:[".sticky-content__wrapper{position:relative;height:100%}.sticky-content__content{transform:translateZ(0)}\n"],encapsulation:2,changeDetection:0})}return i})();function Te(i,r){if(1&i&&t.nrm(0,"aegisx-branch",4),2&i){const e=r.$implicit,o=t.XpG();t.Y8G("item",e)("parent",o.parent)}}function Se(i,r){1&i&&t.EFF(0,"Nov\u011b vznikl\xe9 kategorie, kter\xe9 je\u0161t\u011b nejsou nikam za\u0159azen\xe9.")}let De=(()=>{class i{get parent(){return"new"}constructor(e,o){this.store=e,this.toolbarService=o,this.destroy=new F.B7,this.skipFirstTreeChange=!0}ngOnInit(){this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.newCategories),(0,u.Q)(this.destroy)).subscribe(e=>this.categories=e)}ngOnChanges(e){e.hasOwnProperty("tree")&&(!this.skipFirstTreeChange||!e.tree.firstChange)&&this.fetchCategories()}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}fetchCategories(e=1){this.store.dispatch(new v.LQ({page:e,tree:this.tree}))}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(L.h))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-new-categories"]],inputs:{tree:"tree",skipFirstTreeChange:"skipFirstTreeChange"},features:[t.OA$],decls:14,vars:3,consts:[["info",""],["color","secondary"],[1,"pull-right",3,"mcraiTooltip"],[3,"marginTop"],[3,"item","parent"],[1,"pull-left",3,"page","paginator"]],template:function(o,n){if(1&o){const c=t.RV6();t.j41(0,"mcrai-panel",1)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"Nov\xe9 kategorie"),t.k0s(),t.j41(4,"mcrai-icon",2),t.EFF(5,"info"),t.k0s()(),t.j41(6,"mcrai-panel-content")(7,"mcrai-sticky-content",3),t.Z7z(8,Te,1,2,"aegisx-branch",4,t.fX1),t.k0s()(),t.j41(10,"mcrai-panel-actions")(11,"mcrai-paginator",5),t.bIt("page",function(E){return t.eBV(c),t.Njj(n.fetchCategories(E))}),t.k0s()()(),t.DNE(12,Se,1,0,"ng-template",null,0,t.C5r)}if(2&o){const c=t.sdS(13);t.R7$(4),t.Y8G("mcraiTooltip",c),t.R7$(3),t.Y8G("marginTop",100),t.R7$(),t.Dyx(null==n.categories?null:n.categories.items),t.R7$(3),t.Y8G("paginator",null==n.categories?null:n.categories.paginator)}},dependencies:[Ut.K,Yt.R,X.g,N.l,H.h,U.B,Vt.h,be.d,xe]})}return i})();function je(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",7),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.cancelStaged())}),t.EFF(1," Zru\u0161it v\xfdb\u011br "),t.k0s()}}function Ge(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",7),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.showExportModal())}),t.EFF(1," Exportovat na FTP "),t.k0s()}}function we(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",8),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.editCategories())}),t.EFF(1," Upravit vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isEditButtonDisabled())}}function Me(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",9),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.deleteCategories())}),t.EFF(1," Smazat vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isDeleteButtonDisabled())}}function $e(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",10),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.addCategory())}),t.EFF(1," P\u0159idat kategorii "),t.k0s()}}function Ie(i,r){if(1&i&&t.DNE(0,je,2,0,"button",3)(1,Ge,2,0,"button",3)(2,we,2,1,"button",4)(3,Me,2,1,"button",5)(4,$e,2,0,"button",6),2&i){const e=t.XpG();t.vxM(0,e.toolbarService.isDeleteMode()?0:-1),t.R7$(),t.vxM(1,e.canExport()?1:-1),t.R7$(),t.vxM(2,e.toolbarService.isEditMode()?2:-1),t.R7$(),t.vxM(3,e.toolbarService.isDeleteMode()?3:-1),t.R7$(),t.vxM(4,e.toolbarService.isDeleteMode()?-1:4)}}function Pe(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",7),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.cancelStaged())}),t.EFF(1," Zru\u0161it v\xfdb\u011br "),t.k0s()}}function Oe(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",7),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.showExportModal())}),t.EFF(1," Exportovat na FTP "),t.k0s()}}function Be(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",8),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.editCategories())}
1),t.EFF(1," Upravit vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isEditButtonDisabled())}}function Ae(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",9),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.deleteCategories())}),t.EFF(1," Smazat vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isDeleteButtonDisabled())}}function Xe(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",10),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.addCategory())}),t.EFF(1," P\u0159idat kategorii "),t.k0s()}}function Ne(i,r){if(1&i&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,Pe,2,0,"button",3)(2,Oe,2,0,"button",3)(3,Be,2,1,"button",4)(4,Ae,2,1,"button",5)(5,Xe,2,0,"button",6),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(1,e.toolbarService.isDeleteMode()?1:-1),t.R7$(),t.vxM(2,e.canExport()?2:-1),t.R7$(),t.vxM(3,e.toolbarService.isEditMode()?3:-1),t.R7$(),t.vxM(4,e.toolbarService.isDeleteMode()?4:-1),t.R7$(),t.vxM(5,e.toolbarService.isDeleteMode()?-1:5)}}let Ue=(()=>{class i{constructor(e,o,n,c){this.store=e,this.modalService=o,this.permissionService=n,this.toolbarService=c,this.destroy=new F.B7}ngOnInit(){this.toolbarService.setToolbarModes([rt.H.View,rt.H.Edit,rt.H.Delete]),this.store.dispatch(new C.c8),this.store.dispatch(new P.tu),this.store.select(e=>e.aegisxForest.staged).pipe((0,u.Q)(this.destroy)).subscribe(e=>this.staged=e),this.store.pipe((0,p.Lt)(e=>e.aegisxForest.actions),(0,u.Q)(this.destroy)).subscribe(e=>this.actions=e),this.store.pipe((0,p.Lt)(e=>e.aegisxForest.branches),(0,u.Q)(this.destroy)).subscribe(e=>this.branches=e),this.store.pipe((0,p.Lt)(fe.eS,{id:""}),(0,T.p)(e=>!!e),(0,u.Q)(this.destroy)).subscribe(e=>this.tree=e)}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}addCategory(){const e=new m.m_("1100px","750px",{tree:this.tree});this.actions.length>0&&this.editCategories(),this.modalService.open(ue,e)}isDeleteButtonDisabled(){return!this.staged||!this.staged.length}isEditButtonDisabled(){return!this.actions||!this.actions.length}deleteCategories(){if(this.staged.some(o=>o.item.articles_count>0||o.item.products_count>0)){const o=new m.m_("500px","250px",{branches:this.staged,tree:this.tree});this.modalService.open(_e,o)}else this.store.dispatch(new S.k6({branches:this.staged,tree:this.tree})),this.staged.forEach(o=>{this.store.dispatch(new R.Ni({id:o.item.id}))}),this.store.dispatch(new h.lT),this.store.dispatch(new h.yM)}editCategories(){this.store.dispatch(new g.Ec({actions:this.actions}));const e=[];this.branches.forEach(o=>{"order"in o.item&&e.push({id:o.item.id,order:o.item.order})}),this.store.dispatch(new D.JT({categories:e})),this.store.dispatch(new h.hM)}showExportModal(){this.modalService.open(ge,new m.m_("800px","600px"))}canExport(){return this.permissionService.canExport()&&!this.toolbarService.isDeleteMode()}cancelStaged(){}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(m.mO),t.rXU(et.n),t.rXU(L.h))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-category-overview"]],decls:22,vars:5,consts:[[3,"tree"],["top",""],[1,"pull-left"],["mcrai-button","neutral"],["mcrai-button","positive",3,"disabled"],["mcrai-button","negative",3,"disabled"],["mcrai-button","positive"],["mcrai-button","neutral",3,"click"],["mcrai-button","positive",3,"click","disabled"],["mcrai-button","negative",3,"click","disabled"],["mcrai-button","positive",3,"click"]],template:function(o,n){1&o&&(t.nrm(0,"aegisx-header"),t.j41(1,"mcrai-container")(2,"mcrai-panel")(3,"mcrai-panel-header")(4,"h1"),t.EFF(5,"P\u0159ehled kategori\xed"),t.k0s()(),t.j41(6,"mcrai-panel-content")(7,"mcrai-row")(8,"mcrai-col")(9,"mcrai-row")(10,"mcrai-col"),t.nrm(11,"aegisx-category-tree",0),t.k0s()(),t.j41(12,"mcrai-row")(13,"mcrai-col"),t.nrm(14,"aegisx-special-categories",0),t.k0s()()(),t.j41(15,"mcrai-col"),t.nrm(16,"aegisx-new-categories",0),t.k0s()()(),t.j41(17,"mcrai-panel-actions",1),t.nrm(18,"aegisx-select-user-category-tree",2),t.DNE(19,Ie,5,5),t.k0s(),t.DNE(20,Ne,6,5,"mcrai-panel-actions"),t.k0s()(),t.nrm(21,"aegisx-toolbar")),2&o&&(t.R7$(11),t.Y8G("tree",n.tree),t.R7$(3),t.Y8G("tree",n.tree),t.R7$(2),t.Y8G("tree",n.tree),t.R7$(3),t.vxM(19,n.permissionService.canWrite()?19:-1),t.R7$(),t.vxM(20,n.permissionService.canWrite()?20:-1))},dependencies:[At.I,Ce.e,ye.b,O.Q,Xt.I,V.o,z.g,Nt.H,X.g,N.l,H.h,U.B,ve.j,De]}
1)}return i})();var Ye=a(19493),x=a(95006),Ve=a(52890),kt=a(51998),zt=a(7887),ze=a(71845);const Lt=["kategorie","\u010dl\xe1nky"];class Ht{constructor(r){this.q=r}}const Zt="[Articles] GET category articles",Rt="[Articles] GET category articles success";class Qt{constructor(r){this.payload=r,this.type=Zt}}class Le{constructor(r){this.payload=r,this.type=Rt}}const He={articles:{}},Jt="categoryArticles";function Ze(i=He,r){return r.type===Rt?{...i,articles:{...i.articles,[r.payload.id]:r.payload.items}}:i}const Kt=i=>i[Jt].articles;var Qe=a(8077),lt=a(64204),dt=a(95466),mt=a(7306),pt=a(7622),ut=a(57382),_t=a(65208),ht=a(21336),gt=a(30127),ft=a(49451);const Wt=()=>["brand","order","actions"];function Je(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Zna\u010dka"),t.k0s())}function Ke(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.SpI(" ",e.brand.name," ")}}function We(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Po\u0159ad\xed"),t.k0s())}function qe(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.SpI(" ",e.order," ")}}function ti(i,r){1&i&&t.nrm(0,"mcrai-th")}function ei(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-td",10)(1,"a",11),t.bIt("click",function(){const n=t.eBV(e).$implicit,c=t.XpG();return t.Njj(c.openOrderModal(n))}),t.EFF(2,"Zm\u011bnit po\u0159ad\xed "),t.k0s()()}}function ii(i,r){1&i&&t.nrm(0,"mcrai-tr")}function oi(i,r){1&i&&t.nrm(0,"mcrai-tr")}let ni=(()=>{class i{constructor(e,o,n,c){this.store=e,this.builder=o,this.modalService=n,this.data=c,this.destroy=new F.B7,this.ERRORS={name:{required:"Kategorie mus\xed m\xedt n\xe1zev."}},c.category?this.category=c.category:console.error("category is not set",c)}ngOnInit(){this.store.pipe((0,p.Lt)(_.N2),(0,u.Q)(this.destroy)).subscribe(e=>this.category=e)}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}close(){this.modalService.close()}openOrderModal(e){const o=new m.m_("500px","250px",{preferredBrand:e,category:this.category});this.modalService.open(Qe.h,o)}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(s.ze),t.rXU(m.mO),t.rXU(m._P))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-show-preferred-brand-modal"]],decls:21,vars:8,consts:[[3,"items"],["mcraiColumnDef","brand"],[4,"mcraiHeaderCellDef"],[4,"mcraiCellDef"],["mcraiColumnDef","order"],["mcraiColumnDef","actions"],["align-right","",4,"mcraiCellDef"],[4,"mcraiHeaderRowDef"],[4,"mcraiRowDef","mcraiRowDefColumns"],["mcrai-button","negative",3,"click"],["align-right",""],["mcrai-button","neutral",3,"click"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-modal")(1,"mcrai-modal-header")(2,"h1"),t.EFF(3),t.nI1(4,"lowercase"),t.k0s()(),t.j41(5,"mcrai-modal-content")(6,"mcrai-table",0),t.qex(7,1),t.DNE(8,Je,2,0,"mcrai-th",2)(9,Ke,2,1,"mcrai-td",3),t.bVm(),t.qex(10,4),t.DNE(11,We,2,0,"mcrai-th",2)(12,qe,2,1,"mcrai-td",3),t.bVm(),t.qex(13,5),t.DNE(14,ti,1,0,"mcrai-th",2)(15,ei,3,0,"mcrai-td",6),t.bVm(),t.DNE(16,ii,1,0,"mcrai-tr",7)(17,oi,1,0,"mcrai-tr",8),t.k0s()(),t.j41(18,"mcrai-modal-actions")(19,"button",9),t.bIt("click",function(){return n.close()}
1),t.EFF(20,"Zav\u0159\xedt"),t.k0s()()()),2&o&&(t.R7$(3),t.SpI("Preferovan\xed v\xfdrobci pro ",t.bMT(4,4,n.category.info[0].name),""),t.R7$(3),t.Y8G("items",n.category.preferred_brands),t.R7$(10),t.Y8G("mcraiHeaderRowDef",t.lJ4(6,Wt)),t.R7$(),t.Y8G("mcraiRowDefColumns",t.lJ4(7,Wt)))},dependencies:[O.Q,J.h,K.l,W.J,q.f,lt.n,dt.q,mt.B,pt.K,ut.D,_t.Q,ht.V,gt.e,ft.O,d.GH]})}return i})();var B=a(52693),qt=a(19727),te=a(48235),xt=a(41819),Tt=a(62523),St=a(39103);function ri(i,r){1&i&&t.nrm(0,"mcrai-option",2),2&i&&t.Y8G("value",null)}function ai(i,r){if(1&i&&(t.j41(0,"mcrai-option",3),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",e.id)("title",null==e.info[0]?null:e.info[0].headline),t.R7$(),t.SpI(" ",null==e.info[0]?null:e.info[0].headline," ")}}function si(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-select",1),t.bIt("pageChange",function(n){t.eBV(e);const c=t.XpG();return t.Njj(c.onPageChange(n))}),t.DNE(1,ri,1,1,"mcrai-option",2),t.Z7z(2,ai,2,3,"mcrai-option",3,t.fX1),t.k0s()}if(2&i){const e=t.XpG();t.FCK("placeholder","",e.placeholder,"",e.required?" *":"",""),t.Y8G("control",e.control),t.R7$(),t.vxM(1,e.nullable?1:-1),t.R7$(),t.Dyx(e.articles.items)}}let ci=(()=>{class i{get control(){return this._control}set control(e){this._control=e}constructor(e){this.store=e,this.destroy=new F.B7,this.required=!1,this.nullable=!0,this.placeholder="\u010cl\xe1nek"}ngOnInit(){this.getArticles(),this.selectArticles()}ngOnChanges(e){e.category&&this.getArticles()}getArticles(e=1){this.store.dispatch(new Qt({id:this.category.id,page:e}))}selectArticles(){this.store.pipe((0,p.Lt)(Kt),(0,u.Q)(this.destroy),(0,x.T)(e=>e[this.category.id]),(0,T.p)(e=>!!e)).subscribe(e=>{this.articles=e;const o=this.form.value;o.article_link=this.category.article_link,this.form.patchValue(o)})}onPageChange(e){this.getArticles(e)}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-select-category-article"]],inputs:{form:"form",category:"category",control:"control",required:"required",nullable:"nullable",placeholder:"placeholder"},features:[t.OA$],decls:1,vars:1,consts:[[3,"placeholder","control"],[3,"pageChange","placeholder","control"],[3,"value"],[3,"value","title"]],template:function(o,n){1&o&&t.DNE(0,si,4,5,"mcrai-select",0),2&o&&t.vxM(0,n.articles?0:-1)},dependencies:[at.w,st.P]})}return i})();var li=a(57005),ee=a(52570),di=a(99138);function mi(i,r){if(1&i&&(t.j41(0,"mcrai-li"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.JRh(e.brand.name)}}function pi(i,r){if(1&i&&(t.j41(0,"mcrai-ul"),t.Z7z(1,mi,2,1,"mcrai-li",null,t.fX1),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.Dyx(e.category.preferred_brands)}}function ui(i,r){if(1&i&&(t.j41(0,"mcrai-row")(1,"mcrai-col")(2,"mcrai-panel")(3,"mcrai-panel-header")(4,"h3"),t.EFF(5,"Kategorie"),t.k0s()(),t.j41(6,"mcrai-panel-content")(7,"mcrai-dl")(8,"mcrai-dt"),t.EFF(9,"Co zobrazit"),t.k0s(),t.j41(10,"mcrai-dd"),t.EFF(11),t.nI1(12,"notSet"),t.k0s(),t.j41(13,"mcrai-dt"),t.EFF(14,"Po\u0159ad\xed"),t.k0s(),t.j41(15,"mcrai-dd"),t.EFF(16),t.nI1(17,"notSet"),t.k0s(),t.j41(18,"mcrai-dt"),t.EFF(19,"Speci\xe1ln\xed ID"),t.k0s(),t.j41(20,"mcrai-dd"),t.EFF(21),t.nI1(22,"notSet"),t.k0s(),t.j41(23,"mcrai-dt"),t.EFF(24,"Skr\xfdt kategorii"),t.k0s(),t.j41(25,"mcrai-dd"),t.EFF(26),t.nI1(27,"booleanToString"),t.k0s(),t.j41(28,"mcrai-dt"),t.EFF(29,"Zobrazit bannery"),t.k0s(),t.j41(30,"mcrai-dd"),t.EFF(31),t.nI1(32,"booleanToString"),t.k0s(),t.j41(33,"mcrai-dt"),t.EFF(34,"Zobrazit kategorie"),t.k0s(),t.j41(35,"mcrai-dd"),t.EFF(36),t.nI1(37,"booleanToString"),t.k0s(),t.j41(38,"mcrai-dt"),t.EFF(39,"Zobrazit produkty"),t.k0s(),t.j41(40,"mcrai-dd"),t.EFF(41),t.nI1(42,"booleanToString"),t.k0s(),t.j41(43,"mcrai-dt"),t.EFF(44,"Zobrazit nejprod\xe1van\u011bj\u0161\xed produkty"),t.k0s(),t.j41(45,"mcrai-dd"),t.EFF(46),t.nI1(47,"booleanToString"),t.k0s(),t.j41(48,"mcrai-dt"),t.EFF(49,"Zobrazit \u010dl\xe1nky"),t.k0s(),t.j41(50,"mcrai-dd"),t.EFF(51),t.nI1(52,"booleanToString"),t.k0s(),t.j41(53,"mcrai-dt"),t.EFF(54,"Zobrazit filtr"),t.k0s(),t.j41(55,"mcrai-dd"),t.EFF(56),t.nI1(57,"booleanToString"),t.k0s(),t.j41(58,"mcrai-dt"),t.EFF(59,"Zobrazit zna\u010dky"),t.k0s(),t.j41(60,"mcrai-dd"),t.EFF(61),t.nI1(62,"booleanToString"),t.k0s(),t.j41(63,"mcrai-dt"),t.EFF(64,"Zobrazit mapu"),t.k0s(),t.j41(65,"mcrai-dd"),t.EFF(66),t.nI1(67,"booleanToString"),t.k0s(),t.j41(68,"mcrai-dt"),t.EFF(69,"Odkazuje do \u010dl\xe1nku"),t.k0s(),t.j41(70,"mcrai-dd"),t.EFF(71),t.nI1(72,"notSet"),t.k0s()()()()(),t.j41(73,"mcrai-col")(74,"mcrai-panel")(75,"mcrai-panel-header")(76,"h3"),t.EFF(77,"Za\u0159azen\xe9 polo\u017eky"),t.k0s()(),t.j41(78,"mcrai-panel-content")(79,"mcrai-row")(80,"mcrai-col")(81,"mcrai-dl")(82,"mcrai-dt"),t.EFF(83,"\u0160ablona kategori\xed"),t.k0s(),t.j41(84,"mcrai-dd"),t.EFF(85),t.nI1(86,"notSet"),t.k0s(),t.j41(87,"mcrai-dt"),t.EFF(88,"\u0160ablona produkt\u016f"),t.k0s(),t.j41(89,"mcrai-dd"),t.EFF(90),t.nI1(91,"n
1otSet"),t.k0s(),t.j41(92,"mcrai-dt"),t.EFF(93,"\u0160ablona \u010dl\xe1nk\u016f"),t.k0s(),t.j41(94,"mcrai-dd"),t.EFF(95),t.nI1(96,"notSet"),t.k0s()()(),t.j41(97,"mcrai-col")(98,"mcrai-dl")(99,"mcrai-dt"),t.EFF(100,"\u0158azen\xed produkt\u016f"),t.k0s(),t.j41(101,"mcrai-dd"),t.EFF(102),t.nI1(103,"notSet"),t.nI1(104,"translate"),t.k0s()()()(),t.j41(105,"mcrai-row")(106,"mcrai-col")(107,"mcrai-dl")(108,"mcrai-dt"),t.EFF(109,"Zdroj kategori\xed"),t.k0s(),t.j41(110,"mcrai-dd"),t.EFF(111),t.nI1(112,"notSet"),t.k0s()()()()()()(),t.j41(113,"mcrai-col")(114,"mcrai-panel")(115,"mcrai-panel-header")(116,"h3"),t.EFF(117,"Preferovan\xed v\xfdrobci"),t.k0s()(),t.j41(118,"mcrai-panel-content"),t.DNE(119,pi,3,0,"mcrai-ul"),t.nrm(120,"br"),t.j41(121,"mcrai-dt"),t.EFF(122,"Povolen\xed d\u011bdi\u010dnosti"),t.k0s(),t.j41(123,"mcrai-dd"),t.EFF(124),t.nI1(125,"booleanToString"),t.k0s()()()()()),2&i){const e=t.XpG();t.R7$(11),t.JRh(t.bMT(12,20,e.CATEGORY_CONTENTS[null==e.category?null:e.category.category_content])),t.R7$(5),t.JRh(t.bMT(17,22,null==e.category?null:e.category.order)),t.R7$(5),t.JRh(t.bMT(22,24,null==e.category?null:e.category.special_id)),t.R7$(5),t.JRh(t.bMT(27,26,null==e.category?null:e.category.hidden)),t.R7$(5),t.JRh(t.bMT(32,28,null==e.category?null:e.category.enable_banners)),t.R7$(5),t.JRh(t.bMT(37,30,null==e.category?null:e.category.enable_categories)),t.R7$(5),t.JRh(t.bMT(42,32,null==e.category?null:e.category.enable_products)),t.R7$(5),t.JRh(t.bMT(47,34,null==e.category?null:e.category.enable_top)),t.R7$(5),t.JRh(t.bMT(52,36,null==e.category?null:e.category.enable_articles)),t.R7$(5),t.JRh(t.bMT(57,38,null==e.category?null:e.category.enable_filter)),t.R7$(5),t.JRh(t.bMT(62,40,null==e.category?null:e.category.enable_brands)),t.R7$(5),t.JRh(t.bMT(67,42,null==e.category?null:e.category.enable_map)),t.R7$(5),t.SpI(" ",e.defaultArticle?e.defaultArticle.info[0].headline:t.bMT(72,44,null==e.category?null:e.category.article_link)," "),t.R7$(14),t.JRh(t.bMT(86,46,e.CATEGORIES_LAYOUTS[null==e.category?null:e.category.layout])),t.R7$(5),t.JRh(t.bMT(91,48,e.PRODUCTS_LAYOUTS[null==e.category?null:e.category.products_layout])),t.R7$(5),t.JRh(t.bMT(96,50,e.ARTICLES_LAYOUTS[null==e.category?null:e.category.articles_layout])),t.R7$(7),t.JRh(t.bMT(104,54,t.bMT(103,52,e.PRODUCTS_ORDER[(null==e.category?null:e.category.products_order)-1]))),t.R7$(9),t.JRh(t.bMT(112,56,null==e.category||null==e.category.categories_source||null==e.category.categories_source.info[0]?null:e.category.categories_source.info[0].name)),t.R7$(8),t.vxM(119,null!=e.category&&e.category.preferred_brands?119:-1),t.R7$(5),t.JRh(t.bMT(125,58,null==e.category?null:e.category.use_preferred_brand_heredity))}}function _i(i,r){if(1&i&&(t.j41(0,"mcrai-option",3),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",r.$index),t.R7$(),t.SpI(" ",e," ")}}function hi(i,r){if(1&i&&(t.j41(0,"mcrai-option",3),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",e),t.R7$(),t.SpI(" ",e," ")}}function gi(i,r){if(1&i&&(t.j41(0,"mcrai-option",3),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",r.$index),t.R7$(),t.SpI(" ",e," ")}}function fi(i,r){if(1&i&&(t.j41(0,"mcrai-option",3),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",r.$index),t.R7$(),t.SpI(" ",e," ")}}function Ci(i,r){if(1&i&&(t.j41(0,"mcrai-option",3),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",r.$index),t.R7$(),t.SpI(" ",e," ")}}function yi(i,r){if(1&i&&(t.j41(0,"mcrai-option",3),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",r.$index+1),t.R7$(),t.SpI(" ",t.bMT(2,2,e)," ")}}function vi(i,r){if(1&i&&(t.j41(0,"mcrai-option",3),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",e.name),t.R7$(),t.SpI(" ",e.name," ")}}function bi(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",16),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.showPrefBrandsModal())}),t.EFF(1,"Nastavit preferovan\xe9 v\xfdrobce "),t.k0s()}}function Ei(i,r){if(1&i){const e=t.RV6();t.j41(0,"form",1)(1,"mcrai-row")(2,"mcrai-col")(3,"mcrai-panel")(4,"mcrai-panel-header")(5,"h3"),t.EFF(6,"Kategorie"),t.k0s()(),t.j41(7,"mcrai-panel-content")(8,"mcrai-select",2),t.Z7z(9,_i,2,2,"mcrai-option",3,t.fX1),t.k0s(),t.nrm(11,"mcrai-input",4),t.j41(12,"mcrai-select",5),t.nrm(13,"mcrai-option",3),t.Z7z(14,hi,2,2,"mcrai-option",3,t.fX1),t.k0s(),t.nrm(16,"br"),t.j41(17,"mcrai-input",6),t.EFF(18," Skr\xfdt kategorii "),t.k0s(),t.j41(19,"mcrai-input",6),t.EFF(20," Zobrazit bannery "),t.k0s(),t.j41(21,"mcrai-input",6),t.EFF(22," Zobrazit kategorie "),t.k0s(),t.j41(23,"mcrai-input",6),t.EFF(24,"Zobrazit \u010dl\xe1nky "),t.k0s(),t.j41(25,"mcrai-input",6),t.EFF(26," Zobrazit produkty "),t.k0s(),t.j41(27,"mcrai-input",6),t.EFF(28," Zobrazit nejprod\xe1van\u011bj\u0161\xed produkty "),t.k0s(),t.j41(29,"mcrai-input",6),t.EFF(30," Zobrazit filtr "),t.k0s(),t.j41(31,"mcrai-input",6),t.EFF(32," Zobrazit zna\u010dky "),t.k0s(),t.j41(33,"mcrai-input",6),t.EFF(34," Zobrazit mapu "),t.k0s(),t.nrm(35,"br")(36,"aegisx-select-category-article",7),t.k0s()()(),t.j41(37,"mcrai-col")(38,"mcrai-panel")(39,"mcrai-panel-header")(40,"h3"),t.EFF(41,"Za\u0159azen\xe9 polo\u017eky"),t.k0s()(),t.j41(42,"mcrai-panel-content")(43,"mcrai-row")(44,"mcrai-col")(45,"mcrai-select",8),t.Z7z(46,gi,2,2,"mcrai-option",3,t.fX1),t.k0s(),t.j41(48,"mcrai-select",9),t.Z7z(49,fi,2,2,"mcrai-option",3,t.fX1),t.k0s(),t.j41(51,"mcrai-select",10),t.Z7z(52,Ci,2,2,"mcrai-option",3,t.fX1),t.k0s()(),t.j41(54,"mcrai-col")(55,"mcrai-select",11),t.Z7z(56,yi,3,4,"mcrai-option",3,t.fX1),t.k0s()()(),t.j41(58,"mcrai-row")(59,"mcrai-col"),t.nrm(60,"aegisx-select-category",12),t.k0s()()()()(),t.j41(61,"mcrai-col")(62,"mcrai-panel")(63,"mcrai-panel-header")(64,"h3"),t.EFF(65,"Ostatn\xed"),t.k0s()(),t.j41(66,"mcrai-panel-content")(67,"mcrai-select",13),t.bIt("pageChange",function(n){t.eBV(e);const c=t.XpG();
1return t.Njj(c.fetchBrands(n,c.query))})("queryChange",function(n){t.eBV(e);const c=t.XpG();return t.Njj(c.fetchBrands(1,n))}),t.Z7z(68,vi,2,2,"mcrai-option",3,t.fX1),t.k0s(),t.nrm(70,"br"),t.j41(71,"mcrai-input",14),t.EFF(72,"Povolit d\u011bdi\u010dnost"),t.k0s()(),t.j41(73,"mcrai-panel-actions"),t.DNE(74,bi,2,0,"button",15),t.k0s()()()()()}if(2&i){const e=t.XpG();t.Y8G("formGroup",e.form),t.R7$(8),t.Y8G("control",e.controls.category_content),t.R7$(),t.Dyx(e.CATEGORY_CONTENTS),t.R7$(2),t.Y8G("control",e.controls.order)("errors",e.ERRORS.order),t.R7$(),t.Y8G("control",e.controls.special_id),t.R7$(),t.Y8G("value",null),t.R7$(),t.Dyx(e.special_ids),t.R7$(3),t.Y8G("control",e.controls.hidden)("checked",e.category.hidden)("value",!0),t.R7$(2),t.Y8G("control",e.controls.enable_banners)("checked",e.category.enable_banners)("value",!0),t.R7$(2),t.Y8G("control",e.controls.enable_categories)("checked",e.category.enable_categories)("value",!0),t.R7$(2),t.Y8G("control",e.controls.enable_articles)("checked",e.category.enable_articles)("value",!0),t.R7$(2),t.Y8G("control",e.controls.enable_products)("checked",e.category.enable_products)("value",!0),t.R7$(2),t.Y8G("control",e.controls.enable_top)("checked",e.category.enable_products)("value",!0),t.R7$(2),t.Y8G("control",e.controls.enable_filter)("checked",e.category.enable_filter)("value",!0),t.R7$(2),t.Y8G("control",e.controls.enable_brands)("checked",e.category.enable_brands)("value",!0),t.R7$(2),t.Y8G("control",e.controls.enable_map)("checked",e.category.enable_map)("value",!0),t.R7$(3),t.Y8G("category",e.category)("form",e.form)("control",e.controls.article_link),t.R7$(9),t.Y8G("control",e.controls.layout),t.R7$(),t.Dyx(e.CATEGORIES_LAYOUTS),t.R7$(2),t.Y8G("control",e.controls.products_layout),t.R7$(),t.Dyx(e.PRODUCTS_LAYOUTS),t.R7$(2),t.Y8G("control",e.controls.articles_layout),t.R7$(),t.Dyx(e.ARTICLES_LAYOUTS),t.R7$(3),t.Y8G("control",e.controls.products_order),t.R7$(),t.Dyx(e.PRODUCTS_ORDER),t.R7$(4),t.Y8G("control",e.form.controls.categories_source)("multiple",!1)("specials",!0)("selected",e.category.categories_source)("placeholder","Zdroj kategori\xed"),t.R7$(7),t.Y8G("control",e.controls.preferred_brands)("paginator",null==e.brands?null:e.brands.paginator),t.R7$(),t.Dyx(null==e.brands?null:e.brands.items),t.R7$(3),t.Y8G("control",e.controls.use_preferred_brand_heredity)("value",!0),t.R7$(3),t.vxM(74,e.toolbarService.isEditMode()?74:-1)}}function Fi(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",18),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.patch())}),t.EFF(1,"Ulo\u017eit zm\u011bny "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isPatchButtonDisabled())}}function ki(i,r){if(1&i&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,Fi,2,1,"button",17),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(1,e.toolbarService.isEditMode()?1:-1)}}let Ri=(()=>{class i{get controls(){return this.form.controls}constructor(e,o,n,c){this.store=e,this.permissionService=o,this.toolbarService=n,this.modalService=c,this.destroy=new F.B7,this.CATEGORIES_LAYOUTS=ot,this.PRODUCTS_LAYOUTS=nt.D,this.ARTICLES_LAYOUTS=wt,this.PRODUCTS_ORDER=Mt.o,this.CATEGORY_CONTENTS=Lt,this.ERRORS={order:{pattern:"Mus\xed b\xfdt nez\xe1porn\xe9 cel\xe9 \u010d\xedslo",max:"P\u0159\xedli\u0161 dlouh\xe9 \u010d\xedslo"}},this.special_ids=[],this.form=new s.J3({special_id:new s.hs,hidden:new s.hs(!1),enable_banners:new s.hs(!0),enable_categories:new s.hs(!0),enable_articles:new s.hs(!0),enable_products:new s.hs(!0),enable_filter:new s.hs(!0),enable_brands:new s.hs(!1),enable_map:new s.hs(!1),enable_top:new s.hs(!1),layout:new s.hs,products_layout:new s.hs,articles_layout:new s.hs,products_order:new s.hs,categories_source:new s.hs,preferred_brands:new s.hs([]),use_preferred_brand_heredity:new s.hs(!0),order:new s.hs(null,[s.k0.pattern(B.j8),s.k0.max(999)]),category_content:new s.hs,article_link:new s.hs})}ngOnInit(){this.store.pipe((0,p.Lt)(_.N2),(0,u.Q)(this.destroy),(0,T.p)(e=>!!e)).subscribe(e=>{this.onCategoryChange(e)}),this.store.select(e=>e.sharedStuff.brands).pipe((0,u.Q)(this.destroy)).subscribe(e=>this.brands=e),this.store.pipe((0,p.Lt)(Kt),(0,u.Q)(this.destroy),(0,T.p)(e=>!!e&&Object.keys(e).length&&!!this.category&&!!this.category.article_link),(0,x.T)(e=>e[this.category.id])).subscribe(e=>{this.defaultArticle=e.items.find(o=>o.id===this.category.article_link)}),this.store.pipe((0,p.Lt)(_.Gf),(0,u.Q)(this.destroy),(0,T.p)(e=>!!e.length)).subscribe(e=>this.special_ids=e),this.fetchSpecialIds()}fetchSpecialIds(){this.store.dispatch(new v.kD)}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}onCategoryChange(e){this.category=e,this.getArticles(),this.form.patchValue({...e,preferred_brands:e.preferred_brands.map(o=>o.brand.name),products_order:0===e.products_order?1:e.products_order,categories_source:e.categories_source?e.categories_source.id:"",use_preferred_brand_heredity:this.category.use_preferred_brand_heredity})}patch(){this.store.dispatch(new g.xu({id:this.category.id,newCategory:this.form.value}))}fetchBrands(e,o){o?(this.query=o,this.store.dispatch(new P.tu({page:e,filter:new Ht(o)}))):this.store.dispatch(new P.tu({page:e}))}
1getArticles(e=1){this.store.dispatch(new Qt({id:this.category.id,page:e}))}showPrefBrandsModal(){const e=new m.m_("750px","500px",{category:this.category});this.modalService.open(ni,e)}isPatchButtonDisabled(){return!this.form.valid||!this.form.dirty}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(et.n),t.rXU(L.h),t.rXU(m.mO))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-category-settings"]],decls:10,vars:4,consts:[["color","secondary","collapsable","",3,"collapsed"],[3,"formGroup"],["placeholder","Co zobrazit",3,"control"],[3,"value"],["type","text","placeholder","Po\u0159ad\xed",3,"control","errors"],["placeholder","Speci\xe1ln\xed ID",3,"control"],["type","checkbox",3,"control","checked","value"],["placeholder","Odkazuje do \u010dl\xe1nku",3,"category","form","control"],["placeholder","\u0160ablona kategori\xed",3,"control"],["placeholder","\u0160ablona produkt\u016f",3,"control"],["placeholder","\u0160ablona \u010dl\xe1nk\u016f",3,"control"],["placeholder","\u0158azen\xed produkt\u016f",3,"control"],[3,"control","multiple","specials","selected","placeholder"],["placeholder","Preferovan\xed v\xfdrobci","multiple","",3,"pageChange","queryChange","control","paginator"],["type","checkbox",3,"control","value"],["mcrai-button","positive"],["mcrai-button","positive",3,"click"],["mcrai-button","positive",3,"disabled"],["mcrai-button","positive",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-row")(1,"mcrai-col")(2,"mcrai-panel",0)(3,"mcrai-panel-header")(4,"h2"),t.EFF(5,"Nastaven\xed"),t.k0s()(),t.j41(6,"mcrai-panel-content"),t.DNE(7,ui,126,60,"mcrai-row")(8,Ei,75,50,"form",1),t.k0s(),t.DNE(9,ki,2,1,"mcrai-panel-actions"),t.k0s()()()),2&o&&(t.R
17$(2),t.Y8G("collapsed",!0),t.R7$(5),t.vxM(7,n.toolbarService.isEditMode()?-1:7),t.R7$(),t.vxM(8,n.toolbarService.isEditMode()?8:-1),t.R7$(),t.vxM(9,n.permissionService.canWrite()?9:-1))},dependencies:[O.Q,s.qT,s.cb,s.j4,tt.N,It.u,at.w,st.P,V.o,z.g,X.g,N.l,H.h,U.B,qt.E,te.R,xt.p,Tt.L,St.Z,ci,li.O,ee.s,di.Z,Bt.D9]})}return i})();var xi=a(55526),Ti=a(96919),Dt=a(81391);function Si(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"N\xe1zev"),t.k0s())}function Di(i,r){if(1&i&&t.nrm(0,"input",12),2&i){const e=t.XpG().$implicit;t.Y8G("formControlName","param["+e.id+"][sort_index]")}}function ji(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.EFF(1),t.DNE(2,Di,1,1,"input",12),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.SpI(" ",e.info[0].name," "),t.R7$(),t.vxM(2,e.id?2:-1)}}function Gi(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Stav"),t.k0s())}function wi(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit,o=t.XpG();t.R7$(),t.SpI(" ",o.isBlacklistedStr(e.id)," ")}}function Mi(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Z rodi\u010de"),t.k0s())}function $i(i,r){if(1&i&&t.nrm(0,"input",13),2&i){const e=t.XpG().$implicit;t.Y8G("formControlName","param["+e.id+"][hidden]")}}function Ii(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,$i,1,1,"input",13),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.vxM(1,e.id?1:-1)}}function Pi(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Povolit"),t.k0s())}function Oi(i,r){if(1&i&&t.nrm(0,"input",14),2&i){const e=t.XpG().$implicit;t.Y8G("formControlName","param["+e.id+"][hidden]")}}function Bi(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,Oi,1,1,"input",14),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.vxM(1,e.id?1:-1)}}function Ai(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Zak\xe1zat"),t.k0s())}function Xi(i,r){if(1&i&&t.nrm(0,"input",15),2&i){const e=t.XpG().$implicit;t.Y8G("formControlName","param["+e.id+"][hidden]")}}function Ni(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,Xi,1,1,"input",15),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.vxM(1,e.id?1:-1)}}function Ui(i,r){1&i&&t.nrm(0,"mcrai-tr")}function Yi(i,r){1&i&&t.nrm(0,"mcrai-tr",16),2&i&&t.Y8G("cdkDragDisabled",!r.$implicit.id)}function Vi(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",19),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.removeSortIndexes())}),t.EFF(1,"Odstranit po\u0159ad\xed "),t.k0s()}}function zi(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",20),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.patch())}),t.EFF(1,"Ulo\u017eit zm\u011bny "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isPatchButtonDisabled())}}function Li(i,r){if(1&i&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,Vi,2,0,"button",17)(2,zi,2,1,"button",18),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(1,e.toolbarService.isEditMode()?1:-1),t.R7$(),t.vxM(2,e.toolbarService.isEditMode()?2:-1)}}let Hi=(()=>{class i{get controls(){return this.form.controls}get columns(){return this.toolbarService.isEditMode()?["name","status","parent","allow","disallow"]:["name","status"]}constructor(e,o,n){this.store=e,this.permissionService=o,this.toolbarService=n,this.destroy=new F.B7,this.CATEGORY_CONTENTS=Lt,this.ERRORS={},this.form=new s.J3({})}ngOnInit(){this.store.pipe((0,p.Lt)(_.N2),(0,u.Q)(this.destroy),(0,T.p)(e=>!!e)).subscribe(e=>{this.onCategoryChange(e)}),this.store.pipe((0,p.Lt)(Ti.M$),(0,u.Q)(this.destroy),(0,x.T)(e=>e[this.category.id])).subscribe(e=>{this.onFilterChange(e)})}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}onCategoryChange(e){this.category=e,this.getCategoryFilter()}onFilterChange(e){this.filter=e,this.filter&&this.initForm()}formValueToParamHash(){const e=[];return this.filter.params.forEach(o=>{if(o.id){const n=o.id,c=`param[${n}]`;e.push({id:n,hidden:this.form.value[`${c}[hidden]`],sort_index:this.form.value[`${c}[sort_index]`]})}}),{param_settings:e}}patch(){this.store.dispatch(new g.xu({id:this.category.id,newCategory:this.formValueToParamHash()}))}getCategoryFilter(){this.store.dispatch(new xi.H9({id:this.category.id,filter:{include_blacklisted:!0}}))}isPatchButtonDisabled(){return!this.form.valid||!this.form.dirty}isBlacklisted(e){if(!this.filter||!this.filter.params_blacklist)return!1;const o=this.filter.params_blacklist.filter(n=>n.id===e);return o.length>=1&&"true"===o[0].hidden}isBlacklistedStr(e){return this.isBlacklisted(e)?"Zak\xe1z\xe1no":"Povoleno"}getBlacklistedValue(e){const o=this.category.param_settings.filter(n=>n.id===e);return o.length>=1?o[0].hidden:"parent"}getParamSortIndex(e){const o=this.category.param_settings.filter(n=>n.id===e);if(o.length>=1){const n=o[0];return n.sort_index?n.sort_index:0}return 0}initForm(){this.form=new s.J3({}
1),this.filter.params.forEach(e=>{e.id&&(this.form.addControl(`param[${e.id}][hidden]`,new s.hs(this.getBlacklistedValue(e.id))),this.form.addControl(`param[${e.id}][sort_index]`,new s.hs(this.getParamSortIndex(e.id))))})}removeSortIndexes(){for(let e=0;e<this.filter.params.length;e++)this.form.patchValue({[`param[${this.filter.params[e].id}][sort_index]`]:0});this.form.markAsDirty(),this.patch()}rewriteSortIndexes(e){const o=e.previousIndex-e.currentIndex;if(0===o)return;let n=0,c=!1;const y=[];for(let E=0;E<this.filter.params.length;E++)c=!1,E===e.currentIndex?(y.push({...this.filter.params[e.previousIndex]}),o>0?(n=-1,c=!0):(c=!0,n=0)):E===e.previousIndex&&(o>0?(y.push({...this.filter.params[E+n]}),n=0,c=!0):n=1),c||y.push({...this.filter.params[E+n]});this.filter.params=y;for(let E=0;E<this.filter.params.length;E++)this.form.patchValue({[`param[${this.filter.params[E].id}][sort_index]`]:E+1});this.form.markAsDirty()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(et.n),t.rXU(L.h))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-category-params"]],decls:35,vars:7,consts:[["color","secondary","collapsable","",3,"collapsed"],[3,"formGroup"],["cdkDropList","",3,"cdkDropListDropped","items","cdkDropListDisabled"],["mcraiColumnDef","name"],[4,"mcraiHeaderCellDef"],[4,"mcraiCellDef"],["mcraiColumnDef","status"],["mcraiColumnDef","parent"],["mcraiColumnDef","allow"],["mcraiColumnDef","disallow"],[4,"mcraiHeaderRowDef"],["cdkDrag","",3,"cdkDragDisabled",4,"mcraiRowDef","mcraiRowDefColumns"],["type","hidden",3,"formControlName"],["type","radio","value","parent",3,"formControlName"],["type","radio","value","false",3,"formControlName"],["type","radio","value","true",3,"formControlName"],["cdkDrag","",3,"cdkDragDisabled"],["mcrai-button","positive"],["mcrai-button","positive",3,"disabled"],["mcrai-button","positive",3,"click"],["mcrai-button","positive",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-row")(1,"mcrai-col")(2,"mcrai-panel",0)(3,"mcrai-panel-header")(4,"h2"),t.EFF(5,"Nastaven\xed parametr\u016f pro filtraci"),t.k0s()(),t.j41(6,"mcrai-panel-content"),t.qex(7),t.j41(8,"form",1)(9,"mcrai-row")(10,"mcrai-col")(11,"mcrai-panel")(12,"mcrai-panel-header")(13,"h3"),t.EFF(14,"Parametry"),t.k0s()(),t.j41(15,"mcrai-panel-content")(16,"mcrai-table",2),t.bIt("cdkDropListDropped",function(y){return n.rewriteSortIndexes(y)}),t.qex(17,3),t.DNE(18,Si,2,0,"mcrai-th",4)(19,ji,3,2,"mcrai-td",5),t.bVm(),t.qex(20,6),t.DNE(21,Gi,2,0,"mcrai-th",4)(22,wi,2,1,"mcrai-td",5),t.bVm(),t.qex(23,7),t.DNE(24,Mi,2,0,"mcrai-th",4)(25,Ii,2,1,"mcrai-td",5),t.bVm(),t.qex(26,8),t.DNE(27,Pi,2,0,"mcrai-th",4)(28,Bi,2,1,"mcrai-td",5),t.bVm(),t.qex(29,9),t.DNE(30,Ai,2,0,"mcrai-th",4)(31,Ni,2,1,"mcrai-td",5),t.bVm(),t.DNE(32,Ui,1,0,"mcrai-tr",10)(33,Yi,1,1,"mcrai-tr",11),t.k0s()()()()()(),t.bVm(),t.k0s(),t.DNE(34,Li,3,2,"mcrai-panel-actions"),t.k0s()()()),2&o&&(t.R
17$(2),t.Y8G("collapsed",!0),t.R7$(6),t.Y8G("formGroup",n.form),t.R7$(8),t.Y8G("items",null==n.filter?null:n.filter.params)("cdkDropListDisabled",!n.toolbarService.isEditMode()),t.R7$(16),t.Y8G("mcraiHeaderRowDef",n.columns),t.R7$(),t.Y8G("mcraiRowDefColumns",n.columns),t.R7$(),t.vxM(34,n.permissionService.canWrite()?34:-1))},dependencies:[O.Q,s.qT,s.me,s.Fm,s.BC,s.cb,s.j4,s.JD,V.o,z.g,X.g,N.l,H.h,U.B,lt.n,dt.q,mt.B,pt.K,ut.D,_t.Q,ht.V,gt.e,ft.O,Dt.O7,Dt.T1]})}return i})();const Zi=i=>["/aegisx","categories",i];function Qi(i,r){1&i&&(t.j41(0,"mcrai-dt"),t.EFF(1,"N\xe1zev ve v\xfdpisu"),t.k0s())}function Ji(i,r){if(1&i&&(t.j41(0,"mcrai-dd"),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.JRh(null==e.category||null==e.category.info[0]?null:e.category.info[0].name_detail)}}function Ki(i,r){if(1&i&&(t.j41(0,"a",1),t.EFF(1),t.k0s()),2&i){const e=t.XpG().$implicit;t.Y8G("routerLink",t.eq3(2,Zi,e.id)),t.R7$(),t.SpI(" ",null==e.info[0]?null:e.info[0].name," ")}}function Wi(i,r){if(1&i&&(t.j41(0,"mcrai-dd"),t.DNE(1,Ki,2,4,"a",1),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.vxM(1,e.id?1:-1)}}let qi=(()=>{class i{constructor(e){this.store=e,this.destroy=new F.B7}ngOnInit(){this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.category),(0,u.Q)(this.destroy)).subscribe(e=>this.category=e)}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-category-info"]],decls:22,vars:4,consts:[["color","secondary"],["target","_blank",3,"routerLink"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-panel",0)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"Z\xe1kladn\xed informace"),t.k0s()(),t.j41(4,"mcrai-panel-content")(5,"mcrai-dl")(6,"mcrai-dt"),t.EFF(7,"N\xe1zev"),t.k0s(),t.j41(8,"mcrai-dd"),t.EFF(9),t.k0s(),t.DNE(10,Qi,2,0,"mcrai-dt")(11,Ji,2,1,"mcrai-dd"),t.j41(12,"mcrai-dt"),t.EFF(13,"Cesta"),t.k0s(),t.j41(14,"mcrai-dd"),t.EFF(15,"root"),t.k0s(),t.Z7z(16,Wi,2,1,"mcrai-dd",null,t.fX1),t.j41(18,"mcrai-dt"),t.EFF(19,"Po\u010det p\u0159\xedstup\u016f"),t.k0s(),t.j41(20,"mcrai-dd"),t.EFF(21),t.k0s()()()()),2&o&&(t.R
17$(9),t.JRh(null==n.category||null==n.category.info[0]?null:n.category.info[0].name),t.R7$(),t.vxM(10,null!=n.category&&null!=n.category.info[0]&&n.category.info[0].name_detail?10:-1),t.R7$(),t.vxM(11,null!=n.category&&null!=n.category.info[0]&&n.category.info[0].name_detail?11:-1),t.R7$(5),t.Dyx(null==n.category?null:n.category.breadcrumbs),t.R7$(5),t.JRh(null==n.category?null:n.category.access_count))},dependencies:[b.Wk,X.g,N.l,U.B,xt.p,Tt.L,St.Z]})}return i})();var Ct=a(70039),ie=a(57864),yt=a(44010),to=a(63020);let eo=(()=>{class i{constructor(){this.formChange=new t.bkB,this.destroy=new F.B7,this.form=new s.J3({q:new s.hs})}ngOnInit(){this.form.valueChanges.pipe((0,to.B)(100),(0,u.Q)(this.destroy)).subscribe(e=>this.formChange.emit(e))}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}static#t=this.\u0275fac=function(o){return new(o||i)};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-assigned-items-filter"]],outputs:{formChange:"formChange"},decls:1,vars:1,consts:[["type","text","placeholder","Hledat",3,"control"]],template:function(o,n){1&o&&t.nrm(0,"mcrai-input",0),2&o&&t.Y8G("control",n.form.controls.q)},dependencies:[tt.N]})}return i})();function io(i,r){1&i&&t.EFF(0,"V cel\xe9 v\u011btvi")}function oo(i,r){1&i&&t.nrm(0,"aegisx-branch",9),2&i&&t.Y8G("item",r.$implicit)}function no(i,r){1&i&&t.EFF(0,"P\u0159\xedmo v kategorii")}function ro(i,r){1&i&&t.nrm(0,"aegisx-branch",9),2&i&&t.Y8G("item",r.$implicit)}function ao(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-paginator",12),t.bIt("page",function(n){t.eBV(e);const c=t.XpG(2);return t.Njj(c.getProducts(n))}),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("paginator",null==e.products?null:e.products.paginator)("showCount",!0)}}function so(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-paginator",12),t.bIt("page",function(n){t.eBV(e);const c=t.XpG(2);return t.Njj(c.getProductsDirect(n))}),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("paginator",null==e.directProducts?null:e.directProducts.paginator)("showCount",!0)}}function co(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",13),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.deleteProducts())}),t.EFF(1,"Smazat vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isDeleteProductsButtonDisabled())}}function lo(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-col")(1,"mcrai-panel")(2,"mcrai-panel-header")(3,"h3"),t.EFF(4,"Produkty"),t.k0s()(),t.j41(5,"mcrai-panel-content")(6,"mcrai-row")(7,"mcrai-col")(8,"mcrai-panel",5)(9,"mcrai-panel-header")(10,"h4"),t.EFF(11,"Filtrace"),t.k0s()(),t.j41(12,"mcrai-panel-content")(13,"aegisx-assigned-items-filter",6),t.bIt("formChange",function(n){t.eBV(e);const c=t.XpG();return t.Njj(c.stagedFilter=n)}),t.k0s()(),t.j41(14,"mcrai-panel-actions")(15,"button",7),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return n.getProducts(1),t.Njj(n.getProductsDirect(1))}),t.EFF(16,"Filtrovat"),t.k0s()()()()(),t.j41(17,"mcrai-row")(18,"mcrai-col")(19,"mcrai-horizontal-tabs",null,0)(21,"mcrai-tab"),t.DNE(22,io,1,0,"ng-template",8),t.Z7z(23,oo,1,1,"aegisx-branch",9,t.fX1),t.k0s(),t.j41(25,"mcrai-tab"),t.DNE(26,no,1,0,"ng-template",8),t.Z7z(27,ro,1,1,"aegisx-branch",9,t.fX1),t.k0s()()()()(),t.j41(29,"mcrai-panel-actions"),t.DNE(30,ao,1,2,"mcrai-paginator",10)(31,so,1,2,"mcrai-paginator",10)(32,co,2,1,"button",11),t.k0s()()()}if(2&i){const e=t.sdS(20),o=t.XpG();t.R7$(23),t.Dyx(null==o.products?null:o.products.items),t.R7$(4),t.Dyx(null==o.directProducts?null:o.directProducts.items),t.R7$(3),t.vxM(30,0===e.selectedIndex?30:-1),t.R7$(),t.vxM(31,1===e.selectedIndex?31:-1),t.R7$(),t.vxM(32,o.toolbarService.isDeleteMode()?32:-1)}}function mo(i,r){1&i&&t.nrm(0,"aegisx-branch",9),2&i&&t.Y8G("item",r.$implicit)}function po(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",13),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.deleteArticles())}),t.EFF(1,"Smazat vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isDeleteArticlesButtonDisabled())}}function uo(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-col")(1,"mcrai-panel")(2,"mcrai-panel-header")(3,"h3"),t.EFF(4,"\u010cl\xe1nky"),t.k0s()(),t.j41(5,"mcrai-panel-content"),t.Z7z(6,mo,1,1,"aegisx-branch",9,t.fX1),t.k0s(),t.j41(8,"mcrai-panel-actions")(9,"mcrai-paginator",3),t.bIt("page",function(n){t.eBV(e);const c=t.XpG();return t.Njj(c.getArticles(n))}),t.k0s(),t.DNE(10,po,2,1,"button",11),t.k0s()()()}if(2&i){const e=t.XpG();t.R7$(6),t.Dyx(null==e.articles?null:e.articles.items),t.R7$(3),t.Y8G("paginator",null==e.articles?null:e.articles.paginator),t.R7$(),t.vxM(10,e.toolbarService.isDeleteMode()?10:-1)}}function _o(i,r){if(1&i&&(t.j41(0,"mcrai-li"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.JRh(e.name)}}function ho(i,r){if(1&i&&(t.j41(0,"mcrai-ul"),t.Z7z(1,_o,2,1,"mcrai-li",null,t.fX1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.Dyx(e.brands.items)}}function go(i,r){if(1&i&&(t.j41(0,"mcrai-option",15),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.Y8G("value",e.name),t.R7$(),t.SpI(" ",e.name," ")}}function fo(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-select",14),t.bIt("pageChange",function(n){t.eBV(e);const c=t.XpG();
1return t.Njj(c.fetchBrands(n,c.query))})("queryChange",function(n){t.eBV(e);const c=t.XpG();return t.Njj(c.fetchBrands(1,n))}),t.Z7z(1,go,2,2,"mcrai-option",15,t.fX1),t.k0s()}if(2&i){const e=t.XpG();t.Y8G("control",e.controls.brands)("paginator",null==e.allBrands?null:e.allBrands.paginator),t.R7$(),t.Dyx(null==e.allBrands?null:e.allBrands.items)}}function Co(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",7),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.saveBrands())}),t.EFF(1,"Ulo\u017eit zm\u011bny "),t.k0s()}}let yo=(()=>{class i{get controls(){return this.form.controls}constructor(e,o,n){this.store=e,this.activatedRoute=o,this.toolbarService=n,this.destroy=new F.B7,this.form=new s.J3({brands:new s.hs([])})}ngOnInit(){this.activatedRoute.params.pipe((0,u.Q)(this.destroy)).subscribe(e=>{this.id=e.id,this.getProducts(1),this.getProductsDirect(1),this.getArticles(1),this.getBrands(1)}),this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.products),(0,u.Q)(this.destroy)).subscribe(e=>this.products=e),this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.directProducts),(0,u.Q)(this.destroy)).subscribe(e=>this.directProducts=e),this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.articles),(0,u.Q)(this.destroy)).subscribe(e=>this.articles=e),this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.brands),(0,u.Q)(this.destroy)).subscribe(e=>{this.brands=e,e&&this.updateForm()}),this.store.pipe((0,p.Lt)(e=>e.aegisxForest.staged),(0,u.Q)(this.destroy),(0,x.T)(e=>e.filter(o=>1==+o.type).map(o=>o.item.id))).subscribe(e=>this.selectedProducts=e),this.store.pipe((0,p.Lt)(e=>e.aegisxForest.staged),(0,u.Q)(this.destroy),(0,x.T)(e=>e.filter(o=>2==+o.type).map(o=>o.item.id))).subscribe(e=>this.selectedArticles=e),this.store.select(e=>e.sharedStuff.brands).pipe((0,u.Q)(this.destroy)).subscribe(e=>this.allBrands=e)}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}getProducts(e){this.store.dispatch(new v.vK({id:this.id,page:e,filter:this.stagedFilter}))}getProductsDirect(e){this.store.dispatch(new v.AS({id:this.id,page:e,filter:this.stagedFilter}))}getArticles(e){this.store.dispatch(new v.Cu({id:this.id,page:e}))}getBrands(e){this.store.dispatch(new v.tu({id:this.id,page:e}))}isDeleteArticlesButtonDisabled(){return!this.selectedArticles||!this.selectedArticles.length}deleteArticles(){this.isDeleteArticlesButtonDisabled()||this.store.dispatch(new Ct.jF({category_id:this.id,items:this.selectedArticles}))}isDeleteProductsButtonDisabled(){return!this.selectedProducts||!this.selectedProducts.length}deleteProducts(){this.isDeleteProductsButtonDisabled()||this.store.dispatch(new Ct.Ae({category_id:this.id,items:this.selectedProducts}))}fetchBrands(e,o){o?(this.query=o,this.store.dispatch(new P.tu({page:e,filter:new Ht(o)}))):this.store.dispatch(new P.tu({page:e}))}saveBrands(){this.store.dispatch(new j.D3({id:this.id,brand_names:this.controls.brands.value}))}updateForm(){this.form.patchValue({brands:this.brands.items.map(e=>e.name)})}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(b.nX),t.rXU(L.h))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-assigned-items"]],decls:19,vars:7,consts:[["productsTabs",""],["color","secondary","collapsable","",3,"collapsed"],["placeholder","Preferovan\xed v\xfdrobci","multiple","",3,"control","paginator"],[1,"pull-left",3,"page","paginator"],["mcrai-button","positive"],["color","secondary","collapsable",""],[3,"formChange"],["mcrai-button","positive",3,"click"],["mcraiTabLabel",""],["parent","category",3,"item"],[1,"pull-left",3,"paginator","showCount"],["mcrai-button","negative",3,"disabled"],[1,"pull-left",3,"page","paginator","showCount"],["mcrai-button","negative",3,"click","disabled"],["placeholder","Preferovan\xed v\xfdrobci","multiple","",3,"pageChange","queryChange","control","paginator"],[3,"value"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-panel",1)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"Za\u0159azen\xe9 polo\u017eky"),t.k0s()(),t.j41(4,"mcrai-panel-content")(5,"mcrai-row"),t.DNE(6,lo,33,3,"mcrai-col")(7,uo,11,2,"mcrai-col"),t.j41(8,"mcrai-col")(9,"mcrai-panel")(10,"mcrai-panel-header")(11,"h3"),t.EFF(12,"Zna\u010dky"),t.k0s()(),t.j41(13,"mcrai-panel-content"),t.DNE(14,ho,3,0,"mcrai-ul")(15,fo,3,2,"mcrai-select",2),t.k0s(),t.j41(16,"mcrai-panel-actions")(17,"mcrai-paginator",3),t.bIt("page",function(y){return n.getArticles(y)}),t.k0s(),t.DNE(18,Co,2,0,"button",4),t.k0s()()()()()()),2&o&&(t.Y8G("collapsed",!0),t.R7$(6),t.vxM(6,n.products&&n.products.items.length>0?6:-1),t.R7$(),t.vxM(7,n.articles&&n.articles.items.length>0?7:-1),t.R7$(7),t.vxM(14,n.brands&&!n.toolbarService.isEditMode()?14:-1),t.R7$(),t.vxM(15,n.toolbarService.isEditMode()?15:-1),t.R7$(2),t.Y8G("paginator",null==n.articles?null:n.articles.paginator),t.R7$(),t.vxM(18,n.toolbarService.isEditMode()?18:-1))},dependencies:[Ut.K,O.Q,at.w,st.P,V.o,z.g,X.g,N.l,H.h,U.B,Vt.h,qt.E,te.R,ie.y,yt.qv,yt.p$,eo]})}return i})(),vo=(()=>{class i{get controls(){return this.form.controls}constructor(e,o,n){this.builder=e,this.store=o,this.modalService=n,this.buildForm()}ngOnInit(){}buildForm(){this.form=this.builder.group({language:["CZ"],name:[null,s.k0.required],url:[null],description:[null],seo_title:[null],seo_description:[null]})}
1isAddButtonDisabled(){return this.form.invalid}createCategoryInfo(){this.isAddButtonDisabled()||(this.store.dispatch(new j.BZ({info:this.form.value})),this.close())}close(){this.modalService.close()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(s.ze),t.rXU(p.il),t.rXU(m.mO))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-add-category-info-modal"]],decls:17,vars:10,consts:[[3,"formGroup"],[3,"control","required","nullable"],["placeholder","N\xe1zev *","type","text",3,"control"],["type","category",3,"control"],["placeholder","Popis","type","text",3,"control"],["placeholder","SEO Title","type","text",3,"control"],["placeholder","SEO Description","type","text",3,"control"],["mcrai-button","negative",3,"click"],["mcrai-button","positive",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-modal")(1,"mcrai-modal-header")(2,"h1"),t.EFF(3,"Nov\xe1 jazykov\xe1 mutace"),t.k0s()(),t.j41(4,"mcrai-modal-content")(5,"form",0),t.nrm(6,"aegisx-select-language",1)(7,"mcrai-input",2)(8,"aegisx-url-input",3)(9,"mcrai-input",4)(10,"mcrai-input",5)(11,"mcrai-input",6),t.k0s()(),t.j41(12,"mcrai-modal-actions")(13,"button",7),t.bIt("click",function(){return n.close}),t.EFF(14,"Zav\u0159\xedt"),t.k0s(),t.j41(15,"button",8),t.bIt("click",function(){return n.createCategoryInfo()}
1),t.EFF(16,"Vytvo\u0159it"),t.k0s()()()),2&o&&(t.R7$(5),t.Y8G("formGroup",n.form),t.R7$(),t.Y8G("control",n.controls.language)("required",!0)("nullable",!1),t.R7$(),t.Y8G("control",n.controls.name),t.R7$(),t.Y8G("control",n.controls.url),t.R7$(),t.Y8G("control",n.controls.description),t.R7$(),t.Y8G("control",n.controls.seo_title),t.R7$(),t.Y8G("control",n.controls.seo_description),t.R7$(4),t.Y8G("disabled",n.isAddButtonDisabled()))},dependencies:[O.Q,s.qT,s.cb,s.j4,Ft.$,J.h,K.l,W.J,q.f,tt.N,Pt.Q]})}return i})();var bo=a(87173),Eo=a(6985),Fo=a(7165);const ko=i=>[i,"name"],Ro=i=>[i,"name_detail"],xo=i=>[i,"url"],To=i=>[i,"seo_title"],So=i=>[i,"seo_description"],Do=i=>[i,"description"];function jo(i,r){if(1&i&&(t.j41(0,"h3"),t.EFF(1),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.JRh(e.language)}}function Go(i,r){if(1&i&&t.EFF(0),2&i){const e=t.XpG(4);t.SpI(" ",e.baseUrl," ")}}function wo(i,r){if(1&i&&(t.j41(0,"mcrai-dl")(1,"mcrai-dt"),t.EFF(2,"N\xe1zev"),t.k0s(),t.j41(3,"mcrai-dd"),t.EFF(4),t.nI1(5,"notSet"),t.k0s(),t.j41(6,"mcrai-dt"),t.EFF(7,"N\xe1zev ve v\xfdpisu"),t.k0s(),t.j41(8,"mcrai-dd"),t.EFF(9),t.nI1(10,"notSet"),t.k0s(),t.j41(11,"mcrai-dt"),t.EFF(12,"URL"),t.k0s(),t.j41(13,"mcrai-dd")(14,"a",3),t.DNE(15,Go,1,1),t.EFF(16),t.k0s()(),t.j41(17,"mcrai-dt"),t.EFF(18,"SEO Title"),t.k0s(),t.j41(19,"mcrai-dd"),t.EFF(20),t.nI1(21,"notSet"),t.k0s(),t.j41(22,"mcrai-dt"),t.EFF(23,"SEO Description"),t.k0s(),t.j41(24,"mcrai-dd"),t.EFF(25),t.nI1(26,"notSet"),t.k0s(),t.j41(27,"mcrai-dt"),t.EFF(28,"Popis"),t.k0s(),t.nrm(29,"mcrai-dd",4),t.nI1(30,"notSet"),t.k0s()),2&i){const e=t.XpG().$implicit,o=t.XpG(2);t.R7$(4),t.JRh(t.bMT(5,8,e.name)),t.R7$(5),t.JRh(t.bMT(10,10,e.name_detail)),t.R7$(5),t.Y8G("mcraiLink",o.category),t.R7$(),t.vxM(15,o.isAbsolute(e)?-1:15),t.R7$(),t.SpI("",e.url," "),t.R7$(4),t.JRh(t.bMT(21,12,e.seo_title)),t.R7$(5),t.JRh(t.bMT(26,14,e.seo_description)),t.R7$(4),t.Y8G("safeHTML",t.bMT(30,16,e.description))}}function Mo(i,r){if(1&i&&(t.nrm(0,"mcrai-input",5)(1,"mcrai-input",6)(2,"aegisx-url-input",7)(3,"mcrai-input",8)(4,"mcrai-input",9),t.j41(5,"div"),t.nrm(6,"br"),t.EFF(7," Popis "),t.nrm(8,"aegisx-smd-editor",10),t.k0s()),2&i){const e=t.XpG().$implicit,o=t.XpG(2);t.Y8G("control",o.form.get(t.eq3(7,ko,e.language)))("errors",o.ERRORS.name),t.R7$(),t.Y8G("control",o.form.get(t.eq3(9,Ro,e.language))),t.R7$(),t.Y8G("control",o.form.get(t.eq3(11,xo,e.language))),t.R7$(),t.Y8G("control",o.form.get(t.eq3(13,To,e.language))),t.R7$(),t.Y8G("control",o.form.get(t.eq3(15,So,e.language))),t.R7$(4),t.Y8G("control",o.form.get(t.eq3(17,Do,e.language)))}}function $o(i,r){if(1&i&&(t.j41(0,"mcrai-tab"),t.DNE(1,jo,2,1,"ng-template",2)(2,wo,31,18,"mcrai-dl")(3,Mo,9,19),t.k0s()),2&i){const e=t.XpG(2);t.R7$(2),t.vxM(2,e.toolbarService.isEditMode()?-1:2),t.R7$(),t.vxM(3,e.toolbarService.isEditMode()?3:-1)}}function Io(i,r){if(1&i&&(t.j41(0,"mcrai-horizontal-tabs"),t.Z7z(1,$o,4,2,"mcrai-tab",null,t.fX1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.Dyx(e.info)}}function Po(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",13),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.patch())}),t.EFF(1,"Ulo\u017eit zm\u011bny "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.form.invalid)}}function Oo(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",14),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.add())}),t.EFF(1,"P\u0159idat jazykovou mutaci "),t.k0s()}}function Bo(i,r){if(1&i&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,Po,2,1,"button",11)(2,Oo,2,0,"button",12),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(1,e.toolbarService.isEditMode()?1:-1),t.R7$(),t.vxM(2,!e.toolbarService.isDeleteMode()&&e.showAddButton()?2:-1)}}let Ao=(()=>{class i{get controls(){return this.form.controls}get baseUrl(){return this.linkService.getCategoriesAbsoluteUrl()}constructor(e,o,n,c,y){this.store=e,this.modalService=o,this.linkService=n,this.permissionService=c,this.toolbarService=y,this.ERRORS={name:{required:"Kategorie mus\xed m\xedt n\xe1zev."}},this.destroy=new F.B7,this.info=[],this.form=new s.J3({}),this.languages=[]}ngOnInit(){this.store.select(e=>e.aegisxCategories.category).pipe((0,u.Q)(this.destroy),(0,T.p)(e=>!!e)).subscribe(e=>this.onCategoryChange(e)),this.store.select(e=>e.sharedLCD.languages).pipe((0,u.Q)(this.destroy)).subscribe(e=>this.languages=e)}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}onCategoryChange(e){this.id=e.id,this.info=e.info,this.category=e,this.updateForm(e.info),this.hydrateForm(e.info)}getInfoDiff(e,o){return o.filter(n=>-1===e.indexOf(n.language))}updateForm(e=[]){const o=Object.keys(this.form.value);this.getInfoDiff(o,e).forEach(c=>{const y=this.buildForm(c);this.form.addControl(c.language,y)})}buildForm(e){const o=new s.J3({});return Object.keys(e).forEach(n=>{["name"].indexOf(n)>=0?o.addControl(n,new s.hs(null,s.k0.required)):o.addControl(n,new s.hs)}),o}hydrateForm(e){e.forEach(o=>{const n=this.form.controls[o.language];n&&n.patchValue(o)})}showAddButton(){return this.info.length<this.languages.length}showActions(){return this.showAddButton()&&this.toolbarService.isViewMode()||!this.toolbarService.isViewMode()}
1add(){const e=new m.m_("600px","500px");this.modalService.open(vo,e)}patch(){const e=this.form.controls;Object.keys(e).forEach(o=>{e[o].dirty&&this.store.dispatch(new g.TZ({id:this.id,language:o,info:e[o].value},!0))})}isAbsolute(e){return/^https?:\/\//.test(e.url)}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(m.mO),t.rXU(bo._),t.rXU(et.n),t.rXU(L.h))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-category-languages"]],decls:8,vars:3,consts:[["color","secondary"],["id","info",3,"formGroup"],["mcraiTabLabel",""],["target","_blank",3,"mcraiLink"],[3,"safeHTML"],["type","text","placeholder","N\xe1zev *",3,"control","errors"],["type","text","placeholder","N\xe1zev ve v\xfdpisu",3,"control"],["type","category",3,"control"],["type","text","placeholder","SEO Title",3,"control"],["type","text","placeholder","SEO Description",3,"control"],[3,"control"],["form","info","mcrai-button","positive",3,"disabled"],["mcrai-button","positive"],["form","info","mcrai-button","positive",3,"click","disabled"],["mcrai-button","positive",3,"click"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-panel",0)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"Jazykov\xe9 mutace"),t.k0s()(),t.j41(4,"mcrai-panel-content")(5,"form",1),t.DNE(6,Io,3,0,"mcrai-horizontal-tabs"),t.k0s()(),t.DNE(7,Bo,3,2,"mcrai-panel-actions"),t.k0s()),2&o&&(t.R
17$(5),t.Y8G("formGroup",n.form),t.R7$(),t.vxM(6,n.info.length?6:-1),t.R7$(),t.vxM(7,n.permissionService.canWrite()&&n.showActions()?7:-1))},dependencies:[O.Q,Eo.m,Fo.g,s.qT,s.cb,s.j4,Ft.$,tt.N,X.g,N.l,H.h,U.B,xt.p,Tt.L,St.Z,ie.y,yt.qv,yt.p$,Ot.N,ee.s],styles:[".mcrai-tabs[_ngcontent-%COMP%]{background-color:#fff!important}"]})}return i})();var vt=a(54704);function Xo(i,r){if(1&i&&t.nrm(0,"mcrai-media",2),2&i){const e=t.XpG(3);t.Y8G("data",e.category.preview_image.small)}}function No(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-panel-actions")(1,"button",4),t.bIt("click",function(){t.eBV(e);const n=t.XpG(3);return t.Njj(n.toggleImageProp("preview_image"))}),t.EFF(2,"Vybrat"),t.k0s()()}}function Uo(i,r){if(1&i&&t.nrm(0,"mcrai-media",2),2&i){const e=t.XpG(3);t.Y8G("data",e.category.background_image.small)}}function Yo(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-panel-actions")(1,"button",4),t.bIt("click",function(){t.eBV(e);const n=t.XpG(3);return t.Njj(n.toggleImageProp("background_image"))}),t.EFF(2,"Vybrat"),t.k0s()()}}function Vo(i,r){if(1&i&&t.nrm(0,"mcrai-media",3),2&i){const e=t.XpG(3);t.Y8G("data",e.category.icon.thumbnail)}}function zo(i,r){if(1&i){const e=t.RV6();t.j41(0,"mcrai-panel-actions")(1,"button",4),t.bIt("click",function(){t.eBV(e);const n=t.XpG(3);return t.Njj(n.toggleImageProp("icon"))}),t.EFF(2,"Vybrat"),t.k0s()()}}function Lo(i,r){if(1&i&&(t.j41(0,"mcrai-row")(1,"mcrai-col")(2,"mcrai-panel")(3,"mcrai-panel-header")(4,"h3"),t.EFF(5,"N\xe1hledov\xfd obr\xe1zek"),t.k0s()(),t.j41(6,"mcrai-panel-content"),t.DNE(7,Xo,1,1,"mcrai-media",2),t.k0s(),t.DNE(8,No,3,0,"mcrai-panel-actions"),t.k0s()(),t.j41(9,"mcrai-col")(10,"mcrai-panel")(11,"mcrai-panel-header")(12,"h3"),t.EFF(13,"Pozad\xed"),t.k0s()(),t.j41(14,"mcrai-panel-content"),t.DNE(15,Uo,1,1,"mcrai-media",2),t.k0s(),t.DNE(16,Yo,3,0,"mcrai-panel-actions"),t.k0s()(),t.j41(17,"mcrai-col")(18,"mcrai-panel")(19,"mcrai-panel-header")(20,"h3"),t.EFF(21,"Ikona"),t.k0s()(),t.j41(22,"mcrai-panel-content"),t.DNE(23,Vo,1,1,"mcrai-media",3),t.k0s(),t.DNE(24,zo,3,0,"mcrai-panel-actions"),t.k0s()()()),2&i){const e=t.XpG(2);t.R7$(2),t.AVh("selected",e.isSelected("preview_image")),t.R7$(5),t.vxM(7,e.category.preview_image?7:-1),t.R7$(),t.vxM(8,e.toolbarService.isDeleteMode()&&e.category.preview_image?8:-1),t.R7$(2),t.AVh("selected",e.isSelected("background_image")),t.R7$(5),t.vxM(15,e.category.background_image?15:-1),t.R7$(),t.vxM(16,e.toolbarService.isDeleteMode()&&e.category.background_image?16:-1),t.R7$(2),t.AVh("selected",e.isSelected("icon")),t.R7$(5),t.vxM(23,e.category.icon?23:-1),t.R7$(),t.vxM(24,e.toolbarService.isDeleteMode()&&e.category.icon?24:-1)}}function Ho(i,r){if(1&i&&t.nrm(0,"mcrai-media",6),2&i){const e=t.XpG(3);t.Y8G("data",e.category.preview_image.medium)}}function Zo(i,r){if(1&i&&t.nrm(0,"mcrai-media",6),2&i){const e=t.XpG(3);t.Y8G("data",e.category.background_image.medium)}}function Qo(i,r){if(1&i&&t.nrm(0,"mcrai-media",6),2&i){const e=t.XpG(3);t.Y8G("data",e.category.icon.medium)}}function Jo(i,r){if(1&i&&(t.j41(0,"form",1)(1,"mcrai-row")(2,"mcrai-col")(3,"mcrai-panel")(4,"mcrai-panel-header")(5,"h3"),t.EFF(6,"N\xe1hledov\xfd obr\xe1zek"),t.k0s()(),t.j41(7,"mcrai-panel-content")(8,"mcrai-row")(9,"mcrai-col"),t.nrm(10,"mcrai-input",5),t.k0s()(),t.j41(11,"mcrai-row")(12,"mcrai-col"),t.DNE(13,Ho,1,1,"mcrai-media",6),t.k0s()()()()(),t.j41(14,"mcrai-col")(15,"mcrai-panel")(16,"mcrai-panel-header")(17,"h3"),t.EFF(18,"Pozad\xed"),t.k0s()(),t.j41(19,"mcrai-panel-content")(20,"mcrai-row")(21,"mcrai-col"),t.nrm(22,"mcrai-input",5),t.k0s()(),t.j41(23,"mcrai-row")(24,"mcrai-col"),t.DNE(25,Zo,1,1,"mcrai-media",6),t.k0s()()()()(),t.j41(26,"mcrai-col")(27,"mcrai-panel")(28,"mcrai-panel-header")(29,"h3"),t.EFF(30,"Ikona"),t.k0s()(),t.j41(31,"mcrai-panel-content")(32,"mcrai-row")(33,"mcrai-col"),t.nrm(34,"mcrai-input",5),t.k0s()(),t.j41(35,"mcrai-row")(36,"mcrai-col"),t.DNE(37,Qo,1,1,"mcrai-media",6),t.k0s()()()()()()()),2&i){const e=t.XpG(2);t.Y8G("formGroup",e.form),t.R7$(10),t.Y8G("control",e.controls.preview_image),t.R7$(3),t.vxM(13,e.category&&e.category.preview_image?13:-1),t.R7$(9),t.Y8G("control",e.controls.background_image),t.R7$(3),t.vxM(25,e.category&&e.category.background_image?25:-1),t.R7$(9),t.Y8G("control",e.controls.icon),t.R7$(3),t.vxM(37,e.category&&e.category.icon?37:-1)}}function Ko(i,r){if(1&i&&(t.j41(0,"mcrai-panel-content"),t.DNE(1,Lo,25,12,"mcrai-row")(2,Jo,38,7,"form",1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(1,e.toolbarService.isEditMode()?-1:1),t.R7$(),t.vxM(2,e.toolbarService.isEditMode()?2:-1)}}function Wo(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",10),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.patch())}
1),t.EFF(1," Ulo\u017eit zm\u011bny "),t.k0s()}}function qo(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.unselectAll())}),t.EFF(1,"Zru\u0161it v\xfdb\u011br "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",!e.selectedImages.length)}}function tn(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",12),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.deleteImages())}),t.EFF(1,"Smazat vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",!e.selectedImages.length)}}function en(i,r){if(1&i&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,Wo,2,0,"button",7)(2,qo,2,1,"button",8)(3,tn,2,1,"button",9),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(1,e.toolbarService.isEditMode()?1:-1),t.R7$(),t.vxM(2,e.toolbarService.isDeleteMode()?2:-1),t.R7$(),t.vxM(3,e.toolbarService.isDeleteMode()?3:-1)}}let on=(()=>{class i{get controls(){return this.form.controls}constructor(e,o,n){this.store=e,this.permissionService=o,this.toolbarService=n,this.destroy=new F.B7,this.form=new s.J3({preview_image:new s.hs,background_image:new s.hs,icon:new s.hs})}ngOnInit(){this.selectCategory(),this.selectSelectedImages()}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}selectCategory(){this.store.select(e=>e.aegisxCategories.category).pipe((0,u.Q)(this.destroy),(0,T.p)(e=>!!e)).subscribe(e=>this.category=e)}selectSelectedImages(){this.store.pipe((0,p.Lt)(_.oo),(0,u.Q)(this.destroy)).subscribe(e=>this.selectedImages=e)}patch(){this.store.dispatch(new j.AH({id:this.category.id,previewImage:this.form.value.preview_image,backgroundImage:this.form.value.background_image,icon:this.form.value.icon})),this.form.reset()}toggleImageProp(e){this.store.dispatch(new vt.X8({prop:e}))}isSelected(e){return this.selectedImages.indexOf(e)>=0}unselectAll(){this.store.dispatch(new vt.J8)}deleteImages(){this.selectedImages.length&&this.store.dispatch(new S.sR({category_id:this.category.id,image_props:this.selectedImages}))}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(et.n),t.rXU(L.h))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-category-images"]],decls:6,vars:3,consts:[["color","secondary","collapsable","",3,"collapsed"],[3,"formGroup"],["type","image","width","400","height","400",3,"data"],["type","image","width","100","height","100",3,"data"],["mcrai-button","neutral",3,"click"],["type","file",3,"control"],["type","image","width","50%","height","auto",3,"data"],["mcrai-button","positive"],["mcrai-button","neutral",3,"disabled"],["mcrai-button","negative",3,"disabled"],["mcrai-button","positive",3,"click"],["mcrai-button","neutral",3,"click","disabled"],["mcrai-button","negative",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-panel",0)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"Obr\xe1zky"),t.k0s()(),t.DNE(4,Ko,3,2,"mcrai-panel-content")(5,en,4,3,"mcrai-panel-actions"),t.k0s()),2&o&&(t.Y8G("collapsed",!0),t.R7$(4),t.vxM(4,n.category?4:-1),t.R7$(),t.vxM(5,n.permissionService.canWrite()?5:-1))},dependencies:[O.Q,s.qT,s.cb,s.j4,$t.e,V.o,z.g,X.g,N.l,H.h,U.B,zt.h],styles:["mcrai-panel.selected[_ngcontent-%COMP%]{background:gray!important}mcrai-panel.selected[_ngcontent-%COMP%]   mcrai-panel-header[_ngcontent-%COMP%], mcrai-panel.selected[_ngcontent-%COMP%]   mcrai-panel-actions[_ngcontent-%COMP%]{background:gray!important}"]})}return i})();var A=a(96465),nn=a(73614),oe=a(58591),rn=a(84426);function an(i,r){if(1&i&&t.nrm(0,"shared-select-price-level",3),2&i){const e=t.XpG();t.Y8G("control",e.controls.price_level)("required",!0)}}function sn(i,r){if(1&i&&t.nrm(0,"mcrai-input",6),2&i){const e=t.XpG();t.Y8G("control",e.controls.margin_max)("errors",e.ERRORS.price)}}function cn(i,r){if(1&i&&t.nrm(0,"mcrai-input",7),2&i){const e=t.XpG();t.Mz_("placeholder","Mar\u017ee [",e.controls.currency.value,"]"),t.Y8G("control",e.controls.margin_abs)("errors",e.ERRORS.price)}}function ln(i,r){if(1&i&&t.nrm(0,"mcrai-input",8),2&i){const e=t.XpG();t.Y8G("control",e.controls.additional_price)("errors",e.ERRORS.price)}}function dn(i,r){if(1&i&&t.nrm(0,"mcrai-input",9),2&i){const e=t.XpG();t.Y8G("control",e.controls.rebate)("errors",e.ERRORS.price)}}let mn=(()=>{class i{get controls(){return this.form.controls}constructor(e,o){this.store=e,this.modalService=o,this.DEFAULT_CURRENCY="CZK",this.ERRORS={price:{pattern:"Mus\xed b\xfdt nez\xe1porn\xe9 \u010d\xedslo"}},this.destroy=new F.B7,this.form=new s.J3({currency:new s.hs(this.DEFAULT_CURRENCY,s.k0.required),price_level:new s.hs(null),margin:new s.hs(null,s.k0.pattern(B.Q6)),margin_min:new s.hs(null,s.k0.pattern(B.Q6)),margin_max:new s.hs(null,s.k0.pattern(B.Q6)),margin_abs:new s.hs(null,s.k0.pattern(B.Q6)),rebate:new s.hs(null,s.k0.pattern(B.Q6)),additional_price:new s.hs(null,s.k0.pattern(B.Q6))}),this.globalControl=new s.hs(!0)}ngOnInit(){this.selectCategory()}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}selectCategory(){this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.category),(0,u.Q)(this.destroy)).subscribe(e=>this.category=e)}add(){this.isAddButtonDisabled()?console.error("add category price not valid",this.form):(this.store.dispatch(new A.M4({category_id:this.category.id,body:this.form.value})),this.close())}isAddButtonDisabled(){return!this.form.valid}close(){this.modalService.close()}isGlobal(){return!!this.globalControl.value}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(m.mO))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-add-category-price-modal"]],decls:26,vars:16,consts:[[3,"formGroup"],[1,"radiogroup__global",3,"control"],["type","radio",3,"value"],[3,"control","required"],["type","text","placeholder","Mar\u017ee [%]",3,"control","errors"],["type","text","placeholder","Min. mar\u017ee [%]",3,"control","errors"],["type","text","placeholder","Max. mar\u017ee [%]",3,"control","errors"],["type","text",3,"control","errors","placeholder"],["type","text","placeholder","Nav\xfd\u0161en\xed MOC",3,"control","errors"],["type","text","placeholder","Rabat [%]",3,"control","errors"],["mcrai-button","negative",3,"click"],["mcrai-button","positive",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-modal")(1,"mcrai-modal-header")(2,"h1"),t.EFF(3,"N
1astavit cenu kategorie"),t.k0s()(),t.j41(4,"mcrai-modal-content")(5,"form",0)(6,"mcrai-row")(7,"mcrai-col")(8,"mcrai-radio-group",1)(9,"mcrai-input",2),t.EFF(10,"Glob\xe1ln\xed cena "),t.k0s(),t.j41(11,"mcrai-input",2),t.EFF(12,"Cena na cenovou hladinu "),t.k0s()()()(),t.nrm(13,"aegisx-select-currency",3),t.DNE(14,an,1,2,"shared-select-price-level",3),t.nrm(15,"mcrai-input",4)(16,"mcrai-input",5),t.DNE(17,sn,1,2,"mcrai-input",6)(18,cn,1,4,"mcrai-input",7)(19,ln,1,2,"mcrai-input",8)(20,dn,1,2,"mcrai-input",9),t.k0s()(),t.j41(21,"mcrai-modal-actions")(22,"button",10),t.bIt("click",function(){return n.close()}),t.EFF(23,"Zav\u0159\xedt "),t.k0s(),t.j41(24,"button",11),t.bIt("click",function(){return n.add()}),t.EFF(25,"Vytvo\u0159it "),t.k0s()()()),2&o&&(t.R7$(5),t.Y8G("formGroup",n.form),t.R7$(3),t.Y8G("control",n.globalControl),t.R7$(),t.Y8G("value",!0),t.R7$(2),t.Y8G("value",!1),t.R7$(2),t.Y8G("control",n.controls.currency)("required",!0),t.R7$(),t.vxM(14,n.isGlobal()?-1:14),t.R7$(),t.Y8G("control",n.controls.margin)("errors",n.ERRORS.price),t.R7$(),t.Y8G("control",n.controls.margin_min)("errors",n.ERRORS.price),t.R7$(),t.vxM(17,n.isGlobal()?17:-1),t.R7$(),t.vxM(18,n.isGlobal()?-1:18),t.R7$(),t.vxM(19,n.isGlobal()?19:-1),t.R7$(),t.vxM(20,n.isGlobal()?-1:20),t.R7$(4),t.Y8G("disabled",n.isAddButtonDisabled()))},dependencies:[O.Q,s.qT,s.cb,s.j4,nn.J,J.h,K.l,W.J,q.f,tt.N,oe.r,oe.S,V.o,z.g,rn.h],styles:[".radiogroup__global[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"]})}return i})();const pn=i=>[i,"margin"],un=i=>[i,"margin_min"],_n=i=>[i,"margin_max"],hn=i=>[i,"margin_abs"],gn=i=>[i,"rebate"],fn=i=>[i,"additional_price"];function Cn(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"M\u011bna"),t.k0s())}function yn(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.JRh(e.currency)}}function vn(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Cenov\xe1 hladina"),t.k0s())}function bn(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.JRh(null==e.price_level?null:e.price_level.name)}}function En(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Mar\u017ee [%]"),t.k0s())}function Fn(i,r){if(1&i&&t.EFF(0),2&i){const e=t.XpG().$implicit;t.SpI(" ",e.margin," ")}}function kn(i,r){if(1&i&&t.nrm(0,"mcrai-input",16),2&i){const e=t.XpG().$implicit,o=t.XpG(2);t.Y8G("control",o.form.get(t.eq3(2,pn,e.id)))("errors",o.ERRORS.price)}}function Rn(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,Fn,1,1)(2,kn,1,4,"mcrai-input",16),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.vxM(1,e.toolbarService.isEditMode()?-1:1),t.R7$(),t.vxM(2,e.toolbarService.isEditMode()?2:-1)}}function xn(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Min. mar\u017ee [%]"),t.k0s())}function Tn(i,r){if(1&i&&t.EFF(0),2&i){const e=t.XpG().$implicit;t.SpI(" ",e.margin_min," ")}}function Sn(i,r){if(1&i&&t.nrm(0,"mcrai-input",17),2&i){const e=t.XpG().$implicit,o=t.XpG(2);t.Y8G("control",o.form.get(t.eq3(2,un,e.id)))("errors",o.ERRORS.price)}}function Dn(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,Tn,1,1)(2,Sn,1,4,"mcrai-input",17),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.vxM(1,e.toolbarService.isEditMode()?-1:1),t.R7$(),t.vxM(2,e.toolbarService.isEditMode()?2:-1)}}function jn(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Max. mar\u017ee [%]"),t.k0s())}function Gn(i,r){if(1&i&&t.EFF(0),2&i){const e=t.XpG().$implicit;t.SpI(" ",e.margin_max," ")}}function wn(i,r){if(1&i&&t.nrm(0,"mcrai-input",18),2&i){const e=t.XpG().$implicit,o=t.XpG(2);t.Y8G("control",o.form.get(t.eq3(2,_n,e.id)))("errors",o.ERRORS.price)}}function Mn(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,Gn,1,1)(2,wn,1,4,"mcrai-input",18),t.k0s()),2&i){const e=r.$implicit,o=t.XpG(2);t.R7$(),t.vxM(1,o.toolbarService.isEditMode()?-1:1),t.R7$(),t.vxM(2,o.toolbarService.isEditMode()&&o.isGlobal(e)?2:-1)}}function $n(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Mar\u017ee"),t.k0s())}function In(i,r){if(1&i&&t.EFF(0),2&i){const e=t.XpG().$implicit;t.SpI(" ",e.margin_abs," ")}}function Pn(i,r){if(1&i&&t.nrm(0,"mcrai-input",19),2&i){const e=t.XpG().$implicit,o=t.XpG(2);t.Mz_("placeholder","Mar\u017ee [",e.currency,"]"),t.Y8G("control",o.form.get(t.eq3(4,hn,e.id)))("errors",o.ERRORS.price)}}function On(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,In,1,1)(2,Pn,1,6,"mcrai-input",19),t.k0s()),2&i){const e=r.$implicit,o=t.XpG(2);t.R7$(),t.vxM(1,o.toolbarService.isEditMode()?-1:1),t.R7$(),t.vxM(2,o.toolbarService.isEditMode()&&!o.isGlobal(e)?2:-1)}}function Bn(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Rabat [%]"),t.k0s())}function An(i,r){if(1&i&&t.EFF(0),2&i){const e=t.XpG().$implicit;t.SpI(" ",e.rebate," ")}}function Xn(i,r){if(1&i&&t.nrm(0,"mcrai-input",20),2&i){const e=t.XpG().$implicit,o=t.XpG(2);t.Y8G("control",o.form.get(t.eq3(2,gn,e.id)))("errors",o.ERRORS.price)}}function Nn(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,An,1,1)(2,Xn,1,4,"mcrai-input",20),t.k0s()),2&i){const e=r.$implicit,o=t.XpG(2);t.R7$(),t.vxM(1,o.toolbarService.isEditMode()?-1:1),t.R7$(),t.vxM(2,o.toolbarService.isEditMode()&&!o.isGlobal(e)?2:-1)}}function Un(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Nav\xfd\u0161en\xed MOC"),t.k0s())}function Yn(i,r){if(1&i&&t.EFF(0),2&i){const e=t.XpG().$implicit;t.SpI(" ",e.additional_price," ")}}function Vn(i,r){if(1&i&&t.nrm(0,"mcrai-input",21),2&i){const e=t.XpG().$implicit,o=t.XpG(2);t.Y8G("control",o.form.get(t.eq3(2,fn,e.id)))("errors",o.ERRORS.price)}}function zn(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,Yn,1,1)(2,Vn,1,4,"mcrai-input",21),t.k0s()),2&i){const e=r.$implicit,o=t.XpG(2);t.R7$(),t.vxM(1,o.toolbarService.isEditMode()?-1:1),t.R7$(),t.vxM(2,o.toolbarService.isEditMode()&&o.isGlobal(e)?2:-1)}}function Ln(i,r){1&i&&t.nrm(0,"mcrai-th")}function Hn(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",24),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,c=t.XpG(2);return t.Njj(c.togglePrice(n))}),t.EFF(1,"Vybrat "),t.k0s()}}function Zn(i,r){if(1&i&&(t.j41(0,"mcrai-td",22),t.DNE(1,Hn,2,0,"button",23),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.vxM(1,e.toolbarService.isDeleteMode()?1:-1)}}function Qn(i,r){1&i&&t.nrm(0,"mcrai-tr")}function Jn(i,r){if(1&i&&t.nrm(0,"mcrai-tr"),2&i){const e=r.$implicit,o=t.XpG(2);t.AVh("mcrai-tr--highlight",o.isSelected(e))}}function Kn(i,r){if(1&i&&(t.j41(0,"mcrai-table",1),t.qex(1,2),t.DNE(2,Cn,2,0,"mcrai-th",3)(3,yn,2,1,"mcrai-td",4),t.bVm(),t.qex(4,5),t.DNE(5,vn,2,0,"mcrai-th",3)(6,bn,2,1,"mcrai-td",4),t.bVm(),t.qex(7,6),t.DNE(8,En,2,0,"mcrai-th",3)(9,Rn,3,2,"mcrai-td",4),t.bVm(),t.qex(10,7),t.DNE(11,xn,2,0,"mcrai-th",3)(12,Dn,3,2,"mcrai-td",4),t.bVm(),t.qex(13,8),t.DNE(14,jn,2,0,"mcrai-th",3)(15,Mn,3,2,"mcrai-td",4),t.bVm(),t.qex(16,9),t.DNE(17,$n,2,0,"mcrai-th",3)(18,On,3,2,"mcrai-td",4),t.bVm(),t.qex(19,10),t.DNE(20,Bn,2,0,"mcrai-th",3)(21,Nn,3,2,"mcrai-td",4),t.bVm(),t.qex(22,11),t.DNE(23,Un,2,0,"mcrai-th",3)(24,zn,3,2,"mcrai-td",4),t.bVm(),t.qex(25,12),t.DNE(26,Ln,1,0,"mcrai-th",3)(27,Zn,2,1,"mcrai-td",13),t.bVm(),t.DNE(28,Qn,1,0,"mcrai-tr",14)(29,Jn,1,2,"mcrai-tr",15),t.k0s()),2&i){const e=t.XpG();t.Y8G("items",e.prices),t.R7$(28),t.Y8G("mcraiHeaderRowDef",e.columns),t.R7$(),t.Y8G("mcraiRowDefColumns",e.columns)}}function Wn(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",27),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.showAddPriceModal())}),t.EFF(1,"Nastavit cenu "),t.k0s()}}function qn(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",28),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.patchPrices())}),t.EFF(1,"Upravit vybran\xe9"),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isPatchButtonDisabled())}}function tr(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",29),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.unselectAll())}),t.EFF(1,"Zru\u0161it v\xfdb\u011br "),t.k0s(),t.j41(2,"button",30),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);
1return t.Njj(n.deletePrices())}),t.EFF(3,"Smazat vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(2);t.Y8G("disabled",e.isDeleteButtonDisabled()),t.R7$(2),t.Y8G("disabled",e.isDeleteButtonDisabled())}}function er(i,r){if(1&i&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,Wn,2,0,"button",25)(2,qn,2,1,"button",26)(3,tr,4,2),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(1,e.toolbarService.isDeleteMode()?-1:1),t.R7$(),t.vxM(2,e.toolbarService.isEditMode()?2:-1),t.R7$(),t.vxM(3,e.toolbarService.isDeleteMode()?3:-1)}}let ir=(()=>{class i{get controls(){return this.form.controls}constructor(e,o,n,c){this.store=e,this.modalService=o,this.permissionService=n,this.toolbarService=c,this.destroy=new F.B7,this.ERRORS={price:{pattern:"Mus\xed b\xfdt nez\xe1porn\xe9 \u010d\xedslo"}},this.columns=["currency","price_level","margin","margin_min","margin_max","margin_abs","rebate","additional_price","actions"],this.form=new s.J3({})}ngOnInit(){this.selectCategory(),this.selectSelectedPrices()}ngOnDestroy(){this.destroy.next(),this.destroy.complete()}selectCategory(){this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.category),(0,T.p)(e=>!!e),(0,u.Q)(this.destroy)).subscribe(e=>{this.category=e,this.updateForm(e.prices),this.hydrateForm(e.prices)}),this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.category),(0,u.Q)(this.destroy),(0,T.p)(e=>!!e),(0,x.T)(e=>e.prices)).subscribe(e=>this.prices=e)}selectSelectedPrices(){this.store.pipe((0,p.Lt)(e=>e.aegisxCategories.selectedPrices),(0,u.Q)(this.destroy)).subscribe(e=>this.selectedPrices=e)}updateForm(e){let o=Object.keys(this.form.value);const n=this.pricesDiff(o,e),c=e.map(E=>E.id);n.forEach(E=>{const ct=this.createPriceForm(E);this.form.addControl(E.id,ct)}),o=Object.keys(this.form.value),o.filter(E=>-1===c.indexOf(E)).forEach(E=>{this.form.removeControl(E)})}hydrateForm(e){e.forEach(o=>{const n=this.form.controls[o.id];n&&n.patchValue(o)})}createPriceForm(e){return new s.J3({id:new s.hs(e.id),margin:new s.hs(e.margin,s.k0.pattern(B.Q6)),margin_min:new s.hs(e.margin_min,s.k0.pattern(B.Q6)),margin_max:new s.hs(e.margin_max,s.k0.pattern(B.Q6)),margin_abs:new s.hs(e.margin_abs,s.k0.pattern(B.Q6)),rebate:new s.hs(e.rebate,s.k0.pattern(B.Q6)),additional_price:new s.hs(e.additional_price,s.k0.pattern(B.Q6))})}pricesDiff(e,o){return o.filter(n=>-1===e.indexOf(n.id))}showAddPriceModal(){const e=new m.m_("800px","600px");this.modalService.open(mn,e)}isSelected(e){return!!this.selectedPrices.find(o=>o.id===e.id)}togglePrice(e){this.store.dispatch(new A.g8({item:e}))}isPatchButtonDisabled(){return!this.form.valid||!this.form.dirty}isDeleteButtonDisabled(){return 0===this.selectedPrices.length}unselectAll(){this.store.dispatch(new vt.J8)}patchPrices(){if(this.isPatchButtonDisabled())console.error("patch category prices not valid",this.form);else{const e=[];Object.keys(this.form.value).forEach(n=>{const c=this.form.controls[n];if(c.valid&&c.dirty){const y=c.value;y.id=n,e.push(y)}}),this.store.dispatch(new A.lV({category_id:this.category.id,bodies:e}))}}
1deletePrices(){this.isDeleteButtonDisabled()?console.error("delete category prices not valid",this.selectedPrices):this.store.dispatch(new A.wB({category_id:this.category.id,items:this.selectedPrices}))}isGlobal(e){return"number"!=typeof e.price_level_id}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(m.mO),t.rXU(et.n),t.rXU(L.h))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-category-prices"]],decls:7,vars:3,consts:[["color","secondary","collapsable","",3,"collapsed"],[3,"items"],["mcraiColumnDef","currency"],[4,"mcraiHeaderCellDef"],[4,"mcraiCellDef"],["mcraiColumnDef","price_level"],["mcraiColumnDef","margin"],["mcraiColumnDef","margin_min"],["mcraiColumnDef","margin_max"],["mcraiColumnDef","margin_abs"],["mcraiColumnDef","rebate"],["mcraiColumnDef","additional_price"],["mcraiColumnDef","actions"],["align-right","",4,"mcraiCellDef"],[4,"mcraiHeaderRowDef"],[3,"mcrai-tr--highlight",4,"mcraiRowDef","mcraiRowDefColumns"],["type","text","placeholder","Mar\u017ee [%]",3,"control","errors"],["type","text","placeholder","Min. mar\u017ee [%]",3,"control","errors"],["type","text","placeholder","Max. mar\u017ee [%]",3,"control","errors"],["type","text",3,"control","errors","placeholder"],["type","text","placeholder","Rabat [%]",3,"control","errors"],["type","text","placeholder","Nav\xfd\u0161en\xed MOC",3,"control","errors"],["align-right",""],["mcrai-button","neutral"],["mcrai-button","neutral",3,"click"],["mcrai-button","positive"],["mcrai-button","positive",3,"disabled"],["mcrai-button","positive",3,"click"],["mcrai-button","positive",3,"click","disabled"],["mcrai-button","neutral",3,"click","disabled"],["mcrai-button","negative",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-panel",0)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"Nastaven\xed cen"),t.k0s()(),t.j41(4,"mcrai-panel-content"),t.DNE(5,Kn,30,3,"mcrai-table",1),t.k0s(),t.DNE(6,er,4,3,"mcrai-panel-actions"),t.k0s()),2&o&&(t.Y8G("collapsed",!0),t.R7$(5),t.vxM(5,n.prices?5:-1),t.R7$(),t.vxM(6,n.permissionService.canWrite()?6:-1))},dependencies:[O.Q,tt.N,X.g,N.l,H.h,U.B,lt.n,dt.q,mt.B,pt.K,ut.D,_t.Q,ht.V,gt.e,ft.O]})}return i})();var Y=a(90255),ne=a(94793),or=a(35119);let nr=(()=>{class i{constructor(e,o,n){this.store=e,this.modalService=o,this.data=n,this.form=new s.J3({users:new s.hs([]),roles:new s.hs([]),blacklist:new s.hs([])})}ngOnInit(){}isAddButtonDisabled(){return this.form.invalid||this.form.pristine}add(){this.isAddButtonDisabled()?console.error("add category permission not valid",this.form):this.store.dispatch(new Y.Q2({category_id:this.data.category.id,body:this.form.value}))}close(){this.modalService.close()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(m.mO),t.rXU(m._P))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-add-category-permission-modal"]],decls:22,vars:9,consts:[[3,"formGroup"],[3,"control","multiple"],[3,"control","roles","multiple"],["mcrai-button","negative",3,"click"],["mcrai-button","positive",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-modal")(1,"mcrai-modal-header")(2,"h1"),t.EFF(3,"Nastavit pr\xe1va"),t.k0s()(),t.j41(4,"mcrai-modal-content")(5,"form",0)(6,"mcrai-row")(7,"mcrai-col")(8,"h2"),t.EFF(9,"Povolit"),t.k0s(),t.nrm(10,"aegisx-select-user",1)(11,"aegisx-select-role",1),t.k0s()(),t.j41(12,"mcrai-row")(13,"mcrai-col")(14,"h2"),t.EFF(15,"Zak\xe1zat"),t.k0s(),t.nrm(16,"aegisx-select-user",2),t.k0s()()()(),t.j41(17,"mcrai-modal-actions")(18,"button",3),t.bIt("click",function(){return n.close()}),t.EFF(19,"Zav\u0159\xedt "),t.k0s(),t.j41(20,"button",4),t.bIt("click",function(){return n.add()}
1),t.EFF(21,"Nastavit "),t.k0s()()()),2&o&&(t.R7$(5),t.Y8G("formGroup",n.form),t.R7$(5),t.Y8G("control",n.form.controls.users)("multiple",!0),t.R7$(),t.Y8G("control",n.form.controls.roles)("multiple",!0),t.R7$(5),t.Y8G("control",n.form.controls.blacklist)("roles",n.form.controls.roles.value)("multiple",!0),t.R7$(4),t.Y8G("disabled",n.isAddButtonDisabled()))},dependencies:[O.Q,s.qT,s.cb,s.j4,ne.J,or.w,J.h,K.l,W.J,q.f,V.o,z.g]})}return i})(),rr=(()=>{class i{get controls(){return this.form.controls}constructor(e,o,n){this.store=e,this.modalService=o,this.data=n,this.form=new s.J3({blacklist:new s.hs([],s.k0.required)}),this.category=n.category}ngOnInit(){}isAddButtonDisabled(){return this.form.invalid}add(){this.isAddButtonDisabled()?console.error("add category blacklist not valid",this.form):(this.store.dispatch(new Y.Q2({category_id:this.category.id,body:this.form.value})),this.close())}close(){this.modalService.close()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(m.mO),t.rXU(m._P))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["mcrai-add-category-blacklist-modal"]],decls:12,vars:4,consts:[[3,"formGroup"],[3,"control","multiple"],["mcrai-button","negative",3,"click"],["mcrai-button","positive",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-modal")(1,"mcrai-modal-header")(2,"h1"),t.EFF(3,"Zak\xe1zat kategorii pro"),t.k0s()(),t.j41(4,"mcrai-modal-content")(5,"form",0),t.nrm(6,"aegisx-select-user",1),t.k0s()(),t.j41(7,"mcrai-modal-actions")(8,"button",2),t.bIt("click",function(){return n.close()}),t.EFF(9,"Zav\u0159\xedt "),t.k0s(),t.j41(10,"button",3),t.bIt("click",function(){return n.add()}
1),t.EFF(11,"Nastavit "),t.k0s()()()),2&o&&(t.R7$(5),t.Y8G("formGroup",n.form),t.R7$(),t.Y8G("control",n.controls.blacklist)("multiple",!0),t.R7$(4),t.Y8G("disabled",n.isAddButtonDisabled()))},dependencies:[O.Q,s.qT,s.cb,s.j4,ne.J,J.h,K.l,W.J,q.f]})}return i})();var jt=a(20832);function ar(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"U\u017eivatel"),t.k0s())}function sr(i,r){if(1&i&&t.EFF(0),2&i){const e=t.XpG().$implicit;t.Lme(" ",null==e.user?null:e.user.username," - ",null==e.user?null:e.user.nickname," ")}}function cr(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.DNE(1,sr,1,2),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.vxM(1,e.user?1:-1)}}function lr(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"Role"),t.k0s())}function dr(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.JRh(null==e.role?null:e.role.name)}}function mr(i,r){1&i&&t.nrm(0,"mcrai-th")}function pr(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",19),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,c=t.XpG(3);return t.Njj(c.toggleUser(n.user))}),t.j41(1,"mcrai-icon"),t.EFF(2,"delete"),t.k0s()()}}function ur(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",19),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,c=t.XpG(3);return t.Njj(c.toggleRole(n.role))}),t.j41(1,"mcrai-icon"),t.EFF(2,"delete"),t.k0s()()}}function _r(i,r){if(1&i&&(t.j41(0,"mcrai-td",17),t.DNE(1,pr,3,0,"button",18)(2,ur,3,0,"button",18),t.k0s()),2&i){const e=r.$implicit,o=t.XpG(3);t.R7$(),t.vxM(1,e.user&&o.toolbarService.isDeleteMode()?1:-1),t.R7$(),t.vxM(2,e.role&&o.toolbarService.isDeleteMode()?2:-1)}}function hr(i,r){1&i&&t.nrm(0,"mcrai-tr")}function gr(i,r){if(1&i&&t.nrm(0,"mcrai-tr"),2&i){const e=r.$implicit,o=t.XpG(3);t.AVh("mcrai-tr--highlight",o.isSelectedUser(e.user)||o.isSelectedRole(e.role))}}function fr(i,r){if(1&i&&(t.j41(0,"mcrai-table",1),t.qex(1,9),t.DNE(2,ar,2,0,"mcrai-th",10)(3,cr,2,1,"mcrai-td",11),t.bVm(),t.qex(4,12),t.DNE(5,lr,2,0,"mcrai-th",10)(6,dr,2,1,"mcrai-td",11),t.bVm(),t.qex(7,13),t.DNE(8,mr,1,0,"mcrai-th",10)(9,_r,3,2,"mcrai-td",14),t.bVm(),t.DNE(10,hr,1,0,"mcrai-tr",15)(11,gr,1,2,"mcrai-tr",16),t.k0s()),2&i){const e=t.XpG(2);t.Y8G("items",e.enabled),t.R7$(10),t.Y8G("mcraiHeaderRowDef",e.columns),t.R7$(),t.Y8G("mcraiRowDefColumns",e.columns)}}function Cr(i,r){1&i&&(t.j41(0,"p"),t.EFF(1," Kategorie je p\u0159\xedstupn\xe1 pro v\u0161echny "),t.k0s())}function yr(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",21),t.bIt("click",function(){t.eBV(e);const n=t.XpG(3);return t.Njj(n.showAddPermissionModal())}),t.EFF(1,"Nastavit "),t.k0s()}}function vr(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",22),t.bIt("click",function(){t.eBV(e);const n=t.XpG(3);return t.Njj(n.unselectEnabled())}),t.EFF(1,"Zru\u0161it v\xfdb\u011br "),t.k0s(),t.j41(2,"button",23),t.bIt("click",function(){t.eBV(e);const n=t.XpG(3);return t.Njj(n.deleteEnabled())}),t.EFF(3,"Smazat vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(3);t.Y8G("disabled",e.isDeleteEnabledButtonDisabled()),t.R7$(2),t.Y8G("disabled",e.isDeleteEnabledButtonDisabled())}}function br(i,r){if(1&i&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,yr,2,0,"button",20)(2,vr,4,2),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.vxM(1,e.toolbarService.isDeleteMode()?-1:1),t.R7$(),t.vxM(2,e.toolbarService.isDeleteMode()?2:-1)}}function Er(i,r){1&i&&(t.j41(0,"mcrai-th"),t.EFF(1,"U\u017eivatel"),t.k0s())}function Fr(i,r){if(1&i&&(t.j41(0,"mcrai-td"),t.EFF(1),t.k0s()),2&i){const e=r.$implicit;t.R7$(),t.E5c(" [",null==e.role?null:e.role.name,"] - ",e.username," - ",e.nickname," ")}}function kr(i,r){1&i&&t.nrm(0,"mcrai-th")}function Rr(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",19),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit,c=t.XpG(3);return t.Njj(c.toggleBlacklist(n))}),t.j41(1,"mcrai-icon"),t.EFF(2,"delete"),t.k0s()()}}function xr(i,r){if(1&i&&(t.j41(0,"mcrai-td",17),t.DNE(1,Rr,3,0,"button",18),t.k0s()),2&i){const e=t.XpG(3);t.R7$(),t.vxM(1,e.toolbarService.isDeleteMode()?1:-1)}}function Tr(i,r){1&i&&t.nrm(0,"mcrai-tr")}function Sr(i,r){if(1&i&&t.nrm(0,"mcrai-tr"),2&i){const e=r.$implicit,o=t.XpG(3);t.AVh("mcrai-tr--highlight",o.isSelectedBlacklist(e))}}function Dr(i,r){if(1&i&&(t.j41(0,"mcrai-table",1),t.qex(1,9),t.DNE(2,Er,2,0,"mcrai-th",10)(3,Fr,2,3,"mcrai-td",11),t.bVm(),t.qex(4,13),t.DNE(5,kr,1,0,"mcrai-th",10)(6,xr,2,1,"mcrai-td",14),t.bVm(),t.DNE(7,Tr,1,0,"mcrai-tr",15)(8,Sr,1,2,"mcrai-tr",16),t.k0s()),2&i){const e=t.XpG(2);t.Y8G("items",e.disabled),t.R7$(7),t.Y8G("mcraiHeaderRowDef",e.columns2),t.R7$(),t.Y8G("mcraiRowDefColumns",e.columns2)}}function jr(i,r){1&i&&(t.j41(0,"p"),t.EFF(1," Nikdo "),t.k0s())}function Gr(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",21),t.bIt("click",function(){t.eBV(e);const n=t.XpG(3);return t.Njj(n.showAddBlacklistModal())}),t.EFF(1,"Zak\xe1zat pro "),t.k0s()}}function wr(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",22),t.bIt("click",function(){t.eBV(e);const n=t.XpG(3);return t.Njj(n.unselectBlacklist())}),t.EFF(1,"Zru\u0161it v\xfdb\u011br "),t.k0s(),t.j41(2,"button",23),t.bIt("click",function(){t.eBV(e);const n=t.XpG(3);return t.Njj(n.deleteBlacklist())}),t.EFF(3,"Smazat vybran\xe9 "),t.k0s()}if(2&i){const e=t.XpG(3);t.Y8G("disabled",e.isDeleteBlacklistButtonDisabled()),t.R7$(2),t.Y8G("disabled",e.isDeleteBlacklistButtonDisabled())}}function Mr(i,r){if(1&i&&(t.j41(0,"mcrai-panel-actions"),t.DNE(1,Gr,2,0,"button",20)(2,wr,4,2),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.vxM(1,e.toolbarService.isDeleteMode()?-1:1),t.R7$(),t.vxM(2,e.toolbarService.isDeleteMode()?2:-1)}}function $r(i,r){if(1&i&&(t.j41(0,"mcrai-panel-content")(1,"mcrai-row")(2,"mcrai-col")(3,"mcrai-panel")(4,"mcrai-panel-header")(5,"h3"),t.EFF(6,"Povoleno pro"),t.k0s()(),t.j41(7,"mcrai-panel-content"),t.DNE(8,fr,12,3,"mcrai-table",1)(9,Cr,2,0,"p"),t.k0s(),t.DNE(10,br,3,2,"mcrai-panel-actions"),t.k0s()(),t.j41(11,"mcrai-col")(12,"mcrai-panel")(13,"m
1crai-panel-header",2)(14,"mcrai-row")(15,"mcrai-col")(16,"h3"),t.EFF(17,"Zak\xe1z\xe1no pro"),t.k0s()(),t.j41(18,"mcrai-col")(19,"mcrai-select",3)(20,"mcrai-option",4),t.EFF(21,"V\xfdchoz\xed"),t.k0s(),t.j41(22,"mcrai-option",5),t.EFF(23,"U\u017eivatel a-z"),t.k0s(),t.j41(24,"mcrai-option",6),t.EFF(25,"U\u017eivatel z-a"),t.k0s(),t.j41(26,"mcrai-option",7),t.EFF(27,"Role a-z"),t.k0s(),t.j41(28,"mcrai-option",8),t.EFF(29,"Role z-a"),t.k0s()()()()(),t.j41(30,"mcrai-panel-content"),t.DNE(31,Dr,9,3,"mcrai-table",1)(32,jr,2,0,"p"),t.k0s(),t.DNE(33,Mr,3,2,"mcrai-panel-actions"),t.k0s()()()()),2&i){const e=t.XpG();t.R7$(8),t.vxM(8,null!=e.enabled&&e.enabled.length?8:-1),t.R7$(),t.vxM(9,null!=e.enabled&&e.enabled.length?-1:9),t.R7$(),t.vxM(10,e.permissionService.canWrite()?10:-1),t.R7$(9),t.Y8G("control",e.order),t.R7$(12),t.vxM(31,null!=e.category&&null!=e.category.blacklist&&e.category.blacklist.length?31:-1),t.R7$(),t.vxM(32,null!=e.category&&null!=e.category.blacklist&&e.category.blacklist.length?-1:32),t.R7$(),t.vxM(33,e.permissionService.canWrite()?33:-1)}}let Ir=(()=>{class i{get enabled(){const e=[];for(const o of this.category.roles)e.push({user:null,role:o});for(const o of this.category.users)e.push({user:o,role:null});return e}get disabled(){let e;switch(this.order.value){case"1":e=(o,n)=>{const c=o.nickname.toLowerCase(),y=n.nickname.toLowerCase();return c<y?-1:c>y?1:0};break;case"2":e=(o,n)=>{const c=o.nickname.toLowerCase(),y=n.nickname.toLowerCase();return y<c?-1:y>c?1:0};break;case"3":e=(o,n)=>{const c=o.role?o.role.name.toLowerCase():"",y=n.role?n.role.name.toLowerCase():"";return c<y?-1:c>y?1:0};break;case"4":e=(o,n)=>{const c=o.role?o.role.name.toLowerCase():"",y=n.role?n.role.name.toLowerCase():"";return y<c?-1:y>c?1:0}}if(e){const o=this.category.blacklist.slice();return o.sort(e),o}return this.category.blacklist}get columns(){return["user","role","actions"]}get columns2(){return["user","actions"]}constructor(e,o,n,c){this.store=e,this.modalService=o,this.permissionService=n,this.toolbarService=c,this.selectedUsers=[],this.selectedRoles=[],this.selectedBlacklist=[],this.order=new s.hs}ngOnInit(){}showAddPermissionModal(){const e=new m.m_("800px","600px",{category:this.category});this.modalService.open(nr,e)}showAddBlacklistModal(){const e=new m.m_("800px","600px",{category:this.category});this.modalService.open(rr,e)}isSelectedUser(e){return!!e&&!!this.selectedUsers.find(o=>o.id===e.id)}isSelectedRole(e){return!!e&&!!this.selectedRoles.find(o=>o.id===e.id)}isSelectedBlacklist(e){return!!this.selectedBlacklist.find(o=>o.id===e.id)}toggleUser(e){this.selectedUsers=(0,jt.g)(this.selectedUsers,e)}toggleRole(e){this.selectedRoles=(0,jt.g)(this.selectedRoles,e)}toggleBlacklist(e){this.selectedBlacklist=(0,jt.g)(this.selectedBlacklist,e)}unselectEnabled(){this.selectedUsers=[],this.selectedRoles=[]}unselectBlacklist(){this.selectedBlacklist=[]}isDeleteEnabledButtonDisabled(){return!this.selectedUsers.length&&!this.selectedRoles.length}deleteEnabled(){this.isDeleteEnabledButtonDisabled()||(this.store.dispatch(new Y.ml({id:this.category.id,users:this.selectedUsers,roles:this.selectedRoles,blacklist:[]})),this.unselectEnabled())}isDeleteBlacklistButtonDisabled(){return!this.selectedBlacklist.length}deleteBlacklist(){this.isDeleteBlacklistButtonDisabled()||(this.store.dispatch(new Y.ml({id:this.category.id,users:[],roles:[],blacklist:this.selectedBlacklist})),this.unselectBlacklist())}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(m.mO),t.rXU(et.n),t.rXU(L.h))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-category-permissions"]],inputs:{category:"category"},decls:5,vars:2,consts:[["color","secondary","collapsable","",3,"collapsed"],[3,"items"],[1,"permissions--header"],["placeholder","Po\u0159ad\xed",3,"control"],["value","0"],["value","1"],["value","2"],["value","3"],["value","4"],["mcraiColumnDef","user"],[4,"mcraiHeaderCellDef"],[4,"mcraiCellDef"],["mcraiColumnDef","role"],["mcraiColumnDef","actions"],["align-right","",4,"mcraiCellDef"],[4,"mcraiHeaderRowDef"],[3,"mcrai-tr--highlight",4,"mcraiRowDef","mcraiRowDefColumns"],["align-right",""],["mcrai-button","neutral"],["mcrai-button","neutral",3,"click"],["mcrai-button","positive"],["mcrai-button","positive",3,"click"],["mcrai-button","neutral",3,"click","disabled"],["mcrai-button","negative",3,"click","disabled"]],template:function(o,n){1&o&&(t.j41(0,"mcrai-panel",0)(1,"mcrai-panel-header")(2,"h2"),t.EFF(3,"N
1astaven\xed pr\xe1v"),t.k0s()(),t.DNE(4,$r,34,7,"mcrai-panel-content"),t.k0s()),2&o&&(t.Y8G("collapsed",!1),t.R7$(4),t.vxM(4,n.category?4:-1))},dependencies:[O.Q,Yt.R,at.w,st.P,V.o,z.g,X.g,N.l,H.h,U.B,lt.n,dt.q,mt.B,pt.K,ut.D,_t.Q,ht.V,gt.e,ft.O],styles:[".permissions--header[_ngcontent-%COMP%]   .mcrai-row[_ngcontent-%COMP%]{width:100%}.permissions--header[_ngcontent-%COMP%]   .mcrai-col[_ngcontent-%COMP%]{display:flex;align-items:center}"]})}return i})();function Pr(i,r){if(1&i&&t.nrm(0,"mcrai-media",1),2&i){const e=t.XpG(2);t.Y8G("data",null==e.category.preview_image?null:e.category.preview_image.thumbnail)("mcraiImageDetail",null==e.category.preview_image?null:e.category.preview_image.original)}}function Or(i,r){if(1&i&&(t.j41(0,"mcrai-panel")(1,"mcrai-panel-header"),t.DNE(2,Pr,1,2,"mcrai-media",1),t.j41(3,"h1"),t.EFF(4),t.k0s()(),t.j41(5,"mcrai-panel-content")(6,"mcrai-row")(7,"mcrai-col"),t.nrm(8,"aegisx-category-info"),t.k0s(),t.j41(9,"mcrai-col",2),t.nrm(10,"aegisx-category-languages"),t.k0s()(),t.j41(11,"mcrai-row")(12,"mcrai-col"),t.nrm(13,"aegisx-category-images"),t.k0s()(),t.j41(14,"mcrai-row")(15,"mcrai-col"),t.nrm(16,"aegisx-category-settings"),t.k0s()(),t.j41(17,"mcrai-row")(18,"mcrai-col"),t.nrm(19,"aegisx-category-params"),t.k0s()(),t.j41(20,"mcrai-row")(21,"mcrai-col"),t.nrm(22,"aegisx-assigned-items"),t.k0s()(),t.j41(23,"mcrai-row")(24,"mcrai-col"),t.nrm(25,"aegisx-category-prices"),t.k0s()(),t.j41(26,"mcrai-row")(27,"mcrai-col"),t.nrm(28,"aegisx-category-permissions",3),t.k0s()()()()),2&i){const e=t.XpG();t.R7$(2),t.vxM(2,e.category.preview_image?2:-1),t.R7$(2),t.JRh(null==e.category.info[0]?null:e.category.info[0].name),t.R7$(24),t.Y8G("category",e.category)}}const Ar=[{path:"",component:Ue,canActivate:[$.J]},{path:":id",component:(()=>{class i{constructor(e,o,n,c){this.store=e,this.activatedRoute=o,this.toolbarService=n,this.location=c,this.destroy=new F.B7}ngOnInit(){this.toolbarService.setToolbarModes([rt.H.View,rt.H.Edit,rt.H.Delete]),this.getLanguages(),this.getBrands(),this.activatedRoute.params.pipe((0,u.Q)(this.destroy)).subscribe(e=>this.getCategory(e.id)),this.store.pipe((0,p.Lt)(_.N2),(0,u.Q)(this.destroy)).subscribe(e=>this.category=e)}ngOnDestroy(){this.destroy.next(),this.destroy.complete(),this.store.pipe((0,p.Lt)(Ve.rd),(0,Ye.s)(1),(0,x.T)(e=>e.find(o=>o.item.id===this.category.id)),(0,T.p)(e=>!!e),(0,x.T)(e=>e.parent),(0,T.p)(e=>"root"!==e)).subscribe(e=>{this.store.dispatch(new kt.jm({id:e,page:1}))})}getBrands(){this.store.dispatch(new P.tu)}getLanguages(){this.store.dispatch(new C.c8)}getCategory(e){this.store.dispatch(new v.zS({id:e}))}showAssignedItems(){return!!this.category&&(this.category.products_count>0||this.category.articles_count>0)}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(p.il),t.rXU(b.nX),t.rXU(L.h),t.rXU(d.aZ))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["aegisx-category-detail"]],decls:10,vars:1,consts:[["mcrai-button","neutral",3,"click"],["type","image","width","40","height","40",1,"header--image",3,"data","mcraiImageDetail"],["flex-2",""],[3,"category"]],template:function(o,n){1&o&&(t.nrm(0,"aegisx-header"),t.j41(1,"mcrai-container")(2,"mcrai-row")(3,"mcrai-col")(4,"button",0),t.bIt("click",function(){return n.location.back()}),t.EFF(5,"Zp\xe1tky"),t.k0s()()(),t.j41(6,"mcrai-row")(7,"mcrai-col"),t.DNE(8,Or,29,3,"mcrai-panel"),t.k0s()()(),t.nrm(9,"aegisx-toolbar")),2&o&&(t.R7$(8),t.vxM(8,n.category?8:-1))},dependencies:[At.I,O.Q,Xt.I,V.o,z.g,Nt.H,X.g,N.l,U.B,zt.h,ze.U,Ri,Hi,qi,yo,Ao,on,ir,Ir],styles:["[_nghost-%COMP%]{display:block}.category-detail__panel--main[_ngcontent-%COMP%]{margin-top:20px}.header--image[_ngcontent-%COMP%]{margin-right:10px}"]})}return i})(),canActivate:[$.J]}];let Xr=(()=>{class i{static#t=this.\u0275fac=function(o){return new(o||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[b.iI.forChild(Ar),b.iI]})}return i})();var G=a(14421),re=a(12906),bt=a(80070);let ae=(()=>{class i extends re.d{constructor(){super(...arguments),this.CATEGORIES_ROOT="categories",this.PRICES="prices",this.PERMISSIONS="permissions"}getCategories(e,o,n){const c=this.buildUrl([this.CATEGORIES_ROOT,e,"nav"],{page:o,ipp:3e3,category_tree:n?n.id:null},!0);return this.get(c)}postCategory(e){const o=this.buildUrl([this.CATEGORIES_ROOT]),n=new FormData;return e.preview_image&&n.append("preview_image",e.preview_image),e.background_image&&n.append("background_image",e.background_image),e.icon&&n.append("icon",e.icon),n.append("body",JSON.stringify(e)),this.post(o,n)}getCategory(e){const o=this.buildUrl([this.CATEGORIES_ROOT,e]);return this.get(o)}patchCategory(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e]);return this.patch(n,o)}postCategoryInfo(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e,"info"]);return this.post(n,o)}patchCategoryInfo(e,o,n){const c=this.buildUrl([this.CATEGORIES_ROOT,e,"info",o]);return this.patch(c,n)}postCategoryImage(e,o,n,c){const y=this.buildUrl([this.CATEGORIES_ROOT,e,"images"]),E=new FormData;return o&&E.append("preview_image",o),n&&E.append("background_image",n),c&&E.append("icon",c),this.post(y,E)}postCategoryNav(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e,"nav"]);return this.post(n,{category_ids:o})}patchCategoriesNav(e){const o=this.buildUrl([this.CATEGORIES_ROOT,"nav"]);return this.patch(o,{categories:e})}postCategoryBrands(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e,"brands"]);return this.post(n,{brands:o})}deleteCategories(e){const o=this.buildUrl([this.CATEGORIES_ROOT],{category_ids:e});return this.del(o)}getProducts(e,o,n=!0,c={}){const y=Object.assign({page:o,deep:n},c),E=this.buildUrl([this.CATEGORIES_ROOT,e,"products"],y,!0);return e?this.get(E):(0,G.of)(null)}getArticles(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e,"articles"],{page:o},!0);return this.get(n)}getBrands(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e,"brands"],{page:o},!0);return this.get(n)}getSpecialIds(){const e=this.buildUrl([this.CATEGORIES_ROOT,"special_ids"]);return this.get(e)}deleteImages(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e,"images"],{image_props:o});return this.del(n)}createPrice(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e,this.PRICES]);return this.post(n,o)}patchPrices(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e,this.PRICES]);return this.patch(n,o)}
1deletePrices(e,o){const n={price_ids:(0,bt._)(o)},c=this.buildUrl([this.CATEGORIES_ROOT,e,this.PRICES],n);return this.del(c)}createPermission(e,o){const n=this.buildUrl([this.CATEGORIES_ROOT,e,this.PERMISSIONS]);return this.post(n,o)}deletePermissions(e,o,n,c){const y={users:(0,bt._)(o),roles:(0,bt._)(n),blacklist:(0,bt._)(c)},E=this.buildUrl([this.CATEGORIES_ROOT,e,this.PERMISSIONS],y);return this.del(E)}patchCategoryPrefBrandOrder(e,o,n,c){const y=this.buildUrl([this.CATEGORIES_ROOT,e,"preferred_brands",o]);return this.patch(y,{order:n,load_tree:c})}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})();var f=a(15539),k=a(49090),w=a(83921),Et=a(57421);let Z=(()=>{class i{constructor(e,o,n,c,y,E){this.actions=e,this.categoryService=o,this.store=n,this.toastService=c,this.loaderService=y,this.modalService=E}static#t=this.\u0275fac=function(o){return new(o||i)(t.KVO(l.En),t.KVO(ae),t.KVO(p.il),t.KVO(m.FS),t.KVO(m.wA),t.KVO(m.mO))};static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})();var M=a(76613);let Nr=(()=>{class i extends Z{constructor(){super(...arguments),this.getCategory=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.Cg),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.getCategory(e.payload.id).pipe((0,x.T)(o=>new v.sq(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.getCategorySuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.ug),(0,f.M)(()=>this.loaderService.hide())),{dispatch:!1}),this.getNewCategories=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.lp),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.getCategories("new",e.payload.page,e.payload.tree).pipe((0,x.T)(o=>new v.Uw({categories:o})),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.getNewCategoriesSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.LY),(0,f.M)(()=>this.loaderService.hide())),{dispatch:!1}),this.deleteArticlesSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(Ct.Ft),(0,Et.E)(this.store),(0,k.n)(([e,o])=>[new v.Cu({id:o.aegisxCategories.category.id,page:1})]))),this.getArticles=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.xd),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.getArticles(e.payload.id,e.payload.page).pipe((0,x.T)(o=>new v.tt(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.getArticlesSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.tx),(0,f.M)(()=>this.loaderService.hide())),{dispatch:!1}),this.deleteProductsSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(Ct.im),(0,Et.E)(this.store),(0,k.n)(([e,o])=>[new v.vK({id:o.aegisxCategories.category.id,page:1})]))),this.getProducts=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.oH),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.getProducts(e.payload.id,e.payload.page,!0,e.payload.filter).pipe((0,x.T)(o=>new v.C$(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.getProductsSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.G_),(0,f.M)(()=>this.loaderService.hide())),{dispatch:!1}),this.getProductsDirect=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.UF),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.getProducts(e.payload.id,e.payload.page,!1,e.payload.filter).pipe((0,x.T)(o=>new v.hI(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.getProductsDirectSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.mU),(0,f.M)(()=>this.loaderService.hide())),{dispatch:!1}),this.getBrands=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v._R),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.getBrands(e.payload.id,e.payload.page).pipe((0,x.T)(o=>new v.ey(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.getBrandsSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.Oj),(0,f.M)(()=>this.loaderService.hide())),{dispatch:!1}),this.getSpecialIds=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.U6),(0,k.n)(()=>this.categoryService.getSpecialIds().pipe((0,x.T)(e=>new v.jm(e)),(0,w.W)(e=>(0,G.of)(new M.Rn(e))))))),this.getSpecialIdsSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(v.SL)),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})();var it=a(70369);let Ur=(()=>{class i extends Z{constructor(){super(...arguments),this.postCategory=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.ot),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.postCategory(e.payload.category).pipe((0,x.T)(o=>new j._1(o,e.payload.tree)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.postCategorySuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.u_),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)}),(0,k.n)(e=>[new v.LQ({page:1,tree:e.tree}
1)]))),this.postCategoryNav=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.iX),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.postCategoryNav(e.payload.id,e.payload.categories).pipe((0,x.T)(o=>new j.j_({...o,id:e.payload.id},e.payload.tree)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.postCategoryNavSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.ks),(0,f.M)(e=>this.toastService.makeToast(e.payload.message,m.Ck.Success)),(0,k.n)(e=>[new v.LQ({page:1,tree:e.tree}),new it.Ae({page:1,tree:e.tree}),new it.n0({page:1,tree:e.tree}),new kt.jm({id:e.payload.id,page:1}),new h.Od({id:e.payload.id})]))),this.postCategoryInfo=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.X5),(0,f.M)(()=>this.loaderService.show()),(0,Et.E)(this.store.select(e=>e.aegisxCategories.category)),(0,k.n)(([e,o])=>this.categoryService.postCategoryInfo(o.id,e.payload.info).pipe((0,x.T)(n=>new j.gi(n)),(0,w.W)(n=>(0,G.of)(new M.Rn(n))))))),this.postCategoryInfoSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.nz),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)})),{dispatch:!1}),this.postCategoryImage=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.As),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.postCategoryImage(e.payload.id,e.payload.previewImage,e.payload.backgroundImage,e.payload.icon).pipe((0,x.T)(o=>new j.Fp(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.postCategoryImageSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.cI),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)})),{dispatch:!1}),this.postCategoryBrands=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.JJ),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.postCategoryBrands(e.payload.id,e.payload.brand_names).pipe((0,x.T)(o=>new j.Wm(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.postCategoryBrandsSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(j.xF),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)}),(0,k.n)(e=>[new v.tu({id:e.payload.id,page:1})])))}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})();var Yr=a(18456);let Vr=(()=>{class i extends Z{constructor(){super(...arguments),this.patchCategory=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(g.iX),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.patchCategory(e.payload.id,e.payload.newCategory).pipe((0,x.T)(o=>new g.w$(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.patchCategorySuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(g.Sp),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)})),{dispatch:!1}),this.patchCategoriesNav=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(g.s9),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.patchCategoriesNav(e.payload.actions).pipe((0,x.T)(o=>new g.bp({...o})),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.patchCategoriesNavSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(g.w7),(0,f.M)(e=>{this.toastService.makeToast(e.payload.message,m.Ck.Success)}),(0,k.n)(e=>[new v.LQ({page:1}),new it.Ae({page:1}),new it.n0({page:1}),new h.G2]))),this.patchCategoryInfo=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(g.Jn),(0,f.M)(()=>this.loaderService.show()),(0,Yr.ZZ)(e=>this.categoryService.patchCategoryInfo(e.payload.id,e.payload.language,e.payload.info).pipe((0,x.T)(o=>new g.OK(o,e.no_get)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.patchCategoryInfoSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(g.ZR),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)}),(0,k.n)(e=>e.no_get?[]:[new v.zS({id:e.payload.item.id})]))),this.patchCategoryPrefBrandOrder=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(g.vW),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.patchCategoryPrefBrandOrder(e.payload.category_id,e.payload.preferred_brand_id,e.payload.order,e.payload.load_tree).pipe((0,x.T)(o=>new g.I2(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.patchCategoryPrefBrandOrderSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(g.pd),(0,k.n)(e=>{if(e.payload.load_tree){const o=e.payload.item.breadcrumbs.length>0?e.payload.item.breadcrumbs.slice(-1)[0].id:null;
1return[o?new kt.jm({id:o,page:1}):new it.n0({page:1})]}return[new v.zS({id:e.payload.item.id})]})))}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})(),zr=(()=>{class i extends Z{constructor(){super(...arguments),this.deleteCategories=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(S.rK),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.deleteCategories(e.payload.branches.map(o=>o.item.id)).pipe((0,x.T)(o=>new S.RU({...o,parents:Array.from(new Set(e.payload.branches.map(n=>n.parent)))},e.payload.tree)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.deleteCategoriesSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(S.nO),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)}),(0,k.n)(e=>[new v.LQ({page:1,tree:e.tree}),new it.Ae({page:1,tree:e.tree}),new it.n0({page:1,tree:e.tree})]))),this.deleteCategoryImages=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(S.ow),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.deleteImages(e.payload.category_id,e.payload.image_props).pipe((0,x.T)(o=>new S.lN(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.deleteCategoryImagesSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(S.wQ),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)})),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})(),Lr=(()=>{class i extends Z{constructor(){super(...arguments),this.removeStaged=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(h.q2),(0,Et.E)(this.store.select(e=>e.aegisxForest.staged)),(0,k.n)(([e,o])=>{const n=[];return o.forEach(c=>{switch(c.parent){case"new":n.push(new S.TZ({id:c.item.id}));break;case"specials":n.push(new S.wF({id:c.item.id}))}}),n})))}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})(),Hr=(()=>{class i extends Z{constructor(){super(...arguments),this.createPrice=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(A.Fz),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.createPrice(e.payload.category_id,e.payload.body).pipe((0,x.T)(o=>new A.JY(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.createPriceSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(A.j0),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)})),{dispatch:!1}),this.patchPrices=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(A.oR),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.patchPrices(e.payload.category_id,e.payload.bodies).pipe((0,x.T)(o=>new A.ex(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.patchPricesSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(A.Ko),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)})),{dispatch:!1}),this.deletePrices=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(A.zF),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.deletePrices(e.payload.category_id,e.payload.items).pipe((0,x.T)(o=>new A.H4(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.deletePricesSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(A.jn),(0,f.M)(e=>{this.loaderService.hide(),this.toastService.makeToast(e.payload.message,m.Ck.Success)})),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})(),Zr=(()=>{class i extends Z{constructor(){super(...arguments),this.createPermission=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(Y.BG),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.createPermission(e.payload.category_id,e.payload.body).pipe((0,x.T)(o=>new Y.t2(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.createPermissionSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(Y.l2),(0,f.M)(e=>{this.toastService.makeToast(e.payload.message,m.Ck.Success)}),(0,k.n)(e=>[new v.sq(e.payload)]))),this.deletePermissions=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(Y.rx),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.categoryService.deletePermissions(e.payload.id,e.payload.users,e.payload.roles,e.payload.blacklist).pipe((0,x.T)(o=>new Y.Jg(o)),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.deletePermissionsSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(Y.dk),(0,f.M)(e=>{this.toastService.makeToast(e.payload.message,m.Ck.Success)}),(0,k.n)(e=>[new v.sq(e.payload)])))}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})();var Qr=a(46150);let Jr=(()=>{class i extends Z{constructor(){super(...arguments),this.reset=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(Qr.EX),(0,k.n)(()=>[new vt.J8,new v.LQ({page:1})])))}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})();var Kr=a(291),Wr=a(50289),qr=a(68998),ta=a(4903),ea=a(13802),ia=a(53278),oa=a(52759),na=a(96161),ra=a(51124),aa=a(67524),sa=a(93578),ca=a(55951),la=a(79194);let da=(()=>{class i extends Z{constructor(){super(...arguments),this.closeModal=(0,l.
1EH)(()=>this.actions.pipe((0,l.gp)(Y.l2),(0,f.M)(()=>{this.modalService.close()})),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})();var ma=a(634);let pa=(()=>{class i{static#t=this.\u0275fac=function(o){return new(o||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[d.MD,ma.r]})}return i})(),ua=(()=>{class i extends re.d{getCategoryArticles(e,o){const c=this.buildUrl(["categories",e,"articles"],{page:o});return this.get(c)}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),_a=(()=>{class i{constructor(e,o,n,c,y,E){this.dataService=e,this.actions=o,this.store=n,this.router=c,this.toastService=y,this.loaderService=E}static#t=this.\u0275fac=function(o){return new(o||i)(t.KVO(ua),t.KVO(l.En),t.KVO(p.il),t.KVO(b.Ix),t.KVO(m.FS),t.KVO(m.wA))};static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})(),ha=(()=>{class i extends _a{constructor(){super(...arguments),this.getCategoryArticles=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(Zt),(0,f.M)(()=>this.loaderService.show()),(0,k.n)(e=>this.dataService.getCategoryArticles(e.payload.id,e.payload.page).pipe((0,x.T)(o=>new Le({id:e.payload.id,items:o})),(0,w.W)(o=>(0,G.of)(new M.Rn(o))))))),this.getCategoryArticlesSuccess=(0,l.EH)(()=>this.actions.pipe((0,l.gp)(Rt),(0,f.M)(()=>this.loaderService.hide())),{dispatch:!1})}static#t=this.\u0275fac=(()=>{let e;return function(n){return(e||(e=t.xGo(i)))(n||i)}})();static#e=this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac})}return i})(),ga=(()=>{class i{static#t=this.\u0275fac=function(o){return new(o||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[d.MD,pa,p.md.forFeature(Jt,Ze),l.Vm.forFeature([ha])]})}return i})(),fa=(()=>{class i{static#t=this.\u0275fac=function(o){return new(o||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[d.MD,s.X1,ga,m.ni]})}return i})();var Ca=a(73821),ya=a(13476),va=a(94684),ba=a(68098),Ea=a(25252);let Fa=(()=>{class i{static#t=this.\u0275fac=function(o){return new(o||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({providers:[ae],imports:[d.MD,Xr,Kr.G,qr.m,Wr.G,s.X1,ta.g,l.Vm.forFeature([Nr,Ur,Vr,zr,Lr,Hr,Zr,Jr,da]),p.md.forFeature(_.qx,_.Ff),sa.m,aa.N,ea.a,ra.d,na._,oa.V,m.xT,m.oP,m.B4,m.ni,m.LU,m.pj,m.SD,m.I0,m.Tm,m.F8,m.Zg,m.hv,m.x6,la.w,ia.G,ca.R,fa,Ca.c,ya.X,va.h,Ea.i,ba.j,Dt.ad]})}return i})()},52570:(Q,I,a)=>{a.d(I,{s:()=>s});var d=a(54438);let s=(()=>{class l{static#t=this.LET={ZERO:1,EMPTY_STR:2,FALSE:4,NAN:8};transform(m,_=0){return _&l.LET.ZERO&&0===m||_&l.LET.EMPTY_STR&&""===m||_&l.LET.FALSE&&!1===m||_&l.LET.NAN&&isNaN(m)?m:m||"-"}static#e=this.\u0275fac=function(_){return new(_||l)};static#i=this.\u0275pipe=d.EJ8({name:"notSet",type:l,pure:!0})}return l})()},41333:(Q,I,a)=>{a.d(I,{A:()=>p});var d=a(60177),s=a(29262),l=a(54438);let p=(()=>{class m{static#t=this.\u0275fac=function($){return new($||m)};static#e=this.\u0275mod=l.$C({type:m});static#i=this.\u0275inj=l.G2t({imports:[d.MD,s.DJ,s.wl]})}return m})()},59722:(Q,I,a)=>{a.d(I,{G:()=>F});var d=a(54438),s=a(95006),l=a(12906);let p=(()=>{class u extends l.d{getCategories(C,R){const h=this.buildUrl(["shop","categories",C,"nav"],{page:R});return this.get(h)}getArticles(C,R){const h=this.buildUrl(["shop","categories",C,"articles"],{page:R});return this.get(h)}getBrands(C,R){const h=this.buildUrl(["shop","categories",C,"brands"],{page:R});return this.get(h)}getProducts(C,R,h,D){const S={page:R,products_layout:h};D&&Object.assign(S,D);const g=this.buildUrl(["shop","categories",C,"products"],S);return this.get(g)}getTopProducts(C,R){const h=this.buildUrl(["shop","categories",C,"top"]);return this.get(h)}getCategory(C){const R=this.buildUrl(["shop","categories",C]);return this.get(R)}getBanners(C,R){const h=this.buildUrl(["shop","categories",C,"banners"],R?{group:R}:void 0);return this.get(h)}getFilter(C,R=null,h="",D=""){const g=this.buildUrl(D?[D,"categories",h,C,"filter"]:["shop","categories",C,"filter"],this.objProc.deleteEmptyKeys(R));return this.get(g).pipe((0,s.T)(P=>({...P.filter,id:C})))}getParamValues(C,R,h,D="",S=""){const P=this.buildUrl(S?[S,"categories",D,C,"filter",R]:["shop","categories",C,"filter",R],this.objProc.deleteEmptyKeys(h));return this.get(P)}static#t=this.\u0275fac=(()=>{let C;return function(h){return(C||(C=d.xGo(u)))(h||u)}})();static#e=this.\u0275prov=d.jDH({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();var m=a(41635),_=a(76965),b=a(63040),$=a(29262);let F=(()=>{class u{constructor(C,R,h,D,S,g){this.dataService=C,this.actions=R,this.store=h,this.router=D,this.toastService=S,this.loaderService=g}static#t=this.\u0275fac=function(R){return new(R||u)(d.KVO(p),d.KVO(m.En),d.KVO(_.il),d.KVO(b.Ix),d.KVO($.FS),d.KVO($.wA))};static#e=this.\u0275prov=d.jDH({token:u,factory:u.\u0275fac})}return u})()},58591:(Q,I,a)=>{a.d(I,{S:()=>m,r:()=>_});var d=a(54438);const s=["type","radio"],l=["*"];let p=0,m=(()=>{class b{set checked(F){this._checked=F,this.changeDetectorRef.markForCheck()}get checked(){return this._checked}constructor(F,u){this.changeDetectorRef=F,this.radioGroup=u,this.id="mcrai-input--radio-"+ ++p,this._checked=!1}
1ngOnInit(){this.radioGroup.value===this.value&&(this.checked=!0),this.name=this.radioGroup.name}onClick(){this.radioGroup.setValue(this),this.checked=!0}isDisabled(){return!this.disabled&&typeof this.disabled<"u"}static#t=this.\u0275fac=function(u){return new(u||b)(d.rXU(d.gRc),d.rXU((0,d.Rfq)(()=>_)))};static#e=this.\u0275cmp=d.VBU({type:b,selectors:[["mcrai-input","type","radio"]],hostVars:4,hostBindings:function(u,T){2&u&&d.AVh("mcrai-input",!0)("mcrai-input--radio",!0)},inputs:{disabled:"disabled",value:"value"},attrs:s,ngContentSelectors:l,decls:5,vars:9,consts:[[1,"mcrai-input__label"],["type","radio",1,"mcrai-input__radio",3,"click","id","name","disabled","checked"],[1,"mcrai-input__circle"],[1,"mcrai-input__text"]],template:function(u,T){1&u&&(d.NAR(),d.j41(0,"label",0)(1,"input",1),d.bIt("click",function(){return T.onClick()}),d.k0s(),d.nrm(2,"div",2),d.j41(3,"div",3),d.SdG(4),d.k0s()()),2&u&&(d.AVh("mcrai-input__label--active",T.checked)("mcrai-input__label--disabled",T.isDisabled()),d.BMQ("for",T.id),d.R7$(),d.Y8G("id",T.id)("name",T.name)("disabled",T.isDisabled())("checked",T.checked))},styles:['.mcrai-input__label{display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}[disabled]>.mcrai-input__label{opacity:.4;cursor:default}.mcrai-input__radio{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.mcrai-input__circle{position:relative;top:0;left:0;height:20px;width:20px;border:2px solid;margin-right:10px;border-radius:50%}.mcrai-input__circle:after{content:"";position:absolute;display:none}.mcrai-input__radio:checked~.mcrai-input__circle:after{display:block}.mcrai-input__circle:after{inset:0;margin:auto;width:10px;height:10px;border-radius:50%}.mcrai-input__text{flex:1;font-weight:500}.mcrai-radio-group--inline{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:stretch;gap:8px;margin:0}.mcrai-radio-group--inline .mcrai-input--radio{flex:0 0 auto;display:flex}.mcrai-radio-group--inline .mcrai-input__label{flex-grow:1;margin:0;padding:4px 16px;border:1px solid #9da8b3;border-radius:3px}.mcrai-radio-group--inline .mcrai-input__label--active{background-color:#ddd}.mcrai-radio-group--inline .mcrai-input__label--disabled{opacity:.4;cursor:default}.mcrai-radio-group--inline .mcrai-input__circle{display:none}\n'],encapsulation:2,changeDetection:0})}return b})(),_=(()=>{class b{get control(){return this._control}set control(F){this._control=F}setValue(F){this.control.setValue(F.value),this.radios.forEach(u=>{u.id!==F.id&&(u.checked=!1)}),this.radioGroupInput.emit(this)}get value(){return this.control.value}get classNames(){return"mcrai-radio-group mcrai-radio-group--"+this.layout}constructor(){this.radioGroupInput=new d.bkB,this.layout="classic",this.name="mcrai-radio-group-"+ ++p}ngOnInit(){}static#t=this.\u0275fac=function(u){return new(u||b)};static#e=this.\u0275dir=d.FsC({type:b,selectors:[["mcrai-radio-group"]],contentQueries:function(u,T,C){if(1&u&&d.wni(C,m,4),2&u){let R;d.mGM(R=d.lsd())&&(T.radios=R)}},hostVars:2,hostBindings:function(u,T){2&u&&d.HbH(T.classNames)},inputs:{control:"control",layout:"layout"},outputs:{radioGroupInput:"radioGroupInput"}})}return b})()},48235:(Q,I,a)=>{a.d(I,{R:()=>l});var d=a(54438);const s=["*"];let l=(()=>{class p{set separator(_){this.separatorCssClass=!1!==_}set highlight(_){this.highlightCssClass=!1!==_}constructor(){this.cssClass=!0,this.separatorCssClass=!1,this.highlightCssClass=!1}ngOnInit(){}static#t=this.\u0275fac=function(b){return new(b||p)};static#e=this.\u0275cmp=d.VBU({type:p,selectors:[["mcrai-li"]],hostVars:6,hostBindings:function(b,$){2&b&&d.AVh("mcrai-li",$.cssClass)("mcrai-li--separator",$.separatorCssClass)("mcrai-li--highlight",$.highlightCssClass)},inputs:{separator:"separator",highlight:"highlight"},ngContentSelectors:s,decls:1,vars:0,template:function(b,$){1&b&&(d.NAR(),d.SdG(0))},styles:[".mcrai-li{display:block}.mcrai-li--separator{margin-top:5px}\n"],encapsulation:2,changeDetection:0})}return p})()},19727:(Q,I,a)=>{a.d(I,{E:()=>l});var d=a(54438);const s=["*"];let l=(()=>{class p{constructor(){this.cssClass=!0}ngOnInit(){}static#t=this.\u0275fac=function(b){return new(b||p)};static#e=this.\u0275cmp=d.VBU({type:p,selectors:[["mcrai-ul"]],hostVars:2,hostBindings:function(b,$){2&b&&d.AVh("mcrai-ul",$.cssClass)},ngContentSelectors:s,decls:1,vars:0,template:function(b,$){1&b&&(d.NAR(),d.SdG(0))},styles:[".mcrai-ul{display:flex;flex-direction:column;margin:3px 0}\n"],encapsulation:2,changeDetection:0})}return p})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.