@appforgeapps/uiforge 0.5.0 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/uiforge.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),ft=({variant:e="primary",size:t="medium",children:s,className:n="",...a})=>{const f="uiforge-button",m=`${f}--${e}`,x=`${f}--${t}`,j=`${f} ${m} ${x} ${n}`.trim();return r.jsx("button",{className:j,...a,children:s})},xt=({columns:e,data:t,selectable:s=!1,selectedRows:n,getRowKey:a=(G,Z)=>Z,onSelectionChange:f,onCellEdit:m,actionButtons:x=[],searchable:j=!1,searchPlaceholder:W="Search...",onSearch:A,customFilter:F,pagination:h,onPageChange:E,onPageSizeChange:M,pageSizeOptions:q=[10,25,50,100],className:B="",loading:L=!1,emptyMessage:R="No data available"})=>{const[G,Z]=i.useState(new Set),[I,U]=i.useState(""),[k,O]=i.useState(null),[P,c]=i.useState(""),v=n??G,d=i.useMemo(()=>!j||!I?t:t.filter(o=>F?F(o,I):Object.values(o).some(_=>_==null?!1:String(_).toLowerCase().includes(I.toLowerCase()))),[t,I,j,F]),b=i.useMemo(()=>{if(!h||h.serverSide)return d;const o=h.currentPage*h.pageSize,_=o+h.pageSize;return d.slice(o,_)},[d,h]),H=i.useMemo(()=>h?h.serverSide&&h.totalItems!==void 0?Math.ceil(h.totalItems/h.pageSize):Math.ceil(d.length/h.pageSize):1,[h,d.length]),D=i.useCallback(()=>t.filter((o,_)=>{const w=a(o,_);return v.has(w)}),[t,v,a]),X=i.useCallback(o=>{const _=new Set;o&&b.forEach(w=>{const $=t.indexOf(w),se=a(w,$);_.add(se)}),n===void 0&&Z(_),f?.(_,o?b:[])},[b,t,a,f,n]),ee=i.useCallback((o,_,w)=>{const $=new Set(v);w?$.add(o):$.delete(o),n===void 0&&Z($);const se=t.filter((N,oe)=>{const ie=a(N,oe);return $.has(ie)});f?.($,se)},[v,t,a,f,n]),J=i.useCallback(o=>{U(o),A?.(o)},[A]),z=i.useCallback((o,_,w)=>{O({rowKey:o,columnKey:_}),c(w)},[]),te=i.useCallback((o,_,w)=>{m?.(o,_,P,w),O(null),c("")},[P,m]),l=i.useCallback(()=>{O(null),c("")},[]),S=i.useCallback(o=>{h&&E?.(o,h.pageSize)},[h,E]),p=i.useCallback(o=>{M?.(o),h&&E?.(0,o)},[M,E,h]),C=i.useMemo(()=>b.length===0?!1:b.every(o=>{const _=t.indexOf(o),w=a(o,_);return v.has(w)}),[b,v,t,a]),K=i.useMemo(()=>b.length===0?!1:b.some(_=>{const w=t.indexOf(_),$=a(_,w);return v.has($)})&&!C,[b,v,C,t,a]),g="uiforge-grid";return r.jsxs("div",{className:`${g} ${B}`.trim(),children:[(j||x.length>0)&&r.jsxs("div",{className:`${g}__toolbar`,children:[j&&r.jsx("div",{className:`${g}__search`,children:r.jsx("input",{type:"text",className:`${g}__search-input`,placeholder:W,value:I,onChange:o=>J(o.target.value),"aria-label":"Search"})}),x.length>0&&r.jsx("div",{className:`${g}__actions`,children:x.map((o,_)=>{const w=o.disabled||o.requiresSelection&&v.size===0;return r.jsx("button",{className:`${g}__action-button ${g}__action-button--${o.variant||"primary"}`,onClick:()=>o.onClick(D()),disabled:w,children:o.label},_)})})]}),r.jsx("div",{className:`${g}__table-container`,children:r.jsxs("table",{className:`${g}__table`,role:"table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[s&&r.jsx("th",{className:`${g}__header-cell ${g}__header-cell--checkbox`,children:r.jsx("input",{type:"checkbox",checked:C,ref:o=>{o&&(o.indeterminate=K)},onChange:o=>X(o.target.checked),"aria-label":"Select all rows"})}),e.map(o=>r.jsx("th",{className:`${g}__header-cell`,style:{width:o.width},children:o.header},o.key))]})}),r.jsx("tbody",{children:L?r.jsx("tr",{children:r.jsx("td",{colSpan:e.length+(s?1:0),className:`${g}__loading-cell`,children:"Loading..."})}):b.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:e.length+(s?1:0),className:`${g}__empty-cell`,children:R})}):b.map((o,_)=>{const w=t.indexOf(o),$=a(o,w),se=v.has($);return r.jsxs("tr",{className:`${g}__row ${se?`${g}__row--selected`:""}`,children:[s&&r.jsx("td",{className:`${g}__cell ${g}__cell--checkbox`,children:r.jsx("input",{type:"checkbox",checked:se,onChange:N=>ee($,o,N.target.checked),"aria-label":`Select row ${_+1}`})}),e.map(N=>{const oe=N.field?o[N.field]:void 0,ie=k?.rowKey===$&&k?.columnKey===N.key;return r.jsx("td",{className:`${g}__cell`,children:ie?r.jsxs("div",{className:`${g}__edit-cell`,children:[r.jsx("input",{type:"text",className:`${g}__edit-input`,value:String(P??""),onChange:ne=>c(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"?te($,N.key,o):ne.key==="Escape"&&l()},autoFocus:!0,"aria-label":`Edit ${N.header}`}),r.jsx("button",{className:`${g}__edit-button ${g}__edit-button--save`,onClick:()=>te($,N.key,o),"aria-label":"Save",children:"✓"}),r.jsx("button",{className:`${g}__edit-button ${g}__edit-button--cancel`,onClick:l,"aria-label":"Cancel",children:"✕"})]}):r.jsx("div",{className:`${g}__cell-content ${N.editable?`${g}__cell-content--editable`:""}`,onClick:()=>{N.editable&&z($,N.key,oe)},onKeyDown:ne=>{N.editable&&(ne.key==="Enter"||ne.key===" ")&&z($,N.key,oe)},tabIndex:N.editable?0:void 0,role:N.editable?"button":void 0,"aria-label":N.editable?`Edit ${N.header}`:void 0,children:N.render?N.render(oe,o,w):String(oe??"")})},N.key)})]},$)})})]})}),h&&H>1&&r.jsxs("div",{className:`${g}__pagination`,children:[r.jsx("div",{className:`${g}__pagination-info`,children:h.serverSide&&h.totalItems!==void 0?r.jsxs(r.Fragment,{children:["Showing ",h.currentPage*h.pageSize+1," to"," ",Math.min((h.currentPage+1)*h.pageSize,h.totalItems)," ","of ",h.totalItems," items"]}):r.jsxs(r.Fragment,{children:["Showing ",h.currentPage*h.pageSize+1," to"," ",Math.min((h.currentPage+1)*h.pageSize,d.length)," ","of ",d.length," items"]})}),r.jsxs("div",{className:`${g}__pagination-controls`,children:[r.jsx("button",{className:`${g}__pagination-button`,onClick:()=>S(h.currentPage-1),disabled:h.currentPage===0,"aria-label":"Previous page",children:"‹"}),Array.from({length:H},(o,_)=>_).map(o=>o===0||o===H-1||Math.abs(o-h.currentPage)<=1?r.jsx("button",{className:`${g}__pagination-button ${o===h.currentPage?`${g}__pagination-button--active`:""}`,onClick:()=>S(o),"aria-label":`Page ${o+1}`,"aria-current":o===h.currentPage?"page":void 0,children:o+1},o):o===h.currentPage-2||o===h.currentPage+2?r.jsx("span",{className:`${g}__pagination-ellipsis`,children:"..."},o):null),r.jsx("button",{className:`${g}__pagination-button`,onClick:()=>S(h.currentPage+1),disabled:h.currentPage>=H-1,"aria-label":"Next page",children:"›"})]}),r.jsxs("div",{className:`${g}__page-size`,children:[r.jsx("label",{htmlFor:"page-size-select",children:"Items per page:"}),r.jsx("select",{id:"page-size-select",className:`${g}__page-size-select`,value:h.pageSize,onChange:o=>p(Number(o.target.value)),children:q.map(o=>r.jsx("option",{value:o,children:o},o))})]})]})]})},gt=()=>`block-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,ue=(e="paragraph")=>({id:gt(),type:e,content:"",format:{}}),vt=({initialBlocks:e=[],onChange:t,placeholder:s="Start typing...",readOnly:n=!1,className:a="",maxHeight:f})=>{const[m,x]=i.useState(e.length>0?e:[ue()]),[j,W]=i.useState(null),[A,F]=i.useState(null),[h,E]=i.useState(!1),M=i.useRef(null);i.useEffect(()=>{t&&t(m)},[m,t]);const q=i.useCallback((c,v)=>{x(d=>d.map(b=>b.id===c?{...b,...v}:b))},[]),B=i.useCallback((c="paragraph",v)=>{const d=ue(c);x(b=>{if(!v)return[...b,d];const H=b.findIndex(X=>X.id===v),D=[...b];return D.splice(H+1,0,d),D}),W(d.id)},[]),L=i.useCallback(c=>{x(v=>{const d=v.filter(b=>b.id!==c);return d.length>0?d:[ue()]})},[]),R=i.useCallback((c,v)=>{x(d=>{const b=d.findIndex(ee=>ee.id===c),H=d.findIndex(ee=>ee.id===v);if(b===-1||H===-1)return d;const D=[...d],[X]=D.splice(b,1);return D.splice(H,0,X),D})},[]),G=i.useCallback((c,v)=>{n||(F(v),c.dataTransfer.effectAllowed="move")},[n]),Z=i.useCallback(c=>{c.preventDefault(),c.dataTransfer.dropEffect="move"},[]),I=i.useCallback((c,v)=>{c.preventDefault(),A&&A!==v&&R(A,v),F(null)},[A,R]),U=i.useCallback(()=>{F(null)},[]),k=i.useCallback(c=>{j&&x(v=>v.map(d=>{if(d.id===j){const b=d.format||{};return{...d,format:{...b,[c]:!b[c]}}}return d}))},[j]),O=i.useCallback((c,v)=>{q(c,{type:v})},[q]),P=i.useCallback((c,v)=>{if(!n){if((c.metaKey||c.ctrlKey)&&c.key==="b")c.preventDefault(),k("bold");else if((c.metaKey||c.ctrlKey)&&c.key==="i")c.preventDefault(),k("italic");else if((c.metaKey||c.ctrlKey)&&c.key==="u")c.preventDefault(),k("underline");else if(c.key==="Enter"&&!c.shiftKey){const d=m.find(b=>b.id===v);d&&d.type!=="code"&&(c.preventDefault(),B("paragraph",v))}else if(c.key==="Backspace"){const d=m.find(b=>b.id===v);d&&!d.content&&m.length>1&&(c.preventDefault(),L(v))}}},[n,m,k,B,L]);return r.jsxs("div",{className:`uiforge-blocks-editor ${a}`,ref:M,style:{maxHeight:f},children:[!n&&h&&j&&r.jsx(bt,{selectedBlock:m.find(c=>c.id===j),onFormatToggle:k,onBlockTypeChange:c=>O(j,c)}),r.jsx("div",{className:"uiforge-blocks-editor__content",children:m.map((c,v)=>r.jsx(yt,{block:c,isSelected:j===c.id,isDragging:A===c.id,readOnly:n,placeholder:v===0&&m.length===1?s:void 0,onSelect:()=>{W(c.id),E(!0)},onChange:d=>q(c.id,d),onDelete:()=>L(c.id),onDragStart:d=>G(d,c.id),onDragOver:Z,onDrop:d=>I(d,c.id),onDragEnd:U,onKeyDown:d=>P(d,c.id)},c.id))}),!n&&r.jsx(wt,{onAddBlock:B})]})},bt=({selectedBlock:e,onFormatToggle:t,onBlockTypeChange:s})=>{if(!e)return null;const n=e.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:e.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:()=>t("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:()=>t("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:()=>t("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:()=>t("code"),title:"Inline Code","aria-label":"Code","aria-pressed":n.code,children:"</>"})]})]})},yt=({block:e,isSelected:t,isDragging:s,readOnly:n,placeholder:a,onSelect:f,onChange:m,onDelete:x,onDragStart:j,onDragOver:W,onDrop:A,onDragEnd:F,onKeyDown:h})=>{const E=["uiforge-blocks-editor__block",`uiforge-blocks-editor__block--${e.type}`,t?"uiforge-blocks-editor__block--selected":"",s?"uiforge-blocks-editor__block--dragging":""].filter(Boolean).join(" "),M=["uiforge-blocks-editor__block-text",e.format?.bold?"uiforge-blocks-editor__block-text--bold":"",e.format?.italic?"uiforge-blocks-editor__block-text--italic":"",e.format?.underline?"uiforge-blocks-editor__block-text--underline":"",e.format?.code?"uiforge-blocks-editor__block-text--code":""].filter(Boolean).join(" "),q=L=>{m({content:L.target.value})},B=()=>{const L={value:e.content,onChange:q,onFocus:f,onKeyDown:h,placeholder:a,readOnly:n,className:M};switch(e.type){case"heading1":return r.jsx("input",{...L,type:"text",className:`${M} uiforge-blocks-editor__heading1`,placeholder:a||"Heading 1"});case"heading2":return r.jsx("input",{...L,type:"text",className:`${M} uiforge-blocks-editor__heading2`,placeholder:a||"Heading 2"});case"heading3":return r.jsx("input",{...L,type:"text",className:`${M} uiforge-blocks-editor__heading3`,placeholder:a||"Heading 3"});case"code":return r.jsx("textarea",{...L,className:`${M} uiforge-blocks-editor__code`,placeholder:a||"Code block",rows:4});case"quote":return r.jsx("textarea",{...L,className:`${M} 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:e.imageUrl||"",onChange:R=>m({imageUrl:R.target.value}),placeholder:"Image URL",className:"uiforge-blocks-editor__image-url",readOnly:n}),r.jsx("input",{type:"text",value:e.imageAlt||"",onChange:R=>m({imageAlt:R.target.value}),placeholder:"Alt text",className:"uiforge-blocks-editor__image-alt",readOnly:n}),e.imageUrl&&r.jsx("img",{src:e.imageUrl,alt:e.imageAlt||"Block image",className:"uiforge-blocks-editor__image-preview"})]});default:return r.jsx("textarea",{...L,className:`${M} uiforge-blocks-editor__paragraph`,placeholder:a||"Start typing...",rows:1,style:{minHeight:"1.5em"}})}};return r.jsxs("div",{className:E,draggable:!n,onDragStart:j,onDragOver:W,onDrop:A,onDragEnd:F,"data-block-id":e.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:x,title:"Delete block","aria-label":"Delete block",children:"×"})]}),r.jsx("div",{className:"uiforge-blocks-editor__block-content",children:B()})]})},wt=({onAddBlock:e})=>{const[t,s]=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 r.jsxs("div",{className:"uiforge-blocks-editor__block-menu",children:[r.jsx("button",{type:"button",className:"uiforge-blocks-editor__add-button",onClick:()=>s(!t),"aria-label":"Add block","aria-expanded":t,children:"+ Add Block"}),t&&r.jsx("div",{className:"uiforge-blocks-editor__block-menu-dropdown",children:n.map(({type:a,label:f,icon:m})=>r.jsxs("button",{type:"button",className:"uiforge-blocks-editor__block-menu-item",onClick:()=>{e(a),s(!1)},children:[r.jsx("span",{className:"uiforge-blocks-editor__block-menu-icon",children:m}),r.jsx("span",{children:f})]},a))})]})};function he(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function jt(e){const t=e.trim(),s=["javascript:","data:","vbscript:","file:"],n=t.toLowerCase();for(const a of s)if(n.startsWith(a))return"";return t}function _t(e){return e.map(t=>{let s=he(t.content);switch(t.format?.bold&&(s=`<strong>${s}</strong>`),t.format?.italic&&(s=`<em>${s}</em>`),t.format?.underline&&(s=`<u>${s}</u>`),t.format?.code&&(s=`<code>${s}</code>`),t.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>${he(t.content)}</code></pre>`;case"image":{const n=jt(t.imageUrl||""),a=he(t.imageAlt||"");return n?`<img src="${n}" alt="${a}" />`:""}case"list":return`<ul><li>${s}</li></ul>`;default:return`<p>${s}</p>`}}).join(`
2
- `)}function It(e){return e.map(t=>{let s=t.content;switch(t.format?.bold&&(s=`**${s}**`),t.format?.italic&&(s=`*${s}*`),t.format?.code&&(s=`\`${s}\``),t.type){case"heading1":return`# ${s}`;case"heading2":return`## ${s}`;case"heading3":return`### ${s}`;case"quote":return`> ${s}`;case"code":return`\`\`\`
3
- ${t.content}
4
- \`\`\``;case"image":return`![${t.imageAlt||""}](${t.imageUrl||""})`;case"list":return`- ${s}`;default:return s}}).join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),Ot=({variant:t="primary",size:e="medium",theme:r="light",density:n="default",children:a,className:d="",...l})=>{const c="uiforge-button",_=`${c}--${t}`,w=`${c}--${e}`,L=`${c}--${r}`,A=n==="condensed"?`${c}--condensed`:"",S=[c,_,w,L,A,d].filter(Boolean).join(" ");return s.jsx("button",{className:S,"data-theme":r,...l,children:a})},Ut=({isOpen:t,controlsId:e,ariaLabel:r="Toggle menu",className:n="",size:a="medium",...d})=>{const l="uiforge-hamburger-button",c=[l,`${l}--${a}`,t&&`${l}--open`,n].filter(Boolean).join(" ");return s.jsxs("button",{type:"button",className:c,"aria-expanded":t,"aria-controls":e,"aria-label":r,...d,children:[s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"})]})},zt=({icon:t,size:e="medium",ariaLabel:r,badge:n,className:a="",disabled:d,...l})=>{const c="uiforge-icon-button",_=[c,`${c}--${e}`,a].filter(Boolean).join(" ");return s.jsxs("button",{type:"button",className:_,"aria-label":r,disabled:d,...l,children:[s.jsx("span",{className:`${c}__icon`,"aria-hidden":"true",children:t}),n!==void 0&&s.jsx("span",{className:`${c}__badge`,"aria-hidden":"true",children:n})]})},Vt=({columns:t,data:e,theme:r="light",selectable:n=!1,selectedRows:a,getRowKey:d=(P,$)=>$,onSelectionChange:l,onCellEdit:c,actionButtons:_=[],searchable:w=!1,searchPlaceholder:L="Search...",onSearch:A,customFilter:S,pagination:u,onPageChange:C,onPageSizeChange:o,pageSizeOptions:h=[10,25,50,100],className:f="",loading:b=!1,emptyMessage:k="No data available"})=>{const[P,$]=i.useState(new Set),[j,E]=i.useState(""),[D,N]=i.useState(null),[z,B]=i.useState(""),v=a??P,m=i.useMemo(()=>!w||!j?e:e.filter(g=>S?S(g,j):Object.values(g).some(V=>V==null?!1:String(V).toLowerCase().includes(j.toLowerCase()))),[e,j,w,S]),y=i.useMemo(()=>{if(!u||u.serverSide)return m;const g=u.currentPage*u.pageSize,V=g+u.pageSize;return m.slice(g,V)},[m,u]),I=i.useMemo(()=>u?u.serverSide&&u.totalItems!==void 0?Math.ceil(u.totalItems/u.pageSize):Math.ceil(m.length/u.pageSize):1,[u,m.length]),te=i.useCallback(()=>e.filter((g,V)=>{const W=d(g,V);return v.has(W)}),[e,v,d]),Y=i.useCallback(g=>{const V=new Set;g&&y.forEach(W=>{const K=e.indexOf(W),ae=d(W,K);V.add(ae)}),a===void 0&&$(V),l?.(V,g?y:[])},[y,e,d,l,a]),re=i.useCallback((g,V,W)=>{const K=new Set(v);W?K.add(g):K.delete(g),a===void 0&&$(K);const ae=e.filter((q,de)=>{const he=d(q,de);return K.has(he)});l?.(K,ae)},[v,e,d,l,a]),X=i.useCallback(g=>{E(g),A?.(g)},[A]),ne=i.useCallback((g,V,W)=>{N({rowKey:g,columnKey:V}),B(W)},[]),se=i.useCallback((g,V,W)=>{c?.(g,V,z,W),N(null),B("")},[z,c]),T=i.useCallback(()=>{N(null),B("")},[]),oe=i.useCallback(g=>{u&&C?.(g,u.pageSize)},[u,C]),Z=i.useCallback(g=>{o?.(g),u&&C?.(0,g)},[o,C,u]),ee=i.useMemo(()=>y.length===0?!1:y.every(g=>{const V=e.indexOf(g),W=d(g,V);return v.has(W)}),[y,v,e,d]),le=i.useMemo(()=>y.length===0?!1:y.some(V=>{const W=e.indexOf(V),K=d(V,W);return v.has(K)})&&!ee,[y,v,ee,e,d]),M="uiforge-grid",F=`${M}--${r}`;return s.jsxs("div",{className:`${M} ${F} ${f}`.trim(),"data-theme":r,children:[(w||_.length>0)&&s.jsxs("div",{className:`${M}__toolbar`,children:[w&&s.jsx("div",{className:`${M}__search`,children:s.jsx("input",{type:"text",className:`${M}__search-input`,placeholder:L,value:j,onChange:g=>X(g.target.value),"aria-label":"Search"})}),_.length>0&&s.jsx("div",{className:`${M}__actions`,children:_.map((g,V)=>{const W=g.disabled||g.requiresSelection&&v.size===0;return s.jsx("button",{className:`${M}__action-button ${M}__action-button--${g.variant||"primary"}`,onClick:()=>g.onClick(te()),disabled:W,children:g.label},V)})})]}),s.jsx("div",{className:`${M}__table-container`,children:s.jsxs("table",{className:`${M}__table`,role:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[n&&s.jsx("th",{className:`${M}__header-cell ${M}__header-cell--checkbox`,children:s.jsx("input",{type:"checkbox",checked:ee,ref:g=>{g&&(g.indeterminate=le)},onChange:g=>Y(g.target.checked),"aria-label":"Select all rows"})}),t.map(g=>s.jsx("th",{className:`${M}__header-cell`,style:{width:g.width},children:g.header},g.key))]})}),s.jsx("tbody",{children:b?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length+(n?1:0),className:`${M}__loading-cell`,children:"Loading..."})}):y.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length+(n?1:0),className:`${M}__empty-cell`,children:k})}):y.map((g,V)=>{const W=e.indexOf(g),K=d(g,W),ae=v.has(K);return s.jsxs("tr",{className:`${M}__row ${ae?`${M}__row--selected`:""}`,children:[n&&s.jsx("td",{className:`${M}__cell ${M}__cell--checkbox`,children:s.jsx("input",{type:"checkbox",checked:ae,onChange:q=>re(K,g,q.target.checked),"aria-label":`Select row ${V+1}`})}),t.map(q=>{const de=q.field?g[q.field]:void 0,he=D?.rowKey===K&&D?.columnKey===q.key;return s.jsx("td",{className:`${M}__cell`,children:he?s.jsxs("div",{className:`${M}__edit-cell`,children:[s.jsx("input",{type:"text",className:`${M}__edit-input`,value:String(z??""),onChange:ie=>B(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"?se(K,q.key,g):ie.key==="Escape"&&T()},autoFocus:!0,"aria-label":`Edit ${q.header}`}),s.jsx("button",{className:`${M}__edit-button ${M}__edit-button--save`,onClick:()=>se(K,q.key,g),"aria-label":"Save",children:"✓"}),s.jsx("button",{className:`${M}__edit-button ${M}__edit-button--cancel`,onClick:T,"aria-label":"Cancel",children:"✕"})]}):s.jsx("div",{className:`${M}__cell-content ${q.editable?`${M}__cell-content--editable`:""}`,onClick:()=>{q.editable&&ne(K,q.key,de)},onKeyDown:ie=>{q.editable&&(ie.key==="Enter"||ie.key===" ")&&ne(K,q.key,de)},tabIndex:q.editable?0:void 0,role:q.editable?"button":void 0,"aria-label":q.editable?`Edit ${q.header}`:void 0,children:q.render?q.render(de,g,W):String(de??"")})},q.key)})]},K)})})]})}),u&&I>1&&s.jsxs("div",{className:`${M}__pagination`,children:[s.jsx("div",{className:`${M}__pagination-info`,children:u.serverSide&&u.totalItems!==void 0?s.jsxs(s.Fragment,{children:["Showing ",u.currentPage*u.pageSize+1," to"," ",Math.min((u.currentPage+1)*u.pageSize,u.totalItems)," ","of ",u.totalItems," items"]}):s.jsxs(s.Fragment,{children:["Showing ",u.currentPage*u.pageSize+1," to"," ",Math.min((u.currentPage+1)*u.pageSize,m.length)," ","of ",m.length," items"]})}),s.jsxs("div",{className:`${M}__pagination-controls`,children:[s.jsx("button",{className:`${M}__pagination-button`,onClick:()=>oe(u.currentPage-1),disabled:u.currentPage===0,"aria-label":"Previous page",children:"‹"}),Array.from({length:I},(g,V)=>V).map(g=>g===0||g===I-1||Math.abs(g-u.currentPage)<=1?s.jsx("button",{className:`${M}__pagination-button ${g===u.currentPage?`${M}__pagination-button--active`:""}`,onClick:()=>oe(g),"aria-label":`Page ${g+1}`,"aria-current":g===u.currentPage?"page":void 0,children:g+1},g):g===u.currentPage-2||g===u.currentPage+2?s.jsx("span",{className:`${M}__pagination-ellipsis`,children:"..."},g):null),s.jsx("button",{className:`${M}__pagination-button`,onClick:()=>oe(u.currentPage+1),disabled:u.currentPage>=I-1,"aria-label":"Next page",children:"›"})]}),s.jsxs("div",{className:`${M}__page-size`,children:[s.jsx("label",{htmlFor:"page-size-select",children:"Items per page:"}),s.jsx("select",{id:"page-size-select",className:`${M}__page-size-select`,value:u.pageSize,onChange:g=>Z(Number(g.target.value)),children:h.map(g=>s.jsx("option",{value:g,children:g},g))})]})]})]})},Bt=()=>`block-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,_e=(t="paragraph")=>({id:Bt(),type:t,content:"",format:{}}),Tt=({initialBlocks:t=[],onChange:e,placeholder:r="Start typing...",readOnly:n=!1,theme:a="light",className:d="",maxHeight:l})=>{const[c,_]=i.useState(t.length>0?t:[_e()]),[w,L]=i.useState(null),[A,S]=i.useState(null),[u,C]=i.useState(!1),o=i.useRef(null);i.useEffect(()=>{e&&e(c)},[c,e]);const h=i.useCallback((v,m)=>{_(y=>y.map(I=>I.id===v?{...I,...m}:I))},[]),f=i.useCallback((v="paragraph",m)=>{const y=_e(v);_(I=>{if(!m)return[...I,y];const te=I.findIndex(re=>re.id===m),Y=[...I];return Y.splice(te+1,0,y),Y}),L(y.id)},[]),b=i.useCallback(v=>{_(m=>{const y=m.filter(I=>I.id!==v);return y.length>0?y:[_e()]})},[]),k=i.useCallback((v,m)=>{_(y=>{const I=y.findIndex(X=>X.id===v),te=y.findIndex(X=>X.id===m);if(I===-1||te===-1)return y;const Y=[...y],[re]=Y.splice(I,1);return Y.splice(te,0,re),Y})},[]),P=i.useCallback((v,m)=>{n||(S(m),v.dataTransfer.effectAllowed="move")},[n]),$=i.useCallback(v=>{v.preventDefault(),v.dataTransfer.dropEffect="move"},[]),j=i.useCallback((v,m)=>{v.preventDefault(),A&&A!==m&&k(A,m),S(null)},[A,k]),E=i.useCallback(()=>{S(null)},[]),D=i.useCallback(v=>{w&&_(m=>m.map(y=>{if(y.id===w){const I=y.format||{};return{...y,format:{...I,[v]:!I[v]}}}return y}))},[w]),N=i.useCallback((v,m)=>{h(v,{type:m})},[h]),z=i.useCallback((v,m)=>{if(!n){if((v.metaKey||v.ctrlKey)&&v.key==="b")v.preventDefault(),D("bold");else if((v.metaKey||v.ctrlKey)&&v.key==="i")v.preventDefault(),D("italic");else if((v.metaKey||v.ctrlKey)&&v.key==="u")v.preventDefault(),D("underline");else if(v.key==="Enter"&&!v.shiftKey){const y=c.find(I=>I.id===m);y&&y.type!=="code"&&(v.preventDefault(),f("paragraph",m))}else if(v.key==="Backspace"){const y=c.find(I=>I.id===m);y&&!y.content&&c.length>1&&(v.preventDefault(),b(m))}}},[n,c,D,f,b]),B=`uiforge-blocks-editor--${a}`;return s.jsxs("div",{className:`uiforge-blocks-editor ${B} ${d}`,ref:o,style:{maxHeight:l},"data-theme":a,children:[!n&&u&&w&&s.jsx(Ht,{selectedBlock:c.find(v=>v.id===w),onFormatToggle:D,onBlockTypeChange:v=>N(w,v)}),s.jsx("div",{className:"uiforge-blocks-editor__content",children:c.map((v,m)=>s.jsx(Wt,{block:v,isSelected:w===v.id,isDragging:A===v.id,readOnly:n,placeholder:m===0&&c.length===1?r:void 0,onSelect:()=>{L(v.id),C(!0)},onChange:y=>h(v.id,y),onDelete:()=>b(v.id),onDragStart:y=>P(y,v.id),onDragOver:$,onDrop:y=>j(y,v.id),onDragEnd:E,onKeyDown:y=>z(y,v.id)},v.id))}),!n&&s.jsx(Ft,{onAddBlock:f})]})},Ht=({selectedBlock:t,onFormatToggle:e,onBlockTypeChange:r})=>{if(!t)return null;const n=t.format||{};return s.jsxs("div",{className:"uiforge-blocks-editor__toolbar",role:"toolbar","aria-label":"Text formatting",children:[s.jsx("div",{className:"uiforge-blocks-editor__toolbar-group",children:s.jsxs("select",{value:t.type,onChange:a=>r(a.target.value),className:"uiforge-blocks-editor__toolbar-select","aria-label":"Block type",children:[s.jsx("option",{value:"paragraph",children:"Paragraph"}),s.jsx("option",{value:"heading1",children:"Heading 1"}),s.jsx("option",{value:"heading2",children:"Heading 2"}),s.jsx("option",{value:"heading3",children:"Heading 3"}),s.jsx("option",{value:"list",children:"List"}),s.jsx("option",{value:"quote",children:"Quote"}),s.jsx("option",{value:"code",children:"Code"}),s.jsx("option",{value:"image",children:"Image"})]})}),s.jsx("div",{className:"uiforge-blocks-editor__toolbar-divider"}),s.jsxs("div",{className:"uiforge-blocks-editor__toolbar-group",children:[s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.bold?"active":""}`,onClick:()=>e("bold"),title:"Bold (Ctrl+B)","aria-label":"Bold","aria-pressed":n.bold,children:s.jsx("strong",{children:"B"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.italic?"active":""}`,onClick:()=>e("italic"),title:"Italic (Ctrl+I)","aria-label":"Italic","aria-pressed":n.italic,children:s.jsx("em",{children:"I"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.underline?"active":""}`,onClick:()=>e("underline"),title:"Underline (Ctrl+U)","aria-label":"Underline","aria-pressed":n.underline,children:s.jsx("u",{children:"U"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.code?"active":""}`,onClick:()=>e("code"),title:"Inline Code","aria-label":"Code","aria-pressed":n.code,children:"</>"})]})]})},Wt=({block:t,isSelected:e,isDragging:r,readOnly:n,placeholder:a,onSelect:d,onChange:l,onDelete:c,onDragStart:_,onDragOver:w,onDrop:L,onDragEnd:A,onKeyDown:S})=>{const u=["uiforge-blocks-editor__block",`uiforge-blocks-editor__block--${t.type}`,e?"uiforge-blocks-editor__block--selected":"",r?"uiforge-blocks-editor__block--dragging":""].filter(Boolean).join(" "),C=["uiforge-blocks-editor__block-text",t.format?.bold?"uiforge-blocks-editor__block-text--bold":"",t.format?.italic?"uiforge-blocks-editor__block-text--italic":"",t.format?.underline?"uiforge-blocks-editor__block-text--underline":"",t.format?.code?"uiforge-blocks-editor__block-text--code":""].filter(Boolean).join(" "),o=f=>{l({content:f.target.value})},h=()=>{const f={value:t.content,onChange:o,onFocus:d,onKeyDown:S,placeholder:a,readOnly:n,className:C};switch(t.type){case"heading1":return s.jsx("input",{...f,type:"text",className:`${C} uiforge-blocks-editor__heading1`,placeholder:a||"Heading 1"});case"heading2":return s.jsx("input",{...f,type:"text",className:`${C} uiforge-blocks-editor__heading2`,placeholder:a||"Heading 2"});case"heading3":return s.jsx("input",{...f,type:"text",className:`${C} uiforge-blocks-editor__heading3`,placeholder:a||"Heading 3"});case"code":return s.jsx("textarea",{...f,className:`${C} uiforge-blocks-editor__code`,placeholder:a||"Code block",rows:4});case"quote":return s.jsx("textarea",{...f,className:`${C} uiforge-blocks-editor__quote`,placeholder:a||"Quote",rows:2});case"image":return s.jsxs("div",{className:"uiforge-blocks-editor__image-block",children:[s.jsx("input",{type:"text",value:t.imageUrl||"",onChange:b=>l({imageUrl:b.target.value}),placeholder:"Image URL",className:"uiforge-blocks-editor__image-url",readOnly:n}),s.jsx("input",{type:"text",value:t.imageAlt||"",onChange:b=>l({imageAlt:b.target.value}),placeholder:"Alt text",className:"uiforge-blocks-editor__image-alt",readOnly:n}),t.imageUrl&&s.jsx("img",{src:t.imageUrl,alt:t.imageAlt||"Block image",className:"uiforge-blocks-editor__image-preview"})]});default:return s.jsx("textarea",{...f,className:`${C} uiforge-blocks-editor__paragraph`,placeholder:a||"Start typing...",rows:1,style:{minHeight:"1.5em"}})}};return s.jsxs("div",{className:u,draggable:!n,onDragStart:_,onDragOver:w,onDrop:L,onDragEnd:A,"data-block-id":t.id,children:[!n&&s.jsxs("div",{className:"uiforge-blocks-editor__block-controls",children:[s.jsx("button",{type:"button",className:"uiforge-blocks-editor__drag-handle",title:"Drag to reorder","aria-label":"Drag to reorder",children:"⋮⋮"}),s.jsx("button",{type:"button",className:"uiforge-blocks-editor__delete-button",onClick:c,title:"Delete block","aria-label":"Delete block",children:"×"})]}),s.jsx("div",{className:"uiforge-blocks-editor__block-content",children:h()})]})},Ft=({onAddBlock:t})=>{const[e,r]=i.useState(!1),n=[{type:"paragraph",label:"Paragraph",icon:"¶"},{type:"heading1",label:"Heading 1",icon:"H1"},{type:"heading2",label:"Heading 2",icon:"H2"},{type:"heading3",label:"Heading 3",icon:"H3"},{type:"list",label:"List",icon:"≡"},{type:"quote",label:"Quote",icon:'"'},{type:"code",label:"Code",icon:"</>"},{type:"image",label:"Image",icon:"🖼"}];return s.jsxs("div",{className:"uiforge-blocks-editor__block-menu",children:[s.jsx("button",{type:"button",className:"uiforge-blocks-editor__add-button",onClick:()=>r(!e),"aria-label":"Add block","aria-expanded":e,children:"+ Add Block"}),e&&s.jsx("div",{className:"uiforge-blocks-editor__block-menu-dropdown",children:n.map(({type:a,label:d,icon:l})=>s.jsxs("button",{type:"button",className:"uiforge-blocks-editor__block-menu-item",onClick:()=>{t(a),r(!1)},children:[s.jsx("span",{className:"uiforge-blocks-editor__block-menu-icon",children:l}),s.jsx("span",{children:d})]},a))})]})};function Ie(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function qt(t){const e=t.trim(),r=["javascript:","data:","vbscript:","file:"],n=e.toLowerCase();for(const a of r)if(n.startsWith(a))return"";return e}function Kt(t){return t.map(e=>{let r=Ie(e.content);switch(e.format?.bold&&(r=`<strong>${r}</strong>`),e.format?.italic&&(r=`<em>${r}</em>`),e.format?.underline&&(r=`<u>${r}</u>`),e.format?.code&&(r=`<code>${r}</code>`),e.type){case"heading1":return`<h1>${r}</h1>`;case"heading2":return`<h2>${r}</h2>`;case"heading3":return`<h3>${r}</h3>`;case"quote":return`<blockquote>${r}</blockquote>`;case"code":return`<pre><code>${Ie(e.content)}</code></pre>`;case"image":{const n=qt(e.imageUrl||""),a=Ie(e.imageAlt||"");return n?`<img src="${n}" alt="${a}" />`:""}case"list":return`<ul><li>${r}</li></ul>`;default:return`<p>${r}</p>`}}).join(`
2
+ `)}function Zt(t){return t.map(e=>{let r=e.content;switch(e.format?.bold&&(r=`**${r}**`),e.format?.italic&&(r=`*${r}*`),e.format?.code&&(r=`\`${r}\``),e.type){case"heading1":return`# ${r}`;case"heading2":return`## ${r}`;case"heading3":return`### ${r}`;case"quote":return`> ${r}`;case"code":return`\`\`\`
3
+ ${e.content}
4
+ \`\`\``;case"image":return`![${e.imageAlt||""}](${e.imageUrl||""})`;case"list":return`- ${r}`;default:return r}}).join(`
5
5
 
6
- `)}function kt(e){return JSON.stringify(e,null,2)}const $t=({options:e=[],value:t,onChange:s,onSearch:n,placeholder:a="Select an option...",disabled:f=!1,clearable:m=!1,className:x="",renderOption:j,renderValue:W,loading:A=!1,maxHeight:F="300px",debounceMs:h=300,searchable:E=!0,noOptionsMessage:M="No options found",ariaLabel:q,enableCache:B=!1,cacheTTL:L,refreshOnOpen:R=!1,onClearCache:G,onForceRefresh:Z})=>{const[I,U]=i.useState(!1),[k,O]=i.useState(""),[P,c]=i.useState([]),[v,d]=i.useState(0),[b,H]=i.useState(!1),D=i.useRef(null),X=i.useRef(null),ee=i.useRef(null),J=i.useRef(null),z=i.useRef(null),te=i.useRef(n),l=i.useRef(null),S=i.useRef(!1),p=i.useRef(new Map),C=i.useRef(B),K=i.useRef(L),g=i.useCallback((u,y=0)=>u.reduce((Q,V)=>{const Y={...V,level:y};return Q.push(Y),V.children&&V.children.length>0&&Q.push(...g(V.children,y+1)),Q},[]),[]),o=u=>typeof u=="string"&&(u.startsWith("http://")||u.startsWith("https://")||u.startsWith("data:")||u.startsWith("/")),_=i.useMemo(()=>g(P.length>0?P:e).find(y=>y.value===t)||null,[t,e,P,g]),w=i.useCallback((u,y)=>{if(!y.trim())return u;const Q=y.toLowerCase(),V=Y=>Y.reduce((re,ae)=>{const ce=ae.label.toLowerCase().includes(Q),le=ae.children?V(ae.children):[];return(ce||le.length>0)&&re.push({...ae,children:le.length>0?le:ae.children}),re},[]);return V(u)},[]);i.useEffect(()=>{te.current=n,z.current=null},[n]),i.useEffect(()=>{C.current=B},[B]),i.useEffect(()=>{K.current=L},[L]),i.useEffect(()=>{G&&G(()=>{p.current.clear()}),Z&&Z(()=>{if(!te.current)return;l.current&&l.current.abort(),l.current=new AbortController;const u=l.current.signal;H(!0),(async()=>{try{const y=Date.now(),Q=k,V=p.current.get(Q),Y=V&&(!K.current||y-V.timestamp<K.current);let re;C.current&&Y?re=V.data:(re=await(te.current?te.current(k,u):n?.(k,u)??[]),!u.aborted&&C.current&&p.current.set(Q,{data:re,timestamp:y})),u.aborted||(c(re),z.current=k)}catch(y){console.error(y),c([])}finally{H(!1)}})()})},[G,Z,k,n]),i.useEffect(()=>{if(n&&I){const u=z.current===k,y=!S.current&&I;return u&&!(R&&y)?void 0:(J.current&&clearTimeout(J.current),J.current=setTimeout(async()=>{l.current&&l.current.abort(),l.current=new AbortController;const V=l.current.signal;H(!0);try{let Y;const re=k,ae=p.current.get(re),ce=Date.now(),le=ae&&(!K.current||ce-ae.timestamp<K.current);if(C.current&&le?Y=ae.data:(Y=await(te.current?te.current(k,V):n(k,V)),!V.aborted&&C.current&&p.current.set(re,{data:Y,timestamp:ce})),V.aborted)return;c(Y),z.current=k}catch(Y){console.error("Error fetching options:",Y),c([])}finally{H(!1)}},h),()=>{J.current&&clearTimeout(J.current),l.current&&(l.current.abort(),l.current=null)})}else n||c(w(e,k));S.current=I},[k,I,e,h,w,R,n]),i.useEffect(()=>{n||c(e)},[e,n]),i.useEffect(()=>{const u=y=>{D.current&&!D.current.contains(y.target)&&(U(!1),O(""))};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const $=i.useMemo(()=>g(P.length>0?P:e).filter(y=>!y.disabled),[P,e,g]),se=i.useMemo(()=>g(P.length>0?P:e),[P,e,g]),N=i.useMemo(()=>{const u=new Map;return se.forEach(y=>{const Q=JSON.stringify({value:y.value,label:y.label}),V=$.findIndex(Y=>Y.value===y.value&&Y.label===y.label);u.set(Q,V)}),u},[se,$]),oe=u=>{if(!f)switch(u.key){case"ArrowDown":u.preventDefault(),I?d(y=>y<$.length-1?y+1:0):U(!0);break;case"ArrowUp":u.preventDefault(),I&&d(y=>y>0?y-1:$.length-1);break;case"Enter":u.preventDefault(),I&&$[v]?ie($[v]):U(!I);break;case"Escape":u.preventDefault(),U(!1),O("");break;case"Tab":I&&(U(!1),O(""));break}};i.useEffect(()=>{if(I&&ee.current){const u=ee.current.querySelector(`[data-index="${v}"]`);u&&typeof u.scrollIntoView=="function"&&u.scrollIntoView({block:"nearest"})}},[v,I]);const ie=u=>{u.disabled||(s?.(u.value,u),U(!1),O(""),d(0))},ne=u=>{u.stopPropagation(),s?.(null,null),O("")},dt=()=>{f||U(u=>{const y=!u;return y&&setTimeout(()=>X.current?.focus(),0),y})};i.useEffect(()=>{I||(z.current=null)},[I]);const ut=u=>{O(u.target.value),I||U(!0),d(0)},ht=u=>{const y=(u.level||0)*20;return r.jsxs("div",{className:"uiforge-combobox-option-content",style:{paddingLeft:`${y}px`},children:[u.icon&&r.jsx("span",{className:"uiforge-combobox-option-icon",children:o(u.icon)?r.jsx("img",{src:u.icon,alt:"",className:"uiforge-combobox-option-icon-img"}):u.icon}),r.jsx("span",{className:"uiforge-combobox-option-label",children:u.label})]})},mt=u=>u?r.jsxs("div",{className:"uiforge-combobox-value-content",children:[u.icon&&r.jsx("span",{className:"uiforge-combobox-value-icon",children:o(u.icon)?r.jsx("img",{src:u.icon,alt:"",className:"uiforge-combobox-value-icon-img"}):u.icon}),r.jsx("span",{className:"uiforge-combobox-value-label",children:u.label})]}):a,T="uiforge-combobox",pt=[T,I&&`${T}--open`,f&&`${T}--disabled`,x].filter(Boolean).join(" ");return r.jsxs("div",{ref:D,className:pt,onKeyDown:oe,role:"combobox","aria-expanded":I,"aria-haspopup":"listbox","aria-label":q,"aria-disabled":f,tabIndex:f?-1:0,children:[r.jsxs("div",{className:`${T}-control`,onClick:dt,children:[E&&I?r.jsx("input",{ref:X,type:"text",className:`${T}-input`,value:k,onChange:ut,placeholder:a,disabled:f,"aria-autocomplete":"list","aria-controls":`${T}-listbox`}):r.jsx("div",{className:`${T}-value`,children:W?W(_):mt(_)}),r.jsxs("div",{className:`${T}-indicators`,children:[m&&t!==null&&t!==void 0&&!f&&r.jsx("button",{type:"button",className:`${T}-clear`,onClick:ne,"aria-label":"Clear selection",tabIndex:-1,children:"×"}),r.jsx("span",{className:`${T}-arrow`,children:"▼"})]})]}),I&&r.jsx("div",{ref:ee,className:`${T}-dropdown`,style:{maxHeight:F},role:"listbox",id:`${T}-listbox`,children:A||b?r.jsx("div",{className:`${T}-loading`,children:"Loading..."}):$.length===0?r.jsx("div",{className:`${T}-no-options`,children:M}):se.map(u=>{const y=JSON.stringify({value:u.value,label:u.label}),Q=N.get(y)??-1,V=u.value===t,Y=Q===v,re=[`${T}-option`,V&&`${T}-option--selected`,Y&&`${T}-option--highlighted`,u.disabled&&`${T}-option--disabled`].filter(Boolean).join(" ");return r.jsx("div",{className:re,onClick:()=>ie(u),role:"option","aria-selected":V,"aria-disabled":u.disabled,"data-index":Q,children:j?j(u):ht(u)},y)})})]})},je=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),_e=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Ie=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),$e=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Ce=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Ne=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Me=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Le=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Se=({size:e=20,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,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"})]}),Ae=({size:e=20,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,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"})]}),Ue=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Pe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Ve=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,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"})]}),De=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),Ee=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),Be=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),Re=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),Oe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,children:r.jsx("path",{d:"M2 8H5L6.5 5L8 11L9.5 8H14",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),He=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),ze=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),Te=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),We=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Fe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),qe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),Ze=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),Ke=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),Ye=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),Ge=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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})]}),Je=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),Qe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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})]}),Xe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),et=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),tt=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),rt=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),st=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),nt=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),at=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),ot=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),it=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),lt=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})]}),ct=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,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"})}),xe={commit:je,pr:_e,issue:Ie,comment:ke,star:$e,fork:Ce,merge:Ne,release:Me,deploy:Le},ge={unfold:Se,fold:Ae,close:Ue,check:Pe},Ct={taichi:Ve,meditation:De,yoga:Ee},Nt={dumbbell:Be,running:Re,heartrate:Oe,strength:He},Mt={server:ze,database:Te,cloud:We,terminal:Fe,bug:qe,code:Ze},Lt={rocket:Ke,satellite:Ye,alien:Ge,planet:Je,telescope:Qe},St={chart:Xe,meeting:et,document:tt,calendar:rt,briefcase:st},At={gitbranch:nt,prdraft:at,testing:ot,deployment:it,review:lt,build:ct},Ut=e=>{const t=xe[e]||xe.commit;return r.jsx(t,{size:16})},me=(e,t=2)=>{if(e.length===0)return[];const s=[];let n=[],a=null;return e.forEach((f,m)=>{a===f.type?n.push(f):(n.length>=t&&a?s.push(we(n,a)):n.forEach(x=>{s.push({id:x.id.toString(),type:x.type,count:1,title:x.title,timestamp:new Date(x.timestamp),icon:x.icon,events:[x]})}),n=[f],a=f.type),m===e.length-1&&(n.length>=t&&a?s.push(we(n,a)):n.forEach(x=>{s.push({id:x.id.toString(),type:x.type,count:1,title:x.title,timestamp:new Date(x.timestamp),icon:x.icon,events:[x]})}))}),s},we=(e,t)=>{const s=e.reduce((m,x)=>{const j=x.metadata?.repository||"unknown";return m[j]||(m[j]=[]),m[j].push(x),m},{}),n=Object.entries(s),a=n.length>1;let f="";if(a)f=`Created ${e.length} ${pe(t)} in ${n.length} repositories`;else{const m=n[0][0];f=`Created ${e.length} ${pe(t)}${m!=="unknown"?` in ${m}`:""}`}return{id:`group-${t}-${e[0].id}`,type:t,count:e.length,title:f,timestamp:new Date(e[0].timestamp),icon:e[0].icon,events:e,children:a?n.map(([m,x])=>({id:`group-${t}-${m}`,type:t,count:x.length,title:`Created ${x.length} ${pe(t)} in ${m}`,timestamp:new Date(x[0].timestamp),icon:x[0].icon,events:x})):void 0}},pe=e=>({pr:"pull requests",issue:"issues",commit:"commits",comment:"comments",star:"stars",fork:"forks",merge:"merges",release:"releases",deploy:"deployments"})[e]||`${e}s`,fe=e=>{if(e.length===0)return[];const t=[];let s=null;return e.forEach((n,a)=>{if("type"in n&&n.type==="date-separator"){t.push(n);return}const m=n.timestamp,x=`${m.getFullYear()}-${m.getMonth()}`;if(x!==s){const j={id:`sep-${a}`,type:"date-separator",date:m,label:Pt(m)};t.push(j),s=x}t.push(n)}),t},Pt=e=>e.toLocaleDateString("en-US",{month:"long",year:"numeric"}),Vt=e=>{const t=typeof e=="string"?new Date(e):e,n=new Date().getTime()-t.getTime(),a=Math.floor(n/1e3),f=Math.floor(a/60),m=Math.floor(f/60),x=Math.floor(m/24);return a<60?"just now":f<60?`${f}m ago`:m<24?`${m}h ago`:x<30?`${x}d ago`:t.toLocaleDateString()},Dt=({events:e,theme:t="light",className:s="",showLoadMore:n=!0,loading:a=!1,onLoadMore:f,pagination:m,maxHeight:x,showMoreThreshold:j=100,initiallyExpandedAll:W=!1,emptyMessage:A="No activity to display",onToggleExpand:F,enableGrouping:h=!0,groupingThreshold:E=2,showDateSeparators:M=!0,showTimeline:q=!0,scale:B=1,renderIcon:L,renderEvent:R})=>{const[G,Z]=i.useState(()=>{const l=new Set;return(h?M?fe(me(e,E)):me(e,E):e.map(p=>({id:p.id.toString(),type:p.type,count:1,title:p.title,timestamp:new Date(p.timestamp),icon:p.icon,events:[p]}))).forEach(p=>{if("events"in p&&p.type!=="date-separator"){const C=p;(W||C.events.some(K=>K.initiallyExpanded))&&l.add(C.id),C.children&&C.children.forEach(K=>{(W||K.events.some(g=>g.initiallyExpanded))&&l.add(K.id)})}}),l}),[I,U]=i.useState(!1),k=i.useRef(null),O=i.useRef(null),P=i.useMemo(()=>{if(!h){const S=e.map(p=>({id:p.id.toString(),type:p.type,count:1,title:p.title,timestamp:new Date(p.timestamp),icon:p.icon,events:[p]}));return M?fe(S):S}const l=me(e,E);return M?fe(l):l},[e,h,E,M]),c=i.useCallback(()=>{if(!O.current||!n||!f)return;const{scrollTop:l,scrollHeight:S,clientHeight:p}=O.current,C=S-l-p;U(C<=j)},[n,f,j]);i.useEffect(()=>{const l=O.current;if(l)return l.addEventListener("scroll",c),c(),()=>{l.removeEventListener("scroll",c)}},[c]);const v=i.useCallback((l,S)=>{Z(p=>{const C=new Set(p),K=C.has(l);return K?C.delete(l):C.add(l),F?.(S,!K),C})},[F]),d=(l,S=!1)=>{const p=G.has(l.id),C=l.children&&l.children.length>0,K=l.count>1,g=l.count===1&&l.events[0]?.description,o=K||C||g,_=l.count===1&&l.events.length===1?l.events[0].id:l.id;return R&&l.count===1&&l.events.length===1?r.jsxs("div",{className:`activity-stream__item ${S?"activity-stream__item--child":""}`,"data-event-id":l.id,children:[q&&!S&&r.jsx("div",{className:"activity-stream__timeline-marker"}),R(l.events[0])]},l.id):r.jsxs("div",{className:`activity-stream__item ${S?"activity-stream__item--child":""}`,"data-event-id":l.id,children:[q&&!S&&r.jsx("div",{className:"activity-stream__timeline-marker"}),r.jsx("div",{className:"activity-stream__icon",children:L&&l.events.length===1?L(l.events[0]):l.icon||Ut(l.type)}),r.jsxs("div",{className:"activity-stream__content",children:[r.jsxs("div",{className:`activity-stream__header ${o?"activity-stream__header--clickable":""}`,onClick:()=>o&&v(l.id,_),onKeyDown:w=>{o&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),v(l.id,_))},role:o?"button":void 0,tabIndex:o?0:void 0,"aria-expanded":o?p:void 0,children:[r.jsx("div",{className:"activity-stream__title",children:l.title}),r.jsx("div",{className:"activity-stream__timestamp",children:Vt(l.timestamp)}),o&&r.jsx("div",{className:"activity-stream__toggle",children:p?r.jsx(ge.fold,{size:16}):r.jsx(ge.unfold,{size:16})})]}),p&&C&&l.children&&r.jsx("div",{className:"activity-stream__children",children:l.children.map(w=>d(w,!0))}),p&&!C&&l.events.length>1&&r.jsx("div",{className:"activity-stream__events-list",children:l.events.map(w=>R?r.jsx("div",{className:"activity-stream__event-item",children:R(w)},w.id):r.jsxs("div",{className:"activity-stream__event-item",children:[r.jsx("div",{className:"activity-stream__event-title",children:w.title}),w.description&&r.jsx("div",{className:"activity-stream__event-description",children:w.description})]},w.id))}),p&&l.count===1&&l.events[0].description&&r.jsx("div",{className:"activity-stream__description",children:l.events[0].description})]})]},l.id)},b=l=>r.jsxs("div",{className:"activity-stream__date-separator",children:[r.jsx("div",{className:"activity-stream__date-label",children:l.label}),r.jsx("div",{className:"activity-stream__date-line"})]},l.id),H=m?.hasMore!==void 0?m.hasMore:m?.totalItems!==void 0?e.length<m.totalItems:!0,D="activity-stream",X=`${D}--${t}`,ee=q?`${D}--with-timeline`:"";let J=`${D} ${X} ${ee} ${s}`.trim();B&&B<1&&(J=`${J} ${D}--compact`),B&&B>1&&(J=`${J} ${D}--spacious`);const z=x?{maxHeight:x}:void 0,te={"--activity-stream-scale":B};return r.jsx("div",{ref:k,className:J,"data-theme":t,children:r.jsxs("div",{ref:O,className:"activity-stream__container",style:{...z,...te},children:[P.length===0?r.jsx("div",{className:"activity-stream__empty",children:A}):r.jsx("div",{className:"activity-stream__items",children:P.map(l=>"type"in l&&l.type==="date-separator"?b(l):d(l))}),a&&r.jsxs("div",{className:"activity-stream__loading",children:[r.jsx("div",{className:"activity-stream__spinner"}),r.jsx("span",{children:"Loading..."})]}),n&&!a&&H&&f&&r.jsx("div",{className:`activity-stream__load-more ${I?"activity-stream__load-more--visible":""}`,onClick:f,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),f())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]})})},Et={name:"youtube",displayName:"YouTube",domains:["youtube.com","youtu.be","youtube-nocookie.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);return t.hostname.replace("www.","")==="youtu.be"?t.pathname.slice(1).split("?")[0]:t.searchParams.has("v")?t.searchParams.get("v"):t.pathname.startsWith("/embed/")||t.pathname.startsWith("/v/")?t.pathname.split("/")[2]:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1"),t.muted&&s.set("mute","1"),t.loop&&(s.set("loop","1"),s.set("playlist",e)),t.startTime&&s.set("start",String(t.startTime)),t.controls===!1&&s.set("controls","0");const n="https://www.youtube.com",a=s.toString();return`${n}/embed/${e}${a?`?${a}`:""}`}},Bt={name:"vimeo",displayName:"Vimeo",domains:["vimeo.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s!=="vimeo.com"&&s!=="player.vimeo.com")return null;if(t.pathname.startsWith("/video/"))return t.pathname.split("/")[2];const n=t.pathname.split("/").filter(Boolean);if(n.length>0){const a=n[0];if(/^\d+$/.test(a))return a}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1"),t.muted&&s.set("muted","1"),t.loop&&s.set("loop","1"),t.startTime&&s.set("t",`${t.startTime}s`),t.controls===!1&&s.set("controls","0");const n=s.toString();return`https://player.vimeo.com/video/${e}${n?`?${n}`:""}`}},Rt={name:"dailymotion",displayName:"Dailymotion",domains:["dailymotion.com","dai.ly"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s==="dai.ly")return t.pathname.slice(1).split("?")[0];if(s==="dailymotion.com"){if(t.pathname.startsWith("/video/"))return t.pathname.split("/")[2].split("_")[0];if(t.pathname.startsWith("/embed/video/"))return t.pathname.split("/")[3].split("?")[0]}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1"),t.muted&&s.set("mute","1"),t.loop&&s.set("loop","1"),t.startTime&&s.set("start",String(t.startTime)),t.controls===!1&&s.set("controls","0");const n=s.toString();return`https://www.dailymotion.com/embed/video/${e}${n?`?${n}`:""}`}},Ot={name:"twitch",displayName:"Twitch",domains:["twitch.tv","clips.twitch.tv"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")==="clips.twitch.tv")return`clip:${t.pathname.slice(1)}`;if(t.pathname.startsWith("/videos/"))return`video:${t.pathname.split("/")[2]}`;const n=t.pathname.match(/\/([^/]+)\/clip\/([^/?]+)/);return n?`clip:${n[2]}`:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams,n=typeof window<"u"?window.location.hostname:"localhost";s.set("parent",n),t.autoplay&&s.set("autoplay","true"),t.muted&&s.set("muted","true");const a=s.toString();return e.startsWith("video:")?`https://player.twitch.tv/?video=${e.slice(6)}&${a}`:e.startsWith("clip:")?`https://clips.twitch.tv/embed?clip=${e.slice(5)}&${a}`:""}},Ht={name:"kick",displayName:"Kick",domains:["kick.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="kick.com")return null;const n=t.pathname.match(/\/video\/([a-zA-Z0-9-]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://player.kick.com/video/${e}`},zt={name:"rumble",displayName:"Rumble",domains:["rumble.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="rumble.com")return null;if(t.pathname.startsWith("/embed/"))return t.pathname.split("/")[2].split("?")[0];const n=t.pathname.match(/\/([a-z0-9]+)-/);return n?n[1]:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","2");const n=s.toString();return`https://rumble.com/embed/${e}${n?`?${n}`:""}`}},Tt={name:"odysee",displayName:"Odysee",domains:["odysee.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="odysee.com")return null;const n=t.pathname.match(/\$\/embed\/(.+)/);if(n)return n[1];const a=t.pathname.slice(1);return a.startsWith("@")?a:null}catch{return null}},getEmbedUrl:e=>`https://odysee.com/$/embed/${e}`},Wt={name:"bitchute",displayName:"BitChute",domains:["bitchute.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="bitchute.com")return null;const n=t.pathname.match(/\/(video|embed)\/([a-zA-Z0-9]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:e=>`https://www.bitchute.com/embed/${e}/`},Ft={name:"vk",displayName:"VK Video",domains:["vk.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="vk.com")return null;const n=t.searchParams.get("z");if(n&&n.startsWith("video"))return n.replace("video","");const a=t.pathname.match(/\/video(-?\d+_\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1");const n=e.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}`:""}`}},qt={name:"bilibili",displayName:"Bilibili",domains:["bilibili.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s!=="bilibili.com"&&s!=="www.bilibili.com")return null;const n=t.pathname.match(/\/video\/((?:BV|av)[a-zA-Z0-9]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1");const n=s.toString();return`https://player.bilibili.com/player.html?bvid=${e}${n?`&${n}`:""}`}},Zt={name:"niconico",displayName:"Niconico",domains:["nicovideo.jp"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="nicovideo.jp")return null;const n=t.pathname.match(/\/watch\/((?:sm|so|nm)\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://embed.nicovideo.jp/watch/${e}`},Kt={name:"wistia",displayName:"Wistia",domains:["wistia.com","wi.st","wistia.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(t.pathname.includes("/medias/")){const n=t.pathname.match(/\/medias\/([a-zA-Z0-9]+)/);if(n)return n[1]}if(s.includes("wistia")&&t.pathname.includes("/iframe/")){const n=t.pathname.match(/\/iframe\/([a-zA-Z0-9]+)/);if(n)return n[1]}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoPlay","true"),t.muted&&s.set("muted","true");const n=s.toString();return`https://fast.wistia.net/embed/iframe/${e}${n?`?${n}`:""}`}},Yt={name:"brightcove",displayName:"Brightcove",domains:["brightcove.com","bcove.video"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.searchParams.get("videoId");if(s){const n=t.pathname.match(/\/(\d+)\//);if(n)return`${n[1]}:${s}`}return null}catch{return null}},getEmbedUrl:e=>{const t=e.split(":");if(t.length<2)return console.error("Brightcove video ID must be in format ACCOUNT_ID:VIDEO_ID"),"";const[s,...n]=t,a=n.join(":");return`https://players.brightcove.net/${s}/default_default/index.html?videoId=${a}`}},Gt={name:"kaltura",displayName:"Kaltura",domains:["kaltura.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.searchParams.get("entry_id")||t.searchParams.get("entryId");if(s){const n=t.pathname.match(/\/p\/(\d+)\//),a=t.pathname.match(/\/uiconf_id\/(\d+)/);if(n&&a)return`${n[1]}:${a[1]}:${s}`}return null}catch{return null}},getEmbedUrl:e=>{const t=e.split(":");if(t.length<3)return console.error("Kaltura video ID must be in format PARTNER_ID:UI_CONF_ID:ENTRY_ID"),"";const[s,n,a]=t;return`https://cdnapisec.kaltura.com/p/${s}/sp/${s}00/embedIframeJs/uiconf_id/${n}/partner_id/${s}?iframeembed=true&entry_id=${a}`}},Jt={name:"panopto",displayName:"Panopto",domains:["panopto.com"],tier:"professional",supportsAutoplay:!1,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname;if(s==="panopto.com"||s.endsWith(".panopto.com")){const a=t.searchParams.get("id");if(a)return`${s.split(".")[0]}:${a}`}return null}catch{return null}},getEmbedUrl:e=>{const t=e.split(":");if(t.length<2)return console.error("Panopto video ID must be in format SUBDOMAIN:SESSION_ID"),"";const[s,...n]=t,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`}},Qt={name:"jwplayer",displayName:"JW Player",domains:["jwplayer.com","jwplatform.com","content.jwplatform.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const s=new URL(e).pathname.match(/\/players\/([a-zA-Z0-9]+-[a-zA-Z0-9]+)\.html/);return s?s[1]:null}catch{return null}},getEmbedUrl:e=>`https://content.jwplatform.com/players/${e}.html`},Xt={name:"cloudflare",displayName:"Cloudflare Stream",domains:["cloudflarestream.com","videodelivery.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname,n=s==="videodelivery.net"||s.endsWith(".videodelivery.net"),a=s==="cloudflarestream.com"||s.endsWith(".cloudflarestream.com");if(n||a){const f=t.pathname.match(/\/([a-zA-Z0-9]+)(?:\/|$)/);if(f)return f[1]}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","true"),t.muted&&s.set("muted","true"),t.loop&&s.set("loop","true");const n=s.toString();return`https://iframe.videodelivery.net/${e}${n?`?${n}`:""}`}},er={name:"mux",displayName:"Mux",domains:["mux.com","stream.mux.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname==="stream.mux.com"){const n=t.pathname.slice(1).split(".")[0];if(n)return n}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","true"),t.muted&&s.set("muted","true");const n=s.toString();return`https://stream.mux.com/${e}.m3u8${n?`?${n}`:""}`}},tr={name:"aws-ivs",displayName:"AWS IVS",domains:["ivs.aws","amazonaws.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);return t.hostname.includes(".channel.ivs.aws")?t.hostname.split(".")[0]:null}catch{return null}},getEmbedUrl:e=>`https://${e}.channel.ivs.aws/stream.m3u8`},rr={name:"azure-media",displayName:"Azure Media Services",domains:["azure.net","azureedge.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.endsWith(".streaming.media.azure.net")){const s=t.pathname.split("/");if(s.length>=2)return`${t.hostname}:${s[1]}`}return null}catch{return null}},getEmbedUrl:e=>{const t=e.split(":");if(t.length<2)return console.error("Azure Media video ID must be in format HOSTNAME:ASSET_ID"),"";const[s,...n]=t,a=n.join(":");return`https://${s}/${a}/manifest`}},sr={name:"google-drive",displayName:"Google Drive",domains:["drive.google.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="drive.google.com")return null;const n=t.pathname.match(/\/file\/d\/([a-zA-Z0-9_-]+)/);if(n)return n[1];const a=t.searchParams.get("id");return a||null}catch{return null}},getEmbedUrl:e=>`https://drive.google.com/file/d/${e}/preview`},nr={name:"dropbox",displayName:"Dropbox",domains:["dropbox.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{return new URL(e).hostname.replace("www.","")!=="dropbox.com"?null:e}catch{return null}},getEmbedUrl:e=>{try{const t=new URL(e);return t.searchParams.delete("dl"),t.searchParams.set("raw","1"),t.toString()}catch{return e}}},ar={name:"facebook",displayName:"Facebook Video",domains:["facebook.com","fb.watch"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s==="fb.watch")return t.pathname.slice(1);if(s==="facebook.com"){const n=t.searchParams.get("v");if(n)return n;const a=t.pathname.match(/\/videos\/(\d+)/);if(a)return a[1]}return null}catch{return null}},getEmbedUrl:e=>`https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fwatch%2F%3Fv%3D${e}`},or={name:"instagram",displayName:"Instagram",domains:["instagram.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="instagram.com")return null;const n=t.pathname.match(/\/(p|reel|tv)\/([a-zA-Z0-9_-]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:e=>`https://www.instagram.com/p/${e}/embed/`},ir={name:"twitter",displayName:"X (Twitter)",domains:["twitter.com","x.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s!=="twitter.com"&&s!=="x.com")return null;const n=t.pathname.match(/\/status\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://platform.twitter.com/embed/Tweet.html?id=${e}`},lr={name:"pornhub",displayName:"Pornhub",domains:["pornhub.com"],tier:"adult",supportsAutoplay:!0,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="pornhub.com")return null;const n=t.searchParams.get("viewkey");if(n)return n;const a=t.pathname.match(/\/embed\/([a-zA-Z0-9]+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:e=>`https://www.pornhub.com/embed/${e}`},cr={name:"youporn",displayName:"YouPorn",domains:["youporn.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="youporn.com")return null;const n=t.pathname.match(/\/watch\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://www.youporn.com/embed/${e}`},dr={name:"redtube",displayName:"Redtube",domains:["redtube.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="redtube.com")return null;const n=t.searchParams.get("id");if(n)return n;const a=t.pathname.match(/\/(\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:e=>`https://embed.redtube.com/?id=${e}`},ur={name:"xhamster",displayName:"XHamster",domains:["xhamster.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="xhamster.com")return null;const n=t.pathname.match(/\/videos\/[^/]+-(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://xhamster.com/xembed.php?video=${e}`},hr={name:"spankbang",displayName:"SpankBang",domains:["spankbang.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="spankbang.com")return null;const n=t.pathname.match(/\/([a-zA-Z0-9]+)\/video\//);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://spankbang.com/${e}/embed/`},ve=[Et,Bt,Rt,Ot,Ht,zt,Tt,Wt,Ft,qt,Zt,Kt,Yt,Gt,Jt,Qt,Xt,er,tr,rr,sr,nr,ar,or,ir,lr,cr,dr,ur,hr],de=ve.reduce((e,t)=>(e[t.name]=t,e),{});function be(e){if(!e)return null;try{const s=new URL(e).hostname.toLowerCase().replace("www.","");for(const n of ve)for(const a of n.domains)if(s===a||s.endsWith(`.${a}`))return n;return null}catch{return null}}function ye(e){const t=be(e);if(!t)return null;const s=t.extractVideoId(e);return s?{provider:t,videoId:s}:null}function mr(e,t){const s=ye(e);return s?s.provider.getEmbedUrl(s.videoId,t):null}function pr(e){return be(e)?.tier==="adult"}const fr=()=>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"})]}),gr=({title:e,description:t,url:s,youtubeId:n,vimeoId:a,provider:f,videoId:m,autoplay:x=!1,muted:j=!1,loop:W=!1,startTime:A,controls:F=!0,thumbnailUrl:h,onPlay:E,onError:M,onReady:q,className:B="",overlayIcon:L,aspectRatio:R="16:9",width:G,height:Z,allowAdultContent:I=!1,fallback:U})=>{const[k,O]=i.useState(!1),[P,c]=i.useState(null),v=i.useRef(null),d=i.useMemo(()=>{if(f&&m){const p=de[f];if(p)return{provider:p,videoId:m,method:"explicit"}}if(s){const p=ye(s);if(p)return{...p,method:"url"}}if(n){const p=de.youtube;if(p)return{provider:p,videoId:n,method:"legacy"}}if(a){const p=de.vimeo;if(p)return{provider:p,videoId:a,method:"legacy"}}return null},[s,f,m,n,a]),b=i.useMemo(()=>d?d.provider.tier==="adult":!1,[d]),H=i.useMemo(()=>({autoplay:k?!0:x,muted:j,loop:W,startTime:A,controls:F}),[x,j,W,A,F,k]),D=i.useMemo(()=>{if(!d)return"";try{return d.provider.getEmbedUrl(d.videoId,H)}catch(p){return console.error("Error generating embed URL:",p),""}},[d,H]),X=i.useMemo(()=>{if(h)return h;if(d?.provider.name==="youtube")return`https://img.youtube.com/vi/${d.videoId}/maxresdefault.jpg`},[h,d]),ee=i.useCallback(()=>{d&&(O(!0),E&&E(d.videoId,d.provider.name),q&&q(d.videoId,d.provider.name))},[d,E,q]),J=i.useCallback(p=>{c(p),M&&d&&M(new Error(p),d.provider.name)},[M,d]);if(!d)return U?r.jsx(r.Fragment,{children:U}):(console.warn("UIForgeVideo: No valid video source provided"),null);if(b&&!I){const p="Adult content must be explicitly enabled with allowAdultContent prop";return U?r.jsx(r.Fragment,{children:U}):(console.warn(`UIForgeVideo: ${p}`),r.jsx("div",{className:"uiforge-video",children:r.jsx("div",{className:"uiforge-video__error",children:r.jsx("p",{children:p})})}))}if(P)return U?r.jsx(r.Fragment,{children:U}):r.jsx("div",{className:"uiforge-video",children:r.jsx("div",{className:"uiforge-video__error",children:r.jsx("p",{children:P})})});const z="uiforge-video",te=`${z} ${B}`.trim(),l={aspectRatio:R!=="auto"?R.replace(":","/"):void 0,width:G?typeof G=="number"?`${G}px`:G:void 0,height:Z?typeof Z=="number"?`${Z}px`:Z:void 0},S=e||`${d.provider.displayName} Video`;return r.jsxs("div",{className:te,children:[(e||t)&&r.jsxs("div",{className:`${z}__header`,children:[e&&r.jsx("h3",{className:`${z}__title`,children:e}),t&&r.jsx("p",{className:`${z}__description`,children:t})]}),r.jsx("div",{className:`${z}__player-container`,style:l,children:k?r.jsx("iframe",{ref:v,src:D,title:S,className:`${z}__iframe`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,onError:()=>J("Failed to load video")}):r.jsxs(r.Fragment,{children:[X&&r.jsx("img",{src:X,alt:S,className:`${z}__thumbnail`}),r.jsx("button",{className:`${z}__overlay`,onClick:ee,"aria-label":`Play video: ${S}`,type:"button",children:L||r.jsx(fr,{})})]})})]})},vr=({title:e,icon:t,className:s="",onClick:n})=>{const a="uiforge-video-preview",f=`${a} ${s}`.trim(),m=()=>{n&&n()},x=A=>{n&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),n())},j=n?"button":"div",W=n?{type:"button",onClick:m,onKeyDown:x}:{};return r.jsxs(j,{className:f,...W,children:[r.jsx("div",{className:`${a}__icon-container`,children:t||r.jsx(xr,{})}),r.jsx("span",{className:`${a}__title`,children:e})]})};exports.ActivityIcons=xe;exports.AlienIcon=Ge;exports.BriefcaseIcon=st;exports.BugIcon=qe;exports.BuildIcon=ct;exports.BusinessIcons=St;exports.Button=ft;exports.CalendarIcon=rt;exports.ChartIcon=Xe;exports.CheckIcon=Pe;exports.CloseIcon=Ue;exports.CloudIcon=We;exports.CodeIcon=Ze;exports.CommentIcon=ke;exports.CommitIcon=je;exports.DatabaseIcon=Te;exports.DeployIcon=Le;exports.DeploymentIcon=it;exports.DevProcessIcons=At;exports.DocumentIcon=tt;exports.DumbbellIcon=Be;exports.FitnessIcons=Nt;exports.FoldIcon=Ae;exports.ForkIcon=Ce;exports.GitBranchIcon=nt;exports.HeartRateIcon=Oe;exports.IssueIcon=Ie;exports.MeditationIcon=De;exports.MeetingIcon=et;exports.MergeIcon=Ne;exports.PlanetIcon=Je;exports.PullRequestDraftIcon=at;exports.PullRequestIcon=_e;exports.ReleaseIcon=Me;exports.ReviewIcon=lt;exports.RocketIcon=Ke;exports.RunningIcon=Re;exports.SatelliteIcon=Ye;exports.ServerIcon=ze;exports.SpaceIcons=Lt;exports.StarIcon=$e;exports.StrengthIcon=He;exports.TaiChiIcon=Ve;exports.TechIcons=Mt;exports.TelescopeIcon=Qe;exports.TerminalIcon=Fe;exports.TestingIcon=ot;exports.UIForgeActivityStream=Dt;exports.UIForgeBlocksEditor=vt;exports.UIForgeComboBox=$t;exports.UIForgeGrid=xt;exports.UIForgeVideo=gr;exports.UIForgeVideoPreview=vr;exports.UIIcons=ge;exports.UnfoldIcon=Se;exports.WellnessIcons=Ct;exports.YogaIcon=Ee;exports.blocksToHTML=_t;exports.blocksToJSON=kt;exports.blocksToMarkdown=It;exports.detectProvider=be;exports.extractVideoId=ye;exports.getEmbedUrlFromVideoUrl=mr;exports.isAdultContent=pr;exports.providersByName=de;exports.videoProviders=ve;
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;