1import{w as ie,r as _,u as a,o as fa,s as ga,e as pt,i as V,j as se,F as va,c as K,z as ya,Y as ft,d as Le,G as ha,h as ba,p as gt,l as C,k as vt,f as Ca}from"./vendor-vue-ugSA5z41.js";import{a as he,c as be,b as yt,u as Nt,t as ht,v as Sa,w as Ne,x as Ae,y as _a,z as wa,A as Ea}from"./toastMessages-D0rMr6Ad.js";import{_ as Pa}from"./ModuleViewLayout-BGuUlP39.js";import{M as ka}from"./ModuleFilters-tAryMYpF.js";import{M as Da}from"./ModuleFiltersModal-DpQd5flp.js";import{u as Fa,a as Ma,b as La,V as Oa,M as xa,c as Ta,p as Ia,d as Na,e as Aa,f as za,g as Ba,m as Ra,h as Ua}from"./useSearchWithQueryParam-BbkhjI_F.js";import{u as Va,M as Ka}from"./useModuleBulkEdit-kFTEnwcu.js";import{u as qa,M as Ga,a as Ha,c as $a}from"./useModulePrintOverlay-BxcjKkln.js";import{M as Ya}from"./ModuleBulkEditGrid-DgSMtw6A.js";import{K as ja,bm as At,bc as bt,J as zt,I as Za,bn as ze,bo as Qa,bp as Wa,bq as Xa,br as Ja,bs as er,_ as tr,E as or,F as nr,h as ar,u as rr,bt as le,bu as sr,bv as lr,bw as Ce,bx as Oe,o as ir,k as Ct,A as St,j as _t,by as ur,bz as cr}from"./index-BE6tbDiz.js";import{D as dr}from"./DeleteConfirmationModal-Ceb9T7GA.js";import{e as mr,u as pr,f as fr,d as gr,A as vr}from"./useSeedlingForm-CLqlvaev.js";import{b as yr,s as Bt,a as hr,t as br,i as Cr,T as Sr,P as _r,e as wt}from"./photoExportCore-hMbusRX0.js";import{P as wr}from"./PhotoLimitModal-CJ11nPrc.js";import Et from"./UpgradeModal-C5RoTkch.js";import{T as Er}from"./ToastNotification-D20fytGj.js";import{G as Pr}from"./GalleryPopup-Bxs30OD9.js";import{u as kr}from"./useToast-B0l-XRWP.js";import{u as Dr}from"./usePagination-Dn78HP-9.js";import{i as Fr,r as me,g as Mr,u as Lr}from"./inlineFieldMutation-C7gncAU3.js";import{u as Or}from"./useSorting-Dk_Cs2oJ.js";import{u as xr}from"./useModuleEntitlement-5f6M_uD8.js";import{u as Tr}from"./useMetricSystem-DLgQcoG3.js";import{r as Pt,m as Ir,c as Nr}from"./unitConversionUtils-C3Z6YxqX.js";import{u as Ar}from"./useInlineEdit-WzXgu5Gb.js";import{u as zr}from"./useTabNavigation-UEcadPUw.js";import{u as Br}from"./useDeleteConfirmation-DpccdZUi.js";import{a as Rr,e as Ur}from"./varietySearchUtils-B7e2G8Gn.js";import{u as Vr}from"./usePhotoManagement-Bg02Cn3z.js";import{d as Kr,b as qr}from"./adsColorShadeTokens-DnxEjMYc.js";import{u as kt}from"./supabaseRowMutation-COHO3Qy3.js";import{b as Gr}from"./bulkDeleteConfirmation-DboTJt1k.js";import{u as Hr}from"./useVarietyNames-ogIN51Et.js";import{u as $r}from"./useUserMasterLists-BcY1m00K.js";import{U as Dt}from"./userActionService-2jBsxkwp.js";import"./SideNav-BdLJ9e9a.js";import"./useInAppModuleNav-CxnoYwsr.js";import"./InventoryModuleNavigation-IMX2qAuD.js";import"./hybridizing-CAjTpHRU.js";import"./exhibit-BnmrI-1a.js";import"./SearchBar-BtO2Vlx0.js";import"./SearchBarWithSuggestions-DGu_SjAa.js";import"./fuse-Ch1WBRTM.js";import"./PaginationControls-C3Vjky2K.js";import"./BottomPagination-BNIxqtY_.js";import"./EmptyState-BEX1ZhCz.js";import"./FilterAdsColorShadeSelect-B-v50WfY.js";import"./AdsColorShadePicker-CQpc71FD.js";import"./dahliaColorSwatches-DBTrXar7.js";import"./FilterSelect-BJT--NCe.js";import"./FilterToggleButton-8b8SY7VF.js";import"./ExpandCaret-BtUhMsTh.js";import"./search-RHthSusW.js";import"./squarespace-Cg50zv7P.js";import"./shopify-Dj_v-Wkq.js";import"./formImages-BxceXRMa.js";import"./resized-BA-aiiz_LED.js";import"./masterListLimits-Cg2jJRHx.js";import"./inventoryCustomFields-pTXUO-bx.js";import"./NumberCell-B9L2fuQg.js";import"./main-Xf0gchZB.js";import"./TagInput-Dy65cblh.js";import"./InlineDropdown-Hm7YtOMq.js";import"./AdsTooltip-BzwCPGVE.js";import"./PlantTypeIcons-BkkF9pCF.js";import"./tubers-BxFfsXMZ.js";import"./cuttings-Buk2pU-i.js";import"./ToggleSwitch-Ctlq1---.js";import"./ads-registered-BT0_cMu0.js";import"./DahliaAutocomplete-BL7XToeY.js";import"./printingBodyClass-D0Bx2-L4.js";import"./vendor-supabase-B6vtjUvU.js";import"./inventoryVarietyFormSave-BaCXrpoa.js";import"./imageUtils-CwB-vkvr.js";import"./ImageCropModal-FW03lsmV.js";import"./AdsColorDescChips-BQ0N0EDT.js";import"./communityPhotos-BN1-mW84.js";import"./ImageUpload-DdDNRJVr.js";import"./PhotoGallery-Bu0XlXC4.js";/* empty css */import"./useLockedViewportHe
1ight-2nqaB71R.js";import"./useVarietyPhotoSync-C8ndKikn.js";import"./plannerV2State-C0DUt9au.js";const Rt={name:"name",height:"height",bloomSize:"bloom_size",adsSize:"ads_size",adsForm:"ads_form",adsColor:"ads_color",adsColorDescFull:"ads_color_desc_full",adsClass:"ads_class",myColors:"my_colors",year:"year",locations:"planting_locations",plantingLocations:"planting_locations",storageLocations:"storage_locations",parent1:"parent_1",parent2:"parent_2",grandparent1A:"grandparent_1a",grandparent1B:"grandparent_1b",grandparent2A:"grandparent_2a",grandparent2B:"grandparent_2b",seedCollected:"seed_collected",pollinated:"pollinated",datePollinated:"date_pollinated",keeping:"keeping",plantHabit:"plant_habit",plants:"plant_count",tubersPerSeedling:"tubers_per_seedling",tuberProduction:"tuber_production",vaseLife:"vase_life",vitality:"vitality",stemStrength:"stem_strength",notes:"notes",description:"description",isArchived:"is_archived",createdAt:"created_at",updatedAt:"updated_at"},Yr=new Set(["height","bloomSize","plants","tubersPerSeedling"]),jr=new Set(["seedCollected","pollinated","keeping","isArchived"]),Be=n=>Yr.has(n),Zr=n=>jr.has(n);function Qr(n,s,l){const e=_(null);async function i(){const d=typeof l.value=="function"?l.value:null,b=s.value;if(!d||!b){e.value=null;return}const r=d();if(!r){e.value=null;return}const{count:v,error:S}=await r.from("seedlings").select("*",{count:"exact",head:!0}).eq("email",b).eq("is_archived",!1);if(S){console.error("[useSeedlingCount]",S),e.value=null;return}e.value=v??0}return ie(()=>[n.value,s.value,l.value],()=>{if(!n.value||!s.value||typeof l.value!="function"){e.value=null;return}i()},{immediate:!0}),{count:e,fetchCount:i}}function Wr(n){return`"${String(n??"").replace(/"/g,'""')}"`}function Ft(n,s){const l=Wr(s);return n.map(e=>`${e}.eq.${l}`).join(",")}const xe=1e3,Xr="parent_1, parent_2, grandparent_1a, grandparent_1b, grandparent_2a, grandparent_2b";function Jr(n){return{parent1:n.parent_1,parent2:n.parent_2,grandparent1A:n.grandparent_1a,grandparent1B:n.grandparent_1b,grandparent2A:n.grandparent_2a,grandparent2B:n.grandparent_2b}}async function es(n,s){if(!n||!s)return{parentOptions:[],grandparentOptions:[]};const l=[];let e=0,i=!0;for(;i;){const{data:d,error:b}=await n.from("seedlings").select(Xr).eq("email",s).range(e,e+xe-1);if(b)throw b;d!=null&&d.length?(l.push(...d),i=d.length>=xe,e+=xe):i=!1}return mr(l.map(Jr))}const Te=1e3;function Ut(n){return{...ja(n),createdAt:n.created_at,updatedAt:n.updated_at}}function Vt(n,{email:s,searchQuery:l="",filters:e={},sortColumn:i="",sortDirection:d="asc"},{count:b}={}){let r=n.from("seedlings").select("*",b?{count:b}:void 0).eq("email",s);const v=String(l??"").trim();if(v&&(r=Rr(r,Ur(v))),e.year&&(r=r.eq("year",parseInt(e.year,10))),e.keeping==="yes"?r=r.eq("keeping",!0):e.keeping==="no"&&(r=r.eq("keeping",!1)),e.seedCollected==="yes"?r=r.eq("seed_collected",!0):e.seedCollected==="no"&&(r=r.eq("seed_collected",!1)),e.pollinated==="yes"?r=r.eq("pollinated",!0):e.pollinated==="no"&&(r=r.eq("pollinated",!1)),e.parent&&(r=r.or(Ft(["parent_1","parent_2"],e.parent))),e.grandparent&&(r=r.or(Ft(["grandparent_1a","grandparent_1b","grandparent_2a","grandparent_2b"],e.grandparent))),e.plantingLocation&&(r=r.contains("planting_locations",[e.plantingLocation])),e.storageLocation&&(r=r.contains("storage_locations",[e.storageLocation])),e.tuberProduction&&(r=r.eq("tuber_production",parseInt(e.tuberProduction,10))),e.vaseLife&&(r=r.eq("vase_life",parseInt(e.vaseLife,10))),e.vitality&&(r=r.eq("vitality",parseInt(e.vitality,10))),e.stemStrength&&(r=r.eq("stem_strength",parseInt(e.stemStrength,10))),e.adsSize&&(r=r.eq("ads_size",e.adsSize)),e.adsForm&&(r=r.eq("ads_form",e.adsForm)),e.adsColor&&(r=r.eq("ads_color",e.adsColor)),e.archived==="yes"?r=r.eq("is_archived",!0):e.archived==="no"&&(r=r.eq("is_archived",!1)),i){const S=Rt[i]||i;r=r.order(S,{ascending:d==="asc"})}else r=r.order("created_at",{ascending:!1});return r}async function Mt(n,{email:s,searchQuery:l="",filters:e={},sortColumn:i="",sortDirection:d="asc",currentPage:b=1,itemsPerPage:r=25}){const v=Math.max(1,Number(r)||1);let k=(Math.max(1,Number(b)||1)-1)*v,L=[],A=!0;for(;A;){const M=Vt(n,{email:s,searchQuery:l,filters:e,sortColumn:i,sortDirection:d}).range(k,k+Te-1),{data:O,error:z}=await M;if(z)throw z;O!=null&&O.length?(L=[...L,...O.map(Ut)],A=O.length>=Te,k+=Te):A=!1}return L}function ts(n={}){const{itemsPerPage:s=25,searchQuery:l=_(""),filters:e=_({}),sortColumn:i=_(""),sortDirection:d=_("asc"),currentPage:b=_(1),email:r=_(""),getAuthenticatedSupabase:v=null}=n,S=typeof s=="object"&&s!==null&&"value"in s?s:_(s),k=_([]),L=_([]),A=_(!0),M=_(null),O=_(0),z=_([]),x=_([]),q=async()=>
1{if(!(v!=null&&v())||!r.value){z.value=[],x.value=[];return}try{const F=await es(v(),r.value);z.value=F.parentOptions,x.value=F.grandparentOptions}catch(F){console.error("Error loading genealogy filter options:",F)}},$=async()=>{if(!(v!=null&&v())){console.warn("No authenticated Supabase client - cannot fetch seedlings"),A.value=!1;return}if(!r.value){console.warn("No email provided - cannot fetch seedlings"),A.value=!1;return}try{A.value=!0,M.value=null;const F=a(S),m=(b.value-1)*F,u=m+F-1,y=Vt(v(),{email:r.value,searchQuery:l.value,filters:e.value,sortColumn:i.value,sortDirection:d.value},{count:"exact"}).range(m,u),{data:p,error:c,count:h}=await y;if(c)throw c;k.value=(p||[]).map(Ut),O.value=h||0,Mt(v(),{email:r.value,searchQuery:l.value,filters:e.value,sortColumn:i.value,sortDirection:d.value,currentPage:1,itemsPerPage:F}).then(w=>{L.value=w}).catch(w=>{console.error("Error loading seedling count metrics:",w),L.value=[]})}catch(F){console.error("Error loading seedlings:",F),M.value=F.message,k.value=[],L.value=[],O.value=0}finally{A.value=!1}},H=async()=>!(v!=null&&v())||!r.value?[]:Mt(v(),{email:r.value,searchQuery:l.value,filters:e.value,sortColumn:i.value,sortDirection:d.value,currentPage:b.value,itemsPerPage:a(S)});return ie(S,()=>{$()}),{seedlings:k,filteredSeedlingsForMetrics:L,isLoading:A,loadError:M,totalCount:O,parentOptions:z,grandparentOptions:x,fetchSeedlings:$,fetchSeedlingsForPrint:H,fetchGenealogyFilterOptions:q}}
1const Kt=new Set(["myColors","plantingLocations","storageLocations"]),Lt=new Set(["adsSize","adsForm","adsColor"]);function os(n,s,l){const e=s==="adsSize"?l:(n==null?void 0:n.adsSize)??"",i=s==="adsForm"?l:(n==null?void 0:n.adsForm)??"",d=s==="adsColor"?l:(n==null?void 0:n.adsColor)??"";return zt(Za({adsSize:e,adsForm:i,adsColor:d}))}function ns(n,s){if(Kt.has(n)){const e=typeof s=="string"?s.split(",").map(d=>d.trim()).filter(Boolean):Array.isArray(s)?s:[];return{dbValue:e.length>0?e:null,localValue:e}}if(Zr(n)){const e=s===!0||s==="Yes"||s==="yes";return{dbValue:e,localValue:e}}if(Be(n)){if(s===""||s===null||s===void 0)return{dbValue:null,localValue:null};const e=Number.parseFloat(s),i=Number.isNaN(e)?null:e;return{dbValue:i,localValue:i}}if(n==="name"){const e=s??"";return{dbValue:e,localValue:e}}if(s==="")return{dbValue:null,localValue:""};const l=At(n,s);return{dbValue:l,localValue:l}}function as(n,s,l){if(Kt.has(l)){const e=Array.isArray(n)?n:[],i=Array.isArray(s)?s:[];return e.length!==i.length?!1:e.every((d,b)=>d===i[b])}return n===s||n==null&&s==null?!0:typeof n=="number"&&typeof s=="number"?n===s:String(n??"")===String(s??"")}function Ot(n){return n?typeof n=="object"&&n!==null&&"value"in n?n.value??"":String(n??""):""}const xt="Could not save â this item may have been deleted or changed elsewhere.";function rs(n={}){const{getAuthenticatedSupabase:s,email:l,showToastNotification:e,cancelEdit:i,onAfterSuccessfulFieldSave:d}=n,b=Mr();function r(m,u,y){return y==null?!0:b.shouldApply(m,u,y)}const v=async(m,u,y,p,{silent:c=!1,suppressPostSaveCallback:h=!1,localValue:w=y,mutationToken:E=null}={})=>{if(!(s!=null&&s()))return c||e==null||e(he,"error"),i==null||i(),!1;const U=Ot(l);if(!U)return c||e==null||e(he,"error"),i==null||i(),!1;try{const P=Rt[u]||u,f=p.find(I=>I.id===m);let T={[P]:y};if(u==="adsColorDescFull"){const I=bt(y);T={ads_color_desc_full:I.adsColorDescFull||null,ads_color_desc_1:I.adsColorDesc1,ads_color_desc_2:I.adsColorDesc2,ads_color_desc_3:I.adsColorDesc3,ads_color_desc_4:I.adsColorDesc4}}else if(Lt.has(u))T.ads_class=os(f,u,y);else if(u==="adsClass"){const I=zt(y);T.ads_class=I,T[P]=I}const pe=await kt(s().from("seedlings").update(T).eq("id",m).eq("email",U).select("id").maybeSingle());if(!pe.ok){if(!c){const I=pe.code==="not_found"?xt:be;e==null||e(I,"error")}return!1}if(!r(m,u,E))return!0;if(f)if(u==="adsColorDescFull"){const I=bt(y);f.adsColorDescFull=I.adsColorDescFull||"",f.adsColorDesc1=I.adsColorDesc1||"",f.adsColorDesc2=I.adsColorDesc2||"",f.adsColorDesc3=I.adsColorDesc3||"",f.adsColorDesc4=I.adsColorDesc4||""}else u==="adsClass"?f.adsClass=T.ads_class??"":(f[u]=w,Lt.has(u)&&(f.adsClass=T.ads_class??""));return u!=="isArchived"&&!c&&(e==null||e(yt,"success")),u!=="isArchived"&&!h&&d&&d({field:u}),!0}catch(P){return console.error("Error saving field:",P),c||e==null||e(be,"error"),!1}};return{saveTextEdit:async(m,u,y,p)=>{let c=y;const h=c;if(i==null||i(),Be(u))if(h===""||h===null||h===void 0)c=null;else{const E=Number.parseFloat(h);c=Number.isNaN(E)?null:E}else h===""&&u!=="name"?c=null:u==="adsClass"?c=At(u,h):c=h;if(await v(m,u,c,p)){const E=p.find(U=>U.id===m);E&&(Be(u)?E[u]=c:u==="adsClass"?E.adsClass=c??"":E[u]=h||"")}},saveSelectEdit:async(m,u,y,p)=>{i==null||i(),await v(m,u,y,p)},saveTagsEdit:async(m,u,y,p)=>{i==null||i();const c=typeof y=="string"?y.split(",").map(E=>E.trim()).filter(Boolean):Array.isArray(y)?y:[],h=c.length>0?c:null;if(await v(m,u,h,p)){const E=p.find(U=>U.id===m);E&&(E[u]=c)}},saveParentEdit:async(m,u,y,p)=>{const c=await v(m,u,y,p);(c||!c)&&(i==null||i())},saveFieldValue:async(m,u,y,p,{silent:c=!1,compareToItem:h=!0,suppressPostSaveCallback:w=!1}={})=>{const E=p.find(T=>T.id===m);if(!E)return{success:!1};const{dbValue:U,localValue:P}=ns(u,y);return h&&as(E[u],P,u)?{success:!0,skipped:!0}:{success:await v(m,u,U,p,{silent:c,suppressPostSaveCallback:w,localValue:P}),skipped:!1}},toggleBoolean:async(m,u,y,p)=>{await me(m,u,async c=>{await v(m,u,y,p,{mutationToken:c})})},updateStarRating:async(m,u,y,p)=>{await me(m,u,async c=>{await v(m,u,y,p,{mutationToken:c})})},updateYear:async(m,u,y)=>{await me(m,"year",async p=>{await v(m,"year",u,y,{mutationToken:p})})},updateDate:async(m,u,y,p)=>{const c=y?y.toISOString().split("T")[0]:null,h=await v(m,u,c,p);(h||!h)&&(i==null||i())},toggleArchive:async(m,u,y)=>{const p=!u,c=await v(m,"isArchived",p,y);return c&&(e==null||e(p?"Seedling archived!":"Seedling unarchived!","
1success")),c},handleRemoveTag:async(m,u,y,p)=>{await me(m,u,async c=>{const h=(y==null?void 0:y.length)>0?y:null;await v(m,u,h,p,{localValue:y||[],mutationToken:c})})},handleColorDescChipsUpdate:async(m,u,y)=>{const p="adsColorDescChips";await me(m,p,async c=>{if(!(s!=null&&s())){e==null||e(he,"error");return}const h=Ot(l);if(!h){e==null||e(he,"error");return}const w=Kr(u);[w.ads_color_desc_1,w.ads_color_desc_2,w.ads_color_desc_3,w.ads_color_desc_4].filter(Boolean);try{const E=await kt(s().from("seedlings").update(w).eq("id",m).eq("email",h).select("id").maybeSingle());if(!E.ok){if(r(m,p,c)){const P=E.code==="not_found"?xt:be;e==null||e(P,"error")}return}if(!r(m,p,c))return;const U=y.find(P=>P.id===m);U&&qr(U,w),e==null||e(yt,"success"),d&&d({field:p})}catch(E){console.error("Error saving color chips:",E),r(m,p,c)&&(e==null||e(be,"error"))}})},isImmediateFieldPending:(m,u)=>Fr(m,u)}}function ss(n={}){const{deleteService:s,getAuthenticatedSupabase:l,showToast:e,dataRef:i,itemToDelete:d,cancelDelete:b,setTotalCount:r=null,totalCount:v=null,refreshData:S=null,onAfterDelete:k=null,reconcilePagination:L=null,onBulkDeleteStarted:A=null,onBulkDeleteComplete:M=null,getItemName:O=c=>(c==null?void 0:c.name)||(c==null?void 0:c.varietyName)||"",messages:z={}}=n,{errorPrefix:x="Couldn't delete",successSuffix:q="deleted",authRequired:$=Nt,noItemSelected:H="No item selected for deletion",notFound:F="Item not found or already deleted"}=z,m=_(!1);async function u(c){const h=c.id,w=O(c),{error:E,notFound:U}=await s(l(),h);if(E)return{ok:!1,itemId:h,itemName:w,notFound:U};if(k)try{await k(c)}catch(P){console.warn("Post-delete cleanup failed:",P)}if(i&&i.value){const P=i.value.findIndex(f=>f.id===h);P!==-1&&(i.value.splice(P,1),r&&v&&r(Math.max(0,v.value-1)))}return{ok:!0,itemId:h,itemName:w}}return{executeDelete:async()=>{if(!(l!=null&&l())){e($,"error"),b();return}if(!d.value){console.error(H),b();return}m.value=!0;try{const c=await u(d.value);if(!c.ok){e(c.notFound?F:x,"error"),b();return}b(),e(q==="deleted"?ht(c.itemName):`${c.itemName} ${q}`,"success"),S&&await S(),L==null||L(),M==null||M({deletedCount:1,failedIds:[]})}catch(c){console.error(`${x}:`,c),e(x,"error"),b()}finally{m.value=!1}},executeDeleteMany:async c=>{const h=Array.isArray(c)?c.filter(P=>P==null?void 0:P.id):[];if(h.length===0)return e(H,"error"),b(),{deletedCount:0,failedIds:[]};if(!(l!=null&&l()))return e($,"error"),b(),{deletedCount:0,failedIds:h.map(P=>P.id)};b(),A==null||A(),q==="deleted"?h.length===1?e(ht(O(h[0])||"Item"),"success"):e(Sa(h.length),"success"):h.length===1?e(`${O(h[0])||"Item"} ${q}`,"success"):e(`${h.length} items ${q}`,"success");let w=0;const E=[],U=[];try{for(const P of h){const f=await u(P);f.ok?(w+=1,f.itemName&&U.push(f.itemName)):E.push(P.id)}return w<h.length&&(w>0?e(`Deleted ${w} of ${h.length}; ${E.length} failed.`,"error"):e(x,"error")),S&&await S(),L==null||L(),M==null||M({deletedCount:w,failedIds:E}),{deletedCount:w,failedIds:E}}catch(P){return console.error(`${x}:`,P),e(x,"error"),M==null||M({deletedCount:w,failedIds:h.map(f=>f.id)}),{deletedCount:w,failedIds:h.map(f=>f.id)}}},isBulkDeleting:m}}const Re=[{key:"name",header:"Name",viewKey:null,defaultOn:!0},{key:"height",header:"Height (ft)",viewKey:"height"},{key:"bloom_size",header:"Bloom (in)",viewKey:"bloomSize"},{key:"ads_size",header:"ADS Size",viewKey:"adsSize"},{key:"ads_form",header:"Form",viewKey:"adsForm"},{key:"ads_color",header:"Color",viewKey:"adsColor"},{key:"ads_color_desc_full",header:"Color Description",viewKey:"adsColorDescFull"},{key:"ads_color_desc_1",header:"Color Chip 1",viewKey:"adsColorDescChips"},{key:"ads_color_desc_2",header:"Color Chip 2",viewKey:"adsColorDescChips"},{key:"ads_color_desc_3",header:"Color Chip 3",viewKey:"adsColorDescChips"},{key:"ads_color_desc_4",header:"Color Chip 4",viewKey:"adsColorDescChips"},{key:"ads_class",header:"Class",viewKey:"adsClass"},{key:"my_colors",header:"My Color",viewKey:"myColors"},{key:"plant_count",header:"# Plants",viewKey:"plants"},{key:"year",header:"Year",viewKey:"year"},{key:"planting_locations",header:"Planting Locations",viewKey:"plantingLocations"},{key:"storage_locations",header:"Storage Locations",viewKey:"storageLocations"},{key:"parent_1",header:"Seed Parent",viewKey:"parent1"},{key:"parent_2",header:"Pollen Parent",viewKey:"parent2"},{key:"grandparent_1a",header:"Grandparent 1A (Seed)",viewKey:"grandparent1A"},{key:"grandparent_1b",header:"Grandparent 1B (Pollen)",viewKey:"grandparent1B"},{key:"grandparent_2a",header:"Grandparent 2A (Seed)",viewKey:"grandparent2A"},{key:"grandparent_2b",header:"Grandparent 2B (Pollen)",viewKey:"grandparent2B"},{key:"seed_collected",header:"Seed Collected?",viewKey:"seedCollected"},{key:"pollinated",header:"Pollinated?",viewKey:"pollinated"},{key:"date_pollinated",header:"Date Pollinated",viewKey:"datePollinated"},{key:"keeping",header:"Keeping?",viewKey:"keeping"},{key:"plant_habit",header:"Plant Habit",viewKey:"plantHabit"},{key:"tubers_per_seedling",header:"Tubers per Seedling",viewKey:"tubersPerSeedling"},{key:"tuber_production",header:"Tuber Production",viewKey:"tuberProduction"},{key:"vase_life",header:"Vase Life",viewKey:"vaseLife"},{key:"vitality",header:"Vitality",viewKey:"vitality"},{key:"stem_strength",header:"Stem Strength",viewKey:"stemStrength"},{key:"notes",header:"Notes",viewKey:"notes"},{key:"description",header:"Description",viewKey:"description"}],ls=Re.map(({key:n,header:s})=>({key:n,label:s}));function Tt(n={}){const s={};for(const l of Re)if(l.viewKey!=null){const e=n[l.viewKey];s[l.key]=e!=null?!!e:!!ze[l.viewKey]}else s[l.key]=!!l.defaultOn;return s}function It(n){return!n||typeof n!="object"?0:Object.values(n).filter(
1Boolean).length}function is(n,s){return n[s]}function us(n){return n==null?"":Array.isArray(n)?n.join("; "):typeof n=="boolean"?n?"Yes":"No":n}const cs="name, main_photo, more_photos",Ie=1e3;async function ds(n,s){let l=[],e=0,i=!0;for(;i;){const{data:d,error:b}=await n.from("seedlings").select(cs).eq("email",s).order("name",{ascending:!0}).range(e,e+Ie-1);if(b)throw b;d!=null&&d.length?(l=[...l,...d],i=d.length>=Ie,e+=Ie):i=!1}return l}function ms(n,s){const l=Xa(n);if(!l||!Ja(l))return!1;const e=`seedlings/${er(s)}/`;return l.startsWith(e)}function ps(n){const s=new Map,l=new Map;for(const e of n){const i=e.name??"";let d=Bt(i,"unknown-seedling");const b=d.toLowerCase();if(!s.has(b)){s.set(b,1),l.set(i,d);continue}const r=s.get(b)+1;s.set(b,r),l.set(i,`${d}-${r}`)}return l}function fs(n,s){const l=ps(n),e=[];for(const i of n){const d=i.name??"",b=l.get(d)??Bt(d,"unknown-seedling"),v=Qa(i).filter(S=>ms(S,s)).filter(S=>{const k=S.url??S.secure_url;return k&&typeof k=="string"});v.forEach((S,k)=>{const L=S.url??S.secure_url,A=k+1,M=hr(S,A,v.length);e.push({zipPath:`${b}/${M}`,downloadUrl:L.trim(),mediaType:Wa(S),seedlingName:d})})}return e}const gs=yr;function vs(n,s=new Date().toISOString().split("T")[0]){br(n,"clade-hybridizing-photos",s)}function ys({getAuthenticatedSupabase:n,email:s,showToast:l,logAction:e}){const i=_(!1),d=_("preparing"),b=_(0),r=_(0),v=_(!1);let S=null;function k(){i.value=!1,d.value="preparing",b.value=0,r.value=0,v.value=!1,S=null}function L(){S==null||S.abort(),k(),l("Export cancelled","success")}async function A(){if(v.value)return;if(Cr()){l("Photo export is not supported in the iOS app. Please export from the web app at useclade.com.","error");return}const M=n==null?void 0:n();if(!M||!s.value){l(Ne,"error");return}v.value=!0,i.value=!0,d.value="preparing",b.value=0,r.value=0,S=new AbortController;const{signal:O}=S;try{const z=await ds(M,s.value);if(O.aborted)return;const x=fs(z,s.value);if(x.length===0){k(),l("No user photos or videos to export","error");return}r.value=x.length,d.value="downloading";const q=new Set(x.map(m=>m.seedlingName)).size,{blob:$,failedCount:H,successCount:F}=await gs(x,{signal:O,onProgress:(m,u)=>{b.value=m,r.value=u},onAllFetched:()=>{d.value="zipping"}});if(O.aborted)return;if(F===0){k(),l("Could not download any photos. Please try again.","error");return}d.value="done",vs($),e==null||e("export_photos",{seedlingCount:q,fileCount:F,failedCount:H}),k(),H>0?l(`Exported ${F} files; ${H} failed`,"success"):l(`Exported ${F} files from ${q} ${q===1?"seedling":"seedlings"}`,"success")}catch(z){if((z==null?void 0:z.name)==="AbortError"){k(),l("Export cancelled","success");return}console.error("[hybridizing] Photo export error:",z),k(),l(Ae,"error")}}return{showPhotoExportModal:i,photoExportPhase:d,photoExportCurrent:b,photoExportTotal:r,isPhotoExportLoading:v,startPhotoExport:A,cancelPhotoExport:L}}const hs={key:0,class:"more-menu-dropdown"},bs=["disabled"],Cs=["disabled"],Ss=["disabled"],_s=["disabled"],ws={class:"hybridizing-filters-desktop-only"},Es="hybridizing",Ps={__name:"Hybridizing",setup(n){async function s(t,o){let D=[],R=0,Q=!0;for(;Q;){const{data:Y,error:ee}=await t.from("seedlings").select("*").eq("email",o).eq("is_archived",!1).order("name",{ascending:!0}).range(R,R+1e3-1);if(ee)throw ee;Y!=null&&Y.length?(D=[...D,...Y],Q=Y.length>=1e3,R+=1e3):Q=!1}return D}const l=_(!1),e=_(!1),i=_(null),{searchQuery:d}=Fa(),b=t=>{d.value=t},r=_({...le}),{isMobile:v}=or(),S=["pollinated","tuberProduction","vaseLife","vitality","stemStrength","adsSize","adsForm","adsColor"],k=K(()=>Oe.filter(t=>!S.includes(t.key))),L=K(()=>{const t=v.value?Oe:Oe.filter(o=>S.includes(o.key));return Ba(t)}),A=K(()=>v.value?{...le}:Ra(le,r.value,S)),M=K(()=>Object.keys(le).some(t=>r.value[t]!==le[t])),O=_(!1),z=_(!1),x=_(!1),q=_(!1),$=_(null),H=_(!1),F=_(!1),m=_(!1),u=_(Tt(ze)),y=K(()=>It(u.value)===0),{email:p,userFirstName:c,userProfilePictureUrl:h,authChecked:w,profileLoaded:E,initAuth:U,fetchUserProfile:P,getAuthenticatedSupabase:f}=ar(!0);function T(t,o){if(!p.value)return;const g=f==null?void 0:f();g&&new Dt(g,p.value).logAction(Es,t,o).catch(D=>console.debug("Failed to log module user action:",D))}const{loadSubscription:pe,canAccessModule:I,maxVarietyPhotos:qt,canAddSeedling:Gt,seedlingLimit:Ht}=rr(),$t=ya(),{count:Yt,fetchCount:fe}=Qr(ft(()=>w.value),p,ft(()=>f)),jt=K(()=>ir(Ht.value)),Ue=()=>{q.value=!1},Zt=async()=>(await fe(),Yt.value),{isPreviewMode:Qt,requireModuleAccess:N,handleUpgradeClick:Wt}=xr("hybridizing",x),Xt=()=>{x.value=!1},{useMetricSystem:X}=Tr({email:p,getAuthenticatedSupabase:f}),{rowsPerPage:Ve}=Lr({email:p,getAuthenticatedSupabase:f}),{showToast:Jt,toastMessage:eo,toastType:to,showToastNotification:B}=kr(),{showPhotoExportModal:oo,photoExportPhase:no,photoExportCurrent:ao,photoExportTotal:ro,isPhotoExportLoading:so,startPhotoExport:lo,cancelPhotoExport:io}=ys({getAuthenticatedSupabase:f,email:p,showToast:B,logAction:T}),uo=async()=>{try{await Wt()}catch(t){B(t.message||"Could not open billing portal. Please try again.","error")}},{showPrintOverlay:co,printItems:mo,isPrintLoading:po,closePrintOverlay:fo,runPr
1intDialog:go,destroyPrintOverlay:vo,preparePrintView:yo}=qa({printingBodyClass:Ha,landscapeStyleId:"hybridizing-print-landscape-page"}),{currentPage:ne,totalCount:ho,totalPages:Ke,previousPage:qe,nextPage:bo,resetToFirstPage:Ge,setTotalCount:He}=Dr(Ve),{sortColumn:ae,sortDirection:ue,handleSort:Co,setSort:So,resetSort:_o}=Or(),{applyFiltersWithSort:wo,handleSortWithPresetSync:Eo,clearSortState:Po}=za({filters:r,sortColumn:ae,setSort:So,resetSort:_o,handleSort:Co}),ko=t=>{wo(t)},{editingCell:ge,editingValue:J,startEditing:Do,cancelEdit:ve}=Ar(),{showDeleteModal:Fo,itemToDelete:Se,itemsToDelete:$e,confirmDelete:Ye,confirmDeleteMany:Mo,cancelDelete:je}=Br(),{myColors:Ze,plantingLocations:_e,storageLocations:we,fetchMasterLists:Lo,addMyColor:Oo,addPlantingLocation:xo,addStorageLocation:To}=$r(f,p),{settings:Z,loadSettings:Io,saveSettings:No}=Ma({settingsKey:"hybridizing_view_settings",defaultSettings:ze,email:p,getAuthenticatedSupabase:f}),Ao=K(()=>ur.columns),{orderedColumns:ce,hasCustomColumnOrder:zo,viewSettingsListKey:Bo,setColumnOrder:Ro,resetColumnOrder:Uo}=Na({settingsRef:Z,columnsRef:Ao,saveSettings:No}),Vo=K(()=>Ua(ce.value,cr));function Ko(t){const o=t.value;if(Object.prototype.hasOwnProperty.call(o,"tubers")&&o.plants===void 0){const g={...o,plants:o.tubers};delete g.tubers,t.value=g}}const{createPhotoPreview:qo,createVideoPreview:Go,deletePhotoFromCloudinary:Qe,deleteCloudinaryFoldersByPath:Ho}=Vr(),$o=new Set(["parent1","parent2","grandparent1A","grandparent1B","grandparent2A","grandparent2B"]),{seedlings:G,filteredSeedlingsForMetrics:Yo,isLoading:We,totalCount:Xe,parentOptions:jo,grandparentOptions:Zo,fetchSeedlings:ye,fetchSeedlingsForPrint:Qo,fetchGenealogyFilterOptions:de}=ts({itemsPerPage:Ve,searchQuery:d,filters:r,sortColumn:ae,sortDirection:ue,currentPage:ne,email:p,getAuthenticatedSupabase:f}),{saveTextEdit:Wo,saveTagsEdit:Xo,saveParentEdit:Jo,saveFieldValue:en,toggleBoolean:tn,updateStarRating:on,updateYear:nn,toggleArchive:an,handleRemoveTag:rn,handleColorDescChipsUpdate:sn}=rs({getAuthenticatedSupabase:f,email:p,showToastNotification:B,cancelEdit:ve,onAfterSuccessfulFieldSave:({field:t})=>{T("edit",{source:"inline"}),$o.has(t)&&de()}}),{form:Ee,isEditMode:ln,showPhotoLimitModal:un,closePhotoLimitModal:cn,handleAddClick:dn,handleEditClick:mn,handleSubmit:pn,handlePhotoUpload:fn}=pr({showModal:H,email:p,useMetricSystem:X,getAuthenticatedSupabase:f,showToast:B,createPhotoPreview:qo,createVideoPreview:Go,deletePhotoFromCloudinary:Qe,fetchSeedlings:ye,onAddSuccess:({name:t})=>{T("add",t?{name:t}:null),de(),fe()},onEditSuccess:({name:t})=>{T("edit",t?{source:"modal",name:t}:{source:"modal"}),de()},canAddSeedling:Gt,getActiveSeedlingCount:Zt,onSeedlingLimitReached:()=>{q.value=!0}}),gn=async()=>{N()&&await dn()},vn=t=>{N()&&mn(t)},yn=(...t)=>{if(N())return pn(...t)},hn=(...t)=>{if(N())return fn(...t)},bn=t=>{N()&&Ye(t)},Je=()=>{N()&&$t.push("/import/hybridizing")},Pe=()=>{N()&&(e.value=!1,O.value=!0)},Cn=t=>{N()&&(Z.value=t)},{showGallery:Sn,galleryData:ke,openGallery:_n,closeGallery:wn}=Aa(),{varietyNames:et,isFetching:tt,fetchVarietyNames:En,ensureLoaded:Pn}=Hr({fetchService:fr}),j=K(()=>G.value),kn=(t,o,g,D)=>en(t,o,g,G.value,D),ot=(t,o)=>Ia(t,o,X.value),{showBulkEditOverlay:nt,closeBulkEditOverlay:at,bulkSaveCell:Dn,handleBulkEditClick:Fn,showBulkEditPasteErrorToast:Mn}=Va({saveFieldValue:kn,logModuleUserAction:T,getAuthenticatedSupabase:f,showToastNotification:B,paginatedVarieties:j,prepareFieldForSave:ot}),{selectedCount:rt,selectedIds:Ln,allVisibleSelected:On,someVisibleSelected:xn,toggleRowSelection:Tn,toggleSelectAllVisible:In,getSelectedItems:Nn,showBulkDeleteMode:De,openBulkDeleteMode:An,closeBulkDeleteMode:st}=La({paginatedItems:j,searchQuery:d,filters:r,currentPage:ne,showBulkEditOverlay:nt,closeBulkEditOverlay:at,getItemId:t=>t.id}),Fe=_(!1),{executeDelete:zn,executeDeleteMany:Bn,isBulkDeleting:Rn}=ss({deleteService:(t,o)=>gr(t,o,p.value),getAuthenticatedSupabase:f,showToast:B,dataRef:G,itemToDelete:Se,cancelDelete:je,setTotalCount:He,totalCount:ho,refreshData:async()=>{await ye(),await de(),await fe()},reconcilePagination:()=>{j.value.length===0&&ne.value>1&&qe()},onBulkDeleteStarted:()=>{Fe.value=!0,st()},onBulkDeleteComplete:({deletedCount:t})=>{Fe.value=!1,t>0&&T("delete",{source:"bulk",count:t})},getItemName:t=>(t==null?void 0:t.name)||"",onAfterDelete:async t=>{Fe.value||T("delete",t!=null&&t.name?{name:t.name}:null);const o=f==null?void 0:f(),g=await sr(t,{deletePhotoFromCloudinary:Qe,deleteCloudinaryFoldersByPath:Ho,prefixDeleteGuard:o&&p.value&&(t!=null&&t.id)?{supabase:o,email:p.value,table:"seedlings",excludeRowId:t.id}:void 0}),D=lr(g);D&&B(D,"warning")},messages:{authRequired:Nt,noItemSelected:"No seedling selected for deleti
1on",errorPrefix:"Couldn't delete",notFound:"Seedling not found or already deleted",successSuffix:"deleted"}}),Un=(...t)=>{if(N())return Dn(...t)},lt=K(()=>$e.value.length>0?$e.value:Se.value?[Se.value]:[]),re=K(()=>{const t=lt.value,o=t.map(g=>(g==null?void 0:g.name)||"").filter(Boolean);return Gr({count:t.length,names:o,entityLabel:"seedling"})}),Vn=async()=>{if(!N())return;const t=lt.value;if(t.length>1){Bn(t);return}await zn()};function Kn(t){const o=Array.isArray(t)?t.filter(Boolean):[];if(o.length!==0){if(o.length===1){Ye(o[0]);return}Mo(o)}}function qn(){N()&&(!De.value||rt.value===0||Kn(Nn()))}const Gn=K(()=>{const t=G.value.map(o=>o.name).filter(Boolean);return[...new Set(t)]}),Hn=K(()=>Xe.value),$n=K(()=>$a(Yo.value,"hybridizing")),Me=K(()=>({adsSizeOptions:_t,adsFormOptions:St,adsColorOptions:Ct,myColors:Ze.value,plantingLocations:_e.value,storageLocations:we.value,varietyNames:et.value,isFetchingVarietyNames:tt.value})),it=K(()=>({parentOptions:jo.value,grandparentOptions:Zo.value,plantingLocations:_e.value,storageLocations:we.value,adsSizeOptions:_t,adsFormOptions:St,adsColorOptions:Ct}));ie(Xe,t=>{He(t)});const Yn=t=>{Eo(t,Ge)},ut=["parent1","parent2","grandparent1A","grandparent1B","grandparent2A","grandparent2B"],ct=async(t,o,g)=>{N()&&(ut.includes(o)&&await Pn(),Do(t,o,g||""))},jn=async(t,o,g)=>{N()&&await tn(t,o,g,G.value)},Zn=async(t,o,g)=>{N()&&await on(t,o,g,G.value)},Qn=async(t,o)=>{N()&&await nn(t,o,G.value)},Wn=async(t,o)=>{if(!N())return;const g=!o,D=G.value.find(Y=>Y.id===t),R=D==null?void 0:D.name;await an(t,o,G.value)&&(T(g?"archive":"unarchive",R?{name:R}:null),await fe())},dt=async(t,o)=>{if(N()&&!(!ge.value||ge.value.itemId!==t||ge.value.field!==o)){if(o==="height"||o==="bloomSize"){const g=J.value;if(g!==""&&g!=null&&!Number.isNaN(Number(g))){const D=Number(g),R=X.value,Q=R?3:10,Y=R?50:20,ee=R?"Height (m)":"Height (ft)",te=R?"Bloom size (cm)":"Bloom size (in)";if(o==="height"&&(D<0||D>Q)){B(`${ee} must be between 0 and ${Q}`,"error"),ve();return}if(o==="bloomSize"){const oe=Pt(D);if(oe<0||oe>Y){B(`${te} must be between 0 and ${Y}`,"error"),ve();return}}if(R){const oe=o==="bloomSize"?Pt(D):Math.round(D*100)/100,W=o==="height"?Ir(oe):Nr(oe);J.value=String(W)}}}if(ut.includes(o)){await Jo(t,o,J.value,G.value);return}o==="myColors"||o==="plantingLocations"||o==="storageLocations"?await Xo(t,o,J.value,G.value):await Wo(t,o,J.value,G.value)}},Xn=new Set([Ce.BOOLEAN,Ce.STAR_RATING,Ce.YEAR_SELECTOR,Ce.READONLY]),Jn=K(()=>ce.value.filter(t=>Z.value[t.key]&&t.editable!==!1&&!Xn.has(t.type)).map(t=>t.key)),{handleTabNavigation:ea}=zr({editableFields:Jn,itemsRef:j,saveEditFn:dt,startEditingFn:ct});nr({title:"Clade | Hybridizing",description:"Track and manage your dahlia hybridizing projects with Clade.",url:"https://useclade.com/hybridizing",image:"https://useclade.com/clade-logo-social-preview.png"});const ta=()=>{l.value=!l.value};ie(l,async t=>{t&&!E.value&&p.value&&await P()});const oa=()=>{l.value&&(l.value=!1),e.value=!1},na=t=>{t.stopPropagation(),e.value=!e.value},aa=()=>{Pe()},ra=()=>{N()&&(e.value=!1,Fn())},sa=()=>{N()&&(e.value=!1,An())},la=async()=>{if(e.value=!1,!(f!=null&&f())){B(Ea,"error");return}await yo({resolveItems:Qo,showToast:B,emptyMessage:"No seedlings to print",errorMessage:"Error loading hybridizing list for print"})&&T("print")},ia=()=>{e.value=!1,lo()},ua=()=>{if(e.value=!1,!(f!=null&&f())){B(Ne,"error");return}u.value=Tt(Z.value),F.value=!0},ca=async()=>{if(It(u.value)===0){B("Select at least one column to export","error");return}if(!(f!=null&&f())){B(Ne,"error");return}T("export"),m.value=!0;try{B(_a,"success");const t=f();let o;try{o=await s(t,p.value)}catch(W){console.error("Error fetching seedlings for export:",W),B(Ae,"error");return}if(!o||o.length===0){B("No seedlings to export","error");return}const g=Re.filter(W=>u.value[W.key]),D=g.map(W=>wt(W.header)).join(","),R=o.map(W=>g.map(ma=>{const pa=is(W,ma.key);return wt(us(pa))}).join(",")),Q=[D,...R].join(` 2`),Y=new Blob([Q],{type:"text/csv;charset=utf-8;"}),ee=URL.createObjectURL(Y),te=document.createElement("a");te.setAttribute("href",ee);const oe=new Date().toISOString().split("T")[0];te.setAttribute("download",`clade-hybridizing-export-${oe}.csv`),document.body.appendChild(te),te.click(),document.body.removeChild(te),URL.revokeObjectURL(ee),F.value=!1,B(wa(o.length),"success")}catch(t){console.error("Error exporting hybridizing list:",t),B(Ae,"error")}finally{m.value=!1}},mt=t=>
2{i.value&&!i.value.contains(t.target)&&(e.value=!1)},da=()=>{d.value="",r.value={...le},Po()};return ie([d,r,ae,ue],()=>{Ge()},{deep:!0}),ie([d,r,ae,ue,ne],()=>{p.value&&(f!=null&&f())&&ye()},{deep:!0}),fa(async()=>{if(document.addEventListener("click",mt),await U()){const o=f==null?void 0:f();o&&p.value&&($.value=new Dt(o,p.value),await pe(o,p.value),T("visit")),I("hybridizing")||(x.value=!0),await Promise.all([Io(),Lo()]),Ko(Z),await Promise.all([ye(),de()]),En()}}),ga(()=>{document.removeEventListener("click",mt),vo()}),(t,o)=>(Le(),pt(va,null,[V(Pa,{"auth-checked":a(w),email:a(p),"user-first-name":a(c),"user-profile-picture-url":a(h),"show-navigation":l.value,"active-module":"hybridizing","can-access-module":a(I),"get-authenticated-supabase":a(f),title:"Hybridizing","search-query":a(d),"search-suggestions":Gn.value,"is-loading":a(We),"item-count":j.value.length,"total-count":Hn.value,"count-suffix":$n.value,"item-label-singular":"seedling","item-label-plural":"seedlings","current-page":a(ne),"total-pages":a(Ke),"empty-title":"No varieties found","empty-message":"Try adjusting your search or filters!","show-clear-button":!!a(d)||M.value,onMainClick:oa,onToggleNavigation:ta,"onUpdate:searchQuery":b,onClearSearch:da,"view-settings-in-more-menu":!0,onViewSettings:Pe,onPreviousPage:a(qe),onNextPage:a(bo)},{"action-buttons":se(()=>[C("button",{type:"button",class:"action-btn module-filters-btn","aria-label":"Filters",onClick:o[0]||(o[0]=g=>z.value=!0)},[...o[11]||(o[11]=[C("span",{class:"material-icons"},"tune",-1),C("span",{class:"action-btn-text"},"Filters",-1)])]),C("button",{type:"button",class:"action-btn hybridizing-view-settings-desktop","aria-label":"View Settings",onClick:Pe},[...o[12]||(o[12]=[C("span",{class:"material-icons"},"table_view",-1),C("span",{class:"action-btn-text"},"View Settings",-1)])]),C("a",{href:"/import/hybridizing",class:"action-btn import-btn",onClick:vt(Je,["prevent"])},[...o[13]||(o[13]=[C("span",{class:"material-icons"},"upload_file",-1),C("span",{class:"action-btn-text"},"Import",-1)])]),C("div",{class:Ca(["more-menu-container",{"more-menu-container--open":e.value}]),ref_key:"moreMenuRef",ref:i},[C("button",{type:"button",class:"action-btn","aria-label":"More actions",onClick:na},[...o[14]||(o[14]=[C("span",{class:"material-icons"},"more_vert",-1)])]),e.value?(Le(),pt("div",hs,[C("button",{type:"button",class:"more-menu-item more-menu-item-mobile-only",onClick:aa},[...o[15]||(o[15]=[C("span",{class:"material-icons"},"table_view",-1),C("span",null,"View Settings",-1)])]),C("a",{href:"/import/hybridizing",class:"more-menu-item more-menu-item-mobile-only",onClick:vt(Je,["prevent"])},[...o[16]||(o[16]=[C("span",{class:"material-icons"},"upload_file",-1),C("span",null,"Import",-1)])]),C("button",{type:"button",class:"more-menu-item",onClick:ua},[...o[17]||(o[17]=[C("span",{class:"material-icons-outlined"},"download",-1),C("span",null,"CSV Export",-1)])]),C("button",{type:"button",class:"more-menu-item",disabled:a(so),onClick:ia},[...o[18]||(o[18]=[C("span",{class:"material-icons-outlined"},"photo_library",-1),C("span",null,"Export Photos",-1)])],8,bs),C("button",{type:"button",class:"more-menu-item",disabled:a(po),onClick:la},[...o[19]||(o[19]=[C("span",{class:"material-icons-outlined"},"print",-1),C("span",null,"Print",-1)])],8,Cs),C("button",{type:"button",class:"more-menu-item",disabled:j.value.length===0,onClick:ra},[...o[20]||(o[20]=[C("span",{class:"material-icons-outlined"},"edit_note",-1),C("span",null,"Bulk Edit",-1)])],8,Ss),C("button",{type:"button",class:"more-menu-item",disabled:j.value.length===0,onClick:sa},[...o[21]||(o[21]=[C("span",{class:"material-icons-outlined"},"delete",-1),C("span",null,"Bulk Delete",-1)])],8,_s)])):gt("",!0)],2),C("button",{class:"add-variety-btn",onClick:gn},[...o[22]||(o[22]=[C("span",{class:"plus-icon"},"+",-1),C("span",{class:"add-variety-btn-text"},"Add Variety",-1)])])]),"bulk-actions":se(()=>[V(Ta,{"selected-count":a(rt),"mode-active":a(De),"hint-text":"Select seedlings to delete",onCancel:a(st),onDelete:qn},null,8,["selected-count","mode-active","onCancel"])]),filters:se(()=>[C("div",ws,[V(ka,{filters:r.value,"filter-config":k.value,"options-list":it.value,"onUpdate:filters":o[1]||(o[1]=g=>r.value=g)},null,8,["filters","filter-config","options-list"])])]),content:se(()=>[!a(We)&&j.value.length>0?(Le(),ba(xa,{key:0,items:j.value,columns:a(ce),"visible-columns":a(Z),"sort-column":a(ae),"sort-direction":a(ue),"editing-cell":a(ge),"editing-value":a(J),"options-list":Me.value,"use-metric-system":a(X),"show-google-image-search":!1,"show-archive-button":!0,"show-delete-button":!0,"enable-row-selection":a(De),"selected-ids":a(Ln),"all-visible-selected":a(On),"some-visible-selected":a(xn),"collapse-row-actions-on-mobile":!0,"read-only":a(Qt),"name-field":"name",onToggleRowSelection:a(Tn),onToggleSelectAll:a(In),onSort:Yn,onStartEditing:ct,onSaveEdit:dt,onCancelEdit:a(ve),"onUpdate:editingV
2alue":o[2]||(o[2]=g=>J.value=g),onGalleryClick:a(_n),onEditClick:vn,onArchiveClick:Wn,onDeleteClick:bn,onToggleBoolean:jn,onYearClick:Qn,onStarRating:Zn,onRemoveTag:o[3]||(o[3]=(g,D,R)=>{a(N)()&&a(rn)(g,D,R,a(G))}),onUpdateChips:o[4]||(o[4]=(g,D,R)=>{a(N)()&&a(sn)(g,R,a(G))}),onHandleTab:a(ea)},null,8,["items","columns","visible-columns","sort-column","sort-direction","editing-cell","editing-value","options-list","use-metric-system","enable-row-selection","selected-ids","all-visible-selected","some-visible-selected","read-only","onToggleRowSelection","onToggleSelectAll","onCancelEdit","onGalleryClick","onHandleTab"])):gt("",!0)]),modals:se(()=>[V(dr,{show:a(Fo),title:re.value.title,subtitle:re.value.subtitle,note:re.value.note,"item-name":re.value.itemName,"item-names":re.value.itemNames,"require-typed-count":re.value.requireTypedCount,"is-confirming":a(Rn),onCancel:a(je),onConfirm:Vn},null,8,["show","title","subtitle","note","item-name","item-names","require-typed-count","is-confirming","onCancel"]),V(vr,{show:H.value,"onUpdate:show":o[5]||(o[5]=g=>H.value=g),form:a(Ee),"onUpdate:form":o[6]||(o[6]=g=>ha(Ee)?Ee.value=g:null),"variety-names":a(et),"my-color-options":a(Ze),"location-options":a(_e),"storage-location-options":a(we),"is-fetching-variety-names":a(tt),"is-edit-mode":a(ln),"use-metric-system":a(X),onSubmit:yn,onPhotoUpload:hn,onAddMyColor:a(Oo),onAddLocation:a(xo),onAddStorageLocation:a(To)},null,8,["show","form","variety-names","my-color-options","location-options","storage-location-options","is-fetching-variety-names","is-edit-mode","use-metric-system","onAddMyColor","onAddLocation","onAddStorageLocation"]),V(wr,{show:a(un),"max-photos":a(qt),onDismiss:a(cn)},null,8,["show","max-photos","onDismiss"]),V(Oa,{show:O.value,"onUpdate:show":o[7]||(o[7]=g=>O.value=g),"visible-columns":a(Z),columns:Vo.value,"has-custom-column-order":a(zo),"column-list-key":a(Bo),"onUpdate:visibleColumns":Cn,"onUpdate:columnOrder":a(Ro),onResetColumnOrder:a(Uo)},null,8,["show","visible-columns","columns","has-custom-column-order","column-list-key","onUpdate:columnOrder","onResetColumnOrder"]),V(Sr,{show:F.value,"onUpdate:show":o[8]||(o[8]=g=>F.value=g),settings:u.value,"onUpdate:settings":o[9]||(o[9]=g=>u.value=g),title:"Export columns",fields:a(ls),"submit-label":"Export columns","is-loading":m.value,"submit-disabled":y.value,onSubmit:ca},null,8,["show","settings","fields","is-loading","submit-disabled"]),V(_r,{show:a(oo),phase:a(no),current:a(ao),total:a(ro),onCancel:a(io)},null,8,["show","phase","current","total","onCancel"]),V(Da,{show:z.value,"onUpdate:show":o[10]||(o[10]=g=>z.value=g),filters:r.value,"default-filters":A.value,"filter-config":L.value,"options-list":it.value,onApply:ko},null,8,["show","filters","default-filters","filter-config","options-list"]),V(Et,{show:x.value,title:"Upgrade to access module",message:"The Hybridizing module is only available on the Pro plan & above.","user-action-service":$.value,onUpgrade:uo,onClose:Xt},null,8,["show","user-action-service"]),V(Et,{show:q.value,title:"Seedling limit reached",message:jt.value,"button-text":"Got it","user-action-service":$.value,onUpgrade:Ue,onClose:Ue},null,8,["show","message","user-action-service"]),V(Er,{show:a(Jt),message:a(eo),type:a(to)},null,8,["show","message","type"]),V(Pr,{"is-open":a(Sn),"variety-name":a(ke).varietyName,"main-photo":a(ke).mainPhoto,"more-photos":a(ke).morePhotos,onClose:a(wn)},null,8,["is-open","variety-name","main-photo","more-photos","onClose"])]),_:1},8,["auth-checked","email","user-first-name","user-profile-picture-url","show-navigation","can-access-module","get-authenticated-supabase","search-query","search-suggestions","is-loading","item-count","total-count","count-suffix","current-page","total-pages","show-clear-button","onPreviousPage","onNextPage"]),V(Ka,{show:a(nt),"current-page":a(ne),"total-pages":a(Ke),"item-count":j.value.length,onClose:a(at)},{default:se(()=>[V(Ya,{items:j.value,columns:a(ce),"visible-columns":a(Z),"options-record":Me.value,"use-metric-system":a(X),"name-field":"name","name-column-label":"Name","save-cell":Un,"prepare-field-for-save":ot,"toast-error":a(Mn)},null,8,["items","columns","visible-columns","options-record","use-metric-system","toast-error"])]),_:1},8,["show","current-page","total-pages","item-count","onClose"]),V(Ga,{show:a(co),"toolbar-title":"Print hybridizing","page-title":"Hybridizing",items:a(mo),columns:a(ce),"visible-columns":a(Z),"sort-column":a(ae),"sort-direction":a(ue),"options-list":Me.value,"use-metric-system":a(X),"show-google-image-search":!1,"name-field":"name",onClose:a(fo),onPrint:a(go)},null,8,["show","items","columns","visible-columns","sort-column","sort-direction","options-list","use-metric-system","onClose","onPrint"])],64))}},ti=tr(Ps,[["__scopeId","data-v-b9400732"]]);export{ti 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.