PageSourceSearch

https://www.magentoseo.nl/assets/accordion-a2zzgnB9.js

js magentoseo.nl collected 2026-10-08 08:34:54 UTC 15,375 bytes, 1 lines download raw bytes

1import{a as e,c as t,o as n,s as r}from"./index-Bi6LKcIu.js";import{d as i,h as a}from"./PageShell-DXSTsu4Q.js";import{t as o}from"./utils-BzOWElVW.js";var s=a(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),c=t(r(),1),l=e();function u(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,u=c.useMemo(()=>o,Object.values(o));return(0,l.jsx)(s.Provider,{value:u,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,l=c.useContext(s);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>c.createContext(e));return function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,d(i,...t)]}function d(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function f(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function p(...e){return t=>{let n=!1,r=e.map(e=>{let r=f(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():f(e[t],null)}}}}function m(...e){return c.useCallback(p(...e),e)}function h(e){let t=g(e),n=c.forwardRef((e,n)=>{let{children:r,...i}=e,a=c.Children.toArray(r),o=a.find(v);if(o){let e=o.props.children,r=a.map(t=>t===o?c.Children.count(e)>1?c.Children.only(null):c.isValidElement(e)?e.props.children:null:t);return(0,l.jsx)(t,{...i,ref:n,children:c.isValidElement(e)?c.cloneElement(e,void 0,r):null})}return(0,l.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function g(e){let t=c.forwardRef((e,t)=>{let{children:n,...r}=e;if(c.isValidElement(n)){let e=b(n),i=y(r,n.props);return n.type!==c.Fragment&&(i.ref=t?p(t,e):e),c.cloneElement(n,i)}return c.Children.count(n)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _=Symbol(`radix.slottable`);function v(e){return c.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_}function y(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ee(e){let t=e+`CollectionProvider`,[n,r]=u(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=c.useRef(null),a=c.useRef(new Map).current;return(0,l.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,d=h(s),f=c.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,l.jsx)(d,{ref:m(t,a(s,n).collectionRef),children:r})});f.displayName=s;let p=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=h(p),v=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=c.useRef(null),s=m(t,o),u=a(p,n);return c.useEffect(()=>(u.itemMap.set(o,{ref:o,...i}),()=>void u.itemMap.delete(o))),(0,l.jsx)(_,{[g]:``,ref:s,children:r})});v.displayName=p;function y(t){let n=a(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:f,ItemSlot:v},y,r]}typeof window<`u`&&window.document&&window.document.createElement;function x(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var S=globalThis?.document?c.useLayoutEffect:()=>{},te=c.useInsertionEffect||S;function C({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ne({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{let t=c.useRef(e!==void 0);c.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[l,c.useCallback(t=>{if(s){let n=re(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ne({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return te(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function re(e){return typeof e==`function`}n();
vendor: 4,257 bytes, line 1
1function ie(e){let t=ae(e),n=c.forwardRef((e,n)=>{let{children:r,...i}=e,a=c.Children.toArray(r),o=a.find(se);if(o){let e=o.props.children,r=a.map(t=>t===o?c.Children.count(e)>1?c.Children.only(null):c.isValidElement(e)?e.props.children:null:t);return(0,l.jsx)(t,{...i,ref:n,children:c.isValidElement(e)?c.cloneElement(e,void 0,r):null})}return(0,l.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function ae(e){let t=c.forwardRef((e,t)=>{let{children:n,...r}=e;if(c.isValidElement(n)){let e=le(n),i=ce(r,n.props);return n.type!==c.Fragment&&(i.ref=t?p(t,e):e),c.cloneElement(n,i)}return c.Children.count(n)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oe=Symbol(`radix.slottable`);function se(e){return c.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===oe}function ce(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function le(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var w=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ie(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,l.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ue(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}var T=e=>{let{present:t,children:n}=e,r=de(t),i=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),a=m(r.ref,fe(i));return typeof n==`function`||r.isPresent?c.cloneElement(i,{ref:a}):null};T.displayName=`Presence`;function de(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),[o,s]=ue(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{let e=E(r.current);a.current=o===`mounted`?e:`none`},[o]),S(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=E(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),S(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=E(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=E(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:c.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function E(e){return e?.animationName||`none`}function fe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pe=c.useId||(()=>void 0),me=0;function D(e){let[t,n]=c.useState(pe());return S(()=>{e||n(e=>e??String(me++))},[e]),e||(t?`radix-${t}`:``)}var O=`Collapsible`,[he,k]=u(O),[ge,A]=he(O),j=c.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[u,d]=C({prop:r,defaultProp:i??!1,onChange:o,caller:O});return(0,l.jsx)(ge,{scope:n,disabled:a,contentId:D(),open:u,onOpenToggle:c.useCallback(()=>d(e=>!e),[d]),children:(0,l.jsx)(w.div,{"data-state":I(u),"data-disabled":a?``:void 0,...s,ref:t})})});j.displayName=O;var M=`CollapsibleTrigger`,N=c.forwardRef((e,t)=>
vendor: 4,161 bytes, line 1
1{let{__scopeCollapsible:n,...r}=e,i=A(M,n);return(0,l.jsx)(w.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":I(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:x(e.onClick,i.onOpenToggle)})});N.displayName=M;var P=`CollapsibleContent`,F=c.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=A(P,e.__scopeCollapsible);return(0,l.jsx)(T,{present:n||i.open,children:({present:e})=>(0,l.jsx)(_e,{...r,ref:t,present:e})})});F.displayName=P;var _e=c.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=A(P,n),[s,u]=c.useState(r),d=c.useRef(null),f=m(t,d),p=c.useRef(0),h=p.current,g=c.useRef(0),_=g.current,v=o.open||s,y=c.useRef(v),b=c.useRef(void 0);return c.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),S(()=>{let e=d.current;if(e){b.current=b.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();p.current=t.height,g.current=t.width,y.current||(e.style.transitionDuration=b.current.transitionDuration,e.style.animationName=b.current.animationName),u(r)}},[o.open,r]),(0,l.jsx)(w.div,{"data-state":I(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!v,...a,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:v&&i})});function I(e){return e?`open`:`closed`}var ve=j,ye=N,be=F,xe=c.createContext(void 0);function Se(e){let t=c.useContext(xe);return e||t||`ltr`}var L=`Accordion`,Ce=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[R,we,Te]=ee(L),[z,Ee]=u(L,[Te,k]),B=k(),V=c.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,l.jsx)(R.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,l.jsx)(Ae,{...a,ref:t}):(0,l.jsx)(ke,{...i,ref:t})})});V.displayName=L;var[H,De]=z(L),[U,Oe]=z(L,{collapsible:!1}),ke=c.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,u]=C({prop:n,defaultProp:r??``,onChange:i,caller:L});return(0,l.jsx)(H,{scope:e.__scopeAccordion,value:c.useMemo(()=>s?[s]:[],[s]),onItemOpen:u,onItemClose:c.useCallback(()=>a&&u(``),[a,u]),children:(0,l.jsx)(U,{scope:e.__scopeAccordion,collapsible:a,children:(0,l.jsx)(G,{...o,ref:t})})})}),Ae=c.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=C({prop:n,defaultProp:r??[],onChange:i,caller:L}),u=c.useCallback(e=>s((t=[])=>[...t,e]),[s]),d=c.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,l.jsx)(H,{scope:e.__scopeAccordion,value:o,onItemOpen:u,onItemClose:d,children:(0,l.jsx)(U,{scope:e.__scopeAccordion,collapsible:!0,children:(0,l.jsx)(G,{...a,ref:t})})})}),[je,W]=z(L),G=c.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=m(c.useRef(null),t),u=we(n),d=Se(i)===`ltr`,f=x(e.onKeyDown,e=>{if(!Ce.includes(e.key))return;let t=e.target,n=u().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,c=()=>{o=r+1,o>s&&(o=0)},l=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(d?c():l());break;case`ArrowDown`:a===`vertical`&&c();break;case`ArrowLeft`:a===`horizontal`&&(d?l():c());break;case`ArrowUp`:a===`vertical`&&l();break}n[o%i].ref.current?.focus()});return(0,l.jsx)(je,{scope:n,disabled:r,direction:i,orientation:a,children:(0,l.jsx)(R.Slot,{scope:n,children:(0,l.jsx)(w.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:f})})})}),K=`AccordionItem`,[Me,q]=z(K),J=c.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=W(K,n),o=De(K,n),s=B(n),c=D(),u=r&&o.value.includes(r)||!1,d=a.disabled||e.disabled;return(0,l.jsx)(Me,{scope:n,open:u,disabled:d,triggerId:c,children:(0,l.jsx)(ve,{"data-orientation":a.orientation,"data-state":Q(u),...s,...i,ref:t,disabled:d,open:u,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});J.displayName=K;var Y=`AccordionHeader`,X=c.forwardRef((e,t)=>
1{let{__scopeAccordion:n,...r}=e,i=W(L,n),a=q(Y,n);return(0,l.jsx)(w.h3,{"data-orientation":i.orientation,"data-state":Q(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});X.displayName=Y;var Z=`AccordionTrigger`,Ne=c.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=W(L,n),a=q(Z,n),o=Oe(Z,n),s=B(n);return(0,l.jsx)(R.ItemSlot,{scope:n,children:(0,l.jsx)(ye,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});Ne.displayName=Z;var Pe=`AccordionContent`,Fe=c.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=W(L,n),a=q(Pe,n),o=B(n);return(0,l.jsx)(be,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})});Fe.displayName=Pe;function Q(e){return e?`open`:`closed`}var Ie=V,Le=J,Re=X,ze=Ne,Be=Fe,Ve=Ie,He=c.forwardRef(({className:e,...t},n)=>(0,l.jsx)(Le,{ref:n,className:o(`border-b`,e),...t}));He.displayName=`AccordionItem`;var Ue=c.forwardRef(({className:e,children:t,...n},r)=>(0,l.jsx)(Re,{className:`flex`,children:(0,l.jsxs)(ze,{ref:r,className:o(`flex flex-1 items-center justify-between py-4 text-sm font-medium cursor-pointer transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,l.jsx)(i,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200`})]})}));Ue.displayName=ze.displayName;var $=c.forwardRef(({className:e,children:t,...n},r)=>(0,l.jsx)(Be,{ref:r,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,l.jsx)(`div`,{className:o(`pb-4 pt-0`,e),children:t})}));$.displayName=Be.displayName;export{s as a,Ue as i,$ as n,He as r,Ve as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.