{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/AK2LOXcwd5BqxVTlBM3C/0PmGFmTkVFUP4sMYvQmP/faqmm.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function FAQ({faqs,questionColor,answerColor,questionBackground,answerBackground,questionPadding,answerPadding,gap,fontSize,fontWeight,borderRadius,fontFamily,borderColor,lineColor,faqLimit,answerFontSize}){const[openIndex,setOpenIndex]=useState(null);const[showAll,setShowAll]=useState(false);const[height,setHeight]=useState(null);const answerRefs=useRef([]);const toggleFAQ=index=>{setOpenIndex(openIndex===index?null:index);};const handleViewAllClick=()=>{setShowAll(!showAll);};const displayFaqs=showAll?faqs:faqs.slice(0,faqLimit);// Update height of the answer when openIndex changes\nuseEffect(()=>{if(openIndex!==null&&answerRefs.current[openIndex]){var _answerRefs_current_openIndex;setHeight((_answerRefs_current_openIndex=answerRefs.current[openIndex])===null||_answerRefs_current_openIndex===void 0?void 0:_answerRefs_current_openIndex.scrollHeight)// Get the scrollHeight of the content\n;}else{setHeight(0)// Reset height when closed\n;}},[openIndex]);return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap},children:[displayFaqs.map((faq,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{background:questionBackground,borderRadius,padding:questionPadding,cursor:\"pointer\",border:`1px solid ${borderColor}`,marginBottom:\"30px\",display:\"flex\",flexDirection:\"column\"},onClick:()=>toggleFAQ(index),tabIndex:0,children:[/*#__PURE__*/_jsxs(\"div\",{style:{color:questionColor,fontSize,fontWeight,fontFamily,display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\"},children:[/*#__PURE__*/_jsx(\"div\",{children:faq.question}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"20px\",fontWeight:\"bold\",color:\"#8791FF\"},children:openIndex===index?\"-\":\"+\"})]}),/*#__PURE__*/_jsx(\"div\",{ref:el=>answerRefs.current[index]=el,style:{color:answerColor,background:answerBackground,padding:answerPadding,fontSize:answerFontSize,borderRadius,transition:\"max-height 0.3s ease\",maxHeight:openIndex===index?`${height}px`:\"0\",overflow:\"hidden\",marginTop:openIndex===index?`18px`:\"0px\",fontFamily:\"Inter\",letterSpacing:\"0.2px\",lineHeight:\"140%\"},children:faq.answer.split(\"\\\\n\").map((paragraph,i)=>/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 10px\"},children:paragraph},i))}),/*#__PURE__*/_jsx(\"div\",{style:{borderBottom:`1px solid ${lineColor}`,marginTop:\"24px\"}})]},index)),!showAll&&faqs.length>faqLimit&&/*#__PURE__*/_jsx(\"div\",{style:{textAlign:\"center\",marginTop:\"10px\"},children:/*#__PURE__*/_jsx(\"button\",{onClick:handleViewAllClick,style:{padding:\"12px 30px\",backgroundColor:\"#232C34\",fontSize:\"16px\",fontWeight:\"400\",color:\"#ffffff\",border:\"none\",borderRadius:\"6px\"},children:\"View All\"})})]});}// Default Props\nFAQ.defaultProps={faqs:[{question:\"What is Framer?\",answer:\"Framer is a design tool.\\\\nIt helps in creating prototypes and designs.\"},{question:\"Why use Framer?\",answer:\"It simplifies design and coding.\\\\nFramer is perfect for rapid prototyping.\"}],questionColor:\"#000000\",answerColor:\"#333333\",questionBackground:\"#f7f7f7\",answerBackground:\"#eaeaea\",questionPadding:\"10px\",answerPadding:\"10px\",gap:\"10px\",fontSize:\"16px\",fontWeight:\"bold\",borderRadius:\"5px\",fontFamily:\"Arial, sans-serif\",borderColor:\"#ddd\",lineColor:\"#ccc\",faqLimit:3,answerFontSize:\"14px\"};// Property Controls for Framer\naddPropertyControls(FAQ,{faqs:{type:ControlType.Array,title:\"FAQs\",propertyControl:{type:ControlType.Object,controls:{question:{type:ControlType.String,title:\"Question\"},answer:{type:ControlType.String,title:\"Answer\"}}}},questionColor:{type:ControlType.Color,title:\"Question Color\"},answerColor:{type:ControlType.Color,title:\"Answer Color\"},questionBackground:{type:ControlType.Color,title:\"Question BG\"},answerBackground:{type:ControlType.Color,title:\"Answer BG\"},questionPadding:{type:ControlType.String,title:\"Question Padding\"},answerPadding:{type:ControlType.String,title:\"Answer Padding\"},gap:{type:ControlType.String,title:\"Gap Between FAQs\"},fontSize:{type:ControlType.String,title:\"Font Size\"},fontWeight:{type:ControlType.String,title:\"Font Weight\"},borderRadius:{type:ControlType.String,title:\"Border Radius\"},fontFamily:{type:ControlType.String,title:\"Font Family\"},borderColor:{type:ControlType.Color,title:\"Border Color\"},lineColor:{type:ControlType.Color,title:\"Line Color\"},faqLimit:{type:ControlType.Number,title:\"FAQ Limit\"},answerFontSize:{type:ControlType.String,title:\"Answer Font Size\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"FAQ\":{\"type\":\"reactComponent\",\"name\":\"FAQ\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./faqmm.map"],
  "mappings": "qHAAiK,SAASA,EAAI,CAAC,KAAAC,EAAK,cAAAC,EAAc,YAAAC,EAAY,mBAAAC,EAAmB,iBAAAC,EAAiB,gBAAAC,EAAgB,cAAAC,EAAc,IAAAC,EAAI,SAAAC,EAAS,WAAAC,EAAW,aAAAC,EAAa,WAAAC,EAAW,YAAAC,EAAY,UAAAC,EAAU,SAAAC,EAAS,eAAAC,CAAc,EAAE,CAAC,GAAK,CAACC,EAAUC,CAAY,EAAEC,EAAS,IAAI,EAAO,CAACC,EAAQC,CAAU,EAAEF,EAAS,EAAK,EAAO,CAACG,EAAOC,CAAS,EAAEJ,EAAS,IAAI,EAAQK,EAAWC,EAAO,CAAC,CAAC,EAAQC,EAAUC,GAAO,CAACT,EAAaD,IAAYU,EAAM,KAAKA,CAAK,CAAE,EAAQC,EAAmB,IAAI,CAACP,EAAW,CAACD,CAAO,CAAE,EAAQS,EAAYT,EAAQnB,EAAKA,EAAK,MAAM,EAAEc,CAAQ,EACxrB,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AE,iBAAiB,CAAC,KAAKA,EAAY,MAAM,MAAM,WAAW,EAAE,gBAAgB,CAAC,KAAKA,EAAY,OAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,KAAKA,EAAY,OAAO,MAAM,gBAAgB,EAAE,IAAI,CAAC,KAAKA,EAAY,OAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,KAAKA,EAAY,OAAO,MAAM,WAAW,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,aAAa,EAAE,aAAa,CAAC,KAAKA,EAAY,OAAO,MAAM,eAAe,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,aAAa,EAAE,YAAY,CAAC,KAAKA,EAAY,MAAM,MAAM,cAAc,EAAE,UAAU,CAAC,KAAKA,EAAY,MAAM,MAAM,YAAY,EAAE,SAAS,CAAC,KAAKA,EAAY,OAAO,MAAM,WAAW,EAAE,eAAe,CAAC,KAAKA,EAAY,OAAO,MAAM,kBAAkB,CAAC,CAAC",
  "names": ["FAQ", "faqs", "questionColor", "answerColor", "questionBackground", "answerBackground", "questionPadding", "answerPadding", "gap", "fontSize", "fontWeight", "borderRadius", "fontFamily", "borderColor", "lineColor", "faqLimit", "answerFontSize", "openIndex", "setOpenIndex", "ye", "showAll", "setShowAll", "height", "setHeight", "answerRefs", "pe", "toggleFAQ", "index", "handleViewAllClick", "displayFaqs", "ue", "_answerRefs_current_openIndex", "u", "faq", "p", "el", "paragraph", "i", "addPropertyControls", "ControlType"]
}
