1import{a as v,b as x,c as y}from"./chunk-5BLE3IXV.js";import{e as g}from"./chunk-JOBZWO2R.js";import{a as b}from"./chunk-PTU3FOXD.js";import"./chunk-OXIGMNMO.js";import"./chunk-53RKE6AR.js";import"./chunk-MJI6LEGI.js";import"./chunk-UP5HVQJ7.js";import"./chunk-S5LESQWC.js";import"./chunk-KWZSRHIQ.js";import{Za as h,ea as c}from"./chunk-AW2E5EY2.js";import{I as m,K as s,U as d,Z as p,da as f,p as t}from"./chunk-R4JWJUZM.js";import"./chunk-56UI36AU.js";import{xa as u}from"./chunk-S4ZYYDEY.js";import"./chunk-GBLYWK7B.js";import"./chunk-7H42BKFX.js";import"./chunk-UQ2EVXRL.js";import"./chunk-PLPY2PP7.js";import"./chunk-U7PF3LKU.js";import"./chunk-E4HNVVNL.js";import{M as l,O as n}from"./chunk-2SVM3XRP.js";import{N as o,Nb as i,m as a}from"./chunk-HCYDIVNE.js";import"./chunk-KLNAR7ZE.js";var C=`<div class="page"> 2 <app-breadcrumb-control [breadcrumb]="breadcrumb"></app-breadcrumb-control> 3 <app-menu-bar [config]="menuConfig"></app-menu-bar> 4 5 <div class="form-wrapper"> 6 <form [formGroup]="form"> 7 <div class="form-row"> 8 <mat-form-field appearance="fill" class="full-width"> 9 <mat-label>Heading</mat-label> 10 <input matInput formControlName="heading" placeholder="Main heading text" /> 11 @if (form.get('heading')?.hasError('required')) { 12 <mat-error>Heading is required</mat-error> 13 } 14 @if (form.get('heading')?.hasError('maxlength')) { 15 <mat-error>Max 200 characters</mat-error> 16 } 17 </mat-form-field> 18 </div> 19 <div class="form-row"> 20 <mat-form-field appearance="fill" class="full-width"> 21 <mat-label>Subheading</mat-label> 22 <input matInput formControlName="subHeading" placeholder="Optional subheading" /> 23 @if (form.get('subHeading')?.hasError('maxlength')) { 24 <mat-error>Max 200 characters</mat-error> 25 } 26 </mat-form-field> 27 </div> 28 <div class="form-row"> 29 <mat-form-field appearance="fill" class="full-width"> 30 <mat-label>Synopsis</mat-label> 31 <textarea matInput formControlName="synopsis" placeholder="Short description" rows="3"></textarea> 32 @if (form.get('synopsis')?.hasError('maxlength')) { 33 <mat-error>Max 1000 characters</mat-error> 34 } 35 </mat-form-field> 36 </div> 37 <div class="form-row"> 38 <mat-form-field appearance="fill" class="half-width"> 39 <mat-label>Button text</mat-label> 40 <input matInput formControlName="buttonText" placeholder="e.g. Learn more" /> 41 @if (form.get('buttonText')?.hasError('maxlength')) { 42 <mat-error>Max 100 characters</mat-error> 43 } 44 </mat-form-field> 45 <mat-form-field appearance="fill" class="half-width"> 46 <mat-label>Navigation type</mat-label> 47 <mat-select formControlName="navigationType" placeholder="How the link opens"> 48 <mat-option value="">\u2014</mat-option> 49 @for (opt of navigationTypeOptions; track opt.value) { 50 <mat-option [value]="opt.value">{{ opt.label }}</mat-option> 51 } 52 </mat-select> 53 </mat-form-field> 54 </div> 55 <div class="form-row"> 56 <mat-form-field appearance="fill" class="full-width"> 57 <mat-label>URL</mat-label> 58 <input matInput formControlName="url" placeholder="Link URL" /> 59 @if (form.get('url')?.hasError('maxlength')) { 60 <mat-error>Max 500 characters</mat-error> 61 } 62 </mat-form-field> 63 </div> 64 <div class="form-row"> 65 <mat-form-field appearance="fill" class="half-width"> 66 <mat-label>Sort order</mat-label> 67 <input matInput type="number" formControlName="sortOrder" placeholder="0" /> 68 </mat-form-field> 69 </div> 70 </form> 71 </div> 72</div> 73`;var w=`.page{padding:20px}.form-wrapper{max-width:800px;margin-top:16px}.form-row{margin-bottom:8px}.form-row .full-width{width:100%}.form-row .half-width{width:calc(50% - 8px);margin-right:16px}.form-row .half-width:last-child{margin-right:0}@media(max-width:600px){.form-row .half-width{width:100%;margin-right:0}} 74/*# sourceMappingURL=carousel-modify.component-DBHONHBM.css.map */ 75`;var M=class{constructor(r,e,S,T,I){this.fb=r,this.route=e,this.router=S,this.carouselService=T,this.coreUtils=I,this.isSubmitting=!1,this.isEdit=!1,this.carouselId=null,this.navigationTypeOptions=x,this.breadcrumb=g({i
75d:"carousel-modify-breadcrumb",label:"Breadcrumb",items:[{label:"Home",route:"/"},{label:"Admin",route:"/admin"},{label:"Carousel Management",route:"/admin/carousels"},{label:"New Carousel"}]}),this.menuConfig={alignment:"end",buttons:[{id:"cancel",label:"Cancel",icon:"close",color:"primary",size:"large",variant:"basic",tooltip:"Cancel",events:{click:()=>this.onMenuCancel()}},{id:"save",label:"Save",icon:"save",color:"primary",size:"large",variant:"basic",tooltip:"Save",events:{click:()=>this.onMenuSave()}}]},this.form=this.fb.group({id:[null],heading:["",[t.required,t.maxLength(200)]],subHeading:["",[t.maxLength(200)]],synopsis:["",[t.maxLength(1e3)]],buttonText:["",[t.maxLength(100)]],navigationType:[""],url:["",[t.maxLength(500)]],sortOrder:[0]})}ngOnInit(){let r=this.route.snapshot.paramMap.get("carouselId");r&&(this.isEdit=!0,this.carouselId=+r,this.breadcrumb.items[3]={label:"Edit Carousel"},this.carouselService.getCarouselById(this.carouselId).pipe(o(1)).subscribe({next:e=>{if(!e){this.coreUtils.openSnackBar("Carousel not found."),this.router.navigate(["/admin/carousels"]);return}this.form.patchValue({id:e.id,heading:e.heading??"",subHeading:e.subHeading??"",synopsis:e.synopsis??"",buttonText:e.buttonText??"",navigationType:y(e.navigationType),url:e.url??"",sortOrder:e.sortOrder??0})},error:()=>{this.coreUtils.openSnackBar("Carousel not found."),this.router.navigate(["/admin/carousels"])}}))}onMenuCancel(){this.router.navigate(["/admin/carousels"])}onMenuSave(){if(this.isSubmitting||this.form.invalid){this.form.markAllAsTouched();return}this.isSubmitting=!0;let r=this.form.getRawValue(),e={id:r.id??void 0,heading:r.heading||null,subHeading:r.subHeading||null,synopsis:r.synopsis||null,buttonText:r.buttonText||null,navigationType:r.navigationType||null,url:r.url||null,sortOrder:typeof r.sortOrder=="number"?r.sortOrder:parseInt(r.sortOrder||"0",10)};this.carouselService.mutateEntity(e).subscribe({next:()=>{this.coreUtils.openSnackBar("Carousel saved successfully."),this.router.navigate(["/admin/carousels"]),this.isSubmitting=!1},error:()=>{this.coreUtils.openSnackBar("Error saving carousel."),this.isSubmitting=!1}})}static{this.ctorParameters=()=>[{type:m},{type:l},{type:n},{type:v},{type:b}]}};M=a([i({selector:"app-carousel-modify",standalone:!0,imports:[s,d,f,p,u,h,c],template:C,styles:[w]})],M);export{M as CarouselModifyComponent}; 76//# sourceMappingURL=chunk-NARDVGK7.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.