{"version":3,"file":"GoogleReviewsStat.CbEppdu7.mjs","names":["useState","__esmMin","te","_e","init_jsx_runtime","c","p","init_npm_react_18_3_1","ce","RenderTarget","init_framer_CaDWdxiz","addPropertyControls","ControlType","PP_FONT_FACE","PP_API","PP","fetchPublicReviews","init_ppBrand","PP_FONT","GoogleReviewsStat","apiUrl","props","template","fallbackRating","fallbackTotal","textColor","fontSize","fontWeight","style","stat","setStat","cancelled","data","rating","total","text","init_GoogleReviewsStat"],"sources":["https:/framerusercontent.com/modules/Vo8krcJHuONtPVnyyv3E/zDwULrB7hxhoDKfavACm/GoogleReviewsStat.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useState,startTransition}from\"react\";import{PP,PP_FONT,PP_FONT_FACE,PP_API,fetchPublicReviews}from\"https://framerusercontent.com/modules/ntpRMZJn5GXg9XRgRRHO/tBQLb7AcK9gBkXYYoRkl/ppBrand.js\";/**\n * Small inline stat sourced live from the pp-slack-proxy /reviews/public feed\n * (mirrors the native Google Business Profile API, refreshed daily). `template`\n * supports {rating} and {total} tokens, e.g. \"{rating}/5 across {total} reviews\",\n * \"{total} Google reviews\", or just \"{rating}\" — same live fetch, different slot.\n * Falls back to static values if the fetch fails, so it never breaks the page.\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function GoogleReviewsStat(props){const apiUrl=props.apiUrl||PP_API.reviews;const template=props.template||\"{rating}/5 across {total} reviews\";const fallbackRating=props.fallbackRating??\"5.0\";const fallbackTotal=props.fallbackTotal??\"150+\";const textColor=props.textColor??PP.ink;const fontSize=props.fontSize??16;const fontWeight=props.fontWeight??700;const style=props.style;const[stat,setStat]=useState(null);useEffect(()=>{// Skip network calls while Framer is generating canvas thumbnails —\n// there's no visible result to fetch for, just wasted requests.\nif(RenderTarget.current()===RenderTarget.thumbnail)return;let cancelled=false;fetchPublicReviews(apiUrl).then(data=>{if(cancelled)return;if(typeof data.avgRating===\"number\"&&typeof data.total===\"number\"){startTransition(()=>setStat({rating:data.avgRating.toFixed(1),total:String(data.total)}));}}).catch(()=>{/* keep the static fallback — never show a broken stat */});return()=>{cancelled=true;};},[apiUrl]);const rating=stat?.rating??fallbackRating;const total=stat?.total??fallbackTotal;const text=template.replace(/\\{rating\\}/g,rating).replace(/\\{total\\}/g,total);return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",minWidth:\"max-content\",...style},children:[/*#__PURE__*/_jsx(\"style\",{children:PP_FONT_FACE}),/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:PP_FONT,fontWeight,fontSize,lineHeight:1.2,color:textColor,letterSpacing:\"-0.005em\",whiteSpace:\"nowrap\"},children:text})]});}addPropertyControls(GoogleReviewsStat,{apiUrl:{type:ControlType.String,title:\"API URL\",defaultValue:PP_API.reviews},template:{type:ControlType.String,title:\"Template\",defaultValue:\"{rating}/5 across {total} reviews\",description:\"Use {rating} and {total} as placeholders\"},fallbackRating:{type:ControlType.String,title:\"Fallback Rating\",defaultValue:\"5.0\"},fallbackTotal:{type:ControlType.String,title:\"Fallback Total\",defaultValue:\"150+\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:PP.ink},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:10,max:40},fontWeight:{type:ControlType.Number,title:\"Font Weight\",defaultValue:700,min:400,max:900,step:100}})// Rebuilt 2026-08-24: PP_FONT now resolves to the private \"PP Biennale\"\n// family, mapped only to the licensed Fontspring webfonts. Framer rebuilds a\n// component only when its own file changes, so dependents of ppBrand.ts must be\n// touched for a token change to reach the published bundle.\n// Rebuild stamp 2026-08-24b: ppBrand Ink 3 / Orange Ink darkened to meet 4.5:1.\n// Endpoint moved to pp-brain-gateway (pp-slack-proxy-sandbox retired).\n// Rebuild stamp 2026-08-27: PP_API.reviews now points at gateway.panhandleproductions.net.\n;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GoogleReviewsStat\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,wRAQG,SAAwBmB,EAAkB,EAAM,CAAC,IAAMC,EAAOC,EAAM,QAAQP,EAAO,QAAcQ,EAASD,EAAM,UAAU,oCAA0CE,EAAeF,EAAM,gBAAgB,MAAYG,EAAcH,EAAM,eAAe,OAAaI,EAAUJ,EAAM,WAAWN,EAAG,IAAUW,EAASL,EAAM,UAAU,GAASM,EAAWN,EAAM,YAAY,IAAUO,EAAMP,EAAM,MAAW,CAACQ,EAAKC,GAAS9B,EAAS,IAAI,EAAEQ,MAAc,CAE5b,GAAGC,EAAa,QAAQ,IAAIA,EAAa,UAAU,OAAO,IAAIsB,EAAU,GAAyS,OAAnSf,EAAmBI,CAAM,CAAC,CAAC,KAAK,GAAM,CAAIW,GAAoB,OAAOC,EAAK,WAAY,UAAU,OAAOA,EAAK,OAAQ,UAAU9B,MAAoB4B,EAAQ,CAAC,OAAOE,EAAK,UAAU,QAAQ,CAAC,EAAE,MAAM,OAAOA,EAAK,KAAK,CAAC,CAAC,CAAC,CAAG,CAAC,CAAC,CAAC,UAAU,CAA0D,CAAC,MAAY,CAAC,EAAU,EAAK,CAAE,EAAE,CAACZ,CAAM,CAAC,EAAE,IAAMa,EAAOJ,GAAM,QAAQN,EAAqBW,EAAML,GAAM,OAAOL,EAAoBW,EAAKb,EAAS,QAAQ,cAAcW,CAAM,CAAC,CAAC,QAAQ,aAAaC,CAAK,EAAE,MAAoB,gBAAM,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,SAAS,cAAc,GAAGN,CAAK,EAAE,SAAS,CAAc,gBAAK,QAAQ,CAAC,SAASf,CAAY,CAAC,EAAe,gBAAK,OAAO,CAAC,MAAM,CAAC,WAA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