"use strict";(self["webpackChunkcigar_finder_frontend"]=self["webpackChunkcigar_finder_frontend"]||[]).push([[689],{9009:function(t,e,a){a.r(e),a.d(e,{default:function(){return B}});var s=a(641),i=a(33);const r={class:"admin-page"},n={class:"stats-bar"},o={class:"stat"},l={class:"stat-value"},d={class:"stat"},u={class:"stat-value"},c={class:"stat"},p={class:"stat-value"},g={class:"stat"},m={class:"stat-value"},k={class:"tabs"},h={key:0,class:"tab-content"},v={class:"card-header"},L={class:"stars"},y={class:"card-meta"},f={key:0,class:"badge hidden"},b={key:1,class:"badge"},C={class:"card-actions"},w=["onClick"],E=["onClick"],_={key:0,class:"empty"},I={key:1,class:"tab-content"},F={class:"card-header"},X={class:"card-actions"},A=["onClick"],$=["onClick"],R={key:0,class:"empty"},U={key:2,class:"tab-content"},Q={class:"card-meta"},j={key:0,class:"empty"},P={key:3,class:"tab-content"},S={key:0},D={class:"card-meta"},J={key:0,class:"empty"};function V(t,e,a,V,H,T){const N=(0,s.g2)("base-meta"),B=(0,s.g2)("base-profile-wrapper");return(0,s.uX)(),(0,s.CE)(s.FK,null,[(0,s.bF)(N,{pageType:"admin"}),(0,s.bF)(B,{title:"Admin - Review Management"},{default:(0,s.k6)((()=>[(0,s.Lk)("div",r,[(0,s.Lk)("div",n,[(0,s.Lk)("div",o,[(0,s.Lk)("span",l,(0,i.v_)(T.stats.total),1),e[4]||(e[4]=(0,s.Lk)("span",{class:"stat-label"},"Total Reviews",-1))]),(0,s.Lk)("div",d,[(0,s.Lk)("span",u,(0,i.v_)(T.stats.avgRating),1),e[5]||(e[5]=(0,s.Lk)("span",{class:"stat-label"},"Avg Rating",-1))]),(0,s.Lk)("div",c,[(0,s.Lk)("span",p,(0,i.v_)(T.stats.reported),1),e[6]||(e[6]=(0,s.Lk)("span",{class:"stat-label"},"Reports",-1))]),(0,s.Lk)("div",g,[(0,s.Lk)("span",m,(0,i.v_)(T.stats.hidden),1),e[7]||(e[7]=(0,s.Lk)("span",{class:"stat-label"},"Hidden",-1))])]),(0,s.Lk)("div",k,[(0,s.Lk)("button",{class:(0,i.C4)({active:"all"===H.tab}),onClick:e[0]||(e[0]=t=>H.tab="all")},"All Reviews ("+(0,i.v_)(T.allReviews.length)+")",3),(0,s.Lk)("button",{class:(0,i.C4)({active:"reports"===H.tab}),onClick:e[1]||(e[1]=t=>H.tab="reports")},"Reports ("+(0,i.v_)(T.reports.length)+")",3),(0,s.Lk)("button",{class:(0,i.C4)({active:"humidor"===H.tab}),onClick:e[2]||(e[2]=t=>H.tab="humidor")},"Humidor Data",2),(0,s.Lk)("button",{class:(0,i.C4)({active:"journal"===H.tab}),onClick:e[3]||(e[3]=t=>H.tab="journal")},"Journal Data",2)]),"all"===H.tab?((0,s.uX)(),(0,s.CE)("div",h,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(T.allReviews,(t=>((0,s.uX)(),(0,s.CE)("div",{key:t.id,class:"admin-card"},[(0,s.Lk)("div",v,[(0,s.Lk)("strong",null,(0,i.v_)(t.displayName),1),e[8]||(e[8]=(0,s.eW)(" on ")),(0,s.Lk)("em",null,(0,i.v_)(t.productName||"Product #"+t.productId),1),(0,s.Lk)("span",L,(0,i.v_)("★".repeat(t.rating))+(0,i.v_)("☆".repeat(5-t.rating)),1)]),(0,s.Lk)("h5",null,(0,i.v_)(t.title),1),(0,s.Lk)("p",null,(0,i.v_)(t.body),1),(0,s.Lk)("div",y,[(0,s.Lk)("span",null,(0,i.v_)(T.formatDate(t.createdAt)),1),t.hidden?((0,s.uX)(),(0,s.CE)("span",f,"Hidden")):(0,s.Q3)("",!0),t.userId?((0,s.uX)(),(0,s.CE)("span",b,"User #"+(0,i.v_)(t.userId),1)):(0,s.Q3)("",!0)]),(0,s.Lk)("div",C,[t.hidden?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("button",{key:0,class:"btn-hide",onClick:e=>T.hideReview(t.id)},"Hide Review",8,w)),(0,s.Lk)("button",{class:"btn-delete",onClick:e=>T.deleteReview(t.id)},"Delete Permanently",8,E)])])))),128)),T.allReviews.length?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("p",_,"No community reviews yet."))])):(0,s.Q3)("",!0),"reports"===H.tab?((0,s.uX)(),(0,s.CE)("div",I,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(T.reports,(t=>((0,s.uX)(),(0,s.CE)("div",{key:t.id,class:"admin-card report"},[(0,s.Lk)("div",F,[e[9]||(e[9]=(0,s.Lk)("strong",null,"Report:",-1)),(0,s.eW)(" "+(0,i.v_)(t.reason),1)]),(0,s.Lk)("p",null,"Review ID: "+(0,i.v_)(t.reviewId)+" · Reporter: "+(0,i.v_)(t.reporterId)+" · "+(0,i.v_)(T.formatDate(t.createdAt)),1),(0,s.Lk)("div",X,[(0,s.Lk)("button",{class:"btn-hide",onClick:e=>T.hideReportedReview(t)},"Hide Review",8,A),(0,s.Lk)("button",{class:"btn-dismiss",onClick:e=>T.dismissReport(t.id)},"Dismiss Report",8,$)])])))),128)),T.reports.length?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("p",R,"No reports to review."))])):(0,s.Q3)("",!0),"humidor"===H.tab?((0,s.uX)(),(0,s.CE)("div",U,[(0,s.Lk)("h4",null,"Humidor Items ("+(0,i.v_)(T.humidorItems.length)+" entries, "+(0,i.v_)(T.humidorCount)+" total cigars)",1),((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(T.humidorItems,(t=>((0,s.uX)(),(0,s.CE)("div",{key:t.id,class:"admin-card"},[(0,s.Lk)("strong",null,(0,i.v_)(t.name),1),(0,s.eW)(" · Qty: "+(0,i.v_)(t.quantity)+" · Brand: "+(0,i.v_)(t.brand||"N/A")+" ",1),(0,s.Lk)("span",Q,"Added "+(0,i.v_)(T.formatDate(t.addedAt)),1)])))),128)),T.humidorItems.length?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("p",j,"No humidor data."))])):(0,s.Q3)("",!0),"journal"===H.tab?((0,s.uX)(),(0,s.CE)("div",P,[(0,s.Lk)("h4",null,"Journal Entries ("+(0,i.v_)(T.journalEntries.length)+")",1),((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(T.journalEntries,(t=>((0,s.uX)(),(0,s.CE)("div",{key:t.id,class:"admin-card"},[(0,s.Lk)("strong",null,(0,i.v_)(t.name),1),(0,s.eW)(" · Rating: "+(0,i.v_)(t.rating)+"/5 · "+(0,i.v_)(t.brand||"N/A")+" ",1),t.notes?((0,s.uX)(),(0,s.CE)("p",S,(0,i.v_)(t.notes),1)):(0,s.Q3)("",!0),(0,s.Lk)("span",D,(0,i.v_)(T.formatDate(t.createdAt)),1)])))),128)),T.journalEntries.length?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("p",J,"No journal data."))])):(0,s.Q3)("",!0)])])),_:1})],64)}var H={data(){return{tab:"all"}},computed:{allReviews(){return this.$store.getters["cigarlife/getAllReviews"]},reports(){return this.$store.getters["cigarlife/getReviewReports"]},stats(){return this.$store.getters["cigarlife/reviewStats"]},humidorItems(){return this.$store.getters["cigarlife/humidorItems"]},humidorCount(){return this.$store.getters["cigarlife/humidorCount"]},journalEntries(){return this.$store.getters["cigarlife/journalEntries"]}},methods:{hideReview(t){this.$store.dispatch("cigarlife/hideReview",t)},deleteReview(t){confirm("Permanently delete this review?")&&this.$store.dispatch("cigarlife/deleteReview",t)},hideReportedReview(t){this.$store.dispatch("cigarlife/hideReview",t.reviewId),this.$store.dispatch("cigarlife/dismissReport",t.id)},dismissReport(t){this.$store.dispatch("cigarlife/dismissReport",t)},formatDate(t){return t?new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):""}}},T=a(6262);const N=(0,T.A)(H,[["render",V],["__scopeId","data-v-09413cea"]]);var B=N},2668:function(t,e,a){a.r(e),a.d(e,{default:function(){return it}});var s=a(641),i=a(33),r=a(3751);const n={class:"journal-page"},o={class:"stats-bar"},l={class:"stat"},d={class:"stat-value"},u={class:"stat"},c={class:"stat-value"},p={class:"stat"},g={class:"stat-value"},m={class:"add-section"},k={key:0,class:"add-form"},h={class:"form-row"},v={class:"form-row"},L={class:"form-row rating-row"},y={class:"star-rating"},f=["onClick"],b={class:"form-row"},C={class:"form-row"},w={class:"form-row"},E={class:"form-row"},_={class:"form-row"},I={class:"file-upload-label"},F=["disabled"],X={key:1,class:"loading"},A={key:2,class:"journal-list"},$={class:"entry-header"},R=["onClick"],U=["src","alt"],Q=["onClick"],j=["onChange"],P={class:"entry-info"},S={class:"entry-name"},D={key:0,class:"entry-brand"},J={class:"entry-stars"},V={class:"entry-date"},H={key:1,class:"upload-status"},T={key:0,class:"entry-details"},N={class:"detail-tags"},B={key:0,class:"tag strength"},q={key:1,class:"tag wrapper"},K={key:2,class:"tag"},M={key:3,class:"tag"},W={key:0,class:"flavor-notes"},O={key:1,class:"pairing"},z={key:1,class:"entry-notes"},x={class:"entry-actions"},Y=["onClick"],G=["onClick"],Z={key:3,class:"empty-state"};function tt(t,e,a,tt,et,at){const st=(0,s.g2)("base-meta"),it=(0,s.g2)("base-profile-wrapper");return(0,s.uX)(),(0,s.CE)(s.FK,null,[(0,s.bF)(st,{pageType:"journal"}),(0,s.bF)(it,{title:"Cigar Journal"},{default:(0,s.k6)((()=>[(0,s.Lk)("div",n,[(0,s.Lk)("div",o,[(0,s.Lk)("div",l,[(0,s.Lk)("span",d,(0,i.v_)(at.stats.totalSmoked),1),e[13]||(e[13]=(0,s.Lk)("span",{class:"stat-label"},"Cigars Smoked",-1))]),(0,s.Lk)("div",u,[(0,s.Lk)("span",c,(0,i.v_)(at.stats.avgRating)+"/5",1),e[14]||(e[14]=(0,s.Lk)("span",{class:"stat-label"},"Avg Rating",-1))]),(0,s.Lk)("div",p,[(0,s.Lk)("span",g,(0,i.v_)(at.stats.favBrand),1),e[15]||(e[15]=(0,s.Lk)("span",{class:"stat-label"},"Top Brand",-1))])]),(0,s.Lk)("div",m,[(0,s.Lk)("button",{class:"btn-add",onClick:e[0]||(e[0]=t=>et.showAddForm=!et.showAddForm)},(0,i.v_)(et.showAddForm?"✕ Cancel":"+ Log a Smoke"),1)]),et.showAddForm?((0,s.uX)(),(0,s.CE)("div",k,[(0,s.Lk)("div",h,[(0,s.bo)((0,s.Lk)("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>et.entry.name=t),placeholder:"Cigar Name *",class:"form-input full"},null,512),[[r.Jo,et.entry.name]])]),(0,s.Lk)("div",v,[(0,s.bo)((0,s.Lk)("input",{"onUpdate:modelValue":e[2]||(e[2]=t=>et.entry.brand=t),placeholder:"Brand",class:"form-input"},null,512),[[r.Jo,et.entry.brand]]),(0,s.bo)((0,s.Lk)("select",{"onUpdate:modelValue":e[3]||(e[3]=t=>et.entry.wrapper=t),class:"form-input"},e[16]||(e[16]=[(0,s.Lk)("option",{value:""},"Wrapper",-1),(0,s.Lk)("option",null,"Connecticut",-1),(0,s.Lk)("option",null,"Maduro",-1),(0,s.Lk)("option",null,"Habano",-1),(0,s.Lk)("option",null,"Corojo",-1),(0,s.Lk)("option",null,"Oscuro",-1),(0,s.Lk)("option",null,"Cameroon",-1),(0,s.Lk)("option",null,"Sumatra",-1),(0,s.Lk)("option",null,"Candela",-1),(0,s.Lk)("option",null,"Other",-1)]),512),[[r.u1,et.entry.wrapper]])]),(0,s.Lk)("div",L,[e[17]||(e[17]=(0,s.Lk)("label",null,"Rating:",-1)),(0,s.Lk)("div",y,[((0,s.uX)(),(0,s.CE)(s.FK,null,(0,s.pI)(5,(t=>(0,s.Lk)("span",{key:t,class:(0,i.C4)(["star",{filled:t<=et.entry.rating}]),onClick:e=>et.entry.rating=t},"★",10,f))),64))])]),(0,s.Lk)("div",b,[(0,s.bo)((0,s.Lk)("select",{"onUpdate:modelValue":e[4]||(e[4]=t=>et.entry.strength=t),class:"form-input"},e[18]||(e[18]=[(0,s.Lk)("option",{value:""},"Strength",-1),(0,s.Lk)("option",null,"Mild",-1),(0,s.Lk)("option",null,"Mild-Medium",-1),(0,s.Lk)("option",null,"Medium",-1),(0,s.Lk)("option",null,"Medium-Full",-1),(0,s.Lk)("option",null,"Full",-1)]),512),[[r.u1,et.entry.strength]]),(0,s.bo)((0,s.Lk)("select",{"onUpdate:modelValue":e[5]||(e[5]=t=>et.entry.draw=t),class:"form-input"},e[19]||(e[19]=[(0,s.Lk)("option",{value:""},"Draw",-1),(0,s.Lk)("option",null,"Tight",-1),(0,s.Lk)("option",null,"Firm",-1),(0,s.Lk)("option",null,"Perfect",-1),(0,s.Lk)("option",null,"Loose",-1),(0,s.Lk)("option",null,"Very Loose",-1)]),512),[[r.u1,et.entry.draw]]),(0,s.bo)((0,s.Lk)("select",{"onUpdate:modelValue":e[6]||(e[6]=t=>et.entry.burn=t),class:"form-input"},e[20]||(e[20]=[(0,s.Lk)("option",{value:""},"Burn",-1),(0,s.Lk)("option",null,"Perfect",-1),(0,s.Lk)("option",null,"Slightly Uneven",-1),(0,s.Lk)("option",null,"Uneven",-1),(0,s.Lk)("option",null,"Needs Touch-ups",-1),(0,s.Lk)("option",null,"Canoeing",-1)]),512),[[r.u1,et.entry.burn]])]),(0,s.Lk)("div",C,[(0,s.bo)((0,s.Lk)("input",{"onUpdate:modelValue":e[7]||(e[7]=t=>et.entry.flavor=t),placeholder:"Flavor notes (leather, cedar, pepper...)",class:"form-input full"},null,512),[[r.Jo,et.entry.flavor]])]),(0,s.Lk)("div",w,[(0,s.bo)((0,s.Lk)("input",{"onUpdate:modelValue":e[8]||(e[8]=t=>et.entry.pairing=t),placeholder:"Paired with (coffee, bourbon, beer...)",class:"form-input full"},null,512),[[r.Jo,et.entry.pairing]])]),(0,s.Lk)("div",E,[(0,s.bo)((0,s.Lk)("textarea",{"onUpdate:modelValue":e[9]||(e[9]=t=>et.entry.notes=t),placeholder:"Your thoughts on this cigar...",class:"form-input full",rows:"3"},null,512),[[r.Jo,et.entry.notes]])]),(0,s.Lk)("div",_,[(0,s.Lk)("label",I,[(0,s.Lk)("span",null,(0,i.v_)(et.entryFile?et.entryFile.name:"📷 Add Photo"),1),(0,s.Lk)("input",{type:"file",accept:"image/*",onChange:e[10]||(e[10]=(...t)=>at.onEntryFile&&at.onEntryFile(...t)),hidden:""},null,32)])]),(0,s.Lk)("button",{class:"btn-save",onClick:e[11]||(e[11]=(...t)=>at.saveEntry&&at.saveEntry(...t)),disabled:!et.entry.name||et.saving},(0,i.v_)(et.saving?"Saving...":et.editingId?"Update Entry":"Save to Journal"),9,F)])):(0,s.Q3)("",!0),at.journalLoaded?at.journalEntries.length?((0,s.uX)(),(0,s.CE)("div",A,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(at.journalEntries,(t=>((0,s.uX)(),(0,s.CE)("div",{class:"journal-entry",key:t.id},[(0,s.Lk)("div",$,[t.image||t.thumbnail?((0,s.uX)(),(0,s.CE)("div",{key:0,class:"entry-image",onClick:e=>at.triggerImageUpload(t.id)},[(0,s.Lk)("img",{src:at.getImageUrl(t.thumbnail||t.image),alt:t.name},null,8,U),e[21]||(e[21]=(0,s.Lk)("div",{class:"image-overlay"},"📷",-1))],8,R)):((0,s.uX)(),(0,s.CE)("div",{key:1,class:"entry-image placeholder",onClick:e=>at.triggerImageUpload(t.id)},e[22]||(e[22]=[(0,s.Lk)("span",null,"📷",-1),(0,s.Lk)("div",{class:"upload-hint"},"Add Photo",-1)]),8,Q)),(0,s.Lk)("input",{type:"file",ref_for:!0,ref:"jupload_"+t.id,accept:"image/*",onChange:e=>at.onImageSelected(e,t.id),hidden:""},null,40,j),(0,s.Lk)("div",P,[(0,s.Lk)("h3",S,(0,i.v_)(t.name),1),t.brand?((0,s.uX)(),(0,s.CE)("p",D,(0,i.v_)(t.brand),1)):(0,s.Q3)("",!0),(0,s.Lk)("div",J,[((0,s.uX)(),(0,s.CE)(s.FK,null,(0,s.pI)(5,(e=>(0,s.Lk)("span",{key:e,class:(0,i.C4)(["star",{filled:e<=t.rating}])},"★",2))),64))]),(0,s.Lk)("span",V,(0,i.v_)(at.formatDate(t.createdAt)),1),et.uploadingId===t.id?((0,s.uX)(),(0,s.CE)("p",H,"Uploading photo...")):(0,s.Q3)("",!0)])]),t.strength||t.draw||t.burn||t.flavor?((0,s.uX)(),(0,s.CE)("div",T,[(0,s.Lk)("div",N,[t.strength?((0,s.uX)(),(0,s.CE)("span",B,(0,i.v_)(t.strength),1)):(0,s.Q3)("",!0),t.wrapper?((0,s.uX)(),(0,s.CE)("span",q,(0,i.v_)(t.wrapper),1)):(0,s.Q3)("",!0),t.draw?((0,s.uX)(),(0,s.CE)("span",K,"Draw: "+(0,i.v_)(t.draw),1)):(0,s.Q3)("",!0),t.burn?((0,s.uX)(),(0,s.CE)("span",M,"Burn: "+(0,i.v_)(t.burn),1)):(0,s.Q3)("",!0)]),t.flavor?((0,s.uX)(),(0,s.CE)("p",W,"🂠"+(0,i.v_)(t.flavor),1)):(0,s.Q3)("",!0),t.pairing?((0,s.uX)(),(0,s.CE)("p",O,"🥃 Paired with: "+(0,i.v_)(t.pairing),1)):(0,s.Q3)("",!0)])):(0,s.Q3)("",!0),t.notes?((0,s.uX)(),(0,s.CE)("p",z,(0,i.v_)(t.notes),1)):(0,s.Q3)("",!0),(0,s.Lk)("div",x,[(0,s.Lk)("button",{class:"btn-edit",onClick:e=>at.editEntry(t)},"Edit",8,Y),(0,s.Lk)("button",{class:"btn-delete",onClick:e=>at.deleteEntry(t.id)},"Delete",8,G)])])))),128))])):((0,s.uX)(),(0,s.CE)("div",Z,[e[23]||(e[23]=(0,s.Lk)("div",{class:"empty-icon"},"📓",-1)),e[24]||(e[24]=(0,s.Lk)("h3",null,"Your journal is empty",-1)),e[25]||(e[25]=(0,s.Lk)("p",null,"Start logging your smokes! Record tasting notes, ratings, and pairings to build your personal cigar history.",-1)),(0,s.Lk)("button",{class:"btn-browse",onClick:e[12]||(e[12]=t=>et.showAddForm=!0)},"Log Your First Cigar")])):((0,s.uX)(),(0,s.CE)("div",X,"Loading journal..."))])])),_:1})],64)}var et={data(){return{showAddForm:!1,editingId:null,saving:!1,uploadingId:null,entryFile:null,entry:this.freshEntry()}},computed:{journalEntries(){return this.$store.getters["cigarlife/journalEntries"]},stats(){return this.$store.getters["cigarlife/journalStats"]},journalLoaded(){return this.$store.state.cigarlife.journalLoaded}},mounted(){this.$store.dispatch("cigarlife/loadJournal");const t=this.journalEntries[0];!t||t.rating||t.notes||(this.editingId=t.id,this.entry={...t},this.showAddForm=!0)},methods:{freshEntry(){return{name:"",brand:"",wrapper:"",rating:0,strength:"",draw:"",burn:"",flavor:"",pairing:"",notes:""}},getImageUrl(t){return t?t.startsWith("http")?t:"https://hiscigar.com"+t:""},onEntryFile(t){const e=t.target.files[0];e&&(e.size>5242880?alert("Image must be under 5MB"):this.entryFile=e)},triggerImageUpload(t){const e=this.$refs["jupload_"+t];if(e){const t=Array.isArray(e)?e[0]:e;t.click()}},async onImageSelected(t,e){const a=t.target.files[0];if(a)if(a.size>5242880)alert("Image must be under 5MB.");else{this.uploadingId=e;try{await this.$store.dispatch("cigarlife/uploadJournalImage",{id:e,file:a})}catch(s){alert("Upload failed.")}this.uploadingId=null}},async saveEntry(){if(this.entry.name&&!this.saving){this.saving=!0;try{if(this.editingId)await this.$store.dispatch("cigarlife/updateJournalEntry",{id:this.editingId,updates:{...this.entry}}),this.entryFile&&await this.$store.dispatch("cigarlife/uploadJournalImage",{id:this.editingId,file:this.entryFile});else if(await this.$store.dispatch("cigarlife/addJournalEntry",{...this.entry}),this.entryFile&&this.journalEntries.length){const t=this.journalEntries[0];await this.$store.dispatch("cigarlife/uploadJournalImage",{id:t.id,file:this.entryFile})}this.entry=this.freshEntry(),this.editingId=null,this.entryFile=null,this.showAddForm=!1}catch(t){console.error("Save error:",t)}this.saving=!1}},editEntry(t){this.editingId=t.id,this.entry={...t},this.showAddForm=!0,window.scrollTo({top:0,behavior:"smooth"})},deleteEntry(t){confirm("Delete this journal entry?")&&this.$store.dispatch("cigarlife/removeJournalEntry",t)},formatDate(t){if(!t)return"";const e=new Date(t);return e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"})}}},at=a(6262);const st=(0,at.A)(et,[["render",tt],["__scopeId","data-v-c4d78056"]]);var it=st},7780:function(t,e,a){a.r(e),a.d(e,{default:function(){return x}});var s=a(641),i=a(33),r=a(3751);const n={class:"humidor-page"},o={class:"stats-bar"},l={class:"stat"},d={class:"stat-value"},u={class:"stat"},c={class:"stat-value"},p={class:"stat"},g={class:"stat-value"},m={class:"add-section"},k={key:0,class:"add-form"},h={class:"form-row"},v={class:"form-row"},L={class:"form-row"},y={class:"form-row"},f={class:"form-row"},b={class:"file-upload-label"},C=["disabled"],w={key:1,class:"loading"},E={key:2,class:"humidor-list"},_=["onClick"],I=["src","alt"],F=["onClick"],X=["onChange"],A={class:"item-details"},$={class:"item-name"},R={key:0,class:"item-brand"},U={class:"item-meta"},Q={key:0,class:"tag"},j={key:1,class:"tag"},P={class:"tag"},S={key:1,class:"item-notes"},D={key:2,class:"upload-status"},J={class:"item-actions"},V={class:"quantity-control"},H=["onClick","disabled"],T={class:"qty"},N=["onClick"],B=["onClick"],q=["onClick"],K={key:3,class:"empty-state"};function M(t,e,a,M,W,O){const z=(0,s.g2)("base-meta"),x=(0,s.g2)("router-link"),Y=(0,s.g2)("base-profile-wrapper");return(0,s.uX)(),(0,s.CE)(s.FK,null,[(0,s.bF)(z,{pageType:"humidor"}),(0,s.bF)(Y,{title:"My Humidor"},{default:(0,s.k6)((()=>[(0,s.Lk)("div",n,[(0,s.Lk)("div",o,[(0,s.Lk)("div",l,[(0,s.Lk)("span",d,(0,i.v_)(O.stats.totalCigars),1),e[9]||(e[9]=(0,s.Lk)("span",{class:"stat-label"},"Total Cigars",-1))]),(0,s.Lk)("div",u,[(0,s.Lk)("span",c,(0,i.v_)(O.stats.uniqueBrands),1),e[10]||(e[10]=(0,s.Lk)("span",{class:"stat-label"},"Brands",-1))]),(0,s.Lk)("div",p,[(0,s.Lk)("span",g,"$"+(0,i.v_)(O.stats.totalValue.toFixed(2)),1),e[11]||(e[11]=(0,s.Lk)("span",{class:"stat-label"},"Est. Value",-1))])]),(0,s.Lk)("div",m,[(0,s.Lk)("button",{class:"btn-add",onClick:e[0]||(e[0]=t=>W.showAddForm=!W.showAddForm)},(0,i.v_)(W.showAddForm?"✕ Cancel":"+ Add Cigar"),1)]),W.showAddForm?((0,s.uX)(),(0,s.CE)("div",k,[(0,s.Lk)("div",h,[(0,s.bo)((0,s.Lk)("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>W.newCigar.name=t),placeholder:"Cigar Name *",class:"form-input full"},null,512),[[r.Jo,W.newCigar.name]])]),(0,s.Lk)("div",v,[(0,s.bo)((0,s.Lk)("input",{"onUpdate:modelValue":e[2]||(e[2]=t=>W.newCigar.brand=t),placeholder:"Brand",class:"form-input"},null,512),[[r.Jo,W.newCigar.brand]]),(0,s.bo)((0,s.Lk)("input",{"onUpdate:modelValue":e[3]||(e[3]=t=>W.newCigar.quantity=t),type:"number",min:"1",placeholder:"Qty",class:"form-input small"},null,512),[[r.Jo,W.newCigar.quantity,void 0,{number:!0}]])]),(0,s.Lk)("div",L,[(0,s.bo)((0,s.Lk)("input",{"onUpdate:modelValue":e[4]||(e[4]=t=>W.newCigar.price=t),type:"number",step:"0.01",placeholder:"Price ($)",class:"form-input"},null,512),[[r.Jo,W.newCigar.price,void 0,{number:!0}]]),(0,s.bo)((0,s.Lk)("select",{"onUpdate:modelValue":e[5]||(e[5]=t=>W.newCigar.wrapper=t),class:"form-input"},e[12]||(e[12]=[(0,s.Lk)("option",{value:""},"Wrapper",-1),(0,s.Lk)("option",null,"Connecticut",-1),(0,s.Lk)("option",null,"Maduro",-1),(0,s.Lk)("option",null,"Habano",-1),(0,s.Lk)("option",null,"Corojo",-1),(0,s.Lk)("option",null,"Oscuro",-1),(0,s.Lk)("option",null,"Cameroon",-1),(0,s.Lk)("option",null,"Sumatra",-1),(0,s.Lk)("option",null,"Candela",-1),(0,s.Lk)("option",null,"Other",-1)]),512),[[r.u1,W.newCigar.wrapper]])]),(0,s.Lk)("div",y,[(0,s.bo)((0,s.Lk)("textarea",{"onUpdate:modelValue":e[6]||(e[6]=t=>W.newCigar.notes=t),placeholder:"Notes (aging, occasion, etc.)",class:"form-input full",rows:"2"},null,512),[[r.Jo,W.newCigar.notes]])]),(0,s.Lk)("div",f,[(0,s.Lk)("label",b,[(0,s.Lk)("span",null,(0,i.v_)(W.newCigarFile?W.newCigarFile.name:"📷 Add Photo"),1),(0,s.Lk)("input",{type:"file",accept:"image/*",onChange:e[7]||(e[7]=(...t)=>O.onNewCigarFile&&O.onNewCigarFile(...t)),hidden:""},null,32)])]),(0,s.Lk)("button",{class:"btn-save",onClick:e[8]||(e[8]=(...t)=>O.addCigar&&O.addCigar(...t)),disabled:!W.newCigar.name||W.adding},(0,i.v_)(W.adding?"Adding...":"Add to Humidor"),9,C)])):(0,s.Q3)("",!0),O.humidorLoaded?O.humidorItems.length?((0,s.uX)(),(0,s.CE)("div",E,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(O.humidorItems,(t=>((0,s.uX)(),(0,s.CE)("div",{class:"humidor-item",key:t.id},[t.image||t.thumbnail?((0,s.uX)(),(0,s.CE)("div",{key:0,class:"item-image",onClick:e=>O.triggerImageUpload(t.id)},[(0,s.Lk)("img",{src:O.getImageUrl(t.thumbnail||t.image),alt:t.name},null,8,I),e[13]||(e[13]=(0,s.Lk)("div",{class:"image-overlay"},"📷",-1))],8,_)):((0,s.uX)(),(0,s.CE)("div",{key:1,class:"item-image placeholder",onClick:e=>O.triggerImageUpload(t.id)},e[14]||(e[14]=[(0,s.Lk)("span",null,"📷",-1),(0,s.Lk)("div",{class:"upload-hint"},"Add Photo",-1)]),8,F)),(0,s.Lk)("input",{type:"file",ref_for:!0,ref:"upload_"+t.id,accept:"image/*",onChange:e=>O.onImageSelected(e,t.id),hidden:""},null,40,X),(0,s.Lk)("div",A,[(0,s.Lk)("h3",$,(0,i.v_)(t.name),1),t.brand?((0,s.uX)(),(0,s.CE)("p",R,(0,i.v_)(t.brand),1)):(0,s.Q3)("",!0),(0,s.Lk)("div",U,[t.wrapper?((0,s.uX)(),(0,s.CE)("span",Q,(0,i.v_)(t.wrapper),1)):(0,s.Q3)("",!0),t.price?((0,s.uX)(),(0,s.CE)("span",j,"$"+(0,i.v_)(t.price),1)):(0,s.Q3)("",!0),(0,s.Lk)("span",P,"Added "+(0,i.v_)(O.formatDate(t.addedAt)),1)]),t.notes?((0,s.uX)(),(0,s.CE)("p",S,(0,i.v_)(t.notes),1)):(0,s.Q3)("",!0),W.uploadingId===t.id?((0,s.uX)(),(0,s.CE)("p",D,"Uploading photo...")):(0,s.Q3)("",!0)]),(0,s.Lk)("div",J,[(0,s.Lk)("div",V,[(0,s.Lk)("button",{onClick:e=>O.updateQty(t,-1),disabled:t.quantity<=1},"−",8,H),(0,s.Lk)("span",T,(0,i.v_)(t.quantity||1),1),(0,s.Lk)("button",{onClick:e=>O.updateQty(t,1)},"+",8,N)]),(0,s.Lk)("button",{class:"btn-smoke",onClick:e=>O.smokeOne(t)},"Smoke One 🔥",8,B),(0,s.Lk)("button",{class:"btn-remove",onClick:e=>O.removeItem(t.id)},"Remove",8,q)])])))),128))])):((0,s.uX)(),(0,s.CE)("div",K,[e[16]||(e[16]=(0,s.Lk)("div",{class:"empty-icon"},"🗄ï¸",-1)),e[17]||(e[17]=(0,s.Lk)("h3",null,"Your humidor is empty",-1)),e[18]||(e[18]=(0,s.Lk)("p",null,'Start building your collection! Browse cigars and click "Add to Humidor" on any product, or add manually above.',-1)),(0,s.bF)(x,{to:"/categories/1-cigars",class:"btn-browse"},{default:(0,s.k6)((()=>e[15]||(e[15]=[(0,s.eW)("Browse Cigars")]))),_:1})])):((0,s.uX)(),(0,s.CE)("div",w,"Loading humidor..."))])])),_:1})],64)}a(4114);var W={data(){return{showAddForm:!1,adding:!1,uploadingId:null,newCigar:{name:"",brand:"",quantity:1,price:null,wrapper:"",notes:""},newCigarFile:null}},computed:{humidorItems(){return this.$store.getters["cigarlife/humidorItems"]},stats(){return this.$store.getters["cigarlife/humidorStats"]},humidorLoaded(){return this.$store.state.cigarlife.humidorLoaded}},mounted(){this.$store.dispatch("cigarlife/loadHumidor")},methods:{getImageUrl(t){return t?t.startsWith("http")?t:"https://hiscigar.com"+t:""},onNewCigarFile(t){const e=t.target.files[0];e&&(e.size>5242880?alert("Image must be under 5MB"):this.newCigarFile=e)},async addCigar(){if(this.newCigar.name&&!this.adding){this.adding=!0;try{if(await this.$store.dispatch("cigarlife/addToHumidor",{...this.newCigar}),this.newCigarFile&&this.humidorItems.length){const t=this.humidorItems[this.humidorItems.length-1];await this.$store.dispatch("cigarlife/uploadHumidorImage",{id:t.id,file:this.newCigarFile})}this.newCigar={name:"",brand:"",quantity:1,price:null,wrapper:"",notes:""},this.newCigarFile=null,this.showAddForm=!1}catch(t){console.error("Add cigar error:",t)}this.adding=!1}},triggerImageUpload(t){const e=this.$refs["upload_"+t];if(e){const t=Array.isArray(e)?e[0]:e;t.click()}},async onImageSelected(t,e){const a=t.target.files[0];if(a)if(a.size>5242880)alert("Image must be under 5MB. Please choose a smaller file.");else{this.uploadingId=e;try{await this.$store.dispatch("cigarlife/uploadHumidorImage",{id:e,file:a})}catch(s){alert("Upload failed. Please try again.")}this.uploadingId=null}},updateQty(t,e){const a=(t.quantity||1)+e;a<1||this.$store.dispatch("cigarlife/updateHumidorItem",{id:t.id,updates:{quantity:a}})},smokeOne(t){const e=(t.quantity||1)-1;e<=0?this.$store.dispatch("cigarlife/removeFromHumidor",t.id):this.$store.dispatch("cigarlife/updateHumidorItem",{id:t.id,updates:{quantity:e}}),this.$store.dispatch("cigarlife/addJournalEntry",{name:t.name,brand:t.brand,productId:t.productId,image:t.image,wrapper:t.wrapper,rating:0,notes:"",pairing:"",flavor:"",draw:"",burn:"",strength:""}),this.$router.push("/journal")},removeItem(t){confirm("Remove this cigar from your humidor?")&&this.$store.dispatch("cigarlife/removeFromHumidor",t)},formatDate(t){if(!t)return"";const e=new Date(t);return e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}}},O=a(6262);const z=(0,O.A)(W,[["render",M],["__scopeId","data-v-0810a280"]]);var x=z},5241:function(t,e,a){a.r(e),a.d(e,{default:function(){return u}});var s=a(641);const i={key:0,class:"blank-products"};function r(t,e,a,r,n,o){const l=(0,s.g2)("base-meta"),d=(0,s.g2)("products-list"),u=(0,s.g2)("base-profile-wrapper"),c=(0,s.g2)("test-ads-banner");return(0,s.uX)(),(0,s.CE)(s.FK,null,[(0,s.bF)(l,{pageType:"orderhistory"}),(0,s.bF)(u,{title:"recently viewed"},{default:(0,s.k6)((()=>[o.productsList?((0,s.uX)(),(0,s.Wv)(d,{key:1,onlyList:!0,orderHistory:!0,countTitle:o.countProducts,products:o.productsList,count:o.productsList.count,deleteSvg:"delete-svg",reload:!0},null,8,["countTitle","products","count"])):((0,s.uX)(),(0,s.CE)("div",i,e[0]||(e[0]=[(0,s.Lk)("div",{class:"image"},null,-1),(0,s.Lk)("h2",{class:"title"},"no data to display",-1)])))])),_:1}),(0,s.bF)(c,{type:"footer"})],64)}var n=a(9371),o={components:{ProductsList:n.A},computed:{productsList(){return this.$store.getters.orderHistory},countProducts(){return this.productsList?this.productsList.count+" products added":"0 products added"}}},l=a(6262);const d=(0,l.A)(o,[["render",r],["__scopeId","data-v-504095a5"]]);var u=d},9531:function(t,e,a){a.r(e),a.d(e,{default:function(){return l}});var s=a(641);function i(t,e,a,i,r,n){const o=(0,s.g2)("base-meta"),l=(0,s.g2)("profile"),d=(0,s.g2)("base-profile-wrapper"),u=(0,s.g2)("test-ads-banner");return(0,s.uX)(),(0,s.CE)(s.FK,null,[(0,s.bF)(o,{pageType:"profile"}),(0,s.bF)(d,{title:"my profile"},{default:(0,s.k6)((()=>[(0,s.bF)(l)])),_:1}),(0,s.bF)(u,{type:"footer"})],64)}var r={components:{Profile:(0,s.$V)((()=>a.e(613).then(a.bind(a,2642))))}},n=a(6262);const o=(0,n.A)(r,[["render",i],["__scopeId","data-v-b164f80e"]]);var l=o},1772:function(t,e,a){a.r(e),a.d(e,{default:function(){return p}});var s=a(641);const i={key:0,class:"blank-products"},r={class:"pagination"};function n(t,e,a,n,o,l){const d=(0,s.g2)("base-meta"),u=(0,s.g2)("products-list"),c=(0,s.g2)("base-profile-wrapper"),p=(0,s.g2)("pagination"),g=(0,s.g2)("test-ads-banner");return(0,s.uX)(),(0,s.CE)(s.FK,null,[(0,s.bF)(d,{pageType:"wishlist"}),(0,s.bF)(c,{title:"wishlist"},{default:(0,s.k6)((()=>[l.productsList?((0,s.uX)(),(0,s.Wv)(u,{key:1,onlyList:!0,showCount:!0,countTitle:l.countProducts,products:l.productsList.products,count:l.productsList.count,reload:!0,withoutPaginate:""},null,8,["countTitle","products","count"])):((0,s.uX)(),(0,s.CE)("div",i,e[1]||(e[1]=[(0,s.Lk)("div",{class:"image"},null,-1),(0,s.Lk)("h2",{class:"title"},"no data to display",-1)])))])),_:1}),(0,s.Lk)("div",r,[l.productsList.count?((0,s.uX)(),(0,s.Wv)(p,{key:0,modelValue:o.page,"onUpdate:modelValue":e[0]||(e[0]=t=>o.page=t),records:l.productsList.count,"per-page":15,options:o.options,onPaginate:l.loadProducts},null,8,["modelValue","records","options","onPaginate"])):(0,s.Q3)("",!0)]),(0,s.bF)(g,{type:"footer"})],64)}var o=a(9371),l=a(4497),d={components:{ProductsList:o.A},data(){return{page:1,options:Object.freeze({template:l.A,edgeNavigation:!0,texts:{first:"<<",last:">>"}})}},computed:{productsList(){return this.$store.getters.wishList},countProducts(){return this.productsList?this.productsList.count+" products added":"0 products added"},sorting(){return this.$store.getters.sorting}},watch:{sorting(t,e){t&&t!==e&&this.loadProducts()}},methods:{loadProducts(){let t="&sort_column=favorite_at&sort_type=desc";this.sorting&&(t=this.sorting),this.$store.dispatch("loadWishlist","&page="+this.page+t)}}},u=a(6262);const c=(0,u.A)(d,[["render",n],["__scopeId","data-v-aeadc93c"]]);var p=c}}]);
//# sourceMappingURL=profile-pages.589255c8.js.map