@appforgeapps/uiforge 0.5.4 → 0.5.6

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"),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`\`\`\`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react"),Rt=({variant:t="primary",size:e="medium",theme:s="light",density:n="default",children:a,className:d="",...l})=>{const c="uiforge-button",j=`${c}--${t}`,y=`${c}--${e}`,$=`${c}--${s}`,k=n==="condensed"?`${c}--condensed`:"",I=[c,j,y,$,k,d].filter(Boolean).join(" ");return r.jsx("button",{className:I,"data-theme":s,...l,children:a})},zt=({isOpen:t,controlsId:e,ariaLabel:s="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 r.jsxs("button",{type:"button",className:c,"aria-expanded":t,"aria-controls":e,"aria-label":s,...d,children:[r.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),r.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),r.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"})]})},Ut=({icon:t,size:e="medium",ariaLabel:s,badge:n,className:a="",disabled:d,...l})=>{const c="uiforge-icon-button",j=[c,`${c}--${e}`,a].filter(Boolean).join(" ");return r.jsxs("button",{type:"button",className:j,"aria-label":s,disabled:d,...l,children:[r.jsx("span",{className:`${c}__icon`,"aria-hidden":"true",children:t}),n!==void 0&&r.jsx("span",{className:`${c}__badge`,"aria-hidden":"true",children:n})]})},Vt=({columns:t,data:e,theme:s="light",selectable:n=!1,selectedRows:a,getRowKey:d=(E,N)=>N,onSelectionChange:l,onCellEdit:c,actionButtons:j=[],searchable:y=!1,searchPlaceholder:$="Search...",onSearch:k,customFilter:I,pagination:u,onPageChange:w,onPageSizeChange:i,pageSizeOptions:h=[10,25,50,100],className:m="",loading:g=!1,emptyMessage:M="No data available"})=>{const[E,N]=o.useState(new Set),[C,D]=o.useState(""),[P,L]=o.useState(null),[U,B]=o.useState(""),v=a??E,f=o.useMemo(()=>!y||!C?e:e.filter(x=>I?I(x,C):Object.values(x).some(V=>V==null?!1:String(V).toLowerCase().includes(C.toLowerCase()))),[e,C,y,I]),_=o.useMemo(()=>{if(!u||u.serverSide)return f;const x=u.currentPage*u.pageSize,V=x+u.pageSize;return f.slice(x,V)},[f,u]),S=o.useMemo(()=>u?u.serverSide&&u.totalItems!==void 0?Math.ceil(u.totalItems/u.pageSize):Math.ceil(f.length/u.pageSize):1,[u,f.length]),te=o.useCallback(()=>e.filter((x,V)=>{const W=d(x,V);return v.has(W)}),[e,v,d]),Y=o.useCallback(x=>{const V=new Set;x&&_.forEach(W=>{const K=e.indexOf(W),ae=d(W,K);V.add(ae)}),a===void 0&&N(V),l?.(V,x?_:[])},[_,e,d,l,a]),re=o.useCallback((x,V,W)=>{const K=new Set(v);W?K.add(x):K.delete(x),a===void 0&&N(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=o.useCallback(x=>{D(x),k?.(x)},[k]),ne=o.useCallback((x,V,W)=>{L({rowKey:x,columnKey:V}),B(W)},[]),se=o.useCallback((x,V,W)=>{c?.(x,V,U,W),L(null),B("")},[U,c]),T=o.useCallback(()=>{L(null),B("")},[]),oe=o.useCallback(x=>{u&&w?.(x,u.pageSize)},[u,w]),Z=o.useCallback(x=>{i?.(x),u&&w?.(0,x)},[i,w,u]),ee=o.useMemo(()=>_.length===0?!1:_.every(x=>{const V=e.indexOf(x),W=d(x,V);return v.has(W)}),[_,v,e,d]),le=o.useMemo(()=>_.length===0?!1:_.some(V=>{const W=e.indexOf(V),K=d(V,W);return v.has(K)})&&!ee,[_,v,ee,e,d]),A="uiforge-grid",F=`${A}--${s}`;return r.jsxs("div",{className:`${A} ${F} ${m}`.trim(),"data-theme":s,children:[(y||j.length>0)&&r.jsxs("div",{className:`${A}__toolbar`,children:[y&&r.jsx("div",{className:`${A}__search`,children:r.jsx("input",{type:"text",className:`${A}__search-input`,placeholder:$,value:C,onChange:x=>X(x.target.value),"aria-label":"Search"})}),j.length>0&&r.jsx("div",{className:`${A}__actions`,children:j.map((x,V)=>{const W=x.disabled||x.requiresSelection&&v.size===0;return r.jsx("button",{className:`${A}__action-button ${A}__action-button--${x.variant||"primary"}`,onClick:()=>x.onClick(te()),disabled:W,children:x.label},V)})})]}),r.jsx("div",{className:`${A}__table-container`,children:r.jsxs("table",{className:`${A}__table`,role:"table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[n&&r.jsx("th",{className:`${A}__header-cell ${A}__header-cell--checkbox`,children:r.jsx("input",{type:"checkbox",checked:ee,ref:x=>{x&&(x.indeterminate=le)},onChange:x=>Y(x.target.checked),"aria-label":"Select all rows"})}),t.map(x=>r.jsx("th",{className:`${A}__header-cell`,style:{width:x.width},children:x.header},x.key))]})}),r.jsx("tbody",{children:g?r.jsx("tr",{children:r.jsx("td",{colSpan:t.length+(n?1:0),className:`${A}__loading-cell`,children:"Loading..."})}):_.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:t.length+(n?1:0),className:`${A}__empty-cell`,children:M})}):_.map((x,V)=>{const W=e.indexOf(x),K=d(x,W),ae=v.has(K);return r.jsxs("tr",{className:`${A}__row ${ae?`${A}__row--selected`:""}`,children:[n&&r.jsx("td",{className:`${A}__cell ${A}__cell--checkbox`,children:r.jsx("input",{type:"checkbox",checked:ae,onChange:q=>re(K,x,q.target.checked),"aria-label":`Select row ${V+1}`})}),t.map(q=>{const de=q.field?x[q.field]:void 0,he=P?.rowKey===K&&P?.columnKey===q.key;return r.jsx("td",{className:`${A}__cell`,children:he?r.jsxs("div",{className:`${A}__edit-cell`,children:[r.jsx("input",{type:"text",className:`${A}__edit-input`,value:String(U??""),onChange:ie=>B(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"?se(K,q.key,x):ie.key==="Escape"&&T()},autoFocus:!0,"aria-label":`Edit ${q.header}`}),r.jsx("button",{className:`${A}__edit-button ${A}__edit-button--save`,onClick:()=>se(K,q.key,x),"aria-label":"Save",children:"✓"}),r.jsx("button",{className:`${A}__edit-button ${A}__edit-button--cancel`,onClick:T,"aria-label":"Cancel",children:"✕"})]}):r.jsx("div",{className:`${A}__cell-content ${q.editable?`${A}__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,x,W):String(de??"")})},q.key)})]},K)})})]})}),u&&S>1&&r.jsxs("div",{className:`${A}__pagination`,children:[r.jsx("div",{className:`${A}__pagination-info`,children:u.serverSide&&u.totalItems!==void 0?r.jsxs(r.Fragment,{children:["Showing ",u.currentPage*u.pageSize+1," to"," ",Math.min((u.currentPage+1)*u.pageSize,u.totalItems)," ","of ",u.totalItems," items"]}):r.jsxs(r.Fragment,{children:["Showing ",u.currentPage*u.pageSize+1," to"," ",Math.min((u.currentPage+1)*u.pageSize,f.length)," ","of ",f.length," items"]})}),r.jsxs("div",{className:`${A}__pagination-controls`,children:[r.jsx("button",{className:`${A}__pagination-button`,onClick:()=>oe(u.currentPage-1),disabled:u.currentPage===0,"aria-label":"Previous page",children:"‹"}),Array.from({length:S},(x,V)=>V).map(x=>x===0||x===S-1||Math.abs(x-u.currentPage)<=1?r.jsx("button",{className:`${A}__pagination-button ${x===u.currentPage?`${A}__pagination-button--active`:""}`,onClick:()=>oe(x),"aria-label":`Page ${x+1}`,"aria-current":x===u.currentPage?"page":void 0,children:x+1},x):x===u.currentPage-2||x===u.currentPage+2?r.jsx("span",{className:`${A}__pagination-ellipsis`,children:"..."},x):null),r.jsx("button",{className:`${A}__pagination-button`,onClick:()=>oe(u.currentPage+1),disabled:u.currentPage>=S-1,"aria-label":"Next page",children:"›"})]}),r.jsxs("div",{className:`${A}__page-size`,children:[r.jsx("label",{htmlFor:"page-size-select",children:"Items per page:"}),r.jsx("select",{id:"page-size-select",className:`${A}__page-size-select`,value:u.pageSize,onChange:x=>Z(Number(x.target.value)),children:h.map(x=>r.jsx("option",{value:x,children:x},x))})]})]})]})},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:s="Start typing...",readOnly:n=!1,theme:a="light",className:d="",maxHeight:l})=>{const[c,j]=o.useState(t.length>0?t:[_e()]),[y,$]=o.useState(null),[k,I]=o.useState(null),[u,w]=o.useState(!1),i=o.useRef(null);o.useEffect(()=>{e&&e(c)},[c,e]);const h=o.useCallback((v,f)=>{j(_=>_.map(S=>S.id===v?{...S,...f}:S))},[]),m=o.useCallback((v="paragraph",f)=>{const _=_e(v);j(S=>{if(!f)return[...S,_];const te=S.findIndex(re=>re.id===f),Y=[...S];return Y.splice(te+1,0,_),Y}),$(_.id)},[]),g=o.useCallback(v=>{j(f=>{const _=f.filter(S=>S.id!==v);return _.length>0?_:[_e()]})},[]),M=o.useCallback((v,f)=>{j(_=>{const S=_.findIndex(X=>X.id===v),te=_.findIndex(X=>X.id===f);if(S===-1||te===-1)return _;const Y=[..._],[re]=Y.splice(S,1);return Y.splice(te,0,re),Y})},[]),E=o.useCallback((v,f)=>{n||(I(f),v.dataTransfer.effectAllowed="move")},[n]),N=o.useCallback(v=>{v.preventDefault(),v.dataTransfer.dropEffect="move"},[]),C=o.useCallback((v,f)=>{v.preventDefault(),k&&k!==f&&M(k,f),I(null)},[k,M]),D=o.useCallback(()=>{I(null)},[]),P=o.useCallback(v=>{y&&j(f=>f.map(_=>{if(_.id===y){const S=_.format||{};return{..._,format:{...S,[v]:!S[v]}}}return _}))},[y]),L=o.useCallback((v,f)=>{h(v,{type:f})},[h]),U=o.useCallback((v,f)=>{if(!n){if((v.metaKey||v.ctrlKey)&&v.key==="b")v.preventDefault(),P("bold");else if((v.metaKey||v.ctrlKey)&&v.key==="i")v.preventDefault(),P("italic");else if((v.metaKey||v.ctrlKey)&&v.key==="u")v.preventDefault(),P("underline");else if(v.key==="Enter"&&!v.shiftKey){const _=c.find(S=>S.id===f);_&&_.type!=="code"&&(v.preventDefault(),m("paragraph",f))}else if(v.key==="Backspace"){const _=c.find(S=>S.id===f);_&&!_.content&&c.length>1&&(v.preventDefault(),g(f))}}},[n,c,P,m,g]),B=`uiforge-blocks-editor--${a}`;return r.jsxs("div",{className:`uiforge-blocks-editor ${B} ${d}`,ref:i,style:{maxHeight:l},"data-theme":a,children:[!n&&u&&y&&r.jsx(Ht,{selectedBlock:c.find(v=>v.id===y),onFormatToggle:P,onBlockTypeChange:v=>L(y,v)}),r.jsx("div",{className:"uiforge-blocks-editor__content",children:c.map((v,f)=>r.jsx(Wt,{block:v,isSelected:y===v.id,isDragging:k===v.id,readOnly:n,placeholder:f===0&&c.length===1?s:void 0,onSelect:()=>{$(v.id),w(!0)},onChange:_=>h(v.id,_),onDelete:()=>g(v.id),onDragStart:_=>E(_,v.id),onDragOver:N,onDrop:_=>C(_,v.id),onDragEnd:D,onKeyDown:_=>U(_,v.id)},v.id))}),!n&&r.jsx(Ft,{onAddBlock:m})]})},Ht=({selectedBlock:t,onFormatToggle:e,onBlockTypeChange:s})=>{if(!t)return null;const n=t.format||{};return r.jsxs("div",{className:"uiforge-blocks-editor__toolbar",role:"toolbar","aria-label":"Text formatting",children:[r.jsx("div",{className:"uiforge-blocks-editor__toolbar-group",children:r.jsxs("select",{value:t.type,onChange:a=>s(a.target.value),className:"uiforge-blocks-editor__toolbar-select","aria-label":"Block type",children:[r.jsx("option",{value:"paragraph",children:"Paragraph"}),r.jsx("option",{value:"heading1",children:"Heading 1"}),r.jsx("option",{value:"heading2",children:"Heading 2"}),r.jsx("option",{value:"heading3",children:"Heading 3"}),r.jsx("option",{value:"list",children:"List"}),r.jsx("option",{value:"quote",children:"Quote"}),r.jsx("option",{value:"code",children:"Code"}),r.jsx("option",{value:"image",children:"Image"})]})}),r.jsx("div",{className:"uiforge-blocks-editor__toolbar-divider"}),r.jsxs("div",{className:"uiforge-blocks-editor__toolbar-group",children:[r.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:r.jsx("strong",{children:"B"})}),r.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:r.jsx("em",{children:"I"})}),r.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:r.jsx("u",{children:"U"})}),r.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:s,readOnly:n,placeholder:a,onSelect:d,onChange:l,onDelete:c,onDragStart:j,onDragOver:y,onDrop:$,onDragEnd:k,onKeyDown:I})=>{const u=["uiforge-blocks-editor__block",`uiforge-blocks-editor__block--${t.type}`,e?"uiforge-blocks-editor__block--selected":"",s?"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=m=>{l({content:m.target.value})},h=()=>{const m={value:t.content,onChange:i,onFocus:d,onKeyDown:I,placeholder:a,readOnly:n,className:w};switch(t.type){case"heading1":return r.jsx("input",{...m,type:"text",className:`${w} uiforge-blocks-editor__heading1`,placeholder:a||"Heading 1"});case"heading2":return r.jsx("input",{...m,type:"text",className:`${w} uiforge-blocks-editor__heading2`,placeholder:a||"Heading 2"});case"heading3":return r.jsx("input",{...m,type:"text",className:`${w} uiforge-blocks-editor__heading3`,placeholder:a||"Heading 3"});case"code":return r.jsx("textarea",{...m,className:`${w} uiforge-blocks-editor__code`,placeholder:a||"Code block",rows:4});case"quote":return r.jsx("textarea",{...m,className:`${w} uiforge-blocks-editor__quote`,placeholder:a||"Quote",rows:2});case"image":return r.jsxs("div",{className:"uiforge-blocks-editor__image-block",children:[r.jsx("input",{type:"text",value:t.imageUrl||"",onChange:g=>l({imageUrl:g.target.value}),placeholder:"Image URL",className:"uiforge-blocks-editor__image-url",readOnly:n}),r.jsx("input",{type:"text",value:t.imageAlt||"",onChange:g=>l({imageAlt:g.target.value}),placeholder:"Alt text",className:"uiforge-blocks-editor__image-alt",readOnly:n}),t.imageUrl&&r.jsx("img",{src:t.imageUrl,alt:t.imageAlt||"Block image",className:"uiforge-blocks-editor__image-preview"})]});default:return r.jsx("textarea",{...m,className:`${w} uiforge-blocks-editor__paragraph`,placeholder:a||"Start typing...",rows:1,style:{minHeight:"1.5em"}})}};return r.jsxs("div",{className:u,draggable:!n,onDragStart:j,onDragOver:y,onDrop:$,onDragEnd:k,"data-block-id":t.id,children:[!n&&r.jsxs("div",{className:"uiforge-blocks-editor__block-controls",children:[r.jsx("button",{type:"button",className:"uiforge-blocks-editor__drag-handle",title:"Drag to reorder","aria-label":"Drag to reorder",children:"⋮⋮"}),r.jsx("button",{type:"button",className:"uiforge-blocks-editor__delete-button",onClick:c,title:"Delete block","aria-label":"Delete block",children:"×"})]}),r.jsx("div",{className:"uiforge-blocks-editor__block-content",children:h()})]})},Ft=({onAddBlock:t})=>{const[e,s]=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 r.jsxs("div",{className:"uiforge-blocks-editor__block-menu",children:[r.jsx("button",{type:"button",className:"uiforge-blocks-editor__add-button",onClick:()=>s(!e),"aria-label":"Add block","aria-expanded":e,children:"+ Add Block"}),e&&r.jsx("div",{className:"uiforge-blocks-editor__block-menu-dropdown",children:n.map(({type:a,label:d,icon:l})=>r.jsxs("button",{type:"button",className:"uiforge-blocks-editor__block-menu-item",onClick:()=>{t(a),s(!1)},children:[r.jsx("span",{className:"uiforge-blocks-editor__block-menu-icon",children:l}),r.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(),s=["javascript:","data:","vbscript:","file:"],n=e.toLowerCase();for(const a of s)if(n.startsWith(a))return"";return e}function Kt(t){return t.map(e=>{let s=Ie(e.content);switch(e.format?.bold&&(s=`<strong>${s}</strong>`),e.format?.italic&&(s=`<em>${s}</em>`),e.format?.underline&&(s=`<u>${s}</u>`),e.format?.code&&(s=`<code>${s}</code>`),e.type){case"heading1":return`<h1>${s}</h1>`;case"heading2":return`<h2>${s}</h2>`;case"heading3":return`<h3>${s}</h3>`;case"quote":return`<blockquote>${s}</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>${s}</li></ul>`;default:return`<p>${s}</p>`}}).join(`
2
+ `)}function Zt(t){return t.map(e=>{let s=e.content;switch(e.format?.bold&&(s=`**${s}**`),e.format?.italic&&(s=`*${s}*`),e.format?.code&&(s=`\`${s}\``),e.type){case"heading1":return`# ${s}`;case"heading2":return`## ${s}`;case"heading3":return`### ${s}`;case"quote":return`> ${s}`;case"code":return`\`\`\`
3
3
  ${e.content}
4
- \`\`\``;case"image":return`![${e.imageAlt||""}](${e.imageUrl||""})`;case"list":return`- ${r}`;default:return r}}).join(`
4
+ \`\`\``;case"image":return`![${e.imageAlt||""}](${e.imageUrl||""})`;case"list":return`- ${s}`;default:return s}}).join(`
5
5
 
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;
6
+ `)}function Gt(t){return JSON.stringify(t,null,2)}const Yt=({options:t=[],value:e,onChange:s,onSearch:n,theme:a="light",placeholder:d="Select an option...",disabled:l=!1,clearable:c=!1,className:j="",renderOption:y,renderValue:$,loading:k=!1,maxHeight:I="300px",debounceMs:u=300,searchable:w=!0,noOptionsMessage:i="No options found",ariaLabel:h,enableCache:m=!1,cacheTTL:g,refreshOnOpen:M=!1,onClearCache:E,onForceRefresh:N})=>{const[C,D]=o.useState(!1),[P,L]=o.useState(""),[U,B]=o.useState([]),[v,f]=o.useState(0),[_,S]=o.useState(!1),te=o.useRef(null),Y=o.useRef(null),re=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(m),le=o.useRef(g),A=o.useCallback((p,R=0)=>p.reduce((Q,G)=>{const H={...G,level:R};return Q.push(H),G.children&&G.children.length>0&&Q.push(...A(G.children,R+1)),Q},[]),[]),F=p=>typeof p=="string"&&(p.startsWith("http://")||p.startsWith("https://")||p.startsWith("data:")||p.startsWith("/")),x=o.useMemo(()=>A(U.length>0?U:t).find(R=>R.value===e)||null,[e,t,U,A]),V=o.useCallback((p,R)=>{if(!R.trim())return p;const Q=R.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)},[]);o.useEffect(()=>{se.current=n,ne.current=null},[n]),o.useEffect(()=>{ee.current=m},[m]),o.useEffect(()=>{le.current=g},[g]),o.useEffect(()=>{E&&E(()=>{Z.current.clear()}),N&&N(()=>{if(!se.current)return;T.current&&T.current.abort(),T.current=new AbortController;const p=T.current.signal;S(!0),(async()=>{try{const R=Date.now(),Q=P,G=Z.current.get(Q),H=G&&(!le.current||R-G.timestamp<le.current);let ce;ee.current&&H?ce=G.data:(ce=await(se.current?se.current(P,p):n?.(P,p)??[]),!p.aborted&&ee.current&&Z.current.set(Q,{data:ce,timestamp:R})),p.aborted||(B(ce),ne.current=P)}catch(R){console.error(R),B([])}finally{S(!1)}})()})},[E,N,P,n]),o.useEffect(()=>{if(n&&C){const p=ne.current===P,R=!oe.current&&C;return p&&!(M&&R)?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;S(!0);try{let H;const ce=P,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(P,G):n(P,G)),!G.aborted&&ee.current&&Z.current.set(ce,{data:H,timestamp:xe})),G.aborted)return;B(H),ne.current=P}catch(H){console.error("Error fetching options:",H),B([])}finally{S(!1)}},u),()=>{X.current&&clearTimeout(X.current),T.current&&(T.current.abort(),T.current=null)})}else n||B(V(t,P));oe.current=C},[P,C,t,u,V,M,n]),o.useEffect(()=>{n||B(t)},[t,n]),o.useEffect(()=>{const p=R=>{te.current&&!te.current.contains(R.target)&&(D(!1),L(""))};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const W=o.useMemo(()=>A(U.length>0?U:t).filter(R=>!R.disabled),[U,t,A]),K=o.useMemo(()=>A(U.length>0?U:t),[U,t,A]),ae=o.useMemo(()=>{const p=new Map;return K.forEach(R=>{const Q=JSON.stringify({value:R.value,label:R.label}),G=W.findIndex(H=>H.value===R.value&&H.label===R.label);p.set(Q,G)}),p},[K,W]),q=p=>{if(!l)switch(p.key){case"ArrowDown":p.preventDefault(),C?f(R=>R<W.length-1?R+1:0):D(!0);break;case"ArrowUp":p.preventDefault(),C&&f(R=>R>0?R-1:W.length-1);break;case"Enter":p.preventDefault(),C&&W[v]?de(W[v]):D(!C);break;case"Escape":p.preventDefault(),D(!1),L("");break;case"Tab":C&&(D(!1),L(""));break}};o.useEffect(()=>{if(C&&re.current){const p=re.current.querySelector(`[data-index="${v}"]`);p&&typeof p.scrollIntoView=="function"&&p.scrollIntoView({block:"nearest"})}},[v,C]);const de=p=>{p.disabled||(s?.(p.value,p),D(!1),L(""),f(0))},he=p=>{p.stopPropagation(),s?.(null,null),L("")},ie=()=>{l||D(p=>{const R=!p;return R&&setTimeout(()=>Y.current?.focus(),0),R})};o.useEffect(()=>{C||(ne.current=null)},[C]);const je=p=>{L(p.target.value),C||D(!0),f(0)},ge=p=>{const R=(p.level||0)*20;return r.jsxs("div",{className:"uiforge-combobox-option-content",style:{paddingLeft:`${R}px`},children:[p.icon&&r.jsx("span",{className:"uiforge-combobox-option-icon",children:F(p.icon)?r.jsx("img",{src:p.icon,alt:"",className:"uiforge-combobox-option-icon-img"}):p.icon}),r.jsx("span",{className:"uiforge-combobox-option-label",children:p.label})]})},b=p=>p?r.jsxs("div",{className:"uiforge-combobox-value-content",children:[p.icon&&r.jsx("span",{className:"uiforge-combobox-value-icon",children:F(p.icon)?r.jsx("img",{src:p.icon,alt:"",className:"uiforge-combobox-value-icon-img"}):p.icon}),r.jsx("span",{className:"uiforge-combobox-value-label",children:p.label})]}):d,O="uiforge-combobox",z=`${O}--${a}`,J=[O,z,C&&`${O}--open`,l&&`${O}--disabled`,j].filter(Boolean).join(" ");return r.jsxs("div",{ref:te,className:J,onKeyDown:q,role:"combobox","aria-expanded":C,"aria-haspopup":"listbox","aria-label":h,"aria-disabled":l,tabIndex:l?-1:0,"data-theme":a,children:[r.jsxs("div",{className:`${O}-control`,onClick:ie,children:[w&&C?r.jsx("input",{ref:Y,type:"text",className:`${O}-input`,value:P,onChange:je,placeholder:d,disabled:l,"aria-autocomplete":"list","aria-controls":`${O}-listbox`}):r.jsx("div",{className:`${O}-value`,children:$?$(x):b(x)}),r.jsxs("div",{className:`${O}-indicators`,children:[c&&e!==null&&e!==void 0&&!l&&r.jsx("button",{type:"button",className:`${O}-clear`,onClick:he,"aria-label":"Clear selection",tabIndex:-1,children:"×"}),r.jsx("span",{className:`${O}-arrow`,children:"▼"})]})]}),C&&r.jsx("div",{ref:re,className:`${O}-dropdown`,style:{maxHeight:I},role:"listbox",id:`${O}-listbox`,children:k||_?r.jsx("div",{className:`${O}-loading`,children:"Loading..."}):W.length===0?r.jsx("div",{className:`${O}-no-options`,children:i}):K.map(p=>{const R=JSON.stringify({value:p.value,label:p.label}),Q=ae.get(R)??-1,G=p.value===e,H=Q===v,ce=[`${O}-option`,G&&`${O}-option--selected`,H&&`${O}-option--highlighted`,p.disabled&&`${O}-option--disabled`].filter(Boolean).join(" ");return r.jsx("div",{className:ce,onClick:()=>de(p),role:"option","aria-selected":G,"aria-disabled":p.disabled,"data-index":Q,children:y?y(p):ge(p)},R)})})]})};function Me(){return Me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[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(s,n){return s.__proto__=n,s},Le(t,e)}function Jt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Le(t,e)}var Oe=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Qt(t,e){return!!(t===e||Oe(t)&&Oe(e))}function Xt(t,e){if(t.length!==e.length)return!1;for(var s=0;s<t.length;s++)if(!Qt(t[s],e[s]))return!1;return!0}function $e(t,e){e===void 0&&(e=Xt);var s,n=[],a,d=!1;function l(){for(var c=[],j=0;j<arguments.length;j++)c[j]=arguments[j];return d&&s===this&&e(c,n)||(a=t.apply(this,c),d=!0,s=this,n=c),a}return l}var er=typeof performance=="object"&&typeof performance.now=="function",Re=er?function(){return performance.now()}:function(){return Date.now()};function ze(t){cancelAnimationFrame(t.id)}function tr(t,e){var s=Re();function n(){Re()-s>=e?t.call(null):a.id=requestAnimationFrame(n)}var a={id:requestAnimationFrame(n)};return a}var Ce=-1;function Ue(t){if(t===void 0&&(t=!1),Ce===-1||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",document.body.appendChild(e),Ce=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Ce}var me=null;function Ve(t){if(t===void 0&&(t=!1),me===null||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",s.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,s){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,s=t.getItemOffset,n=t.getEstimatedTotalSize,a=t.getItemSize,d=t.getOffsetForIndexAndAlignment,l=t.getStartIndexForOffset,c=t.getStopIndexForStartIndex,j=t.initInstanceProps,y=t.shouldResetStyleCacheOnItemSizeChange,$=t.validateProps;return e=(function(k){Jt(I,k);function I(w){var i;return i=k.call(this,w)||this,i._instanceProps=j(i.props,Pe(i)),i._outerRef=void 0,i._resetIsScrollingTimeoutId=null,i.state={instance:Pe(i),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof i.props.initialScrollOffset=="number"?i.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},i._callOnItemsRendered=void 0,i._callOnItemsRendered=$e(function(h,m,g,M){return i.props.onItemsRendered({overscanStartIndex:h,overscanStopIndex:m,visibleStartIndex:g,visibleStopIndex:M})}),i._callOnScroll=void 0,i._callOnScroll=$e(function(h,m,g){return i.props.onScroll({scrollDirection:h,scrollOffset:m,scrollUpdateWasRequested:g})}),i._getItemStyle=void 0,i._getItemStyle=function(h){var m=i.props,g=m.direction,M=m.itemSize,E=m.layout,N=i._getItemStyleCache(y&&M,y&&E,y&&g),C;if(N.hasOwnProperty(h))C=N[h];else{var D=s(i.props,h,i._instanceProps),P=a(i.props,h,i._instanceProps),L=g==="horizontal"||E==="horizontal",U=g==="rtl",B=L?D:0;N[h]=C={position:"absolute",left:U?void 0:B,right:U?B:void 0,top:L?0:D,height:L?"100%":P,width:L?P:"100%"}}return C},i._getItemStyleCache=void 0,i._getItemStyleCache=$e(function(h,m,g){return{}}),i._onScrollHorizontal=function(h){var m=h.currentTarget,g=m.clientWidth,M=m.scrollLeft,E=m.scrollWidth;i.setState(function(N){if(N.scrollOffset===M)return null;var C=i.props.direction,D=M;if(C==="rtl")switch(Ve()){case"negative":D=-M;break;case"positive-descending":D=E-g-M;break}return D=Math.max(0,Math.min(D,E-g)),{isScrolling:!0,scrollDirection:N.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._onScrollVertical=function(h){var m=h.currentTarget,g=m.clientHeight,M=m.scrollHeight,E=m.scrollTop;i.setState(function(N){if(N.scrollOffset===E)return null;var C=Math.max(0,Math.min(E,M-g));return{isScrolling:!0,scrollDirection:N.scrollOffset<C?"forward":"backward",scrollOffset:C,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._outerRefSetter=function(h){var m=i.props.outerRef;i._outerRef=h,typeof m=="function"?m(h):m!=null&&typeof m=="object"&&m.hasOwnProperty("current")&&(m.current=h)},i._resetIsScrollingDebounced=function(){i._resetIsScrollingTimeoutId!==null&&ze(i._resetIsScrollingTimeoutId),i._resetIsScrollingTimeoutId=tr(i._resetIsScrolling,rr)},i._resetIsScrolling=function(){i._resetIsScrollingTimeoutId=null,i.setState({isScrolling:!1},function(){i._getItemStyleCache(-1,null)})},i}I.getDerivedStateFromProps=function(i,h){return ar(i,h),$(i),null};var u=I.prototype;return u.scrollTo=function(i){i=Math.max(0,i),this.setState(function(h){return h.scrollOffset===i?null:{scrollDirection:h.scrollOffset<i?"forward":"backward",scrollOffset:i,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},u.scrollToItem=function(i,h){h===void 0&&(h="auto");var m=this.props,g=m.itemCount,M=m.layout,E=this.state.scrollOffset;i=Math.max(0,Math.min(i,g-1));var N=0;if(this._outerRef){var C=this._outerRef;M==="vertical"?N=C.scrollWidth>C.clientWidth?Ue():0:N=C.scrollHeight>C.clientHeight?Ue():0}this.scrollTo(d(this.props,i,h,E,this._instanceProps,N))},u.componentDidMount=function(){var i=this.props,h=i.direction,m=i.initialScrollOffset,g=i.layout;if(typeof m=="number"&&this._outerRef!=null){var M=this._outerRef;h==="horizontal"||g==="horizontal"?M.scrollLeft=m:M.scrollTop=m}this._callPropsCallbacks()},u.componentDidUpdate=function(){var i=this.props,h=i.direction,m=i.layout,g=this.state,M=g.scrollOffset,E=g.scrollUpdateWasRequested;if(E&&this._outerRef!=null){var N=this._outerRef;if(h==="horizontal"||m==="horizontal")if(h==="rtl")switch(Ve()){case"negative":N.scrollLeft=-M;break;case"positive-ascending":N.scrollLeft=M;break;default:var C=N.clientWidth,D=N.scrollWidth;N.scrollLeft=D-C-M;break}else N.scrollLeft=M;else N.scrollTop=M}this._callPropsCallbacks()},u.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ze(this._resetIsScrollingTimeoutId)},u.render=function(){var i=this.props,h=i.children,m=i.className,g=i.direction,M=i.height,E=i.innerRef,N=i.innerElementType,C=i.innerTagName,D=i.itemCount,P=i.itemData,L=i.itemKey,U=L===void 0?sr:L,B=i.layout,v=i.outerElementType,f=i.outerTagName,_=i.style,S=i.useIsScrolling,te=i.width,Y=this.state.isScrolling,re=g==="horizontal"||B==="horizontal",X=re?this._onScrollHorizontal:this._onScrollVertical,ne=this._getRangeToRender(),se=ne[0],T=ne[1],oe=[];if(D>0)for(var Z=se;Z<=T;Z++)oe.push(o.createElement(h,{data:P,key:U(Z,P),index:Z,isScrolling:S?Y:void 0,style:this._getItemStyle(Z)}));var ee=n(this.props,this._instanceProps);return o.createElement(v||f||"div",{className:m,onScroll:X,ref:this._outerRefSetter,style:Me({position:"relative",height:M,width:te,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:g},_)},o.createElement(N||C||"div",{children:oe,ref:E,style:{height:re?"100%":ee,pointerEvents:Y?"none":void 0,width:re?ee:"100%"}}))},u._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var i=this.props.itemCount;if(i>0){var h=this._getRangeToRender(),m=h[0],g=h[1],M=h[2],E=h[3];this._callOnItemsRendered(m,g,M,E)}}if(typeof this.props.onScroll=="function"){var N=this.state,C=N.scrollDirection,D=N.scrollOffset,P=N.scrollUpdateWasRequested;this._callOnScroll(C,D,P)}},u._getRangeToRender=function(){var i=this.props,h=i.itemCount,m=i.overscanCount,g=this.state,M=g.isScrolling,E=g.scrollDirection,N=g.scrollOffset;if(h===0)return[0,0,0,0];var C=l(this.props,N,this._instanceProps),D=c(this.props,C,N,this._instanceProps),P=!M||E==="backward"?Math.max(1,m):1,L=!M||E==="forward"?Math.max(1,m):1;return[Math.max(0,C-P),Math.max(0,Math.min(h-1,D+L)),C,D]},I})(o.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var ar=function(e,s){var n=e.children,a=e.direction,d=e.height,l=e.layout,c=e.innerTagName,j=e.outerTagName,y=e.width,$=s.instance;if(process.env.NODE_ENV!=="production"){(c!=null||j!=null)&&ye&&!ye.has($)&&(ye.add($),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var k=a==="horizontal"||l==="horizontal";switch(a){case"horizontal":case"vertical":be&&!be.has($)&&(be.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(k&&typeof y!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(y===null?"null":typeof y)+'" was specified.'));if(!k&&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,s){var n=e.itemSize;return s*n},getItemSize:function(e,s){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var s=e.itemCount,n=e.itemSize;return n*s},getOffsetForIndexAndAlignment:function(e,s,n,a,d,l){var c=e.direction,j=e.height,y=e.itemCount,$=e.itemSize,k=e.layout,I=e.width,u=c==="horizontal"||k==="horizontal",w=u?I:j,i=Math.max(0,y*$-w),h=Math.min(i,s*$),m=Math.max(0,s*$-w+$+l);switch(n==="smart"&&(a>=m-w&&a<=h+w?n="auto":n="center"),n){case"start":return h;case"end":return m;case"center":{var g=Math.round(m+(h-m)/2);return g<Math.ceil(w/2)?0:g>i+Math.floor(w/2)?i:g}case"auto":default:return a>=m&&a<=h?a:a<m?m:h}},getStartIndexForOffset:function(e,s){var n=e.itemCount,a=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(s/a)))},getStopIndexForStartIndex:function(e,s,n){var a=e.direction,d=e.height,l=e.itemCount,c=e.itemSize,j=e.layout,y=e.width,$=a==="horizontal"||j==="horizontal",k=s*c,I=$?y:d,u=Math.ceil((I+n-k)/c);return Math.max(0,Math.min(l-1,s+u-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var s=e.itemSize;if(process.env.NODE_ENV!=="production"&&typeof s!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(s===null?"null":typeof s)+'" was specified.'))}});const We=({size:t=16,className:e="",color:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("path",{d:"M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}),r.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:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:e,children:[r.jsx("path",{d:"M10 2L6 6M10 2L14 6M10 2V7.5",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M3 10H17",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),r.jsx("path",{d:"M10 18L6 14M10 18L14 14M10 18V12.5",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),et=({size:t=20,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:e,children:[r.jsx("path",{d:"M10 7.5L6 4M10 7.5L14 4M10 7.5V2",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M3 10H17",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),r.jsx("path",{d:"M10 12.5L6 16M10 12.5L14 16M10 12.5V18",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),tt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:e,children:[r.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:s,strokeWidth:"1.5"}),r.jsx("path",{d:"M8 1C11.866 1 15 4.134 15 8C15 11.866 11.866 15 8 15",fill:s}),r.jsx("circle",{cx:"8",cy:"5",r:"2",fill:s==="currentColor"?"white":"#fff"}),r.jsx("circle",{cx:"8",cy:"11",r:"2",fill:s}),r.jsx("circle",{cx:"8",cy:"5",r:"0.5",fill:s}),r.jsx("circle",{cx:"8",cy:"11",r:"0.5",fill:s==="currentColor"?"white":"#fff"})]}),nt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),r.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"}),r.jsx("path",{d:"M4 9L2 10M12 9L14 10",strokeWidth:"1",stroke:s,fill:"none"})]}),at=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("circle",{cx:"8",cy:"2.5",r:"1.5"}),r.jsx("path",{d:"M8 4.5L6 8L4 14H6L7 10H9L10 14H12L10 8L8 4.5Z"}),r.jsx("path",{d:"M6 8L3 6M10 8L13 6",strokeWidth:"1.5",stroke:s,fill:"none"})]}),it=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("rect",{x:"1",y:"6",width:"2",height:"4",rx:"0.5"}),r.jsx("rect",{x:"13",y:"6",width:"2",height:"4",rx:"0.5"}),r.jsx("rect",{x:"3",y:"5.5",width:"1",height:"5"}),r.jsx("rect",{x:"12",y:"5.5",width:"1",height:"5"}),r.jsx("rect",{x:"4",y:"7",width:"8",height:"2",rx:"0.5"})]}),ot=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("circle",{cx:"10",cy:"2.5",r:"1.5"}),r.jsx("path",{d:"M9 4.5L8 6L6 7L4 8L6 9L8 8L10 7L11 9L10 12L9 14H11L12 11L13 9L12 6L10 4.5H9Z"}),r.jsx("path",{d:"M6 14H4L5 11"})]}),lt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:e,children:r.jsx("path",{d:"M2 8H5L6.5 5L8 11L9.5 8H14",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ct=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.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"}),r.jsx("circle",{cx:"7",cy:"3",r:"1.5"})]}),dt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("rect",{x:"2",y:"2",width:"12",height:"3",rx:"0.5"}),r.jsx("rect",{x:"2",y:"6.5",width:"12",height:"3",rx:"0.5"}),r.jsx("rect",{x:"2",y:"11",width:"12",height:"3",rx:"0.5"}),r.jsx("circle",{cx:"4",cy:"3.5",r:"0.5"}),r.jsx("circle",{cx:"4",cy:"8",r:"0.5"}),r.jsx("circle",{cx:"4",cy:"12.5",r:"0.5"})]}),ut=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("ellipse",{cx:"8",cy:"3",rx:"5",ry:"2"}),r.jsx("path",{d:"M3 3V13C3 14.1 5.2 15 8 15C10.8 15 13 14.1 13 13V3"}),r.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:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.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"}),r.jsx("path",{d:"M3 5.5L6 8L3 10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),r.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:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("path",{d:"M4.75 7.5a3.25 3.25 0 116.5 0v3.75a3.25 3.25 0 01-6.5 0V7.5z"}),r.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:s,strokeWidth:"1.5",fill:"none"}),r.jsx("ellipse",{cx:"8",cy:"4",rx:"2.5",ry:"1.5"})]}),pt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.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"}),r.jsx("path",{d:"M2 12C2 12 0 14 0 16C2 16 4 14 4 14"})]}),gt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"0.5"}),r.jsx("path",{d:"M4 4L2 2M4 12L2 14M12 4L14 2M12 12L14 14",strokeWidth:"1.5",stroke:s,strokeLinecap:"round"}),r.jsx("rect",{x:"1",y:"1",width:"1.5",height:"1.5"}),r.jsx("rect",{x:"13.5",y:"1",width:"1.5",height:"1.5"}),r.jsx("rect",{x:"1",y:"13.5",width:"1.5",height:"1.5"}),r.jsx("rect",{x:"13.5",y:"13.5",width:"1.5",height:"1.5"}),r.jsx("circle",{cx:"8",cy:"8",r:"1"})]}),xt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.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"}),r.jsx("ellipse",{cx:"6",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),r.jsx("ellipse",{cx:"10",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),r.jsx("circle",{cx:"6",cy:"5.5",r:"0.75",fill:s}),r.jsx("circle",{cx:"10",cy:"5.5",r:"0.75",fill:s})]}),bt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("circle",{cx:"8",cy:"8",r:"5"}),r.jsx("ellipse",{cx:"8",cy:"8",rx:"8",ry:"2.5",fill:"none",stroke:s,strokeWidth:"1",opacity:"0.6"}),r.jsx("circle",{cx:"6",cy:"6",r:"1",opacity:"0.4",fill:s==="currentColor"?"white":"#fff"})]}),yt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("path",{d:"M1 8L6 6L14 2L12 10L10 8L8 14H6L8 8L1 8Z"}),r.jsx("path",{d:"M10 8L12 10",strokeWidth:"1.5",stroke:s})]}),wt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("circle",{cx:"5",cy:"4",r:"2"}),r.jsx("circle",{cx:"11",cy:"4",r:"2"}),r.jsx("path",{d:"M1 14V12C1 10.5 2.5 9 5 9C7.5 9 9 10.5 9 12V14H1Z"}),r.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:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.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"}),r.jsx("path",{d:"M10 0v3.5c0 .275.225.5.5.5H14",fill:s==="currentColor"?"white":"#fff"})]}),It=({size:t=16,className:e="",color:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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"})}),$t=({size:t=16,className:e="",color:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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"})}),Ct=({size:t=16,className:e="",color:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.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"}),r.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"})]}),Nt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("path",{d:"M6 1h4v1H6V1zM5.5 3h5L13 13c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2L5.5 3z"}),r.jsx("circle",{cx:"7",cy:"8",r:"1",fill:s==="currentColor"?"white":"#fff",opacity:"0.5"}),r.jsx("circle",{cx:"9",cy:"10",r:"0.75",fill:s==="currentColor"?"white":"#fff",opacity:"0.5"})]}),St=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("path",{d:"M8 0L0 3v5c0 5 3 7.5 8 8 5-.5 8-3 8-8V3L8 0z"}),r.jsx("path",{d:"M7 10L4.5 7.5l1-1L7 8l3.5-3.5 1 1L7 10z",fill:s==="currentColor"?"white":"#fff"})]}),Mt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:[r.jsx("rect",{x:"1",y:"1",width:"9",height:"11",rx:"1"}),r.jsx("line",{x1:"3",y1:"4",x2:"7",y2:"4",stroke:s==="currentColor"?"white":"#fff",strokeWidth:"1"}),r.jsx("line",{x1:"3",y1:"6.5",x2:"7",y2:"6.5",stroke:s==="currentColor"?"white":"#fff",strokeWidth:"1"}),r.jsx("circle",{cx:"11",cy:"11",r:"3",fill:"none",stroke:s,strokeWidth:"1.5"}),r.jsx("line",{x1:"13",y1:"13",x2:"15.5",y2:"15.5",stroke:s,strokeWidth:"1.5",strokeLinecap:"round"})]}),Lt=({size:t=16,className:e="",color:s="currentColor"})=>r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:e,children:r.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:$t},hr={gitbranch:Ct,prdraft:kt,testing:Nt,deployment:St,review:Mt,build:Lt};function At(t,e=640){const[s,n]=o.useState(!1);return o.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]),s}const Et=o.createContext({density:"comfortable",showMeta:!0}),Dt=({children:t,value:e})=>r.jsx(Et.Provider,{value:e,children:t});function Pt(){return o.useContext(Et)}const mr=t=>{const e=pe[t]||pe.commit;return r.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:s,expandable:n,isChild:a=!1,showTimeline:d=!1,density:l,showMeta:c,renderIcon:j,className:y=""})=>{const $=Pt(),k=l??$.density,I=c??$.showMeta,u=n??!!t.description,w=()=>{u&&s&&s(t.id,!e)},i=g=>{u&&s&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s(t.id,!e))},h=["uiforge-activity-item",`uiforge-activity-item--${k}`,a?"uiforge-activity-item--child":"",I?"":"uiforge-activity-item--hide-meta",y].filter(Boolean).join(" "),m=["uiforge-activity-item__header",u?"uiforge-activity-item__header--clickable":""].filter(Boolean).join(" ");return r.jsxs("div",{className:h,"data-event-id":t.id,"data-density":k,"data-show-meta":I,children:[d&&!a&&r.jsx("div",{className:"uiforge-activity-item__timeline-marker"}),r.jsx("div",{className:"uiforge-activity-item__icon",children:j?j(t):t.icon||mr(t.type)}),r.jsxs("div",{className:"uiforge-activity-item__content",children:[r.jsxs("div",{className:m,onClick:w,onKeyDown:i,role:u?"button":void 0,tabIndex:u?0:void 0,"aria-expanded":u?e:void 0,children:[r.jsx("div",{className:"uiforge-activity-item__title",children:t.title}),I&&r.jsx("div",{className:"uiforge-activity-item__timestamp",children:fr(t.timestamp)}),u&&r.jsx("div",{className:"uiforge-activity-item__toggle",children:e?r.jsx(ve.fold,{size:16}):r.jsx(ve.unfold,{size:16})})]}),e&&t.description&&I&&r.jsx("div",{className:"uiforge-activity-item__description",children:t.description})]})]})},Be=400,vr=t=>{const e=pe[t]||pe.commit;return r.jsx(e,{size:16})},ke=(t,e=2)=>{if(t.length===0)return[];const s=[];let n=[],a=null;return t.forEach((d,l)=>{a===d.type?n.push(d):(n.length>=e&&a?s.push(Te(n,a)):n.forEach(c=>{s.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?s.push(Te(n,a)):n.forEach(c=>{s.push({id:c.id.toString(),type:c.type,count:1,title:c.title,timestamp:new Date(c.timestamp),icon:c.icon,events:[c]})}))}),s},Te=(t,e)=>{const s=t.reduce((l,c)=>{const j=c.metadata?.repository||"unknown";return l[j]||(l[j]=[]),l[j].push(c),l},{}),n=Object.entries(s),a=n.length>1;let d="";if(a)d=`Created ${t.length} ${Ne(e)} in ${n.length} repositories`;else{const l=n[0][0];d=`Created ${t.length} ${Ne(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} ${Ne(e)} in ${l}`,timestamp:new Date(c[0].timestamp),icon:c[0].icon,events:c})):void 0}},Ne=t=>({pr:"pull requests",issue:"issues",commit:"commits",comment:"comments",star:"stars",fork:"forks",merge:"merges",release:"releases",deploy:"deployments"})[t]||`${t}s`,Se=t=>{if(t.length===0)return[];const e=[];let s=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!==s){const j={id:`sep-${a}`,type:"date-separator",date:l,label:gr(l)};e.push(j),s=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:s="",style:n,showLoadMore:a=!0,loading:d=!1,onLoadMore:l,pagination:c,maxHeight:j,showMoreThreshold:y=100,initiallyExpandedAll:$=!1,emptyMessage:k="No activity to display",onToggleExpand:I,enableGrouping:u=!0,groupingThreshold:w=2,showDateSeparators:i=!0,showTimeline:h=!0,scale:m,density:g="comfortable",responsive:M=!0,compactBreakpointPx:E=640,containerRef:N,showMeta:C,renderIcon:D,renderEvent:P,virtualization:L=!1,virtualItemHeight:U=48})=>{const[B,v]=o.useState(()=>{const b=new Set;return(u?i?Se(ke(t,w)):ke(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(p=>p.initiallyExpanded))&&b.add(J.id),J.children&&J.children.forEach(p=>{($||p.events.some(R=>R.initiallyExpanded))&&b.add(p.id)})}}),b}),[f,_]=o.useState(!1),[S,te]=o.useState(Be),Y=o.useRef(null),re=N||Y,X=o.useRef(null),ne=o.useRef(null),se=At(M?re:null,E),T=o.useMemo(()=>M&&se&&g==="comfortable"?"compact":g,[M,se,g]),oe=o.useMemo(()=>C!==void 0?C:!0,[C]),Z=o.useMemo(()=>{if(!u){const O=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?Se(O):O}const b=ke(t,w);return i?Se(b):b},[t,u,w,i]),ee=o.useCallback(()=>{if(!X.current||!a||!l)return;const{scrollTop:b,scrollHeight:O,clientHeight:z}=X.current,J=O-b-z;_(J<=y)},[a,l,y]),le=o.useCallback(({scrollOffset:b})=>{if(!a||!l)return;const O=Z.length*U,z=S,J=O-b-z;_(J<=y)},[a,l,y,Z.length,U,S]);o.useEffect(()=>{if(!L||!Y.current)return;const b=()=>{const z=Y.current;if(z){let J=z.clientHeight||Be;if(j){const p=parseFloat(j);!isNaN(p)&&p>0&&(J=p)}te(J)}};b();const O=new ResizeObserver(b);return O.observe(Y.current),()=>{O.disconnect()}},[L,j]),o.useEffect(()=>{const b=X.current;if(b)return b.addEventListener("scroll",ee),ee(),()=>{b.removeEventListener("scroll",ee)}},[ee]);const A=o.useCallback((b,O)=>{v(z=>{const J=new Set(z),p=J.has(b);return p?J.delete(b):J.add(b),I?.(O,!p),J})},[I]),F=(b,O=!1)=>{const z=B.has(b.id),J=b.children&&b.children.length>0,p=b.count>1,R=b.count===1&&b.events[0]?.description,Q=p||J||R,G=b.count===1&&b.events.length===1?b.events[0].id:b.id;return P&&b.count===1&&b.events.length===1?r.jsxs("div",{className:`activity-stream__item ${O?"activity-stream__item--child":""}`,"data-event-id":b.id,children:[h&&!O&&r.jsx("div",{className:"activity-stream__timeline-marker"}),P(b.events[0])]},b.id):r.jsxs("div",{className:`activity-stream__item ${O?"activity-stream__item--child":""}`,"data-event-id":b.id,children:[h&&!O&&r.jsx("div",{className:"activity-stream__timeline-marker"}),r.jsx("div",{className:"activity-stream__icon",children:D&&b.events.length===1?D(b.events[0]):b.icon||vr(b.type)}),r.jsxs("div",{className:"activity-stream__content",children:[r.jsxs("div",{className:`activity-stream__header ${Q?"activity-stream__header--clickable":""}`,onClick:()=>Q&&A(b.id,G),onKeyDown:H=>{Q&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),A(b.id,G))},role:Q?"button":void 0,tabIndex:Q?0:void 0,"aria-expanded":Q?z:void 0,children:[r.jsx("div",{className:"activity-stream__title",children:b.title}),r.jsx("div",{className:"activity-stream__timestamp",children:xr(b.timestamp)}),Q&&r.jsx("div",{className:"activity-stream__toggle",children:z?r.jsx(ve.fold,{size:16}):r.jsx(ve.unfold,{size:16})})]}),z&&J&&b.children&&r.jsx("div",{className:"activity-stream__children",children:b.children.map(H=>F(H,!0))}),z&&!J&&b.events.length>1&&r.jsx("div",{className:"activity-stream__events-list",children:b.events.map(H=>P?r.jsx("div",{className:"activity-stream__event-item",children:P(H)},H.id):r.jsxs("div",{className:"activity-stream__event-item",children:[r.jsx("div",{className:"activity-stream__event-title",children:H.title}),H.description&&r.jsx("div",{className:"activity-stream__event-description",children:H.description})]},H.id))}),z&&b.count===1&&b.events[0].description&&r.jsx("div",{className:"activity-stream__description",children:b.events[0].description})]})]},b.id)},x=o.useCallback(b=>{if("type"in b&&b.type==="date-separator"){const O=b;return r.jsxs("div",{className:"activity-stream__date-separator",children:[r.jsx("div",{className:"activity-stream__date-label",children:O.label}),r.jsx("div",{className:"activity-stream__date-line"})]},O.id)}return F(b)},[B,h,D,P,A]),V=b=>r.jsxs("div",{className:"activity-stream__date-separator",children:[r.jsx("div",{className:"activity-stream__date-label",children:b.label}),r.jsx("div",{className:"activity-stream__date-line"})]},b.id),W=o.useCallback(({index:b,style:O})=>{const z=Z[b];return z?r.jsx("div",{style:O,className:"activity-stream__virtual-row",children:x(z)}):null},[Z,x]),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} ${s}`.trim();m!==void 0&&m<1&&(ie=`${ie} ${ae}--scale-compact`),m!==void 0&&m>1&&(ie=`${ie} ${ae}--scale-spacious`);const je=j?{maxHeight:j}:void 0,ge=m!==void 0?{"--activity-stream-scale":m}:{};return r.jsx(Dt,{value:{density:T,showMeta:oe},children:r.jsx("div",{ref:Y,className:`${ie}${L?" activity-stream--virtualized":""}`,"data-theme":e,"data-density":T,"data-show-meta":oe,"data-virtualized":L,style:n,children:L?r.jsxs("div",{className:"activity-stream__container activity-stream__container--virtualized",style:ge,children:[Z.length===0?r.jsx("div",{className:"activity-stream__empty",children:k}):r.jsx(ir,{ref:ne,className:"activity-stream__items activity-stream__items--virtualized",height:S,itemCount:Z.length,itemSize:U,width:"100%",onScroll:le,children:W}),d&&r.jsxs("div",{className:"activity-stream__loading",children:[r.jsx("div",{className:"activity-stream__spinner"}),r.jsx("span",{children:"Loading..."})]}),a&&!d&&K&&l&&r.jsx("div",{className:`activity-stream__load-more ${f?"activity-stream__load-more--visible":""}`,onClick:l,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),l())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]}):r.jsxs("div",{ref:X,className:"activity-stream__container",style:{...je,...ge},children:[Z.length===0?r.jsx("div",{className:"activity-stream__empty",children:k}):r.jsx("div",{className:"activity-stream__items",children:Z.map(b=>"type"in b&&b.type==="date-separator"?V(b):F(b))}),d&&r.jsxs("div",{className:"activity-stream__loading",children:[r.jsx("div",{className:"activity-stream__spinner"}),r.jsx("span",{children:"Loading..."})]}),a&&!d&&K&&l&&r.jsx("div",{className:`activity-stream__load-more ${f?"activity-stream__load-more--visible":""}`,onClick:l,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.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 s=new URLSearchParams;e.autoplay&&s.set("autoplay","1"),e.muted&&s.set("mute","1"),e.loop&&(s.set("loop","1"),s.set("playlist",t)),e.startTime&&s.set("start",String(e.startTime)),e.controls===!1&&s.set("controls","0");const n="https://www.youtube.com",a=s.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),s=e.hostname.replace("www.","");if(s!=="vimeo.com"&&s!=="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 s=new URLSearchParams;e.autoplay&&s.set("autoplay","1"),e.muted&&s.set("muted","1"),e.loop&&s.set("loop","1"),e.startTime&&s.set("t",`${e.startTime}s`),e.controls===!1&&s.set("controls","0");const n=s.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),s=e.hostname.replace("www.","");if(s==="dai.ly")return e.pathname.slice(1).split("?")[0];if(s==="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 s=new URLSearchParams;e.autoplay&&s.set("autoplay","1"),e.muted&&s.set("mute","1"),e.loop&&s.set("loop","1"),e.startTime&&s.set("start",String(e.startTime)),e.controls===!1&&s.set("controls","0");const n=s.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 s=new URLSearchParams,n=typeof window<"u"?window.location.hostname:"localhost";s.set("parent",n),e.autoplay&&s.set("autoplay","true"),e.muted&&s.set("muted","true");const a=s.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}`},$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 s=new URLSearchParams;e.autoplay&&s.set("autoplay","2");const n=s.toString();return`https://rumble.com/embed/${t}${n?`?${n}`:""}`}},Cr={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}/`},Nr={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 s=new URLSearchParams;e.autoplay&&s.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=s.toString();return`https://vk.com/video_ext.php?oid=${n[0]}&id=${n[1]}${a?`&${a}`:""}`}},Sr={name:"bilibili",displayName:"Bilibili",domains:["bilibili.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),s=e.hostname.replace("www.","");if(s!=="bilibili.com"&&s!=="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 s=new URLSearchParams;e.autoplay&&s.set("autoplay","1");const n=s.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),s=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(s.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 s=new URLSearchParams;e.autoplay&&s.set("autoPlay","true"),e.muted&&s.set("muted","true");const n=s.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),s=e.searchParams.get("videoId");if(s){const n=e.pathname.match(/\/(\d+)\//);if(n)return`${n[1]}:${s}`}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[s,...n]=e,a=n.join(":");return`https://players.brightcove.net/${s}/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),s=e.searchParams.get("entry_id")||e.searchParams.get("entryId");if(s){const n=e.pathname.match(/\/p\/(\d+)\//),a=e.pathname.match(/\/uiconf_id\/(\d+)/);if(n&&a)return`${n[1]}:${a[1]}:${s}`}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[s,n,a]=e;return`https://cdnapisec.kaltura.com/p/${s}/sp/${s}00/embedIframeJs/uiconf_id/${n}/partner_id/${s}?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),s=e.hostname;if(s==="panopto.com"||s.endsWith(".panopto.com")){const a=e.searchParams.get("id");if(a)return`${s.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[s,...n]=e,a=n.join(":");return`https://${s}.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 s=new URL(t).pathname.match(/\/players\/([a-zA-Z0-9]+-[a-zA-Z0-9]+)\.html/);return s?s[1]:null}catch{return null}},getEmbedUrl:t=>`https://content.jwplatform.com/players/${t}.html`},Or={name:"cloudflare",displayName:"Cloudflare Stream",domains:["cloudflarestream.com","videodelivery.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),s=e.hostname,n=s==="videodelivery.net"||s.endsWith(".videodelivery.net"),a=s==="cloudflarestream.com"||s.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 s=new URLSearchParams;e.autoplay&&s.set("autoplay","true"),e.muted&&s.set("muted","true"),e.loop&&s.set("loop","true");const n=s.toString();return`https://iframe.videodelivery.net/${t}${n?`?${n}`:""}`}},Rr={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 s=new URLSearchParams;e.autoplay&&s.set("autoplay","true"),e.muted&&s.set("muted","true");const n=s.toString();return`https://stream.mux.com/${t}.m3u8${n?`?${n}`:""}`}},zr={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`},Ur={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 s=e.pathname.split("/");if(s.length>=2)return`${e.hostname}:${s[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[s,...n]=e,a=n.join(":");return`https://${s}/${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),s=e.hostname.replace("www.","");if(s==="fb.watch")return e.pathname.slice(1);if(s==="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),s=e.hostname.replace("www.","");if(s!=="twitter.com"&&s!=="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,$r,Cr,kr,Nr,Sr,Mr,Lr,Ar,Er,Dr,Pr,Or,Rr,zr,Ur,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 s=new URL(t).hostname.toLowerCase().replace("www.","");for(const n of Ae)for(const a of n.domains)if(s===a||s.endsWith(`.${a}`))return n;return null}catch{return null}}function De(t){const e=Ee(t);if(!e)return null;const s=e.extractVideoId(t);return s?{provider:e,videoId:s}:null}function Yr(t,e){const s=De(t);return s?s.provider.getEmbedUrl(s.videoId,e):null}function Jr(t){return Ee(t)?.tier==="adult"}const Qr=()=>r.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:[r.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"white",fillOpacity:"0.9"}),r.jsx("path",{d:"M26 20L46 32L26 44V20Z",fill:"currentColor",style:{color:"#3b82f6"}})]}),Xr=()=>r.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:[r.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"}),r.jsx("path",{d:"M8 7l5 3-5 3V7z"})]}),es=({title:t,description:e,url:s,youtubeId:n,vimeoId:a,provider:d,videoId:l,autoplay:c=!1,muted:j=!1,loop:y=!1,startTime:$,controls:k=!0,thumbnailUrl:I,onPlay:u,onError:w,onReady:i,className:h="",overlayIcon:m,aspectRatio:g="16:9",width:M,height:E,maxHeight:N,responsive:C=!1,hideHeader:D=!1,allowAdultContent:P=!1,fallback:L})=>{const[U,B]=o.useState(!1),[v,f]=o.useState(null),_=o.useRef(null),S=o.useMemo(()=>{if(d&&l){const F=we[d];if(F)return{provider:F,videoId:l,method:"explicit"}}if(s){const F=De(s);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},[s,d,l,n,a]),te=o.useMemo(()=>S?S.provider.tier==="adult":!1,[S]),Y=o.useMemo(()=>({autoplay:U?!0:c,muted:j,loop:y,startTime:$,controls:k}),[c,j,y,$,k,U]),re=o.useMemo(()=>{if(!S)return"";try{return S.provider.getEmbedUrl(S.videoId,Y)}catch(F){return console.error("Error generating embed URL:",F),""}},[S,Y]),X=o.useMemo(()=>{if(I)return I;if(S?.provider.name==="youtube")return`https://img.youtube.com/vi/${S.videoId}/maxresdefault.jpg`},[I,S]),ne=o.useCallback(()=>{S&&(B(!0),u&&u(S.videoId,S.provider.name),i&&i(S.videoId,S.provider.name))},[S,u,i]),se=o.useCallback(F=>{f(F),w&&S&&w(new Error(F),S.provider.name)},[w,S]);if(!S)return L?r.jsx(r.Fragment,{children:L}):(console.warn("UIForgeVideo: No valid video source provided"),null);if(te&&!P){const F="Adult content must be explicitly enabled with allowAdultContent prop";return L?r.jsx(r.Fragment,{children:L}):(console.warn(`UIForgeVideo: ${F}`),r.jsx("div",{className:"uiforge-video",children:r.jsx("div",{className:"uiforge-video__error",children:r.jsx("p",{children:F})})}))}if(v)return L?r.jsx(r.Fragment,{children:L}):r.jsx("div",{className:"uiforge-video",children:r.jsx("div",{className:"uiforge-video__error",children:r.jsx("p",{children:v})})});const T="uiforge-video",oe=C?`${T}--responsive`:"",Z=`${T} ${oe} ${h}`.trim(),ee={aspectRatio:g!=="auto"?g.replace(":","/"):void 0,width:M?typeof M=="number"?`${M}px`:M:void 0,height:E?typeof E=="number"?`${E}px`:E:void 0,maxHeight:N?typeof N=="number"?`${N}px`:N:void 0},le=t||`${S.provider.displayName} Video`,A=!D&&(t||e);return r.jsxs("div",{className:Z,children:[A&&r.jsxs("div",{className:`${T}__header`,children:[t&&r.jsx("h3",{className:`${T}__title`,children:t}),e&&r.jsx("p",{className:`${T}__description`,children:e})]}),r.jsx("div",{className:`${T}__player-container`,style:ee,children:U?r.jsx("iframe",{ref:_,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")}):r.jsxs(r.Fragment,{children:[X&&r.jsx("img",{src:X,alt:le,className:`${T}__thumbnail`}),r.jsx("button",{className:`${T}__overlay`,onClick:ne,"aria-label":`Play video: ${le}`,type:"button",children:m||r.jsx(Qr,{})})]})})]})},ts=({title:t,icon:e,className:s="",onClick:n})=>{const a="uiforge-video-preview",d=`${a} ${s}`.trim(),l=()=>{n&&n()},c=$=>{n&&($.key==="Enter"||$.key===" ")&&($.preventDefault(),n())},j=n?"button":"div",y=n?{type:"button",onClick:l,onKeyDown:c}:{};return r.jsxs(j,{className:d,...y,children:[r.jsx("div",{className:`${a}__icon-container`,children:e||r.jsx(Xr,{})}),r.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:s=!0,onOpenChange:n,children:a,className:d="",ariaLabel:l="Sidebar navigation",width:c="280px",height:j="200px",position:y="left",showBackdrop:$=!0,closeOnBackdropClick:k=!0,closeOnEscape:I=!0,trapFocus:u=!0})=>{const w=o.useRef(null),i=o.useRef(null),h=e==="drawer"||e==="bottom",m=o.useCallback(()=>{k&&n&&n(!1)},[k,n]);o.useEffect(()=>{if(!h||!s||!I)return;const D=P=>{P.key==="Escape"&&(P.preventDefault(),n?.(!1))};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[h,s,I,n]),o.useEffect(()=>{if(!h||!s||!u)return;const D=w.current;if(!D)return;i.current=document.activeElement;const P=He(D);P.length>0?P[0].focus():D.focus();const L=U=>{if(U.key!=="Tab")return;const B=He(D);if(B.length===0)return;const v=B[0],f=B[B.length-1];U.shiftKey?document.activeElement===v&&(U.preventDefault(),f.focus()):document.activeElement===f&&(U.preventDefault(),v.focus())};return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L),i.current&&typeof i.current.focus=="function"&&i.current.focus()}},[h,s,u]),o.useEffect(()=>{if(!h||!s)return;const D=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=D}},[h,s]);const g="uiforge-sidebar",M=[g,`${g}--${e}`,`${g}--${y}`,h&&s&&`${g}--open`,h&&!s&&`${g}--closed`,d].filter(Boolean).join(" "),E={"--sidebar-width":c,"--sidebar-height":j},C=e==="static"?{role:"navigation","aria-label":l}:{role:"dialog","aria-modal":s,"aria-expanded":s,"aria-label":l,"aria-hidden":!s};return e==="static"?r.jsx("aside",{id:t,ref:w,className:M,style:E,...C,children:r.jsx("div",{className:`${g}__content`,children:a})}):r.jsxs(r.Fragment,{children:[$&&r.jsx("div",{className:`${g}__backdrop ${s?`${g}__backdrop--visible`:""}`,onClick:m,"aria-hidden":"true"}),r.jsx("aside",{id:t,ref:w,className:M,style:E,tabIndex:-1,...C,children:r.jsx("div",{className:`${g}__content`,children:a})})]})},Ot=({children:t,disableTop:e=!1,disableBottom:s=!1,disableLeft:n=!1,disableRight:a=!1,className:d="",...l})=>{const c="uiforge-safe-area-container",j=[c,e&&`${c}--disable-top`,a&&`${c}--disable-right`,s&&`${c}--disable-bottom`,n&&`${c}--disable-left`,d].filter(Boolean).join(" ");return r.jsx("div",{className:j,...l,children:t})},ss=({left:t,title:e,right:s,hideOnDesktop:n=!1,className:a="",...d})=>{const l="uiforge-mobile-header-layout",c=[l,n&&`${l}--hide-on-desktop`,a].filter(Boolean).join(" "),j=typeof e=="string";return r.jsx(Ot,{disableBottom:!0,disableLeft:!0,disableRight:!0,children:r.jsxs("header",{className:c,...d,children:[r.jsx("div",{className:`${l}__left`,children:t}),r.jsx("div",{className:`${l}__center`,children:j?r.jsx("span",{className:`${l}__title`,children:e}):e}),r.jsx("div",{className:`${l}__right`,children:s})]})})},ns=({items:t,onSelect:e,ariaLabel:s="More actions",trigger:n,align:a="right",disabled:d=!1,size:l="medium",className:c="","data-testid":j})=>{const[y,$]=o.useState(!1),[k,I]=o.useState(-1),u=o.useRef(null),w=o.useRef(null),i=o.useRef(null),h=o.useRef(null),g=`overflow-menu-${o.useId()}`,M=t.filter(f=>!f.disabled),E=o.useCallback(()=>{d||($(!0),I(0))},[d]),N=o.useCallback(()=>{$(!1),I(-1),n?i.current?.focus():w.current?.focus()},[n]),C=o.useCallback(f=>{f.disabled||(f.onClick?f.onClick():e&&e(f),N())},[e,N]);o.useEffect(()=>{if(!y)return;const f=_=>{u.current&&!u.current.contains(_.target)&&N()};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[y,N]);const D=o.useCallback(f=>{if(!d)switch(f.key){case"Enter":case" ":if(f.preventDefault(),!y)E();else if(k>=0){const _=M[k];_&&C(_)}break;case"ArrowDown":f.preventDefault(),y?I(_=>_<M.length-1?_+1:0):E();break;case"ArrowUp":f.preventDefault(),y&&I(_=>_>0?_-1:M.length-1);break;case"Escape":f.preventDefault(),y&&N();break;case"Tab":y&&N();break;case"Home":y&&(f.preventDefault(),I(0));break;case"End":y&&(f.preventDefault(),I(M.length-1));break}},[d,y,k,M,E,N,C]);o.useEffect(()=>{if(y&&h.current&&k>=0){const f=h.current.querySelector(`[data-index="${k}"]`);f&&typeof f.scrollIntoView=="function"&&f.scrollIntoView({block:"nearest"})}},[k,y]);const P=()=>{d||(y?N():E())},L="uiforge-overflow-menu",U=[L,d&&`${L}--disabled`,c].filter(Boolean).join(" "),B=[`${L}__menu`,`${L}__menu--${a}`].filter(Boolean).join(" "),v=f=>M.findIndex(_=>_.id===f.id);return r.jsxs("div",{ref:u,className:U,onKeyDown:D,"data-testid":j,children:[n?r.jsx("div",{onClick:P,role:"button",tabIndex:d?-1:0,"aria-haspopup":"menu","aria-expanded":y,"aria-controls":y?g:void 0,"aria-label":s,"aria-disabled":d,ref:i,className:`${L}__custom-trigger`,children:n}):r.jsx("button",{ref:w,type:"button",className:`${L}__trigger ${L}__trigger--${l}`,onClick:P,"aria-haspopup":"menu","aria-expanded":y,"aria-controls":y?g:void 0,"aria-label":s,disabled:d,children:r.jsx("span",{className:`${L}__trigger-icon`,"aria-hidden":"true",children:"•••"})}),y&&r.jsx("div",{ref:h,id:g,className:B,role:"menu","aria-label":s,children:t.map(f=>{const _=v(f),S=!f.disabled&&_===k,te=[`${L}__item`,f.disabled&&`${L}__item--disabled`,S&&`${L}__item--highlighted`].filter(Boolean).join(" ");return r.jsxs("div",{className:te,role:"menuitem",tabIndex:-1,"aria-disabled":f.disabled,"data-index":f.disabled?void 0:_,onClick:()=>C(f),onMouseEnter:()=>{f.disabled||I(_)},children:[f.icon&&r.jsx("span",{className:`${L}__item-icon`,"aria-hidden":"true",children:f.icon}),r.jsx("span",{className:`${L}__item-label`,children:f.label})]},f.id)})})]})},as=({title:t,subtitle:e,mediaUrl:s,mediaAlt:n,meta:a,actions:d,variant:l="default",className:c="",theme:j="light",renderBody:y,renderFooter:$,onClick:k,tabIndex:I,ariaLabel:u})=>{const w="uiforge-media-card",i=`${w}--${l}`,h=`${w}--${j}`,m=k?`${w}--clickable`:"",g=[w,i,h,m,c].filter(Boolean).join(" "),M=E=>{k&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),k())};return r.jsxs("div",{className:g,"data-theme":j,onClick:k,onKeyDown:M,role:k?"button":void 0,tabIndex:k?I??0:I,"aria-label":u||t,children:[r.jsx("div",{className:`${w}__media`,children:r.jsx("img",{src:s,alt:n,className:`${w}__image`,loading:"lazy"})}),r.jsx("div",{className:`${w}__content`,children:y?y():r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${w}__body`,children:[r.jsx("h3",{className:`${w}__title`,children:t}),e&&r.jsx("p",{className:`${w}__subtitle`,children:e}),a&&Object.keys(a).length>0&&r.jsx("dl",{className:`${w}__meta`,children:Object.entries(a).map(([E,N])=>r.jsxs("div",{className:`${w}__meta-item`,children:[r.jsxs("dt",{className:`${w}__meta-key`,children:[E,":"]}),r.jsx("dd",{className:`${w}__meta-value`,children:N})]},E))})]}),(d||$)&&r.jsx("div",{className:`${w}__footer`,children:$?$():d})]})})]})};function is(t){if(!t)return"?";const e=t.trim().split(/\s+/);return e.length===1?e[0].charAt(0).toUpperCase():(e[0].charAt(0)+e[e.length-1].charAt(0)).toUpperCase()}const os=()=>r.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),r.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),r.jsx("polyline",{points:"21 15 16 10 5 21"})]}),ls=({type:t="icon",icon:e,name:s="",initials:n,gradientColor:a="blue",size:d="medium",borderRadius:l="medium",className:c="",alt:j="Media placeholder",theme:y="light"})=>{const $="uif-media-placeholder",k=`${$}--${t}`,I=`${$}--${d}`,u=`${$}--radius-${l}`,w=`${$}--${y}`,i=t==="gradient"?`${$}--gradient-${a}`:"",h=[$,k,I,u,w,i,c].filter(Boolean).join(" ");let m;if(t==="initials"){const g=n||is(s);m=r.jsx("span",{className:`${$}__initials`,children:g})}else t==="icon"?m=e||r.jsx(os,{}):m=null;return r.jsx("div",{className:h,role:"img","aria-label":j,"data-theme":y,children:m})},cs=({count:t=3,theme:e="light",className:s="",ariaLabel:n="Loading media items"})=>{const a="uiforge-media-list-skeleton",d=`${a}--${e}`,l=[a,d,s].filter(Boolean).join(" "),c=Array.from({length:t},(j,y)=>y);return r.jsx("div",{className:l,"data-theme":e,role:"status","aria-label":n,children:c.map(j=>r.jsxs("div",{className:`${a}__item`,children:[r.jsx("div",{className:`${a}__media`,children:r.jsx("div",{className:`${a}__shimmer`})}),r.jsxs("div",{className:`${a}__content`,children:[r.jsxs("div",{className:`${a}__body`,children:[r.jsx("div",{className:`${a}__line ${a}__line--title`,children:r.jsx("div",{className:`${a}__shimmer`})}),r.jsx("div",{className:`${a}__line ${a}__line--subtitle`,children:r.jsx("div",{className:`${a}__shimmer`})}),r.jsxs("div",{className:`${a}__meta`,children:[r.jsx("div",{className:`${a}__line ${a}__line--meta`,children:r.jsx("div",{className:`${a}__shimmer`})}),r.jsx("div",{className:`${a}__line ${a}__line--meta`,children:r.jsx("div",{className:`${a}__shimmer`})})]})]}),r.jsxs("div",{className:`${a}__footer`,children:[r.jsx("div",{className:`${a}__line ${a}__line--action`,children:r.jsx("div",{className:`${a}__shimmer`})}),r.jsx("div",{className:`${a}__line ${a}__line--action`,children:r.jsx("div",{className:`${a}__shimmer`})})]})]})]},j))})};function ds(t,e){const{sampleCount:s=3,min:n=3,max:a=15,approxItemHeight:d=120}=e??{},[l,c]=o.useState(n),j=o.useRef(n),y=o.useCallback(()=>{const $=t?.current;if(!$)return n;const k=$.clientHeight;if(k===0)return n;const I=Array.from($.children).filter(h=>h instanceof HTMLElement&&h.offsetHeight>0);let u=d;if(I.length>0){const h=Math.min(s,I.length);let m=0;for(let g=0;g<h;g++)m+=I[g].offsetHeight;u=m/h}const w=Math.floor(k/u);return Math.max(n,Math.min(a,w))},[t,s,n,a,d]);return o.useEffect(()=>{const $=t?.current;if(!$)return;const k=()=>{const w=y();w!==j.current&&(j.current=w,c(w))};k();let I;typeof ResizeObserver<"u"&&(I=new ResizeObserver(()=>{k()}),I.observe($));let u;return typeof MutationObserver<"u"&&(u=new MutationObserver(()=>{k()}),u.observe($,{childList:!0,subtree:!1})),()=>{I?.disconnect(),u?.disconnect()}},[t,y]),l}function us(t){const{src:e,alt:s,srcSet:n,sizes:a,loading:d="lazy",decoding:l="async",aspectRatio:c,width:j,height:y,className:$,style:k={}}=t,I={src:e,alt:s,loading:d,decoding:l,className:$,style:{...k,...c?{width:"100%",height:"100%",objectFit:"cover"}:{}}};n&&(I.srcSet=n),a&&(I.sizes=a),j&&(I.width=j),y&&(I.height=y);let u;return c&&(u={style:{position:"relative",width:"100%",aspectRatio:c,overflow:"hidden"},className:"optimized-image-container"},I.style={...I.style,position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"}),{imgProps:I,containerProps:u}}exports.ActivityIcons=pe;exports.ActivityItemProvider=Dt;exports.AlienIcon=xt;exports.BriefcaseIcon=$t;exports.BugIcon=ft;exports.BuildIcon=Lt;exports.BusinessIcons=ur;exports.Button=Rt;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=St;exports.DevProcessIcons=hr;exports.DocumentIcon=_t;exports.DumbbellIcon=it;exports.FitnessIcons=lr;exports.FoldIcon=et;exports.ForkIcon=Ge;exports.GitBranchIcon=Ct;exports.HamburgerButton=zt;exports.HeartRateIcon=lt;exports.IconButton=Ut;exports.IssueIcon=qe;exports.MediaCard=as;exports.MediaListSkeleton=cs;exports.MediaPlaceholder=ls;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=Ot;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=Nt;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=ds;exports.useOptimizedImage=us;exports.useResponsive=At;exports.videoProviders=Ae;