@shumai-one/shumai 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{chunk-qxscgcn9.js → chunk-01ym2agz.js} +1 -1
- package/bin/{chunk-ae6zgjhd.js → chunk-047n9gfs.js} +2 -2
- package/bin/chunk-0a4ahz7r.js +2 -0
- package/bin/{chunk-v5hz09a1.js → chunk-0awcpx0a.js} +2 -2
- package/bin/{chunk-19q13a80.js → chunk-0fbgfgxv.js} +5 -5
- package/bin/{chunk-jt6v15wx.js → chunk-0nnqha4f.js} +1 -1
- package/bin/chunk-0tvggyy4.js +1 -0
- package/bin/{chunk-zckxc8m6.js → chunk-113baw0m.js} +2 -2
- package/bin/{chunk-mneeg71d.js → chunk-1dbjyarc.js} +2 -2
- package/bin/{chunk-951r2rx1.js → chunk-1qre79kf.js} +1 -1
- package/bin/chunk-27v3yepb.js +1 -0
- package/bin/{chunk-5vqbzsjv.js → chunk-2rq3w8sg.js} +1 -1
- package/bin/{chunk-v034sfw8.js → chunk-3020am4q.js} +2 -2
- package/bin/{chunk-zdzkjp4q.js → chunk-3fjgf7eb.js} +2 -2
- package/bin/chunk-3pwwg1xm.js +1 -0
- package/bin/{chunk-19jpn3r6.js → chunk-3sfb63fp.js} +1 -1
- package/bin/{chunk-wwkhskce.js → chunk-3tg10kwz.js} +2 -2
- package/bin/{chunk-0y4zq3y4.js → chunk-4g4pxmef.js} +1 -1
- package/bin/{chunk-2pw7xcrn.js → chunk-4jj92zwa.js} +1 -1
- package/bin/{chunk-bpxw19ez.js → chunk-4yhvexzk.js} +1 -1
- package/bin/chunk-58cbk6e8.js +1 -0
- package/bin/{chunk-eqr0znmc.js → chunk-59t9s2jh.js} +1 -1
- package/bin/{chunk-n76w2wcr.js → chunk-5e7r7a9d.js} +1 -1
- package/bin/{chunk-8tzfcqtb.js → chunk-5m51b7af.js} +1 -1
- package/bin/{chunk-m6v8vt2b.js → chunk-65t6rm5d.js} +2 -2
- package/bin/chunk-6bed0rz4.js +1 -0
- package/bin/{chunk-1nvj833s.js → chunk-6smn0q1n.js} +5 -5
- package/bin/{chunk-r249n1xe.js → chunk-6zerk0em.js} +2 -2
- package/bin/{chunk-gvas3xkp.js → chunk-7bbsv8g0.js} +1 -1
- package/bin/chunk-83bdgs2c.js +1 -0
- package/bin/{chunk-93p27bbm.js → chunk-86qtjd30.js} +5 -5
- package/bin/{chunk-b5r0be06.js → chunk-8rekh4h9.js} +1 -1
- package/bin/{chunk-d2dgazjj.js → chunk-8s9fehda.js} +1 -1
- package/bin/{chunk-r776bhsg.js → chunk-8sf2hf31.js} +1 -1
- package/bin/{chunk-mn108p93.js → chunk-9d3w678j.js} +1 -1
- package/bin/{chunk-xr2v0d6y.js → chunk-9gftd4f7.js} +4 -4
- package/bin/{chunk-n9vp9nbg.js → chunk-9rcg8zgs.js} +32 -32
- package/bin/{chunk-6jkjx0n2.js → chunk-a23q1kc4.js} +3 -3
- package/bin/{chunk-81dawvn4.js → chunk-a6cdt85k.js} +2 -2
- package/bin/chunk-a76h3ehe.js +1 -0
- package/bin/{chunk-rmvhyqyb.js → chunk-b1bkd2p4.js} +8 -8
- package/bin/{chunk-wnqxyqrg.js → chunk-bf5m8f6t.js} +2 -2
- package/bin/chunk-cf57fk11.js +2 -0
- package/bin/{chunk-0v9srsdz.js → chunk-cv5xx81e.js} +1 -1
- package/bin/{chunk-3q5qkfkc.js → chunk-czybv3vy.js} +1 -1
- package/bin/{chunk-ggfx2b0f.js → chunk-d4sbcvpa.js} +1 -1
- package/bin/{chunk-9ggwc289.js → chunk-d6xezgrg.js} +1 -1
- package/bin/{chunk-bbcmhcvc.js → chunk-da86fpjt.js} +2 -2
- package/bin/chunk-dzjmwat0.js +14 -0
- package/bin/{chunk-rza95y4z.js → chunk-eex8sjfs.js} +2 -2
- package/bin/{chunk-9zgqjdx1.js → chunk-emgyjhmx.js} +2 -2
- package/bin/{chunk-k3prp6c6.js → chunk-exmwerag.js} +5 -5
- package/bin/{chunk-kzr6ecke.js → chunk-f38xyahm.js} +1 -1
- package/bin/{chunk-ffj9cq9y.js → chunk-fb1bes2h.js} +1 -1
- package/bin/chunk-fbvak7q2.js +1 -0
- package/bin/{chunk-15w79661.js → chunk-fg9sr6r9.js} +1 -1
- package/bin/{chunk-dppfek34.js → chunk-fyb6t7ct.js} +2 -2
- package/bin/chunk-g2ptqqm3.js +3 -0
- package/bin/{chunk-t1yamxgk.js → chunk-ggwqxn95.js} +1 -1
- package/bin/chunk-ghk54h71.js +13 -0
- package/bin/{chunk-kvwec0p3.js → chunk-h1fbev9c.js} +2 -2
- package/bin/{chunk-f5z3096k.js → chunk-h9akn41s.js} +2 -2
- package/bin/{chunk-asy868kq.js → chunk-hdansxny.js} +1 -1
- package/bin/{chunk-grjek810.js → chunk-hjwpd09v.js} +2 -2
- package/bin/{chunk-zf5cyxnt.js → chunk-hjzbw975.js} +1 -1
- package/bin/{chunk-jgfye6nf.js → chunk-j4p3eqtd.js} +1 -1
- package/bin/chunk-jtkxeat4.js +2 -0
- package/bin/{chunk-8zgq5sav.js → chunk-jw4g9628.js} +3 -3
- package/bin/{chunk-0ge2mm8j.js → chunk-jxebakyq.js} +1 -1
- package/bin/{chunk-0asthrjf.js → chunk-kfewyax2.js} +2 -2
- package/bin/chunk-kk3m4za5.js +1 -0
- package/bin/{chunk-vzdgsfkf.js → chunk-m7tnj47b.js} +1 -1
- package/bin/{chunk-w73v578p.js → chunk-maw5ah8t.js} +2 -2
- package/bin/{chunk-8ny7wvzb.js → chunk-n0wwtjwv.js} +1 -1
- package/bin/{chunk-e439kt05.js → chunk-nahdd2t9.js} +1 -1
- package/bin/{chunk-04avc4fn.js → chunk-nv7tztvh.js} +32 -32
- package/bin/{chunk-mn208vrv.js → chunk-nyjwdxyj.js} +2 -2
- package/bin/{chunk-qmrg2jhs.js → chunk-p0yfxt5e.js} +5 -5
- package/bin/{chunk-p0j4wpa5.js → chunk-q27qn367.js} +2 -2
- package/bin/{chunk-j53sjkxt.js → chunk-q36sdt2w.js} +1 -1
- package/bin/{chunk-vm2pz2hm.js → chunk-q7t5zs7n.js} +2 -2
- package/bin/{chunk-cpj562n6.js → chunk-qbj5pe8t.js} +1 -1
- package/bin/chunk-qj0bxb1m.js +2 -0
- package/bin/{chunk-9bakwac0.js → chunk-qk5hsn6e.js} +4 -4
- package/bin/{chunk-6rn094yj.js → chunk-qnyqtaf0.js} +1 -1
- package/bin/{chunk-ypkkfwfb.js → chunk-qqkr6h07.js} +2 -2
- package/bin/chunk-qyqc5j3a.css +1 -0
- package/bin/chunk-qzaf6bre.js +2 -0
- package/bin/{chunk-cx32wsa1.js → chunk-r1e59gf0.js} +1 -1
- package/bin/chunk-ra5csbkr.js +2 -0
- package/bin/{chunk-rtaya5wc.js → chunk-rh8dy99a.js} +2 -2
- package/bin/{chunk-ryepy5er.js → chunk-rx9g95wk.js} +4 -4
- package/bin/{chunk-2w6gve12.js → chunk-rxyy37wa.js} +3 -3
- package/bin/{chunk-7qvvf0yd.js → chunk-scez7ppq.js} +2 -2
- package/bin/{chunk-twpc640e.js → chunk-t2a1vq34.js} +1 -1
- package/bin/chunk-t879v3b7.js +1 -0
- package/bin/{chunk-a8bymrv1.js → chunk-tjavzarz.js} +2 -2
- package/bin/{chunk-ce0bhc72.js → chunk-treyx8em.js} +1 -1
- package/bin/{chunk-dche0gy0.js → chunk-v3z4z04s.js} +1 -1
- package/bin/{chunk-5bk16qdp.js → chunk-v3z63tpw.js} +2 -2
- package/bin/{chunk-5rzxekn4.js → chunk-v9bes1fv.js} +1 -1
- package/bin/{chunk-d5hbzp7t.js → chunk-vjyget8s.js} +1 -1
- package/bin/{chunk-4zksqvwj.js → chunk-vmm9m3nv.js} +2 -2
- package/bin/chunk-vvr8tnse.js +211 -0
- package/bin/{chunk-tvkekn4z.js → chunk-w3stry4v.js} +1 -1
- package/bin/{chunk-3pm6q6kg.js → chunk-w89czwjj.js} +1 -1
- package/bin/{chunk-rw5h0n0s.js → chunk-wk0hk00z.js} +1 -1
- package/bin/{chunk-15vsw36h.js → chunk-ww9qq8yq.js} +5 -5
- package/bin/chunk-x4q082e6.js +2 -0
- package/bin/{chunk-98mg3dpd.js → chunk-x6rf77jm.js} +4 -4
- package/bin/chunk-x7dyj53k.js +2 -0
- package/bin/{chunk-y2dhf3p0.js → chunk-xbw7ffrz.js} +2 -2
- package/bin/{chunk-5nqvqvqp.js → chunk-xcrd0y8v.js} +3 -3
- package/bin/{chunk-0j22699g.js → chunk-z0z0jn5h.js} +2 -2
- package/bin/{chunk-w9z27p0m.js → chunk-zasjhrwc.js} +1 -1
- package/bin/chunk-zefds5gg.js +1 -0
- package/bin/{chunk-8ayz61rc.js → chunk-zzzgk1d5.js} +3 -3
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +390 -373
- package/package.json +8 -11
- package/prisma/migrations/20261014054332_add_embedding_768/migration.sql +8 -0
- package/prisma/schema.prisma +10 -8
- package/bin/chunk-2gf95tj0.js +0 -1
- package/bin/chunk-2tk5w3jc.js +0 -1
- package/bin/chunk-301e7g3z.js +0 -2
- package/bin/chunk-3kmjbc3m.js +0 -2
- package/bin/chunk-3td60k1m.js +0 -2
- package/bin/chunk-42hrvk6k.js +0 -211
- package/bin/chunk-8abhmarc.js +0 -2
- package/bin/chunk-965102pf.js +0 -3
- package/bin/chunk-acn3r2m2.js +0 -1
- package/bin/chunk-ce75dw3k.css +0 -1
- package/bin/chunk-d9qpgkek.js +0 -2
- package/bin/chunk-dv6p6n5e.js +0 -1
- package/bin/chunk-gnt9gewm.js +0 -2
- package/bin/chunk-k97axrc4.js +0 -13
- package/bin/chunk-qb178ntp.js +0 -2
- package/bin/chunk-s4r6e6ms.js +0 -1
- package/bin/chunk-syjjke3f.js +0 -1
- package/bin/chunk-tgfxe0sb.js +0 -1
- package/bin/chunk-tjretpx8.js +0 -1
- package/bin/chunk-w4yjgez6.js +0 -14
- package/bin/chunk-wjcebkpb.js +0 -1
- package/bin/chunk-ws71fg50.js +0 -2
- package/bin/chunk-yfp3q4da.js +0 -1
- package/bin/chunk-z8e4wc59.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{w}from"./chunk-a8bymrv1.js";var Bu=w(function(T){Object.defineProperty(T,"__esModule",{value:!0});T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1=T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0=T.ATTR_DOTNET_GC_HEAP_GENERATION=T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST=T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING=T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION=T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT=T.ATTR_DEPLOYMENT_ENVIRONMENT_NAME=T.DB_SYSTEM_NAME_VALUE_POSTGRESQL=T.DB_SYSTEM_NAME_VALUE_MYSQL=T.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER=T.DB_SYSTEM_NAME_VALUE_MARIADB=T.ATTR_DB_SYSTEM_NAME=T.ATTR_DB_STORED_PROCEDURE_NAME=T.ATTR_DB_RESPONSE_STATUS_CODE=T.ATTR_DB_QUERY_TEXT=T.ATTR_DB_QUERY_SUMMARY=T.ATTR_DB_OPERATION_NAME=T.ATTR_DB_OPERATION_BATCH_SIZE=T.ATTR_DB_NAMESPACE=T.ATTR_DB_COLLECTION_NAME=T.ATTR_CONTAINER_IMAGE_TAGS=T.ATTR_CONTAINER_IMAGE_REPO_DIGESTS=T.ATTR_CONTAINER_IMAGE_NAME=T.ATTR_CONTAINER_ID=T.ATTR_CODE_STACKTRACE=T.ATTR_CODE_LINE_NUMBER=T.ATTR_CODE_FUNCTION_NAME=T.ATTR_CODE_FILE_PATH=T.ATTR_CODE_COLUMN_NUMBER=T.ATTR_CLIENT_PORT=T.ATTR_CLIENT_ADDRESS=T.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED=T.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS=T.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE=T.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS=T.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK=T.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED=T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED=T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER=T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER=T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED=T.ATTR_ASPNETCORE_RATE_LIMITING_RESULT=T.ATTR_ASPNETCORE_RATE_LIMITING_POLICY=T.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE=T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED=T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED=T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED=T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED=T.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT=void 0;T.ATTR_K8S_DAEMONSET_LABEL=T.ATTR_K8S_DAEMONSET_ANNOTATION=T.ATTR_K8S_CRONJOB_UID=T.ATTR_K8S_CRONJOB_NAME=T.ATTR_K8S_CRONJOB_LABEL=T.ATTR_K8S_CRONJOB_ANNOTATION=T.ATTR_K8S_CONTAINER_RESTART_COUNT=T.ATTR_K8S_CONTAINER_NAME=T.ATTR_K8S_CLUSTER_UID=T.ATTR_K8S_CLUSTER_NAME=T.JVM_THREAD_STATE_VALUE_WAITING=T.JVM_THREAD_STATE_VALUE_TIMED_WAITING=T.JVM_THREAD_STATE_VALUE_TERMINATED=T.JVM_THREAD_STATE_VALUE_RUNNABLE=T.JVM_THREAD_STATE_VALUE_NEW=T.JVM_THREAD_STATE_VALUE_BLOCKED=T.ATTR_JVM_THREAD_STATE=T.ATTR_JVM_THREAD_DAEMON=T.JVM_MEMORY_TYPE_VALUE_NON_HEAP=T.JVM_MEMORY_TYPE_VALUE_HEAP=T.ATTR_JVM_MEMORY_TYPE=T.ATTR_JVM_MEMORY_POOL_NAME=T.ATTR_JVM_GC_NAME=T.ATTR_JVM_GC_ACTION=T.ATTR_HTTP_ROUTE=T.ATTR_HTTP_RESPONSE_STATUS_CODE=T.ATTR_HTTP_RESPONSE_HEADER=T.ATTR_HTTP_REQUEST_RESEND_COUNT=T.ATTR_HTTP_REQUEST_METHOD_ORIGINAL=T.HTTP_REQUEST_METHOD_VALUE_TRACE=T.HTTP_REQUEST_METHOD_VALUE_PUT=T.HTTP_REQUEST_METHOD_VALUE_POST=T.HTTP_REQUEST_METHOD_VALUE_PATCH=T.HTTP_REQUEST_METHOD_VALUE_OPTIONS=T.HTTP_REQUEST_METHOD_VALUE_HEAD=T.HTTP_REQUEST_METHOD_VALUE_GET=T.HTTP_REQUEST_METHOD_VALUE_DELETE=T.HTTP_REQUEST_METHOD_VALUE_CONNECT=T.HTTP_REQUEST_METHOD_VALUE_OTHER=T.ATTR_HTTP_REQUEST_METHOD=T.ATTR_HTTP_REQUEST_HEADER=T.ATTR_EXCEPTION_TYPE=T.ATTR_EXCEPTION_STACKTRACE=T.ATTR_EXCEPTION_MESSAGE=T.ATTR_EXCEPTION_ESCAPED=T.ERROR_TYPE_VALUE_OTHER=T.ATTR_ERROR_TYPE=T.DOTNET_GC_HEAP_GENERATION_VALUE_POH=T.DOTNET_GC_HEAP_GENERATION_VALUE_LOH=T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2=void 0;T.ATTR_OTEL_SCOPE_VERSION=T.ATTR_OTEL_SCOPE_NAME=T.ATTR_OTEL_EVENT_NAME=T.NETWORK_TYPE_VALUE_IPV6=T.NETWORK_TYPE_VALUE_IPV4=T.ATTR_NETWORK_TYPE=T.NETWORK_TRANSPORT_VALUE_UNIX=T.NETWORK_TRANSPORT_VALUE_UDP=T.NETWORK_TRANSPORT_VALUE_TCP=T.NETWORK_TRANSPORT_VALUE_QUIC=T.NETWORK_TRANSPORT_VALUE_PIPE=T.ATTR_NETWORK_TRANSPORT=T.ATTR_NETWORK_PROTOCOL_VERSION=T.ATTR_NETWORK_PROTOCOL_NAME=T.ATTR_NETWORK_PEER_PORT=T.ATTR_NETWORK_PEER_ADDRESS=T.ATTR_NETWORK_LOCAL_PORT=T.ATTR_NETWORK_LOCAL_ADDRESS=T.ATTR_K8S_STATEFULSET_UID=T.ATTR_K8S_STATEFULSET_NAME=T.ATTR_K8S_STATEFULSET_LABEL=T.ATTR_K8S_STATEFULSET_ANNOTATION=T.ATTR_K8S_REPLICASET_UID=T.ATTR_K8S_REPLICASET_NAME=T.ATTR_K8S_REPLICASET_LABEL=T.ATTR_K8S_REPLICASET_ANNOTATION=T.ATTR_K8S_POD_UID=T.ATTR_K8S_POD_START_TIME=T.ATTR_K8S_POD_NAME=T.ATTR_K8S_POD_LABEL=T.ATTR_K8S_POD_IP=T.ATTR_K8S_POD_HOSTNAME=T.ATTR_K8S_POD_ANNOTATION=T.ATTR_K8S_NODE_UID=T.ATTR_K8S_NODE_NAME=T.ATTR_K8S_NODE_LABEL=T.ATTR_K8S_NODE_ANNOTATION=T.ATTR_K8S_NAMESPACE_NAME=T.ATTR_K8S_NAMESPACE_LABEL=T.ATTR_K8S_NAMESPACE_ANNOTATION=T.ATTR_K8S_JOB_UID=T.ATTR_K8S_JOB_NAME=T.ATTR_K8S_JOB_LABEL=T.ATTR_K8S_JOB_ANNOTATION=T.ATTR_K8S_DEPLOYMENT_UID=T.ATTR_K8S_DEPLOYMENT_NAME=T.ATTR_K8S_DEPLOYMENT_LABEL=T.ATTR_K8S_DEPLOYMENT_ANNOTATION=T.ATTR_K8S_DAEMONSET_UID=T.ATTR_K8S_DAEMONSET_NAME=void 0;T.ATTR_USER_AGENT_ORIGINAL=T.ATTR_URL_SCHEME=T.ATTR_URL_QUERY=T.ATTR_URL_PATH=T.ATTR_URL_FULL=T.ATTR_URL_FRAGMENT=T.ATTR_TELEMETRY_SDK_VERSION=T.ATTR_TELEMETRY_SDK_NAME=T.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS=T.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT=T.TELEMETRY_SDK_LANGUAGE_VALUE_RUST=T.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY=T.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON=T.TELEMETRY_SDK_LANGUAGE_VALUE_PHP=T.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS=T.TELEMETRY_SDK_LANGUAGE_VALUE_KOTLIN=T.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA=T.TELEMETRY_SDK_LANGUAGE_VALUE_GO=T.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG=T.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET=T.TELEMETRY_SDK_LANGUAGE_VALUE_CPP=T.ATTR_TELEMETRY_SDK_LANGUAGE=T.ATTR_TELEMETRY_DISTRO_VERSION=T.ATTR_TELEMETRY_DISTRO_NAME=T.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS=T.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS=T.SIGNALR_TRANSPORT_VALUE_LONG_POLLING=T.ATTR_SIGNALR_TRANSPORT=T.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT=T.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE=T.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN=T.ATTR_SIGNALR_CONNECTION_STATUS=T.ATTR_SERVICE_VERSION=T.ATTR_SERVICE_NAMESPACE=T.ATTR_SERVICE_NAME=T.ATTR_SERVICE_INSTANCE_ID=T.ATTR_SERVER_PORT=T.ATTR_SERVER_ADDRESS=T.ATTR_OTEL_STATUS_DESCRIPTION=T.OTEL_STATUS_CODE_VALUE_OK=T.OTEL_STATUS_CODE_VALUE_ERROR=T.ATTR_OTEL_STATUS_CODE=void 0;T.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT="aspnetcore.diagnostics.exception.result";T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED="aborted";T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED="handled";T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED="skipped";T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED="unhandled";T.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE="aspnetcore.diagnostics.handler.type";T.ATTR_ASPNETCORE_RATE_LIMITING_POLICY="aspnetcore.rate_limiting.policy";T.ATTR_ASPNETCORE_RATE_LIMITING_RESULT="aspnetcore.rate_limiting.result";T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED="acquired";T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER="endpoint_limiter";T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER="global_limiter";T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED="request_canceled";T.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED="aspnetcore.request.is_unhandled";T.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK="aspnetcore.routing.is_fallback";T.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS="aspnetcore.routing.match_status";T.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE="failure";T.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS="success";T.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED="aspnetcore.user.is_authenticated";T.ATTR_CLIENT_ADDRESS="client.address";T.ATTR_CLIENT_PORT="client.port";T.ATTR_CODE_COLUMN_NUMBER="code.column.number";T.ATTR_CODE_FILE_PATH="code.file.path";T.ATTR_CODE_FUNCTION_NAME="code.function.name";T.ATTR_CODE_LINE_NUMBER="code.line.number";T.ATTR_CODE_STACKTRACE="code.stacktrace";T.ATTR_CONTAINER_ID="container.id";T.ATTR_CONTAINER_IMAGE_NAME="container.image.name";T.ATTR_CONTAINER_IMAGE_REPO_DIGESTS="container.image.repo_digests";T.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";T.ATTR_DB_COLLECTION_NAME="db.collection.name";T.ATTR_DB_NAMESPACE="db.namespace";T.ATTR_DB_OPERATION_BATCH_SIZE="db.operation.batch.size";T.ATTR_DB_OPERATION_NAME="db.operation.name";T.ATTR_DB_QUERY_SUMMARY="db.query.summary";T.ATTR_DB_QUERY_TEXT="db.query.text";T.ATTR_DB_RESPONSE_STATUS_CODE="db.response.status_code";T.ATTR_DB_STORED_PROCEDURE_NAME="db.stored_procedure.name";T.ATTR_DB_SYSTEM_NAME="db.system.name";T.DB_SYSTEM_NAME_VALUE_MARIADB="mariadb";T.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER="microsoft.sql_server";T.DB_SYSTEM_NAME_VALUE_MYSQL="mysql";T.DB_SYSTEM_NAME_VALUE_POSTGRESQL="postgresql";T.ATTR_DEPLOYMENT_ENVIRONMENT_NAME="deployment.environment.name";T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT="development";T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION="production";T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING="staging";T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST="test";T.ATTR_DOTNET_GC_HEAP_GENERATION="dotnet.gc.heap.generation";T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0="gen0";T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1="gen1";T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2="gen2";T.DOTNET_GC_HEAP_GENERATION_VALUE_LOH="loh";T.DOTNET_GC_HEAP_GENERATION_VALUE_POH="poh";T.ATTR_ERROR_TYPE="error.type";T.ERROR_TYPE_VALUE_OTHER="_OTHER";T.ATTR_EXCEPTION_ESCAPED="exception.escaped";T.ATTR_EXCEPTION_MESSAGE="exception.message";T.ATTR_EXCEPTION_STACKTRACE="exception.stacktrace";T.ATTR_EXCEPTION_TYPE="exception.type";var L=(_)=>`http.request.header.${_}`;T.ATTR_HTTP_REQUEST_HEADER=L;T.ATTR_HTTP_REQUEST_METHOD="http.request.method";T.HTTP_REQUEST_METHOD_VALUE_OTHER="_OTHER";T.HTTP_REQUEST_METHOD_VALUE_CONNECT="CONNECT";T.HTTP_REQUEST_METHOD_VALUE_DELETE="DELETE";T.HTTP_REQUEST_METHOD_VALUE_GET="GET";T.HTTP_REQUEST_METHOD_VALUE_HEAD="HEAD";T.HTTP_REQUEST_METHOD_VALUE_OPTIONS="OPTIONS";T.HTTP_REQUEST_METHOD_VALUE_PATCH="PATCH";T.HTTP_REQUEST_METHOD_VALUE_POST="POST";T.HTTP_REQUEST_METHOD_VALUE_PUT="PUT";T.HTTP_REQUEST_METHOD_VALUE_TRACE="TRACE";T.ATTR_HTTP_REQUEST_METHOD_ORIGINAL="http.request.method_original";T.ATTR_HTTP_REQUEST_RESEND_COUNT="http.request.resend_count";var o=(_)=>`http.response.header.${_}`;T.ATTR_HTTP_RESPONSE_HEADER=o;T.ATTR_HTTP_RESPONSE_STATUS_CODE="http.response.status_code";T.ATTR_HTTP_ROUTE="http.route";T.ATTR_JVM_GC_ACTION="jvm.gc.action";T.ATTR_JVM_GC_NAME="jvm.gc.name";T.ATTR_JVM_MEMORY_POOL_NAME="jvm.memory.pool.name";T.ATTR_JVM_MEMORY_TYPE="jvm.memory.type";T.JVM_MEMORY_TYPE_VALUE_HEAP="heap";T.JVM_MEMORY_TYPE_VALUE_NON_HEAP="non_heap";T.ATTR_JVM_THREAD_DAEMON="jvm.thread.daemon";T.ATTR_JVM_THREAD_STATE="jvm.thread.state";T.JVM_THREAD_STATE_VALUE_BLOCKED="blocked";T.JVM_THREAD_STATE_VALUE_NEW="new";T.JVM_THREAD_STATE_VALUE_RUNNABLE="runnable";T.JVM_THREAD_STATE_VALUE_TERMINATED="terminated";T.JVM_THREAD_STATE_VALUE_TIMED_WAITING="timed_waiting";T.JVM_THREAD_STATE_VALUE_WAITING="waiting";T.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";T.ATTR_K8S_CLUSTER_UID="k8s.cluster.uid";T.ATTR_K8S_CONTAINER_NAME="k8s.container.name";T.ATTR_K8S_CONTAINER_RESTART_COUNT="k8s.container.restart_count";var s=(_)=>`k8s.cronjob.annotation.${_}`;T.ATTR_K8S_CRONJOB_ANNOTATION=s;var C=(_)=>`k8s.cronjob.label.${_}`;T.ATTR_K8S_CRONJOB_LABEL=C;T.ATTR_K8S_CRONJOB_NAME="k8s.cronjob.name";T.ATTR_K8S_CRONJOB_UID="k8s.cronjob.uid";var M=(_)=>`k8s.daemonset.annotation.${_}`;T.ATTR_K8S_DAEMONSET_ANNOTATION=M;var r=(_)=>`k8s.daemonset.label.${_}`;T.ATTR_K8S_DAEMONSET_LABEL=r;T.ATTR_K8S_DAEMONSET_NAME="k8s.daemonset.name";T.ATTR_K8S_DAEMONSET_UID="k8s.daemonset.uid";var U=(_)=>`k8s.deployment.annotation.${_}`;T.ATTR_K8S_DEPLOYMENT_ANNOTATION=U;var D=(_)=>`k8s.deployment.label.${_}`;T.ATTR_K8S_DEPLOYMENT_LABEL=D;T.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";T.ATTR_K8S_DEPLOYMENT_UID="k8s.deployment.uid";var p=(_)=>`k8s.job.annotation.${_}`;T.ATTR_K8S_JOB_ANNOTATION=p;var P=(_)=>`k8s.job.label.${_}`;T.ATTR_K8S_JOB_LABEL=P;T.ATTR_K8S_JOB_NAME="k8s.job.name";T.ATTR_K8S_JOB_UID="k8s.job.uid";var n=(_)=>`k8s.namespace.annotation.${_}`;T.ATTR_K8S_NAMESPACE_ANNOTATION=n;var V=(_)=>`k8s.namespace.label.${_}`;T.ATTR_K8S_NAMESPACE_LABEL=V;T.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";var x=(_)=>`k8s.node.annotation.${_}`;T.ATTR_K8S_NODE_ANNOTATION=x;var a=(_)=>`k8s.node.label.${_}`;T.ATTR_K8S_NODE_LABEL=a;T.ATTR_K8S_NODE_NAME="k8s.node.name";T.ATTR_K8S_NODE_UID="k8s.node.uid";var G=(_)=>`k8s.pod.annotation.${_}`;T.ATTR_K8S_POD_ANNOTATION=G;T.ATTR_K8S_POD_HOSTNAME="k8s.pod.hostname";T.ATTR_K8S_POD_IP="k8s.pod.ip";var i=(_)=>`k8s.pod.label.${_}`;T.ATTR_K8S_POD_LABEL=i;T.ATTR_K8S_POD_NAME="k8s.pod.name";T.ATTR_K8S_POD_START_TIME="k8s.pod.start_time";T.ATTR_K8S_POD_UID="k8s.pod.uid";var K=(_)=>`k8s.replicaset.annotation.${_}`;T.ATTR_K8S_REPLICASET_ANNOTATION=K;var c=(_)=>`k8s.replicaset.label.${_}`;T.ATTR_K8S_REPLICASET_LABEL=c;T.ATTR_K8S_REPLICASET_NAME="k8s.replicaset.name";T.ATTR_K8S_REPLICASET_UID="k8s.replicaset.uid";var H=(_)=>`k8s.statefulset.annotation.${_}`;T.ATTR_K8S_STATEFULSET_ANNOTATION=H;var d=(_)=>`k8s.statefulset.label.${_}`;T.ATTR_K8S_STATEFULSET_LABEL=d;T.ATTR_K8S_STATEFULSET_NAME="k8s.statefulset.name";T.ATTR_K8S_STATEFULSET_UID="k8s.statefulset.uid";T.ATTR_NETWORK_LOCAL_ADDRESS="network.local.address";T.ATTR_NETWORK_LOCAL_PORT="network.local.port";T.ATTR_NETWORK_PEER_ADDRESS="network.peer.address";T.ATTR_NETWORK_PEER_PORT="network.peer.port";T.ATTR_NETWORK_PROTOCOL_NAME="network.protocol.name";T.ATTR_NETWORK_PROTOCOL_VERSION="network.protocol.version";T.ATTR_NETWORK_TRANSPORT="network.transport";T.NETWORK_TRANSPORT_VALUE_PIPE="pipe";T.NETWORK_TRANSPORT_VALUE_QUIC="quic";T.NETWORK_TRANSPORT_VALUE_TCP="tcp";T.NETWORK_TRANSPORT_VALUE_UDP="udp";T.NETWORK_TRANSPORT_VALUE_UNIX="unix";T.ATTR_NETWORK_TYPE="network.type";T.NETWORK_TYPE_VALUE_IPV4="ipv4";T.NETWORK_TYPE_VALUE_IPV6="ipv6";T.ATTR_OTEL_EVENT_NAME="otel.event.name";T.ATTR_OTEL_SCOPE_NAME="otel.scope.name";T.ATTR_OTEL_SCOPE_VERSION="otel.scope.version";T.ATTR_OTEL_STATUS_CODE="otel.status_code";T.OTEL_STATUS_CODE_VALUE_ERROR="ERROR";T.OTEL_STATUS_CODE_VALUE_OK="OK";T.ATTR_OTEL_STATUS_DESCRIPTION="otel.status_description";T.ATTR_SERVER_ADDRESS="server.address";T.ATTR_SERVER_PORT="server.port";T.ATTR_SERVICE_INSTANCE_ID="service.instance.id";T.ATTR_SERVICE_NAME="service.name";T.ATTR_SERVICE_NAMESPACE="service.namespace";T.ATTR_SERVICE_VERSION="service.version";T.ATTR_SIGNALR_CONNECTION_STATUS="signalr.connection.status";T.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN="app_shutdown";T.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE="normal_closure";T.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT="timeout";T.ATTR_SIGNALR_TRANSPORT="signalr.transport";T.SIGNALR_TRANSPORT_VALUE_LONG_POLLING="long_polling";T.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS="server_sent_events";T.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS="web_sockets";T.ATTR_TELEMETRY_DISTRO_NAME="telemetry.distro.name";T.ATTR_TELEMETRY_DISTRO_VERSION="telemetry.distro.version";T.ATTR_TELEMETRY_SDK_LANGUAGE="telemetry.sdk.language";T.TELEMETRY_SDK_LANGUAGE_VALUE_CPP="cpp";T.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET="dotnet";T.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG="erlang";T.TELEMETRY_SDK_LANGUAGE_VALUE_GO="go";T.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA="java";T.TELEMETRY_SDK_LANGUAGE_VALUE_KOTLIN="kotlin";T.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS="nodejs";T.TELEMETRY_SDK_LANGUAGE_VALUE_PHP="php";T.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON="python";T.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY="ruby";T.TELEMETRY_SDK_LANGUAGE_VALUE_RUST="rust";T.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT="swift";T.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS="webjs";T.ATTR_TELEMETRY_SDK_NAME="telemetry.sdk.name";T.ATTR_TELEMETRY_SDK_VERSION="telemetry.sdk.version";T.ATTR_URL_FRAGMENT="url.fragment";T.ATTR_URL_FULL="url.full";T.ATTR_URL_PATH="url.path";T.ATTR_URL_QUERY="url.query";T.ATTR_URL_SCHEME="url.scheme";T.ATTR_USER_AGENT_ORIGINAL="user_agent.original"});var Uu=w(function(O){Object.defineProperty(O,"__esModule",{value:!0});O.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS=O.METRIC_KESTREL_UPGRADED_CONNECTIONS=O.METRIC_KESTREL_TLS_HANDSHAKE_DURATION=O.METRIC_KESTREL_REJECTED_CONNECTIONS=O.METRIC_KESTREL_QUEUED_REQUESTS=O.METRIC_KESTREL_QUEUED_CONNECTIONS=O.METRIC_KESTREL_CONNECTION_DURATION=O.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES=O.METRIC_KESTREL_ACTIVE_CONNECTIONS=O.METRIC_JVM_THREAD_COUNT=O.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC=O.METRIC_JVM_MEMORY_USED=O.METRIC_JVM_MEMORY_LIMIT=O.METRIC_JVM_MEMORY_COMMITTED=O.METRIC_JVM_GC_DURATION=O.METRIC_JVM_CPU_TIME=O.METRIC_JVM_CPU_RECENT_UTILIZATION=O.METRIC_JVM_CPU_COUNT=O.METRIC_JVM_CLASS_UNLOADED=O.METRIC_JVM_CLASS_LOADED=O.METRIC_JVM_CLASS_COUNT=O.METRIC_HTTP_SERVER_REQUEST_DURATION=O.METRIC_HTTP_CLIENT_REQUEST_DURATION=O.METRIC_DOTNET_TIMER_COUNT=O.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT=O.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT=O.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH=O.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET=O.METRIC_DOTNET_PROCESS_CPU_TIME=O.METRIC_DOTNET_PROCESS_CPU_COUNT=O.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS=O.METRIC_DOTNET_JIT_COMPILED_METHODS=O.METRIC_DOTNET_JIT_COMPILED_IL_SIZE=O.METRIC_DOTNET_JIT_COMPILATION_TIME=O.METRIC_DOTNET_GC_PAUSE_TIME=O.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE=O.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE=O.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE=O.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED=O.METRIC_DOTNET_GC_COLLECTIONS=O.METRIC_DOTNET_EXCEPTIONS=O.METRIC_DOTNET_ASSEMBLY_COUNT=O.METRIC_DB_CLIENT_OPERATION_DURATION=O.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS=O.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS=O.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION=O.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE=O.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS=O.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES=O.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS=void 0;O.METRIC_SIGNALR_SERVER_CONNECTION_DURATION=void 0;O.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS="aspnetcore.diagnostics.exceptions";O.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES="aspnetcore.rate_limiting.active_request_leases";O.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS="aspnetcore.rate_limiting.queued_requests";O.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE="aspnetcore.rate_limiting.request.time_in_queue";O.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION="aspnetcore.rate_limiting.request_lease.duration";O.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS="aspnetcore.rate_limiting.requests";O.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS="aspnetcore.routing.match_attempts";O.METRIC_DB_CLIENT_OPERATION_DURATION="db.client.operation.duration";O.METRIC_DOTNET_ASSEMBLY_COUNT="dotnet.assembly.count";O.METRIC_DOTNET_EXCEPTIONS="dotnet.exceptions";O.METRIC_DOTNET_GC_COLLECTIONS="dotnet.gc.collections";O.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED="dotnet.gc.heap.total_allocated";O.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE="dotnet.gc.last_collection.heap.fragmentation.size";O.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE="dotnet.gc.last_collection.heap.size";O.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE="dotnet.gc.last_collection.memory.committed_size";O.METRIC_DOTNET_GC_PAUSE_TIME="dotnet.gc.pause.time";O.METRIC_DOTNET_JIT_COMPILATION_TIME="dotnet.jit.compilation.time";O.METRIC_DOTNET_JIT_COMPILED_IL_SIZE="dotnet.jit.compiled_il.size";O.METRIC_DOTNET_JIT_COMPILED_METHODS="dotnet.jit.compiled_methods";O.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS="dotnet.monitor.lock_contentions";O.METRIC_DOTNET_PROCESS_CPU_COUNT="dotnet.process.cpu.count";O.METRIC_DOTNET_PROCESS_CPU_TIME="dotnet.process.cpu.time";O.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET="dotnet.process.memory.working_set";O.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH="dotnet.thread_pool.queue.length";O.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT="dotnet.thread_pool.thread.count";O.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT="dotnet.thread_pool.work_item.count";O.METRIC_DOTNET_TIMER_COUNT="dotnet.timer.count";O.METRIC_HTTP_CLIENT_REQUEST_DURATION="http.client.request.duration";O.METRIC_HTTP_SERVER_REQUEST_DURATION="http.server.request.duration";O.METRIC_JVM_CLASS_COUNT="jvm.class.count";O.METRIC_JVM_CLASS_LOADED="jvm.class.loaded";O.METRIC_JVM_CLASS_UNLOADED="jvm.class.unloaded";O.METRIC_JVM_CPU_COUNT="jvm.cpu.count";O.METRIC_JVM_CPU_RECENT_UTILIZATION="jvm.cpu.recent_utilization";O.METRIC_JVM_CPU_TIME="jvm.cpu.time";O.METRIC_JVM_GC_DURATION="jvm.gc.duration";O.METRIC_JVM_MEMORY_COMMITTED="jvm.memory.committed";O.METRIC_JVM_MEMORY_LIMIT="jvm.memory.limit";O.METRIC_JVM_MEMORY_USED="jvm.memory.used";O.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC="jvm.memory.used_after_last_gc";O.METRIC_JVM_THREAD_COUNT="jvm.thread.count";O.METRIC_KESTREL_ACTIVE_CONNECTIONS="kestrel.active_connections";O.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES="kestrel.active_tls_handshakes";O.METRIC_KESTREL_CONNECTION_DURATION="kestrel.connection.duration";O.METRIC_KESTREL_QUEUED_CONNECTIONS="kestrel.queued_connections";O.METRIC_KESTREL_QUEUED_REQUESTS="kestrel.queued_requests";O.METRIC_KESTREL_REJECTED_CONNECTIONS="kestrel.rejected_connections";O.METRIC_KESTREL_TLS_HANDSHAKE_DURATION="kestrel.tls_handshake.duration";O.METRIC_KESTREL_UPGRADED_CONNECTIONS="kestrel.upgraded_connections";O.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS="signalr.server.active_connections";O.METRIC_SIGNALR_SERVER_CONNECTION_DURATION="signalr.server.connection.duration"});var zu=w(function(t){Object.defineProperty(t,"__esModule",{value:!0});t.EVENT_EXCEPTION=void 0;t.EVENT_EXCEPTION="exception"});
|
|
2
|
+
import{w}from"./chunk-tjavzarz.js";var Bu=w(function(T){Object.defineProperty(T,"__esModule",{value:!0});T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1=T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0=T.ATTR_DOTNET_GC_HEAP_GENERATION=T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST=T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING=T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION=T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT=T.ATTR_DEPLOYMENT_ENVIRONMENT_NAME=T.DB_SYSTEM_NAME_VALUE_POSTGRESQL=T.DB_SYSTEM_NAME_VALUE_MYSQL=T.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER=T.DB_SYSTEM_NAME_VALUE_MARIADB=T.ATTR_DB_SYSTEM_NAME=T.ATTR_DB_STORED_PROCEDURE_NAME=T.ATTR_DB_RESPONSE_STATUS_CODE=T.ATTR_DB_QUERY_TEXT=T.ATTR_DB_QUERY_SUMMARY=T.ATTR_DB_OPERATION_NAME=T.ATTR_DB_OPERATION_BATCH_SIZE=T.ATTR_DB_NAMESPACE=T.ATTR_DB_COLLECTION_NAME=T.ATTR_CONTAINER_IMAGE_TAGS=T.ATTR_CONTAINER_IMAGE_REPO_DIGESTS=T.ATTR_CONTAINER_IMAGE_NAME=T.ATTR_CONTAINER_ID=T.ATTR_CODE_STACKTRACE=T.ATTR_CODE_LINE_NUMBER=T.ATTR_CODE_FUNCTION_NAME=T.ATTR_CODE_FILE_PATH=T.ATTR_CODE_COLUMN_NUMBER=T.ATTR_CLIENT_PORT=T.ATTR_CLIENT_ADDRESS=T.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED=T.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS=T.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE=T.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS=T.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK=T.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED=T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED=T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER=T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER=T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED=T.ATTR_ASPNETCORE_RATE_LIMITING_RESULT=T.ATTR_ASPNETCORE_RATE_LIMITING_POLICY=T.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE=T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED=T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED=T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED=T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED=T.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT=void 0;T.ATTR_K8S_DAEMONSET_LABEL=T.ATTR_K8S_DAEMONSET_ANNOTATION=T.ATTR_K8S_CRONJOB_UID=T.ATTR_K8S_CRONJOB_NAME=T.ATTR_K8S_CRONJOB_LABEL=T.ATTR_K8S_CRONJOB_ANNOTATION=T.ATTR_K8S_CONTAINER_RESTART_COUNT=T.ATTR_K8S_CONTAINER_NAME=T.ATTR_K8S_CLUSTER_UID=T.ATTR_K8S_CLUSTER_NAME=T.JVM_THREAD_STATE_VALUE_WAITING=T.JVM_THREAD_STATE_VALUE_TIMED_WAITING=T.JVM_THREAD_STATE_VALUE_TERMINATED=T.JVM_THREAD_STATE_VALUE_RUNNABLE=T.JVM_THREAD_STATE_VALUE_NEW=T.JVM_THREAD_STATE_VALUE_BLOCKED=T.ATTR_JVM_THREAD_STATE=T.ATTR_JVM_THREAD_DAEMON=T.JVM_MEMORY_TYPE_VALUE_NON_HEAP=T.JVM_MEMORY_TYPE_VALUE_HEAP=T.ATTR_JVM_MEMORY_TYPE=T.ATTR_JVM_MEMORY_POOL_NAME=T.ATTR_JVM_GC_NAME=T.ATTR_JVM_GC_ACTION=T.ATTR_HTTP_ROUTE=T.ATTR_HTTP_RESPONSE_STATUS_CODE=T.ATTR_HTTP_RESPONSE_HEADER=T.ATTR_HTTP_REQUEST_RESEND_COUNT=T.ATTR_HTTP_REQUEST_METHOD_ORIGINAL=T.HTTP_REQUEST_METHOD_VALUE_TRACE=T.HTTP_REQUEST_METHOD_VALUE_PUT=T.HTTP_REQUEST_METHOD_VALUE_POST=T.HTTP_REQUEST_METHOD_VALUE_PATCH=T.HTTP_REQUEST_METHOD_VALUE_OPTIONS=T.HTTP_REQUEST_METHOD_VALUE_HEAD=T.HTTP_REQUEST_METHOD_VALUE_GET=T.HTTP_REQUEST_METHOD_VALUE_DELETE=T.HTTP_REQUEST_METHOD_VALUE_CONNECT=T.HTTP_REQUEST_METHOD_VALUE_OTHER=T.ATTR_HTTP_REQUEST_METHOD=T.ATTR_HTTP_REQUEST_HEADER=T.ATTR_EXCEPTION_TYPE=T.ATTR_EXCEPTION_STACKTRACE=T.ATTR_EXCEPTION_MESSAGE=T.ATTR_EXCEPTION_ESCAPED=T.ERROR_TYPE_VALUE_OTHER=T.ATTR_ERROR_TYPE=T.DOTNET_GC_HEAP_GENERATION_VALUE_POH=T.DOTNET_GC_HEAP_GENERATION_VALUE_LOH=T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2=void 0;T.ATTR_OTEL_SCOPE_VERSION=T.ATTR_OTEL_SCOPE_NAME=T.ATTR_OTEL_EVENT_NAME=T.NETWORK_TYPE_VALUE_IPV6=T.NETWORK_TYPE_VALUE_IPV4=T.ATTR_NETWORK_TYPE=T.NETWORK_TRANSPORT_VALUE_UNIX=T.NETWORK_TRANSPORT_VALUE_UDP=T.NETWORK_TRANSPORT_VALUE_TCP=T.NETWORK_TRANSPORT_VALUE_QUIC=T.NETWORK_TRANSPORT_VALUE_PIPE=T.ATTR_NETWORK_TRANSPORT=T.ATTR_NETWORK_PROTOCOL_VERSION=T.ATTR_NETWORK_PROTOCOL_NAME=T.ATTR_NETWORK_PEER_PORT=T.ATTR_NETWORK_PEER_ADDRESS=T.ATTR_NETWORK_LOCAL_PORT=T.ATTR_NETWORK_LOCAL_ADDRESS=T.ATTR_K8S_STATEFULSET_UID=T.ATTR_K8S_STATEFULSET_NAME=T.ATTR_K8S_STATEFULSET_LABEL=T.ATTR_K8S_STATEFULSET_ANNOTATION=T.ATTR_K8S_REPLICASET_UID=T.ATTR_K8S_REPLICASET_NAME=T.ATTR_K8S_REPLICASET_LABEL=T.ATTR_K8S_REPLICASET_ANNOTATION=T.ATTR_K8S_POD_UID=T.ATTR_K8S_POD_START_TIME=T.ATTR_K8S_POD_NAME=T.ATTR_K8S_POD_LABEL=T.ATTR_K8S_POD_IP=T.ATTR_K8S_POD_HOSTNAME=T.ATTR_K8S_POD_ANNOTATION=T.ATTR_K8S_NODE_UID=T.ATTR_K8S_NODE_NAME=T.ATTR_K8S_NODE_LABEL=T.ATTR_K8S_NODE_ANNOTATION=T.ATTR_K8S_NAMESPACE_NAME=T.ATTR_K8S_NAMESPACE_LABEL=T.ATTR_K8S_NAMESPACE_ANNOTATION=T.ATTR_K8S_JOB_UID=T.ATTR_K8S_JOB_NAME=T.ATTR_K8S_JOB_LABEL=T.ATTR_K8S_JOB_ANNOTATION=T.ATTR_K8S_DEPLOYMENT_UID=T.ATTR_K8S_DEPLOYMENT_NAME=T.ATTR_K8S_DEPLOYMENT_LABEL=T.ATTR_K8S_DEPLOYMENT_ANNOTATION=T.ATTR_K8S_DAEMONSET_UID=T.ATTR_K8S_DAEMONSET_NAME=void 0;T.ATTR_USER_AGENT_ORIGINAL=T.ATTR_URL_SCHEME=T.ATTR_URL_QUERY=T.ATTR_URL_PATH=T.ATTR_URL_FULL=T.ATTR_URL_FRAGMENT=T.ATTR_TELEMETRY_SDK_VERSION=T.ATTR_TELEMETRY_SDK_NAME=T.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS=T.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT=T.TELEMETRY_SDK_LANGUAGE_VALUE_RUST=T.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY=T.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON=T.TELEMETRY_SDK_LANGUAGE_VALUE_PHP=T.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS=T.TELEMETRY_SDK_LANGUAGE_VALUE_KOTLIN=T.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA=T.TELEMETRY_SDK_LANGUAGE_VALUE_GO=T.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG=T.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET=T.TELEMETRY_SDK_LANGUAGE_VALUE_CPP=T.ATTR_TELEMETRY_SDK_LANGUAGE=T.ATTR_TELEMETRY_DISTRO_VERSION=T.ATTR_TELEMETRY_DISTRO_NAME=T.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS=T.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS=T.SIGNALR_TRANSPORT_VALUE_LONG_POLLING=T.ATTR_SIGNALR_TRANSPORT=T.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT=T.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE=T.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN=T.ATTR_SIGNALR_CONNECTION_STATUS=T.ATTR_SERVICE_VERSION=T.ATTR_SERVICE_NAMESPACE=T.ATTR_SERVICE_NAME=T.ATTR_SERVICE_INSTANCE_ID=T.ATTR_SERVER_PORT=T.ATTR_SERVER_ADDRESS=T.ATTR_OTEL_STATUS_DESCRIPTION=T.OTEL_STATUS_CODE_VALUE_OK=T.OTEL_STATUS_CODE_VALUE_ERROR=T.ATTR_OTEL_STATUS_CODE=void 0;T.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT="aspnetcore.diagnostics.exception.result";T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED="aborted";T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED="handled";T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED="skipped";T.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED="unhandled";T.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE="aspnetcore.diagnostics.handler.type";T.ATTR_ASPNETCORE_RATE_LIMITING_POLICY="aspnetcore.rate_limiting.policy";T.ATTR_ASPNETCORE_RATE_LIMITING_RESULT="aspnetcore.rate_limiting.result";T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED="acquired";T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER="endpoint_limiter";T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER="global_limiter";T.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED="request_canceled";T.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED="aspnetcore.request.is_unhandled";T.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK="aspnetcore.routing.is_fallback";T.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS="aspnetcore.routing.match_status";T.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE="failure";T.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS="success";T.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED="aspnetcore.user.is_authenticated";T.ATTR_CLIENT_ADDRESS="client.address";T.ATTR_CLIENT_PORT="client.port";T.ATTR_CODE_COLUMN_NUMBER="code.column.number";T.ATTR_CODE_FILE_PATH="code.file.path";T.ATTR_CODE_FUNCTION_NAME="code.function.name";T.ATTR_CODE_LINE_NUMBER="code.line.number";T.ATTR_CODE_STACKTRACE="code.stacktrace";T.ATTR_CONTAINER_ID="container.id";T.ATTR_CONTAINER_IMAGE_NAME="container.image.name";T.ATTR_CONTAINER_IMAGE_REPO_DIGESTS="container.image.repo_digests";T.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";T.ATTR_DB_COLLECTION_NAME="db.collection.name";T.ATTR_DB_NAMESPACE="db.namespace";T.ATTR_DB_OPERATION_BATCH_SIZE="db.operation.batch.size";T.ATTR_DB_OPERATION_NAME="db.operation.name";T.ATTR_DB_QUERY_SUMMARY="db.query.summary";T.ATTR_DB_QUERY_TEXT="db.query.text";T.ATTR_DB_RESPONSE_STATUS_CODE="db.response.status_code";T.ATTR_DB_STORED_PROCEDURE_NAME="db.stored_procedure.name";T.ATTR_DB_SYSTEM_NAME="db.system.name";T.DB_SYSTEM_NAME_VALUE_MARIADB="mariadb";T.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER="microsoft.sql_server";T.DB_SYSTEM_NAME_VALUE_MYSQL="mysql";T.DB_SYSTEM_NAME_VALUE_POSTGRESQL="postgresql";T.ATTR_DEPLOYMENT_ENVIRONMENT_NAME="deployment.environment.name";T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT="development";T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION="production";T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING="staging";T.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST="test";T.ATTR_DOTNET_GC_HEAP_GENERATION="dotnet.gc.heap.generation";T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0="gen0";T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1="gen1";T.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2="gen2";T.DOTNET_GC_HEAP_GENERATION_VALUE_LOH="loh";T.DOTNET_GC_HEAP_GENERATION_VALUE_POH="poh";T.ATTR_ERROR_TYPE="error.type";T.ERROR_TYPE_VALUE_OTHER="_OTHER";T.ATTR_EXCEPTION_ESCAPED="exception.escaped";T.ATTR_EXCEPTION_MESSAGE="exception.message";T.ATTR_EXCEPTION_STACKTRACE="exception.stacktrace";T.ATTR_EXCEPTION_TYPE="exception.type";var L=(_)=>`http.request.header.${_}`;T.ATTR_HTTP_REQUEST_HEADER=L;T.ATTR_HTTP_REQUEST_METHOD="http.request.method";T.HTTP_REQUEST_METHOD_VALUE_OTHER="_OTHER";T.HTTP_REQUEST_METHOD_VALUE_CONNECT="CONNECT";T.HTTP_REQUEST_METHOD_VALUE_DELETE="DELETE";T.HTTP_REQUEST_METHOD_VALUE_GET="GET";T.HTTP_REQUEST_METHOD_VALUE_HEAD="HEAD";T.HTTP_REQUEST_METHOD_VALUE_OPTIONS="OPTIONS";T.HTTP_REQUEST_METHOD_VALUE_PATCH="PATCH";T.HTTP_REQUEST_METHOD_VALUE_POST="POST";T.HTTP_REQUEST_METHOD_VALUE_PUT="PUT";T.HTTP_REQUEST_METHOD_VALUE_TRACE="TRACE";T.ATTR_HTTP_REQUEST_METHOD_ORIGINAL="http.request.method_original";T.ATTR_HTTP_REQUEST_RESEND_COUNT="http.request.resend_count";var o=(_)=>`http.response.header.${_}`;T.ATTR_HTTP_RESPONSE_HEADER=o;T.ATTR_HTTP_RESPONSE_STATUS_CODE="http.response.status_code";T.ATTR_HTTP_ROUTE="http.route";T.ATTR_JVM_GC_ACTION="jvm.gc.action";T.ATTR_JVM_GC_NAME="jvm.gc.name";T.ATTR_JVM_MEMORY_POOL_NAME="jvm.memory.pool.name";T.ATTR_JVM_MEMORY_TYPE="jvm.memory.type";T.JVM_MEMORY_TYPE_VALUE_HEAP="heap";T.JVM_MEMORY_TYPE_VALUE_NON_HEAP="non_heap";T.ATTR_JVM_THREAD_DAEMON="jvm.thread.daemon";T.ATTR_JVM_THREAD_STATE="jvm.thread.state";T.JVM_THREAD_STATE_VALUE_BLOCKED="blocked";T.JVM_THREAD_STATE_VALUE_NEW="new";T.JVM_THREAD_STATE_VALUE_RUNNABLE="runnable";T.JVM_THREAD_STATE_VALUE_TERMINATED="terminated";T.JVM_THREAD_STATE_VALUE_TIMED_WAITING="timed_waiting";T.JVM_THREAD_STATE_VALUE_WAITING="waiting";T.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";T.ATTR_K8S_CLUSTER_UID="k8s.cluster.uid";T.ATTR_K8S_CONTAINER_NAME="k8s.container.name";T.ATTR_K8S_CONTAINER_RESTART_COUNT="k8s.container.restart_count";var s=(_)=>`k8s.cronjob.annotation.${_}`;T.ATTR_K8S_CRONJOB_ANNOTATION=s;var C=(_)=>`k8s.cronjob.label.${_}`;T.ATTR_K8S_CRONJOB_LABEL=C;T.ATTR_K8S_CRONJOB_NAME="k8s.cronjob.name";T.ATTR_K8S_CRONJOB_UID="k8s.cronjob.uid";var M=(_)=>`k8s.daemonset.annotation.${_}`;T.ATTR_K8S_DAEMONSET_ANNOTATION=M;var r=(_)=>`k8s.daemonset.label.${_}`;T.ATTR_K8S_DAEMONSET_LABEL=r;T.ATTR_K8S_DAEMONSET_NAME="k8s.daemonset.name";T.ATTR_K8S_DAEMONSET_UID="k8s.daemonset.uid";var U=(_)=>`k8s.deployment.annotation.${_}`;T.ATTR_K8S_DEPLOYMENT_ANNOTATION=U;var D=(_)=>`k8s.deployment.label.${_}`;T.ATTR_K8S_DEPLOYMENT_LABEL=D;T.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";T.ATTR_K8S_DEPLOYMENT_UID="k8s.deployment.uid";var p=(_)=>`k8s.job.annotation.${_}`;T.ATTR_K8S_JOB_ANNOTATION=p;var P=(_)=>`k8s.job.label.${_}`;T.ATTR_K8S_JOB_LABEL=P;T.ATTR_K8S_JOB_NAME="k8s.job.name";T.ATTR_K8S_JOB_UID="k8s.job.uid";var n=(_)=>`k8s.namespace.annotation.${_}`;T.ATTR_K8S_NAMESPACE_ANNOTATION=n;var V=(_)=>`k8s.namespace.label.${_}`;T.ATTR_K8S_NAMESPACE_LABEL=V;T.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";var x=(_)=>`k8s.node.annotation.${_}`;T.ATTR_K8S_NODE_ANNOTATION=x;var a=(_)=>`k8s.node.label.${_}`;T.ATTR_K8S_NODE_LABEL=a;T.ATTR_K8S_NODE_NAME="k8s.node.name";T.ATTR_K8S_NODE_UID="k8s.node.uid";var G=(_)=>`k8s.pod.annotation.${_}`;T.ATTR_K8S_POD_ANNOTATION=G;T.ATTR_K8S_POD_HOSTNAME="k8s.pod.hostname";T.ATTR_K8S_POD_IP="k8s.pod.ip";var i=(_)=>`k8s.pod.label.${_}`;T.ATTR_K8S_POD_LABEL=i;T.ATTR_K8S_POD_NAME="k8s.pod.name";T.ATTR_K8S_POD_START_TIME="k8s.pod.start_time";T.ATTR_K8S_POD_UID="k8s.pod.uid";var K=(_)=>`k8s.replicaset.annotation.${_}`;T.ATTR_K8S_REPLICASET_ANNOTATION=K;var c=(_)=>`k8s.replicaset.label.${_}`;T.ATTR_K8S_REPLICASET_LABEL=c;T.ATTR_K8S_REPLICASET_NAME="k8s.replicaset.name";T.ATTR_K8S_REPLICASET_UID="k8s.replicaset.uid";var H=(_)=>`k8s.statefulset.annotation.${_}`;T.ATTR_K8S_STATEFULSET_ANNOTATION=H;var d=(_)=>`k8s.statefulset.label.${_}`;T.ATTR_K8S_STATEFULSET_LABEL=d;T.ATTR_K8S_STATEFULSET_NAME="k8s.statefulset.name";T.ATTR_K8S_STATEFULSET_UID="k8s.statefulset.uid";T.ATTR_NETWORK_LOCAL_ADDRESS="network.local.address";T.ATTR_NETWORK_LOCAL_PORT="network.local.port";T.ATTR_NETWORK_PEER_ADDRESS="network.peer.address";T.ATTR_NETWORK_PEER_PORT="network.peer.port";T.ATTR_NETWORK_PROTOCOL_NAME="network.protocol.name";T.ATTR_NETWORK_PROTOCOL_VERSION="network.protocol.version";T.ATTR_NETWORK_TRANSPORT="network.transport";T.NETWORK_TRANSPORT_VALUE_PIPE="pipe";T.NETWORK_TRANSPORT_VALUE_QUIC="quic";T.NETWORK_TRANSPORT_VALUE_TCP="tcp";T.NETWORK_TRANSPORT_VALUE_UDP="udp";T.NETWORK_TRANSPORT_VALUE_UNIX="unix";T.ATTR_NETWORK_TYPE="network.type";T.NETWORK_TYPE_VALUE_IPV4="ipv4";T.NETWORK_TYPE_VALUE_IPV6="ipv6";T.ATTR_OTEL_EVENT_NAME="otel.event.name";T.ATTR_OTEL_SCOPE_NAME="otel.scope.name";T.ATTR_OTEL_SCOPE_VERSION="otel.scope.version";T.ATTR_OTEL_STATUS_CODE="otel.status_code";T.OTEL_STATUS_CODE_VALUE_ERROR="ERROR";T.OTEL_STATUS_CODE_VALUE_OK="OK";T.ATTR_OTEL_STATUS_DESCRIPTION="otel.status_description";T.ATTR_SERVER_ADDRESS="server.address";T.ATTR_SERVER_PORT="server.port";T.ATTR_SERVICE_INSTANCE_ID="service.instance.id";T.ATTR_SERVICE_NAME="service.name";T.ATTR_SERVICE_NAMESPACE="service.namespace";T.ATTR_SERVICE_VERSION="service.version";T.ATTR_SIGNALR_CONNECTION_STATUS="signalr.connection.status";T.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN="app_shutdown";T.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE="normal_closure";T.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT="timeout";T.ATTR_SIGNALR_TRANSPORT="signalr.transport";T.SIGNALR_TRANSPORT_VALUE_LONG_POLLING="long_polling";T.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS="server_sent_events";T.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS="web_sockets";T.ATTR_TELEMETRY_DISTRO_NAME="telemetry.distro.name";T.ATTR_TELEMETRY_DISTRO_VERSION="telemetry.distro.version";T.ATTR_TELEMETRY_SDK_LANGUAGE="telemetry.sdk.language";T.TELEMETRY_SDK_LANGUAGE_VALUE_CPP="cpp";T.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET="dotnet";T.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG="erlang";T.TELEMETRY_SDK_LANGUAGE_VALUE_GO="go";T.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA="java";T.TELEMETRY_SDK_LANGUAGE_VALUE_KOTLIN="kotlin";T.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS="nodejs";T.TELEMETRY_SDK_LANGUAGE_VALUE_PHP="php";T.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON="python";T.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY="ruby";T.TELEMETRY_SDK_LANGUAGE_VALUE_RUST="rust";T.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT="swift";T.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS="webjs";T.ATTR_TELEMETRY_SDK_NAME="telemetry.sdk.name";T.ATTR_TELEMETRY_SDK_VERSION="telemetry.sdk.version";T.ATTR_URL_FRAGMENT="url.fragment";T.ATTR_URL_FULL="url.full";T.ATTR_URL_PATH="url.path";T.ATTR_URL_QUERY="url.query";T.ATTR_URL_SCHEME="url.scheme";T.ATTR_USER_AGENT_ORIGINAL="user_agent.original"});var Uu=w(function(O){Object.defineProperty(O,"__esModule",{value:!0});O.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS=O.METRIC_KESTREL_UPGRADED_CONNECTIONS=O.METRIC_KESTREL_TLS_HANDSHAKE_DURATION=O.METRIC_KESTREL_REJECTED_CONNECTIONS=O.METRIC_KESTREL_QUEUED_REQUESTS=O.METRIC_KESTREL_QUEUED_CONNECTIONS=O.METRIC_KESTREL_CONNECTION_DURATION=O.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES=O.METRIC_KESTREL_ACTIVE_CONNECTIONS=O.METRIC_JVM_THREAD_COUNT=O.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC=O.METRIC_JVM_MEMORY_USED=O.METRIC_JVM_MEMORY_LIMIT=O.METRIC_JVM_MEMORY_COMMITTED=O.METRIC_JVM_GC_DURATION=O.METRIC_JVM_CPU_TIME=O.METRIC_JVM_CPU_RECENT_UTILIZATION=O.METRIC_JVM_CPU_COUNT=O.METRIC_JVM_CLASS_UNLOADED=O.METRIC_JVM_CLASS_LOADED=O.METRIC_JVM_CLASS_COUNT=O.METRIC_HTTP_SERVER_REQUEST_DURATION=O.METRIC_HTTP_CLIENT_REQUEST_DURATION=O.METRIC_DOTNET_TIMER_COUNT=O.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT=O.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT=O.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH=O.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET=O.METRIC_DOTNET_PROCESS_CPU_TIME=O.METRIC_DOTNET_PROCESS_CPU_COUNT=O.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS=O.METRIC_DOTNET_JIT_COMPILED_METHODS=O.METRIC_DOTNET_JIT_COMPILED_IL_SIZE=O.METRIC_DOTNET_JIT_COMPILATION_TIME=O.METRIC_DOTNET_GC_PAUSE_TIME=O.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE=O.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE=O.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE=O.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED=O.METRIC_DOTNET_GC_COLLECTIONS=O.METRIC_DOTNET_EXCEPTIONS=O.METRIC_DOTNET_ASSEMBLY_COUNT=O.METRIC_DB_CLIENT_OPERATION_DURATION=O.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS=O.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS=O.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION=O.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE=O.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS=O.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES=O.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS=void 0;O.METRIC_SIGNALR_SERVER_CONNECTION_DURATION=void 0;O.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS="aspnetcore.diagnostics.exceptions";O.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES="aspnetcore.rate_limiting.active_request_leases";O.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS="aspnetcore.rate_limiting.queued_requests";O.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE="aspnetcore.rate_limiting.request.time_in_queue";O.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION="aspnetcore.rate_limiting.request_lease.duration";O.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS="aspnetcore.rate_limiting.requests";O.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS="aspnetcore.routing.match_attempts";O.METRIC_DB_CLIENT_OPERATION_DURATION="db.client.operation.duration";O.METRIC_DOTNET_ASSEMBLY_COUNT="dotnet.assembly.count";O.METRIC_DOTNET_EXCEPTIONS="dotnet.exceptions";O.METRIC_DOTNET_GC_COLLECTIONS="dotnet.gc.collections";O.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED="dotnet.gc.heap.total_allocated";O.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE="dotnet.gc.last_collection.heap.fragmentation.size";O.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE="dotnet.gc.last_collection.heap.size";O.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE="dotnet.gc.last_collection.memory.committed_size";O.METRIC_DOTNET_GC_PAUSE_TIME="dotnet.gc.pause.time";O.METRIC_DOTNET_JIT_COMPILATION_TIME="dotnet.jit.compilation.time";O.METRIC_DOTNET_JIT_COMPILED_IL_SIZE="dotnet.jit.compiled_il.size";O.METRIC_DOTNET_JIT_COMPILED_METHODS="dotnet.jit.compiled_methods";O.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS="dotnet.monitor.lock_contentions";O.METRIC_DOTNET_PROCESS_CPU_COUNT="dotnet.process.cpu.count";O.METRIC_DOTNET_PROCESS_CPU_TIME="dotnet.process.cpu.time";O.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET="dotnet.process.memory.working_set";O.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH="dotnet.thread_pool.queue.length";O.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT="dotnet.thread_pool.thread.count";O.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT="dotnet.thread_pool.work_item.count";O.METRIC_DOTNET_TIMER_COUNT="dotnet.timer.count";O.METRIC_HTTP_CLIENT_REQUEST_DURATION="http.client.request.duration";O.METRIC_HTTP_SERVER_REQUEST_DURATION="http.server.request.duration";O.METRIC_JVM_CLASS_COUNT="jvm.class.count";O.METRIC_JVM_CLASS_LOADED="jvm.class.loaded";O.METRIC_JVM_CLASS_UNLOADED="jvm.class.unloaded";O.METRIC_JVM_CPU_COUNT="jvm.cpu.count";O.METRIC_JVM_CPU_RECENT_UTILIZATION="jvm.cpu.recent_utilization";O.METRIC_JVM_CPU_TIME="jvm.cpu.time";O.METRIC_JVM_GC_DURATION="jvm.gc.duration";O.METRIC_JVM_MEMORY_COMMITTED="jvm.memory.committed";O.METRIC_JVM_MEMORY_LIMIT="jvm.memory.limit";O.METRIC_JVM_MEMORY_USED="jvm.memory.used";O.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC="jvm.memory.used_after_last_gc";O.METRIC_JVM_THREAD_COUNT="jvm.thread.count";O.METRIC_KESTREL_ACTIVE_CONNECTIONS="kestrel.active_connections";O.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES="kestrel.active_tls_handshakes";O.METRIC_KESTREL_CONNECTION_DURATION="kestrel.connection.duration";O.METRIC_KESTREL_QUEUED_CONNECTIONS="kestrel.queued_connections";O.METRIC_KESTREL_QUEUED_REQUESTS="kestrel.queued_requests";O.METRIC_KESTREL_REJECTED_CONNECTIONS="kestrel.rejected_connections";O.METRIC_KESTREL_TLS_HANDSHAKE_DURATION="kestrel.tls_handshake.duration";O.METRIC_KESTREL_UPGRADED_CONNECTIONS="kestrel.upgraded_connections";O.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS="signalr.server.active_connections";O.METRIC_SIGNALR_SERVER_CONNECTION_DURATION="signalr.server.connection.duration"});var zu=w(function(t){Object.defineProperty(t,"__esModule",{value:!0});t.EVENT_EXCEPTION=void 0;t.EVENT_EXCEPTION="exception"});
|
|
3
3
|
export{Bu,Uu,zu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m,S,t,Z,Ue,A,ut,Ct,fm}from"./chunk-vvr8tnse.js";import"./chunk-nv7tztvh.js";import"./chunk-dzjmwat0.js";import"./chunk-zasjhrwc.js";import"./chunk-fb1bes2h.js";import"./chunk-bf5m8f6t.js";import"./chunk-rx9g95wk.js";import"./chunk-113baw0m.js";import"./chunk-eex8sjfs.js";import"./chunk-v3z63tpw.js";import"./chunk-kfewyax2.js";import"./chunk-zzzgk1d5.js";import"./chunk-a23q1kc4.js";import"./chunk-4yhvexzk.js";import{Qn}from"./chunk-treyx8em.js";import{tr}from"./chunk-ra5csbkr.js";import"./chunk-3tg10kwz.js";import"./chunk-fg9sr6r9.js";import"./chunk-hjzbw975.js";import"./chunk-5m51b7af.js";import"./chunk-emgyjhmx.js";import"./chunk-01ym2agz.js";import"./chunk-hjwpd09v.js";import"./chunk-8s9fehda.js";S();function l(){let{projectId:o,folderId:n}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=ut();m(()=>{a(o)},[o,a]);let{data:s}=tr(fm(o)),e=s?.rootFolder,{data:i}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!i)return t(Ct,{});return t(Qn,{teamId:r,projectId:o,projectName:s.name??"",assetId:n,rootFolderId:e})}var c=Ue("/projects/$projectId/folders/$folderId")({component:l});export{c as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P,m,_,u,S,L,t,o,V,Z,A,I,O,Tn,Tt,ve,ht,tr,rr,de,we,Ne,E,f_,p_,__,P_,Nf,ih,ay,ky,rb,nb,gr,Hh,Yf,rp,ug,mS,bS,jS,Sg,Pp,zd,jI,XT,Gp,Vp,C1,_n,Qp,ce,ut,Or,kn,xi,Le,Ze,Be,Ue,ne,Io,Qs,$t,ur}from"./chunk-42hrvk6k.js";import{vn}from"./chunk-wnqxyqrg.js";import{_u,Ks}from"./chunk-ryepy5er.js";import{Mo}from"./chunk-15w79661.js";var qe=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ie=I("brain",qe);S();function Ii({projectId:p,contextAssetId:N,file:h,currentTime:le,frameRate:j,startTimecode:U,formatTimestamp:F,onTyping:me,onSelectMessage:X,selectedMessageId:ue}){let{isHistoryMode:x,setIsHistoryMode:R,currentSessionId:pe,chatAssets:fe,removeAsset:ge,messages:v,historySessions:G,isStreaming:C,fetchHistorySessions:Y,loadSession:xe,deleteSession:he,startNewSession:ee,sendMessage:be,abortActiveSession:ye,selectedAgentId:M,setSelectedAgentId:q,inputText:ke,setInputText:_e}=ur(),{teamId:f,ensureTeamIdForProject:te}=ut(),{videoTimeDisplayMode:Se}=$t(),[D,H]=u(null);m(()=>{if(p)te(p)},[p,te]);let{data:Te=[],isSuccess:re}=Z({queryKey:["chat-agents",p],queryFn:async()=>{if(!p)return[];let e=await A.api.projects[":projectId"]["chat-agents"].$get({param:{projectId:p}});if(!e.ok)throw Error("failed to fetch agents");return e.json()},enabled:!!p}),T=Te.filter((e)=>e.type==="chat"&&e.enabled);m(()=>{if(!re)return;if(T.length>0){if(!T.some((r)=>r.id===M))q(T[0].id)}else if(M!==null)q(null)},[re,T,M,q]);let oe=_(null),B=_(null),Q=_(!0),K=_(!0);m(()=>{K.current=!0,Q.current=!0},[p,N,x]),m(()=>{let e=B.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let{scrollTop:r,isAtBottom:l}=ur.getState(),s=setTimeout(()=>{if(l)e.scrollTop=e.scrollHeight;else e.scrollTop=r;let c=setTimeout(()=>{K.current=!1},50);return()=>clearTimeout(c)},0);return()=>clearTimeout(s)},[p,N,x]),m(()=>{let e=B.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let r=()=>{if(K.current)return;let l=e.scrollTop,s=e.scrollHeight-l-e.clientHeight<10;ur.getState().setScrollState(l,s)};return e.addEventListener("scroll",r),()=>{e.removeEventListener("scroll",r)}},[p,N,x]);let{ref:Ce,isDropTarget:Ae}=Or({id:"chatbot-sidebar",data:{type:"chatbot-sidebar"}});m(()=>{if(!x){let{isAtBottom:e}=ur.getState();if(e||C){let r=Q.current?"auto":"smooth";oe.current?.scrollIntoView({behavior:r})}Q.current=!1}},[v,C,x]),m(()=>{if(x&&f)Y(f)},[x,Y,f]);let w=V(),Me=P(()=>{w.invalidateQueries({queryKey:["search"]}),w.invalidateQueries({queryKey:["folders"]}),w.invalidateQueries({queryKey:["files"]}),w.invalidateQueries({queryKey:["file"]}),w.invalidateQueries({queryKey:["version_stacks"]}),w.invalidateQueries({queryKey:["projects"]})},[w]),z=(e)=>{if(typeof e==="string")return e;if(Array.isArray(e))return e.map((r)=>{if(typeof r==="string")return r;if(r&&typeof r==="object"&&"type"in r&&r.type==="text"&&"text"in r)return String(r.text);return""}).join("");return""},se=(e)=>e.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:"),je=(e)=>{switch(e.role){case"user":case"custom":{let r=e;if(e.role==="custom"&&r.customType==="context_display_info"){let c=r.details?.assets||[];if(c.length===0)return null;return o("div",{className:"text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1",children:[t("div",{className:"font-semibold",children:p_()}),t("ul",{className:"list-disc list-inside space-y-0.5",children:c.map((n)=>o("li",{className:"truncate",children:[n.name," ",o("span",{className:"text-muted-foreground/70",children:["(",n.type,")"]})]},n.id))})]},e.id)}if(e.role==="user"||r.customType==="shumai_message"){let s=r.details,c=s?.referencedAssets||[],n=s?.attachedFiles||[],i=s?.position,g=s?.annotation||s?.annotations&&s.annotations.length>0,d=!s?.currentAsset?.id||N&&s.currentAsset.id===N||h?.id&&s.currentAsset.id===h.id,b=ue===e.id,k="";if(i?.type==="time")if(F)k=F(i.seconds);else if(j){let a=Math.round(i.seconds*j);k=vn(a,j,Se,U)}else{let a=Math.floor(i.seconds/60),y=Math.floor(i.seconds%60);k=`${a.toString().padStart(2,"0")}:${y.toString().padStart(2,"0")}`}else if(i?.type==="page")k=Sg({page:i.page});let ae=z(r.content),Re=n.length>0||c.length>0;return t("div",{onClick:()=>{if(d&&X)X(e)},className:E("flex flex-col items-end w-full group transition-all duration-150",d&&(g||i)&&"cursor-pointer"),children:o("div",{className:E("bg-primary text-primary-foreground rounded-lg px-3 py-2 text-sm whitespace-pre-wrap shadow-xs break-words transition-all border",Re?"w-full":"max-w-[85%]",b?"border-blue-500 dark:border-blue-400":"border-transparent"),children:[o("div",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:[g&&t("span",{className:"inline-flex items-center align-middle mr-1.5 p-0.5 rounded bg-primary-foreground/20 text-primary-foreground",title:ay(),children:t(xi,{className:"w-3.5 h-3.5"})}),i&&t("span",{className:"inline-flex items-center align-middle mr-1.5 px-1.5 py-0.5 rounded text-xs font-mono font-bold bg-primary-foreground/20 text-primary-foreground",children:k}),ae&&t("span",{children:ae})]}),n.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:__()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:n.map((a)=>{let y=a.name||"file",W=Qs(y)||a.mediaType==="image"||a.mimeType?.startsWith("image/");return o("div",{className:E("group/att relative flex items-center w-full max-w-full rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",W?"h-18 p-1.5 gap-2.5 cursor-pointer":"h-9 px-2.5 gap-2.5"),onClick:(J)=>{if(J.stopPropagation(),a.url)if(W)H({url:a.url,name:y});else window.open(a.url,"_blank","noreferrer")},children:[W&&a.url?t("div",{className:"h-full aspect-square rounded-md overflow-hidden bg-black/20 shrink-0",children:t("img",{src:a.url,alt:y,className:"w-full h-full object-cover group-hover/att:scale-105 transition-transform duration-200"})}):t(tr,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("div",{className:"min-w-0 flex-1 overflow-hidden",children:t("p",{className:"text-xs font-medium text-primary-foreground truncate block w-full",title:y,children:y})}),a.url&&t("a",{href:a.url,target:"_blank",rel:"noreferrer",download:y,className:"p-1 text-primary-foreground/70 hover:text-primary-foreground shrink-0 rounded-md hover:bg-primary-foreground/20 transition-colors opacity-0 group-hover/att:opacity-100",onClick:(J)=>J.stopPropagation(),title:gr(),children:t(ht,{className:"w-3.5 h-3.5"})})]},a.id)})})]}),c.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:f_()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:c.map((a)=>o("div",{className:"flex items-center justify-between w-full h-9 px-2.5 rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",children:[o("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[a.type==="folder"?t(rr,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}):t(tr,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("span",{className:"text-xs font-medium truncate text-primary-foreground",title:a.name,children:a.name})]}),t("span",{className:"text-[10px] text-primary-foreground/60 uppercase shrink-0 font-mono ml-2",children:a.type})]},a.id))})]})]})},e.id)}let l=r.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:z(l)},e.id)}case"assistant":{let l=e.content;if(!l)return null;let s=[];if(l.forEach((n,i)=>{if(!n||typeof n!=="object")return;let g=n;switch(g.type){case"text":{let d=g.text;if(typeof d!=="string"||!d.trim())return;s.push(t("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:t(Io,{components:{pre:({node:b,...k})=>t("pre",{className:"whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm",...k})},children:se(d)})},`txt-${i}`));break}case"thinking":{let d=g.thinking;if(typeof d!=="string"||!d.trim())return;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-muted/20 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-medium text-muted-foreground select-none cursor-pointer hover:bg-muted/40 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(ie,{className:"h-3.5 w-3.5 text-primary/70 animate-pulse"}),t("span",{children:Pp()||"Thinking"}),t(ve,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),t("div",{className:"p-3 pt-0 text-xs text-muted-foreground/90 border-t border-border/40 bg-muted/10 leading-relaxed prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap font-sans",children:t(Io,{children:se(d)})})]},`think-${i}`));break}case"toolCall":{let d=String(g.name||g.toolName||_n()),b=g.arguments||g.args;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-violet-500/5 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-semibold text-violet-600 dark:text-violet-400 select-none cursor-pointer hover:bg-violet-500/10 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(Mo,{className:"h-3.5 w-3.5"}),t("span",{children:Nf()}),t("span",{className:"font-mono bg-violet-500/10 px-1.5 py-0.5 rounded text-[11px] text-violet-700 dark:text-violet-300",children:d}),t(ve,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),!!b&&o("div",{className:"p-3 pt-0 text-[10px] text-muted-foreground/90 border-t border-border/40 bg-violet-500/5 font-sans",children:[t("div",{className:"text-[9px] text-muted-foreground/60 uppercase font-bold tracking-wider mb-1.5",children:Gp()||"Arguments"}),t("pre",{className:"font-mono bg-muted/30 p-2 rounded border border-border/30 overflow-x-auto max-h-32",children:JSON.stringify(b,null,2)})]})]},`tool-${i}`));break}case"image":{let d=String(g.mimeType||"image/png"),b=String(g.data||"");s.push(t("div",{className:"my-2 max-w-full",children:b?t("img",{src:b.startsWith("data:")?b:`data:${d};base64,${b}`,alt:"Attached asset",className:"max-h-60 rounded border border-border/50 object-contain shadow-xs"}):t("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Yf()})},`img-${i}`));break}default:{let d=JSON.stringify(n,null,2);if(d==="{}")return;s.push(t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:d},`other-${i}`))}}}),s.length===0)return null;let c=!1;if(l.length>0){let n=l[l.length-1];if(typeof n==="string"&&n.trim().length>0)c=!0;else if(n&&typeof n==="object"){let i=n;if(i.type==="text"&&typeof i.text==="string"&&i.text.trim().length>0)c=!0}}return o("div",{className:"flex flex-col w-full space-y-1",children:[t("div",{className:"space-y-2 w-full",children:s}),c&&t("div",{className:"text-[10px] text-muted-foreground self-start italic pt-1",children:ky()})]},e.id)}case"toolResult":return t("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/40 p-2 rounded-md border border-border/50",children:t("span",{className:"font-semibold",children:Vp({name:e.toolName||"tool"})})},e.id);case"thinking_level_change":{let l=e.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:z(l)},e.id)}default:return null}};return o("div",{ref:Ce,className:E("relative flex flex-col h-full bg-background transition-colors duration-200 min-h-0"),children:[Ae&&t("div",{className:"absolute inset-0 bg-accent/30 border-2 border-primary z-50 pointer-events-none flex items-center justify-center p-6 text-center animate-in fade-in duration-150",children:o("div",{className:"bg-background/95 text-foreground px-4 py-3 rounded-xl border border-border/80 flex flex-col items-center gap-2 shadow-lg max-w-[80%] animate-in zoom-in-95 duration-150",children:[t(Tt,{className:"h-6 w-6 text-primary animate-bounce"}),t("span",{className:"text-sm font-semibold text-foreground",children:ih()})]})}),o("div",{className:"h-12 border-b border-border flex items-center justify-between px-4 flex-shrink-0 bg-background/50 backdrop-blur-sm",children:[o("div",{className:"flex items-center gap-2",children:[x&&t("button",{onClick:()=>R(!1),className:"p-1 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:P_(),children:t(_u,{className:"h-4 w-4"})}),t(Tt,{className:"h-5 w-5 text-primary"}),t("span",{className:"font-semibold text-sm",children:x?Hh():jI()})]}),t("div",{className:"flex items-center gap-1",children:!x?o(L,{children:[t("button",{onClick:ee,className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:ug(),children:t(de,{className:"h-4 w-4"})}),t("button",{onClick:()=>R(!0),className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:Hh(),children:t(Tn,{className:"h-4 w-4"})})]}):o("button",{onClick:()=>{ee(),R(!1)},className:"flex items-center gap-1 text-xs bg-primary text-primary-foreground px-2.5 py-1 rounded-md hover:bg-primary/90 transition-colors shadow-xs cursor-pointer",children:[t(de,{className:"h-3.5 w-3.5"}),t("span",{children:ug()})]})})]}),x?t(ce,{className:"flex-1 p-3",children:G.length===0?t("div",{className:"text-center text-xs text-muted-foreground py-8",children:bS()}):t("div",{className:"space-y-1",children:G.map((e)=>{let r=e.id===pe;return o("div",{onClick:()=>{if(f)xe(f,e.id),R(!1)},className:E("group flex items-center justify-between p-2.5 rounded-lg text-xs cursor-pointer transition-all border border-transparent",r?"bg-accent/80 text-accent-foreground font-medium border-border/40":"hover:bg-muted/60 text-muted-foreground hover:text-foreground"),children:[o("div",{className:"flex flex-col min-w-0 pr-2",children:[t("span",{className:"truncate text-foreground font-medium text-xs",children:e.name||Qp()}),t("span",{className:"text-[10px] text-muted-foreground",children:kn(e.updatedAt)})]}),t("button",{onClick:(l)=>{if(l.stopPropagation(),f&&window.confirm(nb()))he(f,e.id)},className:"opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-destructive p-1 rounded hover:bg-muted cursor-pointer",title:rb(),children:t(we,{className:"h-4 w-4"})})]},e.id)})})}):o(L,{children:[t(ce,{ref:B,className:"flex-1 p-4 min-h-0 [&>div>div]:!block",children:v.length===0?o("div",{className:"flex flex-col items-center justify-center h-48 border-2 border-dashed border-border rounded-lg text-muted-foreground p-4 text-center",children:[t(Tt,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),t("p",{className:"text-sm",children:ih()})]}):o("div",{className:"space-y-4 pb-4",children:[v.map(je),C&&v.length>0&&(v[v.length-1].role==="user"||v[v.length-1].customType==="shumai_message")&&o("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground italic",children:[t(O,{className:"h-3 w-3 animate-spin text-primary"}),t("span",{children:XT()})]}),t("div",{ref:oe})]})}),t("div",{className:"p-2 flex-shrink-0 bg-background",children:t(Ks,{projectId:p,value:ke,onChangeText:_e,placeholder:C1(),disabled:!M||!f,isStreaming:C,onAbort:()=>{if(f)ye(f)},allowMentions:!1,allowAttachments:!0,workspaceAssets:fe,onRemoveWorkspaceAsset:ge,allowMarkup:!0,canMarkup:!!h&&["image","video","pdf"].includes(h.proxyType||""),markupDisabledTooltip:!h?jS():rp(),allowTimestamp:h?.proxyType==="video"||h?.proxyType==="pdf",currentTime:le,frameRate:j||h?.media?.metadata?.frameRate||30,startTimecode:U||h?.media?.metadata?.startTimecode,formatTimestamp:F||(h?.proxyType==="pdf"?(e)=>Sg({page:Math.round(e)}):void 0),onTyping:me,onSendMessage:(e,r,l,s,c,n)=>{if(!f)return;be(f,e,p,N,Me,r,l,c,n)},bottomLeftExtra:t("div",{className:"flex items-center gap-1.5 min-w-0 max-w-full",children:T.length>0?o(Le,{value:M||"",onValueChange:(e)=>q(e),disabled:C,children:[t(Be,{className:"h-8 border-none bg-transparent hover:bg-muted text-muted-foreground hover:text-foreground focus:ring-0 focus:ring-offset-0 px-2 py-0 gap-1.5 text-xs shrink-0 select-none shadow-none max-w-full cursor-pointer",children:t(Ze,{placeholder:zd()})}),t(Ue,{children:T.map((e)=>t(ne,{value:e.id,className:"cursor-pointer",children:o("div",{className:"flex items-center gap-2",children:[e.avatar?t("img",{src:e.avatar,alt:e.name,className:"w-4 h-4 rounded-full object-cover"}):t(Tt,{className:"w-4 h-4 text-muted-foreground"}),t("span",{className:"text-xs",children:e.name})]})},e.id))})]}):t("div",{className:"flex items-center gap-1.5 px-2 py-1 text-[11px] text-muted-foreground/60 italic select-none",children:t("span",{children:mS()})})})})})]}),D&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>H(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50 cursor-pointer",children:t(Ne,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:D.url,alt:D.name,className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),H(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:D.name})]})]})}
|
|
2
|
-
export{
|
|
1
|
+
import{P,m,_,u,S,L,t,o,G,Z,A,I,O,Tn,Tt,ve,ht,ar,lr,fe,we,Pe,E,p_,m_,y_,N_,Df,ch,ly,Ry,nb,ob,gr,Gh,Jf,np,fg,mS,bS,jS,Cg,Np,zd,jI,JT,Vp,Qp,E1,An,Kp,ue,ut,Or,kn,Si,Fe,Le,Ze,Be,ne,Io,Ks,$t,ur}from"./chunk-vvr8tnse.js";import{vn}from"./chunk-bf5m8f6t.js";import{_u,Ws}from"./chunk-rx9g95wk.js";import{Mo}from"./chunk-fg9sr6r9.js";var Re=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ie=I("brain",Re);S();function Ti({projectId:p,contextAssetId:N,file:h,currentTime:le,frameRate:j,startTimecode:J,formatTimestamp:F,onTyping:de,onSelectMessage:U,selectedMessageId:me}){let{isHistoryMode:x,setIsHistoryMode:R,currentSessionId:ce,chatAssets:pe,removeAsset:ge,messages:v,historySessions:X,isStreaming:C,fetchHistorySessions:Y,loadSession:xe,deleteSession:he,startNewSession:ee,sendMessage:be,abortActiveSession:ye,selectedAgentId:M,setSelectedAgentId:q,inputText:ke,setInputText:Ne}=ur(),{teamId:f,ensureTeamIdForProject:te}=ut(),{videoTimeDisplayMode:_e}=$t(),[D,H]=u(null);m(()=>{if(p)te(p)},[p,te]);let{data:Se=[],isSuccess:re}=Z({queryKey:["chat-agents",p],queryFn:async()=>{if(!p)return[];let e=await A.api.projects[":projectId"]["chat-agents"].$get({param:{projectId:p}});if(!e.ok)throw Error("failed to fetch agents");return e.json()},enabled:!!p}),T=Se.filter((e)=>e.type==="chat"&&e.enabled);m(()=>{if(!re)return;if(T.length>0){if(!T.some((r)=>r.id===M))q(T[0].id)}else if(M!==null)q(null)},[re,T,M,q]);let oe=_(null),B=_(null),Q=_(!0),K=_(!0);m(()=>{K.current=!0,Q.current=!0},[p,N,x]),m(()=>{let e=B.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let{scrollTop:r,isAtBottom:l}=ur.getState(),s=setTimeout(()=>{if(l)e.scrollTop=e.scrollHeight;else e.scrollTop=r;let c=setTimeout(()=>{K.current=!1},50);return()=>clearTimeout(c)},0);return()=>clearTimeout(s)},[p,N,x]),m(()=>{let e=B.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!e)return;let r=()=>{if(K.current)return;let l=e.scrollTop,s=e.scrollHeight-l-e.clientHeight<10;ur.getState().setScrollState(l,s)};return e.addEventListener("scroll",r),()=>{e.removeEventListener("scroll",r)}},[p,N,x]);let{ref:Te,isDropTarget:Ce}=Or({id:"chatbot-sidebar",data:{type:"chatbot-sidebar"}});m(()=>{if(!x){let{isAtBottom:e}=ur.getState();if(e||C){let r=Q.current?"auto":"smooth";oe.current?.scrollIntoView({behavior:r})}Q.current=!1}},[v,C,x]),m(()=>{if(x&&f)Y(f)},[x,Y,f]);let w=G(),Ae=P(()=>{w.invalidateQueries({queryKey:["search"]}),w.invalidateQueries({queryKey:["folders"]}),w.invalidateQueries({queryKey:["files"]}),w.invalidateQueries({queryKey:["file"]}),w.invalidateQueries({queryKey:["version_stacks"]}),w.invalidateQueries({queryKey:["projects"]})},[w]),z=(e)=>{if(typeof e==="string")return e;if(Array.isArray(e))return e.map((r)=>{if(typeof r==="string")return r;if(r&&typeof r==="object"&&"type"in r&&r.type==="text"&&"text"in r)return String(r.text);return""}).join("");return""},se=(e)=>e.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:"),Me=(e)=>{switch(e.role){case"user":case"custom":{let r=e;if(e.role==="custom"&&r.customType==="context_display_info"){let c=r.details?.assets||[];if(c.length===0)return null;return o("div",{className:"text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1",children:[t("div",{className:"font-semibold",children:m_()}),t("ul",{className:"list-disc list-inside space-y-0.5",children:c.map((n)=>o("li",{className:"truncate",children:[n.name," ",o("span",{className:"text-muted-foreground/70",children:["(",n.type,")"]})]},n.id))})]},e.id)}if(e.role==="user"||r.customType==="shumai_message"){let s=r.details,c=s?.referencedAssets||[],n=s?.attachedFiles||[],i=s?.position,g=s?.annotation||s?.annotations&&s.annotations.length>0,d=!s?.currentAsset?.id||N&&s.currentAsset.id===N||h?.id&&s.currentAsset.id===h.id,b=me===e.id,k="";if(i?.type==="time")if(F)k=F(i.seconds);else if(j){let a=Math.round(i.seconds*j);k=vn(a,j,_e,J)}else{let a=Math.floor(i.seconds/60),y=Math.floor(i.seconds%60);k=`${a.toString().padStart(2,"0")}:${y.toString().padStart(2,"0")}`}else if(i?.type==="page")k=Cg({page:i.page});let ae=z(r.content),je=n.length>0||c.length>0;return t("div",{onClick:()=>{if(d&&U)U(e)},className:E("flex flex-col items-end w-full group transition-all duration-150",d&&(g||i)&&"cursor-pointer"),children:o("div",{className:E("bg-primary text-primary-foreground rounded-lg px-3 py-2 text-sm whitespace-pre-wrap shadow-xs break-words transition-all border",je?"w-full":"max-w-[85%]",b?"border-blue-500 dark:border-blue-400":"border-transparent"),children:[o("div",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:[g&&t("span",{className:"inline-flex items-center align-middle mr-1.5 p-0.5 rounded bg-primary-foreground/20 text-primary-foreground",title:ly(),children:t(Si,{className:"w-3.5 h-3.5"})}),i&&t("span",{className:"inline-flex items-center align-middle mr-1.5 px-1.5 py-0.5 rounded text-xs font-mono font-bold bg-primary-foreground/20 text-primary-foreground",children:k}),ae&&t("span",{children:ae})]}),n.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:y_()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:n.map((a)=>{let y=a.name||"file",V=Ks(y)||a.mediaType==="image"||a.mimeType?.startsWith("image/");return o("div",{className:E("group/att relative flex items-center w-full max-w-full rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",V?"h-18 p-1.5 gap-2.5 cursor-pointer":"h-9 px-2.5 gap-2.5"),onClick:(W)=>{if(W.stopPropagation(),a.url)if(V)H({url:a.url,name:y});else window.open(a.url,"_blank","noreferrer")},children:[V&&a.url?t("div",{className:"h-full aspect-square rounded-md overflow-hidden bg-black/20 shrink-0",children:t("img",{src:a.url,alt:y,className:"w-full h-full object-cover group-hover/att:scale-105 transition-transform duration-200"})}):t(ar,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("div",{className:"min-w-0 flex-1 overflow-hidden",children:t("p",{className:"text-xs font-medium text-primary-foreground truncate block w-full",title:y,children:y})}),a.url&&t("a",{href:a.url,target:"_blank",rel:"noreferrer",download:y,className:"p-1 text-primary-foreground/70 hover:text-primary-foreground shrink-0 rounded-md hover:bg-primary-foreground/20 transition-colors opacity-0 group-hover/att:opacity-100",onClick:(W)=>W.stopPropagation(),title:gr(),children:t(ht,{className:"w-3.5 h-3.5"})})]},a.id)})})]}),c.length>0&&o("div",{className:"mt-2.5 w-full",children:[t("div",{className:"text-xs font-medium text-primary-foreground/70 mb-1",children:p_()}),t("div",{className:"flex flex-col gap-1.5 w-full",children:c.map((a)=>o("div",{className:"flex items-center justify-between w-full h-9 px-2.5 rounded-lg border border-primary-foreground/15 bg-primary-foreground/10 hover:bg-primary-foreground/15 transition-colors overflow-hidden",children:[o("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[a.type==="folder"?t(lr,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}):t(ar,{className:"w-4 h-4 text-primary-foreground/70 shrink-0"}),t("span",{className:"text-xs font-medium truncate text-primary-foreground",title:a.name,children:a.name})]}),t("span",{className:"text-[10px] text-primary-foreground/60 uppercase shrink-0 font-mono ml-2",children:a.type})]},a.id))})]})]})},e.id)}let l=r.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:z(l)},e.id)}case"assistant":{let l=e.content;if(!l)return null;let s=[];if(l.forEach((n,i)=>{if(!n||typeof n!=="object")return;let g=n;switch(g.type){case"text":{let d=g.text;if(typeof d!=="string"||!d.trim())return;s.push(t("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:t(Io,{components:{pre:({node:b,...k})=>t("pre",{className:"whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm",...k})},children:se(d)})},`txt-${i}`));break}case"thinking":{let d=g.thinking;if(typeof d!=="string"||!d.trim())return;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-muted/20 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-medium text-muted-foreground select-none cursor-pointer hover:bg-muted/40 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(ie,{className:"h-3.5 w-3.5 text-primary/70 animate-pulse"}),t("span",{children:Np()||"Thinking"}),t(ve,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),t("div",{className:"p-3 pt-0 text-xs text-muted-foreground/90 border-t border-border/40 bg-muted/10 leading-relaxed prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap font-sans",children:t(Io,{children:se(d)})})]},`think-${i}`));break}case"toolCall":{let d=String(g.name||g.toolName||An()),b=g.arguments||g.args;s.push(o("details",{className:"group border border-border/50 rounded-lg bg-violet-500/5 my-2 overflow-hidden",children:[o("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-semibold text-violet-600 dark:text-violet-400 select-none cursor-pointer hover:bg-violet-500/10 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[t(Mo,{className:"h-3.5 w-3.5"}),t("span",{children:Df()}),t("span",{className:"font-mono bg-violet-500/10 px-1.5 py-0.5 rounded text-[11px] text-violet-700 dark:text-violet-300",children:d}),t(ve,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),!!b&&o("div",{className:"p-3 pt-0 text-[10px] text-muted-foreground/90 border-t border-border/40 bg-violet-500/5 font-sans",children:[t("div",{className:"text-[9px] text-muted-foreground/60 uppercase font-bold tracking-wider mb-1.5",children:Vp()||"Arguments"}),t("pre",{className:"font-mono bg-muted/30 p-2 rounded border border-border/30 overflow-x-auto max-h-32",children:JSON.stringify(b,null,2)})]})]},`tool-${i}`));break}case"image":{let d=String(g.mimeType||"image/png"),b=String(g.data||"");s.push(t("div",{className:"my-2 max-w-full",children:b?t("img",{src:b.startsWith("data:")?b:`data:${d};base64,${b}`,alt:"Attached asset",className:"max-h-60 rounded border border-border/50 object-contain shadow-xs"}):t("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Jf()})},`img-${i}`));break}default:{let d=JSON.stringify(n,null,2);if(d==="{}")return;s.push(t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:d},`other-${i}`))}}}),s.length===0)return null;let c=!1;if(l.length>0){let n=l[l.length-1];if(typeof n==="string"&&n.trim().length>0)c=!0;else if(n&&typeof n==="object"){let i=n;if(i.type==="text"&&typeof i.text==="string"&&i.text.trim().length>0)c=!0}}return o("div",{className:"flex flex-col w-full space-y-1",children:[t("div",{className:"space-y-2 w-full",children:s}),c&&t("div",{className:"text-[10px] text-muted-foreground self-start italic pt-1",children:Ry()})]},e.id)}case"toolResult":return t("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/40 p-2 rounded-md border border-border/50",children:t("span",{className:"font-semibold",children:Qp({name:e.toolName||"tool"})})},e.id);case"thinking_level_change":{let l=e.content||"";return t("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:z(l)},e.id)}default:return null}};return o("div",{ref:Te,className:E("relative flex flex-col h-full bg-background transition-colors duration-200 min-h-0"),children:[Ce&&t("div",{className:"absolute inset-0 bg-accent/30 border-2 border-primary z-50 pointer-events-none flex items-center justify-center p-6 text-center animate-in fade-in duration-150",children:o("div",{className:"bg-background/95 text-foreground px-4 py-3 rounded-xl border border-border/80 flex flex-col items-center gap-2 shadow-lg max-w-[80%] animate-in zoom-in-95 duration-150",children:[t(Tt,{className:"h-6 w-6 text-primary animate-bounce"}),t("span",{className:"text-sm font-semibold text-foreground",children:ch()})]})}),o("div",{className:"h-12 border-b border-border flex items-center justify-between px-4 flex-shrink-0 bg-background/50 backdrop-blur-sm",children:[o("div",{className:"flex items-center gap-2",children:[x&&t("button",{onClick:()=>R(!1),className:"p-1 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:N_(),children:t(_u,{className:"h-4 w-4"})}),t(Tt,{className:"h-5 w-5 text-primary"}),t("span",{className:"font-semibold text-sm",children:x?Gh():jI()})]}),t("div",{className:"flex items-center gap-1",children:!x?o(L,{children:[t("button",{onClick:ee,className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:fg(),children:t(fe,{className:"h-4 w-4"})}),t("button",{onClick:()=>R(!0),className:"p-1.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:Gh(),children:t(Tn,{className:"h-4 w-4"})})]}):o("button",{onClick:()=>{ee(),R(!1)},className:"flex items-center gap-1 text-xs bg-primary text-primary-foreground px-2.5 py-1 rounded-md hover:bg-primary/90 transition-colors shadow-xs cursor-pointer",children:[t(fe,{className:"h-3.5 w-3.5"}),t("span",{children:fg()})]})})]}),x?t(ue,{className:"flex-1 p-3",children:X.length===0?t("div",{className:"text-center text-xs text-muted-foreground py-8",children:bS()}):t("div",{className:"space-y-1",children:X.map((e)=>{let r=e.id===ce;return o("div",{onClick:()=>{if(f)xe(f,e.id),R(!1)},className:E("group flex items-center justify-between p-2.5 rounded-lg text-xs cursor-pointer transition-all border border-transparent",r?"bg-accent/80 text-accent-foreground font-medium border-border/40":"hover:bg-muted/60 text-muted-foreground hover:text-foreground"),children:[o("div",{className:"flex flex-col min-w-0 pr-2",children:[t("span",{className:"truncate text-foreground font-medium text-xs",children:e.name||Kp()}),t("span",{className:"text-[10px] text-muted-foreground",children:kn(e.updatedAt)})]}),t("button",{onClick:(l)=>{if(l.stopPropagation(),f&&window.confirm(ob()))he(f,e.id)},className:"opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-destructive p-1 rounded hover:bg-muted cursor-pointer",title:nb(),children:t(we,{className:"h-4 w-4"})})]},e.id)})})}):o(L,{children:[t(ue,{ref:B,className:"flex-1 p-4 min-h-0 [&>div>div]:!block",children:v.length===0?o("div",{className:"flex flex-col items-center justify-center h-48 border-2 border-dashed border-border rounded-lg text-muted-foreground p-4 text-center",children:[t(Tt,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),t("p",{className:"text-sm",children:ch()})]}):o("div",{className:"space-y-4 pb-4",children:[v.map(Me),C&&v.length>0&&(v[v.length-1].role==="user"||v[v.length-1].customType==="shumai_message")&&o("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground italic",children:[t(O,{className:"h-3 w-3 animate-spin text-primary"}),t("span",{children:JT()})]}),t("div",{ref:oe})]})}),t("div",{className:"p-2 flex-shrink-0 bg-background",children:t(Ws,{projectId:p,value:ke,onChangeText:Ne,placeholder:E1(),disabled:!M||!f,isStreaming:C,onAbort:()=>{if(f)ye(f)},allowMentions:!1,allowAttachments:!0,workspaceAssets:pe,onRemoveWorkspaceAsset:ge,allowMarkup:!0,canMarkup:!!h&&["image","video","pdf"].includes(h.proxyType||""),markupDisabledTooltip:!h?jS():np(),allowTimestamp:h?.proxyType==="video"||h?.proxyType==="pdf",currentTime:le,frameRate:j||h?.media?.metadata?.frameRate||30,startTimecode:J||h?.media?.metadata?.startTimecode,formatTimestamp:F||(h?.proxyType==="pdf"?(e)=>Cg({page:Math.round(e)}):void 0),onTyping:de,onSendMessage:(e,r,l,s,c,n)=>{if(!f)return;be(f,e,p,N,Ae,r,l,c,n)},bottomLeftExtra:t("div",{className:"flex items-center gap-1.5 min-w-0 max-w-full",children:T.length>0?o(Fe,{value:M||"",onValueChange:(e)=>q(e),disabled:C,children:[t(Ze,{className:"h-8 border-none bg-transparent hover:bg-muted text-muted-foreground hover:text-foreground focus:ring-0 focus:ring-offset-0 px-2 py-0 gap-1.5 text-xs shrink-0 select-none shadow-none max-w-full cursor-pointer",children:t(Le,{placeholder:zd()})}),t(Be,{children:T.map((e)=>t(ne,{value:e.id,className:"cursor-pointer",children:o("div",{className:"flex items-center gap-2",children:[e.avatar?t("img",{src:e.avatar,alt:e.name,className:"w-4 h-4 rounded-full object-cover"}):t(Tt,{className:"w-4 h-4 text-muted-foreground"}),t("span",{className:"text-xs",children:e.name})]})},e.id))})]}):t("div",{className:"flex items-center gap-1.5 px-2 py-1 text-[11px] text-muted-foreground/60 italic select-none",children:t("span",{children:mS()})})})})})]}),D&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>H(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50 cursor-pointer",children:t(Pe,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:D.url,alt:D.name,className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),H(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:D.name})]})]})}
|
|
2
|
+
export{Ti};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P,m,D,_,u,S,L,t,o,V,Z,B,mt,A,I,Sr,O,Fo,Pe,ve,on,Et,ht,tr,we,Ne,E,C,ge,ra,Ae,_e,K,Wr,Vt,ms,hs,gs,Tf,De,md,ct,jc,qc,gr,Ad,zb,ov,Oa,Xf,ip,fg,pg,Fa,Tg,yp,Zo,Gn,qd,Xe,et,tt,rt,nt,ot,st,it,ue,ae,pe,qe,le,z,ce,Ot,Nt,M,Eo,Co,Yr,Rn,he,vs,jr,of}from"./chunk-42hrvk6k.js";import{ws,xs,Fr,hu,gu,rs,ns,Ss,Cs}from"./chunk-04avc4fn.js";import{Ga,pu}from"./chunk-6jkjx0n2.js";import{Ks}from"./chunk-ryepy5er.js";var ut=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Ge=I("pencil",ut);S();S();function Ye({teamId:c,projectId:s,file:r,onSaveField:d,members:T,onCommentSelect:x,hideAnnotationControl:F=!1,readOnly:b=!1,publicFields:v,isPublic:p=!1,shareId:y,currentTime:Q,onTyping:ee,selectedCommentId:h,heightPercent:j,onHeightPercentChange:G}){let{canEdit:H}=Ot(s),{fields:i,setFields:X}=Fr(),se=V(),{ref:oe,inView:de}=Nt(),[a,U]=u(null),[Ce,te]=u(!1),[me,Ee]=u(null),Y=_(!1),ze=_(0),q=_(j),je=(e)=>{Y.current=!0,ze.current=e.clientY,q.current=j,e.target.setPointerCapture?.(e.pointerId)},Ie=P((e)=>{if(!Y.current)return;let w=(ze.current-e.clientY)/window.innerHeight*100,ne=Math.min(85,Math.max(10,q.current+w));G(ne)},[G]),ke=(e)=>{Y.current=!1;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}},{data:J}=Z({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s&&!v}),k=rs(r);m(()=>{if(v)X(v,s);else if(J)X(J,s)},[J,v,s,X]);let{data:fe,fetchNextPage:W,hasNextPage:Te}=mt({queryKey:p?["shares",y,"files",r?.id,"comments"]:["files",r?.id,"comments"],queryFn:async({pageParam:e})=>{if(p){let l=localStorage.getItem(`share_pwd_${y}`)||"",w=await A.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:y,fileId:r.id},query:{after:e}},{headers:{"x-share-password":l}});if(!w.ok)throw Error("Failed to fetch comments");return await w.json()}else{let l=await A.api.files[":fileId"].comments.$get({param:{fileId:r.id},query:{after:e}});if(!l.ok)throw Error("Failed to fetch comments");return await l.json()}},enabled:!!r?.id&&(!p||!!y),initialPageParam:"",refetchInterval:2000,getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{mutate:Me}=B({mutationFn:async({text:e,attachmentIds:l,annotations:w,replyToId:ne,guestUserId:xe,second:be})=>{if(p){let ie=localStorage.getItem(`share_pwd_${y}`)||"",Be=await A.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:y,fileId:r.id},json:{message:e,attachmentIds:l,replyToId:ne??void 0,annotations:w,second:be??void 0}},{headers:{"x-share-password":ie,...xe?{"x-guest-user-id":xe}:{}}});if(!Be.ok)throw Error("Failed to create comment");return await Be.json()}else{let ie=await A.api.files[":fileId"].comments.$post({param:{fileId:r.id},json:{message:e,attachmentIds:l,replyToId:ne??void 0,annotations:w,second:be??void 0}});if(!ie.ok)throw Error("Failed to create comment");return await ie.json()}},onSuccess:()=>{se.invalidateQueries({queryKey:p?["shares",y,"files",r?.id,"comments"]:["files",r?.id,"comments"]})},onError:()=>{M.error(ov?.()||"Failed to post comment")}}),Se=fe?.pages?.[0]?.pageInfo?.total??fe?.pages.reduce((e,l)=>e+(l.data?.length||0),0)??0;m(()=>{if(de&&Te)W()},[de,W,Te]);let R=D(()=>(r?.fieldValues||[]).reduce((e,l)=>(e[l.fieldId]=l,e),{}),[r?.fieldValues]),re=D(()=>[...i].sort((e,l)=>{let w=e.config?.name?.toLowerCase()||"",ne=l.config?.name?.toLowerCase()||"";if(w<ne)return-1;if(w>ne)return 1;return 0}),[i]),Le=fe?.pages.flatMap((e)=>e.data??[])??[],Ve=(e,l,w=[],ne,xe)=>{if(!e.trim()&&l.length===0&&w.length===0)return;let be=ne||a?.id||null;if(p){let ie=localStorage.getItem(`guest_user_id_${y}`);if(!ie)Ee({text:e,attachmentIds:l,annotations:w,replyToId:be,second:xe}),te(!0);else Me({text:e,attachmentIds:l,annotations:w,replyToId:be,guestUserId:ie,second:xe})}else Me({text:e,attachmentIds:l,annotations:w,replyToId:be,second:xe});U(null)},He=(e)=>{if(me)Me({...me,guestUserId:e}),Ee(null),U(null)},Fe=(e)=>{let l=T.find((w)=>w.id===e);if(l)return l;return{id:"unknown",name:"Unknown",role:"unknown"}},Re=j<=15;return o("div",{style:{height:`${j}dvh`},className:"shrink-0 flex flex-col bg-background border-t border-border shadow-2xl rounded-t-2xl overflow-hidden select-none z-20","data-testid":"mobile-bottom-sheet",children:[t("div",{onPointerDown:je,onPointerMove:Ie,onPointerUp:ke,onPointerCancel:ke,className:"w-full pt-2 pb-1.5 flex flex-col items-center justify-center cursor-grab active:cursor-grabbing touch-none shrink-0","aria-label":"Drag to resize bottom sheet",children:t("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/50 transition-colors"})}),o(Eo,{defaultValue:"comments",className:"flex-1 flex flex-col min-h-0 px-2 pb-1 overflow-hidden",children:[o(Co,{className:"w-full shrink-0 h-9 bg-muted/60 p-1",children:[o(Yr,{value:"comments",className:"flex-1 text-xs font-semibold py-1",children:[md()," ",Se>0&&`(${Se})`]}),t(Yr,{value:"fields",className:"flex-1 text-xs font-semibold py-1",children:Oa()})]}),o(Rn,{value:"comments",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Re&&"hidden"),children:[t("div",{className:"flex items-center justify-between px-2 pb-1.5 shrink-0 border-b border-border/50",children:o("span",{className:"text-xs font-bold text-foreground",children:[Tf?.()||"All comments",Se>0?` (${Se})`:""]})}),t(ce,{className:"flex-1 min-h-0 px-2 py-2 [&>div>div]:block!",children:Le.length===0?t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:pg()}):o("div",{className:"space-y-3",children:[Le.map((e)=>o("div",{children:[t(Ga,{teamId:c,message:e,getUser:Fe,onReply:U,hasReplies:!!e.replies?.length,formatTimestamp:k?.commentsConfig?.formatTimestamp,frameRate:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:h===e.id,onSelect:()=>{x?.(e)},readOnly:b,isPublic:p}),e.replies?.map((l,w)=>t("div",{children:t(Ga,{teamId:c,isReply:!0,message:l,getUser:Fe,onReply:U,hasReplies:!1,isLastReply:w===(e.replies?.length??0)-1,formatTimestamp:k?.commentsConfig?.formatTimestamp,frameRate:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:h===l.id,onSelect:()=>{x?.(l)},readOnly:b,isPublic:p})},l.id))]},e.id)),t("div",{ref:oe})]})}),(!b||p)&&t("div",{className:"mt-auto shrink-0 bg-background border-t border-border pt-1",children:t(pu,{isOpen:Ce,onClose:()=>te(!1),onSuccess:He,children:t(Ks,{projectId:s,onSendMessage:Ve,replyingTo:a,onCancelReply:()=>U(null),hideAnnotationControl:F,disableMentions:p,currentTime:k?.commentsConfig?.hasTimestamp?Q:void 0,formatTimestamp:k?.commentsConfig?.formatTimestamp,frameRate:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,onTyping:ee})})})]}),t(Rn,{value:"fields",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Re&&"hidden"),children:t(ce,{className:"flex-1 px-3 py-2 min-h-0 [&>div>div]:block!",children:re&&re.length>0?t("div",{className:"space-y-4 pb-6",children:re.map((e)=>o("div",{className:"space-y-1.5",children:[t("label",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:e.config?.name}),t("div",{className:"min-h-[32px]",children:t(Cs,{fieldId:e.id,config:e.config,value:R[e.id]?.value,onSave:H?(l)=>d(e.id,l):void 0,readOnly:b||e.readOnly||!H})})]},e.id))}):t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:"No custom fields defined"})})})]})]})}function We({fileName:c,folderName:s,version:r,versions:d,activeFileId:T,isPublic:x=!1,shareId:F,allowDownload:b=!0,downloadInfo:v,canEdit:p=!1,onBack:y,onPrevFile:Q,onNextFile:ee,hasPrevFile:h=!1,hasNextFile:j=!1,onSelectVersion:G,onRename:H,onDelete:i,onLinkedTasks:X,linkedTaskCount:se=0}){let oe=async(a)=>{try{let U=x&&F?await A.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:F,fileId:T},json:{key:a}}):await A.api.files["download-url"].$post({json:{key:a,assetId:T}});if(!U.ok)return;let{url:Ce}=await U.json(),te=document.createElement("a");te.href=Ce,te.download="",document.body.appendChild(te),te.click(),document.body.removeChild(te)}catch{}},de=(v?.videoTranscodes?.length??0)>0;return o("header",{className:"flex h-12 w-full items-center justify-between border-b border-border bg-card px-2 py-1.5 shrink-0 select-none z-30",children:[t("div",{className:"flex items-center",children:t(C,{variant:"ghost",size:"icon",onClick:y,className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":yp(),children:t(on,{className:"h-5 w-5"})})}),o("div",{className:"flex flex-1 items-center justify-center gap-1 min-w-0 px-1",children:[o("div",{className:"flex items-center min-w-0 max-w-[65vw]",children:[s&&o(L,{children:[t("span",{className:"truncate text-xs font-medium text-muted-foreground max-w-[80px]",children:s}),t("span",{className:"text-muted-foreground mx-1 text-xs",children:"/"})]}),d&&d.length>1?o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:o("button",{className:"flex items-center gap-1 min-w-0 truncate text-xs font-medium text-foreground hover:bg-accent rounded px-1 py-0.5 transition-colors cursor-pointer",children:[t("span",{className:"truncate max-w-[120px] font-semibold",children:c}),r!==void 0&&o(he,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]}),t(ve,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),o(_e,{align:"center",className:"w-48 z-40",children:[t(Wr,{className:"text-xs",children:qd()}),d.map((a)=>o(K,{onClick:()=>G?.(a.id),className:E("flex items-center justify-between text-xs cursor-pointer",a.id===T?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:a.name||c})]},a.id))]})]}):o("div",{className:"flex items-center gap-1 min-w-0 truncate",children:[t("span",{className:"truncate text-xs font-semibold text-foreground max-w-[140px]",children:c}),r!==void 0&&o(he,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]})]})]}),(h||j)&&o("div",{className:"flex items-center gap-0.5 shrink-0 bg-muted/60 rounded p-0.5 ml-1",children:[t(C,{variant:"ghost",size:"icon",disabled:!h,onClick:Q,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Tg(),"aria-label":Tg(),children:t(on,{className:"h-3.5 w-3.5"})}),t(C,{variant:"ghost",size:"icon",disabled:!j,onClick:ee,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:fg(),"aria-label":fg(),children:t(Et,{className:"h-3.5 w-3.5"})})]})]}),t("div",{className:"flex items-center gap-1",children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t(C,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":ip(),children:t(Sr,{className:"h-4 w-4"})})}),o(_e,{align:"end",className:"w-52 z-40",children:[b&&(de?o(ms,{children:[o(hs,{className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(ht,{className:"h-3.5 w-3.5"}),t("span",{children:gr()})]}),t(ra,{children:o(gs,{className:"w-48 z-50",children:[t(Wr,{className:"text-xs",children:gr()}),v?.videoTranscodes?.map((a)=>{let U=vs(a),Ce=a.hdr?`${U} (HDR)`:U;return o(K,{onClick:()=>oe(a.key),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:Ce}),t("span",{className:"text-[10px] text-muted-foreground",children:"MP4"})]},a.key||`${U}-${a.hdr?"hdr":"sdr"}`)}),v?.originalKey&&o(L,{children:[t(Vt,{}),o(K,{onClick:()=>oe(v.originalKey),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:Fa?.()||"Original"}),t("span",{className:"text-[10px] text-muted-foreground",children:c.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):o(K,{onClick:()=>v?.originalKey&&oe(v.originalKey),disabled:!v?.originalKey,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(ht,{className:"h-3.5 w-3.5"}),t("span",{children:gr()})]})),d&&d.length>1&&G&&o(ms,{children:[t(hs,{className:"flex items-center gap-2 text-xs cursor-pointer",children:t("span",{children:qd?.()||"Switch version"})}),t(ra,{children:o(gs,{className:"w-48 z-50",children:[t(Wr,{className:"text-xs",children:qd?.()||"Switch version"}),d.map((a)=>o(K,{onClick:()=>G(a.id),className:E("flex items-center justify-between text-xs cursor-pointer",a.id===T?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px]",children:a.name||c})]},a.id))]})})]}),X&&o(K,{onClick:X,className:"flex items-center justify-between text-xs cursor-pointer",children:[o("span",{className:"flex items-center gap-2",children:[t(Fo,{className:"h-3.5 w-3.5"}),t("span",{children:Xf?.()||"Linked Tasks"})]}),se>0&&t("span",{className:"inline-flex items-center justify-center px-1.5 py-0.2 text-[10px] font-semibold rounded-full bg-muted-foreground/15 text-foreground",children:se})]}),p&&H&&o(K,{onClick:H,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(Ge,{className:"h-3.5 w-3.5"}),t("span",{children:Zo()})]}),p&&i&&o(L,{children:[t(Vt,{}),o(K,{onClick:i,className:"flex items-center gap-2 text-xs text-destructive focus:text-destructive cursor-pointer",children:[t(we,{className:"h-3.5 w-3.5"}),t("span",{children:ct()})]})]})]})]})})]})}function jl({projectId:c,teamId:s="",fileId:r,file:d,projectInfo:T,ancestorFolders:x=[],versions:F,activeFileId:b,startTime:v,isPublic:p=!1,shareId:y,allowDownload:Q=!0,publicFields:ee,siblingFiles:h=[],onNavigateToFile:j,onNavigateBack:G,onRenameFile:H,onDeleteFile:i,onSaveField:X,onSelectVersion:se}){let{canEdit:oe}=Ot(c),{members:de}=jr(),a=_(null),[U,Ce]=u(50),[te,me]=u([]),[Ee,Y]=u(0),[ze,q]=u(null),[je,Ie]=u(!1),[ke,J]=u(""),k=_(null),[fe,W]=u(!1),[Te,Me]=u(!1),[Se,R]=u(!1),[re,Le]=u(!1),{data:Ve}=Z({queryKey:["teams",s,"kanban","assets",b,"tasks"],queryFn:async()=>{if(!s||!b||p)return{data:[],total:0};let f=await A.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:s,assetId:b}});if(!f.ok)return{data:[],total:0};return await f.json()},enabled:!!s&&!!b&&!p}),He=Ve?.total??Ve?.data?.length??0,{prevFile:Fe,nextFile:Re}=D(()=>{if(!h||h.length===0)return{prevFile:null,nextFile:null};let f=h.findIndex((ye)=>ye.id===r||ye.id===b);if(f===-1)return{prevFile:null,nextFile:null};return{prevFile:f>0?h[f-1]:null,nextFile:f<h.length-1?h[f+1]:null}},[h,r,b]),e=x.length>0?x[0]?.name:T?.name,w=F?.find((f)=>f.id===b)?.version??(F&&F.length>0?F.length:void 0),ne=D(()=>({originalKey:d.media?.original?.key,videoTranscodes:d.media?.videoTranscodes?.map((f)=>({key:f.key,width:f.width,height:f.height,resolution:f.resolution,hdr:f.hdr}))}),[d.media]),xe=()=>{me([]),q(null)},be=()=>{me([]),q(null)},ie=(f)=>{q(f.id||null);let ye=f.annotations;if(ye&&ye.length>0)me(ye);else me([]);if(f.second!==null&&f.second!==void 0)a.current?.seekTo(f.second),a.current?.pause();else if(ye&&ye.length>0)a.current?.pause()},Be=async(f)=>{if(f?.preventDefault(),!ke.trim()||!H)return;try{Me(!0),await H(ke.trim()),Ie(!1)}finally{Me(!1)}},$e=async()=>{if(!i)return;try{W(!0),await i(),R(!1)}finally{W(!1)}};return m(()=>{Y(0),q(null),me([])},[d?.id]),o("div",{className:"flex h-[100dvh] w-full flex-col bg-background overflow-hidden relative",children:[t(We,{fileName:d.name,folderName:e,version:w,versions:F,activeFileId:b,isPublic:p,shareId:y,allowDownload:Q,downloadInfo:ne,canEdit:oe,onBack:G,hasPrevFile:!!Fe,hasNextFile:!!Re,onPrevFile:()=>Fe&&j(Fe.id),onNextFile:()=>Re&&j(Re.id),onSelectVersion:se,onRename:()=>{J(d.name),Ie(!0)},onDelete:()=>R(!0),onLinkedTasks:!p?()=>Le(!0):void 0,linkedTaskCount:He}),t("div",{className:"relative flex-1 min-h-0 bg-background overflow-hidden flex flex-col",children:t(ns,{file:d,mediaControllerRef:a,onPlay:xe,onTimeUpdate:Y,onSeek:be,annotations:te,startTime:v,shareId:y,allowDownload:Q})}),t(Ye,{teamId:s,projectId:c,file:d,onSaveField:X,members:de,onCommentSelect:ie,hideAnnotationControl:d.proxyType==="audio",readOnly:p||!oe,publicFields:ee,isPublic:p,shareId:y,currentTime:Ee,onTyping:()=>a.current?.pause(),selectedCommentId:ze,heightPercent:U,onHeightPercentChange:Ce}),!p&&re&&t(of,{teamId:s,assetId:b,assetName:d.name,isOpen:re,onClose:()=>Le(!1)}),!p&&t(ue,{open:je,onOpenChange:Ie,children:t(ae,{children:o("form",{onSubmit:Be,children:[t(pe,{children:t(le,{children:Zo()})}),t("div",{className:"py-4",children:t(z,{ref:k,value:ke,onChange:(f)=>J(f.target.value),placeholder:Ad?.()||"Enter new name",onFocus:()=>{setTimeout(()=>{if(k.current)Ss(k.current)},0)},autoFocus:!0})}),o(qe,{children:[t(C,{type:"button",variant:"outline",onClick:()=>Ie(!1),children:De()}),o(C,{type:"submit",disabled:Te||!ke.trim(),children:[Te&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),Gn()]})]})]})})}),!p&&t(Xe,{open:Se,onOpenChange:R,children:o(et,{children:[o(tt,{children:[t(nt,{children:qc?.()||"Delete Asset?"}),t(ot,{children:jc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(rt,{children:[t(it,{children:De()}),o(st,{onClick:$e,disabled:fe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[fe&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),ct()]})]})]})})]})}S();function Je({activeState:c,activeAsset:s,previewUrl:r,isFullScreen:d,onTogglePlay:T,onToggleLoop:x,onSeek:F,onVolumeChange:b,onToggleMute:v,onChangePlaybackRate:p,onChangeResolution:y,onZoomIn:Q,onZoomOut:ee,onFit:h,onDownload:j,onToggleFullScreen:G,allowDownload:H=!0}){if(c?.kind==="video"&&c.video&&s){let i=c.video,X=i.totalFrames/i.frameRate,se=i.currentFrame/i.frameRate,oe={isPlaying:i.isPlaying,progress:X>0?se/X*100:0,currentTime:se,duration:X,volume:i.volume,isMuted:i.isMuted,isLooping:i.isLooping,playbackRate:i.playbackRate,isFullScreen:d,showFrames:!1,currentResolution:i.currentResolution,isCurrentHdr:i.isCurrentHdr,activeAutoResolution:i.activeAutoResolution,isHlsManualSupported:i.isHlsManualSupported,isLoading:i.isLoading},de=r&&!s.media?.videoPreview?{...s,media:{...s.media,videoPreview:{url:r}}}:s;return t(hu,{state:oe,zoom:c.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:i.buffered,data:de,resolutions:i.resolutions,togglePlay:T,toggleLoop:x,toggleMute:v,handleVolumeChange:b,changePlaybackRate:p,changeResolution:(a)=>y(a.resolution,a.hdr),handleDownload:(a)=>j(a),toggleFullScreen:G,onZoomChange:(a)=>a>=c.zoom?Q():ee(),onZoomReset:h,frameRate:i.frameRate,totalFrames:i.totalFrames,currentFrame:i.currentFrame,seekToFrame:F,allowDownload:H})}if(c?.kind==="image")return t(gu,{zoom:c.zoom,onZoomIn:Q,onZoomOut:ee,onFit:h,onDownload:()=>j(),canDownload:!!s?.media?.original?.key,fullscreen:{isFullScreen:d,onToggle:G},allowDownload:H});return t("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:t("button",{onClick:G,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:d?t(xs,{className:"h-5 w-5"}):t(ws,{className:"h-5 w-5"})})})}function Ze({side:c,fileName:s,version:r,activeVersionId:d,versions:T,isActive:x,onActivate:F,onSwitchVersion:b,onExit:v}){let p=E("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",x?"text-foreground":"text-muted-foreground hover:text-foreground"),y=t("button",{onClick:v,title:zb(),className:p,children:t(Ne,{className:"h-4 w-4"})}),Q=o("button",{onClick:F,className:E("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",x?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t("span",{className:"truncate",children:s}),r!==void 0&&o("span",{className:E("flex-shrink-0 rounded border px-1 py-0 text-xs",x?"border-foreground/40":"border-border"),children:["v",r]})]}),ee=o(ge,{children:[t(Ae,{onClick:F,title:qd(),className:p,children:t(ve,{className:"h-4 w-4"})}),t(_e,{align:c==="left"?"start":"end",className:"w-80 p-1",children:t("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:T.map((h)=>{let j=h.id===d;return o(K,{onClick:()=>b(h.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[o("div",{className:"flex min-w-[2rem] flex-shrink-0 items-center justify-center rounded-full bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground select-none",children:["v",h.version]}),t("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:h.previewUrl?t("img",{src:h.previewUrl,alt:h.name||void 0,className:"h-full w-full object-cover"}):t(tr,{className:"h-4 w-4 text-muted-foreground"})}),o("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[t("span",{className:"truncate text-sm font-semibold text-foreground",children:h.name}),t("span",{className:"truncate text-xs text-muted-foreground",children:h.creator?.name||"Unknown"})]}),j&&t(Pe,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},h.id)})})})]});return t("div",{onMouseDown:F,className:E("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",x?"border-b-2 border-primary":"border-border"),children:c==="left"?o(L,{children:[y,Q,ee]}):o(L,{children:[Q,ee,t("div",{className:"ml-auto"}),y]})})}function at(c,s,r){return Z({queryKey:s?["public-share-file",r,c,localStorage.getItem(`share_pwd_${r}`)||""]:["files",c],queryFn:async()=>{if(s){let T=localStorage.getItem(`share_pwd_${r}`)||"",x=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:c}},{headers:{"x-share-password":T}});if(!x.ok)throw Error("Failed to fetch version asset");return await x.json()}let d=await A.api.files[":fileId"].$get({param:{fileId:c}});if(!d.ok)throw Error("Failed to fetch version asset");return await d.json()},enabled:!!c&&(!s||!!r)})}function ql({isPublic:c=!1,shareId:s,versions:r,leftId:d,rightId:T,activeSide:x,annotations:F,seekRequest:b,onActiveSideChange:v,onSwitchVersion:p,onExit:y,onActiveAssetChange:Q,onPlay:ee,onTimeUpdate:h,allowDownload:j=!0}){let G=_(null),H=_(null),i=_(null),[X,se]=u(null),[oe,de]=u(null),[a,U]=u(1),[Ce,te]=u(!1),[me,Ee]=u(!1),{data:Y,isLoading:ze}=at(d,c,s),{data:q,isLoading:je}=at(T,c,s),Ie=rs(Y),ke=rs(q),J=!!Y&&!!q&&Ie.id===ke.id,k=x==="left"?Y:q,fe=x==="left"?X:oe,W=P(()=>x==="left"?H.current:i.current,[x]),Te=P(()=>x==="left"?i.current:H.current,[x]);m(()=>{Q(k??null)},[k,Q]),m(()=>{if(!b)return;let n=W();if(n?.seekToSecond(b.second),n?.pause(),J){let g=Te();g?.seekToSecond(b.second),g?.pause()}},[b?.nonce]),m(()=>{let n=()=>Ee(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]);let Me=P((n)=>se(n),[]),Se=P((n)=>de(n),[]),R=P((n)=>{let g=W();if(g)n(g);if(J){let N=Te();if(N)n(N)}},[W,Te,J]),re=P(()=>{let n=!fe?.video?.isPlaying;R((g)=>n?g.play():g.pause())},[fe?.video?.isPlaying,R]);m(()=>{let n=(g)=>{let N=document.activeElement;if(N&&(N.tagName==="INPUT"||N.tagName==="TEXTAREA"||N instanceof HTMLElement&&N.isContentEditable))return;let Ue=g.key===" ",Oe=N&&(N.tagName==="BUTTON"||N.tagName==="A"||N.tagName==="SELECT"||N.tagName==="OPTION"||N.getAttribute("role")==="button"||N.getAttribute("role")==="link"||N.getAttribute("role")==="checkbox"||N.getAttribute("role")==="radio"||N.getAttribute("role")==="menuitem");if(Ue&&Oe)return;if(g.key===" "||g.key.toLowerCase()==="k")g.preventDefault(),re()};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[re]);let Le=P((n)=>R((g)=>g.seekToFrame(n)),[R]),Ve=P(()=>W()?.toggleLoop(),[W]),He=P((n)=>{U(n),te(n===0)},[]),Fe=P(()=>te((n)=>!n),[]),Re=P((n)=>R((g)=>g.setPlaybackRate(n)),[R]),e=P((n,g)=>W()?.changeResolution(n,g),[W]),l=P(()=>R((n)=>n.zoomBy(1.2)),[R]),w=P(()=>R((n)=>n.zoomBy(0.8)),[R]),ne=P(()=>R((n)=>n.fit()),[R]),xe=P((n)=>{W()?.download(n)},[W]),be=P(()=>{let n=G.current;if(!n||typeof n.requestFullscreen!=="function")return;if(!document.fullscreenElement)n.requestFullscreen().catch(()=>{});else if(document.exitFullscreen)document.exitFullscreen().catch(()=>{})},[]),ie=P((n,g)=>{if(J)i.current?.panBy(n,g)},[J]),Be=P((n,g)=>{if(J)H.current?.panBy(n,g)},[J]),$e=P(()=>re(),[re]),f=P((n)=>r.find((g)=>g.id===n)?.version,[r]),ye=D(()=>k?.media?.videoPreview?.url,[k?.media?.videoPreview?.url]),Qe=(n,g)=>{let Ue=rs(g)?.comparePane;if(!Ue)return t("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:t("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let Oe=x===n;return t(Ue,{ref:n==="left"?H:i,file:g,shareId:s,isActive:Oe,annotations:Oe?F:[],onStateChange:n==="left"?Me:Se,onUserPan:n==="left"?ie:Be,onActivate:()=>v(n),muted:Oe?Ce:!0,volume:a,onPlay:ee,onTimeUpdate:h,onRequestTogglePlay:$e},g.id)},lt=!!Y&&!!q,dt=ze||je;return o("div",{ref:G,className:"flex h-full flex-1 flex-col bg-background",children:[o("div",{className:"flex min-h-0 flex-1",children:[o("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[Y&&t(Ze,{side:"left",fileName:Y.name,version:f(d),activeVersionId:d,versions:r,isActive:x==="left",onActivate:()=>v("left"),onSwitchVersion:(n)=>p("left",n),onExit:y}),t("div",{className:"relative flex min-h-0 flex-1",children:Y?Qe("left",Y):t("div",{className:"flex flex-1 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),o("div",{className:"flex min-w-0 flex-1 flex-col",children:[q&&t(Ze,{side:"right",fileName:q.name,version:f(T),activeVersionId:T,versions:r,isActive:x==="right",onActivate:()=>v("right"),onSwitchVersion:(n)=>p("right",n),onExit:y}),t("div",{className:"relative flex min-h-0 flex-1",children:q?Qe("right",q):t("div",{className:"flex flex-1 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),dt&&!lt&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})}),t(Je,{activeState:fe,activeAsset:k??null,previewUrl:ye,isFullScreen:me,onTogglePlay:re,onToggleLoop:Ve,onSeek:Le,onVolumeChange:He,onToggleMute:Fe,onChangePlaybackRate:Re,onChangeResolution:e,onZoomIn:l,onZoomOut:w,onFit:ne,onDownload:xe,onToggleFullScreen:be,allowDownload:j})]})}
|
|
2
|
-
export{
|
|
1
|
+
import{P,m,D,_,u,S,L,t,o,G,Z,B,mt,A,I,Sr,O,Fo,Re,ve,nn,Et,ht,ar,we,Pe,E,C,ge,ra,Ae,_e,K,Wr,Vt,ms,hs,gs,Mf,Ne,md,ct,Hc,$c,gr,Ad,jb,sv,Fa,ep,ap,mg,hg,La,kg,bp,Zo,Gn,qd,Xe,et,tt,rt,nt,ot,st,it,de,le,me,qe,ce,z,ue,Ot,Nt,M,Eo,Co,Yr,Rn,he,vs,jr,of}from"./chunk-vvr8tnse.js";import{ws,xs,Fr,hu,gu,rs,ns,Ss,Cs}from"./chunk-nv7tztvh.js";import{Ka,pu}from"./chunk-a23q1kc4.js";import{Ws}from"./chunk-rx9g95wk.js";var ut=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Ge=I("pencil",ut);S();S();function Ye({teamId:c,projectId:s,file:r,onSaveField:d,members:T,onCommentSelect:x,hideAnnotationControl:F=!1,readOnly:b=!1,publicFields:v,isPublic:p=!1,shareId:y,currentTime:q,onTyping:ee,selectedCommentId:h,heightPercent:V,onHeightPercentChange:Q}){let{canEdit:j}=Ot(s),{fields:i,setFields:X}=Fr(),ae=G(),{ref:oe,inView:ie}=Nt(),[a,H]=u(null),[Ce,te]=u(!1),[pe,Ee]=u(null),Y=_(!1),ze=_(0),U=_(V),je=(e)=>{Y.current=!0,ze.current=e.clientY,U.current=V,e.target.setPointerCapture?.(e.pointerId)},De=P((e)=>{if(!Y.current)return;let w=(ze.current-e.clientY)/window.innerHeight*100,ne=Math.min(85,Math.max(10,U.current+w));Q(ne)},[Q]),ke=(e)=>{Y.current=!1;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}},{data:J}=Z({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s&&!v}),k=rs(r);m(()=>{if(v)X(v,s);else if(J)X(J,s)},[J,v,s,X]);let{data:fe,fetchNextPage:W,hasNextPage:Te}=mt({queryKey:p?["shares",y,"files",r?.id,"comments"]:["files",r?.id,"comments"],queryFn:async({pageParam:e})=>{if(p){let l=localStorage.getItem(`share_pwd_${y}`)||"",w=await A.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:y,fileId:r.id},query:{after:e}},{headers:{"x-share-password":l}});if(!w.ok)throw Error("Failed to fetch comments");return await w.json()}else{let l=await A.api.files[":fileId"].comments.$get({param:{fileId:r.id},query:{after:e}});if(!l.ok)throw Error("Failed to fetch comments");return await l.json()}},enabled:!!r?.id&&(!p||!!y),initialPageParam:"",refetchInterval:2000,getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{mutate:Ie}=B({mutationFn:async({text:e,attachmentIds:l,annotations:w,replyToId:ne,guestUserId:xe,second:be})=>{if(p){let se=localStorage.getItem(`share_pwd_${y}`)||"",Be=await A.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:y,fileId:r.id},json:{message:e,attachmentIds:l,replyToId:ne??void 0,annotations:w,second:be??void 0}},{headers:{"x-share-password":se,...xe?{"x-guest-user-id":xe}:{}}});if(!Be.ok)throw Error("Failed to create comment");return await Be.json()}else{let se=await A.api.files[":fileId"].comments.$post({param:{fileId:r.id},json:{message:e,attachmentIds:l,replyToId:ne??void 0,annotations:w,second:be??void 0}});if(!se.ok)throw Error("Failed to create comment");return await se.json()}},onSuccess:()=>{ae.invalidateQueries({queryKey:p?["shares",y,"files",r?.id,"comments"]:["files",r?.id,"comments"]})},onError:()=>{M.error(sv?.()||"Failed to post comment")}}),Me=fe?.pages?.[0]?.pageInfo?.total??fe?.pages.reduce((e,l)=>e+(l.data?.length||0),0)??0;m(()=>{if(ie&&Te)W()},[ie,W,Te]);let R=D(()=>(r?.fieldValues||[]).reduce((e,l)=>(e[l.fieldId]=l,e),{}),[r?.fieldValues]),re=D(()=>[...i].sort((e,l)=>{let w=e.config?.name?.toLowerCase()||"",ne=l.config?.name?.toLowerCase()||"";if(w<ne)return-1;if(w>ne)return 1;return 0}),[i]),Le=fe?.pages.flatMap((e)=>e.data??[])??[],Ve=(e,l,w=[],ne,xe)=>{if(!e.trim()&&l.length===0&&w.length===0)return;let be=ne||a?.id||null;if(p){let se=localStorage.getItem(`guest_user_id_${y}`);if(!se)Ee({text:e,attachmentIds:l,annotations:w,replyToId:be,second:xe}),te(!0);else Ie({text:e,attachmentIds:l,annotations:w,replyToId:be,guestUserId:se,second:xe})}else Ie({text:e,attachmentIds:l,annotations:w,replyToId:be,second:xe});H(null)},He=(e)=>{if(pe)Ie({...pe,guestUserId:e}),Ee(null),H(null)},Se=(e)=>{let l=T.find((w)=>w.id===e);if(l)return l;return{id:"unknown",name:"Unknown",role:"unknown"}},Fe=V<=15;return o("div",{style:{height:`${V}dvh`},className:"shrink-0 flex flex-col bg-background border-t border-border shadow-2xl rounded-t-2xl overflow-hidden select-none z-20","data-testid":"mobile-bottom-sheet",children:[t("div",{onPointerDown:je,onPointerMove:De,onPointerUp:ke,onPointerCancel:ke,className:"w-full pt-2 pb-1.5 flex flex-col items-center justify-center cursor-grab active:cursor-grabbing touch-none shrink-0","aria-label":"Drag to resize bottom sheet",children:t("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/50 transition-colors"})}),o(Eo,{defaultValue:"comments",className:"flex-1 flex flex-col min-h-0 px-2 pb-1 overflow-hidden",children:[o(Co,{className:"w-full shrink-0 h-9 bg-muted/60 p-1",children:[o(Yr,{value:"comments",className:"flex-1 text-xs font-semibold py-1",children:[md()," ",Me>0&&`(${Me})`]}),t(Yr,{value:"fields",className:"flex-1 text-xs font-semibold py-1",children:Fa()})]}),o(Rn,{value:"comments",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Fe&&"hidden"),children:[t("div",{className:"flex items-center justify-between px-2 pb-1.5 shrink-0 border-b border-border/50",children:o("span",{className:"text-xs font-bold text-foreground",children:[Mf?.()||"All comments",Me>0?` (${Me})`:""]})}),t(ue,{className:"flex-1 min-h-0 px-2 py-2 [&>div>div]:block!",children:Le.length===0?t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:hg()}):o("div",{className:"space-y-3",children:[Le.map((e)=>o("div",{children:[t(Ka,{teamId:c,message:e,getUser:Se,onReply:H,hasReplies:!!e.replies?.length,formatTimestamp:k?.commentsConfig?.formatTimestamp,frameRate:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:h===e.id,onSelect:()=>{x?.(e)},readOnly:b,isPublic:p}),e.replies?.map((l,w)=>t("div",{children:t(Ka,{teamId:c,isReply:!0,message:l,getUser:Se,onReply:H,hasReplies:!1,isLastReply:w===(e.replies?.length??0)-1,formatTimestamp:k?.commentsConfig?.formatTimestamp,frameRate:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:h===l.id,onSelect:()=>{x?.(l)},readOnly:b,isPublic:p})},l.id))]},e.id)),t("div",{ref:oe})]})}),(!b||p)&&t("div",{className:"mt-auto shrink-0 bg-background border-t border-border pt-1",children:t(pu,{isOpen:Ce,onClose:()=>te(!1),onSuccess:He,children:t(Ws,{projectId:s,onSendMessage:Ve,replyingTo:a,onCancelReply:()=>H(null),hideAnnotationControl:F,disableMentions:p,currentTime:k?.commentsConfig?.hasTimestamp?q:void 0,formatTimestamp:k?.commentsConfig?.formatTimestamp,frameRate:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:k?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,onTyping:ee})})})]}),t(Rn,{value:"fields",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Fe&&"hidden"),children:t(ue,{className:"flex-1 px-3 py-2 min-h-0 [&>div>div]:block!",children:re&&re.length>0?t("div",{className:"space-y-4 pb-6",children:re.map((e)=>o("div",{className:"space-y-1.5",children:[t("label",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:e.config?.name}),t("div",{className:"min-h-[32px]",children:t(Cs,{fieldId:e.id,config:e.config,value:R[e.id]?.value,onSave:j?(l)=>d(e.id,l):void 0,readOnly:b||e.readOnly||!j})})]},e.id))}):t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:"No custom fields defined"})})})]})]})}function We({fileName:c,folderName:s,version:r,versions:d,activeFileId:T,isPublic:x=!1,shareId:F,allowDownload:b=!0,downloadInfo:v,canEdit:p=!1,onBack:y,onPrevFile:q,onNextFile:ee,hasPrevFile:h=!1,hasNextFile:V=!1,onSelectVersion:Q,onRename:j,onDelete:i,onLinkedTasks:X,linkedTaskCount:ae=0}){let oe=async(a)=>{try{let H=x&&F?await A.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:F,fileId:T},json:{key:a}}):await A.api.files["download-url"].$post({json:{key:a,assetId:T}});if(!H.ok)return;let{url:Ce}=await H.json(),te=document.createElement("a");te.href=Ce,te.download="",document.body.appendChild(te),te.click(),document.body.removeChild(te)}catch{}},ie=(v?.videoTranscodes?.length??0)>0;return o("header",{className:"flex h-12 w-full items-center justify-between border-b border-border bg-card px-2 py-1.5 shrink-0 select-none z-30",children:[t("div",{className:"flex items-center",children:t(C,{variant:"ghost",size:"icon",onClick:y,className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":bp(),children:t(nn,{className:"h-5 w-5"})})}),o("div",{className:"flex flex-1 items-center justify-center gap-1 min-w-0 px-1",children:[o("div",{className:"flex items-center min-w-0 max-w-[65vw]",children:[s&&o(L,{children:[t("span",{className:"truncate text-xs font-medium text-muted-foreground max-w-[80px]",children:s}),t("span",{className:"text-muted-foreground mx-1 text-xs",children:"/"})]}),d&&d.length>1?o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:o("button",{className:"flex items-center gap-1 min-w-0 truncate text-xs font-medium text-foreground hover:bg-accent rounded px-1 py-0.5 transition-colors cursor-pointer",children:[t("span",{className:"truncate max-w-[120px] font-semibold",children:c}),r!==void 0&&o(he,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]}),t(ve,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),o(_e,{align:"center",className:"w-48 z-40",children:[t(Wr,{className:"text-xs",children:qd()}),d.map((a)=>o(K,{onClick:()=>Q?.(a.id),className:E("flex items-center justify-between text-xs cursor-pointer",a.id===T?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:a.name||c})]},a.id))]})]}):o("div",{className:"flex items-center gap-1 min-w-0 truncate",children:[t("span",{className:"truncate text-xs font-semibold text-foreground max-w-[140px]",children:c}),r!==void 0&&o(he,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]})]})]}),(h||V)&&o("div",{className:"flex items-center gap-0.5 shrink-0 bg-muted/60 rounded p-0.5 ml-1",children:[t(C,{variant:"ghost",size:"icon",disabled:!h,onClick:q,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:kg(),"aria-label":kg(),children:t(nn,{className:"h-3.5 w-3.5"})}),t(C,{variant:"ghost",size:"icon",disabled:!V,onClick:ee,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:mg(),"aria-label":mg(),children:t(Et,{className:"h-3.5 w-3.5"})})]})]}),t("div",{className:"flex items-center gap-1",children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t(C,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":ap(),children:t(Sr,{className:"h-4 w-4"})})}),o(_e,{align:"end",className:"w-52 z-40",children:[b&&(ie?o(ms,{children:[o(hs,{className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(ht,{className:"h-3.5 w-3.5"}),t("span",{children:gr()})]}),t(ra,{children:o(gs,{className:"w-48 z-50",children:[t(Wr,{className:"text-xs",children:gr()}),v?.videoTranscodes?.map((a)=>{let H=vs(a),Ce=a.hdr?`${H} (HDR)`:H;return o(K,{onClick:()=>oe(a.key),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:Ce}),t("span",{className:"text-[10px] text-muted-foreground",children:"MP4"})]},a.key||`${H}-${a.hdr?"hdr":"sdr"}`)}),v?.originalKey&&o(L,{children:[t(Vt,{}),o(K,{onClick:()=>oe(v.originalKey),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:La?.()||"Original"}),t("span",{className:"text-[10px] text-muted-foreground",children:c.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):o(K,{onClick:()=>v?.originalKey&&oe(v.originalKey),disabled:!v?.originalKey,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(ht,{className:"h-3.5 w-3.5"}),t("span",{children:gr()})]})),d&&d.length>1&&Q&&o(ms,{children:[t(hs,{className:"flex items-center gap-2 text-xs cursor-pointer",children:t("span",{children:qd?.()||"Switch version"})}),t(ra,{children:o(gs,{className:"w-48 z-50",children:[t(Wr,{className:"text-xs",children:qd?.()||"Switch version"}),d.map((a)=>o(K,{onClick:()=>Q(a.id),className:E("flex items-center justify-between text-xs cursor-pointer",a.id===T?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px]",children:a.name||c})]},a.id))]})})]}),X&&o(K,{onClick:X,className:"flex items-center justify-between text-xs cursor-pointer",children:[o("span",{className:"flex items-center gap-2",children:[t(Fo,{className:"h-3.5 w-3.5"}),t("span",{children:ep?.()||"Linked Tasks"})]}),ae>0&&t("span",{className:"inline-flex items-center justify-center px-1.5 py-0.2 text-[10px] font-semibold rounded-full bg-muted-foreground/15 text-foreground",children:ae})]}),p&&j&&o(K,{onClick:j,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(Ge,{className:"h-3.5 w-3.5"}),t("span",{children:Zo()})]}),p&&i&&o(L,{children:[t(Vt,{}),o(K,{onClick:i,className:"flex items-center gap-2 text-xs text-destructive focus:text-destructive cursor-pointer",children:[t(we,{className:"h-3.5 w-3.5"}),t("span",{children:ct()})]})]})]})]})})]})}function $l({projectId:c,teamId:s="",fileId:r,file:d,projectInfo:T,ancestorFolders:x=[],versions:F,activeFileId:b,startTime:v,isPublic:p=!1,shareId:y,allowDownload:q=!0,publicFields:ee,siblingFiles:h=[],onNavigateToFile:V,onNavigateBack:Q,onRenameFile:j,onDeleteFile:i,onSaveField:X,onSelectVersion:ae}){let{canEdit:oe}=Ot(c),{members:ie}=jr(),a=_(null),[H,Ce]=u(50),[te,pe]=u([]),[Ee,Y]=u(0),[ze,U]=u(null),[je,De]=u(!1),[ke,J]=u(""),k=_(null),[fe,W]=u(!1),[Te,Ie]=u(!1),[Me,R]=u(!1),[re,Le]=u(!1),{data:Ve}=Z({queryKey:["teams",s,"kanban","assets",b,"tasks"],queryFn:async()=>{if(!s||!b||p)return{data:[],total:0};let f=await A.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:s,assetId:b}});if(!f.ok)return{data:[],total:0};return await f.json()},enabled:!!s&&!!b&&!p}),He=Ve?.total??Ve?.data?.length??0,{prevFile:Se,nextFile:Fe}=D(()=>{if(!h||h.length===0)return{prevFile:null,nextFile:null};let f=h.findIndex((ye)=>ye.id===r||ye.id===b);if(f===-1)return{prevFile:null,nextFile:null};return{prevFile:f>0?h[f-1]:null,nextFile:f<h.length-1?h[f+1]:null}},[h,r,b]),e=x.length>0?x[0]?.name:T?.name,w=F?.find((f)=>f.id===b)?.version??(F&&F.length>0?F.length:void 0),ne=D(()=>({originalKey:d.media?.original?.key,videoTranscodes:d.media?.videoTranscodes?.map((f)=>({key:f.key,width:f.width,height:f.height,resolution:f.resolution,hdr:f.hdr}))}),[d.media]),xe=()=>{pe([]),U(null)},be=()=>{pe([]),U(null)},se=(f)=>{U(f.id||null);let ye=f.annotations;if(ye&&ye.length>0)pe(ye);else pe([]);if(f.second!==null&&f.second!==void 0)a.current?.seekTo(f.second),a.current?.pause();else if(ye&&ye.length>0)a.current?.pause()},Be=async(f)=>{if(f?.preventDefault(),!ke.trim()||!j)return;try{Ie(!0),await j(ke.trim()),De(!1)}finally{Ie(!1)}},$e=async()=>{if(!i)return;try{W(!0),await i(),R(!1)}finally{W(!1)}};return m(()=>{Y(0),U(null),pe([])},[d?.id]),o("div",{className:"flex h-[100dvh] w-full flex-col bg-background overflow-hidden relative",children:[t(We,{fileName:d.name,folderName:e,version:w,versions:F,activeFileId:b,isPublic:p,shareId:y,allowDownload:q,downloadInfo:ne,canEdit:oe,onBack:Q,hasPrevFile:!!Se,hasNextFile:!!Fe,onPrevFile:()=>Se&&V(Se.id),onNextFile:()=>Fe&&V(Fe.id),onSelectVersion:ae,onRename:()=>{J(d.name),De(!0)},onDelete:()=>R(!0),onLinkedTasks:!p?()=>Le(!0):void 0,linkedTaskCount:He}),t("div",{className:"relative flex-1 min-h-0 bg-background overflow-hidden flex flex-col",children:t(ns,{file:d,mediaControllerRef:a,onPlay:xe,onTimeUpdate:Y,onSeek:be,annotations:te,startTime:v,shareId:y,allowDownload:q})}),t(Ye,{teamId:s,projectId:c,file:d,onSaveField:X,members:ie,onCommentSelect:se,hideAnnotationControl:d.proxyType==="audio",readOnly:p||!oe,publicFields:ee,isPublic:p,shareId:y,currentTime:Ee,onTyping:()=>a.current?.pause(),selectedCommentId:ze,heightPercent:H,onHeightPercentChange:Ce}),!p&&re&&t(of,{teamId:s,assetId:b,assetName:d.name,isOpen:re,onClose:()=>Le(!1)}),!p&&t(de,{open:je,onOpenChange:De,children:t(le,{children:o("form",{onSubmit:Be,children:[t(me,{children:t(ce,{children:Zo()})}),t("div",{className:"py-4",children:t(z,{ref:k,value:ke,onChange:(f)=>J(f.target.value),placeholder:Ad?.()||"Enter new name",onFocus:()=>{setTimeout(()=>{if(k.current)Ss(k.current)},0)},autoFocus:!0})}),o(qe,{children:[t(C,{type:"button",variant:"outline",onClick:()=>De(!1),children:Ne()}),o(C,{type:"submit",disabled:Te||!ke.trim(),children:[Te&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),Gn()]})]})]})})}),!p&&t(Xe,{open:Me,onOpenChange:R,children:o(et,{children:[o(tt,{children:[t(nt,{children:$c?.()||"Delete Asset?"}),t(ot,{children:Hc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(rt,{children:[t(it,{children:Ne()}),o(st,{onClick:$e,disabled:fe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[fe&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),ct()]})]})]})})]})}S();function Je({activeState:c,activeAsset:s,previewUrl:r,isFullScreen:d,onTogglePlay:T,onToggleLoop:x,onSeek:F,onVolumeChange:b,onToggleMute:v,onChangePlaybackRate:p,onChangeResolution:y,onZoomIn:q,onZoomOut:ee,onFit:h,onDownload:V,onToggleFullScreen:Q,allowDownload:j=!0}){if(c?.kind==="video"&&c.video&&s){let i=c.video,X=i.totalFrames/i.frameRate,ae=i.currentFrame/i.frameRate,oe={isPlaying:i.isPlaying,progress:X>0?ae/X*100:0,currentTime:ae,duration:X,volume:i.volume,isMuted:i.isMuted,isLooping:i.isLooping,playbackRate:i.playbackRate,isFullScreen:d,showFrames:!1,currentResolution:i.currentResolution,isCurrentHdr:i.isCurrentHdr,activeAutoResolution:i.activeAutoResolution,isHlsManualSupported:i.isHlsManualSupported,isLoading:i.isLoading},ie=r&&!s.media?.videoPreview?{...s,media:{...s.media,videoPreview:{url:r}}}:s;return t(hu,{state:oe,zoom:c.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:i.buffered,data:ie,resolutions:i.resolutions,togglePlay:T,toggleLoop:x,toggleMute:v,handleVolumeChange:b,changePlaybackRate:p,changeResolution:(a)=>y(a.resolution,a.hdr),handleDownload:(a)=>V(a),toggleFullScreen:Q,onZoomChange:(a)=>a>=c.zoom?q():ee(),onZoomReset:h,frameRate:i.frameRate,totalFrames:i.totalFrames,currentFrame:i.currentFrame,seekToFrame:F,allowDownload:j})}if(c?.kind==="image")return t(gu,{zoom:c.zoom,onZoomIn:q,onZoomOut:ee,onFit:h,onDownload:()=>V(),canDownload:!!s?.media?.original?.key,fullscreen:{isFullScreen:d,onToggle:Q},allowDownload:j});return t("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:t("button",{onClick:Q,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:d?t(xs,{className:"h-5 w-5"}):t(ws,{className:"h-5 w-5"})})})}function Ze({side:c,fileName:s,version:r,activeVersionId:d,versions:T,isActive:x,onActivate:F,onSwitchVersion:b,onExit:v}){let p=E("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",x?"text-foreground":"text-muted-foreground hover:text-foreground"),y=t("button",{onClick:v,title:jb(),className:p,children:t(Pe,{className:"h-4 w-4"})}),q=o("button",{onClick:F,className:E("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",x?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t("span",{className:"truncate",children:s}),r!==void 0&&o("span",{className:E("flex-shrink-0 rounded border px-1 py-0 text-xs",x?"border-foreground/40":"border-border"),children:["v",r]})]}),ee=o(ge,{children:[t(Ae,{onClick:F,title:qd(),className:p,children:t(ve,{className:"h-4 w-4"})}),t(_e,{align:c==="left"?"start":"end",className:"w-80 p-1",children:t("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:T.map((h)=>{let V=h.id===d;return o(K,{onClick:()=>b(h.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[o("div",{className:"flex min-w-[2rem] flex-shrink-0 items-center justify-center rounded-full bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground select-none",children:["v",h.version]}),t("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:h.previewUrl?t("img",{src:h.previewUrl,alt:h.name||void 0,className:"h-full w-full object-cover"}):t(ar,{className:"h-4 w-4 text-muted-foreground"})}),o("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[t("span",{className:"truncate text-sm font-semibold text-foreground",children:h.name}),t("span",{className:"truncate text-xs text-muted-foreground",children:h.creator?.name||"Unknown"})]}),V&&t(Re,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},h.id)})})})]});return t("div",{onMouseDown:F,className:E("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",x?"border-b-2 border-primary":"border-border"),children:c==="left"?o(L,{children:[y,q,ee]}):o(L,{children:[q,ee,t("div",{className:"ml-auto"}),y]})})}function at(c,s,r){return Z({queryKey:s?["public-share-file",r,c,localStorage.getItem(`share_pwd_${r}`)||""]:["files",c],queryFn:async()=>{if(s){let T=localStorage.getItem(`share_pwd_${r}`)||"",x=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:c}},{headers:{"x-share-password":T}});if(!x.ok)throw Error("Failed to fetch version asset");return await x.json()}let d=await A.api.files[":fileId"].$get({param:{fileId:c}});if(!d.ok)throw Error("Failed to fetch version asset");return await d.json()},enabled:!!c&&(!s||!!r)})}function Gl({isPublic:c=!1,shareId:s,versions:r,leftId:d,rightId:T,activeSide:x,annotations:F,seekRequest:b,onActiveSideChange:v,onSwitchVersion:p,onExit:y,onActiveAssetChange:q,onPlay:ee,onTimeUpdate:h,allowDownload:V=!0}){let Q=_(null),j=_(null),i=_(null),[X,ae]=u(null),[oe,ie]=u(null),[a,H]=u(1),[Ce,te]=u(!1),[pe,Ee]=u(!1),{data:Y,isLoading:ze}=at(d,c,s),{data:U,isLoading:je}=at(T,c,s),De=rs(Y),ke=rs(U),J=!!Y&&!!U&&De.id===ke.id,k=x==="left"?Y:U,fe=x==="left"?X:oe,W=P(()=>x==="left"?j.current:i.current,[x]),Te=P(()=>x==="left"?i.current:j.current,[x]);m(()=>{q(k??null)},[k,q]),m(()=>{if(!b)return;let n=W();if(n?.seekToSecond(b.second),n?.pause(),J){let g=Te();g?.seekToSecond(b.second),g?.pause()}},[b?.nonce]),m(()=>{let n=()=>Ee(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]);let Ie=P((n)=>ae(n),[]),Me=P((n)=>ie(n),[]),R=P((n)=>{let g=W();if(g)n(g);if(J){let N=Te();if(N)n(N)}},[W,Te,J]),re=P(()=>{let n=!fe?.video?.isPlaying;R((g)=>n?g.play():g.pause())},[fe?.video?.isPlaying,R]);m(()=>{let n=(g)=>{let N=document.activeElement;if(N&&(N.tagName==="INPUT"||N.tagName==="TEXTAREA"||N instanceof HTMLElement&&N.isContentEditable))return;let Ue=g.key===" ",Oe=N&&(N.tagName==="BUTTON"||N.tagName==="A"||N.tagName==="SELECT"||N.tagName==="OPTION"||N.getAttribute("role")==="button"||N.getAttribute("role")==="link"||N.getAttribute("role")==="checkbox"||N.getAttribute("role")==="radio"||N.getAttribute("role")==="menuitem");if(Ue&&Oe)return;if(g.key===" "||g.key.toLowerCase()==="k")g.preventDefault(),re()};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[re]);let Le=P((n)=>R((g)=>g.seekToFrame(n)),[R]),Ve=P(()=>W()?.toggleLoop(),[W]),He=P((n)=>{H(n),te(n===0)},[]),Se=P(()=>te((n)=>!n),[]),Fe=P((n)=>R((g)=>g.setPlaybackRate(n)),[R]),e=P((n,g)=>W()?.changeResolution(n,g),[W]),l=P(()=>R((n)=>n.zoomBy(1.2)),[R]),w=P(()=>R((n)=>n.zoomBy(0.8)),[R]),ne=P(()=>R((n)=>n.fit()),[R]),xe=P((n)=>{W()?.download(n)},[W]),be=P(()=>{let n=Q.current;if(!n||typeof n.requestFullscreen!=="function")return;if(!document.fullscreenElement)n.requestFullscreen().catch(()=>{});else if(document.exitFullscreen)document.exitFullscreen().catch(()=>{})},[]),se=P((n,g)=>{if(J)i.current?.panBy(n,g)},[J]),Be=P((n,g)=>{if(J)j.current?.panBy(n,g)},[J]),$e=P(()=>re(),[re]),f=P((n)=>r.find((g)=>g.id===n)?.version,[r]),ye=D(()=>k?.media?.videoPreview?.url,[k?.media?.videoPreview?.url]),Qe=(n,g)=>{let Ue=rs(g)?.comparePane;if(!Ue)return t("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:t("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let Oe=x===n;return t(Ue,{ref:n==="left"?j:i,file:g,shareId:s,isActive:Oe,annotations:Oe?F:[],onStateChange:n==="left"?Ie:Me,onUserPan:n==="left"?se:Be,onActivate:()=>v(n),muted:Oe?Ce:!0,volume:a,onPlay:ee,onTimeUpdate:h,onRequestTogglePlay:$e},g.id)},lt=!!Y&&!!U,dt=ze||je;return o("div",{ref:Q,className:"flex h-full flex-1 flex-col bg-background",children:[o("div",{className:"flex min-h-0 flex-1",children:[o("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[Y&&t(Ze,{side:"left",fileName:Y.name,version:f(d),activeVersionId:d,versions:r,isActive:x==="left",onActivate:()=>v("left"),onSwitchVersion:(n)=>p("left",n),onExit:y}),t("div",{className:"relative flex min-h-0 flex-1",children:Y?Qe("left",Y):t("div",{className:"flex flex-1 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),o("div",{className:"flex min-w-0 flex-1 flex-col",children:[U&&t(Ze,{side:"right",fileName:U.name,version:f(T),activeVersionId:T,versions:r,isActive:x==="right",onActivate:()=>v("right"),onSwitchVersion:(n)=>p("right",n),onExit:y}),t("div",{className:"relative flex min-h-0 flex-1",children:U?Qe("right",U):t("div",{className:"flex flex-1 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),dt&&!lt&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:t(O,{className:"h-8 w-8 animate-spin text-foreground"})}),t(Je,{activeState:fe,activeAsset:k??null,previewUrl:ye,isFullScreen:pe,onTogglePlay:re,onToggleLoop:Ve,onSeek:Le,onVolumeChange:He,onToggleMute:Se,onChangePlaybackRate:Fe,onChangeResolution:e,onZoomIn:l,onZoomOut:w,onFit:ne,onDownload:xe,onToggleFullScreen:be,allowDownload:V})]})}
|
|
2
|
+
export{$l,Gl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F,P,m,D,_,u,Xn,S,L,t,o,V,Hu,$u,br,Rc,Yi,wo,Ht,Yo,Gu,Vu,Qu,Ku,Pc,Wu,Z,B,mt,ze,A,I,lr,O,Tt,ve,er,Ut,Jo,Ne,E,gt,ye,Y,Pt,Er,Lt,se,cr,C,Ce,Ie,Te,HA,$A,G0,K0,W0,Rf,y_,sh,De,na,uh,Iy,zc,mh,qs,Xo,kh,Rh,kv,Rv,Gh,Pw,Nx,Dx,pS,dp,fp,IS,BS,vg,Vc,NE,zg,XE,tC,vp,nC,iC,qg,lC,cC,Hg,uC,fC,Ld,Zd,Bd,kl,Ip,bC,vC,wC,xC,Ud,$s,qC,oI,aI,wI,NI,OI,FI,LI,ZI,dA,BI,$d,LT,zT,r1,SA,_n,Qp,F1,L1,Xc,Xe,et,tt,rt,nt,ot,st,it,z,Nt,M,Fl,kn,em,he,At,_t,yt,wr,af,Ke,vt,wt,kt,at}from"./chunk-42hrvk6k.js";import{Ro,yr}from"./chunk-ffj9cq9y.js";import{Ql}from"./chunk-8ayz61rc.js";import{Ws,zo,Jl,Wa,Oi,Xl}from"./chunk-81dawvn4.js";import{Pn,Nn,Dn,xr,It,xt}from"./chunk-t1yamxgk.js";import"./chunk-15w79661.js";import"./chunk-zf5cyxnt.js";import{Kn,co}from"./chunk-8tzfcqtb.js";S();function te(a,e){let s=new Set(e);return a.filter((i)=>!s.has(i))}var ae=class extends wo{#r;#e;#o;#a;#t;#s;#i;#n;#l;#d=[];constructor(a,e,s){super();this.#r=a,this.#a=s,this.#o=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){if(this.listeners.size===1)this.#t.forEach((a)=>{a.subscribe((e)=>{this.#p(a,e)})})}onUnsubscribe(){if(!this.listeners.size)this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach((a)=>{a.destroy()})}setQueries(a,e){this.#o=a,this.#a=e,Ht.batch(()=>{let s=this.#t,i=this.#u(this.#o);i.forEach((p)=>p.observer.setOptions(p.defaultedQueryOptions));let c=i.map((p)=>p.observer),r=c.map((p)=>p.getCurrentResult()),f=s.length!==c.length,g=c.some((p,x)=>p!==s[x]),b=f||g,v=b?!0:r.some((p,x)=>{let N=this.#e[x];return!N||!Yi(p,N)});if(!b&&!v)return;if(b)this.#d=i,this.#t=c;if(this.#e=r,!this.hasListeners())return;if(b)te(s,c).forEach((p)=>{p.destroy()}),te(c,s).forEach((p)=>{p.subscribe((x)=>{this.#p(p,x)})});this.#f()})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map((a)=>a.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(a,e){let s=this.#u(a),i=s.map((r)=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),c=s.map((r)=>r.defaultedQueryOptions.queryHash);return[i,(r)=>this.#c(r??i,e,c),()=>this.#m(i,s)]}#m(a,e){let s=new Set;return e.map((i,c)=>{let r=a[c];return!i.defaultedQueryOptions.notifyOnChangeProps?i.observer.trackResult(r,(f)=>{if(!s.has(f))s.add(f),e.forEach((g)=>{g.observer.trackProp(f)})}):r})}#c(a,e,s){if(e){let i=this.#l,c=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((r,f)=>r!==i[f]));if(this.#e!==this.#n||c||e!==this.#i){if(this.#i=e,this.#n=this.#e,s!==void 0)this.#l=s;this.#s=Rc(this.#s,e(a))}return this.#s}return a}#g(){return!this.#a?.combine||this.#t.some((a,e)=>a.options.suspense&&this.#e[e]?.data===void 0)}#u(a){let e=new Map;this.#t.forEach((i)=>{let c=i.options.queryHash;if(!c)return;let r=e.get(c);if(r)r.push(i);else e.set(c,[i])});let s=[];return a.forEach((i)=>{let c=this.#r.defaultQueryOptions(i),r=e.get(c.queryHash)?.shift()??new Yo(this.#r,c);s.push({defaultedQueryOptions:c,observer:r})}),s}#p(a,e){let s=this.#t.indexOf(a);if(s!==-1)this.#e=this.#e.slice(),this.#e[s]=e,this.#f()}#f(){if(this.hasListeners()){let a=this.#g(),e=this.#s,s=a?e:this.#c(this.#m(this.#e,this.#d),this.#a?.combine);if(a||e!==s)Ht.batch(()=>{this.listeners.forEach((i)=>{i(this.#e)})})}}};S();function re({queries:a,...e},s){let i=V(s),c=Hu(),r=$u(),f=e.subscribed!==!1,g=D(()=>a.map((d)=>{let h=i.defaultQueryOptions(d);return h._optimisticResults=c?"isRestoring":f?"optimistic":void 0,h}),[a,i,c,f]);g.forEach((d)=>{Ku(d);let h=i.getQueryCache().get(d.queryHash);Gu(d,r,h)}),Vu(r);let[b]=u(()=>new ae(i,g,e)),[v,p,x]=b.getOptimisticResult(g,e.combine),N=!c&&f;Xn(P((d)=>N?b.subscribe(Ht.batchCalls(d)):br,[b,N]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),m(()=>{b.setQueries(g,e)},[g,e,b]);let n=v.some((d,h)=>Pc(g[h],d))?v.flatMap((d,h)=>{let w=g[h];if(w&&Pc(w,d)){let q=new Yo(i,w);return Wu(w,q,r)}return[]}):[];if(n.length>0)throw Promise.all(n);let y=v.find((d,h)=>{let w=g[h];return w&&Qu({result:d,errorResetBoundary:r,throwOnError:w.throwOnError,query:i.getQueryCache().get(w.queryHash),suspense:w.suspense})});if(y)throw y.error;return p(x())}S();S();var xe=Object.defineProperty,H=(a,e)=>xe(a,"name",{value:e,configurable:!0}),W="Collapsible",[we,Mt]=gt(W),[_e,X]=we(W),Re=F(H(function(e,s){let{__scopeCollapsible:i,open:c,defaultOpen:r,disabled:f,onOpenChange:g,...b}=e,[v,p]=Lt({prop:c,defaultProp:r??!1,onChange:g,caller:W});return t(_e,{scope:i,disabled:f,contentId:Er(),open:v,onOpenToggle:P(()=>p((x)=>!x),[p]),children:t(se.div,{"data-state":U(v),"data-disabled":f?"":void 0,...b,ref:s})})},"Collapsible")),ke="CollapsibleTrigger",Ae=F(H(function(e,s){let{__scopeCollapsible:i,...c}=e,r=X(ke,i);return t(se.button,{type:"button","aria-controls":r.open?r.contentId:void 0,"aria-expanded":r.open||!1,"data-state":U(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...c,ref:s,onClick:Y(e.onClick,r.onOpenToggle)})},"CollapsibleTrigger")),oe="CollapsibleContent",qe=F(H(function(e,s){let{forceMount:i,...c}=e,r=X(oe,e.__scopeCollapsible);return t(cr,{present:i||r.open,children:({present:f})=>t(Pe,{...c,ref:s,present:f})})},"CollapsibleContent")),Pe=F(H(function(e,s){let{__scopeCollapsible:i,present:c,children:r,...f}=e,g=X(oe,i),[b,v]=u(c),p=_(null),x=ye(s,p),N=_(0),n=N.current,y=_(0),d=y.current,h=g.open||b,w=_(h),q=_(void 0);return m(()=>{let R=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(R)},[]),Pt(()=>{let R=p.current;if(R){q.current=q.current||{transitionDuration:R.style.transitionDuration,animationName:R.style.animationName},R.style.transitionDuration="0s",R.style.animationName="none";let j=R.getBoundingClientRect();if(N.current=j.height,y.current=j.width,!w.current)R.style.transitionDuration=q.current.transitionDuration,R.style.animationName=q.current.animationName;v(c)}},[g.open,c]),t(se.div,{"data-state":U(g.open),"data-disabled":g.disabled?"":void 0,id:g.contentId,hidden:!h,...f,ref:x,style:{["--radix-collapsible-content-height"]:n?`${n}px`:void 0,["--radix-collapsible-content-width"]:d?`${d}px`:void 0,...e.style},children:h&&r})},"CollapsibleContentImpl"));function U(a){return a?"open":"closed"}H(U,"getState");var Se=Re;var He=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],ie=I("chart-no-axes-column",He);var Oe=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],J=I("funnel",Oe);var Qe=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],Q=I("messages-square",Qe);function ne({teamId:a}){let[e,s]=u("team"),[i,c]=u("1h"),{data:r,isLoading:f}=Z({queryKey:["teams",a,"ai-usage",i,"team"],queryFn:async()=>{let d=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i}});if(!d.ok)throw Error("Failed to fetch team AI usage");return await d.json()},enabled:!!a&&e==="team"}),{data:g,isLoading:b}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let d=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!d.ok)throw Error("Failed to fetch team members");return await d.json()},enabled:!!a&&e==="members"}),v=re({queries:(g||[]).map((d)=>({queryKey:["teams",a,"ai-usage",i,d.id],queryFn:async()=>{let h=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i,userId:d.id}});if(!h.ok)throw Error(`Failed to fetch AI usage for member ${d.id}`);return await h.json()},enabled:!!a&&e==="members"}))}),p=b||v.some((d)=>d.isLoading),x=(d)=>{if(!d)return"U";let h=d.split(" ");if(h.length>1)return`${h[0][0]}${h[h.length-1][0]}`.toUpperCase();return d.substring(0,2).toUpperCase()},N=(d)=>{if(!d)return"";switch(d.toLowerCase()){case"owner":return Vc();case"editor":return qs();case"reviewer":return $s();default:return d}},n=(d)=>(d??0).toLocaleString(),y=(d)=>`$${(d??0).toFixed(6)}`;return o(Ke,{className:"border-border/60 shadow-sm",children:[o(vt,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[o("div",{children:[t(wt,{className:"text-xl font-semibold tracking-tight",children:K0()}),t(kt,{className:"text-sm text-muted-foreground mt-1",children:W0()})]}),o("div",{className:"flex flex-wrap items-center gap-3",children:[o(Ro,{type:"single",value:e,onValueChange:(d)=>{if(d)s(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(yr,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:zT()}),t(yr,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:Dx()})]}),o(Ro,{type:"single",value:i,onValueChange:(d)=>{if(d)c(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(yr,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),t(yr,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),t(yr,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),t(yr,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),t(at,{children:e==="team"?f?t("div",{className:"flex h-48 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(Pn,{children:[t(Nn,{children:o(xr,{children:[t(It,{children:$d()}),t(It,{className:"text-right",children:Gh()}),t(It,{className:"text-right",children:vg()}),t(It,{className:"text-right",children:sh()}),t(It,{className:"text-right",children:SA()}),t(It,{className:"text-right",children:uh()})]})}),t(Dn,{children:o(xr,{children:[t(xt,{className:"font-medium",children:$d()}),t(xt,{className:"text-right",children:n(r?.team?.inputTokens)}),t(xt,{className:"text-right",children:n(r?.team?.outputTokens)}),t(xt,{className:"text-right",children:n(r?.team?.cacheReadTokens)}),t(xt,{className:"text-right font-medium",children:n(r?.team?.totalTokens)}),t(xt,{className:"text-right font-medium",children:y(r?.team?.cost)})]})})]})}):p?t("div",{className:"flex h-48 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(Pn,{children:[t(Nn,{children:o(xr,{children:[t(It,{children:Nx()}),t(It,{children:qC()}),t(It,{className:"text-right",children:Gh()}),t(It,{className:"text-right",children:vg()}),t(It,{className:"text-right",children:sh()}),t(It,{className:"text-right",children:SA()}),t(It,{className:"text-right",children:uh()})]})}),t(Dn,{children:(g||[]).map((d,h)=>{let w=v[h]?.data?.member;return o(xr,{children:[t(xt,{children:o("div",{className:"flex items-center gap-3",children:[o(Ce,{className:"h-8 w-8 rounded-full",children:[d.image&&t(Ie,{src:d.image,alt:d.name,className:"object-cover"}),t(Te,{className:"bg-primary/20 text-xs",children:x(d.name)})]}),o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-medium leading-none",children:d.name}),t("span",{className:"text-xs text-muted-foreground mt-0.5",children:d.email})]})]})}),t(xt,{className:"text-xs text-muted-foreground",children:N(d.role)}),t(xt,{className:"text-right",children:n(w?.inputTokens)}),t(xt,{className:"text-right",children:n(w?.outputTokens)}),t(xt,{className:"text-right",children:n(w?.cacheReadTokens)}),t(xt,{className:"text-right font-medium",children:n(w?.totalTokens)}),t(xt,{className:"text-right font-medium",children:y(w?.cost)})]},d.id)})})]})})})]})}S();function le({teamId:a}){let[e,s]=u(null),{ref:i,inView:c}=Nt(),{data:r,isLoading:f,isError:g,fetchNextPage:b,hasNextPage:v,isFetchingNextPage:p}=mt({queryKey:["teams",a,"agent-sessions"],queryFn:async({pageParam:n})=>{let y=await A.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:a},query:{first:"20",after:n?String(n):void 0}});if(!y.ok)throw Error("Failed to fetch agent sessions");return await y.json()},initialPageParam:"",getNextPageParam:(n)=>n.pageInfo.cursor||void 0,enabled:!!a});m(()=>{if(c&&v&&!p)b()},[c,v,p,b]);let x=r?.pages.flatMap((n)=>n.data).filter((n)=>n.id!=="pending")||[],N=(n)=>{switch(n){case"comment":return t(he,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:LI()});case"chat":return t(he,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:FI()});case"naming":return t(he,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:ZI()});default:return t(he,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:n})}};return o("div",{className:"space-y-6",children:[o(Ke,{className:"border border-border/50 shadow-xs",children:[t(vt,{className:"pb-4",children:t("div",{className:"flex items-center justify-between",children:o("div",{children:[o(wt,{className:"text-xl font-bold flex items-center gap-2",children:[t(Q,{className:"w-5 h-5 text-violet-500"}),dA()]}),t(kt,{className:"mt-1 text-sm text-muted-foreground",children:BI()})]})})}),t(at,{children:f?t("div",{className:"flex h-64 items-center justify-center",children:t(O,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):g?t("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):x.length===0?o("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[t(Q,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),t("p",{className:"text-base font-medium",children:IS()})]}):o("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[o(Pn,{children:[t(Nn,{className:"bg-muted/40",children:o(xr,{children:[t(It,{children:NI()}),t(It,{children:zc()}),t(It,{children:OI()}),t(It,{className:"text-right",children:Iy()})]})}),t(Dn,{children:x.map((n)=>o(xr,{onClick:()=>s(n.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[t(xt,{className:"font-medium",children:o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-semibold text-foreground",children:n.name||Qp()}),t("span",{className:"text-xs font-mono text-muted-foreground/70",children:n.id})]})}),t(xt,{children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[t(Ie,{src:n.creator?.image||void 0}),t(Te,{className:"text-[10px]",children:n.creator?.name?.[0]?.toUpperCase()||"?"})]}),t("span",{className:"text-sm text-foreground/90",children:n.creator?.name||"System / Agent"})]})}),t(xt,{children:N(n.type)}),t(xt,{className:"text-right text-xs text-muted-foreground",children:kn(n.createdAt)})]},n.id))})]}),t("div",{ref:i,className:"py-4 flex justify-center",children:p&&t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),t(Ql,{sessionId:e,open:!!e,onOpenChange:(n)=>{if(!n)s(null)}})]})}S();function de({...a}){return t(Se,{"data-slot":"collapsible",...a})}function me({...a}){return t(Ae,{"data-slot":"collapsible-trigger",...a})}function ce({...a}){return t(qe,{"data-slot":"collapsible-content",...a})}function ee(a){switch(a.toLowerCase()){case"owner":return Vc();case"editor":return qs();case"reviewer":return $s();default:return a}}function Le(a,e){if(typeof a==="object"&&a!==null&&"message"in a){let s=a.message;if(typeof s==="string")return s}return e}function Be({rule:a}){let e=a.resourceData??{};if(a.resource==="agent_mcp_call_count")return t("span",{children:vC({value:String(e.id??"")})});if(a.resource==="agent_bash_call_count")return t("span",{children:bC({value:String(e.match??"*")})});if(a.resource==="agent_tool_call_count")return t("span",{children:wC({value:String(e.name??e.toolName??"*")})});return null}function Me({rule:a}){if(a.scopeMode==="all_members")return o(he,{variant:"secondary",className:"gap-1 text-xs",children:[t(co,{className:"h-3 w-3"}),o("span",{children:[Ld(),a.role?` (${ee(a.role)})`:` (${kl()})`]})]});if(a.scopeMode==="each_member")return o(he,{variant:"secondary",className:"gap-1 text-xs",children:[t(Kn,{className:"h-3 w-3"}),o("span",{children:[Zd(),a.role?` (${ee(a.role)})`:` (${kl()})`]})]});return o(he,{variant:"secondary",className:"gap-1 text-xs",children:[t(Jo,{className:"h-3 w-3"}),o("span",{children:[Bd()," (",a.userIds?.length||0,")"]})]})}function Fe({teamId:a,rule:e,record:s}){let i=V(),[c,r]=u(!1),[f,g]=u(()=>new Date),b=Wa[e.resource],v=e.scopeMode==="all_members",p=s.percent>=100,x=v?e.role?`${fC()}: ${ee(e.role)}`:xC():s.user?.name||s.userId||_n();m(()=>{if(!s.isWindowActive||!s.periodEnd)return;let n=window.setInterval(()=>g(new Date),60000);return()=>window.clearInterval(n)},[s.isWindowActive,s.periodEnd]);let N=B({mutationFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.reset.$post({param:{teamId:a,id:e.id},json:{userId:s.userId??null}});if(!n.ok){let y=await n.json().catch(()=>null);throw Error(Le(y,Rh()))}return await n.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["teams",a,"quotas",e.id,"records"]}),i.invalidateQueries({queryKey:["teams",a,"quotas"]}),r(!1),M.success(cC())},onError:(n)=>{let y=n instanceof Error?n.message:Rh();r(!1),M.error(y)}});return o(L,{children:[o("div",{className:"space-y-3 rounded-xl border border-border/70 bg-card p-4 text-card-foreground shadow-2xs",children:[o("div",{className:"flex items-center justify-between gap-3",children:[o("div",{className:"flex min-w-0 items-center gap-3",children:[v?t("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t(co,{className:"h-5 w-5"})}):o(Ce,{className:"h-9 w-9 shrink-0 border border-border/50",children:[t(Ie,{src:s.user?.image||void 0}),t(Te,{className:"text-xs font-semibold",children:s.user?.name?.[0]?.toUpperCase()||"U"})]}),o("div",{className:"min-w-0",children:[t("div",{className:"truncate text-sm font-semibold text-foreground",children:x}),!v&&s.user?.email&&t("div",{className:"truncate text-xs text-muted-foreground",children:s.user.email})]})]}),o("div",{className:"flex shrink-0 items-center gap-2",children:[s.isWindowActive&&s.periodEnd?o(he,{variant:"outline",className:"hidden gap-1 border-primary/30 bg-primary/5 text-xs text-primary sm:flex",children:[t(er,{className:"h-3 w-3"}),t("span",{children:qg({time:em(s.periodEnd,f)})})]}):o(he,{variant:"secondary",className:"hidden gap-1 text-xs text-muted-foreground sm:flex",children:[t(lr,{className:"h-3 w-3 text-primary"}),t("span",{children:zg()})]}),o(C,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>r(!0),disabled:N.isPending,children:[N.isPending?t(O,{className:"h-3.5 w-3.5 animate-spin"}):t(Ws,{className:"h-3.5 w-3.5"}),Hg()]})]})]}),o("div",{className:"space-y-1.5 pt-1",children:[t(af,{value:Math.min(100,Math.max(0,s.percent)),className:"h-2"}),o("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[o("span",{className:p?"font-bold text-destructive":"text-foreground",children:[Oi(e.resource,s.consumed)," /"," ",Oi(e.resource,e.limit)," ",b?.unit]}),o("span",{className:p?"font-bold text-destructive":"text-muted-foreground",children:[s.percent,"%"]})]})]}),o("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground sm:hidden",children:[s.isWindowActive&&s.periodEnd?o("span",{className:"flex items-center gap-1 text-primary",children:[t(er,{className:"h-3 w-3"}),qg({time:em(s.periodEnd,f)})]}):o("span",{className:"flex items-center gap-1",children:[t(lr,{className:"h-3 w-3 text-primary"}),zg()]}),o("span",{children:[lC(),": ",Oi(e.resource,s.remaining)," ",b?.unit]})]})]}),t(Xe,{open:c,onOpenChange:r,children:o(et,{children:[o(tt,{children:[t(nt,{children:Hg()}),t(ot,{children:uC({target:x})})]}),o(rt,{children:[t(it,{disabled:N.isPending,children:De()}),o(st,{onClick:(n)=>{n.preventDefault(),N.mutate()},disabled:N.isPending,children:[N.isPending&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),na()]})]})]})})]})}function je({teamId:a,rule:e}){let[s,i]=u(!1),[c,r]=u(""),f=Wa[e.resource],g=f?.icon||zo,{data:b,isLoading:v,isError:p}=Z({queryKey:["teams",a,"quotas",e.id,"records"],queryFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.$get({param:{teamId:a,id:e.id}});if(!n.ok)throw Error(kh());return await n.json()},enabled:s,refetchInterval:s?1e4:!1}),x=b?.records??[],N=x.filter((n)=>{if(!c.trim())return!0;let y=c.toLowerCase();return n.user?.name.toLowerCase().includes(y)||n.user?.email.toLowerCase().includes(y)});return o(de,{open:s,onOpenChange:i,className:"rounded-xl border border-border/70",children:[t(me,{asChild:!0,children:o("button",{type:"button","aria-label":s?XE():nC(),className:"flex w-full items-center justify-between gap-4 p-4 text-left transition-colors hover:bg-muted/40",children:[o("div",{className:"flex min-w-0 items-start gap-3",children:[t("div",{className:"mt-0.5 rounded-lg bg-primary/10 p-2 text-primary",children:t(g,{className:"h-5 w-5"})}),o("div",{className:"min-w-0",children:[o("div",{className:"flex flex-wrap items-center gap-2",children:[t("span",{className:"font-semibold text-foreground",children:f?.label()||e.resource}),!e.enabled&&t(he,{variant:"secondary",children:vp()})]}),o("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[t(Me,{rule:e}),o(he,{variant:"outline",className:"gap-1 text-xs",children:[t(er,{className:"h-3 w-3"}),Oi(e.resource,e.limit)," ",f?.unit," /"," ",Xl(e.period)]}),t(Be,{rule:e})]})]})]}),t(ve,{className:`h-5 w-5 shrink-0 text-muted-foreground transition-transform ${s?"rotate-180":""}`})]})}),t(ce,{children:o("div",{className:"space-y-3 border-t border-border/60 bg-muted/10 p-4",children:[e.scopeMode!=="all_members"&&x.length>3&&o("div",{className:"relative",children:[t(Ut,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),t(z,{value:c,onChange:(n)=>r(n.target.value),placeholder:Ip(),className:"h-9 pl-9 text-sm"})]}),v?t("div",{className:"flex justify-center py-10",children:t(O,{className:"h-7 w-7 animate-spin text-primary"})}):p?t("div",{className:"py-8 text-center text-sm text-destructive",children:kh()}):N.length===0?t("div",{className:"py-8 text-center text-sm text-muted-foreground",children:iC()}):N.map((n,y)=>t(Fe,{teamId:a,rule:e,record:n},n.id||n.userId||`record-${y}`))]})})]})}function ue({teamId:a}){let{data:e,isLoading:s,isError:i}=Z({queryKey:["teams",a,"quotas"],queryFn:async()=>{let r=await A.api.teams[":teamId"].quotas.$get({param:{teamId:a}});if(!r.ok)throw Error(Xo());return await r.json()},enabled:!!a}),c=e?.rules??[];return o(Ke,{className:"border-border/60 shadow-sm",children:[o(vt,{children:[o(wt,{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[t(zo,{className:"h-5 w-5 text-primary"}),Ud()]}),t(kt,{children:tC()})]}),t(at,{children:s?t("div",{className:"flex h-48 items-center justify-center",children:t(O,{className:"h-7 w-7 animate-spin text-muted-foreground"})}):i?t("div",{className:"py-10 text-center text-sm text-destructive",children:Xo()}):c.length===0?o("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-12 text-center",children:[t(zo,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),t("p",{className:"text-base font-medium text-foreground",children:fp()}),t("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:dp()})]}):t("div",{className:"space-y-3",children:c.map((r)=>t(je,{teamId:a,rule:r},r.id))})})]})}S();var Ue=Object.values(Fl);function pe({teamId:a}){let[e,s]=u([]),[i,c]=u([]),[r,f]=u(""),{ref:g,inView:b}=Nt(),{data:v}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let l=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!l.ok)return[];return await l.json()},enabled:!!a}),p=v||[],{data:x,isLoading:N,isError:n,fetchNextPage:y,hasNextPage:d,isFetchingNextPage:h}=mt({queryKey:["teams",a,"audit-logs",e,i,r],queryFn:async({pageParam:l})=>{let T=await A.api.teams[":teamId"]["audit-logs"].$get({param:{teamId:a},query:{first:"20",after:l?String(l):void 0,actions:e.length>0?e:void 0,userIds:i.length>0?i:void 0,itemId:r.trim()||void 0}});if(!T.ok)throw Error("Failed to fetch audit logs");return await T.json()},initialPageParam:"",getNextPageParam:(l)=>l.pageInfo.endCursor||void 0,enabled:!!a});m(()=>{if(b&&d&&!h)y()},[b,d,h,y]);let w=x?.pages.flatMap((l)=>l.nodes)||[],q=x?.pages[0]?.total??0,R=(l)=>{s((T)=>T.includes(l)?T.filter((k)=>k!==l):[...T,l])},j=(l)=>{c((T)=>T.includes(l)?T.filter((k)=>k!==l):[...T,l])},fe=(l)=>{if(l.includes("delete")||l.includes("remove")||l.includes("revoke"))return t(he,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:l});if(l.includes("create")||l.includes("add"))return t(he,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:l});if(l.includes("update")||l.includes("reparent")||l.includes("copy"))return t(he,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs",children:l});return t(he,{variant:"outline",className:"bg-muted text-muted-foreground border-border font-mono text-xs",children:l})},ge=new Map(p.map((l)=>[l.userId||l.id,l]));return t("div",{className:"space-y-6",children:o(Ke,{className:"border border-border/50 shadow-xs",children:[o(vt,{className:"pb-4",children:[o("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[o("div",{children:[o(wt,{className:"text-xl font-bold flex items-center gap-2",children:[t(Ws,{className:"h-5 w-5 text-primary"}),Rf()]}),t(kt,{className:"mt-1",children:y_()})]}),q>0&&o(he,{variant:"secondary",className:"w-fit text-xs font-normal",children:[q," ",Rf()]})]}),o("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[o(At,{children:[t(_t,{asChild:!0,children:o(C,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(J,{className:"h-3.5 w-3.5"}),kv(),e.length>0&&t(he,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:e.length})]})}),o(yt,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:aI()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:Ue.map((l)=>o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(wr,{checked:e.includes(l),onCheckedChange:()=>R(l)}),t("span",{className:"font-mono",children:l})]},l))}),e.length>0&&t(C,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>s([]),children:"Clear Actions"})]})]}),o(At,{children:[t(_t,{asChild:!0,children:o(C,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(J,{className:"h-3.5 w-3.5"}),Rv(),i.length>0&&t(he,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:i.length})]})}),o(yt,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:wI()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:p.map((l)=>{let T=l.userId||l.user?.id||l.id,k=l.user?.name||l.name||T,K=l.user?.image||l.image;return o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(wr,{checked:i.includes(T),onCheckedChange:()=>j(T)}),o(Ce,{className:"h-5 w-5",children:[t(Ie,{src:K||void 0}),t(Te,{className:"text-[10px]",children:k.slice(0,2).toUpperCase()})]}),t("span",{className:"truncate",children:k})]},T)})}),i.length>0&&t(C,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>c([]),children:"Clear Users"})]})]}),o("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[t(Ut,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t(z,{type:"text",placeholder:oI(),value:r,onChange:(l)=>f(l.target.value),className:"pl-8 pr-8 h-9 text-xs"}),r&&t("button",{onClick:()=>f(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:t(Ne,{className:"h-4 w-4"})})]}),(e.length>0||i.length>0||r)&&t(C,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{s([]),c([]),f("")},children:"Clear all"})]})]}),o(at,{className:"p-0",children:[N?t("div",{className:"flex h-64 items-center justify-center",children:t(O,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?t("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load audit logs."}):w.length===0?t("div",{className:"p-12 text-center text-sm text-muted-foreground",children:pS()}):o(Pn,{children:[t(Nn,{children:o(xr,{className:"hover:bg-transparent border-b border-border/50",children:[t(It,{className:"w-[180px] text-xs font-semibold",children:$A()}),t(It,{className:"w-[200px] text-xs font-semibold",children:L1()}),t(It,{className:"text-xs font-semibold",children:Pw()}),t(It,{className:"text-xs font-semibold",children:NE()}),t(It,{className:"w-[160px] text-right text-xs font-semibold",children:r1()})]})}),t(Dn,{children:w.map((l)=>{let T=l.userId?ge.get(l.userId):null,k=T?.user?.name||T?.name||l.userId||"System",K=T?.user?.image||T?.image;return o(xr,{className:"hover:bg-muted/40 transition-colors",children:[t(xt,{className:"py-3 font-medium",children:fe(l.action)}),t(xt,{className:"py-3",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[t(Ie,{src:K||void 0}),t(Te,{className:"text-[10px]",children:k.slice(0,2).toUpperCase()})]}),t("span",{className:"text-xs font-medium text-foreground truncate max-w-[160px]",children:l.agent?Xc({user:k,agent:l.agent.name}):k}),l.agent&&t(Tt,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"})]})}),t(xt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.itemId||"-"}),t(xt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.projectId||"-"}),t(xt,{className:"py-3 text-right text-xs text-muted-foreground",children:kn(l.createdAt)})]},l.id)})})]}),t("div",{ref:g,className:"py-4 flex justify-center",children:h&&t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]})})}function $e(){let{teamId:a}=Ge.useParams(),[e,s]=u("audit-logs"),{data:i,isLoading:c}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let r=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!r.ok)throw Error("Failed to fetch me");return await r.json()},enabled:!!a});if(c)return t("div",{className:"flex h-screen items-center justify-center",children:t(O,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(i?.role?.toLowerCase()!=="owner")return o("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[t(Jl,{className:"h-12 w-12 text-destructive mb-4"}),t("h2",{className:"text-xl font-bold tracking-tight mb-2",children:HA()}),t("p",{className:"text-sm text-muted-foreground max-w-md",children:BS()})]});return t("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:o("div",{className:"flex flex-col md:flex-row h-full",children:[t("div",{className:"w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300",children:o("nav",{className:"p-4 space-y-1 mt-4",children:[t("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:mh()}),t("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:LT()}),o("button",{onClick:()=>s("audit-logs"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="audit-logs"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(Ws,{className:"w-5 h-5"}),Rf(),e==="audit-logs"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("quotas"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="quotas"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(zo,{className:"w-5 h-5"}),Ud(),e==="quotas"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),t("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:G0()}),o("button",{onClick:()=>s("ai-usage"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="ai-usage"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(ie,{className:"w-5 h-5"}),F1(),e==="ai-usage"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("ai-sessions"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="ai-sessions"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(Q,{className:"w-5 h-5"}),dA(),e==="ai-sessions"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),t("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:o("div",{className:"max-w-6xl mx-auto space-y-8",children:[e==="audit-logs"&&t(pe,{teamId:a}),e==="ai-usage"&&t(ne,{teamId:a}),e==="ai-sessions"&&t(le,{teamId:a}),e==="quotas"&&t(ue,{teamId:a})]})})]})})}var Ge=ze("/teams/$teamId/dashboard")({component:$e});export{Ge as Route};
|
|
1
|
+
import{F,P,m,D,_,u,Xn,S,L,t,o,G,Hu,$u,br,Dc,Yi,wo,Ht,Yo,Gu,Vu,Qu,Ku,Oc,Wu,Z,B,mt,Ue,A,I,ir,O,Tt,ve,er,Ut,Jo,Pe,E,gt,ye,Y,Pt,Er,Lt,se,cr,C,Ce,Ie,Te,qA,HA,V0,W0,Y0,Pf,b_,lh,Ne,na,ph,Ty,qc,Ah,Hs,Xo,Nh,Dh,Rv,Pv,Qh,Nw,Nx,Dx,pS,fp,pp,IS,BS,xg,Kc,NE,qg,XE,tC,wp,nC,iC,$g,lC,cC,Gg,uC,fC,Ld,Zd,Bd,Nl,Tp,bC,vC,wC,xC,Ud,Gs,qC,oI,aI,wI,NI,OI,FI,LI,ZI,pA,BI,$d,FT,UT,t1,CA,An,Kp,O1,F1,tu,Xe,et,tt,rt,nt,ot,st,it,z,Nt,M,Bl,kn,tm,he,At,_t,yt,wr,af,Ke,vt,wt,kt,at}from"./chunk-vvr8tnse.js";import{Ro,yr}from"./chunk-fb1bes2h.js";import{Yl}from"./chunk-zzzgk1d5.js";import{Ys,zo,tc,Xa,Oi,rc}from"./chunk-a6cdt85k.js";import{Pn,Nn,Dn,xr,It,xt}from"./chunk-ggwqxn95.js";import"./chunk-fg9sr6r9.js";import"./chunk-hjzbw975.js";import{Kn,co}from"./chunk-5m51b7af.js";S();function te(a,e){let s=new Set(e);return a.filter((i)=>!s.has(i))}var ae=class extends wo{#r;#e;#o;#a;#t;#s;#i;#n;#l;#d=[];constructor(a,e,s){super();this.#r=a,this.#a=s,this.#o=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){if(this.listeners.size===1)this.#t.forEach((a)=>{a.subscribe((e)=>{this.#p(a,e)})})}onUnsubscribe(){if(!this.listeners.size)this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach((a)=>{a.destroy()})}setQueries(a,e){this.#o=a,this.#a=e,Ht.batch(()=>{let s=this.#t,i=this.#u(this.#o);i.forEach((p)=>p.observer.setOptions(p.defaultedQueryOptions));let c=i.map((p)=>p.observer),r=c.map((p)=>p.getCurrentResult()),f=s.length!==c.length,g=c.some((p,x)=>p!==s[x]),b=f||g,v=b?!0:r.some((p,x)=>{let N=this.#e[x];return!N||!Yi(p,N)});if(!b&&!v)return;if(b)this.#d=i,this.#t=c;if(this.#e=r,!this.hasListeners())return;if(b)te(s,c).forEach((p)=>{p.destroy()}),te(c,s).forEach((p)=>{p.subscribe((x)=>{this.#p(p,x)})});this.#f()})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map((a)=>a.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(a,e){let s=this.#u(a),i=s.map((r)=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),c=s.map((r)=>r.defaultedQueryOptions.queryHash);return[i,(r)=>this.#c(r??i,e,c),()=>this.#m(i,s)]}#m(a,e){let s=new Set;return e.map((i,c)=>{let r=a[c];return!i.defaultedQueryOptions.notifyOnChangeProps?i.observer.trackResult(r,(f)=>{if(!s.has(f))s.add(f),e.forEach((g)=>{g.observer.trackProp(f)})}):r})}#c(a,e,s){if(e){let i=this.#l,c=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((r,f)=>r!==i[f]));if(this.#e!==this.#n||c||e!==this.#i){if(this.#i=e,this.#n=this.#e,s!==void 0)this.#l=s;this.#s=Dc(this.#s,e(a))}return this.#s}return a}#g(){return!this.#a?.combine||this.#t.some((a,e)=>a.options.suspense&&this.#e[e]?.data===void 0)}#u(a){let e=new Map;this.#t.forEach((i)=>{let c=i.options.queryHash;if(!c)return;let r=e.get(c);if(r)r.push(i);else e.set(c,[i])});let s=[];return a.forEach((i)=>{let c=this.#r.defaultQueryOptions(i),r=e.get(c.queryHash)?.shift()??new Yo(this.#r,c);s.push({defaultedQueryOptions:c,observer:r})}),s}#p(a,e){let s=this.#t.indexOf(a);if(s!==-1)this.#e=this.#e.slice(),this.#e[s]=e,this.#f()}#f(){if(this.hasListeners()){let a=this.#g(),e=this.#s,s=a?e:this.#c(this.#m(this.#e,this.#d),this.#a?.combine);if(a||e!==s)Ht.batch(()=>{this.listeners.forEach((i)=>{i(this.#e)})})}}};S();function re({queries:a,...e},s){let i=G(s),c=Hu(),r=$u(),f=e.subscribed!==!1,g=D(()=>a.map((d)=>{let h=i.defaultQueryOptions(d);return h._optimisticResults=c?"isRestoring":f?"optimistic":void 0,h}),[a,i,c,f]);g.forEach((d)=>{Ku(d);let h=i.getQueryCache().get(d.queryHash);Gu(d,r,h)}),Vu(r);let[b]=u(()=>new ae(i,g,e)),[v,p,x]=b.getOptimisticResult(g,e.combine),N=!c&&f;Xn(P((d)=>N?b.subscribe(Ht.batchCalls(d)):br,[b,N]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),m(()=>{b.setQueries(g,e)},[g,e,b]);let n=v.some((d,h)=>Oc(g[h],d))?v.flatMap((d,h)=>{let w=g[h];if(w&&Oc(w,d)){let q=new Yo(i,w);return Wu(w,q,r)}return[]}):[];if(n.length>0)throw Promise.all(n);let y=v.find((d,h)=>{let w=g[h];return w&&Qu({result:d,errorResetBoundary:r,throwOnError:w.throwOnError,query:i.getQueryCache().get(w.queryHash),suspense:w.suspense})});if(y)throw y.error;return p(x())}S();S();var xe=Object.defineProperty,H=(a,e)=>xe(a,"name",{value:e,configurable:!0}),W="Collapsible",[we,Mt]=gt(W),[_e,X]=we(W),Re=F(H(function(e,s){let{__scopeCollapsible:i,open:c,defaultOpen:r,disabled:f,onOpenChange:g,...b}=e,[v,p]=Lt({prop:c,defaultProp:r??!1,onChange:g,caller:W});return t(_e,{scope:i,disabled:f,contentId:Er(),open:v,onOpenToggle:P(()=>p((x)=>!x),[p]),children:t(se.div,{"data-state":U(v),"data-disabled":f?"":void 0,...b,ref:s})})},"Collapsible")),ke="CollapsibleTrigger",Ae=F(H(function(e,s){let{__scopeCollapsible:i,...c}=e,r=X(ke,i);return t(se.button,{type:"button","aria-controls":r.open?r.contentId:void 0,"aria-expanded":r.open||!1,"data-state":U(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...c,ref:s,onClick:Y(e.onClick,r.onOpenToggle)})},"CollapsibleTrigger")),oe="CollapsibleContent",qe=F(H(function(e,s){let{forceMount:i,...c}=e,r=X(oe,e.__scopeCollapsible);return t(cr,{present:i||r.open,children:({present:f})=>t(De,{...c,ref:s,present:f})})},"CollapsibleContent")),De=F(H(function(e,s){let{__scopeCollapsible:i,present:c,children:r,...f}=e,g=X(oe,i),[b,v]=u(c),p=_(null),x=ye(s,p),N=_(0),n=N.current,y=_(0),d=y.current,h=g.open||b,w=_(h),q=_(void 0);return m(()=>{let R=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(R)},[]),Pt(()=>{let R=p.current;if(R){q.current=q.current||{transitionDuration:R.style.transitionDuration,animationName:R.style.animationName},R.style.transitionDuration="0s",R.style.animationName="none";let j=R.getBoundingClientRect();if(N.current=j.height,y.current=j.width,!w.current)R.style.transitionDuration=q.current.transitionDuration,R.style.animationName=q.current.animationName;v(c)}},[g.open,c]),t(se.div,{"data-state":U(g.open),"data-disabled":g.disabled?"":void 0,id:g.contentId,hidden:!h,...f,ref:x,style:{["--radix-collapsible-content-height"]:n?`${n}px`:void 0,["--radix-collapsible-content-width"]:d?`${d}px`:void 0,...e.style},children:h&&r})},"CollapsibleContentImpl"));function U(a){return a?"open":"closed"}H(U,"getState");var Se=Re;var He=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],ie=I("chart-no-axes-column",He);var Oe=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],J=I("funnel",Oe);var Qe=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],Q=I("messages-square",Qe);function ne({teamId:a}){let[e,s]=u("team"),[i,c]=u("1h"),{data:r,isLoading:f}=Z({queryKey:["teams",a,"ai-usage",i,"team"],queryFn:async()=>{let d=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i}});if(!d.ok)throw Error("Failed to fetch team AI usage");return await d.json()},enabled:!!a&&e==="team"}),{data:g,isLoading:b}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let d=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!d.ok)throw Error("Failed to fetch team members");return await d.json()},enabled:!!a&&e==="members"}),v=re({queries:(g||[]).map((d)=>({queryKey:["teams",a,"ai-usage",i,d.id],queryFn:async()=>{let h=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i,userId:d.id}});if(!h.ok)throw Error(`Failed to fetch AI usage for member ${d.id}`);return await h.json()},enabled:!!a&&e==="members"}))}),p=b||v.some((d)=>d.isLoading),x=(d)=>{if(!d)return"U";let h=d.split(" ");if(h.length>1)return`${h[0][0]}${h[h.length-1][0]}`.toUpperCase();return d.substring(0,2).toUpperCase()},N=(d)=>{if(!d)return"";switch(d.toLowerCase()){case"owner":return Kc();case"editor":return Hs();case"reviewer":return Gs();default:return d}},n=(d)=>(d??0).toLocaleString(),y=(d)=>`$${(d??0).toFixed(6)}`;return o(Ke,{className:"border-border/60 shadow-sm",children:[o(vt,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[o("div",{children:[t(wt,{className:"text-xl font-semibold tracking-tight",children:W0()}),t(kt,{className:"text-sm text-muted-foreground mt-1",children:Y0()})]}),o("div",{className:"flex flex-wrap items-center gap-3",children:[o(Ro,{type:"single",value:e,onValueChange:(d)=>{if(d)s(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(yr,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:UT()}),t(yr,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:Dx()})]}),o(Ro,{type:"single",value:i,onValueChange:(d)=>{if(d)c(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(yr,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),t(yr,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),t(yr,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),t(yr,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),t(at,{children:e==="team"?f?t("div",{className:"flex h-48 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(Pn,{children:[t(Nn,{children:o(xr,{children:[t(It,{children:$d()}),t(It,{className:"text-right",children:Qh()}),t(It,{className:"text-right",children:xg()}),t(It,{className:"text-right",children:lh()}),t(It,{className:"text-right",children:CA()}),t(It,{className:"text-right",children:ph()})]})}),t(Dn,{children:o(xr,{children:[t(xt,{className:"font-medium",children:$d()}),t(xt,{className:"text-right",children:n(r?.team?.inputTokens)}),t(xt,{className:"text-right",children:n(r?.team?.outputTokens)}),t(xt,{className:"text-right",children:n(r?.team?.cacheReadTokens)}),t(xt,{className:"text-right font-medium",children:n(r?.team?.totalTokens)}),t(xt,{className:"text-right font-medium",children:y(r?.team?.cost)})]})})]})}):p?t("div",{className:"flex h-48 items-center justify-center",children:t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(Pn,{children:[t(Nn,{children:o(xr,{children:[t(It,{children:Nx()}),t(It,{children:qC()}),t(It,{className:"text-right",children:Qh()}),t(It,{className:"text-right",children:xg()}),t(It,{className:"text-right",children:lh()}),t(It,{className:"text-right",children:CA()}),t(It,{className:"text-right",children:ph()})]})}),t(Dn,{children:(g||[]).map((d,h)=>{let w=v[h]?.data?.member;return o(xr,{children:[t(xt,{children:o("div",{className:"flex items-center gap-3",children:[o(Ce,{className:"h-8 w-8 rounded-full",children:[d.image&&t(Ie,{src:d.image,alt:d.name,className:"object-cover"}),t(Te,{className:"bg-primary/20 text-xs",children:x(d.name)})]}),o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-medium leading-none",children:d.name}),t("span",{className:"text-xs text-muted-foreground mt-0.5",children:d.email})]})]})}),t(xt,{className:"text-xs text-muted-foreground",children:N(d.role)}),t(xt,{className:"text-right",children:n(w?.inputTokens)}),t(xt,{className:"text-right",children:n(w?.outputTokens)}),t(xt,{className:"text-right",children:n(w?.cacheReadTokens)}),t(xt,{className:"text-right font-medium",children:n(w?.totalTokens)}),t(xt,{className:"text-right font-medium",children:y(w?.cost)})]},d.id)})})]})})})]})}S();function le({teamId:a}){let[e,s]=u(null),{ref:i,inView:c}=Nt(),{data:r,isLoading:f,isError:g,fetchNextPage:b,hasNextPage:v,isFetchingNextPage:p}=mt({queryKey:["teams",a,"agent-sessions"],queryFn:async({pageParam:n})=>{let y=await A.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:a},query:{first:"20",after:n?String(n):void 0}});if(!y.ok)throw Error("Failed to fetch agent sessions");return await y.json()},initialPageParam:"",getNextPageParam:(n)=>n.pageInfo.cursor||void 0,enabled:!!a});m(()=>{if(c&&v&&!p)b()},[c,v,p,b]);let x=r?.pages.flatMap((n)=>n.data).filter((n)=>n.id!=="pending")||[],N=(n)=>{switch(n){case"comment":return t(he,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:LI()});case"chat":return t(he,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:FI()});case"naming":return t(he,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:ZI()});default:return t(he,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:n})}};return o("div",{className:"space-y-6",children:[o(Ke,{className:"border border-border/50 shadow-xs",children:[t(vt,{className:"pb-4",children:t("div",{className:"flex items-center justify-between",children:o("div",{children:[o(wt,{className:"text-xl font-bold flex items-center gap-2",children:[t(Q,{className:"w-5 h-5 text-violet-500"}),pA()]}),t(kt,{className:"mt-1 text-sm text-muted-foreground",children:BI()})]})})}),t(at,{children:f?t("div",{className:"flex h-64 items-center justify-center",children:t(O,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):g?t("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):x.length===0?o("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[t(Q,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),t("p",{className:"text-base font-medium",children:IS()})]}):o("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[o(Pn,{children:[t(Nn,{className:"bg-muted/40",children:o(xr,{children:[t(It,{children:NI()}),t(It,{children:qc()}),t(It,{children:OI()}),t(It,{className:"text-right",children:Ty()})]})}),t(Dn,{children:x.map((n)=>o(xr,{onClick:()=>s(n.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[t(xt,{className:"font-medium",children:o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-semibold text-foreground",children:n.name||Kp()}),t("span",{className:"text-xs font-mono text-muted-foreground/70",children:n.id})]})}),t(xt,{children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[t(Ie,{src:n.creator?.image||void 0}),t(Te,{className:"text-[10px]",children:n.creator?.name?.[0]?.toUpperCase()||"?"})]}),t("span",{className:"text-sm text-foreground/90",children:n.creator?.name||"System / Agent"})]})}),t(xt,{children:N(n.type)}),t(xt,{className:"text-right text-xs text-muted-foreground",children:kn(n.createdAt)})]},n.id))})]}),t("div",{ref:i,className:"py-4 flex justify-center",children:p&&t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),t(Yl,{sessionId:e,open:!!e,onOpenChange:(n)=>{if(!n)s(null)}})]})}S();function de({...a}){return t(Se,{"data-slot":"collapsible",...a})}function me({...a}){return t(Ae,{"data-slot":"collapsible-trigger",...a})}function ce({...a}){return t(qe,{"data-slot":"collapsible-content",...a})}function ee(a){switch(a.toLowerCase()){case"owner":return Kc();case"editor":return Hs();case"reviewer":return Gs();default:return a}}function Le(a,e){if(typeof a==="object"&&a!==null&&"message"in a){let s=a.message;if(typeof s==="string")return s}return e}function Be({rule:a}){let e=a.resourceData??{};if(a.resource==="agent_mcp_call_count")return t("span",{children:vC({value:String(e.id??"")})});if(a.resource==="agent_bash_call_count")return t("span",{children:bC({value:String(e.match??"*")})});if(a.resource==="agent_tool_call_count")return t("span",{children:wC({value:String(e.name??e.toolName??"*")})});return null}function Me({rule:a}){if(a.scopeMode==="all_members")return o(he,{variant:"secondary",className:"gap-1 text-xs",children:[t(co,{className:"h-3 w-3"}),o("span",{children:[Ld(),a.role?` (${ee(a.role)})`:` (${Nl()})`]})]});if(a.scopeMode==="each_member")return o(he,{variant:"secondary",className:"gap-1 text-xs",children:[t(Kn,{className:"h-3 w-3"}),o("span",{children:[Zd(),a.role?` (${ee(a.role)})`:` (${Nl()})`]})]});return o(he,{variant:"secondary",className:"gap-1 text-xs",children:[t(Jo,{className:"h-3 w-3"}),o("span",{children:[Bd()," (",a.userIds?.length||0,")"]})]})}function Fe({teamId:a,rule:e,record:s}){let i=G(),[c,r]=u(!1),[f,g]=u(()=>new Date),b=Xa[e.resource],v=e.scopeMode==="all_members",p=s.percent>=100,x=v?e.role?`${fC()}: ${ee(e.role)}`:xC():s.user?.name||s.userId||An();m(()=>{if(!s.isWindowActive||!s.periodEnd)return;let n=window.setInterval(()=>g(new Date),60000);return()=>window.clearInterval(n)},[s.isWindowActive,s.periodEnd]);let N=B({mutationFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.reset.$post({param:{teamId:a,id:e.id},json:{userId:s.userId??null}});if(!n.ok){let y=await n.json().catch(()=>null);throw Error(Le(y,Dh()))}return await n.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["teams",a,"quotas",e.id,"records"]}),i.invalidateQueries({queryKey:["teams",a,"quotas"]}),r(!1),M.success(cC())},onError:(n)=>{let y=n instanceof Error?n.message:Dh();r(!1),M.error(y)}});return o(L,{children:[o("div",{className:"space-y-3 rounded-xl border border-border/70 bg-card p-4 text-card-foreground shadow-2xs",children:[o("div",{className:"flex items-center justify-between gap-3",children:[o("div",{className:"flex min-w-0 items-center gap-3",children:[v?t("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t(co,{className:"h-5 w-5"})}):o(Ce,{className:"h-9 w-9 shrink-0 border border-border/50",children:[t(Ie,{src:s.user?.image||void 0}),t(Te,{className:"text-xs font-semibold",children:s.user?.name?.[0]?.toUpperCase()||"U"})]}),o("div",{className:"min-w-0",children:[t("div",{className:"truncate text-sm font-semibold text-foreground",children:x}),!v&&s.user?.email&&t("div",{className:"truncate text-xs text-muted-foreground",children:s.user.email})]})]}),o("div",{className:"flex shrink-0 items-center gap-2",children:[s.isWindowActive&&s.periodEnd?o(he,{variant:"outline",className:"hidden gap-1 border-primary/30 bg-primary/5 text-xs text-primary sm:flex",children:[t(er,{className:"h-3 w-3"}),t("span",{children:$g({time:tm(s.periodEnd,f)})})]}):o(he,{variant:"secondary",className:"hidden gap-1 text-xs text-muted-foreground sm:flex",children:[t(ir,{className:"h-3 w-3 text-primary"}),t("span",{children:qg()})]}),o(C,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>r(!0),disabled:N.isPending,children:[N.isPending?t(O,{className:"h-3.5 w-3.5 animate-spin"}):t(Ys,{className:"h-3.5 w-3.5"}),Gg()]})]})]}),o("div",{className:"space-y-1.5 pt-1",children:[t(af,{value:Math.min(100,Math.max(0,s.percent)),className:"h-2"}),o("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[o("span",{className:p?"font-bold text-destructive":"text-foreground",children:[Oi(e.resource,s.consumed)," /"," ",Oi(e.resource,e.limit)," ",b?.unit]}),o("span",{className:p?"font-bold text-destructive":"text-muted-foreground",children:[s.percent,"%"]})]})]}),o("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground sm:hidden",children:[s.isWindowActive&&s.periodEnd?o("span",{className:"flex items-center gap-1 text-primary",children:[t(er,{className:"h-3 w-3"}),$g({time:tm(s.periodEnd,f)})]}):o("span",{className:"flex items-center gap-1",children:[t(ir,{className:"h-3 w-3 text-primary"}),qg()]}),o("span",{children:[lC(),": ",Oi(e.resource,s.remaining)," ",b?.unit]})]})]}),t(Xe,{open:c,onOpenChange:r,children:o(et,{children:[o(tt,{children:[t(nt,{children:Gg()}),t(ot,{children:uC({target:x})})]}),o(rt,{children:[t(it,{disabled:N.isPending,children:Ne()}),o(st,{onClick:(n)=>{n.preventDefault(),N.mutate()},disabled:N.isPending,children:[N.isPending&&t(O,{className:"mr-2 h-4 w-4 animate-spin"}),na()]})]})]})})]})}function je({teamId:a,rule:e}){let[s,i]=u(!1),[c,r]=u(""),f=Xa[e.resource],g=f?.icon||zo,{data:b,isLoading:v,isError:p}=Z({queryKey:["teams",a,"quotas",e.id,"records"],queryFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.$get({param:{teamId:a,id:e.id}});if(!n.ok)throw Error(Nh());return await n.json()},enabled:s,refetchInterval:s?1e4:!1}),x=b?.records??[],N=x.filter((n)=>{if(!c.trim())return!0;let y=c.toLowerCase();return n.user?.name.toLowerCase().includes(y)||n.user?.email.toLowerCase().includes(y)});return o(de,{open:s,onOpenChange:i,className:"rounded-xl border border-border/70",children:[t(me,{asChild:!0,children:o("button",{type:"button","aria-label":s?XE():nC(),className:"flex w-full items-center justify-between gap-4 p-4 text-left transition-colors hover:bg-muted/40",children:[o("div",{className:"flex min-w-0 items-start gap-3",children:[t("div",{className:"mt-0.5 rounded-lg bg-primary/10 p-2 text-primary",children:t(g,{className:"h-5 w-5"})}),o("div",{className:"min-w-0",children:[o("div",{className:"flex flex-wrap items-center gap-2",children:[t("span",{className:"font-semibold text-foreground",children:f?.label()||e.resource}),!e.enabled&&t(he,{variant:"secondary",children:wp()})]}),o("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[t(Me,{rule:e}),o(he,{variant:"outline",className:"gap-1 text-xs",children:[t(er,{className:"h-3 w-3"}),Oi(e.resource,e.limit)," ",f?.unit," /"," ",rc(e.period)]}),t(Be,{rule:e})]})]})]}),t(ve,{className:`h-5 w-5 shrink-0 text-muted-foreground transition-transform ${s?"rotate-180":""}`})]})}),t(ce,{children:o("div",{className:"space-y-3 border-t border-border/60 bg-muted/10 p-4",children:[e.scopeMode!=="all_members"&&x.length>3&&o("div",{className:"relative",children:[t(Ut,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),t(z,{value:c,onChange:(n)=>r(n.target.value),placeholder:Tp(),className:"h-9 pl-9 text-sm"})]}),v?t("div",{className:"flex justify-center py-10",children:t(O,{className:"h-7 w-7 animate-spin text-primary"})}):p?t("div",{className:"py-8 text-center text-sm text-destructive",children:Nh()}):N.length===0?t("div",{className:"py-8 text-center text-sm text-muted-foreground",children:iC()}):N.map((n,y)=>t(Fe,{teamId:a,rule:e,record:n},n.id||n.userId||`record-${y}`))]})})]})}function ue({teamId:a}){let{data:e,isLoading:s,isError:i}=Z({queryKey:["teams",a,"quotas"],queryFn:async()=>{let r=await A.api.teams[":teamId"].quotas.$get({param:{teamId:a}});if(!r.ok)throw Error(Xo());return await r.json()},enabled:!!a}),c=e?.rules??[];return o(Ke,{className:"border-border/60 shadow-sm",children:[o(vt,{children:[o(wt,{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[t(zo,{className:"h-5 w-5 text-primary"}),Ud()]}),t(kt,{children:tC()})]}),t(at,{children:s?t("div",{className:"flex h-48 items-center justify-center",children:t(O,{className:"h-7 w-7 animate-spin text-muted-foreground"})}):i?t("div",{className:"py-10 text-center text-sm text-destructive",children:Xo()}):c.length===0?o("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-12 text-center",children:[t(zo,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),t("p",{className:"text-base font-medium text-foreground",children:pp()}),t("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:fp()})]}):t("div",{className:"space-y-3",children:c.map((r)=>t(je,{teamId:a,rule:r},r.id))})})]})}S();var $e=Object.values(Bl);function pe({teamId:a}){let[e,s]=u([]),[i,c]=u([]),[r,f]=u(""),{ref:g,inView:b}=Nt(),{data:v}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let l=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!l.ok)return[];return await l.json()},enabled:!!a}),p=v||[],{data:x,isLoading:N,isError:n,fetchNextPage:y,hasNextPage:d,isFetchingNextPage:h}=mt({queryKey:["teams",a,"audit-logs",e,i,r],queryFn:async({pageParam:l})=>{let T=await A.api.teams[":teamId"]["audit-logs"].$get({param:{teamId:a},query:{first:"20",after:l?String(l):void 0,actions:e.length>0?e:void 0,userIds:i.length>0?i:void 0,itemId:r.trim()||void 0}});if(!T.ok)throw Error("Failed to fetch audit logs");return await T.json()},initialPageParam:"",getNextPageParam:(l)=>l.pageInfo.endCursor||void 0,enabled:!!a});m(()=>{if(b&&d&&!h)y()},[b,d,h,y]);let w=x?.pages.flatMap((l)=>l.nodes)||[],q=x?.pages[0]?.total??0,R=(l)=>{s((T)=>T.includes(l)?T.filter((k)=>k!==l):[...T,l])},j=(l)=>{c((T)=>T.includes(l)?T.filter((k)=>k!==l):[...T,l])},fe=(l)=>{if(l.includes("delete")||l.includes("remove")||l.includes("revoke"))return t(he,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:l});if(l.includes("create")||l.includes("add"))return t(he,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:l});if(l.includes("update")||l.includes("reparent")||l.includes("copy"))return t(he,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs",children:l});return t(he,{variant:"outline",className:"bg-muted text-muted-foreground border-border font-mono text-xs",children:l})},ge=new Map(p.map((l)=>[l.userId||l.id,l]));return t("div",{className:"space-y-6",children:o(Ke,{className:"border border-border/50 shadow-xs",children:[o(vt,{className:"pb-4",children:[o("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[o("div",{children:[o(wt,{className:"text-xl font-bold flex items-center gap-2",children:[t(Ys,{className:"h-5 w-5 text-primary"}),Pf()]}),t(kt,{className:"mt-1",children:b_()})]}),q>0&&o(he,{variant:"secondary",className:"w-fit text-xs font-normal",children:[q," ",Pf()]})]}),o("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[o(At,{children:[t(_t,{asChild:!0,children:o(C,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(J,{className:"h-3.5 w-3.5"}),Rv(),e.length>0&&t(he,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:e.length})]})}),o(yt,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:aI()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:$e.map((l)=>o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(wr,{checked:e.includes(l),onCheckedChange:()=>R(l)}),t("span",{className:"font-mono",children:l})]},l))}),e.length>0&&t(C,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>s([]),children:"Clear Actions"})]})]}),o(At,{children:[t(_t,{asChild:!0,children:o(C,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(J,{className:"h-3.5 w-3.5"}),Pv(),i.length>0&&t(he,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:i.length})]})}),o(yt,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:wI()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:p.map((l)=>{let T=l.userId||l.user?.id||l.id,k=l.user?.name||l.name||T,K=l.user?.image||l.image;return o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(wr,{checked:i.includes(T),onCheckedChange:()=>j(T)}),o(Ce,{className:"h-5 w-5",children:[t(Ie,{src:K||void 0}),t(Te,{className:"text-[10px]",children:k.slice(0,2).toUpperCase()})]}),t("span",{className:"truncate",children:k})]},T)})}),i.length>0&&t(C,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>c([]),children:"Clear Users"})]})]}),o("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[t(Ut,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t(z,{type:"text",placeholder:oI(),value:r,onChange:(l)=>f(l.target.value),className:"pl-8 pr-8 h-9 text-xs"}),r&&t("button",{onClick:()=>f(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:t(Pe,{className:"h-4 w-4"})})]}),(e.length>0||i.length>0||r)&&t(C,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{s([]),c([]),f("")},children:"Clear all"})]})]}),o(at,{className:"p-0",children:[N?t("div",{className:"flex h-64 items-center justify-center",children:t(O,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?t("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load audit logs."}):w.length===0?t("div",{className:"p-12 text-center text-sm text-muted-foreground",children:pS()}):o(Pn,{children:[t(Nn,{children:o(xr,{className:"hover:bg-transparent border-b border-border/50",children:[t(It,{className:"w-[180px] text-xs font-semibold",children:HA()}),t(It,{className:"w-[200px] text-xs font-semibold",children:F1()}),t(It,{className:"text-xs font-semibold",children:Nw()}),t(It,{className:"text-xs font-semibold",children:NE()}),t(It,{className:"w-[160px] text-right text-xs font-semibold",children:t1()})]})}),t(Dn,{children:w.map((l)=>{let T=l.userId?ge.get(l.userId):null,k=T?.user?.name||T?.name||l.userId||"System",K=T?.user?.image||T?.image;return o(xr,{className:"hover:bg-muted/40 transition-colors",children:[t(xt,{className:"py-3 font-medium",children:fe(l.action)}),t(xt,{className:"py-3",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[t(Ie,{src:K||void 0}),t(Te,{className:"text-[10px]",children:k.slice(0,2).toUpperCase()})]}),t("span",{className:"text-xs font-medium text-foreground truncate max-w-[160px]",children:l.agent?tu({user:k,agent:l.agent.name}):k}),l.agent&&t(Tt,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"})]})}),t(xt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.itemId||"-"}),t(xt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.projectId||"-"}),t(xt,{className:"py-3 text-right text-xs text-muted-foreground",children:kn(l.createdAt)})]},l.id)})})]}),t("div",{ref:g,className:"py-4 flex justify-center",children:h&&t(O,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]})})}function ze(){let{teamId:a}=Ge.useParams(),[e,s]=u("audit-logs"),{data:i,isLoading:c}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let r=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!r.ok)throw Error("Failed to fetch me");return await r.json()},enabled:!!a});if(c)return t("div",{className:"flex h-screen items-center justify-center",children:t(O,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(i?.role?.toLowerCase()!=="owner")return o("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[t(tc,{className:"h-12 w-12 text-destructive mb-4"}),t("h2",{className:"text-xl font-bold tracking-tight mb-2",children:qA()}),t("p",{className:"text-sm text-muted-foreground max-w-md",children:BS()})]});return t("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:o("div",{className:"flex flex-col md:flex-row h-full",children:[t("div",{className:"w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300",children:o("nav",{className:"p-4 space-y-1 mt-4",children:[t("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:Ah()}),t("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:FT()}),o("button",{onClick:()=>s("audit-logs"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="audit-logs"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(Ys,{className:"w-5 h-5"}),Pf(),e==="audit-logs"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("quotas"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="quotas"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(zo,{className:"w-5 h-5"}),Ud(),e==="quotas"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),t("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:V0()}),o("button",{onClick:()=>s("ai-usage"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="ai-usage"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(ie,{className:"w-5 h-5"}),O1(),e==="ai-usage"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("ai-sessions"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="ai-sessions"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(Q,{className:"w-5 h-5"}),pA(),e==="ai-sessions"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),t("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:o("div",{className:"max-w-6xl mx-auto space-y-8",children:[e==="audit-logs"&&t(pe,{teamId:a}),e==="ai-usage"&&t(ne,{teamId:a}),e==="ai-sessions"&&t(le,{teamId:a}),e==="quotas"&&t(ue,{teamId:a})]})})]})})}var Ge=Ue("/teams/$teamId/dashboard")({component:ze});export{Ge as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m,S,t,Z,Ue,A,ut,Ct,am}from"./chunk-vvr8tnse.js";import"./chunk-nv7tztvh.js";import"./chunk-dzjmwat0.js";import"./chunk-zasjhrwc.js";import"./chunk-fb1bes2h.js";import"./chunk-bf5m8f6t.js";import"./chunk-rx9g95wk.js";import"./chunk-113baw0m.js";import"./chunk-eex8sjfs.js";import"./chunk-v3z63tpw.js";import"./chunk-kfewyax2.js";import"./chunk-zzzgk1d5.js";import"./chunk-a23q1kc4.js";import"./chunk-4yhvexzk.js";import{Qn}from"./chunk-treyx8em.js";import{tr}from"./chunk-ra5csbkr.js";import"./chunk-3tg10kwz.js";import"./chunk-fg9sr6r9.js";import"./chunk-hjzbw975.js";import"./chunk-5m51b7af.js";import"./chunk-emgyjhmx.js";import"./chunk-01ym2agz.js";import"./chunk-hjwpd09v.js";import"./chunk-8s9fehda.js";S();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=ut();m(()=>{a(o)},[o,a]);let{data:n}=tr(am(o)),e=n?.rootFolder,{data:s}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!s)return t(Ct,{});return t(Qn,{teamId:r,projectId:o,projectName:n.name??"",assetId:"recently-deleted",rootFolderId:e})}var l=Ue("/projects/$projectId/recently-deleted")({component:i});export{l as Route};
|