{"version":3,"file":"ActiveFormatSummary.CY80PBAf.mjs","names":["useState","useMemo","customEvent"],"sources":["https:/framerusercontent.com/modules/P6lxJhptqlU6mBPmrCLr/WsIvJMkXXWxU40j5IZXk/ActiveFormatSummary.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{startTransition,useEffect,useMemo,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const STORAGE_KEY=\"beaverGolf.privateTournament.activeFormat\";const FORMAT_EVENT=\"beaverGolf:formatChanged\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ActiveFormatSummary(props){const{accentColor,surfaceColor,textColor,borderColor,radius,displayMode,title,titleFont,bodyFont}=props;const canvasStyle=props.style;const[activeFormat,setActiveFormat]=useState(\"stableford\");const formatInfo=useMemo(()=>{return{\"stableford\":{label:\"Stableford\",description:\"Points-based format where score on each hole contributes to a running points total.\"},\"stroke-play\":{label:\"Stroke Play\",description:\"Classic medal play: every stroke counts, lowest total score wins the round.\"},\"match-play\":{label:\"Match Play\",description:\"Head-to-head hole wins; each hole is its own contest rather than cumulative strokes.\"},\"texas-scramble\":{label:\"Texas Scramble\",description:\"Team format where players choose the best shot and all play from that position.\"}};},[]);useEffect(()=>{if(typeof window!==\"undefined\"){const saved=window.localStorage.getItem(STORAGE_KEY);if(saved&&formatInfo[saved]){startTransition(()=>setActiveFormat(saved));}}const onFormatChanged=event=>{const customEvent=event;const incoming=customEvent.detail?.format;if(incoming&&formatInfo[incoming]){startTransition(()=>setActiveFormat(incoming));}};const onStorageChanged=event=>{if(event.key===STORAGE_KEY&&event.newValue){const next=event.newValue;if(formatInfo[next]){startTransition(()=>setActiveFormat(next));}}};if(typeof window!==\"undefined\"){window.addEventListener(FORMAT_EVENT,onFormatChanged);window.addEventListener(\"storage\",onStorageChanged);}return()=>{if(typeof window!==\"undefined\"){window.removeEventListener(FORMAT_EVENT,onFormatChanged);window.removeEventListener(\"storage\",onStorageChanged);}};},[formatInfo]);const info=formatInfo[activeFormat];const isCompact=displayMode===\"compact\";return /*#__PURE__*/_jsxs(\"section\",{\"aria-live\":\"polite\",style:{...canvasStyle,position:\"relative\",width:\"100%\",minWidth:0,boxSizing:\"border-box\",display:\"flex\",flexDirection:\"column\",gap:isCompact?8:12,padding:isCompact?12:16,borderRadius:radius,border:`1px solid ${borderColor}`,background:surfaceColor},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:10},children:[/*#__PURE__*/_jsx(\"span\",{style:{...titleFont,color:textColor},children:title}),/*#__PURE__*/_jsx(\"span\",{style:{...bodyFont,color:surfaceColor,background:accentColor,borderRadius:999,padding:\"4px 10px\",whiteSpace:\"nowrap\"},children:info.label})]}),/*#__PURE__*/_jsx(\"p\",{style:{...bodyFont,color:textColor,margin:0,opacity:isCompact?.86:1},children:info.description})]});}addPropertyControls(ActiveFormatSummary,{accentColor:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#000000\"},surfaceColor:{type:ControlType.Color,title:\"Surface\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#000000\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#EEEEEE\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:40,step:1,defaultValue:14},displayMode:{type:ControlType.Enum,title:\"Display\",options:[\"compact\",\"detailed\"],optionTitles:[\"Compact\",\"Detailed\"],defaultValue:\"detailed\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Active Format\"},titleFont:{type:ControlType.Font,title:\"Title Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},bodyFont:{type:ControlType.Font,title:\"Body Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ActiveFormatSummary\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ActiveFormatSummary.map"],"mappings":"+MAGG,SAAwB,EAAoB,EAAM,CAAC,GAAK,CAAC,cAAY,eAAa,YAAU,cAAY,SAAO,cAAY,QAAM,YAAU,YAAU,EAAY,EAAY,EAAM,MAAW,CAAC,EAAa,GAAiBA,EAAS,YAAY,EAAQ,EAAWC,OAAmB,CAAC,WAAa,CAAC,MAAM,aAAa,YAAY,qFAAqF,EAAE,cAAc,CAAC,MAAM,cAAc,YAAY,6EAA6E,EAAE,aAAa,CAAC,MAAM,aAAa,YAAY,sFAAsF,EAAE,iBAAiB,CAAC,MAAM,iBAAiB,YAAY,iFAAiF,CAAC,GAAI,CAAC,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,CAAC,IAAM,EAAM,EAAO,aAAa,QAAQ,CAAW,EAAK,GAAO,EAAW,IAAQ,MAAoB,EAAgB,CAAK,CAAC,CAAG,CAAC,IAAM,EAAgB,GAAO,CAAyB,IAAM,EAASC,EAAY,QAAQ,OAAU,GAAU,EAAW,IAAW,MAAoB,EAAgB,CAAQ,CAAC,CAAG,EAAQ,EAAiB,GAAO,CAAC,GAAG,EAAM,MAAM,GAAa,EAAM,SAAS,CAAC,IAAM,EAAK,EAAM,SAAY,EAAW,IAAO,MAAoB,EAAgB,CAAI,CAAC,CAAG,CAAC,EAA6I,OAAjI,IAAS,SAAa,EAAO,iBAAiB,EAAa,CAAe,EAAE,EAAO,iBAAiB,UAAU,CAAgB,OAAa,CAAW,IAAS,SAAa,EAAO,oBAAoB,EAAa,CAAe,EAAE,EAAO,oBAAoB,UAAU,CAAgB,EAAG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