1import{r as s,R as d}from"./index-t2syyCXo.js";import{f as p,U as L}from"./ButtonGroup-DMO-zSCm.js";import{a as N}from"./Banner-BX0o9yUu.js";var C={Collapsible:"Polaris-Collapsible",isFullyClosed:"Polaris-Collapsible--isFullyClosed",expandOnPrint:"Polaris-Collapsible--expandOnPrint"};function T({id:l,expandOnPrint:n,open:e,transition:a=!0,children:f,onAnimationEnd:o}){const[b,r]=s.useState(0),[i,m]=s.useState(e),[c,u]=s.useState("idle"),t=s.useRef(null),g=c==="idle"&&e&&i,y=c==="idle"&&!e&&!i,x=n||!y?f:null,v=p(C.Collapsible,y&&C.isFullyClosed,n&&C.expandOnPrint),k=P(a),S={...typeof a=="object"&&{transitionDuration:a.duration,transitionTimingFunction:a.timingFunction},maxHeight:g?"none":`${b}px`,overflow:g?"visible":"hidden"},E=s.useCallback(({target:H})=>{H===t.current&&(u("idle"),m(e),o&&o())},[o,e]),F=s.useCallback(()=>{k?(m(e),u("idle"),e&&t.current?r(t.current.scrollHeight):r(0)):u("measuring")},[e,k]);return s.useEffect(()=>{e!==i&&F()},[e,i]),s.useEffect(()=>{!e||!t.current||r(t.current.scrollHeight)},[]),s.useEffect(()=>{if(t.current)switch(c){case"idle":break;case"measuring":r(t.current.scrollHeight),u("animating");break;case"animating":r(e?t.current.scrollHeight:0)}},[c,e,i]),d.createElement("div",{id:l,style:S,ref:t,className:v,onTransitionEnd:E,"aria-hidden":!e},x)}const O=/^0(ms|s)$/;function P(l){if(typeof l=="boolean")return!l;const{duration:n}=l;return!!(n&&O.test(n.trim()))}var h={Link:"Polaris-Link",monochrome:"Polaris-Link--monochrome",removeUnderline:"Polaris-Link--removeUnderline"};function $({url:l,children:n,onClick:e,external:a,target:f,id:o,monochrome:b,removeUnderline:r,accessibilityLabel:i,dataPrimaryLink:m}){return d.createElement(N.Consumer,null,c=>{const u=b||c,t=p(h.Link,u&&h.monochrome,r&&h.removeUnderline);return l?d.createElement(L,{onClick:e,className:t,url:l,external:a,target:f,id:o,"aria-label":i,"data-primary-link":m},n):d.createElement("button",{type:"button",onClick:e,className:t,id:o,"aria-label":i,"data-primary-link":m},n)})}export{T as C,$ as L};
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.