@kitn.ai/ui 0.30.0 → 0.31.0
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/README.md +1 -1
- package/dist/{Icon-BzBET3E-.js → Icon-DJDuE_-x.js} +1 -1
- package/dist/action-icons-xkBBVKkF.js +1 -0
- package/dist/agent-tooling/construct/schema-url.d.ts +9 -0
- package/dist/agent-tooling/construct/schema.d.ts +76 -1
- package/dist/agent-tooling/construct/templates.d.ts +45 -0
- package/dist/arrow-down-DU6wOl-h.js +1 -0
- package/dist/arrow-left-DD46kN17.js +1 -0
- package/dist/{artifact-DGjzHYUT.js → artifact-DoUAr1Fd.js} +1 -1
- package/dist/assets/dev-DwzHsqYD.js +553 -0
- package/dist/{attachments-YvXHlg88.js → attachments-BLWPDiLH.js} +1 -1
- package/dist/{audio-visualizer-9lz5IHsL.js → audio-visualizer-DhHicYvV.js} +1 -1
- package/dist/{badge-Dh_vp8A5.js → badge-BGm7pcwi.js} +1 -1
- package/dist/{bell-CT7_WUwS.js → bell-CMEdSo7A.js} +1 -1
- package/dist/builder-app/App.d.ts +1 -0
- package/dist/builder-app/edit-guard.d.ts +8 -0
- package/dist/builder-app/main.d.ts +0 -0
- package/dist/builder-page/assets/index-C10OF-ur.js +72 -0
- package/dist/builder-page/assets/index-CFyKLBlu.css +1 -0
- package/dist/builder-page/index.html +20 -0
- package/dist/button-BM0YTTDQ.js +1 -0
- package/dist/{card-renderer-DZVaGH2e.js → card-renderer-Ds-wXc6_.js} +1 -1
- package/dist/check-BG1VfYjm.js +1 -0
- package/dist/{checkbox-group-BiryEXPQ.js → checkbox-group-CqXj8ehz.js} +1 -1
- package/dist/{checkbox-Bu2T2e0U.js → checkbox-np_5mKxM.js} +1 -1
- package/dist/chevron-down-CZ4W0hy6.js +1 -0
- package/dist/chevron-right-5gdxkCTF.js +1 -0
- package/dist/{choice-card-CM6IjkmL.js → choice-card-BYBmPAT5.js} +1 -1
- package/dist/circle-C0lwjD2A.js +1 -0
- package/dist/circle-check-BfT1cxQU.js +1 -0
- package/dist/{circle-x-Bk-dA5Wf.js → circle-x-DzUfvRqr.js} +1 -1
- package/dist/{code-block-B26t-Q7q.js → code-block-H6E5Eurc.js} +1 -1
- package/dist/{collapsible-Bhc636Cf.js → collapsible-CBq1Tj6y.js} +1 -1
- package/dist/components/builder-message-actions.d.ts +9 -18
- package/dist/components/builder-panel-derived.d.ts +18 -0
- package/dist/components/builder-panel.d.ts +51 -0
- package/dist/components/builder-start.d.ts +14 -10
- package/dist/components/chat-thread.d.ts +27 -1
- package/dist/components/construct-form-paths.d.ts +54 -0
- package/dist/components/message.d.ts +5 -0
- package/dist/{composer-DMI85B6j.js → composer-B5IvgxAF.js} +1 -1
- package/dist/{confirm-card-B0YIAwXp.js → confirm-card-B63pZIfG.js} +1 -1
- package/dist/construct-cli.es.js +469 -125
- package/dist/construct-templates.d.ts +5 -0
- package/dist/construct-templates.js +266 -0
- package/dist/construct.js +269 -86
- package/dist/{context-DWgfhqWp.js → context-Byqor78j.js} +1 -1
- package/dist/controllable-C4BSt73s.js +1 -0
- package/dist/{conversation-item-BsOsVGmT.js → conversation-item-piXZFRWa.js} +1 -1
- package/dist/{conversation-list-aX3Vtc7L.js → conversation-list-B5yu9cPg.js} +1 -1
- package/dist/{copy-BmEwsNhJ.js → copy-DfI2NYEX.js} +1 -1
- package/dist/{create-tween-CNOAU3Fx.js → create-tween-C4j96_Aj.js} +1 -1
- package/dist/{create-tween-WfqiENls.js → create-tween-CHleHI8m.js} +1 -1
- package/dist/{create-tween-wlFtW9Kh.js → create-tween-DQ6lOhdl.js} +1 -1
- package/dist/{create-tween-zt79ba32.js → create-tween-DyjTgkJi.js} +1 -1
- package/dist/custom-elements.json +40 -5
- package/dist/{default-input-DMV5Eaze.js → default-input-Bwmt8Lai.js} +1 -1
- package/dist/define-B3OpsIDE.js +1 -0
- package/dist/define.js +2 -2
- package/dist/define.server.js +2 -2
- package/dist/{disclosure-NnACBxsC.js → disclosure-ZSAlD4wg.js} +1 -1
- package/dist/{dropdown-DT7G0RGR.js → dropdown-CSRhiMN2.js} +1 -1
- package/dist/elements/agent-card.js +1 -1
- package/dist/elements/artifact.js +1 -1
- package/dist/elements/attachments.js +1 -1
- package/dist/elements/audio-visualizer.js +1 -1
- package/dist/elements/avatar.js +1 -1
- package/dist/elements/badge.js +1 -1
- package/dist/elements/button.js +1 -1
- package/dist/elements/card.js +1 -1
- package/dist/elements/cards.js +1 -1
- package/dist/elements/chain-of-thought.js +1 -1
- package/dist/elements/chat-actions.d.ts +12 -0
- package/dist/elements/chat-scope-picker.js +1 -1
- package/dist/elements/chat-types.d.ts +7 -2
- package/dist/elements/chat-workspace.js +1 -1
- package/dist/elements/chat.js +1 -1
- package/dist/elements/checkbox-group.js +1 -1
- package/dist/elements/checkbox.js +1 -1
- package/dist/elements/checkpoint.js +1 -1
- package/dist/elements/choice.js +1 -1
- package/dist/elements/coachmark.js +1 -1
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/command.js +1 -1
- package/dist/elements/compare.js +1 -1
- package/dist/elements/composer.js +1 -1
- package/dist/elements/confirm-card.js +1 -1
- package/dist/elements/context-meter.js +1 -1
- package/dist/elements/conversation-item.js +1 -1
- package/dist/elements/conversation-list.js +1 -1
- package/dist/elements/dialog.js +1 -1
- package/dist/elements/dock.js +1 -1
- package/dist/elements/dropdown.js +1 -1
- package/dist/elements/editable-label.js +1 -1
- package/dist/elements/embed.js +1 -1
- package/dist/elements/empty.js +1 -1
- package/dist/elements/feedback-bar.js +1 -1
- package/dist/elements/file-tree.js +1 -1
- package/dist/elements/file-upload.js +1 -1
- package/dist/elements/form.js +1 -1
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/icon.js +1 -1
- package/dist/elements/image.js +1 -1
- package/dist/elements/input.js +1 -1
- package/dist/elements/kbd.js +1 -1
- package/dist/elements/link-preview.js +1 -1
- package/dist/elements/loader.js +1 -1
- package/dist/elements/markdown.js +1 -1
- package/dist/elements/menu.js +1 -1
- package/dist/elements/message-skills.js +1 -1
- package/dist/elements/message.js +1 -1
- package/dist/elements/model-switcher.js +1 -1
- package/dist/elements/nav.js +1 -1
- package/dist/elements/notice.js +1 -1
- package/dist/elements/pane-grid.js +1 -1
- package/dist/elements/pane-group.js +1 -1
- package/dist/elements/pane.js +1 -1
- package/dist/elements/popover.js +1 -1
- package/dist/elements/progress-bar.js +1 -1
- package/dist/elements/prompt-dock.js +1 -1
- package/dist/elements/prompt-input.js +1 -1
- package/dist/elements/prompt-suggestions.js +1 -1
- package/dist/elements/radio-group.js +1 -1
- package/dist/elements/reasoning.js +1 -1
- package/dist/elements/remote.js +1 -1
- package/dist/elements/resizable.js +1 -1
- package/dist/elements/response-stream.js +1 -1
- package/dist/elements/screen.js +1 -1
- package/dist/elements/scroll-area.js +1 -1
- package/dist/elements/scroll-button.js +1 -1
- package/dist/elements/search.js +1 -1
- package/dist/elements/segmented.js +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/elements/separator.js +1 -1
- package/dist/elements/setting-item.js +1 -1
- package/dist/elements/settings-group.js +1 -1
- package/dist/elements/skeleton.js +1 -1
- package/dist/elements/slider.js +1 -1
- package/dist/elements/source.js +1 -1
- package/dist/elements/status.js +1 -1
- package/dist/elements/switch.js +1 -1
- package/dist/elements/tabs.js +1 -1
- package/dist/elements/tasks.js +1 -1
- package/dist/elements/text-shimmer.js +1 -1
- package/dist/elements/thinking-bar.js +1 -1
- package/dist/elements/thread.js +1 -1
- package/dist/elements/toast.js +1 -1
- package/dist/elements/tool.js +1 -1
- package/dist/elements/tooltip.js +1 -1
- package/dist/elements/voice-input.js +1 -1
- package/dist/elements/voice-output.js +1 -1
- package/dist/elements.d.ts +22 -10
- package/dist/{ellipsis-6pJ7SxYT.js → ellipsis-CJ5QIjWo.js} +1 -1
- package/dist/{embed-BMje-nxj.js → embed-6Vji0PfS.js} +1 -1
- package/dist/{external-link-Beh9DKeR.js → external-link-BPTtTdet.js} +1 -1
- package/dist/{file-text-D1GPfZ8Q.js → file-text-eVjcFDrK.js} +1 -1
- package/dist/{file-tree-Dwj2lqg-.js → file-tree-a9tfWYmg.js} +1 -1
- package/dist/{folder-b6D8x1DY.js → folder-DN6Ilq6d.js} +1 -1
- package/dist/{form-DWgdxDXu.js → form-U1cwhcQx.js} +1 -1
- package/dist/{hover-card-CWRkqm40.js → hover-card-C5ptzZOZ.js} +1 -1
- package/dist/{icon-CL0jdhsf.js → icon-BOMrFp0D.js} +1 -1
- package/dist/index.js +1991 -1989
- package/dist/index.server.js +1886 -1884
- package/dist/{info-0cOUherQ.js → info-DxzKsIHn.js} +1 -1
- package/dist/{input-BH6Ru91Q.js → input-aW72PACH.js} +1 -1
- package/dist/kai.es.js +1 -1
- package/dist/{kbd-DRAnVtNX.js → kbd-BP-6MwUs.js} +1 -1
- package/dist/{link-preview-DODgRyV9.js → link-preview-CZaDilMG.js} +1 -1
- package/dist/{link-Dlr0vssB.js → link-rlN11N0B.js} +1 -1
- package/dist/{loader-KvJB6NrT.js → loader-BdFK70fF.js} +1 -1
- package/dist/{markdown-DX9tuJVj.js → markdown-DjEaoNz-.js} +1 -1
- package/dist/mcp.es.js +579 -107
- package/dist/message--Nlbemtp.js +1 -0
- package/dist/message-C88yTu2A.js +1 -0
- package/dist/message-circle-CZeVDN1f.js +1 -0
- package/dist/message-square-BXNBKC6i.js +1 -0
- package/dist/{minimize-2-CyOHJwcN.js → minimize-2-BxLOOSEf.js} +1 -1
- package/dist/{model-switcher-0hrKDiK2.js → model-switcher-BxRvub2A.js} +1 -1
- package/dist/{overlay-DBMFXie6.js → overlay-CDwKJtHN.js} +1 -1
- package/dist/{panel-right-t8SWJL6e.js → panel-right-BovedCwW.js} +1 -1
- package/dist/{paperclip-CdzuOjbU.js → paperclip-D0Xyjja2.js} +1 -1
- package/dist/play-DGJ4MgB2.js +1 -0
- package/dist/primitives/speech.d.ts +35 -0
- package/dist/{progress-bar-CiBtxMWT.js → progress-bar-D-aQfy5h.js} +1 -1
- package/dist/{prompt-suggestion-I_DHP21i.js → prompt-suggestion-C6qLjMEQ.js} +1 -1
- package/dist/{radio-C_p3n39l.js → radio-D1CkXISc.js} +1 -1
- package/dist/react/index.d.ts +22 -6
- package/dist/react.js +13 -13
- package/dist/{reasoning-BDwy_tIe.js → reasoning-DARmbgmE.js} +1 -1
- package/dist/register-impl-WcrdIihK.js +424 -0
- package/dist/{resizable-SYC-fStM.js → resizable-Da6oSO2z.js} +1 -1
- package/dist/{rotate-ccw-B1nwmwuY.js → rotate-ccw-31ed1xK_.js} +1 -1
- package/dist/{rotate-cw-CLAnBcm1.js → rotate-cw-qkl39dw3.js} +1 -1
- package/dist/{scroll-area-zRyXoLhI.js → scroll-area-RrKnLYlA.js} +1 -1
- package/dist/{scroll-button-jzrbYCG9.js → scroll-button--QeNjobK.js} +1 -1
- package/dist/{select-DM-0nEe0.js → select-CS_0mWW3.js} +1 -1
- package/dist/{separator-BToOOoOt.js → separator-fT-zBypW.js} +1 -1
- package/dist/{settings-PaGo_S4U.js → settings-dfkV_WDm.js} +1 -1
- package/dist/{settings-group-BFXGIfXq.js → settings-group-CX694npG.js} +1 -1
- package/dist/{skeleton-DYpmFnnm.js → skeleton-BsqKD9TV.js} +1 -1
- package/dist/{slider-ebutAmkQ.js → slider-_EWfTH9H.js} +1 -1
- package/dist/{solid-15v_3WVL.js → solid-BITWG_VE.js} +3073 -3006
- package/dist/{solid-5P-otgdi.js → solid-CRFYWlBw.js} +3865 -3797
- package/dist/solid.js +1 -1
- package/dist/solid.server.js +1 -1
- package/dist/{source-c1gpRl9h.js → source-Da1TFiuj.js} +1 -1
- package/dist/speech-CjbWuqG2.js +1 -0
- package/dist/{star-pcV_3LqF.js → star-ZvSbbXS6.js} +1 -1
- package/dist/{store-CSgbFFCg.js → store-DE5lcr9q.js} +1 -1
- package/dist/{switch-Bh2OdLV2.js → switch-P_fsHqv3.js} +1 -1
- package/dist/{tasks-card-CbqQAn2S.js → tasks-card-B86qqyZm.js} +1 -1
- package/dist/{text-shimmer-BSzgEnDH.js → text-shimmer-BAkw_65G.js} +1 -1
- package/dist/{textarea-DrYNt_0z.js → textarea-Bkinatpi.js} +1 -1
- package/dist/{thumbs-up-BL3-NenK.js → thumbs-up-CDGW7a4o.js} +1 -1
- package/dist/{toast-store-DkOlYczt.js → toast-store-B94I50AO.js} +1 -1
- package/dist/{tool-CeIWUVUe.js → tool-CUiCeyi1.js} +1 -1
- package/dist/{tooltip-GA-nmg06.js → tooltip-B3wlQSPh.js} +1 -1
- package/dist/{trash-2-CT66QWlm.js → trash-2-Cu8yZmFQ.js} +1 -1
- package/dist/{triangle-alert-CeHLWxhD.js → triangle-alert-CCtDUUmn.js} +1 -1
- package/dist/ui/button-variant-names.d.ts +12 -0
- package/dist/ui/button.d.ts +6 -0
- package/dist/{upload-9Csb0F0J.js → upload-CxotJlLv.js} +1 -1
- package/dist/{use-card-resolution-Zg0a08Z-.js → use-card-resolution-DILUvNyj.js} +1 -1
- package/dist/{variant-aurora-4VBQHIKV.js → variant-aurora-BGaXBBGf.js} +1 -1
- package/dist/{variant-aurora-LE3fqxgw.js → variant-aurora-BLcQmvkd.js} +1 -1
- package/dist/{variant-aurora-DBeCAQNk.js → variant-aurora-DZIfAtx1.js} +2 -2
- package/dist/{variant-aurora-FzHVXHby.js → variant-aurora-DpoIW4ZX.js} +2 -2
- package/dist/{variant-custom-DI5R0rln.js → variant-custom-BhtWdAxE.js} +1 -1
- package/dist/{variant-custom-WWnrrRHS.js → variant-custom-BtApuSyr.js} +2 -2
- package/dist/{variant-custom-BQkNuPpE.js → variant-custom-C-zS4ZtE.js} +2 -2
- package/dist/{variant-custom-AFRGcOBS.js → variant-custom-swi9PXxU.js} +1 -1
- package/dist/{variant-wave-wTP5v_jU.js → variant-wave-7JCIwhpb.js} +1 -1
- package/dist/{variant-wave-nSI2sfII.js → variant-wave-BG4nGr6x.js} +1 -1
- package/dist/{variant-wave-DuQV7DhQ.js → variant-wave-C32lM9G2.js} +2 -2
- package/dist/{variant-wave-DUCbH5oI.js → variant-wave-Dl6jOiK3.js} +2 -2
- package/dist/x-C4niw05N.js +1 -0
- package/frameworks/react/index.tsx +12 -6
- package/llms-full.txt +9 -6
- package/llms.txt +1 -1
- package/package.json +7 -3
- package/solid.css +17 -2
- package/src/elements/element-meta.json +39 -14
- package/dist/action-icons-DaW2pU6m.js +0 -1
- package/dist/arrow-down-D783iMJj.js +0 -1
- package/dist/arrow-left-0VLM5kyg.js +0 -1
- package/dist/assets/dev-5XzXYR21.js +0 -91
- package/dist/button-C_3te6fm.js +0 -1
- package/dist/check-CiEOVnEN.js +0 -1
- package/dist/chevron-down-CSobuZRG.js +0 -1
- package/dist/chevron-right-DR9ZAP-2.js +0 -1
- package/dist/circle-BC66EYF7.js +0 -1
- package/dist/circle-check-BqmahW0O.js +0 -1
- package/dist/controllable-BagRpyHv.js +0 -1
- package/dist/define-CI0y3eE4.js +0 -1
- package/dist/message-BqQ7Ot5q.js +0 -1
- package/dist/message-DkaGfBd8.js +0 -1
- package/dist/message-circle-BPpp5QKv.js +0 -1
- package/dist/message-square-BLbsd9BJ.js +0 -1
- package/dist/play-BXy1u7rW.js +0 -1
- package/dist/register-impl-DvEnhIxx.js +0 -424
- package/dist/x-eiO9V6J6.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as y,h as T,f as N,c as g,j as P,D as Q,A as V,o as H,C as X,S as w,m as x,i as Y,a as Z,b as ee,v as $,t as A}from"./define-B3OpsIDE.js";import{r as te,M as re}from"./slots-DaNjX0rc.js";import{a as z,M as ae,b as ne}from"./message-C88yTu2A.js";import{t as B}from"./toast-store-B94I50AO.js";import{s as oe}from"./speech-CjbWuqG2.js";import{B as O}from"./card-renderer-Ds-wXc6_.js";import{m as ie,B as se}from"./card-tags-D8lZ-C_U.js";function R(e){return e.filter(a=>a.type==="text").map(a=>a.text).join("")}const le=2e3;function _(e){const[a,c]=y({}),[i,s]=y(new Set),m=e.copiedDuration??le,n=new Map;T(()=>{n.forEach(t=>clearTimeout(t)),n.clear()});const u=t=>t.feedback??a()[t.id],h=t=>i().has(t),f=t=>{s(d=>{const l=new Set(d);return l.add(t),l});const o=n.get(t);o&&clearTimeout(o),n.set(t,setTimeout(()=>{n.delete(t),s(d=>{if(!d.has(t))return d;const l=new Set(d);return l.delete(t),l})},m))},b=(t,o)=>{c(d=>{const l={...d};return o===void 0?delete l[t]:l[t]=o,l})};return{resolveFeedback:u,isCopied:h,handleAction:(t,o)=>{var d,l,p;if(o==="copy"){try{(d=navigator.clipboard)==null||d.writeText(R(t.parts))}catch{}f(t.id),B("Copied to clipboard",{target:(l=e.target)==null?void 0:l.call(e)}),e.emit({messageId:t.id,action:o});return}if(o==="like"||o==="dislike"){u(t)===o?(b(t.id,void 0),e.emit({messageId:t.id,action:o,state:"off"})):(b(t.id,o),B("Thanks for your feedback",{target:(p=e.target)==null?void 0:p.call(e)}),e.emit({messageId:t.id,action:o,state:"on"}));return}if(o==="speak"){oe(R(t.parts)),e.emit({messageId:t.id,action:o});return}e.emit({messageId:t.id,action:o})}}}function S(e){return!!e&&typeof e=="object"&&Array.isArray(e.parts)}const ce="each entry needs a 'parts' array (e.g. parts: [{ type: 'text', text: 'Hi' }]). The 'content' string field was removed in 0.20.0.",de=[];function ue(e){const a=new WeakSet;let c=!1,i=!1;return s=>{if(!Array.isArray(s))return s!=null&&!i&&(i=!0,console.error(`<${e}>: 'messages' must be an array. Ignoring it.`)),de;if(s.every(S))return s;let m=0,n=0;for(const u of s)if(!S(u)){if(m++,u!==null&&typeof u=="object"){if(a.has(u))continue;a.add(u)}else{if(c)continue;c=!0}n++}return n>0&&console.error(`<${e}>: skipped ${m} of ${s.length} messages: ${ce}`),s.filter(S)}}var ge=A("<slot name=before-body>"),me=A("<slot name=after-body>"),ve=A("<div part=avatar class=shrink-0><slot name=avatar>"),fe=A("<div>");function D(e,a="auto"){const c=ie(e),i={};for(const s of Object.keys(c)){const m=c[s];i[s]=m===se[s]&&O[s]?O[s]:n=>g(pe,{tag:m,get envelope(){return n.envelope},theme:a})}return i}function pe(e){let a;return P(()=>{a&&(a.data=e.envelope.data,a.cardId=e.envelope.id,e.envelope.title!=null&&(a.heading=e.envelope.title),a.resolution=e.envelope.resolution,a.setAttribute("theme",e.theme),a.setAttribute("data-card-id",e.envelope.id))}),g(Q,{get component(){return e.tag},ref(c){var i=a;typeof i=="function"?i(c):a=c}})}function E(e){const a=e.getAttribute("role");a!==null&&(e.removeAttribute("role"),e.role=a)}N("kai-message",{message:void 0,role:"assistant",markdown:void 0,proseSize:"sm",codeTheme:"github-dark-dimmed",codeHighlight:!0,actionsReveal:"always",avatarSrc:void 0,avatarFallback:void 0,avatar:void 0,cardTypes:void 0,cardSchemas:void 0},(e,{dispatch:a,flag:c,element:i,expose:s})=>{const m=V();E(i);const n=()=>e.message??{id:"message",role:e.role??"assistant",parts:[]};let u;const h=()=>{const r=n();return S(r)?!0:(r!==u&&(u=r,console.error("<kai-message>: 'message' must have a 'parts' array. The 'content' string field was removed in 0.20.0.")),!1)},f=_({emit:r=>a("kai-message-action",r)});s({copy:()=>{h()&&f.handleAction(n(),"copy")}});const[b,t]=y([]),[o,d]=y({});H(()=>{const r=()=>{const K=[...i.querySelectorAll("kai-action")];t(K.map(v=>{var j;return{id:v.id||v.getAttribute("action")||"",label:((j=v.textContent)==null?void 0:j.trim())||v.getAttribute("label")||v.id||"",icon:v.getAttribute("icon")??void 0,tooltip:v.getAttribute("tooltip")??void 0}})),d(te(i,re))};r();const k=new MutationObserver(r);k.observe(i,{childList:!0,attributes:!0,subtree:!0}),T(()=>k.disconnect())}),H(()=>{const r=new MutationObserver(()=>E(i));r.observe(i,{attributes:!0,attributeFilter:["role"]}),T(()=>r.disconnect())});const l=()=>n().role==="user",p=()=>n().avatar??(e.avatarSrc||e.avatarFallback?{src:e.avatarSrc,fallback:e.avatarFallback}:void 0),q=()=>e.avatar==="none",F=()=>!!o().avatar,L=()=>!q()&&(F()||!!p()),I=()=>e.actionsReveal==="hover"?"hover":"always",U=()=>i.hasAttribute("markdown")||e.markdown===!0||e.markdown===!1,W=()=>U()?c("markdown"):!l(),G=()=>[...n().actions??[],...b()],M=()=>g(ae,{get parts(){return n().parts},get cardTypes(){return D(e.cardTypes,e.theme)},get cardSchemas(){return e.cardSchemas},cardHostElement:i,get isUser(){return l()},get markdown(){return W()},get actions(){return G()},get actionsReveal(){return I()},get activeFeedback(){return f.resolveFeedback(n())},get copied(){return f.isCopied(n().id)},onAction:r=>f.handleAction(n(),r),get beforeBody(){return x(()=>!!o()["before-body"])()?(()=>{var r=ge();return r._$owner=$(),r})():void 0},get afterBody(){return x(()=>!!o()["after-body"])()?(()=>{var r=me();return r._$owner=$(),r})():void 0}}),C=()=>I()==="hover"?"group ":"",J=()=>g(w,{get when(){return F()},get fallback(){return g(w,{get when(){return p()},children:r=>g(ne,{get src(){return r().src??""},get alt(){return r().alt??""},get fallback(){return r().fallback}})})},get children(){var r=ve(),k=r.firstChild;return k._$owner=$(),r}});return g(w,{get when(){return h()},get children(){return g(X,{get proseSize(){return e.proseSize},get codeTheme(){return e.codeTheme},get codeHighlight(){return c("codeHighlight")},get portalMount(){return m.portalMount()},get children(){return g(w,{get when(){return L()},get fallback(){return g(z,{get role(){return n().role},get class(){return`${C()}${l()?"flex-col items-end":"flex-col items-start"}`},get children(){return M()}})},get children(){return g(z,{get role(){return n().role},get class(){return C()},get children(){return[x(()=>J()),(()=>{var r=fe();return Y(r,M),Z(()=>ee(r,`flex min-w-0 flex-1 flex-col ${l()?"items-end":"items-start"}`)),r})()]}})}})}})}})});export{D as a,ue as b,_ as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as S,p as A,q as B,m as w,i as g,k as D,c as r,S as c,r as F,M as o,F as z,a as x,d as k,I as E,b as j,t as u,A as H,Q as q,e as L}from"./define-B3OpsIDE.js";import{T as N}from"./tooltip-B3wlQSPh.js";import{c as h}from"./cn-DN5AWfiS.js";import{M as P}from"./markdown-DjEaoNz-.js";import{B as Q}from"./button-BM0YTTDQ.js";import{B as _,a as C}from"./action-icons-xkBBVKkF.js";import{R as $,a as G,b as J}from"./reasoning-DARmbgmE.js";import{L as K}from"./loader-BdFK70fF.js";import{T as V}from"./tool-CUiCeyi1.js";import{A as W,a as X,b as Y,c as Z,d as ee,e as re,f as te,g as O,h as ne}from"./attachments-BLWPDiLH.js";import{S as ae,a as ie,b as se,c as le}from"./source-Da1TFiuj.js";import{a as ce}from"./card-renderer-Ds-wXc6_.js";import{c as oe}from"./check-BG1VfYjm.js";var ue=u("<div part=row>"),de=u('<img class="h-full w-full object-cover">'),ge=u("<div part=avatar>"),he=u('<div class="flex h-full w-full items-center justify-center bg-muted text-xs font-medium text-muted-foreground">'),R=u("<div>"),me=u('<span class="px-1 text-xs">'),fe=u('<span><span class="min-w-0 overflow-hidden">'),pe=u('<img class="block max-h-64 max-w-xs rounded object-contain">'),ve=u('<div class="text-body font-medium">'),be=u('<div class="text-muted-foreground text-caption">');const ke={user:"User message",assistant:"Assistant message",system:"System message"};function we(e){const[t,n]=S(e,["children","class","role"]);return(()=>{var a=ue();return A(a,B({get class(){return h("flex items-start gap-3",t.class)},get"data-role"(){return t.role},get role(){return t.role?"article":void 0},get"aria-label"(){return w(()=>!!t.role)()?ke[t.role]:void 0}},n),!1,!0),g(a,()=>t.children),a})()}function xe(e){return(()=>{var t=ge();return g(t,r(c,{get when(){return e.src},get fallback(){return r(c,{get when(){return e.fallback},get children(){var n=he();return g(n,()=>e.fallback),n}})},get children(){var n=de();return x(a=>{var i=e.src,s=e.alt??"";return i!==a.e&&k(n,"src",a.e=i),s!==a.t&&k(n,"alt",a.t=s),a},{e:void 0,t:void 0}),n}})),x(()=>j(t,h("h-8 w-8 shrink-0 overflow-hidden rounded-full",e.class))),t})()}function ye(e){const[t,n]=S(e,["children","markdown","class","part"]),a=H(),i=()=>h("min-w-0 rounded-lg p-2 text-foreground bg-secondary max-w-none break-words whitespace-normal",q(a.proseSize()),t.class);return r(c,{get when(){return t.markdown},get fallback(){return(()=>{var s=R();return A(s,B({get part(){return t.part},get class(){return i()}},n),!1,!0),g(s,()=>t.children),s})()},get children(){return r(P,{get part(){return t.part},get content(){return t.children},get class(){return i()}})}})}function Se(e){const[t,n]=S(e,["children","class"]);return(()=>{var a=R();return A(a,B({get class(){return h("flex items-center gap-0.5 mt-0.5",t.class)}},n),!1,!0),g(a,()=>t.children),a})()}function Ae(e){return typeof e=="string"?{id:e,label:_[e],Icon:C(e)}:{id:e.id,label:e.label,Icon:C(e.icon)}}function Be(e){return e==="like"||e==="dislike"?e:void 0}function Fe(e){return r(Se,{part:"actions",get class(){return h("mt-1 flex gap-0",e.reveal==="hover"&&"opacity-0 transition-opacity group-hover:opacity-100",e.class)},get children(){return r(z,{get each(){return e.actions},children:t=>{const n=Ae(t),a=()=>typeof t!="string"&&t.tooltip?t.tooltip:n.label,i=Be(t),s=()=>i!==void 0&&e.activeFeedback===i,d=n.id==="copy",m=()=>d&&e.copied===!0,l=()=>r(Q,{variant:"ghost",size:"icon-sm",get class(){return h("rounded-full",s()&&"text-primary")},get"data-action"(){return n.id},get"aria-label"(){return w(()=>!!m())()?"Copied":n.label},get"aria-pressed"(){return i!==void 0?s():void 0},onClick:()=>e.onAction(n.id),get children(){return r(c,{get when(){return m()},get fallback(){return r(c,{get when(){return n.Icon},get fallback(){return(()=>{var f=me();return g(f,()=>n.label),f})()},children:f=>{const p=f();return r(p,{get class(){return h("size-3.5",s()&&"fill-current")}})}})},get children(){return r(oe,{class:"size-3.5 text-emerald-400"})}})}}),v=()=>r(c,{get when(){return n.Icon},get fallback(){return l()},get children(){return r(N,{get content(){return a()},get children(){return l()}})}});return r(c,{when:i!==void 0,get fallback(){return v()},get children(){return(()=>{const f=()=>e.activeFeedback===void 0||e.activeFeedback===i;return(()=>{var p=fe(),U=p.firstChild;return g(U,v),x(b=>{var M=f()?void 0:"",T=h("grid transition-[grid-template-columns,opacity] duration-300 ease-out",f()?"grid-cols-[1fr] opacity-100":"grid-cols-[0fr] opacity-0");return M!==b.e&&k(p,"data-feedback-collapsed",b.e=M),T!==b.t&&j(p,b.t=T),b},{e:void 0,t:void 0}),p})()})()}})}})}})}function ze(e){const t=[];for(const n of e){if(n.type==="file"){const a=t[t.length-1];if(a?.kind==="files"){t[t.length-1]={kind:"files",parts:[...a.parts,n]};continue}t.push({kind:"files",parts:[n]});continue}if(n.type==="source"){const a=t[t.length-1];if(a?.kind==="sources"){t[t.length-1]={kind:"sources",parts:[...a.parts,n]};continue}t.push({kind:"sources",parts:[n]});continue}t.push({kind:"single",part:n})}return t}function Ie(e){if(e.index!==void 0)return e.index;if(!e.url)return e.title||"Source"}function Me(e){return e.title||e.url||"Source"}function I(e,t){return e.kind===t?e:!1}function y(e,t){return e.type===t?e:!1}function Te(e){const t=D(()=>ze(e.parts).filter(n=>!(e.hideSources===!0&&n.kind==="sources")));return[r(c,{get when(){return e.beforeBody},get children(){return e.beforeBody}}),r(E,{get each(){return t()},children:n=>r(F,{fallback:null,get children(){return[r(o,{get when(){return I(n(),"files")},children:a=>r(W,{variant:"grid",get class(){return e.isUser?"mb-2 ml-auto":"mb-2"},get children(){return r(z,{get each(){return a().parts},children:i=>r(X,{get data(){return i.attachment},get children(){return r(Y,{get children(){return[r(Z,{class:"block size-full",get children(){return[r(ee,{}),r(re,{})]}}),r(te,{get children(){return r(c,{get when(){return w(()=>ne(i.attachment)==="image"&&i.attachment.type==="file")()&&i.attachment.url},get fallback(){return[(()=>{var s=ve();return g(s,()=>O(i.attachment)),s})(),r(c,{get when(){return i.attachment.mediaType},get children(){var s=be();return g(s,()=>i.attachment.mediaType),s}})]},get children(){var s=pe();return x(d=>{var m=O(i.attachment),l=i.attachment.url;return m!==d.e&&k(s,"alt",d.e=m),l!==d.t&&k(s,"src",d.t=l),d},{e:void 0,t:void 0}),s}})}})]}})}})})}})}),r(o,{get when(){return I(n(),"sources")},children:a=>r(ae,{part:"citations",get class(){return e.isUser?"justify-end":void 0},get children(){return r(z,{get each(){return a().parts},children:i=>r(ie,{get href(){return i.source.url},get children(){return[r(se,{get label(){return Ie(i.source)}}),r(le,{get title(){return Me(i.source)},get description(){return i.source.snippet??""}})]}})})}})}),r(o,{get when(){return I(n(),"single")},children:a=>{const i=()=>a().part,s=()=>y(i(),"reasoning"),d=()=>{const l=s();return l!==!1&&l.text===""},m=()=>{const l=s();return l!==!1&&l.text!==""&&l};return r(F,{fallback:null,get children(){return[r(o,{get when(){return y(i(),"text")},children:l=>r(ye,{part:"bubble content",get markdown(){return e.markdown},get class(){return e.isUser?"bg-muted max-w-[85%] rounded-2xl px-4 py-2":"bg-transparent p-0"},get children(){return l().text}})}),r(o,{get when(){return d()},children:null}),r(o,{get when(){return m()},children:l=>{const v=()=>e.reasoningMode??"full";return r(F,{fallback:null,get children(){return[r(o,{get when(){return v()==="full"},get children(){return r($,{class:"mb-2 w-full",get isStreaming(){return e.isStreaming},get defaultOpen(){return e.reasoningDefaultOpen},get openOnStream(){return e.reasoningDefaultOpen},get children(){return[r(G,{get children(){return l().label??"Reasoning"}}),r(J,{markdown:!0,get children(){return l().text}})]}})}}),r(o,{get when(){return w(()=>v()==="compact")()&&e.isStreaming},get children(){return r(K,{variant:"text-shimmer",get text(){return l().label??"Reasoning"},class:"mb-2"})}})]}})}}),r(o,{get when(){return y(i(),"tool")},children:l=>r(V,{get toolPart(){return l().tool},class:"mb-2 w-full"})}),r(o,{get when(){return y(i(),"card")},children:l=>r(ce,{get envelope(){return l().envelope},get types(){return e.cardTypes},get schemas(){return e.cardSchemas},get hostElement(){return e.cardHostElement}})})]}})}})]}})}),r(c,{get when(){var n;return(((n=e.actions)==null?void 0:n.length)??0)>0},get children(){return r(Fe,{get actions(){return e.actions},get reveal(){return e.actionsReveal==="hover"?"hover":"always"},get activeFeedback(){return e.activeFeedback},get copied(){return e.copied},onAction:n=>{var a;return(a=e.onAction)==null?void 0:a.call(e,n)}})}}),r(c,{get when(){return e.afterBody},get children(){return e.afterBody}})]}L(["click"]);export{Te as M,we as a,xe as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as o}from"./Icon-DJDuE_-x.js";import{c as r,q as s}from"./define-B3OpsIDE.js";var e=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],m=a=>r(o,s(a,{name:"MessageCircle",iconNode:e})),i=m;export{i as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./Icon-DJDuE_-x.js";import{c as o,q as r}from"./define-B3OpsIDE.js";var m=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],s=a=>o(e,r(a,{name:"MessageSquare",iconNode:m})),i=s;export{i as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as i}from"./Icon-
|
|
1
|
+
import{I as i}from"./Icon-DJDuE_-x.js";import{c as n,q as y}from"./define-B3OpsIDE.js";var o=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],a=e=>n(i,y(e,{name:"Maximize2",iconNode:o})),l=a,m=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],p=e=>n(i,y(e,{name:"Minimize2",iconNode:m})),x=p;export{l as a,x as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as y,c as n,q as k,m as O,F as h,g as R,i as s,S as p,a as f,d as x,b as B,t as u,e as S}from"./define-
|
|
1
|
+
import{s as y,c as n,q as k,m as O,F as h,g as R,i as s,S as p,a as f,d as x,b as B,t as u,e as S}from"./define-B3OpsIDE.js";import{c as v}from"./cn-DN5AWfiS.js";import{c as j,D as q,a as z,d as D}from"./dropdown-CSRhiMN2.js";import{B as F}from"./button-BM0YTTDQ.js";var $=u('<svg width=12 height=12 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="6 9 12 15 18 9">'),A=u('<span class="text-caption text-muted-foreground">'),E=u('<div class="flex flex-col"><span>'),J=u("<div class=pl-2>"),P=u('<div><button type=button class="flex w-full items-center justify-between rounded-md px-2 py-1.5 text-body outline-none transition-colors hover:bg-muted focus:bg-muted">');const C=o=>(()=>{var e=$();return f(()=>x(e,"class",o.class)),e})();function b(o){const e=()=>o.model.description??o.model.provider,c=()=>o.model.id===o.currentModelId;return n(D,{get checked(){return c()},onSelect:()=>{o.onModelChange(o.model.id),o.onClose()},get children(){var d=E(),a=d.firstChild;return s(a,()=>o.model.name),s(d,n(p,{get when(){return e()},get children(){var i=A();return s(i,e),i}}),null),f(()=>B(a,v("text-body",c()&&"font-medium text-foreground"))),d}})}function _(o){const[e]=y(o,["models","currentModelId","onModelChange","class","defaultOpen","disabled","controllerRef"]),c=()=>e.models.find(r=>r.id===e.currentModelId);let d;const a=()=>d?.setOpen(!1),i=()=>e.models.filter(r=>!r.group),w=()=>{const r=[],t=new Map;for(const l of e.models)l.group&&(t.has(l.group)||(t.set(l.group,[]),r.push(l.group)),t.get(l.group).push(l));return r.map(l=>({name:l,models:t.get(l)}))};return n(p,{get when(){return e.models.length>1},get children(){return n(j,{get defaultOpen(){return e.defaultOpen},get disabled(){return e.disabled},controllerRef:r=>{var t;d=r,(t=e.controllerRef)==null||t.call(e,r)},get children(){return[n(q,{as:r=>n(F,k({variant:"ghost",size:"sm",get class(){return v("gap-1 text-meta text-muted-foreground",e.class)}},r,{get children(){return[O(()=>{var t;return((t=c())==null?void 0:t.name)??e.currentModelId}),n(C,{})]}}))}),n(z,{get children(){return[n(h,{get each(){return i()},children:r=>n(b,{model:r,get currentModelId(){return e.currentModelId},get onModelChange(){return e.onModelChange},onClose:a})}),n(h,{get each(){return w()},children:r=>{const[t,l]=R(!1);return(()=>{var m=P(),g=m.firstChild;return g.$$click=()=>l(!t()),s(g,()=>r.name,null),s(g,n(C,{get class(){return v("transition-transform",t()&&"rotate-180")}}),null),s(m,n(p,{get when(){return t()},get children(){var M=J();return s(M,n(h,{get each(){return r.models},children:I=>n(b,{model:I,get currentModelId(){return e.currentModelId},get onModelChange(){return e.onModelChange},onClose:a})})),M}}),null),f(()=>x(g,"aria-expanded",t())),m})()}})]}})]}})}})}S(["click"]);export{_ as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as It,c as jt,q as Xt,D as _t,g as tt,j as ut,h as dt}from"./define-CI0y3eE4.js";const Yt=["top","right","bottom","left"],X=Math.min,$=Math.max,ot=Math.round,it=Math.floor,A=t=>({x:t,y:t}),Jt={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(t,e,n){return $(t,X(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Et(t){return t==="x"?"y":"x"}function ht(t){return t==="y"?"height":"width"}function M(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function pt(t){return Et(M(t))}function Gt(t,e,n){n===void 0&&(n=!1);const o=et(t),i=pt(t),c=ht(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[c]>e.floating[c]&&(r=rt(r)),[r,rt(r)]}function Kt(t){const e=rt(t);return[gt(t),e,gt(e)]}function gt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Lt=["left","right"],Ot=["right","left"],Ut=["top","bottom"],Qt=["bottom","top"];function Zt(t,e,n){switch(t){case"top":case"bottom":return n?e?Ot:Lt:e?Lt:Ot;case"left":case"right":return e?Ut:Qt;default:return[]}}function te(t,e,n,o){const i=et(t);let c=Zt(q(t),n==="start",o);return i&&(c=c.map(r=>r+"-"+i),e&&(c=c.concat(c.map(gt)))),c}function rt(t){const e=q(t);return Jt[e]+t.slice(e.length)}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function ct(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Dt(t,e,n){let{reference:o,floating:i}=t;const c=M(e),r=pt(e),s=ht(r),a=q(e),l=c==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(et(e)){case"start":f[r]-=m*(n&&l?-1:1);break;case"end":f[r]+=m*(n&&l?-1:1);break}return f}async function ne(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:c,rects:r,elements:s,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=_(e,t),h=Tt(f),p=s[m?d==="floating"?"reference":"floating":d],y=ct(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(p)))==null||n?p:p.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:a})),g=d==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,w=await(c.getOffsetParent==null?void 0:c.getOffsetParent(s.floating)),x=await(c.isElement==null?void 0:c.isElement(w))?await(c.getScale==null?void 0:c.getScale(w))||{x:1,y:1}:{x:1,y:1},v=ct(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:w,strategy:a}):g);return{top:(y.top-v.top+h.top)/x.y,bottom:(v.bottom-y.bottom+h.bottom)/x.y,left:(y.left-v.left+h.left)/x.x,right:(v.right-y.right+h.right)/x.x}}const oe=50,ie=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:c=[],platform:r}=n,s=r.detectOverflow?r:{...r,detectOverflow:ne},a=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Dt(l,o,a),m=o,f=0;const h={};for(let p=0;p<c.length;p++){const y=c[p];if(!y)continue;const{name:g,fn:w}=y,{x,y:v,data:E,reset:b}=await w({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});u=x??u,d=v??d,h[g]={...h[g],...E},b&&f<oe&&(f++,typeof b=="object"&&(b.placement&&(m=b.placement),b.rects&&(l=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:u,y:d}=Dt(l,m,a)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:h}},re=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:c,platform:r,elements:s,middlewareData:a}=e,{element:l,padding:u=0}=_(t,e)||{};if(l==null)return{};const d=Tt(u),m={x:n,y:o},f=pt(i),h=ht(f),p=await r.getDimensions(l),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=c.reference[h]+c.reference[f]-m[f]-c.floating[h],E=m[f]-c.reference[f],b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l));let B=b?b[x]:0;(!B||!await(r.isElement==null?void 0:r.isElement(b)))&&(B=s.floating[x]||c.floating[h]);const U=v/2-E/2,N=B/2-p[h]/2-1,S=X(d[g],N),Q=X(d[w],N),V=S,Z=B-p[h]-Q,R=B/2-p[h]/2+U,z=mt(V,R,Z),k=!a.arrow&&et(i)!=null&&R!==z&&c.reference[h]/2-(R<V?S:Q)-p[h]/2<0,L=k?R<V?R-V:R-Z:0;return{[f]:m[f]+L,data:{[f]:z,centerOffset:R-z-L,...k&&{alignmentOffset:L}},reset:k}}}),ce=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:c,rects:r,initialPlacement:s,platform:a,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...y}=_(t,e);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const g=q(i),w=M(s),x=q(s)===s,v=await(a.isRTL==null?void 0:a.isRTL(l.floating)),E=m||(x||!p?[rt(s)]:Kt(s)),b=h!=="none";!m&&b&&E.push(...te(s,p,h,v));const B=[s,...E],U=await a.detectOverflow(e,y),N=[];let S=((o=c.flip)==null?void 0:o.overflows)||[];if(u&&N.push(U[g]),d){const R=Gt(i,r,v);N.push(U[R[0]],U[R[1]])}if(S=[...S,{placement:i,overflows:N}],!N.every(R=>R<=0)){var Q,V;const R=(((Q=c.flip)==null?void 0:Q.index)||0)+1,z=B[R];if(z&&(!(d==="alignment"&&w!==M(z))||S.every(L=>M(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:R,overflows:S},reset:{placement:z}};let k=(V=S.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:V.placement;if(!k)switch(f){case"bestFit":{var Z;const L=(Z=S.filter(P=>{if(b){const H=M(P.placement);return H===w||H==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(H=>H>0).reduce((H,qt)=>H+qt,0)]).sort((P,H)=>P[1]-H[1])[0])==null?void 0:Z[0];L&&(k=L);break}case"initialPlacement":k=s;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function At(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ct(t){return Yt.some(e=>t[e]>=0)}const se=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...c}=_(t,e);switch(i){case"referenceHidden":{const r=await o.detectOverflow(e,{...c,elementContext:"reference"}),s=At(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ct(s)}}}case"escaped":{const r=await o.detectOverflow(e,{...c,altBoundary:!0}),s=At(r,n.floating);return{data:{escapedOffsets:s,escaped:Ct(s)}}}default:return{}}}}},le=new Set(["left","top"]);async function ae(t,e){const{placement:n,platform:o,elements:i}=t,c=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=q(n),s=et(n),a=M(n)==="y",l=le.has(r)?-1:1,u=c&&a?-1:1,d=_(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof h=="number"&&(f=s==="end"?h*-1:h),a?{x:f*u,y:m*l}:{x:m*l,y:f*u}}const fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:c,placement:r,middlewareData:s}=e,a=await ae(e,t);return r===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:c+a.y,data:{...a,placement:r}}}}},ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:c}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:w,y:x}=g;return{x:w,y:x}}},...l}=_(t,e),u={x:n,y:o},d=await c.detectOverflow(e,l),m=M(q(i)),f=Et(m);let h=u[f],p=u[m];if(r){const g=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=h+d[g],v=h-d[w];h=mt(x,h,v)}if(s){const g=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+d[g],v=p-d[w];p=mt(x,p,v)}const y=a.fn({...e,[f]:h,[m]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[f]:r,[m]:s}}}}}};function st(){return typeof window<"u"}function Y(t){return St(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function C(t){var e;return(e=(St(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function St(t){return st()?t instanceof Node||t instanceof O(t).Node:!1}function T(t){return st()?t instanceof Element||t instanceof O(t).Element:!1}function F(t){return st()?t instanceof HTMLElement||t instanceof O(t).HTMLElement:!1}function kt(t){return!st()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof O(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=D(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function de(t){return/^(table|td|th)$/.test(Y(t))}function lt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const me=/transform|translate|scale|rotate|perspective|filter/,he=/paint|layout|strict|content/,I=t=>!!t&&t!=="none";let yt;function wt(t){const e=T(t)?D(t):t;return I(e.transform)||I(e.translate)||I(e.scale)||I(e.rotate)||I(e.perspective)||!xt()&&(I(e.backdropFilter)||I(e.filter))||me.test(e.willChange||"")||he.test(e.contain||"")}function pe(t){let e=W(t);for(;F(e)&&!J(e);){if(wt(e))return e;if(lt(e))return null;e=W(e)}return null}function xt(){return yt==null&&(yt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yt}function J(t){return/^(html|body|#document)$/.test(Y(t))}function D(t){return O(t).getComputedStyle(t)}function at(t){return T(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if(Y(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||C(t);return kt(e)?e.host:e}function Ft(t){const e=W(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&nt(e)?e:Ft(e)}function G(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ft(t),c=i===((o=t.ownerDocument)==null?void 0:o.body),r=O(i);if(c){const s=vt(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],s&&n?G(s):[])}else return e.concat(i,G(i,[],n))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Pt(t){const e=D(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),c=i?t.offsetWidth:n,r=i?t.offsetHeight:o,s=ot(n)!==c||ot(o)!==r;return s&&(n=c,o=r),{width:n,height:o,$:s}}function bt(t){return T(t)?t:t.contextElement}function K(t){const e=bt(t);if(!F(e))return A(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:c}=Pt(e);let r=(c?ot(n.width):n.width)/o,s=(c?ot(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const ge=A(0);function Ht(t){const e=O(t);return!xt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==O(t)?!1:e}function j(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),c=bt(t);let r=A(1);e&&(o?T(o)&&(r=K(o)):r=K(t));const s=ye(c,n,o)?Ht(c):A(0);let a=(i.left+s.x)/r.x,l=(i.top+s.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(c){const m=O(c),f=o&&T(o)?O(o):o;let h=m,p=vt(h);for(;p&&o&&f!==h;){const y=K(p),g=p.getBoundingClientRect(),w=D(p),x=g.left+(p.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(p.clientTop+parseFloat(w.paddingTop))*y.y;a*=y.x,l*=y.y,u*=y.x,d*=y.y,a+=x,l+=v,h=O(p),p=vt(h)}}return ct({width:u,height:d,x:a,y:l})}function ft(t,e){const n=at(t).scrollLeft;return e?e.left+n:j(C(t)).left+n}function Mt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ft(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function we(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const c=i==="fixed",r=C(o),s=e?lt(e.floating):!1;if(o===r||s&&c)return n;let a={scrollLeft:0,scrollTop:0},l=A(1);const u=A(0),d=F(o);if((d||!d&&!c)&&((Y(o)!=="body"||nt(r))&&(a=at(o)),d)){const f=j(o);l=K(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const m=r&&!d&&!c?Mt(r,a):A(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+m.x,y:n.y*l.y-a.scrollTop*l.y+u.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){const e=C(t),n=at(t),o=t.ownerDocument.body,i=$(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),c=$(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+ft(t);const s=-n.scrollTop;return D(o).direction==="rtl"&&(r+=$(e.clientWidth,o.clientWidth)-i),{width:i,height:c,x:r,y:s}}const Wt=25;function be(t,e){const n=O(t),o=C(t),i=n.visualViewport;let c=o.clientWidth,r=o.clientHeight,s=0,a=0;if(i){c=i.width,r=i.height;const u=xt();(!u||u&&e==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const l=ft(o);if(l<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-d.clientWidth-f);h<=Wt&&(c-=h)}else l<=Wt&&(c+=l);return{width:c,height:r,x:s,y:a}}function Re(t,e){const n=j(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,c=F(t)?K(t):A(1),r=t.clientWidth*c.x,s=t.clientHeight*c.y,a=i*c.x,l=o*c.y;return{width:r,height:s,x:a,y:l}}function Bt(t,e,n){let o;if(e==="viewport")o=be(t,n);else if(e==="document")o=ve(C(t));else if(T(e))o=Re(e,n);else{const i=Ht(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ct(o)}function Nt(t,e){const n=W(t);return n===e||!T(n)||J(n)?!1:D(n).position==="fixed"||Nt(n,e)}function Ee(t,e){const n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(s=>T(s)&&Y(s)!=="body"),i=null;const c=D(t).position==="fixed";let r=c?W(t):t;for(;T(r)&&!J(r);){const s=D(r),a=wt(r);!a&&s.position==="fixed"&&(i=null),(c?!a&&!i:!a&&s.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||nt(r)&&!a&&Nt(t,r))?o=o.filter(l=>l!==r):i=s,r=W(r)}return e.set(t,o),o}function Le(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const c=[...n==="clippingAncestors"?lt(e)?[]:Ee(e,this._c):[].concat(n),o],r=Bt(e,c[0],i);let s=r.top,a=r.right,l=r.bottom,u=r.left;for(let d=1;d<c.length;d++){const m=Bt(e,c[d],i);s=$(m.top,s),a=X(m.right,a),l=X(m.bottom,l),u=$(m.left,u)}return{width:a-u,height:l-s,x:u,y:s}}function Oe(t){const{width:e,height:n}=Pt(t);return{width:e,height:n}}function Te(t,e,n){const o=F(e),i=C(e),c=n==="fixed",r=j(t,!0,c,e);let s={scrollLeft:0,scrollTop:0};const a=A(0);function l(){a.x=ft(i)}if(o||!o&&!c)if((Y(e)!=="body"||nt(i))&&(s=at(e)),o){const f=j(e,!0,c,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else i&&l();c&&!o&&i&&l();const u=i&&!o&&!c?Mt(i,s):A(0),d=r.left+s.scrollLeft-a.x-u.x,m=r.top+s.scrollTop-a.y-u.y;return{x:d,y:m,width:r.width,height:r.height}}function Rt(t){return D(t).position==="static"}function Vt(t,e){if(!F(t)||D(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return C(t)===n&&(n=n.ownerDocument.body),n}function zt(t,e){const n=O(t);if(lt(t))return n;if(!F(t)){let i=W(t);for(;i&&!J(i);){if(T(i)&&!Rt(i))return i;i=W(i)}return n}let o=Vt(t,e);for(;o&&de(o)&&Rt(o);)o=Vt(o,e);return o&&J(o)&&Rt(o)&&!wt(o)?n:o||pe(t)||n}const De=async function(t){const e=this.getOffsetParent||zt,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ae(t){return D(t).direction==="rtl"}const Ce={convertOffsetParentRelativeRectToViewportRelativeRect:we,getDocumentElement:C,getClippingRect:Le,getOffsetParent:zt,getElementRects:De,getClientRects:xe,getDimensions:Oe,getScale:K,isElement:T,isRTL:Ae};function $t(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Se(t,e){let n=null,o;const i=C(t);function c(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function r(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),c();const l=t.getBoundingClientRect(),{left:u,top:d,width:m,height:f}=l;if(s||e(),!m||!f)return;const h=it(d),p=it(i.clientWidth-(u+m)),y=it(i.clientHeight-(d+f)),g=it(u),w={rootMargin:-h+"px "+-p+"px "+-y+"px "+-g+"px",threshold:$(0,X(1,a))||1};let x=!0;function v(E){const b=E[0].intersectionRatio;if(b!==a){if(!x)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}b===1&&!$t(l,t.getBoundingClientRect())&&r(),x=!1}try{n=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,w)}n.observe(t)}return r(!0),c}function ke(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=bt(t),u=i||c?[...l?G(l):[],...e?G(e):[]]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),c&&g.addEventListener("resize",n)});const d=l&&s?Se(l,n):null;let m=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===l&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),l&&!a&&f.observe(l),e&&f.observe(e));let h,p=a?j(t):null;a&&y();function y(){const g=j(t);p&&!$t(p,g)&&n(),p=g,h=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),c&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,a&&cancelAnimationFrame(h)}}const Fe=fe,Pe=ue,He=ce,Me=se,We=re,Be=(t,e,n)=>{const o=new Map,i={platform:Ce,...n},c={...i.platform,_c:o};return ie(t,e,{...i,platform:c})};function Ne(t){const[e,n]=tt(t()),[o,i]=tt(t()?"open":"closed");let c,r=0;const s=a=>{c=a};return ut(a=>{const l=t();if(l)r++,n(!0),i("open");else if(a){i("closed");const u=c,d=u&&(()=>{const h=getComputedStyle(u);return h.animationName!=="none"&&parseFloat(h.animationDuration||"0")>0})();if(!u||!d){const h=++r;return queueMicrotask(()=>{h===r&&n(!1)}),l}const m=u,f=h=>{h.target===m&&(m.removeEventListener("animationend",f),n(!1))};m.addEventListener("animationend",f),dt(()=>m.removeEventListener("animationend",f))}return l}),{present:e,state:o,setRef:s}}function Ve(t){const[e,n]=It(t,["as"]);return typeof e.as=="function"?e.as(n):jt(_t,Xt({get component(){return e.as??"span"}},n))}function ze(t){let e=t;for(;e;){if(e instanceof Element&&e.closest("[inert]"))return!0;const n=e.getRootNode();e=n instanceof ShadowRoot?n.host:null}return!1}function $e(t,e){if(typeof MutationObserver!="function")return()=>{};let n=!1;const o=()=>t.isConnected&&!ze(t);let i=o();const c=()=>{if(!n){if(o()){i=!0;return}i&&(n=!0,r.disconnect(),e())}},r=new MutationObserver(c),s=new Set;typeof document<"u"&&s.add(document);const a=t.getRootNode();a&&s.add(a);for(const l of s)try{r.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]})}catch{}return()=>r.disconnect()}function qe(t,e,n={}){const[o,i]=tt({x:0,y:0,placement:n.placement??"bottom"}),[c,r]=tt({}),[s,a]=tt(!1);return ut(()=>{const l=t(),u=e();if(!l||!u)return;const d=()=>{var p;const y=[Fe(n.gutter??8),He(),Pe({padding:8})],g=(p=n.arrowEl)==null?void 0:p.call(n);g&&y.push(We({element:g})),y.push(Me()),Be(l,u,{placement:n.placement??"bottom",strategy:"fixed",middleware:y}).then(({x:w,y:x,placement:v,middlewareData:E})=>{var b;i({x:w,y:x,placement:v}),E.arrow&&r({x:E.arrow.x,y:E.arrow.y}),a(!!((b=E.hide)!=null&&b.referenceHidden))})},m=ke(l,u,d);let f;if(typeof ResizeObserver=="function"&&l instanceof Element){f=new ResizeObserver(d),f.observe(l);for(const p of G(l))p instanceof Element&&f.observe(p)}const h=n.onDisconnect?$e(l,n.onDisconnect):void 0;dt(()=>{m(),f?.disconnect(),h?.()})}),{pos:o,arrowPos:c,hidden:s}}function Ie(t){ut(()=>{if(!t.enabled())return;const e=i=>{i.key==="Escape"&&t.onDismiss("escape")},n=i=>{const c=i.target;t.refs().some(r=>r&&r.contains(c))||t.onDismiss("outside")},o=document;o.addEventListener("keydown",e),o.addEventListener("pointerdown",n,!0),dt(()=>{o.removeEventListener("keydown",e),o.removeEventListener("pointerdown",n,!0)})})}export{Ve as A,Ie as a,Ne as c,qe as u};
|
|
1
|
+
import{s as It,c as jt,q as Xt,D as _t,g as tt,j as ut,h as dt}from"./define-B3OpsIDE.js";const Yt=["top","right","bottom","left"],X=Math.min,$=Math.max,ot=Math.round,it=Math.floor,A=t=>({x:t,y:t}),Jt={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(t,e,n){return $(t,X(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Et(t){return t==="x"?"y":"x"}function ht(t){return t==="y"?"height":"width"}function M(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function pt(t){return Et(M(t))}function Gt(t,e,n){n===void 0&&(n=!1);const o=et(t),i=pt(t),c=ht(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[c]>e.floating[c]&&(r=rt(r)),[r,rt(r)]}function Kt(t){const e=rt(t);return[gt(t),e,gt(e)]}function gt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Lt=["left","right"],Ot=["right","left"],Ut=["top","bottom"],Qt=["bottom","top"];function Zt(t,e,n){switch(t){case"top":case"bottom":return n?e?Ot:Lt:e?Lt:Ot;case"left":case"right":return e?Ut:Qt;default:return[]}}function te(t,e,n,o){const i=et(t);let c=Zt(q(t),n==="start",o);return i&&(c=c.map(r=>r+"-"+i),e&&(c=c.concat(c.map(gt)))),c}function rt(t){const e=q(t);return Jt[e]+t.slice(e.length)}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function ct(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Dt(t,e,n){let{reference:o,floating:i}=t;const c=M(e),r=pt(e),s=ht(r),a=q(e),l=c==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(et(e)){case"start":f[r]-=m*(n&&l?-1:1);break;case"end":f[r]+=m*(n&&l?-1:1);break}return f}async function ne(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:c,rects:r,elements:s,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=_(e,t),h=Tt(f),p=s[m?d==="floating"?"reference":"floating":d],y=ct(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(p)))==null||n?p:p.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:a})),g=d==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,w=await(c.getOffsetParent==null?void 0:c.getOffsetParent(s.floating)),x=await(c.isElement==null?void 0:c.isElement(w))?await(c.getScale==null?void 0:c.getScale(w))||{x:1,y:1}:{x:1,y:1},v=ct(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:w,strategy:a}):g);return{top:(y.top-v.top+h.top)/x.y,bottom:(v.bottom-y.bottom+h.bottom)/x.y,left:(y.left-v.left+h.left)/x.x,right:(v.right-y.right+h.right)/x.x}}const oe=50,ie=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:c=[],platform:r}=n,s=r.detectOverflow?r:{...r,detectOverflow:ne},a=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Dt(l,o,a),m=o,f=0;const h={};for(let p=0;p<c.length;p++){const y=c[p];if(!y)continue;const{name:g,fn:w}=y,{x,y:v,data:E,reset:b}=await w({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});u=x??u,d=v??d,h[g]={...h[g],...E},b&&f<oe&&(f++,typeof b=="object"&&(b.placement&&(m=b.placement),b.rects&&(l=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:u,y:d}=Dt(l,m,a)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:h}},re=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:c,platform:r,elements:s,middlewareData:a}=e,{element:l,padding:u=0}=_(t,e)||{};if(l==null)return{};const d=Tt(u),m={x:n,y:o},f=pt(i),h=ht(f),p=await r.getDimensions(l),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=c.reference[h]+c.reference[f]-m[f]-c.floating[h],E=m[f]-c.reference[f],b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l));let B=b?b[x]:0;(!B||!await(r.isElement==null?void 0:r.isElement(b)))&&(B=s.floating[x]||c.floating[h]);const U=v/2-E/2,N=B/2-p[h]/2-1,S=X(d[g],N),Q=X(d[w],N),V=S,Z=B-p[h]-Q,R=B/2-p[h]/2+U,z=mt(V,R,Z),k=!a.arrow&&et(i)!=null&&R!==z&&c.reference[h]/2-(R<V?S:Q)-p[h]/2<0,L=k?R<V?R-V:R-Z:0;return{[f]:m[f]+L,data:{[f]:z,centerOffset:R-z-L,...k&&{alignmentOffset:L}},reset:k}}}),ce=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:c,rects:r,initialPlacement:s,platform:a,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...y}=_(t,e);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const g=q(i),w=M(s),x=q(s)===s,v=await(a.isRTL==null?void 0:a.isRTL(l.floating)),E=m||(x||!p?[rt(s)]:Kt(s)),b=h!=="none";!m&&b&&E.push(...te(s,p,h,v));const B=[s,...E],U=await a.detectOverflow(e,y),N=[];let S=((o=c.flip)==null?void 0:o.overflows)||[];if(u&&N.push(U[g]),d){const R=Gt(i,r,v);N.push(U[R[0]],U[R[1]])}if(S=[...S,{placement:i,overflows:N}],!N.every(R=>R<=0)){var Q,V;const R=(((Q=c.flip)==null?void 0:Q.index)||0)+1,z=B[R];if(z&&(!(d==="alignment"&&w!==M(z))||S.every(L=>M(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:R,overflows:S},reset:{placement:z}};let k=(V=S.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:V.placement;if(!k)switch(f){case"bestFit":{var Z;const L=(Z=S.filter(P=>{if(b){const H=M(P.placement);return H===w||H==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(H=>H>0).reduce((H,qt)=>H+qt,0)]).sort((P,H)=>P[1]-H[1])[0])==null?void 0:Z[0];L&&(k=L);break}case"initialPlacement":k=s;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function At(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ct(t){return Yt.some(e=>t[e]>=0)}const se=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...c}=_(t,e);switch(i){case"referenceHidden":{const r=await o.detectOverflow(e,{...c,elementContext:"reference"}),s=At(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ct(s)}}}case"escaped":{const r=await o.detectOverflow(e,{...c,altBoundary:!0}),s=At(r,n.floating);return{data:{escapedOffsets:s,escaped:Ct(s)}}}default:return{}}}}},le=new Set(["left","top"]);async function ae(t,e){const{placement:n,platform:o,elements:i}=t,c=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=q(n),s=et(n),a=M(n)==="y",l=le.has(r)?-1:1,u=c&&a?-1:1,d=_(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof h=="number"&&(f=s==="end"?h*-1:h),a?{x:f*u,y:m*l}:{x:m*l,y:f*u}}const fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:c,placement:r,middlewareData:s}=e,a=await ae(e,t);return r===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:c+a.y,data:{...a,placement:r}}}}},ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:c}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:w,y:x}=g;return{x:w,y:x}}},...l}=_(t,e),u={x:n,y:o},d=await c.detectOverflow(e,l),m=M(q(i)),f=Et(m);let h=u[f],p=u[m];if(r){const g=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=h+d[g],v=h-d[w];h=mt(x,h,v)}if(s){const g=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+d[g],v=p-d[w];p=mt(x,p,v)}const y=a.fn({...e,[f]:h,[m]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[f]:r,[m]:s}}}}}};function st(){return typeof window<"u"}function Y(t){return St(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function C(t){var e;return(e=(St(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function St(t){return st()?t instanceof Node||t instanceof O(t).Node:!1}function T(t){return st()?t instanceof Element||t instanceof O(t).Element:!1}function F(t){return st()?t instanceof HTMLElement||t instanceof O(t).HTMLElement:!1}function kt(t){return!st()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof O(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=D(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function de(t){return/^(table|td|th)$/.test(Y(t))}function lt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const me=/transform|translate|scale|rotate|perspective|filter/,he=/paint|layout|strict|content/,I=t=>!!t&&t!=="none";let yt;function wt(t){const e=T(t)?D(t):t;return I(e.transform)||I(e.translate)||I(e.scale)||I(e.rotate)||I(e.perspective)||!xt()&&(I(e.backdropFilter)||I(e.filter))||me.test(e.willChange||"")||he.test(e.contain||"")}function pe(t){let e=W(t);for(;F(e)&&!J(e);){if(wt(e))return e;if(lt(e))return null;e=W(e)}return null}function xt(){return yt==null&&(yt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yt}function J(t){return/^(html|body|#document)$/.test(Y(t))}function D(t){return O(t).getComputedStyle(t)}function at(t){return T(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if(Y(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||C(t);return kt(e)?e.host:e}function Ft(t){const e=W(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&nt(e)?e:Ft(e)}function G(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ft(t),c=i===((o=t.ownerDocument)==null?void 0:o.body),r=O(i);if(c){const s=vt(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],s&&n?G(s):[])}else return e.concat(i,G(i,[],n))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Pt(t){const e=D(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),c=i?t.offsetWidth:n,r=i?t.offsetHeight:o,s=ot(n)!==c||ot(o)!==r;return s&&(n=c,o=r),{width:n,height:o,$:s}}function bt(t){return T(t)?t:t.contextElement}function K(t){const e=bt(t);if(!F(e))return A(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:c}=Pt(e);let r=(c?ot(n.width):n.width)/o,s=(c?ot(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const ge=A(0);function Ht(t){const e=O(t);return!xt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==O(t)?!1:e}function j(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),c=bt(t);let r=A(1);e&&(o?T(o)&&(r=K(o)):r=K(t));const s=ye(c,n,o)?Ht(c):A(0);let a=(i.left+s.x)/r.x,l=(i.top+s.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(c){const m=O(c),f=o&&T(o)?O(o):o;let h=m,p=vt(h);for(;p&&o&&f!==h;){const y=K(p),g=p.getBoundingClientRect(),w=D(p),x=g.left+(p.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(p.clientTop+parseFloat(w.paddingTop))*y.y;a*=y.x,l*=y.y,u*=y.x,d*=y.y,a+=x,l+=v,h=O(p),p=vt(h)}}return ct({width:u,height:d,x:a,y:l})}function ft(t,e){const n=at(t).scrollLeft;return e?e.left+n:j(C(t)).left+n}function Mt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ft(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function we(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const c=i==="fixed",r=C(o),s=e?lt(e.floating):!1;if(o===r||s&&c)return n;let a={scrollLeft:0,scrollTop:0},l=A(1);const u=A(0),d=F(o);if((d||!d&&!c)&&((Y(o)!=="body"||nt(r))&&(a=at(o)),d)){const f=j(o);l=K(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const m=r&&!d&&!c?Mt(r,a):A(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+m.x,y:n.y*l.y-a.scrollTop*l.y+u.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){const e=C(t),n=at(t),o=t.ownerDocument.body,i=$(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),c=$(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+ft(t);const s=-n.scrollTop;return D(o).direction==="rtl"&&(r+=$(e.clientWidth,o.clientWidth)-i),{width:i,height:c,x:r,y:s}}const Wt=25;function be(t,e){const n=O(t),o=C(t),i=n.visualViewport;let c=o.clientWidth,r=o.clientHeight,s=0,a=0;if(i){c=i.width,r=i.height;const u=xt();(!u||u&&e==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const l=ft(o);if(l<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-d.clientWidth-f);h<=Wt&&(c-=h)}else l<=Wt&&(c+=l);return{width:c,height:r,x:s,y:a}}function Re(t,e){const n=j(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,c=F(t)?K(t):A(1),r=t.clientWidth*c.x,s=t.clientHeight*c.y,a=i*c.x,l=o*c.y;return{width:r,height:s,x:a,y:l}}function Bt(t,e,n){let o;if(e==="viewport")o=be(t,n);else if(e==="document")o=ve(C(t));else if(T(e))o=Re(e,n);else{const i=Ht(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ct(o)}function Nt(t,e){const n=W(t);return n===e||!T(n)||J(n)?!1:D(n).position==="fixed"||Nt(n,e)}function Ee(t,e){const n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(s=>T(s)&&Y(s)!=="body"),i=null;const c=D(t).position==="fixed";let r=c?W(t):t;for(;T(r)&&!J(r);){const s=D(r),a=wt(r);!a&&s.position==="fixed"&&(i=null),(c?!a&&!i:!a&&s.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||nt(r)&&!a&&Nt(t,r))?o=o.filter(l=>l!==r):i=s,r=W(r)}return e.set(t,o),o}function Le(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const c=[...n==="clippingAncestors"?lt(e)?[]:Ee(e,this._c):[].concat(n),o],r=Bt(e,c[0],i);let s=r.top,a=r.right,l=r.bottom,u=r.left;for(let d=1;d<c.length;d++){const m=Bt(e,c[d],i);s=$(m.top,s),a=X(m.right,a),l=X(m.bottom,l),u=$(m.left,u)}return{width:a-u,height:l-s,x:u,y:s}}function Oe(t){const{width:e,height:n}=Pt(t);return{width:e,height:n}}function Te(t,e,n){const o=F(e),i=C(e),c=n==="fixed",r=j(t,!0,c,e);let s={scrollLeft:0,scrollTop:0};const a=A(0);function l(){a.x=ft(i)}if(o||!o&&!c)if((Y(e)!=="body"||nt(i))&&(s=at(e)),o){const f=j(e,!0,c,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else i&&l();c&&!o&&i&&l();const u=i&&!o&&!c?Mt(i,s):A(0),d=r.left+s.scrollLeft-a.x-u.x,m=r.top+s.scrollTop-a.y-u.y;return{x:d,y:m,width:r.width,height:r.height}}function Rt(t){return D(t).position==="static"}function Vt(t,e){if(!F(t)||D(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return C(t)===n&&(n=n.ownerDocument.body),n}function zt(t,e){const n=O(t);if(lt(t))return n;if(!F(t)){let i=W(t);for(;i&&!J(i);){if(T(i)&&!Rt(i))return i;i=W(i)}return n}let o=Vt(t,e);for(;o&&de(o)&&Rt(o);)o=Vt(o,e);return o&&J(o)&&Rt(o)&&!wt(o)?n:o||pe(t)||n}const De=async function(t){const e=this.getOffsetParent||zt,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ae(t){return D(t).direction==="rtl"}const Ce={convertOffsetParentRelativeRectToViewportRelativeRect:we,getDocumentElement:C,getClippingRect:Le,getOffsetParent:zt,getElementRects:De,getClientRects:xe,getDimensions:Oe,getScale:K,isElement:T,isRTL:Ae};function $t(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Se(t,e){let n=null,o;const i=C(t);function c(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function r(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),c();const l=t.getBoundingClientRect(),{left:u,top:d,width:m,height:f}=l;if(s||e(),!m||!f)return;const h=it(d),p=it(i.clientWidth-(u+m)),y=it(i.clientHeight-(d+f)),g=it(u),w={rootMargin:-h+"px "+-p+"px "+-y+"px "+-g+"px",threshold:$(0,X(1,a))||1};let x=!0;function v(E){const b=E[0].intersectionRatio;if(b!==a){if(!x)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}b===1&&!$t(l,t.getBoundingClientRect())&&r(),x=!1}try{n=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,w)}n.observe(t)}return r(!0),c}function ke(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=bt(t),u=i||c?[...l?G(l):[],...e?G(e):[]]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),c&&g.addEventListener("resize",n)});const d=l&&s?Se(l,n):null;let m=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===l&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),l&&!a&&f.observe(l),e&&f.observe(e));let h,p=a?j(t):null;a&&y();function y(){const g=j(t);p&&!$t(p,g)&&n(),p=g,h=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),c&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,a&&cancelAnimationFrame(h)}}const Fe=fe,Pe=ue,He=ce,Me=se,We=re,Be=(t,e,n)=>{const o=new Map,i={platform:Ce,...n},c={...i.platform,_c:o};return ie(t,e,{...i,platform:c})};function Ne(t){const[e,n]=tt(t()),[o,i]=tt(t()?"open":"closed");let c,r=0;const s=a=>{c=a};return ut(a=>{const l=t();if(l)r++,n(!0),i("open");else if(a){i("closed");const u=c,d=u&&(()=>{const h=getComputedStyle(u);return h.animationName!=="none"&&parseFloat(h.animationDuration||"0")>0})();if(!u||!d){const h=++r;return queueMicrotask(()=>{h===r&&n(!1)}),l}const m=u,f=h=>{h.target===m&&(m.removeEventListener("animationend",f),n(!1))};m.addEventListener("animationend",f),dt(()=>m.removeEventListener("animationend",f))}return l}),{present:e,state:o,setRef:s}}function Ve(t){const[e,n]=It(t,["as"]);return typeof e.as=="function"?e.as(n):jt(_t,Xt({get component(){return e.as??"span"}},n))}function ze(t){let e=t;for(;e;){if(e instanceof Element&&e.closest("[inert]"))return!0;const n=e.getRootNode();e=n instanceof ShadowRoot?n.host:null}return!1}function $e(t,e){if(typeof MutationObserver!="function")return()=>{};let n=!1;const o=()=>t.isConnected&&!ze(t);let i=o();const c=()=>{if(!n){if(o()){i=!0;return}i&&(n=!0,r.disconnect(),e())}},r=new MutationObserver(c),s=new Set;typeof document<"u"&&s.add(document);const a=t.getRootNode();a&&s.add(a);for(const l of s)try{r.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]})}catch{}return()=>r.disconnect()}function qe(t,e,n={}){const[o,i]=tt({x:0,y:0,placement:n.placement??"bottom"}),[c,r]=tt({}),[s,a]=tt(!1);return ut(()=>{const l=t(),u=e();if(!l||!u)return;const d=()=>{var p;const y=[Fe(n.gutter??8),He(),Pe({padding:8})],g=(p=n.arrowEl)==null?void 0:p.call(n);g&&y.push(We({element:g})),y.push(Me()),Be(l,u,{placement:n.placement??"bottom",strategy:"fixed",middleware:y}).then(({x:w,y:x,placement:v,middlewareData:E})=>{var b;i({x:w,y:x,placement:v}),E.arrow&&r({x:E.arrow.x,y:E.arrow.y}),a(!!((b=E.hide)!=null&&b.referenceHidden))})},m=ke(l,u,d);let f;if(typeof ResizeObserver=="function"&&l instanceof Element){f=new ResizeObserver(d),f.observe(l);for(const p of G(l))p instanceof Element&&f.observe(p)}const h=n.onDisconnect?$e(l,n.onDisconnect):void 0;dt(()=>{m(),f?.disconnect(),h?.()})}),{pos:o,arrowPos:c,hidden:s}}function Ie(t){ut(()=>{if(!t.enabled())return;const e=i=>{i.key==="Escape"&&t.onDismiss("escape")},n=i=>{const c=i.target;t.refs().some(r=>r&&r.contains(c))||t.onDismiss("outside")},o=document;o.addEventListener("keydown",e),o.addEventListener("pointerdown",n,!0),dt(()=>{o.removeEventListener("keydown",e),o.removeEventListener("pointerdown",n,!0)})})}export{Ve as A,Ie as a,Ne as c,qe as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as t}from"./Icon-
|
|
1
|
+
import{I as t}from"./Icon-DJDuE_-x.js";import{c as r,q as e}from"./define-B3OpsIDE.js";var i=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],o=a=>r(t,e(a,{name:"PanelRight",iconNode:i})),h=o;export{h as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./Icon-
|
|
1
|
+
import{I as e}from"./Icon-DJDuE_-x.js";import{c,q as r}from"./define-B3OpsIDE.js";var m=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],o=a=>c(e,r(a,{name:"Globe",iconNode:m})),i=o,p=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],y=a=>c(e,r(a,{name:"Image",iconNode:p})),t=y,l=[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]],d=a=>c(e,r(a,{name:"Paperclip",iconNode:l})),h=d;export{i as g,t as i,h as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as a}from"./Icon-DJDuE_-x.js";import{c as p,q as r}from"./define-B3OpsIDE.js";var e=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],m=o=>p(a,r(o,{name:"Play",iconNode:e})),s=m;export{s as p};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser SpeechSynthesis mechanics, shared by `VoiceOutput`
|
|
3
|
+
* (components/voice-output.tsx) and the message action bar's built-in
|
|
4
|
+
* 'speak' action (primitives/message-feedback.ts) — ONE implementation, per
|
|
5
|
+
* B-7's "back it with the existing kai-voice-output/SpeechSynthesis
|
|
6
|
+
* mechanics". Free, local, no provider — no invoice concern.
|
|
7
|
+
*
|
|
8
|
+
* Every raw `window.speechSynthesis` access lives HERE, each wrapped in its
|
|
9
|
+
* own `hasSpeechSynthesis()` guard, so `voice-output.tsx` (whose `stop()` is
|
|
10
|
+
* reachable from `onCleanup`) never touches the global directly. That is not
|
|
11
|
+
* just tidiness: `tests/components/teardown-without-dom-globals.test.tsx`
|
|
12
|
+
* statically resolves a teardown callback's call graph PER FILE (it does not
|
|
13
|
+
* follow an imported callee into the module that defines it) and recognizes
|
|
14
|
+
* a guard only when the guarding predicate's body is walkable in the same
|
|
15
|
+
* file as the raw access — so the guard must live beside the access it
|
|
16
|
+
* protects, not just be callable before it.
|
|
17
|
+
*/
|
|
18
|
+
/** True when the browser exposes the Web Speech synthesis API. */
|
|
19
|
+
export declare function hasSpeechSynthesis(): boolean;
|
|
20
|
+
/** Cancel any in-flight/queued native speech. No-ops where the API is absent. */
|
|
21
|
+
export declare function cancelSpeech(): void;
|
|
22
|
+
/** Speak an already-constructed utterance (the caller wires its own
|
|
23
|
+
* onstart/onend/onerror before calling this). No-ops where the API is absent. */
|
|
24
|
+
export declare function speakUtterance(utterance: SpeechSynthesisUtterance): void;
|
|
25
|
+
/** Pause in-flight native speech (resumable via `resumeSpeech`). No-ops where
|
|
26
|
+
* the API is absent. */
|
|
27
|
+
export declare function pauseSpeech(): void;
|
|
28
|
+
/** Resume previously paused native speech. No-ops where the API is absent. */
|
|
29
|
+
export declare function resumeSpeech(): void;
|
|
30
|
+
/** Speak `text` natively: cancel-then-speak so a second call pre-empts the
|
|
31
|
+
* first (VoiceOutput's own speakNative discipline). No-ops where the API
|
|
32
|
+
* is absent (jsdom, some webviews) or `text` is empty — the caller's
|
|
33
|
+
* `kai-message-action` event still fires, so a host can back the same
|
|
34
|
+
* action with a model TTS path instead. */
|
|
35
|
+
export declare function speakText(text: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as M,w as P,p as k,q,i as m,c as S,d as o,S as A,a as B,b as E,l as F,t as g}from"./define-
|
|
1
|
+
import{s as M,w as P,p as k,q,i as m,c as S,d as o,S as A,a as B,b as E,l as F,t as g}from"./define-B3OpsIDE.js";import{c as h}from"./cn-DN5AWfiS.js";var I=g('<span class="text-xs text-muted-foreground">'),L=g('<div><div part=track role=progressbar aria-valuemin=0 class="h-1.5 w-full overflow-hidden rounded-full bg-surface-strong"><div part=fill>');const N={primary:"bg-primary",success:"bg-tool-green",warning:"bg-tool-amber",error:"bg-tool-red",info:"bg-tool-blue"};function T(p){const[r,x]=M(p,["value","max","label","tone","class","aria-label","aria-labelledby"]),i=P(),t=()=>r.max??100,s=()=>{const e=t();return e>0?Math.max(0,Math.min(r.value,e)):0},w=()=>{const e=t();return e>0?s()/e*100:0},y=()=>r.label?i:r["aria-labelledby"],C=()=>r.label||r["aria-labelledby"]?void 0:r["aria-label"]??"Progress";return(()=>{var e=L(),l=e.firstChild,n=l.firstChild;return k(e,q({get class(){return h("flex flex-col gap-1",r.class)}},x),!1,!0),m(e,S(A,{get when(){return r.label},get children(){var a=I();return o(a,"id",i),m(a,()=>r.label),a}}),l),B(a=>{var d=s(),u=t(),b=y(),v=C(),f=h("h-full rounded-full motion-safe:transition-[width] motion-safe:duration-500 motion-safe:ease-out",N[r.tone??"primary"]),c=`${w()}%`;return d!==a.e&&o(l,"aria-valuenow",a.e=d),u!==a.t&&o(l,"aria-valuemax",a.t=u),b!==a.a&&o(l,"aria-labelledby",a.a=b),v!==a.o&&o(l,"aria-label",a.o=v),f!==a.i&&E(n,a.i=f),c!==a.n&&F(n,"width",a.n=c),a},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),e})()}export{T as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as w,c as t,S as a,q as u,i as c,m as x,t as p}from"./define-
|
|
1
|
+
import{s as w,c as t,S as a,q as u,i as c,m as x,t as p}from"./define-B3OpsIDE.js";import{c as g}from"./cn-DN5AWfiS.js";import{B as o}from"./button-BM0YTTDQ.js";import{r as b}from"./icon-BOMrFp0D.js";var y=p('<span class="min-w-0 flex-1">'),f=p('<span class="text-foreground/70 whitespace-pre-wrap">'),z=p('<span class="text-foreground font-medium whitespace-pre-wrap">');function k(i){const[r,s]=w(i,["children","variant","size","class","icon","highlight","block","list"]),h=()=>t(a,{get when(){return r.icon},get children(){return b(r.icon,{class:"size-3.5 shrink-0"})}}),d=()=>r.highlight!==void 0&&r.highlight.trim()!=="",n=()=>typeof r.children=="string"?r.children:"";return t(a,{get when(){return d()},get fallback(){return t(a,{get when(){return r.list},get fallback(){return t(a,{get when(){return r.block},get fallback(){return t(o,u({get variant(){return r.variant??"outline"},size:"lg",get class(){return g("rounded-full",r.class)}},s,{get children(){return[t(h,{}),x(()=>r.children)]}}))},get children(){return t(o,u({get variant(){return r.variant??"outline"},size:"md",get class(){return g("h-auto w-full cursor-pointer justify-start rounded-xl px-4 py-2.5","text-left text-sm leading-snug whitespace-normal text-pretty",r.class)}},s,{get children(){return r.children}}))}})},get children(){return t(o,u({get variant(){return r.variant??"ghost"},size:"md",get class(){return g("group h-auto w-full cursor-pointer items-center justify-start gap-2.5 rounded-xl px-3",r.size==="lg"?"py-3.5":"py-2.5","text-left text-sm leading-snug whitespace-normal text-pretty","hover:bg-accent",r.class)}},s,{get children(){return[t(h,{}),(()=>{var l=y();return c(l,()=>r.children),l})()]}}))}})},get children(){return t(a,{get when(){return n()},get fallback(){return t(o,u({get variant(){return r.variant??"ghost"},size:"sm",get class(){return g("w-full cursor-pointer justify-start rounded-xl py-2","hover:bg-accent",r.class)}},s,{get children(){return r.children}}))},get children(){return t(o,u({get variant(){return r.variant??"ghost"},size:"sm",get class(){return g("w-full cursor-pointer justify-start gap-0 rounded-xl py-2","hover:bg-accent",r.class)}},s,{get children(){return j(n(),r.highlight)}}))}})}})}function j(i,r){const s=r.trim(),h=i.toLowerCase(),d=s.toLowerCase(),n=h.indexOf(d);if(n===-1)return(()=>{var e=f();return c(e,i),e})();const l=i.substring(0,n),m=i.substring(n,n+d.length),v=i.substring(n+m.length);return[t(a,{when:l,get children(){var e=f();return c(e,l),e}}),(()=>{var e=z();return c(e,m),e})(),t(a,{when:v,get children(){var e=f();return c(e,v),e}})]}export{k as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as b,p as m,q as f,t as a,w,i as n,c as o,S as h,a as y,b as B,F as S}from"./define-
|
|
1
|
+
import{s as b,p as m,q as f,t as a,w,i as n,c as o,S as h,a as y,b as B,F as S}from"./define-B3OpsIDE.js";import{c as g}from"./cn-DN5AWfiS.js";var q=a("<input>"),O=a("<div>"),R=a("<label>"),F=a('<span class="flex flex-col gap-0.5"><span></span><span class="text-xs font-normal text-muted-foreground">'),N=a("<span>");function x(i){const[e,d]=b(i,["class"]);return(()=>{var l=q();return m(l,f(d,{type:"radio",get class(){return g("kai-radio",e.class)}}),!1,!1),l})()}function P(i){const[e,d]=b(i,["options","value","name","disabled","label","onChange","onOptionBlur","itemClass","children","class"]),l=w(),C=()=>e.name??l;return(()=>{var u=O();return m(u,f(d,{role:"radiogroup",get"aria-label"(){return e.label},get class(){return g("divide-y divide-border overflow-hidden rounded-lg border border-border",e.class)}}),!1,!0),n(u,o(S,{get each(){return e.options},children:t=>{const c=()=>e.value===t.value,p=()=>!!(e.disabled||t.disabled);return(()=>{var s=R();return n(s,o(x,{get name(){return C()},get value(){return String(t.value)},get checked(){return c()},get disabled(){return p()},get class(){return t.description===void 0?void 0:"mt-0.5"},onChange:()=>{var r;return(r=e.onChange)==null?void 0:r.call(e,t.value,t)},onBlur:()=>{var r;return(r=e.onOptionBlur)==null?void 0:r.call(e)}}),null),n(s,o(h,{get when(){return e.children},get fallback(){return o(h,{get when(){return t.description!==void 0},get fallback(){return(()=>{var r=N();return n(r,()=>t.label),r})()},get children(){var r=F(),v=r.firstChild,k=v.nextSibling;return n(v,()=>t.label),n(k,()=>t.description),r}})},children:r=>r()(t,{checked:c(),disabled:p()})}),null),y(()=>B(s,g("flex cursor-pointer items-center gap-3 px-3 py-2.5 text-sm transition-colors",t.description!==void 0&&"items-start",c()?"bg-accent font-medium text-accent-foreground":"text-foreground hover:bg-muted/50",e.itemClass))),s})()}})),u})()}export{P as R,x as a};
|
package/dist/react/index.d.ts
CHANGED
|
@@ -411,6 +411,22 @@ export interface ChatProps extends WebComponentProps {
|
|
|
411
411
|
kindIcons?: Record<string, string>;
|
|
412
412
|
/** Whether each message's action bar is always visible (`'always'`, default) or only revealed on hover of that message row (`'hover'`). */
|
|
413
413
|
actionsReveal?: "always" | "hover";
|
|
414
|
+
/** Role-scoped DEFAULT action bars (B-7b): a user message with no `actions` of its own gets `userActions`; an assistant message, `assistantActions`. A per-message `m.actions` OVERRIDES the role default (replace, not merge), so a message that sets `actions: []` renders NO action bar even when a role default is set. Set as JS properties. */
|
|
415
|
+
userActions?: ("copy" | "dislike" | "edit" | "like" | "regenerate" | "speak" | {
|
|
416
|
+
id: string;
|
|
417
|
+
label: string;
|
|
418
|
+
icon?: string;
|
|
419
|
+
tooltip?: string;
|
|
420
|
+
})[];
|
|
421
|
+
/** See `userActions`, the assistant-role default. */
|
|
422
|
+
assistantActions?: ("copy" | "dislike" | "edit" | "like" | "regenerate" | "speak" | {
|
|
423
|
+
id: string;
|
|
424
|
+
label: string;
|
|
425
|
+
icon?: string;
|
|
426
|
+
tooltip?: string;
|
|
427
|
+
})[];
|
|
428
|
+
/** Hide the citations row consecutive `source` parts collapse into (`part="citations"`, message.tsx). Named as a HIDE, not `sources: boolean`, so absence-means-default stays unambiguous: absent/false is today's rendering, byte-for-byte (B-8). */
|
|
429
|
+
hideSources?: boolean;
|
|
414
430
|
/** Which attachment media types the user may stage, in HTML `accept` syntax: `<kai-chat accept="image/*,application/pdf">`. A plain string, so unlike `messages` it DOES work as an attribute. Omitted means no filter. MEDIA TYPES ONLY -- exact (`image/png`) or subtype wildcard (`text/*`). HTML allows a file extension here and this does not: `accept=".py"` THROWS with the entry named, rather than silently resolving to a picker that accepts nothing. It can only NARROW what the kit can already encode: `accept="image/*"` resolves to the four image formats both APIs take, not to every image type the OS offers. Pass the SAME string to `toOpenAIMessages(msgs, { accept })` and the picker and the wire cannot disagree -- both resolve it through `resolveMediaPolicy` against one declaration. That declaration is readable as `encodableMediaTypes()` from `@kitn.ai/ui/wire`, if you would rather build your own picker than use this prop. */
|
|
415
431
|
accept?: string;
|
|
416
432
|
/** The full message thread to render, newest last. Each entry carries its role, ordered `parts`, and optional actions/avatar/feedback. Set as a JS property (`el.messages = [...]`); a NEW array reference per streaming chunk re-renders (mutating in place does not). Omit for an empty thread. Re-declared here (rather than inherited from `ChatThreadProps`) because the ELEMENT registers a `[]` default and renders the empty state without it, while the SolidJS `<ChatThread>` component still requires it. The facade hands it a validated array either way. Matches `<kai-thread>`. */
|
|
@@ -512,7 +528,7 @@ export interface ChatProps extends WebComponentProps {
|
|
|
512
528
|
payload: unknown;
|
|
513
529
|
};
|
|
514
530
|
})[];
|
|
515
|
-
actions?: ("copy" | "
|
|
531
|
+
actions?: ("copy" | "dislike" | "edit" | "like" | "regenerate" | "speak" | {
|
|
516
532
|
id: string;
|
|
517
533
|
label: string;
|
|
518
534
|
icon?: string;
|
|
@@ -654,7 +670,7 @@ export interface ChatProps extends WebComponentProps {
|
|
|
654
670
|
payload: unknown;
|
|
655
671
|
};
|
|
656
672
|
})[];
|
|
657
|
-
actions?: ("copy" | "
|
|
673
|
+
actions?: ("copy" | "dislike" | "edit" | "like" | "regenerate" | "speak" | {
|
|
658
674
|
id: string;
|
|
659
675
|
label: string;
|
|
660
676
|
icon?: string;
|
|
@@ -765,7 +781,7 @@ export interface ChatProps extends WebComponentProps {
|
|
|
765
781
|
payload: unknown;
|
|
766
782
|
};
|
|
767
783
|
})[];
|
|
768
|
-
actions?: ("copy" | "
|
|
784
|
+
actions?: ("copy" | "dislike" | "edit" | "like" | "regenerate" | "speak" | {
|
|
769
785
|
id: string;
|
|
770
786
|
label: string;
|
|
771
787
|
icon?: string;
|
|
@@ -917,7 +933,7 @@ export interface ChatProps extends WebComponentProps {
|
|
|
917
933
|
payload: unknown;
|
|
918
934
|
};
|
|
919
935
|
})[];
|
|
920
|
-
actions?: undefined | ("copy" | "
|
|
936
|
+
actions?: undefined | ("copy" | "dislike" | "edit" | "like" | "regenerate" | "speak" | {
|
|
921
937
|
id: string;
|
|
922
938
|
label: string;
|
|
923
939
|
icon?: undefined | string;
|
|
@@ -1951,7 +1967,7 @@ export interface MessageProps extends WebComponentProps {
|
|
|
1951
1967
|
payload: unknown;
|
|
1952
1968
|
};
|
|
1953
1969
|
})[];
|
|
1954
|
-
actions?: ("copy" | "
|
|
1970
|
+
actions?: ("copy" | "dislike" | "edit" | "like" | "regenerate" | "speak" | {
|
|
1955
1971
|
id: string;
|
|
1956
1972
|
label: string;
|
|
1957
1973
|
icon?: string;
|
|
@@ -2919,7 +2935,7 @@ export interface ThreadProps extends WebComponentProps {
|
|
|
2919
2935
|
payload: unknown;
|
|
2920
2936
|
};
|
|
2921
2937
|
})[];
|
|
2922
|
-
actions?: ("copy" | "
|
|
2938
|
+
actions?: ("copy" | "dislike" | "edit" | "like" | "regenerate" | "speak" | {
|
|
2923
2939
|
id: string;
|
|
2924
2940
|
label: string;
|
|
2925
2941
|
icon?: string;
|
package/dist/react.js
CHANGED
|
@@ -260,7 +260,7 @@ function ne(e = {}) {
|
|
|
260
260
|
const [t, n] = I(() => [...e.initialMessages ?? []]), [i, r] = I(() => [...e.initialSuggestions ?? []]), [c, o] = I(!1), s = x(e.onSubmit);
|
|
261
261
|
s.current = e.onSubmit;
|
|
262
262
|
const l = g((u) => n(u), []), m = g((u) => l((p) => _(p, u)), [l]), b = g(
|
|
263
|
-
(u, p) => l((
|
|
263
|
+
(u, p) => l((R) => Y(R, u, p)),
|
|
264
264
|
[l]
|
|
265
265
|
), d = g((u) => l((p) => J(p, u)), [l]), h = g((u) => r((p) => Q(p, u)), []), k = g((u) => r((p) => X(p, u)), []), f = g(() => r([]), []), C = g((u) => (o(!0), ee($(l, u), () => o(!1))), [l]), y = g(
|
|
266
266
|
(u) => {
|
|
@@ -288,7 +288,7 @@ function ne(e = {}) {
|
|
|
288
288
|
bind: S
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function A() {
|
|
292
292
|
if (typeof window > "u") return;
|
|
293
293
|
const e = window;
|
|
294
294
|
return e.SpeechRecognition ?? e.webkitSpeechRecognition;
|
|
@@ -296,8 +296,8 @@ function R() {
|
|
|
296
296
|
function ie(e) {
|
|
297
297
|
const t = x(e);
|
|
298
298
|
t.current = e;
|
|
299
|
-
const n =
|
|
300
|
-
const r =
|
|
299
|
+
const n = A() !== void 0, i = g(() => {
|
|
300
|
+
const r = A();
|
|
301
301
|
if (!r) return;
|
|
302
302
|
const c = new r();
|
|
303
303
|
c.lang = "en-US", c.interimResults = !1, c.onresult = (o) => t.current(o.results[0][0].transcript), c.start();
|
|
@@ -356,7 +356,7 @@ const oe = /* @__PURE__ */ a(
|
|
|
356
356
|
() => import("@kitn.ai/ui/elements/chain-of-thought")
|
|
357
357
|
), ke = /* @__PURE__ */ a(
|
|
358
358
|
"kai-chat",
|
|
359
|
-
["theme", "value", "placeholder", "loading", "suggestions", "suggestionMode", "persistSuggestions", "proseSize", "codeTheme", "codeHighlight", "reasoning", "reasoningOpen", "chatTitle", "models", "currentModel", "context", "scrollButton", "headerStart", "headerEnd", "headerFull", "sidebar", "empty", "composer", "composerActions", "footer", "attach", "webSearch", "voice", "triggers", "kindIcons", "actionsReveal", "accept", "messages", "cardTypes", "cardSchemas", "conversations", "store", "home"],
|
|
359
|
+
["theme", "value", "placeholder", "loading", "suggestions", "suggestionMode", "persistSuggestions", "proseSize", "codeTheme", "codeHighlight", "reasoning", "reasoningOpen", "chatTitle", "models", "currentModel", "context", "scrollButton", "headerStart", "headerEnd", "headerFull", "sidebar", "empty", "composer", "composerActions", "footer", "attach", "webSearch", "voice", "triggers", "kindIcons", "actionsReveal", "userActions", "assistantActions", "hideSources", "accept", "messages", "cardTypes", "cardSchemas", "conversations", "store", "home"],
|
|
360
360
|
{ onAttachmentsChange: "kai-attachments-change", onAttachmentsRejected: "kai-attachments-rejected", onConversationLoad: "kai-conversation-load", onHomeLink: "kai-home-link", onMessageAction: "kai-message-action", onModelChange: "kai-model-change", onSubmit: "kai-submit", onSuggestionClick: "kai-suggestion-click", onValueChange: "kai-value-change", onVoice: "kai-voice", onWebSearch: "kai-web-search" },
|
|
361
361
|
() => import("@kitn.ai/ui/elements/chat")
|
|
362
362
|
), ge = /* @__PURE__ */ a(
|
|
@@ -424,12 +424,12 @@ const oe = /* @__PURE__ */ a(
|
|
|
424
424
|
["theme", "groups", "conversations", "activeId", "collapsed", "defaultCollapsed", "compact"],
|
|
425
425
|
{ onCollapseToggle: "kai-collapse-toggle", onConversationSelect: "kai-conversation-select", onNewChat: "kai-new-chat", onSearch: "kai-search", onToggleSidebar: "kai-toggle-sidebar" },
|
|
426
426
|
() => import("@kitn.ai/ui/elements/conversation-list")
|
|
427
|
-
),
|
|
427
|
+
), Ae = /* @__PURE__ */ a(
|
|
428
428
|
"kai-dialog",
|
|
429
429
|
["theme", "open", "defaultOpen", "label"],
|
|
430
430
|
{ onOpenChange: "kai-open-change" },
|
|
431
431
|
() => import("@kitn.ai/ui/elements/dialog")
|
|
432
|
-
),
|
|
432
|
+
), Re = /* @__PURE__ */ a(
|
|
433
433
|
"kai-dock",
|
|
434
434
|
["theme", "open", "defaultOpen", "position", "label", "openLabel", "closeLabel", "unread", "disabled", "hideClose", "focusOnOpen"],
|
|
435
435
|
{ onOpenChange: "kai-open-change" },
|
|
@@ -694,12 +694,12 @@ const oe = /* @__PURE__ */ a(
|
|
|
694
694
|
["theme", "checked", "defaultChecked", "disabled", "label", "name", "value"],
|
|
695
695
|
{ onChange: "kai-change" },
|
|
696
696
|
() => import("@kitn.ai/ui/elements/switch")
|
|
697
|
-
),
|
|
697
|
+
), At = /* @__PURE__ */ a(
|
|
698
698
|
"kai-tabs",
|
|
699
699
|
["theme", "items", "value", "defaultValue", "variant", "block", "disabled"],
|
|
700
700
|
{ onTabChange: "kai-tab-change" },
|
|
701
701
|
() => import("@kitn.ai/ui/elements/tabs")
|
|
702
|
-
),
|
|
702
|
+
), Rt = /* @__PURE__ */ a(
|
|
703
703
|
"kai-tasks",
|
|
704
704
|
["theme", "data", "cardId", "heading", "resolution", "value", "defaultValue", "disabled", "readonly"],
|
|
705
705
|
{ onValueChange: "kai-value-change" },
|
|
@@ -775,8 +775,8 @@ export {
|
|
|
775
775
|
Ie as Context,
|
|
776
776
|
ze as ConversationItem,
|
|
777
777
|
Oe as Conversations,
|
|
778
|
-
|
|
779
|
-
|
|
778
|
+
Ae as Dialog,
|
|
779
|
+
Re as Dock,
|
|
780
780
|
Me as Dropdown,
|
|
781
781
|
Ee as EditableLabel,
|
|
782
782
|
Le as Embed,
|
|
@@ -829,8 +829,8 @@ export {
|
|
|
829
829
|
It as Status,
|
|
830
830
|
zt as Suggestions,
|
|
831
831
|
Ot as Switch,
|
|
832
|
-
|
|
833
|
-
|
|
832
|
+
At as Tabs,
|
|
833
|
+
Rt as Tasks,
|
|
834
834
|
Mt as TextShimmer,
|
|
835
835
|
Et as ThinkingBar,
|
|
836
836
|
Lt as Thread,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as b,g as y,j as R,w as z,c as f,i as h,a as x,b as O,u as w,d as S,p as k,q as H,S as $,t as m,G as A,H as E,h as M,e as j}from"./define-
|
|
1
|
+
import{s as b,g as y,j as R,w as z,c as f,i as h,a as x,b as O,u as w,d as S,p as k,q as H,S as $,t as m,G as A,H as E,h as M,e as j}from"./define-B3OpsIDE.js";import{c as v}from"./cn-DN5AWfiS.js";import{M as q}from"./markdown-DjEaoNz-.js";import{T as B}from"./text-shimmer-BAkw_65G.js";import{c as G}from"./chevron-down-CZ4W0hy6.js";const N=1;function P(l,r){let e=-1;const s=new ResizeObserver(c=>{var d;const t=((d=c[c.length-1])==null?void 0:d.contentRect.height)??l.getBoundingClientRect().height;(e<0||Math.abs(t-e)>N)&&(e=t,r(t))});return s.observe(l),()=>s.disconnect()}var D=m("<div>"),F=m("<button type=button><div>"),L=m("<span class=text-foreground>"),V=m("<div style=max-height:0px><div>");const I=A();function T(){const l=E(I);if(!l)throw new Error("useReasoningContext must be used within a Reasoning provider");return l}function X(l){var r;const[e]=b(l,["children","class","open","defaultOpen","onOpenChange","isStreaming","disabled","controllerRef","openOnStream"]),[s,c]=y(e.defaultOpen??!1),[d,t]=y(!1),a=()=>e.open!==void 0,g=()=>a()?e.open:s(),n=()=>!!e.disabled,o=i=>{var C;g()!==i&&(a()||c(i),(C=e.onOpenChange)==null||C.call(e,i))};R(()=>{if(!e.openOnStream)return;const i=e.isStreaming;i&&!d()&&(a()||c(!0),t(!0)),!i&&d()&&(a()||c(!1),t(!1))}),(r=e.controllerRef)==null||r.call(e,{open:g,setOpen:o});const u=z();let p;return f(I.Provider,{value:{isOpen:g,onOpenChange:o,disabled:n,contentId:u,registerTrigger:i=>{p=i},trigger:()=>p,isStreaming:()=>!!e.isStreaming},get children(){var i=D();return h(i,()=>e.children),x(()=>O(i,e.class)),i}})}function Y(l){const[r,e]=b(l,["children","class","ref"]),{isOpen:s,onOpenChange:c,disabled:d,contentId:t,registerTrigger:a,isStreaming:g}=T();return(()=>{var n=F(),o=n.firstChild;return n.$$click=()=>{d()||c(!s())},w(u=>{a(u),typeof r.ref=="function"&&r.ref(u)},n),S(n,"aria-controls",t),k(n,H({get class(){return v("flex cursor-pointer items-center gap-2 text-meta",r.class)},get disabled(){return d()||void 0},get"aria-expanded"(){return s()},get"data-expanded"(){return s()?"":void 0},get"data-closed"(){return s()?void 0:""},get"data-state"(){return s()?"open":"closed"}},e),!1,!0),h(n,f($,{get when(){return g()},get fallback(){return(()=>{var u=L();return h(u,()=>r.children),u})()},get children(){return f(B,{class:"font-medium",get children(){return r.children}})}}),o),h(o,f(G,{class:"size-4"})),x(()=>O(o,v("transform transition-transform",s()?"rotate-180":""))),n})()}function _(l){const[r,e]=b(l,["children","class","contentClass","markdown"]),{isOpen:s,contentId:c,trigger:d}=T();let t,a;const g=()=>{var n;if(!t)return;const o=t.getRootNode().activeElement;o&&t.contains(o)&&((n=d())==null||n.focus())};return R(()=>{if(!t||!a)return;const n=P(a,()=>{t&&a&&s()&&(t.style.maxHeight=`${a.scrollHeight}px`)});s()?(t.style.maxHeight=`${a.scrollHeight}px`,t.removeAttribute("inert")):(t.style.maxHeight="0px",g(),t.setAttribute("inert","")),M(n)}),(()=>{var n=V(),o=n.firstChild,u=t;typeof u=="function"?w(u,n):t=n,S(n,"id",c),k(n,H({get class(){return v("overflow-hidden transition-[max-height] duration-150 ease-out",r.class)},get"data-state"(){return s()?"open":"closed"}},e),!1,!0);var p=a;return typeof p=="function"?w(p,o):a=o,h(o,f($,{get when(){return r.markdown},get fallback(){return r.children},get children(){return f(q,{get content(){return r.children}})}})),x(()=>O(o,v("text-muted-foreground text-body",r.contentClass))),n})()}j(["click"]);export{X as R,Y as a,_ as b};
|