manifest 4.6.2 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,5 +9,5 @@
9
9
  <style>@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";@charset "UTF-8";html,body{margin:0;padding:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}html{background-color:#fff;font-size:10px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-width:300px;overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{font-family:Rubik,sans-serif}body{color:#535356;font-size:1em;font-weight:400;line-height:1.5}*:focus{outline:none}html{overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}@media screen and (max-width: 999px){html{font-size:10.22px}}body{text-rendering:optimizeLegibility;overflow:hidden;background:#f5f7f9;color:#303032;font-size:1.2rem}*[href]{cursor:pointer}</style><link rel="stylesheet" href="styles.3d08469f3ecb6171.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.3d08469f3ecb6171.css"></noscript></head>
10
10
  <body>
11
11
  <app-root></app-root>
12
- <script src="runtime.403eb7b027c4a939.js" type="module"></script><script src="polyfills.2aefc0784c3d32a6.js" type="module"></script><script src="main.f278d8f8fda3eed1.js" type="module"></script></body>
12
+ <script src="runtime.403eb7b027c4a939.js" type="module"></script><script src="polyfills.2aefc0784c3d32a6.js" type="module"></script><script src="main.752247e6982e0e3e.js" type="module"></script></body>
13
13
  </html>
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[792],{4783:(et,he,M)=>{M.r(he),M.d(he,{AuthModule:()=>tt});var h=M(2943),o=M(8023),K=M(3123),q=M(4385),x=M(8284);let ge=(()=>{class Te{constructor(Ie){this.router=Ie}canActivate(){return!localStorage.getItem(q.il)||(this.router.navigate(["/"]),!1)}static{this.\u0275fac=function(He){return new(He||Te)(x.KVO(K.Ix))}}static{this.\u0275prov=x.jDH({token:Te,factory:Te.\u0275fac,providedIn:"root"})}}return Te})();var te=M(7431),we=M(9911),pe=M(5442),ce=M(7906),oe=M(818),ye=M(8428);const Le=Te=>({name:"email",type:Te}),ne=Te=>({name:"password",type:Te});function Ce(Te,at){if(1&Te){const Ie=x.RV6();x.j41(0,"div",10)(1,"div",11)(2,"div",12)(3,"app-input",13),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("email",ft))}),x.k0s()()(),x.j41(4,"div",11)(5,"div",12)(6,"app-input",13),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("password",ft))}),x.k0s()()()()}if(2&Te){const Ie=x.XpG();x.R7$(3),x.Y8G("prop",x.eq3(4,Le,Ie.PropType.Email))("value",Ie.suggestedEmail),x.R7$(3),x.Y8G("prop",x.eq3(6,ne,Ie.PropType.Password))("value",Ie.suggestedPassword)}}function ct(Te){return at=>{const Ie=at.parent;if(!Ie)return null;const He=Ie.get(Te);if(!He)return null;const Ht=at.value;return Ht&&He.value===Ht?null:{confirmPasswordMismatch:!0}}}const yt=Te=>({name:"email",type:Te}),pt=Te=>({name:"password",type:Te}),Ne=Te=>({name:"confirm password",type:Te});function be(Te,at){if(1&Te){const Ie=x.RV6();x.j41(0,"div",14)(1,"div",15)(2,"div",16)(3,"app-input",17),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("email",ft))}),x.k0s()()(),x.j41(4,"div",15)(5,"div",16)(6,"app-input",17),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("password",ft))}),x.k0s()()(),x.j41(7,"div",15)(8,"div",16)(9,"app-input",17),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("confirmPassword",ft))}),x.k0s()()()()}if(2&Te){const Ie=x.XpG();x.R7$(3),x.Y8G("prop",x.eq3(3,yt,Ie.PropType.Email)),x.R7$(3),x.Y8G("prop",x.eq3(5,pt,Ie.PropType.Password)),x.R7$(3),x.Y8G("prop",x.eq3(7,Ne,Ie.PropType.Password))}}const Pe=[{path:"login",component:(()=>{class Te{constructor(Ie,He,ft,Ht){this.authService=Ie,this.router=He,this.activatedRoute=ft,this.flashMessageService=Ht,this.PropType=pe.Kk}ngOnInit(){var Ie=this;this.activatedRoute.queryParams.subscribe(function(){var He=(0,te.A)(function*(ft){ft.email&&ft.password?(Ie.suggestedEmail=ft.email,Ie.suggestedPassword=ft.password):(yield Ie.authService.isDefaultAdminExists())&&(Ie.suggestedEmail=q.Fr.email,Ie.suggestedPassword=q.Fr.password),Ie.form=new we.gE({email:new we.MJ(Ie.suggestedEmail||"",[we.k0.required,we.k0.email]),password:new we.MJ(Ie.suggestedPassword||"",[we.k0.required])}),(yield Ie.authService.isDbEmpty())&&Ie.router.navigate(["/auth/welcome"])});return function(ft){return He.apply(this,arguments)}}())}patchValue(Ie,He){this.form.get(Ie)?.patchValue(He)}submit(){this.authService.login(this.form.value).then(Ie=>{this.router.navigate(["/"])},Ie=>{this.flashMessageService.error(401===Ie.status?"Error: Incorrect username or password.":Ie.error.message)})}static{this.\u0275fac=function(He){return new(He||Te)(x.rXU(ce.u),x.rXU(K.Ix),x.rXU(K.nX),x.rXU(oe.L))}}static{this.\u0275cmp=x.VBU({type:Te,selectors:[["app-login"]],decls:13,vars:2,consts:[[1,"hero","is-fullheight"],[1,"hero-body"],[1,"container","has-text-centered"],[1,"columns"],[1,"column","col-login"],["src","/assets/images/logo.svg","alt","manifest logo","width","264",1,"mb-3"],[1,"title","is-4"],["class","has-text-left",4,"ngIf"],[1,"button","is-block","is-dark","is-fullwidth","mb-3",3,"click","disabled"],[1,"column","col-decoration"],[1,"has-text-left"],[1,"field","mb-5"],[1,"control"],[3,"valueChanged","prop","value"]],template:function(He,ft){1&He&&(x.j41(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),x.nrm(6,"img",5),x.j41(7,"h2",6),x.EFF(8,"Sign in"),x.k0s(),x.DNE(9,Ce,7,8,"div",7),x.j41(10,"button",8),x.bIt("click",function(){return ft.submit()}),x.EFF(11," Login "),x.k0s()()()(),x.nrm(12,"div",9),x.k0s()()()),2&He&&(x.R7$(9),x.Y8G("ngIf",ft.form),x.R7$(),x.Y8G("disabled",!ft.form.valid))},dependencies:[h.bT,ye.S],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.container[_ngcontent-%COMP%]{max-width:100%;width:100%}.hero.is-fullheight[_ngcontent-%COMP%]{min-height:calc(100vh - 64px)}.notification[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:auto;border-radius:0;bottom:unset}.auth-column[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%]{position:fixed;display:flex;align-items:center;justify-content:center;background-color:#fff;left:0;top:0;height:100vh}.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin:auto}@media screen and (min-width: 1188px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:482px;min-width:382px}}@media screen and (min-width: 1000px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:360px}}@media screen and (min-width: 768px),print{.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:320px}}@media screen and (max-width: 767px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:50%;max-width:380px}}@media screen and (max-width: 999px){.col-login[_ngcontent-%COMP%]{width:66.66667%}}@media screen and (max-width: 767px){.col-login[_ngcontent-%COMP%]{width:100%}}@media screen and (min-width: 1000px){.col-login[_ngcontent-%COMP%]{width:40%}}@media screen and (min-width: 1188px){.col-login[_ngcontent-%COMP%]{width:33.33333%}}.col-decoration[_ngcontent-%COMP%]{width:60%}@media screen and (max-width: 999px){.col-decoration[_ngcontent-%COMP%]{width:33.33333%}}@media screen and (min-width: 1188px){.col-decoration[_ngcontent-%COMP%]{width:66.66666%}}']})}}return Te})(),canActivate:[ge]},{path:"logout",component:(()=>{class Te{constructor(Ie,He){this.authService=Ie,this.router=He}ngOnInit(){this.authService.logout(),this.router.navigate(["/","auth","login"])}static{this.\u0275fac=function(He){return new(He||Te)(x.rXU(ce.u),x.rXU(K.Ix))}}static{this.\u0275cmp=x.VBU({type:Te,selectors:[["ng-component"]],decls:1,vars:0,template:function(He,ft){1&He&&x.EFF(0,"NO UI TO BE FOUND HERE!")},encapsulation:2})}}return Te})()},{path:"welcome",component:(()=>{class Te{constructor(Ie,He,ft){this.authService=Ie,this.router=He,this.flashMessageService=ft,this.PropType=pe.Kk}ngOnInit(){this.form=new we.gE({email:new we.MJ("",[we.k0.required,we.k0.email]),password:new we.MJ("",[we.k0.required]),confirmPassword:new we.MJ("",[we.k0.required,ct("password")])})}patchValue(Ie,He){this.form.get(Ie)?.patchValue(He)}submit(){var Ie=this;return(0,te.A)(function*(){if(!(yield Ie.authService.signup(Ie.form.value)))return Ie.flashMessageService.error("Error: Failed to register");Ie.flashMessageService.success("Welcome! You have successfully registered as an admin."),Ie.router.navigate(["/"])})()}static{this.\u0275fac=function(He){return new(He||Te)(x.rXU(ce.u),x.rXU(K.Ix),x.rXU(oe.L))}}static{this.\u0275cmp=x.VBU({type:Te,selectors:[["app-register-first-admin"]],decls:17,vars:2,consts:[[1,"hero","is-fullheight"],[1,"hero-body"],[1,"container","has-text-centered"],[1,"columns"],[1,"column","col-welcome"],[1,"register-wrap"],["src","/assets/images/logo.svg","alt","manifest logo","width","264",1,"mb-3"],[1,"card","is-bordered"],[1,"card-content"],[1,"content"],[1,"title","is-2","has-text-weight-bold"],[1,"is-size-5"],["class","has-text-left",4,"ngIf"],[1,"button","is-block","is-dark","is-fullwidth","mb-0",3,"click","disabled"],[1,"has-text-left"],[1,"field","mb-5"],[1,"control"],[3,"valueChanged","prop"]],template:function(He,ft){1&He&&(x.j41(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),x.nrm(6,"img",6),x.j41(7,"div",7)(8,"div",8)(9,"div",9)(10,"h2",10),x.EFF(11,"Welcome"),x.k0s(),x.j41(12,"p",11),x.EFF(13," Welcome to your admin panel. Create your first admin account to continue. You can always change those values later. "),x.k0s(),x.DNE(14,be,10,9,"div",12),x.j41(15,"button",13),x.bIt("click",function(){return ft.submit()}),x.EFF(16," Login "),x.k0s()()()()()()()()()()),2&He&&(x.R7$(14),x.Y8G("ngIf",ft.form),x.R7$(),x.Y8G("disabled",!ft.form.valid))},dependencies:[h.bT,ye.S],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.container[_ngcontent-%COMP%]{max-width:100%;width:100%}.hero.is-fullheight[_ngcontent-%COMP%]{min-height:calc(100vh - 64px)}.notification[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:auto;border-radius:0;bottom:unset}.auth-column[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%]{position:fixed;display:flex;align-items:center;justify-content:center;background-color:#fff;left:0;top:0;height:100vh}.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin:auto}@media screen and (min-width: 1188px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:482px;min-width:382px}}@media screen and (min-width: 1000px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:360px}}@media screen and (min-width: 768px),print{.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:320px}}@media screen and (max-width: 767px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:50%;max-width:380px}}.col-welcome[_ngcontent-%COMP%]{width:100vw}']})}}return Te})(),canActivate:[(()=>{class Te{constructor(Ie,He){this.authService=Ie,this.router=He}canActivate(){var Ie=this;return(0,te.A)(function*(){return!!(yield Ie.authService.isDbEmpty())||(Ie.router.navigate(["/auth/login"]),!1)})()}static{this.\u0275fac=function(He){return new(He||Te)(x.KVO(ce.u),x.KVO(K.Ix))}}static{this.\u0275prov=x.jDH({token:Te,factory:Te.\u0275fac,providedIn:"root"})}}return Te})()]}];let Ue=(()=>{class Te{static{this.\u0275fac=function(He){return new(He||Te)}}static{this.\u0275mod=x.$C({type:Te})}static{this.\u0275inj=x.G2t({imports:[K.iI.forChild(Pe),K.iI]})}}return Te})(),tt=(()=>{class Te{static{this.\u0275fac=function(He){return new(He||Te)}}static{this.\u0275mod=x.$C({type:Te})}static{this.\u0275inj=x.G2t({imports:[h.MD,Ue,o.G]})}}return Te})()},7906:(et,he,M)=>{M.d(he,{u:()=>pe});var h=M(7431),o=M(8033),K=M(4385),q=M(9606),x=M(8284),ge=M(5640),te=M(3123),we=M(818);let pe=(()=>{class ce{constructor(ye,Le,ne){this.http=ye,this.router=Le,this.flashMessageService=ne,this.currentUserPromise=null}login(ye){var Le=this;return(0,h.A)(function*(){return(0,o._)(Le.http.post(`${q.c.apiBaseUrl}/auth/admins/login`,ye)).then(ne=>{const Ce=ne?.token;return Ce&&localStorage.setItem(K.il,Ce),Ce})})()}signup(ye){var Le=this;return(0,h.A)(function*(){return(0,o._)(Le.http.post(`${q.c.apiBaseUrl}/auth/admins/signup`,ye)).then(ne=>{const Ce=ne?.token;return Ce&&localStorage.setItem(K.il,Ce),Ce})})()}logout(){delete this.currentUserPromise,localStorage.removeItem(K.il)}isLoggedIn(){return!!localStorage.getItem(K.il)}me(){var ye=this;return(0,h.A)(function*(){return ye.currentUserPromise||(ye.currentUserPromise=(0,o._)(ye.http.get(`${q.c.apiBaseUrl}/auth/admins/me`)).catch(()=>{ye.logout(),ye.router.navigate(["/auth/login"]),ye.flashMessageService.error("You must be logged in to view that page.")})),ye.currentUserPromise})()}isDefaultAdminExists(){var ye=this;return(0,h.A)(function*(){return(0,o._)(ye.http.get(`${q.c.apiBaseUrl}/auth/admins/default-exists`)).then(Le=>Le.exists)})()}isDbEmpty(){var ye=this;return(0,h.A)(function*(){return(0,o._)(ye.http.get(`${q.c.apiBaseUrl}/db/is-db-empty`)).then(Le=>Le.empty)})()}static{this.\u0275fac=function(Le){return new(Le||ce)(x.KVO(ge.Qq),x.KVO(te.Ix),x.KVO(we.L))}}static{this.\u0275prov=x.jDH({token:ce,factory:ce.\u0275fac,providedIn:"root"})}}return ce})()},6119:(et,he,M)=>{M.d(he,{m:()=>x});var h=M(8033),o=M(9606),K=M(8284),q=M(5640);let x=(()=>{class ge{constructor(we){this.http=we,this.collectionBaseUrl=o.c.apiBaseUrl+"/collections",this.singleBaseUrl=o.c.apiBaseUrl+"/singles"}list(we,pe){const ce={page:pe.filters?.page||1,perPage:20};return Object.keys(pe.filters||{}).forEach(oe=>{"page"!==oe&&(ce[`${oe}_eq`]=pe.filters[oe])}),pe.relations&&(ce.relations=pe.relations.join(",")),(0,h._)(this.http.get(`${this.collectionBaseUrl}/${we}`,{params:ce}))}listSelectOptions(we){return(0,h._)(this.http.get(`${this.collectionBaseUrl}/${we}/select-options`))}show(we,pe,ce){return(0,h._)(this.http.get(`${this.collectionBaseUrl}/${we}/${pe}`,{params:{relations:ce?.relations?.join(",")}}))}showSingle(we){return(0,h._)(this.http.get(`${this.singleBaseUrl}/${we}`))}create(we,pe){return(0,h._)(this.http.post(`${this.collectionBaseUrl}/${we}`,pe))}update(we,pe,ce){return(0,h._)(this.http.put(`${this.collectionBaseUrl}/${we}/${pe}`,ce))}updateSingle(we,pe){return(0,h._)(this.http.put(`${this.singleBaseUrl}/${we}`,pe))}delete(we,pe){return(0,h._)(this.http.delete(`${this.collectionBaseUrl}/${we}/${pe}`))}static{this.\u0275fac=function(pe){return new(pe||ge)(K.KVO(q.Qq))}}static{this.\u0275prov=K.jDH({token:ge,factory:ge.\u0275fac,providedIn:"root"})}}return ge})()},8428:(et,he,M)=>{M.d(he,{S:()=>fr});var h=M(2943),o=M(8284),K=M(5442);const q=N=>({"is-danger":N}),x=N=>({"is-checked":N});function ge(N,J){if(1&N&&(o.j41(0,"p",5),o.EFF(1),o.k0s()),2&N){const C=o.XpG();o.R7$(),o.JRh(C.helpText)}}let te=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnChanges(C){this.checked=!!this.value}toggleCheck(){this.checked=!this.checked,this.valueChanged.emit(this.checked)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-boolean-input"]],inputs:{prop:"prop",value:"value",helpText:"helpText",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.OA$,o.aNF],decls:6,vars:8,consts:[["input",""],[1,"control","mt-7","mb-4"],["for","",1,"checkbox",3,"click","ngClass"],[1,"checkmark"],["class","help",4,"ngIf"],[1,"help"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"div",1)(1,"label",2,0),o.bIt("click",function(){return o.eBV(W),o.Njj(A.toggleCheck())}),o.EFF(3),o.nrm(4,"span",3),o.k0s(),o.DNE(5,ge,2,1,"p",4),o.k0s()}2&S&&(o.R7$(),o.Y8G("ngClass",o.eq3(4,q,A.isError))("ngClass",o.eq3(6,x,A.checked)),o.R7$(2),o.SpI("",A.prop.name," "),o.R7$(2),o.Y8G("ngIf",A.helpText))},dependencies:[h.YU,h.bT]})}}return N})();const we=["input"],pe=N=>({"is-danger":N});let ce=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){this.symbol=(0,h.Qn)(this.currency||"USD","wide"),void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(Number(C.target.value))}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-currency-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(we,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",currency:"currency",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:8,vars:6,consts:[["input",""],[3,"for"],[1,"control","has-icons-left"],[1,"icon","is-small","is-left"],[1,"is-family-sans-serif"],["type","number","step","0.01",1,"input",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"p",2)(3,"span",3)(4,"span",4),o.EFF(5),o.k0s()(),o.j41(6,"input",5,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(4),o.SpI(" ",A.symbol," "),o.R7$(),o.Y8G("ngClass",o.eq3(4,pe,A.isError)))},dependencies:[h.YU]})}}return N})();const oe=["input"],ye=N=>({"is-danger":N});let Le=(()=>{class N{constructor(){this.valueChanged=new o.bkB,this.today=Date.now()}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-date-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(oe,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:6,consts:[["input",""],[3,"for"],["type","date",1,"input",3,"change","ngClass","value"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(4,ye,A.isError))("value",A.value?A.value:A.today))},dependencies:[h.YU]})}}return N})();const ne=["input"],Ce=N=>({"is-danger":N});let Xe=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-email-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(ne,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","email","placeholder","Email...","autocomplete","email",1,"input",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,Ce,A.isError)))},dependencies:[h.YU]})}}return N})();const Ke=["latInput"],ct=["lngInput"],yt=N=>({"is-danger":N});let pt=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.latInput.nativeElement.value=this.value?.lat,this.lngInput.nativeElement.value=this.value?.lng)}onChange(){this.valueChanged.emit({lat:this.latInput.nativeElement.value,lng:this.lngInput.nativeElement.value})}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-location-input"]],viewQuery:function(S,A){if(1&S&&(o.GBs(Ke,7),o.GBs(ct,7)),2&S){let W;o.mGM(W=o.lsd())&&(A.latInput=W.first),o.mGM(W=o.lsd())&&(A.lngInput=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:21,vars:7,consts:[["latInput",""],["lngInput",""],["for",""],[1,"columns","is-mobile"],[1,"column"],[1,"field"],["for","lat-input"],[1,"control","has-icons-left"],[1,"icon","is-small","is-left"],[1,"icon","icon-map-pin"],["type","number","step","0.0001","min","-90","max","90",1,"input","form-control",3,"change","ngClass"],["for","lng-input"],["type","number","step","0.0001","min","-180","max","180",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",2),o.EFF(1),o.k0s(),o.j41(2,"div",3)(3,"div",4)(4,"div",5)(5,"label",6),o.EFF(6,"Latitude"),o.k0s(),o.j41(7,"p",7)(8,"span",8),o.nrm(9,"i",9),o.k0s(),o.j41(10,"input",10,0),o.bIt("change",function(){return o.eBV(W),o.Njj(A.onChange())}),o.k0s()()()(),o.j41(12,"div",4)(13,"div",5)(14,"label",11),o.EFF(15,"Longitude"),o.k0s(),o.j41(16,"p",7)(17,"span",8),o.nrm(18,"i",9),o.k0s(),o.j41(19,"input",12,1),o.bIt("change",function(){return o.eBV(W),o.Njj(A.onChange())}),o.k0s()()()()()}2&S&&(o.R7$(),o.JRh(A.prop.name),o.R7$(9),o.Y8G("ngClass",o.eq3(3,yt,A.isError)),o.R7$(9),o.Y8G("ngClass",o.eq3(5,yt,A.isError)))},dependencies:[h.YU],styles:["label[for=lat-input][_ngcontent-%COMP%]:not(.file-label):not(.checkbox):not(.image-label), label[for=lng-input][_ngcontent-%COMP%]:not(.file-label):not(.checkbox):not(.image-label){text-transform:unset}"]})}}return N})();var Ne=M(7431),be=M(7563),Ye=M(2283),Ge=M(6119);const Pe=N=>({"is-danger":N}),Ue=N=>({"is-checked":N});function tt(N,J){if(1&N&&o.EFF(0),2&N){const C=o.XpG(2);o.SpI("No ",C.entityManifest.nameSingular," selected")}}function Te(N,J){if(1&N&&o.EFF(0),2&N){const C=o.XpG(2);o.SpI("1 ",C.entityManifest.nameSingular," selected")}}function at(N,J){if(1&N&&o.EFF(0),2&N){const C=o.XpG(2);o.Lme("",C.selectedOptions.length," ",C.entityManifest.namePlural," selected ")}}function Ie(N,J){if(1&N&&(o.qex(0,6),o.DNE(1,tt,1,1,"ng-template",7)(2,Te,1,1,"ng-template",8)(3,at,1,2,"ng-template",9),o.bVm()),2&N){const C=o.XpG();o.Y8G("ngPlural",C.selectedOptions.length)}}function He(N,J){if(1&N){const C=o.RV6();o.j41(0,"a",14),o.bIt("click",function(){o.eBV(C);const A=o.XpG(2);return o.Njj(A.selectAll())}),o.EFF(1,"Select all"),o.k0s()}}function ft(N,J){if(1&N){const C=o.RV6();o.j41(0,"a",14),o.bIt("click",function(){o.eBV(C);const A=o.XpG(2);return o.Njj(A.selectNone())}),o.EFF(1,"Select none"),o.k0s()}}function Ht(N,J){if(1&N){const C=o.RV6();o.j41(0,"div",15)(1,"label",16),o.bIt("click",function(){const A=o.eBV(C).$implicit,W=o.XpG(2);return o.Njj(W.toggleSelected(A))}),o.EFF(2),o.nrm(3,"span",17),o.k0s()()}if(2&N){const C=J.$implicit;o.R7$(),o.Y8G("ngClass",o.eq3(2,Ue,C.selected)),o.R7$(),o.SpI(" ",C.label," ")}}function tn(N,J){if(1&N&&(o.j41(0,"div",10)(1,"p",11),o.DNE(2,He,2,0,"a",12)(3,ft,2,0,"a",12),o.k0s(),o.DNE(4,Ht,4,4,"div",13),o.k0s()),2&N){const C=o.XpG();o.Y8G("ngClass",o.eq3(4,Pe,C.isError)),o.R7$(2),o.Y8G("ngIf",C.selectedOptions.length<C.options.length),o.R7$(),o.Y8G("ngIf",C.selectedOptions.length===C.options.length),o.R7$(),o.Y8G("ngForOf",C.options)}}let Sn=(()=>{class N{constructor(C,S,A){this.manifestService=C,this.crudService=S,this.elementRef=A,this.valueChanged=new o.bkB,this.selectedOptions=[]}ngOnInit(){var C=this;return(0,Ne.A)(function*(){C.label=C.prop?.name||C.relationship.name,C.relationship&&(C.entityManifest=yield C.manifestService.getEntityManifest({className:C.relationship.entity}),C.options=yield C.crudService.listSelectOptions(C.entityManifest.slug)),C.value&&(C.selectedOptions=[],C.options.filter(S=>(0,be.qt)(C.value.map(A=>A.id)).find(A=>A===S.id)).forEach(S=>{S.selected=!0,C.selectedOptions.push(S)}))})()}selectAll(){this.options.forEach(C=>C.selected=!0),this.selectedOptions=this.options,this.valueChanged.emit(this.selectedOptions.map(C=>C.id))}selectNone(){this.options.forEach(C=>C.selected=!1),this.selectedOptions=[],this.valueChanged.emit([])}toggleSelected(C){const S=this.selectedOptions.findIndex(A=>A.id===C.id);S>-1?this.selectedOptions.splice(S,1):this.selectedOptions.push(C),C.selected=!C.selected,this.valueChanged.emit(this.selectedOptions.map(A=>A.id))}clickOut(C){this.showList&&!this.elementRef.nativeElement.contains(C)&&!C.className.includes("mass-selection-button")&&(this.showList=!1)}static{this.\u0275fac=function(S){return new(S||N)(o.rXU(Ye.x),o.rXU(Ge.m),o.rXU(o.aKT))}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-multi-select-input"]],hostBindings:function(S,A){1&S&&o.bIt("click",function(Ae){return A.clickOut(Ae.target)},!1,o.EBC)},inputs:{prop:"prop",relationship:"relationship",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:7,vars:3,consts:[[1,"multiselect-box"],[1,"control"],[3,"click"],[1,"select","select--simulate",3,"click"],[3,"ngPlural",4,"ngIf"],["class","box",3,"ngClass",4,"ngIf"],[3,"ngPlural"],["ngPluralCase","=0"],["ngPluralCase","=1"],["ngPluralCase","other"],[1,"box",3,"ngClass"],[1,"pb-2","px-4"],["class","small-meta mass-selection-button has-text-grey-dark is-underlined is-inline-block is-fullwidth",3,"click",4,"ngIf"],["class","control px-4 py-1 is-fullwidth",4,"ngFor","ngForOf"],[1,"small-meta","mass-selection-button","has-text-grey-dark","is-underlined","is-inline-block","is-fullwidth",3,"click"],[1,"control","px-4","py-1","is-fullwidth"],[1,"checkbox",3,"click","ngClass"],[1,"checkmark"]],template:function(S,A){1&S&&(o.j41(0,"div",0)(1,"div",1)(2,"label",2),o.bIt("click",function(){return A.showList=!0}),o.EFF(3),o.k0s(),o.j41(4,"div",3),o.bIt("click",function(){return A.showList=!A.showList}),o.DNE(5,Ie,4,1,"ng-container",4),o.k0s(),o.DNE(6,tn,5,6,"div",5),o.k0s()()),2&S&&(o.R7$(3),o.SpI("",A.label," "),o.R7$(2),o.Y8G("ngIf",A.entityManifest),o.R7$(),o.Y8G("ngIf",A.showList&&(null==A.options?null:A.options.length)))},dependencies:[h.MD,h.YU,h.Sq,h.bT,h.IJ,h.WO],styles:[".is-disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]})}}return N})();const ee=["input"],ae=N=>({"is-danger":N});let le=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(Number(C.target.value))}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-number-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(ee,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","number","step","1",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,ae,A.isError)))},dependencies:[h.YU]})}}return N})();const fe=["input"],De=N=>({"is-danger":N});let Se=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-password-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(fe,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["placeholder","Password...","type","password","autocomplete","current-password",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,De,A.isError)))},dependencies:[h.YU]})}}return N})();var je=M(9911);const xt=N=>({"is-danger":N});function nn(N,J){if(1&N&&(o.j41(0,"option",7),o.EFF(1),o.k0s()),2&N){const C=J.$implicit;o.Y8G("value",C.id),o.R7$(),o.SpI(" ",C.label," ")}}let lt=(()=>{class N{constructor(C,S,A){this.manifestService=C,this.crudService=S,this.formBuilder=A,this.valueChanged=new o.bkB,this.form=this.formBuilder.group({select:null})}ngOnInit(){var C=this;return(0,Ne.A)(function*(){C.label=C.prop?.name||C.relationship.name,C.relationship?(C.entityManifest=yield C.manifestService.getEntityManifest({className:C.relationship.entity}),C.options=yield C.crudService.listSelectOptions(C.entityManifest.slug)):C.prop.type===K.Kk.Choice&&(C.options=(C.prop.options?.values||[]).map(S=>({id:S,label:S}))),C.value&&C.form.patchValue({select:C.relationship?C.value.id:C.value})})()}onChange(C){if(""===C.target.value)return this.form.patchValue({select:null}),void this.valueChanged.emit(null);this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)(o.rXU(Ye.x),o.rXU(Ge.m),o.rXU(je.ok))}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-select-input"]],inputs:{prop:"prop",relationship:"relationship",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:9,vars:8,consts:[[3,"formGroup"],[3,"for"],[1,"control"],[1,"select",3,"ngClass"],["formControlName","select",1,"is-fullwidth",3,"change"],["value",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(S,A){1&S&&(o.j41(0,"div",0)(1,"label",1),o.EFF(2),o.k0s(),o.j41(3,"div",2)(4,"div",3)(5,"select",4),o.bIt("change",function(Ae){return A.onChange(Ae)}),o.j41(6,"option",5),o.EFF(7),o.k0s(),o.DNE(8,nn,2,2,"option",6),o.k0s()()()()),2&S&&(o.Y8G("formGroup",A.form),o.R7$(),o.Y8G("for",A.label),o.R7$(),o.JRh(A.label),o.R7$(2),o.Y8G("ngClass",o.eq3(6,xt,A.isError)),o.R7$(3),o.SpI("Select ",A.label,"..."),o.R7$(),o.Y8G("ngForOf",A.options))},dependencies:[je.X1,je.xH,je.y7,je.wz,je.BC,je.cb,je.j4,je.JD,h.YU,h.pM]})}}return N})();const jt=["input"],sn=N=>({"is-danger":N});let fn=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-text-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(jt,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","text",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,sn,A.isError)))},dependencies:[h.YU]})}}return N})();const St=["input"],Kt=N=>({"is-danger":N});let Je=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-textarea-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(St,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:6,consts:[["input",""],[3,"for"],[1,"textarea",3,"change","ngClass","name"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"textarea",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.EFF(4," "),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(4,Kt,A.isError))("name",A.prop.name))},dependencies:[h.YU]})}}return N})();const Ut=["input"],hn=N=>({"is-danger":N});let Fe=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-url-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(Ut,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","url","placeholder","https://example.com",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,hn,A.isError)))},dependencies:[h.YU]})}}return N})();const qt=["input"],_n=N=>({"is-danger":N});let Dn=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-timestamp-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(qt,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:6,consts:[["input",""],[3,"for"],["type","datetime-local",1,"input",3,"change","ngClass","value"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(4,_n,A.isError))("value",A.value))},dependencies:[h.YU],encapsulation:2})}}return N})();var _r=M(8033),gi=M(9606),Pn=M(5640);let $=(()=>{class N{constructor(C){this.http=C}uploadImage({entity:C,property:S,fileContent:A}){return this.upload({type:"image",entity:C,property:S,fileContent:A})}uploadFile({entity:C,property:S,fileContent:A}){var W=this;return(0,Ne.A)(function*(){return W.upload({type:"file",entity:C,property:S,fileContent:A})})()}upload({type:C,entity:S,property:A,fileContent:W}){var Ae=this;return(0,Ne.A)(function*(){const rt=new FormData;return rt.append(C,W),rt.append("entity",S),rt.append("property",A),(0,_r._)(Ae.http.post(`${gi.c.apiBaseUrl}/upload/${C}`,rt)).catch(Tt=>{throw new Error(Tt.error.message)})})()}static{this.\u0275fac=function(S){return new(S||N)(o.KVO(Pn.Qq))}}static{this.\u0275prov=o.jDH({token:N,factory:N.\u0275fac,providedIn:"root"})}}return N})();var ze=M(818);const X=["fileInput"],de=N=>({"show-errors":N});function Be(N,J){1&N&&(o.j41(0,"span",10)(1,"span",11),o.nrm(2,"i",12),o.k0s(),o.j41(3,"span",6),o.EFF(4," Upload file... "),o.k0s()())}function Bt(N,J){1&N&&(o.j41(0,"button",13),o.EFF(1," Loading "),o.k0s())}function Qt(N,J){if(1&N){const C=o.RV6();o.j41(0,"div")(1,"div",5)(2,"label",6)(3,"input",7,0),o.bIt("change",function(){o.eBV(C);const A=o.XpG();return o.Njj(A.onFileInputEvent())}),o.k0s(),o.DNE(5,Be,5,0,"span",8)(6,Bt,2,0,"button",9),o.k0s()()()}if(2&N){const C=o.XpG();o.R7$(),o.Y8G("ngClass",o.eq3(3,de,C.isError)),o.R7$(4),o.Y8G("ngIf",!C.loading),o.R7$(),o.Y8G("ngIf",C.loading)}}function Fn(N,J){if(1&N){const C=o.RV6();o.j41(0,"div",14)(1,"a",15),o.EFF(2),o.k0s(),o.j41(3,"span",16)(4,"a",17),o.bIt("click",function(){o.eBV(C);const A=o.XpG();return o.Njj(A.removeFile())}),o.nrm(5,"i",18),o.k0s()()()}if(2&N){const C=o.XpG();o.R7$(),o.Y8G("href",C.value,o.B4B),o.R7$(),o.SpI(" ",C.value," ")}}let ht=(()=>{class N{constructor(C,S){this.uploadService=C,this.flashMessageService=S,this.valueChanged=new o.bkB}onFileInputEvent(){var C=this;return(0,Ne.A)(function*(){return C.loading=!0,C.uploadService.uploadFile({entity:C.entitySlug,property:C.prop.name,fileContent:C.fileInputEl.nativeElement.files.item(0)}).then(S=>{C.loading=!1,C.value=S.path,C.valueChanged.emit(C.value)},S=>{C.loading=!1,C.flashMessageService.error("There was an error uploading your file.")})})()}removeFile(){delete this.value,this.valueChanged.emit(null)}static{this.\u0275fac=function(S){return new(S||N)(o.rXU($),o.rXU(ze.L))}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-file-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(X,5),2&S){let W;o.mGM(W=o.lsd())&&(A.fileInputEl=W.first)}},inputs:{prop:"prop",entitySlug:"entitySlug",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:4,consts:[["fileInput",""],[1,"control"],[3,"for"],[4,"ngIf"],["class","has-current-file is-flex is-justify-content-space-between is-align-items-center mt-1 has-background-white-ter pl-1",4,"ngIf"],[1,"file",3,"ngClass"],[1,"file-label"],["type","file",1,"file-input",3,"change"],["class","file-cta",4,"ngIf"],["class","button is-link is-loading",4,"ngIf"],[1,"file-cta"],[1,"file-icon"],[1,"icon","icon-upload-cloud","is-size-5"],[1,"button","is-link","is-loading"],[1,"has-current-file","is-flex","is-justify-content-space-between","is-align-items-center","mt-1","has-background-white-ter","pl-1"],["target","_blank",3,"href"],[1,"file-cta","file-remove"],[3,"click"],[1,"icon","icon-x","is-size-5"]],template:function(S,A){1&S&&(o.j41(0,"div",1)(1,"label",2),o.EFF(2),o.k0s(),o.DNE(3,Qt,7,5,"div",3)(4,Fn,6,2,"div",4),o.k0s()),2&S&&(o.R7$(),o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngIf",!A.value),o.R7$(),o.Y8G("ngIf",A.value))},dependencies:[h.bT,h.YU],encapsulation:2})}}return N})();const ar=["imageInput"],At=N=>({"show-errors":N});function it(N,J){1&N&&(o.j41(0,"span",11)(1,"span",12),o.nrm(2,"i",13),o.k0s(),o.j41(3,"span",14),o.EFF(4," Upload image..."),o.k0s()())}function lr(N,J){1&N&&(o.j41(0,"button",15),o.EFF(1," Loading "),o.k0s())}function ln(N,J){if(1&N){const C=o.RV6();o.j41(0,"div",5)(1,"div",6)(2,"label",7)(3,"input",8,0),o.bIt("change",function(){o.eBV(C);const A=o.XpG();return o.Njj(A.imageInputEvent())}),o.k0s(),o.DNE(5,it,5,0,"span",9)(6,lr,2,0,"button",10),o.k0s()()()}if(2&N){const C=o.XpG();o.R7$(),o.Y8G("ngClass",o.eq3(3,At,C.isError)),o.R7$(4),o.Y8G("ngIf",!C.loading),o.R7$(),o.Y8G("ngIf",C.loading)}}function An(N,J){if(1&N){const C=o.RV6();o.j41(0,"div",16),o.nrm(1,"img",17),o.j41(2,"span",18)(3,"a",19),o.bIt("click",function(){o.eBV(C);const A=o.XpG();return o.Njj(A.removeFile())}),o.nrm(4,"i",20),o.k0s()()()}if(2&N){const C=o.XpG();o.R7$(),o.Y8G("src",C.displayedImage,o.B4B)}}let Si=(()=>{class N{constructor(C,S){this.uploadService=C,this.flashMessageService=S,this.valueChanged=new o.bkB}ngOnInit(){if(this.value){const C=(0,be.Gj)(this.prop.options?.sizes);this.displayedImage=this.value[C]}}imageInputEvent(){this.loading=!0,this.uploadService.uploadImage({entity:this.entitySlug,property:this.prop.name,fileContent:this.imageInputEl.nativeElement.files.item(0)}).then(C=>{this.loading=!1,this.value=C,setTimeout(()=>{this.displayedImage=C[Object.keys(C)[0]],this.valueChanged.emit(this.value)},100)},C=>{this.loading=!1,this.flashMessageService.error("There was an error uploading your image.")})}removeFile(){delete this.value,delete this.displayedImage,this.valueChanged.emit(null)}static{this.\u0275fac=function(S){return new(S||N)(o.rXU($),o.rXU(ze.L))}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-image-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(ar,5),2&S){let W;o.mGM(W=o.lsd())&&(A.imageInputEl=W.first)}},inputs:{prop:"prop",entitySlug:"entitySlug",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:4,consts:[["imageInput",""],[1,"control"],[3,"for"],["class","image",4,"ngIf"],["class","has-current-file is-flex is-align-items-center is-justify-content-space-between mt-1 has-background-white-ter pl-1 py-1",4,"ngIf"],[1,"image"],[1,"file",3,"ngClass"],[1,"image-label"],["type","file","accept","image/*",1,"file-input",3,"change"],["class","file-cta",4,"ngIf"],["class","button is-link is-loading full-width",4,"ngIf"],[1,"file-cta"],[1,"file-icon"],[1,"icon","icon-upload-cloud","is-size-5"],[1,"file-label"],[1,"button","is-link","is-loading","full-width"],[1,"has-current-file","is-flex","is-align-items-center","is-justify-content-space-between","mt-1","has-background-white-ter","pl-1","py-1"],[3,"src"],[1,"file-cta","file-remove"],[3,"click"],[1,"icon","icon-x","is-size-5"]],template:function(S,A){1&S&&(o.j41(0,"div",1)(1,"label",2),o.EFF(2),o.k0s(),o.DNE(3,ln,7,5,"div",3)(4,An,5,1,"div",4),o.k0s()),2&S&&(o.R7$(),o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngIf",!A.value),o.R7$(),o.Y8G("ngIf",A.displayedImage))},dependencies:[h.bT,h.YU],encapsulation:2})}}return N})();const ur={toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"],["table"]]},or=new o.nKC("config",{providedIn:"root",factory:()=>({modules:ur})});var F=M(7711),H=M(7787),Ee=M(5719);
1
+ "use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[792],{4783:(et,he,M)=>{M.r(he),M.d(he,{AuthModule:()=>tt});var h=M(2943),o=M(8023),K=M(3123),q=M(4385),x=M(8284);let ge=(()=>{class Te{constructor(Ie){this.router=Ie}canActivate(){return!localStorage.getItem(q.il)||(this.router.navigate(["/"]),!1)}static{this.\u0275fac=function(He){return new(He||Te)(x.KVO(K.Ix))}}static{this.\u0275prov=x.jDH({token:Te,factory:Te.\u0275fac,providedIn:"root"})}}return Te})();var te=M(7431),we=M(9911),pe=M(5442),ce=M(7906),oe=M(818),ye=M(8428);const Le=Te=>({name:"email",type:Te}),ne=Te=>({name:"password",type:Te});function Ce(Te,at){if(1&Te){const Ie=x.RV6();x.j41(0,"div",10)(1,"div",11)(2,"div",12)(3,"app-input",13),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("email",ft))}),x.k0s()()(),x.j41(4,"div",11)(5,"div",12)(6,"app-input",13),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("password",ft))}),x.k0s()()()()}if(2&Te){const Ie=x.XpG();x.R7$(3),x.Y8G("prop",x.eq3(4,Le,Ie.PropType.Email))("value",Ie.suggestedEmail),x.R7$(3),x.Y8G("prop",x.eq3(6,ne,Ie.PropType.Password))("value",Ie.suggestedPassword)}}function ct(Te){return at=>{const Ie=at.parent;if(!Ie)return null;const He=Ie.get(Te);if(!He)return null;const Ht=at.value;return Ht&&He.value===Ht?null:{confirmPasswordMismatch:!0}}}const yt=Te=>({name:"email",type:Te}),pt=Te=>({name:"password",type:Te}),Ne=Te=>({name:"confirm password",type:Te});function be(Te,at){if(1&Te){const Ie=x.RV6();x.j41(0,"div",14)(1,"div",15)(2,"div",16)(3,"app-input",17),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("email",ft))}),x.k0s()()(),x.j41(4,"div",15)(5,"div",16)(6,"app-input",17),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("password",ft))}),x.k0s()()(),x.j41(7,"div",15)(8,"div",16)(9,"app-input",17),x.bIt("valueChanged",function(ft){x.eBV(Ie);const Ht=x.XpG();return x.Njj(Ht.patchValue("confirmPassword",ft))}),x.k0s()()()()}if(2&Te){const Ie=x.XpG();x.R7$(3),x.Y8G("prop",x.eq3(3,yt,Ie.PropType.Email)),x.R7$(3),x.Y8G("prop",x.eq3(5,pt,Ie.PropType.Password)),x.R7$(3),x.Y8G("prop",x.eq3(7,Ne,Ie.PropType.Password))}}const Pe=[{path:"login",component:(()=>{class Te{constructor(Ie,He,ft,Ht){this.authService=Ie,this.router=He,this.activatedRoute=ft,this.flashMessageService=Ht,this.PropType=pe.Kk}ngOnInit(){var Ie=this;this.activatedRoute.queryParams.subscribe(function(){var He=(0,te.A)(function*(ft){ft.email&&ft.password?(Ie.suggestedEmail=ft.email,Ie.suggestedPassword=ft.password):(yield Ie.authService.isDefaultAdminExists())&&(Ie.suggestedEmail=q.Fr.email,Ie.suggestedPassword=q.Fr.password),Ie.form=new we.gE({email:new we.MJ(Ie.suggestedEmail||"",[we.k0.required,we.k0.email]),password:new we.MJ(Ie.suggestedPassword||"",[we.k0.required])}),(yield Ie.authService.isDbEmpty())&&Ie.router.navigate(["/auth/welcome"])});return function(ft){return He.apply(this,arguments)}}())}patchValue(Ie,He){this.form.get(Ie)?.patchValue(He)}submit(){this.authService.login(this.form.value).then(Ie=>{this.router.navigate(["/"])},Ie=>{this.flashMessageService.error(401===Ie.status?"Error: Incorrect username or password.":Ie.error.message)})}static{this.\u0275fac=function(He){return new(He||Te)(x.rXU(ce.u),x.rXU(K.Ix),x.rXU(K.nX),x.rXU(oe.L))}}static{this.\u0275cmp=x.VBU({type:Te,selectors:[["app-login"]],decls:13,vars:2,consts:[[1,"hero","is-fullheight"],[1,"hero-body"],[1,"container","has-text-centered"],[1,"columns"],[1,"column","col-login"],["src","/assets/images/logo.svg","alt","manifest logo","width","264",1,"mb-3"],[1,"title","is-4"],["class","has-text-left",4,"ngIf"],[1,"button","is-block","is-dark","is-fullwidth","mb-3",3,"click","disabled"],[1,"column","col-decoration"],[1,"has-text-left"],[1,"field","mb-5"],[1,"control"],[3,"valueChanged","prop","value"]],template:function(He,ft){1&He&&(x.j41(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),x.nrm(6,"img",5),x.j41(7,"h2",6),x.EFF(8,"Sign in"),x.k0s(),x.DNE(9,Ce,7,8,"div",7),x.j41(10,"button",8),x.bIt("click",function(){return ft.submit()}),x.EFF(11," Login "),x.k0s()()()(),x.nrm(12,"div",9),x.k0s()()()),2&He&&(x.R7$(9),x.Y8G("ngIf",ft.form),x.R7$(),x.Y8G("disabled",!ft.form.valid))},dependencies:[h.bT,ye.S],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.container[_ngcontent-%COMP%]{max-width:100%;width:100%}.hero.is-fullheight[_ngcontent-%COMP%]{min-height:calc(100vh - 64px)}.notification[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:auto;border-radius:0;bottom:unset}.auth-column[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%]{position:fixed;display:flex;align-items:center;justify-content:center;background-color:#fff;left:0;top:0;height:100vh}.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin:auto}@media screen and (min-width: 1188px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:482px;min-width:382px}}@media screen and (min-width: 1000px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:360px}}@media screen and (min-width: 768px),print{.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:320px}}@media screen and (max-width: 767px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:50%;max-width:380px}}@media screen and (max-width: 999px){.col-login[_ngcontent-%COMP%]{width:66.66667%}}@media screen and (max-width: 767px){.col-login[_ngcontent-%COMP%]{width:100%}}@media screen and (min-width: 1000px){.col-login[_ngcontent-%COMP%]{width:40%}}@media screen and (min-width: 1188px){.col-login[_ngcontent-%COMP%]{width:33.33333%}}.col-decoration[_ngcontent-%COMP%]{width:60%}@media screen and (max-width: 999px){.col-decoration[_ngcontent-%COMP%]{width:33.33333%}}@media screen and (min-width: 1188px){.col-decoration[_ngcontent-%COMP%]{width:66.66666%}}']})}}return Te})(),canActivate:[ge]},{path:"logout",component:(()=>{class Te{constructor(Ie,He){this.authService=Ie,this.router=He}ngOnInit(){this.authService.logout(),this.router.navigate(["/","auth","login"])}static{this.\u0275fac=function(He){return new(He||Te)(x.rXU(ce.u),x.rXU(K.Ix))}}static{this.\u0275cmp=x.VBU({type:Te,selectors:[["ng-component"]],decls:1,vars:0,template:function(He,ft){1&He&&x.EFF(0,"NO UI TO BE FOUND HERE!")},encapsulation:2})}}return Te})()},{path:"welcome",component:(()=>{class Te{constructor(Ie,He,ft){this.authService=Ie,this.router=He,this.flashMessageService=ft,this.PropType=pe.Kk}ngOnInit(){this.form=new we.gE({email:new we.MJ("",[we.k0.required,we.k0.email]),password:new we.MJ("",[we.k0.required]),confirmPassword:new we.MJ("",[we.k0.required,ct("password")])})}patchValue(Ie,He){this.form.get(Ie)?.patchValue(He)}submit(){var Ie=this;return(0,te.A)(function*(){if(!(yield Ie.authService.signup(Ie.form.value)))return Ie.flashMessageService.error("Error: Failed to register");Ie.flashMessageService.success("Welcome! You have successfully registered as an admin."),Ie.router.navigate(["/"])})()}static{this.\u0275fac=function(He){return new(He||Te)(x.rXU(ce.u),x.rXU(K.Ix),x.rXU(oe.L))}}static{this.\u0275cmp=x.VBU({type:Te,selectors:[["app-register-first-admin"]],decls:17,vars:2,consts:[[1,"hero","is-fullheight"],[1,"hero-body"],[1,"container","has-text-centered"],[1,"columns"],[1,"column","col-welcome"],[1,"register-wrap"],["src","/assets/images/logo.svg","alt","manifest logo","width","264",1,"mb-3"],[1,"card","is-bordered"],[1,"card-content"],[1,"content"],[1,"title","is-2","has-text-weight-bold"],[1,"is-size-5"],["class","has-text-left",4,"ngIf"],[1,"button","is-block","is-dark","is-fullwidth","mb-0",3,"click","disabled"],[1,"has-text-left"],[1,"field","mb-5"],[1,"control"],[3,"valueChanged","prop"]],template:function(He,ft){1&He&&(x.j41(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),x.nrm(6,"img",6),x.j41(7,"div",7)(8,"div",8)(9,"div",9)(10,"h2",10),x.EFF(11,"Welcome"),x.k0s(),x.j41(12,"p",11),x.EFF(13," Welcome to your admin panel. Create your first admin account to continue. You can always change those values later. "),x.k0s(),x.DNE(14,be,10,9,"div",12),x.j41(15,"button",13),x.bIt("click",function(){return ft.submit()}),x.EFF(16," Login "),x.k0s()()()()()()()()()()),2&He&&(x.R7$(14),x.Y8G("ngIf",ft.form),x.R7$(),x.Y8G("disabled",!ft.form.valid))},dependencies:[h.bT,ye.S],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.container[_ngcontent-%COMP%]{max-width:100%;width:100%}.hero.is-fullheight[_ngcontent-%COMP%]{min-height:calc(100vh - 64px)}.notification[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:auto;border-radius:0;bottom:unset}.auth-column[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%]{position:fixed;display:flex;align-items:center;justify-content:center;background-color:#fff;left:0;top:0;height:100vh}.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin:auto}@media screen and (min-width: 1188px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:482px;min-width:382px}}@media screen and (min-width: 1000px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:360px}}@media screen and (min-width: 768px),print{.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:320px}}@media screen and (max-width: 767px){.auth-column[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:50%;max-width:380px}}.col-welcome[_ngcontent-%COMP%]{width:100vw}']})}}return Te})(),canActivate:[(()=>{class Te{constructor(Ie,He){this.authService=Ie,this.router=He}canActivate(){var Ie=this;return(0,te.A)(function*(){return!!(yield Ie.authService.isDbEmpty())||(Ie.router.navigate(["/auth/login"]),!1)})()}static{this.\u0275fac=function(He){return new(He||Te)(x.KVO(ce.u),x.KVO(K.Ix))}}static{this.\u0275prov=x.jDH({token:Te,factory:Te.\u0275fac,providedIn:"root"})}}return Te})()]}];let Ue=(()=>{class Te{static{this.\u0275fac=function(He){return new(He||Te)}}static{this.\u0275mod=x.$C({type:Te})}static{this.\u0275inj=x.G2t({imports:[K.iI.forChild(Pe),K.iI]})}}return Te})(),tt=(()=>{class Te{static{this.\u0275fac=function(He){return new(He||Te)}}static{this.\u0275mod=x.$C({type:Te})}static{this.\u0275inj=x.G2t({imports:[h.MD,Ue,o.G]})}}return Te})()},7906:(et,he,M)=>{M.d(he,{u:()=>pe});var h=M(7431),o=M(8033),K=M(4385),q=M(9606),x=M(8284),ge=M(5640),te=M(3123),we=M(818);let pe=(()=>{class ce{constructor(ye,Le,ne){this.http=ye,this.router=Le,this.flashMessageService=ne,this.currentUserPromise=null}login(ye){var Le=this;return(0,h.A)(function*(){return(0,o._)(Le.http.post(`${q.c.apiBaseUrl}/auth/admins/login`,ye)).then(ne=>{const Ce=ne?.token;return Ce&&localStorage.setItem(K.il,Ce),Ce})})()}signup(ye){var Le=this;return(0,h.A)(function*(){return(0,o._)(Le.http.post(`${q.c.apiBaseUrl}/auth/admins/signup`,ye)).then(ne=>{const Ce=ne?.token;return Ce&&localStorage.setItem(K.il,Ce),Ce})})()}logout(){delete this.currentUserPromise,localStorage.removeItem(K.il)}isLoggedIn(){return!!localStorage.getItem(K.il)}me(){var ye=this;return(0,h.A)(function*(){return ye.currentUserPromise||(ye.currentUserPromise=(0,o._)(ye.http.get(`${q.c.apiBaseUrl}/auth/admins/me`)).catch(()=>{ye.logout(),ye.router.navigate(["/auth/login"]),ye.flashMessageService.error("You must be logged in to view that page.")})),ye.currentUserPromise})()}isDefaultAdminExists(){var ye=this;return(0,h.A)(function*(){return(0,o._)(ye.http.get(`${q.c.apiBaseUrl}/auth/admins/default-exists`)).then(Le=>Le.exists)})()}isDbEmpty(){var ye=this;return(0,h.A)(function*(){return(0,o._)(ye.http.get(`${q.c.apiBaseUrl}/db/is-db-empty`)).then(Le=>Le.empty)})()}static{this.\u0275fac=function(Le){return new(Le||ce)(x.KVO(ge.Qq),x.KVO(te.Ix),x.KVO(we.L))}}static{this.\u0275prov=x.jDH({token:ce,factory:ce.\u0275fac,providedIn:"root"})}}return ce})()},6119:(et,he,M)=>{M.d(he,{m:()=>x});var h=M(8033),o=M(9606),K=M(8284),q=M(5640);let x=(()=>{class ge{constructor(we){this.http=we,this.collectionBaseUrl=o.c.apiBaseUrl+"/collections",this.singleBaseUrl=o.c.apiBaseUrl+"/singles"}list(we,pe){const ce={page:pe.filters?.page||1,perPage:20};return Object.keys(pe.filters||{}).forEach(oe=>{"page"!==oe&&(ce[`${oe}_eq`]=pe.filters[oe])}),pe.relations&&(ce.relations=pe.relations.join(",")),(0,h._)(this.http.get(`${this.collectionBaseUrl}/${we}`,{params:ce}))}listSelectOptions(we){return(0,h._)(this.http.get(`${this.collectionBaseUrl}/${we}/select-options`))}show(we,pe,ce){return(0,h._)(this.http.get(`${this.collectionBaseUrl}/${we}/${pe}`,{params:{relations:ce?.relations?.join(",")}}))}showSingle(we){return(0,h._)(this.http.get(`${this.singleBaseUrl}/${we}`))}create(we,pe){return(0,h._)(this.http.post(`${this.collectionBaseUrl}/${we}`,pe))}update(we,pe,ce){return(0,h._)(this.http.put(`${this.collectionBaseUrl}/${we}/${pe}`,ce))}updateSingle(we,pe){return(0,h._)(this.http.put(`${this.singleBaseUrl}/${we}`,pe))}delete(we,pe){return(0,h._)(this.http.delete(`${this.collectionBaseUrl}/${we}/${pe}`))}static{this.\u0275fac=function(pe){return new(pe||ge)(K.KVO(q.Qq))}}static{this.\u0275prov=K.jDH({token:ge,factory:ge.\u0275fac,providedIn:"root"})}}return ge})()},8428:(et,he,M)=>{M.d(he,{S:()=>fr});var h=M(2943),o=M(8284),K=M(5442);const q=N=>({"is-danger":N}),x=N=>({"is-checked":N});function ge(N,J){if(1&N&&(o.j41(0,"p",5),o.EFF(1),o.k0s()),2&N){const C=o.XpG();o.R7$(),o.JRh(C.helpText)}}let te=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnChanges(C){this.checked=!!this.value}toggleCheck(){this.checked=!this.checked,this.valueChanged.emit(this.checked)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-boolean-input"]],inputs:{prop:"prop",value:"value",helpText:"helpText",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.OA$,o.aNF],decls:6,vars:8,consts:[["input",""],[1,"control","mt-7","mb-4"],["for","",1,"checkbox",3,"click","ngClass"],[1,"checkmark"],["class","help",4,"ngIf"],[1,"help"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"div",1)(1,"label",2,0),o.bIt("click",function(){return o.eBV(W),o.Njj(A.toggleCheck())}),o.EFF(3),o.nrm(4,"span",3),o.k0s(),o.DNE(5,ge,2,1,"p",4),o.k0s()}2&S&&(o.R7$(),o.Y8G("ngClass",o.eq3(4,q,A.isError))("ngClass",o.eq3(6,x,A.checked)),o.R7$(2),o.SpI("",A.prop.name," "),o.R7$(2),o.Y8G("ngIf",A.helpText))},dependencies:[h.YU,h.bT]})}}return N})();const we=["input"],pe=N=>({"is-danger":N});let ce=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){this.symbol=(0,h.Qn)(this.currency||"USD","wide"),void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(Number(C.target.value))}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-currency-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(we,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",currency:"currency",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:8,vars:6,consts:[["input",""],[3,"for"],[1,"control","has-icons-left"],[1,"icon","is-small","is-left"],[1,"is-family-sans-serif"],["type","number","step","0.01",1,"input",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"p",2)(3,"span",3)(4,"span",4),o.EFF(5),o.k0s()(),o.j41(6,"input",5,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(4),o.SpI(" ",A.symbol," "),o.R7$(),o.Y8G("ngClass",o.eq3(4,pe,A.isError)))},dependencies:[h.YU]})}}return N})();const oe=["input"],ye=N=>({"is-danger":N});let Le=(()=>{class N{constructor(){this.valueChanged=new o.bkB,this.today=Date.now()}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-date-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(oe,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:6,consts:[["input",""],[3,"for"],["type","date",1,"input",3,"change","ngClass","value"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(4,ye,A.isError))("value",A.value?A.value:A.today))},dependencies:[h.YU]})}}return N})();const ne=["input"],Ce=N=>({"is-danger":N});let Xe=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-email-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(ne,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","email","placeholder","Email...","autocomplete","email",1,"input",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,Ce,A.isError)))},dependencies:[h.YU]})}}return N})();const Ke=["latInput"],ct=["lngInput"],yt=N=>({"is-danger":N});let pt=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.latInput.nativeElement.value=this.value?.lat,this.lngInput.nativeElement.value=this.value?.lng)}onChange(){this.valueChanged.emit({lat:this.latInput.nativeElement.value,lng:this.lngInput.nativeElement.value})}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-location-input"]],viewQuery:function(S,A){if(1&S&&(o.GBs(Ke,7),o.GBs(ct,7)),2&S){let W;o.mGM(W=o.lsd())&&(A.latInput=W.first),o.mGM(W=o.lsd())&&(A.lngInput=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:21,vars:7,consts:[["latInput",""],["lngInput",""],["for",""],[1,"columns","is-mobile"],[1,"column"],[1,"field"],["for","lat-input"],[1,"control","has-icons-left"],[1,"icon","is-small","is-left"],[1,"icon","icon-map-pin"],["type","number","step","0.0001","min","-90","max","90",1,"input","form-control",3,"change","ngClass"],["for","lng-input"],["type","number","step","0.0001","min","-180","max","180",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",2),o.EFF(1),o.k0s(),o.j41(2,"div",3)(3,"div",4)(4,"div",5)(5,"label",6),o.EFF(6,"Latitude"),o.k0s(),o.j41(7,"p",7)(8,"span",8),o.nrm(9,"i",9),o.k0s(),o.j41(10,"input",10,0),o.bIt("change",function(){return o.eBV(W),o.Njj(A.onChange())}),o.k0s()()()(),o.j41(12,"div",4)(13,"div",5)(14,"label",11),o.EFF(15,"Longitude"),o.k0s(),o.j41(16,"p",7)(17,"span",8),o.nrm(18,"i",9),o.k0s(),o.j41(19,"input",12,1),o.bIt("change",function(){return o.eBV(W),o.Njj(A.onChange())}),o.k0s()()()()()}2&S&&(o.R7$(),o.JRh(A.prop.name),o.R7$(9),o.Y8G("ngClass",o.eq3(3,yt,A.isError)),o.R7$(9),o.Y8G("ngClass",o.eq3(5,yt,A.isError)))},dependencies:[h.YU],styles:["label[for=lat-input][_ngcontent-%COMP%]:not(.file-label):not(.checkbox):not(.image-label), label[for=lng-input][_ngcontent-%COMP%]:not(.file-label):not(.checkbox):not(.image-label){text-transform:unset}"]})}}return N})();var Ne=M(7431),be=M(7563),Ye=M(2283),Ge=M(6119);const Pe=N=>({"is-danger":N}),Ue=N=>({"is-checked":N});function tt(N,J){if(1&N&&o.EFF(0),2&N){const C=o.XpG(2);o.SpI("No ",C.entityManifest.nameSingular," selected")}}function Te(N,J){if(1&N&&o.EFF(0),2&N){const C=o.XpG(2);o.SpI("1 ",C.entityManifest.nameSingular," selected")}}function at(N,J){if(1&N&&o.EFF(0),2&N){const C=o.XpG(2);o.Lme("",C.selectedOptions.length," ",C.entityManifest.namePlural," selected ")}}function Ie(N,J){if(1&N&&(o.qex(0,6),o.DNE(1,tt,1,1,"ng-template",7)(2,Te,1,1,"ng-template",8)(3,at,1,2,"ng-template",9),o.bVm()),2&N){const C=o.XpG();o.Y8G("ngPlural",C.selectedOptions.length)}}function He(N,J){if(1&N){const C=o.RV6();o.j41(0,"a",14),o.bIt("click",function(){o.eBV(C);const A=o.XpG(2);return o.Njj(A.selectAll())}),o.EFF(1,"Select all"),o.k0s()}}function ft(N,J){if(1&N){const C=o.RV6();o.j41(0,"a",14),o.bIt("click",function(){o.eBV(C);const A=o.XpG(2);return o.Njj(A.selectNone())}),o.EFF(1,"Select none"),o.k0s()}}function Ht(N,J){if(1&N){const C=o.RV6();o.j41(0,"div",15)(1,"label",16),o.bIt("click",function(){const A=o.eBV(C).$implicit,W=o.XpG(2);return o.Njj(W.toggleSelected(A))}),o.EFF(2),o.nrm(3,"span",17),o.k0s()()}if(2&N){const C=J.$implicit;o.R7$(),o.Y8G("ngClass",o.eq3(2,Ue,C.selected)),o.R7$(),o.SpI(" ",C.label," ")}}function tn(N,J){if(1&N&&(o.j41(0,"div",10)(1,"p",11),o.DNE(2,He,2,0,"a",12)(3,ft,2,0,"a",12),o.k0s(),o.DNE(4,Ht,4,4,"div",13),o.k0s()),2&N){const C=o.XpG();o.Y8G("ngClass",o.eq3(4,Pe,C.isError)),o.R7$(2),o.Y8G("ngIf",C.selectedOptions.length<C.options.length),o.R7$(),o.Y8G("ngIf",C.selectedOptions.length===C.options.length),o.R7$(),o.Y8G("ngForOf",C.options)}}let Sn=(()=>{class N{constructor(C,S,A){this.manifestService=C,this.crudService=S,this.elementRef=A,this.valueChanged=new o.bkB,this.selectedOptions=[]}ngOnInit(){var C=this;return(0,Ne.A)(function*(){C.label=C.prop?.name||C.relationship.name,C.relationship&&(C.entityManifest=yield C.manifestService.getEntityManifest({className:C.relationship.entity}),C.options=yield C.crudService.listSelectOptions(C.entityManifest.slug)),C.value&&(C.selectedOptions=[],C.options.filter(S=>(0,be.qt)(C.value.map(A=>A.id)).find(A=>A===S.id)).forEach(S=>{S.selected=!0,C.selectedOptions.push(S)}))})()}selectAll(){this.options.forEach(C=>C.selected=!0),this.selectedOptions=this.options,this.valueChanged.emit(this.selectedOptions.map(C=>C.id))}selectNone(){this.options.forEach(C=>C.selected=!1),this.selectedOptions=[],this.valueChanged.emit([])}toggleSelected(C){const S=this.selectedOptions.findIndex(A=>A.id===C.id);S>-1?this.selectedOptions.splice(S,1):this.selectedOptions.push(C),C.selected=!C.selected,this.valueChanged.emit(this.selectedOptions.map(A=>A.id))}clickOut(C){this.showList&&!this.elementRef.nativeElement.contains(C)&&!C.className.includes("mass-selection-button")&&(this.showList=!1)}static{this.\u0275fac=function(S){return new(S||N)(o.rXU(Ye.x),o.rXU(Ge.m),o.rXU(o.aKT))}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-multi-select-input"]],hostBindings:function(S,A){1&S&&o.bIt("click",function(Ae){return A.clickOut(Ae.target)},!1,o.EBC)},inputs:{prop:"prop",relationship:"relationship",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:7,vars:3,consts:[[1,"multiselect-box"],[1,"control"],[3,"click"],[1,"select","select--simulate",3,"click"],[3,"ngPlural",4,"ngIf"],["class","box",3,"ngClass",4,"ngIf"],[3,"ngPlural"],["ngPluralCase","=0"],["ngPluralCase","=1"],["ngPluralCase","other"],[1,"box",3,"ngClass"],[1,"pb-2","px-4"],["class","small-meta mass-selection-button has-text-grey-dark is-underlined is-inline-block is-fullwidth",3,"click",4,"ngIf"],["class","control px-4 py-1 is-fullwidth",4,"ngFor","ngForOf"],[1,"small-meta","mass-selection-button","has-text-grey-dark","is-underlined","is-inline-block","is-fullwidth",3,"click"],[1,"control","px-4","py-1","is-fullwidth"],[1,"checkbox",3,"click","ngClass"],[1,"checkmark"]],template:function(S,A){1&S&&(o.j41(0,"div",0)(1,"div",1)(2,"label",2),o.bIt("click",function(){return A.showList=!0}),o.EFF(3),o.k0s(),o.j41(4,"div",3),o.bIt("click",function(){return A.showList=!A.showList}),o.DNE(5,Ie,4,1,"ng-container",4),o.k0s(),o.DNE(6,tn,5,6,"div",5),o.k0s()()),2&S&&(o.R7$(3),o.SpI("",A.label," "),o.R7$(2),o.Y8G("ngIf",A.entityManifest),o.R7$(),o.Y8G("ngIf",A.showList&&(null==A.options?null:A.options.length)))},dependencies:[h.MD,h.YU,h.Sq,h.bT,h.IJ,h.WO],styles:[".is-disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]})}}return N})();const ee=["input"],ae=N=>({"is-danger":N});let le=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(Number(C.target.value))}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-number-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(ee,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","number","step","1",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,ae,A.isError)))},dependencies:[h.YU]})}}return N})();const fe=["input"],De=N=>({"is-danger":N});let Se=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-password-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(fe,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["placeholder","Password...","type","password","autocomplete","current-password",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,De,A.isError)))},dependencies:[h.YU]})}}return N})();var je=M(9911);const xt=N=>({"is-danger":N});function nn(N,J){if(1&N&&(o.j41(0,"option",7),o.EFF(1),o.k0s()),2&N){const C=J.$implicit;o.Y8G("value",C.id),o.R7$(),o.SpI(" ",C.label," ")}}let lt=(()=>{class N{constructor(C,S,A){this.manifestService=C,this.crudService=S,this.formBuilder=A,this.valueChanged=new o.bkB,this.form=this.formBuilder.group({select:null})}ngOnInit(){var C=this;return(0,Ne.A)(function*(){C.label=C.prop?.name||C.relationship.name,C.relationship?(C.entityManifest=yield C.manifestService.getEntityManifest({className:C.relationship.entity}),C.options=yield C.crudService.listSelectOptions(C.entityManifest.slug)):C.prop.type===K.Kk.Choice&&(C.options=(C.prop.options?.values||[]).map(S=>({id:S,label:S}))),C.value&&C.form.patchValue({select:C.relationship?C.value.id:C.value})})()}onChange(C){if(""===C.target.value)return this.form.patchValue({select:null}),void this.valueChanged.emit(null);this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)(o.rXU(Ye.x),o.rXU(Ge.m),o.rXU(je.ok))}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-select-input"]],inputs:{prop:"prop",relationship:"relationship",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:9,vars:8,consts:[[3,"formGroup"],[3,"for"],[1,"control"],[1,"select",3,"ngClass"],["formControlName","select",1,"is-fullwidth",3,"change"],["value",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(S,A){1&S&&(o.j41(0,"div",0)(1,"label",1),o.EFF(2),o.k0s(),o.j41(3,"div",2)(4,"div",3)(5,"select",4),o.bIt("change",function(Ae){return A.onChange(Ae)}),o.j41(6,"option",5),o.EFF(7),o.k0s(),o.DNE(8,nn,2,2,"option",6),o.k0s()()()()),2&S&&(o.Y8G("formGroup",A.form),o.R7$(),o.Y8G("for",A.label),o.R7$(),o.JRh(A.label),o.R7$(2),o.Y8G("ngClass",o.eq3(6,xt,A.isError)),o.R7$(3),o.SpI("Select ",A.label,"..."),o.R7$(),o.Y8G("ngForOf",A.options))},dependencies:[je.X1,je.xH,je.y7,je.wz,je.BC,je.cb,je.j4,je.JD,h.YU,h.pM]})}}return N})();const jt=["input"],sn=N=>({"is-danger":N});let fn=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-text-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(jt,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","text",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,sn,A.isError)))},dependencies:[h.YU]})}}return N})();const St=["input"],Kt=N=>({"is-danger":N});let Je=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-textarea-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(St,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:6,consts:[["input",""],[3,"for"],[1,"textarea",3,"change","ngClass","name"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"textarea",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.EFF(4," "),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(4,Kt,A.isError))("name",A.prop.name))},dependencies:[h.YU]})}}return N})();const Ut=["input"],hn=N=>({"is-danger":N});let Fe=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-url-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(Ut,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","url","placeholder","https://example.com",1,"input","form-control",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,hn,A.isError)))},dependencies:[h.YU]})}}return N})();const qt=["input"],_n=N=>({"is-danger":N});let Dn=(()=>{class N{constructor(){this.valueChanged=new o.bkB}ngOnInit(){this.input.nativeElement.value=null!==this.value?new Date(this.value).toISOString().replace("T"," ").substring(0,19):""}onChange(C){this.valueChanged.emit(new Date(C.target.value))}static{this.\u0275fac=function(S){return new(S||N)}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-timestamp-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(qt,7),2&S){let W;o.mGM(W=o.lsd())&&(A.input=W.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","datetime-local",1,"input",3,"change","ngClass"]],template:function(S,A){if(1&S){const W=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(W),o.Njj(A.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,_n,A.isError)))},dependencies:[h.YU],encapsulation:2})}}return N})();var _r=M(8033),gi=M(9606),Pn=M(5640);let $=(()=>{class N{constructor(C){this.http=C}uploadImage({entity:C,property:S,fileContent:A}){return this.upload({type:"image",entity:C,property:S,fileContent:A})}uploadFile({entity:C,property:S,fileContent:A}){var W=this;return(0,Ne.A)(function*(){return W.upload({type:"file",entity:C,property:S,fileContent:A})})()}upload({type:C,entity:S,property:A,fileContent:W}){var Ae=this;return(0,Ne.A)(function*(){const rt=new FormData;return rt.append(C,W),rt.append("entity",S),rt.append("property",A),(0,_r._)(Ae.http.post(`${gi.c.apiBaseUrl}/upload/${C}`,rt)).catch(Tt=>{throw new Error(Tt.error.message)})})()}static{this.\u0275fac=function(S){return new(S||N)(o.KVO(Pn.Qq))}}static{this.\u0275prov=o.jDH({token:N,factory:N.\u0275fac,providedIn:"root"})}}return N})();var ze=M(818);const X=["fileInput"],de=N=>({"show-errors":N});function Be(N,J){1&N&&(o.j41(0,"span",10)(1,"span",11),o.nrm(2,"i",12),o.k0s(),o.j41(3,"span",6),o.EFF(4," Upload file... "),o.k0s()())}function Bt(N,J){1&N&&(o.j41(0,"button",13),o.EFF(1," Loading "),o.k0s())}function Qt(N,J){if(1&N){const C=o.RV6();o.j41(0,"div")(1,"div",5)(2,"label",6)(3,"input",7,0),o.bIt("change",function(){o.eBV(C);const A=o.XpG();return o.Njj(A.onFileInputEvent())}),o.k0s(),o.DNE(5,Be,5,0,"span",8)(6,Bt,2,0,"button",9),o.k0s()()()}if(2&N){const C=o.XpG();o.R7$(),o.Y8G("ngClass",o.eq3(3,de,C.isError)),o.R7$(4),o.Y8G("ngIf",!C.loading),o.R7$(),o.Y8G("ngIf",C.loading)}}function Fn(N,J){if(1&N){const C=o.RV6();o.j41(0,"div",14)(1,"a",15),o.EFF(2),o.k0s(),o.j41(3,"span",16)(4,"a",17),o.bIt("click",function(){o.eBV(C);const A=o.XpG();return o.Njj(A.removeFile())}),o.nrm(5,"i",18),o.k0s()()()}if(2&N){const C=o.XpG();o.R7$(),o.Y8G("href",C.value,o.B4B),o.R7$(),o.SpI(" ",C.value," ")}}let ht=(()=>{class N{constructor(C,S){this.uploadService=C,this.flashMessageService=S,this.valueChanged=new o.bkB}onFileInputEvent(){var C=this;return(0,Ne.A)(function*(){return C.loading=!0,C.uploadService.uploadFile({entity:C.entitySlug,property:C.prop.name,fileContent:C.fileInputEl.nativeElement.files.item(0)}).then(S=>{C.loading=!1,C.value=S.path,C.valueChanged.emit(C.value)},S=>{C.loading=!1,C.flashMessageService.error("There was an error uploading your file.")})})()}removeFile(){delete this.value,this.valueChanged.emit(null)}static{this.\u0275fac=function(S){return new(S||N)(o.rXU($),o.rXU(ze.L))}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-file-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(X,5),2&S){let W;o.mGM(W=o.lsd())&&(A.fileInputEl=W.first)}},inputs:{prop:"prop",entitySlug:"entitySlug",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:4,consts:[["fileInput",""],[1,"control"],[3,"for"],[4,"ngIf"],["class","has-current-file is-flex is-justify-content-space-between is-align-items-center mt-1 has-background-white-ter pl-1",4,"ngIf"],[1,"file",3,"ngClass"],[1,"file-label"],["type","file",1,"file-input",3,"change"],["class","file-cta",4,"ngIf"],["class","button is-link is-loading",4,"ngIf"],[1,"file-cta"],[1,"file-icon"],[1,"icon","icon-upload-cloud","is-size-5"],[1,"button","is-link","is-loading"],[1,"has-current-file","is-flex","is-justify-content-space-between","is-align-items-center","mt-1","has-background-white-ter","pl-1"],["target","_blank",3,"href"],[1,"file-cta","file-remove"],[3,"click"],[1,"icon","icon-x","is-size-5"]],template:function(S,A){1&S&&(o.j41(0,"div",1)(1,"label",2),o.EFF(2),o.k0s(),o.DNE(3,Qt,7,5,"div",3)(4,Fn,6,2,"div",4),o.k0s()),2&S&&(o.R7$(),o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngIf",!A.value),o.R7$(),o.Y8G("ngIf",A.value))},dependencies:[h.bT,h.YU],encapsulation:2})}}return N})();const ar=["imageInput"],At=N=>({"show-errors":N});function it(N,J){1&N&&(o.j41(0,"span",11)(1,"span",12),o.nrm(2,"i",13),o.k0s(),o.j41(3,"span",14),o.EFF(4," Upload image..."),o.k0s()())}function lr(N,J){1&N&&(o.j41(0,"button",15),o.EFF(1," Loading "),o.k0s())}function ln(N,J){if(1&N){const C=o.RV6();o.j41(0,"div",5)(1,"div",6)(2,"label",7)(3,"input",8,0),o.bIt("change",function(){o.eBV(C);const A=o.XpG();return o.Njj(A.imageInputEvent())}),o.k0s(),o.DNE(5,it,5,0,"span",9)(6,lr,2,0,"button",10),o.k0s()()()}if(2&N){const C=o.XpG();o.R7$(),o.Y8G("ngClass",o.eq3(3,At,C.isError)),o.R7$(4),o.Y8G("ngIf",!C.loading),o.R7$(),o.Y8G("ngIf",C.loading)}}function An(N,J){if(1&N){const C=o.RV6();o.j41(0,"div",16),o.nrm(1,"img",17),o.j41(2,"span",18)(3,"a",19),o.bIt("click",function(){o.eBV(C);const A=o.XpG();return o.Njj(A.removeFile())}),o.nrm(4,"i",20),o.k0s()()()}if(2&N){const C=o.XpG();o.R7$(),o.Y8G("src",C.displayedImage,o.B4B)}}let Si=(()=>{class N{constructor(C,S){this.uploadService=C,this.flashMessageService=S,this.valueChanged=new o.bkB}ngOnInit(){if(this.value){const C=(0,be.Gj)(this.prop.options?.sizes);this.displayedImage=this.value[C]}}imageInputEvent(){this.loading=!0,this.uploadService.uploadImage({entity:this.entitySlug,property:this.prop.name,fileContent:this.imageInputEl.nativeElement.files.item(0)}).then(C=>{this.loading=!1,this.value=C,setTimeout(()=>{this.displayedImage=C[Object.keys(C)[0]],this.valueChanged.emit(this.value)},100)},C=>{this.loading=!1,this.flashMessageService.error("There was an error uploading your image.")})}removeFile(){delete this.value,delete this.displayedImage,this.valueChanged.emit(null)}static{this.\u0275fac=function(S){return new(S||N)(o.rXU($),o.rXU(ze.L))}}static{this.\u0275cmp=o.VBU({type:N,selectors:[["app-image-input"]],viewQuery:function(S,A){if(1&S&&o.GBs(ar,5),2&S){let W;o.mGM(W=o.lsd())&&(A.imageInputEl=W.first)}},inputs:{prop:"prop",entitySlug:"entitySlug",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:4,consts:[["imageInput",""],[1,"control"],[3,"for"],["class","image",4,"ngIf"],["class","has-current-file is-flex is-align-items-center is-justify-content-space-between mt-1 has-background-white-ter pl-1 py-1",4,"ngIf"],[1,"image"],[1,"file",3,"ngClass"],[1,"image-label"],["type","file","accept","image/*",1,"file-input",3,"change"],["class","file-cta",4,"ngIf"],["class","button is-link is-loading full-width",4,"ngIf"],[1,"file-cta"],[1,"file-icon"],[1,"icon","icon-upload-cloud","is-size-5"],[1,"file-label"],[1,"button","is-link","is-loading","full-width"],[1,"has-current-file","is-flex","is-align-items-center","is-justify-content-space-between","mt-1","has-background-white-ter","pl-1","py-1"],[3,"src"],[1,"file-cta","file-remove"],[3,"click"],[1,"icon","icon-x","is-size-5"]],template:function(S,A){1&S&&(o.j41(0,"div",1)(1,"label",2),o.EFF(2),o.k0s(),o.DNE(3,ln,7,5,"div",3)(4,An,5,1,"div",4),o.k0s()),2&S&&(o.R7$(),o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngIf",!A.value),o.R7$(),o.Y8G("ngIf",A.displayedImage))},dependencies:[h.bT,h.YU],encapsulation:2})}}return N})();const ur={toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"],["table"]]},or=new o.nKC("config",{providedIn:"root",factory:()=>({modules:ur})});var F=M(7711),H=M(7787),Ee=M(5719);
2
2
  /**
3
3
  * @license Angular v17.3.12
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
@@ -65,9 +65,16 @@ exports.AppModule = AppModule = __decorate([
65
65
  typeorm_1.TypeOrmModule.forRootAsync({
66
66
  imports: [config_1.ConfigModule, entity_module_1.EntityModule, manifest_module_1.ManifestModule],
67
67
  useFactory: async (configService, entityLoaderService, manifestService) => {
68
- const databaseConfig = configService.get('database');
68
+ const isPostgres = configService.get('DB_CONNECTION') === 'postgres';
69
+ let databaseConfig;
70
+ if (isPostgres) {
71
+ databaseConfig = configService.get('database').postgres;
72
+ }
73
+ else {
74
+ databaseConfig = configService.get('database').sqlite;
75
+ }
69
76
  await manifestService.loadManifest(configService.get('paths').manifestFile);
70
- const entities = entityLoaderService.loadEntities();
77
+ const entities = entityLoaderService.loadEntities(isPostgres);
71
78
  return Object.assign(databaseConfig, { entities });
72
79
  },
73
80
  inject: [config_1.ConfigService, entity_loader_service_1.EntityLoaderService, manifest_service_1.ManifestService]
@@ -3,10 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = () => {
4
4
  return {
5
5
  database: {
6
- type: 'sqlite',
7
- database: process.env.DATABASE_PATH || `${process.cwd()}/manifest/backend.db`,
8
- dropSchema: process.env.DB_DROP_SCHEMA === 'true' || false,
9
- synchronize: true
6
+ sqlite: {
7
+ type: 'sqlite',
8
+ database: process.env.DB_PATH || `${process.cwd()}/manifest/backend.db`,
9
+ dropSchema: process.env.DB_DROP_SCHEMA === 'true' || false,
10
+ synchronize: true
11
+ },
12
+ postgres: {
13
+ type: 'postgres',
14
+ host: process.env.DB_HOST || 'localhost',
15
+ port: parseInt(process.env.DB_PORT, 10) || 5432,
16
+ username: process.env.DB_USERNAME || 'postgres',
17
+ password: process.env.DB_PASSWORD || 'postgres',
18
+ database: process.env.DB_DATABASE || 'manifest',
19
+ dropSchema: process.env.DB_DROP_SCHEMA === 'true' || false,
20
+ ssl: process.env.DB_SSL === 'true' || false,
21
+ synchronize: true
22
+ }
10
23
  }
11
24
  };
12
25
  };
@@ -7,6 +7,8 @@ exports.default = () => {
7
7
  nodeEnv: process.env.NODE_ENV || 'development',
8
8
  tokenSecretKey: process.env.TOKEN_SECRET_KEY || constants_1.DEFAULT_TOKEN_SECRET_KEY,
9
9
  baseUrl: process.env.BASE_URL ||
10
- `http://localhost:${process.env.PORT || constants_1.DEFAULT_PORT}`
10
+ `http://localhost:${process.env.PORT || constants_1.DEFAULT_PORT}`,
11
+ showOpenApiDocs: process.env.OPEN_API_DOCS === 'true' ||
12
+ process.env.NODE_ENV !== 'production'
11
13
  };
12
14
  };
@@ -14,7 +14,7 @@ let PaginationService = class PaginationService {
14
14
  const total = await query.getCount();
15
15
  const results = await query
16
16
  .skip(offset)
17
- .take(resultsPerPage)
17
+ .take(resultsPerPage === -1 ? total : resultsPerPage)
18
18
  .getMany();
19
19
  return {
20
20
  data: results,
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.postgresPropTypeColumnTypes = void 0;
4
+ const types_1 = require("../../../../types/src");
5
+ exports.postgresPropTypeColumnTypes = {
6
+ [types_1.PropType.String]: 'varchar',
7
+ [types_1.PropType.Number]: 'numeric',
8
+ [types_1.PropType.Link]: 'varchar',
9
+ [types_1.PropType.Text]: 'text',
10
+ [types_1.PropType.RichText]: 'text',
11
+ [types_1.PropType.Money]: 'numeric',
12
+ [types_1.PropType.Date]: 'date',
13
+ [types_1.PropType.Timestamp]: 'timestamp',
14
+ [types_1.PropType.Email]: 'varchar',
15
+ [types_1.PropType.Boolean]: 'boolean',
16
+ [types_1.PropType.Password]: 'varchar',
17
+ [types_1.PropType.Choice]: 'text',
18
+ [types_1.PropType.Location]: 'jsonb',
19
+ [types_1.PropType.File]: 'varchar',
20
+ [types_1.PropType.Image]: 'jsonb'
21
+ };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.propTypeColumnTypes = void 0;
3
+ exports.sqlitePropTypeColumnTypes = void 0;
4
4
  const types_1 = require("../../../../types/src");
5
- exports.propTypeColumnTypes = {
5
+ exports.sqlitePropTypeColumnTypes = {
6
6
  [types_1.PropType.String]: 'varchar',
7
7
  [types_1.PropType.Number]: 'decimal',
8
8
  [types_1.PropType.Link]: 'varchar',
@@ -10,7 +10,7 @@ exports.propTypeColumnTypes = {
10
10
  [types_1.PropType.RichText]: 'text',
11
11
  [types_1.PropType.Money]: 'decimal',
12
12
  [types_1.PropType.Date]: 'date',
13
- [types_1.PropType.Timestamp]: 'integer',
13
+ [types_1.PropType.Timestamp]: 'datetime',
14
14
  [types_1.PropType.Email]: 'varchar',
15
15
  [types_1.PropType.Boolean]: 'boolean',
16
16
  [types_1.PropType.Password]: 'varchar',
@@ -10,27 +10,47 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.EntityLoaderService = void 0;
13
+ const types_1 = require("../../../../types/src");
13
14
  const common_1 = require("@nestjs/common");
14
15
  const typeorm_1 = require("typeorm");
15
16
  const base_entity_1 = require("../core-entities/base-entity");
16
- const prop_type_column_types_1 = require("../records/prop-type-column-types");
17
+ const sqlite_prop_type_column_types_1 = require("../records/sqlite-prop-type-column-types");
17
18
  const base_authenticable_entity_1 = require("../core-entities/base-authenticable-entity");
18
19
  const relationship_service_1 = require("./relationship.service");
19
20
  const entity_manifest_service_1 = require("../../manifest/services/entity-manifest.service");
21
+ const postgres_prop_type_column_types_copy_1 = require("../records/postgres-prop-type-column-types copy");
20
22
  let EntityLoaderService = class EntityLoaderService {
21
23
  constructor(entityManifestService, relationshipService) {
22
24
  this.entityManifestService = entityManifestService;
23
25
  this.relationshipService = relationshipService;
24
26
  }
25
- loadEntities() {
27
+ loadEntities(isPostgres) {
26
28
  const entityManifests = this.entityManifestService.getEntityManifests({ fullVersion: true });
29
+ const columns = isPostgres
30
+ ? postgres_prop_type_column_types_copy_1.postgresPropTypeColumnTypes
31
+ : sqlite_prop_type_column_types_1.sqlitePropTypeColumnTypes;
27
32
  const entitySchemas = entityManifests.map((entityManifest) => {
28
33
  const entitySchema = new typeorm_1.EntitySchema({
29
34
  name: entityManifest.className,
30
35
  columns: entityManifest.properties.reduce((acc, propManifest) => {
36
+ let transformer = undefined;
37
+ if (propManifest.type === types_1.PropType.Number ||
38
+ propManifest.type === types_1.PropType.Money) {
39
+ transformer = {
40
+ from: (value) => Number(value),
41
+ to: (value) => value
42
+ };
43
+ }
44
+ if (propManifest.type === types_1.PropType.Timestamp) {
45
+ transformer = {
46
+ from: (value) => value instanceof Date ? value.toISOString() : value,
47
+ to: (value) => value
48
+ };
49
+ }
31
50
  acc[propManifest.name] = {
32
51
  name: propManifest.name,
33
- type: prop_type_column_types_1.propTypeColumnTypes[propManifest.type],
52
+ type: columns[propManifest.type],
53
+ transformer,
34
54
  nullable: true
35
55
  };
36
56
  return acc;
@@ -16,21 +16,22 @@ exports.LoggerService = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const config_1 = require("@nestjs/config");
18
18
  const chalk_1 = __importDefault(require("chalk"));
19
+ const constants_1 = require("../constants");
19
20
  let LoggerService = class LoggerService {
20
21
  constructor(configService) {
21
22
  this.configService = configService;
22
23
  }
23
24
  initMessage() {
24
- const port = this.configService.get('port');
25
+ const baseUrl = this.configService.get('baseUrl');
25
26
  const nodeEnv = this.configService.get('nodeEnv');
26
- const adminUrl = nodeEnv === 'contribution'
27
- ? 'http://localhost:4200'
28
- : `http://localhost:${port}`;
27
+ const adminUrl = nodeEnv === 'contribution' ? 'http://localhost:4200' : `${baseUrl}`;
29
28
  console.log();
30
29
  console.log(chalk_1.default.blue('Manifest backend successfully started! '));
31
30
  console.log();
32
31
  console.log(chalk_1.default.blue('🖥️ Admin Panel: ', chalk_1.default.underline.blue(adminUrl)));
33
- console.log(chalk_1.default.blue('📚 API Doc: ', chalk_1.default.underline.blue(`http://localhost:${port}/api`)));
32
+ if (this.configService.get('showOpenApiDocs')) {
33
+ console.log(chalk_1.default.blue('📚 API Doc: ', chalk_1.default.underline.blue(`${baseUrl}/${constants_1.API_PATH}`)));
34
+ }
34
35
  console.log();
35
36
  }
36
37
  };
@@ -75,8 +75,7 @@ async function bootstrap() {
75
75
  res.sendFile((0, path_1.join)(adminPanelFolder, 'index.html'));
76
76
  }
77
77
  });
78
- const showOpenApi = process.env.OPEN_API_DOCS !== 'false';
79
- if (showOpenApi) {
78
+ if (configService.get('showOpenApiDocs')) {
80
79
  const openApiService = app.get(open_api_service_1.OpenApiService);
81
80
  swagger_1.SwaggerModule.setup(constants_1.API_PATH, app, openApiService.generateOpenApiObject(), {
82
81
  customfavIcon: 'assets/images/open-api/favicon.ico',
@@ -60,11 +60,20 @@ let SeederService = class SeederService {
60
60
  entityMetadatas = entityMetadatas.filter((entity) => entity.tableName === tableName);
61
61
  }
62
62
  const queryRunner = this.dataSource.createQueryRunner();
63
- await queryRunner.query('PRAGMA foreign_keys = OFF');
64
- await Promise.all(entityMetadatas.map(async (entity) => queryRunner
65
- .query(`DELETE FROM [${entity.tableName}]`)
66
- .then(() => queryRunner.query(`DELETE FROM sqlite_sequence WHERE name = '${entity.tableName}'`))));
67
- await queryRunner.query('PRAGMA foreign_keys = ON');
63
+ const isPostgres = this.dataSource.options.type === 'postgres';
64
+ if (isPostgres) {
65
+ await Promise.all(entityMetadatas.map(async (entity) => queryRunner.query(`TRUNCATE TABLE "${entity.tableName}" CASCADE`)));
66
+ await Promise.all(entityMetadatas.map(async (entity) => queryRunner
67
+ .query(`ALTER SEQUENCE "${entity.tableName}_id_seq" RESTART WITH 1`)
68
+ .catch(() => { })));
69
+ }
70
+ else {
71
+ await queryRunner.query('PRAGMA foreign_keys = OFF');
72
+ await Promise.all(entityMetadatas.map(async (entity) => queryRunner
73
+ .query(`DELETE FROM [${entity.tableName}]`)
74
+ .then(() => queryRunner.query(`DELETE FROM sqlite_sequence WHERE name = '${entity.tableName}'`))));
75
+ await queryRunner.query('PRAGMA foreign_keys = ON');
76
+ }
68
77
  entityMetadatas = entityMetadatas.filter((entity) => entity.tableType === 'regular');
69
78
  for (const entityMetadata of entityMetadatas) {
70
79
  const repository = this.entityService.getEntityRepository({
@@ -15,12 +15,7 @@ exports.typeValidators = {
15
15
  [types_1.PropType.Date]: (value) => (0, class_validator_1.isDateString)(value) && new RegExp(/^\d{4}-\d{2}-\d{2}$/).test(value)
16
16
  ? null
17
17
  : 'The value must be a valid date',
18
- [types_1.PropType.Timestamp]: (value) => typeof value === 'number' &&
19
- Number.isInteger(value) &&
20
- value > 0 &&
21
- isFinite(value)
22
- ? null
23
- : 'The value must be a valid timestamp',
18
+ [types_1.PropType.Timestamp]: (value) => (0, class_validator_1.isISO8601)(value) ? null : 'The value must be a valid timestamp',
24
19
  [types_1.PropType.Email]: (value) => (0, class_validator_1.isEmail)(value) ? null : 'The value must be a valid email address',
25
20
  [types_1.PropType.Boolean]: (value) => (0, class_validator_1.isBoolean)(value) ? null : 'The value must be a boolean',
26
21
  [types_1.PropType.Password]: (value) => (0, class_validator_1.isString)(value) ? null : 'The value must be a string',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "manifest",
3
- "version": "4.6.2",
3
+ "version": "4.7.0",
4
4
  "description": "The 1-file micro-backend",
5
5
  "author": "Manifest",
6
6
  "license": "MIT",
@@ -43,8 +43,10 @@
43
43
  "test:ci": "npm run test:unit:ci && npm run test:e2e:ci",
44
44
  "test:watch": "jest --watch",
45
45
  "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
46
- "test:e2e": "jest --config ./e2e/jest-e2e.config.json",
47
- "test:e2e:ci": "jest --config ./e2e/jest-e2e.config.json --ci",
46
+ "test:e2e:sqlite": "jest --config ./e2e/jest-e2e.sqlite-config.json",
47
+ "test:e2e:postgres": "jest --config ./e2e/jest-e2e.pg-config.json",
48
+ "test:e2e": "npm run test:e2e:sqlite && npm run test:e2e:postgres",
49
+ "test:e2e:ci": "npm run test:e2e:sqlite -- --ci && npm run test:e2e:postgres -- --ci",
48
50
  "test:unit": "jest --config ./jest.config.json",
49
51
  "test:unit:ci": "jest --config ./jest.config.json --ci --coverage",
50
52
  "postbuild": "rm -fr ./dist/admin/dist && rm ./dist/tsconfig.build.tsbuildinfo",
@@ -78,6 +80,7 @@
78
80
  "mock-fs": "^5.4.1",
79
81
  "node-fetch": "^3.3.2",
80
82
  "nodemon": "^3.1.7",
83
+ "pg": "^8.13.1",
81
84
  "pluralize": "^8.0.0",
82
85
  "reflect-metadata": "^0.2.1",
83
86
  "rxjs": "^7.8.1",
@@ -93,6 +96,7 @@
93
96
  "@nestjs/cli": "^10.4.7",
94
97
  "@nestjs/schematics": "^10.2.3",
95
98
  "@nestjs/testing": "^10.4.8",
99
+ "@testcontainers/postgresql": "^10.18.0",
96
100
  "@types/dasherize": "^2.0.3",
97
101
  "@types/express": "^4.17.21",
98
102
  "@types/js-yaml": "^4.0.9",