"use strict";var DesignSystem;(globalThis.webpackChunkDesignSystem=globalThis.webpackChunkDesignSystem||[]).push([[789],{1238:(e,n,t)=>{t.d(n,{A:()=>d});var o=t(2485),a=t.n(o),c=t(1637),s=t(5901);const d=e=>{let{ariaHidden:n,className:t,children:o,description:d,id:i,inversed:r,title:l,viewBox:u,...m}=e;const h=a()("ds-c-icon",{"ds-c-icon--inverse":r},t),v=(0,c.A)("icon--",i),p=`${v}__title`,b=`${v}__desc`,N=d?`${p} ${b}`:p,_=!n,g={};return _&&(g["aria-labelledby"]=N,g.role="img"),(0,s.FD)("svg",{"aria-hidden":n,className:h,id:i??_?v:void 0,viewBox:u,xmlns:"http://www.w3.org/2000/svg",...g,...m,children:[_&&(0,s.Y)("title",{id:p,children:l}),_&&d&&(0,s.Y)("desc",{id:b,children:d}),o]})};d.defaultProps={ariaHidden:!0,inversed:!1}},7819:(e,n,t)=>{var o=t(7142),a=t(2485),c=t.n(a),s=t(5901);const d=e=>{let{bordered:n,children:t,className:o}=e;const a=c()("ds-c-accordion",n&&"ds-c-accordion--bordered",o);return(0,s.Y)("div",{className:a,children:t})},i=e=>{let{bordered:n,...t}=e;return(0,s.Y)(d,{...t,bordered:n&&Boolean(JSON.parse(n))})};(0,o.E)("ds-accordion",(()=>i),{attributes:["class-name","bordered"],shadow:!0});var r=t(7402),l=t(4987),u=t(1238);const m={className:"",viewBox:"0 0 24 24"},h={className:"",viewBox:"3 3 18 18"};var v=t(1637);const p=e=>{let{buttonClassName:n,children:t,contentClassName:o,defaultOpen:a,heading:d,headingLevel:i,id:l,isControlledOpen:u,onChange:m,closeIconComponent:h,openIconComponent:p}=e;const b=c()("ds-c-accordion__content",o),N=c()("ds-c-accordion__button",n),_=`h${i}`,g=(0,v.A)("accordion-item--",l),f=`${g}__button`,C=void 0!==u,[Y,w]=(0,r.useState)(C?u:a),$=C?u:Y,D=h,O=p,S=(0,s.Y)(D,{className:"ds-c-accordion__button-icon",id:`${g}__icon`}),F=(0,s.Y)(O,{className:"ds-c-accordion__button-icon",id:`${g}__icon`});if(d)return(0,s.FD)(s.FK,{children:[(0,s.Y)(_,{className:"ds-c-accordion__heading",children:(0,s.FD)("button",{className:N,"aria-expanded":$,"aria-controls":g,id:f,onClick:e=>{m?.(e),C||w(!Y)},type:"button",children:[d,$?S:F]})}),(0,s.Y)("div",{className:b,id:g,hidden:C?!u:!Y,children:t})]})};p.defaultProps={defaultOpen:!1,headingLevel:"2",closeIconComponent:function(e){const n=`ds-c-icon--remove ${e.className||""}`;return(0,s.Y)(u.A,{title:(0,l.t)("icons.remove"),...m,...e,className:n,children:(0,s.Y)("path",{d:"M19 13H5v-2h14v2z"})})},openIconComponent:function(e){const n=`ds-c-icon--add ${e.className||""}`;return(0,s.Y)(u.A,{title:(0,l.t)("icons.add"),...h,...e,className:n,children:(0,s.Y)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})}};var b=t(5590);const N=e=>{let{defaultOpen:n,contentId:t,contentClassName:o,customElement:a,...d}=e;const i=function(e){let n,t=e.parentElement;do{if("DS-ACCORDION"===t.tagName){n=t;break}t=t.parentElement}while(null!=t);return n}(a),r=(0,b.$Q)(i?.getAttribute("bordered"));return(0,s.Y)(p,{...d,defaultOpen:(0,b.$Q)(n),id:t,contentClassName:c()(o,r&&"ds-c-accordion__content--bordered")})};(0,o.E)("ds-accordion-item",(()=>N),{attributes:["button-class-name","content-class-name","content-id","default-open","heading","heading-level"],events:["onChange"],shadow:!0,passCustomElementProp:!0})},5590:(e,n,t)=>{function o(e){return void 0!==e&&"false"!==e}function a(e){return e?new Date(e):void 0}function c(e){if(void 0!==e)return parseInt(e)}function s(e){return(e=>{try{JSON.parse(e)}catch(e){return!1}return!0})(e)?JSON.parse(e):e}t.d(n,{$Q:()=>o,Rk:()=>s,Tt:()=>c,tv:()=>a})},5901:(e,n,t)=>{t.d(n,{FD:()=>o.FD,FK:()=>o.FK,Y:()=>o.Y}),t(7402);var o=t(201)}},e=>{var n=e(e.s=7819);DesignSystem=n}]);
//# sourceMappingURL=ds-accordion.js.map