tempest-react-sdk 0.33.2 → 0.35.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.
Files changed (87) hide show
  1. package/README.md +5 -3
  2. package/dist/components/AIChat/AIChat.cjs +2 -0
  3. package/dist/components/AIChat/AIChat.cjs.map +1 -0
  4. package/dist/components/AIChat/AIChat.js +141 -0
  5. package/dist/components/AIChat/AIChat.js.map +1 -0
  6. package/dist/components/AIChat/AIChat.module.cjs +2 -0
  7. package/dist/components/AIChat/AIChat.module.cjs.map +1 -0
  8. package/dist/components/AIChat/AIChat.module.js +58 -0
  9. package/dist/components/AIChat/AIChat.module.js.map +1 -0
  10. package/dist/components/AIChat/AIChatComposer.cjs +2 -0
  11. package/dist/components/AIChat/AIChatComposer.cjs.map +1 -0
  12. package/dist/components/AIChat/AIChatComposer.js +87 -0
  13. package/dist/components/AIChat/AIChatComposer.js.map +1 -0
  14. package/dist/components/AIChat/AIChatTurn.cjs +3 -0
  15. package/dist/components/AIChat/AIChatTurn.cjs.map +1 -0
  16. package/dist/components/AIChat/AIChatTurn.js +217 -0
  17. package/dist/components/AIChat/AIChatTurn.js.map +1 -0
  18. package/dist/components/AIChat/ai-chat-turns.cjs +2 -0
  19. package/dist/components/AIChat/ai-chat-turns.cjs.map +1 -0
  20. package/dist/components/AIChat/ai-chat-turns.js +90 -0
  21. package/dist/components/AIChat/ai-chat-turns.js.map +1 -0
  22. package/dist/perf/cache-size.cjs +2 -0
  23. package/dist/perf/cache-size.cjs.map +1 -0
  24. package/dist/perf/cache-size.js +16 -0
  25. package/dist/perf/cache-size.js.map +1 -0
  26. package/dist/perf/device.cjs +2 -0
  27. package/dist/perf/device.cjs.map +1 -0
  28. package/dist/perf/device.js +22 -0
  29. package/dist/perf/device.js.map +1 -0
  30. package/dist/perf/format.cjs +2 -0
  31. package/dist/perf/format.cjs.map +1 -0
  32. package/dist/perf/format.js +8 -0
  33. package/dist/perf/format.js.map +1 -0
  34. package/dist/perf/profiler.cjs +2 -0
  35. package/dist/perf/profiler.cjs.map +1 -0
  36. package/dist/perf/profiler.js +46 -0
  37. package/dist/perf/profiler.js.map +1 -0
  38. package/dist/styles.css +1 -1
  39. package/dist/tempest-react-sdk.cjs +1 -1
  40. package/dist/tempest-react-sdk.d.ts +626 -9
  41. package/dist/tempest-react-sdk.js +122 -114
  42. package/dist/vision/core/timing.cjs +2 -0
  43. package/dist/vision/core/timing.cjs.map +1 -0
  44. package/dist/vision/core/timing.js +24 -0
  45. package/dist/vision/core/timing.js.map +1 -0
  46. package/dist/vision/index.cjs +1 -1
  47. package/dist/vision/index.cjs.map +1 -1
  48. package/dist/vision/index.js +16 -15
  49. package/dist/vision/index.js.map +1 -1
  50. package/dist/vision/postprocess/detection.cjs +1 -1
  51. package/dist/vision/postprocess/detection.cjs.map +1 -1
  52. package/dist/vision/postprocess/detection.js +2 -2
  53. package/dist/vision/postprocess/detection.js.map +1 -1
  54. package/dist/vision/postprocess/segmentation.cjs +1 -1
  55. package/dist/vision/postprocess/segmentation.cjs.map +1 -1
  56. package/dist/vision/postprocess/segmentation.js +1 -1
  57. package/dist/vision/postprocess/segmentation.js.map +1 -1
  58. package/dist/vision/results.cjs +1 -1
  59. package/dist/vision/results.cjs.map +1 -1
  60. package/dist/vision/results.js +18 -13
  61. package/dist/vision/results.js.map +1 -1
  62. package/dist/vision/tasks/classifier.cjs +1 -1
  63. package/dist/vision/tasks/classifier.cjs.map +1 -1
  64. package/dist/vision/tasks/classifier.js +46 -39
  65. package/dist/vision/tasks/classifier.js.map +1 -1
  66. package/dist/vision/tasks/detector.cjs +1 -1
  67. package/dist/vision/tasks/detector.cjs.map +1 -1
  68. package/dist/vision/tasks/detector.js +40 -33
  69. package/dist/vision/tasks/detector.js.map +1 -1
  70. package/dist/vision/tasks/segmenter.cjs +1 -1
  71. package/dist/vision/tasks/segmenter.cjs.map +1 -1
  72. package/dist/vision/tasks/segmenter.js +35 -28
  73. package/dist/vision/tasks/segmenter.js.map +1 -1
  74. package/dist/vision.cjs +1 -1
  75. package/dist/vision.d.ts +68 -10
  76. package/dist/vision.js +19 -18
  77. package/dist/ws/create-web-socket.cjs +1 -1
  78. package/dist/ws/create-web-socket.cjs.map +1 -1
  79. package/dist/ws/create-web-socket.js +54 -37
  80. package/dist/ws/create-web-socket.js.map +1 -1
  81. package/dist/ws/use-web-socket.cjs +1 -1
  82. package/dist/ws/use-web-socket.cjs.map +1 -1
  83. package/dist/ws/use-web-socket.js +49 -18
  84. package/dist/ws/use-web-socket.js.map +1 -1
  85. package/package.json +1 -1
  86. package/template/src/lib/api.ts +27 -5
  87. package/template/src/stores/auth.ts +14 -0
@@ -175,117 +175,125 @@ import { SignaturePad as Hn } from "./components/SignaturePad/SignaturePad.js";
175
175
  import { chatStrings as Un, dayLabel as Wn, groupMessages as Gn, timeLabel as Kn, typingLabel as qn } from "./components/Chat/chat-groups.js";
176
176
  import { ChatComposer as Jn } from "./components/Chat/ChatComposer.js";
177
177
  import { Chat as Yn } from "./components/Chat/Chat.js";
178
- import { applyMove as Xn, splitSides as Zn } from "./components/Transfer/transfer-state.js";
179
- import { Transfer as Qn } from "./components/Transfer/Transfer.js";
180
- import { Masonry as $n } from "./components/Masonry/Masonry.js";
181
- import { safeLinkUrl as er } from "./components/Markdown/markdown-url.js";
182
- import { parseMarkdown as tr } from "./components/Markdown/markdown-parse.js";
183
- import { Markdown as nr } from "./components/Markdown/Markdown.js";
184
- import { Tour as rr } from "./components/Tour/Tour.js";
185
- import { describeFilter as ir, filtersFromSearchParams as ar, filtersToSearchParams as or, operatorsFor as sr } from "./components/FilterBar/filter-model.js";
186
- import { FilterBar as cr } from "./components/FilterBar/FilterBar.js";
187
- import { formatCPF as lr, formatCurrency as ur, formatDate as dr, formatDateTime as fr, formatPercent as pr, formatPhone as mr } from "./utils/format.js";
188
- import { storage as hr } from "./utils/storage.js";
189
- import { camelCase as gr, capitalize as _r, kebabCase as vr, pluralize as yr, slugify as br, truncate as xr } from "./utils/strings.js";
190
- import { chunk as Sr, groupBy as Cr, range as wr, uniqueBy as Tr } from "./utils/arrays.js";
191
- import { deepMerge as Er, isEmpty as Dr, omit as Or, pick as kr } from "./utils/objects.js";
192
- import { assertNever as Ar, isDefined as jr, isNumber as Mr, isPlainObject as Nr, isString as Pr } from "./utils/guards.js";
193
- import { debounce as Fr, memoizeOne as Ir, once as Lr, throttle as Rr } from "./utils/functions.js";
194
- import { sleep as zr, withTimeout as Br } from "./utils/promises.js";
195
- import { randomId as Vr } from "./utils/ids.js";
196
- import { writeXlsx as Hr } from "./utils/xlsx.js";
197
- import { TempestApiError as Ur, buildApiError as Wr, isApiError as Gr } from "./http/errors.js";
198
- import { createApiClient as Kr } from "./http/api-client.js";
199
- import { parseResponse as qr } from "./http/parse-response.js";
200
- import { uploadWithProgress as Jr } from "./http/upload-with-progress.js";
201
- import { retry as Yr } from "./http/retry.js";
202
- import { generateIdempotencyKey as Xr } from "./http/idempotency.js";
203
- import { usePoll as Zr } from "./http/use-poll.js";
204
- import { createAuthStore as Qr } from "./auth/create-auth-store.js";
205
- import { AuthGuard as $r } from "./auth/AuthGuard.js";
206
- import { decodeJWT as ei, isJWTExpired as ti } from "./auth/jwt.js";
207
- import { lazyWithRetry as ni } from "./auth/lazy-with-retry.js";
208
- import { createRefreshQueue as ri } from "./auth/refresh-queue.js";
209
- import { createTempestAuth as ii } from "./auth/create-tempest-auth.js";
210
- import { AccessControlProvider as ai, useAccessControl as oi } from "./access/access-control-context.js";
211
- import { useCan as si } from "./access/use-can.js";
212
- import { Can as ci } from "./access/Can.js";
213
- import { createRoleAccessControl as li } from "./access/create-role-access-control.js";
214
- import { permissionsFromToken as ui } from "./access/permissions-from-token.js";
215
- import { GoogleSignIn as di } from "./oauth/GoogleSignIn.js";
216
- import { useOAuthCallback as fi } from "./oauth/use-oauth-callback.js";
217
- import { CACHE_TIME as pi, REFETCH_TIME as mi, STALE_TIME as hi } from "./query/constants.js";
218
- import { createQueryKeys as gi } from "./query/create-query-keys.js";
219
- import { QueryProvider as _i } from "./query/QueryProvider.js";
220
- import { emptyOffsetPage as vi, isCursorPage as yi, isOffsetPage as bi } from "./query/pagination.js";
221
- import { usePaginatedQuery as xi } from "./query/use-paginated-query.js";
222
- import { useCursorQuery as Si } from "./query/use-cursor-query.js";
223
- import { useOfflineMutation as Ci } from "./query/use-offline-mutation.js";
224
- import { removeById as wi, upsertById as Ti } from "./query/optimistic.js";
225
- import { createOfflineStore as Ei } from "./offline/create-offline-store.js";
226
- import { persistQueryClientOffline as Di } from "./query/offline-persistence.js";
227
- import { createDataProvider as Oi } from "./data/create-data-provider.js";
228
- import { TempestDataProvider as ki, useDataProvider as Ai } from "./data/data-provider-context.js";
229
- import { listQueryKey as ji, oneQueryKey as Mi, useCreate as Ni, useDelete as Pi, useList as Fi, useOne as Ii, useUpdate as Li } from "./data/use-resource.js";
230
- import { RouteGuard as Ri } from "./router/RouteGuard.js";
231
- import { AppRouter as zi, defineRoutes as Bi } from "./router/AppRouter.js";
232
- import { BrowserRouter as Vi, HashRouter as Hi, Link as Ui, MemoryRouter as Wi, NavLink as Gi, Navigate as Ki, Outlet as qi, Route as Ji, Routes as Yi, redirect as Xi, useLocation as Zi, useMatch as Qi, useNavigate as $i, useParams as ea, useRouteError as ta, useSearchParams as na } from "./router/index.js";
233
- import { createStore as ra } from "./store/create-store.js";
234
- import { createSelectors as ia } from "./store/create-selectors.js";
235
- import { ThemeProvider as aa, useTheme as oa } from "./theme/ThemeProvider.js";
236
- import { createI18n as sa } from "./i18n/create-i18n.js";
237
- import { I18nProvider as ca, useI18n as la, useTranslate as ua } from "./i18n/I18nProvider.js";
238
- import { ErrorBoundary as da } from "./error-boundary/ErrorBoundary.js";
239
- import { AppProviders as fa } from "./app/AppProviders.js";
240
- import { createEventStream as pa } from "./sse/create-event-stream.js";
241
- import { useEventStream as ma } from "./sse/use-event-stream.js";
242
- import { isPushSupported as ha, urlBase64ToUint8Array as ga } from "./push/utils.js";
243
- import { WebPushClient as _a, WebPushPermissionDeniedError as va, WebPushUnsupportedError as ya } from "./push/web-push-client.js";
244
- import { usePushSubscription as ba } from "./push/use-push-subscription.js";
245
- import { installNotificationClickHandler as xa, installPushHandler as Sa, installSkipWaitingListener as Ca } from "./sw/create-push-handler.js";
246
- import { createPartialResponse as wa, installPrecache as Ta, installRuntimeCache as Ea } from "./sw/cache.js";
247
- import { installBackgroundSync as Da } from "./sw/background-sync.js";
248
- import { registerPeriodicSync as Oa } from "./sw/periodic-sync.js";
249
- import { clearCaches as ka, inspectCaches as Aa } from "./sw/cache-inspect.js";
250
- import { createAudioPlayer as ja, playAudio as Ma, stopAudio as Na } from "./audio/audio-player.js";
251
- import { useAudio as Pa } from "./audio/use-audio.js";
252
- import { createOfflineSync as Fa } from "./offline/create-offline-sync.js";
253
- import { higherVersionWins as Ia, lastWriteWins as La } from "./offline/conflict.js";
254
- import { useErrorHandler as Ra } from "./error-boundary/use-error-handler.js";
255
- import { FormField as za } from "./forms/FormField.js";
256
- import { validateForm as Ba } from "./forms/validate-form.js";
257
- import { zodResolver as Va } from "./forms/zod-resolver.js";
258
- import { useZodForm as Ha } from "./forms/use-zod-form.js";
259
- import { formatCEP as Ua, formatCNPJ as Wa, unmask as Ga, validateCNPJ as Ka, validateCPF as qa } from "./forms/br-validators.js";
260
- import { CEPInput as Ja, CNPJInput as Ya, CPFInput as Xa, MoneyInput as Za, PhoneInput as Qa } from "./forms/masked-inputs.js";
261
- import { useViaCEP as $a } from "./forms/use-viacep.js";
262
- import { Controller as eo, FormProvider as to, useFieldArray as no, useForm as ro, useFormContext as io, useFormState as ao, useWatch as oo } from "./forms/index.js";
263
- import { createWebSocket as so } from "./ws/create-web-socket.js";
264
- import { useWebSocket as co } from "./ws/use-web-socket.js";
265
- import { clampLatitude as lo, isCoordinate as uo, isValidLatitude as fo, isValidLongitude as po, normalizeLongitude as mo } from "./geo/types.js";
266
- import { EARTH_RADIUS_KM as ho, bearingDeg as go, haversineKm as _o, pathLengthKm as vo, toRadians as yo } from "./geo/distance.js";
267
- import { DEFAULT_CAR_SPEED_KMH as bo, DEFAULT_CIRCUITY_FACTOR as xo, DEFAULT_MODE_DURATION_FACTORS as So, durationFactor as Co, estimateTravel as wo } from "./geo/estimate.js";
268
- import { boundingBox as To, boundsCenter as Eo, expandBounds as Do } from "./geo/bounds.js";
269
- import { MERCATOR_MAX_LATITUDE as Oo, fitProjection as ko, projectMercator as Ao, unprojectMercator as jo } from "./geo/projection.js";
270
- import { createOSRMBackend as Mo } from "./geo/routing.js";
271
- import { createPositionTracker as No } from "./geo/create-position-tracker.js";
272
- import { usePositionTracker as Po } from "./geo/use-position-tracker.js";
273
- import { TrajectoryMap as Fo } from "./geo/TrajectoryMap.js";
274
- import { THEME_STYLE_ID as Io, applyTheme as Lo, readThemeToken as Ro } from "./theme/apply-theme.js";
275
- import { contrastRatio as zo, createColorScale as Bo, hexToOklch as Vo, hexToRgb as Ho, hexToRgbaString as Uo, oklchToHex as Wo, readableForeground as Go, relativeLuminance as Ko, rgbToHex as qo } from "./theme/color.js";
276
- import { createTheme as Jo, themeContrast as Yo } from "./theme/create-theme.js";
277
- import { getThemePreset as Xo, themePresets as Zo } from "./theme/theme-presets.js";
278
- import { getInitialTheme as Qo, themeInitScript as $o } from "./theme/initial-theme.js";
279
- import { consoleSink as es, createLogger as ts } from "./logger/logger.js";
280
- import { TelemetryProvider as ns, useTelemetry as rs } from "./telemetry/TelemetryProvider.js";
281
- import { consoleTelemetryAdapter as is } from "./telemetry/console-adapter.js";
282
- import { createSentryTelemetryAdapter as as } from "./telemetry/sentry-adapter.js";
283
- import { createPostHogTelemetryAdapter as os } from "./telemetry/posthog-adapter.js";
284
- import { FeatureFlagsProvider as ss, useFeatureFlag as cs, useFlagValue as ls } from "./feature-flags/FeatureFlagsProvider.js";
285
- import { createInMemoryFlags as us } from "./feature-flags/in-memory-adapter.js";
286
- import { createGrowthBookFeatureFlagsAdapter as ds } from "./feature-flags/growthbook-adapter.js";
287
- import { createLaunchDarklyFeatureFlagsAdapter as fs } from "./feature-flags/launchdarkly-adapter.js";
288
- import { isShareSupported as ps, share as ms } from "./share/share.js";
289
- import { shareOrDownloadBlob as hs } from "./share/share-or-download.js";
290
- import { DIVERGING_STEP_COUNT as gs, ORDINAL_START_STEP as _s, SEQUENTIAL_STEP_COUNT as vs, divergingScale as ys, scaleSteps as bs, sequentialScale as xs } from "./charts/scales.js";
291
- export { ai as AccessControlProvider, t as Accordion, n as Alert, r as AppBar, fa as AppProviders, zi as AppRouter, o as AppShell, s as AspectRatio, $r as AuthGuard, c as Avatar, l as AvatarGroup, i as BREAKPOINTS, u as Badge, d as Banner, f as BottomNavigation, p as BottomSheet, m as Breadcrumbs, Vi as BrowserRouter, h as Button, pi as CACHE_TIME, Ja as CEPInput, Ya as CNPJInput, Xa as CPFInput, Dn as Calendar, ci as Can, g as Card, Nn as Carousel, _ as Center, Yn as Chat, Jn as ChatComposer, v as Checkbox, y as ChipInput, un as ClickOutside, nn as CodeBlock, xn as Collapsible, b as Combobox, wn as Command, dn as ConditionalWrapper, S as ConfirmDialog, I as Container, Sn as ContextMenu, eo as Controller, Qt as CopyButton, bo as DEFAULT_CAR_SPEED_KMH, xo as DEFAULT_CIRCUITY_FACTOR, So as DEFAULT_MODE_DURATION_FACTORS, gs as DIVERGING_STEP_COUNT, hn as DataList, Pn as DataTable, w as DatePicker, An as DateRangePicker, gn as DescriptionList, T as Divider, E as Drawer, D as DropdownMenu, O as Dropzone, ho as EARTH_RADIUS_KM, k as EmptyState, da as ErrorBoundary, A as ErrorState, pn as ErrorText, ss as FeatureFlagsProvider, j as FileUpload, cr as FilterBar, In as FloatingActionButton, fn as For, M as Form, N as FormActions, za as FormField, to as FormProvider, P as FormRow, F as FormSection, di as GoogleSignIn, L as Grid, Hi as HashRouter, pt as Hide, Cn as HoverCard, ca as I18nProvider, mn as Image, Rt as ImageCropper, C as Input, B as InstallBanner, V as InstallButton, Je as Kanban, Xe as Kbd, bn as Label, Vn as Lightbox, Ui as Link, Fn as ListTile, Oo as MERCATOR_MAX_LATITUDE, nr as Markdown, $n as Masonry, Wi as MemoryRouter, Mn as Menubar, x as Modal, Ze as ModalsProvider, an as Money, Za as MoneyInput, kn as MultiSelect, et as NProgressBar, Gi as NavLink, $e as Navbar, Ki as Navigate, jn as NavigationMenu, Ln as NavigationRail, Ht as NotificationCenter, _s as ORDINAL_START_STEP, Ue as OfflineIndicator, qi as Outlet, nt as Page, rt as Pagination, it as PasswordInput, Qa as PhoneInput, ot as PinInput, st as Popover, ln as Portal, ct as Progress, qt as QRCapacityError, Zt as QRCode, _i as QueryProvider, mi as REFETCH_TIME, lt as Radio, ut as RadioGroup, dt as RangeSlider, ft as RatingStars, zn as RefreshIndicator, rn as RelativeTime, En as Resizable, Ji as Route, Ri as RouteGuard, Yi as Routes, vs as SEQUENTIAL_STEP_COUNT, hi as STALE_TIME, ht as SafeArea, Bt as Scheduler, Tn as ScrollArea, gt as SearchBar, _t as SegmentedControl, vt as Select, mt as Show, yt as Sidebar, Hn as SignaturePad, bt as Skeleton, On as Slider, xt as Spacer, zt as Sparkline, St as Spinner, R as Stack, Ct as Stat, wt as Stepper, Ot as StepperInput, kt as Switch, Ke as SyncStatusBadge, Io as THEME_STYLE_ID, jt as Table, Mt as Tabs, At as Tag, ns as TelemetryProvider, Ur as TempestApiError, ki as TempestDataProvider, Nt as Textarea, aa as ThemeProvider, Rn as TimePicker, Pt as Timeline, It as ToastProvider, _n as Toggle, vn as ToggleGroup, yn as ToggleGroupItem, Ft as Tooltip, rr as Tour, Fo as TrajectoryMap, Qn as Transfer, on as TreeView, sn as TruncateText, qe as UpdatePrompt, Wt as VirtualList, Kt as VirtualTable, cn as VisuallyHidden, _a as WebPushClient, va as WebPushPermissionDeniedError, ya as WebPushUnsupportedError, Bn as Wizard, Ye as applyKanbanMove, Lo as applyTheme, Xn as applyTransferMove, Ar as assertNever, go as bearingDeg, To as boundingBox, Eo as boundsCenter, Wr as buildApiError, De as buildOpenInChromeIntent, gr as camelCase, _r as capitalize, Un as chatStrings, Sr as chunk, Tt as clamp, lo as clampLatitude, ka as clearCaches, e as cn, Gt as compareValues, es as consoleSink, is as consoleTelemetryAdapter, zo as contrastRatio, Kr as createApiClient, ja as createAudioPlayer, Qr as createAuthStore, Bo as createColorScale, Oi as createDataProvider, pa as createEventStream, ds as createGrowthBookFeatureFlagsAdapter, sa as createI18n, us as createInMemoryFlags, fs as createLaunchDarklyFeatureFlagsAdapter, ts as createLogger, Mo as createOSRMBackend, Ei as createOfflineStore, Fa as createOfflineSync, wa as createPartialResponse, No as createPositionTracker, os as createPostHogTelemetryAdapter, gi as createQueryKeys, ri as createRefreshQueue, li as createRoleAccessControl, ia as createSelectors, as as createSentryTelemetryAdapter, ra as createStore, ii as createTempestAuth, Jo as createTheme, so as createWebSocket, Wn as dayLabel, Fr as debounce, ei as decodeJWT, Er as deepMerge, Bi as defineRoutes, ir as describeFilter, ys as divergingScale, Co as durationFactor, vi as emptyOffsetPage, Jt as encodeQR, at as estimatePasswordStrength, Le as estimateStorage, wo as estimateTravel, Do as expandBounds, ar as filtersFromSearchParams, or as filtersToSearchParams, ko as fitProjection, Et as formatBytes, Ua as formatCEP, Wa as formatCNPJ, lr as formatCPF, Dt as formatCompactNumber, ur as formatCurrency, dr as formatDate, fr as formatDateTime, pr as formatPercent, mr as formatPhone, Xr as generateIdempotencyKey, Qo as getInitialTheme, Xo as getThemePreset, Cr as groupBy, Gn as groupMessages, _o as haversineKm, Vo as hexToOklch, Ho as hexToRgb, Uo as hexToRgbaString, Ia as higherVersionWins, Aa as inspectCaches, Da as installBackgroundSync, xa as installNotificationClickHandler, Ta as installPrecache, Sa as installPushHandler, Ea as installRuntimeCache, Ca as installSkipWaitingListener, Oe as isAndroid, ke as isAndroidWithoutPromptApi, Gr as isApiError, uo as isCoordinate, yi as isCursorPage, jr as isDefined, Dr as isEmpty, Ae as isIOS, ti as isJWTExpired, Mr as isNumber, bi as isOffsetPage, Nr as isPlainObject, ha as isPushSupported, ps as isShareSupported, je as isStandalone, Pr as isString, fo as isValidLatitude, po as isValidLongitude, vr as kebabCase, La as lastWriteWins, ni as lazyWithRetry, ji as listQueryKey, Yt as matrixToPath, Ir as memoizeOne, Be as moveItem, mo as normalizeLongitude, tt as nprogress, Wo as oklchToHex, Or as omit, Lr as once, Mi as oneQueryKey, sr as operatorsFor, tr as parseMarkdown, qr as parseResponse, vo as pathLengthKm, ui as permissionsFromToken, Di as persistQueryClientOffline, kr as pick, Ma as playAudio, yr as pluralize, Ao as projectMercator, Vr as randomId, wr as range, Ro as readThemeToken, Go as readableForeground, Xi as redirect, Oa as registerPeriodicSync, Ne as registerServiceWorker, Ko as relativeLuminance, Vt as relativeTime, wi as removeById, Re as requestPersistentStorage, $t as resolveLanguage, Yr as retry, qo as rgbToHex, er as safeLinkUrl, bs as scaleSteps, Xt as selectMode, xs as sequentialScale, ms as share, hs as shareOrDownloadBlob, Pe as skipWaiting, zr as sleep, br as slugify, Zn as splitTransferSides, Na as stopAudio, hr as storage, Yo as themeContrast, $o as themeInitScript, Zo as themePresets, Rr as throttle, Kn as timeLabel, yo as toRadians, en as tokenize, tn as tokenizeLines, xr as truncate, qn as typingLabel, Tr as uniqueBy, Ga as unmask, jo as unprojectMercator, Fe as unregisterAllServiceWorkers, Jr as uploadWithProgress, Ti as upsertById, ga as urlBase64ToUint8Array, oi as useAccessControl, Y as useAsync, Pa as useAudio, z as useBeforeInstallPrompt, a as useBreakpoint, si as useCan, Ce as useClickOutside, W as useClientFilter, ee as useClipboard, _e as useCounter, Ni as useCreate, Si as useCursorQuery, Ai as useDataProvider, H as useDebounce, se as useDeepMemo, Pi as useDelete, he as useDisclosure, ve as useDocumentTitle, Z as useDocumentVisibility, Ra as useErrorHandler, K as useEventListener, ma as useEventStream, ye as useFavicon, cs as useFeatureFlag, no as useFieldArray, ls as useFlagValue, ae as useFocusTrap, ro as useForm, io as useFormContext, ao as useFormState, re as useGeolocation, pe as useHover, la as useI18n, ne as useIdle, Me as useInstallPrompt, Q as useIntersectionObserver, le as useInterval, we as useIsFirstRender, te as useKeyboardShortcut, Fi as useList, ge as useListState, q as useLocalStorage, Zi as useLocation, me as useLongPress, Ee as useLongPressHandlers, be as useMap, Qi as useMatch, G as useMediaQuery, Qe as useModals, $i as useNavigate, Ut as useNotificationInbox, fi as useOAuthCallback, Te as useObjectUrl, Ci as useOfflineMutation, We as useOfflineSync, Ii as useOne, X as useOnline, xi as usePaginatedQuery, U as usePagination, ea as useParams, Zr as usePoll, Po as usePositionTracker, ce as usePrevious, ba as usePushSubscription, Se as useQueue, $ as useResizeObserver, ta as useRouteError, ie as useScrollLock, He as useScrollOverflow, na as useSearchParams, Ie as useServiceWorkerUpdate, xe as useSet, Ve as useSortable, oe as useStableCallback, ze as useStorageEstimate, Ge as useSyncStatus, rs as useTelemetry, oa as useTheme, de as useThrottle, ue as useTimeout, Lt as useToast, J as useToggle, ua as useTranslate, Li as useUpdate, $a as useViaCEP, oo as useWatch, co as useWebSocket, fe as useWindowSize, Ha as useZodForm, Ka as validateCNPJ, qa as validateCPF, Ba as validateForm, Br as withTimeout, Hr as writeXlsx, Va as zodResolver };
178
+ import { aiChatStrings as Xn, isGenerating as Zn, lastAssistantId as Qn, roleLabel as $n, tailSignature as er, turnTime as tr, visibleTurns as nr } from "./components/AIChat/ai-chat-turns.js";
179
+ import { AIChatComposer as rr } from "./components/AIChat/AIChatComposer.js";
180
+ import { safeLinkUrl as ir } from "./components/Markdown/markdown-url.js";
181
+ import { parseMarkdown as ar } from "./components/Markdown/markdown-parse.js";
182
+ import { Markdown as or } from "./components/Markdown/Markdown.js";
183
+ import { AIChatTurn as sr } from "./components/AIChat/AIChatTurn.js";
184
+ import { AIChat as cr } from "./components/AIChat/AIChat.js";
185
+ import { applyMove as lr, splitSides as ur } from "./components/Transfer/transfer-state.js";
186
+ import { Transfer as dr } from "./components/Transfer/Transfer.js";
187
+ import { Masonry as fr } from "./components/Masonry/Masonry.js";
188
+ import { Tour as pr } from "./components/Tour/Tour.js";
189
+ import { describeFilter as mr, filtersFromSearchParams as hr, filtersToSearchParams as gr, operatorsFor as _r } from "./components/FilterBar/filter-model.js";
190
+ import { FilterBar as vr } from "./components/FilterBar/FilterBar.js";
191
+ import { formatCPF as yr, formatCurrency as br, formatDate as xr, formatDateTime as Sr, formatPercent as Cr, formatPhone as wr } from "./utils/format.js";
192
+ import { storage as Tr } from "./utils/storage.js";
193
+ import { camelCase as Er, capitalize as Dr, kebabCase as Or, pluralize as kr, slugify as Ar, truncate as jr } from "./utils/strings.js";
194
+ import { chunk as Mr, groupBy as Nr, range as Pr, uniqueBy as Fr } from "./utils/arrays.js";
195
+ import { deepMerge as Ir, isEmpty as Lr, omit as Rr, pick as zr } from "./utils/objects.js";
196
+ import { assertNever as Br, isDefined as Vr, isNumber as Hr, isPlainObject as Ur, isString as Wr } from "./utils/guards.js";
197
+ import { debounce as Gr, memoizeOne as Kr, once as qr, throttle as Jr } from "./utils/functions.js";
198
+ import { sleep as Yr, withTimeout as Xr } from "./utils/promises.js";
199
+ import { randomId as Zr } from "./utils/ids.js";
200
+ import { writeXlsx as Qr } from "./utils/xlsx.js";
201
+ import { TempestApiError as $r, buildApiError as ei, isApiError as ti } from "./http/errors.js";
202
+ import { createApiClient as ni } from "./http/api-client.js";
203
+ import { parseResponse as ri } from "./http/parse-response.js";
204
+ import { uploadWithProgress as ii } from "./http/upload-with-progress.js";
205
+ import { retry as ai } from "./http/retry.js";
206
+ import { generateIdempotencyKey as oi } from "./http/idempotency.js";
207
+ import { usePoll as si } from "./http/use-poll.js";
208
+ import { createAuthStore as ci } from "./auth/create-auth-store.js";
209
+ import { AuthGuard as li } from "./auth/AuthGuard.js";
210
+ import { decodeJWT as ui, isJWTExpired as di } from "./auth/jwt.js";
211
+ import { lazyWithRetry as fi } from "./auth/lazy-with-retry.js";
212
+ import { createRefreshQueue as pi } from "./auth/refresh-queue.js";
213
+ import { createTempestAuth as mi } from "./auth/create-tempest-auth.js";
214
+ import { AccessControlProvider as hi, useAccessControl as gi } from "./access/access-control-context.js";
215
+ import { useCan as _i } from "./access/use-can.js";
216
+ import { Can as vi } from "./access/Can.js";
217
+ import { createRoleAccessControl as yi } from "./access/create-role-access-control.js";
218
+ import { permissionsFromToken as bi } from "./access/permissions-from-token.js";
219
+ import { GoogleSignIn as xi } from "./oauth/GoogleSignIn.js";
220
+ import { useOAuthCallback as Si } from "./oauth/use-oauth-callback.js";
221
+ import { CACHE_TIME as Ci, REFETCH_TIME as wi, STALE_TIME as Ti } from "./query/constants.js";
222
+ import { createQueryKeys as Ei } from "./query/create-query-keys.js";
223
+ import { QueryProvider as Di } from "./query/QueryProvider.js";
224
+ import { emptyOffsetPage as Oi, isCursorPage as ki, isOffsetPage as Ai } from "./query/pagination.js";
225
+ import { usePaginatedQuery as ji } from "./query/use-paginated-query.js";
226
+ import { useCursorQuery as Mi } from "./query/use-cursor-query.js";
227
+ import { useOfflineMutation as Ni } from "./query/use-offline-mutation.js";
228
+ import { removeById as Pi, upsertById as Fi } from "./query/optimistic.js";
229
+ import { createOfflineStore as Ii } from "./offline/create-offline-store.js";
230
+ import { persistQueryClientOffline as Li } from "./query/offline-persistence.js";
231
+ import { createDataProvider as Ri } from "./data/create-data-provider.js";
232
+ import { TempestDataProvider as zi, useDataProvider as Bi } from "./data/data-provider-context.js";
233
+ import { listQueryKey as Vi, oneQueryKey as Hi, useCreate as Ui, useDelete as Wi, useList as Gi, useOne as Ki, useUpdate as qi } from "./data/use-resource.js";
234
+ import { RouteGuard as Ji } from "./router/RouteGuard.js";
235
+ import { AppRouter as Yi, defineRoutes as Xi } from "./router/AppRouter.js";
236
+ import { BrowserRouter as Zi, HashRouter as Qi, Link as $i, MemoryRouter as ea, NavLink as ta, Navigate as na, Outlet as ra, Route as ia, Routes as aa, redirect as oa, useLocation as sa, useMatch as ca, useNavigate as la, useParams as ua, useRouteError as da, useSearchParams as fa } from "./router/index.js";
237
+ import { createStore as pa } from "./store/create-store.js";
238
+ import { createSelectors as ma } from "./store/create-selectors.js";
239
+ import { ThemeProvider as ha, useTheme as ga } from "./theme/ThemeProvider.js";
240
+ import { createI18n as _a } from "./i18n/create-i18n.js";
241
+ import { I18nProvider as va, useI18n as ya, useTranslate as ba } from "./i18n/I18nProvider.js";
242
+ import { ErrorBoundary as xa } from "./error-boundary/ErrorBoundary.js";
243
+ import { AppProviders as Sa } from "./app/AppProviders.js";
244
+ import { createEventStream as Ca } from "./sse/create-event-stream.js";
245
+ import { useEventStream as wa } from "./sse/use-event-stream.js";
246
+ import { isPushSupported as Ta, urlBase64ToUint8Array as Ea } from "./push/utils.js";
247
+ import { WebPushClient as Da, WebPushPermissionDeniedError as Oa, WebPushUnsupportedError as ka } from "./push/web-push-client.js";
248
+ import { usePushSubscription as Aa } from "./push/use-push-subscription.js";
249
+ import { installNotificationClickHandler as ja, installPushHandler as Ma, installSkipWaitingListener as Na } from "./sw/create-push-handler.js";
250
+ import { createPartialResponse as Pa, installPrecache as Fa, installRuntimeCache as Ia } from "./sw/cache.js";
251
+ import { installBackgroundSync as La } from "./sw/background-sync.js";
252
+ import { registerPeriodicSync as Ra } from "./sw/periodic-sync.js";
253
+ import { clearCaches as za, inspectCaches as Ba } from "./sw/cache-inspect.js";
254
+ import { createAudioPlayer as Va, playAudio as Ha, stopAudio as Ua } from "./audio/audio-player.js";
255
+ import { useAudio as Wa } from "./audio/use-audio.js";
256
+ import { createOfflineSync as Ga } from "./offline/create-offline-sync.js";
257
+ import { higherVersionWins as Ka, lastWriteWins as qa } from "./offline/conflict.js";
258
+ import { useErrorHandler as Ja } from "./error-boundary/use-error-handler.js";
259
+ import { FormField as Ya } from "./forms/FormField.js";
260
+ import { validateForm as Xa } from "./forms/validate-form.js";
261
+ import { zodResolver as Za } from "./forms/zod-resolver.js";
262
+ import { useZodForm as Qa } from "./forms/use-zod-form.js";
263
+ import { formatCEP as $a, formatCNPJ as eo, unmask as to, validateCNPJ as no, validateCPF as ro } from "./forms/br-validators.js";
264
+ import { CEPInput as io, CNPJInput as ao, CPFInput as oo, MoneyInput as so, PhoneInput as co } from "./forms/masked-inputs.js";
265
+ import { useViaCEP as lo } from "./forms/use-viacep.js";
266
+ import { Controller as uo, FormProvider as fo, useFieldArray as po, useForm as mo, useFormContext as ho, useFormState as go, useWatch as _o } from "./forms/index.js";
267
+ import { createWebSocket as vo } from "./ws/create-web-socket.js";
268
+ import { useWebSocket as yo } from "./ws/use-web-socket.js";
269
+ import { clampLatitude as bo, isCoordinate as xo, isValidLatitude as So, isValidLongitude as Co, normalizeLongitude as wo } from "./geo/types.js";
270
+ import { EARTH_RADIUS_KM as To, bearingDeg as Eo, haversineKm as Do, pathLengthKm as Oo, toRadians as ko } from "./geo/distance.js";
271
+ import { DEFAULT_CAR_SPEED_KMH as Ao, DEFAULT_CIRCUITY_FACTOR as jo, DEFAULT_MODE_DURATION_FACTORS as Mo, durationFactor as No, estimateTravel as Po } from "./geo/estimate.js";
272
+ import { boundingBox as Fo, boundsCenter as Io, expandBounds as Lo } from "./geo/bounds.js";
273
+ import { MERCATOR_MAX_LATITUDE as Ro, fitProjection as zo, projectMercator as Bo, unprojectMercator as Vo } from "./geo/projection.js";
274
+ import { createOSRMBackend as Ho } from "./geo/routing.js";
275
+ import { createPositionTracker as Uo } from "./geo/create-position-tracker.js";
276
+ import { usePositionTracker as Wo } from "./geo/use-position-tracker.js";
277
+ import { TrajectoryMap as Go } from "./geo/TrajectoryMap.js";
278
+ import { THEME_STYLE_ID as Ko, applyTheme as qo, readThemeToken as Jo } from "./theme/apply-theme.js";
279
+ import { contrastRatio as Yo, createColorScale as Xo, hexToOklch as Zo, hexToRgb as Qo, hexToRgbaString as $o, oklchToHex as es, readableForeground as ts, relativeLuminance as ns, rgbToHex as rs } from "./theme/color.js";
280
+ import { createTheme as is, themeContrast as as } from "./theme/create-theme.js";
281
+ import { getThemePreset as os, themePresets as ss } from "./theme/theme-presets.js";
282
+ import { getInitialTheme as cs, themeInitScript as ls } from "./theme/initial-theme.js";
283
+ import { consoleSink as us, createLogger as ds } from "./logger/logger.js";
284
+ import { TelemetryProvider as fs, useTelemetry as ps } from "./telemetry/TelemetryProvider.js";
285
+ import { consoleTelemetryAdapter as ms } from "./telemetry/console-adapter.js";
286
+ import { createSentryTelemetryAdapter as hs } from "./telemetry/sentry-adapter.js";
287
+ import { createPostHogTelemetryAdapter as gs } from "./telemetry/posthog-adapter.js";
288
+ import { FeatureFlagsProvider as _s, useFeatureFlag as vs, useFlagValue as ys } from "./feature-flags/FeatureFlagsProvider.js";
289
+ import { createInMemoryFlags as bs } from "./feature-flags/in-memory-adapter.js";
290
+ import { createGrowthBookFeatureFlagsAdapter as xs } from "./feature-flags/growthbook-adapter.js";
291
+ import { createLaunchDarklyFeatureFlagsAdapter as Ss } from "./feature-flags/launchdarkly-adapter.js";
292
+ import { isShareSupported as Cs, share as ws } from "./share/share.js";
293
+ import { shareOrDownloadBlob as Ts } from "./share/share-or-download.js";
294
+ import { DIVERGING_STEP_COUNT as Es, ORDINAL_START_STEP as Ds, SEQUENTIAL_STEP_COUNT as Os, divergingScale as ks, scaleSteps as As, sequentialScale as js } from "./charts/scales.js";
295
+ import { cachedResponseBytes as Ms } from "./perf/cache-size.js";
296
+ import { readDeviceProfile as Ns } from "./perf/device.js";
297
+ import { formatDurationMs as Ps } from "./perf/format.js";
298
+ import { createInferenceProfiler as Fs } from "./perf/profiler.js";
299
+ export { cr as AIChat, rr as AIChatComposer, sr as AIChatTurn, hi as AccessControlProvider, t as Accordion, n as Alert, r as AppBar, Sa as AppProviders, Yi as AppRouter, o as AppShell, s as AspectRatio, li as AuthGuard, c as Avatar, l as AvatarGroup, i as BREAKPOINTS, u as Badge, d as Banner, f as BottomNavigation, p as BottomSheet, m as Breadcrumbs, Zi as BrowserRouter, h as Button, Ci as CACHE_TIME, io as CEPInput, ao as CNPJInput, oo as CPFInput, Dn as Calendar, vi as Can, g as Card, Nn as Carousel, _ as Center, Yn as Chat, Jn as ChatComposer, v as Checkbox, y as ChipInput, un as ClickOutside, nn as CodeBlock, xn as Collapsible, b as Combobox, wn as Command, dn as ConditionalWrapper, S as ConfirmDialog, I as Container, Sn as ContextMenu, uo as Controller, Qt as CopyButton, Ao as DEFAULT_CAR_SPEED_KMH, jo as DEFAULT_CIRCUITY_FACTOR, Mo as DEFAULT_MODE_DURATION_FACTORS, Es as DIVERGING_STEP_COUNT, hn as DataList, Pn as DataTable, w as DatePicker, An as DateRangePicker, gn as DescriptionList, T as Divider, E as Drawer, D as DropdownMenu, O as Dropzone, To as EARTH_RADIUS_KM, k as EmptyState, xa as ErrorBoundary, A as ErrorState, pn as ErrorText, _s as FeatureFlagsProvider, j as FileUpload, vr as FilterBar, In as FloatingActionButton, fn as For, M as Form, N as FormActions, Ya as FormField, fo as FormProvider, P as FormRow, F as FormSection, xi as GoogleSignIn, L as Grid, Qi as HashRouter, pt as Hide, Cn as HoverCard, va as I18nProvider, mn as Image, Rt as ImageCropper, C as Input, B as InstallBanner, V as InstallButton, Je as Kanban, Xe as Kbd, bn as Label, Vn as Lightbox, $i as Link, Fn as ListTile, Ro as MERCATOR_MAX_LATITUDE, or as Markdown, fr as Masonry, ea as MemoryRouter, Mn as Menubar, x as Modal, Ze as ModalsProvider, an as Money, so as MoneyInput, kn as MultiSelect, et as NProgressBar, ta as NavLink, $e as Navbar, na as Navigate, jn as NavigationMenu, Ln as NavigationRail, Ht as NotificationCenter, Ds as ORDINAL_START_STEP, Ue as OfflineIndicator, ra as Outlet, nt as Page, rt as Pagination, it as PasswordInput, co as PhoneInput, ot as PinInput, st as Popover, ln as Portal, ct as Progress, qt as QRCapacityError, Zt as QRCode, Di as QueryProvider, wi as REFETCH_TIME, lt as Radio, ut as RadioGroup, dt as RangeSlider, ft as RatingStars, zn as RefreshIndicator, rn as RelativeTime, En as Resizable, ia as Route, Ji as RouteGuard, aa as Routes, Os as SEQUENTIAL_STEP_COUNT, Ti as STALE_TIME, ht as SafeArea, Bt as Scheduler, Tn as ScrollArea, gt as SearchBar, _t as SegmentedControl, vt as Select, mt as Show, yt as Sidebar, Hn as SignaturePad, bt as Skeleton, On as Slider, xt as Spacer, zt as Sparkline, St as Spinner, R as Stack, Ct as Stat, wt as Stepper, Ot as StepperInput, kt as Switch, Ke as SyncStatusBadge, Ko as THEME_STYLE_ID, jt as Table, Mt as Tabs, At as Tag, fs as TelemetryProvider, $r as TempestApiError, zi as TempestDataProvider, Nt as Textarea, ha as ThemeProvider, Rn as TimePicker, Pt as Timeline, It as ToastProvider, _n as Toggle, vn as ToggleGroup, yn as ToggleGroupItem, Ft as Tooltip, pr as Tour, Go as TrajectoryMap, dr as Transfer, on as TreeView, sn as TruncateText, qe as UpdatePrompt, Wt as VirtualList, Kt as VirtualTable, cn as VisuallyHidden, Da as WebPushClient, Oa as WebPushPermissionDeniedError, ka as WebPushUnsupportedError, Bn as Wizard, Xn as aiChatStrings, Ye as applyKanbanMove, qo as applyTheme, lr as applyTransferMove, Br as assertNever, Eo as bearingDeg, Fo as boundingBox, Io as boundsCenter, ei as buildApiError, De as buildOpenInChromeIntent, Ms as cachedResponseBytes, Er as camelCase, Dr as capitalize, Un as chatStrings, Mr as chunk, Tt as clamp, bo as clampLatitude, za as clearCaches, e as cn, Gt as compareValues, us as consoleSink, ms as consoleTelemetryAdapter, Yo as contrastRatio, ni as createApiClient, Va as createAudioPlayer, ci as createAuthStore, Xo as createColorScale, Ri as createDataProvider, Ca as createEventStream, xs as createGrowthBookFeatureFlagsAdapter, _a as createI18n, bs as createInMemoryFlags, Fs as createInferenceProfiler, Ss as createLaunchDarklyFeatureFlagsAdapter, ds as createLogger, Ho as createOSRMBackend, Ii as createOfflineStore, Ga as createOfflineSync, Pa as createPartialResponse, Uo as createPositionTracker, gs as createPostHogTelemetryAdapter, Ei as createQueryKeys, pi as createRefreshQueue, yi as createRoleAccessControl, ma as createSelectors, hs as createSentryTelemetryAdapter, pa as createStore, mi as createTempestAuth, is as createTheme, vo as createWebSocket, Wn as dayLabel, Gr as debounce, ui as decodeJWT, Ir as deepMerge, Xi as defineRoutes, mr as describeFilter, ks as divergingScale, No as durationFactor, Oi as emptyOffsetPage, Jt as encodeQR, at as estimatePasswordStrength, Le as estimateStorage, Po as estimateTravel, Lo as expandBounds, hr as filtersFromSearchParams, gr as filtersToSearchParams, zo as fitProjection, Et as formatBytes, $a as formatCEP, eo as formatCNPJ, yr as formatCPF, Dt as formatCompactNumber, br as formatCurrency, xr as formatDate, Sr as formatDateTime, Ps as formatDurationMs, Cr as formatPercent, wr as formatPhone, oi as generateIdempotencyKey, cs as getInitialTheme, os as getThemePreset, Nr as groupBy, Gn as groupMessages, Do as haversineKm, Zo as hexToOklch, Qo as hexToRgb, $o as hexToRgbaString, Ka as higherVersionWins, Ba as inspectCaches, La as installBackgroundSync, ja as installNotificationClickHandler, Fa as installPrecache, Ma as installPushHandler, Ia as installRuntimeCache, Na as installSkipWaitingListener, Oe as isAndroid, ke as isAndroidWithoutPromptApi, ti as isApiError, xo as isCoordinate, ki as isCursorPage, Vr as isDefined, Lr as isEmpty, Zn as isGenerating, Ae as isIOS, di as isJWTExpired, Hr as isNumber, Ai as isOffsetPage, Ur as isPlainObject, Ta as isPushSupported, Cs as isShareSupported, je as isStandalone, Wr as isString, So as isValidLatitude, Co as isValidLongitude, Or as kebabCase, Qn as lastAssistantId, qa as lastWriteWins, fi as lazyWithRetry, Vi as listQueryKey, Yt as matrixToPath, Kr as memoizeOne, Be as moveItem, wo as normalizeLongitude, tt as nprogress, es as oklchToHex, Rr as omit, qr as once, Hi as oneQueryKey, _r as operatorsFor, ar as parseMarkdown, ri as parseResponse, Oo as pathLengthKm, bi as permissionsFromToken, Li as persistQueryClientOffline, zr as pick, Ha as playAudio, kr as pluralize, Bo as projectMercator, Zr as randomId, Pr as range, Ns as readDeviceProfile, Jo as readThemeToken, ts as readableForeground, oa as redirect, Ra as registerPeriodicSync, Ne as registerServiceWorker, ns as relativeLuminance, Vt as relativeTime, Pi as removeById, Re as requestPersistentStorage, $t as resolveLanguage, ai as retry, rs as rgbToHex, $n as roleLabel, ir as safeLinkUrl, As as scaleSteps, Xt as selectMode, js as sequentialScale, ws as share, Ts as shareOrDownloadBlob, Pe as skipWaiting, Yr as sleep, Ar as slugify, ur as splitTransferSides, Ua as stopAudio, Tr as storage, er as tailSignature, as as themeContrast, ls as themeInitScript, ss as themePresets, Jr as throttle, Kn as timeLabel, ko as toRadians, en as tokenize, tn as tokenizeLines, jr as truncate, tr as turnTime, qn as typingLabel, Fr as uniqueBy, to as unmask, Vo as unprojectMercator, Fe as unregisterAllServiceWorkers, ii as uploadWithProgress, Fi as upsertById, Ea as urlBase64ToUint8Array, gi as useAccessControl, Y as useAsync, Wa as useAudio, z as useBeforeInstallPrompt, a as useBreakpoint, _i as useCan, Ce as useClickOutside, W as useClientFilter, ee as useClipboard, _e as useCounter, Ui as useCreate, Mi as useCursorQuery, Bi as useDataProvider, H as useDebounce, se as useDeepMemo, Wi as useDelete, he as useDisclosure, ve as useDocumentTitle, Z as useDocumentVisibility, Ja as useErrorHandler, K as useEventListener, wa as useEventStream, ye as useFavicon, vs as useFeatureFlag, po as useFieldArray, ys as useFlagValue, ae as useFocusTrap, mo as useForm, ho as useFormContext, go as useFormState, re as useGeolocation, pe as useHover, ya as useI18n, ne as useIdle, Me as useInstallPrompt, Q as useIntersectionObserver, le as useInterval, we as useIsFirstRender, te as useKeyboardShortcut, Gi as useList, ge as useListState, q as useLocalStorage, sa as useLocation, me as useLongPress, Ee as useLongPressHandlers, be as useMap, ca as useMatch, G as useMediaQuery, Qe as useModals, la as useNavigate, Ut as useNotificationInbox, Si as useOAuthCallback, Te as useObjectUrl, Ni as useOfflineMutation, We as useOfflineSync, Ki as useOne, X as useOnline, ji as usePaginatedQuery, U as usePagination, ua as useParams, si as usePoll, Wo as usePositionTracker, ce as usePrevious, Aa as usePushSubscription, Se as useQueue, $ as useResizeObserver, da as useRouteError, ie as useScrollLock, He as useScrollOverflow, fa as useSearchParams, Ie as useServiceWorkerUpdate, xe as useSet, Ve as useSortable, oe as useStableCallback, ze as useStorageEstimate, Ge as useSyncStatus, ps as useTelemetry, ga as useTheme, de as useThrottle, ue as useTimeout, Lt as useToast, J as useToggle, ba as useTranslate, qi as useUpdate, lo as useViaCEP, _o as useWatch, yo as useWebSocket, fe as useWindowSize, Qa as useZodForm, no as validateCNPJ, ro as validateCPF, Xa as validateForm, nr as visibleTurns, Xr as withTimeout, Qr as writeXlsx, Za as zodResolver };
@@ -0,0 +1,2 @@
1
+ var e=class{_last;_speed={load:0,preprocess:0,inference:0,postprocess:0};constructor(){this._last=performance.now()}stage(e){let t=performance.now();this._speed[e]+=t-this._last,this._last=t}speed(){return{...this._speed}}};exports.SpeedTimer=e;
2
+ //# sourceMappingURL=timing.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timing.cjs","names":[],"sources":["../../../src/vision/core/timing.ts"],"sourcesContent":["/**\n * Per-stage timing for a single `predict()` call.\n *\n * Populates the `speed` field every `Results` envelope carries, mirroring\n * Ultralytics' `results[0].speed`. All values are milliseconds measured with\n * `performance.now()`.\n */\n\n/**\n * Stage durations of one inference, in milliseconds.\n *\n * `preprocess`, `inference` and `postprocess` are the three keys Ultralytics\n * reports, measured over the same boundaries. `load` is specific to this SDK:\n * `predict()` accepts a URL, `Blob` or DOM element and decodes it internally,\n * so the fetch/decode cost would otherwise be invisible — and on a cold cache\n * it dominates everything else.\n */\nexport interface Speed {\n /** Fetching and decoding the input into an `RGBImage`. */\n load: number;\n /** Letterbox/resize, normalization and tensor packing. */\n preprocess: number;\n /** The ONNX Runtime forward pass. */\n inference: number;\n /** Decoding raw outputs into results (NMS, mask assembly, top-k). */\n postprocess: number;\n}\n\n/**\n * Accumulate stage durations while a `predict()` call runs.\n *\n * Each `stage()` call closes the previous stage: the elapsed time since the\n * last boundary is attributed to the name given. This keeps the call sites\n * free of paired start/stop bookkeeping and guarantees the four stages tile\n * the whole call without gaps.\n */\nexport class SpeedTimer {\n private _last: number;\n private readonly _speed: Speed = {\n load: 0,\n preprocess: 0,\n inference: 0,\n postprocess: 0,\n };\n\n constructor() {\n this._last = performance.now();\n }\n\n /**\n * Attribute the time elapsed since the previous boundary to `stage`.\n *\n * @param stage Which stage just finished.\n */\n stage(stage: keyof Speed): void {\n const now = performance.now();\n this._speed[stage] += now - this._last;\n this._last = now;\n }\n\n /**\n * The accumulated durations.\n *\n * @returns The `speed` object to hand to the `Results` envelope.\n */\n speed(): Speed {\n return { ...this._speed };\n }\n}\n"],"mappings":"AAoCA,IAAa,EAAb,KAAwB,CACpB,MACA,OAAiC,CAC7B,KAAM,EACN,WAAY,EACZ,UAAW,EACX,YAAa,CACjB,EAEA,aAAc,CACV,KAAK,MAAQ,YAAY,IAAI,CACjC,CAOA,MAAM,EAA0B,CAC5B,IAAM,EAAM,YAAY,IAAI,EAC5B,KAAK,OAAO,IAAU,EAAM,KAAK,MACjC,KAAK,MAAQ,CACjB,CAOA,OAAe,CACX,MAAO,CAAE,GAAG,KAAK,MAAO,CAC5B,CACJ"}
@@ -0,0 +1,24 @@
1
+ //#region src/vision/core/timing.ts
2
+ var e = class {
3
+ _last;
4
+ _speed = {
5
+ load: 0,
6
+ preprocess: 0,
7
+ inference: 0,
8
+ postprocess: 0
9
+ };
10
+ constructor() {
11
+ this._last = performance.now();
12
+ }
13
+ stage(e) {
14
+ let t = performance.now();
15
+ this._speed[e] += t - this._last, this._last = t;
16
+ }
17
+ speed() {
18
+ return { ...this._speed };
19
+ }
20
+ };
21
+ //#endregion
22
+ export { e as SpeedTimer };
23
+
24
+ //# sourceMappingURL=timing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timing.js","names":[],"sources":["../../../src/vision/core/timing.ts"],"sourcesContent":["/**\n * Per-stage timing for a single `predict()` call.\n *\n * Populates the `speed` field every `Results` envelope carries, mirroring\n * Ultralytics' `results[0].speed`. All values are milliseconds measured with\n * `performance.now()`.\n */\n\n/**\n * Stage durations of one inference, in milliseconds.\n *\n * `preprocess`, `inference` and `postprocess` are the three keys Ultralytics\n * reports, measured over the same boundaries. `load` is specific to this SDK:\n * `predict()` accepts a URL, `Blob` or DOM element and decodes it internally,\n * so the fetch/decode cost would otherwise be invisible — and on a cold cache\n * it dominates everything else.\n */\nexport interface Speed {\n /** Fetching and decoding the input into an `RGBImage`. */\n load: number;\n /** Letterbox/resize, normalization and tensor packing. */\n preprocess: number;\n /** The ONNX Runtime forward pass. */\n inference: number;\n /** Decoding raw outputs into results (NMS, mask assembly, top-k). */\n postprocess: number;\n}\n\n/**\n * Accumulate stage durations while a `predict()` call runs.\n *\n * Each `stage()` call closes the previous stage: the elapsed time since the\n * last boundary is attributed to the name given. This keeps the call sites\n * free of paired start/stop bookkeeping and guarantees the four stages tile\n * the whole call without gaps.\n */\nexport class SpeedTimer {\n private _last: number;\n private readonly _speed: Speed = {\n load: 0,\n preprocess: 0,\n inference: 0,\n postprocess: 0,\n };\n\n constructor() {\n this._last = performance.now();\n }\n\n /**\n * Attribute the time elapsed since the previous boundary to `stage`.\n *\n * @param stage Which stage just finished.\n */\n stage(stage: keyof Speed): void {\n const now = performance.now();\n this._speed[stage] += now - this._last;\n this._last = now;\n }\n\n /**\n * The accumulated durations.\n *\n * @returns The `speed` object to hand to the `Results` envelope.\n */\n speed(): Speed {\n return { ...this._speed };\n }\n}\n"],"mappings":";AAoCA,IAAa,IAAb,MAAwB;CACpB;CACA,SAAiC;EAC7B,MAAM;EACN,YAAY;EACZ,WAAW;EACX,aAAa;CACjB;CAEA,cAAc;EACV,KAAK,QAAQ,YAAY,IAAI;CACjC;CAOA,MAAM,GAA0B;EAC5B,IAAM,IAAM,YAAY,IAAI;EAE5B,AADA,KAAK,OAAO,MAAU,IAAM,KAAK,OACjC,KAAK,QAAQ;CACjB;CAOA,QAAe;EACX,OAAO,EAAE,GAAG,KAAK,OAAO;CAC5B;AACJ"}
@@ -1,2 +1,2 @@
1
- const e=require("./core/exceptions.cjs"),t=require("./types.cjs"),n=require("./results.cjs"),r=require("./labels.cjs"),i=require("./core/providers.cjs"),a=require("./core/session.cjs"),o=require("./io/image.cjs"),s=require("./preprocess/image.cjs"),c=require("./postprocess/classification.cjs"),l=require("./postprocess/detection.cjs"),u=require("./postprocess/segmentation.cjs"),d=require("./tasks/base.cjs"),f=require("./tasks/classifier.cjs"),p=require("./tasks/detector.cjs"),m=require("./tasks/segmenter.cjs");var h=`0.2.1`;exports.BoundingBox=t.BoundingBox,exports.Boxes=n.Boxes,exports.COCO_CLASSES=r.COCO_CLASSES,exports.ClassificationResults=n.ClassificationResults,exports.Classifier=f.Classifier,exports.DEFAULT_PROVIDERS=i.DEFAULT_PROVIDERS,exports.DetectionResults=n.DetectionResults,exports.Detector=p.Detector,exports.ImageLoadError=e.ImageLoadError,exports.InferenceError=e.InferenceError,exports.LabelMapError=e.LabelMapError,exports.Mask=t.Mask,exports.Masks=n.Masks,exports.ModelLoadError=e.ModelLoadError,exports.OrtSession=a.OrtSession,exports.OrtVisionError=e.OrtVisionError,exports.Probs=n.Probs,exports.ProviderNotAvailableError=e.ProviderNotAvailableError,exports.RGBImage=t.RGBImage,exports.SegmentationResults=n.SegmentationResults,exports.Segmenter=m.Segmenter,exports.VERSION=h,exports.VisionTask=d.VisionTask,exports.batchedNms=l.batchedNms,exports.decodeYolo=l.decodeYolo,exports.decodeYoloAnchors=l.decodeYoloAnchors,exports.decodeYoloSeg=u.decodeYoloSeg,exports.decodeYoloV8=l.decodeYoloV8,exports.decodeYoloV8Anchors=l.decodeYoloV8Anchors,exports.decodeYoloV8Seg=u.decodeYoloV8Seg,exports.fromCv2=s.fromCv2,exports.letterbox=s.letterbox,exports.loadImage=o.loadImage,exports.nms=l.nms,exports.normalize=s.normalize,exports.resize=s.resize,exports.resolveLabels=r.resolveLabels,exports.resolveProviders=i.resolveProviders,exports.softmax=c.softmax,exports.toCHW=s.toCHW,exports.toCv2=s.toCv2,exports.toFloat32=s.toFloat32,exports.toFloat32Tensor=s.toFloat32Tensor,exports.toTensor=s.toTensor,exports.topK=c.topK;
1
+ const e=require("./core/exceptions.cjs"),t=require("./types.cjs"),n=require("./core/timing.cjs"),r=require("./results.cjs"),i=require("./labels.cjs"),a=require("./core/providers.cjs"),o=require("./core/session.cjs"),s=require("./io/image.cjs"),c=require("./preprocess/image.cjs"),l=require("./postprocess/classification.cjs"),u=require("./postprocess/detection.cjs"),d=require("./postprocess/segmentation.cjs"),f=require("./tasks/base.cjs"),p=require("./tasks/classifier.cjs"),m=require("./tasks/detector.cjs"),h=require("./tasks/segmenter.cjs");var g=`0.3.0`;exports.BoundingBox=t.BoundingBox,exports.Boxes=r.Boxes,exports.COCO_CLASSES=i.COCO_CLASSES,exports.ClassificationResults=r.ClassificationResults,exports.Classifier=p.Classifier,exports.DEFAULT_PROVIDERS=a.DEFAULT_PROVIDERS,exports.DetectionResults=r.DetectionResults,exports.Detector=m.Detector,exports.ImageLoadError=e.ImageLoadError,exports.InferenceError=e.InferenceError,exports.LabelMapError=e.LabelMapError,exports.Mask=t.Mask,exports.Masks=r.Masks,exports.ModelLoadError=e.ModelLoadError,exports.OrtSession=o.OrtSession,exports.OrtVisionError=e.OrtVisionError,exports.Probs=r.Probs,exports.ProviderNotAvailableError=e.ProviderNotAvailableError,exports.RGBImage=t.RGBImage,exports.SegmentationResults=r.SegmentationResults,exports.Segmenter=h.Segmenter,exports.SpeedTimer=n.SpeedTimer,exports.VERSION=g,exports.VisionTask=f.VisionTask,exports.batchedNms=u.batchedNms,exports.decodeYolo=u.decodeYolo,exports.decodeYoloAnchors=u.decodeYoloAnchors,exports.decodeYoloSeg=d.decodeYoloSeg,exports.decodeYoloV8=u.decodeYoloV8,exports.decodeYoloV8Anchors=u.decodeYoloV8Anchors,exports.decodeYoloV8Seg=d.decodeYoloV8Seg,exports.fromCv2=c.fromCv2,exports.letterbox=c.letterbox,exports.loadImage=s.loadImage,exports.nms=u.nms,exports.normalize=c.normalize,exports.resize=c.resize,exports.resolveLabels=i.resolveLabels,exports.resolveProviders=a.resolveProviders,exports.softmax=l.softmax,exports.toCHW=c.toCHW,exports.toCv2=c.toCv2,exports.toFloat32=c.toFloat32,exports.toFloat32Tensor=c.toFloat32Tensor,exports.toTensor=c.toTensor,exports.topK=l.topK;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * `tempest-react-sdk/vision` — browser computer-vision inference with ONNX\n * Runtime Web (classification, detection, segmentation).\n *\n * Vendored from `@mauriciobenjamin700/ort-vision-sdk-web@0.2.1` (MIT, same\n * author) so it ships inside this SDK without an extra package install.\n * `onnxruntime-web` stays an optional peer dependency — install it (and ship\n * the matching `.wasm` files) only when you use this subpath.\n *\n * Do not hand-edit — regenerate with `npm run vendor:vision`.\n */\n\nexport {\n BoundingBox,\n Mask,\n RGBImage,\n type ClassProbability,\n type ClassificationResult,\n type DetectionResult,\n type SegmentationResult,\n} from \"./types\";\n\nexport {\n Boxes,\n ClassificationResults,\n DetectionResults,\n Masks,\n Probs,\n SegmentationResults,\n} from \"./results\";\n\nexport { COCO_CLASSES, type LabelSpec, type ResolveLabelsOptions, resolveLabels } from \"./labels\";\n\nexport {\n ImageLoadError,\n InferenceError,\n LabelMapError,\n ModelLoadError,\n OrtVisionError,\n ProviderNotAvailableError,\n} from \"./core/exceptions\";\n\nexport { type ModelSource, type OrtSessionOptions, OrtSession } from \"./core/session\";\nexport { DEFAULT_PROVIDERS, resolveProviders } from \"./core/providers\";\n\nexport { type ImageInput, loadImage } from \"./io/image\";\n\nexport {\n type LetterboxResult,\n fromCv2,\n letterbox,\n normalize,\n resize,\n toCHW,\n toCv2,\n toFloat32,\n toFloat32Tensor,\n toTensor,\n} from \"./preprocess/image\";\n\nexport { type TopKResult, softmax, topK } from \"./postprocess/classification\";\n\nexport {\n type DecodeYoloAnchorsOptions,\n type DecodeYoloOptions,\n type DecodeYoloV8AnchorsOptions,\n type DecodeYoloV8Options,\n type DecodedAnchors,\n type DecodedDetection,\n batchedNms,\n decodeYolo,\n decodeYoloAnchors,\n decodeYoloV8,\n decodeYoloV8Anchors,\n nms,\n} from \"./postprocess/detection\";\n\nexport {\n type DecodeYoloSegOptions,\n type DecodeYoloV8SegOptions,\n type DecodedSegmentation,\n decodeYoloSeg,\n decodeYoloV8Seg,\n} from \"./postprocess/segmentation\";\n\nexport { VisionTask } from \"./tasks/base\";\nexport {\n type ClassifierOptions,\n type ClassifierPredictOptions,\n Classifier,\n} from \"./tasks/classifier\";\nexport {\n type DetectorHead,\n type DetectorOptions,\n type DetectorPredictOptions,\n Detector,\n} from \"./tasks/detector\";\nexport {\n type SegmenterHead,\n type SegmenterOptions,\n type SegmenterPredictOptions,\n Segmenter,\n} from \"./tasks/segmenter\";\n\nexport const VERSION: string = \"0.2.1\";\n"],"mappings":"mgBAwGA,IAAa,EAAkB"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * `tempest-react-sdk/vision` — browser computer-vision inference with ONNX\n * Runtime Web (classification, detection, segmentation).\n *\n * Vendored from `@mauriciobenjamin700/ort-vision-sdk-web@0.3.0` (MIT, same\n * author) so it ships inside this SDK without an extra package install.\n * `onnxruntime-web` stays an optional peer dependency — install it (and ship\n * the matching `.wasm` files) only when you use this subpath.\n *\n * Do not hand-edit — regenerate with `npm run vendor:vision`.\n */\n\nexport {\n BoundingBox,\n Mask,\n RGBImage,\n type ClassProbability,\n type ClassificationResult,\n type DetectionResult,\n type SegmentationResult,\n} from \"./types\";\n\nexport {\n Boxes,\n ClassificationResults,\n DetectionResults,\n Masks,\n Probs,\n SegmentationResults,\n} from \"./results\";\n\nexport { COCO_CLASSES, type LabelSpec, type ResolveLabelsOptions, resolveLabels } from \"./labels\";\n\nexport {\n ImageLoadError,\n InferenceError,\n LabelMapError,\n ModelLoadError,\n OrtVisionError,\n ProviderNotAvailableError,\n} from \"./core/exceptions\";\n\nexport { type ModelSource, type OrtSessionOptions, OrtSession } from \"./core/session\";\nexport { DEFAULT_PROVIDERS, resolveProviders } from \"./core/providers\";\nexport { type Speed, SpeedTimer } from \"./core/timing\";\n\nexport { type ImageInput, loadImage } from \"./io/image\";\n\nexport {\n type LetterboxResult,\n fromCv2,\n letterbox,\n normalize,\n resize,\n toCHW,\n toCv2,\n toFloat32,\n toFloat32Tensor,\n toTensor,\n} from \"./preprocess/image\";\n\nexport { type TopKResult, softmax, topK } from \"./postprocess/classification\";\n\nexport {\n type DecodeYoloAnchorsOptions,\n type DecodeYoloOptions,\n type DecodeYoloV8AnchorsOptions,\n type DecodeYoloV8Options,\n type DecodedAnchors,\n type DecodedDetection,\n batchedNms,\n decodeYolo,\n decodeYoloAnchors,\n decodeYoloV8,\n decodeYoloV8Anchors,\n nms,\n} from \"./postprocess/detection\";\n\nexport {\n type DecodeYoloSegOptions,\n type DecodeYoloV8SegOptions,\n type DecodedSegmentation,\n decodeYoloSeg,\n decodeYoloV8Seg,\n} from \"./postprocess/segmentation\";\n\nexport { VisionTask } from \"./tasks/base\";\nexport {\n type ClassifierOptions,\n type ClassifierPredictOptions,\n Classifier,\n} from \"./tasks/classifier\";\nexport {\n type DetectorHead,\n type DetectorOptions,\n type DetectorPredictOptions,\n Detector,\n} from \"./tasks/detector\";\nexport {\n type SegmenterHead,\n type SegmenterOptions,\n type SegmenterPredictOptions,\n Segmenter,\n} from \"./tasks/segmenter\";\n\nexport const VERSION: string = \"0.3.0\";\n"],"mappings":"kiBAyGA,IAAa,EAAkB"}
@@ -1,21 +1,22 @@
1
1
  import { ImageLoadError as e, InferenceError as t, LabelMapError as n, ModelLoadError as r, OrtVisionError as i, ProviderNotAvailableError as a } from "./core/exceptions.js";
2
2
  import { BoundingBox as o, Mask as s, RGBImage as c } from "./types.js";
3
- import { Boxes as l, ClassificationResults as u, DetectionResults as d, Masks as f, Probs as p, SegmentationResults as m } from "./results.js";
4
- import { COCO_CLASSES as h, resolveLabels as g } from "./labels.js";
5
- import { DEFAULT_PROVIDERS as _, resolveProviders as v } from "./core/providers.js";
6
- import { OrtSession as y } from "./core/session.js";
7
- import { loadImage as b } from "./io/image.js";
8
- import { fromCv2 as x, letterbox as S, normalize as C, resize as w, toCHW as T, toCv2 as E, toFloat32 as D, toFloat32Tensor as O, toTensor as k } from "./preprocess/image.js";
9
- import { softmax as A, topK as j } from "./postprocess/classification.js";
10
- import { batchedNms as M, decodeYolo as N, decodeYoloAnchors as P, decodeYoloV8 as F, decodeYoloV8Anchors as I, nms as L } from "./postprocess/detection.js";
11
- import { decodeYoloSeg as R, decodeYoloV8Seg as z } from "./postprocess/segmentation.js";
12
- import { VisionTask as B } from "./tasks/base.js";
13
- import { Classifier as V } from "./tasks/classifier.js";
14
- import { Detector as H } from "./tasks/detector.js";
15
- import { Segmenter as U } from "./tasks/segmenter.js";
3
+ import { SpeedTimer as l } from "./core/timing.js";
4
+ import { Boxes as u, ClassificationResults as d, DetectionResults as f, Masks as p, Probs as m, SegmentationResults as h } from "./results.js";
5
+ import { COCO_CLASSES as g, resolveLabels as _ } from "./labels.js";
6
+ import { DEFAULT_PROVIDERS as v, resolveProviders as y } from "./core/providers.js";
7
+ import { OrtSession as b } from "./core/session.js";
8
+ import { loadImage as x } from "./io/image.js";
9
+ import { fromCv2 as S, letterbox as C, normalize as w, resize as T, toCHW as E, toCv2 as D, toFloat32 as O, toFloat32Tensor as k, toTensor as A } from "./preprocess/image.js";
10
+ import { softmax as j, topK as M } from "./postprocess/classification.js";
11
+ import { batchedNms as N, decodeYolo as P, decodeYoloAnchors as F, decodeYoloV8 as I, decodeYoloV8Anchors as L, nms as R } from "./postprocess/detection.js";
12
+ import { decodeYoloSeg as z, decodeYoloV8Seg as B } from "./postprocess/segmentation.js";
13
+ import { VisionTask as V } from "./tasks/base.js";
14
+ import { Classifier as H } from "./tasks/classifier.js";
15
+ import { Detector as U } from "./tasks/detector.js";
16
+ import { Segmenter as W } from "./tasks/segmenter.js";
16
17
  //#region src/vision/index.ts
17
- var W = "0.2.1";
18
+ var G = "0.3.0";
18
19
  //#endregion
19
- export { o as BoundingBox, l as Boxes, h as COCO_CLASSES, u as ClassificationResults, V as Classifier, _ as DEFAULT_PROVIDERS, d as DetectionResults, H as Detector, e as ImageLoadError, t as InferenceError, n as LabelMapError, s as Mask, f as Masks, r as ModelLoadError, y as OrtSession, i as OrtVisionError, p as Probs, a as ProviderNotAvailableError, c as RGBImage, m as SegmentationResults, U as Segmenter, W as VERSION, B as VisionTask, M as batchedNms, N as decodeYolo, P as decodeYoloAnchors, R as decodeYoloSeg, F as decodeYoloV8, I as decodeYoloV8Anchors, z as decodeYoloV8Seg, x as fromCv2, S as letterbox, b as loadImage, L as nms, C as normalize, w as resize, g as resolveLabels, v as resolveProviders, A as softmax, T as toCHW, E as toCv2, D as toFloat32, O as toFloat32Tensor, k as toTensor, j as topK };
20
+ export { o as BoundingBox, u as Boxes, g as COCO_CLASSES, d as ClassificationResults, H as Classifier, v as DEFAULT_PROVIDERS, f as DetectionResults, U as Detector, e as ImageLoadError, t as InferenceError, n as LabelMapError, s as Mask, p as Masks, r as ModelLoadError, b as OrtSession, i as OrtVisionError, m as Probs, a as ProviderNotAvailableError, c as RGBImage, h as SegmentationResults, W as Segmenter, l as SpeedTimer, G as VERSION, V as VisionTask, N as batchedNms, P as decodeYolo, F as decodeYoloAnchors, z as decodeYoloSeg, I as decodeYoloV8, L as decodeYoloV8Anchors, B as decodeYoloV8Seg, S as fromCv2, C as letterbox, x as loadImage, R as nms, w as normalize, T as resize, _ as resolveLabels, y as resolveProviders, j as softmax, E as toCHW, D as toCv2, O as toFloat32, k as toFloat32Tensor, A as toTensor, M as topK };
20
21
 
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * `tempest-react-sdk/vision` — browser computer-vision inference with ONNX\n * Runtime Web (classification, detection, segmentation).\n *\n * Vendored from `@mauriciobenjamin700/ort-vision-sdk-web@0.2.1` (MIT, same\n * author) so it ships inside this SDK without an extra package install.\n * `onnxruntime-web` stays an optional peer dependency — install it (and ship\n * the matching `.wasm` files) only when you use this subpath.\n *\n * Do not hand-edit — regenerate with `npm run vendor:vision`.\n */\n\nexport {\n BoundingBox,\n Mask,\n RGBImage,\n type ClassProbability,\n type ClassificationResult,\n type DetectionResult,\n type SegmentationResult,\n} from \"./types\";\n\nexport {\n Boxes,\n ClassificationResults,\n DetectionResults,\n Masks,\n Probs,\n SegmentationResults,\n} from \"./results\";\n\nexport { COCO_CLASSES, type LabelSpec, type ResolveLabelsOptions, resolveLabels } from \"./labels\";\n\nexport {\n ImageLoadError,\n InferenceError,\n LabelMapError,\n ModelLoadError,\n OrtVisionError,\n ProviderNotAvailableError,\n} from \"./core/exceptions\";\n\nexport { type ModelSource, type OrtSessionOptions, OrtSession } from \"./core/session\";\nexport { DEFAULT_PROVIDERS, resolveProviders } from \"./core/providers\";\n\nexport { type ImageInput, loadImage } from \"./io/image\";\n\nexport {\n type LetterboxResult,\n fromCv2,\n letterbox,\n normalize,\n resize,\n toCHW,\n toCv2,\n toFloat32,\n toFloat32Tensor,\n toTensor,\n} from \"./preprocess/image\";\n\nexport { type TopKResult, softmax, topK } from \"./postprocess/classification\";\n\nexport {\n type DecodeYoloAnchorsOptions,\n type DecodeYoloOptions,\n type DecodeYoloV8AnchorsOptions,\n type DecodeYoloV8Options,\n type DecodedAnchors,\n type DecodedDetection,\n batchedNms,\n decodeYolo,\n decodeYoloAnchors,\n decodeYoloV8,\n decodeYoloV8Anchors,\n nms,\n} from \"./postprocess/detection\";\n\nexport {\n type DecodeYoloSegOptions,\n type DecodeYoloV8SegOptions,\n type DecodedSegmentation,\n decodeYoloSeg,\n decodeYoloV8Seg,\n} from \"./postprocess/segmentation\";\n\nexport { VisionTask } from \"./tasks/base\";\nexport {\n type ClassifierOptions,\n type ClassifierPredictOptions,\n Classifier,\n} from \"./tasks/classifier\";\nexport {\n type DetectorHead,\n type DetectorOptions,\n type DetectorPredictOptions,\n Detector,\n} from \"./tasks/detector\";\nexport {\n type SegmenterHead,\n type SegmenterOptions,\n type SegmenterPredictOptions,\n Segmenter,\n} from \"./tasks/segmenter\";\n\nexport const VERSION: string = \"0.2.1\";\n"],"mappings":";;;;;;;;;;;;;;;;AAwGA,IAAa,IAAkB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * `tempest-react-sdk/vision` — browser computer-vision inference with ONNX\n * Runtime Web (classification, detection, segmentation).\n *\n * Vendored from `@mauriciobenjamin700/ort-vision-sdk-web@0.3.0` (MIT, same\n * author) so it ships inside this SDK without an extra package install.\n * `onnxruntime-web` stays an optional peer dependency — install it (and ship\n * the matching `.wasm` files) only when you use this subpath.\n *\n * Do not hand-edit — regenerate with `npm run vendor:vision`.\n */\n\nexport {\n BoundingBox,\n Mask,\n RGBImage,\n type ClassProbability,\n type ClassificationResult,\n type DetectionResult,\n type SegmentationResult,\n} from \"./types\";\n\nexport {\n Boxes,\n ClassificationResults,\n DetectionResults,\n Masks,\n Probs,\n SegmentationResults,\n} from \"./results\";\n\nexport { COCO_CLASSES, type LabelSpec, type ResolveLabelsOptions, resolveLabels } from \"./labels\";\n\nexport {\n ImageLoadError,\n InferenceError,\n LabelMapError,\n ModelLoadError,\n OrtVisionError,\n ProviderNotAvailableError,\n} from \"./core/exceptions\";\n\nexport { type ModelSource, type OrtSessionOptions, OrtSession } from \"./core/session\";\nexport { DEFAULT_PROVIDERS, resolveProviders } from \"./core/providers\";\nexport { type Speed, SpeedTimer } from \"./core/timing\";\n\nexport { type ImageInput, loadImage } from \"./io/image\";\n\nexport {\n type LetterboxResult,\n fromCv2,\n letterbox,\n normalize,\n resize,\n toCHW,\n toCv2,\n toFloat32,\n toFloat32Tensor,\n toTensor,\n} from \"./preprocess/image\";\n\nexport { type TopKResult, softmax, topK } from \"./postprocess/classification\";\n\nexport {\n type DecodeYoloAnchorsOptions,\n type DecodeYoloOptions,\n type DecodeYoloV8AnchorsOptions,\n type DecodeYoloV8Options,\n type DecodedAnchors,\n type DecodedDetection,\n batchedNms,\n decodeYolo,\n decodeYoloAnchors,\n decodeYoloV8,\n decodeYoloV8Anchors,\n nms,\n} from \"./postprocess/detection\";\n\nexport {\n type DecodeYoloSegOptions,\n type DecodeYoloV8SegOptions,\n type DecodedSegmentation,\n decodeYoloSeg,\n decodeYoloV8Seg,\n} from \"./postprocess/segmentation\";\n\nexport { VisionTask } from \"./tasks/base\";\nexport {\n type ClassifierOptions,\n type ClassifierPredictOptions,\n Classifier,\n} from \"./tasks/classifier\";\nexport {\n type DetectorHead,\n type DetectorOptions,\n type DetectorPredictOptions,\n Detector,\n} from \"./tasks/detector\";\nexport {\n type SegmenterHead,\n type SegmenterOptions,\n type SegmenterPredictOptions,\n Segmenter,\n} from \"./tasks/segmenter\";\n\nexport const VERSION: string = \"0.3.0\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAyGA,IAAa,IAAkB"}
@@ -1,2 +1,2 @@
1
- const e=require("../types.cjs");function t(e,t,n){let r=t.length;if(r===0)return new Int32Array;let i=new Float32Array(r);for(let t=0;t<r;t++){let n=e[t*4],r=e[t*4+1],a=e[t*4+2],o=e[t*4+3];i[t]=Math.max(0,a-n)*Math.max(0,o-r)}let a=Array(r);for(let e=0;e<r;e++)a[e]=e;a.sort((e,n)=>t[n]-t[e]);let o=new Uint8Array(r),s=[];for(let t=0;t<a.length;t++){let r=a[t];if(o[r])continue;s.push(r);let c=e[r*4],l=e[r*4+1],u=e[r*4+2],d=e[r*4+3],f=i[r];for(let r=t+1;r<a.length;r++){let t=a[r];if(o[t])continue;let s=e[t*4],p=e[t*4+1],m=e[t*4+2],h=e[t*4+3],g=Math.max(c,s),_=Math.max(l,p),v=Math.min(u,m),y=Math.min(d,h),b=Math.max(0,v-g)*Math.max(0,y-_),x=f+i[t]-b;(x>0?b/x:0)>n&&(o[t]=1)}}return Int32Array.from(s)}function n(e,n,r,i){if(n.length===0)return new Int32Array;let a=new Map;for(let e=0;e<r.length;e++){let t=r[e],n=a.get(t);n===void 0?a.set(t,[e]):n.push(e)}let o=[];for(let r of a.values()){let a=r.length,s=new Float32Array(a*4),c=new Float32Array(a);for(let t=0;t<a;t++){let i=r[t];s[t*4]=e[i*4],s[t*4+1]=e[i*4+1],s[t*4+2]=e[i*4+2],s[t*4+3]=e[i*4+3],c[t]=n[i]}let l=t(s,c,i);for(let e=0;e<l.length;e++)o.push(r[l[e]])}return o.sort((e,t)=>n[t]-n[e]),Int32Array.from(o)}function r(e,t,r){let a=t;if(a.length===3){if(a[0]!==1)throw Error(`decodeYoloAnchors: expected batch size 1, got ${a[0]}.`);a=[a[1],a[2]]}if(a.length!==2)throw Error(`decodeYoloAnchors: expected 2-D output after batch removal, got dims=${JSON.stringify(t)}.`);let o=a[0],s=a[1],{numClasses:c,originalWidth:l,originalHeight:u,padLeft:d,padTop:f,scale:p,confThreshold:m,iouThreshold:h,maxDetections:g}=r;if(c<1||c+4>o)throw Error(`decodeYoloAnchors: invalid numClasses=${c} for channels=${o}.`);if(e.length!==o*s)throw Error(`decodeYoloAnchors: data length ${e.length} does not match channels*numAnchors=${o*s}.`);let _=[];for(let t=0;t<s;t++){let n=0,r=-1/0;for(let i=0;i<c;i++){let a=e[(4+i)*s+t];a!==void 0&&a>r&&(r=a,n=i)}if(r<m)continue;let i=e[t],a=e[s+t],o=e[2*s+t],h=e[3*s+t],g=i-o/2,v=a-h/2,y=i+o/2,b=a+h/2;g=(g-d)/p,v=(v-f)/p,y=(y-d)/p,b=(b-f)/p,g=Math.max(0,Math.min(l,g)),v=Math.max(0,Math.min(u,v)),y=Math.max(0,Math.min(l,y)),b=Math.max(0,Math.min(u,b)),_.push({anchorIdx:t,x1:g,y1:v,x2:y,y2:b,classId:n,confidence:r})}if(_.length===0)return i();let v=new Float32Array(_.length*4),y=new Float32Array(_.length),b=new Int32Array(_.length);for(let e=0;e<_.length;e++){let t=_[e];v[e*4]=t.x1,v[e*4+1]=t.y1,v[e*4+2]=t.x2,v[e*4+3]=t.y2,y[e]=t.confidence,b[e]=t.classId}let x=n(v,y,b,h);if(x.length===0)return i();let S=Array.from(x).slice(0,g),C=S.length,w=new Int32Array(C),T=new Float32Array(C*4),E=new Int32Array(C),D=new Float32Array(C);for(let e=0;e<C;e++){let t=_[S[e]];w[e]=t.anchorIdx,T[e*4]=t.x1,T[e*4+1]=t.y1,T[e*4+2]=t.x2,T[e*4+3]=t.y2,E[e]=t.classId,D[e]=t.confidence}return{anchorIndices:w,boxesXyxy:T,classIds:E,confidences:D}}function i(){return{anchorIndices:new Int32Array,boxesXyxy:new Float32Array,classIds:new Int32Array,confidences:new Float32Array}}function a(t,n,i){let a=n.length===3?n[1]:n[0];if(a===void 0||a<5)throw Error(`decodeYolo: invalid output channel count ${a} (expected >= 5).`);let o=r(t,n,{numClasses:a-4,...i}),s=[];for(let t=0;t<o.classIds.length;t++)s.push({bbox:new e.BoundingBox(o.boxesXyxy[t*4],o.boxesXyxy[t*4+1],o.boxesXyxy[t*4+2],o.boxesXyxy[t*4+3]),classId:o.classIds[t],confidence:o.confidences[t]});return s}var o=!1,s=!1;function c(e,t,n){return o||(o=!0,console.warn(`[@ort-vision-sdk/web] decodeYoloV8 is deprecated since 0.2.0; use decodeYolo. The alias will be removed in 0.3.0.`)),a(e,t,n)}function l(e,t,n){return s||(s=!0,console.warn(`[@ort-vision-sdk/web] decodeYoloV8Anchors is deprecated since 0.2.0; use decodeYoloAnchors. The alias will be removed in 0.3.0.`)),r(e,t,n)}exports.batchedNms=n,exports.decodeYolo=a,exports.decodeYoloAnchors=r,exports.decodeYoloV8=c,exports.decodeYoloV8Anchors=l,exports.nms=t;
1
+ const e=require("../types.cjs");function t(e,t,n){let r=t.length;if(r===0)return new Int32Array;let i=new Float32Array(r);for(let t=0;t<r;t++){let n=e[t*4],r=e[t*4+1],a=e[t*4+2],o=e[t*4+3];i[t]=Math.max(0,a-n)*Math.max(0,o-r)}let a=Array(r);for(let e=0;e<r;e++)a[e]=e;a.sort((e,n)=>t[n]-t[e]);let o=new Uint8Array(r),s=[];for(let t=0;t<a.length;t++){let r=a[t];if(o[r])continue;s.push(r);let c=e[r*4],l=e[r*4+1],u=e[r*4+2],d=e[r*4+3],f=i[r];for(let r=t+1;r<a.length;r++){let t=a[r];if(o[t])continue;let s=e[t*4],p=e[t*4+1],m=e[t*4+2],h=e[t*4+3],g=Math.max(c,s),_=Math.max(l,p),v=Math.min(u,m),y=Math.min(d,h),b=Math.max(0,v-g)*Math.max(0,y-_),x=f+i[t]-b;(x>0?b/x:0)>n&&(o[t]=1)}}return Int32Array.from(s)}function n(e,n,r,i){if(n.length===0)return new Int32Array;let a=new Map;for(let e=0;e<r.length;e++){let t=r[e],n=a.get(t);n===void 0?a.set(t,[e]):n.push(e)}let o=[];for(let r of a.values()){let a=r.length,s=new Float32Array(a*4),c=new Float32Array(a);for(let t=0;t<a;t++){let i=r[t];s[t*4]=e[i*4],s[t*4+1]=e[i*4+1],s[t*4+2]=e[i*4+2],s[t*4+3]=e[i*4+3],c[t]=n[i]}let l=t(s,c,i);for(let e=0;e<l.length;e++)o.push(r[l[e]])}return o.sort((e,t)=>n[t]-n[e]),Int32Array.from(o)}function r(e,t,r){let a=t;if(a.length===3){if(a[0]!==1)throw Error(`decodeYoloAnchors: expected batch size 1, got ${a[0]}.`);a=[a[1],a[2]]}if(a.length!==2)throw Error(`decodeYoloAnchors: expected 2-D output after batch removal, got dims=${JSON.stringify(t)}.`);let o=a[0],s=a[1],{numClasses:c,originalWidth:l,originalHeight:u,padLeft:d,padTop:f,scale:p,confThreshold:m,iouThreshold:h,maxDetections:g}=r;if(c<1||c+4>o)throw Error(`decodeYoloAnchors: invalid numClasses=${c} for channels=${o}.`);if(e.length!==o*s)throw Error(`decodeYoloAnchors: data length ${e.length} does not match channels*numAnchors=${o*s}.`);let _=[];for(let t=0;t<s;t++){let n=0,r=-1/0;for(let i=0;i<c;i++){let a=e[(4+i)*s+t];a!==void 0&&a>r&&(r=a,n=i)}if(r<m)continue;let i=e[t],a=e[s+t],o=e[2*s+t],h=e[3*s+t],g=i-o/2,v=a-h/2,y=i+o/2,b=a+h/2;g=(g-d)/p,v=(v-f)/p,y=(y-d)/p,b=(b-f)/p,g=Math.max(0,Math.min(l,g)),v=Math.max(0,Math.min(u,v)),y=Math.max(0,Math.min(l,y)),b=Math.max(0,Math.min(u,b)),_.push({anchorIdx:t,x1:g,y1:v,x2:y,y2:b,classId:n,confidence:r})}if(_.length===0)return i();let v=new Float32Array(_.length*4),y=new Float32Array(_.length),b=new Int32Array(_.length);for(let e=0;e<_.length;e++){let t=_[e];v[e*4]=t.x1,v[e*4+1]=t.y1,v[e*4+2]=t.x2,v[e*4+3]=t.y2,y[e]=t.confidence,b[e]=t.classId}let x=n(v,y,b,h);if(x.length===0)return i();let S=Array.from(x).slice(0,g),C=S.length,w=new Int32Array(C),T=new Float32Array(C*4),E=new Int32Array(C),D=new Float32Array(C);for(let e=0;e<C;e++){let t=_[S[e]];w[e]=t.anchorIdx,T[e*4]=t.x1,T[e*4+1]=t.y1,T[e*4+2]=t.x2,T[e*4+3]=t.y2,E[e]=t.classId,D[e]=t.confidence}return{anchorIndices:w,boxesXyxy:T,classIds:E,confidences:D}}function i(){return{anchorIndices:new Int32Array,boxesXyxy:new Float32Array,classIds:new Int32Array,confidences:new Float32Array}}function a(t,n,i){let a=n.length===3?n[1]:n[0];if(a===void 0||a<5)throw Error(`decodeYolo: invalid output channel count ${a} (expected >= 5).`);let o=r(t,n,{numClasses:a-4,...i}),s=[];for(let t=0;t<o.classIds.length;t++)s.push({bbox:new e.BoundingBox(o.boxesXyxy[t*4],o.boxesXyxy[t*4+1],o.boxesXyxy[t*4+2],o.boxesXyxy[t*4+3]),classId:o.classIds[t],confidence:o.confidences[t]});return s}var o=!1,s=!1;function c(e,t,n){return o||(o=!0,console.warn(`[@ort-vision-sdk/web] decodeYoloV8 is deprecated since 0.2.0; use decodeYolo. The alias will be removed in 0.4.0.`)),a(e,t,n)}function l(e,t,n){return s||(s=!0,console.warn(`[@ort-vision-sdk/web] decodeYoloV8Anchors is deprecated since 0.2.0; use decodeYoloAnchors. The alias will be removed in 0.4.0.`)),r(e,t,n)}exports.batchedNms=n,exports.decodeYolo=a,exports.decodeYoloAnchors=r,exports.decodeYoloV8=c,exports.decodeYoloV8Anchors=l,exports.nms=t;
2
2
  //# sourceMappingURL=detection.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"detection.cjs","names":[],"sources":["../../../src/vision/postprocess/detection.ts"],"sourcesContent":["/**\n * Detection head postprocessing: anchor-free YOLO decoding + non-maximum suppression.\n *\n * The shared {@link decodeYoloAnchors} helper does the per-anchor work that\n * is identical for plain detection and segmentation (transpose, xywh→xyxy,\n * letterbox unmap, per-class NMS, sort & cap). {@link decodeYolo} is a thin\n * wrapper around it; the segmentation module ({@link ./segmentation.js})\n * calls the helper directly so it can also recover the per-anchor mask\n * coefficients.\n *\n * Works for any YOLO export with the post-v8 anchor-free head:\n * **YOLOv8 / v9 / v10 / v11 / v12** detect heads, all of which share the\n * `[1, 4 + nc, N]` output layout.\n */\n\nimport { BoundingBox } from \"../types\";\n\n/**\n * Greedy non-maximum suppression on axis-aligned bounding boxes.\n *\n * Mirrors `torchvision.ops.nms` (keeps boxes with the highest score, drops\n * any subsequent box whose IoU exceeds the threshold).\n *\n * @param boxes Flat array of length `4 * N` in xyxy order: `[x1,y1,x2,y2, ...]`.\n * @param scores Detection score per box, length `N`.\n * @param iouThreshold Boxes with IoU above this threshold relative to a kept box are suppressed.\n * @returns Indices of kept boxes, in descending score order.\n */\nexport function nms(boxes: Float32Array, scores: Float32Array, iouThreshold: number): Int32Array {\n const n = scores.length;\n if (n === 0) return new Int32Array(0);\n\n const areas = new Float32Array(n);\n for (let i = 0; i < n; i++) {\n const x1 = boxes[i * 4] as number;\n const y1 = boxes[i * 4 + 1] as number;\n const x2 = boxes[i * 4 + 2] as number;\n const y2 = boxes[i * 4 + 3] as number;\n areas[i] = Math.max(0, x2 - x1) * Math.max(0, y2 - y1);\n }\n\n const order = new Array<number>(n);\n for (let i = 0; i < n; i++) order[i] = i;\n order.sort((a, b) => (scores[b] as number) - (scores[a] as number));\n\n const suppressed = new Uint8Array(n);\n const keep: number[] = [];\n\n for (let oi = 0; oi < order.length; oi++) {\n const i = order[oi] as number;\n if (suppressed[i]) continue;\n keep.push(i);\n\n const ax1 = boxes[i * 4] as number;\n const ay1 = boxes[i * 4 + 1] as number;\n const ax2 = boxes[i * 4 + 2] as number;\n const ay2 = boxes[i * 4 + 3] as number;\n const ai = areas[i] as number;\n\n for (let oj = oi + 1; oj < order.length; oj++) {\n const j = order[oj] as number;\n if (suppressed[j]) continue;\n\n const bx1 = boxes[j * 4] as number;\n const by1 = boxes[j * 4 + 1] as number;\n const bx2 = boxes[j * 4 + 2] as number;\n const by2 = boxes[j * 4 + 3] as number;\n\n const ix1 = Math.max(ax1, bx1);\n const iy1 = Math.max(ay1, by1);\n const ix2 = Math.min(ax2, bx2);\n const iy2 = Math.min(ay2, by2);\n const iw = Math.max(0, ix2 - ix1);\n const ih = Math.max(0, iy2 - iy1);\n const inter = iw * ih;\n const union = ai + (areas[j] as number) - inter;\n const iou = union > 0 ? inter / union : 0;\n if (iou > iouThreshold) suppressed[j] = 1;\n }\n }\n\n return Int32Array.from(keep);\n}\n\n/**\n * Per-class NMS — boxes are suppressed only by other boxes of the same class.\n *\n * Mirrors `torchvision.ops.batched_nms`.\n *\n * @param boxes Flat array of length `4 * N` in xyxy order.\n * @param scores Detection score per box, length `N`.\n * @param idxs Class index per box, length `N`. Boxes with different `idxs`\n * never suppress each other.\n * @param iouThreshold IoU threshold for suppression within a class.\n */\nexport function batchedNms(\n boxes: Float32Array,\n scores: Float32Array,\n idxs: Int32Array,\n iouThreshold: number,\n): Int32Array {\n if (scores.length === 0) return new Int32Array(0);\n\n const byClass = new Map<number, number[]>();\n for (let i = 0; i < idxs.length; i++) {\n const c = idxs[i] as number;\n const list = byClass.get(c);\n if (list === undefined) byClass.set(c, [i]);\n else list.push(i);\n }\n\n const keep: number[] = [];\n for (const indices of byClass.values()) {\n const m = indices.length;\n const subBoxes = new Float32Array(m * 4);\n const subScores = new Float32Array(m);\n for (let k = 0; k < m; k++) {\n const i = indices[k] as number;\n subBoxes[k * 4] = boxes[i * 4] as number;\n subBoxes[k * 4 + 1] = boxes[i * 4 + 1] as number;\n subBoxes[k * 4 + 2] = boxes[i * 4 + 2] as number;\n subBoxes[k * 4 + 3] = boxes[i * 4 + 3] as number;\n subScores[k] = scores[i] as number;\n }\n const subKeep = nms(subBoxes, subScores, iouThreshold);\n for (let k = 0; k < subKeep.length; k++) {\n keep.push(indices[subKeep[k] as number] as number);\n }\n }\n\n keep.sort((a, b) => (scores[b] as number) - (scores[a] as number));\n return Int32Array.from(keep);\n}\n\nexport interface DecodeYoloAnchorsOptions {\n /** Number of class-score channels following the 4 box channels. */\n readonly numClasses: number;\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedAnchors {\n /** Indices into the original `numAnchors` axis, in descending confidence order. */\n readonly anchorIndices: Int32Array;\n /** `[k, 4]` boxes in original-image pixel coords, flat row-major xyxy. */\n readonly boxesXyxy: Float32Array;\n /** Predicted class id per survivor. */\n readonly classIds: Int32Array;\n /** Confidence per survivor. */\n readonly confidences: Float32Array;\n}\n\n/**\n * Shared YOLO per-anchor decode used by both detection and segmentation\n * (v8 / v9 / v10 / v11 / v12).\n *\n * Only the first `4 + numClasses` channels are read; later channels (e.g.\n * mask coefficients) are ignored — callers can fetch them via the returned\n * {@link DecodedAnchors.anchorIndices}.\n *\n * @param data Flat per-anchor output, length `channels * numAnchors`.\n * @param dims Dims as reported by ORT, e.g. `[1, 84, 8400]` (det) or\n * `[1, 116, 8400]` (seg). The leading batch dim must be 1.\n */\nexport function decodeYoloAnchors(\n data: Float32Array,\n dims: readonly number[],\n options: DecodeYoloAnchorsOptions,\n): DecodedAnchors {\n let normalized = dims;\n if (normalized.length === 3) {\n if (normalized[0] !== 1) {\n throw new Error(`decodeYoloAnchors: expected batch size 1, got ${normalized[0]}.`);\n }\n normalized = [normalized[1] as number, normalized[2] as number];\n }\n if (normalized.length !== 2) {\n throw new Error(\n `decodeYoloAnchors: expected 2-D output after batch removal, got dims=${JSON.stringify(dims)}.`,\n );\n }\n const channels = normalized[0] as number;\n const numAnchors = normalized[1] as number;\n\n const {\n numClasses,\n originalWidth,\n originalHeight,\n padLeft,\n padTop,\n scale,\n confThreshold,\n iouThreshold,\n maxDetections,\n } = options;\n\n if (numClasses < 1 || numClasses + 4 > channels) {\n throw new Error(\n `decodeYoloAnchors: invalid numClasses=${numClasses} for channels=${channels}.`,\n );\n }\n if (data.length !== channels * numAnchors) {\n throw new Error(\n `decodeYoloAnchors: data length ${data.length} does not match channels*numAnchors=${channels * numAnchors}.`,\n );\n }\n\n type Candidate = {\n anchorIdx: number;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n classId: number;\n confidence: number;\n };\n const candidates: Candidate[] = [];\n\n for (let a = 0; a < numAnchors; a++) {\n let bestCls = 0;\n let bestScore = -Infinity;\n for (let c = 0; c < numClasses; c++) {\n const s = data[(4 + c) * numAnchors + a];\n if (s !== undefined && s > bestScore) {\n bestScore = s;\n bestCls = c;\n }\n }\n if (bestScore < confThreshold) continue;\n\n const cx = data[a] as number;\n const cy = data[numAnchors + a] as number;\n const w = data[2 * numAnchors + a] as number;\n const h = data[3 * numAnchors + a] as number;\n\n let x1 = cx - w / 2;\n let y1 = cy - h / 2;\n let x2 = cx + w / 2;\n let y2 = cy + h / 2;\n\n x1 = (x1 - padLeft) / scale;\n y1 = (y1 - padTop) / scale;\n x2 = (x2 - padLeft) / scale;\n y2 = (y2 - padTop) / scale;\n\n x1 = Math.max(0, Math.min(originalWidth, x1));\n y1 = Math.max(0, Math.min(originalHeight, y1));\n x2 = Math.max(0, Math.min(originalWidth, x2));\n y2 = Math.max(0, Math.min(originalHeight, y2));\n\n candidates.push({ anchorIdx: a, x1, y1, x2, y2, classId: bestCls, confidence: bestScore });\n }\n\n if (candidates.length === 0) return emptyDecoded();\n\n // Build flat arrays then delegate to batchedNms — same algorithm as before\n // but funnelled through the public per-class NMS helper.\n const flatBoxes = new Float32Array(candidates.length * 4);\n const scoresArr = new Float32Array(candidates.length);\n const idxsArr = new Int32Array(candidates.length);\n for (let i = 0; i < candidates.length; i++) {\n const c = candidates[i] as Candidate;\n flatBoxes[i * 4] = c.x1;\n flatBoxes[i * 4 + 1] = c.y1;\n flatBoxes[i * 4 + 2] = c.x2;\n flatBoxes[i * 4 + 3] = c.y2;\n scoresArr[i] = c.confidence;\n idxsArr[i] = c.classId;\n }\n const kept = batchedNms(flatBoxes, scoresArr, idxsArr, iouThreshold);\n if (kept.length === 0) return emptyDecoded();\n\n const limited = Array.from(kept).slice(0, maxDetections);\n const k = limited.length;\n const anchorIndices = new Int32Array(k);\n const boxesXyxy = new Float32Array(k * 4);\n const classIds = new Int32Array(k);\n const confidences = new Float32Array(k);\n for (let i = 0; i < k; i++) {\n const c = candidates[limited[i] as number] as Candidate;\n anchorIndices[i] = c.anchorIdx;\n boxesXyxy[i * 4] = c.x1;\n boxesXyxy[i * 4 + 1] = c.y1;\n boxesXyxy[i * 4 + 2] = c.x2;\n boxesXyxy[i * 4 + 3] = c.y2;\n classIds[i] = c.classId;\n confidences[i] = c.confidence;\n }\n return { anchorIndices, boxesXyxy, classIds, confidences };\n}\n\nfunction emptyDecoded(): DecodedAnchors {\n return {\n anchorIndices: new Int32Array(0),\n boxesXyxy: new Float32Array(0),\n classIds: new Int32Array(0),\n confidences: new Float32Array(0),\n };\n}\n\nexport interface DecodeYoloOptions {\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedDetection {\n readonly bbox: BoundingBox;\n readonly classId: number;\n readonly confidence: number;\n}\n\n/**\n * Decode an anchor-free YOLO detection output into a list of detections.\n *\n * Works for **YOLOv8 / v9 / v10 / v11 / v12** detect heads.\n *\n * Expected raw shape: `[1, 4 + numClasses, N]`. `numClasses` is inferred\n * from the channel count.\n */\nexport function decodeYolo(\n output: Float32Array,\n outputDims: readonly number[],\n options: DecodeYoloOptions,\n): DecodedDetection[] {\n const channels = outputDims.length === 3 ? outputDims[1] : outputDims[0];\n if (channels === undefined || channels < 5) {\n throw new Error(`decodeYolo: invalid output channel count ${channels} (expected >= 5).`);\n }\n const numClasses = channels - 4;\n\n const decoded = decodeYoloAnchors(output, outputDims, {\n numClasses,\n ...options,\n });\n\n const results: DecodedDetection[] = [];\n for (let i = 0; i < decoded.classIds.length; i++) {\n results.push({\n bbox: new BoundingBox(\n decoded.boxesXyxy[i * 4] as number,\n decoded.boxesXyxy[i * 4 + 1] as number,\n decoded.boxesXyxy[i * 4 + 2] as number,\n decoded.boxesXyxy[i * 4 + 3] as number,\n ),\n classId: decoded.classIds[i] as number,\n confidence: decoded.confidences[i] as number,\n });\n }\n return results;\n}\n\nlet _warnedDecodeYoloV8 = false;\nlet _warnedDecodeYoloV8Anchors = false;\n\n/**\n * @deprecated since 0.2.0 — use {@link decodeYolo}. Same behavior; the\n * decoder covers v8/v9/v10/v11/v12 detect heads. Will be removed in 0.3.0.\n */\nexport function decodeYoloV8(\n output: Float32Array,\n outputDims: readonly number[],\n options: DecodeYoloOptions,\n): DecodedDetection[] {\n if (!_warnedDecodeYoloV8) {\n _warnedDecodeYoloV8 = true;\n console.warn(\n \"[@ort-vision-sdk/web] decodeYoloV8 is deprecated since 0.2.0; use decodeYolo. \" +\n \"The alias will be removed in 0.3.0.\",\n );\n }\n return decodeYolo(output, outputDims, options);\n}\n\n/**\n * @deprecated since 0.2.0 — use {@link decodeYoloAnchors}. Will be removed in 0.3.0.\n */\nexport function decodeYoloV8Anchors(\n data: Float32Array,\n dims: readonly number[],\n options: DecodeYoloAnchorsOptions,\n): DecodedAnchors {\n if (!_warnedDecodeYoloV8Anchors) {\n _warnedDecodeYoloV8Anchors = true;\n console.warn(\n \"[@ort-vision-sdk/web] decodeYoloV8Anchors is deprecated since 0.2.0; use decodeYoloAnchors. \" +\n \"The alias will be removed in 0.3.0.\",\n );\n }\n return decodeYoloAnchors(data, dims, options);\n}\n\n/** @deprecated since 0.2.0 — use {@link DecodeYoloAnchorsOptions}. */\nexport type DecodeYoloV8AnchorsOptions = DecodeYoloAnchorsOptions;\n\n/** @deprecated since 0.2.0 — use {@link DecodeYoloOptions}. */\nexport type DecodeYoloV8Options = DecodeYoloOptions;\n"],"mappings":"gCA4BA,SAAgB,EAAI,EAAqB,EAAsB,EAAkC,CAC7F,IAAM,EAAI,EAAO,OACjB,GAAI,IAAM,EAAG,OAAO,IAAI,WAExB,IAAM,EAAQ,IAAI,aAAa,CAAC,EAChC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IAAK,CACxB,IAAM,EAAK,EAAM,EAAI,GACf,EAAK,EAAM,EAAI,EAAI,GACnB,EAAK,EAAM,EAAI,EAAI,GACnB,EAAK,EAAM,EAAI,EAAI,GACzB,EAAM,GAAK,KAAK,IAAI,EAAG,EAAK,CAAE,EAAI,KAAK,IAAI,EAAG,EAAK,CAAE,CACzD,CAEA,IAAM,EAAY,MAAc,CAAC,EACjC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IAAK,EAAM,GAAK,EACvC,EAAM,MAAM,EAAG,IAAO,EAAO,GAAiB,EAAO,EAAa,EAElE,IAAM,EAAa,IAAI,WAAW,CAAC,EAC7B,EAAiB,CAAC,EAExB,IAAK,IAAI,EAAK,EAAG,EAAK,EAAM,OAAQ,IAAM,CACtC,IAAM,EAAI,EAAM,GAChB,GAAI,EAAW,GAAI,SACnB,EAAK,KAAK,CAAC,EAEX,IAAM,EAAM,EAAM,EAAI,GAChB,EAAM,EAAM,EAAI,EAAI,GACpB,EAAM,EAAM,EAAI,EAAI,GACpB,EAAM,EA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,EACA,EACA,EACkB,CAQlB,OAPK,IACD,EAAsB,GACtB,QAAQ,KACJ,mHAEJ,GAEG,EAAW,EAAQ,EAAY,CAAO,CACjD,CAKA,SAAgB,EACZ,EACA,EACA,EACc,CAQd,OAPK,IACD,EAA6B,GAC7B,QAAQ,KACJ,iIAEJ,GAEG,EAAkB,EAAM,EAAM,CAAO,CAChD"}
1
+ {"version":3,"file":"detection.cjs","names":[],"sources":["../../../src/vision/postprocess/detection.ts"],"sourcesContent":["/**\n * Detection head postprocessing: anchor-free YOLO decoding + non-maximum suppression.\n *\n * The shared {@link decodeYoloAnchors} helper does the per-anchor work that\n * is identical for plain detection and segmentation (transpose, xywh→xyxy,\n * letterbox unmap, per-class NMS, sort & cap). {@link decodeYolo} is a thin\n * wrapper around it; the segmentation module ({@link ./segmentation.js})\n * calls the helper directly so it can also recover the per-anchor mask\n * coefficients.\n *\n * Works for any YOLO export with the post-v8 anchor-free head:\n * **YOLOv8 / v9 / v10 / v11 / v12** detect heads, all of which share the\n * `[1, 4 + nc, N]` output layout.\n */\n\nimport { BoundingBox } from \"../types\";\n\n/**\n * Greedy non-maximum suppression on axis-aligned bounding boxes.\n *\n * Mirrors `torchvision.ops.nms` (keeps boxes with the highest score, drops\n * any subsequent box whose IoU exceeds the threshold).\n *\n * @param boxes Flat array of length `4 * N` in xyxy order: `[x1,y1,x2,y2, ...]`.\n * @param scores Detection score per box, length `N`.\n * @param iouThreshold Boxes with IoU above this threshold relative to a kept box are suppressed.\n * @returns Indices of kept boxes, in descending score order.\n */\nexport function nms(boxes: Float32Array, scores: Float32Array, iouThreshold: number): Int32Array {\n const n = scores.length;\n if (n === 0) return new Int32Array(0);\n\n const areas = new Float32Array(n);\n for (let i = 0; i < n; i++) {\n const x1 = boxes[i * 4] as number;\n const y1 = boxes[i * 4 + 1] as number;\n const x2 = boxes[i * 4 + 2] as number;\n const y2 = boxes[i * 4 + 3] as number;\n areas[i] = Math.max(0, x2 - x1) * Math.max(0, y2 - y1);\n }\n\n const order = new Array<number>(n);\n for (let i = 0; i < n; i++) order[i] = i;\n order.sort((a, b) => (scores[b] as number) - (scores[a] as number));\n\n const suppressed = new Uint8Array(n);\n const keep: number[] = [];\n\n for (let oi = 0; oi < order.length; oi++) {\n const i = order[oi] as number;\n if (suppressed[i]) continue;\n keep.push(i);\n\n const ax1 = boxes[i * 4] as number;\n const ay1 = boxes[i * 4 + 1] as number;\n const ax2 = boxes[i * 4 + 2] as number;\n const ay2 = boxes[i * 4 + 3] as number;\n const ai = areas[i] as number;\n\n for (let oj = oi + 1; oj < order.length; oj++) {\n const j = order[oj] as number;\n if (suppressed[j]) continue;\n\n const bx1 = boxes[j * 4] as number;\n const by1 = boxes[j * 4 + 1] as number;\n const bx2 = boxes[j * 4 + 2] as number;\n const by2 = boxes[j * 4 + 3] as number;\n\n const ix1 = Math.max(ax1, bx1);\n const iy1 = Math.max(ay1, by1);\n const ix2 = Math.min(ax2, bx2);\n const iy2 = Math.min(ay2, by2);\n const iw = Math.max(0, ix2 - ix1);\n const ih = Math.max(0, iy2 - iy1);\n const inter = iw * ih;\n const union = ai + (areas[j] as number) - inter;\n const iou = union > 0 ? inter / union : 0;\n if (iou > iouThreshold) suppressed[j] = 1;\n }\n }\n\n return Int32Array.from(keep);\n}\n\n/**\n * Per-class NMS — boxes are suppressed only by other boxes of the same class.\n *\n * Mirrors `torchvision.ops.batched_nms`.\n *\n * @param boxes Flat array of length `4 * N` in xyxy order.\n * @param scores Detection score per box, length `N`.\n * @param idxs Class index per box, length `N`. Boxes with different `idxs`\n * never suppress each other.\n * @param iouThreshold IoU threshold for suppression within a class.\n */\nexport function batchedNms(\n boxes: Float32Array,\n scores: Float32Array,\n idxs: Int32Array,\n iouThreshold: number,\n): Int32Array {\n if (scores.length === 0) return new Int32Array(0);\n\n const byClass = new Map<number, number[]>();\n for (let i = 0; i < idxs.length; i++) {\n const c = idxs[i] as number;\n const list = byClass.get(c);\n if (list === undefined) byClass.set(c, [i]);\n else list.push(i);\n }\n\n const keep: number[] = [];\n for (const indices of byClass.values()) {\n const m = indices.length;\n const subBoxes = new Float32Array(m * 4);\n const subScores = new Float32Array(m);\n for (let k = 0; k < m; k++) {\n const i = indices[k] as number;\n subBoxes[k * 4] = boxes[i * 4] as number;\n subBoxes[k * 4 + 1] = boxes[i * 4 + 1] as number;\n subBoxes[k * 4 + 2] = boxes[i * 4 + 2] as number;\n subBoxes[k * 4 + 3] = boxes[i * 4 + 3] as number;\n subScores[k] = scores[i] as number;\n }\n const subKeep = nms(subBoxes, subScores, iouThreshold);\n for (let k = 0; k < subKeep.length; k++) {\n keep.push(indices[subKeep[k] as number] as number);\n }\n }\n\n keep.sort((a, b) => (scores[b] as number) - (scores[a] as number));\n return Int32Array.from(keep);\n}\n\nexport interface DecodeYoloAnchorsOptions {\n /** Number of class-score channels following the 4 box channels. */\n readonly numClasses: number;\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedAnchors {\n /** Indices into the original `numAnchors` axis, in descending confidence order. */\n readonly anchorIndices: Int32Array;\n /** `[k, 4]` boxes in original-image pixel coords, flat row-major xyxy. */\n readonly boxesXyxy: Float32Array;\n /** Predicted class id per survivor. */\n readonly classIds: Int32Array;\n /** Confidence per survivor. */\n readonly confidences: Float32Array;\n}\n\n/**\n * Shared YOLO per-anchor decode used by both detection and segmentation\n * (v8 / v9 / v10 / v11 / v12).\n *\n * Only the first `4 + numClasses` channels are read; later channels (e.g.\n * mask coefficients) are ignored — callers can fetch them via the returned\n * {@link DecodedAnchors.anchorIndices}.\n *\n * @param data Flat per-anchor output, length `channels * numAnchors`.\n * @param dims Dims as reported by ORT, e.g. `[1, 84, 8400]` (det) or\n * `[1, 116, 8400]` (seg). The leading batch dim must be 1.\n */\nexport function decodeYoloAnchors(\n data: Float32Array,\n dims: readonly number[],\n options: DecodeYoloAnchorsOptions,\n): DecodedAnchors {\n let normalized = dims;\n if (normalized.length === 3) {\n if (normalized[0] !== 1) {\n throw new Error(`decodeYoloAnchors: expected batch size 1, got ${normalized[0]}.`);\n }\n normalized = [normalized[1] as number, normalized[2] as number];\n }\n if (normalized.length !== 2) {\n throw new Error(\n `decodeYoloAnchors: expected 2-D output after batch removal, got dims=${JSON.stringify(dims)}.`,\n );\n }\n const channels = normalized[0] as number;\n const numAnchors = normalized[1] as number;\n\n const {\n numClasses,\n originalWidth,\n originalHeight,\n padLeft,\n padTop,\n scale,\n confThreshold,\n iouThreshold,\n maxDetections,\n } = options;\n\n if (numClasses < 1 || numClasses + 4 > channels) {\n throw new Error(\n `decodeYoloAnchors: invalid numClasses=${numClasses} for channels=${channels}.`,\n );\n }\n if (data.length !== channels * numAnchors) {\n throw new Error(\n `decodeYoloAnchors: data length ${data.length} does not match channels*numAnchors=${channels * numAnchors}.`,\n );\n }\n\n type Candidate = {\n anchorIdx: number;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n classId: number;\n confidence: number;\n };\n const candidates: Candidate[] = [];\n\n for (let a = 0; a < numAnchors; a++) {\n let bestCls = 0;\n let bestScore = -Infinity;\n for (let c = 0; c < numClasses; c++) {\n const s = data[(4 + c) * numAnchors + a];\n if (s !== undefined && s > bestScore) {\n bestScore = s;\n bestCls = c;\n }\n }\n if (bestScore < confThreshold) continue;\n\n const cx = data[a] as number;\n const cy = data[numAnchors + a] as number;\n const w = data[2 * numAnchors + a] as number;\n const h = data[3 * numAnchors + a] as number;\n\n let x1 = cx - w / 2;\n let y1 = cy - h / 2;\n let x2 = cx + w / 2;\n let y2 = cy + h / 2;\n\n x1 = (x1 - padLeft) / scale;\n y1 = (y1 - padTop) / scale;\n x2 = (x2 - padLeft) / scale;\n y2 = (y2 - padTop) / scale;\n\n x1 = Math.max(0, Math.min(originalWidth, x1));\n y1 = Math.max(0, Math.min(originalHeight, y1));\n x2 = Math.max(0, Math.min(originalWidth, x2));\n y2 = Math.max(0, Math.min(originalHeight, y2));\n\n candidates.push({ anchorIdx: a, x1, y1, x2, y2, classId: bestCls, confidence: bestScore });\n }\n\n if (candidates.length === 0) return emptyDecoded();\n\n // Build flat arrays then delegate to batchedNms — same algorithm as before\n // but funnelled through the public per-class NMS helper.\n const flatBoxes = new Float32Array(candidates.length * 4);\n const scoresArr = new Float32Array(candidates.length);\n const idxsArr = new Int32Array(candidates.length);\n for (let i = 0; i < candidates.length; i++) {\n const c = candidates[i] as Candidate;\n flatBoxes[i * 4] = c.x1;\n flatBoxes[i * 4 + 1] = c.y1;\n flatBoxes[i * 4 + 2] = c.x2;\n flatBoxes[i * 4 + 3] = c.y2;\n scoresArr[i] = c.confidence;\n idxsArr[i] = c.classId;\n }\n const kept = batchedNms(flatBoxes, scoresArr, idxsArr, iouThreshold);\n if (kept.length === 0) return emptyDecoded();\n\n const limited = Array.from(kept).slice(0, maxDetections);\n const k = limited.length;\n const anchorIndices = new Int32Array(k);\n const boxesXyxy = new Float32Array(k * 4);\n const classIds = new Int32Array(k);\n const confidences = new Float32Array(k);\n for (let i = 0; i < k; i++) {\n const c = candidates[limited[i] as number] as Candidate;\n anchorIndices[i] = c.anchorIdx;\n boxesXyxy[i * 4] = c.x1;\n boxesXyxy[i * 4 + 1] = c.y1;\n boxesXyxy[i * 4 + 2] = c.x2;\n boxesXyxy[i * 4 + 3] = c.y2;\n classIds[i] = c.classId;\n confidences[i] = c.confidence;\n }\n return { anchorIndices, boxesXyxy, classIds, confidences };\n}\n\nfunction emptyDecoded(): DecodedAnchors {\n return {\n anchorIndices: new Int32Array(0),\n boxesXyxy: new Float32Array(0),\n classIds: new Int32Array(0),\n confidences: new Float32Array(0),\n };\n}\n\nexport interface DecodeYoloOptions {\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedDetection {\n readonly bbox: BoundingBox;\n readonly classId: number;\n readonly confidence: number;\n}\n\n/**\n * Decode an anchor-free YOLO detection output into a list of detections.\n *\n * Works for **YOLOv8 / v9 / v10 / v11 / v12** detect heads.\n *\n * Expected raw shape: `[1, 4 + numClasses, N]`. `numClasses` is inferred\n * from the channel count.\n */\nexport function decodeYolo(\n output: Float32Array,\n outputDims: readonly number[],\n options: DecodeYoloOptions,\n): DecodedDetection[] {\n const channels = outputDims.length === 3 ? outputDims[1] : outputDims[0];\n if (channels === undefined || channels < 5) {\n throw new Error(`decodeYolo: invalid output channel count ${channels} (expected >= 5).`);\n }\n const numClasses = channels - 4;\n\n const decoded = decodeYoloAnchors(output, outputDims, {\n numClasses,\n ...options,\n });\n\n const results: DecodedDetection[] = [];\n for (let i = 0; i < decoded.classIds.length; i++) {\n results.push({\n bbox: new BoundingBox(\n decoded.boxesXyxy[i * 4] as number,\n decoded.boxesXyxy[i * 4 + 1] as number,\n decoded.boxesXyxy[i * 4 + 2] as number,\n decoded.boxesXyxy[i * 4 + 3] as number,\n ),\n classId: decoded.classIds[i] as number,\n confidence: decoded.confidences[i] as number,\n });\n }\n return results;\n}\n\nlet _warnedDecodeYoloV8 = false;\nlet _warnedDecodeYoloV8Anchors = false;\n\n/**\n * @deprecated since 0.2.0 — use {@link decodeYolo}. Same behavior; the\n * decoder covers v8/v9/v10/v11/v12 detect heads. Will be removed in 0.4.0.\n */\nexport function decodeYoloV8(\n output: Float32Array,\n outputDims: readonly number[],\n options: DecodeYoloOptions,\n): DecodedDetection[] {\n if (!_warnedDecodeYoloV8) {\n _warnedDecodeYoloV8 = true;\n console.warn(\n \"[@ort-vision-sdk/web] decodeYoloV8 is deprecated since 0.2.0; use decodeYolo. \" +\n \"The alias will be removed in 0.4.0.\",\n );\n }\n return decodeYolo(output, outputDims, options);\n}\n\n/**\n * @deprecated since 0.2.0 — use {@link decodeYoloAnchors}. Will be removed in 0.4.0.\n */\nexport function decodeYoloV8Anchors(\n data: Float32Array,\n dims: readonly number[],\n options: DecodeYoloAnchorsOptions,\n): DecodedAnchors {\n if (!_warnedDecodeYoloV8Anchors) {\n _warnedDecodeYoloV8Anchors = true;\n console.warn(\n \"[@ort-vision-sdk/web] decodeYoloV8Anchors is deprecated since 0.2.0; use decodeYoloAnchors. \" +\n \"The alias will be removed in 0.4.0.\",\n );\n }\n return decodeYoloAnchors(data, dims, options);\n}\n\n/** @deprecated since 0.2.0 — use {@link DecodeYoloAnchorsOptions}. */\nexport type DecodeYoloV8AnchorsOptions = DecodeYoloAnchorsOptions;\n\n/** @deprecated since 0.2.0 — use {@link DecodeYoloOptions}. */\nexport type DecodeYoloV8Options = DecodeYoloOptions;\n"],"mappings":"gCA4BA,SAAgB,EAAI,EAAqB,EAAsB,EAAkC,CAC7F,IAAM,EAAI,EAAO,OACjB,GAAI,IAAM,EAAG,OAAO,IAAI,WAExB,IAAM,EAAQ,IAAI,aAAa,CAAC,EAChC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IAAK,CACxB,IAAM,EAAK,EAAM,EAAI,GACf,EAAK,EAAM,EAAI,EAAI,GACnB,EAAK,EAAM,EAAI,EAAI,GACnB,EAAK,EAAM,EAAI,EAAI,GACzB,EAAM,GAAK,KAAK,IAAI,EAAG,EAAK,CAAE,EAAI,KAAK,IAAI,EAAG,EAAK,CAAE,CACzD,CAEA,IAAM,EAAY,MAAc,CAAC,EACjC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IAAK,EAAM,GAAK,EACvC,EAAM,MAAM,EAAG,IAAO,EAAO,GAAiB,EAAO,EAAa,EAElE,IAAM,EAAa,IAAI,WAAW,CAAC,EAC7B,EAAiB,CAAC,EAExB,IAAK,IAAI,EAAK,EAAG,EAAK,EAAM,OAAQ,IAAM,CACtC,IAAM,EAAI,EAAM,GAChB,GAAI,EAAW,GAAI,SACnB,EAAK,KAAK,CAAC,EAEX,IAAM,EAAM,EAAM,EAAI,GAChB,EAAM,EAAM,EAAI,EAAI,GACpB,EAAM,EAAM,EAAI,EAAI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