{"version":3,"file":"ForgeCountdownClock.CncHS2Je.mjs","names":["useMemo","useState","_Fragment","React"],"sources":["https:/framerusercontent.com/modules/wWce5PKzgwsnippKWJUN/bjZrJYH8eVg10zOVapFR/ForgeCountdownClock.js"],"sourcesContent":["\"use client\";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import React,{useEffect,useMemo,useState}from\"react\";// Framer property controls (types provided by Framer at runtime)\n// @ts-ignore - Framer provides these types at runtime\nimport{addPropertyControls,ControlType}from\"framer\";const FORGE_COPPERWOOD=\"#A86828\";const FORGE_TEXT=\"#F5EEE0\";const pad=n=>n<10?`0${n}`:`${n}`;function useCountdown(deadlineISO){const target=useMemo(()=>new Date(deadlineISO).getTime(),[deadlineISO]);const[now,setNow]=useState(null);useEffect(()=>{setNow(Date.now());const id=window.setInterval(()=>setNow(Date.now()),1e3);return()=>window.clearInterval(id);},[]);if(now===null||Number.isNaN(target)){return{ready:false,passed:false,d:\"--\",h:\"--\",m:\"--\",s:\"--\"};}let diff=target-now;const passed=diff<=0;if(diff<0)diff=0;const d=Math.floor(diff/864e5);diff-=d*864e5;const h=Math.floor(diff/36e5);diff-=h*36e5;const m=Math.floor(diff/6e4);diff-=m*6e4;const s=Math.floor(diff/1e3);return{ready:true,passed,d:pad(d),h:pad(h),m:pad(m),s:pad(s)};}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ForgeCountdownClock({deadlineISO=\"2026-07-29T23:59:59+02:00\",state=\"Auto\",daysLabel=\"Days\",hoursLabel=\"Hours\",minutesLabel=\"Minutes\",secondsLabel=\"Seconds\",closedLabel=\"Applications closed\",accentColor=FORGE_COPPERWOOD,textColor=FORGE_TEXT}){const{ready,passed,d,h,m,s}=useCountdown(deadlineISO);const isClosed=state===\"Closed\"?true:state===\"Open\"?false:passed;const cells=[{value:d,label:daysLabel},{value:h,label:hoursLabel},{value:m,label:minutesLabel},{value:s,label:secondsLabel}];return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n        .fcc-root {\n          /* This element is the size container the clock scales against. */\n          container-type: inline-size;\n          width: 100%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          background: transparent;\n          pointer-events: none;\n          overflow: hidden;\n        }\n        /* ONE base size, derived from the container's width, drives everything.\n           Every part below is sized in em, so the whole clock scales together\n           and stays proportional — no clipping, no viewport dependence. */\n        .fcc-clock {\n          font-size: clamp(8px, 4.6cqw, 30px);\n          display: flex;\n          align-items: flex-start;\n          justify-content: center;\n          gap: 0.45em;\n          max-width: 100%;\n        }\n        .fcc-cell {\n          min-width: 3.6em;\n          text-align: center;\n        }\n        .fcc-num {\n          font-family: \"Prompt\", sans-serif;\n          font-weight: 900;\n          font-size: 2.6em;\n          line-height: 1;\n          color: var(--fcc-accent, ${FORGE_COPPERWOOD});\n          font-variant-numeric: tabular-nums;\n          text-shadow: 0 0 1.1em rgba(168,104,40,0.5);\n        }\n        .fcc-label {\n          font-family: \"Prompt\", sans-serif;\n          font-size: 0.62em;\n          font-weight: 600;\n          letter-spacing: 0.1em;\n          text-transform: uppercase;\n          color: var(--fcc-text, ${FORGE_TEXT});\n          opacity: 0.62;\n          margin-top: 0.9em;\n          white-space: nowrap;\n        }\n        .fcc-colon {\n          font-family: \"Prompt\", sans-serif;\n          font-weight: 900;\n          font-size: 2em;\n          line-height: 1;\n          color: var(--fcc-accent, ${FORGE_COPPERWOOD});\n          opacity: 0.5;\n          padding-top: 0.15em;\n        }\n        .fcc-closed {\n          font-family: \"Prompt\", sans-serif;\n          font-weight: 900;\n          text-transform: uppercase;\n          font-size: clamp(1rem, 7cqw, 2.6rem);\n          line-height: 1.05;\n          color: var(--fcc-accent, ${FORGE_COPPERWOOD});\n          text-shadow: 0 0 1em rgba(168,104,40,0.45);\n          text-align: center;\n          padding: 0 0.5em;\n        }\n      `}),/*#__PURE__*/_jsx(\"div\",{className:\"fcc-root\",style:{[\"--fcc-accent\"]:accentColor,[\"--fcc-text\"]:textColor},\"aria-live\":\"polite\",\"aria-atomic\":\"true\",children:isClosed?/*#__PURE__*/_jsx(\"div\",{className:\"fcc-closed\",children:closedLabel}):/*#__PURE__*/_jsx(\"div\",{className:\"fcc-clock\",role:\"status\",\"aria-label\":\"Time left\",children:cells.map((cell,i)=>/*#__PURE__*/_jsxs(React.Fragment,{children:[/*#__PURE__*/_jsxs(\"div\",{className:\"fcc-cell\",children:[/*#__PURE__*/_jsx(\"div\",{className:\"fcc-num\",children:ready?cell.value:\"--\"}),/*#__PURE__*/_jsx(\"div\",{className:\"fcc-label\",children:cell.label})]}),i<cells.length-1?/*#__PURE__*/_jsx(\"span\",{className:\"fcc-colon\",\"aria-hidden\":\"true\",children:\":\"}):null]},i))})})]});}addPropertyControls(ForgeCountdownClock,{deadlineISO:{type:ControlType.String,title:\"Deadline (ISO)\",defaultValue:\"2026-07-29T23:59:59+02:00\"},state:{type:ControlType.Enum,title:\"State\",options:[\"Auto\",\"Open\",\"Closed\"],optionTitles:[\"Auto (by date)\",\"Force open\",\"Force closed\"],defaultValue:\"Auto\",displaySegmentedControl:true},daysLabel:{type:ControlType.String,title:\"Days Label\",defaultValue:\"Days\"},hoursLabel:{type:ControlType.String,title:\"Hours Label\",defaultValue:\"Hours\"},minutesLabel:{type:ControlType.String,title:\"Minutes Label\",defaultValue:\"Minutes\"},secondsLabel:{type:ControlType.String,title:\"Seconds Label\",defaultValue:\"Seconds\"},closedLabel:{type:ControlType.String,title:\"Closed Label\",defaultValue:\"Applications closed\"},accentColor:{type:ControlType.Color,title:\"Accent Color\",defaultValue:FORGE_COPPERWOOD},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:FORGE_TEXT}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ForgeCountdownClock\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"ForgeCountdownClockProps\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ForgeCountdownClock.map"],"mappings":"2NAEiJ,SAAS,EAAa,EAAY,CAAC,IAAM,EAAOA,MAAY,IAAI,KAAK,CAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAW,CAAC,EAAO,CAAC,EAAI,GAAQC,EAAS,IAAI,EAAqI,GAAnI,MAAc,CAAC,EAAO,KAAK,IAAI,CAAC,EAAE,IAAM,EAAG,EAAO,gBAAgB,EAAO,KAAK,IAAI,CAAC,EAAE,GAAG,EAAE,UAAU,EAAO,cAAc,CAAE,CAAE,EAAE,CAAC,CAAC,EAAK,IAAM,MAAM,OAAO,MAAM,CAAM,EAAG,MAAM,CAAC,MAAM,GAAM,OAAO,GAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAG,IAAI,EAAK,EAAO,EAAU,EAAO,GAAM,EAAK,EAAK,IAAE,EAAK,GAAE,IAAM,EAAE,KAAK,MAAM,EAAK,KAAK,EAAE,GAAM,EAAE,MAAM,IAAM,EAAE,KAAK,MAAM,EAAK,IAAI,EAAE,GAAM,EAAE,KAAK,IAAM,EAAE,KAAK,MAAM,EAAK,GAAG,EAAE,GAAM,EAAE,IAAI,IAAM,EAAE,KAAK,MAAM,EAAK,GAAG,EAAE,MAAM,CAAC,MAAM,GAAK,SAAO,EAAE,EAAI,CAAC,EAAE,EAAE,EAAI,CAAC,EAAE,EAAE,EAAI,CAAC,EAAE,EAAE,EAAI,CAAC,CAAC,CAAE,CAGtxB,SAAwB,EAAoB,CAAC,cAAY,4BAA4B,QAAM,OAAO,YAAU,OAAO,aAAW,QAAQ,eAAa,UAAU,eAAa,UAAU,cAAY,sBAAsB,cAAY,EAAiB,YAAU,GAAY,CAAC,GAAK,CAAC,QAAM,SAAO,IAA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