@appforgeapps/uiforge 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/uiforge.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),Ut=({variant:t="primary",size:e="medium",theme:r="light",density:n="default",children:a,className:f="",...l})=>{const c="uiforge-button",j=`${c}--${t}`,k=`${c}--${e}`,$=`${c}--${r}`,E=n==="condensed"?`${c}--condensed`:"",A=[c,j,k,$,E,f].filter(Boolean).join(" ");return s.jsx("button",{className:A,"data-theme":r,...l,children:a})},Ot=({isOpen:t,controlsId:e,ariaLabel:r="Toggle menu",className:n="",size:a="medium",...f})=>{const l="uiforge-hamburger-button",c=[l,`${l}--${a}`,t&&`${l}--open`,n].filter(Boolean).join(" ");return s.jsxs("button",{type:"button",className:c,"aria-expanded":t,"aria-controls":e,"aria-label":r,...f,children:[s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"})]})},zt=({columns:t,data:e,theme:r="light",selectable:n=!1,selectedRows:a,getRowKey:f=(U,C)=>C,onSelectionChange:l,onCellEdit:c,actionButtons:j=[],searchable:k=!1,searchPlaceholder:$="Search...",onSearch:E,customFilter:A,pagination:d,onPageChange:w,onPageSizeChange:i,pageSizeOptions:u=[10,25,50,100],className:h="",loading:x=!1,emptyMessage:S="No data available"})=>{const[U,C]=o.useState(new Set),[y,M]=o.useState(""),[L,O]=o.useState(null),[R,W]=o.useState(""),v=a??U,N=o.useMemo(()=>!k||!y?e:e.filter(p=>A?A(p,y):Object.values(p).some(V=>V==null?!1:String(V).toLowerCase().includes(y.toLowerCase()))),[e,y,k,A]),_=o.useMemo(()=>{if(!d||d.serverSide)return N;const p=d.currentPage*d.pageSize,V=p+d.pageSize;return N.slice(p,V)},[N,d]),b=o.useMemo(()=>d?d.serverSide&&d.totalItems!==void 0?Math.ceil(d.totalItems/d.pageSize):Math.ceil(N.length/d.pageSize):1,[d,N.length]),re=o.useCallback(()=>e.filter((p,V)=>{const H=f(p,V);return v.has(H)}),[e,v,f]),Y=o.useCallback(p=>{const V=new Set;p&&_.forEach(H=>{const K=e.indexOf(H),ae=f(H,K);V.add(ae)}),a===void 0&&C(V),l?.(V,p?_:[])},[_,e,f,l,a]),te=o.useCallback((p,V,H)=>{const K=new Set(v);H?K.add(p):K.delete(p),a===void 0&&C(K);const ae=e.filter((q,de)=>{const he=f(q,de);return K.has(he)});l?.(K,ae)},[v,e,f,l,a]),X=o.useCallback(p=>{M(p),E?.(p)},[E]),ne=o.useCallback((p,V,H)=>{O({rowKey:p,columnKey:V}),W(H)},[]),se=o.useCallback((p,V,H)=>{c?.(p,V,R,H),O(null),W("")},[R,c]),T=o.useCallback(()=>{O(null),W("")},[]),oe=o.useCallback(p=>{d&&w?.(p,d.pageSize)},[d,w]),Z=o.useCallback(p=>{i?.(p),d&&w?.(0,p)},[i,w,d]),ee=o.useMemo(()=>_.length===0?!1:_.every(p=>{const V=e.indexOf(p),H=f(p,V);return v.has(H)}),[_,v,e,f]),le=o.useMemo(()=>_.length===0?!1:_.some(V=>{const H=e.indexOf(V),K=f(V,H);return v.has(K)})&&!ee,[_,v,ee,e,f]),I="uiforge-grid",F=`${I}--${r}`;return s.jsxs("div",{className:`${I} ${F} ${h}`.trim(),"data-theme":r,children:[(k||j.length>0)&&s.jsxs("div",{className:`${I}__toolbar`,children:[k&&s.jsx("div",{className:`${I}__search`,children:s.jsx("input",{type:"text",className:`${I}__search-input`,placeholder:$,value:y,onChange:p=>X(p.target.value),"aria-label":"Search"})}),j.length>0&&s.jsx("div",{className:`${I}__actions`,children:j.map((p,V)=>{const H=p.disabled||p.requiresSelection&&v.size===0;return s.jsx("button",{className:`${I}__action-button ${I}__action-button--${p.variant||"primary"}`,onClick:()=>p.onClick(re()),disabled:H,children:p.label},V)})})]}),s.jsx("div",{className:`${I}__table-container`,children:s.jsxs("table",{className:`${I}__table`,role:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[n&&s.jsx("th",{className:`${I}__header-cell ${I}__header-cell--checkbox`,children:s.jsx("input",{type:"checkbox",checked:ee,ref:p=>{p&&(p.indeterminate=le)},onChange:p=>Y(p.target.checked),"aria-label":"Select all rows"})}),t.map(p=>s.jsx("th",{className:`${I}__header-cell`,style:{width:p.width},children:p.header},p.key))]})}),s.jsx("tbody",{children:x?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length+(n?1:0),className:`${I}__loading-cell`,children:"Loading..."})}):_.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length+(n?1:0),className:`${I}__empty-cell`,children:S})}):_.map((p,V)=>{const H=e.indexOf(p),K=f(p,H),ae=v.has(K);return s.jsxs("tr",{className:`${I}__row ${ae?`${I}__row--selected`:""}`,children:[n&&s.jsx("td",{className:`${I}__cell ${I}__cell--checkbox`,children:s.jsx("input",{type:"checkbox",checked:ae,onChange:q=>te(K,p,q.target.checked),"aria-label":`Select row ${V+1}`})}),t.map(q=>{const de=q.field?p[q.field]:void 0,he=L?.rowKey===K&&L?.columnKey===q.key;return s.jsx("td",{className:`${I}__cell`,children:he?s.jsxs("div",{className:`${I}__edit-cell`,children:[s.jsx("input",{type:"text",className:`${I}__edit-input`,value:String(R??""),onChange:ie=>W(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"?se(K,q.key,p):ie.key==="Escape"&&T()},autoFocus:!0,"aria-label":`Edit ${q.header}`}),s.jsx("button",{className:`${I}__edit-button ${I}__edit-button--save`,onClick:()=>se(K,q.key,p),"aria-label":"Save",children:"✓"}),s.jsx("button",{className:`${I}__edit-button ${I}__edit-button--cancel`,onClick:T,"aria-label":"Cancel",children:"✕"})]}):s.jsx("div",{className:`${I}__cell-content ${q.editable?`${I}__cell-content--editable`:""}`,onClick:()=>{q.editable&&ne(K,q.key,de)},onKeyDown:ie=>{q.editable&&(ie.key==="Enter"||ie.key===" ")&&ne(K,q.key,de)},tabIndex:q.editable?0:void 0,role:q.editable?"button":void 0,"aria-label":q.editable?`Edit ${q.header}`:void 0,children:q.render?q.render(de,p,H):String(de??"")})},q.key)})]},K)})})]})}),d&&b>1&&s.jsxs("div",{className:`${I}__pagination`,children:[s.jsx("div",{className:`${I}__pagination-info`,children:d.serverSide&&d.totalItems!==void 0?s.jsxs(s.Fragment,{children:["Showing ",d.currentPage*d.pageSize+1," to"," ",Math.min((d.currentPage+1)*d.pageSize,d.totalItems)," ","of ",d.totalItems," items"]}):s.jsxs(s.Fragment,{children:["Showing ",d.currentPage*d.pageSize+1," to"," ",Math.min((d.currentPage+1)*d.pageSize,N.length)," ","of ",N.length," items"]})}),s.jsxs("div",{className:`${I}__pagination-controls`,children:[s.jsx("button",{className:`${I}__pagination-button`,onClick:()=>oe(d.currentPage-1),disabled:d.currentPage===0,"aria-label":"Previous page",children:"‹"}),Array.from({length:b},(p,V)=>V).map(p=>p===0||p===b-1||Math.abs(p-d.currentPage)<=1?s.jsx("button",{className:`${I}__pagination-button ${p===d.currentPage?`${I}__pagination-button--active`:""}`,onClick:()=>oe(p),"aria-label":`Page ${p+1}`,"aria-current":p===d.currentPage?"page":void 0,children:p+1},p):p===d.currentPage-2||p===d.currentPage+2?s.jsx("span",{className:`${I}__pagination-ellipsis`,children:"..."},p):null),s.jsx("button",{className:`${I}__pagination-button`,onClick:()=>oe(d.currentPage+1),disabled:d.currentPage>=b-1,"aria-label":"Next page",children:"›"})]}),s.jsxs("div",{className:`${I}__page-size`,children:[s.jsx("label",{htmlFor:"page-size-select",children:"Items per page:"}),s.jsx("select",{id:"page-size-select",className:`${I}__page-size-select`,value:d.pageSize,onChange:p=>Z(Number(p.target.value)),children:u.map(p=>s.jsx("option",{value:p,children:p},p))})]})]})]})},Rt=()=>`block-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,_e=(t="paragraph")=>({id:Rt(),type:t,content:"",format:{}}),Vt=({initialBlocks:t=[],onChange:e,placeholder:r="Start typing...",readOnly:n=!1,theme:a="light",className:f="",maxHeight:l})=>{const[c,j]=o.useState(t.length>0?t:[_e()]),[k,$]=o.useState(null),[E,A]=o.useState(null),[d,w]=o.useState(!1),i=o.useRef(null);o.useEffect(()=>{e&&e(c)},[c,e]);const u=o.useCallback((v,N)=>{j(_=>_.map(b=>b.id===v?{...b,...N}:b))},[]),h=o.useCallback((v="paragraph",N)=>{const _=_e(v);j(b=>{if(!N)return[...b,_];const re=b.findIndex(te=>te.id===N),Y=[...b];return Y.splice(re+1,0,_),Y}),$(_.id)},[]),x=o.useCallback(v=>{j(N=>{const _=N.filter(b=>b.id!==v);return _.length>0?_:[_e()]})},[]),S=o.useCallback((v,N)=>{j(_=>{const b=_.findIndex(X=>X.id===v),re=_.findIndex(X=>X.id===N);if(b===-1||re===-1)return _;const Y=[..._],[te]=Y.splice(b,1);return Y.splice(re,0,te),Y})},[]),U=o.useCallback((v,N)=>{n||(A(N),v.dataTransfer.effectAllowed="move")},[n]),C=o.useCallback(v=>{v.preventDefault(),v.dataTransfer.dropEffect="move"},[]),y=o.useCallback((v,N)=>{v.preventDefault(),E&&E!==N&&S(E,N),A(null)},[E,S]),M=o.useCallback(()=>{A(null)},[]),L=o.useCallback(v=>{k&&j(N=>N.map(_=>{if(_.id===k){const b=_.format||{};return{..._,format:{...b,[v]:!b[v]}}}return _}))},[k]),O=o.useCallback((v,N)=>{u(v,{type:N})},[u]),R=o.useCallback((v,N)=>{if(!n){if((v.metaKey||v.ctrlKey)&&v.key==="b")v.preventDefault(),L("bold");else if((v.metaKey||v.ctrlKey)&&v.key==="i")v.preventDefault(),L("italic");else if((v.metaKey||v.ctrlKey)&&v.key==="u")v.preventDefault(),L("underline");else if(v.key==="Enter"&&!v.shiftKey){const _=c.find(b=>b.id===N);_&&_.type!=="code"&&(v.preventDefault(),h("paragraph",N))}else if(v.key==="Backspace"){const _=c.find(b=>b.id===N);_&&!_.content&&c.length>1&&(v.preventDefault(),x(N))}}},[n,c,L,h,x]),W=`uiforge-blocks-editor--${a}`;return s.jsxs("div",{className:`uiforge-blocks-editor ${W} ${f}`,ref:i,style:{maxHeight:l},"data-theme":a,children:[!n&&d&&k&&s.jsx(Tt,{selectedBlock:c.find(v=>v.id===k),onFormatToggle:L,onBlockTypeChange:v=>O(k,v)}),s.jsx("div",{className:"uiforge-blocks-editor__content",children:c.map((v,N)=>s.jsx(Bt,{block:v,isSelected:k===v.id,isDragging:E===v.id,readOnly:n,placeholder:N===0&&c.length===1?r:void 0,onSelect:()=>{$(v.id),w(!0)},onChange:_=>u(v.id,_),onDelete:()=>x(v.id),onDragStart:_=>U(_,v.id),onDragOver:C,onDrop:_=>y(_,v.id),onDragEnd:M,onKeyDown:_=>R(_,v.id)},v.id))}),!n&&s.jsx(Ht,{onAddBlock:h})]})},Tt=({selectedBlock:t,onFormatToggle:e,onBlockTypeChange:r})=>{if(!t)return null;const n=t.format||{};return s.jsxs("div",{className:"uiforge-blocks-editor__toolbar",role:"toolbar","aria-label":"Text formatting",children:[s.jsx("div",{className:"uiforge-blocks-editor__toolbar-group",children:s.jsxs("select",{value:t.type,onChange:a=>r(a.target.value),className:"uiforge-blocks-editor__toolbar-select","aria-label":"Block type",children:[s.jsx("option",{value:"paragraph",children:"Paragraph"}),s.jsx("option",{value:"heading1",children:"Heading 1"}),s.jsx("option",{value:"heading2",children:"Heading 2"}),s.jsx("option",{value:"heading3",children:"Heading 3"}),s.jsx("option",{value:"list",children:"List"}),s.jsx("option",{value:"quote",children:"Quote"}),s.jsx("option",{value:"code",children:"Code"}),s.jsx("option",{value:"image",children:"Image"})]})}),s.jsx("div",{className:"uiforge-blocks-editor__toolbar-divider"}),s.jsxs("div",{className:"uiforge-blocks-editor__toolbar-group",children:[s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.bold?"active":""}`,onClick:()=>e("bold"),title:"Bold (Ctrl+B)","aria-label":"Bold","aria-pressed":n.bold,children:s.jsx("strong",{children:"B"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.italic?"active":""}`,onClick:()=>e("italic"),title:"Italic (Ctrl+I)","aria-label":"Italic","aria-pressed":n.italic,children:s.jsx("em",{children:"I"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.underline?"active":""}`,onClick:()=>e("underline"),title:"Underline (Ctrl+U)","aria-label":"Underline","aria-pressed":n.underline,children:s.jsx("u",{children:"U"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.code?"active":""}`,onClick:()=>e("code"),title:"Inline Code","aria-label":"Code","aria-pressed":n.code,children:"</>"})]})]})},Bt=({block:t,isSelected:e,isDragging:r,readOnly:n,placeholder:a,onSelect:f,onChange:l,onDelete:c,onDragStart:j,onDragOver:k,onDrop:$,onDragEnd:E,onKeyDown:A})=>{const d=["uiforge-blocks-editor__block",`uiforge-blocks-editor__block--${t.type}`,e?"uiforge-blocks-editor__block--selected":"",r?"uiforge-blocks-editor__block--dragging":""].filter(Boolean).join(" "),w=["uiforge-blocks-editor__block-text",t.format?.bold?"uiforge-blocks-editor__block-text--bold":"",t.format?.italic?"uiforge-blocks-editor__block-text--italic":"",t.format?.underline?"uiforge-blocks-editor__block-text--underline":"",t.format?.code?"uiforge-blocks-editor__block-text--code":""].filter(Boolean).join(" "),i=h=>{l({content:h.target.value})},u=()=>{const h={value:t.content,onChange:i,onFocus:f,onKeyDown:A,placeholder:a,readOnly:n,className:w};switch(t.type){case"heading1":return s.jsx("input",{...h,type:"text",className:`${w} uiforge-blocks-editor__heading1`,placeholder:a||"Heading 1"});case"heading2":return s.jsx("input",{...h,type:"text",className:`${w} uiforge-blocks-editor__heading2`,placeholder:a||"Heading 2"});case"heading3":return s.jsx("input",{...h,type:"text",className:`${w} uiforge-blocks-editor__heading3`,placeholder:a||"Heading 3"});case"code":return s.jsx("textarea",{...h,className:`${w} uiforge-blocks-editor__code`,placeholder:a||"Code block",rows:4});case"quote":return s.jsx("textarea",{...h,className:`${w} uiforge-blocks-editor__quote`,placeholder:a||"Quote",rows:2});case"image":return s.jsxs("div",{className:"uiforge-blocks-editor__image-block",children:[s.jsx("input",{type:"text",value:t.imageUrl||"",onChange:x=>l({imageUrl:x.target.value}),placeholder:"Image URL",className:"uiforge-blocks-editor__image-url",readOnly:n}),s.jsx("input",{type:"text",value:t.imageAlt||"",onChange:x=>l({imageAlt:x.target.value}),placeholder:"Alt text",className:"uiforge-blocks-editor__image-alt",readOnly:n}),t.imageUrl&&s.jsx("img",{src:t.imageUrl,alt:t.imageAlt||"Block image",className:"uiforge-blocks-editor__image-preview"})]});default:return s.jsx("textarea",{...h,className:`${w} uiforge-blocks-editor__paragraph`,placeholder:a||"Start typing...",rows:1,style:{minHeight:"1.5em"}})}};return s.jsxs("div",{className:d,draggable:!n,onDragStart:j,onDragOver:k,onDrop:$,onDragEnd:E,"data-block-id":t.id,children:[!n&&s.jsxs("div",{className:"uiforge-blocks-editor__block-controls",children:[s.jsx("button",{type:"button",className:"uiforge-blocks-editor__drag-handle",title:"Drag to reorder","aria-label":"Drag to reorder",children:"⋮⋮"}),s.jsx("button",{type:"button",className:"uiforge-blocks-editor__delete-button",onClick:c,title:"Delete block","aria-label":"Delete block",children:"×"})]}),s.jsx("div",{className:"uiforge-blocks-editor__block-content",children:u()})]})},Ht=({onAddBlock:t})=>{const[e,r]=o.useState(!1),n=[{type:"paragraph",label:"Paragraph",icon:"¶"},{type:"heading1",label:"Heading 1",icon:"H1"},{type:"heading2",label:"Heading 2",icon:"H2"},{type:"heading3",label:"Heading 3",icon:"H3"},{type:"list",label:"List",icon:"≡"},{type:"quote",label:"Quote",icon:'"'},{type:"code",label:"Code",icon:"</>"},{type:"image",label:"Image",icon:"🖼"}];return s.jsxs("div",{className:"uiforge-blocks-editor__block-menu",children:[s.jsx("button",{type:"button",className:"uiforge-blocks-editor__add-button",onClick:()=>r(!e),"aria-label":"Add block","aria-expanded":e,children:"+ Add Block"}),e&&s.jsx("div",{className:"uiforge-blocks-editor__block-menu-dropdown",children:n.map(({type:a,label:f,icon:l})=>s.jsxs("button",{type:"button",className:"uiforge-blocks-editor__block-menu-item",onClick:()=>{t(a),r(!1)},children:[s.jsx("span",{className:"uiforge-blocks-editor__block-menu-icon",children:l}),s.jsx("span",{children:f})]},a))})]})};function Ie(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Wt(t){const e=t.trim(),r=["javascript:","data:","vbscript:","file:"],n=e.toLowerCase();for(const a of r)if(n.startsWith(a))return"";return e}function Ft(t){return t.map(e=>{let r=Ie(e.content);switch(e.format?.bold&&(r=`<strong>${r}</strong>`),e.format?.italic&&(r=`<em>${r}</em>`),e.format?.underline&&(r=`<u>${r}</u>`),e.format?.code&&(r=`<code>${r}</code>`),e.type){case"heading1":return`<h1>${r}</h1>`;case"heading2":return`<h2>${r}</h2>`;case"heading3":return`<h3>${r}</h3>`;case"quote":return`<blockquote>${r}</blockquote>`;case"code":return`<pre><code>${Ie(e.content)}</code></pre>`;case"image":{const n=Wt(e.imageUrl||""),a=Ie(e.imageAlt||"");return n?`<img src="${n}" alt="${a}" />`:""}case"list":return`<ul><li>${r}</li></ul>`;default:return`<p>${r}</p>`}}).join(`
2
- `)}function qt(t){return t.map(e=>{let r=e.content;switch(e.format?.bold&&(r=`**${r}**`),e.format?.italic&&(r=`*${r}*`),e.format?.code&&(r=`\`${r}\``),e.type){case"heading1":return`# ${r}`;case"heading2":return`## ${r}`;case"heading3":return`### ${r}`;case"quote":return`> ${r}`;case"code":return`\`\`\`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),Ot=({variant:t="primary",size:e="medium",theme:r="light",density:n="default",children:a,className:d="",...l})=>{const c="uiforge-button",_=`${c}--${t}`,w=`${c}--${e}`,L=`${c}--${r}`,A=n==="condensed"?`${c}--condensed`:"",S=[c,_,w,L,A,d].filter(Boolean).join(" ");return s.jsx("button",{className:S,"data-theme":r,...l,children:a})},Ut=({isOpen:t,controlsId:e,ariaLabel:r="Toggle menu",className:n="",size:a="medium",...d})=>{const l="uiforge-hamburger-button",c=[l,`${l}--${a}`,t&&`${l}--open`,n].filter(Boolean).join(" ");return s.jsxs("button",{type:"button",className:c,"aria-expanded":t,"aria-controls":e,"aria-label":r,...d,children:[s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"})]})},zt=({icon:t,size:e="medium",ariaLabel:r,badge:n,className:a="",disabled:d,...l})=>{const c="uiforge-icon-button",_=[c,`${c}--${e}`,a].filter(Boolean).join(" ");return s.jsxs("button",{type:"button",className:_,"aria-label":r,disabled:d,...l,children:[s.jsx("span",{className:`${c}__icon`,"aria-hidden":"true",children:t}),n!==void 0&&s.jsx("span",{className:`${c}__badge`,"aria-hidden":"true",children:n})]})},Vt=({columns:t,data:e,theme:r="light",selectable:n=!1,selectedRows:a,getRowKey:d=(P,$)=>$,onSelectionChange:l,onCellEdit:c,actionButtons:_=[],searchable:w=!1,searchPlaceholder:L="Search...",onSearch:A,customFilter:S,pagination:u,onPageChange:C,onPageSizeChange:o,pageSizeOptions:h=[10,25,50,100],className:f="",loading:b=!1,emptyMessage:k="No data available"})=>{const[P,$]=i.useState(new Set),[j,E]=i.useState(""),[D,N]=i.useState(null),[z,B]=i.useState(""),v=a??P,m=i.useMemo(()=>!w||!j?e:e.filter(g=>S?S(g,j):Object.values(g).some(V=>V==null?!1:String(V).toLowerCase().includes(j.toLowerCase()))),[e,j,w,S]),y=i.useMemo(()=>{if(!u||u.serverSide)return m;const g=u.currentPage*u.pageSize,V=g+u.pageSize;return m.slice(g,V)},[m,u]),I=i.useMemo(()=>u?u.serverSide&&u.totalItems!==void 0?Math.ceil(u.totalItems/u.pageSize):Math.ceil(m.length/u.pageSize):1,[u,m.length]),te=i.useCallback(()=>e.filter((g,V)=>{const W=d(g,V);return v.has(W)}),[e,v,d]),Y=i.useCallback(g=>{const V=new Set;g&&y.forEach(W=>{const K=e.indexOf(W),ae=d(W,K);V.add(ae)}),a===void 0&&$(V),l?.(V,g?y:[])},[y,e,d,l,a]),re=i.useCallback((g,V,W)=>{const K=new Set(v);W?K.add(g):K.delete(g),a===void 0&&$(K);const ae=e.filter((q,de)=>{const he=d(q,de);return K.has(he)});l?.(K,ae)},[v,e,d,l,a]),X=i.useCallback(g=>{E(g),A?.(g)},[A]),ne=i.useCallback((g,V,W)=>{N({rowKey:g,columnKey:V}),B(W)},[]),se=i.useCallback((g,V,W)=>{c?.(g,V,z,W),N(null),B("")},[z,c]),T=i.useCallback(()=>{N(null),B("")},[]),oe=i.useCallback(g=>{u&&C?.(g,u.pageSize)},[u,C]),Z=i.useCallback(g=>{o?.(g),u&&C?.(0,g)},[o,C,u]),ee=i.useMemo(()=>y.length===0?!1:y.every(g=>{const V=e.indexOf(g),W=d(g,V);return v.has(W)}),[y,v,e,d]),le=i.useMemo(()=>y.length===0?!1:y.some(V=>{const W=e.indexOf(V),K=d(V,W);return v.has(K)})&&!ee,[y,v,ee,e,d]),M="uiforge-grid",F=`${M}--${r}`;return s.jsxs("div",{className:`${M} ${F} ${f}`.trim(),"data-theme":r,children:[(w||_.length>0)&&s.jsxs("div",{className:`${M}__toolbar`,children:[w&&s.jsx("div",{className:`${M}__search`,children:s.jsx("input",{type:"text",className:`${M}__search-input`,placeholder:L,value:j,onChange:g=>X(g.target.value),"aria-label":"Search"})}),_.length>0&&s.jsx("div",{className:`${M}__actions`,children:_.map((g,V)=>{const W=g.disabled||g.requiresSelection&&v.size===0;return s.jsx("button",{className:`${M}__action-button ${M}__action-button--${g.variant||"primary"}`,onClick:()=>g.onClick(te()),disabled:W,children:g.label},V)})})]}),s.jsx("div",{className:`${M}__table-container`,children:s.jsxs("table",{className:`${M}__table`,role:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[n&&s.jsx("th",{className:`${M}__header-cell ${M}__header-cell--checkbox`,children:s.jsx("input",{type:"checkbox",checked:ee,ref:g=>{g&&(g.indeterminate=le)},onChange:g=>Y(g.target.checked),"aria-label":"Select all rows"})}),t.map(g=>s.jsx("th",{className:`${M}__header-cell`,style:{width:g.width},children:g.header},g.key))]})}),s.jsx("tbody",{children:b?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length+(n?1:0),className:`${M}__loading-cell`,children:"Loading..."})}):y.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length+(n?1:0),className:`${M}__empty-cell`,children:k})}):y.map((g,V)=>{const W=e.indexOf(g),K=d(g,W),ae=v.has(K);return s.jsxs("tr",{className:`${M}__row ${ae?`${M}__row--selected`:""}`,children:[n&&s.jsx("td",{className:`${M}__cell ${M}__cell--checkbox`,children:s.jsx("input",{type:"checkbox",checked:ae,onChange:q=>re(K,g,q.target.checked),"aria-label":`Select row ${V+1}`})}),t.map(q=>{const de=q.field?g[q.field]:void 0,he=D?.rowKey===K&&D?.columnKey===q.key;return s.jsx("td",{className:`${M}__cell`,children:he?s.jsxs("div",{className:`${M}__edit-cell`,children:[s.jsx("input",{type:"text",className:`${M}__edit-input`,value:String(z??""),onChange:ie=>B(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"?se(K,q.key,g):ie.key==="Escape"&&T()},autoFocus:!0,"aria-label":`Edit ${q.header}`}),s.jsx("button",{className:`${M}__edit-button ${M}__edit-button--save`,onClick:()=>se(K,q.key,g),"aria-label":"Save",children:"✓"}),s.jsx("button",{className:`${M}__edit-button ${M}__edit-button--cancel`,onClick:T,"aria-label":"Cancel",children:"✕"})]}):s.jsx("div",{className:`${M}__cell-content ${q.editable?`${M}__cell-content--editable`:""}`,onClick:()=>{q.editable&&ne(K,q.key,de)},onKeyDown:ie=>{q.editable&&(ie.key==="Enter"||ie.key===" ")&&ne(K,q.key,de)},tabIndex:q.editable?0:void 0,role:q.editable?"button":void 0,"aria-label":q.editable?`Edit ${q.header}`:void 0,children:q.render?q.render(de,g,W):String(de??"")})},q.key)})]},K)})})]})}),u&&I>1&&s.jsxs("div",{className:`${M}__pagination`,children:[s.jsx("div",{className:`${M}__pagination-info`,children:u.serverSide&&u.totalItems!==void 0?s.jsxs(s.Fragment,{children:["Showing ",u.currentPage*u.pageSize+1," to"," ",Math.min((u.currentPage+1)*u.pageSize,u.totalItems)," ","of ",u.totalItems," items"]}):s.jsxs(s.Fragment,{children:["Showing ",u.currentPage*u.pageSize+1," to"," ",Math.min((u.currentPage+1)*u.pageSize,m.length)," ","of ",m.length," items"]})}),s.jsxs("div",{className:`${M}__pagination-controls`,children:[s.jsx("button",{className:`${M}__pagination-button`,onClick:()=>oe(u.currentPage-1),disabled:u.currentPage===0,"aria-label":"Previous page",children:"‹"}),Array.from({length:I},(g,V)=>V).map(g=>g===0||g===I-1||Math.abs(g-u.currentPage)<=1?s.jsx("button",{className:`${M}__pagination-button ${g===u.currentPage?`${M}__pagination-button--active`:""}`,onClick:()=>oe(g),"aria-label":`Page ${g+1}`,"aria-current":g===u.currentPage?"page":void 0,children:g+1},g):g===u.currentPage-2||g===u.currentPage+2?s.jsx("span",{className:`${M}__pagination-ellipsis`,children:"..."},g):null),s.jsx("button",{className:`${M}__pagination-button`,onClick:()=>oe(u.currentPage+1),disabled:u.currentPage>=I-1,"aria-label":"Next page",children:"›"})]}),s.jsxs("div",{className:`${M}__page-size`,children:[s.jsx("label",{htmlFor:"page-size-select",children:"Items per page:"}),s.jsx("select",{id:"page-size-select",className:`${M}__page-size-select`,value:u.pageSize,onChange:g=>Z(Number(g.target.value)),children:h.map(g=>s.jsx("option",{value:g,children:g},g))})]})]})]})},Bt=()=>`block-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,_e=(t="paragraph")=>({id:Bt(),type:t,content:"",format:{}}),Tt=({initialBlocks:t=[],onChange:e,placeholder:r="Start typing...",readOnly:n=!1,theme:a="light",className:d="",maxHeight:l})=>{const[c,_]=i.useState(t.length>0?t:[_e()]),[w,L]=i.useState(null),[A,S]=i.useState(null),[u,C]=i.useState(!1),o=i.useRef(null);i.useEffect(()=>{e&&e(c)},[c,e]);const h=i.useCallback((v,m)=>{_(y=>y.map(I=>I.id===v?{...I,...m}:I))},[]),f=i.useCallback((v="paragraph",m)=>{const y=_e(v);_(I=>{if(!m)return[...I,y];const te=I.findIndex(re=>re.id===m),Y=[...I];return Y.splice(te+1,0,y),Y}),L(y.id)},[]),b=i.useCallback(v=>{_(m=>{const y=m.filter(I=>I.id!==v);return y.length>0?y:[_e()]})},[]),k=i.useCallback((v,m)=>{_(y=>{const I=y.findIndex(X=>X.id===v),te=y.findIndex(X=>X.id===m);if(I===-1||te===-1)return y;const Y=[...y],[re]=Y.splice(I,1);return Y.splice(te,0,re),Y})},[]),P=i.useCallback((v,m)=>{n||(S(m),v.dataTransfer.effectAllowed="move")},[n]),$=i.useCallback(v=>{v.preventDefault(),v.dataTransfer.dropEffect="move"},[]),j=i.useCallback((v,m)=>{v.preventDefault(),A&&A!==m&&k(A,m),S(null)},[A,k]),E=i.useCallback(()=>{S(null)},[]),D=i.useCallback(v=>{w&&_(m=>m.map(y=>{if(y.id===w){const I=y.format||{};return{...y,format:{...I,[v]:!I[v]}}}return y}))},[w]),N=i.useCallback((v,m)=>{h(v,{type:m})},[h]),z=i.useCallback((v,m)=>{if(!n){if((v.metaKey||v.ctrlKey)&&v.key==="b")v.preventDefault(),D("bold");else if((v.metaKey||v.ctrlKey)&&v.key==="i")v.preventDefault(),D("italic");else if((v.metaKey||v.ctrlKey)&&v.key==="u")v.preventDefault(),D("underline");else if(v.key==="Enter"&&!v.shiftKey){const y=c.find(I=>I.id===m);y&&y.type!=="code"&&(v.preventDefault(),f("paragraph",m))}else if(v.key==="Backspace"){const y=c.find(I=>I.id===m);y&&!y.content&&c.length>1&&(v.preventDefault(),b(m))}}},[n,c,D,f,b]),B=`uiforge-blocks-editor--${a}`;return s.jsxs("div",{className:`uiforge-blocks-editor ${B} ${d}`,ref:o,style:{maxHeight:l},"data-theme":a,children:[!n&&u&&w&&s.jsx(Ht,{selectedBlock:c.find(v=>v.id===w),onFormatToggle:D,onBlockTypeChange:v=>N(w,v)}),s.jsx("div",{className:"uiforge-blocks-editor__content",children:c.map((v,m)=>s.jsx(Wt,{block:v,isSelected:w===v.id,isDragging:A===v.id,readOnly:n,placeholder:m===0&&c.length===1?r:void 0,onSelect:()=>{L(v.id),C(!0)},onChange:y=>h(v.id,y),onDelete:()=>b(v.id),onDragStart:y=>P(y,v.id),onDragOver:$,onDrop:y=>j(y,v.id),onDragEnd:E,onKeyDown:y=>z(y,v.id)},v.id))}),!n&&s.jsx(Ft,{onAddBlock:f})]})},Ht=({selectedBlock:t,onFormatToggle:e,onBlockTypeChange:r})=>{if(!t)return null;const n=t.format||{};return s.jsxs("div",{className:"uiforge-blocks-editor__toolbar",role:"toolbar","aria-label":"Text formatting",children:[s.jsx("div",{className:"uiforge-blocks-editor__toolbar-group",children:s.jsxs("select",{value:t.type,onChange:a=>r(a.target.value),className:"uiforge-blocks-editor__toolbar-select","aria-label":"Block type",children:[s.jsx("option",{value:"paragraph",children:"Paragraph"}),s.jsx("option",{value:"heading1",children:"Heading 1"}),s.jsx("option",{value:"heading2",children:"Heading 2"}),s.jsx("option",{value:"heading3",children:"Heading 3"}),s.jsx("option",{value:"list",children:"List"}),s.jsx("option",{value:"quote",children:"Quote"}),s.jsx("option",{value:"code",children:"Code"}),s.jsx("option",{value:"image",children:"Image"})]})}),s.jsx("div",{className:"uiforge-blocks-editor__toolbar-divider"}),s.jsxs("div",{className:"uiforge-blocks-editor__toolbar-group",children:[s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.bold?"active":""}`,onClick:()=>e("bold"),title:"Bold (Ctrl+B)","aria-label":"Bold","aria-pressed":n.bold,children:s.jsx("strong",{children:"B"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.italic?"active":""}`,onClick:()=>e("italic"),title:"Italic (Ctrl+I)","aria-label":"Italic","aria-pressed":n.italic,children:s.jsx("em",{children:"I"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.underline?"active":""}`,onClick:()=>e("underline"),title:"Underline (Ctrl+U)","aria-label":"Underline","aria-pressed":n.underline,children:s.jsx("u",{children:"U"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.code?"active":""}`,onClick:()=>e("code"),title:"Inline Code","aria-label":"Code","aria-pressed":n.code,children:"</>"})]})]})},Wt=({block:t,isSelected:e,isDragging:r,readOnly:n,placeholder:a,onSelect:d,onChange:l,onDelete:c,onDragStart:_,onDragOver:w,onDrop:L,onDragEnd:A,onKeyDown:S})=>{const u=["uiforge-blocks-editor__block",`uiforge-blocks-editor__block--${t.type}`,e?"uiforge-blocks-editor__block--selected":"",r?"uiforge-blocks-editor__block--dragging":""].filter(Boolean).join(" "),C=["uiforge-blocks-editor__block-text",t.format?.bold?"uiforge-blocks-editor__block-text--bold":"",t.format?.italic?"uiforge-blocks-editor__block-text--italic":"",t.format?.underline?"uiforge-blocks-editor__block-text--underline":"",t.format?.code?"uiforge-blocks-editor__block-text--code":""].filter(Boolean).join(" "),o=f=>{l({content:f.target.value})},h=()=>{const f={value:t.content,onChange:o,onFocus:d,onKeyDown:S,placeholder:a,readOnly:n,className:C};switch(t.type){case"heading1":return s.jsx("input",{...f,type:"text",className:`${C} uiforge-blocks-editor__heading1`,placeholder:a||"Heading 1"});case"heading2":return s.jsx("input",{...f,type:"text",className:`${C} uiforge-blocks-editor__heading2`,placeholder:a||"Heading 2"});case"heading3":return s.jsx("input",{...f,type:"text",className:`${C} uiforge-blocks-editor__heading3`,placeholder:a||"Heading 3"});case"code":return s.jsx("textarea",{...f,className:`${C} uiforge-blocks-editor__code`,placeholder:a||"Code block",rows:4});case"quote":return s.jsx("textarea",{...f,className:`${C} uiforge-blocks-editor__quote`,placeholder:a||"Quote",rows:2});case"image":return s.jsxs("div",{className:"uiforge-blocks-editor__image-block",children:[s.jsx("input",{type:"text",value:t.imageUrl||"",onChange:b=>l({imageUrl:b.target.value}),placeholder:"Image URL",className:"uiforge-blocks-editor__image-url",readOnly:n}),s.jsx("input",{type:"text",value:t.imageAlt||"",onChange:b=>l({imageAlt:b.target.value}),placeholder:"Alt text",className:"uiforge-blocks-editor__image-alt",readOnly:n}),t.imageUrl&&s.jsx("img",{src:t.imageUrl,alt:t.imageAlt||"Block image",className:"uiforge-blocks-editor__image-preview"})]});default:return s.jsx("textarea",{...f,className:`${C} uiforge-blocks-editor__paragraph`,placeholder:a||"Start typing...",rows:1,style:{minHeight:"1.5em"}})}};return s.jsxs("div",{className:u,draggable:!n,onDragStart:_,onDragOver:w,onDrop:L,onDragEnd:A,"data-block-id":t.id,children:[!n&&s.jsxs("div",{className:"uiforge-blocks-editor__block-controls",children:[s.jsx("button",{type:"button",className:"uiforge-blocks-editor__drag-handle",title:"Drag to reorder","aria-label":"Drag to reorder",children:"⋮⋮"}),s.jsx("button",{type:"button",className:"uiforge-blocks-editor__delete-button",onClick:c,title:"Delete block","aria-label":"Delete block",children:"×"})]}),s.jsx("div",{className:"uiforge-blocks-editor__block-content",children:h()})]})},Ft=({onAddBlock:t})=>{const[e,r]=i.useState(!1),n=[{type:"paragraph",label:"Paragraph",icon:"¶"},{type:"heading1",label:"Heading 1",icon:"H1"},{type:"heading2",label:"Heading 2",icon:"H2"},{type:"heading3",label:"Heading 3",icon:"H3"},{type:"list",label:"List",icon:"≡"},{type:"quote",label:"Quote",icon:'"'},{type:"code",label:"Code",icon:"</>"},{type:"image",label:"Image",icon:"🖼"}];return s.jsxs("div",{className:"uiforge-blocks-editor__block-menu",children:[s.jsx("button",{type:"button",className:"uiforge-blocks-editor__add-button",onClick:()=>r(!e),"aria-label":"Add block","aria-expanded":e,children:"+ Add Block"}),e&&s.jsx("div",{className:"uiforge-blocks-editor__block-menu-dropdown",children:n.map(({type:a,label:d,icon:l})=>s.jsxs("button",{type:"button",className:"uiforge-blocks-editor__block-menu-item",onClick:()=>{t(a),r(!1)},children:[s.jsx("span",{className:"uiforge-blocks-editor__block-menu-icon",children:l}),s.jsx("span",{children:d})]},a))})]})};function Ie(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function qt(t){const e=t.trim(),r=["javascript:","data:","vbscript:","file:"],n=e.toLowerCase();for(const a of r)if(n.startsWith(a))return"";return e}function Kt(t){return t.map(e=>{let r=Ie(e.content);switch(e.format?.bold&&(r=`<strong>${r}</strong>`),e.format?.italic&&(r=`<em>${r}</em>`),e.format?.underline&&(r=`<u>${r}</u>`),e.format?.code&&(r=`<code>${r}</code>`),e.type){case"heading1":return`<h1>${r}</h1>`;case"heading2":return`<h2>${r}</h2>`;case"heading3":return`<h3>${r}</h3>`;case"quote":return`<blockquote>${r}</blockquote>`;case"code":return`<pre><code>${Ie(e.content)}</code></pre>`;case"image":{const n=qt(e.imageUrl||""),a=Ie(e.imageAlt||"");return n?`<img src="${n}" alt="${a}" />`:""}case"list":return`<ul><li>${r}</li></ul>`;default:return`<p>${r}</p>`}}).join(`
2
+ `)}function Zt(t){return t.map(e=>{let r=e.content;switch(e.format?.bold&&(r=`**${r}**`),e.format?.italic&&(r=`*${r}*`),e.format?.code&&(r=`\`${r}\``),e.type){case"heading1":return`# ${r}`;case"heading2":return`## ${r}`;case"heading3":return`### ${r}`;case"quote":return`> ${r}`;case"code":return`\`\`\`
3
3
  ${e.content}
4
4
  \`\`\``;case"image":return`![${e.imageAlt||""}](${e.imageUrl||""})`;case"list":return`- ${r}`;default:return r}}).join(`
5
5
 
6
- `)}function Kt(t){return JSON.stringify(t,null,2)}const Zt=({options:t=[],value:e,onChange:r,onSearch:n,theme:a="light",placeholder:f="Select an option...",disabled:l=!1,clearable:c=!1,className:j="",renderOption:k,renderValue:$,loading:E=!1,maxHeight:A="300px",debounceMs:d=300,searchable:w=!0,noOptionsMessage:i="No options found",ariaLabel:u,enableCache:h=!1,cacheTTL:x,refreshOnOpen:S=!1,onClearCache:U,onForceRefresh:C})=>{const[y,M]=o.useState(!1),[L,O]=o.useState(""),[R,W]=o.useState([]),[v,N]=o.useState(0),[_,b]=o.useState(!1),re=o.useRef(null),Y=o.useRef(null),te=o.useRef(null),X=o.useRef(null),ne=o.useRef(null),se=o.useRef(n),T=o.useRef(null),oe=o.useRef(!1),Z=o.useRef(new Map),ee=o.useRef(h),le=o.useRef(x),I=o.useCallback((m,D=0)=>m.reduce((Q,G)=>{const B={...G,level:D};return Q.push(B),G.children&&G.children.length>0&&Q.push(...I(G.children,D+1)),Q},[]),[]),F=m=>typeof m=="string"&&(m.startsWith("http://")||m.startsWith("https://")||m.startsWith("data:")||m.startsWith("/")),p=o.useMemo(()=>I(R.length>0?R:t).find(D=>D.value===e)||null,[e,t,R,I]),V=o.useCallback((m,D)=>{if(!D.trim())return m;const Q=D.toLowerCase(),G=B=>B.reduce((ce,ue)=>{const xe=ue.label.toLowerCase().includes(Q),fe=ue.children?G(ue.children):[];return(xe||fe.length>0)&&ce.push({...ue,children:fe.length>0?fe:ue.children}),ce},[]);return G(m)},[]);o.useEffect(()=>{se.current=n,ne.current=null},[n]),o.useEffect(()=>{ee.current=h},[h]),o.useEffect(()=>{le.current=x},[x]),o.useEffect(()=>{U&&U(()=>{Z.current.clear()}),C&&C(()=>{if(!se.current)return;T.current&&T.current.abort(),T.current=new AbortController;const m=T.current.signal;b(!0),(async()=>{try{const D=Date.now(),Q=L,G=Z.current.get(Q),B=G&&(!le.current||D-G.timestamp<le.current);let ce;ee.current&&B?ce=G.data:(ce=await(se.current?se.current(L,m):n?.(L,m)??[]),!m.aborted&&ee.current&&Z.current.set(Q,{data:ce,timestamp:D})),m.aborted||(W(ce),ne.current=L)}catch(D){console.error(D),W([])}finally{b(!1)}})()})},[U,C,L,n]),o.useEffect(()=>{if(n&&y){const m=ne.current===L,D=!oe.current&&y;return m&&!(S&&D)?void 0:(X.current&&clearTimeout(X.current),X.current=setTimeout(async()=>{T.current&&T.current.abort(),T.current=new AbortController;const G=T.current.signal;b(!0);try{let B;const ce=L,ue=Z.current.get(ce),xe=Date.now(),fe=ue&&(!le.current||xe-ue.timestamp<le.current);if(ee.current&&fe?B=ue.data:(B=await(se.current?se.current(L,G):n(L,G)),!G.aborted&&ee.current&&Z.current.set(ce,{data:B,timestamp:xe})),G.aborted)return;W(B),ne.current=L}catch(B){console.error("Error fetching options:",B),W([])}finally{b(!1)}},d),()=>{X.current&&clearTimeout(X.current),T.current&&(T.current.abort(),T.current=null)})}else n||W(V(t,L));oe.current=y},[L,y,t,d,V,S,n]),o.useEffect(()=>{n||W(t)},[t,n]),o.useEffect(()=>{const m=D=>{re.current&&!re.current.contains(D.target)&&(M(!1),O(""))};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const H=o.useMemo(()=>I(R.length>0?R:t).filter(D=>!D.disabled),[R,t,I]),K=o.useMemo(()=>I(R.length>0?R:t),[R,t,I]),ae=o.useMemo(()=>{const m=new Map;return K.forEach(D=>{const Q=JSON.stringify({value:D.value,label:D.label}),G=H.findIndex(B=>B.value===D.value&&B.label===D.label);m.set(Q,G)}),m},[K,H]),q=m=>{if(!l)switch(m.key){case"ArrowDown":m.preventDefault(),y?N(D=>D<H.length-1?D+1:0):M(!0);break;case"ArrowUp":m.preventDefault(),y&&N(D=>D>0?D-1:H.length-1);break;case"Enter":m.preventDefault(),y&&H[v]?de(H[v]):M(!y);break;case"Escape":m.preventDefault(),M(!1),O("");break;case"Tab":y&&(M(!1),O(""));break}};o.useEffect(()=>{if(y&&te.current){const m=te.current.querySelector(`[data-index="${v}"]`);m&&typeof m.scrollIntoView=="function"&&m.scrollIntoView({block:"nearest"})}},[v,y]);const de=m=>{m.disabled||(r?.(m.value,m),M(!1),O(""),N(0))},he=m=>{m.stopPropagation(),r?.(null,null),O("")},ie=()=>{l||M(m=>{const D=!m;return D&&setTimeout(()=>Y.current?.focus(),0),D})};o.useEffect(()=>{y||(ne.current=null)},[y]);const je=m=>{O(m.target.value),y||M(!0),N(0)},ge=m=>{const D=(m.level||0)*20;return s.jsxs("div",{className:"uiforge-combobox-option-content",style:{paddingLeft:`${D}px`},children:[m.icon&&s.jsx("span",{className:"uiforge-combobox-option-icon",children:F(m.icon)?s.jsx("img",{src:m.icon,alt:"",className:"uiforge-combobox-option-icon-img"}):m.icon}),s.jsx("span",{className:"uiforge-combobox-option-label",children:m.label})]})},g=m=>m?s.jsxs("div",{className:"uiforge-combobox-value-content",children:[m.icon&&s.jsx("span",{className:"uiforge-combobox-value-icon",children:F(m.icon)?s.jsx("img",{src:m.icon,alt:"",className:"uiforge-combobox-value-icon-img"}):m.icon}),s.jsx("span",{className:"uiforge-combobox-value-label",children:m.label})]}):f,P="uiforge-combobox",z=`${P}--${a}`,J=[P,z,y&&`${P}--open`,l&&`${P}--disabled`,j].filter(Boolean).join(" ");return s.jsxs("div",{ref:re,className:J,onKeyDown:q,role:"combobox","aria-expanded":y,"aria-haspopup":"listbox","aria-label":u,"aria-disabled":l,tabIndex:l?-1:0,"data-theme":a,children:[s.jsxs("div",{className:`${P}-control`,onClick:ie,children:[w&&y?s.jsx("input",{ref:Y,type:"text",className:`${P}-input`,value:L,onChange:je,placeholder:f,disabled:l,"aria-autocomplete":"list","aria-controls":`${P}-listbox`}):s.jsx("div",{className:`${P}-value`,children:$?$(p):g(p)}),s.jsxs("div",{className:`${P}-indicators`,children:[c&&e!==null&&e!==void 0&&!l&&s.jsx("button",{type:"button",className:`${P}-clear`,onClick:he,"aria-label":"Clear selection",tabIndex:-1,children:"×"}),s.jsx("span",{className:`${P}-arrow`,children:"▼"})]})]}),y&&s.jsx("div",{ref:te,className:`${P}-dropdown`,style:{maxHeight:A},role:"listbox",id:`${P}-listbox`,children:E||_?s.jsx("div",{className:`${P}-loading`,children:"Loading..."}):H.length===0?s.jsx("div",{className:`${P}-no-options`,children:i}):K.map(m=>{const D=JSON.stringify({value:m.value,label:m.label}),Q=ae.get(D)??-1,G=m.value===e,B=Q===v,ce=[`${P}-option`,G&&`${P}-option--selected`,B&&`${P}-option--highlighted`,m.disabled&&`${P}-option--disabled`].filter(Boolean).join(" ");return s.jsx("div",{className:ce,onClick:()=>de(m),role:"option","aria-selected":G,"aria-disabled":m.disabled,"data-index":Q,children:k?k(m):ge(m)},D)})})]})};function Me(){return Me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Me.apply(null,arguments)}function De(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Le(t,e){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Le(t,e)}function Gt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Le(t,e)}var Ue=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Yt(t,e){return!!(t===e||Ue(t)&&Ue(e))}function Jt(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!Yt(t[r],e[r]))return!1;return!0}function Ce(t,e){e===void 0&&(e=Jt);var r,n=[],a,f=!1;function l(){for(var c=[],j=0;j<arguments.length;j++)c[j]=arguments[j];return f&&r===this&&e(c,n)||(a=t.apply(this,c),f=!0,r=this,n=c),a}return l}var Qt=typeof performance=="object"&&typeof performance.now=="function",Oe=Qt?function(){return performance.now()}:function(){return Date.now()};function ze(t){cancelAnimationFrame(t.id)}function Xt(t,e){var r=Oe();function n(){Oe()-r>=e?t.call(null):a.id=requestAnimationFrame(n)}var a={id:requestAnimationFrame(n)};return a}var ke=-1;function Re(t){if(t===void 0&&(t=!1),ke===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),ke=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return ke}var me=null;function Ve(t){if(t===void 0&&(t=!1),me===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),a=n.style;return a.width="100px",a.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?me="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?me="negative":me="positive-ascending"),document.body.removeChild(e),me}return me}process.env.NODE_ENV;var er=150,tr=function(e,r){return e},ye=null,be=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(ye=new WeakSet,be=new WeakSet);function rr(t){var e,r=t.getItemOffset,n=t.getEstimatedTotalSize,a=t.getItemSize,f=t.getOffsetForIndexAndAlignment,l=t.getStartIndexForOffset,c=t.getStopIndexForStartIndex,j=t.initInstanceProps,k=t.shouldResetStyleCacheOnItemSizeChange,$=t.validateProps;return e=(function(E){Gt(A,E);function A(w){var i;return i=E.call(this,w)||this,i._instanceProps=j(i.props,De(i)),i._outerRef=void 0,i._resetIsScrollingTimeoutId=null,i.state={instance:De(i),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof i.props.initialScrollOffset=="number"?i.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},i._callOnItemsRendered=void 0,i._callOnItemsRendered=Ce(function(u,h,x,S){return i.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:h,visibleStartIndex:x,visibleStopIndex:S})}),i._callOnScroll=void 0,i._callOnScroll=Ce(function(u,h,x){return i.props.onScroll({scrollDirection:u,scrollOffset:h,scrollUpdateWasRequested:x})}),i._getItemStyle=void 0,i._getItemStyle=function(u){var h=i.props,x=h.direction,S=h.itemSize,U=h.layout,C=i._getItemStyleCache(k&&S,k&&U,k&&x),y;if(C.hasOwnProperty(u))y=C[u];else{var M=r(i.props,u,i._instanceProps),L=a(i.props,u,i._instanceProps),O=x==="horizontal"||U==="horizontal",R=x==="rtl",W=O?M:0;C[u]=y={position:"absolute",left:R?void 0:W,right:R?W:void 0,top:O?0:M,height:O?"100%":L,width:O?L:"100%"}}return y},i._getItemStyleCache=void 0,i._getItemStyleCache=Ce(function(u,h,x){return{}}),i._onScrollHorizontal=function(u){var h=u.currentTarget,x=h.clientWidth,S=h.scrollLeft,U=h.scrollWidth;i.setState(function(C){if(C.scrollOffset===S)return null;var y=i.props.direction,M=S;if(y==="rtl")switch(Ve()){case"negative":M=-S;break;case"positive-descending":M=U-x-S;break}return M=Math.max(0,Math.min(M,U-x)),{isScrolling:!0,scrollDirection:C.scrollOffset<M?"forward":"backward",scrollOffset:M,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._onScrollVertical=function(u){var h=u.currentTarget,x=h.clientHeight,S=h.scrollHeight,U=h.scrollTop;i.setState(function(C){if(C.scrollOffset===U)return null;var y=Math.max(0,Math.min(U,S-x));return{isScrolling:!0,scrollDirection:C.scrollOffset<y?"forward":"backward",scrollOffset:y,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._outerRefSetter=function(u){var h=i.props.outerRef;i._outerRef=u,typeof h=="function"?h(u):h!=null&&typeof h=="object"&&h.hasOwnProperty("current")&&(h.current=u)},i._resetIsScrollingDebounced=function(){i._resetIsScrollingTimeoutId!==null&&ze(i._resetIsScrollingTimeoutId),i._resetIsScrollingTimeoutId=Xt(i._resetIsScrolling,er)},i._resetIsScrolling=function(){i._resetIsScrollingTimeoutId=null,i.setState({isScrolling:!1},function(){i._getItemStyleCache(-1,null)})},i}A.getDerivedStateFromProps=function(i,u){return sr(i,u),$(i),null};var d=A.prototype;return d.scrollTo=function(i){i=Math.max(0,i),this.setState(function(u){return u.scrollOffset===i?null:{scrollDirection:u.scrollOffset<i?"forward":"backward",scrollOffset:i,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},d.scrollToItem=function(i,u){u===void 0&&(u="auto");var h=this.props,x=h.itemCount,S=h.layout,U=this.state.scrollOffset;i=Math.max(0,Math.min(i,x-1));var C=0;if(this._outerRef){var y=this._outerRef;S==="vertical"?C=y.scrollWidth>y.clientWidth?Re():0:C=y.scrollHeight>y.clientHeight?Re():0}this.scrollTo(f(this.props,i,u,U,this._instanceProps,C))},d.componentDidMount=function(){var i=this.props,u=i.direction,h=i.initialScrollOffset,x=i.layout;if(typeof h=="number"&&this._outerRef!=null){var S=this._outerRef;u==="horizontal"||x==="horizontal"?S.scrollLeft=h:S.scrollTop=h}this._callPropsCallbacks()},d.componentDidUpdate=function(){var i=this.props,u=i.direction,h=i.layout,x=this.state,S=x.scrollOffset,U=x.scrollUpdateWasRequested;if(U&&this._outerRef!=null){var C=this._outerRef;if(u==="horizontal"||h==="horizontal")if(u==="rtl")switch(Ve()){case"negative":C.scrollLeft=-S;break;case"positive-ascending":C.scrollLeft=S;break;default:var y=C.clientWidth,M=C.scrollWidth;C.scrollLeft=M-y-S;break}else C.scrollLeft=S;else C.scrollTop=S}this._callPropsCallbacks()},d.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ze(this._resetIsScrollingTimeoutId)},d.render=function(){var i=this.props,u=i.children,h=i.className,x=i.direction,S=i.height,U=i.innerRef,C=i.innerElementType,y=i.innerTagName,M=i.itemCount,L=i.itemData,O=i.itemKey,R=O===void 0?tr:O,W=i.layout,v=i.outerElementType,N=i.outerTagName,_=i.style,b=i.useIsScrolling,re=i.width,Y=this.state.isScrolling,te=x==="horizontal"||W==="horizontal",X=te?this._onScrollHorizontal:this._onScrollVertical,ne=this._getRangeToRender(),se=ne[0],T=ne[1],oe=[];if(M>0)for(var Z=se;Z<=T;Z++)oe.push(o.createElement(u,{data:L,key:R(Z,L),index:Z,isScrolling:b?Y:void 0,style:this._getItemStyle(Z)}));var ee=n(this.props,this._instanceProps);return o.createElement(v||N||"div",{className:h,onScroll:X,ref:this._outerRefSetter,style:Me({position:"relative",height:S,width:re,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},_)},o.createElement(C||y||"div",{children:oe,ref:U,style:{height:te?"100%":ee,pointerEvents:Y?"none":void 0,width:te?ee:"100%"}}))},d._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var i=this.props.itemCount;if(i>0){var u=this._getRangeToRender(),h=u[0],x=u[1],S=u[2],U=u[3];this._callOnItemsRendered(h,x,S,U)}}if(typeof this.props.onScroll=="function"){var C=this.state,y=C.scrollDirection,M=C.scrollOffset,L=C.scrollUpdateWasRequested;this._callOnScroll(y,M,L)}},d._getRangeToRender=function(){var i=this.props,u=i.itemCount,h=i.overscanCount,x=this.state,S=x.isScrolling,U=x.scrollDirection,C=x.scrollOffset;if(u===0)return[0,0,0,0];var y=l(this.props,C,this._instanceProps),M=c(this.props,y,C,this._instanceProps),L=!S||U==="backward"?Math.max(1,h):1,O=!S||U==="forward"?Math.max(1,h):1;return[Math.max(0,y-L),Math.max(0,Math.min(u-1,M+O)),y,M]},A})(o.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var sr=function(e,r){var n=e.children,a=e.direction,f=e.height,l=e.layout,c=e.innerTagName,j=e.outerTagName,k=e.width,$=r.instance;if(process.env.NODE_ENV!=="production"){(c!=null||j!=null)&&be&&!be.has($)&&(be.add($),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var E=a==="horizontal"||l==="horizontal";switch(a){case"horizontal":case"vertical":ye&&!ye.has($)&&(ye.add($),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+a+'" was specified.'))}switch(l){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+l+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(E&&typeof k!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(k===null?"null":typeof k)+'" was specified.'));if(!E&&typeof f!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(f===null?"null":typeof f)+'" was specified.'))}},nr=rr({getItemOffset:function(e,r){var n=e.itemSize;return r*n},getItemSize:function(e,r){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var r=e.itemCount,n=e.itemSize;return n*r},getOffsetForIndexAndAlignment:function(e,r,n,a,f,l){var c=e.direction,j=e.height,k=e.itemCount,$=e.itemSize,E=e.layout,A=e.width,d=c==="horizontal"||E==="horizontal",w=d?A:j,i=Math.max(0,k*$-w),u=Math.min(i,r*$),h=Math.max(0,r*$-w+$+l);switch(n==="smart"&&(a>=h-w&&a<=u+w?n="auto":n="center"),n){case"start":return u;case"end":return h;case"center":{var x=Math.round(h+(u-h)/2);return x<Math.ceil(w/2)?0:x>i+Math.floor(w/2)?i:x}case"auto":default:return a>=h&&a<=u?a:a<h?h:u}},getStartIndexForOffset:function(e,r){var n=e.itemCount,a=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/a)))},getStopIndexForStartIndex:function(e,r,n){var a=e.direction,f=e.height,l=e.itemCount,c=e.itemSize,j=e.layout,k=e.width,$=a==="horizontal"||j==="horizontal",E=r*c,A=$?k:f,d=Math.ceil((A+n-E)/c);return Math.max(0,Math.min(l-1,r+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var r=e.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});const We=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M11.93 8.5a4.002 4.002 0 01-7.86 0H.75a.75.75 0 010-1.5h3.32a4.002 4.002 0 017.86 0h3.32a.75.75 0 010 1.5h-3.32zM8 5a3 3 0 100 6 3 3 0 000-6z"})}),Fe=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"})}),qe=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}),s.jsx("path",{d:"M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"})]}),Ke=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0114.25 13H8.06l-2.573 2.573A1.458 1.458 0 013 14.543V13H1.75A1.75 1.75 0 010 11.25v-8.5zM1.75 2.5a.25.25 0 00-.25.25v8.5c0 .138.112.25.25.25h2a.75.75 0 01.75.75v2.19l2.72-2.72a.75.75 0 01.53-.22h6.5a.25.25 0 00.25-.25v-8.5a.25.25 0 00-.25-.25H1.75z"})}),Ze=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"})}),Ge=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),Ye=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M5 3.254V3.25v.005a.75.75 0 110-.005v.004zm.45 1.9a2.25 2.25 0 10-1.95.218v5.256a2.25 2.25 0 101.5 0V7.123A5.735 5.735 0 009.25 9h1.378a2.251 2.251 0 100-1.5H9.25a4.25 4.25 0 01-3.8-2.346zM12.75 9a.75.75 0 100-1.5.75.75 0 000 1.5zm-8.5 4.5a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),Je=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M7.47 10.78a.75.75 0 001.06 0l3.75-3.75a.75.75 0 00-1.06-1.06L8.75 8.44V1.75a.75.75 0 00-1.5 0v6.69L4.78 5.97a.75.75 0 00-1.06 1.06l3.75 3.75zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z"})}),Qe=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.53 4.75A.75.75 0 015 6.25h6a.75.75 0 00.53-1.28l-3-3a.75.75 0 00-1.06 0l-3 3zm.47 6.47a.75.75 0 01.53-.22h6a.75.75 0 01.53 1.28l-3 3a.75.75 0 01-1.06 0l-3-3a.75.75 0 01-.01-1.06h.01z"})}),Xe=({size:t=20,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:e,children:[s.jsx("path",{d:"M10 2L6 6M10 2L14 6M10 2V7.5",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M3 10H17",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),s.jsx("path",{d:"M10 18L6 14M10 18L14 14M10 18V12.5",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),et=({size:t=20,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:e,children:[s.jsx("path",{d:"M10 7.5L6 4M10 7.5L14 4M10 7.5V2",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M3 10H17",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),s.jsx("path",{d:"M10 12.5L6 16M10 12.5L14 16M10 12.5V18",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),tt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"})}),rt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"})}),st=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:e,children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:r,strokeWidth:"1.5"}),s.jsx("path",{d:"M8 1C11.866 1 15 4.134 15 8C15 11.866 11.866 15 8 15",fill:r}),s.jsx("circle",{cx:"8",cy:"5",r:"2",fill:r==="currentColor"?"white":"#fff"}),s.jsx("circle",{cx:"8",cy:"11",r:"2",fill:r}),s.jsx("circle",{cx:"8",cy:"5",r:"0.5",fill:r}),s.jsx("circle",{cx:"8",cy:"11",r:"0.5",fill:r==="currentColor"?"white":"#fff"})]}),nt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),s.jsx("path",{d:"M8 5C6.5 5 5 6 5 7.5V9C5 9 5.5 10 6 10.5L5 14H7L8 11L9 14H11L10 10.5C10.5 10 11 9 11 9V7.5C11 6 9.5 5 8 5Z"}),s.jsx("path",{d:"M4 9L2 10M12 9L14 10",strokeWidth:"1",stroke:r,fill:"none"})]}),at=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"8",cy:"2.5",r:"1.5"}),s.jsx("path",{d:"M8 4.5L6 8L4 14H6L7 10H9L10 14H12L10 8L8 4.5Z"}),s.jsx("path",{d:"M6 8L3 6M10 8L13 6",strokeWidth:"1.5",stroke:r,fill:"none"})]}),it=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"1",y:"6",width:"2",height:"4",rx:"0.5"}),s.jsx("rect",{x:"13",y:"6",width:"2",height:"4",rx:"0.5"}),s.jsx("rect",{x:"3",y:"5.5",width:"1",height:"5"}),s.jsx("rect",{x:"12",y:"5.5",width:"1",height:"5"}),s.jsx("rect",{x:"4",y:"7",width:"8",height:"2",rx:"0.5"})]}),ot=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"10",cy:"2.5",r:"1.5"}),s.jsx("path",{d:"M9 4.5L8 6L6 7L4 8L6 9L8 8L10 7L11 9L10 12L9 14H11L12 11L13 9L12 6L10 4.5H9Z"}),s.jsx("path",{d:"M6 14H4L5 11"})]}),lt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:e,children:s.jsx("path",{d:"M2 8H5L6.5 5L8 11L9.5 8H14",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ct=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M4 8C4 6 5 4 7 4C8 4 8.5 4.5 8.5 5.5C8.5 6 8.8 6.5 9.5 6.5C10.5 6.5 11 7 11 8C11 9.5 10 11 8 12C6 13 4 12 4 10V8Z"}),s.jsx("circle",{cx:"7",cy:"3",r:"1.5"})]}),dt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"2",y:"2",width:"12",height:"3",rx:"0.5"}),s.jsx("rect",{x:"2",y:"6.5",width:"12",height:"3",rx:"0.5"}),s.jsx("rect",{x:"2",y:"11",width:"12",height:"3",rx:"0.5"}),s.jsx("circle",{cx:"4",cy:"3.5",r:"0.5"}),s.jsx("circle",{cx:"4",cy:"8",r:"0.5"}),s.jsx("circle",{cx:"4",cy:"12.5",r:"0.5"})]}),ut=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("ellipse",{cx:"8",cy:"3",rx:"5",ry:"2"}),s.jsx("path",{d:"M3 3V13C3 14.1 5.2 15 8 15C10.8 15 13 14.1 13 13V3"}),s.jsx("path",{d:"M3 8C3 9.1 5.2 10 8 10C10.8 10 13 9.1 13 8"})]}),ht=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.5 10C2.5 10 1 8.5 1 6.5C1 4.5 2.5 3 4.5 3C4.6 3 4.7 3 4.8 3.05C5.3 1.8 6.5 1 8 1C10 1 11.5 2.5 11.5 4.5C11.5 4.6 11.5 4.7 11.5 4.8C12.9 5.1 14 6.3 14 7.75C14 9.5 12.5 11 10.75 11H4.5Z"})}),mt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0114.25 15H1.75A1.75 1.75 0 010 13.25V2.75z"}),s.jsx("path",{d:"M3 5.5L6 8L3 10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),s.jsx("line",{x1:"8",y1:"10.5",x2:"12",y2:"10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),ft=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M4.75 7.5a3.25 3.25 0 116.5 0v3.75a3.25 3.25 0 01-6.5 0V7.5z"}),s.jsx("path",{d:"M5.75 7.5c0-.69.56-1.25 1.25-1.25h2c.69 0 1.25.56 1.25 1.25M4 5.5L2 4M12 5.5L14 4M4 9H1M15 9H12M4 12L2 13.5M12 12L14 13.5",stroke:r,strokeWidth:"1.5",fill:"none"}),s.jsx("ellipse",{cx:"8",cy:"4",rx:"2.5",ry:"1.5"})]}),pt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M5.28 3.72a.75.75 0 00-1.06 1.06L7.44 8l-3.22 3.22a.75.75 0 101.06 1.06l3.75-3.75a.75.75 0 000-1.06L5.28 3.72zM8.5 11.5a.75.75 0 000 1.5h5a.75.75 0 000-1.5h-5z"})}),vt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 0C6 0 4.5 2 3.5 5L1 7L4 8L5 11L7 8.5C9 7.5 11 6 13 3C14 2 15 0 16 0C16 0 14 2 13 3C11 5 9.5 6.5 8 7.5M10 4C10.552 4 11 3.552 11 3C11 2.448 10.552 2 10 2C9.448 2 9 2.448 9 3C9 3.552 9.448 4 10 4Z"}),s.jsx("path",{d:"M2 12C2 12 0 14 0 16C2 16 4 14 4 14"})]}),gt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"0.5"}),s.jsx("path",{d:"M4 4L2 2M4 12L2 14M12 4L14 2M12 12L14 14",strokeWidth:"1.5",stroke:r,strokeLinecap:"round"}),s.jsx("rect",{x:"1",y:"1",width:"1.5",height:"1.5"}),s.jsx("rect",{x:"13.5",y:"1",width:"1.5",height:"1.5"}),s.jsx("rect",{x:"1",y:"13.5",width:"1.5",height:"1.5"}),s.jsx("rect",{x:"13.5",y:"13.5",width:"1.5",height:"1.5"}),s.jsx("circle",{cx:"8",cy:"8",r:"1"})]}),xt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 1C4 1 2 3 2 6C2 8 2 10 3 11C3.5 11.5 4 12 5 12C5.5 12 6 11.5 6.5 10.5C7 9.5 7.5 9 8 9C8.5 9 9 9.5 9.5 10.5C10 11.5 10.5 12 11 12C12 12 12.5 11.5 13 11C14 10 14 8 14 6C14 3 12 1 8 1Z"}),s.jsx("ellipse",{cx:"6",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),s.jsx("ellipse",{cx:"10",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),s.jsx("circle",{cx:"6",cy:"5.5",r:"0.75",fill:r}),s.jsx("circle",{cx:"10",cy:"5.5",r:"0.75",fill:r})]}),yt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"8",cy:"8",r:"5"}),s.jsx("ellipse",{cx:"8",cy:"8",rx:"8",ry:"2.5",fill:"none",stroke:r,strokeWidth:"1",opacity:"0.6"}),s.jsx("circle",{cx:"6",cy:"6",r:"1",opacity:"0.4",fill:r==="currentColor"?"white":"#fff"})]}),bt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M1 8L6 6L14 2L12 10L10 8L8 14H6L8 8L1 8Z"}),s.jsx("path",{d:"M10 8L12 10",strokeWidth:"1.5",stroke:r})]}),wt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M1.5 13.5V2.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v11a.5.5 0 01-.5.5H2a.5.5 0 01-.5-.5zM5 13.5V5.5a.5.5 0 01.5-.5H6a.5.5 0 01.5.5v8a.5.5 0 01-.5.5h-.5a.5.5 0 01-.5-.5zM8.5 13.5V7.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v6a.5.5 0 01-.5.5H9a.5.5 0 01-.5-.5zM12 13.5V3.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v10a.5.5 0 01-.5.5h-.5a.5.5 0 01-.5-.5z"})}),jt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"5",cy:"4",r:"2"}),s.jsx("circle",{cx:"11",cy:"4",r:"2"}),s.jsx("path",{d:"M1 14V12C1 10.5 2.5 9 5 9C7.5 9 9 10.5 9 12V14H1Z"}),s.jsx("path",{d:"M7 14V12C7 10.5 8.5 9 11 9C13.5 9 15 10.5 15 12V14H7Z"})]}),_t=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M3 1.75C3 .784 3.784 0 4.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0113.25 16h-8.5A1.75 1.75 0 013 14.25V1.75z"}),s.jsx("path",{d:"M10 0v3.5c0 .275.225.5.5.5H14",fill:r==="currentColor"?"white":"#fff"})]}),It=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zM2.5 7.5v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5h-11z"})}),Ct=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M6.75 0A1.75 1.75 0 005 1.75V3H1.75C.784 3 0 3.784 0 4.75v8.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25v-8.5A1.75 1.75 0 0014.25 3H11V1.75A1.75 1.75 0 009.25 0h-2.5zM9.5 3V1.75a.25.25 0 00-.25-.25h-2.5a.25.25 0 00-.25.25V3h3z"})}),kt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"})}),$t=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M3.25 1A2.25 2.25 0 011 3.25v9.5A2.25 2.25 0 013.25 15h9.5A2.25 2.25 0 0115 12.75v-9.5A2.25 2.25 0 0012.75 1h-9.5zM2.5 3.25a.75.75 0 01.75-.75h9.5a.75.75 0 01.75.75v9.5a.75.75 0 01-.75.75h-9.5a.75.75 0 01-.75-.75v-9.5z"}),s.jsx("path",{d:"M8 4a.75.75 0 01.75.75v2.5h2.5a.75.75 0 010 1.5h-2.5v2.5a.75.75 0 01-1.5 0v-2.5h-2.5a.75.75 0 010-1.5h2.5v-2.5A.75.75 0 018 4z"})]}),St=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M6 1h4v1H6V1zM5.5 3h5L13 13c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2L5.5 3z"}),s.jsx("circle",{cx:"7",cy:"8",r:"1",fill:r==="currentColor"?"white":"#fff",opacity:"0.5"}),s.jsx("circle",{cx:"9",cy:"10",r:"0.75",fill:r==="currentColor"?"white":"#fff",opacity:"0.5"})]}),Nt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 0L0 3v5c0 5 3 7.5 8 8 5-.5 8-3 8-8V3L8 0z"}),s.jsx("path",{d:"M7 10L4.5 7.5l1-1L7 8l3.5-3.5 1 1L7 10z",fill:r==="currentColor"?"white":"#fff"})]}),Mt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"1",y:"1",width:"9",height:"11",rx:"1"}),s.jsx("line",{x1:"3",y1:"4",x2:"7",y2:"4",stroke:r==="currentColor"?"white":"#fff",strokeWidth:"1"}),s.jsx("line",{x1:"3",y1:"6.5",x2:"7",y2:"6.5",stroke:r==="currentColor"?"white":"#fff",strokeWidth:"1"}),s.jsx("circle",{cx:"11",cy:"11",r:"3",fill:"none",stroke:r,strokeWidth:"1.5"}),s.jsx("line",{x1:"13",y1:"13",x2:"15.5",y2:"15.5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round"})]}),Lt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.48 7.27c.26.26 1.28 1.33 1.28 1.33l.56-.58-.88-.91 1.69-1.8s-.76-.74-.43-.45c.32-1.19.03-2.51-.87-3.44C4.93.5 3.66.2 2.52.51l1.93 2-.51 1.96-1.89.52-1.93-2C-.19 4.17.1 5.48 1 6.4c.94.98 2.29 1.26 3.48.87zm6.44 1.94l-2.33 2.3 3.84 3.98c.31.33.73.49 1.14.49.41 0 .82-.16 1.14-.49.63-.65.63-1.7 0-2.35l-3.79-3.93zM16 2.53L13.55 0 6.33 7.46l.88.91-4.31 4.46-.99.53-1.39 2.27.35.37 2.2-1.44.51-1.02L7.9 9.08l.88.91L16 2.53z"})}),pe={commit:We,pr:Fe,issue:qe,comment:Ke,star:Ze,fork:Ge,merge:Ye,release:Je,deploy:Qe},ve={unfold:Xe,fold:et,close:tt,check:rt},ar={taichi:st,meditation:nt,yoga:at},ir={dumbbell:it,running:ot,heartrate:lt,strength:ct},or={server:dt,database:ut,cloud:ht,terminal:mt,bug:ft,code:pt},lr={rocket:vt,satellite:gt,alien:xt,planet:yt,telescope:bt},cr={chart:wt,meeting:jt,document:_t,calendar:It,briefcase:Ct},dr={gitbranch:kt,prdraft:$t,testing:St,deployment:Nt,review:Mt,build:Lt};function At(t,e=640){const[r,n]=o.useState(!1);return o.useEffect(()=>{const a=t?.current;if(!a)return;const f=()=>{const c=a.clientWidth;c>0&&n(c<e)};f();const l=new ResizeObserver(()=>{f()});return l.observe(a),()=>{l.disconnect()}},[t,e]),r}const Et=o.createContext({density:"comfortable",showMeta:!0}),Pt=({children:t,value:e})=>s.jsx(Et.Provider,{value:e,children:t});function Dt(){return o.useContext(Et)}const ur=t=>{const e=pe[t]||pe.commit;return s.jsx(e,{size:16})},hr=t=>{const e=typeof t=="string"?new Date(t):t,n=new Date().getTime()-e.getTime(),a=Math.floor(n/1e3),f=Math.floor(a/60),l=Math.floor(f/60),c=Math.floor(l/24);return a<60?"just now":f<60?`${f}m ago`:l<24?`${l}h ago`:c<30?`${c}d ago`:e.toLocaleDateString()},mr=({event:t,expanded:e=!1,onToggle:r,expandable:n,isChild:a=!1,showTimeline:f=!1,density:l,showMeta:c,renderIcon:j,className:k=""})=>{const $=Dt(),E=l??$.density,A=c??$.showMeta,d=n??!!t.description,w=()=>{d&&r&&r(t.id,!e)},i=x=>{d&&r&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),r(t.id,!e))},u=["uiforge-activity-item",`uiforge-activity-item--${E}`,a?"uiforge-activity-item--child":"",A?"":"uiforge-activity-item--hide-meta",k].filter(Boolean).join(" "),h=["uiforge-activity-item__header",d?"uiforge-activity-item__header--clickable":""].filter(Boolean).join(" ");return s.jsxs("div",{className:u,"data-event-id":t.id,"data-density":E,"data-show-meta":A,children:[f&&!a&&s.jsx("div",{className:"uiforge-activity-item__timeline-marker"}),s.jsx("div",{className:"uiforge-activity-item__icon",children:j?j(t):t.icon||ur(t.type)}),s.jsxs("div",{className:"uiforge-activity-item__content",children:[s.jsxs("div",{className:h,onClick:w,onKeyDown:i,role:d?"button":void 0,tabIndex:d?0:void 0,"aria-expanded":d?e:void 0,children:[s.jsx("div",{className:"uiforge-activity-item__title",children:t.title}),A&&s.jsx("div",{className:"uiforge-activity-item__timestamp",children:hr(t.timestamp)}),d&&s.jsx("div",{className:"uiforge-activity-item__toggle",children:e?s.jsx(ve.fold,{size:16}):s.jsx(ve.unfold,{size:16})})]}),e&&t.description&&A&&s.jsx("div",{className:"uiforge-activity-item__description",children:t.description})]})]})},Te=400,fr=t=>{const e=pe[t]||pe.commit;return s.jsx(e,{size:16})},$e=(t,e=2)=>{if(t.length===0)return[];const r=[];let n=[],a=null;return t.forEach((f,l)=>{a===f.type?n.push(f):(n.length>=e&&a?r.push(Be(n,a)):n.forEach(c=>{r.push({id:c.id.toString(),type:c.type,count:1,title:c.title,timestamp:new Date(c.timestamp),icon:c.icon,events:[c]})}),n=[f],a=f.type),l===t.length-1&&(n.length>=e&&a?r.push(Be(n,a)):n.forEach(c=>{r.push({id:c.id.toString(),type:c.type,count:1,title:c.title,timestamp:new Date(c.timestamp),icon:c.icon,events:[c]})}))}),r},Be=(t,e)=>{const r=t.reduce((l,c)=>{const j=c.metadata?.repository||"unknown";return l[j]||(l[j]=[]),l[j].push(c),l},{}),n=Object.entries(r),a=n.length>1;let f="";if(a)f=`Created ${t.length} ${Se(e)} in ${n.length} repositories`;else{const l=n[0][0];f=`Created ${t.length} ${Se(e)}${l!=="unknown"?` in ${l}`:""}`}return{id:`group-${e}-${t[0].id}`,type:e,count:t.length,title:f,timestamp:new Date(t[0].timestamp),icon:t[0].icon,events:t,children:a?n.map(([l,c])=>({id:`group-${e}-${l}`,type:e,count:c.length,title:`Created ${c.length} ${Se(e)} in ${l}`,timestamp:new Date(c[0].timestamp),icon:c[0].icon,events:c})):void 0}},Se=t=>({pr:"pull requests",issue:"issues",commit:"commits",comment:"comments",star:"stars",fork:"forks",merge:"merges",release:"releases",deploy:"deployments"})[t]||`${t}s`,Ne=t=>{if(t.length===0)return[];const e=[];let r=null;return t.forEach((n,a)=>{if("type"in n&&n.type==="date-separator"){e.push(n);return}const l=n.timestamp,c=`${l.getFullYear()}-${l.getMonth()}`;if(c!==r){const j={id:`sep-${a}`,type:"date-separator",date:l,label:pr(l)};e.push(j),r=c}e.push(n)}),e},pr=t=>t.toLocaleDateString("en-US",{month:"long",year:"numeric"}),vr=t=>{const e=typeof t=="string"?new Date(t):t,n=new Date().getTime()-e.getTime(),a=Math.floor(n/1e3),f=Math.floor(a/60),l=Math.floor(f/60),c=Math.floor(l/24);return a<60?"just now":f<60?`${f}m ago`:l<24?`${l}h ago`:c<30?`${c}d ago`:e.toLocaleDateString()},gr=({events:t,theme:e="light",className:r="",style:n,showLoadMore:a=!0,loading:f=!1,onLoadMore:l,pagination:c,maxHeight:j,showMoreThreshold:k=100,initiallyExpandedAll:$=!1,emptyMessage:E="No activity to display",onToggleExpand:A,enableGrouping:d=!0,groupingThreshold:w=2,showDateSeparators:i=!0,showTimeline:u=!0,scale:h,density:x="comfortable",responsive:S=!0,compactBreakpointPx:U=640,containerRef:C,showMeta:y,renderIcon:M,renderEvent:L,virtualization:O=!1,virtualItemHeight:R=48})=>{const[W,v]=o.useState(()=>{const g=new Set;return(d?i?Ne($e(t,w)):$e(t,w):t.map(z=>({id:z.id.toString(),type:z.type,count:1,title:z.title,timestamp:new Date(z.timestamp),icon:z.icon,events:[z]}))).forEach(z=>{if("events"in z&&z.type!=="date-separator"){const J=z;($||J.events.some(m=>m.initiallyExpanded))&&g.add(J.id),J.children&&J.children.forEach(m=>{($||m.events.some(D=>D.initiallyExpanded))&&g.add(m.id)})}}),g}),[N,_]=o.useState(!1),[b,re]=o.useState(Te),Y=o.useRef(null),te=C||Y,X=o.useRef(null),ne=o.useRef(null),se=At(S?te:null,U),T=o.useMemo(()=>S&&se&&x==="comfortable"?"compact":x,[S,se,x]),oe=o.useMemo(()=>y!==void 0?y:!0,[y]),Z=o.useMemo(()=>{if(!d){const P=t.map(z=>({id:z.id.toString(),type:z.type,count:1,title:z.title,timestamp:new Date(z.timestamp),icon:z.icon,events:[z]}));return i?Ne(P):P}const g=$e(t,w);return i?Ne(g):g},[t,d,w,i]),ee=o.useCallback(()=>{if(!X.current||!a||!l)return;const{scrollTop:g,scrollHeight:P,clientHeight:z}=X.current,J=P-g-z;_(J<=k)},[a,l,k]),le=o.useCallback(({scrollOffset:g})=>{if(!a||!l)return;const P=Z.length*R,z=b,J=P-g-z;_(J<=k)},[a,l,k,Z.length,R,b]);o.useEffect(()=>{if(!O||!Y.current)return;const g=()=>{const z=Y.current;if(z){let J=z.clientHeight||Te;if(j){const m=parseFloat(j);!isNaN(m)&&m>0&&(J=m)}re(J)}};g();const P=new ResizeObserver(g);return P.observe(Y.current),()=>{P.disconnect()}},[O,j]),o.useEffect(()=>{const g=X.current;if(g)return g.addEventListener("scroll",ee),ee(),()=>{g.removeEventListener("scroll",ee)}},[ee]);const I=o.useCallback((g,P)=>{v(z=>{const J=new Set(z),m=J.has(g);return m?J.delete(g):J.add(g),A?.(P,!m),J})},[A]),F=(g,P=!1)=>{const z=W.has(g.id),J=g.children&&g.children.length>0,m=g.count>1,D=g.count===1&&g.events[0]?.description,Q=m||J||D,G=g.count===1&&g.events.length===1?g.events[0].id:g.id;return L&&g.count===1&&g.events.length===1?s.jsxs("div",{className:`activity-stream__item ${P?"activity-stream__item--child":""}`,"data-event-id":g.id,children:[u&&!P&&s.jsx("div",{className:"activity-stream__timeline-marker"}),L(g.events[0])]},g.id):s.jsxs("div",{className:`activity-stream__item ${P?"activity-stream__item--child":""}`,"data-event-id":g.id,children:[u&&!P&&s.jsx("div",{className:"activity-stream__timeline-marker"}),s.jsx("div",{className:"activity-stream__icon",children:M&&g.events.length===1?M(g.events[0]):g.icon||fr(g.type)}),s.jsxs("div",{className:"activity-stream__content",children:[s.jsxs("div",{className:`activity-stream__header ${Q?"activity-stream__header--clickable":""}`,onClick:()=>Q&&I(g.id,G),onKeyDown:B=>{Q&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),I(g.id,G))},role:Q?"button":void 0,tabIndex:Q?0:void 0,"aria-expanded":Q?z:void 0,children:[s.jsx("div",{className:"activity-stream__title",children:g.title}),s.jsx("div",{className:"activity-stream__timestamp",children:vr(g.timestamp)}),Q&&s.jsx("div",{className:"activity-stream__toggle",children:z?s.jsx(ve.fold,{size:16}):s.jsx(ve.unfold,{size:16})})]}),z&&J&&g.children&&s.jsx("div",{className:"activity-stream__children",children:g.children.map(B=>F(B,!0))}),z&&!J&&g.events.length>1&&s.jsx("div",{className:"activity-stream__events-list",children:g.events.map(B=>L?s.jsx("div",{className:"activity-stream__event-item",children:L(B)},B.id):s.jsxs("div",{className:"activity-stream__event-item",children:[s.jsx("div",{className:"activity-stream__event-title",children:B.title}),B.description&&s.jsx("div",{className:"activity-stream__event-description",children:B.description})]},B.id))}),z&&g.count===1&&g.events[0].description&&s.jsx("div",{className:"activity-stream__description",children:g.events[0].description})]})]},g.id)},p=o.useCallback(g=>{if("type"in g&&g.type==="date-separator"){const P=g;return s.jsxs("div",{className:"activity-stream__date-separator",children:[s.jsx("div",{className:"activity-stream__date-label",children:P.label}),s.jsx("div",{className:"activity-stream__date-line"})]},P.id)}return F(g)},[W,u,M,L,I]),V=g=>s.jsxs("div",{className:"activity-stream__date-separator",children:[s.jsx("div",{className:"activity-stream__date-label",children:g.label}),s.jsx("div",{className:"activity-stream__date-line"})]},g.id),H=o.useCallback(({index:g,style:P})=>{const z=Z[g];return z?s.jsx("div",{style:P,className:"activity-stream__virtual-row",children:p(z)}):null},[Z,p]),K=c?.hasMore!==void 0?c.hasMore:c?.totalItems!==void 0?t.length<c.totalItems:!0,ae="activity-stream",q=`${ae}--${e}`,de=u?`${ae}--with-timeline`:"",he=`${ae}--${T}`;let ie=`${ae} ${q} ${de} ${he} ${r}`.trim();h!==void 0&&h<1&&(ie=`${ie} ${ae}--scale-compact`),h!==void 0&&h>1&&(ie=`${ie} ${ae}--scale-spacious`);const je=j?{maxHeight:j}:void 0,ge=h!==void 0?{"--activity-stream-scale":h}:{};return s.jsx(Pt,{value:{density:T,showMeta:oe},children:s.jsx("div",{ref:Y,className:`${ie}${O?" activity-stream--virtualized":""}`,"data-theme":e,"data-density":T,"data-show-meta":oe,"data-virtualized":O,style:n,children:O?s.jsxs("div",{className:"activity-stream__container activity-stream__container--virtualized",style:ge,children:[Z.length===0?s.jsx("div",{className:"activity-stream__empty",children:E}):s.jsx(nr,{ref:ne,className:"activity-stream__items activity-stream__items--virtualized",height:b,itemCount:Z.length,itemSize:R,width:"100%",onScroll:le,children:H}),f&&s.jsxs("div",{className:"activity-stream__loading",children:[s.jsx("div",{className:"activity-stream__spinner"}),s.jsx("span",{children:"Loading..."})]}),a&&!f&&K&&l&&s.jsx("div",{className:`activity-stream__load-more ${N?"activity-stream__load-more--visible":""}`,onClick:l,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]}):s.jsxs("div",{ref:X,className:"activity-stream__container",style:{...je,...ge},children:[Z.length===0?s.jsx("div",{className:"activity-stream__empty",children:E}):s.jsx("div",{className:"activity-stream__items",children:Z.map(g=>"type"in g&&g.type==="date-separator"?V(g):F(g))}),f&&s.jsxs("div",{className:"activity-stream__loading",children:[s.jsx("div",{className:"activity-stream__spinner"}),s.jsx("span",{children:"Loading..."})]}),a&&!f&&K&&l&&s.jsx("div",{className:`activity-stream__load-more ${N?"activity-stream__load-more--visible":""}`,onClick:l,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]})})})},xr={name:"youtube",displayName:"YouTube",domains:["youtube.com","youtu.be","youtube-nocookie.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);return e.hostname.replace("www.","")==="youtu.be"?e.pathname.slice(1).split("?")[0]:e.searchParams.has("v")?e.searchParams.get("v"):e.pathname.startsWith("/embed/")||e.pathname.startsWith("/v/")?e.pathname.split("/")[2]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1"),e.muted&&r.set("mute","1"),e.loop&&(r.set("loop","1"),r.set("playlist",t)),e.startTime&&r.set("start",String(e.startTime)),e.controls===!1&&r.set("controls","0");const n="https://www.youtube.com",a=r.toString();return`${n}/embed/${t}${a?`?${a}`:""}`}},yr={name:"vimeo",displayName:"Vimeo",domains:["vimeo.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r!=="vimeo.com"&&r!=="player.vimeo.com")return null;if(e.pathname.startsWith("/video/"))return e.pathname.split("/")[2];const n=e.pathname.split("/").filter(Boolean);if(n.length>0){const a=n[0];if(/^\d+$/.test(a))return a}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1"),e.muted&&r.set("muted","1"),e.loop&&r.set("loop","1"),e.startTime&&r.set("t",`${e.startTime}s`),e.controls===!1&&r.set("controls","0");const n=r.toString();return`https://player.vimeo.com/video/${t}${n?`?${n}`:""}`}},br={name:"dailymotion",displayName:"Dailymotion",domains:["dailymotion.com","dai.ly"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r==="dai.ly")return e.pathname.slice(1).split("?")[0];if(r==="dailymotion.com"){if(e.pathname.startsWith("/video/"))return e.pathname.split("/")[2].split("_")[0];if(e.pathname.startsWith("/embed/video/"))return e.pathname.split("/")[3].split("?")[0]}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1"),e.muted&&r.set("mute","1"),e.loop&&r.set("loop","1"),e.startTime&&r.set("start",String(e.startTime)),e.controls===!1&&r.set("controls","0");const n=r.toString();return`https://www.dailymotion.com/embed/video/${t}${n?`?${n}`:""}`}},wr={name:"twitch",displayName:"Twitch",domains:["twitch.tv","clips.twitch.tv"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")==="clips.twitch.tv")return`clip:${e.pathname.slice(1)}`;if(e.pathname.startsWith("/videos/"))return`video:${e.pathname.split("/")[2]}`;const n=e.pathname.match(/\/([^/]+)\/clip\/([^/?]+)/);return n?`clip:${n[2]}`:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams,n=typeof window<"u"?window.location.hostname:"localhost";r.set("parent",n),e.autoplay&&r.set("autoplay","true"),e.muted&&r.set("muted","true");const a=r.toString();return t.startsWith("video:")?`https://player.twitch.tv/?video=${t.slice(6)}&${a}`:t.startsWith("clip:")?`https://clips.twitch.tv/embed?clip=${t.slice(5)}&${a}`:""}},jr={name:"kick",displayName:"Kick",domains:["kick.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="kick.com")return null;const n=e.pathname.match(/\/video\/([a-zA-Z0-9-]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://player.kick.com/video/${t}`},_r={name:"rumble",displayName:"Rumble",domains:["rumble.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="rumble.com")return null;if(e.pathname.startsWith("/embed/"))return e.pathname.split("/")[2].split("?")[0];const n=e.pathname.match(/\/([a-z0-9]+)-/);return n?n[1]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","2");const n=r.toString();return`https://rumble.com/embed/${t}${n?`?${n}`:""}`}},Ir={name:"odysee",displayName:"Odysee",domains:["odysee.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="odysee.com")return null;const n=e.pathname.match(/\$\/embed\/(.+)/);if(n)return n[1];const a=e.pathname.slice(1);return a.startsWith("@")?a:null}catch{return null}},getEmbedUrl:t=>`https://odysee.com/$/embed/${t}`},Cr={name:"bitchute",displayName:"BitChute",domains:["bitchute.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="bitchute.com")return null;const n=e.pathname.match(/\/(video|embed)\/([a-zA-Z0-9]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:t=>`https://www.bitchute.com/embed/${t}/`},kr={name:"vk",displayName:"VK Video",domains:["vk.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="vk.com")return null;const n=e.searchParams.get("z");if(n&&n.startsWith("video"))return n.replace("video","");const a=e.pathname.match(/\/video(-?\d+_\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1");const n=t.split("_");if(n.length<2)return console.error("VK video ID must be in format OWNER_ID_VIDEO_ID"),"";const a=r.toString();return`https://vk.com/video_ext.php?oid=${n[0]}&id=${n[1]}${a?`&${a}`:""}`}},$r={name:"bilibili",displayName:"Bilibili",domains:["bilibili.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r!=="bilibili.com"&&r!=="www.bilibili.com")return null;const n=e.pathname.match(/\/video\/((?:BV|av)[a-zA-Z0-9]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1");const n=r.toString();return`https://player.bilibili.com/player.html?bvid=${t}${n?`&${n}`:""}`}},Sr={name:"niconico",displayName:"Niconico",domains:["nicovideo.jp"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="nicovideo.jp")return null;const n=e.pathname.match(/\/watch\/((?:sm|so|nm)\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://embed.nicovideo.jp/watch/${t}`},Nr={name:"wistia",displayName:"Wistia",domains:["wistia.com","wi.st","wistia.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(e.pathname.includes("/medias/")){const n=e.pathname.match(/\/medias\/([a-zA-Z0-9]+)/);if(n)return n[1]}if(r.includes("wistia")&&e.pathname.includes("/iframe/")){const n=e.pathname.match(/\/iframe\/([a-zA-Z0-9]+)/);if(n)return n[1]}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoPlay","true"),e.muted&&r.set("muted","true");const n=r.toString();return`https://fast.wistia.net/embed/iframe/${t}${n?`?${n}`:""}`}},Mr={name:"brightcove",displayName:"Brightcove",domains:["brightcove.com","bcove.video"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.searchParams.get("videoId");if(r){const n=e.pathname.match(/\/(\d+)\//);if(n)return`${n[1]}:${r}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<2)return console.error("Brightcove video ID must be in format ACCOUNT_ID:VIDEO_ID"),"";const[r,...n]=e,a=n.join(":");return`https://players.brightcove.net/${r}/default_default/index.html?videoId=${a}`}},Lr={name:"kaltura",displayName:"Kaltura",domains:["kaltura.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.searchParams.get("entry_id")||e.searchParams.get("entryId");if(r){const n=e.pathname.match(/\/p\/(\d+)\//),a=e.pathname.match(/\/uiconf_id\/(\d+)/);if(n&&a)return`${n[1]}:${a[1]}:${r}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<3)return console.error("Kaltura video ID must be in format PARTNER_ID:UI_CONF_ID:ENTRY_ID"),"";const[r,n,a]=e;return`https://cdnapisec.kaltura.com/p/${r}/sp/${r}00/embedIframeJs/uiconf_id/${n}/partner_id/${r}?iframeembed=true&entry_id=${a}`}},Ar={name:"panopto",displayName:"Panopto",domains:["panopto.com"],tier:"professional",supportsAutoplay:!1,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname;if(r==="panopto.com"||r.endsWith(".panopto.com")){const a=e.searchParams.get("id");if(a)return`${r.split(".")[0]}:${a}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<2)return console.error("Panopto video ID must be in format SUBDOMAIN:SESSION_ID"),"";const[r,...n]=e,a=n.join(":");return`https://${r}.panopto.com/Panopto/Pages/Embed.aspx?id=${a}&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&captions=false&interactivity=all`}},Er={name:"jwplayer",displayName:"JW Player",domains:["jwplayer.com","jwplatform.com","content.jwplatform.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const r=new URL(t).pathname.match(/\/players\/([a-zA-Z0-9]+-[a-zA-Z0-9]+)\.html/);return r?r[1]:null}catch{return null}},getEmbedUrl:t=>`https://content.jwplatform.com/players/${t}.html`},Pr={name:"cloudflare",displayName:"Cloudflare Stream",domains:["cloudflarestream.com","videodelivery.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname,n=r==="videodelivery.net"||r.endsWith(".videodelivery.net"),a=r==="cloudflarestream.com"||r.endsWith(".cloudflarestream.com");if(n||a){const f=e.pathname.match(/\/([a-zA-Z0-9]+)(?:\/|$)/);if(f)return f[1]}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","true"),e.muted&&r.set("muted","true"),e.loop&&r.set("loop","true");const n=r.toString();return`https://iframe.videodelivery.net/${t}${n?`?${n}`:""}`}},Dr={name:"mux",displayName:"Mux",domains:["mux.com","stream.mux.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname==="stream.mux.com"){const n=e.pathname.slice(1).split(".")[0];if(n)return n}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","true"),e.muted&&r.set("muted","true");const n=r.toString();return`https://stream.mux.com/${t}.m3u8${n?`?${n}`:""}`}},Ur={name:"aws-ivs",displayName:"AWS IVS",domains:["ivs.aws","amazonaws.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);return e.hostname.includes(".channel.ivs.aws")?e.hostname.split(".")[0]:null}catch{return null}},getEmbedUrl:t=>`https://${t}.channel.ivs.aws/stream.m3u8`},Or={name:"azure-media",displayName:"Azure Media Services",domains:["azure.net","azureedge.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.endsWith(".streaming.media.azure.net")){const r=e.pathname.split("/");if(r.length>=2)return`${e.hostname}:${r[1]}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<2)return console.error("Azure Media video ID must be in format HOSTNAME:ASSET_ID"),"";const[r,...n]=e,a=n.join(":");return`https://${r}/${a}/manifest`}},zr={name:"google-drive",displayName:"Google Drive",domains:["drive.google.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="drive.google.com")return null;const n=e.pathname.match(/\/file\/d\/([a-zA-Z0-9_-]+)/);if(n)return n[1];const a=e.searchParams.get("id");return a||null}catch{return null}},getEmbedUrl:t=>`https://drive.google.com/file/d/${t}/preview`},Rr={name:"dropbox",displayName:"Dropbox",domains:["dropbox.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{return new URL(t).hostname.replace("www.","")!=="dropbox.com"?null:t}catch{return null}},getEmbedUrl:t=>{try{const e=new URL(t);return e.searchParams.delete("dl"),e.searchParams.set("raw","1"),e.toString()}catch{return t}}},Vr={name:"facebook",displayName:"Facebook Video",domains:["facebook.com","fb.watch"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r==="fb.watch")return e.pathname.slice(1);if(r==="facebook.com"){const n=e.searchParams.get("v");if(n)return n;const a=e.pathname.match(/\/videos\/(\d+)/);if(a)return a[1]}return null}catch{return null}},getEmbedUrl:t=>`https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fwatch%2F%3Fv%3D${t}`},Tr={name:"instagram",displayName:"Instagram",domains:["instagram.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="instagram.com")return null;const n=e.pathname.match(/\/(p|reel|tv)\/([a-zA-Z0-9_-]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:t=>`https://www.instagram.com/p/${t}/embed/`},Br={name:"twitter",displayName:"X (Twitter)",domains:["twitter.com","x.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r!=="twitter.com"&&r!=="x.com")return null;const n=e.pathname.match(/\/status\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://platform.twitter.com/embed/Tweet.html?id=${t}`},Hr={name:"pornhub",displayName:"Pornhub",domains:["pornhub.com"],tier:"adult",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="pornhub.com")return null;const n=e.searchParams.get("viewkey");if(n)return n;const a=e.pathname.match(/\/embed\/([a-zA-Z0-9]+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:t=>`https://www.pornhub.com/embed/${t}`},Wr={name:"youporn",displayName:"YouPorn",domains:["youporn.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="youporn.com")return null;const n=e.pathname.match(/\/watch\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://www.youporn.com/embed/${t}`},Fr={name:"redtube",displayName:"Redtube",domains:["redtube.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="redtube.com")return null;const n=e.searchParams.get("id");if(n)return n;const a=e.pathname.match(/\/(\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:t=>`https://embed.redtube.com/?id=${t}`},qr={name:"xhamster",displayName:"XHamster",domains:["xhamster.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="xhamster.com")return null;const n=e.pathname.match(/\/videos\/[^/]+-(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://xhamster.com/xembed.php?video=${t}`},Kr={name:"spankbang",displayName:"SpankBang",domains:["spankbang.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="spankbang.com")return null;const n=e.pathname.match(/\/([a-zA-Z0-9]+)\/video\//);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://spankbang.com/${t}/embed/`},Ae=[xr,yr,br,wr,jr,_r,Ir,Cr,kr,$r,Sr,Nr,Mr,Lr,Ar,Er,Pr,Dr,Ur,Or,zr,Rr,Vr,Tr,Br,Hr,Wr,Fr,qr,Kr],we=Ae.reduce((t,e)=>(t[e.name]=e,t),{});function Ee(t){if(!t)return null;try{const r=new URL(t).hostname.toLowerCase().replace("www.","");for(const n of Ae)for(const a of n.domains)if(r===a||r.endsWith(`.${a}`))return n;return null}catch{return null}}function Pe(t){const e=Ee(t);if(!e)return null;const r=e.extractVideoId(t);return r?{provider:e,videoId:r}:null}function Zr(t,e){const r=Pe(t);return r?r.provider.getEmbedUrl(r.videoId,e):null}function Gr(t){return Ee(t)?.tier==="adult"}const Yr=()=>s.jsxs("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"uiforge-video__play-icon",children:[s.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"white",fillOpacity:"0.9"}),s.jsx("path",{d:"M26 20L46 32L26 44V20Z",fill:"currentColor",style:{color:"#3b82f6"}})]}),Jr=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"uiforge-video-preview__icon",children:[s.jsx("path",{d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v10a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm2-1a1 1 0 00-1 1v10a1 1 0 001 1h12a1 1 0 001-1V5a1 1 0 00-1-1H4z"}),s.jsx("path",{d:"M8 7l5 3-5 3V7z"})]}),Qr=({title:t,description:e,url:r,youtubeId:n,vimeoId:a,provider:f,videoId:l,autoplay:c=!1,muted:j=!1,loop:k=!1,startTime:$,controls:E=!0,thumbnailUrl:A,onPlay:d,onError:w,onReady:i,className:u="",overlayIcon:h,aspectRatio:x="16:9",width:S,height:U,maxHeight:C,responsive:y=!1,hideHeader:M=!1,allowAdultContent:L=!1,fallback:O})=>{const[R,W]=o.useState(!1),[v,N]=o.useState(null),_=o.useRef(null),b=o.useMemo(()=>{if(f&&l){const F=we[f];if(F)return{provider:F,videoId:l,method:"explicit"}}if(r){const F=Pe(r);if(F)return{...F,method:"url"}}if(n){const F=we.youtube;if(F)return{provider:F,videoId:n,method:"legacy"}}if(a){const F=we.vimeo;if(F)return{provider:F,videoId:a,method:"legacy"}}return null},[r,f,l,n,a]),re=o.useMemo(()=>b?b.provider.tier==="adult":!1,[b]),Y=o.useMemo(()=>({autoplay:R?!0:c,muted:j,loop:k,startTime:$,controls:E}),[c,j,k,$,E,R]),te=o.useMemo(()=>{if(!b)return"";try{return b.provider.getEmbedUrl(b.videoId,Y)}catch(F){return console.error("Error generating embed URL:",F),""}},[b,Y]),X=o.useMemo(()=>{if(A)return A;if(b?.provider.name==="youtube")return`https://img.youtube.com/vi/${b.videoId}/maxresdefault.jpg`},[A,b]),ne=o.useCallback(()=>{b&&(W(!0),d&&d(b.videoId,b.provider.name),i&&i(b.videoId,b.provider.name))},[b,d,i]),se=o.useCallback(F=>{N(F),w&&b&&w(new Error(F),b.provider.name)},[w,b]);if(!b)return O?s.jsx(s.Fragment,{children:O}):(console.warn("UIForgeVideo: No valid video source provided"),null);if(re&&!L){const F="Adult content must be explicitly enabled with allowAdultContent prop";return O?s.jsx(s.Fragment,{children:O}):(console.warn(`UIForgeVideo: ${F}`),s.jsx("div",{className:"uiforge-video",children:s.jsx("div",{className:"uiforge-video__error",children:s.jsx("p",{children:F})})}))}if(v)return O?s.jsx(s.Fragment,{children:O}):s.jsx("div",{className:"uiforge-video",children:s.jsx("div",{className:"uiforge-video__error",children:s.jsx("p",{children:v})})});const T="uiforge-video",oe=y?`${T}--responsive`:"",Z=`${T} ${oe} ${u}`.trim(),ee={aspectRatio:x!=="auto"?x.replace(":","/"):void 0,width:S?typeof S=="number"?`${S}px`:S:void 0,height:U?typeof U=="number"?`${U}px`:U:void 0,maxHeight:C?typeof C=="number"?`${C}px`:C:void 0},le=t||`${b.provider.displayName} Video`,I=!M&&(t||e);return s.jsxs("div",{className:Z,children:[I&&s.jsxs("div",{className:`${T}__header`,children:[t&&s.jsx("h3",{className:`${T}__title`,children:t}),e&&s.jsx("p",{className:`${T}__description`,children:e})]}),s.jsx("div",{className:`${T}__player-container`,style:ee,children:R?s.jsx("iframe",{ref:_,src:te,title:le,className:`${T}__iframe`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,onError:()=>se("Failed to load video")}):s.jsxs(s.Fragment,{children:[X&&s.jsx("img",{src:X,alt:le,className:`${T}__thumbnail`}),s.jsx("button",{className:`${T}__overlay`,onClick:ne,"aria-label":`Play video: ${le}`,type:"button",children:h||s.jsx(Yr,{})})]})})]})},Xr=({title:t,icon:e,className:r="",onClick:n})=>{const a="uiforge-video-preview",f=`${a} ${r}`.trim(),l=()=>{n&&n()},c=$=>{n&&($.key==="Enter"||$.key===" ")&&($.preventDefault(),n())},j=n?"button":"div",k=n?{type:"button",onClick:l,onKeyDown:c}:{};return s.jsxs(j,{className:f,...k,children:[s.jsx("div",{className:`${a}__icon-container`,children:e||s.jsx(Jr,{})}),s.jsx("span",{className:`${a}__title`,children:t})]})},He=t=>{const e=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");return Array.from(t.querySelectorAll(e))},es=({id:t,variant:e="static",open:r=!0,onOpenChange:n,children:a,className:f="",ariaLabel:l="Sidebar navigation",width:c="280px",height:j="200px",position:k="left",showBackdrop:$=!0,closeOnBackdropClick:E=!0,closeOnEscape:A=!0,trapFocus:d=!0})=>{const w=o.useRef(null),i=o.useRef(null),u=e==="drawer"||e==="bottom",h=o.useCallback(()=>{E&&n&&n(!1)},[E,n]);o.useEffect(()=>{if(!u||!r||!A)return;const M=L=>{L.key==="Escape"&&(L.preventDefault(),n?.(!1))};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[u,r,A,n]),o.useEffect(()=>{if(!u||!r||!d)return;const M=w.current;if(!M)return;i.current=document.activeElement;const L=He(M);L.length>0?L[0].focus():M.focus();const O=R=>{if(R.key!=="Tab")return;const W=He(M);if(W.length===0)return;const v=W[0],N=W[W.length-1];R.shiftKey?document.activeElement===v&&(R.preventDefault(),N.focus()):document.activeElement===N&&(R.preventDefault(),v.focus())};return document.addEventListener("keydown",O),()=>{document.removeEventListener("keydown",O),i.current&&typeof i.current.focus=="function"&&i.current.focus()}},[u,r,d]),o.useEffect(()=>{if(!u||!r)return;const M=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=M}},[u,r]);const x="uiforge-sidebar",S=[x,`${x}--${e}`,`${x}--${k}`,u&&r&&`${x}--open`,u&&!r&&`${x}--closed`,f].filter(Boolean).join(" "),U={"--sidebar-width":c,"--sidebar-height":j},y=e==="static"?{role:"navigation","aria-label":l}:{role:"dialog","aria-modal":r,"aria-expanded":r,"aria-label":l,"aria-hidden":!r};return e==="static"?s.jsx("aside",{id:t,ref:w,className:S,style:U,...y,children:s.jsx("div",{className:`${x}__content`,children:a})}):s.jsxs(s.Fragment,{children:[$&&s.jsx("div",{className:`${x}__backdrop ${r?`${x}__backdrop--visible`:""}`,onClick:h,"aria-hidden":"true"}),s.jsx("aside",{id:t,ref:w,className:S,style:U,tabIndex:-1,...y,children:s.jsx("div",{className:`${x}__content`,children:a})})]})};function ts(t,e){const{sampleCount:r=3,min:n=3,max:a=15,approxItemHeight:f=120}=e??{},[l,c]=o.useState(n),j=o.useRef(n),k=o.useCallback(()=>{const $=t?.current;if(!$)return n;const E=$.clientHeight;if(E===0)return n;const A=Array.from($.children).filter(u=>u instanceof HTMLElement&&u.offsetHeight>0);let d=f;if(A.length>0){const u=Math.min(r,A.length);let h=0;for(let x=0;x<u;x++)h+=A[x].offsetHeight;d=h/u}const w=Math.floor(E/d);return Math.max(n,Math.min(a,w))},[t,r,n,a,f]);return o.useEffect(()=>{const $=t?.current;if(!$)return;const E=()=>{const w=k();w!==j.current&&(j.current=w,c(w))};E();let A;typeof ResizeObserver<"u"&&(A=new ResizeObserver(()=>{E()}),A.observe($));let d;return typeof MutationObserver<"u"&&(d=new MutationObserver(()=>{E()}),d.observe($,{childList:!0,subtree:!1})),()=>{A?.disconnect(),d?.disconnect()}},[t,k]),l}exports.ActivityIcons=pe;exports.ActivityItemProvider=Pt;exports.AlienIcon=xt;exports.BriefcaseIcon=Ct;exports.BugIcon=ft;exports.BuildIcon=Lt;exports.BusinessIcons=cr;exports.Button=Ut;exports.CalendarIcon=It;exports.ChartIcon=wt;exports.CheckIcon=rt;exports.CloseIcon=tt;exports.CloudIcon=ht;exports.CodeIcon=pt;exports.CommentIcon=Ke;exports.CommitIcon=We;exports.DatabaseIcon=ut;exports.DeployIcon=Qe;exports.DeploymentIcon=Nt;exports.DevProcessIcons=dr;exports.DocumentIcon=_t;exports.DumbbellIcon=it;exports.FitnessIcons=ir;exports.FoldIcon=et;exports.ForkIcon=Ge;exports.GitBranchIcon=kt;exports.HamburgerButton=Ot;exports.HeartRateIcon=lt;exports.IssueIcon=qe;exports.MeditationIcon=nt;exports.MeetingIcon=jt;exports.MergeIcon=Ye;exports.PlanetIcon=yt;exports.PullRequestDraftIcon=$t;exports.PullRequestIcon=Fe;exports.ReleaseIcon=Je;exports.ReviewIcon=Mt;exports.RocketIcon=vt;exports.RunningIcon=ot;exports.SatelliteIcon=gt;exports.ServerIcon=dt;exports.SpaceIcons=lr;exports.StarIcon=Ze;exports.StrengthIcon=ct;exports.TaiChiIcon=st;exports.TechIcons=or;exports.TelescopeIcon=bt;exports.TerminalIcon=mt;exports.TestingIcon=St;exports.UIForgeActivityItem=mr;exports.UIForgeActivityStream=gr;exports.UIForgeBlocksEditor=Vt;exports.UIForgeComboBox=Zt;exports.UIForgeGrid=zt;exports.UIForgeSidebar=es;exports.UIForgeVideo=Qr;exports.UIForgeVideoPreview=Xr;exports.UIIcons=ve;exports.UnfoldIcon=Xe;exports.WellnessIcons=ar;exports.YogaIcon=at;exports.blocksToHTML=Ft;exports.blocksToJSON=Kt;exports.blocksToMarkdown=qt;exports.detectProvider=Ee;exports.extractVideoId=Pe;exports.getEmbedUrlFromVideoUrl=Zr;exports.isAdultContent=Gr;exports.providersByName=we;exports.useActivityItemContext=Dt;exports.useDynamicPageCount=ts;exports.useResponsive=At;exports.videoProviders=Ae;
6
+ `)}function Gt(t){return JSON.stringify(t,null,2)}const Yt=({options:t=[],value:e,onChange:r,onSearch:n,theme:a="light",placeholder:d="Select an option...",disabled:l=!1,clearable:c=!1,className:_="",renderOption:w,renderValue:L,loading:A=!1,maxHeight:S="300px",debounceMs:u=300,searchable:C=!0,noOptionsMessage:o="No options found",ariaLabel:h,enableCache:f=!1,cacheTTL:b,refreshOnOpen:k=!1,onClearCache:P,onForceRefresh:$})=>{const[j,E]=i.useState(!1),[D,N]=i.useState(""),[z,B]=i.useState([]),[v,m]=i.useState(0),[y,I]=i.useState(!1),te=i.useRef(null),Y=i.useRef(null),re=i.useRef(null),X=i.useRef(null),ne=i.useRef(null),se=i.useRef(n),T=i.useRef(null),oe=i.useRef(!1),Z=i.useRef(new Map),ee=i.useRef(f),le=i.useRef(b),M=i.useCallback((p,O=0)=>p.reduce((Q,G)=>{const H={...G,level:O};return Q.push(H),G.children&&G.children.length>0&&Q.push(...M(G.children,O+1)),Q},[]),[]),F=p=>typeof p=="string"&&(p.startsWith("http://")||p.startsWith("https://")||p.startsWith("data:")||p.startsWith("/")),g=i.useMemo(()=>M(z.length>0?z:t).find(O=>O.value===e)||null,[e,t,z,M]),V=i.useCallback((p,O)=>{if(!O.trim())return p;const Q=O.toLowerCase(),G=H=>H.reduce((ce,ue)=>{const xe=ue.label.toLowerCase().includes(Q),fe=ue.children?G(ue.children):[];return(xe||fe.length>0)&&ce.push({...ue,children:fe.length>0?fe:ue.children}),ce},[]);return G(p)},[]);i.useEffect(()=>{se.current=n,ne.current=null},[n]),i.useEffect(()=>{ee.current=f},[f]),i.useEffect(()=>{le.current=b},[b]),i.useEffect(()=>{P&&P(()=>{Z.current.clear()}),$&&$(()=>{if(!se.current)return;T.current&&T.current.abort(),T.current=new AbortController;const p=T.current.signal;I(!0),(async()=>{try{const O=Date.now(),Q=D,G=Z.current.get(Q),H=G&&(!le.current||O-G.timestamp<le.current);let ce;ee.current&&H?ce=G.data:(ce=await(se.current?se.current(D,p):n?.(D,p)??[]),!p.aborted&&ee.current&&Z.current.set(Q,{data:ce,timestamp:O})),p.aborted||(B(ce),ne.current=D)}catch(O){console.error(O),B([])}finally{I(!1)}})()})},[P,$,D,n]),i.useEffect(()=>{if(n&&j){const p=ne.current===D,O=!oe.current&&j;return p&&!(k&&O)?void 0:(X.current&&clearTimeout(X.current),X.current=setTimeout(async()=>{T.current&&T.current.abort(),T.current=new AbortController;const G=T.current.signal;I(!0);try{let H;const ce=D,ue=Z.current.get(ce),xe=Date.now(),fe=ue&&(!le.current||xe-ue.timestamp<le.current);if(ee.current&&fe?H=ue.data:(H=await(se.current?se.current(D,G):n(D,G)),!G.aborted&&ee.current&&Z.current.set(ce,{data:H,timestamp:xe})),G.aborted)return;B(H),ne.current=D}catch(H){console.error("Error fetching options:",H),B([])}finally{I(!1)}},u),()=>{X.current&&clearTimeout(X.current),T.current&&(T.current.abort(),T.current=null)})}else n||B(V(t,D));oe.current=j},[D,j,t,u,V,k,n]),i.useEffect(()=>{n||B(t)},[t,n]),i.useEffect(()=>{const p=O=>{te.current&&!te.current.contains(O.target)&&(E(!1),N(""))};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const W=i.useMemo(()=>M(z.length>0?z:t).filter(O=>!O.disabled),[z,t,M]),K=i.useMemo(()=>M(z.length>0?z:t),[z,t,M]),ae=i.useMemo(()=>{const p=new Map;return K.forEach(O=>{const Q=JSON.stringify({value:O.value,label:O.label}),G=W.findIndex(H=>H.value===O.value&&H.label===O.label);p.set(Q,G)}),p},[K,W]),q=p=>{if(!l)switch(p.key){case"ArrowDown":p.preventDefault(),j?m(O=>O<W.length-1?O+1:0):E(!0);break;case"ArrowUp":p.preventDefault(),j&&m(O=>O>0?O-1:W.length-1);break;case"Enter":p.preventDefault(),j&&W[v]?de(W[v]):E(!j);break;case"Escape":p.preventDefault(),E(!1),N("");break;case"Tab":j&&(E(!1),N(""));break}};i.useEffect(()=>{if(j&&re.current){const p=re.current.querySelector(`[data-index="${v}"]`);p&&typeof p.scrollIntoView=="function"&&p.scrollIntoView({block:"nearest"})}},[v,j]);const de=p=>{p.disabled||(r?.(p.value,p),E(!1),N(""),m(0))},he=p=>{p.stopPropagation(),r?.(null,null),N("")},ie=()=>{l||E(p=>{const O=!p;return O&&setTimeout(()=>Y.current?.focus(),0),O})};i.useEffect(()=>{j||(ne.current=null)},[j]);const je=p=>{N(p.target.value),j||E(!0),m(0)},ge=p=>{const O=(p.level||0)*20;return s.jsxs("div",{className:"uiforge-combobox-option-content",style:{paddingLeft:`${O}px`},children:[p.icon&&s.jsx("span",{className:"uiforge-combobox-option-icon",children:F(p.icon)?s.jsx("img",{src:p.icon,alt:"",className:"uiforge-combobox-option-icon-img"}):p.icon}),s.jsx("span",{className:"uiforge-combobox-option-label",children:p.label})]})},x=p=>p?s.jsxs("div",{className:"uiforge-combobox-value-content",children:[p.icon&&s.jsx("span",{className:"uiforge-combobox-value-icon",children:F(p.icon)?s.jsx("img",{src:p.icon,alt:"",className:"uiforge-combobox-value-icon-img"}):p.icon}),s.jsx("span",{className:"uiforge-combobox-value-label",children:p.label})]}):d,R="uiforge-combobox",U=`${R}--${a}`,J=[R,U,j&&`${R}--open`,l&&`${R}--disabled`,_].filter(Boolean).join(" ");return s.jsxs("div",{ref:te,className:J,onKeyDown:q,role:"combobox","aria-expanded":j,"aria-haspopup":"listbox","aria-label":h,"aria-disabled":l,tabIndex:l?-1:0,"data-theme":a,children:[s.jsxs("div",{className:`${R}-control`,onClick:ie,children:[C&&j?s.jsx("input",{ref:Y,type:"text",className:`${R}-input`,value:D,onChange:je,placeholder:d,disabled:l,"aria-autocomplete":"list","aria-controls":`${R}-listbox`}):s.jsx("div",{className:`${R}-value`,children:L?L(g):x(g)}),s.jsxs("div",{className:`${R}-indicators`,children:[c&&e!==null&&e!==void 0&&!l&&s.jsx("button",{type:"button",className:`${R}-clear`,onClick:he,"aria-label":"Clear selection",tabIndex:-1,children:"×"}),s.jsx("span",{className:`${R}-arrow`,children:"▼"})]})]}),j&&s.jsx("div",{ref:re,className:`${R}-dropdown`,style:{maxHeight:S},role:"listbox",id:`${R}-listbox`,children:A||y?s.jsx("div",{className:`${R}-loading`,children:"Loading..."}):W.length===0?s.jsx("div",{className:`${R}-no-options`,children:o}):K.map(p=>{const O=JSON.stringify({value:p.value,label:p.label}),Q=ae.get(O)??-1,G=p.value===e,H=Q===v,ce=[`${R}-option`,G&&`${R}-option--selected`,H&&`${R}-option--highlighted`,p.disabled&&`${R}-option--disabled`].filter(Boolean).join(" ");return s.jsx("div",{className:ce,onClick:()=>de(p),role:"option","aria-selected":G,"aria-disabled":p.disabled,"data-index":Q,children:w?w(p):ge(p)},O)})})]})};function Me(){return Me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Me.apply(null,arguments)}function Pe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Le(t,e){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Le(t,e)}function Jt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Le(t,e)}var Re=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Qt(t,e){return!!(t===e||Re(t)&&Re(e))}function Xt(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!Qt(t[r],e[r]))return!1;return!0}function Ce(t,e){e===void 0&&(e=Xt);var r,n=[],a,d=!1;function l(){for(var c=[],_=0;_<arguments.length;_++)c[_]=arguments[_];return d&&r===this&&e(c,n)||(a=t.apply(this,c),d=!0,r=this,n=c),a}return l}var er=typeof performance=="object"&&typeof performance.now=="function",Oe=er?function(){return performance.now()}:function(){return Date.now()};function Ue(t){cancelAnimationFrame(t.id)}function tr(t,e){var r=Oe();function n(){Oe()-r>=e?t.call(null):a.id=requestAnimationFrame(n)}var a={id:requestAnimationFrame(n)};return a}var $e=-1;function ze(t){if(t===void 0&&(t=!1),$e===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),$e=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return $e}var me=null;function Ve(t){if(t===void 0&&(t=!1),me===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),a=n.style;return a.width="100px",a.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?me="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?me="negative":me="positive-ascending"),document.body.removeChild(e),me}return me}process.env.NODE_ENV;var rr=150,sr=function(e,r){return e},be=null,ye=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(be=new WeakSet,ye=new WeakSet);function nr(t){var e,r=t.getItemOffset,n=t.getEstimatedTotalSize,a=t.getItemSize,d=t.getOffsetForIndexAndAlignment,l=t.getStartIndexForOffset,c=t.getStopIndexForStartIndex,_=t.initInstanceProps,w=t.shouldResetStyleCacheOnItemSizeChange,L=t.validateProps;return e=(function(A){Jt(S,A);function S(C){var o;return o=A.call(this,C)||this,o._instanceProps=_(o.props,Pe(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:Pe(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=Ce(function(h,f,b,k){return o.props.onItemsRendered({overscanStartIndex:h,overscanStopIndex:f,visibleStartIndex:b,visibleStopIndex:k})}),o._callOnScroll=void 0,o._callOnScroll=Ce(function(h,f,b){return o.props.onScroll({scrollDirection:h,scrollOffset:f,scrollUpdateWasRequested:b})}),o._getItemStyle=void 0,o._getItemStyle=function(h){var f=o.props,b=f.direction,k=f.itemSize,P=f.layout,$=o._getItemStyleCache(w&&k,w&&P,w&&b),j;if($.hasOwnProperty(h))j=$[h];else{var E=r(o.props,h,o._instanceProps),D=a(o.props,h,o._instanceProps),N=b==="horizontal"||P==="horizontal",z=b==="rtl",B=N?E:0;$[h]=j={position:"absolute",left:z?void 0:B,right:z?B:void 0,top:N?0:E,height:N?"100%":D,width:N?D:"100%"}}return j},o._getItemStyleCache=void 0,o._getItemStyleCache=Ce(function(h,f,b){return{}}),o._onScrollHorizontal=function(h){var f=h.currentTarget,b=f.clientWidth,k=f.scrollLeft,P=f.scrollWidth;o.setState(function($){if($.scrollOffset===k)return null;var j=o.props.direction,E=k;if(j==="rtl")switch(Ve()){case"negative":E=-k;break;case"positive-descending":E=P-b-k;break}return E=Math.max(0,Math.min(E,P-b)),{isScrolling:!0,scrollDirection:$.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(h){var f=h.currentTarget,b=f.clientHeight,k=f.scrollHeight,P=f.scrollTop;o.setState(function($){if($.scrollOffset===P)return null;var j=Math.max(0,Math.min(P,k-b));return{isScrolling:!0,scrollDirection:$.scrollOffset<j?"forward":"backward",scrollOffset:j,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(h){var f=o.props.outerRef;o._outerRef=h,typeof f=="function"?f(h):f!=null&&typeof f=="object"&&f.hasOwnProperty("current")&&(f.current=h)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&Ue(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=tr(o._resetIsScrolling,rr)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}S.getDerivedStateFromProps=function(o,h){return ar(o,h),L(o),null};var u=S.prototype;return u.scrollTo=function(o){o=Math.max(0,o),this.setState(function(h){return h.scrollOffset===o?null:{scrollDirection:h.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},u.scrollToItem=function(o,h){h===void 0&&(h="auto");var f=this.props,b=f.itemCount,k=f.layout,P=this.state.scrollOffset;o=Math.max(0,Math.min(o,b-1));var $=0;if(this._outerRef){var j=this._outerRef;k==="vertical"?$=j.scrollWidth>j.clientWidth?ze():0:$=j.scrollHeight>j.clientHeight?ze():0}this.scrollTo(d(this.props,o,h,P,this._instanceProps,$))},u.componentDidMount=function(){var o=this.props,h=o.direction,f=o.initialScrollOffset,b=o.layout;if(typeof f=="number"&&this._outerRef!=null){var k=this._outerRef;h==="horizontal"||b==="horizontal"?k.scrollLeft=f:k.scrollTop=f}this._callPropsCallbacks()},u.componentDidUpdate=function(){var o=this.props,h=o.direction,f=o.layout,b=this.state,k=b.scrollOffset,P=b.scrollUpdateWasRequested;if(P&&this._outerRef!=null){var $=this._outerRef;if(h==="horizontal"||f==="horizontal")if(h==="rtl")switch(Ve()){case"negative":$.scrollLeft=-k;break;case"positive-ascending":$.scrollLeft=k;break;default:var j=$.clientWidth,E=$.scrollWidth;$.scrollLeft=E-j-k;break}else $.scrollLeft=k;else $.scrollTop=k}this._callPropsCallbacks()},u.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Ue(this._resetIsScrollingTimeoutId)},u.render=function(){var o=this.props,h=o.children,f=o.className,b=o.direction,k=o.height,P=o.innerRef,$=o.innerElementType,j=o.innerTagName,E=o.itemCount,D=o.itemData,N=o.itemKey,z=N===void 0?sr:N,B=o.layout,v=o.outerElementType,m=o.outerTagName,y=o.style,I=o.useIsScrolling,te=o.width,Y=this.state.isScrolling,re=b==="horizontal"||B==="horizontal",X=re?this._onScrollHorizontal:this._onScrollVertical,ne=this._getRangeToRender(),se=ne[0],T=ne[1],oe=[];if(E>0)for(var Z=se;Z<=T;Z++)oe.push(i.createElement(h,{data:D,key:z(Z,D),index:Z,isScrolling:I?Y:void 0,style:this._getItemStyle(Z)}));var ee=n(this.props,this._instanceProps);return i.createElement(v||m||"div",{className:f,onScroll:X,ref:this._outerRefSetter,style:Me({position:"relative",height:k,width:te,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},y)},i.createElement($||j||"div",{children:oe,ref:P,style:{height:re?"100%":ee,pointerEvents:Y?"none":void 0,width:re?ee:"100%"}}))},u._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var h=this._getRangeToRender(),f=h[0],b=h[1],k=h[2],P=h[3];this._callOnItemsRendered(f,b,k,P)}}if(typeof this.props.onScroll=="function"){var $=this.state,j=$.scrollDirection,E=$.scrollOffset,D=$.scrollUpdateWasRequested;this._callOnScroll(j,E,D)}},u._getRangeToRender=function(){var o=this.props,h=o.itemCount,f=o.overscanCount,b=this.state,k=b.isScrolling,P=b.scrollDirection,$=b.scrollOffset;if(h===0)return[0,0,0,0];var j=l(this.props,$,this._instanceProps),E=c(this.props,j,$,this._instanceProps),D=!k||P==="backward"?Math.max(1,f):1,N=!k||P==="forward"?Math.max(1,f):1;return[Math.max(0,j-D),Math.max(0,Math.min(h-1,E+N)),j,E]},S})(i.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var ar=function(e,r){var n=e.children,a=e.direction,d=e.height,l=e.layout,c=e.innerTagName,_=e.outerTagName,w=e.width,L=r.instance;if(process.env.NODE_ENV!=="production"){(c!=null||_!=null)&&ye&&!ye.has(L)&&(ye.add(L),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var A=a==="horizontal"||l==="horizontal";switch(a){case"horizontal":case"vertical":be&&!be.has(L)&&(be.add(L),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+a+'" was specified.'))}switch(l){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+l+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(A&&typeof w!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(w===null?"null":typeof w)+'" was specified.'));if(!A&&typeof d!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(d===null?"null":typeof d)+'" was specified.'))}},ir=nr({getItemOffset:function(e,r){var n=e.itemSize;return r*n},getItemSize:function(e,r){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var r=e.itemCount,n=e.itemSize;return n*r},getOffsetForIndexAndAlignment:function(e,r,n,a,d,l){var c=e.direction,_=e.height,w=e.itemCount,L=e.itemSize,A=e.layout,S=e.width,u=c==="horizontal"||A==="horizontal",C=u?S:_,o=Math.max(0,w*L-C),h=Math.min(o,r*L),f=Math.max(0,r*L-C+L+l);switch(n==="smart"&&(a>=f-C&&a<=h+C?n="auto":n="center"),n){case"start":return h;case"end":return f;case"center":{var b=Math.round(f+(h-f)/2);return b<Math.ceil(C/2)?0:b>o+Math.floor(C/2)?o:b}case"auto":default:return a>=f&&a<=h?a:a<f?f:h}},getStartIndexForOffset:function(e,r){var n=e.itemCount,a=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/a)))},getStopIndexForStartIndex:function(e,r,n){var a=e.direction,d=e.height,l=e.itemCount,c=e.itemSize,_=e.layout,w=e.width,L=a==="horizontal"||_==="horizontal",A=r*c,S=L?w:d,u=Math.ceil((S+n-A)/c);return Math.max(0,Math.min(l-1,r+u-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var r=e.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});const We=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M11.93 8.5a4.002 4.002 0 01-7.86 0H.75a.75.75 0 010-1.5h3.32a4.002 4.002 0 017.86 0h3.32a.75.75 0 010 1.5h-3.32zM8 5a3 3 0 100 6 3 3 0 000-6z"})}),Fe=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"})}),qe=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}),s.jsx("path",{d:"M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"})]}),Ke=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0114.25 13H8.06l-2.573 2.573A1.458 1.458 0 013 14.543V13H1.75A1.75 1.75 0 010 11.25v-8.5zM1.75 2.5a.25.25 0 00-.25.25v8.5c0 .138.112.25.25.25h2a.75.75 0 01.75.75v2.19l2.72-2.72a.75.75 0 01.53-.22h6.5a.25.25 0 00.25-.25v-8.5a.25.25 0 00-.25-.25H1.75z"})}),Ze=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"})}),Ge=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),Ye=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M5 3.254V3.25v.005a.75.75 0 110-.005v.004zm.45 1.9a2.25 2.25 0 10-1.95.218v5.256a2.25 2.25 0 101.5 0V7.123A5.735 5.735 0 009.25 9h1.378a2.251 2.251 0 100-1.5H9.25a4.25 4.25 0 01-3.8-2.346zM12.75 9a.75.75 0 100-1.5.75.75 0 000 1.5zm-8.5 4.5a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),Je=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M7.47 10.78a.75.75 0 001.06 0l3.75-3.75a.75.75 0 00-1.06-1.06L8.75 8.44V1.75a.75.75 0 00-1.5 0v6.69L4.78 5.97a.75.75 0 00-1.06 1.06l3.75 3.75zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z"})}),Qe=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.53 4.75A.75.75 0 015 6.25h6a.75.75 0 00.53-1.28l-3-3a.75.75 0 00-1.06 0l-3 3zm.47 6.47a.75.75 0 01.53-.22h6a.75.75 0 01.53 1.28l-3 3a.75.75 0 01-1.06 0l-3-3a.75.75 0 01-.01-1.06h.01z"})}),Xe=({size:t=20,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:e,children:[s.jsx("path",{d:"M10 2L6 6M10 2L14 6M10 2V7.5",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M3 10H17",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),s.jsx("path",{d:"M10 18L6 14M10 18L14 14M10 18V12.5",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),et=({size:t=20,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:e,children:[s.jsx("path",{d:"M10 7.5L6 4M10 7.5L14 4M10 7.5V2",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M3 10H17",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),s.jsx("path",{d:"M10 12.5L6 16M10 12.5L14 16M10 12.5V18",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),tt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"})}),rt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"})}),st=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:e,children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:r,strokeWidth:"1.5"}),s.jsx("path",{d:"M8 1C11.866 1 15 4.134 15 8C15 11.866 11.866 15 8 15",fill:r}),s.jsx("circle",{cx:"8",cy:"5",r:"2",fill:r==="currentColor"?"white":"#fff"}),s.jsx("circle",{cx:"8",cy:"11",r:"2",fill:r}),s.jsx("circle",{cx:"8",cy:"5",r:"0.5",fill:r}),s.jsx("circle",{cx:"8",cy:"11",r:"0.5",fill:r==="currentColor"?"white":"#fff"})]}),nt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),s.jsx("path",{d:"M8 5C6.5 5 5 6 5 7.5V9C5 9 5.5 10 6 10.5L5 14H7L8 11L9 14H11L10 10.5C10.5 10 11 9 11 9V7.5C11 6 9.5 5 8 5Z"}),s.jsx("path",{d:"M4 9L2 10M12 9L14 10",strokeWidth:"1",stroke:r,fill:"none"})]}),at=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"8",cy:"2.5",r:"1.5"}),s.jsx("path",{d:"M8 4.5L6 8L4 14H6L7 10H9L10 14H12L10 8L8 4.5Z"}),s.jsx("path",{d:"M6 8L3 6M10 8L13 6",strokeWidth:"1.5",stroke:r,fill:"none"})]}),it=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"1",y:"6",width:"2",height:"4",rx:"0.5"}),s.jsx("rect",{x:"13",y:"6",width:"2",height:"4",rx:"0.5"}),s.jsx("rect",{x:"3",y:"5.5",width:"1",height:"5"}),s.jsx("rect",{x:"12",y:"5.5",width:"1",height:"5"}),s.jsx("rect",{x:"4",y:"7",width:"8",height:"2",rx:"0.5"})]}),ot=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"10",cy:"2.5",r:"1.5"}),s.jsx("path",{d:"M9 4.5L8 6L6 7L4 8L6 9L8 8L10 7L11 9L10 12L9 14H11L12 11L13 9L12 6L10 4.5H9Z"}),s.jsx("path",{d:"M6 14H4L5 11"})]}),lt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:e,children:s.jsx("path",{d:"M2 8H5L6.5 5L8 11L9.5 8H14",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ct=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M4 8C4 6 5 4 7 4C8 4 8.5 4.5 8.5 5.5C8.5 6 8.8 6.5 9.5 6.5C10.5 6.5 11 7 11 8C11 9.5 10 11 8 12C6 13 4 12 4 10V8Z"}),s.jsx("circle",{cx:"7",cy:"3",r:"1.5"})]}),dt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"2",y:"2",width:"12",height:"3",rx:"0.5"}),s.jsx("rect",{x:"2",y:"6.5",width:"12",height:"3",rx:"0.5"}),s.jsx("rect",{x:"2",y:"11",width:"12",height:"3",rx:"0.5"}),s.jsx("circle",{cx:"4",cy:"3.5",r:"0.5"}),s.jsx("circle",{cx:"4",cy:"8",r:"0.5"}),s.jsx("circle",{cx:"4",cy:"12.5",r:"0.5"})]}),ut=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("ellipse",{cx:"8",cy:"3",rx:"5",ry:"2"}),s.jsx("path",{d:"M3 3V13C3 14.1 5.2 15 8 15C10.8 15 13 14.1 13 13V3"}),s.jsx("path",{d:"M3 8C3 9.1 5.2 10 8 10C10.8 10 13 9.1 13 8"})]}),ht=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.5 10C2.5 10 1 8.5 1 6.5C1 4.5 2.5 3 4.5 3C4.6 3 4.7 3 4.8 3.05C5.3 1.8 6.5 1 8 1C10 1 11.5 2.5 11.5 4.5C11.5 4.6 11.5 4.7 11.5 4.8C12.9 5.1 14 6.3 14 7.75C14 9.5 12.5 11 10.75 11H4.5Z"})}),mt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0114.25 15H1.75A1.75 1.75 0 010 13.25V2.75z"}),s.jsx("path",{d:"M3 5.5L6 8L3 10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),s.jsx("line",{x1:"8",y1:"10.5",x2:"12",y2:"10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),ft=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M4.75 7.5a3.25 3.25 0 116.5 0v3.75a3.25 3.25 0 01-6.5 0V7.5z"}),s.jsx("path",{d:"M5.75 7.5c0-.69.56-1.25 1.25-1.25h2c.69 0 1.25.56 1.25 1.25M4 5.5L2 4M12 5.5L14 4M4 9H1M15 9H12M4 12L2 13.5M12 12L14 13.5",stroke:r,strokeWidth:"1.5",fill:"none"}),s.jsx("ellipse",{cx:"8",cy:"4",rx:"2.5",ry:"1.5"})]}),pt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M5.28 3.72a.75.75 0 00-1.06 1.06L7.44 8l-3.22 3.22a.75.75 0 101.06 1.06l3.75-3.75a.75.75 0 000-1.06L5.28 3.72zM8.5 11.5a.75.75 0 000 1.5h5a.75.75 0 000-1.5h-5z"})}),vt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 0C6 0 4.5 2 3.5 5L1 7L4 8L5 11L7 8.5C9 7.5 11 6 13 3C14 2 15 0 16 0C16 0 14 2 13 3C11 5 9.5 6.5 8 7.5M10 4C10.552 4 11 3.552 11 3C11 2.448 10.552 2 10 2C9.448 2 9 2.448 9 3C9 3.552 9.448 4 10 4Z"}),s.jsx("path",{d:"M2 12C2 12 0 14 0 16C2 16 4 14 4 14"})]}),gt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"0.5"}),s.jsx("path",{d:"M4 4L2 2M4 12L2 14M12 4L14 2M12 12L14 14",strokeWidth:"1.5",stroke:r,strokeLinecap:"round"}),s.jsx("rect",{x:"1",y:"1",width:"1.5",height:"1.5"}),s.jsx("rect",{x:"13.5",y:"1",width:"1.5",height:"1.5"}),s.jsx("rect",{x:"1",y:"13.5",width:"1.5",height:"1.5"}),s.jsx("rect",{x:"13.5",y:"13.5",width:"1.5",height:"1.5"}),s.jsx("circle",{cx:"8",cy:"8",r:"1"})]}),xt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 1C4 1 2 3 2 6C2 8 2 10 3 11C3.5 11.5 4 12 5 12C5.5 12 6 11.5 6.5 10.5C7 9.5 7.5 9 8 9C8.5 9 9 9.5 9.5 10.5C10 11.5 10.5 12 11 12C12 12 12.5 11.5 13 11C14 10 14 8 14 6C14 3 12 1 8 1Z"}),s.jsx("ellipse",{cx:"6",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),s.jsx("ellipse",{cx:"10",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),s.jsx("circle",{cx:"6",cy:"5.5",r:"0.75",fill:r}),s.jsx("circle",{cx:"10",cy:"5.5",r:"0.75",fill:r})]}),bt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"8",cy:"8",r:"5"}),s.jsx("ellipse",{cx:"8",cy:"8",rx:"8",ry:"2.5",fill:"none",stroke:r,strokeWidth:"1",opacity:"0.6"}),s.jsx("circle",{cx:"6",cy:"6",r:"1",opacity:"0.4",fill:r==="currentColor"?"white":"#fff"})]}),yt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M1 8L6 6L14 2L12 10L10 8L8 14H6L8 8L1 8Z"}),s.jsx("path",{d:"M10 8L12 10",strokeWidth:"1.5",stroke:r})]}),wt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M1.5 13.5V2.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v11a.5.5 0 01-.5.5H2a.5.5 0 01-.5-.5zM5 13.5V5.5a.5.5 0 01.5-.5H6a.5.5 0 01.5.5v8a.5.5 0 01-.5.5h-.5a.5.5 0 01-.5-.5zM8.5 13.5V7.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v6a.5.5 0 01-.5.5H9a.5.5 0 01-.5-.5zM12 13.5V3.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v10a.5.5 0 01-.5.5h-.5a.5.5 0 01-.5-.5z"})}),jt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"5",cy:"4",r:"2"}),s.jsx("circle",{cx:"11",cy:"4",r:"2"}),s.jsx("path",{d:"M1 14V12C1 10.5 2.5 9 5 9C7.5 9 9 10.5 9 12V14H1Z"}),s.jsx("path",{d:"M7 14V12C7 10.5 8.5 9 11 9C13.5 9 15 10.5 15 12V14H7Z"})]}),_t=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M3 1.75C3 .784 3.784 0 4.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0113.25 16h-8.5A1.75 1.75 0 013 14.25V1.75z"}),s.jsx("path",{d:"M10 0v3.5c0 .275.225.5.5.5H14",fill:r==="currentColor"?"white":"#fff"})]}),It=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zM2.5 7.5v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5h-11z"})}),Ct=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M6.75 0A1.75 1.75 0 005 1.75V3H1.75C.784 3 0 3.784 0 4.75v8.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25v-8.5A1.75 1.75 0 0014.25 3H11V1.75A1.75 1.75 0 009.25 0h-2.5zM9.5 3V1.75a.25.25 0 00-.25-.25h-2.5a.25.25 0 00-.25.25V3h3z"})}),$t=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"})}),kt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M3.25 1A2.25 2.25 0 011 3.25v9.5A2.25 2.25 0 013.25 15h9.5A2.25 2.25 0 0115 12.75v-9.5A2.25 2.25 0 0012.75 1h-9.5zM2.5 3.25a.75.75 0 01.75-.75h9.5a.75.75 0 01.75.75v9.5a.75.75 0 01-.75.75h-9.5a.75.75 0 01-.75-.75v-9.5z"}),s.jsx("path",{d:"M8 4a.75.75 0 01.75.75v2.5h2.5a.75.75 0 010 1.5h-2.5v2.5a.75.75 0 01-1.5 0v-2.5h-2.5a.75.75 0 010-1.5h2.5v-2.5A.75.75 0 018 4z"})]}),St=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M6 1h4v1H6V1zM5.5 3h5L13 13c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2L5.5 3z"}),s.jsx("circle",{cx:"7",cy:"8",r:"1",fill:r==="currentColor"?"white":"#fff",opacity:"0.5"}),s.jsx("circle",{cx:"9",cy:"10",r:"0.75",fill:r==="currentColor"?"white":"#fff",opacity:"0.5"})]}),Nt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 0L0 3v5c0 5 3 7.5 8 8 5-.5 8-3 8-8V3L8 0z"}),s.jsx("path",{d:"M7 10L4.5 7.5l1-1L7 8l3.5-3.5 1 1L7 10z",fill:r==="currentColor"?"white":"#fff"})]}),Mt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"1",y:"1",width:"9",height:"11",rx:"1"}),s.jsx("line",{x1:"3",y1:"4",x2:"7",y2:"4",stroke:r==="currentColor"?"white":"#fff",strokeWidth:"1"}),s.jsx("line",{x1:"3",y1:"6.5",x2:"7",y2:"6.5",stroke:r==="currentColor"?"white":"#fff",strokeWidth:"1"}),s.jsx("circle",{cx:"11",cy:"11",r:"3",fill:"none",stroke:r,strokeWidth:"1.5"}),s.jsx("line",{x1:"13",y1:"13",x2:"15.5",y2:"15.5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round"})]}),Lt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.48 7.27c.26.26 1.28 1.33 1.28 1.33l.56-.58-.88-.91 1.69-1.8s-.76-.74-.43-.45c.32-1.19.03-2.51-.87-3.44C4.93.5 3.66.2 2.52.51l1.93 2-.51 1.96-1.89.52-1.93-2C-.19 4.17.1 5.48 1 6.4c.94.98 2.29 1.26 3.48.87zm6.44 1.94l-2.33 2.3 3.84 3.98c.31.33.73.49 1.14.49.41 0 .82-.16 1.14-.49.63-.65.63-1.7 0-2.35l-3.79-3.93zM16 2.53L13.55 0 6.33 7.46l.88.91-4.31 4.46-.99.53-1.39 2.27.35.37 2.2-1.44.51-1.02L7.9 9.08l.88.91L16 2.53z"})}),pe={commit:We,pr:Fe,issue:qe,comment:Ke,star:Ze,fork:Ge,merge:Ye,release:Je,deploy:Qe},ve={unfold:Xe,fold:et,close:tt,check:rt},or={taichi:st,meditation:nt,yoga:at},lr={dumbbell:it,running:ot,heartrate:lt,strength:ct},cr={server:dt,database:ut,cloud:ht,terminal:mt,bug:ft,code:pt},dr={rocket:vt,satellite:gt,alien:xt,planet:bt,telescope:yt},ur={chart:wt,meeting:jt,document:_t,calendar:It,briefcase:Ct},hr={gitbranch:$t,prdraft:kt,testing:St,deployment:Nt,review:Mt,build:Lt};function At(t,e=640){const[r,n]=i.useState(!1);return i.useEffect(()=>{const a=t?.current;if(!a)return;const d=()=>{const c=a.clientWidth;c>0&&n(c<e)};d();const l=new ResizeObserver(()=>{d()});return l.observe(a),()=>{l.disconnect()}},[t,e]),r}const Et=i.createContext({density:"comfortable",showMeta:!0}),Dt=({children:t,value:e})=>s.jsx(Et.Provider,{value:e,children:t});function Pt(){return i.useContext(Et)}const mr=t=>{const e=pe[t]||pe.commit;return s.jsx(e,{size:16})},fr=t=>{const e=typeof t=="string"?new Date(t):t,n=new Date().getTime()-e.getTime(),a=Math.floor(n/1e3),d=Math.floor(a/60),l=Math.floor(d/60),c=Math.floor(l/24);return a<60?"just now":d<60?`${d}m ago`:l<24?`${l}h ago`:c<30?`${c}d ago`:e.toLocaleDateString()},pr=({event:t,expanded:e=!1,onToggle:r,expandable:n,isChild:a=!1,showTimeline:d=!1,density:l,showMeta:c,renderIcon:_,className:w=""})=>{const L=Pt(),A=l??L.density,S=c??L.showMeta,u=n??!!t.description,C=()=>{u&&r&&r(t.id,!e)},o=b=>{u&&r&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r(t.id,!e))},h=["uiforge-activity-item",`uiforge-activity-item--${A}`,a?"uiforge-activity-item--child":"",S?"":"uiforge-activity-item--hide-meta",w].filter(Boolean).join(" "),f=["uiforge-activity-item__header",u?"uiforge-activity-item__header--clickable":""].filter(Boolean).join(" ");return s.jsxs("div",{className:h,"data-event-id":t.id,"data-density":A,"data-show-meta":S,children:[d&&!a&&s.jsx("div",{className:"uiforge-activity-item__timeline-marker"}),s.jsx("div",{className:"uiforge-activity-item__icon",children:_?_(t):t.icon||mr(t.type)}),s.jsxs("div",{className:"uiforge-activity-item__content",children:[s.jsxs("div",{className:f,onClick:C,onKeyDown:o,role:u?"button":void 0,tabIndex:u?0:void 0,"aria-expanded":u?e:void 0,children:[s.jsx("div",{className:"uiforge-activity-item__title",children:t.title}),S&&s.jsx("div",{className:"uiforge-activity-item__timestamp",children:fr(t.timestamp)}),u&&s.jsx("div",{className:"uiforge-activity-item__toggle",children:e?s.jsx(ve.fold,{size:16}):s.jsx(ve.unfold,{size:16})})]}),e&&t.description&&S&&s.jsx("div",{className:"uiforge-activity-item__description",children:t.description})]})]})},Be=400,vr=t=>{const e=pe[t]||pe.commit;return s.jsx(e,{size:16})},ke=(t,e=2)=>{if(t.length===0)return[];const r=[];let n=[],a=null;return t.forEach((d,l)=>{a===d.type?n.push(d):(n.length>=e&&a?r.push(Te(n,a)):n.forEach(c=>{r.push({id:c.id.toString(),type:c.type,count:1,title:c.title,timestamp:new Date(c.timestamp),icon:c.icon,events:[c]})}),n=[d],a=d.type),l===t.length-1&&(n.length>=e&&a?r.push(Te(n,a)):n.forEach(c=>{r.push({id:c.id.toString(),type:c.type,count:1,title:c.title,timestamp:new Date(c.timestamp),icon:c.icon,events:[c]})}))}),r},Te=(t,e)=>{const r=t.reduce((l,c)=>{const _=c.metadata?.repository||"unknown";return l[_]||(l[_]=[]),l[_].push(c),l},{}),n=Object.entries(r),a=n.length>1;let d="";if(a)d=`Created ${t.length} ${Se(e)} in ${n.length} repositories`;else{const l=n[0][0];d=`Created ${t.length} ${Se(e)}${l!=="unknown"?` in ${l}`:""}`}return{id:`group-${e}-${t[0].id}`,type:e,count:t.length,title:d,timestamp:new Date(t[0].timestamp),icon:t[0].icon,events:t,children:a?n.map(([l,c])=>({id:`group-${e}-${l}`,type:e,count:c.length,title:`Created ${c.length} ${Se(e)} in ${l}`,timestamp:new Date(c[0].timestamp),icon:c[0].icon,events:c})):void 0}},Se=t=>({pr:"pull requests",issue:"issues",commit:"commits",comment:"comments",star:"stars",fork:"forks",merge:"merges",release:"releases",deploy:"deployments"})[t]||`${t}s`,Ne=t=>{if(t.length===0)return[];const e=[];let r=null;return t.forEach((n,a)=>{if("type"in n&&n.type==="date-separator"){e.push(n);return}const l=n.timestamp,c=`${l.getFullYear()}-${l.getMonth()}`;if(c!==r){const _={id:`sep-${a}`,type:"date-separator",date:l,label:gr(l)};e.push(_),r=c}e.push(n)}),e},gr=t=>t.toLocaleDateString("en-US",{month:"long",year:"numeric"}),xr=t=>{const e=typeof t=="string"?new Date(t):t,n=new Date().getTime()-e.getTime(),a=Math.floor(n/1e3),d=Math.floor(a/60),l=Math.floor(d/60),c=Math.floor(l/24);return a<60?"just now":d<60?`${d}m ago`:l<24?`${l}h ago`:c<30?`${c}d ago`:e.toLocaleDateString()},br=({events:t,theme:e="light",className:r="",style:n,showLoadMore:a=!0,loading:d=!1,onLoadMore:l,pagination:c,maxHeight:_,showMoreThreshold:w=100,initiallyExpandedAll:L=!1,emptyMessage:A="No activity to display",onToggleExpand:S,enableGrouping:u=!0,groupingThreshold:C=2,showDateSeparators:o=!0,showTimeline:h=!0,scale:f,density:b="comfortable",responsive:k=!0,compactBreakpointPx:P=640,containerRef:$,showMeta:j,renderIcon:E,renderEvent:D,virtualization:N=!1,virtualItemHeight:z=48})=>{const[B,v]=i.useState(()=>{const x=new Set;return(u?o?Ne(ke(t,C)):ke(t,C):t.map(U=>({id:U.id.toString(),type:U.type,count:1,title:U.title,timestamp:new Date(U.timestamp),icon:U.icon,events:[U]}))).forEach(U=>{if("events"in U&&U.type!=="date-separator"){const J=U;(L||J.events.some(p=>p.initiallyExpanded))&&x.add(J.id),J.children&&J.children.forEach(p=>{(L||p.events.some(O=>O.initiallyExpanded))&&x.add(p.id)})}}),x}),[m,y]=i.useState(!1),[I,te]=i.useState(Be),Y=i.useRef(null),re=$||Y,X=i.useRef(null),ne=i.useRef(null),se=At(k?re:null,P),T=i.useMemo(()=>k&&se&&b==="comfortable"?"compact":b,[k,se,b]),oe=i.useMemo(()=>j!==void 0?j:!0,[j]),Z=i.useMemo(()=>{if(!u){const R=t.map(U=>({id:U.id.toString(),type:U.type,count:1,title:U.title,timestamp:new Date(U.timestamp),icon:U.icon,events:[U]}));return o?Ne(R):R}const x=ke(t,C);return o?Ne(x):x},[t,u,C,o]),ee=i.useCallback(()=>{if(!X.current||!a||!l)return;const{scrollTop:x,scrollHeight:R,clientHeight:U}=X.current,J=R-x-U;y(J<=w)},[a,l,w]),le=i.useCallback(({scrollOffset:x})=>{if(!a||!l)return;const R=Z.length*z,U=I,J=R-x-U;y(J<=w)},[a,l,w,Z.length,z,I]);i.useEffect(()=>{if(!N||!Y.current)return;const x=()=>{const U=Y.current;if(U){let J=U.clientHeight||Be;if(_){const p=parseFloat(_);!isNaN(p)&&p>0&&(J=p)}te(J)}};x();const R=new ResizeObserver(x);return R.observe(Y.current),()=>{R.disconnect()}},[N,_]),i.useEffect(()=>{const x=X.current;if(x)return x.addEventListener("scroll",ee),ee(),()=>{x.removeEventListener("scroll",ee)}},[ee]);const M=i.useCallback((x,R)=>{v(U=>{const J=new Set(U),p=J.has(x);return p?J.delete(x):J.add(x),S?.(R,!p),J})},[S]),F=(x,R=!1)=>{const U=B.has(x.id),J=x.children&&x.children.length>0,p=x.count>1,O=x.count===1&&x.events[0]?.description,Q=p||J||O,G=x.count===1&&x.events.length===1?x.events[0].id:x.id;return D&&x.count===1&&x.events.length===1?s.jsxs("div",{className:`activity-stream__item ${R?"activity-stream__item--child":""}`,"data-event-id":x.id,children:[h&&!R&&s.jsx("div",{className:"activity-stream__timeline-marker"}),D(x.events[0])]},x.id):s.jsxs("div",{className:`activity-stream__item ${R?"activity-stream__item--child":""}`,"data-event-id":x.id,children:[h&&!R&&s.jsx("div",{className:"activity-stream__timeline-marker"}),s.jsx("div",{className:"activity-stream__icon",children:E&&x.events.length===1?E(x.events[0]):x.icon||vr(x.type)}),s.jsxs("div",{className:"activity-stream__content",children:[s.jsxs("div",{className:`activity-stream__header ${Q?"activity-stream__header--clickable":""}`,onClick:()=>Q&&M(x.id,G),onKeyDown:H=>{Q&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),M(x.id,G))},role:Q?"button":void 0,tabIndex:Q?0:void 0,"aria-expanded":Q?U:void 0,children:[s.jsx("div",{className:"activity-stream__title",children:x.title}),s.jsx("div",{className:"activity-stream__timestamp",children:xr(x.timestamp)}),Q&&s.jsx("div",{className:"activity-stream__toggle",children:U?s.jsx(ve.fold,{size:16}):s.jsx(ve.unfold,{size:16})})]}),U&&J&&x.children&&s.jsx("div",{className:"activity-stream__children",children:x.children.map(H=>F(H,!0))}),U&&!J&&x.events.length>1&&s.jsx("div",{className:"activity-stream__events-list",children:x.events.map(H=>D?s.jsx("div",{className:"activity-stream__event-item",children:D(H)},H.id):s.jsxs("div",{className:"activity-stream__event-item",children:[s.jsx("div",{className:"activity-stream__event-title",children:H.title}),H.description&&s.jsx("div",{className:"activity-stream__event-description",children:H.description})]},H.id))}),U&&x.count===1&&x.events[0].description&&s.jsx("div",{className:"activity-stream__description",children:x.events[0].description})]})]},x.id)},g=i.useCallback(x=>{if("type"in x&&x.type==="date-separator"){const R=x;return s.jsxs("div",{className:"activity-stream__date-separator",children:[s.jsx("div",{className:"activity-stream__date-label",children:R.label}),s.jsx("div",{className:"activity-stream__date-line"})]},R.id)}return F(x)},[B,h,E,D,M]),V=x=>s.jsxs("div",{className:"activity-stream__date-separator",children:[s.jsx("div",{className:"activity-stream__date-label",children:x.label}),s.jsx("div",{className:"activity-stream__date-line"})]},x.id),W=i.useCallback(({index:x,style:R})=>{const U=Z[x];return U?s.jsx("div",{style:R,className:"activity-stream__virtual-row",children:g(U)}):null},[Z,g]),K=c?.hasMore!==void 0?c.hasMore:c?.totalItems!==void 0?t.length<c.totalItems:!0,ae="activity-stream",q=`${ae}--${e}`,de=h?`${ae}--with-timeline`:"",he=`${ae}--${T}`;let ie=`${ae} ${q} ${de} ${he} ${r}`.trim();f!==void 0&&f<1&&(ie=`${ie} ${ae}--scale-compact`),f!==void 0&&f>1&&(ie=`${ie} ${ae}--scale-spacious`);const je=_?{maxHeight:_}:void 0,ge=f!==void 0?{"--activity-stream-scale":f}:{};return s.jsx(Dt,{value:{density:T,showMeta:oe},children:s.jsx("div",{ref:Y,className:`${ie}${N?" activity-stream--virtualized":""}`,"data-theme":e,"data-density":T,"data-show-meta":oe,"data-virtualized":N,style:n,children:N?s.jsxs("div",{className:"activity-stream__container activity-stream__container--virtualized",style:ge,children:[Z.length===0?s.jsx("div",{className:"activity-stream__empty",children:A}):s.jsx(ir,{ref:ne,className:"activity-stream__items activity-stream__items--virtualized",height:I,itemCount:Z.length,itemSize:z,width:"100%",onScroll:le,children:W}),d&&s.jsxs("div",{className:"activity-stream__loading",children:[s.jsx("div",{className:"activity-stream__spinner"}),s.jsx("span",{children:"Loading..."})]}),a&&!d&&K&&l&&s.jsx("div",{className:`activity-stream__load-more ${m?"activity-stream__load-more--visible":""}`,onClick:l,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),l())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]}):s.jsxs("div",{ref:X,className:"activity-stream__container",style:{...je,...ge},children:[Z.length===0?s.jsx("div",{className:"activity-stream__empty",children:A}):s.jsx("div",{className:"activity-stream__items",children:Z.map(x=>"type"in x&&x.type==="date-separator"?V(x):F(x))}),d&&s.jsxs("div",{className:"activity-stream__loading",children:[s.jsx("div",{className:"activity-stream__spinner"}),s.jsx("span",{children:"Loading..."})]}),a&&!d&&K&&l&&s.jsx("div",{className:`activity-stream__load-more ${m?"activity-stream__load-more--visible":""}`,onClick:l,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),l())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]})})})},yr={name:"youtube",displayName:"YouTube",domains:["youtube.com","youtu.be","youtube-nocookie.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);return e.hostname.replace("www.","")==="youtu.be"?e.pathname.slice(1).split("?")[0]:e.searchParams.has("v")?e.searchParams.get("v"):e.pathname.startsWith("/embed/")||e.pathname.startsWith("/v/")?e.pathname.split("/")[2]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1"),e.muted&&r.set("mute","1"),e.loop&&(r.set("loop","1"),r.set("playlist",t)),e.startTime&&r.set("start",String(e.startTime)),e.controls===!1&&r.set("controls","0");const n="https://www.youtube.com",a=r.toString();return`${n}/embed/${t}${a?`?${a}`:""}`}},wr={name:"vimeo",displayName:"Vimeo",domains:["vimeo.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r!=="vimeo.com"&&r!=="player.vimeo.com")return null;if(e.pathname.startsWith("/video/"))return e.pathname.split("/")[2];const n=e.pathname.split("/").filter(Boolean);if(n.length>0){const a=n[0];if(/^\d+$/.test(a))return a}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1"),e.muted&&r.set("muted","1"),e.loop&&r.set("loop","1"),e.startTime&&r.set("t",`${e.startTime}s`),e.controls===!1&&r.set("controls","0");const n=r.toString();return`https://player.vimeo.com/video/${t}${n?`?${n}`:""}`}},jr={name:"dailymotion",displayName:"Dailymotion",domains:["dailymotion.com","dai.ly"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r==="dai.ly")return e.pathname.slice(1).split("?")[0];if(r==="dailymotion.com"){if(e.pathname.startsWith("/video/"))return e.pathname.split("/")[2].split("_")[0];if(e.pathname.startsWith("/embed/video/"))return e.pathname.split("/")[3].split("?")[0]}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1"),e.muted&&r.set("mute","1"),e.loop&&r.set("loop","1"),e.startTime&&r.set("start",String(e.startTime)),e.controls===!1&&r.set("controls","0");const n=r.toString();return`https://www.dailymotion.com/embed/video/${t}${n?`?${n}`:""}`}},_r={name:"twitch",displayName:"Twitch",domains:["twitch.tv","clips.twitch.tv"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")==="clips.twitch.tv")return`clip:${e.pathname.slice(1)}`;if(e.pathname.startsWith("/videos/"))return`video:${e.pathname.split("/")[2]}`;const n=e.pathname.match(/\/([^/]+)\/clip\/([^/?]+)/);return n?`clip:${n[2]}`:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams,n=typeof window<"u"?window.location.hostname:"localhost";r.set("parent",n),e.autoplay&&r.set("autoplay","true"),e.muted&&r.set("muted","true");const a=r.toString();return t.startsWith("video:")?`https://player.twitch.tv/?video=${t.slice(6)}&${a}`:t.startsWith("clip:")?`https://clips.twitch.tv/embed?clip=${t.slice(5)}&${a}`:""}},Ir={name:"kick",displayName:"Kick",domains:["kick.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="kick.com")return null;const n=e.pathname.match(/\/video\/([a-zA-Z0-9-]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://player.kick.com/video/${t}`},Cr={name:"rumble",displayName:"Rumble",domains:["rumble.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="rumble.com")return null;if(e.pathname.startsWith("/embed/"))return e.pathname.split("/")[2].split("?")[0];const n=e.pathname.match(/\/([a-z0-9]+)-/);return n?n[1]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","2");const n=r.toString();return`https://rumble.com/embed/${t}${n?`?${n}`:""}`}},$r={name:"odysee",displayName:"Odysee",domains:["odysee.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="odysee.com")return null;const n=e.pathname.match(/\$\/embed\/(.+)/);if(n)return n[1];const a=e.pathname.slice(1);return a.startsWith("@")?a:null}catch{return null}},getEmbedUrl:t=>`https://odysee.com/$/embed/${t}`},kr={name:"bitchute",displayName:"BitChute",domains:["bitchute.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="bitchute.com")return null;const n=e.pathname.match(/\/(video|embed)\/([a-zA-Z0-9]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:t=>`https://www.bitchute.com/embed/${t}/`},Sr={name:"vk",displayName:"VK Video",domains:["vk.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="vk.com")return null;const n=e.searchParams.get("z");if(n&&n.startsWith("video"))return n.replace("video","");const a=e.pathname.match(/\/video(-?\d+_\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1");const n=t.split("_");if(n.length<2)return console.error("VK video ID must be in format OWNER_ID_VIDEO_ID"),"";const a=r.toString();return`https://vk.com/video_ext.php?oid=${n[0]}&id=${n[1]}${a?`&${a}`:""}`}},Nr={name:"bilibili",displayName:"Bilibili",domains:["bilibili.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r!=="bilibili.com"&&r!=="www.bilibili.com")return null;const n=e.pathname.match(/\/video\/((?:BV|av)[a-zA-Z0-9]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1");const n=r.toString();return`https://player.bilibili.com/player.html?bvid=${t}${n?`&${n}`:""}`}},Mr={name:"niconico",displayName:"Niconico",domains:["nicovideo.jp"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="nicovideo.jp")return null;const n=e.pathname.match(/\/watch\/((?:sm|so|nm)\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://embed.nicovideo.jp/watch/${t}`},Lr={name:"wistia",displayName:"Wistia",domains:["wistia.com","wi.st","wistia.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(e.pathname.includes("/medias/")){const n=e.pathname.match(/\/medias\/([a-zA-Z0-9]+)/);if(n)return n[1]}if(r.includes("wistia")&&e.pathname.includes("/iframe/")){const n=e.pathname.match(/\/iframe\/([a-zA-Z0-9]+)/);if(n)return n[1]}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoPlay","true"),e.muted&&r.set("muted","true");const n=r.toString();return`https://fast.wistia.net/embed/iframe/${t}${n?`?${n}`:""}`}},Ar={name:"brightcove",displayName:"Brightcove",domains:["brightcove.com","bcove.video"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.searchParams.get("videoId");if(r){const n=e.pathname.match(/\/(\d+)\//);if(n)return`${n[1]}:${r}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<2)return console.error("Brightcove video ID must be in format ACCOUNT_ID:VIDEO_ID"),"";const[r,...n]=e,a=n.join(":");return`https://players.brightcove.net/${r}/default_default/index.html?videoId=${a}`}},Er={name:"kaltura",displayName:"Kaltura",domains:["kaltura.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.searchParams.get("entry_id")||e.searchParams.get("entryId");if(r){const n=e.pathname.match(/\/p\/(\d+)\//),a=e.pathname.match(/\/uiconf_id\/(\d+)/);if(n&&a)return`${n[1]}:${a[1]}:${r}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<3)return console.error("Kaltura video ID must be in format PARTNER_ID:UI_CONF_ID:ENTRY_ID"),"";const[r,n,a]=e;return`https://cdnapisec.kaltura.com/p/${r}/sp/${r}00/embedIframeJs/uiconf_id/${n}/partner_id/${r}?iframeembed=true&entry_id=${a}`}},Dr={name:"panopto",displayName:"Panopto",domains:["panopto.com"],tier:"professional",supportsAutoplay:!1,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname;if(r==="panopto.com"||r.endsWith(".panopto.com")){const a=e.searchParams.get("id");if(a)return`${r.split(".")[0]}:${a}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<2)return console.error("Panopto video ID must be in format SUBDOMAIN:SESSION_ID"),"";const[r,...n]=e,a=n.join(":");return`https://${r}.panopto.com/Panopto/Pages/Embed.aspx?id=${a}&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&captions=false&interactivity=all`}},Pr={name:"jwplayer",displayName:"JW Player",domains:["jwplayer.com","jwplatform.com","content.jwplatform.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const r=new URL(t).pathname.match(/\/players\/([a-zA-Z0-9]+-[a-zA-Z0-9]+)\.html/);return r?r[1]:null}catch{return null}},getEmbedUrl:t=>`https://content.jwplatform.com/players/${t}.html`},Rr={name:"cloudflare",displayName:"Cloudflare Stream",domains:["cloudflarestream.com","videodelivery.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname,n=r==="videodelivery.net"||r.endsWith(".videodelivery.net"),a=r==="cloudflarestream.com"||r.endsWith(".cloudflarestream.com");if(n||a){const d=e.pathname.match(/\/([a-zA-Z0-9]+)(?:\/|$)/);if(d)return d[1]}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","true"),e.muted&&r.set("muted","true"),e.loop&&r.set("loop","true");const n=r.toString();return`https://iframe.videodelivery.net/${t}${n?`?${n}`:""}`}},Or={name:"mux",displayName:"Mux",domains:["mux.com","stream.mux.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname==="stream.mux.com"){const n=e.pathname.slice(1).split(".")[0];if(n)return n}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","true"),e.muted&&r.set("muted","true");const n=r.toString();return`https://stream.mux.com/${t}.m3u8${n?`?${n}`:""}`}},Ur={name:"aws-ivs",displayName:"AWS IVS",domains:["ivs.aws","amazonaws.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);return e.hostname.includes(".channel.ivs.aws")?e.hostname.split(".")[0]:null}catch{return null}},getEmbedUrl:t=>`https://${t}.channel.ivs.aws/stream.m3u8`},zr={name:"azure-media",displayName:"Azure Media Services",domains:["azure.net","azureedge.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.endsWith(".streaming.media.azure.net")){const r=e.pathname.split("/");if(r.length>=2)return`${e.hostname}:${r[1]}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<2)return console.error("Azure Media video ID must be in format HOSTNAME:ASSET_ID"),"";const[r,...n]=e,a=n.join(":");return`https://${r}/${a}/manifest`}},Vr={name:"google-drive",displayName:"Google Drive",domains:["drive.google.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="drive.google.com")return null;const n=e.pathname.match(/\/file\/d\/([a-zA-Z0-9_-]+)/);if(n)return n[1];const a=e.searchParams.get("id");return a||null}catch{return null}},getEmbedUrl:t=>`https://drive.google.com/file/d/${t}/preview`},Br={name:"dropbox",displayName:"Dropbox",domains:["dropbox.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{return new URL(t).hostname.replace("www.","")!=="dropbox.com"?null:t}catch{return null}},getEmbedUrl:t=>{try{const e=new URL(t);return e.searchParams.delete("dl"),e.searchParams.set("raw","1"),e.toString()}catch{return t}}},Tr={name:"facebook",displayName:"Facebook Video",domains:["facebook.com","fb.watch"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r==="fb.watch")return e.pathname.slice(1);if(r==="facebook.com"){const n=e.searchParams.get("v");if(n)return n;const a=e.pathname.match(/\/videos\/(\d+)/);if(a)return a[1]}return null}catch{return null}},getEmbedUrl:t=>`https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fwatch%2F%3Fv%3D${t}`},Hr={name:"instagram",displayName:"Instagram",domains:["instagram.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="instagram.com")return null;const n=e.pathname.match(/\/(p|reel|tv)\/([a-zA-Z0-9_-]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:t=>`https://www.instagram.com/p/${t}/embed/`},Wr={name:"twitter",displayName:"X (Twitter)",domains:["twitter.com","x.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r!=="twitter.com"&&r!=="x.com")return null;const n=e.pathname.match(/\/status\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://platform.twitter.com/embed/Tweet.html?id=${t}`},Fr={name:"pornhub",displayName:"Pornhub",domains:["pornhub.com"],tier:"adult",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="pornhub.com")return null;const n=e.searchParams.get("viewkey");if(n)return n;const a=e.pathname.match(/\/embed\/([a-zA-Z0-9]+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:t=>`https://www.pornhub.com/embed/${t}`},qr={name:"youporn",displayName:"YouPorn",domains:["youporn.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="youporn.com")return null;const n=e.pathname.match(/\/watch\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://www.youporn.com/embed/${t}`},Kr={name:"redtube",displayName:"Redtube",domains:["redtube.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="redtube.com")return null;const n=e.searchParams.get("id");if(n)return n;const a=e.pathname.match(/\/(\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:t=>`https://embed.redtube.com/?id=${t}`},Zr={name:"xhamster",displayName:"XHamster",domains:["xhamster.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="xhamster.com")return null;const n=e.pathname.match(/\/videos\/[^/]+-(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://xhamster.com/xembed.php?video=${t}`},Gr={name:"spankbang",displayName:"SpankBang",domains:["spankbang.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="spankbang.com")return null;const n=e.pathname.match(/\/([a-zA-Z0-9]+)\/video\//);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://spankbang.com/${t}/embed/`},Ae=[yr,wr,jr,_r,Ir,Cr,$r,kr,Sr,Nr,Mr,Lr,Ar,Er,Dr,Pr,Rr,Or,Ur,zr,Vr,Br,Tr,Hr,Wr,Fr,qr,Kr,Zr,Gr],we=Ae.reduce((t,e)=>(t[e.name]=e,t),{});function Ee(t){if(!t)return null;try{const r=new URL(t).hostname.toLowerCase().replace("www.","");for(const n of Ae)for(const a of n.domains)if(r===a||r.endsWith(`.${a}`))return n;return null}catch{return null}}function De(t){const e=Ee(t);if(!e)return null;const r=e.extractVideoId(t);return r?{provider:e,videoId:r}:null}function Yr(t,e){const r=De(t);return r?r.provider.getEmbedUrl(r.videoId,e):null}function Jr(t){return Ee(t)?.tier==="adult"}const Qr=()=>s.jsxs("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"uiforge-video__play-icon",children:[s.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"white",fillOpacity:"0.9"}),s.jsx("path",{d:"M26 20L46 32L26 44V20Z",fill:"currentColor",style:{color:"#3b82f6"}})]}),Xr=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"uiforge-video-preview__icon",children:[s.jsx("path",{d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v10a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm2-1a1 1 0 00-1 1v10a1 1 0 001 1h12a1 1 0 001-1V5a1 1 0 00-1-1H4z"}),s.jsx("path",{d:"M8 7l5 3-5 3V7z"})]}),es=({title:t,description:e,url:r,youtubeId:n,vimeoId:a,provider:d,videoId:l,autoplay:c=!1,muted:_=!1,loop:w=!1,startTime:L,controls:A=!0,thumbnailUrl:S,onPlay:u,onError:C,onReady:o,className:h="",overlayIcon:f,aspectRatio:b="16:9",width:k,height:P,maxHeight:$,responsive:j=!1,hideHeader:E=!1,allowAdultContent:D=!1,fallback:N})=>{const[z,B]=i.useState(!1),[v,m]=i.useState(null),y=i.useRef(null),I=i.useMemo(()=>{if(d&&l){const F=we[d];if(F)return{provider:F,videoId:l,method:"explicit"}}if(r){const F=De(r);if(F)return{...F,method:"url"}}if(n){const F=we.youtube;if(F)return{provider:F,videoId:n,method:"legacy"}}if(a){const F=we.vimeo;if(F)return{provider:F,videoId:a,method:"legacy"}}return null},[r,d,l,n,a]),te=i.useMemo(()=>I?I.provider.tier==="adult":!1,[I]),Y=i.useMemo(()=>({autoplay:z?!0:c,muted:_,loop:w,startTime:L,controls:A}),[c,_,w,L,A,z]),re=i.useMemo(()=>{if(!I)return"";try{return I.provider.getEmbedUrl(I.videoId,Y)}catch(F){return console.error("Error generating embed URL:",F),""}},[I,Y]),X=i.useMemo(()=>{if(S)return S;if(I?.provider.name==="youtube")return`https://img.youtube.com/vi/${I.videoId}/maxresdefault.jpg`},[S,I]),ne=i.useCallback(()=>{I&&(B(!0),u&&u(I.videoId,I.provider.name),o&&o(I.videoId,I.provider.name))},[I,u,o]),se=i.useCallback(F=>{m(F),C&&I&&C(new Error(F),I.provider.name)},[C,I]);if(!I)return N?s.jsx(s.Fragment,{children:N}):(console.warn("UIForgeVideo: No valid video source provided"),null);if(te&&!D){const F="Adult content must be explicitly enabled with allowAdultContent prop";return N?s.jsx(s.Fragment,{children:N}):(console.warn(`UIForgeVideo: ${F}`),s.jsx("div",{className:"uiforge-video",children:s.jsx("div",{className:"uiforge-video__error",children:s.jsx("p",{children:F})})}))}if(v)return N?s.jsx(s.Fragment,{children:N}):s.jsx("div",{className:"uiforge-video",children:s.jsx("div",{className:"uiforge-video__error",children:s.jsx("p",{children:v})})});const T="uiforge-video",oe=j?`${T}--responsive`:"",Z=`${T} ${oe} ${h}`.trim(),ee={aspectRatio:b!=="auto"?b.replace(":","/"):void 0,width:k?typeof k=="number"?`${k}px`:k:void 0,height:P?typeof P=="number"?`${P}px`:P:void 0,maxHeight:$?typeof $=="number"?`${$}px`:$:void 0},le=t||`${I.provider.displayName} Video`,M=!E&&(t||e);return s.jsxs("div",{className:Z,children:[M&&s.jsxs("div",{className:`${T}__header`,children:[t&&s.jsx("h3",{className:`${T}__title`,children:t}),e&&s.jsx("p",{className:`${T}__description`,children:e})]}),s.jsx("div",{className:`${T}__player-container`,style:ee,children:z?s.jsx("iframe",{ref:y,src:re,title:le,className:`${T}__iframe`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,onError:()=>se("Failed to load video")}):s.jsxs(s.Fragment,{children:[X&&s.jsx("img",{src:X,alt:le,className:`${T}__thumbnail`}),s.jsx("button",{className:`${T}__overlay`,onClick:ne,"aria-label":`Play video: ${le}`,type:"button",children:f||s.jsx(Qr,{})})]})})]})},ts=({title:t,icon:e,className:r="",onClick:n})=>{const a="uiforge-video-preview",d=`${a} ${r}`.trim(),l=()=>{n&&n()},c=L=>{n&&(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),n())},_=n?"button":"div",w=n?{type:"button",onClick:l,onKeyDown:c}:{};return s.jsxs(_,{className:d,...w,children:[s.jsx("div",{className:`${a}__icon-container`,children:e||s.jsx(Xr,{})}),s.jsx("span",{className:`${a}__title`,children:t})]})},He=t=>{const e=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");return Array.from(t.querySelectorAll(e))},rs=({id:t,variant:e="static",open:r=!0,onOpenChange:n,children:a,className:d="",ariaLabel:l="Sidebar navigation",width:c="280px",height:_="200px",position:w="left",showBackdrop:L=!0,closeOnBackdropClick:A=!0,closeOnEscape:S=!0,trapFocus:u=!0})=>{const C=i.useRef(null),o=i.useRef(null),h=e==="drawer"||e==="bottom",f=i.useCallback(()=>{A&&n&&n(!1)},[A,n]);i.useEffect(()=>{if(!h||!r||!S)return;const E=D=>{D.key==="Escape"&&(D.preventDefault(),n?.(!1))};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[h,r,S,n]),i.useEffect(()=>{if(!h||!r||!u)return;const E=C.current;if(!E)return;o.current=document.activeElement;const D=He(E);D.length>0?D[0].focus():E.focus();const N=z=>{if(z.key!=="Tab")return;const B=He(E);if(B.length===0)return;const v=B[0],m=B[B.length-1];z.shiftKey?document.activeElement===v&&(z.preventDefault(),m.focus()):document.activeElement===m&&(z.preventDefault(),v.focus())};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N),o.current&&typeof o.current.focus=="function"&&o.current.focus()}},[h,r,u]),i.useEffect(()=>{if(!h||!r)return;const E=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=E}},[h,r]);const b="uiforge-sidebar",k=[b,`${b}--${e}`,`${b}--${w}`,h&&r&&`${b}--open`,h&&!r&&`${b}--closed`,d].filter(Boolean).join(" "),P={"--sidebar-width":c,"--sidebar-height":_},j=e==="static"?{role:"navigation","aria-label":l}:{role:"dialog","aria-modal":r,"aria-expanded":r,"aria-label":l,"aria-hidden":!r};return e==="static"?s.jsx("aside",{id:t,ref:C,className:k,style:P,...j,children:s.jsx("div",{className:`${b}__content`,children:a})}):s.jsxs(s.Fragment,{children:[L&&s.jsx("div",{className:`${b}__backdrop ${r?`${b}__backdrop--visible`:""}`,onClick:f,"aria-hidden":"true"}),s.jsx("aside",{id:t,ref:C,className:k,style:P,tabIndex:-1,...j,children:s.jsx("div",{className:`${b}__content`,children:a})})]})},Rt=({children:t,disableTop:e=!1,disableBottom:r=!1,disableLeft:n=!1,disableRight:a=!1,className:d="",...l})=>{const c="uiforge-safe-area-container",_=[c,e&&`${c}--disable-top`,a&&`${c}--disable-right`,r&&`${c}--disable-bottom`,n&&`${c}--disable-left`,d].filter(Boolean).join(" ");return s.jsx("div",{className:_,...l,children:t})},ss=({left:t,title:e,right:r,hideOnDesktop:n=!1,className:a="",...d})=>{const l="uiforge-mobile-header-layout",c=[l,n&&`${l}--hide-on-desktop`,a].filter(Boolean).join(" "),_=typeof e=="string";return s.jsx(Rt,{disableBottom:!0,disableLeft:!0,disableRight:!0,children:s.jsxs("header",{className:c,...d,children:[s.jsx("div",{className:`${l}__left`,children:t}),s.jsx("div",{className:`${l}__center`,children:_?s.jsx("span",{className:`${l}__title`,children:e}):e}),s.jsx("div",{className:`${l}__right`,children:r})]})})},ns=({items:t,onSelect:e,ariaLabel:r="More actions",trigger:n,align:a="right",disabled:d=!1,size:l="medium",className:c="","data-testid":_})=>{const[w,L]=i.useState(!1),[A,S]=i.useState(-1),u=i.useRef(null),C=i.useRef(null),o=i.useRef(null),h=i.useRef(null),b=`overflow-menu-${i.useId()}`,k=t.filter(m=>!m.disabled),P=i.useCallback(()=>{d||(L(!0),S(0))},[d]),$=i.useCallback(()=>{L(!1),S(-1),n?o.current?.focus():C.current?.focus()},[n]),j=i.useCallback(m=>{m.disabled||(m.onClick?m.onClick():e&&e(m),$())},[e,$]);i.useEffect(()=>{if(!w)return;const m=y=>{u.current&&!u.current.contains(y.target)&&$()};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[w,$]);const E=i.useCallback(m=>{if(!d)switch(m.key){case"Enter":case" ":if(m.preventDefault(),!w)P();else if(A>=0){const y=k[A];y&&j(y)}break;case"ArrowDown":m.preventDefault(),w?S(y=>y<k.length-1?y+1:0):P();break;case"ArrowUp":m.preventDefault(),w&&S(y=>y>0?y-1:k.length-1);break;case"Escape":m.preventDefault(),w&&$();break;case"Tab":w&&$();break;case"Home":w&&(m.preventDefault(),S(0));break;case"End":w&&(m.preventDefault(),S(k.length-1));break}},[d,w,A,k,P,$,j]);i.useEffect(()=>{if(w&&h.current&&A>=0){const m=h.current.querySelector(`[data-index="${A}"]`);m&&typeof m.scrollIntoView=="function"&&m.scrollIntoView({block:"nearest"})}},[A,w]);const D=()=>{d||(w?$():P())},N="uiforge-overflow-menu",z=[N,d&&`${N}--disabled`,c].filter(Boolean).join(" "),B=[`${N}__menu`,`${N}__menu--${a}`].filter(Boolean).join(" "),v=m=>k.findIndex(y=>y.id===m.id);return s.jsxs("div",{ref:u,className:z,onKeyDown:E,"data-testid":_,children:[n?s.jsx("div",{onClick:D,role:"button",tabIndex:d?-1:0,"aria-haspopup":"menu","aria-expanded":w,"aria-controls":w?b:void 0,"aria-label":r,"aria-disabled":d,ref:o,className:`${N}__custom-trigger`,children:n}):s.jsx("button",{ref:C,type:"button",className:`${N}__trigger ${N}__trigger--${l}`,onClick:D,"aria-haspopup":"menu","aria-expanded":w,"aria-controls":w?b:void 0,"aria-label":r,disabled:d,children:s.jsx("span",{className:`${N}__trigger-icon`,"aria-hidden":"true",children:"•••"})}),w&&s.jsx("div",{ref:h,id:b,className:B,role:"menu","aria-label":r,children:t.map(m=>{const y=v(m),I=!m.disabled&&y===A,te=[`${N}__item`,m.disabled&&`${N}__item--disabled`,I&&`${N}__item--highlighted`].filter(Boolean).join(" ");return s.jsxs("div",{className:te,role:"menuitem",tabIndex:-1,"aria-disabled":m.disabled,"data-index":m.disabled?void 0:y,onClick:()=>j(m),onMouseEnter:()=>{m.disabled||S(y)},children:[m.icon&&s.jsx("span",{className:`${N}__item-icon`,"aria-hidden":"true",children:m.icon}),s.jsx("span",{className:`${N}__item-label`,children:m.label})]},m.id)})})]})};function as(t,e){const{sampleCount:r=3,min:n=3,max:a=15,approxItemHeight:d=120}=e??{},[l,c]=i.useState(n),_=i.useRef(n),w=i.useCallback(()=>{const L=t?.current;if(!L)return n;const A=L.clientHeight;if(A===0)return n;const S=Array.from(L.children).filter(h=>h instanceof HTMLElement&&h.offsetHeight>0);let u=d;if(S.length>0){const h=Math.min(r,S.length);let f=0;for(let b=0;b<h;b++)f+=S[b].offsetHeight;u=f/h}const C=Math.floor(A/u);return Math.max(n,Math.min(a,C))},[t,r,n,a,d]);return i.useEffect(()=>{const L=t?.current;if(!L)return;const A=()=>{const C=w();C!==_.current&&(_.current=C,c(C))};A();let S;typeof ResizeObserver<"u"&&(S=new ResizeObserver(()=>{A()}),S.observe(L));let u;return typeof MutationObserver<"u"&&(u=new MutationObserver(()=>{A()}),u.observe(L,{childList:!0,subtree:!1})),()=>{S?.disconnect(),u?.disconnect()}},[t,w]),l}exports.ActivityIcons=pe;exports.ActivityItemProvider=Dt;exports.AlienIcon=xt;exports.BriefcaseIcon=Ct;exports.BugIcon=ft;exports.BuildIcon=Lt;exports.BusinessIcons=ur;exports.Button=Ot;exports.CalendarIcon=It;exports.ChartIcon=wt;exports.CheckIcon=rt;exports.CloseIcon=tt;exports.CloudIcon=ht;exports.CodeIcon=pt;exports.CommentIcon=Ke;exports.CommitIcon=We;exports.DatabaseIcon=ut;exports.DeployIcon=Qe;exports.DeploymentIcon=Nt;exports.DevProcessIcons=hr;exports.DocumentIcon=_t;exports.DumbbellIcon=it;exports.FitnessIcons=lr;exports.FoldIcon=et;exports.ForkIcon=Ge;exports.GitBranchIcon=$t;exports.HamburgerButton=Ut;exports.HeartRateIcon=lt;exports.IconButton=zt;exports.IssueIcon=qe;exports.MeditationIcon=nt;exports.MeetingIcon=jt;exports.MergeIcon=Ye;exports.MobileHeaderLayout=ss;exports.OverflowMenu=ns;exports.PlanetIcon=bt;exports.PullRequestDraftIcon=kt;exports.PullRequestIcon=Fe;exports.ReleaseIcon=Je;exports.ReviewIcon=Mt;exports.RocketIcon=vt;exports.RunningIcon=ot;exports.SafeAreaContainer=Rt;exports.SatelliteIcon=gt;exports.ServerIcon=dt;exports.SpaceIcons=dr;exports.StarIcon=Ze;exports.StrengthIcon=ct;exports.TaiChiIcon=st;exports.TechIcons=cr;exports.TelescopeIcon=yt;exports.TerminalIcon=mt;exports.TestingIcon=St;exports.UIForgeActivityItem=pr;exports.UIForgeActivityStream=br;exports.UIForgeBlocksEditor=Tt;exports.UIForgeComboBox=Yt;exports.UIForgeGrid=Vt;exports.UIForgeSidebar=rs;exports.UIForgeVideo=es;exports.UIForgeVideoPreview=ts;exports.UIIcons=ve;exports.UnfoldIcon=Xe;exports.WellnessIcons=or;exports.YogaIcon=at;exports.blocksToHTML=Kt;exports.blocksToJSON=Gt;exports.blocksToMarkdown=Zt;exports.detectProvider=Ee;exports.extractVideoId=De;exports.getEmbedUrlFromVideoUrl=Yr;exports.isAdultContent=Jr;exports.providersByName=we;exports.useActivityItemContext=Pt;exports.useDynamicPageCount=as;exports.useResponsive=At;exports.videoProviders=Ae;