@alfadocs/ui-kit 0.30.5 → 0.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{accordion-CNcodXuO.js → accordion-bSU21uTV.js} +3 -3
- package/dist/_chunks/{agenda-card-DO9_yogb.js → agenda-card-UJA6Arbs.js} +3 -3
- package/dist/_chunks/{agenda-tray-WLbfMip6.js → agenda-tray-1fAxNOMz.js} +4 -4
- package/dist/_chunks/{ai-prompt-input-BXlwNnWe.js → ai-prompt-input-C6sCr1Vi.js} +11 -10
- package/dist/_chunks/{alia-sidebar-C-232sD7.js → alia-sidebar-BEoMl6UL.js} +9 -9
- package/dist/_chunks/ar-CEpIJtcO.js +399 -0
- package/dist/_chunks/{audio-recorder-DL800PE_.js → audio-recorder-C1rhKhSN.js} +114 -114
- package/dist/_chunks/audio-visualiser-l6zPd0AG.js +162 -0
- package/dist/_chunks/{autocomplete-CUh0f7Dj.js → autocomplete-DIgdhCGJ.js} +2 -2
- package/dist/_chunks/{avatar-D_H4emLo.js → avatar-BNQNhoyL.js} +19 -18
- package/dist/_chunks/{badge-CIjQ1Us1.js → badge-CptERaHx.js} +2 -2
- package/dist/_chunks/{booking-Cw92aqo3.js → booking-BIZ9GSer.js} +149 -160
- package/dist/_chunks/{breadcrumb--YI7lcHA.js → breadcrumb-CLlhx7qo.js} +2 -2
- package/dist/_chunks/{button-group-Bh2g_Ng-.js → button-group-Ciq6J4IW.js} +15 -14
- package/dist/_chunks/{calendar-WWNx448i.js → calendar-YHFknAGv.js} +22 -22
- package/dist/_chunks/calendar-clock-CYkcqdwl.js +19 -0
- package/dist/_chunks/{carousel.agent-C2Icc9_T.js → carousel.agent-DrX96W-1.js} +2 -2
- package/dist/_chunks/{chart-BLvFl169.js → chart-DLkVn_ex.js} +2 -2
- package/dist/_chunks/{chat-container-izziXViv.js → chat-container-ogB4OskO.js} +24 -23
- package/dist/_chunks/{chat-input-cyl_y9bh.js → chat-input-CQe7nR_v.js} +132 -118
- package/dist/_chunks/{chat-message-fg221-yx.js → chat-message-D53_fH2w.js} +2 -2
- package/dist/_chunks/{checkbox-Dgp_cfUr.js → checkbox-DRcOdmXv.js} +3 -3
- package/dist/_chunks/{checkbox-group-eVowqKcT.js → checkbox-group-CpUwlHug.js} +3 -3
- package/dist/_chunks/{collapsible-hHiyZp0b.js → collapsible-CERONory.js} +2 -2
- package/dist/_chunks/{color-picker-Bm-gzpsh.js → color-picker-9tL7pz5y.js} +192 -181
- package/dist/_chunks/{combobox-Da9eq00i.js → combobox-BC-DFx8G.js} +31 -30
- package/dist/_chunks/{command-palette-11BieSNq.js → command-palette-BiPAAno-.js} +125 -123
- package/dist/_chunks/{copy-field-BAF4mt9h.js → copy-field-CCq7j6Zc.js} +2 -2
- package/dist/_chunks/{date-picker-D0Ry1dMz.js → date-picker-B94HAV4A.js} +4 -4
- package/dist/_chunks/{date-range-picker-DYgHzMOo.js → date-range-picker-D4dgDlLU.js} +73 -73
- package/dist/_chunks/{date-time-picker-CGmGtcyc.js → date-time-picker-D1GEzf8p.js} +5 -5
- package/dist/_chunks/de-Dfbeau59.js +477 -0
- package/dist/_chunks/{description-list-CWjnaDGn.js → description-list-BEbK2g93.js} +2 -2
- package/dist/_chunks/{dialog-C-lTGVkB.js → dialog-Cee13rHU.js} +3 -3
- package/dist/_chunks/{dropdown-menu-DZxwF23X.js → dropdown-menu-BC5ZdOMo.js} +3 -3
- package/dist/_chunks/{editable-currency-cell-renderer-CztRy_21.js → editable-currency-cell-renderer-BpicmolK.js} +308 -322
- package/dist/_chunks/el-Dro3J7CP.js +373 -0
- package/dist/_chunks/{email-input-DvJ_kPKL.js → email-input-lQivsFrw.js} +3 -3
- package/dist/_chunks/es-Dvg8u70B.js +373 -0
- package/dist/_chunks/{file-upload-DxAQprcU.js → file-upload-CdozCPct.js} +226 -233
- package/dist/_chunks/fr-VOGjBSPP.js +338 -0
- package/dist/_chunks/{freemium-paywall-B9c8Ylww.js → freemium-paywall-D1N02Oam.js} +4 -4
- package/dist/_chunks/{header-DDj7uGD-.js → header-CTZWX-tm.js} +2 -2
- package/dist/_chunks/hi-BSDxWU_y.js +433 -0
- package/dist/_chunks/{icon-button-DPEqBKBQ.js → icon-button-CKEOrN37.js} +2 -2
- package/dist/_chunks/{icon-button-group-DeV3FpNY.js → icon-button-group-C48khLE0.js} +23 -22
- package/dist/_chunks/{isSameDay-DHG8Xade.js → isSameDay-DUEiAT0G.js} +2 -2
- package/dist/_chunks/isSameWeek-Dfzu29cW.js +14 -0
- package/dist/_chunks/it-CuonvcI_.js +401 -0
- package/dist/_chunks/ja-DO57gIOT.js +366 -0
- package/dist/_chunks/{key-value-pair-BvDY3zuc.js → key-value-pair-C8DaR3Xs.js} +2 -2
- package/dist/_chunks/{list-BdvDctBz.js → list-BOwqwy03.js} +44 -43
- package/dist/_chunks/{locale-picker-CY89MChR.js → locale-picker-D99UyZVJ.js} +4 -4
- package/dist/_chunks/{map-view-DyB8tr6c.js → map-view-WEWqXzof.js} +569 -557
- package/dist/_chunks/{message-card-D6iyPacd.js → message-card-BbRhZkDI.js} +3 -3
- package/dist/_chunks/{message-tray-Bh-0ra-Y.js → message-tray-B762TKuv.js} +11 -10
- package/dist/_chunks/{multi-select-dSe6Xtc4.js → multi-select-DOLO3K_z.js} +26 -25
- package/dist/_chunks/{navigation-menu-CyS1fBJ7.js → navigation-menu-C6lBYVv9.js} +3 -3
- package/dist/_chunks/nl-DjPaaWaW.js +326 -0
- package/dist/_chunks/{notification-card-vaMaA7Wa.js → notification-card-DMdO4g54.js} +2 -2
- package/dist/_chunks/{notification-tray-Cnum6LwM.js → notification-tray-Dl3FTleW.js} +17 -16
- package/dist/_chunks/{number-input-BZXu6bPY.js → number-input-Dj5L3pXK.js} +2 -2
- package/dist/_chunks/{otp-input-BDF_iNpa.js → otp-input-BEg_sn8A.js} +2 -2
- package/dist/_chunks/{pagination-BWaXF7W0.js → pagination-DQOgnxxw.js} +2 -2
- package/dist/_chunks/{parseISO-Dk4xa7q6.js → parseISO-DEpUNwxZ.js} +2 -2
- package/dist/_chunks/{patient-search-ZpHN-pgJ.js → patient-search-hFiYbqcl.js} +8 -8
- package/dist/_chunks/{patient-shell-CYaNkbA1.js → patient-shell-CDvMw_Nk.js} +6 -6
- package/dist/_chunks/{payment-form-Ds3rxvad.js → payment-form-D5rgnZu7.js} +2 -2
- package/dist/_chunks/{pdf-viewer-CIuaocnq.js → pdf-viewer-DvtEHcEP.js} +347 -320
- package/dist/_chunks/{phone-input-DKSHX7NQ.js → phone-input-DfZbPPvh.js} +217 -201
- package/dist/_chunks/pl-Cl4lOx2N.js +514 -0
- package/dist/_chunks/{popover-BfHSBEKq.js → popover-Devce-tT.js} +3 -3
- package/dist/_chunks/practice-results-JQunxBIg.js +1618 -0
- package/dist/_chunks/{privacy-lock-C6Ra5m3p.js → privacy-lock-DD-wHxBg.js} +3 -3
- package/dist/_chunks/{progress-B-PSO5OS.js → progress-kzIRcdaq.js} +11 -10
- package/dist/_chunks/pt-D7qO5CzD.js +370 -0
- package/dist/_chunks/{public-footer.agent-Bc99tE5Z.js → public-footer.agent-Bh0rnx4i.js} +21 -14
- package/dist/_chunks/{public-header.agent-B-B0WDAi.js → public-header.agent-B2dDg2_d.js} +3 -3
- package/dist/_chunks/{radio-i4ogu3cq.js → radio-TWf9Q-mp.js} +2 -2
- package/dist/_chunks/{radio-group-CTlGc36r.js → radio-group-BcF92GEF.js} +4 -4
- package/dist/_chunks/{react-day-picker-D3yzgvDB.js → react-day-picker-DsjfS7uI.js} +662 -615
- package/dist/_chunks/recaptcha-widget-CFYyLSEX.js +221 -0
- package/dist/_chunks/refresh-cw-CC8jSKMr.js +17 -0
- package/dist/_chunks/registry-nPAVE19X.js +21 -0
- package/dist/_chunks/{resizable-COV-cnth.js → resizable-3vzqDlg6.js} +29 -28
- package/dist/_chunks/{reviews-panel-bKEUKSic.js → reviews-panel-yanuBZs-.js} +4 -4
- package/dist/_chunks/{rich-text-editor-J-wAz9eN.js → rich-text-editor-CHmr9Bz8.js} +2 -2
- package/dist/_chunks/ro-CP2-VJ_O.js +361 -0
- package/dist/_chunks/ru-RPn9_Lpq.js +561 -0
- package/dist/_chunks/{scroll-area-DEDU-lp-.js → scroll-area-BWqCkEGz.js} +2 -2
- package/dist/_chunks/{search-bar-BRMW1-WG.js → search-bar-CP6wUJFY.js} +3 -3
- package/dist/_chunks/{search-input-CIA6pPfn.js → search-input-C1C3jQpD.js} +24 -23
- package/dist/_chunks/{select-C92AT_OZ.js → select-hsCaJSX3.js} +3 -3
- package/dist/_chunks/{sheet-D8Yl0nKR.js → sheet-BV-yuLE2.js} +3 -3
- package/dist/_chunks/{sidebar-DkyC6GvS.js → sidebar-BbR8f6oe.js} +3 -3
- package/dist/_chunks/{signature-capture-DjMlFOzS.js → signature-capture-C-fF71xI.js} +213 -205
- package/dist/_chunks/{slider-CfEzeseL.js → slider-BHWzXdjt.js} +3 -3
- package/dist/_chunks/{slot-grid-Q94gVmhn.js → slot-grid-Dz13dH82.js} +4 -4
- package/dist/_chunks/smile-BSYLAHy6.js +17 -0
- package/dist/_chunks/{sparkline-B5Ms55PZ.js → sparkline-DEROcSl0.js} +2 -2
- package/dist/_chunks/sq-AQvefouo.js +355 -0
- package/dist/_chunks/{stepper-progress-jFY8BSf7.js → stepper-progress-DDjq5nei.js} +16 -15
- package/dist/_chunks/streaming-text-GH07yIYh.js +127 -0
- package/dist/_chunks/sv-zkx9eBtD.js +376 -0
- package/dist/_chunks/{switch-D916VW86.js → switch-BJ6HD3Mn.js} +2 -2
- package/dist/_chunks/{tabs-aEQfQV3x.js → tabs-BpPYVme_.js} +4 -4
- package/dist/_chunks/{tag-bBPAvXyh.js → tag-CyoaEmf_.js} +2 -2
- package/dist/_chunks/{task-tray-6NlryfMJ.js → task-tray-DRK0b0Qb.js} +3 -3
- package/dist/_chunks/{text-area-D5GAe8pV.js → text-area-BIx0tZ05.js} +27 -26
- package/dist/_chunks/{text-input-CakysYnD.js → text-input-BaClJL8Y.js} +2 -2
- package/dist/_chunks/{theme-toggle-JoeMs_ws.js → theme-toggle-DpC28kt5.js} +6 -6
- package/dist/_chunks/{time-picker-DeVZkIY2.js → time-picker-B5umYwfv.js} +2 -2
- package/dist/_chunks/{timeline-CR7HjZCK.js → timeline-D0Wo7v_o.js} +3 -3
- package/dist/_chunks/{toast.agent-DVpKt38p.js → toast.agent-WHHfw5VX.js} +322 -320
- package/dist/_chunks/{tooltip-ClJd0ciy.js → tooltip-DvmfrNvB.js} +29 -20
- package/dist/_chunks/{tooth-scheme-3mITSXiZ.js → tooth-scheme-CxlsLjfN.js} +2 -2
- package/dist/_chunks/tr-Dmr412Ac.js +378 -0
- package/dist/_chunks/{transaction-chip-z9ENE50O.js → transaction-chip-B8ujzowA.js} +47 -60
- package/dist/_chunks/{transcript-panel-QUQ9XJmf.js → transcript-panel-DyhTpAP7.js} +21 -20
- package/dist/_chunks/{use-direction-D6rvvG9G.js → use-direction-Dp8h70PP.js} +7 -6
- package/dist/_chunks/use-isomorphic-layout-effect-BGfaCOP1.js +6 -0
- package/dist/_chunks/use-media-query-CcAx5SMM.js +16 -0
- package/dist/_chunks/{use-password-requirements-E0sSfx5X.js → use-password-requirements-DsgduV1x.js} +3 -3
- package/dist/_chunks/use-scroll-to-first-error-4Za-u5Nw.js +43 -0
- package/dist/_chunks/{workflow-map-DlWBJJBt.js → workflow-map-BSvQS3be.js} +6 -6
- package/dist/_chunks/zh-CN-DxVt64Zk.js +388 -0
- package/dist/agent/registry.d.ts +1 -6
- package/dist/agent-catalog.json +42 -1
- package/dist/components/_shared/date-locale.d.ts +7 -2
- package/dist/components/_shared/index.d.ts +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/audio-visualiser/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chat-container/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/email-input/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/header-settings/index.js +6 -6
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/list/index.js +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts +10 -0
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/practice-results/index.d.ts +4 -0
- package/dist/components/practice-results/index.js +6 -0
- package/dist/components/practice-results/practice-results.agent.d.ts +4 -0
- package/dist/components/practice-results/practice-results.d.ts +159 -0
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/progress/index.js +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio-group/index.js +2 -2
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/resizable/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/stepper-progress/index.js +1 -1
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.js +69 -66
- package/dist/i18n/locales/ar.d.ts +92 -0
- package/dist/i18n/locales/ar.js +82 -0
- package/dist/i18n/locales/de.d.ts +92 -0
- package/dist/i18n/locales/de.js +81 -0
- package/dist/i18n/locales/el.d.ts +92 -0
- package/dist/i18n/locales/el.js +82 -0
- package/dist/i18n/locales/en.d.ts +92 -0
- package/dist/i18n/locales/en.js +92 -0
- package/dist/i18n/locales/es.d.ts +92 -0
- package/dist/i18n/locales/es.js +81 -0
- package/dist/i18n/locales/fr.d.ts +92 -0
- package/dist/i18n/locales/fr.js +81 -0
- package/dist/i18n/locales/hi.d.ts +92 -0
- package/dist/i18n/locales/hi.js +82 -0
- package/dist/i18n/locales/it.d.ts +92 -0
- package/dist/i18n/locales/it.js +81 -0
- package/dist/i18n/locales/ja.d.ts +92 -0
- package/dist/i18n/locales/ja.js +82 -0
- package/dist/i18n/locales/nl.d.ts +92 -0
- package/dist/i18n/locales/nl.js +81 -0
- package/dist/i18n/locales/pl.d.ts +92 -0
- package/dist/i18n/locales/pl.js +82 -0
- package/dist/i18n/locales/pt.d.ts +92 -0
- package/dist/i18n/locales/pt.js +83 -0
- package/dist/i18n/locales/ro.d.ts +92 -0
- package/dist/i18n/locales/ro.js +82 -0
- package/dist/i18n/locales/ru.d.ts +92 -0
- package/dist/i18n/locales/ru.js +82 -0
- package/dist/i18n/locales/sq.d.ts +92 -0
- package/dist/i18n/locales/sq.js +82 -0
- package/dist/i18n/locales/sv.d.ts +92 -0
- package/dist/i18n/locales/sv.js +82 -0
- package/dist/i18n/locales/tr.d.ts +92 -0
- package/dist/i18n/locales/tr.js +82 -0
- package/dist/i18n/locales/zh.d.ts +92 -0
- package/dist/i18n/locales/zh.js +82 -0
- package/dist/index.js +532 -528
- package/dist/locales/ar.json +92 -0
- package/dist/locales/de.json +92 -0
- package/dist/locales/el.json +92 -0
- package/dist/locales/en.json +92 -0
- package/dist/locales/es.json +92 -0
- package/dist/locales/fr.json +92 -0
- package/dist/locales/hi.json +92 -0
- package/dist/locales/it.json +92 -0
- package/dist/locales/ja.json +92 -0
- package/dist/locales/nl.json +92 -0
- package/dist/locales/pl.json +92 -0
- package/dist/locales/pt.json +92 -0
- package/dist/locales/ro.json +92 -0
- package/dist/locales/ru.json +92 -0
- package/dist/locales/sq.json +92 -0
- package/dist/locales/sv.json +92 -0
- package/dist/locales/tr.json +92 -0
- package/dist/locales/zh.json +92 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +5 -2
- package/dist/_chunks/audio-visualiser-I-T4Z7EU.js +0 -145
- package/dist/_chunks/recaptcha-widget-BtBNb6tB.js +0 -192
- package/dist/_chunks/registry-C9nwlNyL.js +0 -21
- package/dist/_chunks/streaming-text-BgjCTVOw.js +0 -105
- package/dist/_chunks/use-scroll-to-first-error-BrK7dKB_.js +0 -55
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { B as
|
|
6
|
-
import { I as
|
|
7
|
-
import { S as
|
|
8
|
-
import { A as
|
|
1
|
+
import { jsxs as R, jsx as s, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ne, useReducer as ae, useState as x, useRef as l, useEffect as N, useCallback as h, useMemo as de, useImperativeHandle as ce } from "react";
|
|
3
|
+
import { c as oe } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as ue } from "react-i18next";
|
|
5
|
+
import { B as J } from "./button-DD_0Xdmr.js";
|
|
6
|
+
import { I as D } from "./icon-button-CKEOrN37.js";
|
|
7
|
+
import { S as pe } from "./select-hsCaJSX3.js";
|
|
8
|
+
import { A as le } from "./audio-visualiser-l6zPd0AG.js";
|
|
9
9
|
import { A as F } from "./alert-ywPR59NE.js";
|
|
10
|
-
import { u as
|
|
10
|
+
import { u as me } from "./registry-nPAVE19X.js";
|
|
11
11
|
import { c as V } from "./createLucideIcon-CrFbzy84.js";
|
|
12
|
-
import { S as
|
|
13
|
-
import { X as
|
|
12
|
+
import { S as fe } from "./square-CZoGU14v.js";
|
|
13
|
+
import { X as ge } from "./x-CCcI3eJp.js";
|
|
14
14
|
/**
|
|
15
15
|
* @license lucide-react v1.8.0 - ISC
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the ISC license.
|
|
18
18
|
* See the LICENSE file in the root directory of this source tree.
|
|
19
19
|
*/
|
|
20
|
-
const
|
|
20
|
+
const he = [
|
|
21
21
|
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
22
22
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
|
|
23
23
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
|
|
24
|
-
],
|
|
24
|
+
], ve = V("mic", he);
|
|
25
25
|
/**
|
|
26
26
|
* @license lucide-react v1.8.0 - ISC
|
|
27
27
|
*
|
|
28
28
|
* This source code is licensed under the ISC license.
|
|
29
29
|
* See the LICENSE file in the root directory of this source tree.
|
|
30
30
|
*/
|
|
31
|
-
const
|
|
31
|
+
const ye = [
|
|
32
32
|
["rect", { x: "14", y: "3", width: "5", height: "18", rx: "1", key: "kaeet6" }],
|
|
33
33
|
["rect", { x: "5", y: "3", width: "5", height: "18", rx: "1", key: "1wsw3u" }]
|
|
34
|
-
],
|
|
34
|
+
], ke = V("pause", ye);
|
|
35
35
|
/**
|
|
36
36
|
* @license lucide-react v1.8.0 - ISC
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the ISC license.
|
|
39
39
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
|
-
const
|
|
41
|
+
const be = [
|
|
42
42
|
[
|
|
43
43
|
"path",
|
|
44
44
|
{
|
|
@@ -46,7 +46,7 @@ const ke = [
|
|
|
46
46
|
key: "10ikf1"
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
|
-
],
|
|
49
|
+
], Re = V("play", be), we = {
|
|
50
50
|
id: "audio-recorder",
|
|
51
51
|
capabilities: ["submit"],
|
|
52
52
|
state: {
|
|
@@ -114,7 +114,7 @@ const ke = [
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
-
function
|
|
117
|
+
function Me(r, u) {
|
|
118
118
|
switch (u.type) {
|
|
119
119
|
case "request":
|
|
120
120
|
return { kind: "requesting" };
|
|
@@ -145,7 +145,7 @@ function we(r, u) {
|
|
|
145
145
|
return r;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
const Ae =
|
|
148
|
+
const Ae = oe(
|
|
149
149
|
[
|
|
150
150
|
"ds:inline-flex ds:flex-col ds:items-stretch ds:gap-[var(--spacing-sm)]",
|
|
151
151
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-border",
|
|
@@ -162,71 +162,71 @@ const Ae = ce(
|
|
|
162
162
|
},
|
|
163
163
|
defaultVariants: { size: "md" }
|
|
164
164
|
}
|
|
165
|
-
),
|
|
165
|
+
), xe = [
|
|
166
166
|
"audio/webm;codecs=opus",
|
|
167
167
|
"audio/webm",
|
|
168
168
|
"audio/mp4",
|
|
169
169
|
"audio/ogg;codecs=opus"
|
|
170
170
|
];
|
|
171
|
-
function
|
|
171
|
+
function Ne() {
|
|
172
172
|
if (!(typeof MediaRecorder > "u")) {
|
|
173
|
-
for (const r of
|
|
173
|
+
for (const r of xe)
|
|
174
174
|
if (MediaRecorder.isTypeSupported(r)) return r;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
function De(r, u) {
|
|
178
|
-
const
|
|
178
|
+
const m = Math.max(0, Math.floor(r / 1e3)), i = Math.floor(m / 60), f = m % 60, v = (S) => new Intl.NumberFormat(u, { minimumIntegerDigits: 2 }).format(S);
|
|
179
179
|
return `${v(i)}:${v(f)}`;
|
|
180
180
|
}
|
|
181
|
-
const
|
|
181
|
+
const Se = ne(
|
|
182
182
|
({
|
|
183
183
|
size: r = "md",
|
|
184
184
|
onRecordingComplete: u,
|
|
185
|
-
onCancel:
|
|
185
|
+
onCancel: m,
|
|
186
186
|
onError: i,
|
|
187
187
|
maxDurationMs: f = 1800 * 1e3,
|
|
188
188
|
maxBytes: v = 250 * 1024 * 1024,
|
|
189
189
|
className: S,
|
|
190
190
|
...I
|
|
191
|
-
},
|
|
192
|
-
const { t: d, i18n:
|
|
193
|
-
|
|
191
|
+
}, Q) => {
|
|
192
|
+
const { t: d, i18n: W } = ue(), [t, p] = ae(Me, { kind: "idle" }), [z, T] = x(null), [Y, Z] = x(Date.now()), [E, ee] = x([]), [w, te] = x(""), c = l(null), y = l([]), _ = l(0), $ = l(0), g = l(null), B = l(!1), k = l(!1), H = l(0), b = typeof MediaRecorder < "u";
|
|
193
|
+
N(() => {
|
|
194
194
|
var e;
|
|
195
|
-
!
|
|
196
|
-
const o =
|
|
197
|
-
|
|
195
|
+
!b || !((e = navigator.mediaDevices) != null && e.enumerateDevices) || navigator.mediaDevices.enumerateDevices().then((n) => {
|
|
196
|
+
const o = n.filter((a) => a.kind === "audioinput");
|
|
197
|
+
ee(o);
|
|
198
198
|
}).catch(() => {
|
|
199
199
|
});
|
|
200
|
-
}, [
|
|
200
|
+
}, [b]), N(() => {
|
|
201
201
|
if (t.kind !== "recording") return;
|
|
202
|
-
const e = window.setInterval(() =>
|
|
202
|
+
const e = window.setInterval(() => Z(Date.now()), 250);
|
|
203
203
|
return () => window.clearInterval(e);
|
|
204
204
|
}, [t.kind]);
|
|
205
|
-
const
|
|
205
|
+
const C = h(() => {
|
|
206
206
|
const e = g.current ?? z;
|
|
207
|
-
e == null || e.getTracks().forEach((
|
|
208
|
-
}, [z]),
|
|
209
|
-
if (!
|
|
207
|
+
e == null || e.getTracks().forEach((n) => n.stop()), g.current = null, T(null);
|
|
208
|
+
}, [z]), M = h(async () => {
|
|
209
|
+
if (!b) {
|
|
210
210
|
p({ type: "error", kind: "unsupported" }), i == null || i("unsupported");
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
|
-
p({ type: "request" }),
|
|
213
|
+
p({ type: "request" }), k.current = !1;
|
|
214
214
|
try {
|
|
215
215
|
const e = await navigator.mediaDevices.getUserMedia({
|
|
216
|
-
audio:
|
|
216
|
+
audio: w ? { deviceId: { exact: w } } : !0
|
|
217
217
|
});
|
|
218
|
-
if (B.current) {
|
|
219
|
-
e.getTracks().forEach((
|
|
218
|
+
if (B.current || k.current) {
|
|
219
|
+
e.getTracks().forEach((a) => a.stop());
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
g.current = e, T(e);
|
|
223
|
-
const
|
|
223
|
+
const n = Ne(), o = new MediaRecorder(
|
|
224
224
|
e,
|
|
225
|
-
|
|
225
|
+
n ? { mimeType: n } : void 0
|
|
226
226
|
);
|
|
227
|
-
c.current = o, y.current = [], _.current = 0, o.ondataavailable = (
|
|
228
|
-
var
|
|
229
|
-
if (
|
|
227
|
+
c.current = o, y.current = [], _.current = 0, o.ondataavailable = (a) => {
|
|
228
|
+
var G;
|
|
229
|
+
if (a.data && a.data.size > 0 && (y.current.push(a.data), _.current += a.data.size, typeof v == "number" && _.current >= v && ((G = c.current) == null ? void 0 : G.state) === "recording")) {
|
|
230
230
|
i == null || i("max-size");
|
|
231
231
|
try {
|
|
232
232
|
c.current.stop();
|
|
@@ -234,29 +234,29 @@ const Ne = se(
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
}, o.onstop = () => {
|
|
237
|
-
if (!
|
|
238
|
-
const
|
|
239
|
-
type:
|
|
237
|
+
if (!k.current) {
|
|
238
|
+
const a = new Blob(y.current, {
|
|
239
|
+
type: n ?? "audio/webm"
|
|
240
240
|
});
|
|
241
|
-
u == null || u(
|
|
241
|
+
u == null || u(a, $.current);
|
|
242
242
|
}
|
|
243
|
-
y.current = [], c.current = null, e.getTracks().forEach((
|
|
244
|
-
}, o.start(1e3), p({ type: "start" });
|
|
243
|
+
y.current = [], c.current = null, e.getTracks().forEach((a) => a.stop()), g.current = null, T(null), k.current = !1;
|
|
244
|
+
}, H.current = performance.now(), o.start(1e3), p({ type: "start" });
|
|
245
245
|
} catch (e) {
|
|
246
|
-
const
|
|
247
|
-
|
|
246
|
+
const n = e instanceof Error ? e.name : "";
|
|
247
|
+
n === "NotAllowedError" || n === "SecurityError" ? (p({ type: "error", kind: "permission-denied" }), i == null || i("permission-denied")) : n === "NotFoundError" || n === "OverconstrainedError" ? (p({ type: "error", kind: "no-device" }), i == null || i("no-device")) : (p({ type: "error", kind: "capture-failed" }), i == null || i("capture-failed"));
|
|
248
248
|
}
|
|
249
|
-
}, [i, u,
|
|
249
|
+
}, [i, u, w, b]), re = h(() => {
|
|
250
250
|
var e;
|
|
251
251
|
(e = c.current) == null || e.pause(), p({ type: "pause" });
|
|
252
|
-
}, []),
|
|
252
|
+
}, []), ie = h(() => {
|
|
253
253
|
var e;
|
|
254
254
|
(e = c.current) == null || e.resume(), p({ type: "resume" });
|
|
255
255
|
}, []), q = h(() => {
|
|
256
256
|
var e;
|
|
257
257
|
if (t.kind === "recording" || t.kind === "paused") {
|
|
258
|
-
const
|
|
259
|
-
$.current = Math.max(0,
|
|
258
|
+
const n = t.startedAt, o = t.pausedMs, a = Date.now() - n - o;
|
|
259
|
+
$.current = Math.max(0, a), p({ type: "stop", duration: a });
|
|
260
260
|
}
|
|
261
261
|
try {
|
|
262
262
|
(e = c.current) == null || e.stop();
|
|
@@ -264,51 +264,51 @@ const Ne = se(
|
|
|
264
264
|
}
|
|
265
265
|
}, [t]), K = h(() => {
|
|
266
266
|
var e;
|
|
267
|
-
|
|
267
|
+
k.current = !0;
|
|
268
268
|
try {
|
|
269
269
|
(e = c.current) == null || e.stop();
|
|
270
270
|
} catch {
|
|
271
271
|
}
|
|
272
|
-
y.current = [], c.current = null,
|
|
273
|
-
}, [
|
|
274
|
-
|
|
272
|
+
y.current = [], c.current = null, C(), p({ type: "cancel" }), m == null || m();
|
|
273
|
+
}, [C, m]);
|
|
274
|
+
N(() => {
|
|
275
275
|
if (t.kind !== "recording" || typeof f != "number" || f <= 0) return;
|
|
276
|
-
const e =
|
|
277
|
-
var
|
|
278
|
-
if (((
|
|
276
|
+
const e = performance.now() - H.current - t.pausedMs, n = Math.max(0, f - e), o = window.setTimeout(() => {
|
|
277
|
+
var a;
|
|
278
|
+
if (((a = c.current) == null ? void 0 : a.state) === "recording") {
|
|
279
279
|
i == null || i("max-duration");
|
|
280
280
|
try {
|
|
281
281
|
c.current.stop();
|
|
282
282
|
} catch {
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
},
|
|
285
|
+
}, n);
|
|
286
286
|
return () => window.clearTimeout(o);
|
|
287
|
-
}, [t, f, i]),
|
|
288
|
-
var e,
|
|
287
|
+
}, [t, f, i]), N(() => () => {
|
|
288
|
+
var e, n;
|
|
289
289
|
B.current = !0;
|
|
290
290
|
try {
|
|
291
291
|
(e = c.current) == null || e.stop();
|
|
292
292
|
} catch {
|
|
293
293
|
}
|
|
294
|
-
(
|
|
294
|
+
(n = g.current) == null || n.getTracks().forEach((o) => o.stop()), g.current = null;
|
|
295
295
|
}, []);
|
|
296
|
-
const j = t.kind === "recording" ?
|
|
296
|
+
const j = t.kind === "recording" ? Y - t.startedAt - t.pausedMs : t.kind === "paused" ? t.pausedAt - t.startedAt - t.pausedMs : t.kind === "stopped" ? t.duration : 0, P = de(
|
|
297
297
|
() => ({
|
|
298
298
|
isRecording: () => t.kind === "recording",
|
|
299
299
|
getDuration: () => j,
|
|
300
300
|
hasRecording: () => t.kind === "stopped",
|
|
301
|
-
startRecording: () =>
|
|
301
|
+
startRecording: () => M(),
|
|
302
302
|
stopRecording: () => q(),
|
|
303
303
|
discard: () => K()
|
|
304
304
|
}),
|
|
305
|
-
[t, j,
|
|
305
|
+
[t, j, M, q, K]
|
|
306
306
|
);
|
|
307
|
-
|
|
308
|
-
const
|
|
307
|
+
ce(Q, () => P, [P]), me(we, P, I.id);
|
|
308
|
+
const O = E.map((e) => ({
|
|
309
309
|
value: e.deviceId,
|
|
310
310
|
label: e.label || d("chat.audio.selectDevice")
|
|
311
|
-
})),
|
|
311
|
+
})), L = (() => {
|
|
312
312
|
switch (t.kind) {
|
|
313
313
|
case "idle":
|
|
314
314
|
return d("chat.audio.idle");
|
|
@@ -323,8 +323,8 @@ const Ne = se(
|
|
|
323
323
|
case "error":
|
|
324
324
|
return t.type === "permission-denied" ? d("chat.audio.permissionDenied") : t.type === "unsupported" ? d("chat.audio.unsupported") : d("chat.audio.idle");
|
|
325
325
|
}
|
|
326
|
-
})(),
|
|
327
|
-
return /* @__PURE__ */
|
|
326
|
+
})(), A = t.kind === "recording", U = t.kind === "paused", X = t.kind === "error";
|
|
327
|
+
return /* @__PURE__ */ R(
|
|
328
328
|
"div",
|
|
329
329
|
{
|
|
330
330
|
"data-component": "audio-recorder",
|
|
@@ -332,16 +332,16 @@ const Ne = se(
|
|
|
332
332
|
className: Ae({ size: r, className: S }),
|
|
333
333
|
...I,
|
|
334
334
|
children: [
|
|
335
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ R("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
336
336
|
/* @__PURE__ */ s(
|
|
337
337
|
"span",
|
|
338
338
|
{
|
|
339
339
|
"aria-hidden": "true",
|
|
340
340
|
className: [
|
|
341
341
|
"ds:relative ds:inline-flex ds:size-3 ds:items-center ds:justify-center ds:rounded-[var(--radius-full)]",
|
|
342
|
-
|
|
342
|
+
A ? "ds:bg-[color:var(--destructive)]" : "ds:bg-[color:var(--muted)]"
|
|
343
343
|
].join(" "),
|
|
344
|
-
children:
|
|
344
|
+
children: A ? /* @__PURE__ */ s(
|
|
345
345
|
"span",
|
|
346
346
|
{
|
|
347
347
|
className: [
|
|
@@ -355,7 +355,7 @@ const Ne = se(
|
|
|
355
355
|
}
|
|
356
356
|
),
|
|
357
357
|
/* @__PURE__ */ s(
|
|
358
|
-
|
|
358
|
+
le,
|
|
359
359
|
{
|
|
360
360
|
stream: z,
|
|
361
361
|
size: "sm",
|
|
@@ -369,48 +369,48 @@ const Ne = se(
|
|
|
369
369
|
dir: "ltr",
|
|
370
370
|
"aria-hidden": "true",
|
|
371
371
|
className: "ds:tabular-nums type-meta ds:text-[color:var(--muted-foreground)]",
|
|
372
|
-
children: De(j,
|
|
372
|
+
children: De(j, W.language)
|
|
373
373
|
}
|
|
374
374
|
)
|
|
375
375
|
] }),
|
|
376
|
-
/* @__PURE__ */ s("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children:
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
t.kind === "idle" || t.kind === "stopped" ||
|
|
379
|
-
|
|
376
|
+
/* @__PURE__ */ s("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: L }),
|
|
377
|
+
/* @__PURE__ */ R("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
378
|
+
t.kind === "idle" || t.kind === "stopped" || X ? /* @__PURE__ */ s(
|
|
379
|
+
J,
|
|
380
380
|
{
|
|
381
381
|
intent: "primary",
|
|
382
382
|
size: "sm",
|
|
383
|
-
startIcon: /* @__PURE__ */ s(
|
|
384
|
-
onClick:
|
|
385
|
-
disabled: !
|
|
383
|
+
startIcon: /* @__PURE__ */ s(ve, {}),
|
|
384
|
+
onClick: M,
|
|
385
|
+
disabled: !b,
|
|
386
386
|
children: d("chat.audio.record")
|
|
387
387
|
}
|
|
388
388
|
) : null,
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
A ? /* @__PURE__ */ s(
|
|
390
|
+
D,
|
|
391
391
|
{
|
|
392
|
-
icon: /* @__PURE__ */ s(
|
|
392
|
+
icon: /* @__PURE__ */ s(ke, {}),
|
|
393
393
|
"aria-label": d("chat.audio.pause"),
|
|
394
394
|
intent: "secondary",
|
|
395
395
|
size: "sm",
|
|
396
|
-
onClick:
|
|
396
|
+
onClick: re
|
|
397
397
|
}
|
|
398
398
|
) : null,
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
U ? /* @__PURE__ */ s(
|
|
400
|
+
D,
|
|
401
401
|
{
|
|
402
|
-
icon: /* @__PURE__ */ s(
|
|
402
|
+
icon: /* @__PURE__ */ s(Re, {}),
|
|
403
403
|
"aria-label": d("chat.audio.resume"),
|
|
404
404
|
intent: "secondary",
|
|
405
405
|
size: "sm",
|
|
406
|
-
onClick:
|
|
406
|
+
onClick: ie
|
|
407
407
|
}
|
|
408
408
|
) : null,
|
|
409
|
-
|
|
409
|
+
A || U ? /* @__PURE__ */ R(se, { children: [
|
|
410
410
|
/* @__PURE__ */ s(
|
|
411
|
-
|
|
411
|
+
D,
|
|
412
412
|
{
|
|
413
|
-
icon: /* @__PURE__ */ s(
|
|
413
|
+
icon: /* @__PURE__ */ s(fe, {}),
|
|
414
414
|
"aria-label": d("chat.audio.stop"),
|
|
415
415
|
intent: "primary",
|
|
416
416
|
size: "sm",
|
|
@@ -418,9 +418,9 @@ const Ne = se(
|
|
|
418
418
|
}
|
|
419
419
|
),
|
|
420
420
|
/* @__PURE__ */ s(
|
|
421
|
-
|
|
421
|
+
D,
|
|
422
422
|
{
|
|
423
|
-
icon: /* @__PURE__ */ s(
|
|
423
|
+
icon: /* @__PURE__ */ s(ge, {}),
|
|
424
424
|
"aria-label": d("chat.audio.cancel"),
|
|
425
425
|
intent: "ghost",
|
|
426
426
|
size: "sm",
|
|
@@ -428,30 +428,30 @@ const Ne = se(
|
|
|
428
428
|
}
|
|
429
429
|
)
|
|
430
430
|
] }) : null,
|
|
431
|
-
t.kind === "idle" &&
|
|
432
|
-
|
|
431
|
+
t.kind === "idle" && O.length > 1 ? /* @__PURE__ */ s("div", { className: "ds:ms-auto ds:min-w-[160px]", children: /* @__PURE__ */ s(
|
|
432
|
+
pe,
|
|
433
433
|
{
|
|
434
434
|
"aria-label": d("chat.audio.selectDevice"),
|
|
435
|
-
options:
|
|
436
|
-
value:
|
|
437
|
-
onValueChange: (e) =>
|
|
435
|
+
options: O,
|
|
436
|
+
value: w,
|
|
437
|
+
onValueChange: (e) => te(e),
|
|
438
438
|
size: "sm",
|
|
439
439
|
clearable: !0
|
|
440
440
|
}
|
|
441
441
|
) }) : null
|
|
442
442
|
] }),
|
|
443
|
-
|
|
444
|
-
/* @__PURE__ */ s(F.Description, { children:
|
|
445
|
-
t.type === "permission-denied" ? /* @__PURE__ */ s(F.Action, { children: /* @__PURE__ */ s(
|
|
443
|
+
X && t.kind === "error" ? /* @__PURE__ */ R(F, { variant: "error", live: "polite", children: [
|
|
444
|
+
/* @__PURE__ */ s(F.Description, { children: L }),
|
|
445
|
+
t.type === "permission-denied" ? /* @__PURE__ */ s(F.Action, { children: /* @__PURE__ */ s(J, { intent: "ghost", size: "sm", onClick: M, children: d("chat.audio.retry") }) }) : null
|
|
446
446
|
] }) : null
|
|
447
447
|
]
|
|
448
448
|
}
|
|
449
449
|
);
|
|
450
450
|
}
|
|
451
451
|
);
|
|
452
|
-
|
|
452
|
+
Se.displayName = "AudioRecorder";
|
|
453
453
|
export {
|
|
454
|
-
|
|
455
|
-
|
|
454
|
+
Se as A,
|
|
455
|
+
we as a
|
|
456
456
|
};
|
|
457
|
-
//# sourceMappingURL=audio-recorder-
|
|
457
|
+
//# sourceMappingURL=audio-recorder-C1rhKhSN.js.map
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { jsxs as _, jsx as V } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $, useRef as i, useState as G, useEffect as m, useMemo as H, useId as J } from "react";
|
|
3
|
+
import { c as K } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as O } from "react-i18next";
|
|
5
|
+
const Q = K(
|
|
6
|
+
[
|
|
7
|
+
"ds:relative ds:inline-flex ds:items-end ds:justify-center",
|
|
8
|
+
// 2px gap is a visual-tuning value (sub-token): the bars need a pixel
|
|
9
|
+
// comma between them that would look like padding at --spacing-xs (4px).
|
|
10
|
+
"ds:gap-[2px]",
|
|
11
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
12
|
+
"ds:bg-transparent",
|
|
13
|
+
"ds:forced-colors:border ds:forced-colors:border-[CanvasText]"
|
|
14
|
+
].join(" "),
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
size: {
|
|
18
|
+
sm: "ds:h-6 ds:min-w-[120px] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
|
|
19
|
+
md: "ds:h-10 ds:min-w-[160px] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
|
|
20
|
+
lg: "ds:h-14 ds:min-w-[220px] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: { size: "md" }
|
|
24
|
+
}
|
|
25
|
+
), W = $(
|
|
26
|
+
({
|
|
27
|
+
stream: p,
|
|
28
|
+
size: k = "md",
|
|
29
|
+
barCount: s = 32,
|
|
30
|
+
deviceName: R,
|
|
31
|
+
label: q,
|
|
32
|
+
className: B,
|
|
33
|
+
...N
|
|
34
|
+
}, P) => {
|
|
35
|
+
const { t: j } = O(), d = i([]), o = i(null), h = i(null), l = i(null), v = i(null), g = i(null), [x, F] = G(!1), z = i(x);
|
|
36
|
+
m(() => {
|
|
37
|
+
var n;
|
|
38
|
+
if (typeof window > "u") return;
|
|
39
|
+
const e = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
40
|
+
F(e.matches);
|
|
41
|
+
const r = () => F(e.matches);
|
|
42
|
+
return (n = e.addEventListener) == null || n.call(e, "change", r), () => {
|
|
43
|
+
var a;
|
|
44
|
+
return (a = e.removeEventListener) == null ? void 0 : a.call(e, "change", r);
|
|
45
|
+
};
|
|
46
|
+
}, []), m(() => {
|
|
47
|
+
z.current = x;
|
|
48
|
+
}, [x]), m(() => {
|
|
49
|
+
if (!p) {
|
|
50
|
+
d.current.forEach((t) => {
|
|
51
|
+
t == null || t.style.setProperty("--bar-height", "10%");
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const e = window.AudioContext || window.webkitAudioContext;
|
|
56
|
+
if (!e) return;
|
|
57
|
+
let r = !1;
|
|
58
|
+
const n = new e(), a = n.createAnalyser();
|
|
59
|
+
a.fftSize = 256;
|
|
60
|
+
const w = n.createMediaStreamSource(p);
|
|
61
|
+
if (w.connect(a), r) {
|
|
62
|
+
try {
|
|
63
|
+
w.disconnect();
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
a.disconnect();
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
70
|
+
n.close().catch(() => {
|
|
71
|
+
});
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
h.current = n, l.current = a, v.current = w, g.current = new Uint8Array(a.frequencyBinCount);
|
|
75
|
+
let L = 0;
|
|
76
|
+
const b = (t) => {
|
|
77
|
+
var S;
|
|
78
|
+
if (r) return;
|
|
79
|
+
if (z.current && t - L < 250) {
|
|
80
|
+
o.current = requestAnimationFrame(b);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
L = t;
|
|
84
|
+
const c = g.current, u = l.current;
|
|
85
|
+
if (!c || !u) return;
|
|
86
|
+
u.getByteFrequencyData(
|
|
87
|
+
c
|
|
88
|
+
);
|
|
89
|
+
const A = Math.max(1, Math.floor(c.length / s));
|
|
90
|
+
for (let f = 0; f < s; f += 1) {
|
|
91
|
+
let T = 0;
|
|
92
|
+
for (let M = 0; M < A; M += 1)
|
|
93
|
+
T += c[f * A + M] ?? 0;
|
|
94
|
+
const C = T / A, U = Math.max(8, Math.min(100, C / 255 * 100));
|
|
95
|
+
(S = d.current[f]) == null || S.style.setProperty("--bar-height", `${U}%`);
|
|
96
|
+
}
|
|
97
|
+
o.current = requestAnimationFrame(b);
|
|
98
|
+
};
|
|
99
|
+
return o.current = requestAnimationFrame(b), () => {
|
|
100
|
+
var t, c, u;
|
|
101
|
+
r = !0, o.current !== null && cancelAnimationFrame(o.current), o.current = null;
|
|
102
|
+
try {
|
|
103
|
+
(t = v.current) == null || t.disconnect();
|
|
104
|
+
} catch {
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
(c = l.current) == null || c.disconnect();
|
|
108
|
+
} catch {
|
|
109
|
+
}
|
|
110
|
+
(u = h.current) == null || u.close().catch(() => {
|
|
111
|
+
}), h.current = null, l.current = null, v.current = null, g.current = null;
|
|
112
|
+
};
|
|
113
|
+
}, [p, s]);
|
|
114
|
+
const D = H(() => Array.from({ length: s }), [s]);
|
|
115
|
+
m(() => {
|
|
116
|
+
d.current.length > s && (d.current.length = s);
|
|
117
|
+
}, [s]);
|
|
118
|
+
const I = q ?? j("chat.audio.visualiserLabel"), y = R ? j("chat.audio.device", { name: R }) : null, E = J();
|
|
119
|
+
return /* @__PURE__ */ _(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
ref: P,
|
|
123
|
+
role: "img",
|
|
124
|
+
"aria-label": I,
|
|
125
|
+
"aria-describedby": y ? E : void 0,
|
|
126
|
+
"data-component": "audio-visualiser",
|
|
127
|
+
className: Q({ size: k, className: B }),
|
|
128
|
+
...N,
|
|
129
|
+
children: [
|
|
130
|
+
D.map((e, r) => /* @__PURE__ */ V(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
ref: (n) => {
|
|
134
|
+
d.current[r] = n;
|
|
135
|
+
},
|
|
136
|
+
"aria-hidden": "true",
|
|
137
|
+
className: [
|
|
138
|
+
"ds:inline-block ds:w-[3px] ds:min-w-[3px]",
|
|
139
|
+
"ds:bg-[color:var(--primary)]",
|
|
140
|
+
"ds:forced-colors:bg-[CanvasText]",
|
|
141
|
+
"ds:rounded-[1px]",
|
|
142
|
+
"ds:transition-[height] ds:duration-[var(--duration-fast)] ds:motion-reduce:transition-none",
|
|
143
|
+
// Height is runtime-computed — applied via --bar-height CSS var
|
|
144
|
+
// set on the element (inline style is limited to --bar-height; the
|
|
145
|
+
// element never receives a position/size class via style).
|
|
146
|
+
"ds:[block-size:var(--bar-height,10%)]"
|
|
147
|
+
].join(" "),
|
|
148
|
+
style: { "--bar-height": "10%" }
|
|
149
|
+
},
|
|
150
|
+
r
|
|
151
|
+
)),
|
|
152
|
+
y ? /* @__PURE__ */ V("span", { id: E, className: "ds:sr-only", children: y }) : null
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
W.displayName = "AudioVisualiser";
|
|
159
|
+
export {
|
|
160
|
+
W as A
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=audio-visualiser-l6zPd0AG.js.map
|
|
@@ -10,7 +10,7 @@ import { u as tt } from "./use-controllable-state-BiY4xTzM.js";
|
|
|
10
10
|
import { g as st } from "./group-options-BvKhQ3xb.js";
|
|
11
11
|
import { I as nt, a as S, b as K, c as ot } from "./input-surface-xyERuLU_.js";
|
|
12
12
|
import { u as at } from "./use-debounced-callback-BisrB-Fq.js";
|
|
13
|
-
import { u as rt } from "./registry-
|
|
13
|
+
import { u as rt } from "./registry-nPAVE19X.js";
|
|
14
14
|
const it = {
|
|
15
15
|
id: "autocomplete",
|
|
16
16
|
capabilities: ["filter", "pick", "open", "close"],
|
|
@@ -466,4 +466,4 @@ export {
|
|
|
466
466
|
it as a,
|
|
467
467
|
dt as b
|
|
468
468
|
};
|
|
469
|
-
//# sourceMappingURL=autocomplete-
|
|
469
|
+
//# sourceMappingURL=autocomplete-DIgdhCGJ.js.map
|