@burdenoff/microfe-healthybowl 2026.706.1 → 2026.706.3
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.
|
@@ -1990,7 +1990,7 @@ function jt({ entityType: e, entityId: t, currentActorId: n, resolveAssignee: r,
|
|
|
1990
1990
|
variables: { input: {
|
|
1991
1991
|
entityType: e,
|
|
1992
1992
|
entityId: t,
|
|
1993
|
-
take:
|
|
1993
|
+
take: 100,
|
|
1994
1994
|
sortBy: "createdAt",
|
|
1995
1995
|
sortOrder: "asc"
|
|
1996
1996
|
} },
|
|
@@ -2009,18 +2009,27 @@ function jt({ entityType: e, entityId: t, currentActorId: n, resolveAssignee: r,
|
|
|
2009
2009
|
};
|
|
2010
2010
|
}, [h]), [v] = ne(be), [y] = ne(xe), x = (e) => e === n ? s.you : r?.(e)?.name ?? void 0, C = async ({ text: n, mentionUserIds: r }, i) => {
|
|
2011
2011
|
l(null);
|
|
2012
|
+
let a = {
|
|
2013
|
+
entityType: e,
|
|
2014
|
+
entityId: t,
|
|
2015
|
+
content: { text: n },
|
|
2016
|
+
contentType: "TEXT",
|
|
2017
|
+
...i ? { parentCommentId: i } : {}
|
|
2018
|
+
}, o = (e) => v({ variables: { input: e && r.length ? {
|
|
2019
|
+
...a,
|
|
2020
|
+
mentionUserIds: r
|
|
2021
|
+
} : a } });
|
|
2012
2022
|
try {
|
|
2013
|
-
await
|
|
2014
|
-
entityType: e,
|
|
2015
|
-
entityId: t,
|
|
2016
|
-
content: { text: n },
|
|
2017
|
-
contentType: "TEXT",
|
|
2018
|
-
...i ? { parentCommentId: i } : {},
|
|
2019
|
-
...r.length ? { mentionUserIds: r } : {}
|
|
2020
|
-
} } }), await m(), d(null);
|
|
2023
|
+
await o(!0);
|
|
2021
2024
|
} catch (e) {
|
|
2022
|
-
|
|
2025
|
+
if (r.length) try {
|
|
2026
|
+
await o(!1);
|
|
2027
|
+
} catch (e) {
|
|
2028
|
+
throw l(s.failedToComment), e;
|
|
2029
|
+
}
|
|
2030
|
+
else throw l(s.failedToComment), e;
|
|
2023
2031
|
}
|
|
2032
|
+
await m(), d(null);
|
|
2024
2033
|
}, w = async (e) => {
|
|
2025
2034
|
l(null);
|
|
2026
2035
|
try {
|
|
@@ -2032,10 +2041,10 @@ function jt({ entityType: e, entityId: t, currentActorId: n, resolveAssignee: r,
|
|
|
2032
2041
|
l(s.failedToDeleteComment);
|
|
2033
2042
|
}
|
|
2034
2043
|
}, T = (e) => {
|
|
2035
|
-
let t = e.content?.text ?? "", n = (
|
|
2044
|
+
let t = e.content?.text ?? "", n = (i ?? []).map((e) => e.name).filter((e) => t.includes(`@${e}`));
|
|
2036
2045
|
if (n.length === 0) return t;
|
|
2037
|
-
let
|
|
2038
|
-
return t.split(a).map((e, t) =>
|
|
2046
|
+
let r = new Set(n.map((e) => `@${e}`)), a = RegExp(`(@(?:${n.map(At).join("|")}))`, "g");
|
|
2047
|
+
return t.split(a).map((e, t) => r.has(e) ? /* @__PURE__ */ U("span", {
|
|
2039
2048
|
className: "rounded bg-primary/10 px-0.5 font-medium text-primary",
|
|
2040
2049
|
children: e
|
|
2041
2050
|
}, t) : /* @__PURE__ */ U("span", { children: e }, t));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Badge"],"sources":["../../../../../node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js"],"sourcesContent":["import { createContext, useMemo, useEffect, useContext, useState, useCallback, useRef } from 'react';\nimport { ApolloProvider, useQuery, useApolloClient, useMutation } from '@apollo/client/react';\nimport { createHttpLink, ApolloClient, from, InMemoryCache } from '@apollo/client/core';\nimport { setContext } from '@apollo/client/link/context';\nimport { onError } from '@apollo/client/link/error';\nimport { CombinedGraphQLErrors } from '@apollo/client/errors';\nimport { jsx, jsxs } from 'react/jsx-runtime';\nimport { gql } from '@apollo/client';\nimport { CircleX, CircleCheckBig, CircleDotDashed, CircleDot, Circle, CircleDashed, User, Link2, CalendarDays, ChevronUp, ChevronDown, ChevronLeft, ChevronRight, Flag, CalendarRange, List, LayoutGrid, Search, Plus, Trash2 } from 'lucide-react';\nimport { clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\nimport { addWeeks, startOfWeek, endOfWeek, eachDayOfInterval, addMonths, startOfMonth, endOfMonth, format, isToday, isSameMonth, startOfDay, parseISO, isValid } from 'date-fns';\nimport { cva } from 'class-variance-authority';\nimport { Card, CardContent } from '@burdenoff/fe-libs/ui';\n\nvar clientInstance = null;\nfunction buildCache() {\n return new InMemoryCache({\n typePolicies: {\n Query: {\n fields: {\n planmagnetWorkItems: { merge: false },\n planmagnetProjects: { merge: false },\n planmagnetWorkItemLinks: { merge: false }\n }\n },\n WorkItem: { keyFields: [\"id\"] },\n PlanmagnetProject: { keyFields: [\"id\"] },\n Project: { keyFields: [\"id\"] },\n WorkItemLink: { keyFields: [\"id\"] }\n }\n });\n}\nfunction createPlanMagnetClient(config2) {\n const graphqlUrl = getGraphQLUrl(config2.apiGatewayUrl);\n const httpLink = createHttpLink({ uri: graphqlUrl });\n const authLink = setContext((_, { headers }) => ({\n headers: {\n ...headers,\n ...config2.authToken && {\n authorization: `Bearer ${config2.authToken}`\n },\n ...config2.workspaceToken && {\n \"x-workspace-authorization\": `Bearer ${config2.workspaceToken}`\n },\n \"x-workspace-id\": config2.workspaceId,\n ...config2.tenantId && { \"x-tenant-id\": config2.tenantId }\n }\n }));\n const errorLink = onError(({ error }) => {\n if (!config2.onAuthError) return;\n if (CombinedGraphQLErrors.is(error)) {\n for (const graphQLError of error.errors) {\n const code = graphQLError.extensions?.code;\n if (code === \"UNAUTHENTICATED\" || code === \"FORBIDDEN\") {\n config2.onAuthError();\n return;\n }\n }\n } else if (error) {\n const msg = error.message ?? \"\";\n if (msg.includes(\"401\") || msg.includes(\"403\") || msg.includes(\"Unauthorized\")) {\n config2.onAuthError();\n }\n }\n });\n return new ApolloClient({\n link: from([errorLink, authLink, httpLink]),\n cache: buildCache(),\n defaultOptions: {\n watchQuery: { fetchPolicy: \"cache-and-network\" },\n query: { fetchPolicy: \"network-only\" }\n }\n });\n}\nfunction getGraphQLUrl(apiGatewayUrl) {\n const normalizedBase = apiGatewayUrl.endsWith(\"/\") ? apiGatewayUrl.slice(0, -1) : apiGatewayUrl;\n if (normalizedBase.endsWith(\"/graphql\")) {\n return normalizedBase;\n }\n return `${normalizedBase}/workspaces/graphql`;\n}\nfunction setPlanMagnetClient(client) {\n clientInstance = client;\n}\nfunction getPlanMagnetClient() {\n if (!clientInstance) {\n throw new Error(\n \"PlanMagnet client not initialized. Use PlanMagnetProvider or call setPlanMagnetClient().\"\n );\n }\n return clientInstance;\n}\nfunction getPlanMagnetClientSafe() {\n return clientInstance;\n}\nfunction isPlanMagnetClientReady() {\n return clientInstance !== null;\n}\nfunction waitForPlanMagnetClient(timeoutMs = 1e4, intervalMs = 100) {\n return new Promise((resolve) => {\n if (clientInstance) {\n resolve(clientInstance);\n return;\n }\n const start = Date.now();\n const timer = setInterval(() => {\n if (clientInstance) {\n clearInterval(timer);\n resolve(clientInstance);\n } else if (Date.now() - start >= timeoutMs) {\n clearInterval(timer);\n resolve(null);\n }\n }, intervalMs);\n });\n}\nfunction resetPlanMagnetClient() {\n clientInstance = null;\n}\n\n// src/config/index.ts\nvar runtimeConfig = {\n apiGatewayUrl: \"\",\n workspaceId: \"\"\n};\nvar config = new Proxy({}, {\n get(_, prop) {\n return runtimeConfig[prop];\n }\n});\nfunction getPlanMagnetConfig() {\n return { ...runtimeConfig };\n}\nfunction setPlanMagnetConfig(newConfig) {\n runtimeConfig = { ...runtimeConfig, ...newConfig };\n}\nfunction resetPlanMagnetConfig() {\n runtimeConfig = {\n apiGatewayUrl: \"\",\n workspaceId: \"\"\n };\n}\nfunction normalizeOrigin(origin) {\n return origin.replace(/\\/$/, \"\");\n}\nfunction validateTrustedOrigin(trustedOrigins) {\n if (typeof window === \"undefined\" || !trustedOrigins?.length) {\n return;\n }\n const currentOrigin = normalizeOrigin(window.location.origin);\n const allowedOrigins = trustedOrigins.map(normalizeOrigin);\n if (!allowedOrigins.includes(currentOrigin)) {\n throw new Error(\n `PlanMagnet SDK blocked untrusted origin: ${currentOrigin}`\n );\n }\n}\nfunction getGraphQLEndpoint(baseUrl) {\n const url = baseUrl || runtimeConfig.apiGatewayUrl;\n if (!url) {\n throw new Error(\"PlanMagnet SDK requires apiGatewayUrl to be configured\");\n }\n const normalizedBase = url.endsWith(\"/\") ? url.slice(0, -1) : url;\n if (normalizedBase.endsWith(\"/graphql\")) {\n return normalizedBase;\n }\n return `${normalizedBase}/workspaces/graphql`;\n}\nvar PlanMagnetContext = createContext(null);\nfunction PlanMagnetProvider({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient: externalWorkspaceClient,\n apolloClient: legacyClient,\n children\n}) {\n validateTrustedOrigin(trustedOrigins);\n const workspaceClient = useMemo(() => {\n if (externalWorkspaceClient) return externalWorkspaceClient;\n if (legacyClient) return legacyClient;\n if (apiGatewayUrl) {\n return createPlanMagnetClient({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n onAuthError\n });\n }\n throw new Error(\n \"PlanMagnetProvider: Either provide workspaceClient or apiGatewayUrl\"\n );\n }, [\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n onAuthError,\n externalWorkspaceClient,\n legacyClient\n ]);\n useEffect(() => {\n setPlanMagnetClient(workspaceClient);\n return () => {\n resetPlanMagnetClient();\n };\n }, [workspaceClient]);\n useEffect(() => {\n setPlanMagnetConfig({\n apiGatewayUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins\n });\n return () => {\n resetPlanMagnetConfig();\n };\n }, [\n apiGatewayUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins\n ]);\n const contextValue = useMemo(\n () => ({\n apiGatewayUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n workspaceClient\n }),\n [\n apiGatewayUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n workspaceClient\n ]\n );\n return /* @__PURE__ */ jsx(PlanMagnetContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ApolloProvider, { client: workspaceClient, children }) });\n}\nfunction usePlanMagnetContext() {\n const context = useContext(PlanMagnetContext);\n if (!context) {\n throw new Error(\n \"usePlanMagnetContext must be used within PlanMagnetProvider\"\n );\n }\n return context;\n}\nfunction usePlanMagnetContextSafe() {\n return useContext(PlanMagnetContext);\n}\nvar WORK_ITEM_SUMMARY_FIELDS = gql`\n fragment WorkItemSummaryFields on WorkItem {\n id\n key\n title\n type\n status\n priority\n assigneeId\n sprintId\n storyPoints\n dueDate\n labels\n }\n`;\nvar WORK_ITEM_FIELDS = gql`\n fragment WorkItemFields on WorkItem {\n id\n workspaceId\n projectId\n key\n title\n description\n type\n status\n priority\n assigneeId\n reporterId\n parentId\n sprintId\n storyPoints\n estimateMinutes\n timeSpentMinutes\n dueDate\n labels\n tags\n sortOrder\n metadata\n createdBy\n createdAt\n updatedAt\n updatedBy\n deletedAt\n }\n`;\nvar PROJECT_SUMMARY_FIELDS = gql`\n fragment ProjectSummaryFields on Project {\n id\n name\n key\n status\n methodology\n ownerId\n startDate\n endDate\n tags\n }\n`;\nvar LIST_WORK_ITEMS = gql`\n query ListWorkItems(\n $workspaceId: ID!\n $filter: PlanmagnetWorkItemFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetWorkItems(\n workspaceId: $workspaceId\n filter: $filter\n pagination: $pagination\n ) {\n items {\n ...WorkItemSummaryFields\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n totalCount\n }\n totalCount\n }\n }\n ${WORK_ITEM_SUMMARY_FIELDS}\n`;\nvar GET_WORK_ITEM = gql`\n query GetWorkItem($id: ID!) {\n planmagnetWorkItem(id: $id) {\n ...WorkItemFields\n }\n }\n ${WORK_ITEM_FIELDS}\n`;\nvar GET_PROJECTS = gql`\n query GetProjects(\n $workspaceId: ID!\n $filter: PlanmagnetProjectFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetProjects(\n workspaceId: $workspaceId\n filter: $filter\n pagination: $pagination\n ) {\n items {\n ...ProjectSummaryFields\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n totalCount\n }\n totalCount\n }\n }\n ${PROJECT_SUMMARY_FIELDS}\n`;\nvar CREATE_WORK_ITEM = gql`\n mutation CreateWorkItem($input: PlanmagnetCreateWorkItemInput!) {\n planmagnetCreateWorkItem(input: $input) {\n ...WorkItemFields\n }\n }\n ${WORK_ITEM_FIELDS}\n`;\nvar UPDATE_WORK_ITEM = gql`\n mutation UpdateWorkItem($id: ID!, $input: PlanmagnetUpdateWorkItemInput!) {\n planmagnetUpdateWorkItem(id: $id, input: $input) {\n ...WorkItemFields\n }\n }\n ${WORK_ITEM_FIELDS}\n`;\nvar MOVE_WORK_ITEM = gql`\n mutation MoveWorkItem($id: ID!, $input: PlanmagnetMoveWorkItemInput!) {\n planmagnetMoveWorkItem(id: $id, input: $input) {\n ...WorkItemFields\n }\n }\n ${WORK_ITEM_FIELDS}\n`;\nvar WORK_ITEM_LINK_FIELDS = gql`\n fragment WorkItemLinkFields on WorkItemLink {\n id\n workspaceId\n workItemId\n sourceProduct\n entityType\n entityId\n relationType\n displayNameSnapshot\n deepLinkSnapshot\n metadata\n createdBy\n onBehalfOf\n createdAt\n updatedAt\n }\n`;\nvar LIST_WORK_ITEM_LINKS = gql`\n query ListWorkItemLinks(\n $workspaceId: ID!\n $filter: PlanmagnetWorkItemLinkFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetWorkItemLinks(\n workspaceId: $workspaceId\n filter: $filter\n pagination: $pagination\n ) {\n items {\n ...WorkItemLinkFields\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n totalCount\n }\n totalCount\n }\n }\n ${WORK_ITEM_LINK_FIELDS}\n`;\nvar CREATE_WORK_ITEM_LINK = gql`\n mutation CreateWorkItemLink($input: PlanmagnetCreateWorkItemLinkInput!) {\n planmagnetLinkWorkItem(input: $input) {\n ...WorkItemLinkFields\n }\n }\n ${WORK_ITEM_LINK_FIELDS}\n`;\nvar DELETE_WORK_ITEM_LINK = gql`\n mutation UnlinkWorkItem($id: ID!) {\n planmagnetUnlinkWorkItem(id: $id)\n }\n`;\nvar MILESTONE_FIELDS = gql`\n fragment MilestoneFields on Milestone {\n id\n projectId\n name\n description\n status\n dueDate\n completedAt\n ownerId\n createdAt\n updatedAt\n }\n`;\nvar LIST_MILESTONES = gql`\n query ListMilestones(\n $workspaceId: ID!\n $filter: PlanmagnetMilestoneFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetMilestones(\n workspaceId: $workspaceId\n filter: $filter\n pagination: $pagination\n ) {\n items {\n ...MilestoneFields\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n totalCount\n }\n totalCount\n }\n }\n ${MILESTONE_FIELDS}\n`;\nvar DELETE_WORK_ITEM = gql`\n mutation DeleteWorkItem($id: ID!) {\n planmagnetDeleteWorkItem(id: $id)\n }\n`;\nvar ENTITY_COMMENT_FIELDS = gql`\n fragment EntityCommentFields on EntityComment {\n id\n authorId\n authorType\n content {\n text\n }\n createdAt\n edited\n editedAt\n status\n parentCommentId\n threadRootId\n threadLevel\n mentions {\n mentionedUserId\n }\n }\n`;\nvar GET_ENTITY_COMMENTS = gql`\n query GetEntityComments($input: GetCommentsInput!) {\n getEntityComments(input: $input) {\n items {\n ...EntityCommentFields\n }\n total\n }\n }\n ${ENTITY_COMMENT_FIELDS}\n`;\nvar CREATE_ENTITY_COMMENT = gql`\n mutation CreateEntityComment($input: CreateEntityCommentInput!) {\n createEntityComment(input: $input) {\n ...EntityCommentFields\n }\n }\n ${ENTITY_COMMENT_FIELDS}\n`;\nvar DELETE_ENTITY_COMMENT = gql`\n mutation DeleteEntityComment($input: DeleteCommentInput!) {\n deleteEntityComment(input: $input)\n }\n`;\nfunction cn(...inputs) {\n return twMerge(clsx(inputs));\n}\nvar CLOSED_STATUSES = /* @__PURE__ */ new Set([\"DONE\", \"CANCELLED\"]);\nfunction parseDate(iso) {\n if (!iso) return null;\n const d = parseISO(iso);\n return isValid(d) ? d : null;\n}\nfunction toIsoDate(value) {\n if (!value) return void 0;\n const iso = /^\\d{4}-\\d{2}-\\d{2}$/.test(value) ? `${value}T00:00:00.000Z` : value;\n const d = new Date(iso);\n return Number.isNaN(d.getTime()) ? void 0 : d.toISOString();\n}\nfunction formatDueDate(iso) {\n const d = parseDate(iso);\n if (!d) return null;\n const now = /* @__PURE__ */ new Date();\n return format(\n d,\n d.getFullYear() === now.getFullYear() ? \"MMM d\" : \"MMM d yyyy\"\n );\n}\nfunction formatDateFull(iso) {\n const d = parseDate(iso);\n return d ? format(d, \"MMM d, yyyy\") : null;\n}\nfunction isOverdue(iso, status) {\n const d = parseDate(iso);\n if (!d) return false;\n if (status && CLOSED_STATUSES.has(status)) return false;\n return startOfDay(d).getTime() < startOfDay(/* @__PURE__ */ new Date()).getTime();\n}\nvar badgeVariants = cva(\n \"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize transition-colors\",\n {\n variants: {\n variant: {\n default: \"bg-primary/10 text-primary\",\n muted: \"bg-muted text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n accent: \"bg-accent text-accent-foreground\",\n destructive: \"bg-destructive/15 text-destructive\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nfunction Badge({ className, variant, ...props }) {\n return /* @__PURE__ */ jsx(\"span\", { className: cn(badgeVariants({ variant }), className), ...props });\n}\nvar TINTS = [\n \"bg-primary/15 text-primary\",\n \"bg-secondary text-secondary-foreground\",\n \"bg-accent text-accent-foreground\",\n \"bg-muted text-muted-foreground\",\n \"bg-destructive/15 text-destructive\"\n];\nvar SIZES = {\n sm: \"h-5 w-5 text-[9px]\",\n md: \"h-6 w-6 text-[10px]\",\n lg: \"h-8 w-8 text-xs\"\n};\nfunction tintIndex(seed) {\n let h = 0;\n for (let i = 0; i < seed.length; i++) {\n h = h * 31 + seed.charCodeAt(i) >>> 0;\n }\n return h % TINTS.length;\n}\nfunction initials(name, id) {\n const source = (name ?? \"\").trim();\n if (source) {\n const parts = source.split(/\\s+/);\n const first = parts[0]?.[0] ?? \"\";\n const second = parts.length > 1 ? parts[parts.length - 1]?.[0] ?? \"\" : \"\";\n return (first + second).toUpperCase() || \"?\";\n }\n const raw = (id ?? \"\").replace(/[^a-zA-Z0-9]/g, \"\");\n return raw.slice(0, 2).toUpperCase() || \"?\";\n}\nfunction Avatar({ id, name, size = \"md\", className }) {\n if (!id && !name) {\n return /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"inline-flex items-center justify-center rounded-full border border-dashed border-border text-muted-foreground\",\n SIZES[size],\n className\n ),\n title: \"Unassigned\",\n \"aria-label\": \"Unassigned\",\n children: /* @__PURE__ */ jsx(User, { className: \"h-1/2 w-1/2\", \"aria-hidden\": \"true\" })\n }\n );\n }\n const tint = TINTS[tintIndex(name || id || \"\")];\n return /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"inline-flex items-center justify-center rounded-full font-medium\",\n SIZES[size],\n tint,\n className\n ),\n title: name ?? id ?? void 0,\n \"aria-label\": name ?? id ?? void 0,\n children: initials(name, id)\n }\n );\n}\n\n// src/types/index.ts\nvar DEFAULT_BOARD_COLUMNS = [\n { status: \"BACKLOG\", label: \"Backlog\" },\n { status: \"TODO\", label: \"To Do\" },\n { status: \"IN_PROGRESS\", label: \"In Progress\" },\n { status: \"IN_REVIEW\", label: \"In Review\" },\n { status: \"TESTING\", label: \"Testing\" },\n { status: \"DONE\", label: \"Done\" },\n { status: \"CANCELLED\", label: \"Cancelled\" }\n];\nvar TASK_PRIORITIES = [\n \"NONE\",\n \"LOW\",\n \"MEDIUM\",\n \"HIGH\",\n \"CRITICAL\"\n];\nvar TASK_TYPES = [\n \"TASK\",\n \"STORY\",\n \"BUG\",\n \"EPIC\",\n \"SUB_TASK\"\n];\nvar TASK_STATUSES = [\n \"BACKLOG\",\n \"TODO\",\n \"IN_PROGRESS\",\n \"IN_REVIEW\",\n \"TESTING\",\n \"DONE\",\n \"CANCELLED\"\n];\nfunction enumLabel(value) {\n return value.toLowerCase().replace(/_/g, \" \");\n}\nfunction LinkChip({ link, renderIcon, className }) {\n const label = link.displayNameSnapshot || enumLabel(link.entityType);\n const icon = renderIcon?.(link.entityType) ?? /* @__PURE__ */ jsx(Link2, { className: \"h-3 w-3 shrink-0\", \"aria-hidden\": \"true\" });\n const body = /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\n \"inline-flex max-w-full items-center gap-1 rounded-full border border-primary/20 bg-primary/5 px-1.5 py-0.5 text-[10px] font-medium text-primary\",\n className\n ),\n title: `${enumLabel(link.relationType)} \\xB7 ${enumLabel(link.entityType)}`,\n children: [\n icon,\n /* @__PURE__ */ jsx(\"span\", { className: \"truncate\", children: label })\n ]\n }\n );\n if (link.deepLinkSnapshot) {\n return /* @__PURE__ */ jsx(\n \"a\",\n {\n href: link.deepLinkSnapshot,\n onClick: (e) => e.stopPropagation(),\n className: \"inline-flex max-w-full no-underline hover:brightness-95\",\n children: body\n }\n );\n }\n return body;\n}\nvar DEFAULT_TASK_LABELS = {\n board: \"Board\",\n list: \"List\",\n timeline: \"Timeline\",\n searchPlaceholder: \"Search tasks\\u2026\",\n allPriorities: \"All priorities\",\n allTypes: \"All types\",\n newTask: \"New task\",\n myTasks: \"My tasks\",\n noTasks: \"No tasks\",\n noTasksFound: \"No tasks found.\",\n dropHere: \"Drop here\",\n moveConfirmTitle: \"Move task?\",\n moveConfirmPrompt: 'Move \"{task}\" to {status}?',\n moveConfirm: \"Move\",\n unassigned: \"Unassigned\",\n assigned: \"Assigned\",\n overdue: \"{n} overdue\",\n noDueDate: \"No due date ({n})\",\n milestones: \"Milestones\",\n today: \"Today\",\n week: \"Week\",\n month: \"Month\",\n tasksSingular: \"task\",\n tasksPlural: \"tasks\",\n colTask: \"Task\",\n colStatus: \"Status\",\n colPriority: \"Priority\",\n colAssignee: \"Assignee\",\n colDueDate: \"Due Date\",\n colPoints: \"Points\",\n colLinkedRecord: \"Linked Record\",\n colType: \"Type\",\n colKey: \"Key\",\n colLabels: \"Labels\",\n newTaskHeading: \"New task\",\n newTaskSubtitle: \"Create a work item in this workspace.\",\n title: \"Title\",\n titlePlaceholder: \"What needs doing?\",\n description: \"Description\",\n descriptionPlaceholder: \"Add more detail (optional)\",\n typeLabel: \"Type\",\n statusLabel: \"Status\",\n priorityLabel: \"Priority\",\n assigneeLabel: \"Assignee\",\n assigneePlaceholder: \"Actor ID (optional)\",\n dueDateLabel: \"Due date\",\n storyPointsLabel: \"Story points\",\n labelsLabel: \"Labels\",\n labelsPlaceholder: \"comma, separated, labels\",\n linkedRecordsLabel: \"Linked records\",\n createdLabel: \"Created\",\n updatedLabel: \"Updated\",\n parentLabel: \"Parent\",\n subtasksLabel: \"Sub-tasks\",\n addSubtask: \"Add sub-task\",\n commentsLabel: \"Comments\",\n commentPlaceholder: \"Write a comment\\u2026\",\n postComment: \"Comment\",\n posting: \"Posting\\u2026\",\n noComments: \"No comments yet\",\n you: \"You\",\n editedTag: \"(edited)\",\n failedToComment: \"Failed to post comment\",\n failedToDeleteComment: \"Failed to delete comment\",\n reply: \"Reply\",\n replyPlaceholder: \"Write a reply\\u2026\",\n repliesCount: \"{n} replies\",\n create: \"Create task\",\n creating: \"Creating\\u2026\",\n cancel: \"Cancel\",\n edit: \"Edit\",\n del: \"Delete\",\n deletePrompt: \"Delete?\",\n yes: \"Yes\",\n no: \"No\",\n save: \"Save changes\",\n saving: \"Saving\\u2026\",\n taskNotFound: \"Task not found.\",\n projectRequired: \"A projectId is required to create a task.\",\n errorLoading: \"Error loading tasks\",\n moveFailed: \"Couldn't move the task. Please try again.\",\n failedToCreate: \"Failed to create task\",\n failedToSave: \"Failed to save\",\n failedToDelete: \"Failed to delete\",\n overdueLabel: \"Overdue\",\n more: \"more\",\n status: {\n BACKLOG: \"Backlog\",\n TODO: \"To Do\",\n IN_PROGRESS: \"In Progress\",\n IN_REVIEW: \"In Review\",\n TESTING: \"Testing\",\n DONE: \"Done\",\n CANCELLED: \"Cancelled\"\n },\n priority: {\n NONE: \"None\",\n LOW: \"Low\",\n MEDIUM: \"Medium\",\n HIGH: \"High\",\n CRITICAL: \"Critical\"\n },\n type: {\n TASK: \"Task\",\n STORY: \"Story\",\n BUG: \"Bug\",\n EPIC: \"Epic\",\n SUB_TASK: \"Sub Task\"\n }\n};\nvar TaskLabelsContext = createContext(DEFAULT_TASK_LABELS);\nvar TaskLabelsProvider = TaskLabelsContext.Provider;\nfunction useTaskLabels() {\n return useContext(TaskLabelsContext);\n}\nfunction mergeTaskLabels(overrides) {\n if (!overrides) return DEFAULT_TASK_LABELS;\n return {\n ...DEFAULT_TASK_LABELS,\n ...overrides,\n status: { ...DEFAULT_TASK_LABELS.status, ...overrides.status },\n priority: { ...DEFAULT_TASK_LABELS.priority, ...overrides.priority },\n type: { ...DEFAULT_TASK_LABELS.type, ...overrides.type }\n };\n}\nvar STATUS_META = {\n BACKLOG: { icon: CircleDashed, tone: \"text-muted-foreground/60\" },\n TODO: { icon: Circle, tone: \"text-muted-foreground\" },\n IN_PROGRESS: { icon: CircleDot, tone: \"text-primary\" },\n IN_REVIEW: { icon: CircleDotDashed, tone: \"text-accent-foreground\" },\n TESTING: { icon: CircleDotDashed, tone: \"text-secondary-foreground\" },\n DONE: { icon: CircleCheckBig, tone: \"text-primary\" },\n CANCELLED: { icon: CircleX, tone: \"text-destructive/70\" }\n};\nfunction StatusIcon({ status, className }) {\n const meta = STATUS_META[status] ?? STATUS_META.TODO;\n const Icon = meta.icon;\n return /* @__PURE__ */ jsx(\n Icon,\n {\n className: cn(\"h-3.5 w-3.5 shrink-0\", meta.tone, className),\n \"aria-hidden\": \"true\"\n }\n );\n}\nfunction StatusPill({ status, className }) {\n const L = useTaskLabels();\n return /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\n \"inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium capitalize text-foreground\",\n className\n ),\n children: [\n /* @__PURE__ */ jsx(StatusIcon, { status }),\n L.status[status]\n ]\n }\n );\n}\nvar PRIORITY_META = {\n NONE: { level: 0, tone: \"text-muted-foreground/50\" },\n LOW: { level: 1, tone: \"text-muted-foreground\" },\n MEDIUM: { level: 2, tone: \"text-accent-foreground\" },\n HIGH: { level: 3, tone: \"text-accent-foreground\" },\n CRITICAL: { level: 3, tone: \"text-destructive\" }\n};\nvar BAR_HEIGHTS = [\"h-1.5\", \"h-2.5\", \"h-3.5\"];\nfunction PriorityIndicator({\n priority,\n showLabel = false,\n className\n}) {\n const L = useTaskLabels();\n const meta = PRIORITY_META[priority] ?? PRIORITY_META.NONE;\n return /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\"inline-flex items-center gap-1.5\", meta.tone, className),\n title: `${L.priorityLabel}: ${L.priority[priority]}`,\n children: [\n /* @__PURE__ */ jsx(\"span\", { className: \"flex items-end gap-0.5\", \"aria-hidden\": \"true\", children: BAR_HEIGHTS.map((h, i) => /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"w-1 rounded-[1px]\",\n h,\n i < meta.level ? \"bg-current\" : \"bg-current/25\"\n )\n },\n h\n )) }),\n showLabel && /* @__PURE__ */ jsx(\"span\", { className: \"text-xs font-medium capitalize\", children: L.priority[priority] })\n ]\n }\n );\n}\nvar TYPE_VARIANT = {\n TASK: \"secondary\",\n STORY: \"default\",\n BUG: \"destructive\",\n EPIC: \"accent\",\n SUB_TASK: \"muted\"\n};\nfunction TypeBadge({ type, className }) {\n const L = useTaskLabels();\n return /* @__PURE__ */ jsx(Badge, { variant: TYPE_VARIANT[type], className, children: L.type[type] });\n}\nfunction OverlayShell({\n open,\n onClose,\n children,\n ariaLabel,\n className,\n variant\n}) {\n useEffect(() => {\n if (!open) return;\n const onKeyDown = (e) => {\n if (e.key === \"Escape\") onClose();\n };\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [open, onClose]);\n if (!open) return null;\n const isModal = variant === \"modal\";\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n className: cn(\n \"fixed inset-0 z-50 flex bg-foreground/40\",\n isModal ? \"items-center justify-center p-4\" : \"justify-end\"\n ),\n onClick: onClose,\n children: /* @__PURE__ */ jsxs(\n \"div\",\n {\n role: \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-label\": ariaLabel,\n className: cn(\n \"relative overflow-y-auto bg-background text-foreground shadow-lg\",\n isModal ? \"max-h-[90vh] w-full max-w-2xl rounded-lg\" : \"h-full w-full max-w-lg\",\n className\n ),\n onClick: (e) => e.stopPropagation(),\n children: [\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n \"aria-label\": \"Close\",\n onClick: onClose,\n className: \"absolute right-3 top-3 z-10 rounded-md bg-muted px-2 py-1 text-sm font-medium text-muted-foreground hover:bg-muted/70\",\n children: \"\\u2715\"\n }\n ),\n children\n ]\n }\n )\n }\n );\n}\nfunction Modal(props) {\n return /* @__PURE__ */ jsx(OverlayShell, { variant: \"modal\", ...props });\n}\nfunction Drawer(props) {\n return /* @__PURE__ */ jsx(OverlayShell, { variant: \"drawer\", ...props });\n}\nvar EMPTY = /* @__PURE__ */ new Set();\nfunction TaskCard({\n task,\n hidden = EMPTY,\n onClick,\n draggable,\n onDragStart,\n onDragEnd,\n dragging,\n resolveAssignee,\n links,\n renderLinkIcon,\n className\n}) {\n const L = useTaskLabels();\n const overdue = isOverdue(task.dueDate, task.status);\n const due = formatDueDate(task.dueDate);\n const resolved = task.assigneeId ? resolveAssignee?.(task.assigneeId) : null;\n const showTopRow = !hidden.has(\"key\") || !hidden.has(\"type\");\n const showLinks = !hidden.has(\"links\") && (links?.length ?? 0) > 0;\n const showLabels = !hidden.has(\"labels\") && (task.labels?.length ?? 0) > 0;\n const showPriority = !hidden.has(\"priority\");\n const showPoints = !hidden.has(\"storyPoints\") && task.storyPoints != null;\n const showMetaRow = showPriority || showPoints;\n const showAssignee = !hidden.has(\"assignee\");\n const showDue = !hidden.has(\"dueDate\") && Boolean(due);\n const showPeopleRow = showAssignee || showDue;\n const interactive = Boolean(onClick);\n const handleKey = onClick ? (e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onClick(task);\n }\n } : void 0;\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n role: interactive ? \"button\" : void 0,\n tabIndex: interactive ? 0 : void 0,\n draggable,\n onDragStart: draggable ? (e) => onDragStart?.(task, e) : void 0,\n onDragEnd: draggable ? (e) => onDragEnd?.(task, e) : void 0,\n onClick: onClick ? () => onClick(task) : void 0,\n onKeyDown: handleKey,\n className: cn(\n \"group rounded-lg border border-border bg-card p-2.5 shadow-sm transition\",\n \"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n interactive && \"cursor-pointer hover:border-primary/50 hover:shadow-md\",\n draggable && \"active:cursor-grabbing\",\n dragging && \"opacity-50 ring-2 ring-primary/40\",\n className\n ),\n children: [\n showTopRow && /* @__PURE__ */ jsxs(\"div\", { className: \"mb-1 flex items-center justify-between gap-2\", children: [\n !hidden.has(\"key\") ? /* @__PURE__ */ jsx(\"span\", { className: \"font-mono text-[10px] uppercase tracking-wide text-muted-foreground\", children: task.key }) : /* @__PURE__ */ jsx(\"span\", {}),\n !hidden.has(\"type\") && /* @__PURE__ */ jsx(TypeBadge, { type: task.type })\n ] }),\n /* @__PURE__ */ jsx(\"p\", { className: \"line-clamp-2 text-sm font-medium leading-snug text-foreground\", children: task.title }),\n showLinks && /* @__PURE__ */ jsxs(\"div\", { className: \"mt-1.5 flex flex-wrap gap-1\", children: [\n links.slice(0, 3).map((link) => /* @__PURE__ */ jsx(LinkChip, { link, renderIcon: renderLinkIcon }, link.id)),\n links.length > 3 && /* @__PURE__ */ jsxs(\"span\", { className: \"text-[10px] text-muted-foreground\", children: [\n \"+\",\n links.length - 3\n ] })\n ] }),\n showLabels && /* @__PURE__ */ jsxs(\"div\", { className: \"mt-1.5 flex flex-wrap gap-1\", children: [\n task.labels.slice(0, 3).map((l) => /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\",\n children: l\n },\n l\n )),\n task.labels.length > 3 && /* @__PURE__ */ jsxs(\"span\", { className: \"text-[10px] text-muted-foreground\", children: [\n \"+\",\n task.labels.length - 3\n ] })\n ] }),\n showMetaRow && /* @__PURE__ */ jsxs(\"div\", { className: \"mt-2 flex items-center justify-between\", children: [\n showPriority ? /* @__PURE__ */ jsx(PriorityIndicator, { priority: task.priority, showLabel: true }) : /* @__PURE__ */ jsx(\"span\", {}),\n showPoints && /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"flex h-5 min-w-5 items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] font-semibold text-primary\",\n title: `${task.storyPoints} ${L.storyPointsLabel}`,\n children: task.storyPoints\n }\n )\n ] }),\n showPeopleRow && /* @__PURE__ */ jsxs(\"div\", { className: \"mt-2 flex items-center justify-between gap-2\", children: [\n showAssignee ? /* @__PURE__ */ jsxs(\"span\", { className: \"flex min-w-0 items-center gap-1.5\", children: [\n /* @__PURE__ */ jsx(Avatar, { id: task.assigneeId, name: resolved?.name, size: \"sm\" }),\n resolved?.name && /* @__PURE__ */ jsx(\"span\", { className: \"truncate text-[11px] text-muted-foreground\", children: resolved.name })\n ] }) : /* @__PURE__ */ jsx(\"span\", {}),\n showDue && /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\n \"flex shrink-0 items-center gap-1 text-[11px]\",\n overdue ? \"font-medium text-destructive\" : \"text-muted-foreground\"\n ),\n title: overdue ? L.overdueLabel : L.dueDateLabel,\n children: [\n /* @__PURE__ */ jsx(CalendarDays, { className: \"h-3 w-3\", \"aria-hidden\": \"true\" }),\n due\n ]\n }\n )\n ] })\n ]\n }\n );\n}\nfunction useWorkItemLinks(workspaceId, sourceProduct, limit = 500) {\n const { data, loading } = useQuery(\n LIST_WORK_ITEM_LINKS,\n {\n variables: {\n workspaceId,\n ...sourceProduct ? { filter: { sourceProduct } } : {},\n pagination: { first: limit }\n },\n skip: !workspaceId || !sourceProduct\n }\n );\n const linksByItem = useMemo(() => {\n const map = /* @__PURE__ */ new Map();\n for (const link of data?.planmagnetWorkItemLinks?.items ?? []) {\n const arr = map.get(link.workItemId);\n if (arr) arr.push(link);\n else map.set(link.workItemId, [link]);\n }\n return map;\n }, [data]);\n return { linksByItem, loading };\n}\nfunction TaskBoardCore({\n projectId,\n columns = DEFAULT_BOARD_COLUMNS,\n readonly,\n confirmMove = true,\n hideHeader,\n priority = \"ALL\",\n type = \"ALL\",\n search = \"\",\n assigneeId,\n hiddenFields,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n onTaskClick,\n className,\n workspaceId: workspaceIdProp\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const client = useApolloClient();\n const L = useTaskLabels();\n const hidden = useMemo(() => new Set(hiddenFields ?? []), [hiddenFields]);\n const { linksByItem } = useWorkItemLinks(workspaceId, linkSourceProduct);\n const [draggingId, setDraggingId] = useState(null);\n const [dragOver, setDragOver] = useState(null);\n const [moveError, setMoveError] = useState(null);\n const [pendingMove, setPendingMove] = useState(null);\n const [updateItem] = useMutation(UPDATE_WORK_ITEM);\n const { data, loading, error } = useQuery(\n LIST_WORK_ITEMS,\n {\n variables: {\n workspaceId,\n ...projectId ? { filter: { projectId } } : {},\n pagination: { first: 200 }\n },\n skip: !workspaceId\n }\n );\n const moveTask = useCallback(\n (task, toStatus) => {\n const from2 = task.status;\n if (from2 === toStatus) return;\n const id = client.cache.identify({ __typename: \"WorkItem\", id: task.id });\n if (!id) return;\n setMoveError(null);\n client.cache.modify({ id, fields: { status: () => toStatus } });\n updateItem({\n variables: { id: task.id, input: { status: toStatus } }\n }).catch(() => {\n client.cache.modify({ id, fields: { status: () => from2 } });\n setMoveError(L.moveFailed);\n });\n },\n [client, updateItem, L]\n );\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"TaskBoard: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n if (loading && !data) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"flex items-center justify-center p-12\", className), children: /* @__PURE__ */ jsx(\"div\", { className: \"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent\" }) });\n }\n if (error && !data) {\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: [\n L.errorLoading,\n \": \",\n error.message\n ] });\n }\n const tasks = data?.planmagnetWorkItems?.items ?? [];\n const query = search.trim().toLowerCase();\n const filtered = tasks.filter((t) => {\n if (priority !== \"ALL\" && t.priority !== priority) return false;\n if (type !== \"ALL\" && t.type !== type) return false;\n if (assigneeId && t.assigneeId !== assigneeId) return false;\n if (query) {\n const haystack = [t.title, t.key, ...t.labels ?? []].join(\" \").toLowerCase();\n if (!haystack.includes(query)) return false;\n }\n return true;\n });\n const canDrag = !readonly;\n const onColumnDragOver = (status) => (e) => {\n if (!canDrag || !draggingId) return;\n e.preventDefault();\n if (dragOver !== status) setDragOver(status);\n };\n const onColumnDrop = (status) => (e) => {\n if (!canDrag) return;\n e.preventDefault();\n const task = tasks.find((t) => t.id === draggingId);\n setDragOver(null);\n setDraggingId(null);\n if (!task || task.status === status) return;\n if (confirmMove) setPendingMove({ task, toStatus: status });\n else moveTask(task, status);\n };\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-3\", className), children: [\n !hideHeader && /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-baseline justify-between\", children: [\n /* @__PURE__ */ jsx(\"h2\", { className: \"text-lg font-semibold text-foreground\", children: L.board }),\n /* @__PURE__ */ jsxs(\"span\", { className: \"text-sm text-muted-foreground\", children: [\n filtered.length,\n \" \",\n filtered.length === 1 ? L.tasksSingular : L.tasksPlural\n ] })\n ] }),\n moveError && /* @__PURE__ */ jsx(\"div\", { className: \"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-1.5 text-xs text-destructive\", children: moveError }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex gap-3 overflow-x-auto pb-2\", children: columns.map((col) => {\n const colTasks = filtered.filter((t) => t.status === col.status);\n const isOver = dragOver === col.status;\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n onDragOver: onColumnDragOver(col.status),\n onDragLeave: () => dragOver === col.status && setDragOver(null),\n onDrop: onColumnDrop(col.status),\n className: cn(\n \"flex w-72 shrink-0 flex-col rounded-lg border transition-colors\",\n isOver ? \"border-primary/50 bg-primary/5\" : \"border-transparent bg-muted/40\"\n ),\n children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-between gap-2 px-3 py-2\", children: [\n /* @__PURE__ */ jsxs(\"span\", { className: \"flex items-center gap-2 text-sm font-medium text-foreground\", children: [\n /* @__PURE__ */ jsx(StatusIcon, { status: col.status }),\n L.status[col.status]\n ] }),\n /* @__PURE__ */ jsx(\"span\", { className: \"rounded-full bg-muted px-1.5 text-xs font-medium text-muted-foreground\", children: colTasks.length })\n ] }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-col gap-2 px-2 pb-2\", children: colTasks.length === 0 ? /* @__PURE__ */ jsx(\"div\", { className: \"rounded-md border border-dashed border-border/70 px-3 py-6 text-center text-xs text-muted-foreground\", children: isOver ? L.dropHere : L.noTasks }) : colTasks.map((task) => /* @__PURE__ */ jsx(\n TaskCard,\n {\n task,\n hidden,\n onClick: onTaskClick,\n draggable: canDrag,\n dragging: draggingId === task.id,\n resolveAssignee,\n links: linksByItem.get(task.id),\n renderLinkIcon,\n onDragStart: (t, e) => {\n setDraggingId(t.id);\n e.dataTransfer.effectAllowed = \"move\";\n e.dataTransfer.setData(\"text/plain\", t.id);\n },\n onDragEnd: () => {\n setDraggingId(null);\n setDragOver(null);\n }\n },\n task.id\n )) })\n ]\n },\n col.status\n );\n }) }),\n /* @__PURE__ */ jsx(\n Modal,\n {\n open: pendingMove != null,\n onClose: () => setPendingMove(null),\n ariaLabel: L.moveConfirmTitle,\n className: \"max-w-sm\",\n children: pendingMove && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-4 p-6\", children: [\n /* @__PURE__ */ jsx(\"h3\", { className: \"text-base font-semibold text-foreground\", children: L.moveConfirmTitle }),\n /* @__PURE__ */ jsx(\"p\", { className: \"text-sm text-muted-foreground\", children: L.moveConfirmPrompt.replace(\"{task}\", pendingMove.task.title).replace(\"{status}\", L.status[pendingMove.toStatus]) }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-end gap-2\", children: [\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setPendingMove(null),\n className: \"rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70\",\n children: L.cancel\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => {\n moveTask(pendingMove.task, pendingMove.toStatus);\n setPendingMove(null);\n },\n className: \"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:brightness-110\",\n children: L.moveConfirm\n }\n )\n ] })\n ] })\n }\n )\n ] });\n}\nfunction TaskBoard({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(TaskBoardCore, { workspaceId, ...coreProps })\n }\n );\n}\nvar DEFAULT_TYPE = \"TASK\";\nvar DEFAULT_STATUS = \"BACKLOG\";\nvar DEFAULT_PRIORITY = \"NONE\";\nvar fieldClass = \"w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\";\nvar labelClass = \"text-sm font-medium text-foreground\";\nfunction CreateTaskCore({\n projectId: projectIdProp,\n assigneeOptions,\n hiddenFields,\n defaultValues,\n hideHeader,\n submitLabel,\n onCreated,\n onError: onError2,\n onCancel,\n className,\n workspaceId: workspaceIdProp\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const projectId = projectIdProp ?? defaultValues?.projectId;\n const L = useTaskLabels();\n const hidden = useMemo(\n () => new Set(hiddenFields ?? []),\n [hiddenFields]\n );\n const [title, setTitle] = useState(defaultValues?.title ?? \"\");\n const [description, setDescription] = useState(\n defaultValues?.description ?? \"\"\n );\n const [type, setType] = useState(\n defaultValues?.type ?? DEFAULT_TYPE\n );\n const [status, setStatus] = useState(\n defaultValues?.status ?? DEFAULT_STATUS\n );\n const [priority, setPriority] = useState(\n defaultValues?.priority ?? DEFAULT_PRIORITY\n );\n const [assigneeId, setAssigneeId] = useState(defaultValues?.assigneeId ?? \"\");\n const [dueDate, setDueDate] = useState(defaultValues?.dueDate ?? \"\");\n const [labels, setLabels] = useState(\n (defaultValues?.labels ?? []).join(\", \")\n );\n const [storyPoints, setStoryPoints] = useState(\n defaultValues?.storyPoints != null ? String(defaultValues.storyPoints) : \"\"\n );\n const [createWorkItem, { loading, error }] = useMutation(CREATE_WORK_ITEM);\n const canSubmit = Boolean(workspaceId && projectId && title.trim());\n const handleSubmit = async (e) => {\n e.preventDefault();\n if (!canSubmit || !projectId) return;\n const parsedLabels = labels.split(\",\").map((l) => l.trim()).filter(Boolean);\n const parsedPoints = storyPoints.trim() ? Number(storyPoints) : void 0;\n const input = {\n projectId,\n title: title.trim(),\n type,\n // Sub-task linkage: parentId is not an editable form field — it rides\n // through from defaultValues (the \"Add sub-task\" flow) so a created work\n // item nests under its parent.\n ...defaultValues?.parentId ? { parentId: defaultValues.parentId } : {},\n ...hidden.has(\"status\") ? {} : { status },\n ...hidden.has(\"priority\") ? {} : { priority },\n ...hidden.has(\"description\") || !description.trim() ? {} : { description: description.trim() },\n ...hidden.has(\"assignee\") || !assigneeId.trim() ? {} : { assigneeId: assigneeId.trim() },\n ...hidden.has(\"dueDate\") || !dueDate.trim() ? {} : { dueDate: toIsoDate(dueDate) },\n ...hidden.has(\"labels\") || parsedLabels.length === 0 ? {} : { labels: parsedLabels },\n ...hidden.has(\"storyPoints\") || parsedPoints == null || Number.isNaN(parsedPoints) ? {} : { storyPoints: parsedPoints }\n };\n try {\n const result = await createWorkItem({ variables: { input } });\n const created = result.data?.planmagnetCreateWorkItem;\n if (created) {\n const cfg = getPlanMagnetConfig();\n try {\n await cfg.onTaskSaved?.({\n id: created.id,\n key: created.key,\n title: created.title,\n projectId: created.projectId,\n operation: \"created\"\n });\n } catch {\n }\n onCreated?.(created);\n resetForm();\n }\n } catch (err) {\n onError2?.(err instanceof Error ? err : new Error(String(err)));\n }\n };\n function resetForm() {\n setTitle(\"\");\n setDescription(\"\");\n setType(DEFAULT_TYPE);\n setStatus(DEFAULT_STATUS);\n setPriority(DEFAULT_PRIORITY);\n setAssigneeId(\"\");\n setDueDate(\"\");\n setLabels(\"\");\n setStoryPoints(\"\");\n }\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"CreateTask: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n return /* @__PURE__ */ jsx(Card, { className: cn(\"shadow-sm\", className), children: /* @__PURE__ */ jsx(CardContent, { className: \"p-6\", children: /* @__PURE__ */ jsxs(\"form\", { onSubmit: handleSubmit, className: \"space-y-4\", children: [\n !hideHeader && /* @__PURE__ */ jsxs(\"div\", { children: [\n /* @__PURE__ */ jsx(\"h2\", { className: \"text-xl font-semibold text-foreground\", children: L.newTaskHeading }),\n /* @__PURE__ */ jsx(\"p\", { className: \"text-sm text-muted-foreground\", children: L.newTaskSubtitle })\n ] }),\n !projectId && /* @__PURE__ */ jsx(\"p\", { className: \"rounded-md bg-destructive/10 p-2 text-xs text-destructive\", children: L.projectRequired }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-title\", className: labelClass, children: L.title }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-title\",\n className: fieldClass,\n value: title,\n onChange: (e) => setTitle(e.target.value),\n placeholder: L.titlePlaceholder,\n required: true\n }\n )\n ] }),\n !hidden.has(\"description\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-description\", className: labelClass, children: L.description }),\n /* @__PURE__ */ jsx(\n \"textarea\",\n {\n id: \"pm-description\",\n className: cn(fieldClass, \"min-h-[80px]\"),\n value: description,\n onChange: (e) => setDescription(e.target.value),\n placeholder: L.descriptionPlaceholder\n }\n )\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"grid grid-cols-1 gap-4 sm:grid-cols-2\", children: [\n !hidden.has(\"type\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-type\", className: labelClass, children: L.typeLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-type\",\n className: cn(fieldClass, \"capitalize\"),\n value: type,\n onChange: (e) => setType(e.target.value),\n children: TASK_TYPES.map((t) => /* @__PURE__ */ jsx(\"option\", { value: t, children: L.type[t] }, t))\n }\n )\n ] }),\n !hidden.has(\"status\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-status\", className: labelClass, children: L.statusLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-status\",\n className: cn(fieldClass, \"capitalize\"),\n value: status,\n onChange: (e) => setStatus(e.target.value),\n children: TASK_STATUSES.map((s) => /* @__PURE__ */ jsx(\"option\", { value: s, children: L.status[s] }, s))\n }\n )\n ] }),\n !hidden.has(\"priority\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-priority\", className: labelClass, children: L.priorityLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-priority\",\n className: cn(fieldClass, \"capitalize\"),\n value: priority,\n onChange: (e) => setPriority(e.target.value),\n children: TASK_PRIORITIES.map((p) => /* @__PURE__ */ jsx(\"option\", { value: p, children: L.priority[p] }, p))\n }\n )\n ] }),\n !hidden.has(\"assignee\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-assignee\", className: labelClass, children: L.assigneeLabel }),\n assigneeOptions && assigneeOptions.length > 0 ? /* @__PURE__ */ jsxs(\n \"select\",\n {\n id: \"pm-assignee\",\n className: fieldClass,\n value: assigneeId,\n onChange: (e) => setAssigneeId(e.target.value),\n children: [\n /* @__PURE__ */ jsx(\"option\", { value: \"\", children: L.unassigned }),\n assigneeOptions.map((o) => /* @__PURE__ */ jsx(\"option\", { value: o.id, children: o.name }, o.id))\n ]\n }\n ) : /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-assignee\",\n className: fieldClass,\n value: assigneeId,\n onChange: (e) => setAssigneeId(e.target.value),\n placeholder: L.assigneePlaceholder\n }\n )\n ] }),\n !hidden.has(\"dueDate\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-due\", className: labelClass, children: L.dueDateLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-due\",\n type: \"date\",\n className: fieldClass,\n value: dueDate,\n onChange: (e) => setDueDate(e.target.value)\n }\n )\n ] }),\n !hidden.has(\"storyPoints\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-points\", className: labelClass, children: L.storyPointsLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-points\",\n type: \"number\",\n min: 0,\n className: fieldClass,\n value: storyPoints,\n onChange: (e) => setStoryPoints(e.target.value),\n placeholder: \"0\"\n }\n )\n ] })\n ] }),\n !hidden.has(\"labels\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-labels\", className: labelClass, children: L.labelsLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-labels\",\n className: fieldClass,\n value: labels,\n onChange: (e) => setLabels(e.target.value),\n placeholder: L.labelsPlaceholder\n }\n )\n ] }),\n error && /* @__PURE__ */ jsxs(\"p\", { className: \"text-sm text-destructive\", children: [\n L.failedToCreate,\n \": \",\n error.message\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-end gap-2\", children: [\n onCancel && /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: onCancel,\n className: \"rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70\",\n children: L.cancel\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"submit\",\n disabled: !canSubmit || loading,\n className: cn(\n \"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground\",\n (!canSubmit || loading) && \"cursor-not-allowed opacity-50\"\n ),\n children: loading ? L.creating : submitLabel ?? L.create\n }\n )\n ] })\n ] }) }) });\n}\nfunction CreateTask({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(CreateTaskCore, { workspaceId, ...coreProps })\n }\n );\n}\nvar DEFAULT_COLUMNS = [\n \"title\",\n \"status\",\n \"priority\",\n \"assignee\",\n \"dueDate\",\n \"storyPoints\"\n];\nvar priorityRank = {\n CRITICAL: 0,\n HIGH: 1,\n MEDIUM: 2,\n LOW: 3,\n NONE: 4\n};\nvar statusRank = {\n BACKLOG: 0,\n TODO: 1,\n IN_PROGRESS: 2,\n IN_REVIEW: 3,\n TESTING: 4,\n DONE: 5,\n CANCELLED: 6\n};\nfunction columnLabel(col, L) {\n switch (col) {\n case \"key\":\n return L.colKey;\n case \"title\":\n return L.colTask;\n case \"type\":\n return L.colType;\n case \"status\":\n return L.colStatus;\n case \"priority\":\n return L.colPriority;\n case \"assignee\":\n return L.colAssignee;\n case \"dueDate\":\n return L.colDueDate;\n case \"storyPoints\":\n return L.colPoints;\n case \"linkedRecord\":\n return L.colLinkedRecord;\n case \"labels\":\n return L.colLabels;\n default:\n return col;\n }\n}\nvar COLUMN_SORT = {\n title: \"title\",\n type: \"type\",\n status: \"status\",\n priority: \"priority\",\n dueDate: \"dueDate\",\n storyPoints: \"storyPoints\"\n};\nfunction TaskListCore({\n projectId,\n status,\n type,\n priority,\n assigneeId,\n search,\n columns = DEFAULT_COLUMNS,\n sortBy,\n sortDir = \"asc\",\n hideHeader,\n onSelect,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n limit = 200,\n className,\n workspaceId: workspaceIdProp\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const { linksByItem } = useWorkItemLinks(workspaceId, linkSourceProduct);\n const L = useTaskLabels();\n const [sort, setSort] = useState({\n by: sortBy ?? null,\n dir: sortDir\n });\n const filter = useMemo(() => {\n const f = {};\n if (projectId) f.projectId = projectId;\n if (status) f.status = status;\n if (type) f.type = type;\n if (priority) f.priority = priority;\n if (assigneeId) f.assigneeId = assigneeId;\n if (search) f.search = search;\n return f;\n }, [projectId, status, type, priority, assigneeId, search]);\n const { data, loading, error } = useQuery(\n LIST_WORK_ITEMS,\n {\n variables: {\n workspaceId,\n ...Object.keys(filter).length ? { filter } : {},\n pagination: { first: limit }\n },\n skip: !workspaceId\n }\n );\n const rows = useMemo(() => {\n const items = data?.planmagnetWorkItems?.items ?? [];\n if (!sort.by) return items;\n const dir = sort.dir === \"desc\" ? -1 : 1;\n const key = sort.by;\n return [...items].sort((a, b) => dir * compareTasks(a, b, key));\n }, [data, sort]);\n const toggleSort = (col) => {\n const key = COLUMN_SORT[col];\n if (!key) return;\n setSort(\n (prev) => prev.by === key ? { by: key, dir: prev.dir === \"asc\" ? \"desc\" : \"asc\" } : { by: key, dir: \"asc\" }\n );\n };\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"TaskList: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n if (loading && !data) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"flex items-center justify-center p-12\", className), children: /* @__PURE__ */ jsx(\"div\", { className: \"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent\" }) });\n }\n if (error && !data) {\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: [\n L.errorLoading,\n \": \",\n error.message\n ] });\n }\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-3\", className), children: [\n !hideHeader && /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-baseline justify-between\", children: [\n /* @__PURE__ */ jsx(\"h2\", { className: \"text-lg font-semibold text-foreground\", children: L.list }),\n /* @__PURE__ */ jsxs(\"span\", { className: \"text-sm text-muted-foreground\", children: [\n rows.length,\n \" \",\n rows.length === 1 ? L.tasksSingular : L.tasksPlural\n ] })\n ] }),\n /* @__PURE__ */ jsx(\"div\", { className: \"overflow-x-auto rounded-lg border border-border\", children: /* @__PURE__ */ jsxs(\"table\", { className: \"w-full border-collapse text-sm\", children: [\n /* @__PURE__ */ jsx(\"thead\", { children: /* @__PURE__ */ jsx(\"tr\", { className: \"border-b border-border bg-muted/50 text-left\", children: columns.map((col) => {\n const sortable = Boolean(COLUMN_SORT[col]);\n const active = sort.by === COLUMN_SORT[col];\n return /* @__PURE__ */ jsx(\n \"th\",\n {\n onClick: sortable ? () => toggleSort(col) : void 0,\n className: cn(\n \"px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground\",\n sortable && \"cursor-pointer select-none hover:text-foreground\"\n ),\n children: /* @__PURE__ */ jsxs(\"span\", { className: \"inline-flex items-center gap-1\", children: [\n columnLabel(col, L),\n active && (sort.dir === \"asc\" ? /* @__PURE__ */ jsx(ChevronUp, { className: \"h-3 w-3\", \"aria-hidden\": \"true\" }) : /* @__PURE__ */ jsx(ChevronDown, { className: \"h-3 w-3\", \"aria-hidden\": \"true\" }))\n ] })\n },\n col\n );\n }) }) }),\n /* @__PURE__ */ jsxs(\"tbody\", { children: [\n rows.length === 0 && /* @__PURE__ */ jsx(\"tr\", { children: /* @__PURE__ */ jsx(\n \"td\",\n {\n colSpan: columns.length,\n className: \"px-3 py-8 text-center text-muted-foreground\",\n children: L.noTasksFound\n }\n ) }),\n rows.map((task) => /* @__PURE__ */ jsx(\n \"tr\",\n {\n onClick: onSelect ? () => onSelect(task.id) : void 0,\n className: cn(\n \"border-b border-border last:border-0\",\n onSelect && \"cursor-pointer hover:bg-muted/40\"\n ),\n children: columns.map((col) => /* @__PURE__ */ jsx(\n \"td\",\n {\n className: \"px-3 py-2 align-middle text-foreground\",\n children: renderCell(col, task, {\n resolveAssignee,\n links: linksByItem.get(task.id),\n renderLinkIcon,\n unassigned: L.unassigned\n })\n },\n col\n ))\n },\n task.id\n ))\n ] })\n ] }) })\n ] });\n}\nfunction renderCell(col, task, opts) {\n const { resolveAssignee, links, renderLinkIcon, unassigned } = opts;\n switch (col) {\n case \"key\":\n return /* @__PURE__ */ jsx(\"span\", { className: \"font-mono text-xs text-muted-foreground\", children: task.key });\n case \"title\":\n return /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-col\", children: [\n /* @__PURE__ */ jsx(\"span\", { className: \"font-medium text-foreground\", children: task.title }),\n /* @__PURE__ */ jsx(\"span\", { className: \"font-mono text-[10px] uppercase text-muted-foreground\", children: task.key })\n ] });\n case \"type\":\n return /* @__PURE__ */ jsx(TypeBadge, { type: task.type });\n case \"status\":\n return /* @__PURE__ */ jsx(StatusPill, { status: task.status });\n case \"priority\":\n return /* @__PURE__ */ jsx(PriorityIndicator, { priority: task.priority, showLabel: true });\n case \"assignee\": {\n const resolved = task.assigneeId ? resolveAssignee?.(task.assigneeId) : null;\n return /* @__PURE__ */ jsxs(\"span\", { className: \"flex items-center gap-1.5\", children: [\n /* @__PURE__ */ jsx(Avatar, { id: task.assigneeId, name: resolved?.name, size: \"sm\" }),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: resolved?.name ?? (task.assigneeId ? \"\" : unassigned) })\n ] });\n }\n case \"dueDate\": {\n const due = formatDueDate(task.dueDate);\n if (!due) return /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: \"\\u2014\" });\n return /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"text-xs\",\n isOverdue(task.dueDate, task.status) ? \"font-medium text-destructive\" : \"text-muted-foreground\"\n ),\n children: due\n }\n );\n }\n case \"storyPoints\":\n return task.storyPoints != null ? /* @__PURE__ */ jsx(\"span\", { className: \"flex h-5 min-w-5 items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] font-semibold text-primary\", children: task.storyPoints }) : /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: \"\\u2014\" });\n case \"linkedRecord\":\n if (!links || links.length === 0) {\n return /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: \"\\u2014\" });\n }\n return /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-wrap gap-1\", children: [\n links.slice(0, 2).map((link) => /* @__PURE__ */ jsx(LinkChip, { link, renderIcon: renderLinkIcon }, link.id)),\n links.length > 2 && /* @__PURE__ */ jsxs(\"span\", { className: \"text-[10px] text-muted-foreground\", children: [\n \"+\",\n links.length - 2\n ] })\n ] });\n case \"labels\":\n return /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-wrap gap-1\", children: (task.labels ?? []).slice(0, 3).map((l) => /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\",\n children: l\n },\n l\n )) });\n default:\n return null;\n }\n}\nfunction compareTasks(a, b, sortBy) {\n switch (sortBy) {\n case \"priority\":\n return priorityRank[a.priority] - priorityRank[b.priority];\n case \"status\":\n return statusRank[a.status] - statusRank[b.status];\n case \"title\":\n return a.title.localeCompare(b.title);\n case \"type\":\n return a.type.localeCompare(b.type);\n case \"dueDate\":\n return (a.dueDate ?? \"\").localeCompare(b.dueDate ?? \"\");\n case \"storyPoints\":\n return (a.storyPoints ?? 0) - (b.storyPoints ?? 0);\n default:\n return 0;\n }\n}\nfunction TaskList({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(TaskListCore, { workspaceId, ...coreProps })\n }\n );\n}\nfunction useMilestones(workspaceId, opts = {}) {\n const { projectId, enabled = true, limit = 100 } = opts;\n const { data, loading } = useQuery(LIST_MILESTONES, {\n variables: {\n workspaceId,\n ...projectId ? { filter: { projectId } } : {},\n pagination: { first: limit }\n },\n skip: !workspaceId || !enabled,\n errorPolicy: \"all\"\n });\n const milestones = useMemo(\n () => data?.planmagnetMilestones?.items ?? [],\n [data]\n );\n const byDay = useMemo(() => {\n const map = /* @__PURE__ */ new Map();\n for (const m of milestones) {\n const d = parseDate(m.dueDate);\n if (!d) continue;\n const key = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, \"0\")}-${String(d.getDate()).padStart(2, \"0\")}`;\n const arr = map.get(key);\n if (arr) arr.push(m);\n else map.set(key, [m]);\n }\n return map;\n }, [milestones]);\n return { milestones, byDay, loading };\n}\nvar WEEK_OPTS = { weekStartsOn: 1 };\nfunction dayKey(d) {\n return format(d, \"yyyy-MM-dd\");\n}\nfunction TaskTimelineCore({\n projectId,\n priority = \"ALL\",\n type = \"ALL\",\n search = \"\",\n assigneeId,\n defaultMode = \"week\",\n onSelect,\n resolveAssignee,\n showMilestones = true,\n className,\n workspaceId: workspaceIdProp\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const L = useTaskLabels();\n const { milestones, byDay: milestonesByDay } = useMilestones(workspaceId, {\n projectId,\n enabled: showMilestones\n });\n const [mode, setMode] = useState(defaultMode);\n const [offset, setOffset] = useState(0);\n const { data, loading, error } = useQuery(\n LIST_WORK_ITEMS,\n {\n variables: {\n workspaceId,\n ...projectId ? { filter: { projectId } } : {},\n pagination: { first: 200 }\n },\n skip: !workspaceId\n }\n );\n const tasks = useMemo(() => {\n const all = data?.planmagnetWorkItems?.items ?? [];\n const query = search.trim().toLowerCase();\n return all.filter((t) => {\n if (priority !== \"ALL\" && t.priority !== priority) return false;\n if (type !== \"ALL\" && t.type !== type) return false;\n if (assigneeId && t.assigneeId !== assigneeId) return false;\n if (query) {\n const hay = [t.title, t.key, ...t.labels ?? []].join(\" \").toLowerCase();\n if (!hay.includes(query)) return false;\n }\n return true;\n });\n }, [data, priority, type, search, assigneeId]);\n const { anchor, rangeStart, rangeEnd, days } = useMemo(() => {\n const base = /* @__PURE__ */ new Date();\n if (mode === \"week\") {\n const a2 = addWeeks(base, offset);\n const s2 = startOfWeek(a2, WEEK_OPTS);\n const e2 = endOfWeek(a2, WEEK_OPTS);\n return {\n anchor: a2,\n rangeStart: s2,\n rangeEnd: e2,\n days: eachDayOfInterval({ start: s2, end: e2 })\n };\n }\n const a = addMonths(base, offset);\n const s = startOfWeek(startOfMonth(a), WEEK_OPTS);\n const e = endOfWeek(endOfMonth(a), WEEK_OPTS);\n return {\n anchor: a,\n rangeStart: s,\n rangeEnd: e,\n days: eachDayOfInterval({ start: s, end: e })\n };\n }, [mode, offset]);\n const { byDay, overdue, undated } = useMemo(() => {\n const map = /* @__PURE__ */ new Map();\n const od = [];\n const ud = [];\n for (const t of tasks) {\n const d = parseDate(t.dueDate);\n if (!d) {\n ud.push(t);\n continue;\n }\n if (isOverdue(t.dueDate, t.status)) {\n od.push(t);\n continue;\n }\n const k = dayKey(d);\n const arr = map.get(k);\n if (arr) arr.push(t);\n else map.set(k, [t]);\n }\n return { byDay: map, overdue: od, undated: ud };\n }, [tasks]);\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"Timeline: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n if (loading && !data) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"flex items-center justify-center p-12\", className), children: /* @__PURE__ */ jsx(\"div\", { className: \"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent\" }) });\n }\n if (error && !data) {\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: [\n L.errorLoading,\n \": \",\n error.message\n ] });\n }\n const rangeLabel = mode === \"week\" ? `${format(rangeStart, \"MMM d\")} \\u2013 ${format(rangeEnd, \"MMM d\")}` : format(anchor, \"MMMM yyyy\");\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-3\", className), children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-wrap items-center justify-between gap-2\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center gap-1\", children: [\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setOffset((o) => o - 1),\n \"aria-label\": \"Previous\",\n className: \"flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-muted/50\",\n children: /* @__PURE__ */ jsx(ChevronLeft, { className: \"h-4 w-4\" })\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setOffset(0),\n className: \"h-8 rounded-md border border-border px-3 text-xs font-medium text-foreground hover:bg-muted/50\",\n children: L.today\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setOffset((o) => o + 1),\n \"aria-label\": \"Next\",\n className: \"flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-muted/50\",\n children: /* @__PURE__ */ jsx(ChevronRight, { className: \"h-4 w-4\" })\n }\n ),\n /* @__PURE__ */ jsx(\"span\", { className: \"ml-2 text-sm font-medium text-foreground\", children: rangeLabel })\n ] }),\n /* @__PURE__ */ jsx(\"div\", { className: \"inline-flex rounded-md border border-border p-0.5\", children: [\"week\", \"month\"].map((m) => /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => {\n setMode(m);\n setOffset(0);\n },\n className: cn(\n \"rounded px-3 py-1 text-xs font-medium capitalize transition-colors\",\n mode === m ? \"bg-primary text-primary-foreground\" : \"text-muted-foreground hover:text-foreground\"\n ),\n children: m === \"week\" ? L.week : L.month\n },\n m\n )) })\n ] }),\n overdue.length > 0 && /* @__PURE__ */ jsxs(\"div\", { className: \"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2\", children: [\n /* @__PURE__ */ jsx(\"p\", { className: \"mb-1 text-xs font-semibold text-destructive\", children: L.overdue.replace(\"{n}\", String(overdue.length)) }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-wrap gap-1.5\", children: overdue.map((t) => /* @__PURE__ */ jsx(\n TaskChip,\n {\n task: t,\n onSelect,\n resolveAssignee,\n tone: \"destructive\"\n },\n t.id\n )) })\n ] }),\n milestones.length > 0 && /* @__PURE__ */ jsxs(\"div\", { className: \"rounded-md border border-primary/30 bg-primary/5 px-3 py-2\", children: [\n /* @__PURE__ */ jsxs(\"p\", { className: \"mb-1 flex items-center gap-1 text-xs font-semibold text-primary\", children: [\n /* @__PURE__ */ jsx(Flag, { className: \"h-3.5 w-3.5\", \"aria-hidden\": \"true\" }),\n L.milestones\n ] }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-wrap gap-1.5\", children: milestones.map((m) => /* @__PURE__ */ jsx(MilestoneFlag, { milestone: m }, m.id)) })\n ] }),\n mode === \"week\" ? /* @__PURE__ */ jsx(\"div\", { className: \"grid grid-cols-7 gap-2\", children: days.map((day) => {\n const items = byDay.get(dayKey(day)) ?? [];\n const dayMilestones = milestonesByDay.get(dayKey(day)) ?? [];\n const today = isToday(day);\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n className: cn(\n \"flex min-h-32 flex-col rounded-lg border p-2\",\n today ? \"border-primary/50 bg-primary/5\" : \"border-border bg-muted/20\"\n ),\n children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"mb-2 flex items-baseline justify-between\", children: [\n /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"text-xs font-semibold uppercase\",\n today ? \"text-primary\" : \"text-muted-foreground\"\n ),\n children: format(day, \"EEE\")\n }\n ),\n /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"text-sm font-semibold\",\n today ? \"text-primary\" : \"text-foreground\"\n ),\n children: format(day, \"d\")\n }\n )\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-col gap-1.5\", children: [\n dayMilestones.map((m) => /* @__PURE__ */ jsx(MilestoneFlag, { milestone: m, compact: true }, m.id)),\n items.map((t) => /* @__PURE__ */ jsx(\n TaskChip,\n {\n task: t,\n onSelect,\n resolveAssignee\n },\n t.id\n ))\n ] })\n ]\n },\n dayKey(day)\n );\n }) }) : /* @__PURE__ */ jsxs(\"div\", { className: \"grid grid-cols-7 gap-1\", children: [\n [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"].map((d) => /* @__PURE__ */ jsx(\n \"div\",\n {\n className: \"px-1 pb-1 text-center text-[10px] font-semibold uppercase text-muted-foreground\",\n children: d\n },\n d\n )),\n days.map((day) => {\n const items = byDay.get(dayKey(day)) ?? [];\n const today = isToday(day);\n const inMonth = isSameMonth(day, anchor);\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n className: cn(\n \"flex min-h-20 flex-col gap-1 rounded-md border p-1\",\n today ? \"border-primary/50 bg-primary/5\" : \"border-border/60 bg-muted/10\",\n !inMonth && \"opacity-40\"\n ),\n children: [\n /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"text-[10px] font-semibold\",\n today ? \"text-primary\" : \"text-muted-foreground\"\n ),\n children: format(day, \"d\")\n }\n ),\n items.slice(0, 3).map((t) => /* @__PURE__ */ jsx(\n TaskChip,\n {\n task: t,\n onSelect,\n resolveAssignee,\n compact: true\n },\n t.id\n )),\n items.length > 3 && /* @__PURE__ */ jsxs(\"span\", { className: \"text-[10px] text-muted-foreground\", children: [\n \"+\",\n items.length - 3,\n \" \",\n L.more\n ] })\n ]\n },\n dayKey(day)\n );\n })\n ] }),\n undated.length > 0 && /* @__PURE__ */ jsxs(\"div\", { className: \"rounded-md border border-border bg-muted/20 px-3 py-2\", children: [\n /* @__PURE__ */ jsx(\"p\", { className: \"mb-1 text-xs font-semibold text-muted-foreground\", children: L.noDueDate.replace(\"{n}\", String(undated.length)) }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-wrap gap-1.5\", children: undated.map((t) => /* @__PURE__ */ jsx(\n TaskChip,\n {\n task: t,\n onSelect,\n resolveAssignee\n },\n t.id\n )) })\n ] })\n ] });\n}\nfunction MilestoneFlag({\n milestone,\n compact\n}) {\n const due = formatDueDate(milestone.dueDate);\n return /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\n \"inline-flex max-w-full items-center gap-1 rounded-md border border-primary/40 bg-primary/10 px-1.5 py-1 text-[11px] font-medium text-primary\",\n compact && \"w-full\"\n ),\n title: milestone.name + (due ? ` \\xB7 ${due}` : \"\"),\n children: [\n /* @__PURE__ */ jsx(Flag, { className: \"h-3 w-3 shrink-0\", \"aria-hidden\": \"true\" }),\n /* @__PURE__ */ jsx(\"span\", { className: \"truncate\", children: milestone.name }),\n !compact && due && /* @__PURE__ */ jsxs(\"span\", { className: \"shrink-0 text-primary/70\", children: [\n \"\\xB7 \",\n due\n ] })\n ]\n }\n );\n}\nfunction TaskChip({\n task,\n onSelect,\n resolveAssignee,\n tone,\n compact\n}) {\n const resolved = task.assigneeId ? resolveAssignee?.(task.assigneeId) : null;\n const interactive = Boolean(onSelect);\n return /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n disabled: !interactive,\n onClick: interactive ? () => onSelect?.(task.id) : void 0,\n title: task.title,\n className: cn(\n \"flex w-full items-center gap-1.5 rounded-md border px-1.5 py-1 text-left transition-colors\",\n tone === \"destructive\" ? \"border-destructive/40 bg-card hover:bg-destructive/5\" : \"border-border bg-card hover:border-primary/50\",\n interactive ? \"cursor-pointer\" : \"cursor-default\"\n ),\n children: [\n /* @__PURE__ */ jsx(PriorityIndicator, { priority: task.priority }),\n /* @__PURE__ */ jsx(\"span\", { className: \"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground\", children: task.title }),\n !compact && /* @__PURE__ */ jsx(Avatar, { id: task.assigneeId, name: resolved?.name, size: \"sm\" })\n ]\n }\n );\n}\nvar VIEW_ICONS = {\n board: LayoutGrid,\n list: List,\n timeline: CalendarRange\n};\nvar SELECT_CLASS = \"h-8 rounded-md border border-border bg-background px-2 text-xs font-medium text-foreground capitalize transition-colors hover:bg-muted/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring\";\nfunction TaskToolbar({\n view,\n onViewChange,\n views = [\"board\", \"list\", \"timeline\"],\n search,\n onSearchChange,\n priority,\n onPriorityChange,\n type,\n onTypeChange,\n onNewTask,\n canCreate,\n mine,\n onMineChange,\n className\n}) {\n const L = useTaskLabels();\n const viewLabel = {\n board: L.board,\n list: L.list,\n timeline: L.timeline\n };\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n className: cn(\n \"flex flex-wrap items-center justify-between gap-3 border-b border-border pb-2\",\n className\n ),\n children: [\n /* @__PURE__ */ jsx(\n \"div\",\n {\n className: \"flex items-center gap-1\",\n role: \"tablist\",\n \"aria-label\": \"Task views\",\n children: views.map((v) => {\n const Icon = VIEW_ICONS[v];\n const active = v === view;\n return /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n role: \"tab\",\n \"aria-selected\": active,\n onClick: () => onViewChange(v),\n className: cn(\n \"relative flex items-center gap-1.5 rounded-t-md px-2.5 py-1.5 text-sm font-medium transition-colors\",\n active ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\"\n ),\n children: [\n /* @__PURE__ */ jsx(Icon, { className: \"h-4 w-4\", \"aria-hidden\": \"true\" }),\n viewLabel[v],\n active && /* @__PURE__ */ jsx(\"span\", { className: \"absolute inset-x-1 -bottom-[9px] h-0.5 rounded-full bg-primary\" })\n ]\n },\n v\n );\n })\n }\n ),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-wrap items-center gap-2\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"relative\", children: [\n /* @__PURE__ */ jsx(\n Search,\n {\n className: \"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground\",\n \"aria-hidden\": \"true\"\n }\n ),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n type: \"search\",\n value: search,\n onChange: (e) => onSearchChange(e.target.value),\n placeholder: L.searchPlaceholder,\n \"aria-label\": L.searchPlaceholder,\n className: \"h-8 w-40 rounded-md border border-border bg-background pl-7 pr-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n }\n )\n ] }),\n onMineChange && /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: () => onMineChange(!mine),\n \"aria-pressed\": mine,\n className: cn(\n \"flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium transition-colors\",\n mine ? \"border-primary bg-primary/10 text-primary\" : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n ),\n children: [\n /* @__PURE__ */ jsx(User, { className: \"h-3.5 w-3.5\", \"aria-hidden\": \"true\" }),\n L.myTasks\n ]\n }\n ),\n /* @__PURE__ */ jsxs(\n \"select\",\n {\n value: priority,\n onChange: (e) => onPriorityChange(e.target.value),\n \"aria-label\": L.priorityLabel,\n className: SELECT_CLASS,\n children: [\n /* @__PURE__ */ jsx(\"option\", { value: \"ALL\", children: L.allPriorities }),\n TASK_PRIORITIES.map((p) => /* @__PURE__ */ jsx(\"option\", { value: p, children: L.priority[p] }, p))\n ]\n }\n ),\n /* @__PURE__ */ jsxs(\n \"select\",\n {\n value: type,\n onChange: (e) => onTypeChange(e.target.value),\n \"aria-label\": L.typeLabel,\n className: SELECT_CLASS,\n children: [\n /* @__PURE__ */ jsx(\"option\", { value: \"ALL\", children: L.allTypes }),\n TASK_TYPES.map((t) => /* @__PURE__ */ jsx(\"option\", { value: t, children: L.type[t] }, t))\n ]\n }\n ),\n canCreate && onNewTask && /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: onNewTask,\n className: \"flex h-8 items-center gap-1.5 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90\",\n children: [\n /* @__PURE__ */ jsx(Plus, { className: \"h-4 w-4\", \"aria-hidden\": \"true\" }),\n L.newTask\n ]\n }\n )\n ] })\n ]\n }\n );\n}\nvar fieldClass2 = \"w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\";\nfunction CommentComposer({\n placeholder,\n submitLabel,\n pendingLabel,\n members,\n autoFocus,\n onSubmit\n}) {\n const [text, setText] = useState(\"\");\n const [pending, setPending] = useState(false);\n const [mentioned, setMentioned] = useState([]);\n const [query, setQuery] = useState(null);\n const taRef = useRef(null);\n const suggestions = useMemo(() => {\n if (query == null || !members || members.length === 0) return [];\n const q = query.toLowerCase();\n return members.filter((m) => m.name.toLowerCase().includes(q)).slice(0, 6);\n }, [query, members]);\n const detectMention = (value) => {\n const caret = taRef.current?.selectionStart ?? value.length;\n const m = /(?:^|\\s)@([\\p{L}\\p{N} ._-]*)$/u.exec(value.slice(0, caret));\n setQuery(m ? m[1] : null);\n };\n const onChange = (value) => {\n setText(value);\n detectMention(value);\n };\n const pickMention = (member) => {\n const el = taRef.current;\n const caret = el?.selectionStart ?? text.length;\n const before = text.slice(0, caret);\n const after = text.slice(caret);\n const replaced = before.replace(\n /@([\\p{L}\\p{N} ._-]*)$/u,\n `@${member.name} `\n );\n setText(replaced + after);\n setQuery(null);\n setMentioned(\n (prev) => prev.some((p) => p.id === member.id) ? prev : [...prev, member]\n );\n requestAnimationFrame(() => el?.focus());\n };\n const submit = async (e) => {\n e.preventDefault();\n const body = text.trim();\n if (!body || pending) return;\n const ids = mentioned.filter((m) => body.includes(`@${m.name}`)).map((m) => m.id);\n setPending(true);\n try {\n await onSubmit({ text: body, mentionUserIds: ids });\n setText(\"\");\n setMentioned([]);\n setQuery(null);\n } finally {\n setPending(false);\n }\n };\n return /* @__PURE__ */ jsxs(\"form\", { onSubmit: submit, className: \"relative space-y-2\", children: [\n /* @__PURE__ */ jsx(\n \"textarea\",\n {\n ref: taRef,\n className: cn(fieldClass2, \"min-h-[60px]\"),\n rows: 2,\n value: text,\n autoFocus,\n onChange: (e) => onChange(e.target.value),\n onKeyUp: (e) => detectMention(e.target.value),\n onClick: (e) => detectMention(e.target.value),\n placeholder,\n \"aria-label\": placeholder\n }\n ),\n suggestions.length > 0 && /* @__PURE__ */ jsx(\"ul\", { className: \"absolute left-0 top-full z-20 mt-1 max-h-48 w-56 overflow-auto rounded-md border border-border bg-popover p-1 shadow-md\", children: suggestions.map((m) => /* @__PURE__ */ jsx(\"li\", { children: /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onMouseDown: (e) => {\n e.preventDefault();\n pickMention(m);\n },\n className: \"flex w-full items-center rounded px-2 py-1 text-left text-sm text-foreground hover:bg-muted\",\n children: [\n \"@\",\n m.name\n ]\n }\n ) }, m.id)) }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex justify-end\", children: /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"submit\",\n disabled: pending || !text.trim(),\n className: cn(\n \"rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground\",\n (pending || !text.trim()) && \"cursor-not-allowed opacity-50\"\n ),\n children: pending ? pendingLabel : submitLabel\n }\n ) })\n ] });\n}\nvar labelClass2 = \"text-xs font-medium uppercase tracking-wide text-muted-foreground\";\nvar escapeRe = (s) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\nfunction TaskCommentsCore({\n entityType,\n entityId,\n currentActorId,\n resolveAssignee,\n members,\n readonly,\n className\n}) {\n const L = useTaskLabels();\n const [error, setError] = useState(null);\n const [replyingTo, setReplyingTo] = useState(null);\n const { data, loading, refetch } = useQuery(\n GET_ENTITY_COMMENTS,\n {\n // No parentCommentId → the service returns EVERY comment (all levels)\n // flat; we build the thread tree client-side via threadRootId.\n variables: {\n input: {\n entityType,\n entityId,\n take: 200,\n sortBy: \"createdAt\",\n sortOrder: \"asc\"\n }\n },\n skip: !entityId,\n errorPolicy: \"all\"\n }\n );\n const all = data?.getEntityComments?.items ?? [];\n const { topLevel, repliesByRoot } = useMemo(() => {\n const top = [];\n const map = /* @__PURE__ */ new Map();\n for (const c of all) {\n if (!c.parentCommentId) {\n top.push(c);\n } else {\n const root = c.threadRootId ?? c.parentCommentId;\n const arr = map.get(root);\n if (arr) arr.push(c);\n else map.set(root, [c]);\n }\n }\n return { topLevel: top, repliesByRoot: map };\n }, [all]);\n const [createComment] = useMutation(\n CREATE_ENTITY_COMMENT\n );\n const [deleteComment] = useMutation(\n DELETE_ENTITY_COMMENT\n );\n const authorName = (id) => id === currentActorId ? L.you : resolveAssignee?.(id)?.name ?? void 0;\n const post = async ({ text, mentionUserIds }, parentCommentId) => {\n setError(null);\n try {\n await createComment({\n variables: {\n input: {\n entityType,\n entityId,\n content: { text },\n contentType: \"TEXT\",\n ...parentCommentId ? { parentCommentId } : {},\n ...mentionUserIds.length ? { mentionUserIds } : {}\n }\n }\n });\n await refetch();\n setReplyingTo(null);\n } catch (err) {\n setError(L.failedToComment);\n throw err;\n }\n };\n const handleDelete = async (id) => {\n setError(null);\n try {\n await deleteComment({ variables: { input: { id, soft: true } } });\n await refetch();\n } catch {\n setError(L.failedToDeleteComment);\n }\n };\n const renderBody = (c) => {\n const text = c.content?.text ?? \"\";\n const names = (c.mentions ?? []).map((m) => resolveAssignee?.(m.mentionedUserId)?.name).filter((n) => Boolean(n));\n if (names.length === 0) return text;\n const tokens = new Set(names.map((n) => `@${n}`));\n const re = new RegExp(`(@(?:${names.map(escapeRe).join(\"|\")}))`, \"g\");\n return text.split(re).map(\n (part, i) => tokens.has(part) ? /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"rounded bg-primary/10 px-0.5 font-medium text-primary\",\n children: part\n },\n i\n ) : /* @__PURE__ */ jsx(\"span\", { children: part }, i)\n );\n };\n const commentBlock = (c, isReply) => /* @__PURE__ */ jsxs(\"div\", { className: \"flex gap-2\", children: [\n /* @__PURE__ */ jsx(Avatar, { id: c.authorId, name: authorName(c.authorId), size: \"sm\" }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"min-w-0 flex-1\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center gap-2\", children: [\n /* @__PURE__ */ jsx(\"span\", { className: \"text-sm font-medium text-foreground\", children: authorName(c.authorId) ?? c.authorId.slice(0, 8) }),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: formatDateFull(c.createdAt) }),\n c.edited && /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: L.editedTag }),\n !readonly && c.authorId === currentActorId && /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => handleDelete(c.id),\n \"aria-label\": L.del,\n title: L.del,\n className: \"ml-auto rounded p-1 text-muted-foreground hover:text-destructive\",\n children: /* @__PURE__ */ jsx(Trash2, { className: \"h-3.5 w-3.5\" })\n }\n )\n ] }),\n /* @__PURE__ */ jsx(\"p\", { className: \"whitespace-pre-wrap break-words text-sm text-foreground\", children: renderBody(c) }),\n !isReply && !readonly && /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setReplyingTo((prev) => prev === c.id ? null : c.id),\n className: \"mt-1 text-xs font-medium text-muted-foreground hover:text-foreground\",\n children: L.reply\n }\n )\n ] })\n ] });\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-4\", className), children: [\n /* @__PURE__ */ jsxs(\"div\", { className: labelClass2, children: [\n L.commentsLabel,\n all.length > 0 ? ` (${all.length})` : \"\"\n ] }),\n /* @__PURE__ */ jsx(\"ul\", { className: \"space-y-4\", children: topLevel.length === 0 && !loading ? /* @__PURE__ */ jsx(\"li\", { className: \"text-sm text-muted-foreground\", children: L.noComments }) : topLevel.map((c) => {\n const replies = repliesByRoot.get(c.id) ?? [];\n return /* @__PURE__ */ jsxs(\"li\", { className: \"space-y-2\", children: [\n commentBlock(c, false),\n replies.length > 0 && /* @__PURE__ */ jsx(\"ul\", { className: \"ml-8 space-y-2 border-l border-border pl-3\", children: replies.map((r) => /* @__PURE__ */ jsx(\"li\", { children: commentBlock(r, true) }, r.id)) }),\n !readonly && replyingTo === c.id && /* @__PURE__ */ jsx(\"div\", { className: \"ml-8\", children: /* @__PURE__ */ jsx(\n CommentComposer,\n {\n placeholder: L.replyPlaceholder,\n submitLabel: L.reply,\n pendingLabel: L.posting,\n members,\n autoFocus: true,\n onSubmit: (p) => post(p, c.id)\n }\n ) })\n ] }, c.id);\n }) }),\n error && /* @__PURE__ */ jsx(\"p\", { className: \"text-sm text-destructive\", children: error }),\n !readonly && /* @__PURE__ */ jsx(\n CommentComposer,\n {\n placeholder: L.commentPlaceholder,\n submitLabel: L.postComment,\n pendingLabel: L.posting,\n members,\n onSubmit: (p) => post(p)\n }\n )\n ] });\n}\nvar fieldClass3 = \"w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\";\nvar labelClass3 = \"text-xs font-medium uppercase tracking-wide text-muted-foreground\";\nvar priorityVariant = {\n NONE: \"muted\",\n LOW: \"muted\",\n MEDIUM: \"secondary\",\n HIGH: \"accent\",\n CRITICAL: \"destructive\"\n};\nfunction TaskDetailCore({\n id,\n readonly,\n hiddenFields,\n hideHeader,\n onUpdated,\n onDeleted,\n onError: onError2,\n resolveAssignee,\n assigneeOptions,\n linkSourceProduct,\n renderLinkIcon,\n onOpenItem,\n onAddSubtask,\n commentsEntityType,\n currentActorId,\n className\n}) {\n const client = useApolloClient();\n const L = useTaskLabels();\n const hidden = useMemo(\n () => new Set(hiddenFields ?? []),\n [hiddenFields]\n );\n const { data, loading, error } = useQuery(GET_WORK_ITEM, {\n variables: { id },\n skip: !id\n });\n const item = data?.planmagnetWorkItem ?? null;\n const { linksByItem } = useWorkItemLinks(\n item?.workspaceId,\n linkSourceProduct\n );\n const links = item ? linksByItem.get(item.id) ?? [] : [];\n const { data: parentData } = useQuery(GET_WORK_ITEM, {\n variables: { id: item?.parentId },\n skip: !item?.parentId\n });\n const parent = parentData?.planmagnetWorkItem ?? null;\n const { data: childData } = useQuery(LIST_WORK_ITEMS, {\n variables: {\n workspaceId: item?.workspaceId,\n filter: { parentId: item?.id },\n pagination: { first: 100 }\n },\n skip: !item?.id || !item?.workspaceId\n });\n const children = childData?.planmagnetWorkItems?.items ?? [];\n const [editing, setEditing] = useState(false);\n const [confirmingDelete, setConfirmingDelete] = useState(false);\n const [title, setTitle] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [type, setType] = useState(\"TASK\");\n const [status, setStatus] = useState(\"BACKLOG\");\n const [priority, setPriority] = useState(\"NONE\");\n const [assigneeId, setAssigneeId] = useState(\"\");\n const [dueDate, setDueDate] = useState(\"\");\n const [labels, setLabels] = useState(\"\");\n const [storyPoints, setStoryPoints] = useState(\"\");\n useEffect(() => {\n if (!item) return;\n setTitle(item.title);\n setDescription(item.description ?? \"\");\n setType(item.type);\n setStatus(item.status);\n setPriority(item.priority);\n setAssigneeId(item.assigneeId ?? \"\");\n setDueDate(item.dueDate ? String(item.dueDate).slice(0, 10) : \"\");\n setLabels((item.labels ?? []).join(\", \"));\n setStoryPoints(item.storyPoints != null ? String(item.storyPoints) : \"\");\n }, [item]);\n const [updateWorkItem, { loading: saving, error: saveError }] = useMutation(UPDATE_WORK_ITEM);\n const [deleteWorkItem, { loading: deleting, error: deleteError }] = useMutation(DELETE_WORK_ITEM);\n const handleDelete = async () => {\n if (!item) return;\n try {\n await deleteWorkItem({ variables: { id: item.id } });\n client.cache.evict({\n id: client.cache.identify({ __typename: \"WorkItem\", id: item.id })\n });\n client.cache.gc();\n void client.refetchQueries({ include: [LIST_WORK_ITEMS] }).catch(() => {\n });\n onDeleted?.(item.id);\n } catch (err) {\n onError2?.(err instanceof Error ? err : new Error(String(err)));\n }\n };\n const handleSave = async (e) => {\n e.preventDefault();\n if (!item) return;\n const parsedLabels = labels.split(\",\").map((l) => l.trim()).filter(Boolean);\n const parsedPoints = storyPoints.trim() ? Number(storyPoints) : void 0;\n const input = {\n title: title.trim(),\n ...hidden.has(\"description\") ? {} : { description: description.trim() },\n ...hidden.has(\"type\") ? {} : { type },\n ...hidden.has(\"status\") ? {} : { status },\n ...hidden.has(\"priority\") ? {} : { priority },\n ...hidden.has(\"assignee\") ? {} : { assigneeId: assigneeId.trim() },\n ...hidden.has(\"dueDate\") ? {} : { dueDate: toIsoDate(dueDate) },\n ...hidden.has(\"labels\") ? {} : { labels: parsedLabels },\n ...hidden.has(\"storyPoints\") || parsedPoints == null || Number.isNaN(parsedPoints) ? {} : { storyPoints: parsedPoints }\n };\n try {\n const result = await updateWorkItem({\n variables: { id: item.id, input }\n });\n const updated = result.data?.planmagnetUpdateWorkItem;\n if (updated) {\n const cfg = getPlanMagnetConfig();\n try {\n await cfg.onTaskSaved?.({\n id: updated.id,\n key: updated.key,\n title: updated.title,\n projectId: updated.projectId,\n operation: \"updated\"\n });\n } catch {\n }\n onUpdated?.(updated);\n setEditing(false);\n }\n } catch (err) {\n onError2?.(err instanceof Error ? err : new Error(String(err)));\n }\n };\n if (!id) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"TaskDetail: no work-item id provided.\" });\n }\n if (loading && !data) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"flex items-center justify-center p-12\", className), children: /* @__PURE__ */ jsx(\"div\", { className: \"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent\" }) });\n }\n if (error && !data) {\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: [\n L.errorLoading,\n \": \",\n error.message\n ] });\n }\n if (!item) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-muted-foreground\", className), children: L.taskNotFound });\n }\n const canEdit = !readonly;\n return /* @__PURE__ */ jsx(Card, { className: cn(\"shadow-sm\", className), children: /* @__PURE__ */ jsxs(CardContent, { className: \"space-y-4 p-6\", children: [\n !hideHeader && /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-start justify-between gap-4\", children: [\n /* @__PURE__ */ jsxs(\"div\", { children: [\n /* @__PURE__ */ jsx(\"p\", { className: \"text-xs text-muted-foreground\", children: item.key }),\n /* @__PURE__ */ jsx(\"h2\", { className: \"text-xl font-semibold text-foreground\", children: item.title })\n ] }),\n canEdit && !editing && /* @__PURE__ */ jsxs(\"div\", { className: \"flex shrink-0 items-center gap-2\", children: [\n onDeleted && (confirmingDelete ? /* @__PURE__ */ jsxs(\"span\", { className: \"flex items-center gap-1 text-xs\", children: [\n /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: L.deletePrompt }),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n disabled: deleting,\n onClick: handleDelete,\n className: \"rounded bg-destructive px-2 py-1 font-medium text-destructive-foreground disabled:opacity-50\",\n children: deleting ? \"\\u2026\" : L.yes\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setConfirmingDelete(false),\n className: \"rounded bg-muted px-2 py-1 text-muted-foreground\",\n children: L.no\n }\n )\n ] }) : /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setConfirmingDelete(true),\n title: L.del,\n \"aria-label\": L.del,\n className: \"rounded-md p-1.5 text-destructive hover:bg-destructive/10\",\n children: /* @__PURE__ */ jsx(Trash2, { className: \"h-4 w-4\" })\n }\n )),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setEditing(true),\n className: \"rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground\",\n children: L.edit\n }\n )\n ] })\n ] }),\n deleteError && /* @__PURE__ */ jsxs(\"p\", { className: \"text-sm text-destructive\", children: [\n L.failedToDelete,\n \": \",\n deleteError.message\n ] }),\n !editing ? /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-6\", children: [\n /* @__PURE__ */ jsxs(\"dl\", { className: \"grid grid-cols-1 gap-4 sm:grid-cols-2\", children: [\n !hidden.has(\"type\") && /* @__PURE__ */ jsx(Field, { label: L.typeLabel, children: /* @__PURE__ */ jsx(Badge, { variant: \"secondary\", children: L.type[item.type] }) }),\n !hidden.has(\"status\") && /* @__PURE__ */ jsx(Field, { label: L.statusLabel, children: /* @__PURE__ */ jsx(\"span\", { className: \"capitalize text-foreground\", children: L.status[item.status] }) }),\n !hidden.has(\"priority\") && /* @__PURE__ */ jsx(Field, { label: L.priorityLabel, children: /* @__PURE__ */ jsx(Badge, { variant: priorityVariant[item.priority], children: L.priority[item.priority] }) }),\n !hidden.has(\"assignee\") && /* @__PURE__ */ jsx(Field, { label: L.assigneeLabel, children: item.assigneeId ? /* @__PURE__ */ jsxs(\"span\", { className: \"flex items-center gap-1.5\", children: [\n /* @__PURE__ */ jsx(\n Avatar,\n {\n id: item.assigneeId,\n name: resolveAssignee?.(item.assigneeId)?.name,\n size: \"sm\"\n }\n ),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-foreground\", children: resolveAssignee?.(item.assigneeId)?.name ?? L.assigned })\n ] }) : /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: L.unassigned }) }),\n !hidden.has(\"dueDate\") && /* @__PURE__ */ jsx(Field, { label: L.dueDateLabel, children: /* @__PURE__ */ jsx(\"span\", { className: \"text-foreground\", children: formatDateFull(item.dueDate) ?? \"\\u2014\" }) }),\n !hidden.has(\"storyPoints\") && /* @__PURE__ */ jsx(Field, { label: L.storyPointsLabel, children: /* @__PURE__ */ jsx(\"span\", { className: \"text-foreground\", children: item.storyPoints ?? 0 }) }),\n !hidden.has(\"description\") && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: L.description }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 whitespace-pre-wrap text-sm text-foreground\", children: item.description || \"\\u2014\" })\n ] }),\n !hidden.has(\"labels\") && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: L.labelsLabel }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 flex flex-wrap gap-1\", children: (item.labels ?? []).length === 0 ? /* @__PURE__ */ jsx(\"span\", { className: \"text-sm text-muted-foreground\", children: \"\\u2014\" }) : item.labels.map((l) => /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground\",\n children: l\n },\n l\n )) })\n ] }),\n links.length > 0 && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: L.linkedRecordsLabel }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 flex flex-wrap gap-1.5\", children: links.map((link) => /* @__PURE__ */ jsx(\n LinkChip,\n {\n link,\n renderIcon: renderLinkIcon\n },\n link.id\n )) })\n ] }),\n parent && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: L.parentLabel }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1\", children: /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: () => onOpenItem?.(parent.id),\n className: \"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-1 text-sm text-foreground hover:bg-muted\",\n children: [\n /* @__PURE__ */ jsx(StatusIcon, { status: parent.status }),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: parent.key }),\n /* @__PURE__ */ jsx(\"span\", { className: \"truncate\", children: parent.title })\n ]\n }\n ) })\n ] }),\n (children.length > 0 || onAddSubtask && canEdit) && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-between\", children: [\n /* @__PURE__ */ jsxs(\"dt\", { className: labelClass3, children: [\n L.subtasksLabel,\n children.length > 0 ? ` (${children.length})` : \"\"\n ] }),\n onAddSubtask && canEdit && /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: () => onAddSubtask({\n id: item.id,\n projectId: item.projectId\n }),\n className: \"text-xs font-medium text-primary hover:underline\",\n children: [\n \"+ \",\n L.addSubtask\n ]\n }\n )\n ] }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 space-y-1\", children: children.length === 0 ? /* @__PURE__ */ jsx(\"span\", { className: \"text-sm text-muted-foreground\", children: \"\\u2014\" }) : children.map((c) => /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: () => onOpenItem?.(c.id),\n className: \"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm hover:bg-muted\",\n children: [\n /* @__PURE__ */ jsx(StatusIcon, { status: c.status }),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: c.key }),\n /* @__PURE__ */ jsx(\"span\", { className: \"flex-1 truncate text-foreground\", children: c.title })\n ]\n },\n c.id\n )) })\n ] }),\n (item.createdAt || item.updatedAt) && /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-wrap gap-x-6 gap-y-1 border-t border-border pt-3 text-xs text-muted-foreground sm:col-span-2\", children: [\n item.createdAt && /* @__PURE__ */ jsxs(\"span\", { children: [\n L.createdLabel,\n \" \",\n formatDateFull(item.createdAt)\n ] }),\n item.updatedAt && /* @__PURE__ */ jsxs(\"span\", { children: [\n L.updatedLabel,\n \" \",\n formatDateFull(item.updatedAt)\n ] })\n ] })\n ] }),\n commentsEntityType && /* @__PURE__ */ jsx(\"div\", { className: \"border-t border-border pt-4\", children: /* @__PURE__ */ jsx(\n TaskCommentsCore,\n {\n entityType: commentsEntityType,\n entityId: item.id,\n currentActorId,\n resolveAssignee,\n members: assigneeOptions\n }\n ) })\n ] }) : /* @__PURE__ */ jsxs(\"form\", { onSubmit: handleSave, className: \"space-y-4\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-title\", className: labelClass3, children: L.title }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-title\",\n className: fieldClass3,\n value: title,\n onChange: (e) => setTitle(e.target.value),\n required: true\n }\n )\n ] }),\n !hidden.has(\"description\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-desc\", className: labelClass3, children: L.description }),\n /* @__PURE__ */ jsx(\n \"textarea\",\n {\n id: \"pm-detail-desc\",\n className: cn(fieldClass3, \"min-h-[80px]\"),\n value: description,\n onChange: (e) => setDescription(e.target.value)\n }\n )\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"grid grid-cols-1 gap-4 sm:grid-cols-2\", children: [\n !hidden.has(\"type\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-type\", className: labelClass3, children: L.typeLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-detail-type\",\n className: cn(fieldClass3, \"capitalize\"),\n value: type,\n onChange: (e) => setType(e.target.value),\n children: TASK_TYPES.map((t) => /* @__PURE__ */ jsx(\"option\", { value: t, children: L.type[t] }, t))\n }\n )\n ] }),\n !hidden.has(\"status\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-status\", className: labelClass3, children: L.statusLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-detail-status\",\n className: cn(fieldClass3, \"capitalize\"),\n value: status,\n onChange: (e) => setStatus(e.target.value),\n children: TASK_STATUSES.map((s) => /* @__PURE__ */ jsx(\"option\", { value: s, children: L.status[s] }, s))\n }\n )\n ] }),\n !hidden.has(\"priority\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-priority\", className: labelClass3, children: L.priorityLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-detail-priority\",\n className: cn(fieldClass3, \"capitalize\"),\n value: priority,\n onChange: (e) => setPriority(e.target.value),\n children: TASK_PRIORITIES.map((p) => /* @__PURE__ */ jsx(\"option\", { value: p, children: L.priority[p] }, p))\n }\n )\n ] }),\n !hidden.has(\"assignee\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-assignee\", className: labelClass3, children: L.assigneeLabel }),\n assigneeOptions && assigneeOptions.length > 0 ? /* @__PURE__ */ jsxs(\n \"select\",\n {\n id: \"pm-detail-assignee\",\n className: fieldClass3,\n value: assigneeId,\n onChange: (e) => setAssigneeId(e.target.value),\n children: [\n /* @__PURE__ */ jsx(\"option\", { value: \"\", children: L.unassigned }),\n assigneeOptions.map((o) => /* @__PURE__ */ jsx(\"option\", { value: o.id, children: o.name }, o.id))\n ]\n }\n ) : /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-assignee\",\n className: fieldClass3,\n value: assigneeId,\n onChange: (e) => setAssigneeId(e.target.value),\n placeholder: L.assigneePlaceholder\n }\n )\n ] }),\n !hidden.has(\"dueDate\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-due\", className: labelClass3, children: L.dueDateLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-due\",\n type: \"date\",\n className: fieldClass3,\n value: dueDate,\n onChange: (e) => setDueDate(e.target.value)\n }\n )\n ] }),\n !hidden.has(\"storyPoints\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-points\", className: labelClass3, children: L.storyPointsLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-points\",\n type: \"number\",\n min: 0,\n className: fieldClass3,\n value: storyPoints,\n onChange: (e) => setStoryPoints(e.target.value)\n }\n )\n ] })\n ] }),\n !hidden.has(\"labels\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-labels\", className: labelClass3, children: L.labelsLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-labels\",\n className: fieldClass3,\n value: labels,\n onChange: (e) => setLabels(e.target.value),\n placeholder: L.labelsPlaceholder\n }\n )\n ] }),\n saveError && /* @__PURE__ */ jsxs(\"p\", { className: \"text-sm text-destructive\", children: [\n L.failedToSave,\n \": \",\n saveError.message\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-end gap-2\", children: [\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setEditing(false),\n className: \"rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70\",\n children: L.cancel\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"submit\",\n disabled: saving || !title.trim(),\n className: cn(\n \"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground\",\n (saving || !title.trim()) && \"cursor-not-allowed opacity-50\"\n ),\n children: saving ? L.saving : L.save\n }\n )\n ] })\n ] })\n ] }) });\n}\nfunction Field({ label, children }) {\n return /* @__PURE__ */ jsxs(\"div\", { children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: label }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 text-sm\", children })\n ] });\n}\nfunction TaskDetail({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(TaskDetailCore, { ...coreProps })\n }\n );\n}\nfunction TasksPageCore({\n workspaceId: workspaceIdProp,\n projectId,\n boardProjectId,\n columns,\n readonly,\n hiddenFields,\n views,\n defaultView = \"board\",\n confirmMove,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n assigneeOptions,\n currentActorId,\n commentsEntityType,\n labels,\n openItemId,\n header,\n onTaskSaved,\n createSurface = \"modal\",\n detailSurface = \"drawer\",\n className\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const client = useApolloClient();\n const mergedLabels = mergeTaskLabels(labels);\n const [view, setView] = useState(defaultView);\n const [search, setSearch] = useState(\"\");\n const [priority, setPriority] = useState(\"ALL\");\n const [type, setType] = useState(\"ALL\");\n const [mine, setMine] = useState(false);\n const [creating, setCreating] = useState(false);\n const [selectedId, setSelectedId] = useState(null);\n const [createDefaults, setCreateDefaults] = useState(null);\n useEffect(() => {\n if (openItemId) setSelectedId(openItemId);\n }, [openItemId]);\n const refetchBoard = useCallback(() => {\n void client.refetchQueries({ include: [LIST_WORK_ITEMS] }).catch(() => {\n });\n }, [client]);\n const handleCreated = useCallback(\n (workItem) => {\n refetchBoard();\n setCreating(false);\n setCreateDefaults(null);\n onTaskSaved?.({ workItem, operation: \"created\" });\n },\n [refetchBoard, onTaskSaved]\n );\n const handleAddSubtask = useCallback(\n (parent) => {\n setSelectedId(null);\n setCreateDefaults({\n parentId: parent.id,\n projectId: parent.projectId,\n type: \"SUB_TASK\"\n });\n setCreating(true);\n },\n []\n );\n const startCreate = useCallback(() => {\n setCreateDefaults(null);\n setCreating(true);\n }, []);\n const cancelCreate = useCallback(() => {\n setCreating(false);\n setCreateDefaults(null);\n }, []);\n const handleUpdated = useCallback(\n (workItem) => {\n refetchBoard();\n onTaskSaved?.({ workItem, operation: \"updated\" });\n },\n [refetchBoard, onTaskSaved]\n );\n const handleDeleted = useCallback(() => {\n setSelectedId(null);\n }, []);\n const handleTaskClick = useCallback((task) => {\n setSelectedId(task.id);\n }, []);\n const handleSelect = useCallback((id) => setSelectedId(id), []);\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"TasksPage: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n const canCreate = !readonly && Boolean(projectId);\n const showInlineCreate = creating && createSurface === \"inline\";\n const showInlineDetail = selectedId != null && detailSurface === \"inline\";\n const createForm = /* @__PURE__ */ jsx(\n CreateTaskCore,\n {\n workspaceId,\n projectId,\n assigneeOptions,\n hiddenFields,\n defaultValues: createDefaults ?? void 0,\n onCreated: handleCreated,\n onCancel: cancelCreate\n }\n );\n const detailView = selectedId != null ? /* @__PURE__ */ jsx(\n TaskDetailCore,\n {\n id: selectedId,\n readonly,\n hiddenFields,\n resolveAssignee,\n assigneeOptions,\n linkSourceProduct,\n renderLinkIcon,\n onUpdated: handleUpdated,\n onDeleted: handleDeleted,\n onOpenItem: handleSelect,\n onAddSubtask: handleAddSubtask,\n commentsEntityType,\n currentActorId\n }\n ) : null;\n const listPriority = priority === \"ALL\" ? void 0 : priority;\n const listType = type === \"ALL\" ? void 0 : type;\n const mineAssignee = mine && currentActorId ? currentActorId : void 0;\n const listColumns = linkSourceProduct ? [\n \"title\",\n \"status\",\n \"priority\",\n \"assignee\",\n \"dueDate\",\n \"linkedRecord\"\n ] : void 0;\n return /* @__PURE__ */ jsx(TaskLabelsProvider, { value: mergedLabels, children: /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-4 p-6\", className), children: [\n header && /* @__PURE__ */ jsx(\"div\", { className: \"min-w-0\", children: typeof header === \"string\" ? /* @__PURE__ */ jsx(\"h1\", { className: \"truncate text-2xl font-semibold text-foreground\", children: header }) : header }),\n /* @__PURE__ */ jsx(\n TaskToolbar,\n {\n view,\n onViewChange: setView,\n views,\n search,\n onSearchChange: setSearch,\n priority,\n onPriorityChange: setPriority,\n type,\n onTypeChange: setType,\n onNewTask: startCreate,\n canCreate,\n mine,\n onMineChange: currentActorId ? setMine : void 0\n }\n ),\n showInlineCreate && /* @__PURE__ */ jsx(\"div\", { children: createForm }),\n view === \"board\" && /* @__PURE__ */ jsx(\n TaskBoardCore,\n {\n workspaceId,\n projectId: boardProjectId,\n columns,\n readonly,\n confirmMove,\n hideHeader: true,\n priority,\n type,\n search,\n assigneeId: mineAssignee,\n hiddenFields,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n onTaskClick: handleTaskClick\n }\n ),\n view === \"list\" && /* @__PURE__ */ jsx(\n TaskListCore,\n {\n workspaceId,\n projectId: boardProjectId,\n priority: listPriority,\n type: listType,\n search: search || void 0,\n assigneeId: mineAssignee,\n hideHeader: true,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n columns: listColumns ? [...listColumns] : void 0,\n onSelect: handleSelect\n }\n ),\n view === \"timeline\" && /* @__PURE__ */ jsx(\n TaskTimelineCore,\n {\n workspaceId,\n projectId: boardProjectId,\n priority,\n type,\n search,\n assigneeId: mineAssignee,\n resolveAssignee,\n onSelect: handleSelect\n }\n ),\n showInlineDetail && /* @__PURE__ */ jsx(\"div\", { className: \"pb-6\", children: detailView }),\n createSurface === \"modal\" && /* @__PURE__ */ jsx(\n Modal,\n {\n open: creating,\n onClose: cancelCreate,\n ariaLabel: \"Create task\",\n className: \"max-w-xl\",\n children: /* @__PURE__ */ jsx(\"div\", { className: \"p-2 pt-8\", children: createForm })\n }\n ),\n detailSurface === \"drawer\" && /* @__PURE__ */ jsx(\n Drawer,\n {\n open: selectedId != null,\n onClose: () => setSelectedId(null),\n ariaLabel: \"Task detail\",\n children: /* @__PURE__ */ jsx(\"div\", { className: \"p-2 pt-8\", children: detailView })\n }\n )\n ] }) });\n}\nfunction TasksPage({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(TasksPageCore, { workspaceId, ...coreProps })\n }\n );\n}\n\nexport { Avatar, Badge, CREATE_WORK_ITEM, CREATE_WORK_ITEM_LINK, CreateTask, CreateTaskCore, DEFAULT_BOARD_COLUMNS, DEFAULT_TASK_LABELS, DELETE_WORK_ITEM, DELETE_WORK_ITEM_LINK, Drawer, GET_PROJECTS, GET_WORK_ITEM, LIST_MILESTONES, LIST_WORK_ITEMS, LIST_WORK_ITEM_LINKS, LinkChip, MILESTONE_FIELDS, MOVE_WORK_ITEM, Modal, PRIORITY_META, PROJECT_SUMMARY_FIELDS, PlanMagnetProvider, PriorityIndicator, STATUS_META, StatusIcon, StatusPill, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, TaskBoard, TaskBoardCore, TaskCard, TaskCommentsCore, TaskDetail, TaskDetailCore, TaskLabelsProvider, TaskList, TaskListCore, TaskTimelineCore, TaskToolbar, TasksPage, TasksPageCore, TypeBadge, UPDATE_WORK_ITEM, WORK_ITEM_FIELDS, WORK_ITEM_LINK_FIELDS, WORK_ITEM_SUMMARY_FIELDS, badgeVariants, cn, config, createPlanMagnetClient, enumLabel, getGraphQLEndpoint, getPlanMagnetClient, getPlanMagnetClientSafe, getPlanMagnetConfig, isPlanMagnetClientReady, mergeTaskLabels, resetPlanMagnetClient, resetPlanMagnetConfig, setPlanMagnetClient, setPlanMagnetConfig, useMilestones, usePlanMagnetContext, usePlanMagnetContextSafe, useTaskLabels, useWorkItemLinks, validateTrustedOrigin, wa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,CAAC;IAC7M,kBACd,IACA;KACE;KACA,cAAc;KACd;KACA;KACA,gBAAgB;KAChB;KACA,kBAAkB;KAClB;KACA,cAAc;KACd,WAAW;KACX;KACA;KACA,cAAc,IAAiB,IAAU,KAAK;KAC/C,CACF;IACD,MAAoC,kBAAI,OAAO,EAAE,UAAU,IAAY,CAAC;IACxE,MAAS,WAA2B,kBAClC,IACA;KACE;KACA,WAAW;KACX;KACA;KACA;KACA,YAAY;KACZ;KACA;KACA;KACA,YAAY;KACZ;KACA;KACA;KACA;KACA,aAAa;KACd,CACF;IACD,MAAS,UAA0B,kBACjC,IACA;KACE;KACA,WAAW;KACX,UAAU;KACV,MAAM;KACN,QAAQ,KAAU,KAAK;KACvB,YAAY;KACZ,YAAY;KACZ;KACA;KACA;KACA,SAAS,KAAc,CAAC,GAAG,GAAY,GAAG,KAAK;KAC/C,UAAU;KACX,CACF;IACD,MAAS,cAA8B,kBACrC,IACA;KACE;KACA,WAAW;KACX;KACA;KACA;KACA,YAAY;KACZ;KACA,UAAU;KACX,CACF;IACD,MAAoC,kBAAI,OAAO;KAAE,WAAW;KAAQ,UAAU;KAAY,CAAC;IAC3F,MAAkB,WAA2B,kBAC3C,IACA;KACE,MAAM;KACN,SAAS;KACT,WAAW;KACX,WAAW;KACX,UAA0B,kBAAI,OAAO;MAAE,WAAW;MAAY,UAAU;MAAY,CAAC;KACtF,CACF;IACD,MAAkB,YAA4B,kBAC5C,IACA;KACE,MAAM,KAAc;KACpB,eAAe,EAAc,KAAK;KAClC,WAAW;KACX,UAA0B,kBAAI,OAAO;MAAE,WAAW;MAAY,UAAU;MAAY,CAAC;KACtF,CACF;IACF;GAAE,CAAC;EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Badge"],"sources":["../../../../../node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js"],"sourcesContent":["import { createContext, useMemo, useEffect, useContext, useState, useCallback, useRef } from 'react';\nimport { ApolloProvider, useQuery, useApolloClient, useMutation } from '@apollo/client/react';\nimport { createHttpLink, ApolloClient, from, InMemoryCache } from '@apollo/client/core';\nimport { setContext } from '@apollo/client/link/context';\nimport { onError } from '@apollo/client/link/error';\nimport { CombinedGraphQLErrors } from '@apollo/client/errors';\nimport { jsx, jsxs } from 'react/jsx-runtime';\nimport { gql } from '@apollo/client';\nimport { CircleX, CircleCheckBig, CircleDotDashed, CircleDot, Circle, CircleDashed, User, Link2, CalendarDays, ChevronUp, ChevronDown, ChevronLeft, ChevronRight, Flag, CalendarRange, List, LayoutGrid, Search, Plus, Trash2 } from 'lucide-react';\nimport { clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\nimport { addWeeks, startOfWeek, endOfWeek, eachDayOfInterval, addMonths, startOfMonth, endOfMonth, format, isToday, isSameMonth, startOfDay, parseISO, isValid } from 'date-fns';\nimport { cva } from 'class-variance-authority';\nimport { Card, CardContent } from '@burdenoff/fe-libs/ui';\n\nvar clientInstance = null;\nfunction buildCache() {\n return new InMemoryCache({\n typePolicies: {\n Query: {\n fields: {\n planmagnetWorkItems: { merge: false },\n planmagnetProjects: { merge: false },\n planmagnetWorkItemLinks: { merge: false }\n }\n },\n WorkItem: { keyFields: [\"id\"] },\n PlanmagnetProject: { keyFields: [\"id\"] },\n Project: { keyFields: [\"id\"] },\n WorkItemLink: { keyFields: [\"id\"] }\n }\n });\n}\nfunction createPlanMagnetClient(config2) {\n const graphqlUrl = getGraphQLUrl(config2.apiGatewayUrl);\n const httpLink = createHttpLink({ uri: graphqlUrl });\n const authLink = setContext((_, { headers }) => ({\n headers: {\n ...headers,\n ...config2.authToken && {\n authorization: `Bearer ${config2.authToken}`\n },\n ...config2.workspaceToken && {\n \"x-workspace-authorization\": `Bearer ${config2.workspaceToken}`\n },\n \"x-workspace-id\": config2.workspaceId,\n ...config2.tenantId && { \"x-tenant-id\": config2.tenantId }\n }\n }));\n const errorLink = onError(({ error }) => {\n if (!config2.onAuthError) return;\n if (CombinedGraphQLErrors.is(error)) {\n for (const graphQLError of error.errors) {\n const code = graphQLError.extensions?.code;\n if (code === \"UNAUTHENTICATED\" || code === \"FORBIDDEN\") {\n config2.onAuthError();\n return;\n }\n }\n } else if (error) {\n const msg = error.message ?? \"\";\n if (msg.includes(\"401\") || msg.includes(\"403\") || msg.includes(\"Unauthorized\")) {\n config2.onAuthError();\n }\n }\n });\n return new ApolloClient({\n link: from([errorLink, authLink, httpLink]),\n cache: buildCache(),\n defaultOptions: {\n watchQuery: { fetchPolicy: \"cache-and-network\" },\n query: { fetchPolicy: \"network-only\" }\n }\n });\n}\nfunction getGraphQLUrl(apiGatewayUrl) {\n const normalizedBase = apiGatewayUrl.endsWith(\"/\") ? apiGatewayUrl.slice(0, -1) : apiGatewayUrl;\n if (normalizedBase.endsWith(\"/graphql\")) {\n return normalizedBase;\n }\n return `${normalizedBase}/workspaces/graphql`;\n}\nfunction setPlanMagnetClient(client) {\n clientInstance = client;\n}\nfunction getPlanMagnetClient() {\n if (!clientInstance) {\n throw new Error(\n \"PlanMagnet client not initialized. Use PlanMagnetProvider or call setPlanMagnetClient().\"\n );\n }\n return clientInstance;\n}\nfunction getPlanMagnetClientSafe() {\n return clientInstance;\n}\nfunction isPlanMagnetClientReady() {\n return clientInstance !== null;\n}\nfunction waitForPlanMagnetClient(timeoutMs = 1e4, intervalMs = 100) {\n return new Promise((resolve) => {\n if (clientInstance) {\n resolve(clientInstance);\n return;\n }\n const start = Date.now();\n const timer = setInterval(() => {\n if (clientInstance) {\n clearInterval(timer);\n resolve(clientInstance);\n } else if (Date.now() - start >= timeoutMs) {\n clearInterval(timer);\n resolve(null);\n }\n }, intervalMs);\n });\n}\nfunction resetPlanMagnetClient() {\n clientInstance = null;\n}\n\n// src/config/index.ts\nvar runtimeConfig = {\n apiGatewayUrl: \"\",\n workspaceId: \"\"\n};\nvar config = new Proxy({}, {\n get(_, prop) {\n return runtimeConfig[prop];\n }\n});\nfunction getPlanMagnetConfig() {\n return { ...runtimeConfig };\n}\nfunction setPlanMagnetConfig(newConfig) {\n runtimeConfig = { ...runtimeConfig, ...newConfig };\n}\nfunction resetPlanMagnetConfig() {\n runtimeConfig = {\n apiGatewayUrl: \"\",\n workspaceId: \"\"\n };\n}\nfunction normalizeOrigin(origin) {\n return origin.replace(/\\/$/, \"\");\n}\nfunction validateTrustedOrigin(trustedOrigins) {\n if (typeof window === \"undefined\" || !trustedOrigins?.length) {\n return;\n }\n const currentOrigin = normalizeOrigin(window.location.origin);\n const allowedOrigins = trustedOrigins.map(normalizeOrigin);\n if (!allowedOrigins.includes(currentOrigin)) {\n throw new Error(\n `PlanMagnet SDK blocked untrusted origin: ${currentOrigin}`\n );\n }\n}\nfunction getGraphQLEndpoint(baseUrl) {\n const url = baseUrl || runtimeConfig.apiGatewayUrl;\n if (!url) {\n throw new Error(\"PlanMagnet SDK requires apiGatewayUrl to be configured\");\n }\n const normalizedBase = url.endsWith(\"/\") ? url.slice(0, -1) : url;\n if (normalizedBase.endsWith(\"/graphql\")) {\n return normalizedBase;\n }\n return `${normalizedBase}/workspaces/graphql`;\n}\nvar PlanMagnetContext = createContext(null);\nfunction PlanMagnetProvider({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient: externalWorkspaceClient,\n apolloClient: legacyClient,\n children\n}) {\n validateTrustedOrigin(trustedOrigins);\n const workspaceClient = useMemo(() => {\n if (externalWorkspaceClient) return externalWorkspaceClient;\n if (legacyClient) return legacyClient;\n if (apiGatewayUrl) {\n return createPlanMagnetClient({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n onAuthError\n });\n }\n throw new Error(\n \"PlanMagnetProvider: Either provide workspaceClient or apiGatewayUrl\"\n );\n }, [\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n onAuthError,\n externalWorkspaceClient,\n legacyClient\n ]);\n useEffect(() => {\n setPlanMagnetClient(workspaceClient);\n return () => {\n resetPlanMagnetClient();\n };\n }, [workspaceClient]);\n useEffect(() => {\n setPlanMagnetConfig({\n apiGatewayUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins\n });\n return () => {\n resetPlanMagnetConfig();\n };\n }, [\n apiGatewayUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins\n ]);\n const contextValue = useMemo(\n () => ({\n apiGatewayUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n workspaceClient\n }),\n [\n apiGatewayUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n workspaceClient\n ]\n );\n return /* @__PURE__ */ jsx(PlanMagnetContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ApolloProvider, { client: workspaceClient, children }) });\n}\nfunction usePlanMagnetContext() {\n const context = useContext(PlanMagnetContext);\n if (!context) {\n throw new Error(\n \"usePlanMagnetContext must be used within PlanMagnetProvider\"\n );\n }\n return context;\n}\nfunction usePlanMagnetContextSafe() {\n return useContext(PlanMagnetContext);\n}\nvar WORK_ITEM_SUMMARY_FIELDS = gql`\n fragment WorkItemSummaryFields on WorkItem {\n id\n key\n title\n type\n status\n priority\n assigneeId\n sprintId\n storyPoints\n dueDate\n labels\n }\n`;\nvar WORK_ITEM_FIELDS = gql`\n fragment WorkItemFields on WorkItem {\n id\n workspaceId\n projectId\n key\n title\n description\n type\n status\n priority\n assigneeId\n reporterId\n parentId\n sprintId\n storyPoints\n estimateMinutes\n timeSpentMinutes\n dueDate\n labels\n tags\n sortOrder\n metadata\n createdBy\n createdAt\n updatedAt\n updatedBy\n deletedAt\n }\n`;\nvar PROJECT_SUMMARY_FIELDS = gql`\n fragment ProjectSummaryFields on Project {\n id\n name\n key\n status\n methodology\n ownerId\n startDate\n endDate\n tags\n }\n`;\nvar LIST_WORK_ITEMS = gql`\n query ListWorkItems(\n $workspaceId: ID!\n $filter: PlanmagnetWorkItemFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetWorkItems(\n workspaceId: $workspaceId\n filter: $filter\n pagination: $pagination\n ) {\n items {\n ...WorkItemSummaryFields\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n totalCount\n }\n totalCount\n }\n }\n ${WORK_ITEM_SUMMARY_FIELDS}\n`;\nvar GET_WORK_ITEM = gql`\n query GetWorkItem($id: ID!) {\n planmagnetWorkItem(id: $id) {\n ...WorkItemFields\n }\n }\n ${WORK_ITEM_FIELDS}\n`;\nvar GET_PROJECTS = gql`\n query GetProjects(\n $workspaceId: ID!\n $filter: PlanmagnetProjectFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetProjects(\n workspaceId: $workspaceId\n filter: $filter\n pagination: $pagination\n ) {\n items {\n ...ProjectSummaryFields\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n totalCount\n }\n totalCount\n }\n }\n ${PROJECT_SUMMARY_FIELDS}\n`;\nvar CREATE_WORK_ITEM = gql`\n mutation CreateWorkItem($input: PlanmagnetCreateWorkItemInput!) {\n planmagnetCreateWorkItem(input: $input) {\n ...WorkItemFields\n }\n }\n ${WORK_ITEM_FIELDS}\n`;\nvar UPDATE_WORK_ITEM = gql`\n mutation UpdateWorkItem($id: ID!, $input: PlanmagnetUpdateWorkItemInput!) {\n planmagnetUpdateWorkItem(id: $id, input: $input) {\n ...WorkItemFields\n }\n }\n ${WORK_ITEM_FIELDS}\n`;\nvar MOVE_WORK_ITEM = gql`\n mutation MoveWorkItem($id: ID!, $input: PlanmagnetMoveWorkItemInput!) {\n planmagnetMoveWorkItem(id: $id, input: $input) {\n ...WorkItemFields\n }\n }\n ${WORK_ITEM_FIELDS}\n`;\nvar WORK_ITEM_LINK_FIELDS = gql`\n fragment WorkItemLinkFields on WorkItemLink {\n id\n workspaceId\n workItemId\n sourceProduct\n entityType\n entityId\n relationType\n displayNameSnapshot\n deepLinkSnapshot\n metadata\n createdBy\n onBehalfOf\n createdAt\n updatedAt\n }\n`;\nvar LIST_WORK_ITEM_LINKS = gql`\n query ListWorkItemLinks(\n $workspaceId: ID!\n $filter: PlanmagnetWorkItemLinkFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetWorkItemLinks(\n workspaceId: $workspaceId\n filter: $filter\n pagination: $pagination\n ) {\n items {\n ...WorkItemLinkFields\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n totalCount\n }\n totalCount\n }\n }\n ${WORK_ITEM_LINK_FIELDS}\n`;\nvar CREATE_WORK_ITEM_LINK = gql`\n mutation CreateWorkItemLink($input: PlanmagnetCreateWorkItemLinkInput!) {\n planmagnetLinkWorkItem(input: $input) {\n ...WorkItemLinkFields\n }\n }\n ${WORK_ITEM_LINK_FIELDS}\n`;\nvar DELETE_WORK_ITEM_LINK = gql`\n mutation UnlinkWorkItem($id: ID!) {\n planmagnetUnlinkWorkItem(id: $id)\n }\n`;\nvar MILESTONE_FIELDS = gql`\n fragment MilestoneFields on Milestone {\n id\n projectId\n name\n description\n status\n dueDate\n completedAt\n ownerId\n createdAt\n updatedAt\n }\n`;\nvar LIST_MILESTONES = gql`\n query ListMilestones(\n $workspaceId: ID!\n $filter: PlanmagnetMilestoneFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetMilestones(\n workspaceId: $workspaceId\n filter: $filter\n pagination: $pagination\n ) {\n items {\n ...MilestoneFields\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n totalCount\n }\n totalCount\n }\n }\n ${MILESTONE_FIELDS}\n`;\nvar DELETE_WORK_ITEM = gql`\n mutation DeleteWorkItem($id: ID!) {\n planmagnetDeleteWorkItem(id: $id)\n }\n`;\nvar ENTITY_COMMENT_FIELDS = gql`\n fragment EntityCommentFields on EntityComment {\n id\n authorId\n authorType\n content {\n text\n }\n createdAt\n edited\n editedAt\n status\n parentCommentId\n threadRootId\n threadLevel\n mentions {\n mentionedUserId\n }\n }\n`;\nvar GET_ENTITY_COMMENTS = gql`\n query GetEntityComments($input: GetCommentsInput!) {\n getEntityComments(input: $input) {\n items {\n ...EntityCommentFields\n }\n total\n }\n }\n ${ENTITY_COMMENT_FIELDS}\n`;\nvar CREATE_ENTITY_COMMENT = gql`\n mutation CreateEntityComment($input: CreateEntityCommentInput!) {\n createEntityComment(input: $input) {\n ...EntityCommentFields\n }\n }\n ${ENTITY_COMMENT_FIELDS}\n`;\nvar DELETE_ENTITY_COMMENT = gql`\n mutation DeleteEntityComment($input: DeleteCommentInput!) {\n deleteEntityComment(input: $input)\n }\n`;\nfunction cn(...inputs) {\n return twMerge(clsx(inputs));\n}\nvar CLOSED_STATUSES = /* @__PURE__ */ new Set([\"DONE\", \"CANCELLED\"]);\nfunction parseDate(iso) {\n if (!iso) return null;\n const d = parseISO(iso);\n return isValid(d) ? d : null;\n}\nfunction toIsoDate(value) {\n if (!value) return void 0;\n const iso = /^\\d{4}-\\d{2}-\\d{2}$/.test(value) ? `${value}T00:00:00.000Z` : value;\n const d = new Date(iso);\n return Number.isNaN(d.getTime()) ? void 0 : d.toISOString();\n}\nfunction formatDueDate(iso) {\n const d = parseDate(iso);\n if (!d) return null;\n const now = /* @__PURE__ */ new Date();\n return format(\n d,\n d.getFullYear() === now.getFullYear() ? \"MMM d\" : \"MMM d yyyy\"\n );\n}\nfunction formatDateFull(iso) {\n const d = parseDate(iso);\n return d ? format(d, \"MMM d, yyyy\") : null;\n}\nfunction isOverdue(iso, status) {\n const d = parseDate(iso);\n if (!d) return false;\n if (status && CLOSED_STATUSES.has(status)) return false;\n return startOfDay(d).getTime() < startOfDay(/* @__PURE__ */ new Date()).getTime();\n}\nvar badgeVariants = cva(\n \"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize transition-colors\",\n {\n variants: {\n variant: {\n default: \"bg-primary/10 text-primary\",\n muted: \"bg-muted text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n accent: \"bg-accent text-accent-foreground\",\n destructive: \"bg-destructive/15 text-destructive\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nfunction Badge({ className, variant, ...props }) {\n return /* @__PURE__ */ jsx(\"span\", { className: cn(badgeVariants({ variant }), className), ...props });\n}\nvar TINTS = [\n \"bg-primary/15 text-primary\",\n \"bg-secondary text-secondary-foreground\",\n \"bg-accent text-accent-foreground\",\n \"bg-muted text-muted-foreground\",\n \"bg-destructive/15 text-destructive\"\n];\nvar SIZES = {\n sm: \"h-5 w-5 text-[9px]\",\n md: \"h-6 w-6 text-[10px]\",\n lg: \"h-8 w-8 text-xs\"\n};\nfunction tintIndex(seed) {\n let h = 0;\n for (let i = 0; i < seed.length; i++) {\n h = h * 31 + seed.charCodeAt(i) >>> 0;\n }\n return h % TINTS.length;\n}\nfunction initials(name, id) {\n const source = (name ?? \"\").trim();\n if (source) {\n const parts = source.split(/\\s+/);\n const first = parts[0]?.[0] ?? \"\";\n const second = parts.length > 1 ? parts[parts.length - 1]?.[0] ?? \"\" : \"\";\n return (first + second).toUpperCase() || \"?\";\n }\n const raw = (id ?? \"\").replace(/[^a-zA-Z0-9]/g, \"\");\n return raw.slice(0, 2).toUpperCase() || \"?\";\n}\nfunction Avatar({ id, name, size = \"md\", className }) {\n if (!id && !name) {\n return /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"inline-flex items-center justify-center rounded-full border border-dashed border-border text-muted-foreground\",\n SIZES[size],\n className\n ),\n title: \"Unassigned\",\n \"aria-label\": \"Unassigned\",\n children: /* @__PURE__ */ jsx(User, { className: \"h-1/2 w-1/2\", \"aria-hidden\": \"true\" })\n }\n );\n }\n const tint = TINTS[tintIndex(name || id || \"\")];\n return /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"inline-flex items-center justify-center rounded-full font-medium\",\n SIZES[size],\n tint,\n className\n ),\n title: name ?? id ?? void 0,\n \"aria-label\": name ?? id ?? void 0,\n children: initials(name, id)\n }\n );\n}\n\n// src/types/index.ts\nvar DEFAULT_BOARD_COLUMNS = [\n { status: \"BACKLOG\", label: \"Backlog\" },\n { status: \"TODO\", label: \"To Do\" },\n { status: \"IN_PROGRESS\", label: \"In Progress\" },\n { status: \"IN_REVIEW\", label: \"In Review\" },\n { status: \"TESTING\", label: \"Testing\" },\n { status: \"DONE\", label: \"Done\" },\n { status: \"CANCELLED\", label: \"Cancelled\" }\n];\nvar TASK_PRIORITIES = [\n \"NONE\",\n \"LOW\",\n \"MEDIUM\",\n \"HIGH\",\n \"CRITICAL\"\n];\nvar TASK_TYPES = [\n \"TASK\",\n \"STORY\",\n \"BUG\",\n \"EPIC\",\n \"SUB_TASK\"\n];\nvar TASK_STATUSES = [\n \"BACKLOG\",\n \"TODO\",\n \"IN_PROGRESS\",\n \"IN_REVIEW\",\n \"TESTING\",\n \"DONE\",\n \"CANCELLED\"\n];\nfunction enumLabel(value) {\n return value.toLowerCase().replace(/_/g, \" \");\n}\nfunction LinkChip({ link, renderIcon, className }) {\n const label = link.displayNameSnapshot || enumLabel(link.entityType);\n const icon = renderIcon?.(link.entityType) ?? /* @__PURE__ */ jsx(Link2, { className: \"h-3 w-3 shrink-0\", \"aria-hidden\": \"true\" });\n const body = /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\n \"inline-flex max-w-full items-center gap-1 rounded-full border border-primary/20 bg-primary/5 px-1.5 py-0.5 text-[10px] font-medium text-primary\",\n className\n ),\n title: `${enumLabel(link.relationType)} \\xB7 ${enumLabel(link.entityType)}`,\n children: [\n icon,\n /* @__PURE__ */ jsx(\"span\", { className: \"truncate\", children: label })\n ]\n }\n );\n if (link.deepLinkSnapshot) {\n return /* @__PURE__ */ jsx(\n \"a\",\n {\n href: link.deepLinkSnapshot,\n onClick: (e) => e.stopPropagation(),\n className: \"inline-flex max-w-full no-underline hover:brightness-95\",\n children: body\n }\n );\n }\n return body;\n}\nvar DEFAULT_TASK_LABELS = {\n board: \"Board\",\n list: \"List\",\n timeline: \"Timeline\",\n searchPlaceholder: \"Search tasks\\u2026\",\n allPriorities: \"All priorities\",\n allTypes: \"All types\",\n newTask: \"New task\",\n myTasks: \"My tasks\",\n noTasks: \"No tasks\",\n noTasksFound: \"No tasks found.\",\n dropHere: \"Drop here\",\n moveConfirmTitle: \"Move task?\",\n moveConfirmPrompt: 'Move \"{task}\" to {status}?',\n moveConfirm: \"Move\",\n unassigned: \"Unassigned\",\n assigned: \"Assigned\",\n overdue: \"{n} overdue\",\n noDueDate: \"No due date ({n})\",\n milestones: \"Milestones\",\n today: \"Today\",\n week: \"Week\",\n month: \"Month\",\n tasksSingular: \"task\",\n tasksPlural: \"tasks\",\n colTask: \"Task\",\n colStatus: \"Status\",\n colPriority: \"Priority\",\n colAssignee: \"Assignee\",\n colDueDate: \"Due Date\",\n colPoints: \"Points\",\n colLinkedRecord: \"Linked Record\",\n colType: \"Type\",\n colKey: \"Key\",\n colLabels: \"Labels\",\n newTaskHeading: \"New task\",\n newTaskSubtitle: \"Create a work item in this workspace.\",\n title: \"Title\",\n titlePlaceholder: \"What needs doing?\",\n description: \"Description\",\n descriptionPlaceholder: \"Add more detail (optional)\",\n typeLabel: \"Type\",\n statusLabel: \"Status\",\n priorityLabel: \"Priority\",\n assigneeLabel: \"Assignee\",\n assigneePlaceholder: \"Actor ID (optional)\",\n dueDateLabel: \"Due date\",\n storyPointsLabel: \"Story points\",\n labelsLabel: \"Labels\",\n labelsPlaceholder: \"comma, separated, labels\",\n linkedRecordsLabel: \"Linked records\",\n createdLabel: \"Created\",\n updatedLabel: \"Updated\",\n parentLabel: \"Parent\",\n subtasksLabel: \"Sub-tasks\",\n addSubtask: \"Add sub-task\",\n commentsLabel: \"Comments\",\n commentPlaceholder: \"Write a comment\\u2026\",\n postComment: \"Comment\",\n posting: \"Posting\\u2026\",\n noComments: \"No comments yet\",\n you: \"You\",\n editedTag: \"(edited)\",\n failedToComment: \"Failed to post comment\",\n failedToDeleteComment: \"Failed to delete comment\",\n reply: \"Reply\",\n replyPlaceholder: \"Write a reply\\u2026\",\n repliesCount: \"{n} replies\",\n create: \"Create task\",\n creating: \"Creating\\u2026\",\n cancel: \"Cancel\",\n edit: \"Edit\",\n del: \"Delete\",\n deletePrompt: \"Delete?\",\n yes: \"Yes\",\n no: \"No\",\n save: \"Save changes\",\n saving: \"Saving\\u2026\",\n taskNotFound: \"Task not found.\",\n projectRequired: \"A projectId is required to create a task.\",\n errorLoading: \"Error loading tasks\",\n moveFailed: \"Couldn't move the task. Please try again.\",\n failedToCreate: \"Failed to create task\",\n failedToSave: \"Failed to save\",\n failedToDelete: \"Failed to delete\",\n overdueLabel: \"Overdue\",\n more: \"more\",\n status: {\n BACKLOG: \"Backlog\",\n TODO: \"To Do\",\n IN_PROGRESS: \"In Progress\",\n IN_REVIEW: \"In Review\",\n TESTING: \"Testing\",\n DONE: \"Done\",\n CANCELLED: \"Cancelled\"\n },\n priority: {\n NONE: \"None\",\n LOW: \"Low\",\n MEDIUM: \"Medium\",\n HIGH: \"High\",\n CRITICAL: \"Critical\"\n },\n type: {\n TASK: \"Task\",\n STORY: \"Story\",\n BUG: \"Bug\",\n EPIC: \"Epic\",\n SUB_TASK: \"Sub Task\"\n }\n};\nvar TaskLabelsContext = createContext(DEFAULT_TASK_LABELS);\nvar TaskLabelsProvider = TaskLabelsContext.Provider;\nfunction useTaskLabels() {\n return useContext(TaskLabelsContext);\n}\nfunction mergeTaskLabels(overrides) {\n if (!overrides) return DEFAULT_TASK_LABELS;\n return {\n ...DEFAULT_TASK_LABELS,\n ...overrides,\n status: { ...DEFAULT_TASK_LABELS.status, ...overrides.status },\n priority: { ...DEFAULT_TASK_LABELS.priority, ...overrides.priority },\n type: { ...DEFAULT_TASK_LABELS.type, ...overrides.type }\n };\n}\nvar STATUS_META = {\n BACKLOG: { icon: CircleDashed, tone: \"text-muted-foreground/60\" },\n TODO: { icon: Circle, tone: \"text-muted-foreground\" },\n IN_PROGRESS: { icon: CircleDot, tone: \"text-primary\" },\n IN_REVIEW: { icon: CircleDotDashed, tone: \"text-accent-foreground\" },\n TESTING: { icon: CircleDotDashed, tone: \"text-secondary-foreground\" },\n DONE: { icon: CircleCheckBig, tone: \"text-primary\" },\n CANCELLED: { icon: CircleX, tone: \"text-destructive/70\" }\n};\nfunction StatusIcon({ status, className }) {\n const meta = STATUS_META[status] ?? STATUS_META.TODO;\n const Icon = meta.icon;\n return /* @__PURE__ */ jsx(\n Icon,\n {\n className: cn(\"h-3.5 w-3.5 shrink-0\", meta.tone, className),\n \"aria-hidden\": \"true\"\n }\n );\n}\nfunction StatusPill({ status, className }) {\n const L = useTaskLabels();\n return /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\n \"inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium capitalize text-foreground\",\n className\n ),\n children: [\n /* @__PURE__ */ jsx(StatusIcon, { status }),\n L.status[status]\n ]\n }\n );\n}\nvar PRIORITY_META = {\n NONE: { level: 0, tone: \"text-muted-foreground/50\" },\n LOW: { level: 1, tone: \"text-muted-foreground\" },\n MEDIUM: { level: 2, tone: \"text-accent-foreground\" },\n HIGH: { level: 3, tone: \"text-accent-foreground\" },\n CRITICAL: { level: 3, tone: \"text-destructive\" }\n};\nvar BAR_HEIGHTS = [\"h-1.5\", \"h-2.5\", \"h-3.5\"];\nfunction PriorityIndicator({\n priority,\n showLabel = false,\n className\n}) {\n const L = useTaskLabels();\n const meta = PRIORITY_META[priority] ?? PRIORITY_META.NONE;\n return /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\"inline-flex items-center gap-1.5\", meta.tone, className),\n title: `${L.priorityLabel}: ${L.priority[priority]}`,\n children: [\n /* @__PURE__ */ jsx(\"span\", { className: \"flex items-end gap-0.5\", \"aria-hidden\": \"true\", children: BAR_HEIGHTS.map((h, i) => /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"w-1 rounded-[1px]\",\n h,\n i < meta.level ? \"bg-current\" : \"bg-current/25\"\n )\n },\n h\n )) }),\n showLabel && /* @__PURE__ */ jsx(\"span\", { className: \"text-xs font-medium capitalize\", children: L.priority[priority] })\n ]\n }\n );\n}\nvar TYPE_VARIANT = {\n TASK: \"secondary\",\n STORY: \"default\",\n BUG: \"destructive\",\n EPIC: \"accent\",\n SUB_TASK: \"muted\"\n};\nfunction TypeBadge({ type, className }) {\n const L = useTaskLabels();\n return /* @__PURE__ */ jsx(Badge, { variant: TYPE_VARIANT[type], className, children: L.type[type] });\n}\nfunction OverlayShell({\n open,\n onClose,\n children,\n ariaLabel,\n className,\n variant\n}) {\n useEffect(() => {\n if (!open) return;\n const onKeyDown = (e) => {\n if (e.key === \"Escape\") onClose();\n };\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [open, onClose]);\n if (!open) return null;\n const isModal = variant === \"modal\";\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n className: cn(\n \"fixed inset-0 z-50 flex bg-foreground/40\",\n isModal ? \"items-center justify-center p-4\" : \"justify-end\"\n ),\n onClick: onClose,\n children: /* @__PURE__ */ jsxs(\n \"div\",\n {\n role: \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-label\": ariaLabel,\n className: cn(\n \"relative overflow-y-auto bg-background text-foreground shadow-lg\",\n isModal ? \"max-h-[90vh] w-full max-w-2xl rounded-lg\" : \"h-full w-full max-w-lg\",\n className\n ),\n onClick: (e) => e.stopPropagation(),\n children: [\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n \"aria-label\": \"Close\",\n onClick: onClose,\n className: \"absolute right-3 top-3 z-10 rounded-md bg-muted px-2 py-1 text-sm font-medium text-muted-foreground hover:bg-muted/70\",\n children: \"\\u2715\"\n }\n ),\n children\n ]\n }\n )\n }\n );\n}\nfunction Modal(props) {\n return /* @__PURE__ */ jsx(OverlayShell, { variant: \"modal\", ...props });\n}\nfunction Drawer(props) {\n return /* @__PURE__ */ jsx(OverlayShell, { variant: \"drawer\", ...props });\n}\nvar EMPTY = /* @__PURE__ */ new Set();\nfunction TaskCard({\n task,\n hidden = EMPTY,\n onClick,\n draggable,\n onDragStart,\n onDragEnd,\n dragging,\n resolveAssignee,\n links,\n renderLinkIcon,\n className\n}) {\n const L = useTaskLabels();\n const overdue = isOverdue(task.dueDate, task.status);\n const due = formatDueDate(task.dueDate);\n const resolved = task.assigneeId ? resolveAssignee?.(task.assigneeId) : null;\n const showTopRow = !hidden.has(\"key\") || !hidden.has(\"type\");\n const showLinks = !hidden.has(\"links\") && (links?.length ?? 0) > 0;\n const showLabels = !hidden.has(\"labels\") && (task.labels?.length ?? 0) > 0;\n const showPriority = !hidden.has(\"priority\");\n const showPoints = !hidden.has(\"storyPoints\") && task.storyPoints != null;\n const showMetaRow = showPriority || showPoints;\n const showAssignee = !hidden.has(\"assignee\");\n const showDue = !hidden.has(\"dueDate\") && Boolean(due);\n const showPeopleRow = showAssignee || showDue;\n const interactive = Boolean(onClick);\n const handleKey = onClick ? (e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onClick(task);\n }\n } : void 0;\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n role: interactive ? \"button\" : void 0,\n tabIndex: interactive ? 0 : void 0,\n draggable,\n onDragStart: draggable ? (e) => onDragStart?.(task, e) : void 0,\n onDragEnd: draggable ? (e) => onDragEnd?.(task, e) : void 0,\n onClick: onClick ? () => onClick(task) : void 0,\n onKeyDown: handleKey,\n className: cn(\n \"group rounded-lg border border-border bg-card p-2.5 shadow-sm transition\",\n \"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n interactive && \"cursor-pointer hover:border-primary/50 hover:shadow-md\",\n draggable && \"active:cursor-grabbing\",\n dragging && \"opacity-50 ring-2 ring-primary/40\",\n className\n ),\n children: [\n showTopRow && /* @__PURE__ */ jsxs(\"div\", { className: \"mb-1 flex items-center justify-between gap-2\", children: [\n !hidden.has(\"key\") ? /* @__PURE__ */ jsx(\"span\", { className: \"font-mono text-[10px] uppercase tracking-wide text-muted-foreground\", children: task.key }) : /* @__PURE__ */ jsx(\"span\", {}),\n !hidden.has(\"type\") && /* @__PURE__ */ jsx(TypeBadge, { type: task.type })\n ] }),\n /* @__PURE__ */ jsx(\"p\", { className: \"line-clamp-2 text-sm font-medium leading-snug text-foreground\", children: task.title }),\n showLinks && /* @__PURE__ */ jsxs(\"div\", { className: \"mt-1.5 flex flex-wrap gap-1\", children: [\n links.slice(0, 3).map((link) => /* @__PURE__ */ jsx(LinkChip, { link, renderIcon: renderLinkIcon }, link.id)),\n links.length > 3 && /* @__PURE__ */ jsxs(\"span\", { className: \"text-[10px] text-muted-foreground\", children: [\n \"+\",\n links.length - 3\n ] })\n ] }),\n showLabels && /* @__PURE__ */ jsxs(\"div\", { className: \"mt-1.5 flex flex-wrap gap-1\", children: [\n task.labels.slice(0, 3).map((l) => /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\",\n children: l\n },\n l\n )),\n task.labels.length > 3 && /* @__PURE__ */ jsxs(\"span\", { className: \"text-[10px] text-muted-foreground\", children: [\n \"+\",\n task.labels.length - 3\n ] })\n ] }),\n showMetaRow && /* @__PURE__ */ jsxs(\"div\", { className: \"mt-2 flex items-center justify-between\", children: [\n showPriority ? /* @__PURE__ */ jsx(PriorityIndicator, { priority: task.priority, showLabel: true }) : /* @__PURE__ */ jsx(\"span\", {}),\n showPoints && /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"flex h-5 min-w-5 items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] font-semibold text-primary\",\n title: `${task.storyPoints} ${L.storyPointsLabel}`,\n children: task.storyPoints\n }\n )\n ] }),\n showPeopleRow && /* @__PURE__ */ jsxs(\"div\", { className: \"mt-2 flex items-center justify-between gap-2\", children: [\n showAssignee ? /* @__PURE__ */ jsxs(\"span\", { className: \"flex min-w-0 items-center gap-1.5\", children: [\n /* @__PURE__ */ jsx(Avatar, { id: task.assigneeId, name: resolved?.name, size: \"sm\" }),\n resolved?.name && /* @__PURE__ */ jsx(\"span\", { className: \"truncate text-[11px] text-muted-foreground\", children: resolved.name })\n ] }) : /* @__PURE__ */ jsx(\"span\", {}),\n showDue && /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\n \"flex shrink-0 items-center gap-1 text-[11px]\",\n overdue ? \"font-medium text-destructive\" : \"text-muted-foreground\"\n ),\n title: overdue ? L.overdueLabel : L.dueDateLabel,\n children: [\n /* @__PURE__ */ jsx(CalendarDays, { className: \"h-3 w-3\", \"aria-hidden\": \"true\" }),\n due\n ]\n }\n )\n ] })\n ]\n }\n );\n}\nfunction useWorkItemLinks(workspaceId, sourceProduct, limit = 500) {\n const { data, loading } = useQuery(\n LIST_WORK_ITEM_LINKS,\n {\n variables: {\n workspaceId,\n ...sourceProduct ? { filter: { sourceProduct } } : {},\n pagination: { first: limit }\n },\n skip: !workspaceId || !sourceProduct\n }\n );\n const linksByItem = useMemo(() => {\n const map = /* @__PURE__ */ new Map();\n for (const link of data?.planmagnetWorkItemLinks?.items ?? []) {\n const arr = map.get(link.workItemId);\n if (arr) arr.push(link);\n else map.set(link.workItemId, [link]);\n }\n return map;\n }, [data]);\n return { linksByItem, loading };\n}\nfunction TaskBoardCore({\n projectId,\n columns = DEFAULT_BOARD_COLUMNS,\n readonly,\n confirmMove = true,\n hideHeader,\n priority = \"ALL\",\n type = \"ALL\",\n search = \"\",\n assigneeId,\n hiddenFields,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n onTaskClick,\n className,\n workspaceId: workspaceIdProp\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const client = useApolloClient();\n const L = useTaskLabels();\n const hidden = useMemo(() => new Set(hiddenFields ?? []), [hiddenFields]);\n const { linksByItem } = useWorkItemLinks(workspaceId, linkSourceProduct);\n const [draggingId, setDraggingId] = useState(null);\n const [dragOver, setDragOver] = useState(null);\n const [moveError, setMoveError] = useState(null);\n const [pendingMove, setPendingMove] = useState(null);\n const [updateItem] = useMutation(UPDATE_WORK_ITEM);\n const { data, loading, error } = useQuery(\n LIST_WORK_ITEMS,\n {\n variables: {\n workspaceId,\n ...projectId ? { filter: { projectId } } : {},\n pagination: { first: 200 }\n },\n skip: !workspaceId\n }\n );\n const moveTask = useCallback(\n (task, toStatus) => {\n const from2 = task.status;\n if (from2 === toStatus) return;\n const id = client.cache.identify({ __typename: \"WorkItem\", id: task.id });\n if (!id) return;\n setMoveError(null);\n client.cache.modify({ id, fields: { status: () => toStatus } });\n updateItem({\n variables: { id: task.id, input: { status: toStatus } }\n }).catch(() => {\n client.cache.modify({ id, fields: { status: () => from2 } });\n setMoveError(L.moveFailed);\n });\n },\n [client, updateItem, L]\n );\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"TaskBoard: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n if (loading && !data) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"flex items-center justify-center p-12\", className), children: /* @__PURE__ */ jsx(\"div\", { className: \"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent\" }) });\n }\n if (error && !data) {\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: [\n L.errorLoading,\n \": \",\n error.message\n ] });\n }\n const tasks = data?.planmagnetWorkItems?.items ?? [];\n const query = search.trim().toLowerCase();\n const filtered = tasks.filter((t) => {\n if (priority !== \"ALL\" && t.priority !== priority) return false;\n if (type !== \"ALL\" && t.type !== type) return false;\n if (assigneeId && t.assigneeId !== assigneeId) return false;\n if (query) {\n const haystack = [t.title, t.key, ...t.labels ?? []].join(\" \").toLowerCase();\n if (!haystack.includes(query)) return false;\n }\n return true;\n });\n const canDrag = !readonly;\n const onColumnDragOver = (status) => (e) => {\n if (!canDrag || !draggingId) return;\n e.preventDefault();\n if (dragOver !== status) setDragOver(status);\n };\n const onColumnDrop = (status) => (e) => {\n if (!canDrag) return;\n e.preventDefault();\n const task = tasks.find((t) => t.id === draggingId);\n setDragOver(null);\n setDraggingId(null);\n if (!task || task.status === status) return;\n if (confirmMove) setPendingMove({ task, toStatus: status });\n else moveTask(task, status);\n };\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-3\", className), children: [\n !hideHeader && /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-baseline justify-between\", children: [\n /* @__PURE__ */ jsx(\"h2\", { className: \"text-lg font-semibold text-foreground\", children: L.board }),\n /* @__PURE__ */ jsxs(\"span\", { className: \"text-sm text-muted-foreground\", children: [\n filtered.length,\n \" \",\n filtered.length === 1 ? L.tasksSingular : L.tasksPlural\n ] })\n ] }),\n moveError && /* @__PURE__ */ jsx(\"div\", { className: \"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-1.5 text-xs text-destructive\", children: moveError }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex gap-3 overflow-x-auto pb-2\", children: columns.map((col) => {\n const colTasks = filtered.filter((t) => t.status === col.status);\n const isOver = dragOver === col.status;\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n onDragOver: onColumnDragOver(col.status),\n onDragLeave: () => dragOver === col.status && setDragOver(null),\n onDrop: onColumnDrop(col.status),\n className: cn(\n \"flex w-72 shrink-0 flex-col rounded-lg border transition-colors\",\n isOver ? \"border-primary/50 bg-primary/5\" : \"border-transparent bg-muted/40\"\n ),\n children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-between gap-2 px-3 py-2\", children: [\n /* @__PURE__ */ jsxs(\"span\", { className: \"flex items-center gap-2 text-sm font-medium text-foreground\", children: [\n /* @__PURE__ */ jsx(StatusIcon, { status: col.status }),\n L.status[col.status]\n ] }),\n /* @__PURE__ */ jsx(\"span\", { className: \"rounded-full bg-muted px-1.5 text-xs font-medium text-muted-foreground\", children: colTasks.length })\n ] }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-col gap-2 px-2 pb-2\", children: colTasks.length === 0 ? /* @__PURE__ */ jsx(\"div\", { className: \"rounded-md border border-dashed border-border/70 px-3 py-6 text-center text-xs text-muted-foreground\", children: isOver ? L.dropHere : L.noTasks }) : colTasks.map((task) => /* @__PURE__ */ jsx(\n TaskCard,\n {\n task,\n hidden,\n onClick: onTaskClick,\n draggable: canDrag,\n dragging: draggingId === task.id,\n resolveAssignee,\n links: linksByItem.get(task.id),\n renderLinkIcon,\n onDragStart: (t, e) => {\n setDraggingId(t.id);\n e.dataTransfer.effectAllowed = \"move\";\n e.dataTransfer.setData(\"text/plain\", t.id);\n },\n onDragEnd: () => {\n setDraggingId(null);\n setDragOver(null);\n }\n },\n task.id\n )) })\n ]\n },\n col.status\n );\n }) }),\n /* @__PURE__ */ jsx(\n Modal,\n {\n open: pendingMove != null,\n onClose: () => setPendingMove(null),\n ariaLabel: L.moveConfirmTitle,\n className: \"max-w-sm\",\n children: pendingMove && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-4 p-6\", children: [\n /* @__PURE__ */ jsx(\"h3\", { className: \"text-base font-semibold text-foreground\", children: L.moveConfirmTitle }),\n /* @__PURE__ */ jsx(\"p\", { className: \"text-sm text-muted-foreground\", children: L.moveConfirmPrompt.replace(\"{task}\", pendingMove.task.title).replace(\"{status}\", L.status[pendingMove.toStatus]) }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-end gap-2\", children: [\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setPendingMove(null),\n className: \"rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70\",\n children: L.cancel\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => {\n moveTask(pendingMove.task, pendingMove.toStatus);\n setPendingMove(null);\n },\n className: \"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:brightness-110\",\n children: L.moveConfirm\n }\n )\n ] })\n ] })\n }\n )\n ] });\n}\nfunction TaskBoard({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(TaskBoardCore, { workspaceId, ...coreProps })\n }\n );\n}\nvar DEFAULT_TYPE = \"TASK\";\nvar DEFAULT_STATUS = \"BACKLOG\";\nvar DEFAULT_PRIORITY = \"NONE\";\nvar fieldClass = \"w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\";\nvar labelClass = \"text-sm font-medium text-foreground\";\nfunction CreateTaskCore({\n projectId: projectIdProp,\n assigneeOptions,\n hiddenFields,\n defaultValues,\n hideHeader,\n submitLabel,\n onCreated,\n onError: onError2,\n onCancel,\n className,\n workspaceId: workspaceIdProp\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const projectId = projectIdProp ?? defaultValues?.projectId;\n const L = useTaskLabels();\n const hidden = useMemo(\n () => new Set(hiddenFields ?? []),\n [hiddenFields]\n );\n const [title, setTitle] = useState(defaultValues?.title ?? \"\");\n const [description, setDescription] = useState(\n defaultValues?.description ?? \"\"\n );\n const [type, setType] = useState(\n defaultValues?.type ?? DEFAULT_TYPE\n );\n const [status, setStatus] = useState(\n defaultValues?.status ?? DEFAULT_STATUS\n );\n const [priority, setPriority] = useState(\n defaultValues?.priority ?? DEFAULT_PRIORITY\n );\n const [assigneeId, setAssigneeId] = useState(defaultValues?.assigneeId ?? \"\");\n const [dueDate, setDueDate] = useState(defaultValues?.dueDate ?? \"\");\n const [labels, setLabels] = useState(\n (defaultValues?.labels ?? []).join(\", \")\n );\n const [storyPoints, setStoryPoints] = useState(\n defaultValues?.storyPoints != null ? String(defaultValues.storyPoints) : \"\"\n );\n const [createWorkItem, { loading, error }] = useMutation(CREATE_WORK_ITEM);\n const canSubmit = Boolean(workspaceId && projectId && title.trim());\n const handleSubmit = async (e) => {\n e.preventDefault();\n if (!canSubmit || !projectId) return;\n const parsedLabels = labels.split(\",\").map((l) => l.trim()).filter(Boolean);\n const parsedPoints = storyPoints.trim() ? Number(storyPoints) : void 0;\n const input = {\n projectId,\n title: title.trim(),\n type,\n // Sub-task linkage: parentId is not an editable form field — it rides\n // through from defaultValues (the \"Add sub-task\" flow) so a created work\n // item nests under its parent.\n ...defaultValues?.parentId ? { parentId: defaultValues.parentId } : {},\n ...hidden.has(\"status\") ? {} : { status },\n ...hidden.has(\"priority\") ? {} : { priority },\n ...hidden.has(\"description\") || !description.trim() ? {} : { description: description.trim() },\n ...hidden.has(\"assignee\") || !assigneeId.trim() ? {} : { assigneeId: assigneeId.trim() },\n ...hidden.has(\"dueDate\") || !dueDate.trim() ? {} : { dueDate: toIsoDate(dueDate) },\n ...hidden.has(\"labels\") || parsedLabels.length === 0 ? {} : { labels: parsedLabels },\n ...hidden.has(\"storyPoints\") || parsedPoints == null || Number.isNaN(parsedPoints) ? {} : { storyPoints: parsedPoints }\n };\n try {\n const result = await createWorkItem({ variables: { input } });\n const created = result.data?.planmagnetCreateWorkItem;\n if (created) {\n const cfg = getPlanMagnetConfig();\n try {\n await cfg.onTaskSaved?.({\n id: created.id,\n key: created.key,\n title: created.title,\n projectId: created.projectId,\n operation: \"created\"\n });\n } catch {\n }\n onCreated?.(created);\n resetForm();\n }\n } catch (err) {\n onError2?.(err instanceof Error ? err : new Error(String(err)));\n }\n };\n function resetForm() {\n setTitle(\"\");\n setDescription(\"\");\n setType(DEFAULT_TYPE);\n setStatus(DEFAULT_STATUS);\n setPriority(DEFAULT_PRIORITY);\n setAssigneeId(\"\");\n setDueDate(\"\");\n setLabels(\"\");\n setStoryPoints(\"\");\n }\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"CreateTask: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n return /* @__PURE__ */ jsx(Card, { className: cn(\"shadow-sm\", className), children: /* @__PURE__ */ jsx(CardContent, { className: \"p-6\", children: /* @__PURE__ */ jsxs(\"form\", { onSubmit: handleSubmit, className: \"space-y-4\", children: [\n !hideHeader && /* @__PURE__ */ jsxs(\"div\", { children: [\n /* @__PURE__ */ jsx(\"h2\", { className: \"text-xl font-semibold text-foreground\", children: L.newTaskHeading }),\n /* @__PURE__ */ jsx(\"p\", { className: \"text-sm text-muted-foreground\", children: L.newTaskSubtitle })\n ] }),\n !projectId && /* @__PURE__ */ jsx(\"p\", { className: \"rounded-md bg-destructive/10 p-2 text-xs text-destructive\", children: L.projectRequired }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-title\", className: labelClass, children: L.title }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-title\",\n className: fieldClass,\n value: title,\n onChange: (e) => setTitle(e.target.value),\n placeholder: L.titlePlaceholder,\n required: true\n }\n )\n ] }),\n !hidden.has(\"description\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-description\", className: labelClass, children: L.description }),\n /* @__PURE__ */ jsx(\n \"textarea\",\n {\n id: \"pm-description\",\n className: cn(fieldClass, \"min-h-[80px]\"),\n value: description,\n onChange: (e) => setDescription(e.target.value),\n placeholder: L.descriptionPlaceholder\n }\n )\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"grid grid-cols-1 gap-4 sm:grid-cols-2\", children: [\n !hidden.has(\"type\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-type\", className: labelClass, children: L.typeLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-type\",\n className: cn(fieldClass, \"capitalize\"),\n value: type,\n onChange: (e) => setType(e.target.value),\n children: TASK_TYPES.map((t) => /* @__PURE__ */ jsx(\"option\", { value: t, children: L.type[t] }, t))\n }\n )\n ] }),\n !hidden.has(\"status\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-status\", className: labelClass, children: L.statusLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-status\",\n className: cn(fieldClass, \"capitalize\"),\n value: status,\n onChange: (e) => setStatus(e.target.value),\n children: TASK_STATUSES.map((s) => /* @__PURE__ */ jsx(\"option\", { value: s, children: L.status[s] }, s))\n }\n )\n ] }),\n !hidden.has(\"priority\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-priority\", className: labelClass, children: L.priorityLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-priority\",\n className: cn(fieldClass, \"capitalize\"),\n value: priority,\n onChange: (e) => setPriority(e.target.value),\n children: TASK_PRIORITIES.map((p) => /* @__PURE__ */ jsx(\"option\", { value: p, children: L.priority[p] }, p))\n }\n )\n ] }),\n !hidden.has(\"assignee\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-assignee\", className: labelClass, children: L.assigneeLabel }),\n assigneeOptions && assigneeOptions.length > 0 ? /* @__PURE__ */ jsxs(\n \"select\",\n {\n id: \"pm-assignee\",\n className: fieldClass,\n value: assigneeId,\n onChange: (e) => setAssigneeId(e.target.value),\n children: [\n /* @__PURE__ */ jsx(\"option\", { value: \"\", children: L.unassigned }),\n assigneeOptions.map((o) => /* @__PURE__ */ jsx(\"option\", { value: o.id, children: o.name }, o.id))\n ]\n }\n ) : /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-assignee\",\n className: fieldClass,\n value: assigneeId,\n onChange: (e) => setAssigneeId(e.target.value),\n placeholder: L.assigneePlaceholder\n }\n )\n ] }),\n !hidden.has(\"dueDate\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-due\", className: labelClass, children: L.dueDateLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-due\",\n type: \"date\",\n className: fieldClass,\n value: dueDate,\n onChange: (e) => setDueDate(e.target.value)\n }\n )\n ] }),\n !hidden.has(\"storyPoints\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-points\", className: labelClass, children: L.storyPointsLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-points\",\n type: \"number\",\n min: 0,\n className: fieldClass,\n value: storyPoints,\n onChange: (e) => setStoryPoints(e.target.value),\n placeholder: \"0\"\n }\n )\n ] })\n ] }),\n !hidden.has(\"labels\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-labels\", className: labelClass, children: L.labelsLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-labels\",\n className: fieldClass,\n value: labels,\n onChange: (e) => setLabels(e.target.value),\n placeholder: L.labelsPlaceholder\n }\n )\n ] }),\n error && /* @__PURE__ */ jsxs(\"p\", { className: \"text-sm text-destructive\", children: [\n L.failedToCreate,\n \": \",\n error.message\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-end gap-2\", children: [\n onCancel && /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: onCancel,\n className: \"rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70\",\n children: L.cancel\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"submit\",\n disabled: !canSubmit || loading,\n className: cn(\n \"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground\",\n (!canSubmit || loading) && \"cursor-not-allowed opacity-50\"\n ),\n children: loading ? L.creating : submitLabel ?? L.create\n }\n )\n ] })\n ] }) }) });\n}\nfunction CreateTask({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(CreateTaskCore, { workspaceId, ...coreProps })\n }\n );\n}\nvar DEFAULT_COLUMNS = [\n \"title\",\n \"status\",\n \"priority\",\n \"assignee\",\n \"dueDate\",\n \"storyPoints\"\n];\nvar priorityRank = {\n CRITICAL: 0,\n HIGH: 1,\n MEDIUM: 2,\n LOW: 3,\n NONE: 4\n};\nvar statusRank = {\n BACKLOG: 0,\n TODO: 1,\n IN_PROGRESS: 2,\n IN_REVIEW: 3,\n TESTING: 4,\n DONE: 5,\n CANCELLED: 6\n};\nfunction columnLabel(col, L) {\n switch (col) {\n case \"key\":\n return L.colKey;\n case \"title\":\n return L.colTask;\n case \"type\":\n return L.colType;\n case \"status\":\n return L.colStatus;\n case \"priority\":\n return L.colPriority;\n case \"assignee\":\n return L.colAssignee;\n case \"dueDate\":\n return L.colDueDate;\n case \"storyPoints\":\n return L.colPoints;\n case \"linkedRecord\":\n return L.colLinkedRecord;\n case \"labels\":\n return L.colLabels;\n default:\n return col;\n }\n}\nvar COLUMN_SORT = {\n title: \"title\",\n type: \"type\",\n status: \"status\",\n priority: \"priority\",\n dueDate: \"dueDate\",\n storyPoints: \"storyPoints\"\n};\nfunction TaskListCore({\n projectId,\n status,\n type,\n priority,\n assigneeId,\n search,\n columns = DEFAULT_COLUMNS,\n sortBy,\n sortDir = \"asc\",\n hideHeader,\n onSelect,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n limit = 200,\n className,\n workspaceId: workspaceIdProp\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const { linksByItem } = useWorkItemLinks(workspaceId, linkSourceProduct);\n const L = useTaskLabels();\n const [sort, setSort] = useState({\n by: sortBy ?? null,\n dir: sortDir\n });\n const filter = useMemo(() => {\n const f = {};\n if (projectId) f.projectId = projectId;\n if (status) f.status = status;\n if (type) f.type = type;\n if (priority) f.priority = priority;\n if (assigneeId) f.assigneeId = assigneeId;\n if (search) f.search = search;\n return f;\n }, [projectId, status, type, priority, assigneeId, search]);\n const { data, loading, error } = useQuery(\n LIST_WORK_ITEMS,\n {\n variables: {\n workspaceId,\n ...Object.keys(filter).length ? { filter } : {},\n pagination: { first: limit }\n },\n skip: !workspaceId\n }\n );\n const rows = useMemo(() => {\n const items = data?.planmagnetWorkItems?.items ?? [];\n if (!sort.by) return items;\n const dir = sort.dir === \"desc\" ? -1 : 1;\n const key = sort.by;\n return [...items].sort((a, b) => dir * compareTasks(a, b, key));\n }, [data, sort]);\n const toggleSort = (col) => {\n const key = COLUMN_SORT[col];\n if (!key) return;\n setSort(\n (prev) => prev.by === key ? { by: key, dir: prev.dir === \"asc\" ? \"desc\" : \"asc\" } : { by: key, dir: \"asc\" }\n );\n };\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"TaskList: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n if (loading && !data) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"flex items-center justify-center p-12\", className), children: /* @__PURE__ */ jsx(\"div\", { className: \"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent\" }) });\n }\n if (error && !data) {\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: [\n L.errorLoading,\n \": \",\n error.message\n ] });\n }\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-3\", className), children: [\n !hideHeader && /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-baseline justify-between\", children: [\n /* @__PURE__ */ jsx(\"h2\", { className: \"text-lg font-semibold text-foreground\", children: L.list }),\n /* @__PURE__ */ jsxs(\"span\", { className: \"text-sm text-muted-foreground\", children: [\n rows.length,\n \" \",\n rows.length === 1 ? L.tasksSingular : L.tasksPlural\n ] })\n ] }),\n /* @__PURE__ */ jsx(\"div\", { className: \"overflow-x-auto rounded-lg border border-border\", children: /* @__PURE__ */ jsxs(\"table\", { className: \"w-full border-collapse text-sm\", children: [\n /* @__PURE__ */ jsx(\"thead\", { children: /* @__PURE__ */ jsx(\"tr\", { className: \"border-b border-border bg-muted/50 text-left\", children: columns.map((col) => {\n const sortable = Boolean(COLUMN_SORT[col]);\n const active = sort.by === COLUMN_SORT[col];\n return /* @__PURE__ */ jsx(\n \"th\",\n {\n onClick: sortable ? () => toggleSort(col) : void 0,\n className: cn(\n \"px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground\",\n sortable && \"cursor-pointer select-none hover:text-foreground\"\n ),\n children: /* @__PURE__ */ jsxs(\"span\", { className: \"inline-flex items-center gap-1\", children: [\n columnLabel(col, L),\n active && (sort.dir === \"asc\" ? /* @__PURE__ */ jsx(ChevronUp, { className: \"h-3 w-3\", \"aria-hidden\": \"true\" }) : /* @__PURE__ */ jsx(ChevronDown, { className: \"h-3 w-3\", \"aria-hidden\": \"true\" }))\n ] })\n },\n col\n );\n }) }) }),\n /* @__PURE__ */ jsxs(\"tbody\", { children: [\n rows.length === 0 && /* @__PURE__ */ jsx(\"tr\", { children: /* @__PURE__ */ jsx(\n \"td\",\n {\n colSpan: columns.length,\n className: \"px-3 py-8 text-center text-muted-foreground\",\n children: L.noTasksFound\n }\n ) }),\n rows.map((task) => /* @__PURE__ */ jsx(\n \"tr\",\n {\n onClick: onSelect ? () => onSelect(task.id) : void 0,\n className: cn(\n \"border-b border-border last:border-0\",\n onSelect && \"cursor-pointer hover:bg-muted/40\"\n ),\n children: columns.map((col) => /* @__PURE__ */ jsx(\n \"td\",\n {\n className: \"px-3 py-2 align-middle text-foreground\",\n children: renderCell(col, task, {\n resolveAssignee,\n links: linksByItem.get(task.id),\n renderLinkIcon,\n unassigned: L.unassigned\n })\n },\n col\n ))\n },\n task.id\n ))\n ] })\n ] }) })\n ] });\n}\nfunction renderCell(col, task, opts) {\n const { resolveAssignee, links, renderLinkIcon, unassigned } = opts;\n switch (col) {\n case \"key\":\n return /* @__PURE__ */ jsx(\"span\", { className: \"font-mono text-xs text-muted-foreground\", children: task.key });\n case \"title\":\n return /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-col\", children: [\n /* @__PURE__ */ jsx(\"span\", { className: \"font-medium text-foreground\", children: task.title }),\n /* @__PURE__ */ jsx(\"span\", { className: \"font-mono text-[10px] uppercase text-muted-foreground\", children: task.key })\n ] });\n case \"type\":\n return /* @__PURE__ */ jsx(TypeBadge, { type: task.type });\n case \"status\":\n return /* @__PURE__ */ jsx(StatusPill, { status: task.status });\n case \"priority\":\n return /* @__PURE__ */ jsx(PriorityIndicator, { priority: task.priority, showLabel: true });\n case \"assignee\": {\n const resolved = task.assigneeId ? resolveAssignee?.(task.assigneeId) : null;\n return /* @__PURE__ */ jsxs(\"span\", { className: \"flex items-center gap-1.5\", children: [\n /* @__PURE__ */ jsx(Avatar, { id: task.assigneeId, name: resolved?.name, size: \"sm\" }),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: resolved?.name ?? (task.assigneeId ? \"\" : unassigned) })\n ] });\n }\n case \"dueDate\": {\n const due = formatDueDate(task.dueDate);\n if (!due) return /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: \"\\u2014\" });\n return /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"text-xs\",\n isOverdue(task.dueDate, task.status) ? \"font-medium text-destructive\" : \"text-muted-foreground\"\n ),\n children: due\n }\n );\n }\n case \"storyPoints\":\n return task.storyPoints != null ? /* @__PURE__ */ jsx(\"span\", { className: \"flex h-5 min-w-5 items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] font-semibold text-primary\", children: task.storyPoints }) : /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: \"\\u2014\" });\n case \"linkedRecord\":\n if (!links || links.length === 0) {\n return /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: \"\\u2014\" });\n }\n return /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-wrap gap-1\", children: [\n links.slice(0, 2).map((link) => /* @__PURE__ */ jsx(LinkChip, { link, renderIcon: renderLinkIcon }, link.id)),\n links.length > 2 && /* @__PURE__ */ jsxs(\"span\", { className: \"text-[10px] text-muted-foreground\", children: [\n \"+\",\n links.length - 2\n ] })\n ] });\n case \"labels\":\n return /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-wrap gap-1\", children: (task.labels ?? []).slice(0, 3).map((l) => /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\",\n children: l\n },\n l\n )) });\n default:\n return null;\n }\n}\nfunction compareTasks(a, b, sortBy) {\n switch (sortBy) {\n case \"priority\":\n return priorityRank[a.priority] - priorityRank[b.priority];\n case \"status\":\n return statusRank[a.status] - statusRank[b.status];\n case \"title\":\n return a.title.localeCompare(b.title);\n case \"type\":\n return a.type.localeCompare(b.type);\n case \"dueDate\":\n return (a.dueDate ?? \"\").localeCompare(b.dueDate ?? \"\");\n case \"storyPoints\":\n return (a.storyPoints ?? 0) - (b.storyPoints ?? 0);\n default:\n return 0;\n }\n}\nfunction TaskList({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(TaskListCore, { workspaceId, ...coreProps })\n }\n );\n}\nfunction useMilestones(workspaceId, opts = {}) {\n const { projectId, enabled = true, limit = 100 } = opts;\n const { data, loading } = useQuery(LIST_MILESTONES, {\n variables: {\n workspaceId,\n ...projectId ? { filter: { projectId } } : {},\n pagination: { first: limit }\n },\n skip: !workspaceId || !enabled,\n errorPolicy: \"all\"\n });\n const milestones = useMemo(\n () => data?.planmagnetMilestones?.items ?? [],\n [data]\n );\n const byDay = useMemo(() => {\n const map = /* @__PURE__ */ new Map();\n for (const m of milestones) {\n const d = parseDate(m.dueDate);\n if (!d) continue;\n const key = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, \"0\")}-${String(d.getDate()).padStart(2, \"0\")}`;\n const arr = map.get(key);\n if (arr) arr.push(m);\n else map.set(key, [m]);\n }\n return map;\n }, [milestones]);\n return { milestones, byDay, loading };\n}\nvar WEEK_OPTS = { weekStartsOn: 1 };\nfunction dayKey(d) {\n return format(d, \"yyyy-MM-dd\");\n}\nfunction TaskTimelineCore({\n projectId,\n priority = \"ALL\",\n type = \"ALL\",\n search = \"\",\n assigneeId,\n defaultMode = \"week\",\n onSelect,\n resolveAssignee,\n showMilestones = true,\n className,\n workspaceId: workspaceIdProp\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const L = useTaskLabels();\n const { milestones, byDay: milestonesByDay } = useMilestones(workspaceId, {\n projectId,\n enabled: showMilestones\n });\n const [mode, setMode] = useState(defaultMode);\n const [offset, setOffset] = useState(0);\n const { data, loading, error } = useQuery(\n LIST_WORK_ITEMS,\n {\n variables: {\n workspaceId,\n ...projectId ? { filter: { projectId } } : {},\n pagination: { first: 200 }\n },\n skip: !workspaceId\n }\n );\n const tasks = useMemo(() => {\n const all = data?.planmagnetWorkItems?.items ?? [];\n const query = search.trim().toLowerCase();\n return all.filter((t) => {\n if (priority !== \"ALL\" && t.priority !== priority) return false;\n if (type !== \"ALL\" && t.type !== type) return false;\n if (assigneeId && t.assigneeId !== assigneeId) return false;\n if (query) {\n const hay = [t.title, t.key, ...t.labels ?? []].join(\" \").toLowerCase();\n if (!hay.includes(query)) return false;\n }\n return true;\n });\n }, [data, priority, type, search, assigneeId]);\n const { anchor, rangeStart, rangeEnd, days } = useMemo(() => {\n const base = /* @__PURE__ */ new Date();\n if (mode === \"week\") {\n const a2 = addWeeks(base, offset);\n const s2 = startOfWeek(a2, WEEK_OPTS);\n const e2 = endOfWeek(a2, WEEK_OPTS);\n return {\n anchor: a2,\n rangeStart: s2,\n rangeEnd: e2,\n days: eachDayOfInterval({ start: s2, end: e2 })\n };\n }\n const a = addMonths(base, offset);\n const s = startOfWeek(startOfMonth(a), WEEK_OPTS);\n const e = endOfWeek(endOfMonth(a), WEEK_OPTS);\n return {\n anchor: a,\n rangeStart: s,\n rangeEnd: e,\n days: eachDayOfInterval({ start: s, end: e })\n };\n }, [mode, offset]);\n const { byDay, overdue, undated } = useMemo(() => {\n const map = /* @__PURE__ */ new Map();\n const od = [];\n const ud = [];\n for (const t of tasks) {\n const d = parseDate(t.dueDate);\n if (!d) {\n ud.push(t);\n continue;\n }\n if (isOverdue(t.dueDate, t.status)) {\n od.push(t);\n continue;\n }\n const k = dayKey(d);\n const arr = map.get(k);\n if (arr) arr.push(t);\n else map.set(k, [t]);\n }\n return { byDay: map, overdue: od, undated: ud };\n }, [tasks]);\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"Timeline: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n if (loading && !data) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"flex items-center justify-center p-12\", className), children: /* @__PURE__ */ jsx(\"div\", { className: \"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent\" }) });\n }\n if (error && !data) {\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: [\n L.errorLoading,\n \": \",\n error.message\n ] });\n }\n const rangeLabel = mode === \"week\" ? `${format(rangeStart, \"MMM d\")} \\u2013 ${format(rangeEnd, \"MMM d\")}` : format(anchor, \"MMMM yyyy\");\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-3\", className), children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-wrap items-center justify-between gap-2\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center gap-1\", children: [\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setOffset((o) => o - 1),\n \"aria-label\": \"Previous\",\n className: \"flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-muted/50\",\n children: /* @__PURE__ */ jsx(ChevronLeft, { className: \"h-4 w-4\" })\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setOffset(0),\n className: \"h-8 rounded-md border border-border px-3 text-xs font-medium text-foreground hover:bg-muted/50\",\n children: L.today\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setOffset((o) => o + 1),\n \"aria-label\": \"Next\",\n className: \"flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-muted/50\",\n children: /* @__PURE__ */ jsx(ChevronRight, { className: \"h-4 w-4\" })\n }\n ),\n /* @__PURE__ */ jsx(\"span\", { className: \"ml-2 text-sm font-medium text-foreground\", children: rangeLabel })\n ] }),\n /* @__PURE__ */ jsx(\"div\", { className: \"inline-flex rounded-md border border-border p-0.5\", children: [\"week\", \"month\"].map((m) => /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => {\n setMode(m);\n setOffset(0);\n },\n className: cn(\n \"rounded px-3 py-1 text-xs font-medium capitalize transition-colors\",\n mode === m ? \"bg-primary text-primary-foreground\" : \"text-muted-foreground hover:text-foreground\"\n ),\n children: m === \"week\" ? L.week : L.month\n },\n m\n )) })\n ] }),\n overdue.length > 0 && /* @__PURE__ */ jsxs(\"div\", { className: \"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2\", children: [\n /* @__PURE__ */ jsx(\"p\", { className: \"mb-1 text-xs font-semibold text-destructive\", children: L.overdue.replace(\"{n}\", String(overdue.length)) }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-wrap gap-1.5\", children: overdue.map((t) => /* @__PURE__ */ jsx(\n TaskChip,\n {\n task: t,\n onSelect,\n resolveAssignee,\n tone: \"destructive\"\n },\n t.id\n )) })\n ] }),\n milestones.length > 0 && /* @__PURE__ */ jsxs(\"div\", { className: \"rounded-md border border-primary/30 bg-primary/5 px-3 py-2\", children: [\n /* @__PURE__ */ jsxs(\"p\", { className: \"mb-1 flex items-center gap-1 text-xs font-semibold text-primary\", children: [\n /* @__PURE__ */ jsx(Flag, { className: \"h-3.5 w-3.5\", \"aria-hidden\": \"true\" }),\n L.milestones\n ] }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-wrap gap-1.5\", children: milestones.map((m) => /* @__PURE__ */ jsx(MilestoneFlag, { milestone: m }, m.id)) })\n ] }),\n mode === \"week\" ? /* @__PURE__ */ jsx(\"div\", { className: \"grid grid-cols-7 gap-2\", children: days.map((day) => {\n const items = byDay.get(dayKey(day)) ?? [];\n const dayMilestones = milestonesByDay.get(dayKey(day)) ?? [];\n const today = isToday(day);\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n className: cn(\n \"flex min-h-32 flex-col rounded-lg border p-2\",\n today ? \"border-primary/50 bg-primary/5\" : \"border-border bg-muted/20\"\n ),\n children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"mb-2 flex items-baseline justify-between\", children: [\n /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"text-xs font-semibold uppercase\",\n today ? \"text-primary\" : \"text-muted-foreground\"\n ),\n children: format(day, \"EEE\")\n }\n ),\n /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"text-sm font-semibold\",\n today ? \"text-primary\" : \"text-foreground\"\n ),\n children: format(day, \"d\")\n }\n )\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-col gap-1.5\", children: [\n dayMilestones.map((m) => /* @__PURE__ */ jsx(MilestoneFlag, { milestone: m, compact: true }, m.id)),\n items.map((t) => /* @__PURE__ */ jsx(\n TaskChip,\n {\n task: t,\n onSelect,\n resolveAssignee\n },\n t.id\n ))\n ] })\n ]\n },\n dayKey(day)\n );\n }) }) : /* @__PURE__ */ jsxs(\"div\", { className: \"grid grid-cols-7 gap-1\", children: [\n [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"].map((d) => /* @__PURE__ */ jsx(\n \"div\",\n {\n className: \"px-1 pb-1 text-center text-[10px] font-semibold uppercase text-muted-foreground\",\n children: d\n },\n d\n )),\n days.map((day) => {\n const items = byDay.get(dayKey(day)) ?? [];\n const today = isToday(day);\n const inMonth = isSameMonth(day, anchor);\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n className: cn(\n \"flex min-h-20 flex-col gap-1 rounded-md border p-1\",\n today ? \"border-primary/50 bg-primary/5\" : \"border-border/60 bg-muted/10\",\n !inMonth && \"opacity-40\"\n ),\n children: [\n /* @__PURE__ */ jsx(\n \"span\",\n {\n className: cn(\n \"text-[10px] font-semibold\",\n today ? \"text-primary\" : \"text-muted-foreground\"\n ),\n children: format(day, \"d\")\n }\n ),\n items.slice(0, 3).map((t) => /* @__PURE__ */ jsx(\n TaskChip,\n {\n task: t,\n onSelect,\n resolveAssignee,\n compact: true\n },\n t.id\n )),\n items.length > 3 && /* @__PURE__ */ jsxs(\"span\", { className: \"text-[10px] text-muted-foreground\", children: [\n \"+\",\n items.length - 3,\n \" \",\n L.more\n ] })\n ]\n },\n dayKey(day)\n );\n })\n ] }),\n undated.length > 0 && /* @__PURE__ */ jsxs(\"div\", { className: \"rounded-md border border-border bg-muted/20 px-3 py-2\", children: [\n /* @__PURE__ */ jsx(\"p\", { className: \"mb-1 text-xs font-semibold text-muted-foreground\", children: L.noDueDate.replace(\"{n}\", String(undated.length)) }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex flex-wrap gap-1.5\", children: undated.map((t) => /* @__PURE__ */ jsx(\n TaskChip,\n {\n task: t,\n onSelect,\n resolveAssignee\n },\n t.id\n )) })\n ] })\n ] });\n}\nfunction MilestoneFlag({\n milestone,\n compact\n}) {\n const due = formatDueDate(milestone.dueDate);\n return /* @__PURE__ */ jsxs(\n \"span\",\n {\n className: cn(\n \"inline-flex max-w-full items-center gap-1 rounded-md border border-primary/40 bg-primary/10 px-1.5 py-1 text-[11px] font-medium text-primary\",\n compact && \"w-full\"\n ),\n title: milestone.name + (due ? ` \\xB7 ${due}` : \"\"),\n children: [\n /* @__PURE__ */ jsx(Flag, { className: \"h-3 w-3 shrink-0\", \"aria-hidden\": \"true\" }),\n /* @__PURE__ */ jsx(\"span\", { className: \"truncate\", children: milestone.name }),\n !compact && due && /* @__PURE__ */ jsxs(\"span\", { className: \"shrink-0 text-primary/70\", children: [\n \"\\xB7 \",\n due\n ] })\n ]\n }\n );\n}\nfunction TaskChip({\n task,\n onSelect,\n resolveAssignee,\n tone,\n compact\n}) {\n const resolved = task.assigneeId ? resolveAssignee?.(task.assigneeId) : null;\n const interactive = Boolean(onSelect);\n return /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n disabled: !interactive,\n onClick: interactive ? () => onSelect?.(task.id) : void 0,\n title: task.title,\n className: cn(\n \"flex w-full items-center gap-1.5 rounded-md border px-1.5 py-1 text-left transition-colors\",\n tone === \"destructive\" ? \"border-destructive/40 bg-card hover:bg-destructive/5\" : \"border-border bg-card hover:border-primary/50\",\n interactive ? \"cursor-pointer\" : \"cursor-default\"\n ),\n children: [\n /* @__PURE__ */ jsx(PriorityIndicator, { priority: task.priority }),\n /* @__PURE__ */ jsx(\"span\", { className: \"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground\", children: task.title }),\n !compact && /* @__PURE__ */ jsx(Avatar, { id: task.assigneeId, name: resolved?.name, size: \"sm\" })\n ]\n }\n );\n}\nvar VIEW_ICONS = {\n board: LayoutGrid,\n list: List,\n timeline: CalendarRange\n};\nvar SELECT_CLASS = \"h-8 rounded-md border border-border bg-background px-2 text-xs font-medium text-foreground capitalize transition-colors hover:bg-muted/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring\";\nfunction TaskToolbar({\n view,\n onViewChange,\n views = [\"board\", \"list\", \"timeline\"],\n search,\n onSearchChange,\n priority,\n onPriorityChange,\n type,\n onTypeChange,\n onNewTask,\n canCreate,\n mine,\n onMineChange,\n className\n}) {\n const L = useTaskLabels();\n const viewLabel = {\n board: L.board,\n list: L.list,\n timeline: L.timeline\n };\n return /* @__PURE__ */ jsxs(\n \"div\",\n {\n className: cn(\n \"flex flex-wrap items-center justify-between gap-3 border-b border-border pb-2\",\n className\n ),\n children: [\n /* @__PURE__ */ jsx(\n \"div\",\n {\n className: \"flex items-center gap-1\",\n role: \"tablist\",\n \"aria-label\": \"Task views\",\n children: views.map((v) => {\n const Icon = VIEW_ICONS[v];\n const active = v === view;\n return /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n role: \"tab\",\n \"aria-selected\": active,\n onClick: () => onViewChange(v),\n className: cn(\n \"relative flex items-center gap-1.5 rounded-t-md px-2.5 py-1.5 text-sm font-medium transition-colors\",\n active ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\"\n ),\n children: [\n /* @__PURE__ */ jsx(Icon, { className: \"h-4 w-4\", \"aria-hidden\": \"true\" }),\n viewLabel[v],\n active && /* @__PURE__ */ jsx(\"span\", { className: \"absolute inset-x-1 -bottom-[9px] h-0.5 rounded-full bg-primary\" })\n ]\n },\n v\n );\n })\n }\n ),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-wrap items-center gap-2\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"relative\", children: [\n /* @__PURE__ */ jsx(\n Search,\n {\n className: \"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground\",\n \"aria-hidden\": \"true\"\n }\n ),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n type: \"search\",\n value: search,\n onChange: (e) => onSearchChange(e.target.value),\n placeholder: L.searchPlaceholder,\n \"aria-label\": L.searchPlaceholder,\n className: \"h-8 w-40 rounded-md border border-border bg-background pl-7 pr-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n }\n )\n ] }),\n onMineChange && /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: () => onMineChange(!mine),\n \"aria-pressed\": mine,\n className: cn(\n \"flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium transition-colors\",\n mine ? \"border-primary bg-primary/10 text-primary\" : \"border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground\"\n ),\n children: [\n /* @__PURE__ */ jsx(User, { className: \"h-3.5 w-3.5\", \"aria-hidden\": \"true\" }),\n L.myTasks\n ]\n }\n ),\n /* @__PURE__ */ jsxs(\n \"select\",\n {\n value: priority,\n onChange: (e) => onPriorityChange(e.target.value),\n \"aria-label\": L.priorityLabel,\n className: SELECT_CLASS,\n children: [\n /* @__PURE__ */ jsx(\"option\", { value: \"ALL\", children: L.allPriorities }),\n TASK_PRIORITIES.map((p) => /* @__PURE__ */ jsx(\"option\", { value: p, children: L.priority[p] }, p))\n ]\n }\n ),\n /* @__PURE__ */ jsxs(\n \"select\",\n {\n value: type,\n onChange: (e) => onTypeChange(e.target.value),\n \"aria-label\": L.typeLabel,\n className: SELECT_CLASS,\n children: [\n /* @__PURE__ */ jsx(\"option\", { value: \"ALL\", children: L.allTypes }),\n TASK_TYPES.map((t) => /* @__PURE__ */ jsx(\"option\", { value: t, children: L.type[t] }, t))\n ]\n }\n ),\n canCreate && onNewTask && /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: onNewTask,\n className: \"flex h-8 items-center gap-1.5 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90\",\n children: [\n /* @__PURE__ */ jsx(Plus, { className: \"h-4 w-4\", \"aria-hidden\": \"true\" }),\n L.newTask\n ]\n }\n )\n ] })\n ]\n }\n );\n}\nvar fieldClass2 = \"w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\";\nfunction CommentComposer({\n placeholder,\n submitLabel,\n pendingLabel,\n members,\n autoFocus,\n onSubmit\n}) {\n const [text, setText] = useState(\"\");\n const [pending, setPending] = useState(false);\n const [mentioned, setMentioned] = useState([]);\n const [query, setQuery] = useState(null);\n const taRef = useRef(null);\n const suggestions = useMemo(() => {\n if (query == null || !members || members.length === 0) return [];\n const q = query.toLowerCase();\n return members.filter((m) => m.name.toLowerCase().includes(q)).slice(0, 6);\n }, [query, members]);\n const detectMention = (value) => {\n const caret = taRef.current?.selectionStart ?? value.length;\n const m = /(?:^|\\s)@([\\p{L}\\p{N} ._-]*)$/u.exec(value.slice(0, caret));\n setQuery(m ? m[1] : null);\n };\n const onChange = (value) => {\n setText(value);\n detectMention(value);\n };\n const pickMention = (member) => {\n const el = taRef.current;\n const caret = el?.selectionStart ?? text.length;\n const before = text.slice(0, caret);\n const after = text.slice(caret);\n const replaced = before.replace(\n /@([\\p{L}\\p{N} ._-]*)$/u,\n `@${member.name} `\n );\n setText(replaced + after);\n setQuery(null);\n setMentioned(\n (prev) => prev.some((p) => p.id === member.id) ? prev : [...prev, member]\n );\n requestAnimationFrame(() => el?.focus());\n };\n const submit = async (e) => {\n e.preventDefault();\n const body = text.trim();\n if (!body || pending) return;\n const ids = mentioned.filter((m) => body.includes(`@${m.name}`)).map((m) => m.id);\n setPending(true);\n try {\n await onSubmit({ text: body, mentionUserIds: ids });\n setText(\"\");\n setMentioned([]);\n setQuery(null);\n } finally {\n setPending(false);\n }\n };\n return /* @__PURE__ */ jsxs(\"form\", { onSubmit: submit, className: \"relative space-y-2\", children: [\n /* @__PURE__ */ jsx(\n \"textarea\",\n {\n ref: taRef,\n className: cn(fieldClass2, \"min-h-[60px]\"),\n rows: 2,\n value: text,\n autoFocus,\n onChange: (e) => onChange(e.target.value),\n onKeyUp: (e) => detectMention(e.target.value),\n onClick: (e) => detectMention(e.target.value),\n placeholder,\n \"aria-label\": placeholder\n }\n ),\n suggestions.length > 0 && /* @__PURE__ */ jsx(\"ul\", { className: \"absolute left-0 top-full z-20 mt-1 max-h-48 w-56 overflow-auto rounded-md border border-border bg-popover p-1 shadow-md\", children: suggestions.map((m) => /* @__PURE__ */ jsx(\"li\", { children: /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onMouseDown: (e) => {\n e.preventDefault();\n pickMention(m);\n },\n className: \"flex w-full items-center rounded px-2 py-1 text-left text-sm text-foreground hover:bg-muted\",\n children: [\n \"@\",\n m.name\n ]\n }\n ) }, m.id)) }),\n /* @__PURE__ */ jsx(\"div\", { className: \"flex justify-end\", children: /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"submit\",\n disabled: pending || !text.trim(),\n className: cn(\n \"rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground\",\n (pending || !text.trim()) && \"cursor-not-allowed opacity-50\"\n ),\n children: pending ? pendingLabel : submitLabel\n }\n ) })\n ] });\n}\nvar labelClass2 = \"text-xs font-medium uppercase tracking-wide text-muted-foreground\";\nvar escapeRe = (s) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\nfunction TaskCommentsCore({\n entityType,\n entityId,\n currentActorId,\n resolveAssignee,\n members,\n readonly,\n className\n}) {\n const L = useTaskLabels();\n const [error, setError] = useState(null);\n const [replyingTo, setReplyingTo] = useState(null);\n const { data, loading, refetch } = useQuery(\n GET_ENTITY_COMMENTS,\n {\n // No parentCommentId → the service returns EVERY comment (all levels)\n // flat; we build the thread tree client-side via threadRootId. `take` is\n // capped at 100 by the conversations service (a higher value is rejected\n // with a validation error), which is ample for a single work item.\n variables: {\n input: {\n entityType,\n entityId,\n take: 100,\n sortBy: \"createdAt\",\n sortOrder: \"asc\"\n }\n },\n skip: !entityId,\n errorPolicy: \"all\"\n }\n );\n const all = data?.getEntityComments?.items ?? [];\n const { topLevel, repliesByRoot } = useMemo(() => {\n const top = [];\n const map = /* @__PURE__ */ new Map();\n for (const c of all) {\n if (!c.parentCommentId) {\n top.push(c);\n } else {\n const root = c.threadRootId ?? c.parentCommentId;\n const arr = map.get(root);\n if (arr) arr.push(c);\n else map.set(root, [c]);\n }\n }\n return { topLevel: top, repliesByRoot: map };\n }, [all]);\n const [createComment] = useMutation(\n CREATE_ENTITY_COMMENT\n );\n const [deleteComment] = useMutation(\n DELETE_ENTITY_COMMENT\n );\n const authorName = (id) => id === currentActorId ? L.you : resolveAssignee?.(id)?.name ?? void 0;\n const post = async ({ text, mentionUserIds }, parentCommentId) => {\n setError(null);\n const base = {\n entityType,\n entityId,\n content: { text },\n contentType: \"TEXT\",\n ...parentCommentId ? { parentCommentId } : {}\n };\n const create = (withMentions) => createComment({\n variables: {\n input: withMentions && mentionUserIds.length ? { ...base, mentionUserIds } : base\n }\n });\n try {\n await create(true);\n } catch (err) {\n if (mentionUserIds.length) {\n try {\n await create(false);\n } catch (err2) {\n setError(L.failedToComment);\n throw err2;\n }\n } else {\n setError(L.failedToComment);\n throw err;\n }\n }\n await refetch();\n setReplyingTo(null);\n };\n const handleDelete = async (id) => {\n setError(null);\n try {\n await deleteComment({ variables: { input: { id, soft: true } } });\n await refetch();\n } catch {\n setError(L.failedToDeleteComment);\n }\n };\n const renderBody = (c) => {\n const text = c.content?.text ?? \"\";\n const names = (members ?? []).map((m) => m.name).filter((n) => text.includes(`@${n}`));\n if (names.length === 0) return text;\n const tokens = new Set(names.map((n) => `@${n}`));\n const re = new RegExp(`(@(?:${names.map(escapeRe).join(\"|\")}))`, \"g\");\n return text.split(re).map(\n (part, i) => tokens.has(part) ? /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"rounded bg-primary/10 px-0.5 font-medium text-primary\",\n children: part\n },\n i\n ) : /* @__PURE__ */ jsx(\"span\", { children: part }, i)\n );\n };\n const commentBlock = (c, isReply) => /* @__PURE__ */ jsxs(\"div\", { className: \"flex gap-2\", children: [\n /* @__PURE__ */ jsx(Avatar, { id: c.authorId, name: authorName(c.authorId), size: \"sm\" }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"min-w-0 flex-1\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center gap-2\", children: [\n /* @__PURE__ */ jsx(\"span\", { className: \"text-sm font-medium text-foreground\", children: authorName(c.authorId) ?? c.authorId.slice(0, 8) }),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: formatDateFull(c.createdAt) }),\n c.edited && /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: L.editedTag }),\n !readonly && c.authorId === currentActorId && /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => handleDelete(c.id),\n \"aria-label\": L.del,\n title: L.del,\n className: \"ml-auto rounded p-1 text-muted-foreground hover:text-destructive\",\n children: /* @__PURE__ */ jsx(Trash2, { className: \"h-3.5 w-3.5\" })\n }\n )\n ] }),\n /* @__PURE__ */ jsx(\"p\", { className: \"whitespace-pre-wrap break-words text-sm text-foreground\", children: renderBody(c) }),\n !isReply && !readonly && /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setReplyingTo((prev) => prev === c.id ? null : c.id),\n className: \"mt-1 text-xs font-medium text-muted-foreground hover:text-foreground\",\n children: L.reply\n }\n )\n ] })\n ] });\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-4\", className), children: [\n /* @__PURE__ */ jsxs(\"div\", { className: labelClass2, children: [\n L.commentsLabel,\n all.length > 0 ? ` (${all.length})` : \"\"\n ] }),\n /* @__PURE__ */ jsx(\"ul\", { className: \"space-y-4\", children: topLevel.length === 0 && !loading ? /* @__PURE__ */ jsx(\"li\", { className: \"text-sm text-muted-foreground\", children: L.noComments }) : topLevel.map((c) => {\n const replies = repliesByRoot.get(c.id) ?? [];\n return /* @__PURE__ */ jsxs(\"li\", { className: \"space-y-2\", children: [\n commentBlock(c, false),\n replies.length > 0 && /* @__PURE__ */ jsx(\"ul\", { className: \"ml-8 space-y-2 border-l border-border pl-3\", children: replies.map((r) => /* @__PURE__ */ jsx(\"li\", { children: commentBlock(r, true) }, r.id)) }),\n !readonly && replyingTo === c.id && /* @__PURE__ */ jsx(\"div\", { className: \"ml-8\", children: /* @__PURE__ */ jsx(\n CommentComposer,\n {\n placeholder: L.replyPlaceholder,\n submitLabel: L.reply,\n pendingLabel: L.posting,\n members,\n autoFocus: true,\n onSubmit: (p) => post(p, c.id)\n }\n ) })\n ] }, c.id);\n }) }),\n error && /* @__PURE__ */ jsx(\"p\", { className: \"text-sm text-destructive\", children: error }),\n !readonly && /* @__PURE__ */ jsx(\n CommentComposer,\n {\n placeholder: L.commentPlaceholder,\n submitLabel: L.postComment,\n pendingLabel: L.posting,\n members,\n onSubmit: (p) => post(p)\n }\n )\n ] });\n}\nvar fieldClass3 = \"w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\";\nvar labelClass3 = \"text-xs font-medium uppercase tracking-wide text-muted-foreground\";\nvar priorityVariant = {\n NONE: \"muted\",\n LOW: \"muted\",\n MEDIUM: \"secondary\",\n HIGH: \"accent\",\n CRITICAL: \"destructive\"\n};\nfunction TaskDetailCore({\n id,\n readonly,\n hiddenFields,\n hideHeader,\n onUpdated,\n onDeleted,\n onError: onError2,\n resolveAssignee,\n assigneeOptions,\n linkSourceProduct,\n renderLinkIcon,\n onOpenItem,\n onAddSubtask,\n commentsEntityType,\n currentActorId,\n className\n}) {\n const client = useApolloClient();\n const L = useTaskLabels();\n const hidden = useMemo(\n () => new Set(hiddenFields ?? []),\n [hiddenFields]\n );\n const { data, loading, error } = useQuery(GET_WORK_ITEM, {\n variables: { id },\n skip: !id\n });\n const item = data?.planmagnetWorkItem ?? null;\n const { linksByItem } = useWorkItemLinks(\n item?.workspaceId,\n linkSourceProduct\n );\n const links = item ? linksByItem.get(item.id) ?? [] : [];\n const { data: parentData } = useQuery(GET_WORK_ITEM, {\n variables: { id: item?.parentId },\n skip: !item?.parentId\n });\n const parent = parentData?.planmagnetWorkItem ?? null;\n const { data: childData } = useQuery(LIST_WORK_ITEMS, {\n variables: {\n workspaceId: item?.workspaceId,\n filter: { parentId: item?.id },\n pagination: { first: 100 }\n },\n skip: !item?.id || !item?.workspaceId\n });\n const children = childData?.planmagnetWorkItems?.items ?? [];\n const [editing, setEditing] = useState(false);\n const [confirmingDelete, setConfirmingDelete] = useState(false);\n const [title, setTitle] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [type, setType] = useState(\"TASK\");\n const [status, setStatus] = useState(\"BACKLOG\");\n const [priority, setPriority] = useState(\"NONE\");\n const [assigneeId, setAssigneeId] = useState(\"\");\n const [dueDate, setDueDate] = useState(\"\");\n const [labels, setLabels] = useState(\"\");\n const [storyPoints, setStoryPoints] = useState(\"\");\n useEffect(() => {\n if (!item) return;\n setTitle(item.title);\n setDescription(item.description ?? \"\");\n setType(item.type);\n setStatus(item.status);\n setPriority(item.priority);\n setAssigneeId(item.assigneeId ?? \"\");\n setDueDate(item.dueDate ? String(item.dueDate).slice(0, 10) : \"\");\n setLabels((item.labels ?? []).join(\", \"));\n setStoryPoints(item.storyPoints != null ? String(item.storyPoints) : \"\");\n }, [item]);\n const [updateWorkItem, { loading: saving, error: saveError }] = useMutation(UPDATE_WORK_ITEM);\n const [deleteWorkItem, { loading: deleting, error: deleteError }] = useMutation(DELETE_WORK_ITEM);\n const handleDelete = async () => {\n if (!item) return;\n try {\n await deleteWorkItem({ variables: { id: item.id } });\n client.cache.evict({\n id: client.cache.identify({ __typename: \"WorkItem\", id: item.id })\n });\n client.cache.gc();\n void client.refetchQueries({ include: [LIST_WORK_ITEMS] }).catch(() => {\n });\n onDeleted?.(item.id);\n } catch (err) {\n onError2?.(err instanceof Error ? err : new Error(String(err)));\n }\n };\n const handleSave = async (e) => {\n e.preventDefault();\n if (!item) return;\n const parsedLabels = labels.split(\",\").map((l) => l.trim()).filter(Boolean);\n const parsedPoints = storyPoints.trim() ? Number(storyPoints) : void 0;\n const input = {\n title: title.trim(),\n ...hidden.has(\"description\") ? {} : { description: description.trim() },\n ...hidden.has(\"type\") ? {} : { type },\n ...hidden.has(\"status\") ? {} : { status },\n ...hidden.has(\"priority\") ? {} : { priority },\n ...hidden.has(\"assignee\") ? {} : { assigneeId: assigneeId.trim() },\n ...hidden.has(\"dueDate\") ? {} : { dueDate: toIsoDate(dueDate) },\n ...hidden.has(\"labels\") ? {} : { labels: parsedLabels },\n ...hidden.has(\"storyPoints\") || parsedPoints == null || Number.isNaN(parsedPoints) ? {} : { storyPoints: parsedPoints }\n };\n try {\n const result = await updateWorkItem({\n variables: { id: item.id, input }\n });\n const updated = result.data?.planmagnetUpdateWorkItem;\n if (updated) {\n const cfg = getPlanMagnetConfig();\n try {\n await cfg.onTaskSaved?.({\n id: updated.id,\n key: updated.key,\n title: updated.title,\n projectId: updated.projectId,\n operation: \"updated\"\n });\n } catch {\n }\n onUpdated?.(updated);\n setEditing(false);\n }\n } catch (err) {\n onError2?.(err instanceof Error ? err : new Error(String(err)));\n }\n };\n if (!id) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"TaskDetail: no work-item id provided.\" });\n }\n if (loading && !data) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"flex items-center justify-center p-12\", className), children: /* @__PURE__ */ jsx(\"div\", { className: \"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent\" }) });\n }\n if (error && !data) {\n return /* @__PURE__ */ jsxs(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: [\n L.errorLoading,\n \": \",\n error.message\n ] });\n }\n if (!item) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-muted-foreground\", className), children: L.taskNotFound });\n }\n const canEdit = !readonly;\n return /* @__PURE__ */ jsx(Card, { className: cn(\"shadow-sm\", className), children: /* @__PURE__ */ jsxs(CardContent, { className: \"space-y-4 p-6\", children: [\n !hideHeader && /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-start justify-between gap-4\", children: [\n /* @__PURE__ */ jsxs(\"div\", { children: [\n /* @__PURE__ */ jsx(\"p\", { className: \"text-xs text-muted-foreground\", children: item.key }),\n /* @__PURE__ */ jsx(\"h2\", { className: \"text-xl font-semibold text-foreground\", children: item.title })\n ] }),\n canEdit && !editing && /* @__PURE__ */ jsxs(\"div\", { className: \"flex shrink-0 items-center gap-2\", children: [\n onDeleted && (confirmingDelete ? /* @__PURE__ */ jsxs(\"span\", { className: \"flex items-center gap-1 text-xs\", children: [\n /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: L.deletePrompt }),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n disabled: deleting,\n onClick: handleDelete,\n className: \"rounded bg-destructive px-2 py-1 font-medium text-destructive-foreground disabled:opacity-50\",\n children: deleting ? \"\\u2026\" : L.yes\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setConfirmingDelete(false),\n className: \"rounded bg-muted px-2 py-1 text-muted-foreground\",\n children: L.no\n }\n )\n ] }) : /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setConfirmingDelete(true),\n title: L.del,\n \"aria-label\": L.del,\n className: \"rounded-md p-1.5 text-destructive hover:bg-destructive/10\",\n children: /* @__PURE__ */ jsx(Trash2, { className: \"h-4 w-4\" })\n }\n )),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setEditing(true),\n className: \"rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground\",\n children: L.edit\n }\n )\n ] })\n ] }),\n deleteError && /* @__PURE__ */ jsxs(\"p\", { className: \"text-sm text-destructive\", children: [\n L.failedToDelete,\n \": \",\n deleteError.message\n ] }),\n !editing ? /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-6\", children: [\n /* @__PURE__ */ jsxs(\"dl\", { className: \"grid grid-cols-1 gap-4 sm:grid-cols-2\", children: [\n !hidden.has(\"type\") && /* @__PURE__ */ jsx(Field, { label: L.typeLabel, children: /* @__PURE__ */ jsx(Badge, { variant: \"secondary\", children: L.type[item.type] }) }),\n !hidden.has(\"status\") && /* @__PURE__ */ jsx(Field, { label: L.statusLabel, children: /* @__PURE__ */ jsx(\"span\", { className: \"capitalize text-foreground\", children: L.status[item.status] }) }),\n !hidden.has(\"priority\") && /* @__PURE__ */ jsx(Field, { label: L.priorityLabel, children: /* @__PURE__ */ jsx(Badge, { variant: priorityVariant[item.priority], children: L.priority[item.priority] }) }),\n !hidden.has(\"assignee\") && /* @__PURE__ */ jsx(Field, { label: L.assigneeLabel, children: item.assigneeId ? /* @__PURE__ */ jsxs(\"span\", { className: \"flex items-center gap-1.5\", children: [\n /* @__PURE__ */ jsx(\n Avatar,\n {\n id: item.assigneeId,\n name: resolveAssignee?.(item.assigneeId)?.name,\n size: \"sm\"\n }\n ),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-foreground\", children: resolveAssignee?.(item.assigneeId)?.name ?? L.assigned })\n ] }) : /* @__PURE__ */ jsx(\"span\", { className: \"text-muted-foreground\", children: L.unassigned }) }),\n !hidden.has(\"dueDate\") && /* @__PURE__ */ jsx(Field, { label: L.dueDateLabel, children: /* @__PURE__ */ jsx(\"span\", { className: \"text-foreground\", children: formatDateFull(item.dueDate) ?? \"\\u2014\" }) }),\n !hidden.has(\"storyPoints\") && /* @__PURE__ */ jsx(Field, { label: L.storyPointsLabel, children: /* @__PURE__ */ jsx(\"span\", { className: \"text-foreground\", children: item.storyPoints ?? 0 }) }),\n !hidden.has(\"description\") && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: L.description }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 whitespace-pre-wrap text-sm text-foreground\", children: item.description || \"\\u2014\" })\n ] }),\n !hidden.has(\"labels\") && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: L.labelsLabel }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 flex flex-wrap gap-1\", children: (item.labels ?? []).length === 0 ? /* @__PURE__ */ jsx(\"span\", { className: \"text-sm text-muted-foreground\", children: \"\\u2014\" }) : item.labels.map((l) => /* @__PURE__ */ jsx(\n \"span\",\n {\n className: \"rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground\",\n children: l\n },\n l\n )) })\n ] }),\n links.length > 0 && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: L.linkedRecordsLabel }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 flex flex-wrap gap-1.5\", children: links.map((link) => /* @__PURE__ */ jsx(\n LinkChip,\n {\n link,\n renderIcon: renderLinkIcon\n },\n link.id\n )) })\n ] }),\n parent && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: L.parentLabel }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1\", children: /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: () => onOpenItem?.(parent.id),\n className: \"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-1 text-sm text-foreground hover:bg-muted\",\n children: [\n /* @__PURE__ */ jsx(StatusIcon, { status: parent.status }),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: parent.key }),\n /* @__PURE__ */ jsx(\"span\", { className: \"truncate\", children: parent.title })\n ]\n }\n ) })\n ] }),\n (children.length > 0 || onAddSubtask && canEdit) && /* @__PURE__ */ jsxs(\"div\", { className: \"sm:col-span-2\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-between\", children: [\n /* @__PURE__ */ jsxs(\"dt\", { className: labelClass3, children: [\n L.subtasksLabel,\n children.length > 0 ? ` (${children.length})` : \"\"\n ] }),\n onAddSubtask && canEdit && /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: () => onAddSubtask({\n id: item.id,\n projectId: item.projectId\n }),\n className: \"text-xs font-medium text-primary hover:underline\",\n children: [\n \"+ \",\n L.addSubtask\n ]\n }\n )\n ] }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 space-y-1\", children: children.length === 0 ? /* @__PURE__ */ jsx(\"span\", { className: \"text-sm text-muted-foreground\", children: \"\\u2014\" }) : children.map((c) => /* @__PURE__ */ jsxs(\n \"button\",\n {\n type: \"button\",\n onClick: () => onOpenItem?.(c.id),\n className: \"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm hover:bg-muted\",\n children: [\n /* @__PURE__ */ jsx(StatusIcon, { status: c.status }),\n /* @__PURE__ */ jsx(\"span\", { className: \"text-xs text-muted-foreground\", children: c.key }),\n /* @__PURE__ */ jsx(\"span\", { className: \"flex-1 truncate text-foreground\", children: c.title })\n ]\n },\n c.id\n )) })\n ] }),\n (item.createdAt || item.updatedAt) && /* @__PURE__ */ jsxs(\"div\", { className: \"flex flex-wrap gap-x-6 gap-y-1 border-t border-border pt-3 text-xs text-muted-foreground sm:col-span-2\", children: [\n item.createdAt && /* @__PURE__ */ jsxs(\"span\", { children: [\n L.createdLabel,\n \" \",\n formatDateFull(item.createdAt)\n ] }),\n item.updatedAt && /* @__PURE__ */ jsxs(\"span\", { children: [\n L.updatedLabel,\n \" \",\n formatDateFull(item.updatedAt)\n ] })\n ] })\n ] }),\n commentsEntityType && /* @__PURE__ */ jsx(\"div\", { className: \"border-t border-border pt-4\", children: /* @__PURE__ */ jsx(\n TaskCommentsCore,\n {\n entityType: commentsEntityType,\n entityId: item.id,\n currentActorId,\n resolveAssignee,\n members: assigneeOptions\n }\n ) })\n ] }) : /* @__PURE__ */ jsxs(\"form\", { onSubmit: handleSave, className: \"space-y-4\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-title\", className: labelClass3, children: L.title }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-title\",\n className: fieldClass3,\n value: title,\n onChange: (e) => setTitle(e.target.value),\n required: true\n }\n )\n ] }),\n !hidden.has(\"description\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-desc\", className: labelClass3, children: L.description }),\n /* @__PURE__ */ jsx(\n \"textarea\",\n {\n id: \"pm-detail-desc\",\n className: cn(fieldClass3, \"min-h-[80px]\"),\n value: description,\n onChange: (e) => setDescription(e.target.value)\n }\n )\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"grid grid-cols-1 gap-4 sm:grid-cols-2\", children: [\n !hidden.has(\"type\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-type\", className: labelClass3, children: L.typeLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-detail-type\",\n className: cn(fieldClass3, \"capitalize\"),\n value: type,\n onChange: (e) => setType(e.target.value),\n children: TASK_TYPES.map((t) => /* @__PURE__ */ jsx(\"option\", { value: t, children: L.type[t] }, t))\n }\n )\n ] }),\n !hidden.has(\"status\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-status\", className: labelClass3, children: L.statusLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-detail-status\",\n className: cn(fieldClass3, \"capitalize\"),\n value: status,\n onChange: (e) => setStatus(e.target.value),\n children: TASK_STATUSES.map((s) => /* @__PURE__ */ jsx(\"option\", { value: s, children: L.status[s] }, s))\n }\n )\n ] }),\n !hidden.has(\"priority\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-priority\", className: labelClass3, children: L.priorityLabel }),\n /* @__PURE__ */ jsx(\n \"select\",\n {\n id: \"pm-detail-priority\",\n className: cn(fieldClass3, \"capitalize\"),\n value: priority,\n onChange: (e) => setPriority(e.target.value),\n children: TASK_PRIORITIES.map((p) => /* @__PURE__ */ jsx(\"option\", { value: p, children: L.priority[p] }, p))\n }\n )\n ] }),\n !hidden.has(\"assignee\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-assignee\", className: labelClass3, children: L.assigneeLabel }),\n assigneeOptions && assigneeOptions.length > 0 ? /* @__PURE__ */ jsxs(\n \"select\",\n {\n id: \"pm-detail-assignee\",\n className: fieldClass3,\n value: assigneeId,\n onChange: (e) => setAssigneeId(e.target.value),\n children: [\n /* @__PURE__ */ jsx(\"option\", { value: \"\", children: L.unassigned }),\n assigneeOptions.map((o) => /* @__PURE__ */ jsx(\"option\", { value: o.id, children: o.name }, o.id))\n ]\n }\n ) : /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-assignee\",\n className: fieldClass3,\n value: assigneeId,\n onChange: (e) => setAssigneeId(e.target.value),\n placeholder: L.assigneePlaceholder\n }\n )\n ] }),\n !hidden.has(\"dueDate\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-due\", className: labelClass3, children: L.dueDateLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-due\",\n type: \"date\",\n className: fieldClass3,\n value: dueDate,\n onChange: (e) => setDueDate(e.target.value)\n }\n )\n ] }),\n !hidden.has(\"storyPoints\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-points\", className: labelClass3, children: L.storyPointsLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-points\",\n type: \"number\",\n min: 0,\n className: fieldClass3,\n value: storyPoints,\n onChange: (e) => setStoryPoints(e.target.value)\n }\n )\n ] })\n ] }),\n !hidden.has(\"labels\") && /* @__PURE__ */ jsxs(\"div\", { className: \"space-y-1\", children: [\n /* @__PURE__ */ jsx(\"label\", { htmlFor: \"pm-detail-labels\", className: labelClass3, children: L.labelsLabel }),\n /* @__PURE__ */ jsx(\n \"input\",\n {\n id: \"pm-detail-labels\",\n className: fieldClass3,\n value: labels,\n onChange: (e) => setLabels(e.target.value),\n placeholder: L.labelsPlaceholder\n }\n )\n ] }),\n saveError && /* @__PURE__ */ jsxs(\"p\", { className: \"text-sm text-destructive\", children: [\n L.failedToSave,\n \": \",\n saveError.message\n ] }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex items-center justify-end gap-2\", children: [\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"button\",\n onClick: () => setEditing(false),\n className: \"rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70\",\n children: L.cancel\n }\n ),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n type: \"submit\",\n disabled: saving || !title.trim(),\n className: cn(\n \"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground\",\n (saving || !title.trim()) && \"cursor-not-allowed opacity-50\"\n ),\n children: saving ? L.saving : L.save\n }\n )\n ] })\n ] })\n ] }) });\n}\nfunction Field({ label, children }) {\n return /* @__PURE__ */ jsxs(\"div\", { children: [\n /* @__PURE__ */ jsx(\"dt\", { className: labelClass3, children: label }),\n /* @__PURE__ */ jsx(\"dd\", { className: \"mt-1 text-sm\", children })\n ] });\n}\nfunction TaskDetail({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(TaskDetailCore, { ...coreProps })\n }\n );\n}\nfunction TasksPageCore({\n workspaceId: workspaceIdProp,\n projectId,\n boardProjectId,\n columns,\n readonly,\n hiddenFields,\n views,\n defaultView = \"board\",\n confirmMove,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n assigneeOptions,\n currentActorId,\n commentsEntityType,\n labels,\n openItemId,\n header,\n onTaskSaved,\n createSurface = \"modal\",\n detailSurface = \"drawer\",\n className\n}) {\n const ctx = usePlanMagnetContextSafe();\n const workspaceId = workspaceIdProp ?? ctx?.workspaceId;\n const client = useApolloClient();\n const mergedLabels = mergeTaskLabels(labels);\n const [view, setView] = useState(defaultView);\n const [search, setSearch] = useState(\"\");\n const [priority, setPriority] = useState(\"ALL\");\n const [type, setType] = useState(\"ALL\");\n const [mine, setMine] = useState(false);\n const [creating, setCreating] = useState(false);\n const [selectedId, setSelectedId] = useState(null);\n const [createDefaults, setCreateDefaults] = useState(null);\n useEffect(() => {\n if (openItemId) setSelectedId(openItemId);\n }, [openItemId]);\n const refetchBoard = useCallback(() => {\n void client.refetchQueries({ include: [LIST_WORK_ITEMS] }).catch(() => {\n });\n }, [client]);\n const handleCreated = useCallback(\n (workItem) => {\n refetchBoard();\n setCreating(false);\n setCreateDefaults(null);\n onTaskSaved?.({ workItem, operation: \"created\" });\n },\n [refetchBoard, onTaskSaved]\n );\n const handleAddSubtask = useCallback(\n (parent) => {\n setSelectedId(null);\n setCreateDefaults({\n parentId: parent.id,\n projectId: parent.projectId,\n type: \"SUB_TASK\"\n });\n setCreating(true);\n },\n []\n );\n const startCreate = useCallback(() => {\n setCreateDefaults(null);\n setCreating(true);\n }, []);\n const cancelCreate = useCallback(() => {\n setCreating(false);\n setCreateDefaults(null);\n }, []);\n const handleUpdated = useCallback(\n (workItem) => {\n refetchBoard();\n onTaskSaved?.({ workItem, operation: \"updated\" });\n },\n [refetchBoard, onTaskSaved]\n );\n const handleDeleted = useCallback(() => {\n setSelectedId(null);\n }, []);\n const handleTaskClick = useCallback((task) => {\n setSelectedId(task.id);\n }, []);\n const handleSelect = useCallback((id) => setSelectedId(id), []);\n if (!workspaceId) {\n return /* @__PURE__ */ jsx(\"div\", { className: cn(\"p-6 text-sm text-destructive\", className), children: \"TasksPage: no workspaceId provided (prop or PlanMagnetProvider).\" });\n }\n const canCreate = !readonly && Boolean(projectId);\n const showInlineCreate = creating && createSurface === \"inline\";\n const showInlineDetail = selectedId != null && detailSurface === \"inline\";\n const createForm = /* @__PURE__ */ jsx(\n CreateTaskCore,\n {\n workspaceId,\n projectId,\n assigneeOptions,\n hiddenFields,\n defaultValues: createDefaults ?? void 0,\n onCreated: handleCreated,\n onCancel: cancelCreate\n }\n );\n const detailView = selectedId != null ? /* @__PURE__ */ jsx(\n TaskDetailCore,\n {\n id: selectedId,\n readonly,\n hiddenFields,\n resolveAssignee,\n assigneeOptions,\n linkSourceProduct,\n renderLinkIcon,\n onUpdated: handleUpdated,\n onDeleted: handleDeleted,\n onOpenItem: handleSelect,\n onAddSubtask: handleAddSubtask,\n commentsEntityType,\n currentActorId\n }\n ) : null;\n const listPriority = priority === \"ALL\" ? void 0 : priority;\n const listType = type === \"ALL\" ? void 0 : type;\n const mineAssignee = mine && currentActorId ? currentActorId : void 0;\n const listColumns = linkSourceProduct ? [\n \"title\",\n \"status\",\n \"priority\",\n \"assignee\",\n \"dueDate\",\n \"linkedRecord\"\n ] : void 0;\n return /* @__PURE__ */ jsx(TaskLabelsProvider, { value: mergedLabels, children: /* @__PURE__ */ jsxs(\"div\", { className: cn(\"space-y-4 p-6\", className), children: [\n header && /* @__PURE__ */ jsx(\"div\", { className: \"min-w-0\", children: typeof header === \"string\" ? /* @__PURE__ */ jsx(\"h1\", { className: \"truncate text-2xl font-semibold text-foreground\", children: header }) : header }),\n /* @__PURE__ */ jsx(\n TaskToolbar,\n {\n view,\n onViewChange: setView,\n views,\n search,\n onSearchChange: setSearch,\n priority,\n onPriorityChange: setPriority,\n type,\n onTypeChange: setType,\n onNewTask: startCreate,\n canCreate,\n mine,\n onMineChange: currentActorId ? setMine : void 0\n }\n ),\n showInlineCreate && /* @__PURE__ */ jsx(\"div\", { children: createForm }),\n view === \"board\" && /* @__PURE__ */ jsx(\n TaskBoardCore,\n {\n workspaceId,\n projectId: boardProjectId,\n columns,\n readonly,\n confirmMove,\n hideHeader: true,\n priority,\n type,\n search,\n assigneeId: mineAssignee,\n hiddenFields,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n onTaskClick: handleTaskClick\n }\n ),\n view === \"list\" && /* @__PURE__ */ jsx(\n TaskListCore,\n {\n workspaceId,\n projectId: boardProjectId,\n priority: listPriority,\n type: listType,\n search: search || void 0,\n assigneeId: mineAssignee,\n hideHeader: true,\n resolveAssignee,\n linkSourceProduct,\n renderLinkIcon,\n columns: listColumns ? [...listColumns] : void 0,\n onSelect: handleSelect\n }\n ),\n view === \"timeline\" && /* @__PURE__ */ jsx(\n TaskTimelineCore,\n {\n workspaceId,\n projectId: boardProjectId,\n priority,\n type,\n search,\n assigneeId: mineAssignee,\n resolveAssignee,\n onSelect: handleSelect\n }\n ),\n showInlineDetail && /* @__PURE__ */ jsx(\"div\", { className: \"pb-6\", children: detailView }),\n createSurface === \"modal\" && /* @__PURE__ */ jsx(\n Modal,\n {\n open: creating,\n onClose: cancelCreate,\n ariaLabel: \"Create task\",\n className: \"max-w-xl\",\n children: /* @__PURE__ */ jsx(\"div\", { className: \"p-2 pt-8\", children: createForm })\n }\n ),\n detailSurface === \"drawer\" && /* @__PURE__ */ jsx(\n Drawer,\n {\n open: selectedId != null,\n onClose: () => setSelectedId(null),\n ariaLabel: \"Task detail\",\n children: /* @__PURE__ */ jsx(\"div\", { className: \"p-2 pt-8\", children: detailView })\n }\n )\n ] }) });\n}\nfunction TasksPage({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n ...coreProps\n}) {\n return /* @__PURE__ */ jsx(\n PlanMagnetProvider,\n {\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n organizationId,\n trustedOrigins,\n onAuthError,\n workspaceClient,\n children: /* @__PURE__ */ jsx(TasksPageCore, { workspaceId, ...coreProps })\n }\n );\n}\n\nexport { Avatar, Badge, CREATE_WORK_ITEM, CREATE_WORK_ITEM_LINK, CreateTask, CreateTaskCore, DEFAULT_BOARD_COLUMNS, DEFAULT_TASK_LABELS, DELETE_WORK_ITEM, DELETE_WORK_ITEM_LINK, Drawer, GET_PROJECTS, GET_WORK_ITEM, LIST_MILESTONES, LIST_WORK_ITEMS, LIST_WORK_ITEM_LINKS, LinkChip, MILESTONE_FIELDS, MOVE_WORK_ITEM, Modal, PRIORITY_META, PROJECT_SUMMARY_FIELDS, PlanMagnetProvider, PriorityIndicator, STATUS_META, StatusIcon, StatusPill, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, TaskBoard, TaskBoardCore, TaskCard, TaskCommentsCore, TaskDetail, TaskDetailCore, TaskLabelsProvider, TaskList, TaskListCore, TaskTimelineCore, TaskToolbar, TasksPage, TasksPageCore, TypeBadge, UPDATE_WORK_ITEM, WORK_ITEM_FIELDS, WORK_ITEM_LINK_FIELDS, WORK_ITEM_SUMMARY_FIELDS, badgeVariants, cn, config, createPlanMagnetClient, enumLabel, getGraphQLEndpoint, getPlanMagnetClient, getPlanMagnetClientSafe, getPlanMagnetConfig, isPlanMagnetClientReady, mergeTaskLabels, resetPlanMagnetClient, resetPlanMagnetConfig, setPlanMagnetClient, setPlanMagnetConfig, useMilestones, usePlanMagnetContext, usePlanMagnetContextSafe, useTaskLabels, useWorkItemLinks, validateTrustedOrigin, waitForPlanMagnetClient };\n//# sourceMappingURL=index.js.map\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0HA,IAAI,KAAgB;CAClB,eAAe;CACf,aAAa;CACd;AACY,IAAI,MAAM,EAAE,EAAE,EACzB,IAAI,GAAG,GAAM;AACX,QAAO,GAAc;GAExB,CAAC;AACF,SAAS,KAAsB;AAC7B,QAAO,EAAE,GAAG,IAAe;;AAqC7B,IAAI,KAAoB,EAAc,KAAK;AAkG3C,SAAS,KAA2B;AAClC,QAAO,EAAW,GAAkB;;AAEtC,IAAI,KAA2B,CAAG;;;;;;;;;;;;;;GAe9B,KAAmB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BtB,KAAyB,CAAG;;;;;;;;;;;;GAa5B,KAAkB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;IAwBrB,GAAyB;GAEzB,KAAgB,CAAG;;;;;;IAMnB,GAAiB;;AAEF,CAAG;;;;;;;;;;;;;;;;;;;;;;;;IAwBlB,GAAuB;;AAE3B,IAAI,KAAmB,CAAG;;;;;;IAMtB,GAAiB;GAEjB,KAAmB,CAAG;;;;;;IAMtB,GAAiB;;AAEA,CAAG;;;;;;IAMpB,GAAiB;;AAErB,IAAI,KAAwB,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O;KAAE,WAAW;KAAQ,UAAU;KAAY,CAAC;IAC3F,MAAkB,WAA2B,kBAC3C,IACA;KACE,MAAM;KACN,SAAS;KACT,WAAW;KACX,WAAW;KACX,UAA0B,kBAAI,OAAO;MAAE,WAAW;MAAY,UAAU;MAAY,CAAC;KACtF,CACF;IACD,MAAkB,YAA4B,kBAC5C,IACA;KACE,MAAM,KAAc;KACpB,eAAe,EAAc,KAAK;KAClC,WAAW;KACX,UAA0B,kBAAI,OAAO;MAAE,WAAW;MAAY,UAAU;MAAY,CAAC;KACtF,CACF;IACF;GAAE,CAAC;EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-healthybowl",
|
|
3
|
-
"version": "2026.706.
|
|
3
|
+
"version": "2026.706.3",
|
|
4
4
|
"description": "Burdenoff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@apollo/client": "^4.0.11",
|
|
46
46
|
"@burdenoff/fe-libs": "2026.625.5",
|
|
47
|
-
"@burdenoff/planmagnet-fe-sdk": "2026.706.
|
|
47
|
+
"@burdenoff/planmagnet-fe-sdk": "2026.706.3",
|
|
48
48
|
"@tanstack/react-query": "^5.90.16",
|
|
49
49
|
"clsx": "^2.1.1",
|
|
50
50
|
"date-fns": "^4.1.0",
|