@kitn.ai/ui 0.19.0 → 0.20.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/LICENSE +6 -0
- package/NOTICE +54 -0
- package/dist/components/audio-visualizer/audio-visualizer.voice-fixture.d.ts +59 -0
- package/dist/components/audio-visualizer/aurora.glsl.d.ts +114 -0
- package/dist/components/audio-visualizer/index.d.ts +155 -0
- package/dist/components/audio-visualizer/shader-canvas.d.ts +130 -0
- package/dist/components/audio-visualizer/sizes.d.ts +25 -0
- package/dist/components/audio-visualizer/variant-aurora.d.ts +89 -0
- package/dist/components/audio-visualizer/variant-bar.d.ts +46 -0
- package/dist/components/audio-visualizer/variant-custom.d.ts +73 -0
- package/dist/components/audio-visualizer/variant-grid.d.ts +22 -0
- package/dist/components/audio-visualizer/variant-radial.d.ts +13 -0
- package/dist/components/audio-visualizer/variant-wave.d.ts +11 -0
- package/dist/components/audio-visualizer/wave.glsl.d.ts +16 -0
- package/dist/create-tween-hvpmSuwW.js +7 -0
- package/dist/custom-elements.json +282 -0
- 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.d.ts +1 -0
- package/dist/elements/audio-visualizer.js +1 -0
- package/dist/elements/autoloader.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-scope-picker.js +1 -1
- package/dist/elements/chat-workspace.js +1 -1
- package/dist/elements/chat.js +1 -1
- package/dist/elements/checkpoint.js +1 -1
- package/dist/elements/choice.js +1 -1
- package/dist/elements/chunks/{Icon-11SRdjJ4.js → Icon-Tj58ES_d.js} +1 -1
- package/dist/elements/chunks/{action-icons-CtRg17uX.js → action-icons-ns1Fnedj.js} +1 -1
- package/dist/elements/chunks/arrow-left-DQocUFvy.js +1 -0
- package/dist/elements/chunks/{attachments-CBqQRh60.js → attachments-mCB5F1Fq.js} +1 -1
- package/dist/elements/chunks/audio-visualizer-BqNy7dfm.js +1 -0
- package/dist/elements/chunks/{badge-CxklEXQm.js → badge-B4Zuajl2.js} +1 -1
- package/dist/elements/chunks/{button-BD7lUvVB.js → button-ZWNif3--.js} +1 -1
- package/dist/elements/chunks/{card-B-PRGXdj.js → card-BkHbp4BA.js} +1 -1
- package/dist/elements/chunks/{chat-thread-DIZbRIKG.js → chat-thread-CkRN6pZ7.js} +1 -1
- package/dist/elements/chunks/check-B9-gn6SS.js +1 -0
- package/dist/elements/chunks/chevron-down-BNsxc2hk.js +1 -0
- package/dist/elements/chunks/chevron-right-Hv00StBO.js +1 -0
- package/dist/elements/chunks/circle-0e3KJTDr.js +1 -0
- package/dist/elements/chunks/circle-check-BNAS0JEy.js +1 -0
- package/dist/elements/chunks/{circle-x-mtjCO_Ok.js → circle-x-B7faJFlY.js} +1 -1
- package/dist/elements/chunks/{code-block-BeWVttmU.js → code-block-BFUHn6Va.js} +1 -1
- package/dist/elements/chunks/collapsible-DM1Ckd4e.js +1 -0
- package/dist/elements/chunks/{composer-CavJww3d.js → composer-BguS0QL_.js} +2 -2
- package/dist/elements/chunks/{context-CnlsNJSJ.js → context-Cb7k4F-v.js} +1 -1
- package/dist/elements/chunks/{conversation-list-5O_KdI_I.js → conversation-list-CvoAkWhN.js} +1 -1
- package/dist/elements/chunks/create-tween-oVvAIG8r.js +7 -0
- package/dist/elements/chunks/{default-input-CB46cJJ1.js → default-input-Cqqilg9t.js} +1 -1
- package/dist/elements/chunks/define-D1din7Ld.js +1 -0
- package/dist/elements/chunks/{disclosure-BtFK3a-M.js → disclosure-CIZ5c8nO.js} +1 -1
- package/dist/elements/chunks/{download-qJv1dS3M.js → download-Dsbg3ste.js} +1 -1
- package/dist/elements/chunks/{dropdown-UhtAueYR.js → dropdown-BDd1-Zgi.js} +1 -1
- package/dist/elements/chunks/{ellipsis-B1sOOqiJ.js → ellipsis-Dw6qrss-.js} +1 -1
- package/dist/elements/chunks/{external-link-DToP_VKE.js → external-link-Vt74zAoL.js} +1 -1
- package/dist/elements/chunks/{file-text-BwUs_Pj4.js → file-text-CZrZF6_v.js} +1 -1
- package/dist/elements/chunks/{file-tree-C6RhmSnX.js → file-tree-DF4okKyo.js} +1 -1
- package/dist/elements/chunks/{folder-H_Xp0GYP.js → folder-glP5rha4.js} +1 -1
- package/dist/elements/chunks/{hover-card-Dn3yrk1l.js → hover-card-Cmm6Q53m.js} +1 -1
- package/dist/elements/chunks/{icon-BrxJQXzC.js → icon-BLb8beoi.js} +1 -1
- package/dist/elements/chunks/{info-11eT2q5H.js → info-CIsv92JK.js} +1 -1
- package/dist/elements/chunks/{input-B9oZKDfb.js → input-Dds1kFyt.js} +1 -1
- package/dist/elements/chunks/{kbd-D2fx3rWh.js → kbd-De_xbgi9.js} +1 -1
- package/dist/elements/chunks/{link-B-RNYWNw.js → link-i4r_k7z4.js} +1 -1
- package/dist/elements/chunks/{loader-BJh_aRlp.js → loader-BmQH4s3V.js} +1 -1
- package/dist/elements/chunks/{markdown-BIpjrDFv.js → markdown-Zi21WhUz.js} +7 -7
- package/dist/elements/chunks/{message-CPfqj8Gi.js → message-BqyXDN3-.js} +1 -1
- package/dist/elements/chunks/{message-feedback-8uj0aVYh.js → message-feedback-Djr3z6Yb.js} +1 -1
- package/dist/elements/chunks/message-square-vFAgbDaX.js +1 -0
- package/dist/elements/chunks/{minimize-2-C9qkiTJg.js → minimize-2--ifeCGrl.js} +1 -1
- package/dist/elements/chunks/{model-switcher-DRrMcRXH.js → model-switcher-B94YAKsM.js} +1 -1
- package/dist/elements/chunks/{overlay-C8_FUL8q.js → overlay-kD8dwRv_.js} +1 -1
- package/dist/elements/chunks/{paperclip-MA9hxLhW.js → paperclip-q21dYOSK.js} +1 -1
- package/dist/elements/chunks/{progress-bar-y5G6HDjg.js → progress-bar-BrAIIaaJ.js} +1 -1
- package/dist/elements/chunks/{prompt-suggestion-LalWvCJy.js → prompt-suggestion-Bjn2K-fR.js} +1 -1
- package/dist/elements/chunks/reasoning-DTpCGtnY.js +1 -0
- package/dist/elements/chunks/{resizable-xhYF5lCQ.js → resizable-Dp4JExql.js} +1 -1
- package/dist/elements/chunks/{rotate-cw-2ndEXjgS.js → rotate-cw-CFWWkpj2.js} +1 -1
- package/dist/elements/chunks/{scroll-area-BzOPDXrZ.js → scroll-area-Bb0kHH1j.js} +1 -1
- package/dist/elements/chunks/scroll-button-B0cH5fXf.js +1 -0
- package/dist/elements/chunks/{separator-CPvL5Xdl.js → separator-9kRgr1X9.js} +1 -1
- package/dist/elements/chunks/{settings-hmzIuNXD.js → settings-B8lmec4D.js} +1 -1
- package/dist/elements/chunks/{settings-group-BiIym17O.js → settings-group-I0hEuXiN.js} +1 -1
- package/dist/elements/chunks/{share-BbziTAzn.js → share-C3lTiYGt.js} +1 -1
- package/dist/elements/chunks/{skeleton-Bxhs1thL.js → skeleton-DSXW5Yya.js} +1 -1
- package/dist/elements/chunks/{star-BHL3Va5p.js → star-CSJtGxgv.js} +1 -1
- package/dist/elements/chunks/{store-tpnnWlxY.js → store-CHyW95TP.js} +1 -1
- package/dist/elements/chunks/{text-shimmer-1DCKivKx.js → text-shimmer-Cn9TmNpI.js} +1 -1
- package/dist/elements/chunks/{textarea-Czaowo9F.js → textarea-CUwqAX0G.js} +1 -1
- package/dist/elements/chunks/{thumbs-up-CdLqA13R.js → thumbs-up-PNVVThEF.js} +1 -1
- package/dist/elements/chunks/{toast-store-BvBquUFA.js → toast-store-DKbQn3Wn.js} +1 -1
- package/dist/elements/chunks/{tool-4P_ne8Go.js → tool-DjTRpIpl.js} +1 -1
- package/dist/elements/chunks/tooltip-CgBZCVKp.js +1 -0
- package/dist/elements/chunks/{triangle-alert-BllqxXq8.js → triangle-alert-DsHTHCPm.js} +1 -1
- package/dist/elements/chunks/{use-card-resolution-73xiddIW.js → use-card-resolution-BSu_XHjH.js} +1 -1
- package/dist/elements/chunks/variant-aurora-Dc4nQUia.js +218 -0
- package/dist/elements/chunks/variant-custom-y_3kVQhS.js +1 -0
- package/dist/elements/chunks/variant-wave-D5OR1-9Z.js +116 -0
- package/dist/elements/chunks/{video-O9rA6k7S.js → video-B7vmenoC.js} +1 -1
- package/dist/elements/chunks/x-GRUeeQFT.js +1 -0
- 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-list.js +1 -1
- package/dist/elements/define.d.ts +11 -0
- package/dist/elements/dialog.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-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/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/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/slots.d.ts +12 -0
- 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 +38 -0
- package/dist/index.js +18 -17
- package/dist/kai.es.js +1 -1
- package/dist/llms/llms-full.txt +40 -4
- package/dist/llms/llms.txt +3 -3
- package/dist/primitives/audio-bands.d.ts +106 -0
- package/dist/primitives/create-tween.d.ts +33 -0
- package/dist/primitives/use-audio-analysis.d.ts +149 -0
- package/dist/primitives/use-sequencer.d.ts +13 -0
- package/dist/primitives/use-voice-recorder.d.ts +1 -0
- package/dist/primitives/visualizer-sequences.d.ts +39 -0
- package/dist/react/index.d.ts +41 -0
- package/dist/react.js +159 -153
- package/dist/register-impl-DQyejdfb.js +145 -0
- package/dist/test-utils/fake-clock.d.ts +45 -0
- package/dist/variant-aurora-DVtGqVH6.js +218 -0
- package/dist/variant-custom-Dif-IV4u.js +1 -0
- package/dist/variant-wave-DbfNdvSi.js +116 -0
- package/frameworks/react/index.tsx +42 -0
- package/llms-full.txt +40 -4
- package/llms.txt +3 -3
- package/package.json +6 -3
- package/src/components/audio-visualizer/audio-visualizer.voice-fixture.ts +257 -0
- package/src/components/audio-visualizer/aurora.glsl.ts +330 -0
- package/src/components/audio-visualizer/index.tsx +442 -0
- package/src/components/audio-visualizer/shader-canvas.tsx +846 -0
- package/src/components/audio-visualizer/sizes.ts +54 -0
- package/src/components/audio-visualizer/variant-aurora.tsx +299 -0
- package/src/components/audio-visualizer/variant-bar.tsx +143 -0
- package/src/components/audio-visualizer/variant-custom.tsx +338 -0
- package/src/components/audio-visualizer/variant-grid.tsx +170 -0
- package/src/components/audio-visualizer/variant-radial.tsx +158 -0
- package/src/components/audio-visualizer/variant-wave.tsx +125 -0
- package/src/components/audio-visualizer/wave.glsl.ts +130 -0
- package/src/components/component-meta.json +24 -24
- package/src/elements/audio-visualizer.tsx +183 -0
- package/src/elements/compiled.css +1 -1
- package/src/elements/define.tsx +12 -1
- package/src/elements/element-manifest.json +4 -0
- package/src/elements/element-meta.json +170 -0
- package/src/elements/element-types.d.ts +38 -0
- package/src/elements/register-impl.ts +1 -0
- package/src/elements/slots.ts +35 -0
- package/src/primitives/audio-bands.ts +174 -0
- package/src/primitives/create-tween.ts +214 -0
- package/src/primitives/use-audio-analysis.ts +321 -0
- package/src/primitives/use-sequencer.ts +53 -0
- package/src/primitives/use-voice-recorder.ts +16 -4
- package/src/primitives/visualizer-sequences.ts +350 -0
- package/src/test-utils/fake-clock.ts +88 -0
- package/dist/elements/chunks/arrow-left-CifsGq8x.js +0 -1
- package/dist/elements/chunks/check-CUKS495w.js +0 -1
- package/dist/elements/chunks/chevron-down-AELmYT1j.js +0 -1
- package/dist/elements/chunks/chevron-right-C8g26oKh.js +0 -1
- package/dist/elements/chunks/circle-DGcI8Cft.js +0 -1
- package/dist/elements/chunks/circle-check-DuU0IcBQ.js +0 -1
- package/dist/elements/chunks/collapsible-DGjADCN6.js +0 -1
- package/dist/elements/chunks/define-DfTe4zwZ.js +0 -1
- package/dist/elements/chunks/message-square-CCSQ4M9g.js +0 -1
- package/dist/elements/chunks/reasoning-CW3SDdb4.js +0 -1
- package/dist/elements/chunks/scroll-button-B1x4cYqM.js +0 -1
- package/dist/elements/chunks/tooltip-CBeFqJKk.js +0 -1
- package/dist/elements/chunks/x-DeS3rQhx.js +0 -1
- package/dist/register-impl-CaaHJcea.js +0 -145
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as
|
|
1
|
+
import{s as A,c as G,l as D,m as W,i as P,B as se,g as j,a as H,b as ce,d as ue,S as U,r as de,t as M,A as fe,e as me}from"./define-D1din7Ld.js";import{c as E}from"./cn-CU7UAWzk.js";var q=M("<div>"),ge=M('<div><svg viewBox="0 0 4 8"fill=currentColor><circle cx=1 cy=1.5 r=0.6></circle><circle cx=3 cy=1.5 r=0.6></circle><circle cx=1 cy=4 r=0.6></circle><circle cx=3 cy=4 r=0.6></circle><circle cx=1 cy=6.5 r=0.6></circle><circle cx=3 cy=6.5 r=0.6>'),xe=M("<div class=pointer-events-none data-handle-line style=position:absolute>"),pe=M("<div role=separator aria-valuemin=0 aria-valuemax=100>");const J=fe();function L(l){if(l==null||l==="")return;if(typeof l=="number")return Number.isFinite(l)?`${l}%`:void 0;const t=l.trim();if(t==="")return;if(t.endsWith("%")||t.endsWith("px"))return t;const o=Number(t);return Number.isFinite(o)?`${o}%`:void 0}function T(l){const t=/^\s*(-?\d*\.?\d+)(px|%)\s*$/.exec(l);return t?{n:parseFloat(t[1]),unit:t[2]}:null}function K(l,t,o){if(l===void 0)return;const u=T(l),d=t===void 0?void 0:T(t),f=o===void 0?void 0:T(o);if(u&&(t===void 0||d?.unit===u.unit)&&(o===void 0||f?.unit===u.unit)){let i=u.n;return f&&(i=Math.min(i,f.n)),d&&(i=Math.max(i,d.n)),`${i}${u.unit}`}return t!==void 0&&o!==void 0?`clamp(${t}, ${l}, ${o})`:o!==void 0?`min(${l}, ${o})`:t!==void 0?`max(${t}, ${l})`:l}function ve(l){const[t,o]=A(l,["orientation","children","class"]),u=()=>t.orientation??"horizontal";return G(J.Provider,{get value(){return{orientation:u()}},get children(){var d=q();return D(d,W({get class(){return E("flex h-full w-full",u()==="vertical"?"flex-col":"flex-row",t.class)},get"data-orientation"(){return u()}},o),!1,!0),P(d,()=>t.children),d}})}function he(l){const[t,o]=A(l,["defaultSize","minSize","maxSize","locked","hidden","children","class","style"]),u=(i,v,g)=>{const m=L(i);if(m!==void 0)return m;const h=v==null?"":String(v).trim();if(h!==""){const n=parseFloat(h);if(Number.isFinite(n))return`${n}px`}const x=g==null?"":String(g).trim();if(x!==""){const n=parseFloat(x);if(Number.isFinite(n))return`${n}%`}},d=()=>{const i=o,v=u(t.minSize,i["data-min-size"],i["data-min-size-pct"]),g=u(t.maxSize,i["data-max-size"],i["data-max-size-pct"]),m=K(L(t.defaultSize),v,g);return{...m!==void 0?{"flex-basis":m,"flex-grow":"0","flex-shrink":"0"}:{flex:"1 1 0%"},display:"grid","grid-template-rows":"minmax(0, 1fr)","grid-template-columns":"minmax(0, 1fr)","min-width":"0","min-height":"0"}},f=()=>{const i={},v=(g,m,h)=>{if(g==null||g==="")return;if(typeof g=="number"){i[h]=String(g);return}const x=g.trim();x.endsWith("px")?i[m]=String(parseFloat(x)):x.endsWith("%")?i[h]=String(parseFloat(x)):Number.isFinite(Number(x))&&(i[h]=x)};return v(t.minSize,"data-min-size","data-min-size-pct"),v(t.maxSize,"data-max-size","data-max-size-pct"),v(t.defaultSize,"data-default-size","data-default-size-pct"),i};return(()=>{var i=q();return D(i,W({get class(){return E("overflow-hidden",t.class)},get style(){return{...d(),...typeof t.style=="object"?t.style:{}}},get"data-locked"(){return t.locked?"":void 0},get hidden(){return t.hidden||void 0}},f,o),!1,!0),P(i,()=>t.children),i})()}function R(l,t,o,u){const d=l.dataset[t==="min"?"minSize":"maxSize"];if(d!==void 0&&d!==""){const i=parseFloat(d);if(Number.isFinite(i))return i}const f=l.dataset[t==="min"?"minSizePct":"maxSizePct"];if(f!==void 0&&f!==""){const i=parseFloat(f);if(Number.isFinite(i))return i/100*o}return u}function ye(l){const[t,o]=A(l,["handle","onPanelResize","class","keyboardStep","static","orientation"]),u=se(J),d=()=>t.orientation??u?.orientation??"horizontal",[f,i]=j(!1),[v,g]=j(!1),m=()=>!!t.static,h=()=>t.handle??"line";let x=0,n=null,s=null,$=0,C=0;const y=()=>d()==="horizontal",p=()=>y()?"width":"height",O=e=>{if(m())return;const r=e.currentTarget;n=r.previousElementSibling,s=r.nextElementSibling,!(!n||!s)&&(e.preventDefault(),i(!0),r.setPointerCapture(e.pointerId),x=y()?e.clientX:e.clientY,$=n.getBoundingClientRect()[p()],C=s.getBoundingClientRect()[p()])},Q=e=>{if(!f()||!n||!s)return;const r=(y()?e.clientX:e.clientY)-x;F(r)};function F(e){var r;if(!n||!s)return!1;const a=n.parentElement,c=a?a.getBoundingClientRect()[p()]:0,z=R(n,"min",c,0),k=R(n,"max",c,999999),b=R(s,"min",c,0),B=R(s,"max",c,999999);let S=-1/0,w=1/0;if(S=Math.max(S,z-$),w=Math.min(w,k-$),S=Math.max(S,C-B),w=Math.min(w,C-b),S>w)return!1;const N=Math.max(S,Math.min(w,e)),ae=$+N,oe=C-N;return n.style.flexBasis=`${ae}px`,n.style.flexGrow="0",n.style.flexShrink="0",s.style.flexBasis=`${oe}px`,s.style.flexGrow="0",s.style.flexShrink="0",(r=t.onPanelResize)==null||r.call(t,N),!0}function X(){if(!n||!s)return;const e=n.parentElement;if(!e)return;const r=e.getBoundingClientRect()[p()];if(r<=0)return;const a=n.getBoundingClientRect()[p()]/r*100,c=s.getBoundingClientRect()[p()]/r*100;n.style.flexBasis=`${a}%`,s.style.flexBasis=`${c}%`}const V=()=>{X(),i(!1),n=null,s=null};function Y(e){const r=e.dataset.defaultSize,a=e.dataset.defaultSizePct;r!==void 0&&r!==""?(e.style.flexBasis=`${r}px`,e.style.flexGrow="0",e.style.flexShrink="0"):a!==void 0&&a!==""?(e.style.flexBasis=`${a}%`,e.style.flexGrow="0",e.style.flexShrink="0"):(e.style.flexBasis="",e.style.flexGrow="1",e.style.flexShrink="1")}const Z=e=>{var r;if(m())return;const a=e.currentTarget,c=a.previousElementSibling,z=a.nextElementSibling;!c||!z||(e.preventDefault(),Y(c),Y(z),(r=t.onPanelResize)==null||r.call(t,0))},_=j(50),[ee,te]=_;function ne(e){return n=e.previousElementSibling,s=e.nextElementSibling,!n||!s?!1:($=n.getBoundingClientRect()[p()],C=s.getBoundingClientRect()[p()],!0)}function ie(){if(!n)return;const e=n.parentElement;if(!e)return;const r=e.getBoundingClientRect()[p()];if(r<=0)return;const a=n.getBoundingClientRect()[p()]/r*100;te(Math.round(a))}const re=e=>{if(m())return;const r=e.currentTarget,a=t.keyboardStep??16,c=y(),z=c?"ArrowLeft":"ArrowUp",k=c?"ArrowRight":"ArrowDown";let b=null;if(e.key===z)b=-a;else if(e.key===k)b=a;else if(e.key==="Home")b="min";else if(e.key==="End")b="max";else return;if(e.preventDefault(),!!ne(r)){if(b==="min"){const B=n.parentElement,S=B?B.getBoundingClientRect()[p()]:0,w=R(n,"min",S,0);F(w-$)}else if(b==="max"){const B=n.parentElement,S=B?B.getBoundingClientRect()[p()]:0,w=R(n,"max",S,999999);F(w-$)}else F(b);ie(),X(),n=null,s=null}},I=()=>f()&&h()!=="line",le=()=>f()?"var(--color-muted, #f4f4f5)":v()?"var(--color-border, #e4e4e7)":"transparent";return(()=>{var e=pe();return e.$$keydown=re,e.$$dblclick=Z,e.addEventListener("pointerleave",()=>g(!1)),e.addEventListener("pointerenter",()=>g(!0)),e.$$pointerup=V,e.$$pointermove=Q,e.$$pointerdown=O,D(e,W({get class(){return E("relative flex items-center justify-center",t.class)},get style(){return{cursor:m()?"default":y()?"col-resize":"row-resize",[y()?"width":"height"]:"8px",background:I()?"var(--color-muted-foreground, #98989f)":"transparent",opacity:I()?"0.3":"1"}},get tabIndex(){return m()?void 0:0},get"data-orientation"(){return d()},get"data-static"(){return m()?"":void 0},get"aria-orientation"(){return y()?"vertical":"horizontal"},get"aria-valuenow"(){return ee()}},o),!1,!0),P(e,G(U,{get when(){return h()==="grip"},get children(){var r=ge(),a=r.firstChild;return H(c=>{var z=E("z-10 flex items-center justify-center",y()?"h-6 w-3 flex-col":"h-3 w-6 flex-row"),k=E("text-muted-foreground/40",y()?"h-3 w-2":"h-2 w-3 rotate-90");return z!==c.e&&ce(r,c.e=z),k!==c.t&&ue(a,"class",c.t=k),c},{e:void 0,t:void 0}),r}}),null),P(e,G(U,{get when(){return h()==="line"},get children(){var r=xe();return H(a=>de(r,{background:le(),...y()?{top:"0",bottom:"0",left:"50%",width:"1px",transform:"translateX(-0.5px)"}:{left:"0",right:"0",top:"50%",height:"1px",transform:"translateY(-0.5px)"}},a)),r}}),null),e})()}me(["pointerdown","pointermove","pointerup","dblclick","keydown"]);export{ve as R,he as a,ye as b,K as c,L as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./Icon-
|
|
1
|
+
import{I as e}from"./Icon-Tj58ES_d.js";import{c as o,m as t}from"./define-D1din7Ld.js";var p=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],d=a=>o(e,t(a,{name:"Code",iconNode:p})),n=d,i=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],m=a=>o(e,t(a,{name:"House",iconNode:i})),r=m,s=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],l=a=>o(e,t(a,{name:"RotateCw",iconNode:s})),y=l;export{n as c,r as h,y as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e,l as i,m as s,i as l,t as c}from"./define-
|
|
1
|
+
import{s as e,l as i,m as s,i as l,t as c}from"./define-D1din7Ld.js";import{c as d}from"./cn-CU7UAWzk.js";var f=c("<div tabindex=0>");function v(t){const[o,a]=e(t,["children","class","orientation"]),n=()=>o.orientation==="horizontal"?"overflow-x-auto overflow-y-hidden":o.orientation==="both"?"overflow-auto":"overflow-y-auto overflow-x-hidden";return(()=>{var r=f();return i(r,s({get class(){return d(n(),"scrollbar-thin",o.class)}},a),!1,!0),l(r,()=>o.children),r})()}export{v as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as i}from"./cn-CU7UAWzk.js";import{B as w}from"./button-ZWNif3--.js";import{g as x,p as A,s as u,c as f,u as C,l as m,m as h,i as g,t as d,A as T,B as y}from"./define-D1din7Ld.js";import{c as E}from"./chevron-down-BNsxc2hk.js";const H=50;function L(){const[t,o]=x(!0);let r,e=!0;function a(){if(!r)return;const{scrollTop:s,scrollHeight:c,clientHeight:b}=r,v=c-s-b<H;o(v),e=v}function l(s="smooth"){r&&(r.scrollTo({top:r.scrollHeight,behavior:s}),e=!0,o(!0))}function n(){e&&requestAnimationFrame(()=>l("instant"))}function B(s){r=s,s.addEventListener("scroll",a,{passive:!0});const c=new MutationObserver(n);c.observe(s,{childList:!0,subtree:!0,characterData:!0}),A(()=>{s.removeEventListener("scroll",a),c.disconnect()})}return{ref:B,isAtBottom:t,scrollToBottom:l}}var k=d("<div role=log tabindex=0>"),S=d("<div>"),q=d("<div aria-hidden=true>");const p=T();function z(){const t=y(p);if(!t)throw new Error("useChatContainer must be used within ChatContainer");return t}function D(t){const[o,r]=u(t,["children","class"]),{ref:e,isAtBottom:a,scrollToBottom:l}=L();return f(p.Provider,{value:{isAtBottom:a,scrollToBottom:l},get children(){var n=k();return C(e,n),m(n,h({get class(){return i("flex flex-col overflow-y-auto",o.class)}},r),!1,!0),g(n,()=>o.children),n}})}function F(t){const[o,r]=u(t,["children","class"]);return(()=>{var e=S();return m(e,h({get class(){return i("flex w-full flex-col",o.class)}},r),!1,!0),g(e,()=>o.children),e})()}function I(t){const[o,r]=u(t,["class"]);return(()=>{var e=q();return m(e,h({get class(){return i("h-px w-full shrink-0 scroll-mt-4",o.class)}},r),!1,!1),e})()}function M(t){const{isAtBottom:o,scrollToBottom:r}=z();return f(w,{get variant(){return t.variant??"outline"},get size(){return t.size??"sm"},"aria-label":"Scroll to bottom",get class(){return i("h-10 w-10 rounded-full transition-all duration-150 ease-out",o()?"pointer-events-none translate-y-4 scale-95 opacity-0":"translate-y-0 scale-100 opacity-100",t.class)},onClick:()=>r(),get children(){return f(E,{class:"h-5 w-5"})}})}export{D as C,M as S,F as a,I as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e,l as n,m as i,t as l}from"./define-
|
|
1
|
+
import{s as e,l as n,m as i,t as l}from"./define-D1din7Ld.js";import{c}from"./cn-CU7UAWzk.js";var p=l("<div role=separator>");function u(t){const[r,a]=e(t,["orientation","class"]),o=()=>r.orientation==="vertical";return(()=>{var s=p();return n(s,i({get class(){return c("shrink-0 bg-border",o()?"h-full w-px":"h-px w-full",r.class)}},a),!1,!1),s})()}export{u as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as l}from"./Icon-
|
|
1
|
+
import{I as l}from"./Icon-Tj58ES_d.js";import{c as r,m as e}from"./define-D1din7Ld.js";var o=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],c=a=>r(l,e(a,{name:"Settings",iconNode:o})),m=c;export{m as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,c as a,S as d,a as c,b as u,t as i}from"./define-
|
|
1
|
+
import{i as e,c as a,S as d,a as c,b as u,t as i}from"./define-D1din7Ld.js";import{c as f}from"./cn-CU7UAWzk.js";var p=i('<p class="text-xs text-muted-foreground">'),x=i('<section><div part=header class="flex flex-col gap-0.5 px-1"><h3 class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"></h3></div><div part=body class="divide-y divide-border overflow-hidden rounded-xl border border-border bg-surface">'),g=i('<span class="text-xs leading-snug text-muted-foreground">'),h=i("<div part=control class=shrink-0>"),v=i('<div><div part=label class="flex min-w-0 flex-col gap-0.5"><span class="text-sm text-foreground">');function b(r){return(()=>{var t=x(),s=t.firstChild,l=s.firstChild,n=s.nextSibling;return e(l,()=>r.heading),e(s,a(d,{get when(){return r.description},get children(){var o=p();return e(o,()=>r.description),o}}),null),e(n,()=>r.children),c(()=>u(t,f("flex flex-col gap-2",r.class))),t})()}function m(r){return(()=>{var t=v(),s=t.firstChild,l=s.firstChild;return e(l,()=>r.label),e(s,a(d,{get when(){return r.description},get children(){var n=g();return e(n,()=>r.description),n}}),null),e(t,a(d,{get when(){return r.control},get children(){var n=h();return e(n,()=>r.control),n}}),null),c(()=>u(t,f("flex items-center justify-between gap-4 px-4 py-3",r.class))),t})()}export{m as S,b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./Icon-
|
|
1
|
+
import{I as e}from"./Icon-Tj58ES_d.js";import{c as o,m as y}from"./define-D1din7Ld.js";var h=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],i=a=>o(e,y(a,{name:"Bookmark",iconNode:h})),m=i,n=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],c=a=>o(e,y(a,{name:"Copy",iconNode:n})),p=c,s=[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]],k=a=>o(e,y(a,{name:"Flag",iconNode:s})),t=k,d=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],r=a=>o(e,y(a,{name:"Pencil",iconNode:d})),x=r,l=[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]],f=a=>o(e,y(a,{name:"Share",iconNode:l})),v=f;export{m as b,p as c,t as f,x as p,v as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as m,c as u,i as v,F as w,S as p,t as c,l as x,m as y}from"./define-
|
|
1
|
+
import{s as m,c as u,i as v,F as w,S as p,t as c,l as x,m as y}from"./define-D1din7Ld.js";import{c as b}from"./cn-CU7UAWzk.js";var k=c("<div part=skeleton>"),S=c('<div class="flex w-full flex-col gap-2">');const l=r=>typeof r=="number"?`${r}px`:r,F=r=>r==="circle"?"rounded-full":r==="text"?"rounded":"rounded-md";function j(r){const[t,o]=m(r,["class","variant","width","height","lines","style"]),s=()=>t.width!=null,d=()=>t.height!=null,g=()=>!s()&&t.variant!=null&&t.variant!=="circle",f=a=>{const e=typeof t.style=="object"&&t.style?{...t.style}:{};if(t.variant==="circle"){const n=l(t.width)??l(t.height)??"2.5rem";return e.width=n,e.height=n,e}return a?e.width="70%":s()&&(e.width=l(t.width)),d()?e.height=l(t.height):t.variant==="text"&&(e.height="0.75rem"),e},h=(a=!1)=>(()=>{var e=k();return x(e,y({get class(){return b("animate-pulse bg-foreground/10",F(t.variant),g()&&"w-full",t.class)},get style(){return f(a)}},o),!1,!1),e})(),i=()=>t.variant==="text"?Math.max(1,t.lines??1):1;return u(p,{get when(){return i()>1},get fallback(){return h()},get children(){var a=S();return v(a,u(w,{get each(){return Array.from({length:i()})},children:(e,n)=>h(n()===i()-1)})),a}})}export{j as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as r}from"./Icon-
|
|
1
|
+
import{I as r}from"./Icon-Tj58ES_d.js";import{c as a,m}from"./define-D1din7Ld.js";var p=[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]],s=o=>a(r,m(o,{name:"Star",iconNode:p})),t=s;export{t as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as u,J as K,K as P,L as w,g as z}from"./define-
|
|
1
|
+
import{$ as u,J as K,K as P,L as w,g as z}from"./define-D1din7Ld.js";const h=Symbol("store-raw"),y=Symbol("store-node"),f=Symbol("store-has"),m=Symbol("store-self");function v(t){let r=t[u];if(!r&&(Object.defineProperty(t,u,{value:r=new Proxy(t,J)}),!Array.isArray(t))){const o=Object.keys(t),e=Object.getOwnPropertyDescriptors(t),c=Object.getPrototypeOf(t),n=c!==null&&t!==null&&typeof t=="object"&&!Array.isArray(t)&&c!==Object.prototype;if(n){const i=Object.getOwnPropertyDescriptors(c);o.push(...Object.keys(i)),Object.assign(e,i)}for(let i=0,l=o.length;i<l;i++){const s=o[i];n&&s==="constructor"||e[s].get&&Object.defineProperty(t,s,{configurable:!0,enumerable:e[s].enumerable,get:e[s].get.bind(r)})}}return r}function g(t){let r;return t!=null&&typeof t=="object"&&(t[u]||!(r=Object.getPrototypeOf(t))||r===Object.prototype||Array.isArray(t))}function a(t,r=new Set){let o,e,c,n;if(o=t!=null&&t[h])return o;if(!g(t)||r.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):r.add(t);for(let i=0,l=t.length;i<l;i++)c=t[i],(e=a(c,r))!==c&&(t[i]=e)}else{Object.isFrozen(t)?t=Object.assign({},t):r.add(t);const i=Object.keys(t),l=Object.getOwnPropertyDescriptors(t);for(let s=0,d=i.length;s<d;s++)n=i[s],!l[n].get&&(c=t[n],(e=a(c,r))!==c&&(t[n]=e))}return t}function _(t,r){let o=t[r];return o||Object.defineProperty(t,r,{value:o=Object.create(null)}),o}function b(t,r,o){if(t[r])return t[r];const[e,c]=z(o,{equals:!1,internal:!0});return e.$=c,t[r]=e}function F(t,r){const o=Reflect.getOwnPropertyDescriptor(t,r);return!o||o.get||!o.configurable||r===u||r===y||(delete o.value,delete o.writable,o.get=()=>t[u][r]),o}function $(t){w()&&b(_(t,y),m)()}function R(t){return $(t),Reflect.ownKeys(t)}const J={get(t,r,o){if(r===h)return t;if(r===u)return o;if(r===P)return $(t),o;const e=_(t,y),c=e[r];let n=c?c():t[r];if(r===y||r===f||r==="__proto__")return n;if(!c){const i=Object.getOwnPropertyDescriptor(t,r);w()&&(typeof n!="function"||t.hasOwnProperty(r))&&!(i&&i.get)&&(n=b(e,r,n)())}return g(n)?v(n):n},has(t,r){return r===h||r===u||r===P||r===y||r===f||r==="__proto__"?!0:(w()&&b(_(t,f),r)(),r in t)},set(){return!0},deleteProperty(){return!0},ownKeys:R,getOwnPropertyDescriptor:F};function p(t,r,o,e=!1){if(r==="__proto__"||!e&&t[r]===o)return;const c=t[r],n=t.length;o===void 0?(delete t[r],t[f]&&t[f][r]&&c!==void 0&&t[f][r].$()):(t[r]=o,t[f]&&t[f][r]&&c===void 0&&t[f][r].$());let i=_(t,y),l;if((l=b(i,r,c))&&l.$(()=>o),Array.isArray(t)&&t.length!==n){for(let s=t.length;s<n;s++)(l=i[s])&&l.$();(l=b(i,"length",n))&&l.$(t.length)}(l=i[m])&&l.$()}function D(t,r){const o=Object.keys(r);for(let e=0;e<o.length;e+=1){const c=o[e];k(c)||p(t,c,r[c])}}function k(t){return t==="__proto__"||t==="constructor"||t==="prototype"}function L(t,r){if(typeof r=="function"&&(r=r(t)),r=a(r),Array.isArray(r)){if(t===r)return;let o=0,e=r.length;for(;o<e;o++){const c=r[o];t[o]!==c&&p(t,o,c)}p(t,"length",e)}else D(t,r)}function O(t,r,o=[]){let e,c=t;if(r.length>1){e=r.shift();const i=typeof e,l=Array.isArray(t);if(i==="string"&&(e==="__proto__"||r.length>1&&k(e)))return;if(Array.isArray(e)){for(let s=0;s<e.length;s++)O(t,[e[s]].concat(r),o);return}else if(l&&i==="function"){for(let s=0;s<t.length;s++)e(t[s],s)&&O(t,[s].concat(r),o);return}else if(l&&i==="object"){const{from:s=0,to:d=t.length-1,by:x=1}=e;for(let A=s;A<=d;A+=x)O(t,[A].concat(r),o);return}else if(r.length>1){O(t[e],r,[e].concat(o));return}c=t[e],o=[e].concat(o)}let n=r[0];typeof n=="function"&&(n=n(c,o),n===c)||e===void 0&&n==null||(n=a(n),e===void 0||g(c)&&g(n)&&!Array.isArray(n)?D(c,n):p(t,e,n))}function W(...[t,r]){const o=a(t||{}),e=Array.isArray(o),c=v(o);function n(...i){K(()=>{e&&i.length===1?L(o,i[0]):O(o,i)})}return[c,n]}const j=new WeakMap,S={get(t,r){if(r===h)return t;const o=t[r];if(r===u||r===P||r===y||r===f||r==="__proto__")return o;let e;return g(o)?j.get(o)||(j.set(o,e=new Proxy(o,S)),e):o},set(t,r,o){return p(t,r,a(o)),!0},deleteProperty(t,r){return p(t,r,void 0,!0),!0}};function q(t){return r=>{if(g(r)){let o;(o=j.get(r))||j.set(r,o=new Proxy(r,S)),t(o)}return r}}export{W as c,q as p,a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as o,c as i,m as s,D as m}from"./define-
|
|
1
|
+
import{s as o,c as i,m as s,D as m}from"./define-D1din7Ld.js";import{c}from"./cn-CU7UAWzk.js";function u(a){const[r,e]=o(a,["as","class","duration","spread","children"]),t=()=>Math.min(Math.max(r.spread??20,5),45),n=()=>r.as??"span";return i(m,s({get component(){return n()},get class(){return c("bg-size-[200%_auto] bg-clip-text font-medium text-transparent","animate-[shimmer_4s_infinite_linear]",r.class)},get style(){return{"background-image":`linear-gradient(to right, var(--color-muted-foreground) ${50-t()}%, var(--color-foreground) 50%, var(--color-muted-foreground) ${50+t()}%)`,"animation-duration":`${r.duration??4}s`}}},e,{get children(){return r.children}}))}export{u as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as s,s as a,u,l,m as f,t as g}from"./define-
|
|
1
|
+
import{p as s,s as a,u,l,m as f,t as g}from"./define-D1din7Ld.js";import{c as m}from"./cn-CU7UAWzk.js";function c(i={}){let e;function r(){if(!e)return;e.style.height="auto";const t=e.scrollHeight;i.maxHeight&&t>i.maxHeight?(e.style.height=`${i.maxHeight}px`,e.style.overflowY="auto"):(e.style.height=`${t}px`,e.style.overflowY="hidden")}function n(t){e=t,t.addEventListener("input",r),requestAnimationFrame(r),s(()=>t.removeEventListener("input",r))}return{ref:n,resize:r}}var h=g("<textarea rows=1>");function d(i){const[e,r]=a(i,["class","maxHeight","autoResize"]),{ref:n}=c({maxHeight:e.maxHeight});return(()=>{var t=h(),o=e.autoResize!==!1?n:void 0;return typeof o=="function"&&u(o,t),l(t,f({get class(){return m("w-full resize-none rounded-md bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",e.class)}},r),!1,!1),t})()}export{d as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as m}from"./Icon-
|
|
1
|
+
import{I as m}from"./Icon-Tj58ES_d.js";import{c as e,m as o}from"./define-D1din7Ld.js";var h=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],t=a=>e(m,o(a,{name:"ThumbsDown",iconNode:h})),n=t,p=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],r=a=>e(m,o(a,{name:"ThumbsUp",iconNode:p})),d=r;export{n as a,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as p,g as v}from"./define-
|
|
1
|
+
import{Q as p,g as v}from"./define-D1din7Ld.js";import{c as m,p as f}from"./store-CHyW95TP.js";let e={};function g(i){e.stack&&i.setAttribute("stack",e.stack),e.position&&i.setAttribute("position",e.position),e.max!==void 0&&i.setAttribute("max",String(e.max)),e.appearance&&i.setAttribute("appearance",e.appearance),e.inverse!==void 0&&(e.inverse?i.setAttribute("inverse",""):i.removeAttribute("inverse"))}const b=5e3,x=7e3,{toasts:a,setToasts:o,mounted:O,setMounted:A}=p(()=>{const[i,t]=m([]),[n,s]=v(!1);return{toasts:i,setToasts:t,mounted:n,setMounted:s}});let u=0;function k(){return u+=1,`toast-${u}`}function M(i){const t=i.duration??b;return t===0?0:i.action?Math.max(t,x):t}const c=new Map;function h(i=null){if(typeof document>"u")return;const t=c.get(i);if(t&&t.isConnected)return t;const n=document.createElement("kai-toast-region");return document.body.appendChild(n),n.toasts=a,i&&(n.target=i),g(n),c.set(i,n),A(!0),n}function w(i){const t=a.findIndex(n=>n.id===i.id);t>=0?o(t,i):o(f(n=>{n.push(i)}))}function d(i){o(t=>t.filter(n=>n.id!==i))}function I(i){return{id:i,dismiss:()=>d(i),update:t=>{const n=a.findIndex(s=>s.id===i);n>=0&&o(n,s=>({...s,...t}))}}}function r(i,t,n){h(t?.target??null);const s=t?.id??k(),l={id:s,message:i,variant:t?.variant??n,appearance:t?.appearance??e.appearance??"pill",inverse:t?.inverse??e.inverse??!1,description:t?.description,action:t?.action,duration:t?.duration,dismissible:t?.dismissible,target:t?.target};return w(l),I(s)}const T=Object.assign((i,t)=>r(i,t,"neutral"),{success:(i,t)=>r(i,t,"success"),warning:(i,t)=>r(i,t,"warning"),error:(i,t)=>r(i,t,"error"),info:(i,t)=>r(i,t,"info"),dismiss:d,clear:()=>o([])});export{M as r,T as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,m as b,s as B,g as E,i as a,S as l,F as L,n as y,a as p,b as M,t as o,
|
|
1
|
+
import{c as t,m as b,s as B,g as E,i as a,S as l,F as L,n as y,a as p,b as M,t as o,r as g}from"./define-D1din7Ld.js";import{c as P}from"./cn-CU7UAWzk.js";import{a as $,b as q,C as D}from"./collapsible-DM1Ckd4e.js";import{B as F}from"./button-ZWNif3--.js";import{c as J}from"./chevron-down-BNsxc2hk.js";import{I as k}from"./Icon-Tj58ES_d.js";import{c as V}from"./circle-x-B7faJFlY.js";import{s as A}from"./settings-B8lmec4D.js";var G=[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],H=e=>t(k,b(e,{name:"CircleCheckBig",iconNode:G})),K=H,Q=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],U=e=>t(k,b(e,{name:"LoaderCircle",iconNode:Q})),W=U,X=o('<span class="px-2 py-1 rounded-full text-xs font-medium">Processing'),Y=o('<span class="px-2 py-1 rounded-full text-xs font-medium">Ready'),Z=o('<span class="px-2 py-1 rounded-full text-xs font-medium">Completed'),_=o('<span class="px-2 py-1 rounded-full text-xs font-medium">Error'),tt=o('<div><h4 class="text-muted-foreground mb-2 text-sm font-medium">Input</h4><div class="rounded bg-surface-strong p-2 font-mono text-sm">'),et=o('<div><h4 class="text-muted-foreground mb-2 text-sm font-medium">Output</h4><div tabindex=0 class="max-h-60 overflow-auto rounded bg-surface-strong p-2 font-mono text-sm"><pre class=whitespace-pre-wrap>'),rt=o('<div><h4 class="mb-2 text-sm font-medium text-red-600 dark:text-red-400">Error</h4><div class="rounded bg-red-500/10 p-2 text-sm">'),nt=o('<div class="text-muted-foreground text-sm">Processing tool call...'),at=o('<div class="text-muted-foreground pt-2 text-xs"><span class=font-mono>Call ID: '),lt=o('<div class="space-y-3 p-3">'),ot=o("<div>"),st=o('<div class="flex items-center gap-2"><span class="font-mono text-sm font-medium">'),it=o("<div class=mb-1><span class=text-muted-foreground>:</span> <span>");function S(e){return e===null?"null":e===void 0?"undefined":typeof e=="string"?e:typeof e=="object"?JSON.stringify(e,null,2):String(e)}function ut(e){return[t(l,{get when(){return e.state==="input-streaming"},get children(){return t(W,{class:"size-4 animate-spin text-blue-500"})}}),t(l,{get when(){return e.state==="input-available"},get children(){return t(A,{class:"size-4 text-orange-500"})}}),t(l,{get when(){return e.state==="output-available"},get children(){return t(K,{class:"size-4 text-green-500"})}}),t(l,{get when(){return e.state==="output-error"},get children(){return t(V,{class:"size-4 text-red-500"})}})]}const dt={"input-streaming":"var(--color-tool-blue)","input-available":"var(--color-tool-amber)","output-available":"var(--color-tool-green)","output-error":"var(--color-tool-red)"},ct={"input-streaming":"hsl(217 91% 60%)","input-available":"hsl(38 92% 50%)","output-available":"hsl(142 71% 45%)","output-error":"hsl(0 84% 60%)"};function f(e){return{color:dt[e],background:`color-mix(in oklab, ${ct[e]} 15%, transparent)`}}function pt(e){return[t(l,{get when(){return e.state==="input-streaming"},get children(){var r=X();return p(u=>g(r,f("input-streaming"),u)),r}}),t(l,{get when(){return e.state==="input-available"},get children(){var r=Y();return p(u=>g(r,f("input-available"),u)),r}}),t(l,{get when(){return e.state==="output-available"},get children(){var r=Z();return p(u=>g(r,f("output-available"),u)),r}}),t(l,{get when(){return e.state==="output-error"},get children(){var r=_();return p(u=>g(r,f("output-error"),u)),r}})]}function mt(e){const[r,u]=B(e,["toolPart","defaultOpen","disabled","controllerRef","class"]),[z,O]=E(),I=()=>{var d;return((d=z())==null?void 0:d.open())??r.defaultOpen??!1},m=()=>r.toolPart.state,h=()=>r.toolPart.input,w=()=>r.toolPart.output;return(()=>{var d=ot();return a(d,t(D,{get defaultOpen(){return r.defaultOpen},get disabled(){return r.disabled},controllerRef:s=>{var n;O(s),(n=r.controllerRef)==null||n.call(r,s)},get children(){return[t($,{as:s=>t(F,b({variant:"ghost",class:"h-auto w-full justify-between rounded-b-none px-3 py-2 font-normal"},s,{get children(){return[(()=>{var n=st(),i=n.firstChild;return a(n,t(ut,{get state(){return m()}}),i),a(i,()=>r.toolPart.type),a(n,t(pt,{get state(){return m()}}),null),n})(),t(J,{get class(){return P("size-4 transition-transform",I()&&"rotate-180")}})]}}))}),t(q,{class:"data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden",get children(){var s=lt();return a(s,t(l,{get when(){return y(()=>!!h())()&&Object.keys(h()).length>0},get children(){var n=tt(),i=n.firstChild,c=i.nextSibling;return a(c,t(L,{get each(){return Object.entries(h())},children:([v,j])=>(()=>{var C=it(),x=C.firstChild,R=x.firstChild,N=x.nextSibling,T=N.nextSibling;return a(x,v,R),a(T,()=>S(j)),C})()})),n}}),null),a(s,t(l,{get when(){return w()},get children(){var n=et(),i=n.firstChild,c=i.nextSibling,v=c.firstChild;return a(v,()=>S(w())),n}}),null),a(s,t(l,{get when(){return y(()=>m()==="output-error")()&&r.toolPart.errorText},get children(){var n=rt(),i=n.firstChild,c=i.nextSibling;return a(c,()=>r.toolPart.errorText),n}}),null),a(s,t(l,{get when(){return m()==="input-streaming"},get children(){return nt()}}),null),a(s,t(l,{get when(){return r.toolPart.toolCallId},get children(){var n=at(),i=n.firstChild;return i.firstChild,a(i,()=>r.toolPart.toolCallId,null),n}}),null),s}})]}})),p(()=>M(d,P("mt-3 overflow-hidden rounded-lg bg-surface",r.class))),d})()}export{mt as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as L,y as M,x as S,g as s,p as $,c as v,P as j,u as B,d as f,i as G,a as H,q as g,b as J,S as K,t as N}from"./define-D1din7Ld.js";import{c as Q}from"./cn-CU7UAWzk.js";import{c as U,u as V,a as W,A as X}from"./overlay-kD8dwRv_.js";var Y=N("<div role=tooltip style=position:fixed;pointer-events:none>");function Z(R){var x;const[n]=L(R,["content","children","class","openDelay","closeDelay","placement","defaultOpen","disabled","controllerRef","dismissOnClick"]),F=M(),b=S(),[i,t]=s(n.defaultOpen??!1),[r,q]=s(),[y,A]=s();(x=n.controllerRef)==null||x.call(n,{open:i,setOpen:e=>t(e&&!n.disabled)});let a,l=!1;const[E,c]=s(!1),[I,u]=s(!1),h=(e=0)=>{n.disabled||(clearTimeout(a),e?a=window.setTimeout(()=>t(!0),e):t(!0))},p=()=>{clearTimeout(a);const e=n.closeDelay??0;e?a=window.setTimeout(()=>t(!1),e):t(!1)},w=()=>{!E()&&!I()&&p()},T=()=>{n.dismissOnClick!==!1&&(c(!1),u(!1),p())};$(()=>clearTimeout(a));const d=U(i),m=V(r,y,{placement:n.placement??"top",gutter:6,onDisconnect:()=>t(!1)});return W({enabled:i,onDismiss:p,refs:()=>[r(),y()]}),[v(X,{as:"span",class:"inline-flex",ref:q,get"aria-describedby"(){return i()?b:void 0},onPointerEnter:()=>{c(!0),h(n.openDelay??600)},onPointerLeave:()=>{c(!1),w()},onPointerDown:()=>{l=!0,T(),window.setTimeout(()=>{l=!1},0)},onClick:T,onFocusIn:()=>{u(!0),l||h()},onFocusOut:e=>{const o=r();o&&o.contains(e.relatedTarget)||(u(!1),w())},get children(){return n.children}}),v(K,{get when(){return d.present()},get children(){return v(j,{get mount(){return F.portalMount()},get children(){var e=Y();return B(o=>{A(o),d.setRef(o)},e),f(e,"id",b),G(e,()=>n.content),H(o=>{var D=d.state()==="open"?"":void 0,O=d.state()==="closed"?"":void 0,P=`${m.pos().x}px`,k=`${m.pos().y}px`,z=m.hidden()?"hidden":"visible",C=Q("z-50 rounded-md bg-foreground px-2.5 py-1 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95",n.class);return D!==o.e&&f(e,"data-expanded",o.e=D),O!==o.t&&f(e,"data-closed",o.t=O),P!==o.a&&g(e,"left",o.a=P),k!==o.o&&g(e,"top",o.o=k),z!==o.i&&g(e,"visibility",o.i=z),C!==o.n&&J(e,o.n=C),o},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),e}})}})]}export{Z as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./Icon-
|
|
1
|
+
import{I as e}from"./Icon-Tj58ES_d.js";import{c as p,m as o}from"./define-D1din7Ld.js";var r=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],t=a=>p(e,o(a,{name:"TriangleAlert",iconNode:r})),m=t;export{m as t};
|
package/dist/elements/chunks/{use-card-resolution-73xiddIW.js → use-card-resolution-BSu_XHjH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,m,i as p,S as f,a as g,d as h,t as v,
|
|
1
|
+
import{c as o,m,i as p,S as f,a as g,d as h,t as v,B as x,A as C,g as k,h as b,o as w,j as i}from"./define-D1din7Ld.js";import{c as $}from"./cn-CU7UAWzk.js";import{B as y}from"./button-ZWNif3--.js";import{C as R}from"./card-BkHbp4BA.js";import{I as S}from"./Icon-Tj58ES_d.js";var L=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],A=s=>o(S,m(s,{name:"RotateCcw",iconNode:L})),B=A,D=v('<div role=group class="flex flex-wrap items-center gap-x-2 gap-y-1"><span class="min-w-0 text-sm text-muted-foreground"><span class="font-medium text-foreground"></span> <span class=text-foreground></span><span class=text-muted-foreground> \u2014 dismissed');const T={confirm:"Proposed",choice:"Choose",form:"Form",tasks:"Tasks"};function j(s){const t=T[s];return t?`${t}:`:s.length===0?"Card:":`${s.charAt(0).toUpperCase()}${s.slice(1)}:`}function q(s){const t=()=>j(s.type),a=()=>s.title??"this card",e=()=>s.reopenLabel??"Reopen",c=()=>`${t()} ${a()} \u2014 dismissed`;return o(R,{dense:!0,get class(){return s.class},get children(){var n=D(),l=n.firstChild,d=l.firstChild,r=d.nextSibling,u=r.nextSibling;return p(d,t),p(u,a),p(n,o(y,{type:"button",variant:"ghost",size:"sm",get class(){return $("ml-auto gap-1.5")},onClick:()=>s.onReopen(),get children(){return[o(B,{size:14,"aria-hidden":"true"}),o(f,{get when(){return e()},get children(){return e()}})]}}),null),g(()=>h(n,"aria-label",c())),n}})}const z=C();function F(){return x(z)}const I=new Set(["action","submit","expired"]);function M(s){const[t,a]=k(void 0);b(w(s.data,()=>a(void 0),{defer:!0}));const e=i(()=>s.prop()??t()),c=i(()=>e()!==void 0),n=i(()=>{const r=e();return r!==void 0&&I.has(r.kind)}),l=i(()=>{var r;return((r=e())==null?void 0:r.kind)==="dismissed"}),d=i(()=>s.prop()===void 0&&t()!==void 0);return{resolution:e,isResolved:c,isTerminal:n,isDeferred:l,isOptimistic:d,setLocal:a}}export{q as D,M as a,F as u};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import{h as u,i as x,c as y,a as b,d as w,b as R,q as A,g as S,p as _,t as k}from"./define-D1din7Ld.js";import{c as n,h as q,D as M,S as T}from"./create-tween-oVvAIG8r.js";import{C as W}from"./audio-visualizer-BqNy7dfm.js";const C=`
|
|
2
|
+
const float PI = 3.14159265359;
|
|
3
|
+
// Strand phase span: 0.5 + pi (fact sheet section 2's "sigma", the
|
|
4
|
+
// midpoint of the interval [1, 2*pi] with the interpolation knob fixed
|
|
5
|
+
// at 0.5).
|
|
6
|
+
const float STRAND_SIGMA = 0.5 + PI;
|
|
7
|
+
const int STRAND_COUNT = 36;
|
|
8
|
+
|
|
9
|
+
// 4-octave directional-sine warp cascade. M0 and the per-octave rotation B
|
|
10
|
+
// (cos 0.6, sin 0.8, an exact ~53.13 degree rotation) are fact sheet
|
|
11
|
+
// section 2's stated matrices; M1/M2/M3 = B composed with the previous
|
|
12
|
+
// octave's matrix, and each v_k is the first row of M_k. Hand-derived and
|
|
13
|
+
// checked against the fact sheet's own listed v_0..v_3 below, not copied
|
|
14
|
+
// from any source.
|
|
15
|
+
const mat2 WARP_M0 = mat2(0.6, 0.25, -0.25, 0.9);
|
|
16
|
+
const mat2 WARP_M1 = mat2(0.16, 0.63, -0.87, 0.34);
|
|
17
|
+
const mat2 WARP_M2 = mat2(-0.408, 0.506, -0.794, -0.492);
|
|
18
|
+
const mat2 WARP_M3 = mat2(-0.6496, -0.0228, -0.0828, -0.9304);
|
|
19
|
+
const vec2 WARP_V0 = vec2(0.600, -0.250);
|
|
20
|
+
const vec2 WARP_V1 = vec2(0.160, -0.870);
|
|
21
|
+
const vec2 WARP_V2 = vec2(-0.408, -0.794);
|
|
22
|
+
const vec2 WARP_V3 = vec2(-0.650, -0.083);
|
|
23
|
+
|
|
24
|
+
// Displaces p through all 4 octaves. Octave k's phase carries k*tau, so
|
|
25
|
+
// octave 0 is static in time and octave 3 moves fastest -- fine
|
|
26
|
+
// corrugation slides across coarse folds, which reads as flowing wind
|
|
27
|
+
// (fact sheet section 2, "Mechanism of the fold / wind").
|
|
28
|
+
vec2 auroraWarp(vec2 p, float phi, float tau, float freq, float amp) {
|
|
29
|
+
vec2 x = p;
|
|
30
|
+
float f = freq;
|
|
31
|
+
float a = amp;
|
|
32
|
+
|
|
33
|
+
vec2 q = WARP_M0 * x;
|
|
34
|
+
vec2 w = sin(f * q + vec2(phi));
|
|
35
|
+
x += (a / f) * WARP_V0 * w;
|
|
36
|
+
f *= 1.4;
|
|
37
|
+
a *= 1.0 + 0.1 * (max(w.x, w.y) - 1.0);
|
|
38
|
+
|
|
39
|
+
q = WARP_M1 * x;
|
|
40
|
+
w = sin(f * q + vec2(tau + phi));
|
|
41
|
+
x += (a / f) * WARP_V1 * w;
|
|
42
|
+
f *= 1.4;
|
|
43
|
+
a *= 1.0 + 0.1 * (max(w.x, w.y) - 1.0);
|
|
44
|
+
|
|
45
|
+
q = WARP_M2 * x;
|
|
46
|
+
w = sin(f * q + vec2(2.0 * tau + phi));
|
|
47
|
+
x += (a / f) * WARP_V2 * w;
|
|
48
|
+
f *= 1.4;
|
|
49
|
+
a *= 1.0 + 0.1 * (max(w.x, w.y) - 1.0);
|
|
50
|
+
|
|
51
|
+
q = WARP_M3 * x;
|
|
52
|
+
w = sin(f * q + vec2(3.0 * tau + phi));
|
|
53
|
+
x += (a / f) * WARP_V3 * w;
|
|
54
|
+
|
|
55
|
+
return x;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
vec3 auroraRgb2Hsv(vec3 c) {
|
|
59
|
+
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
|
60
|
+
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
|
61
|
+
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
|
62
|
+
float d = q.x - min(q.w, q.y);
|
|
63
|
+
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + 1.0e-10)), d / (q.x + 1.0e-10), q.x);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
vec3 auroraHsv2Rgb(vec3 c) {
|
|
67
|
+
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
|
68
|
+
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
|
69
|
+
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
|
73
|
+
// Fact sheet section 2: u in [0,1]^2, centered point p = u - 0.5, no
|
|
74
|
+
// aspect correction -- the element is forced square by CSS, so this is
|
|
75
|
+
// only correct on a square canvas (true for every audio-visualizer size).
|
|
76
|
+
vec2 uv = fragCoord / iResolution.xy;
|
|
77
|
+
vec2 p = uv - 0.5;
|
|
78
|
+
|
|
79
|
+
// Solid-body rotation of the sampling frame (module doc, departure 1).
|
|
80
|
+
// gl_FragCoord's y-up frame is mirrored against the screen's y-down one,
|
|
81
|
+
// so the sign here is what makes positive uRotation read CLOCKWISE on
|
|
82
|
+
// screen -- verified empirically against the audit's estimator (which
|
|
83
|
+
// measures +10 for uRotation = +10 deg/s with the wind frozen).
|
|
84
|
+
float rotA = -uRotation * iTime;
|
|
85
|
+
float rc = cos(rotA);
|
|
86
|
+
float rs = sin(rotA);
|
|
87
|
+
p = mat2(rc, -rs, rs, rc) * p;
|
|
88
|
+
|
|
89
|
+
// Negative tau: time-reversing the octave phases flips the wind's
|
|
90
|
+
// emergent angular drift from counter-clockwise (measured on the original)
|
|
91
|
+
// to the reference's clockwise, without touching any static property --
|
|
92
|
+
// lobes, radii, spectra are distribution-identical (module doc,
|
|
93
|
+
// departure 1).
|
|
94
|
+
float tau = -iTime * uSpeed;
|
|
95
|
+
float freq = max(2.0 + 13.0 * uComplexity, 1.0);
|
|
96
|
+
float amp = uAmplitude;
|
|
97
|
+
float ringRadius = uScale;
|
|
98
|
+
|
|
99
|
+
vec3 hsv = auroraRgb2Hsv(uColor);
|
|
100
|
+
// Chain-seed strand, phase -1/36 NOT scaled by STRAND_SIGMA (fact sheet
|
|
101
|
+
// section 2), so inter-strand spacing is defined for strand 1 too.
|
|
102
|
+
vec2 prevStrand = auroraWarp(p, -1.0 / float(STRAND_COUNT), tau, freq, amp);
|
|
103
|
+
|
|
104
|
+
vec3 accum = vec3(0.0);
|
|
105
|
+
for (int j = 1; j <= STRAND_COUNT; j++) {
|
|
106
|
+
float frac = float(j) / float(STRAND_COUNT);
|
|
107
|
+
float phi = frac * STRAND_SIGMA;
|
|
108
|
+
vec2 strand = auroraWarp(p, phi, tau, freq, amp);
|
|
109
|
+
|
|
110
|
+
// Signed distance to the (warped) ring, per strand: negative inside,
|
|
111
|
+
// positive outside -- the sign feeds the asymmetric edge width below.
|
|
112
|
+
float sd = length(strand) - ringRadius;
|
|
113
|
+
float dist = abs(sd);
|
|
114
|
+
// Inter-strand spacing through the chain: an analytic blur exactly
|
|
115
|
+
// proportional to how far this strand's warp has drifted from its
|
|
116
|
+
// neighbour's. Fanned regions (large spacing) fuse into soft veils;
|
|
117
|
+
// bunched regions (small spacing) stay crisp -- this is what turns 36
|
|
118
|
+
// discrete rings into an aurora (fact sheet section 2). The 2.3 growth
|
|
119
|
+
// rate (fact sheet's own is 2.0) and the 0.66x outer-side factor are
|
|
120
|
+
// the parity edge calibration: the reference holds a 10-90% rise of
|
|
121
|
+
// ~6-10px(2x) with the OUTER edge always the sharper of the two
|
|
122
|
+
// (module doc, departure 4).
|
|
123
|
+
float spacing = length(strand - prevStrand);
|
|
124
|
+
float edgeWidth = 0.01 + max(exp(2.3 * spacing) - 1.0, 0.001);
|
|
125
|
+
edgeWidth *= mix(1.0, 0.66, step(0.0, sd));
|
|
126
|
+
float coverage = 1.0 - smoothstep(0.0, 1.0, dist / edgeWidth);
|
|
127
|
+
|
|
128
|
+
// Fixed hue drift across the strand fan, matching the fact sheet's
|
|
129
|
+
// documented colorShift default (0.05 turns at weight 0.3, i.e. 0.015
|
|
130
|
+
// turns end to end); earliest strand shifts most.
|
|
131
|
+
vec3 strandColor = auroraHsv2Rgb(vec3(fract(hsv.x + (1.0 - frac) * 0.015), hsv.y, hsv.z));
|
|
132
|
+
accum += coverage * strandColor;
|
|
133
|
+
prevStrand = strand;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Mean soft coverage across all 36 strands (fact sheet section 2's image
|
|
137
|
+
// accumulator I). The inverse-distance glow accumulator G is omitted: the
|
|
138
|
+
// fact sheet states its gain ships as 0, so it contributes nothing.
|
|
139
|
+
vec3 image = accum / float(STRAND_COUNT);
|
|
140
|
+
|
|
141
|
+
// Deterministic per-pixel dither, +/- 1/510, identical on all channels
|
|
142
|
+
// (fact sheet section 3). Kept as a plain vec3 offset, not pre-mixed into
|
|
143
|
+
// the image accumulator, so each branch can add it at the point the fact
|
|
144
|
+
// sheet actually specifies (see the dark branch below).
|
|
145
|
+
float n = fract(sin(dot(fragCoord, vec2(12.9898, 78.233))) * 43758.5453);
|
|
146
|
+
vec3 dither = vec3((n - 0.5) / 255.0);
|
|
147
|
+
|
|
148
|
+
float brightness = uIntensity;
|
|
149
|
+
vec3 rgb;
|
|
150
|
+
float alpha;
|
|
151
|
+
|
|
152
|
+
if (uTheme < 0.5) {
|
|
153
|
+
// Dark pipeline, parity-calibrated (module doc, departures 2 + 3).
|
|
154
|
+
// RGB1 = 1.2 * I, THEN add dither (fact sheet order: pre-gain first so
|
|
155
|
+
// the dither's written amplitude stays +/- 1/510), then floor at 0 --
|
|
156
|
+
// a negative dither on a near-black pixel would otherwise be blown up
|
|
157
|
+
// by the chroma-preserving rescale's division right below.
|
|
158
|
+
vec3 x1 = max(1.2 * image + dither, 0.0);
|
|
159
|
+
|
|
160
|
+
// Chroma-preserving tonemap: knee the MAX channel (11x/(1+11x) -- a
|
|
161
|
+
// steeper knee than the fact sheet's per-channel 4x/(1+4x)) and rescale
|
|
162
|
+
// the vector, so ribbon cores land on a stable brightness level largely
|
|
163
|
+
// independent of how thin the veils have fanned (the audit measured the
|
|
164
|
+
// per-channel map crushing spread-out states to ~half the reference's
|
|
165
|
+
// rendered brightness) while hue and saturation pass through untouched
|
|
166
|
+
// for the HSV shape-up to own.
|
|
167
|
+
float mxc = max(x1.r, max(x1.g, x1.b));
|
|
168
|
+
float tmMax = 11.0 * mxc / (1.0 + 11.0 * mxc);
|
|
169
|
+
vec3 tm = x1 * (tmMax / max(mxc, 1.0e-5));
|
|
170
|
+
|
|
171
|
+
// Rendered-colour calibration: hue +0.013 turns (audit target
|
|
172
|
+
// ~197.5deg for the default accent), saturation proportional to the
|
|
173
|
+
// caller's own (a desaturated accent stays desaturated) but rising
|
|
174
|
+
// with the pixel's value and capped at 0.98 -- Rob's reference:
|
|
175
|
+
// saturation RISES with brightness, and nothing is ever white.
|
|
176
|
+
vec3 hv = auroraRgb2Hsv(tm);
|
|
177
|
+
hv.x = fract(hv.x + 0.013);
|
|
178
|
+
hv.y = min(hv.y * (1.02 + 0.35 * hv.z), 0.98);
|
|
179
|
+
tm = auroraHsv2Rgb(hv);
|
|
180
|
+
|
|
181
|
+
// Brightness compression (departure 3): uIntensity DRIVES 0.5..2.5 at
|
|
182
|
+
// the thinking/connecting pulse but must RENDER inside roughly
|
|
183
|
+
// 0.5..0.65 mean brightness, never dropping the ring below visibility.
|
|
184
|
+
// Two compressive powers (colour flatter than alpha) plus a smoothstep
|
|
185
|
+
// alpha knee that lifts ribbon cores to full opacity while cutting the
|
|
186
|
+
// dim tails -- which is also what keeps the centre transparent and the
|
|
187
|
+
// edges crisp. max(brightness, 0.05) only guards pow() against a
|
|
188
|
+
// (contractually impossible) zero or negative uniform.
|
|
189
|
+
float bVal = pow(max(brightness, 0.05) / 1.5, 0.07);
|
|
190
|
+
float bAlpha = 0.97 * pow(max(brightness, 0.05) / 1.5, 0.09);
|
|
191
|
+
float luma = dot(tm, vec3(0.299, 0.587, 0.114));
|
|
192
|
+
// Clamped to [0,1] before the premultiply below, mirroring the light
|
|
193
|
+
// branch, so rgb * alpha <= alpha stays enforced for every input.
|
|
194
|
+
rgb = clamp(tm * bVal, 0.0, 1.0);
|
|
195
|
+
alpha = clamp(smoothstep(0.0, 0.50, luma) * bAlpha, 0.0, 1.0);
|
|
196
|
+
} else {
|
|
197
|
+
// Light pipeline (fact sheet section 4): RGB1 = I, then add dither;
|
|
198
|
+
// brightness curve on vector length, hue direction kept, saturation
|
|
199
|
+
// extrapolated 3x about gray.
|
|
200
|
+
vec3 x1 = image + dither;
|
|
201
|
+
float mag = length(x1);
|
|
202
|
+
vec3 dir = x1 / max(mag, 1.0e-5);
|
|
203
|
+
float mag2 = 2.0 * mag / (1.0 + 2.0 * mag);
|
|
204
|
+
vec3 x2 = dir * mag2;
|
|
205
|
+
float gray = dot(x2, vec3(0.2, 0.5, 0.1));
|
|
206
|
+
rgb = clamp(vec3(gray) + 3.0 * (x2 - vec3(gray)), 0.0, 1.0);
|
|
207
|
+
alpha = clamp(mag2 * clamp(brightness, 1.0, 2.0), 0.0, 1.0);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// PREMULTIPLIED output. Both branches above clamp their natural rgb to
|
|
211
|
+
// [0,1] before this line, which is what makes rgb * alpha <= alpha
|
|
212
|
+
// (componentwise) a property the code enforces unconditionally, not one
|
|
213
|
+
// that happens to hold for the inputs this was tested against. See the
|
|
214
|
+
// module doc above for why this departs from the fact sheet's own
|
|
215
|
+
// (deliberately non-premultiplied) pipeline.
|
|
216
|
+
fragColor = vec4(rgb * alpha, alpha);
|
|
217
|
+
}
|
|
218
|
+
`;var z=k("<div style=aspect-ratio:1>");function d(e){switch(e){case"listening":return{intensity:[1.5,2],speed:1,complexity:.7,amplitude:1,scale:.3,rotation:5.3};case"thinking":return{intensity:[.5,2.5],speed:1.5,complexity:1,amplitude:.5,scale:.3,rotation:9.4};case"connecting":return{intensity:[.5,2.5],speed:1.5,complexity:1,amplitude:.5,scale:.3,rotation:5.5};case"speaking":return{intensity:1.5,speed:3.5,complexity:1.25,amplitude:.75,scale:.3,rotation:-3.5};case"disconnected":return{intensity:1,speed:.5,complexity:.4,amplitude:1.2,scale:.2,rotation:0};default:return{intensity:1,speed:.5,complexity:.4,amplitude:1.2,scale:.2,rotation:0}}}function P(){var e;const[c,s]=S(!1);if(typeof matchMedia=="function"){const i=matchMedia("(prefers-color-scheme: dark)");s(i.matches);const o=r=>s(r.matches);(e=i.addEventListener)==null||e.call(i,"change",o),_(()=>{var r;return(r=i.removeEventListener)==null?void 0:r.call(i,"change",o)})}return c}function I(e){const c=n(1),s=n(.5),i=n(.4),o=n(1.2),r=n(.2),f=P(),m=()=>e.dark??f();u(()=>{const t=d(e.state),a=e.frozen?{duration:0}:{duration:.5,ease:"easeOut"},l=e.frozen?{duration:0}:{duration:.35,ease:"easeOut"},h=Array.isArray(t.intensity)&&e.frozen?t.intensity[0]:t.intensity;c.to(h,Array.isArray(t.intensity)?l:a),i.to(t.complexity,a),o.to(t.amplitude,a),r.to(t.scale,e.state==="listening"&&!e.frozen?{type:"spring",duration:1,bounce:.35}:a),s.to(e.frozen?0:t.speed,{duration:0})}),u(()=>{if(e.state!=="speaking")return;const t=e.volume;t>0&&(r.animating()||r.to(.2+.2*t))});const v=()=>e.frozen?0:d(e.state).rotation*Math.PI/180,g=()=>m()?0:1;return(()=>{var t=z();return x(t,y(T,{fragment:C,get precision(){return e.size==="icon"||e.size==="sm"?"mediump":"highp"},get uniforms(){return{uColor:{type:"3fv",value:q(e.color??M)},uIntensity:{type:"1f",value:c.value()},uSpeed:{type:"1f",value:s.value()},uComplexity:{type:"1f",value:i.value()},uAmplitude:{type:"1f",value:o.value()},uScale:{type:"1f",value:r.value()},uTheme:{type:"1f",value:g()},uRotation:{type:"1f",value:v()}}},get animateWhenNotVisible(){return e.animateWhenNotVisible},onError:a=>{/not available/i.test(a)?console.warn('<kai-audio-visualizer variant="aurora">: shader unavailable',a):console.error('<kai-audio-visualizer variant="aurora">: shader error',a),e.onUnavailable()}})),b(a=>{var l=e.state,h=e.class,p=`${W[e.size]}px`;return l!==a.e&&w(t,"data-kai-state",a.e=l),h!==a.t&&R(t,a.t=h),p!==a.a&&A(t,"height",a.a=p),a},{e:void 0,t:void 0,a:void 0}),t})()}export{d as auroraTargets,I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as b,j as k,c,S as g,i as w,a as d,d as m,b as y,r as p,t as S}from"./define-D1din7Ld.js";import{c as x,D as M,S as A,h as N}from"./create-tween-oVvAIG8r.js";import{s as j,C}from"./audio-visualizer-BqNy7dfm.js";var h=S("<div>");const E={"1f":!0,"1i":!0,"1fv":!0,"2f":!0,"3f":!0,"3fv":!0,"4f":!0,"4fv":!0,Matrix2fv:!0,Matrix3fv:!0,Matrix4fv:!0},V=new Set(["1f","1i"]),F={"2f":2,"3f":3,"4f":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function O(r,e){if(e==null||typeof e!="object")return`uniform "${r}" is not a valid declaration (expected an object with "type" and "value").`;if(E[e.type]!==!0)return`uniform "${r}" has an unrecognized type "${String(e.type)}".`;if(V.has(e.type))return typeof e.value!="number"||!Number.isFinite(e.value)?`uniform "${r}" is declared "${e.type}" (a number) but its value is not a finite number.`:void 0;if(!Array.isArray(e.value)||e.value.some(s=>typeof s!="number"||!Number.isFinite(s)))return`uniform "${r}" is declared "${e.type}" (an array) but its value is not an array of finite numbers.`;const o=F[e.type];if(o!==void 0&&e.value.length!==o)return`uniform "${r}" is declared "${e.type}", which takes exactly ${o} numbers, but its value has ${e.value.length}.`}function $(r,e){const o=r.bands.length?r.bands:[0],s={uColor:{type:"3fv",value:N(r.color)},uIntensity:{type:"1f",value:r.intensity},uSpeed:{type:"1f",value:r.speed},uComplexity:{type:"1f",value:r.complexity},uVolume:{type:"1f",value:r.volume},uBands:{type:"1fv",value:o,arraySize:o.length}};if(!e)return s;for(const[l,v]of Object.entries(e)){const a=O(l,v);if(a)throw new Error(a)}return{...s,...e}}function U(r){const e=x(.3),o=x(1);b(()=>{const a=j(r.state);if(r.state==="speaking")e.to(.3+.7*r.volume,{duration:0});else{const t=r.frozen?{duration:0}:{duration:.5,ease:"easeOut"};e.to(Array.isArray(a.intensity)&&r.frozen?a.intensity[0]:a.intensity,t)}o.to(r.frozen?0:a.speed,{duration:0})});const s=k(()=>{var a;try{return{uniforms:$({color:r.color??M,intensity:e.value(),speed:o.value(),complexity:r.complexity??.5,volume:r.volume,bands:r.bands},(a=r.shader)==null?void 0:a.uniforms)}}catch(t){return{error:t instanceof Error?t.message:String(t)}}});let l=!1;b(()=>{const{error:a}=s();if(!a){l=!1;return}l||(l=!0,console.error(`<kai-audio-visualizer variant="custom">: ${a}`),r.onUnavailable())});const v=()=>({height:`${C[r.size]}px`,"aspect-ratio":"1"});return c(g,{get when(){var a;return(a=r.shader)==null?void 0:a.fragment},get fallback(){return(()=>{var a=h();return d(t=>{var n=r.state,i=r.class,u=v();return n!==t.e&&m(a,"data-kai-state",t.e=n),i!==t.t&&y(a,t.t=i),t.a=p(a,u,t.a),t},{e:void 0,t:void 0,a:void 0}),a})()},children:a=>c(g,{get when(){return s().uniforms},get fallback(){return(()=>{var t=h();return d(n=>{var i=r.state,u=r.class,f=v();return i!==n.e&&m(t,"data-kai-state",n.e=i),u!==n.t&&y(t,n.t=u),n.a=p(t,f,n.a),n},{e:void 0,t:void 0,a:void 0}),t})()},children:t=>(()=>{var n=h();return w(n,c(A,{get fragment(){return a()},get precision(){return r.size==="icon"||r.size==="sm"?"mediump":"highp"},get uniforms(){return t()},get animateWhenNotVisible(){return r.animateWhenNotVisible},onError:i=>{/not available/i.test(i)?console.warn('<kai-audio-visualizer variant="custom">: shader unavailable',i):console.error('<kai-audio-visualizer variant="custom">: shader error',i),r.onUnavailable()}})),d(i=>{var u=r.state,f=r.class,z=v();return u!==i.e&&m(n,"data-kai-state",i.e=u),f!==i.t&&y(n,i.t=f),i.a=p(n,z,i.a),i},{e:void 0,t:void 0,a:void 0}),n})()})})}export{$ as customUniforms,U as default};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import{h as v,i as p,c as m,a as h,d as x,b as g,q as y,t as b}from"./define-D1din7Ld.js";import{c as r,h as w,D as C,S as z}from"./create-tween-oVvAIG8r.js";import{C as S,w as q}from"./audio-visualizer-BqNy7dfm.js";const U=`
|
|
2
|
+
const float TAU = 6.28318530718;
|
|
3
|
+
|
|
4
|
+
// Noise for dithering
|
|
5
|
+
vec2 randFibo(vec2 p) {
|
|
6
|
+
p = fract(p * vec2(443.897, 441.423));
|
|
7
|
+
p += dot(p, p.yx + 19.19);
|
|
8
|
+
return fract((p.xx + p.yx) * p.xy);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Luma for alpha
|
|
12
|
+
float luma(vec3 color) {
|
|
13
|
+
return dot(color, vec3(0.299, 0.587, 0.114));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// RGB to HSV
|
|
17
|
+
vec3 rgb2hsv(vec3 c) {
|
|
18
|
+
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
|
19
|
+
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
|
20
|
+
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
|
21
|
+
float d = q.x - min(q.w, q.y);
|
|
22
|
+
float e = 1.0e-10;
|
|
23
|
+
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// HSV to RGB
|
|
27
|
+
vec3 hsv2rgb(vec3 c) {
|
|
28
|
+
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
|
29
|
+
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
|
30
|
+
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Bell curve function for attenuation from center with rounded top
|
|
34
|
+
float bellCurve(float distanceFromCenter, float maxDistance) {
|
|
35
|
+
float normalizedDistance = distanceFromCenter / maxDistance;
|
|
36
|
+
// Use cosine with high power for smooth rounded top
|
|
37
|
+
return pow(cos(normalizedDistance * (3.14159265359 / 4.0)), 16.0);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Calculate the sine wave
|
|
41
|
+
float oscilloscopeWave(float x, float centerX, float time) {
|
|
42
|
+
float relativeX = x - centerX;
|
|
43
|
+
float maxDistance = centerX;
|
|
44
|
+
float distanceFromCenter = abs(relativeX);
|
|
45
|
+
|
|
46
|
+
// Apply bell curve for amplitude attenuation
|
|
47
|
+
float bell = bellCurve(distanceFromCenter, maxDistance);
|
|
48
|
+
|
|
49
|
+
// Calculate wave with uniforms and bell curve attenuation
|
|
50
|
+
float wave = sin(relativeX * uFrequency + time * uSpeed) * uAmplitude * bell;
|
|
51
|
+
|
|
52
|
+
return wave;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
|
56
|
+
vec2 uv = fragCoord / iResolution.xy;
|
|
57
|
+
vec2 pos = uv - 0.5;
|
|
58
|
+
|
|
59
|
+
// Calculate center and positions
|
|
60
|
+
float centerX = 0.5;
|
|
61
|
+
float centerY = 0.5;
|
|
62
|
+
float x = uv.x;
|
|
63
|
+
float y = uv.y;
|
|
64
|
+
|
|
65
|
+
// Convert line width from pixels to UV space
|
|
66
|
+
// Use the average of width and height to handle aspect ratio
|
|
67
|
+
float pixelSize = 2.0 / (iResolution.x + iResolution.y);
|
|
68
|
+
float lineWidthUV = uLineWidth * pixelSize;
|
|
69
|
+
float smoothingUV = uSmoothing * pixelSize;
|
|
70
|
+
|
|
71
|
+
// Find minimum distance to the wave by sampling nearby points
|
|
72
|
+
// This gives us consistent line width without high-frequency artifacts
|
|
73
|
+
const int NUM_SAMPLES = 50; // Must be const for GLSL loop
|
|
74
|
+
float minDist = 1000.0;
|
|
75
|
+
float sampleRange = 0.02; // Range to search for closest point
|
|
76
|
+
|
|
77
|
+
for(int i = 0; i < NUM_SAMPLES; i++) {
|
|
78
|
+
float offset = (float(i) / float(NUM_SAMPLES - 1) - 0.5) * sampleRange;
|
|
79
|
+
float sampleX = x + offset;
|
|
80
|
+
float waveY = centerY + oscilloscopeWave(sampleX, centerX, iTime);
|
|
81
|
+
|
|
82
|
+
// Calculate distance from current pixel to this point on the wave
|
|
83
|
+
vec2 wavePoint = vec2(sampleX, waveY);
|
|
84
|
+
vec2 currentPoint = vec2(x, y);
|
|
85
|
+
float dist = distance(currentPoint, wavePoint);
|
|
86
|
+
|
|
87
|
+
minDist = min(minDist, dist);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Solid line with smooth edges using minimum distance
|
|
91
|
+
float line = smoothstep(lineWidthUV + smoothingUV, lineWidthUV - smoothingUV, minDist);
|
|
92
|
+
|
|
93
|
+
vec3 color = uColor;
|
|
94
|
+
if(abs(uColorShift) > 0.01) {
|
|
95
|
+
// Keep the center 50% at base color, then ramp shift across outer 25% on each side.
|
|
96
|
+
float centerBandHalfWidth = 0.2;
|
|
97
|
+
float edgeBandWidth = 0.5;
|
|
98
|
+
float distanceFromCenter = abs(x - centerX);
|
|
99
|
+
float edgeFactor = clamp((distanceFromCenter - centerBandHalfWidth) / edgeBandWidth, 0.0, 1.0);
|
|
100
|
+
vec3 hsv = rgb2hsv(color);
|
|
101
|
+
// Hue shift is zero in the center band and strongest at far edges.
|
|
102
|
+
hsv.x = fract(hsv.x + edgeFactor * uColorShift * 0.3);
|
|
103
|
+
color = hsv2rgb(hsv);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Apply line intensity
|
|
107
|
+
color *= line;
|
|
108
|
+
|
|
109
|
+
// Add dithering for smoother gradients
|
|
110
|
+
// color += (randFibo(fragCoord).x - 0.5) / 255.0;
|
|
111
|
+
|
|
112
|
+
// Calculate alpha based on line intensity
|
|
113
|
+
float alpha = line * uMix;
|
|
114
|
+
|
|
115
|
+
fragColor = vec4(color * uMix, alpha);
|
|
116
|
+
}`;var F=b('<div style="aspect-ratio:1;mask-image:linear-gradient(90deg, transparent 0%, black 20%, black 80%, transparent 100%)">');const W=.5,A=.05;function D(e){const o=r(0),i=r(0),l=r(1),n=()=>q(e.state),s=()=>e.frozen?{duration:0}:{duration:.2,ease:"easeOut"};v(()=>{const a=n(),t=Array.isArray(a.opacity)&&e.frozen?a.opacity[0]:a.opacity;l.to(t,e.frozen?{duration:0}:{duration:a.pulseDuration||.2})}),v(()=>{if(e.state==="speaking"){const t=e.volume;o.to(.015+.4*t,{duration:0}),i.to(20+60*t,{duration:0});return}const a=n();o.to(a.amplitude,s()),i.to(a.frequency,s())});const d=()=>e.size==="icon"||e.size==="sm"?2:1;return(()=>{var a=F();return p(a,m(z,{fragment:U,get precision(){return e.size==="icon"||e.size==="sm"?"mediump":"highp"},get uniforms(){return{uSpeed:{type:"1f",value:e.frozen?0:n().speed},uAmplitude:{type:"1f",value:o.value()},uFrequency:{type:"1f",value:i.value()},uMix:{type:"1f",value:l.value()},uLineWidth:{type:"1f",value:d()},uSmoothing:{type:"1f",value:W},uColor:{type:"3fv",value:w(e.color??C)},uColorShift:{type:"1f",value:A}}},get animateWhenNotVisible(){return e.animateWhenNotVisible},onError:t=>{console.warn('<kai-audio-visualizer variant="wave">: shader error',t),e.onUnavailable()}})),h(t=>{var c=e.state,u=e.class,f=`${S[e.size]}px`;return c!==t.e&&x(a,"data-kai-state",t.e=c),u!==t.t&&g(a,t.t=u),f!==t.a&&y(a,"height",t.a=f),t},{e:void 0,t:void 0,a:void 0}),a})()}export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./Icon-
|
|
1
|
+
import{I as e}from"./Icon-Tj58ES_d.js";import{c as m,m as o}from"./define-D1din7Ld.js";var r=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],t=a=>m(e,o(a,{name:"Video",iconNode:r})),i=t;export{i as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as m}from"./Icon-Tj58ES_d.js";import{c as o,m as r}from"./define-D1din7Ld.js";var e=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],t=a=>o(m,r(a,{name:"X",iconNode:e})),p=t;export{p as x};
|