import{c as O,d as ne,e as ce,R as l,j as o,f as V,g as se,h as ie,P as $,r as A,a as P}from"./index-6aWWvyNc.js";import{c as L,R as le,T as de,b as pe}from"./index-CZKQAQYO.js";import{u as me,c as ue,b as fe}from"./Navigation-KKUTSq3z.js";/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xe=O("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const he=O("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);var d="Accordion",ve=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[E,be,Ae]=ne(d),[g,Me]=ce(d,[Ae,L]),S=L(),F=l.forwardRef((t,a)=>{const{type:e,...r}=t,c=r,n=r;return o.jsx(E.Provider,{scope:t.__scopeAccordion,children:e==="multiple"?o.jsx(we,{...n,ref:a}):o.jsx(je,{...c,ref:a})})});F.displayName=d;var[K,ge]=g(d),[U,Ce]=g(d,{collapsible:!1}),je=l.forwardRef((t,a)=>{const{value:e,defaultValue:r,onValueChange:c=()=>{},collapsible:n=!1,...i}=t,[s,p]=V({prop:e,defaultProp:r??"",onChange:c,caller:d});return o.jsx(K,{scope:t.__scopeAccordion,value:l.useMemo(()=>s?[s]:[],[s]),onItemOpen:p,onItemClose:l.useCallback(()=>n&&p(""),[n,p]),children:o.jsx(U,{scope:t.__scopeAccordion,collapsible:n,children:o.jsx(q,{...i,ref:a})})})}),we=l.forwardRef((t,a)=>{const{value:e,defaultValue:r,onValueChange:c=()=>{},...n}=t,[i,s]=V({prop:e,defaultProp:r??[],onChange:c,caller:d}),p=l.useCallback(x=>s((u=[])=>[...u,x]),[s]),f=l.useCallback(x=>s((u=[])=>u.filter(j=>j!==x)),[s]);return o.jsx(K,{scope:t.__scopeAccordion,value:i,onItemOpen:p,onItemClose:f,children:o.jsx(U,{scope:t.__scopeAccordion,collapsible:!0,children:o.jsx(q,{...n,ref:a})})})}),[Ie,C]=g(d),q=l.forwardRef((t,a)=>{const{__scopeAccordion:e,disabled:r,dir:c,orientation:n="vertical",...i}=t,s=l.useRef(null),p=se(s,a),f=be(e),u=me(c)==="ltr",j=ie(t.onKeyDown,h=>{var D;if(!ve.includes(h.key))return;const re=h.target,w=f().filter(_=>{var H;return!((H=_.ref.current)!=null&&H.disabled)}),v=w.findIndex(_=>_.ref.current===re),M=w.length;if(v===-1)return;h.preventDefault();let m=v;const I=0,N=M-1,y=()=>{m=v+1,m>N&&(m=I)},R=()=>{m=v-1,m<I&&(m=N)};switch(h.key){case"Home":m=I;break;case"End":m=N;break;case"ArrowRight":n==="horizontal"&&(u?y():R());break;case"ArrowDown":n==="vertical"&&y();break;case"ArrowLeft":n==="horizontal"&&(u?R():y());break;case"ArrowUp":n==="vertical"&&R();break}const ae=m%M;(D=w[ae].ref.current)==null||D.focus()});return o.jsx(Ie,{scope:e,disabled:r,direction:c,orientation:n,children:o.jsx(E.Slot,{scope:e,children:o.jsx($.div,{...i,"data-orientation":n,ref:p,onKeyDown:r?void 0:j})})})}),b="AccordionItem",[Ne,T]=g(b),z=l.forwardRef((t,a)=>{const{__scopeAccordion:e,value:r,...c}=t,n=C(b,e),i=ge(b,e),s=S(e),p=ue(),f=r&&i.value.includes(r)||!1,x=n.disabled||t.disabled;return o.jsx(Ne,{scope:e,open:f,disabled:x,triggerId:p,children:o.jsx(le,{"data-orientation":n.orientation,"data-state":B(f),...s,...c,ref:a,disabled:x,open:f,onOpenChange:u=>{u?i.onItemOpen(r):i.onItemClose(r)}})})});z.displayName=b;var G="AccordionHeader",Q=l.forwardRef((t,a)=>{const{__scopeAccordion:e,...r}=t,c=C(d,e),n=T(G,e);return o.jsx($.h3,{"data-orientation":c.orientation,"data-state":B(n.open),"data-disabled":n.disabled?"":void 0,...r,ref:a})});Q.displayName=G;var k="AccordionTrigger",Y=l.forwardRef((t,a)=>{const{__scopeAccordion:e,...r}=t,c=C(d,e),n=T(k,e),i=Ce(k,e),s=S(e);return o.jsx(E.ItemSlot,{scope:e,children:o.jsx(de,{"aria-disabled":n.open&&!i.collapsible||void 0,"data-orientation":c.orientation,id:n.triggerId,...s,...r,ref:a})})});Y.displayName=k;var Z="AccordionContent",W=l.forwardRef((t,a)=>{const{__scopeAccordion:e,...r}=t,c=C(d,e),n=T(Z,e),i=S(e);return o.jsx(pe,{role:"region","aria-labelledby":n.triggerId,"data-orientation":c.orientation,...i,...r,ref:a,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});W.displayName=Z;function B(t){return t?"open":"closed"}var ye=F,Re=z,_e=Q,J=Y,X=W;const ke=ye,ee=A.forwardRef(({className:t,...a},e)=>o.jsx(Re,{ref:e,className:P("border-b",t),...a}));ee.displayName="AccordionItem";const oe=A.forwardRef(({className:t,children:a,...e},r)=>o.jsx(_e,{className:"flex",children:o.jsxs(J,{ref:r,className:P("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...e,children:[a,o.jsx(fe,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));oe.displayName=J.displayName;const te=A.forwardRef(({className:t,children:a,...e},r)=>o.jsx(X,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...e,children:o.jsx("div",{className:P("pb-4 pt-0",t),children:a})}));te.displayName=X.displayName;const Pe=({question:t,answer:a,value:e})=>{const[r,c]=A.useState(null);return o.jsxs(ee,{value:e,className:"border-b border-border",children:[o.jsx(oe,{className:"text-left text-lg font-semibold hover:text-primary transition-colors",children:t}),o.jsxs(te,{className:"text-base leading-relaxed text-foreground/80 pt-2",children:[a,o.jsxs("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-4",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"Was this helpful?"}),o.jsxs("button",{onClick:()=>c("helpful"),className:`flex items-center gap-1 text-sm transition-colors ${r==="helpful"?"text-green-600":"hover:text-green-600"}`,"aria-label":"Mark as helpful",children:[o.jsx(he,{className:`w-4 h-4 ${r==="helpful"?"fill-current":""}`}),o.jsx("span",{children:"Yes"})]}),o.jsxs("button",{onClick:()=>c("not-helpful"),className:`flex items-center gap-1 text-sm transition-colors ${r==="not-helpful"?"text-red-600":"hover:text-red-600"}`,"aria-label":"Mark as not helpful",children:[o.jsx(xe,{className:`w-4 h-4 ${r==="not-helpful"?"fill-current":""}`}),o.jsx("span",{children:"No"})]}),r&&o.jsx("span",{className:"text-sm text-muted-foreground ml-2",children:"Thanks for your feedback!"})]})]})]})},De=({faqs:t})=>o.jsx(ke,{type:"single",collapsible:!0,className:"w-full space-y-2",children:t.map((a,e)=>o.jsx(Pe,{question:a.question,answer:a.answer,value:`item-${e}`},e))});export{De as F};