1import{_}from"./DiKJ08Nh.js";import{f as $,D as R,j,w as H,o as n,a as t,b as p,i as c,d as b,n as V,t as U,c as i,k as d,F as S,l as T,p as o,v as a,a0 as q,r as y,G as z,_ as K}from"./DHH4uiu3.js";import{I as v}from"./CnXrXDLz.js";import"./BbgUwqB5.js";const Y={class:"page-head"},J={class:"page-actions"},Q=["disabled"],W=["disabled"],X={key:1,class:"loading-state"},Z={class:"tabs"},ee=["onClick"],te={key:0,class:"form-section"},le={class:"form-group"},se={class:"form-group"},oe={key:1,class:"form-section"},ae={class:"section-header"},ne={class:"stat-fields"},ie={class:"form-row"},re={class:"form-group"},ue=["onUpdate:modelValue"],de={class:"form-group"},pe=["onUpdate:modelValue"],ce=["onClick"],ve={key:0,class:"empty-state"},me={key:2,class:"form-section"},ge={class:"form-group"},fe={class:"form-group"},be={key:3,class:"form-section"},ye={class:"section-header"},ke={class:"why-card-fields"},he={class:"form-row"},xe={class:"form-group"},we=["onUpdate:modelValue"],Se={class:"form-group"},Be=["onUpdate:modelValue"],Ve={class:"form-group"},Ue=["onUpdate:modelValue"],Te=["onClick"],Ce={key:0,class:"empty-state"},Ee={key:4,class:"form-section"},Pe={class:"form-group"},De={class:"form-group"},Fe={class:"form-row"},Oe={class:"form-group"},Le={class:"form-group"},Ae={class:"form-row"},Ge={class:"form-group"},Ie={class:"form-group"},Ne={class:"form-group checkbox-group"},Me={class:"checkbox-label"},_e={key:5,class:"form-section"},$e={class:"form-group"},Re={class:"form-group"},je={class:"form-group"},He={class:"form-group"},qe={class:"form-group"},ze={class:"form-group"},Ke=$({__name:"packages-page",async setup(Ye){let C,E;const x=$fetch,l=y(null),g=y(!1),f=y(!1),w=y(""),B=y("success"),m=y("hero"),P=async()=>{g.value=!0;try{const r=await x("/api/packages-page");l.value=r}catch{k("Failed to load packages page data","error")}finally{g.value=!1}},D=async()=>{if(l.value){f.value=!0;try{await x("/api/packages-page",{method:"POST",body:l.value}),k("Packages page saved successfully","success")}catch(r){k(r?.data?.statusMessage||"Failed to save packages page","error")}finally{f.value=!1}}},F=async()=>{if(confirm("Are you sure you want to reset all packages page data to defaults?")){g.value=!0;try{const r=await x("/api/packages-page/reset",{method:"POST"});l.value=r.data,k("Packages page reset to defaults","success")}catch{k("Failed to reset packages page","error")}finally{g.value=!1}}},k=(r,e)=>{w.value=r,B.value=e,setTimeout(()=>{w.value=""},5e3)},O=()=>{l.value&&l.value.filters.push({id:"filter-"+Date.now(),label:"New Filter"})},L=r=>{l.value&&l.value.filters.splice(r,1)},A=()=>{l.value&&l.value.processSteps.push({step:`Step ${l.value.processSteps.length+1}`,title:"New Step",description:""})},G=r=>{l.value&&l.value.processSteps.splice(r,1)},I=async()=>{await x("/api/admin/logout",{method:"POST"}),await z("/admin/login")},N=[{id:"hero",label:"Hero",icon:"lucide:layout-template"},{id:"filters",label:"Filters",icon:"lucide:filter"},{id:"packages",label:"Packages Section",icon:"lucide:package"},{id:"process",label:"Process Steps",icon:"lucide:list-ordered"},{id:"cta",label:"CTA Banner",icon:"lucide:megaphone"},{id:"seo",label:"SEO",icon:"lucide:search"}];return[C,E]=R(()=>P()),await C,E(),(r,e)=>{const M=_;return n(),j(M,{onLogout:I},{default:H(()=>[t("section",Y,[e[18]||(e[18]=t("div",null,[t("h1",null,"Packages Page"),t("p",null,"Edit your packages listing page content, filters, and SEO.")],-1)),t("div",J,[t("button",{class:"btn btn-secondary",onClick:F,disabled:g.value},[p(c(v),{icon:"lucide:rotate-ccw",width:"18",height:"18"}),e[17]||(e[17]=b(" Reset to Defaults ",-1))],8,Q),t("button",{class:"btn btn-primary",onClick:D,disabled:f.value||g.value},[p(c(v),{icon:f.value?"lucide:loader-2":"lucide:save",width:"18",height:"18",class:V({spinning:f.value})},null,8,["icon","class"]),b(" "+U(f.value?"Saving...":"Save Changes"),1)],8,W)])]),w.value?(n(),i("div",{key:0,class:V(["message",B.value])},[p(c(v),{icon:B.value==="success"?"lucide:check-circle":"lucide:alert-circle",width:"20",height:"20"},null,8,["icon"]),b(" "+U(w.value),1)],2)):d("",!0),g.value&&!l.value?(n(),i("div",X,[p(c(v),{icon:"lucide:loader",width:"32",height:"32",class:"spinning"}
1),e[19]||(e[19]=t("p",null,"Loading packages page data...",-1))])):d("",!0),l.value?(n(),i(S,{key:2},[t("div",Z,[(n(),i(S,null,T(N,s=>t("button",{key:s.id,class:V(["tab",{active:m.value===s.id}]),onClick:h=>m.value=s.id},[p(c(v),{icon:s.icon,width:"18",height:"18"},null,8,["icon"]),b(" "+U(s.label),1)],10,ee)),64))]),m.value==="hero"?(n(),i("div",te,[e[22]||(e[22]=t("h2",null,"Hero Section",-1)),t("div",le,[e[20]||(e[20]=t("label",null,"Title",-1)),o(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>l.value.hero.title=s),type:"text",class:"form-input",placeholder:"Enter hero title"},null,512),[[a,l.value.hero.title]])]),t("div",se,[e[21]||(e[21]=t("label",null,"Subtitle",-1)),o(t("textarea",{"onUpdate:modelValue":e[1]||(e[1]=s=>l.value.hero.subtitle=s),class:"form-textarea",rows:"3",placeholder:"Enter hero subtitle"},null,512),[[a,l.value.hero.subtitle]])])])):d("",!0),m.value==="filters"?(n(),i("div",oe,[t("div",ae,[e[24]||(e[24]=t("h2",null,"Filter Chips",-1)),t("button",{class:"btn btn-secondary btn-sm",onClick:O},[p(c(v),{icon:"lucide:plus",width:"16",height:"16"}),e[23]||(e[23]=b(" Add Filter ",-1))])]),e[28]||(e[28]=t("p",{class:"section-description"},"These filter chips appear below the hero title on the packages page.",-1)),(n(!0),i(S,null,T(l.value.filters,(s,h)=>(n(),i("div",{key:s.id,class:"stat-item"},[t("div",ne,[t("div",ie,[t("div",re,[e[25]||(e[25]=t("label",null,"Filter ID (used internally)",-1)),o(t("input",{"onUpdate:modelValue":u=>s.id=u,type:"text",class:"form-input",placeholder:"e.g. beach"},null,8,ue),[[a,s.id]])]),t("div",de,[e[26]||(e[26]=t("label",null,"Label (displayed to users)",-1)),o(t("input",{"onUpdate:modelValue":u=>s.label=u,type:"text",class:"form-input",placeholder:"e.g. Beach Escapes"},null,8,pe),[[a,s.label]])])])]),t("button",{class:"btn-icon danger",onClick:u=>L(h)},[p(c(v),{icon:"lucide:trash-2",width:"18",height:"18"})],8,ce)]))),128)),l.value.filters.length===0?(n(),i("div",ve,[...e[27]||(e[27]=[t("p",null,'No filters defined. Click "Add Filter" to create one.',
1-1)])])):d("",!0)])):d("",!0),m.value==="packages"?(n(),i("div",me,[e[31]||(e[31]=t("h2",null,"Packages Grid Section",-1)),t("div",ge,[e[29]||(e[29]=t("label",null,"Section Title",-1)),o(t("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>l.value.packagesSection.title=s),type:"text",class:"form-input",placeholder:"Enter section title"},null,512),[[a,l.value.packagesSection.title]])]),t("div",fe,[e[30]||(e[30]=t("label",null,"Section Subtitle",-1)),o(t("textarea",{"onUpdate:modelValue":e[3]||(e[3]=s=>l.value.packagesSection.subtitle=s),class:"form-textarea",rows:"3",placeholder:"Enter section subtitle"},null,512),[[a,l.value.packagesSection.subtitle]])])])):d("",!0),m.value==="process"?(n(),i("div",be,[t("div",ye,[e[33]||(e[33]=t("h2",null,"Process Steps",-1)),t("button",{class:"btn btn-secondary btn-sm",onClick:A},[p(c(v),{icon:"lucide:plus",width:"16",height:"16"}),e[32]||(e[32]=b(" Add Step ",-1))])]),e[38]||(e[38]=t("p",{class:"section-description"},"These steps explain how package booking works.",-1)),(n(!0),i(S,null,T(l.value.processSteps,(s,h)=>(n(),i("div",{key:h,class:"why-card-item"},[t("div",ke,[t("div",he,[t("div",xe,[e[34]||(e[34]=t("label",null,"Step Label",-1)),o(t("input",{"onUpdate:modelValue":u=>s.step=u,type:"text",class:"form-input",placeholder:"e.g. Step 1"},null,8,we),[[a,s.step]])]),t("div",Se,[e[35]||(e[35]=t("label",null,"Title",-1)),o(t("input",{"onUpdate:modelValue":u=>s.title=u,type:"text",class:"form-input",placeholder:"e.g. Choose Your Package"},null,8,Be),[[a,s.title]])])]),t("div",Ve,[e[36]||(e[36]=t("label",null,"Description",-1)),o(t("textarea",{"onUpdate:modelValue":u=>s.description=u,class:"form-textarea",rows:"2",placeholder:"Enter step description"},null,8,Ue),[[a,s.description]])])]),t("button",{class:"btn-icon danger",onClick:u=>G(h)},[p(c(v),{icon:"lucide:trash-2",width:"18",height:"18"})],8,Te)]))),128)),l.value.processSteps.length===0?(n(),i("div",Ce,[...e[37]||(e[37]=[t("p",null,'No process steps defined. Click "Add Step" to create one.',
1-1)])])):d("",!0)])):d("",!0),m.value==="cta"?(n(),i("div",Ee,[e[46]||(e[46]=t("h2",null,"CTA Banner Section",-1)),t("div",Pe,[e[39]||(e[39]=t("label",null,"Title",-1)),o(t("input",{"onUpdate:modelValue":e[4]||(e[4]=s=>l.value.ctaBanner.title=s),type:"text",class:"form-input"},null,512),[[a,l.value.ctaBanner.title]])]),t("div",De,[e[40]||(e[40]=t("label",null,"Subtitle",-1)),o(t("textarea",{"onUpdate:modelValue":e[5]||(e[5]=s=>l.value.ctaBanner.subtitle=s),class:"form-textarea",rows:"3"},null,512),[[a,l.value.ctaBanner.subtitle]])]),e[47]||(e[47]=t("h3",{class:"subsection-title"},"Primary Button",-1)),t("div",Fe,[t("div",Oe,[e[41]||(e[41]=t("label",null,"Text",-1)),o(t("input",{"onUpdate:modelValue":e[6]||(e[6]=s=>l.value.ctaBanner.primaryButton.text=s),type:"text",class:"form-input"},null,512),[[a,l.value.ctaBanner.primaryButton.text]])]),t("div",Le,[e[42]||(e[42]=t("label",null,"Link",-1)),o(t("input",{"onUpdate:modelValue":e[7]||(e[7]=s=>l.value.ctaBanner.primaryButton.link=s),type:"text",class:"form-input"},null,512),[[a,l.value.ctaBanner.primaryButton.link]])])]),e[48]||(e[48]=t("h3",{class:"subsection-title"},"Secondary Button",-1)),t("div",Ae,[t("div",Ge,[e[43]||(e[43]=t("label",null,"Text",-1)),o(t("input",{"onUpdate:modelValue":e[8]||(e[8]=s=>l.value.ctaBanner.secondaryButton.text=s),type:"text",class:"form-input"},null,512),[[a,l.value.ctaBanner.secondaryButton.text]])]),t("div",Ie,[e[44]||(e[44]=t("label",null,"Link",-1)),o(t("input",{"onUpdate:modelValue":e[9]||(e[9]=s=>l.value.ctaBanner.secondaryButton.link=s),type:"text",class:"form-input"},null,512),[[a,l.value.ctaBanner.secondaryButton.link]])])]),t("div",Ne,[t("label",Me,[o(t("input",{"onUpdate:modelValue":e[10]||(e[10]=s=>l.value.ctaBanner.secondaryButton.isExternal=s),type:"checkbox"},null,512),[[q,l.value.ctaBanner.secondaryButton.isExternal]]),e[45]||(e[45]=t("span",null,"External Link (opens in new tab)",-1))])])])):d("",!0),m.value==="seo"?(n(),i("div",_e,[e[60]||(e[60]=t("h2",null,"SEO Settings",-1)),e[61]||(e[61]=t("p",{class:"section-description"},"Control the meta tags for search engines and social sharing.",-1)),t("div",$e,[e[49]||(e[49]=t("label",null,"Page Title (Meta Title)",-1)),o(t("input",{"onUpdate:modelValue":e[11]||(e[11]=s=>l.value.seo.title=s),type:"text",class:"form-input",placeholder:"Enter page title"},null,512),[[a,l.value.seo.title]]),e[50]||(e[50]=t("span",{class:"help-text"},"Recommended: 50-60 characters",-1))]),t("div",Re,[e[51]||(e[51]=t("label",null,"Meta Description",-1)),o(t("textarea",{"onUpdate:modelValue":e[12]||(e[12]=s=>l.value.seo.description=s),class:"form-textarea",rows:"3",placeholder:"Enter meta description"},null,512),[[a,l.value.seo.description]]),e[52]||(e[52]=t("span",{class:"help-text"},"Recommended: 150-160 characters",-1))]),t("div",je,[e[53]||(e[53]=t("label",null,"Keywords",-1)),o(t("input",{"onUpdate:modelValue":e[13]||(e[13]=s=>l.value.seo.keywords=s),type:"text",class:"form-input",placeholder:"Enter keywords separated by commas"},null,512),[[a,l.value.seo.keywords]])]),e[62]||(e[62]=t("div",{class:"seo-divider"},[t("h3",null,"Open Graph (Social Sharing)")],-1)),t("div",He,[e[54]||(e[54]=t("label",null,"OG Title",-1)),o(t("input",{"onUpdate:modelValue":e[14]||(e[14]=s=>l.value.seo.ogTitle=s),type:"text",class:"form-input",placeholder:"Enter Open Graph title"},null,512),[[a,l.value.seo.ogTitle]]),e[55]||(e[55]=t("span",{class:"help-text"},"Title shown when shared on social media (defaults to page title if empty)",-1))]),t("div",qe,[e[56]||(e[56]=t("label",null,"OG Description",-1)),o(t("textarea",{"onUpdate:modelValue":e[15]||(e[15]=s=>l.value.seo.ogDescription=s),class:"form-textarea",rows:"3",placeholder:"Enter Open Graph description"},null,512),[[a,l.value.seo.ogDescription]]),e[57]||(e[57]=t("span",{class:"help-text"},"Description shown when shared on social media",-1))]),t("div",ze,[e[58]||(e[58]=t("label",null,"OG Image URL",-1)),o(t("input",{"onUpdate:modelValue":e[16]||(e[16]=s=>l.value.seo.ogImage=s),type:"text",class:"form-input",placeholder:"https://example.com/image.jpg"},null,512),[[a,l.value.seo.ogImage]]),e[59]||(e[59]=t("span",{class:"help-text"},"Image shown when shared on social media (recommended: 1200x630px)",-1))])])):d("",!0)],64)):d("",!0)]),_:1})}}}),Ze=K(Ke,[["__scopeId","data-v-2cfbd746"]]);export{Ze as default};
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.