import{aJ as i,ao as t,ap as o,aT as u,b5 as y,L as f,bl as C}from"./app-k0jcl5PQ.js";import{l as d}from"./BhAq_-86.chunk.js";import{C as b}from"./Bj7bJt_4.chunk.js";const h="_copyBtn_1285l_4",g="_embedHtmlInput_1285l_7",x={copyBtn:h,embedHtmlInput:g},v="shared.copyInput",n=f.encloseNamespace(v);p.defaultProps={styling:"normal"};function p(e){const[a,l]=i.useState(e.showCopiedText||!1);function s(){setTimeout(()=>l(!1),2e3)}function c(){e.onCopy&&e.onCopy(),!a&&(l(!0),s())}i.useEffect(()=>{e.showCopiedText&&s()},[e.showCopiedText]);function m(){return e.styling==="normal-v2"?t.jsx(d.CopyToClipboard,{text:e.value,onCopy:c,children:t.jsx(y,{role:a?"status":"",svg:a?C:b,className:o(x.copyBtn,"btn py-0 text-nowrap",a?"btn-success text-white":"btn-outline-dark border-secondary",e.extraButtonClassNames),children:a?e.copiedText||n("copiedLink"):e.copyText||n("copy")})}):t.jsx(d.CopyToClipboard,{text:e.value,onCopy:c,children:t.jsx("button",{role:a?"status":"",className:o("btn btn-outline-dark border border-secondary py-0 text-nowrap",e.extraButtonClassNames),children:a?e.copiedText||n("copied"):e.copyText||n("copy")})})}const r=t.jsxs("div",{className:e.styling==="normal-v2"?"d-flex flex-row gap-2 position-relative w-100":"input-group",children:[e.textarea?t.jsx("textarea",{className:o("form-control rounded w-100 h-100",!e.hasInputBg&&x.embedHtmlInput,e.textAreaClassName),spellCheck:!1,value:e.value,rows:e.rows||7,readOnly:!0}):t.jsx("input",{type:"text",autoComplete:"off",className:o("form-control",e.styling==="normal"&&e.styling),spellCheck:!1,value:e.value,readOnly:!0}),t.jsx(m,{})]});return e.label?t.jsxs(u.Group,{className:"form-group",children:[t.jsx(u.Label,{children:e.label}),r]}):r}export{p as C};
//# sourceMappingURL=BRytmq3u.chunk.js.map
