@hyperdrive.bot/fleet-server 0.3.125 → 0.3.126

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.
@@ -274,6 +274,23 @@ export function buildStoredAgentPayload(record, validProviders, options) {
274
274
  attentionReason: record.attentionReason ?? null,
275
275
  attentionTimestamp: record.attentionTimestamp ?? null,
276
276
  archivedAt: record.archivedAt ?? null,
277
+ /**
278
+ * The snooze ledger, which the record→wire hop dropped for the life of the
279
+ * feature.
280
+ *
281
+ * `StoredAgentRecord` carries it and the daemon persists it, and neither of
282
+ * the two `AgentSnapshotPayload` constructors nor the list-item projection
283
+ * ever put it on the wire: `grep -c snooze` over this file returned 0. The
284
+ * app's mapper was corrected first, which fixed the LAST link of a chain
285
+ * whose first link was never sending anything, so every consequence stayed
286
+ * exactly as it was: a snoozed card back on the next lap, and a second
287
+ * snooze free for ever because `snoozeDemand(0)` is permanently "free".
288
+ *
289
+ * `?? null` and not a spread: `null` is the value that CLEARS a snooze, and
290
+ * omitting the key means "not computed", which the app would read as never
291
+ * snoozed. `agent-manager.ts:1936` makes the same distinction on the way in.
292
+ */
293
+ snooze: record.snooze ?? null,
277
294
  labels: normalizeLabels(record.labels),
278
295
  ...(record.digest ? { digest: record.digest } : {}),
279
296
  ...(providerAvailable ? {} : { providerUnavailable: true }),
@@ -295,6 +312,9 @@ export function toAgentListItemPayload(agent) {
295
312
  updatedAt: agent.updatedAt,
296
313
  lastUserMessageAt: agent.lastUserMessageAt,
297
314
  archivedAt: agent.archivedAt ?? null,
315
+ // Same reason as the snapshot above: the list is what hydrates the app on
316
+ // connect, so dropping it here means a reload un-snoozes everything.
317
+ snooze: agent.snooze ?? null,
298
318
  requiresAttention: agent.requiresAttention ?? false,
299
319
  attentionReason: agent.attentionReason ?? null,
300
320
  attentionTimestamp: agent.attentionTimestamp ?? null,
@@ -198,6 +198,27 @@ export function answerPendingDecision(existing, input) {
198
198
  return { ok: false, error: `No pending decision with id "${input.decisionId}"` };
199
199
  }
200
200
  const target = decisions[index];
201
+ /*
202
+ * An answered decision cannot be answered again.
203
+ *
204
+ * This overwrote `answeredAt` / `answerNote` silently. On the triage feed
205
+ * that is not hypothetical: answering the last open decision advances the
206
+ * card, and if the store never learns about it (a session the daemon has not
207
+ * loaded emitted nothing) the same card comes back on the next lap with the
208
+ * same question. Answering it again SUCCEEDED, which spent a second act of
209
+ * the 5/day budget on one decision and sent the agent a second
210
+ * "has been answered" prompt.
211
+ *
212
+ * Refusing is the honest answer even once the broadcast is fixed: two people
213
+ * on two devices can reach the same open decision, and the second one should
214
+ * be told it is already settled rather than quietly overwriting the first.
215
+ */
216
+ if (target.answeredAt) {
217
+ return {
218
+ ok: false,
219
+ error: `Decision "${input.decisionId}" was already answered at ${target.answeredAt}`,
220
+ };
221
+ }
201
222
  const note = input.note?.trim() ?? "";
202
223
  if (input.optionId === null && note.length === 0) {
203
224
  return { ok: false, error: "Answer needs an optionId or a note" };
@@ -323,6 +323,31 @@ export declare class Session {
323
323
  private isProviderVisibleToClient;
324
324
  private buildProjectPlacementForWorkspace;
325
325
  private buildProjectPlacementForWorkspaceId;
326
+ /**
327
+ * Broadcast a metadata write so every connected client's store sees it.
328
+ *
329
+ * `updateAgentMetadata` has two branches: a LIVE agent goes through
330
+ * `writeLabels` / `setDigest`, which notify, and an agent the daemon has not
331
+ * loaded falls through to `writeStoredMetadata`, which emits nothing at all.
332
+ * Most of a triage backlog is the second kind, and the request/response the
333
+ * caller gets back is point to point: nothing writes it into the app's store.
334
+ *
335
+ * So a kanban move on an idle session closed its sheet reporting success and
336
+ * the digest kept showing the old column for the rest of the sitting, and an
337
+ * answered decision advanced the card and came back on the next lap with the
338
+ * same question. Answering it again succeeded, because
339
+ * `answerPendingDecision` overwrites rather than refusing, which spent two
340
+ * acts of the daily budget on one decision and sent the agent two prompts.
341
+ *
342
+ * The feed's own compensating refresh does not cover this: it invalidates
343
+ * `agentHistoryQueryKey`, and `useAgentHistory` is mounted on the sessions
344
+ * screen and the tag-colours card, neither of which is mounted on the reels
345
+ * route, so the invalidation has no observer and refetches nothing.
346
+ *
347
+ * Best effort by design: a failure here must not fail the write that already
348
+ * landed, and it says why on stderr rather than swallowing it.
349
+ */
350
+ private emitAgentUpsertFromStorage;
326
351
  /**
327
352
  * Main entry point for processing session messages
328
353
  */
@@ -1068,6 +1068,15 @@ export class Session {
1068
1068
  }
1069
1069
  }
1070
1070
  payload.archivedAt = storedRecord?.archivedAt ?? null;
1071
+ /*
1072
+ * Read off the STORED record, exactly like `archivedAt` above.
1073
+ *
1074
+ * `toAgentPayload` takes a live `ManagedAgent`, which has no snooze field:
1075
+ * the ledger lives on the stored record. This call site already holds that
1076
+ * record, which is why archivedAt is set here rather than inside the pure
1077
+ * projection, and snooze belongs in the same place for the same reason.
1078
+ */
1079
+ payload.snooze = storedRecord?.snooze ?? null;
1071
1080
  return payload;
1072
1081
  }
1073
1082
  buildStoredAgentPayload(record, registeredProviderIds = new Set(this.providerSnapshotManager.listRegisteredProviderIds())) {
@@ -1108,6 +1117,50 @@ export class Session {
1108
1117
  return null;
1109
1118
  return this.buildProjectPlacementForWorkspace(workspace, project);
1110
1119
  }
1120
+ /**
1121
+ * Broadcast a metadata write so every connected client's store sees it.
1122
+ *
1123
+ * `updateAgentMetadata` has two branches: a LIVE agent goes through
1124
+ * `writeLabels` / `setDigest`, which notify, and an agent the daemon has not
1125
+ * loaded falls through to `writeStoredMetadata`, which emits nothing at all.
1126
+ * Most of a triage backlog is the second kind, and the request/response the
1127
+ * caller gets back is point to point: nothing writes it into the app's store.
1128
+ *
1129
+ * So a kanban move on an idle session closed its sheet reporting success and
1130
+ * the digest kept showing the old column for the rest of the sitting, and an
1131
+ * answered decision advanced the card and came back on the next lap with the
1132
+ * same question. Answering it again succeeded, because
1133
+ * `answerPendingDecision` overwrites rather than refusing, which spent two
1134
+ * acts of the daily budget on one decision and sent the agent two prompts.
1135
+ *
1136
+ * The feed's own compensating refresh does not cover this: it invalidates
1137
+ * `agentHistoryQueryKey`, and `useAgentHistory` is mounted on the sessions
1138
+ * screen and the tag-colours card, neither of which is mounted on the reels
1139
+ * route, so the invalidation has no observer and refetches nothing.
1140
+ *
1141
+ * Best effort by design: a failure here must not fail the write that already
1142
+ * landed, and it says why on stderr rather than swallowing it.
1143
+ */
1144
+ async emitAgentUpsertFromStorage(agentId) {
1145
+ try {
1146
+ const record = await this.agentStorage.get(agentId);
1147
+ if (!record)
1148
+ return;
1149
+ const agent = this.buildStoredAgentPayload(record);
1150
+ // `workspaceId` is optional on the record: an agent outside a workspace has
1151
+ // no project placement, and the payload's `project` is optional too.
1152
+ const project = record.workspaceId
1153
+ ? await this.buildProjectPlacementForWorkspaceId(record.workspaceId)
1154
+ : null;
1155
+ this.emit({
1156
+ type: "agent_update",
1157
+ payload: { kind: "upsert", agent, ...(project ? { project } : {}) },
1158
+ });
1159
+ }
1160
+ catch (error) {
1161
+ console.warn(`[session] could not broadcast the metadata write for ${agentId}:`, error instanceof Error ? error.message : String(error));
1162
+ }
1163
+ }
1111
1164
  /**
1112
1165
  * Main entry point for processing session messages
1113
1166
  */
@@ -2866,6 +2919,7 @@ export class Session {
2866
2919
  at: new Date().toISOString(),
2867
2920
  };
2868
2921
  await this.agentManager.updateAgentMetadata(agentId, { snooze: next });
2922
+ await this.emitAgentUpsertFromStorage(agentId);
2869
2923
  this.emit({
2870
2924
  type: "agent.snooze.response",
2871
2925
  payload: { requestId, agentId, accepted: true, snooze: next, error: null },
@@ -2905,6 +2959,7 @@ export class Session {
2905
2959
  await this.agentManager.updateAgentMetadata(agentId, {
2906
2960
  digest: { ...digest, pendingDecisions: result.decisions },
2907
2961
  });
2962
+ await this.emitAgentUpsertFromStorage(agentId);
2908
2963
  this.emit({
2909
2964
  type: "agent.decision.answer.response",
2910
2965
  payload: {
@@ -849,7 +849,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{v
849
849
  __d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.shouldAppendSitemap=u,e.shouldAppendNotFound=s,e.getRootStackRouteNames=function(){const t=[n.INTERNAL_SLOT_NAME];s()&&t.push(n.NOT_FOUND_ROUTE_NAME);u()&&t.push(n.SITEMAP_ROUTE_NAME);return t};const o=t(r(d[0])),n=r(d[1]);function u(){const t=o.default.expoConfig?.extra?.router;return!1!==t?.sitemap}function s(){const t=o.default.expoConfig?.extra?.router;return!1!==t?.notFound}},717,[718,721]);
850
850
  __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"AppOwnership",{enumerable:!0,get:function(){return l.AppOwnership}}),Object.defineProperty(_e,"ExecutionEnvironment",{enumerable:!0,get:function(){return l.ExecutionEnvironment}}),Object.defineProperty(_e,"UserInterfaceIdiom",{enumerable:!0,get:function(){return l.UserInterfaceIdiom}});var n=e(r(d[0])),t=r(d[1]);r(d[2]);var u=e(r(d[3])),l=r(d[4]),o=e(r(d[5]));o.default||console.warn("No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?");const s=(0,t.requireOptionalNativeModule)('ExpoUpdates');let f=null;if(s){let e;s.manifest?e=s.manifest:s.manifestString&&(e=JSON.parse(s.manifestString)),e&&Object.keys(e).length>0&&(f=e)}let c=null;if(u.default.EXDevLauncher){let e;u.default.EXDevLauncher.manifestString&&(e=JSON.parse(u.default.EXDevLauncher.manifestString)),e&&Object.keys(e).length>0&&(c=e)}let p=null;if(o.default&&o.default.manifest){const e=o.default.manifest;p='string'==typeof e?JSON.parse(e):e}let b=f??c??p;const E=o.default||{},{appOwnership:O}=E,x=(0,n.default)(E,["name","appOwnership"]),v=Object.assign({},x,{appOwnership:O??null});function _(e){return!h(e)}function h(e){return'metadata'in e}function S(e=!1){if(!b){const e=null===b?'null':'undefined';if(x.executionEnvironment,l.ExecutionEnvironment.Bare,x.executionEnvironment===l.ExecutionEnvironment.StoreClient||x.executionEnvironment===l.ExecutionEnvironment.Standalone)throw new t.CodedError('ERR_CONSTANTS_MANIFEST_UNAVAILABLE',`Constants.manifest is ${e}, must be an object.`)}return b}Object.defineProperties(v,{__unsafeNoWarnManifest:{get(){const e=S(!0);return e&&_(e)?e:null},enumerable:!1},__unsafeNoWarnManifest2:{get(){const e=S(!0);return e&&h(e)?e:null},enumerable:!1},manifest:{get(){const e=S();return e&&_(e)?e:null},enumerable:!0},manifest2:{get(){const e=S();return e&&h(e)?e:null},enumerable:!0},expoConfig:{get(){const e=S(!0);return e?s&&s.isEmbeddedLaunch?p:h(e)?e.extra?.expoClient??null:_(e)?e:null:null},enumerable:!0},expoGoConfig:{get(){const e=S(!0);return e?h(e)?e.extra?.expoGo??null:_(e)?e:null:null},enumerable:!0},easConfig:{get(){const e=S(!0);return e?h(e)?e.extra?.eas??null:_(e)?e:null:null},enumerable:!0},__rawManifest_TEST:{get:()=>b,set(e){b=e},enumerable:!1}});var N=v},718,[35,4,25,637,719,720]);
851
851
  __d(function(g,r,i,a,m,e,d){"use strict";var t,n,o;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AppOwnership",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ExecutionEnvironment",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"UserInterfaceIdiom",{enumerable:!0,get:function(){return o}}),(function(t){t.Expo="expo"})(t||(t={})),(function(t){t.Bare="bare",t.Standalone="standalone",t.StoreClient="storeClient"})(n||(n={})),(function(t){t.Handset="handset",t.Tablet="tablet",t.Desktop="desktop",t.TV="tv",t.Unsupported="unsupported"})(o||(o={}))},719,[]);
852
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var t=r(d[0]);const n=(Date.now()+'-'+Math.floor(1e9*Math.random())).toString();function o(){if('undefined'!=typeof navigator&&'string'==typeof navigator.userAgent){const t=navigator.userAgent.toLowerCase();if(t.includes('edge'))return'Edge';if(t.includes('edg'))return'Chromium Edge';if(t.includes('opr')&&'opr'in window&&window.opr)return'Opera';if(t.includes('chrome')&&'chrome'in window&&window.chrome)return'Chrome';if(t.includes('trident'))return'IE';if(t.includes('firefox'))return'Firefox';if(t.includes('safari'))return'Safari'}}var s={get appOwnership(){return null},get executionEnvironment(){return t.ExecutionEnvironment.Bare},get sessionId(){return n},get isHeadless(){return'undefined'==typeof navigator||/\bHeadlessChrome\//.test(navigator.userAgent)},get expoVersion(){return this.manifest.sdkVersion||null},get linkingUri(){return'undefined'!=typeof location?location.origin:''},get expoRuntimeVersion(){return this.expoVersion},get deviceName(){return o()},get systemFonts(){return[]},get statusBarHeight(){return 0},get deviceYearClass(){return null},get manifest(){return"{\"name\":\"Paseo\",\"slug\":\"paseo-hyperdrive\",\"version\":\"0.3.125\",\"orientation\":\"portrait\",\"icon\":\"./assets/images/icon.png\",\"scheme\":\"paseo\",\"userInterfaceStyle\":\"automatic\",\"newArchEnabled\":true,\"web\":{\"output\":\"single\",\"favicon\":\"./assets/images/favicon.png\",\"shortName\":\"Paseo\",\"orientation\":\"portrait\",\"name\":\"Paseo\"},\"autolinking\":{\"searchPaths\":[\"../../node_modules\",\"./node_modules\"]},\"experiments\":{\"typedRoutes\":true,\"reactCompiler\":true,\"autolinkingModuleResolution\":true},\"extra\":{\"router\":{},\"eas\":{\"build\":{\"experimental\":{\"ios\":{\"appExtensions\":[{\"bundleIdentifier\":\"bot.hyperdrive.paseo.AgentActivity\",\"targetName\":\"AgentActivity\"}]}}}}},\"sdkVersion\":\"54.0.0\",\"platforms\":[\"ios\",\"android\",\"web\"]}"},get manifest2(){return null},get experienceUrl(){return'undefined'!=typeof location?location.origin:''},get debugMode(){return!1},getWebViewUserAgentAsync:async()=>'undefined'!=typeof navigator?navigator.userAgent:null}},720,[719]);
852
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var t=r(d[0]);const n=(Date.now()+'-'+Math.floor(1e9*Math.random())).toString();function o(){if('undefined'!=typeof navigator&&'string'==typeof navigator.userAgent){const t=navigator.userAgent.toLowerCase();if(t.includes('edge'))return'Edge';if(t.includes('edg'))return'Chromium Edge';if(t.includes('opr')&&'opr'in window&&window.opr)return'Opera';if(t.includes('chrome')&&'chrome'in window&&window.chrome)return'Chrome';if(t.includes('trident'))return'IE';if(t.includes('firefox'))return'Firefox';if(t.includes('safari'))return'Safari'}}var s={get appOwnership(){return null},get executionEnvironment(){return t.ExecutionEnvironment.Bare},get sessionId(){return n},get isHeadless(){return'undefined'==typeof navigator||/\bHeadlessChrome\//.test(navigator.userAgent)},get expoVersion(){return this.manifest.sdkVersion||null},get linkingUri(){return'undefined'!=typeof location?location.origin:''},get expoRuntimeVersion(){return this.expoVersion},get deviceName(){return o()},get systemFonts(){return[]},get statusBarHeight(){return 0},get deviceYearClass(){return null},get manifest(){return"{\"name\":\"Paseo\",\"slug\":\"paseo-hyperdrive\",\"version\":\"0.3.126\",\"orientation\":\"portrait\",\"icon\":\"./assets/images/icon.png\",\"scheme\":\"paseo\",\"userInterfaceStyle\":\"automatic\",\"newArchEnabled\":true,\"web\":{\"output\":\"single\",\"favicon\":\"./assets/images/favicon.png\",\"shortName\":\"Paseo\",\"orientation\":\"portrait\",\"name\":\"Paseo\"},\"autolinking\":{\"searchPaths\":[\"../../node_modules\",\"./node_modules\"]},\"experiments\":{\"typedRoutes\":true,\"reactCompiler\":true,\"autolinkingModuleResolution\":true},\"extra\":{\"router\":{},\"eas\":{\"build\":{\"experimental\":{\"ios\":{\"appExtensions\":[{\"bundleIdentifier\":\"bot.hyperdrive.paseo.AgentActivity\",\"targetName\":\"AgentActivity\"}]}}}}},\"sdkVersion\":\"54.0.0\",\"platforms\":[\"ios\",\"android\",\"web\"]}"},get manifest2(){return null},get experienceUrl(){return'undefined'!=typeof location?location.origin:''},get debugMode(){return!1},getWebViewUserAgentAsync:async()=>'undefined'!=typeof navigator?navigator.userAgent:null}},720,[719]);
853
853
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SITEMAP_ROUTE_NAME=e.NOT_FOUND_ROUTE_NAME=e.INTERNAL_SLOT_NAME=void 0,e.INTERNAL_SLOT_NAME='__root',e.NOT_FOUND_ROUTE_NAME='+not-found',e.SITEMAP_ROUTE_NAME='_sitemap'},721,[]);
854
854
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveHref=void 0,e.resolveHrefStringWithSegments=function(t,{segments:n=[],params:s={}}={},{relativeToDirectory:o}={}){if(t.startsWith('.')){let c=n?.map(t=>{if(!t.startsWith('['))return t;if(t.startsWith('[...')){t=t.slice(4,-1);const n=s[t];return Array.isArray(n)?n.join('/'):n?.split(',')?.join('/')??''}return t=t.slice(1,-1),s[t]}).filter(Boolean).join('/')??'/';o&&(c=`${c}/`);const f=new URL(t,`http://hostname/${c}`);t=`${f.pathname}${f.search}`}return t};function t(t,s){for(const[o,c=""]of Object.entries(s)){const f=`[${o}]`,l=`[...${o}]`;if(t.includes(f))t=t.replace(f,n(c));else{if(!t.includes(l))continue;t=t.replace(l,n(c))}delete s[o]}return{pathname:t,params:s}}function n(t){return Array.isArray(t)?t.map(t=>n(t)).join('/'):encodeURIComponent(t.toString())}function s(t){return Object.entries(t).filter(([,t])=>null!=t).map(([t,n])=>`${t}=${encodeURIComponent(n.toString())}`).join('&')}e.resolveHref=n=>{if('string'==typeof n)return(0,e.resolveHref)({pathname:n});const o=n.pathname??'';if(!n?.params)return o;const{pathname:c,params:f}=t(o,Object.assign({},n.params)),l=s(f);return c+(l?`?${l}`:'')}},722,[]);
855
855
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isRoutePreloadedInStack=function(t,o){if(!t||'stack'!==t.type)return!1;return t.preloadedRoutes.some(t=>t.key===o.key)}},723,[]);
@@ -15057,7 +15057,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
15057
15057
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"decodeOfferFragmentPayload",{enumerable:!0,get:function(){return n.decodeOfferFragmentPayload}}),Object.defineProperty(e,"buildDaemonWebSocketUrl",{enumerable:!0,get:function(){return t.buildDaemonWebSocketUrl}}),Object.defineProperty(e,"deriveLabelFromEndpoint",{enumerable:!0,get:function(){return t.deriveLabelFromEndpoint}}),Object.defineProperty(e,"extractHostPortFromWebSocketUrl",{enumerable:!0,get:function(){return t.extractHostPortFromWebSocketUrl}}),Object.defineProperty(e,"normalizeHostPort",{enumerable:!0,get:function(){return t.normalizeHostPort}}),Object.defineProperty(e,"parseConnectionUri",{enumerable:!0,get:function(){return t.parseConnectionUri}}),Object.defineProperty(e,"parseHostPort",{enumerable:!0,get:function(){return t.parseHostPort}}),Object.defineProperty(e,"serializeConnectionUri",{enumerable:!0,get:function(){return t.serializeConnectionUri}}),Object.defineProperty(e,"serializeConnectionUriForStorage",{enumerable:!0,get:function(){return t.serializeConnectionUriForStorage}}),Object.defineProperty(e,"shouldUseTlsForDefaultHostedRelay",{enumerable:!0,get:function(){return t.shouldUseTlsForDefaultHostedRelay}}),e.buildRelayWebSocketUrl=function(n){return(0,t.buildRelayWebSocketUrl)(Object.assign({},n,{role:"client"}))};var t=r(d[0]),n=r(d[1])},3412,[3392,3413]);
15058
15058
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ConnectionOfferV2Schema",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ConnectionOfferSchema",{enumerable:!0,get:function(){return o}}),e.decodeOfferFragmentPayload=l,e.parseConnectionOfferFromUrl=function(n){const t=f(n);if(!t)return null;const c=l(t);return o.parse(c)};var n=r(d[0]);const t=n.z.object({v:n.z.literal(2),serverId:n.z.string().min(1),daemonPublicKeyB64:n.z.string().min(1),relay:n.z.object({endpoint:n.z.string().min(1),useTls:n.z.boolean().optional()})}),o=t;function c(n){const t=n.replace(/-/g,"+").replace(/_/g,"/"),o=t.padEnd(t.length+(4-t.length%4)%4,"="),c=globalThis.atob(o),l=Uint8Array.from(c,n=>n.charCodeAt(0));return new TextDecoder("utf-8",{fatal:!0}).decode(l)}function l(n){const t=c(n);return JSON.parse(t)}const u="#offer=";function f(n){const t=n.trim();if(!t)return null;const o=t.indexOf(u);if(-1===o)return null;const c=t.slice(o+u.length).trim();return c.length>0?c:null}},3413,[3285]);
15059
15059
  __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.resolveAppVersion=function(){const e=u(t.default?.version);if(e)return e;const o=u(n.default.expoConfig?.version);if(o)return o;const f=u(n.default.manifest?.version);if(f)return f;return null};var n=e(r(d[0])),t=e(r(d[1]));function u(e){if("string"!=typeof e)return null;const n=e.trim();return 0===n.length?null:n}},3414,[718,3415]);
15060
- __d(function(e,t,r,a,i,o,n){i.exports={name:"@hyperdrive.bot/fleet-app",version:"0.3.125",private:!0,main:"index.ts",scripts:{start:"npm run start:expo","start:expo":"cross-env APP_VARIANT=development expo start","reset-project":"node ./scripts/reset-project.js","build:terminal-webview":"node ./scripts/build-terminal-webview-html.mjs","eas-build-post-install":"npm --prefix ../.. run build:app-deps && npm run build:terminal-webview",android:"npm run android:development","android:development":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo prebuild --platform android --non-interactive && cross-env APP_VARIANT=development expo run:android --variant=debug","android:production":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=production expo prebuild --platform android --non-interactive && cross-env APP_VARIANT=production expo run:android --variant=release","android:release":"npm run android:production","android:clear":"node -e \"require('node:fs').rmSync('android', { recursive: true, force: true })\"",ios:"npm --prefix ../.. run build:client && expo run:ios","ios:release":"npm --prefix ../.. run build:client && expo run:ios --configuration Release",web:"npm --prefix ../.. run build:client && concurrently --kill-others --names protocol,client,expo --prefix-colors yellow,blue,magenta \"npm --prefix ../.. run watch:protocol\" \"npm --prefix ../.. run watch:client\" \"npm run web:expo\"","web:expo":"expo start --web",lint:"expo lint",typecheck:"tsgo --noEmit",test:"vitest run","test:browser":"vitest run --project browser","test:e2e":"playwright test --project='Desktop Chrome'","test:e2e:real":"cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=real-provider","test:e2e:ui":"playwright test --ui","test:coverage":"vitest run --project unit --coverage",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web --source-maps","profile:workspace-tabs":"node ./scripts/profile-workspace-tabs.mjs","deploy:web":"npm run build:web && wrangler pages deploy dist --project-name paseo-app --branch main"},dependencies:{"@bacons/apple-targets":"4.0.6","@datadog/browser-rum":"^6.23.0","@datadog/browser-rum-react":"^6.23.0","@datadog/mobile-react-native":"^2.7.0","@datadog/mobile-react-native-session-replay":"^2.14.8","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@expo/image-utils":"0.8.8","@expo/plist":"0.4.9","@expo/prebuild-config":"54.0.8","@floating-ui/react-native":"^0.10.7","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@hyperdrive.bot/fleet-client":"*","@hyperdrive.bot/fleet-expo-two-way-audio":"*","@hyperdrive.bot/fleet-extension-sdk":"*","@hyperdrive.bot/fleet-highlight":"*","@react-native-async-storage/async-storage":"2.2.0","@react-native-masked-view/masked-view":"^0.3.2","@react-native/normalize-colors":"^0.81.5","@react-navigation/native":"^7.1.8","@sentry/electron":"^6.11.0","@sentry/react-native":"^6.20.0","@tanstack/react-query":"^5.90.11","@tanstack/react-virtual":"^3.13.21","@xterm/addon-clipboard":"^0.3.0-beta.213","@xterm/addon-fit":"^0.12.0-beta.213","@xterm/addon-image":"^0.10.0-beta.213","@xterm/addon-ligatures":"0.11.0-beta.213","@xterm/addon-search":"^0.17.0-beta.213","@xterm/addon-unicode11":"^0.10.0-beta.213","@xterm/addon-web-links":"^0.13.0-beta.213","@xterm/addon-webgl":"^0.20.0-beta.212","@xterm/xterm":"^6.1.0-beta.213",buffer:"^6.0.3",expo:"^54.0.18","expo-asset":"~12.0.12","expo-audio":"~1.0.13","expo-background-fetch":"~14.0.9","expo-build-properties":"^1.0.9","expo-camera":"~17.0.10","expo-clipboard":"~8.0.7","expo-constants":"~18.0.9","expo-crypto":"^15.0.8","expo-dev-client":"^6.0.15","expo-document-picker":"~14.0.8","expo-file-system":"~19.0.17","expo-haptics":"~15.0.7","expo-image":"~3.0.10","expo-image-manipulator":"~14.0.8","expo-image-picker":"^17.0.8","expo-keep-awake":"^15.0.7","expo-linking":"~8.0.8","expo-localization":"~17.0.9","expo-notifications":"^0.32.16","expo-router":"~6.0.13","expo-sharing":"^14.0.8","expo-speech":"~14.0.8","expo-speech-recognition":"^56.0.1","expo-splash-screen":"~31.0.10","expo-system-ui":"~6.0.7","expo-task-manager":"~14.0.9","expo-video":"~3.0.16","fast-deep-equal":"^3.1.3",htmlparser2:"^12.0.0",i18next:"^26.3.0","lucide-react-native":"^0.546.0","markdown-it":"^10.0.0","mnemonic-id":"^3.2.7",qrcode:"^1.5.4",react:"19.1.0","react-dom":"19.1.0","react-i18next":"^17.0.8","react-native":"0.81.5","react-native-draggable-flatlist":"^4.0.3","react-native-edge-to-edge":"^1.7.0","react-native-gesture-handler":"~2.28.0","react-native-keyboard-controller":"^1.21.7","react-native-markdown-display":"^7.0.2","react-native-nitro-modules":"0.35.5","react-native-reanimated":"~4.3.1","react-native-safe-area-context":"~5.6.0","react-native-screens":"~4.16.0","react-native-svg":"^15.14.0","react-native-uitextview":"^2.2.0","react-native-unistyles":"^3.2.4","react-native-web":"~0.21.0","react-native-webview":"^13.16.0","react-native-worklets":"~0.8.3","tiny-invariant":"^1.3.3","use-sync-external-store":"^1.6.0",zod:"^4.4.3",zustand:"^5.0.9"},devDependencies:{"@playwright/test":"^1.56.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/chai":"^5.2.2","@types/markdown-it":"^14.1.2","@types/qrcode":"^1.5.6","@types/react":"~19.2.0","@types/ws":"^8.18.1","@vitest/browser":"^4.1.7","@vitest/browser-playwright":"^4.1.7","@vitest/coverage-v8":"^4.1.7","@xterm/headless":"^6.1.0-beta.213",dotenv:"^17.2.3",eslint:"^9.25.0","eslint-config-expo":"~10.0.0",jsdom:"^20.0.3","material-icon-theme":"^5.32.0",playwright:"^1.56.1","serve-sim":"^0.1.40",typescript:"~5.9.2",vitest:"^4.1.6",wrangler:"^4.105.0",ws:"^8.20.0"}}},3415,[]);
15060
+ __d(function(e,t,r,a,i,o,n){i.exports={name:"@hyperdrive.bot/fleet-app",version:"0.3.126",private:!0,main:"index.ts",scripts:{start:"npm run start:expo","start:expo":"cross-env APP_VARIANT=development expo start","reset-project":"node ./scripts/reset-project.js","build:terminal-webview":"node ./scripts/build-terminal-webview-html.mjs","eas-build-post-install":"npm --prefix ../.. run build:app-deps && npm run build:terminal-webview",android:"npm run android:development","android:development":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo prebuild --platform android --non-interactive && cross-env APP_VARIANT=development expo run:android --variant=debug","android:production":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=production expo prebuild --platform android --non-interactive && cross-env APP_VARIANT=production expo run:android --variant=release","android:release":"npm run android:production","android:clear":"node -e \"require('node:fs').rmSync('android', { recursive: true, force: true })\"",ios:"npm --prefix ../.. run build:client && expo run:ios","ios:release":"npm --prefix ../.. run build:client && expo run:ios --configuration Release",web:"npm --prefix ../.. run build:client && concurrently --kill-others --names protocol,client,expo --prefix-colors yellow,blue,magenta \"npm --prefix ../.. run watch:protocol\" \"npm --prefix ../.. run watch:client\" \"npm run web:expo\"","web:expo":"expo start --web",lint:"expo lint",typecheck:"tsgo --noEmit",test:"vitest run","test:browser":"vitest run --project browser","test:e2e":"playwright test --project='Desktop Chrome'","test:e2e:real":"cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=real-provider","test:e2e:ui":"playwright test --ui","test:coverage":"vitest run --project unit --coverage",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web --source-maps","profile:workspace-tabs":"node ./scripts/profile-workspace-tabs.mjs","deploy:web":"npm run build:web && wrangler pages deploy dist --project-name paseo-app --branch main"},dependencies:{"@bacons/apple-targets":"4.0.6","@datadog/browser-rum":"^6.23.0","@datadog/browser-rum-react":"^6.23.0","@datadog/mobile-react-native":"^2.7.0","@datadog/mobile-react-native-session-replay":"^2.14.8","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@expo/image-utils":"0.8.8","@expo/plist":"0.4.9","@expo/prebuild-config":"54.0.8","@floating-ui/react-native":"^0.10.7","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@hyperdrive.bot/fleet-client":"*","@hyperdrive.bot/fleet-expo-two-way-audio":"*","@hyperdrive.bot/fleet-extension-sdk":"*","@hyperdrive.bot/fleet-highlight":"*","@react-native-async-storage/async-storage":"2.2.0","@react-native-masked-view/masked-view":"^0.3.2","@react-native/normalize-colors":"^0.81.5","@react-navigation/native":"^7.1.8","@sentry/electron":"^6.11.0","@sentry/react-native":"^6.20.0","@tanstack/react-query":"^5.90.11","@tanstack/react-virtual":"^3.13.21","@xterm/addon-clipboard":"^0.3.0-beta.213","@xterm/addon-fit":"^0.12.0-beta.213","@xterm/addon-image":"^0.10.0-beta.213","@xterm/addon-ligatures":"0.11.0-beta.213","@xterm/addon-search":"^0.17.0-beta.213","@xterm/addon-unicode11":"^0.10.0-beta.213","@xterm/addon-web-links":"^0.13.0-beta.213","@xterm/addon-webgl":"^0.20.0-beta.212","@xterm/xterm":"^6.1.0-beta.213",buffer:"^6.0.3",expo:"^54.0.18","expo-asset":"~12.0.12","expo-audio":"~1.0.13","expo-background-fetch":"~14.0.9","expo-build-properties":"^1.0.9","expo-camera":"~17.0.10","expo-clipboard":"~8.0.7","expo-constants":"~18.0.9","expo-crypto":"^15.0.8","expo-dev-client":"^6.0.15","expo-document-picker":"~14.0.8","expo-file-system":"~19.0.17","expo-haptics":"~15.0.7","expo-image":"~3.0.10","expo-image-manipulator":"~14.0.8","expo-image-picker":"^17.0.8","expo-keep-awake":"^15.0.7","expo-linking":"~8.0.8","expo-localization":"~17.0.9","expo-notifications":"^0.32.16","expo-router":"~6.0.13","expo-sharing":"^14.0.8","expo-speech":"~14.0.8","expo-speech-recognition":"^56.0.1","expo-splash-screen":"~31.0.10","expo-system-ui":"~6.0.7","expo-task-manager":"~14.0.9","expo-video":"~3.0.16","fast-deep-equal":"^3.1.3",htmlparser2:"^12.0.0",i18next:"^26.3.0","lucide-react-native":"^0.546.0","markdown-it":"^10.0.0","mnemonic-id":"^3.2.7",qrcode:"^1.5.4",react:"19.1.0","react-dom":"19.1.0","react-i18next":"^17.0.8","react-native":"0.81.5","react-native-draggable-flatlist":"^4.0.3","react-native-edge-to-edge":"^1.7.0","react-native-gesture-handler":"~2.28.0","react-native-keyboard-controller":"^1.21.7","react-native-markdown-display":"^7.0.2","react-native-nitro-modules":"0.35.5","react-native-reanimated":"~4.3.1","react-native-safe-area-context":"~5.6.0","react-native-screens":"~4.16.0","react-native-svg":"^15.14.0","react-native-uitextview":"^2.2.0","react-native-unistyles":"^3.2.4","react-native-web":"~0.21.0","react-native-webview":"^13.16.0","react-native-worklets":"~0.8.3","tiny-invariant":"^1.3.3","use-sync-external-store":"^1.6.0",zod:"^4.4.3",zustand:"^5.0.9"},devDependencies:{"@playwright/test":"^1.56.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/chai":"^5.2.2","@types/markdown-it":"^14.1.2","@types/qrcode":"^1.5.6","@types/react":"~19.2.0","@types/ws":"^8.18.1","@vitest/browser":"^4.1.7","@vitest/browser-playwright":"^4.1.7","@vitest/coverage-v8":"^4.1.7","@xterm/headless":"^6.1.0-beta.213",dotenv:"^17.2.3",eslint:"^9.25.0","eslint-config-expo":"~10.0.0",jsdom:"^20.0.3","material-icon-theme":"^5.32.0",playwright:"^1.56.1","serve-sim":"^0.1.40",typescript:"~5.9.2",vitest:"^4.1.6",wrangler:"^4.105.0",ws:"^8.20.0"}}},3415,[]);
15061
15061
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shouldUseDesktopDaemon=function(){return(0,n.isElectronRuntime)()},e.getDesktopDaemonStatus=async function(){return c(await(0,t.invokeDesktopCommand)("desktop_daemon_status"))},e.startDesktopDaemon=async function(){return c(await(0,t.invokeDesktopCommand)("start_desktop_daemon"))},e.stopDesktopDaemon=async function(n="manual_ipc"){return c(await(0,t.invokeDesktopCommand)("stop_desktop_daemon",{reason:n}))},e.restartDesktopDaemon=async function(){return c(await(0,t.invokeDesktopCommand)("restart_desktop_daemon"))},e.getDesktopDaemonLogs=async function(){return p(await(0,t.invokeDesktopCommand)("desktop_daemon_logs"))},e.getDesktopDaemonPairing=async function(){return k(await(0,t.invokeDesktopCommand)("desktop_daemon_pairing"))},e.getCliDaemonStatus=async function(){const n=await(0,t.invokeDesktopCommand)("cli_daemon_status");if("string"!=typeof n)throw new Error("Unexpected CLI daemon status response.");return n},e.listenToLocalTransportEvents=async function(t){const u=(0,n.getDesktopHost)()?.events?.on;if("function"!=typeof u)throw new Error("Desktop events API is unavailable.");const c=await u("local-daemon-transport-event",n=>{o(n)&&t({sessionId:s(n.sessionId)??"",kind:s(n.kind)??"error",text:s(n.text),binaryBase64:s(n.binaryBase64),code:l(n.code),reason:s(n.reason),error:s(n.error)})});return"function"==typeof c?c:()=>{}},e.openLocalTransportSession=async function(n){const o=await(0,t.invokeDesktopCommand)("open_local_daemon_transport",n);if("string"!=typeof o||0===o.trim().length)throw new Error("Unexpected local transport session response.");return o},e.sendLocalTransportMessage=async function(n){await(0,t.invokeDesktopCommand)("send_local_daemon_transport_message",Object.assign({sessionId:n.sessionId},n.text?{text:n.text}:{},n.binaryBase64?{binaryBase64:n.binaryBase64}:{}))},e.closeLocalTransportSession=async function(n){await(0,t.invokeDesktopCommand)("close_local_daemon_transport",{sessionId:n})},e.getCliInstallStatus=async function(){return f(await(0,t.invokeDesktopCommand)("get_cli_install_status"))},e.installCli=async function(){return f(await(0,t.invokeDesktopCommand)("install_cli"))},e.getSkillsStatus=async function(){return y(await(0,t.invokeDesktopCommand)("get_skills_status"))},e.installSkills=async function(){return y(await(0,t.invokeDesktopCommand)("install_skills"))},e.updateSkills=async function(){return y(await(0,t.invokeDesktopCommand)("update_skills"))},e.uninstallSkills=async function(){return y(await(0,t.invokeDesktopCommand)("uninstall_skills"))};var n=r(d[0]),t=r(d[1]);function o(n){return"object"==typeof n&&null!==n}function s(n){return"string"==typeof n&&n.trim().length>0?n:null}function l(n){return"number"==typeof n&&Number.isFinite(n)?n:null}function u(n){const t=s(n)?.toLowerCase();switch(t){case"starting":return"starting";case"running":return"running";case"errored":case"error":return"errored";default:return"stopped"}}function c(n){if(!o(n))throw new Error("Unexpected desktop daemon status response.");return{serverId:s(n.serverId)??"",status:u(n.status),listen:s(n.listen),hostname:s(n.hostname),pid:l(n.pid),home:s(n.home)??"",version:s(n.version),desktopManaged:!0===n.desktopManaged,error:s(n.error)}}function p(n){if(!o(n))throw new Error("Unexpected desktop daemon logs response.");return{logPath:s(n.logPath)??"",contents:"string"==typeof n.contents?n.contents:""}}function k(n){if(!o(n))throw new Error("Unexpected desktop daemon pairing response.");return{relayEnabled:!0===n.relayEnabled,url:s(n.url),qr:s(n.qr)}}function f(n){if(!o(n))throw new Error("Unexpected install status response.");return{installed:!0===n.installed}}function w(n){switch(n){case"not-installed":case"up-to-date":case"drift":return n;default:throw new Error(`Unexpected skills status state: ${String(n)}`)}}function _(n){if(!o(n))throw new Error("Unexpected skill op response.");const t=s(n.name);if(!t)throw new Error("Skill op missing name.");switch(n.kind){case"add":return{kind:"add",name:t};case"update":return{kind:"update",name:t};case"delete":return{kind:"delete",name:t};default:throw new Error(`Unexpected skill op kind: ${String(n.kind)}`)}}function y(n){if(!o(n))throw new Error("Unexpected skills status response.");const t=Array.isArray(n.ops)?n.ops.map(_):[];return{state:w(n.state),ops:t}}},3416,[3417,3419]);
15062
15062
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getDesktopHost=n,e.isElectronRuntime=o,e.isElectronRuntimeMac=function(){if(!o())return!1;if("undefined"==typeof navigator)return!1;const t=n()?.platform?.toLowerCase();if("darwin"===t||"mac"===t||"macos"===t)return!0;const u=navigator.userAgent;return u.includes("Mac OS")||u.includes("Macintosh")},r(d[0]);var t=r(d[1]);function n(){return(0,t.getElectronHost)()}function o(){return null!==n()}},3417,[25,3418]);
15063
15063
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getElectronHost=function(){if("undefined"==typeof window)return null;const t=window.paseoDesktop;if(!t||"object"!=typeof t)return null;return t}},3418,[]);
@@ -15229,7 +15229,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
15229
15229
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"FileSystemSessionType",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"FileSystemUploadType",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"EncodingType",{enumerable:!0,get:function(){return u}});let n=(function(n){return n[n.BACKGROUND=0]="BACKGROUND",n[n.FOREGROUND=1]="FOREGROUND",n})({}),t=(function(n){return n[n.BINARY_CONTENT=0]="BINARY_CONTENT",n[n.MULTIPART=1]="MULTIPART",n})({}),u=(function(n){return n.UTF8="utf8",n.Base64="base64",n})({})},3574,[]);
15230
15230
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.isAvailableAsync=async function(){if(s.default)return!s.default.isAvailableAsync||await s.default.isAvailableAsync();return!1},_e.shareAsync=async function(e,t={}){if(!s.default||!s.default.shareAsync)throw new n.UnavailabilityError('Sharing','shareAsync');return await s.default.shareAsync(e,t)};var e,n=r(d[0]),t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e}},3575,[4,3576]);
15231
15231
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var n=r(d[0]),t={isAvailableAsync:async()=>'undefined'!=typeof navigator&&!!navigator.share,async shareAsync(t,s={}){if(!navigator.share)throw new n.UnavailabilityError('navigator','share');await navigator.share(Object.assign({},s,{url:t}))}}},3576,[4]);
15232
- __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.openExternalUrl=async function(o){if(t.isWeb){const e=(0,n.getDesktopHost)()?.opener?.openUrl;return"function"==typeof e?void await e(o):void window.open(o,"_blank","noopener,noreferrer")}await e.openURL(o)};var e=(function(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}),n.default=e,n})(r(_d[0])),n=r(_d[1]),t=r(_d[2])},3577,[746,3417,3420]);
15232
+ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.openExternalUrl=async function(o){if(t.isWeb){const e=(0,n.getDesktopHost)()?.opener?.openUrl;if("function"==typeof e)return void await e(o);if(!window.open(o,"_blank","noopener,noreferrer"))throw new Error("The browser blocked opening that link. Allow popups and try again.");return}await e.openURL(o)};var e=(function(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}),n.default=e,n})(r(_d[0])),n=r(_d[1]),t=r(_d[2])},3577,[746,3417,3420]);
15233
15233
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.QuittingOverlay=function(){const S=(0,o.c)(16),{t:h}=(0,s.useTranslation)(),{theme:v}=(0,u.useUnistyles)(),[x,b]=(0,l.useState)(!1);let j,z,M,k,T,q,E,I;S[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{if(!(0,f.getIsElectronRuntime)())return;let t=!1,n=null;return(0,p.listenToDesktopEvent)("quitting",()=>{t||b(!0)}).then(o=>{t?o():n=o}),()=>{t=!0,n?.()}},z=[],S[0]=j,S[1]=z):(j=S[0],z=S[1]);if((0,l.useEffect)(j,z),!x)return null;S[2]!==v.colors.foregroundMuted?(M=(0,_.jsx)(c.LoadingSpinner,{size:"large",color:v.colors.foregroundMuted}),S[2]=v.colors.foregroundMuted,S[3]=M):M=S[3];S[4]!==h?(k=h("desktop.quitting.title"),S[4]=h,S[5]=k):k=S[5];S[6]!==k?(T=(0,_.jsx)(n.Text,{style:y.title,children:k}),S[6]=k,S[7]=T):T=S[7];S[8]!==h?(q=h("desktop.quitting.detail"),S[8]=h,S[9]=q):q=S[9];S[10]!==q?(E=(0,_.jsx)(n.Text,{style:y.detail,children:q}),S[10]=q,S[11]=E):E=S[11];S[12]!==M||S[13]!==T||S[14]!==E?(I=(0,_.jsxs)(t.View,{style:y.overlay,children:[M,T,E]}),S[12]=M,S[13]=T,S[14]=E,S[15]=I):I=S[15];return I};var t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]);r(d[4]),r(d[5]);var s=r(d[6]),u=r(d[7]),c=r(d[8]),f=r(d[9]),p=r(d[10]),_=r(d[11]);const y=u.StyleSheet.create(t=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:t.colors.surface1,alignItems:"center",justifyContent:"center",gap:t.spacing[3],zIndex:9999,uni__dependencies:[0]},title:{color:t.colors.foreground,fontSize:t.fontSize.base,uni__dependencies:[0]},detail:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]}}))},3578,[348,349,350,36,234,146,352,56,3579,3472,3580,279]);
15234
15234
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LoadingSpinner=function(c){const s=(0,t.c)(3),{color:l,size:u}=c,v=void 0===u?"small":u;let _;s[0]!==l||s[1]!==v?(_=(0,n.jsx)(o.ActivityIndicator,{size:v,color:l}),s[0]=l,s[1]=v,s[2]=_):_=s[2];return _};var o=r(d[0]),t=r(d[1]);r(d[2]);var n=r(d[3])},3579,[2477,350,654,279]);
15235
15235
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.listenToDesktopEvent=async function(n,o){const s=(0,t.getDesktopHost)()?.events?.on;if("function"!=typeof s)throw new Error("Desktop event API is unavailable.");const c=await s(n,t=>{const n="object"==typeof t&&null!==t&&"payload"in t?t.payload:t;o(n)});return"function"==typeof c?c:()=>{}};var t=r(d[0])},3580,[3417]);
@@ -15769,10 +15769,10 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
15769
15769
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.countKanbanBucketMembers=c,e.useKanbanBucketCounts=function(u,o){const f=(0,n.c)(7);let l;f[0]!==u?(l=n=>n.sessions[u]?.agents,f[0]=u,f[1]=l):l=f[1];const b=(0,s.useSessionStore)(l),v=(0,t.useKanbanBuckets)(),k=(0,t.useDefaultBucketId)();let B;f[2]!==b||f[3]!==v||f[4]!==k||f[5]!==o?(B=c(b?.values()??[],v,k,o),f[2]=b,f[3]=v,f[4]=k,f[5]=o,f[6]=B):B=f[6];return B};var n=r(d[0]);r(d[1]);var t=r(d[2]),s=r(d[3]),u=r(d[4]),o=r(d[5]);function c(n,t,s,c){const f={};for(const n of t)f[n.id]=0;const l=new Set(t.map(n=>n.id));for(const t of n){if(t.archivedAt)continue;if((0,o.isDurableAgent)(t))continue;const n=c?.[t.id]??(0,u.resolveBucketId)(t,l,s);null!==n&&n in f&&(f[n]+=1)}return f}},4010,[350,36,4007,3427,4008,3632]);
15770
15770
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.buildCompactOverflowRows=function(t){const n=[];t.hasOrganize&&n.push({id:"screen",labelKey:"agentControls.options.screen",value:"",testID:"agent-controls-overflow-screen"});null!==t.thinkingLabel&&n.push({id:"thinking",labelKey:"agentControls.thinking.title",value:t.thinkingLabel,testID:"agent-controls-overflow-thinking"});t.hasOrganize&&(n.push({id:"bucket",labelKey:"agentControls.options.bucket",value:"",testID:"agent-controls-overflow-bucket"}),n.push({id:"tags",labelKey:"agentControls.options.tags",value:"",testID:"agent-controls-overflow-tags"}));return n},e.hasCompactOverflow=function(t,n){return t.length>0||n>0}},4011,[]);
15771
15771
  __d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ConversationDigestControl",{enumerable:!0,get:function(){return L}});var s=r(_d[0]),n=r(_d[1]),t=r(_d[2]),o=r(_d[3]),l=r(_d[4]);r(_d[5]),r(_d[6]),r(_d[7]);var d=r(_d[8]),c=r(_d[9]),u=r(_d[10]),p=r(_d[11]),b=r(_d[12]),f=r(_d[13]),x=r(_d[14]),h=r(_d[15]),y=r(_d[16]),S=r(_d[17]),v=r(_d[18]),_=r(_d[19]),j=r(_d[20]);const I=(0,d.withUnistyles)(u.ScrollText),k=s=>({color:s.colors.foregroundMuted}),w={title:"Session digest"};function P(s){const n=s.generatedAt??s.selfReportedAt;if(!n)return null;const t=new Date(n);return Number.isNaN(t.getTime())?null:`updated ${(0,_.formatTimeAgo)(t)}`}function R(t){const l=(0,o.c)(7),{label:d,value:c}=t;if(!c||!c.trim())return null;let u,p,b;return l[0]!==d?(u=(0,j.jsx)(n.Text,{style:H.sectionLabel,children:d}),l[0]=d,l[1]=u):u=l[1],l[2]!==c?(p=(0,j.jsx)(n.Text,{style:H.sectionValue,children:c}),l[2]=c,l[3]=p):p=l[3],l[4]!==u||l[5]!==p?(b=(0,j.jsxs)(s.View,{style:H.section,children:[u,p]}),l[4]=u,l[5]=p,l[6]=b):b=l[6],b}function D(t){const l=(0,o.c)(10),{label:d,items:c}=t;if(!c||0===c.length)return null;let u,p,b;if(l[0]!==d?(u=(0,j.jsx)(n.Text,{style:H.sectionLabel,children:d}),l[0]=d,l[1]=u):u=l[1],l[2]!==c||l[3]!==d){let s;l[5]!==d?(s=s=>(0,j.jsx)(n.Text,{style:H.sectionValue,children:`\u2022 ${s}`},`${d}:${s}`),l[5]=d,l[6]=s):s=l[6],p=c.map(s),l[2]=c,l[3]=d,l[4]=p}else p=l[4];return l[7]!==u||l[8]!==p?(b=(0,j.jsxs)(s.View,{style:H.section,children:[u,p]}),l[7]=u,l[8]=p,l[9]=b):b=l[9],b}function z(s){const l=(0,o.c)(16),{row:d}=s,c=(0,x.useToast)();let u;l[0]!==d.label||l[1]!==d.value||l[2]!==c?(u=()=>{(async()=>{await(0,v.copyToClipboard)(d.value),c.copied(`${d.label} id`)})()},l[0]=d.label,l[1]=d.value,l[2]=c,l[3]=u):u=l[3];const p=u,b=`Copy ${d.label} id`,f=`agent-digest-id-${d.key}`;let h,S,_,I;return l[4]!==d.label?(h=(0,j.jsx)(n.Text,{style:H.idLabel,children:d.label}),l[4]=d.label,l[5]=h):h=l[5],l[6]!==d.value?(S=(0,y.truncateSessionId)(d.value),l[6]=d.value,l[7]=S):S=l[7],l[8]!==S?(_=(0,j.jsx)(n.Text,{style:H.idValue,children:S}),l[8]=S,l[9]=_):_=l[9],l[10]!==p||l[11]!==b||l[12]!==f||l[13]!==h||l[14]!==_?(I=(0,j.jsxs)(t.Pressable,{onPress:p,style:V,accessibilityRole:"button",accessibilityLabel:b,testID:f,children:[h,_]}),l[10]=p,l[11]=b,l[12]=f,l[13]=h,l[14]=_,l[15]=I):I=l[15],I}function C({pressed:s,hovered:n}){return[H.badge,n&&H.badgeHovered,s&&H.badgePressed]}function T({pressed:s,hovered:n}){return[H.iconBadge,n&&H.badgeHovered,s&&H.badgePressed]}function V({pressed:s,hovered:n}){return[H.idRow,n&&H.idRowHovered,s&&H.idRowPressed]}function $(s,n){const t=(0,o.c)(3);let l;return t[0]!==n||t[1]!==s?(l=t=>{const o=t.sessions[s];return o?.agents?.get(n)?.digest??o?.agentDetails?.get(n)?.digest??null},t[0]=n,t[1]=s,t[2]=l):l=t[2],(0,S.useSessionStore)((0,c.useShallow)(l))}function F(s,n){const t=(0,o.c)(9);let l;t[0]!==n||t[1]!==s?(l=t=>{const o=t.sessions[s],l=o?.agents?.get(n)??o?.agentDetails?.get(n);return{persistenceProvider:l?.persistence?.provider,persistenceSessionId:l?.persistence?.sessionId??null,runtimeProvider:l?.runtimeInfo?.provider,runtimeSessionId:l?.runtimeInfo?.sessionId??null}},t[0]=n,t[1]=s,t[2]=l):l=t[2];const d=(0,S.useSessionStore)((0,c.useShallow)(l));let u;return t[3]!==n||t[4]!==d.persistenceProvider||t[5]!==d.persistenceSessionId||t[6]!==d.runtimeProvider||t[7]!==d.runtimeSessionId?(u=(0,y.buildSessionIdRows)({agentId:n,persistence:{provider:d.persistenceProvider,sessionId:d.persistenceSessionId},runtimeInfo:{provider:d.runtimeProvider,sessionId:d.runtimeSessionId}}),t[3]=n,t[4]=d.persistenceProvider,t[5]=d.persistenceSessionId,t[6]=d.runtimeProvider,t[7]=d.runtimeSessionId,t[8]=u):u=t[8],u}const L=(0,l.memo)(function(d){const c=(0,o.c)(50),{agentId:u,serverId:x}=d,y=(0,h.useSessionDigestFeatureEnabled)(x),S=(0,f.useIsCompactFormFactor)(),v=$(x,u),_=F(x,u),[z,V]=(0,l.useState)(!1);let L;c[0]===Symbol.for("react.memo_cache_sentinel")?(L=()=>V(!0),c[0]=L):L=c[0];const A=L;let N;c[1]===Symbol.for("react.memo_cache_sentinel")?(N=()=>V(!1),c[1]=N):N=c[1];const O=N;if(!(y&&v&&(E=v,E.goal||E.nextStep||E.summary||0!==(E.blockers?.length??0)||0!==(E.links?.length??0)||0!==(E.keyFiles?.length??0)||0!==(E.accomplishments?.length??0))))return null;var E;const G=v.blockers?.length??0;let K;c[2]!==v?(K=P(v),c[2]=v,c[3]=K):K=c[3];const U=K;let W;c[4]!==v.links?(W=v.links?.map(B),c[4]=v.links,c[5]=W):W=c[5];const q=W,J=G>0?`Session digest (${G} blocker${1===G?"":"s"})`:"Session digest";let Q,X,Y,Z,ee,se,ne,te,ie,oe,re,le,de,ce;return c[6]!==J||c[7]!==G||c[8]!==S?(Q=S?(0,j.jsxs)(t.Pressable,{onPress:A,style:T,accessibilityRole:"button",accessibilityLabel:J,testID:"agent-controls-digest",children:[(0,j.jsx)(I,{size:16,uniProps:k}),G>0?(0,j.jsx)(s.View,{style:H.dot}):null]}):(0,j.jsxs)(t.Pressable,{onPress:A,style:C,accessibilityRole:"button",accessibilityLabel:J,testID:"agent-digest-selector",children:[(0,j.jsx)(I,{size:16,uniProps:k}),G>0?(0,j.jsx)(s.View,{style:H.dot}):null]}),c[6]=J,c[7]=G,c[8]=S,c[9]=Q):Q=c[9],c[10]!==G||c[11]!==U?(X=G>0||U?(0,j.jsxs)(s.View,{style:H.metaRow,children:[G>0?(0,j.jsx)(n.Text,{style:H.blockedBadge,children:1===G?"Blocked":`${G} blockers`}):null,U?(0,j.jsx)(n.Text,{style:H.updated,children:U}):null]}):null,c[10]=G,c[11]=U,c[12]=X):X=c[12],c[13]!==u||c[14]!==v.pendingDecisions||c[15]!==x?(Y=(0,j.jsx)(b.DecisionChips,{serverId:x,agentId:u,decisions:v.pendingDecisions}),c[13]=u,c[14]=v.pendingDecisions,c[15]=x,c[16]=Y):Y=c[16],c[17]!==v.goal?(Z=(0,j.jsx)(R,{label:"Goal",value:v.goal}),c[17]=v.goal,c[18]=Z):Z=c[18],c[19]!==v.nextStep?(ee=(0,j.jsx)(R,{label:"Next step",value:v.nextStep}),c[19]=v.nextStep,c[20]=ee):ee=c[20],c[21]!==v.blockers?(se=(0,j.jsx)(D,{label:"Blockers",items:v.blockers}),c[21]=v.blockers,c[22]=se):se=c[22],c[23]!==v.summary?(ne=(0,j.jsx)(R,{label:"Summary",value:v.summary}),c[23]=v.summary,c[24]=ne):ne=c[24],c[25]!==v.accomplishments?(te=(0,j.jsx)(D,{label:"Accomplishments",items:v.accomplishments}),c[25]=v.accomplishments,c[26]=te):te=c[26],c[27]!==v.keyFiles?(ie=(0,j.jsx)(D,{label:"Key files",items:v.keyFiles}),c[27]=v.keyFiles,c[28]=ie):ie=c[28],c[29]!==q?(oe=(0,j.jsx)(D,{label:"Links",items:q}),c[29]=q,c[30]=oe):oe=c[30],c[31]!==_?(re=_.length>0?(0,j.jsxs)(s.View,{style:H.section,testID:"agent-digest-ids",children:[(0,j.jsx)(n.Text,{style:H.sectionLabel,children:"IDs"}),_.map(M)]}):null,c[31]=_,c[32]=re):re=c[32],c[33]!==se||c[34]!==ne||c[35]!==te||c[36]!==ie||c[37]!==oe||c[38]!==re||c[39]!==X||c[40]!==Y||c[41]!==Z||c[42]!==ee?(le=(0,j.jsxs)(s.View,{style:H.body,children:[X,Y,Z,ee,se,ne,te,ie,oe,re]}),c[33]=se,c[34]=ne,c[35]=te,c[36]=ie,c[37]=oe,c[38]=re,c[39]=X,c[40]=Y,c[41]=Z,c[42]=ee,c[43]=le):le=c[43],c[44]!==z||c[45]!==le?(de=(0,j.jsx)(p.AdaptiveModalSheet,{header:w,visible:z,onClose:O,testID:"agent-digest-sheet",children:le}),c[44]=z,c[45]=le,c[46]=de):de=c[46],c[47]!==de||c[48]!==Q?(ce=(0,j.jsxs)(j.Fragment,{children:[Q,de]}),c[47]=de,c[48]=Q,c[49]=ce):ce=c[49],ce}),H=d.StyleSheet.create(s=>({badge:{height:28,flexDirection:"row",alignItems:"center",backgroundColor:"transparent",gap:s.spacing[1],paddingHorizontal:s.spacing[2],borderRadius:s.borderRadius["2xl"],uni__dependencies:[0]},badgeHovered:{backgroundColor:s.colors.surface2,uni__dependencies:[0]},badgePressed:{backgroundColor:s.colors.surface0,uni__dependencies:[0]},iconBadge:{width:28,height:28,alignItems:"center",justifyContent:"center",backgroundColor:"transparent",borderRadius:s.borderRadius.full,uni__dependencies:[0]},dot:{position:"absolute",top:5,right:5,width:7,height:7,borderRadius:s.borderRadius.full,backgroundColor:s.colors.destructive,uni__dependencies:[0]},body:{gap:s.spacing[3],uni__dependencies:[0]},metaRow:{flexDirection:"row",alignItems:"center",gap:s.spacing[2],uni__dependencies:[0]},blockedBadge:{fontSize:s.fontSize.xs,paddingHorizontal:s.spacing[2],paddingVertical:s.spacing[1],borderRadius:s.spacing[1],overflow:"hidden",color:s.colors.destructiveForeground,backgroundColor:s.colors.destructive,uni__dependencies:[0]},updated:{fontSize:s.fontSize.xs,color:s.colors.foregroundMuted,uni__dependencies:[0]},section:{gap:s.spacing[1],uni__dependencies:[0]},sectionLabel:{fontSize:s.fontSize.xs,fontWeight:"600",textTransform:"uppercase",color:s.colors.foregroundMuted,uni__dependencies:[0]},sectionValue:{fontSize:s.fontSize.sm,lineHeight:20,color:s.colors.foreground,uni__dependencies:[0]},idRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.spacing[2],paddingVertical:s.spacing[1],paddingHorizontal:s.spacing[1],borderRadius:s.spacing[1],uni__dependencies:[0]},idRowHovered:{backgroundColor:s.colors.surface2,uni__dependencies:[0]},idRowPressed:{backgroundColor:s.colors.surface0,uni__dependencies:[0]},idLabel:{fontSize:s.fontSize.xs,color:s.colors.foregroundMuted,uni__dependencies:[0]},idValue:{fontFamily:s.fontFamily.mono,fontSize:s.fontSize.xs,color:s.colors.foreground,uni__dependencies:[0]}}));function B(s){return s.label?`${s.label} \u2014 ${s.url}`:s.url}function M(s){return(0,j.jsx)(z,{row:s},s.key)}},4012,[348,349,2476,350,36,546,234,146,56,3462,811,3481,4013,3472,3514,4021,4022,3427,3711,3526,279]);
15772
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANSWER_HOLD_SPEC",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"DecisionChips",{enumerable:!0,get:function(){return w}});var n=r(d[0]),o=r(d[1]),t=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);r(d[6]),r(d[7]),r(d[8]),r(d[9]);var u=r(d[10]),p=r(d[11]),h=r(d[12]),f=r(d[13]),b=r(d[14]);function x(n){const o=(0,c.c)(35),{optionId:u,glyph:p,label:h,recommended:x,disabled:_,onCommit:y}=n,[w,I]=(0,l.useState)(f.idleHold),[z,T]=(0,l.useState)(null),D=(0,l.useRef)(null);let R;o[0]===Symbol.for("react.memo_cache_sentinel")?(R=(0,f.idleHold)(),o[0]=R):R=o[0];const H=(0,l.useRef)(R);let C;o[1]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{null!==D.current&&(clearTimeout(D.current),D.current=null)},o[1]=C):C=o[1];const v=C;let O;o[2]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{T(null);const n=(0,f.press)(Date.now());H.current=n,I(n),v(),D.current=setTimeout(()=>{const n=(0,f.tick)(H.current,Date.now());H.current=n,I(n)},f.UNFURL_MS)},o[2]=O):O=o[2];const L=O;let P;o[3]!==y||o[4]!==u?(P=n=>{v();const o=(0,f.release)(H.current,Date.now(),S,n);if(H.current=(0,f.idleHold)(),I((0,f.idleHold)()),o.commit)return T(null),void y(u);T((0,f.answerHint)(o.reason))},o[3]=y,o[4]=u,o[5]=P):P=o[5];const q=P;let V,A,E;o[6]===Symbol.for("react.memo_cache_sentinel")?(V=()=>v,A=[v],o[6]=V,o[7]=A):(V=o[6],A=o[7]),(0,l.useEffect)(V,A),o[8]!==q?(E=()=>q(!1),o[8]=q,o[9]=E):E=o[9];const M=E;let W;o[10]!==q?(W=()=>q(!0),o[10]=q,o[11]=W):W=o[11];const $=W,N=(0,f.isLabelVisible)(w),k=N?j.chipOpen:null,G=_?j.chipDisabled:null;let U;o[12]!==G||o[13]!==k?(U=[j.chip,k,G],o[12]=G,o[13]=k,o[14]=U):U=o[14];const F=U,B=`${h}. Hold to send.`,J=`decision-chip-${h}`;let K;o[15]!==p?(K=(0,b.jsx)(t.Text,{style:j.chipGlyph,children:p}),o[15]=p,o[16]=K):K=o[16];const Q=N?4:2;let X,Y,Z,ee;return o[17]!==h||o[18]!==Q?(X=(0,b.jsx)(t.Text,{style:j.chipLabel,numberOfLines:Q,children:h}),o[17]=h,o[18]=Q,o[19]=X):X=o[19],o[20]!==z?(Y=z?(0,b.jsx)(t.Text,{style:j.chipHint,testID:"decision-chip-hint",children:z}):null,o[20]=z,o[21]=Y):Y=o[21],o[22]!==x?(Z=x?(0,b.jsx)(t.Text,{style:j.recommended,children:"recommended"}):null,o[22]=x,o[23]=Z):Z=o[23],o[24]!==F||o[25]!==_||o[26]!==$||o[27]!==M||o[28]!==B||o[29]!==J||o[30]!==K||o[31]!==X||o[32]!==Y||o[33]!==Z?(ee=(0,b.jsxs)(s.Pressable,{onPressIn:L,onPressOut:M,onTouchCancel:$,disabled:_,accessibilityRole:"button",accessibilityLabel:B,style:F,testID:J,children:[K,X,Y,Z]}),o[24]=F,o[25]=_,o[26]=$,o[27]=M,o[28]=B,o[29]=J,o[30]=K,o[31]=X,o[32]=Y,o[33]=Z,o[34]=ee):ee=o[34],ee}function _(u){const f=(0,c.c)(55),{serverId:_,agentId:S,decision:w,onAnswered:I,useEmoji:z}=u,T=void 0===z||z,{answer:D,error:R,isPending:H}=(0,p.useAnswerDecision)(),[C,v]=(0,l.useState)("");let O;f[0]!==S||f[1]!==D||f[2]!==w.id||f[3]!==I||f[4]!==_?(O=(n,o)=>{D({serverId:_,agentId:S,decisionId:w.id,optionId:n,note:o??null}).then(()=>(I?.(),null)).catch(y)},f[0]=S,f[1]=D,f[2]=w.id,f[3]=I,f[4]=_,f[5]=O):O=f[5];const L=O;let P;f[6]!==C?(P=C.trim(),f[6]=C,f[7]=P):P=f[7];const q=P.length>0,V=q?null:j.chipDisabled;let A;f[8]!==V?(A=[j.send,V],f[8]=V,f[9]=A):A=f[9];const E=A;let M;f[10]!==L||f[11]!==C?(M=()=>{L(null,C.trim()),v("")},f[10]=L,f[11]=C,f[12]=M):M=f[12];const W=M;if(w.answeredAt){let o;f[13]!==w.chosenOptionId||f[14]!==w.options?(o=w.options?.find(n=>n.id===w.chosenOptionId),f[13]=w.chosenOptionId,f[14]=w.options,f[15]=o):o=f[15];const s=o,c=`decision-answered-${w.id}`;let l;f[16]!==w.question?(l=(0,b.jsx)(t.Text,{style:j.question,children:w.question}),f[16]=w.question,f[17]=l):l=f[17];const u=s?.label??w.answerNote??"Answered";let p,h;return f[18]!==u?(p=(0,b.jsx)(t.Text,{style:j.answered,children:u}),f[18]=u,f[19]=p):p=f[19],f[20]!==p||f[21]!==c||f[22]!==l?(h=(0,b.jsxs)(n.View,{style:j.block,testID:c,children:[l,p]}),f[20]=p,f[21]=c,f[22]=l,f[23]=h):h=f[23],h}const $=`decision-${w.id}`;let N,k,G;f[24]!==w.question?(N=(0,b.jsx)(t.Text,{style:j.question,children:w.question}),f[24]=w.question,f[25]=N):N=f[25],f[26]!==L||f[27]!==w.options||f[28]!==H||f[29]!==T?(k=w.options?.map((n,o)=>(0,b.jsx)(x,{optionId:n.id,glyph:(0,h.optionGlyph)(n.emoji,o,T),label:n.label,recommended:!0===n.recommended,disabled:H,onCommit:L},n.id)),f[26]=L,f[27]=w.options,f[28]=H,f[29]=T,f[30]=k):k=f[30],f[31]!==k?(G=(0,b.jsx)(n.View,{style:j.chipRow,children:k}),f[31]=k,f[32]=G):G=f[32];const U=!H,F=`decision-free-text-${w.id}`;let B;f[33]!==C||f[34]!==U||f[35]!==F?(B=(0,b.jsx)(o.TextInput,{value:C,onChangeText:v,placeholder:"None of these? Say what to do",style:j.input,editable:U,testID:F}),f[33]=C,f[34]=U,f[35]=F,f[36]=B):B=f[36];const J=H||!q,K=`decision-free-send-${w.id}`;let Q,X,Y,Z,ee;return f[37]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,b.jsx)(t.Text,{style:j.sendText,children:"Send"}),f[37]=Q):Q=f[37],f[38]!==W||f[39]!==E||f[40]!==J||f[41]!==K?(X=(0,b.jsx)(s.Pressable,{onPress:W,disabled:J,accessibilityRole:"button",accessibilityLabel:"Send a free-text answer",style:E,testID:K,children:Q}),f[38]=W,f[39]=E,f[40]=J,f[41]=K,f[42]=X):X=f[42],f[43]!==B||f[44]!==X?(Y=(0,b.jsxs)(n.View,{style:j.freeRow,children:[B,X]}),f[43]=B,f[44]=X,f[45]=Y):Y=f[45],f[46]!==w.id||f[47]!==R?(Z=R?(0,b.jsxs)(t.Text,{style:j.error,testID:`decision-error-${w.id}`,children:["Could not send that: ",R instanceof Error?R.message:String(R),". Nothing was recorded, so pick again."]}):null,f[46]=w.id,f[47]=R,f[48]=Z):Z=f[48],f[49]!==G||f[50]!==Y||f[51]!==Z||f[52]!==$||f[53]!==N?(ee=(0,b.jsxs)(n.View,{style:j.block,testID:$,children:[N,G,Y,Z]}),f[49]=G,f[50]=Y,f[51]=Z,f[52]=$,f[53]=N,f[54]=ee):ee=f[54],ee}function y(){}const S={holdMs:f.ANSWER_HOLD_MS},w=(0,l.memo)(function(o){const s=(0,c.c)(14),{serverId:l,agentId:u,decisions:p,onAnswered:h,useEmoji:f}=o,x=void 0===f||f;if(!p||0===p.length)return null;let y,S,w;if(s[0]===Symbol.for("react.memo_cache_sentinel")?(y=(0,b.jsx)(t.Text,{style:j.sectionLabel,children:"Decisions"}),s[0]=y):y=s[0],s[1]!==u||s[2]!==p||s[3]!==h||s[4]!==l||s[5]!==x){let n;s[7]!==u||s[8]!==h||s[9]!==l||s[10]!==x?(n=n=>(0,b.jsx)(_,{serverId:l,agentId:u,decision:n,onAnswered:h,useEmoji:x},n.id),s[7]=u,s[8]=h,s[9]=l,s[10]=x,s[11]=n):n=s[11],S=p.map(n),s[1]=u,s[2]=p,s[3]=h,s[4]=l,s[5]=x,s[6]=S}else S=s[6];return s[12]!==S?(w=(0,b.jsxs)(n.View,{style:j.section,testID:"agent-digest-decisions",children:[y,S]}),s[12]=S,s[13]=w):w=s[13],w}),j=u.StyleSheet.create(n=>({error:{color:n.colors.destructive,fontSize:n.fontSize.xs,marginTop:n.spacing[1],uni__dependencies:[0]},section:{gap:n.spacing[2],uni__dependencies:[0]},sectionLabel:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,textTransform:"uppercase",letterSpacing:.6,uni__dependencies:[0]},block:{gap:n.spacing[2],uni__dependencies:[0]},question:{color:n.colors.foreground,fontSize:n.fontSize.sm,lineHeight:18,uni__dependencies:[0]},chipRow:{flexDirection:"row",flexWrap:"wrap",gap:n.spacing[2],uni__dependencies:[0]},chip:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:n.colors.border,borderRadius:n.borderRadius["2xl"],paddingVertical:n.spacing[1],paddingHorizontal:n.spacing[2],maxWidth:"100%",uni__dependencies:[0]},chipOpen:{borderColor:n.colors.accent,uni__dependencies:[0]},chipDisabled:{opacity:.4},chipGlyph:{fontSize:20},chipLabel:{color:n.colors.foreground,fontSize:n.fontSize.xs,marginTop:4,uni__dependencies:[0]},chipHint:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,marginTop:2,uni__dependencies:[0]},recommended:{color:n.colors.accent,fontSize:n.fontSize.xs,marginTop:2,uni__dependencies:[0]},answered:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,uni__dependencies:[0]},freeRow:{flexDirection:"row",alignItems:"center",gap:n.spacing[2],uni__dependencies:[0]},input:{flex:1,borderWidth:1,borderColor:n.colors.border,borderRadius:n.borderRadius["2xl"],paddingVertical:n.spacing[1],paddingHorizontal:n.spacing[2],color:n.colors.foreground,fontSize:n.fontSize.xs,uni__dependencies:[0]},send:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:n.colors.accent,borderRadius:n.borderRadius["2xl"],paddingVertical:n.spacing[1],paddingHorizontal:n.spacing[2],uni__dependencies:[0]},sendText:{color:n.colors.accent,fontSize:n.fontSize.xs,uni__dependencies:[0]}}))},4013,[348,2838,349,2476,350,36,546,234,571,146,56,4014,4016,4020,279]);
15772
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANSWER_HOLD_SPEC",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"DecisionChips",{enumerable:!0,get:function(){return w}});var n=r(d[0]),o=r(d[1]),t=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);r(d[6]),r(d[7]),r(d[8]),r(d[9]);var u=r(d[10]),p=r(d[11]),h=r(d[12]),f=r(d[13]),b=r(d[14]);function x(n){const o=(0,c.c)(35),{optionId:u,glyph:p,label:h,recommended:x,disabled:_,onCommit:y}=n,[w,I]=(0,l.useState)(f.idleHold),[z,T]=(0,l.useState)(null),D=(0,l.useRef)(null);let R;o[0]===Symbol.for("react.memo_cache_sentinel")?(R=(0,f.idleHold)(),o[0]=R):R=o[0];const H=(0,l.useRef)(R);let C;o[1]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{null!==D.current&&(clearTimeout(D.current),D.current=null)},o[1]=C):C=o[1];const v=C;let O;o[2]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{T(null);const n=(0,f.press)(Date.now());H.current=n,I(n),v(),D.current=setTimeout(()=>{const n=(0,f.tick)(H.current,Date.now());H.current=n,I(n)},f.UNFURL_MS)},o[2]=O):O=o[2];const L=O;let P;o[3]!==y||o[4]!==u?(P=n=>{v();const o=(0,f.release)(H.current,Date.now(),S,n);if(H.current=(0,f.idleHold)(),I((0,f.idleHold)()),o.commit)return T(null),void y(u);T((0,f.answerHint)(o.reason))},o[3]=y,o[4]=u,o[5]=P):P=o[5];const q=P;let V,A,E;o[6]===Symbol.for("react.memo_cache_sentinel")?(V=()=>v,A=[v],o[6]=V,o[7]=A):(V=o[6],A=o[7]),(0,l.useEffect)(V,A),o[8]!==q?(E=()=>q(!1),o[8]=q,o[9]=E):E=o[9];const M=E;let W;o[10]!==q?(W=()=>q(!0),o[10]=q,o[11]=W):W=o[11];const $=W,N=(0,f.isLabelVisible)(w),k=N?j.chipOpen:null,G=_?j.chipDisabled:null;let U;o[12]!==G||o[13]!==k?(U=[j.chip,k,G],o[12]=G,o[13]=k,o[14]=U):U=o[14];const F=U,B=`${h}. Hold to send.`,J=`decision-chip-${u}`;let K;o[15]!==p?(K=(0,b.jsx)(t.Text,{style:j.chipGlyph,children:p}),o[15]=p,o[16]=K):K=o[16];const Q=N?4:2;let X,Y,Z,ee;return o[17]!==h||o[18]!==Q?(X=(0,b.jsx)(t.Text,{style:j.chipLabel,numberOfLines:Q,children:h}),o[17]=h,o[18]=Q,o[19]=X):X=o[19],o[20]!==z?(Y=z?(0,b.jsx)(t.Text,{style:j.chipHint,testID:"decision-chip-hint",children:z}):null,o[20]=z,o[21]=Y):Y=o[21],o[22]!==x?(Z=x?(0,b.jsx)(t.Text,{style:j.recommended,children:"recommended"}):null,o[22]=x,o[23]=Z):Z=o[23],o[24]!==F||o[25]!==_||o[26]!==$||o[27]!==M||o[28]!==B||o[29]!==J||o[30]!==K||o[31]!==X||o[32]!==Y||o[33]!==Z?(ee=(0,b.jsxs)(s.Pressable,{onPressIn:L,onPressOut:M,onTouchCancel:$,disabled:_,accessibilityRole:"button",accessibilityLabel:B,style:F,testID:J,children:[K,X,Y,Z]}),o[24]=F,o[25]=_,o[26]=$,o[27]=M,o[28]=B,o[29]=J,o[30]=K,o[31]=X,o[32]=Y,o[33]=Z,o[34]=ee):ee=o[34],ee}function _(u){const f=(0,c.c)(55),{serverId:_,agentId:S,decision:w,onAnswered:I,useEmoji:z}=u,T=void 0===z||z,{answer:D,error:R,isPending:H}=(0,p.useAnswerDecision)(),[C,v]=(0,l.useState)("");let O;f[0]!==S||f[1]!==D||f[2]!==w.id||f[3]!==I||f[4]!==_?(O=(n,o)=>{D({serverId:_,agentId:S,decisionId:w.id,optionId:n,note:o??null}).then(()=>(I?.(),null)).catch(y)},f[0]=S,f[1]=D,f[2]=w.id,f[3]=I,f[4]=_,f[5]=O):O=f[5];const L=O;let P;f[6]!==C?(P=C.trim(),f[6]=C,f[7]=P):P=f[7];const q=P.length>0,V=q?null:j.chipDisabled;let A;f[8]!==V?(A=[j.send,V],f[8]=V,f[9]=A):A=f[9];const E=A;let M;f[10]!==L||f[11]!==C?(M=()=>{L(null,C.trim()),v("")},f[10]=L,f[11]=C,f[12]=M):M=f[12];const W=M;if(w.answeredAt){let o;f[13]!==w.chosenOptionId||f[14]!==w.options?(o=w.options?.find(n=>n.id===w.chosenOptionId),f[13]=w.chosenOptionId,f[14]=w.options,f[15]=o):o=f[15];const s=o,c=`decision-answered-${w.id}`;let l;f[16]!==w.question?(l=(0,b.jsx)(t.Text,{style:j.question,children:w.question}),f[16]=w.question,f[17]=l):l=f[17];const u=s?.label??w.answerNote??"Answered";let p,h;return f[18]!==u?(p=(0,b.jsx)(t.Text,{style:j.answered,children:u}),f[18]=u,f[19]=p):p=f[19],f[20]!==p||f[21]!==c||f[22]!==l?(h=(0,b.jsxs)(n.View,{style:j.block,testID:c,children:[l,p]}),f[20]=p,f[21]=c,f[22]=l,f[23]=h):h=f[23],h}const $=`decision-${w.id}`;let N,k,G;f[24]!==w.question?(N=(0,b.jsx)(t.Text,{style:j.question,children:w.question}),f[24]=w.question,f[25]=N):N=f[25],f[26]!==L||f[27]!==w.options||f[28]!==H||f[29]!==T?(k=w.options?.map((n,o)=>(0,b.jsx)(x,{optionId:n.id,glyph:(0,h.optionGlyph)(n.emoji,o,T),label:n.label,recommended:!0===n.recommended,disabled:H,onCommit:L},n.id)),f[26]=L,f[27]=w.options,f[28]=H,f[29]=T,f[30]=k):k=f[30],f[31]!==k?(G=(0,b.jsx)(n.View,{style:j.chipRow,children:k}),f[31]=k,f[32]=G):G=f[32];const U=!H,F=`decision-free-text-${w.id}`;let B;f[33]!==C||f[34]!==U||f[35]!==F?(B=(0,b.jsx)(o.TextInput,{value:C,onChangeText:v,placeholder:"None of these? Say what to do",style:j.input,editable:U,testID:F}),f[33]=C,f[34]=U,f[35]=F,f[36]=B):B=f[36];const J=H||!q,K=`decision-free-send-${w.id}`;let Q,X,Y,Z,ee;return f[37]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,b.jsx)(t.Text,{style:j.sendText,children:"Send"}),f[37]=Q):Q=f[37],f[38]!==W||f[39]!==E||f[40]!==J||f[41]!==K?(X=(0,b.jsx)(s.Pressable,{onPress:W,disabled:J,accessibilityRole:"button",accessibilityLabel:"Send a free-text answer",style:E,testID:K,children:Q}),f[38]=W,f[39]=E,f[40]=J,f[41]=K,f[42]=X):X=f[42],f[43]!==B||f[44]!==X?(Y=(0,b.jsxs)(n.View,{style:j.freeRow,children:[B,X]}),f[43]=B,f[44]=X,f[45]=Y):Y=f[45],f[46]!==w.id||f[47]!==R?(Z=R?(0,b.jsxs)(t.Text,{style:j.error,testID:`decision-error-${w.id}`,children:["Could not send that: ",R instanceof Error?R.message:String(R),". Nothing was recorded, so pick again."]}):null,f[46]=w.id,f[47]=R,f[48]=Z):Z=f[48],f[49]!==G||f[50]!==Y||f[51]!==Z||f[52]!==$||f[53]!==N?(ee=(0,b.jsxs)(n.View,{style:j.block,testID:$,children:[N,G,Y,Z]}),f[49]=G,f[50]=Y,f[51]=Z,f[52]=$,f[53]=N,f[54]=ee):ee=f[54],ee}function y(){}const S={holdMs:f.ANSWER_HOLD_MS},w=(0,l.memo)(function(o){const s=(0,c.c)(14),{serverId:l,agentId:u,decisions:p,onAnswered:h,useEmoji:f}=o,x=void 0===f||f;if(!p||0===p.length)return null;let y,S,w;if(s[0]===Symbol.for("react.memo_cache_sentinel")?(y=(0,b.jsx)(t.Text,{style:j.sectionLabel,children:"Decisions"}),s[0]=y):y=s[0],s[1]!==u||s[2]!==p||s[3]!==h||s[4]!==l||s[5]!==x){let n;s[7]!==u||s[8]!==h||s[9]!==l||s[10]!==x?(n=n=>(0,b.jsx)(_,{serverId:l,agentId:u,decision:n,onAnswered:h,useEmoji:x},n.id),s[7]=u,s[8]=h,s[9]=l,s[10]=x,s[11]=n):n=s[11],S=p.map(n),s[1]=u,s[2]=p,s[3]=h,s[4]=l,s[5]=x,s[6]=S}else S=s[6];return s[12]!==S?(w=(0,b.jsxs)(n.View,{style:j.section,testID:"agent-digest-decisions",children:[y,S]}),s[12]=S,s[13]=w):w=s[13],w}),j=u.StyleSheet.create(n=>({error:{color:n.colors.destructive,fontSize:n.fontSize.xs,marginTop:n.spacing[1],uni__dependencies:[0]},section:{gap:n.spacing[2],uni__dependencies:[0]},sectionLabel:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,textTransform:"uppercase",letterSpacing:.6,uni__dependencies:[0]},block:{gap:n.spacing[2],uni__dependencies:[0]},question:{color:n.colors.foreground,fontSize:n.fontSize.sm,lineHeight:18,uni__dependencies:[0]},chipRow:{flexDirection:"row",flexWrap:"wrap",gap:n.spacing[2],uni__dependencies:[0]},chip:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:n.colors.border,borderRadius:n.borderRadius["2xl"],paddingVertical:n.spacing[1],paddingHorizontal:n.spacing[2],maxWidth:"100%",uni__dependencies:[0]},chipOpen:{borderColor:n.colors.accent,uni__dependencies:[0]},chipDisabled:{opacity:.4},chipGlyph:{fontSize:20},chipLabel:{color:n.colors.foreground,fontSize:n.fontSize.xs,marginTop:4,uni__dependencies:[0]},chipHint:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,marginTop:2,uni__dependencies:[0]},recommended:{color:n.colors.accent,fontSize:n.fontSize.xs,marginTop:2,uni__dependencies:[0]},answered:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,uni__dependencies:[0]},freeRow:{flexDirection:"row",alignItems:"center",gap:n.spacing[2],uni__dependencies:[0]},input:{flex:1,borderWidth:1,borderColor:n.colors.border,borderRadius:n.borderRadius["2xl"],paddingVertical:n.spacing[1],paddingHorizontal:n.spacing[2],color:n.colors.foreground,fontSize:n.fontSize.xs,uni__dependencies:[0]},send:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:n.colors.accent,borderRadius:n.borderRadius["2xl"],paddingVertical:n.spacing[1],paddingHorizontal:n.spacing[2],uni__dependencies:[0]},sendText:{color:n.colors.accent,fontSize:n.fontSize.xs,uni__dependencies:[0]}}))},4013,[348,2838,349,2476,350,36,546,234,571,146,56,4014,4016,4020,279]);
15773
15773
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MissingDecisionAnswerError",{enumerable:!0,get:function(){return u}}),e.assertAnswerable=c,e.answerDecision=l,e.useAnswerDecision=function(){const s=(0,n.c)(8),u=(0,t.useQueryClient)();let c;s[0]!==u?(c={mutationFn:l,onSuccess:(n,t)=>{u.invalidateQueries({queryKey:(0,o.agentHistoryQueryKey)(t.serverId)})}},s[0]=u,s[1]=c):c=s[1];const w=(0,t.useMutation)(c);let f;s[2]!==w?(f=async n=>await w.mutateAsync(n),s[2]=w,s[3]=f):f=s[3];const y=f;let h;s[4]!==y||s[5]!==w.error||s[6]!==w.isPending?(h={answer:y,isPending:w.isPending,error:w.error},s[4]=y,s[5]=w.error,s[6]=w.isPending,s[7]=h):h=s[7];return h};var n=r(d[0]);r(d[1]);var t=r(d[2]),s=r(d[3]),o=r(d[4]);class u extends Error{constructor(n){super(n),this.name="MissingDecisionAnswerError"}}function c(n){if(null!==n.optionId)return;if(0===(n.note?.trim()??"").length)throw new u("A free-text answer needs a note: without an option and without text there is no answer to record.")}async function l(n){c(n);const t=(0,s.getHostRuntimeStore)().getClient(n.serverId);if(!t)throw new Error(`No client for server ${n.serverId}`);const o=n.note?.trim();return await t.answerAgentDecision(n.agentId,n.decisionId,n.optionId,o&&o.length>0?o:null)}},4014,[350,36,3030,3274,4015]);
15774
15774
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.agentHistoryQueryKey=function(t){return["agentHistory",t]},e.allAgentHistoryQueryRootKey=function(){return t},e.allAgentHistoryQueryKey=function(n){return[...t,...[...n].sort()]};const t=["allAgentHistory"]},4015,[]);
15775
- __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TACO_VERBS",{enumerable:!0,get:function(){return _}}),e.optionGlyph=function(t,i,n){if(n&&t)return t;return String(i+1)},Object.defineProperty(e,"ReelsHeader",{enumerable:!0,get:function(){return w}}),Object.defineProperty(e,"ReelsRail",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"TagGate",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"SnoozeSheet",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"KanbanPicker",{enumerable:!0,get:function(){return R}}),Object.defineProperty(e,"LapSeam",{enumerable:!0,get:function(){return v}});var t=r(d[0]),i=r(d[1]),n=r(d[2]),s=r(d[3]),o=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]);r(d[8]),r(d[9]),r(d[10]),r(d[11]),r(d[12]),r(d[13]),r(d[14]);var p=r(d[15]),b=r(d[16]),h=r(d[17]),f=r(d[18]),x=r(d[19]),y=r(d[20]);const _=[{id:"terminate",icon:b.Archive,label:"Terminate",detail:"Archive it. Soft delete, still readable by id."},{id:"automate",icon:b.Repeat,label:"Automate",detail:"Promote it to a routine: a cadence, running its next step."},{id:"consolidate",icon:b.Merge,label:"Consolidate",detail:"Fold sessions together. You pick which one survives."},{id:"outsource",icon:b.Share2,label:"Outsource",detail:"Share it with a person: WhatsApp, Slack or email."}];const j={on:{selected:!0},off:{selected:!1}},S=(0,u.memo)(function(t){const i=(0,c.c)(12),{value:s,label:l,selected:u,onPick:p,testIDPrefix:b,testIDValue:h}=t;let f;i[0]!==p||i[1]!==s?(f=()=>p(s),i[0]=p,i[1]=s,i[2]=f):f=i[2];const x=f,_=u?`${l}, selected`:l,S=j[!0===u?"on":"off"],w=u?H:C.tagPick,T=`${b}-${h??s}`;let z,I;return i[3]!==l?(z=(0,y.jsx)(n.Text,{style:C.tagPickText,children:l}),i[3]=l,i[4]=z):z=i[4],i[5]!==x||i[6]!==_||i[7]!==S||i[8]!==w||i[9]!==T||i[10]!==z?(I=(0,y.jsx)(o.Pressable,{onPress:x,accessibilityRole:"button",accessibilityLabel:_,accessibilityState:S,style:w,testID:T,children:z}),i[5]=x,i[6]=_,i[7]=S,i[8]=w,i[9]=T,i[10]=z,i[11]=I):I=i[11],I}),w=(0,u.memo)(function(i){const s=(0,c.c)(28),{acts:l,cap:u,activeFilters:p,onFilter:b,position:f}=i,x=null!==u&&l>=u;let _;if(s[0]!==l||s[1]!==u){let t;s[3]!==l?(t=(t,i)=>({key:`pip-${i}`,on:i<l}),s[3]=l,s[4]=t):t=s[4],_=Array.from({length:u??0},t),s[0]=l,s[1]=u,s[2]=_}else _=s[2];const j=_;let S;s[5]!==x||s[6]!==j?(S=j.map(i=>(0,y.jsx)(t.View,{style:B(i.on,x)},i.key)),s[5]=x,s[6]=j,s[7]=S):S=s[7];const w=x?O:C.pipLabel;let T,z,I,P;s[8]!==l||s[9]!==u?(T=(0,h.actCapLabel)({acts:l,cap:u}),s[8]=l,s[9]=u,s[10]=T):T=s[10],s[11]!==w||s[12]!==T?(z=(0,y.jsx)(n.Text,{style:w,children:T}),s[11]=w,s[12]=T,s[13]=z):z=s[13],s[14]!==f?(I=f?(0,y.jsx)(n.Text,{style:C.pipLabel,children:f}):null,s[14]=f,s[15]=I):I=s[15],s[16]!==S||s[17]!==z||s[18]!==I?(P=(0,y.jsxs)(t.View,{style:C.pips,children:[S,z,I]}),s[16]=S,s[17]=z,s[18]=I,s[19]=P):P=s[19];const D=p>0?`filter ${p}`:"filter";let R,v,k;return s[20]!==D?(R=(0,y.jsx)(n.Text,{style:C.headerBtnText,children:D}),s[20]=D,s[21]=R):R=s[21],s[22]!==b||s[23]!==R?(v=(0,y.jsx)(o.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Open filters",style:C.headerBtn,testID:"reels-filter-open",children:R}),s[22]=b,s[23]=R,s[24]=v):v=s[24],s[25]!==v||s[26]!==P?(k=(0,y.jsxs)(t.View,{style:C.header,testID:"reels-header",children:[P,v]}),s[25]=v,s[26]=P,s[27]=k):k=s[27],k}),T=(0,u.memo)(function(i){const s=(0,c.c)(17),{action:l,onAction:u}=i,{theme:b}=(0,p.useUnistyles)();let h;s[0]!==l.id||s[1]!==u?(h=()=>u(l.id),s[0]=l.id,s[1]=u,s[2]=h):h=s[2];const f=h,x=l.icon,_=l.disabled?M:C.railItem,j=`reels-rail-${l.id}`,S=l.destructive?b.colors.destructive:b.colors.foreground;let w;s[3]!==x||s[4]!==S?(w=(0,y.jsx)(t.View,{style:C.railIcon,children:(0,y.jsx)(x,{size:19,color:S})}),s[3]=x,s[4]=S,s[5]=w):w=s[5];const T=l.destructive?A:C.railLabel;let z,I;return s[6]!==l.label||s[7]!==T?(z=(0,y.jsx)(n.Text,{style:T,children:l.label}),s[6]=l.label,s[7]=T,s[8]=z):z=s[8],s[9]!==l.disabled||s[10]!==l.label||s[11]!==f||s[12]!==_||s[13]!==j||s[14]!==w||s[15]!==z?(I=(0,y.jsxs)(o.Pressable,{onPress:f,disabled:l.disabled,accessibilityRole:"button",accessibilityLabel:l.label,style:_,testID:j,children:[w,z]}),s[9]=l.disabled,s[10]=l.label,s[11]=f,s[12]=_,s[13]=j,s[14]=w,s[15]=z,s[16]=I):I=s[16],I}),z=(0,u.memo)(function(i){const s=(0,c.c)(23),{action:l,onAction:u}=i,{theme:b}=(0,p.useUnistyles)(),{showLabel:h,progress:f,hint:_,handlers:j}=(0,x.useDestructiveHold)(u,l.id),S=l.icon;let w;s[0]!==f?(w=Math.round(100*f),s[0]=f,s[1]=w):w=s[1];const T=`${w}%`;let z;s[2]!==T?(z=[C.railHoldFill,{height:T}],s[2]=T,s[3]=z):z=s[3];const I=z,P=`${l.label}. Hold to confirm, this cannot be undone.`,D=l.disabled?M:C.railItem,R=`reels-rail-${l.id}`;let v,k,L;s[4]!==I||s[5]!==f?(v=f>0?(0,y.jsx)(t.View,{style:I,testID:"reels-rail-hold-fill"}):null,s[4]=I,s[5]=f,s[6]=v):v=s[6],s[7]!==S||s[8]!==b.colors.destructive?(k=(0,y.jsx)(S,{size:19,color:b.colors.destructive}),s[7]=S,s[8]=b.colors.destructive,s[9]=k):k=s[9],s[10]!==v||s[11]!==k?(L=(0,y.jsxs)(t.View,{style:C.railIcon,children:[v,k]}),s[10]=v,s[11]=k,s[12]=L):L=s[12];const V=h||"hold"===_?"hold\u2026":_??`hold to ${l.label}`;let O,H;return s[13]!==V?(O=(0,y.jsx)(n.Text,{style:A,numberOfLines:2,children:V}),s[13]=V,s[14]=O):O=s[14],s[15]!==l.disabled||s[16]!==j||s[17]!==O||s[18]!==P||s[19]!==D||s[20]!==R||s[21]!==L?(H=(0,y.jsxs)(o.Pressable,Object.assign({},j,{disabled:l.disabled,accessibilityRole:"button",accessibilityLabel:P,style:D,testID:R,children:[L,O]})),s[15]=l.disabled,s[16]=j,s[17]=O,s[18]=P,s[19]=D,s[20]=R,s[21]=L,s[22]=H):H=s[22],H}),I=(0,u.memo)(function(i){const s=(0,c.c)(10),{actions:o,contextLabel:l,onAction:u}=i;let p,b,h;if(s[0]!==o||s[1]!==u){let t;s[3]!==u?(t=t=>t.destructive?(0,y.jsx)(z,{action:t,onAction:u},t.id):(0,y.jsx)(T,{action:t,onAction:u},t.id),s[3]=u,s[4]=t):t=s[4],p=o.map(t),s[0]=o,s[1]=u,s[2]=p}else p=s[2];return s[5]!==l?(b=(0,y.jsx)(t.View,{style:C.disc,children:(0,y.jsx)(n.Text,{style:C.discText,numberOfLines:1,children:l})}),s[5]=l,s[6]=b):b=s[6],s[7]!==p||s[8]!==b?(h=(0,y.jsxs)(t.View,{style:C.rail,testID:"reels-rail",children:[p,b]}),s[7]=p,s[8]=b,s[9]=h):h=s[9],h}),P=(0,u.memo)(function(l){const p=(0,c.c)(24),{available:b,onPick:h}=l,[f,x]=(0,u.useState)("");let _;p[0]!==f||p[1]!==h?(_=()=>{const t=f.trim().toLowerCase().replace(/\s+/g,"-");t.length>0&&(h(t),x(""))},p[0]=f,p[1]=h,p[2]=_):_=p[2];const j=_;let w,T,z,I,P,D,R,v,k;if(p[3]===Symbol.for("react.memo_cache_sentinel")?(w=(0,y.jsx)(n.Text,{style:C.gateTitle,children:"This session has no tag"}),T=(0,y.jsx)(n.Text,{style:C.gateBody,children:"Tag it before deciding. Without one it is invisible to every filter, report and invoice, and it comes back at the front of the next lap."}),p[3]=w,p[4]=T):(w=p[3],T=p[4]),p[5]!==b||p[6]!==h){let t;p[8]!==h?(t=t=>(0,y.jsx)(S,{value:t,label:t,onPick:h,testIDPrefix:"reels-tag"},t),p[8]=h,p[9]=t):t=p[9],z=b.map(t),p[5]=b,p[6]=h,p[7]=z}else z=p[7];return p[10]!==z?(I=(0,y.jsx)(s.ScrollView,{style:C.gateChipScroll,testID:"reels-tag-gate-list",children:(0,y.jsx)(t.View,{style:C.chipRow,children:z})}),p[10]=z,p[11]=I):I=p[11],p[12]!==f||p[13]!==j?(P=(0,y.jsx)(i.TextInput,{value:f,onChangeText:x,placeholder:"or a new tag",style:C.input,onSubmitEditing:j,testID:"reels-tag-new"}),p[12]=f,p[13]=j,p[14]=P):P=p[14],p[15]===Symbol.for("react.memo_cache_sentinel")?(D=(0,y.jsx)(n.Text,{style:C.sendText,children:"Add"}),p[15]=D):D=p[15],p[16]!==j?(R=(0,y.jsx)(o.Pressable,{onPress:j,style:C.send,accessibilityRole:"button",accessibilityLabel:"Add this tag",testID:"reels-tag-new-send",children:D}),p[16]=j,p[17]=R):R=p[17],p[18]!==P||p[19]!==R?(v=(0,y.jsxs)(t.View,{style:C.freeRow,children:[P,R]}),p[18]=P,p[19]=R,p[20]=v):v=p[20],p[21]!==I||p[22]!==v?(k=(0,y.jsxs)(t.View,{style:C.gate,testID:"reels-tag-gate",children:[w,T,I,v]}),p[21]=I,p[22]=v,p[23]=k):k=p[23],k}),D=(0,u.memo)(function({priorCount:s,now:c=new Date,onCancel:p,onSnooze:b}){const f=(0,h.snoozeDemand)(s),[x,_]=(0,u.useState)(null),[j,w]=(0,u.useState)(""),[T,z]=(0,u.useState)(""),I=(0,u.useMemo)(()=>({until:x,untilWhat:j||null,why:T||null}),[x,j,T]),P=(0,h.snoozeDraftSatisfies)(f,I),D=(0,u.useCallback)(()=>b(I),[I,b]),R="needs-all"===f,v=(0,u.useMemo)(()=>{const t=c.getTime();return[{label:"2h",iso:new Date(t+72e5).toISOString()},{label:"18h",iso:new Date(t+648e5).toISOString()},{label:"3d",iso:new Date(t+2592e5).toISOString()},{label:"next week",iso:new Date(t+6048e5).toISOString()}]},[c]);return"refused"===f?(0,y.jsxs)(t.View,{style:C.sheet,testID:"reels-snooze-refused",children:[(0,y.jsx)(n.Text,{style:C.sheetTitle,children:"Snoozed twice already"}),(0,y.jsx)(n.Text,{style:C.gateBody,children:"A third push is not a decision. Terminate it, automate it, fold it into another session, or hand it to someone."}),(0,y.jsx)(o.Pressable,{onPress:p,style:C.send,accessibilityRole:"button",accessibilityLabel:"Back",testID:"reels-snooze-back",children:(0,y.jsx)(n.Text,{style:C.sendText,children:"Back"})})]}):(0,y.jsxs)(l.KeyboardAvoidingView,{behavior:void 0,style:C.sheet,testID:"reels-snooze-sheet",children:[(0,y.jsx)(n.Text,{style:C.sheetTitle,children:"Snooze"}),(0,y.jsxs)(n.Text,{style:C.label,children:["Until when ",R?"(required)":""]}),(0,y.jsx)(t.View,{style:C.chipRow,children:v.map(t=>(0,y.jsx)(S,{value:t.iso,label:t.label,selected:x===t.iso,onPick:_,testIDPrefix:"reels-snooze-until",testIDValue:t.label},t.label))}),(0,y.jsxs)(n.Text,{style:C.label,children:["Until what ",R?"(required)":"(optional)"]}),(0,y.jsx)(i.TextInput,{value:j,onChangeText:w,placeholder:"the event you are waiting on",style:C.input,testID:"reels-snooze-what"}),(0,y.jsxs)(n.Text,{style:C.label,children:["Why ",R?"(required)":"(optional)"]}),(0,y.jsx)(i.TextInput,{value:T,onChangeText:z,placeholder:"what is missing",style:C.input,testID:"reels-snooze-why"}),(0,y.jsx)(n.Text,{style:C.note,children:"A snooze is a bet that nothing changes. A failure cancels it and the card comes back."}),(0,y.jsxs)(t.View,{style:C.freeRow,children:[(0,y.jsx)(o.Pressable,{onPress:p,style:C.send,accessibilityRole:"button",accessibilityLabel:"Cancel and close",testID:"reels-snooze-cancel",children:(0,y.jsx)(n.Text,{style:C.sendText,children:"Cancel"})}),(0,y.jsx)(o.Pressable,{onPress:D,disabled:!P,style:P?C.send:W,accessibilityRole:"button",accessibilityLabel:"Snooze this session",testID:"reels-snooze-commit",children:(0,y.jsx)(n.Text,{style:C.sendText,children:"Snooze"})})]})]})}),R=(0,u.memo)(function(i){const n=(0,c.c)(9),{current:s,onPick:o}=i,l=(0,f.useKanbanBuckets)();let u,p;if(n[0]!==l||n[1]!==s||n[2]!==o){let t;n[4]!==s||n[5]!==o?(t=t=>(0,y.jsx)(S,{value:t.id,label:t.label,selected:s===t.id,onPick:o,testIDPrefix:"reels-kanban"},t.id),n[4]=s,n[5]=o,n[6]=t):t=n[6],u=l.map(t),n[0]=l,n[1]=s,n[2]=o,n[3]=u}else u=n[3];return n[7]!==u?(p=(0,y.jsx)(t.View,{style:C.chipRow,testID:"reels-kanban",children:u}),n[7]=u,n[8]=p):p=n[8],p}),v=(0,u.memo)(function(i){const s=(0,c.c)(8),{lap:o,ringSize:l,acted:u}=i;let p,b,h;return s[0]!==o?(p=(0,y.jsxs)(n.Text,{style:C.seamRule,children:["lap ",o]}),s[0]=o,s[1]=p):p=s[1],s[2]!==u||s[3]!==l?(b=(0,y.jsxs)(n.Text,{style:C.seamNote,children:[l," sessions in the ring","\n",u," acted last lap, now at the back","\n","no caught-up card. the work is never done."]}),s[2]=u,s[3]=l,s[4]=b):b=s[4],s[5]!==p||s[6]!==b?(h=(0,y.jsxs)(t.View,{style:C.seam,testID:"reels-seam",children:[p,b]}),s[5]=p,s[6]=b,s[7]=h):h=s[7],h}),C=p.StyleSheet.create(t=>({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:t.spacing[2],paddingTop:t.spacing[2],gap:t.spacing[2],uni__dependencies:[0]},pips:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],uni__dependencies:[0]},pip:{width:7,height:7,borderRadius:t.borderRadius.full,borderWidth:1,borderColor:t.colors.foregroundMuted,uni__dependencies:[0]},pipOn:{backgroundColor:t.colors.foregroundMuted,uni__dependencies:[0]},pipMaxed:{borderColor:t.colors.accent,uni__dependencies:[0]},pipLabel:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},pipLabelMaxed:{color:t.colors.accent,uni__dependencies:[0]},headerBtn:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:t.colors.border,borderRadius:t.borderRadius.full,paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],uni__dependencies:[0]},headerBtnText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},rail:{alignItems:"center",gap:t.spacing[1],uni__dependencies:[0]},railItem:{alignItems:"center",gap:2,width:56},railIcon:{width:44,height:44,borderRadius:t.borderRadius.full,borderWidth:1,borderColor:t.colors.border,alignItems:"center",justifyContent:"center",backgroundColor:t.colors.surface0,overflow:"hidden",uni__dependencies:[0]},railHoldFill:{position:"absolute",left:0,right:0,bottom:0,backgroundColor:t.colors.destructive,opacity:.18,uni__dependencies:[0]},railLabel:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,textAlign:"center",uni__dependencies:[0]},railLabelDanger:{color:t.colors.destructive,uni__dependencies:[0]},gateChipScroll:{maxHeight:104},disc:{minHeight:38,maxWidth:96,paddingHorizontal:t.spacing[2],borderRadius:t.borderRadius.full,borderWidth:1,borderColor:t.colors.foregroundMuted,alignItems:"center",justifyContent:"center",backgroundColor:t.colors.surface0,uni__dependencies:[0]},discText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},dim:{opacity:.35},gate:{borderWidth:1,borderStyle:"dashed",borderColor:t.colors.destructive,borderRadius:t.borderRadius["2xl"],padding:t.spacing[2],gap:t.spacing[1],uni__dependencies:[0]},gateTitle:{color:t.colors.destructive,fontSize:t.fontSize.sm,fontWeight:"600",uni__dependencies:[0]},gateBody:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,lineHeight:17,uni__dependencies:[0]},chipRow:{flexDirection:"row",flexWrap:"wrap",gap:t.spacing[1],uni__dependencies:[0]},tagPick:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:t.colors.border,borderRadius:t.borderRadius.full,paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],uni__dependencies:[0]},tagPickOn:{borderColor:t.colors.accent,uni__dependencies:[0]},tagPickText:{color:t.colors.foreground,fontSize:t.fontSize.xs,uni__dependencies:[0]},freeRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],uni__dependencies:[0]},input:{flex:1,borderWidth:1,borderColor:t.colors.border,borderRadius:t.borderRadius["2xl"],paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],color:t.colors.foreground,fontSize:t.fontSize.xs,uni__dependencies:[0]},send:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:t.colors.accent,borderRadius:t.borderRadius["2xl"],paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],uni__dependencies:[0]},sendText:{color:t.colors.accent,fontSize:t.fontSize.xs,uni__dependencies:[0]},sheet:{gap:t.spacing[1],padding:t.spacing[2],uni__dependencies:[0]},sheetTitle:{color:t.colors.foreground,fontSize:t.fontSize.base,fontWeight:"600",uni__dependencies:[0]},label:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,textTransform:"uppercase",letterSpacing:.6,marginTop:t.spacing[1],uni__dependencies:[0]},note:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,fontStyle:"italic",marginTop:t.spacing[1],uni__dependencies:[0]},seam:{alignItems:"center",justifyContent:"center",gap:t.spacing[1],padding:t.spacing[3],uni__dependencies:[0]},seamRule:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,letterSpacing:3,uni__dependencies:[0]},seamNote:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,textAlign:"center",lineHeight:18,uni__dependencies:[0]}})),k=[C.pip,C.pipOn],L=[C.pip,C.pipMaxed],V=[C.pip,C.pipOn,C.pipMaxed],O=[C.pipLabel,C.pipLabelMaxed],M=[C.railItem,C.dim],A=[C.railLabel,C.railLabelDanger],H=[C.tagPick,C.tagPickOn],W=[C.send,C.dim];function B(t,i){return t&&i?V:t?k:i?L:C.pip}},4016,[348,2838,349,2815,2476,4017,350,36,659,25,546,182,234,571,146,56,811,4018,4007,4019,279]);
15775
+ __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TACO_VERBS",{enumerable:!0,get:function(){return _}}),e.optionGlyph=function(t,i,n){if(n&&t)return t;return String(i+1)},Object.defineProperty(e,"ReelsHeader",{enumerable:!0,get:function(){return w}}),Object.defineProperty(e,"ReelsRail",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"TagGate",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"SnoozeSheet",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"KanbanPicker",{enumerable:!0,get:function(){return R}}),Object.defineProperty(e,"LapSeam",{enumerable:!0,get:function(){return v}});var t=r(d[0]),i=r(d[1]),n=r(d[2]),s=r(d[3]),o=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]);r(d[8]),r(d[9]),r(d[10]),r(d[11]),r(d[12]),r(d[13]),r(d[14]);var p=r(d[15]),b=r(d[16]),h=r(d[17]),f=r(d[18]),x=r(d[19]),y=r(d[20]);const _=[{id:"terminate",icon:b.Archive,label:"Terminate",detail:"Archive it. Soft delete, still readable by id."},{id:"automate",icon:b.Repeat,label:"Automate",detail:"Promote it to a routine: a cadence, running its next step."},{id:"consolidate",icon:b.Merge,label:"Consolidate",detail:"Fold sessions together. You pick which one survives."},{id:"outsource",icon:b.Share2,label:"Outsource",detail:"Share it with a person: WhatsApp, Slack or email."}];const j={on:{selected:!0},off:{selected:!1}},S=(0,u.memo)(function(t){const i=(0,c.c)(12),{value:s,label:l,selected:u,onPick:p,testIDPrefix:b,testIDValue:h}=t;let f;i[0]!==p||i[1]!==s?(f=()=>p(s),i[0]=p,i[1]=s,i[2]=f):f=i[2];const x=f,_=u?`${l}, selected`:l,S=j[!0===u?"on":"off"],w=u?H:C.tagPick,T=`${b}-${h??s}`;let z,I;return i[3]!==l?(z=(0,y.jsx)(n.Text,{style:C.tagPickText,children:l}),i[3]=l,i[4]=z):z=i[4],i[5]!==x||i[6]!==_||i[7]!==S||i[8]!==w||i[9]!==T||i[10]!==z?(I=(0,y.jsx)(o.Pressable,{onPress:x,accessibilityRole:"button",accessibilityLabel:_,accessibilityState:S,style:w,testID:T,children:z}),i[5]=x,i[6]=_,i[7]=S,i[8]=w,i[9]=T,i[10]=z,i[11]=I):I=i[11],I}),w=(0,u.memo)(function(i){const s=(0,c.c)(28),{acts:l,cap:u,activeFilters:p,onFilter:b,position:f}=i,x=null!==u&&l>=u;let _;if(s[0]!==l||s[1]!==u){let t;s[3]!==l?(t=(t,i)=>({key:`pip-${i}`,on:i<l}),s[3]=l,s[4]=t):t=s[4],_=Array.from({length:u??0},t),s[0]=l,s[1]=u,s[2]=_}else _=s[2];const j=_;let S;s[5]!==x||s[6]!==j?(S=j.map(i=>(0,y.jsx)(t.View,{style:B(i.on,x)},i.key)),s[5]=x,s[6]=j,s[7]=S):S=s[7];const w=x?M:C.pipLabel;let T,z,I,P;s[8]!==l||s[9]!==u?(T=(0,h.actCapLabel)({acts:l,cap:u}),s[8]=l,s[9]=u,s[10]=T):T=s[10],s[11]!==w||s[12]!==T?(z=(0,y.jsx)(n.Text,{style:w,children:T}),s[11]=w,s[12]=T,s[13]=z):z=s[13],s[14]!==f?(I=f?(0,y.jsx)(n.Text,{style:C.pipLabel,children:f}):null,s[14]=f,s[15]=I):I=s[15],s[16]!==S||s[17]!==z||s[18]!==I?(P=(0,y.jsxs)(t.View,{style:C.pips,children:[S,z,I]}),s[16]=S,s[17]=z,s[18]=I,s[19]=P):P=s[19];const D=p>0?`filter ${p}`:"filter";let R,v,k;return s[20]!==D?(R=(0,y.jsx)(n.Text,{style:C.headerBtnText,children:D}),s[20]=D,s[21]=R):R=s[21],s[22]!==b||s[23]!==R?(v=(0,y.jsx)(o.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Open filters",style:C.headerBtn,testID:"reels-filter-open",children:R}),s[22]=b,s[23]=R,s[24]=v):v=s[24],s[25]!==v||s[26]!==P?(k=(0,y.jsxs)(t.View,{style:C.header,testID:"reels-header",children:[P,v]}),s[25]=v,s[26]=P,s[27]=k):k=s[27],k}),T=(0,u.memo)(function(i){const s=(0,c.c)(17),{action:l,onAction:u}=i,{theme:b}=(0,p.useUnistyles)();let h;s[0]!==l.id||s[1]!==u?(h=()=>u(l.id),s[0]=l.id,s[1]=u,s[2]=h):h=s[2];const f=h,x=l.icon,_=l.disabled?O:C.railItem,j=`reels-rail-${l.id}`,S=l.destructive?b.colors.destructive:b.colors.foreground;let w;s[3]!==x||s[4]!==S?(w=(0,y.jsx)(t.View,{style:C.railIcon,children:(0,y.jsx)(x,{size:19,color:S})}),s[3]=x,s[4]=S,s[5]=w):w=s[5];const T=l.destructive?A:C.railLabel;let z,I;return s[6]!==l.label||s[7]!==T?(z=(0,y.jsx)(n.Text,{style:T,children:l.label}),s[6]=l.label,s[7]=T,s[8]=z):z=s[8],s[9]!==l.disabled||s[10]!==l.label||s[11]!==f||s[12]!==_||s[13]!==j||s[14]!==w||s[15]!==z?(I=(0,y.jsxs)(o.Pressable,{onPress:f,disabled:l.disabled,accessibilityRole:"button",accessibilityLabel:l.label,style:_,testID:j,children:[w,z]}),s[9]=l.disabled,s[10]=l.label,s[11]=f,s[12]=_,s[13]=j,s[14]=w,s[15]=z,s[16]=I):I=s[16],I}),z=(0,u.memo)(function(i){const s=(0,c.c)(23),{action:l,onAction:u}=i,{theme:b}=(0,p.useUnistyles)(),{showLabel:h,progress:f,hint:_,handlers:j}=(0,x.useDestructiveHold)(u,l.id),S=l.icon;let w;s[0]!==f?(w=Math.round(100*f),s[0]=f,s[1]=w):w=s[1];const T=`${w}%`;let z;s[2]!==T?(z=[C.railHoldFill,{height:T}],s[2]=T,s[3]=z):z=s[3];const I=z,P=`${l.label}. Hold to confirm, this cannot be undone.`,D=l.disabled?O:C.railItem,R=`reels-rail-${l.id}`;let v,k,L;s[4]!==I||s[5]!==f?(v=f>0?(0,y.jsx)(t.View,{style:I,testID:"reels-rail-hold-fill"}):null,s[4]=I,s[5]=f,s[6]=v):v=s[6],s[7]!==S||s[8]!==b.colors.destructive?(k=(0,y.jsx)(S,{size:19,color:b.colors.destructive}),s[7]=S,s[8]=b.colors.destructive,s[9]=k):k=s[9],s[10]!==v||s[11]!==k?(L=(0,y.jsxs)(t.View,{style:C.railIcon,children:[v,k]}),s[10]=v,s[11]=k,s[12]=L):L=s[12];const V=h||"hold"===_?"hold\u2026":_??`hold to ${l.label}`;let M,H;return s[13]!==V?(M=(0,y.jsx)(n.Text,{style:A,numberOfLines:2,children:V}),s[13]=V,s[14]=M):M=s[14],s[15]!==l.disabled||s[16]!==j||s[17]!==M||s[18]!==P||s[19]!==D||s[20]!==R||s[21]!==L?(H=(0,y.jsxs)(o.Pressable,Object.assign({},j,{disabled:l.disabled,accessibilityRole:"button",accessibilityLabel:P,style:D,testID:R,children:[L,M]})),s[15]=l.disabled,s[16]=j,s[17]=M,s[18]=P,s[19]=D,s[20]=R,s[21]=L,s[22]=H):H=s[22],H}),I=(0,u.memo)(function(i){const s=(0,c.c)(10),{actions:o,contextLabel:l,onAction:u}=i;let p,b,h;if(s[0]!==o||s[1]!==u){let t;s[3]!==u?(t=t=>t.destructive?(0,y.jsx)(z,{action:t,onAction:u},t.id):(0,y.jsx)(T,{action:t,onAction:u},t.id),s[3]=u,s[4]=t):t=s[4],p=o.map(t),s[0]=o,s[1]=u,s[2]=p}else p=s[2];return s[5]!==l?(b=(0,y.jsx)(t.View,{style:C.disc,children:(0,y.jsx)(n.Text,{style:C.discText,numberOfLines:1,children:l})}),s[5]=l,s[6]=b):b=s[6],s[7]!==p||s[8]!==b?(h=(0,y.jsxs)(t.View,{style:C.rail,testID:"reels-rail",children:[p,b]}),s[7]=p,s[8]=b,s[9]=h):h=s[9],h}),P=(0,u.memo)(function(l){const p=(0,c.c)(24),{available:b,onPick:h}=l,[f,x]=(0,u.useState)("");let _;p[0]!==f||p[1]!==h?(_=()=>{const t=f.trim().toLowerCase().replace(/\s+/g,"-");t.length>0&&(h(t),x(""))},p[0]=f,p[1]=h,p[2]=_):_=p[2];const j=_;let w,T,z,I,P,D,R,v,k;if(p[3]===Symbol.for("react.memo_cache_sentinel")?(w=(0,y.jsx)(n.Text,{style:C.gateTitle,children:"This session has no tag"}),T=(0,y.jsx)(n.Text,{style:C.gateBody,children:"Tag it before deciding. Without one it is invisible to every filter, report and invoice, and it comes back at the front of the next lap."}),p[3]=w,p[4]=T):(w=p[3],T=p[4]),p[5]!==b||p[6]!==h){let t;p[8]!==h?(t=t=>(0,y.jsx)(S,{value:t,label:t,onPick:h,testIDPrefix:"reels-tag"},t),p[8]=h,p[9]=t):t=p[9],z=b.map(t),p[5]=b,p[6]=h,p[7]=z}else z=p[7];return p[10]!==z?(I=(0,y.jsx)(s.ScrollView,{style:C.gateChipScroll,testID:"reels-tag-gate-list",children:(0,y.jsx)(t.View,{style:C.chipRow,children:z})}),p[10]=z,p[11]=I):I=p[11],p[12]!==f||p[13]!==j?(P=(0,y.jsx)(i.TextInput,{value:f,onChangeText:x,placeholder:"or a new tag",style:C.input,onSubmitEditing:j,testID:"reels-tag-new"}),p[12]=f,p[13]=j,p[14]=P):P=p[14],p[15]===Symbol.for("react.memo_cache_sentinel")?(D=(0,y.jsx)(n.Text,{style:C.sendText,children:"Add"}),p[15]=D):D=p[15],p[16]!==j?(R=(0,y.jsx)(o.Pressable,{onPress:j,style:C.send,accessibilityRole:"button",accessibilityLabel:"Add this tag",testID:"reels-tag-new-send",children:D}),p[16]=j,p[17]=R):R=p[17],p[18]!==P||p[19]!==R?(v=(0,y.jsxs)(t.View,{style:C.freeRow,children:[P,R]}),p[18]=P,p[19]=R,p[20]=v):v=p[20],p[21]!==I||p[22]!==v?(k=(0,y.jsxs)(t.View,{style:C.gate,testID:"reels-tag-gate",children:[w,T,I,v]}),p[21]=I,p[22]=v,p[23]=k):k=p[23],k}),D=(0,u.memo)(function({priorCount:s,now:c=new Date,onCancel:p,onSnooze:b}){const f=(0,h.snoozeDemand)(s),[x,_]=(0,u.useState)(null),[j,w]=(0,u.useState)(""),[T,z]=(0,u.useState)(""),I="needs-all"===f,P=(0,u.useMemo)(()=>{const t=c.getTime();return[{label:"2h",iso:new Date(t+72e5).toISOString()},{label:"18h",iso:new Date(t+648e5).toISOString()},{label:"3d",iso:new Date(t+2592e5).toISOString()},{label:"next week",iso:new Date(t+6048e5).toISOString()}]},[c]),D=(0,u.useMemo)(()=>P.find(t=>t.label===x)?.iso??null,[P,x]),R=(0,u.useMemo)(()=>({until:D,untilWhat:j||null,why:T||null}),[D,j,T]),v=(0,h.snoozeDraftSatisfies)(f,R),k=(0,u.useCallback)(()=>b(R),[R,b]);return"refused"===f?(0,y.jsxs)(t.View,{style:C.sheet,testID:"reels-snooze-refused",children:[(0,y.jsx)(n.Text,{style:C.sheetTitle,children:"Snoozed twice already"}),(0,y.jsx)(n.Text,{style:C.gateBody,children:"A third push is not a decision. Terminate it, automate it, fold it into another session, or hand it to someone."}),(0,y.jsx)(o.Pressable,{onPress:p,style:C.send,accessibilityRole:"button",accessibilityLabel:"Back",testID:"reels-snooze-back",children:(0,y.jsx)(n.Text,{style:C.sendText,children:"Back"})})]}):(0,y.jsxs)(l.KeyboardAvoidingView,{behavior:void 0,style:C.sheet,testID:"reels-snooze-sheet",children:[(0,y.jsx)(n.Text,{style:C.sheetTitle,children:"Snooze"}),(0,y.jsxs)(n.Text,{style:C.label,children:["Until when ",I?"(required)":""]}),(0,y.jsx)(t.View,{style:C.chipRow,children:P.map(t=>(0,y.jsx)(S,{value:t.label,label:t.label,selected:x===t.label,onPick:_,testIDPrefix:"reels-snooze-until",testIDValue:t.label},t.label))}),(0,y.jsxs)(n.Text,{style:C.label,children:["Until what ",I?"(required)":"(optional)"]}),(0,y.jsx)(i.TextInput,{value:j,onChangeText:w,placeholder:"the event you are waiting on",style:C.input,testID:"reels-snooze-what"}),(0,y.jsxs)(n.Text,{style:C.label,children:["Why ",I?"(required)":"(optional)"]}),(0,y.jsx)(i.TextInput,{value:T,onChangeText:z,placeholder:"what is missing",style:C.input,testID:"reels-snooze-why"}),(0,y.jsx)(n.Text,{style:C.note,children:"A snooze is a bet that nothing changes. A failure cancels it and the card comes back."}),(0,y.jsxs)(t.View,{style:C.freeRow,children:[(0,y.jsx)(o.Pressable,{onPress:p,style:C.send,accessibilityRole:"button",accessibilityLabel:"Cancel and close",testID:"reels-snooze-cancel",children:(0,y.jsx)(n.Text,{style:C.sendText,children:"Cancel"})}),(0,y.jsx)(o.Pressable,{onPress:k,disabled:!v,style:v?C.send:W,accessibilityRole:"button",accessibilityLabel:"Snooze this session",testID:"reels-snooze-commit",children:(0,y.jsx)(n.Text,{style:C.sendText,children:"Snooze"})})]})]})}),R=(0,u.memo)(function(i){const n=(0,c.c)(9),{current:s,onPick:o}=i,l=(0,f.useKanbanBuckets)();let u,p;if(n[0]!==l||n[1]!==s||n[2]!==o){let t;n[4]!==s||n[5]!==o?(t=t=>(0,y.jsx)(S,{value:t.id,label:t.label,selected:s===t.id,onPick:o,testIDPrefix:"reels-kanban"},t.id),n[4]=s,n[5]=o,n[6]=t):t=n[6],u=l.map(t),n[0]=l,n[1]=s,n[2]=o,n[3]=u}else u=n[3];return n[7]!==u?(p=(0,y.jsx)(t.View,{style:C.chipRow,testID:"reels-kanban",children:u}),n[7]=u,n[8]=p):p=n[8],p}),v=(0,u.memo)(function(i){const s=(0,c.c)(8),{lap:o,ringSize:l,acted:u}=i;let p,b,h;return s[0]!==o?(p=(0,y.jsxs)(n.Text,{style:C.seamRule,children:["lap ",o]}),s[0]=o,s[1]=p):p=s[1],s[2]!==u||s[3]!==l?(b=(0,y.jsxs)(n.Text,{style:C.seamNote,children:[l," sessions in the ring","\n",u," acted last lap, now at the back","\n","no caught-up card. the work is never done."]}),s[2]=u,s[3]=l,s[4]=b):b=s[4],s[5]!==p||s[6]!==b?(h=(0,y.jsxs)(t.View,{style:C.seam,testID:"reels-seam",children:[p,b]}),s[5]=p,s[6]=b,s[7]=h):h=s[7],h}),C=p.StyleSheet.create(t=>({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:t.spacing[2],paddingTop:t.spacing[2],gap:t.spacing[2],uni__dependencies:[0]},pips:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],uni__dependencies:[0]},pip:{width:7,height:7,borderRadius:t.borderRadius.full,borderWidth:1,borderColor:t.colors.foregroundMuted,uni__dependencies:[0]},pipOn:{backgroundColor:t.colors.foregroundMuted,uni__dependencies:[0]},pipMaxed:{borderColor:t.colors.accent,uni__dependencies:[0]},pipLabel:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},pipLabelMaxed:{color:t.colors.accent,uni__dependencies:[0]},headerBtn:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:t.colors.border,borderRadius:t.borderRadius.full,paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],uni__dependencies:[0]},headerBtnText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},rail:{alignItems:"center",gap:t.spacing[1],uni__dependencies:[0]},railItem:{alignItems:"center",gap:2,width:56},railIcon:{width:44,height:44,borderRadius:t.borderRadius.full,borderWidth:1,borderColor:t.colors.border,alignItems:"center",justifyContent:"center",backgroundColor:t.colors.surface0,overflow:"hidden",uni__dependencies:[0]},railHoldFill:{position:"absolute",left:0,right:0,bottom:0,backgroundColor:t.colors.destructive,opacity:.18,uni__dependencies:[0]},railLabel:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,textAlign:"center",uni__dependencies:[0]},railLabelDanger:{color:t.colors.destructive,uni__dependencies:[0]},gateChipScroll:{maxHeight:104},disc:{minHeight:38,maxWidth:96,paddingHorizontal:t.spacing[2],borderRadius:t.borderRadius.full,borderWidth:1,borderColor:t.colors.foregroundMuted,alignItems:"center",justifyContent:"center",backgroundColor:t.colors.surface0,uni__dependencies:[0]},discText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},dim:{opacity:.35},gate:{borderWidth:1,borderStyle:"dashed",borderColor:t.colors.destructive,borderRadius:t.borderRadius["2xl"],padding:t.spacing[2],gap:t.spacing[1],uni__dependencies:[0]},gateTitle:{color:t.colors.destructive,fontSize:t.fontSize.sm,fontWeight:"600",uni__dependencies:[0]},gateBody:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,lineHeight:17,uni__dependencies:[0]},chipRow:{flexDirection:"row",flexWrap:"wrap",gap:t.spacing[1],uni__dependencies:[0]},tagPick:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:t.colors.border,borderRadius:t.borderRadius.full,paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],uni__dependencies:[0]},tagPickOn:{borderColor:t.colors.accent,uni__dependencies:[0]},tagPickText:{color:t.colors.foreground,fontSize:t.fontSize.xs,uni__dependencies:[0]},freeRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],uni__dependencies:[0]},input:{flex:1,borderWidth:1,borderColor:t.colors.border,borderRadius:t.borderRadius["2xl"],paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],color:t.colors.foreground,fontSize:t.fontSize.xs,uni__dependencies:[0]},send:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:t.colors.accent,borderRadius:t.borderRadius["2xl"],paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],uni__dependencies:[0]},sendText:{color:t.colors.accent,fontSize:t.fontSize.xs,uni__dependencies:[0]},sheet:{gap:t.spacing[1],padding:t.spacing[2],uni__dependencies:[0]},sheetTitle:{color:t.colors.foreground,fontSize:t.fontSize.base,fontWeight:"600",uni__dependencies:[0]},label:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,textTransform:"uppercase",letterSpacing:.6,marginTop:t.spacing[1],uni__dependencies:[0]},note:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,fontStyle:"italic",marginTop:t.spacing[1],uni__dependencies:[0]},seam:{alignItems:"center",justifyContent:"center",gap:t.spacing[1],padding:t.spacing[3],uni__dependencies:[0]},seamRule:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,letterSpacing:3,uni__dependencies:[0]},seamNote:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,textAlign:"center",lineHeight:18,uni__dependencies:[0]}})),k=[C.pip,C.pipOn],L=[C.pip,C.pipMaxed],V=[C.pip,C.pipOn,C.pipMaxed],M=[C.pipLabel,C.pipLabelMaxed],O=[C.railItem,C.dim],A=[C.railLabel,C.railLabelDanger],H=[C.tagPick,C.tagPickOn],W=[C.send,C.dim];function B(t,i){return t&&i?V:t?k:i?L:C.pip}},4016,[348,2838,349,2815,2476,4017,350,36,659,25,546,182,234,571,146,56,811,4018,4007,4019,279]);
15776
15776
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"KeyboardAvoidingView",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};const u=(0,r(d[1]).createUnistylesElement)(n.default)},4017,[659,274]);
15777
15777
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.snoozeDemand=function(t){if(t<=0)return"free";if(1===t)return"needs-all";return"refused"},e.snoozeDraftSatisfies=function(t,n){if("refused"===t)return!1;if(!n.until)return!1;if("free"===t)return!0;return(n.untilWhat?.trim().length??0)>1&&(n.why?.trim().length??0)>2},Object.defineProperty(e,"DEFAULT_ACT_CAP",{enumerable:!0,get:function(){return t}}),e.canAct=function({acts:t,cap:n}){if(null===n)return!0;return t<n},e.actCapLabel=function({acts:t,cap:n}){if(null===n)return`${t} decisions`;return t>=n?`${t}/${n} - the rest is tomorrow`:`${t}/${n} essential`};const t=5},4018,[]);
15778
15778
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"FILL_TICK_MS",{enumerable:!0,get:function(){return o}}),e.useDestructiveHold=function(s,u){const _=(0,t.c)(23),[f,h]=(0,n.useState)(l.idleHold),[S,b]=(0,n.useState)(null),[v,I]=(0,n.useState)(0),y=(0,n.useRef)(null);let D;_[0]===Symbol.for("react.memo_cache_sentinel")?(D=(0,l.idleHold)(),_[0]=D):D=_[0];const H=(0,n.useRef)(D),L=(0,n.useRef)(null);let P;_[1]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{null!==L.current&&(clearTimeout(L.current),L.current=null),null!==y.current&&(clearInterval(y.current),y.current=null)},_[1]=P):P=_[1];const T=P;let w;_[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{null!==y.current&&clearInterval(y.current),y.current=setInterval(()=>{const t=(0,l.holdProgress)(H.current,Date.now(),c);I(t),t>=1&&null!==y.current&&(clearInterval(y.current),y.current=null)},o)},_[2]=w):w=_[2];const M=w;let R;_[3]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{b(null);const t=(0,l.press)(Date.now());H.current=t,h(t),T(),L.current=setTimeout(()=>{const t=(0,l.tick)(H.current,Date.now());H.current=t,h(t),M()},l.UNFURL_MS)},_[3]=R):R=_[3];const p=R;let E;_[4]!==s||_[5]!==u?(E=t=>{T();const n=(0,l.release)(H.current,Date.now(),c,t);H.current=(0,l.idleHold)(),h((0,l.idleHold)()),I(0),n.commit?(b(null),Promise.resolve(s(u)).catch(t=>{b(t instanceof Error?t.message:"could not retire it")})):b("too-short"===n.reason||"not-read"===n.reason?"hold":null)},_[4]=s,_[5]=u,_[6]=E):E=_[6];const O=E;let C;_[7]!==O?(C=()=>O(!1),_[7]=O,_[8]=C):C=_[8];const U=C;let j;_[9]!==O?(j=()=>O(!0),_[9]=O,_[10]=j):j=_[10];const F=j;let V,k,K,N,q;_[11]===Symbol.for("react.memo_cache_sentinel")?(V=()=>T,k=[T],_[11]=V,_[12]=k):(V=_[11],k=_[12]);(0,n.useEffect)(V,k),_[13]!==f?(K=(0,l.isLabelVisible)(f),_[13]=f,_[14]=K):K=_[14];_[15]!==F||_[16]!==U?(N={onPressIn:p,onPressOut:U,onTouchCancel:F},_[15]=F,_[16]=U,_[17]=N):N=_[17];_[18]!==S||_[19]!==v||_[20]!==N||_[21]!==K?(q={showLabel:K,progress:v,hint:S,handlers:N},_[18]=S,_[19]=v,_[20]=N,_[21]=K,_[22]=q):q=_[22];return q};var t=r(d[0]),n=r(d[1]),l=r(d[2]);const c={holdMs:l.DESTRUCTIVE_HOLD_MS},o=40},4019,[350,36,4020]);
@@ -16324,7 +16324,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
16324
16324
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.HighlightedLines=function(e){const n=(0,o.c)(13),{lines:l,startLine:s}=e;if(void 0===s){let e,o;return n[0]!==l?(e=l.map(j),n[0]=l,n[1]=e):e=n[1],n[2]!==e?(o=(0,S.jsx)(t.View,{dataSet:f.CODE_SURFACE_DATASET,children:e}),n[2]=e,n[3]=o):o=n[3],o}const c=s+l.length-1,u=Math.max(2,String(c).length);let x,h;if(n[4]!==u||n[5]!==l||n[6]!==s){let e;n[8]!==u||n[9]!==s?(e=(e,t)=>(0,S.jsx)(T,{line:e,lineNumber:s+t,digits:u},e.key),n[8]=u,n[9]=s,n[10]=e):e=n[10],x=l.map(e),n[4]=u,n[5]=l,n[6]=s,n[7]=x}else x=n[7];n[11]!==x?(h=(0,S.jsx)(t.View,{dataSet:f.CODE_SURFACE_DATASET,children:x}),n[11]=x,n[12]=h):h=n[12];return h};var e,t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),s=(e=l)&&e.__esModule?e:{default:e};r(d[4]),r(d[5]);var c=r(d[6]),u=r(d[7]),f=r(d[8]),x=r(d[9]),S=r(d[10]);const h="\u200b";function y(e){const t=(0,o.c)(4),{line:l}=e;let s,c;return t[0]!==l.tokens?(s=0===l.tokens.length?h:l.tokens.map(_),t[0]=l.tokens,t[1]=s):s=t[1],t[2]!==s?(c=(0,S.jsx)(n.Text,{selectable:!0,style:p.lineText,children:s}),t[2]=s,t[3]=c):c=t[3],c}function _(e){const{key:t,token:o}=e;return(0,S.jsx)(n.Text,{style:o.style?(0,x.syntaxTokenStyleFor)(o.style):void 0,children:o.text},t)}const T=s.default.memo(function(e){const l=(0,o.c)(10),{line:s,lineNumber:c,digits:u}=e,f=String(c);let x,h,_,T;return l[0]!==u||l[1]!==f?(x=f.padStart(u),l[0]=u,l[1]=f,l[2]=x):x=l[2],l[3]!==x?(h=(0,S.jsxs)(n.Text,{style:p.gutterText,children:[x," "]}),l[3]=x,l[4]=h):h=l[4],l[5]!==s?(_=(0,S.jsx)(y,{line:s}),l[5]=s,l[6]=_):_=l[6],l[7]!==h||l[8]!==_?(T=(0,S.jsxs)(t.View,{style:p.row,children:[h,_]}),l[7]=h,l[8]=_,l[9]=T):T=l[9],T});function j(e){return(0,S.jsx)(y,{line:e},e.key)}const p=c.StyleSheet.create(e=>({row:{flexDirection:"row",minHeight:18},gutterText:{fontFamily:e.fontFamily.mono,fontSize:e.fontSize.code,lineHeight:18,color:e.colors.foregroundMuted,opacity:.6,userSelect:"none",flexShrink:0,uni__dependencies:[0]},lineText:Object.assign({fontFamily:e.fontFamily.mono,fontSize:e.fontSize.code,color:e.colors.foreground,lineHeight:18},u.isWeb?{whiteSpace:"pre",overflowWrap:"normal"}:null,{uni__dependencies:[0]})}))},4565,[348,349,350,36,234,146,56,3420,3820,3821,279]);
16325
16325
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DiffViewer=function(e){const t=(0,l.c)(32),{diffLines:c,maxHeight:u,emptyLabel:y,fillAvailableHeight:h}=e,p=void 0!==h&&h,{t:S}=(0,x.useTranslation)(),[v,k]=s.default.useState(0);let C;t[0]!==y||t[1]!==S?(C=y??S("diffViewer.empty"),t[0]=y,t[1]=S,t[2]=C):C=t[2];const w=C,H=(0,f.useWebScrollbarStyle)();let L;t[3]===Symbol.for("react.memo_cache_sentinel")?(L=e=>k(e.nativeEvent.layout.width),t[3]=L):L=t[3];const E=L;let W;t[4]!==u?(W=void 0!==u&&(0,T.inlineUnistylesStyle)({maxHeight:u}),t[4]=u,t[5]=W):W=t[5];const F=p&&$.fillHeight;let M;t[6]!==W||t[7]!==F||t[8]!==H?(M=[$.verticalScroll,W,F,H],t[6]=W,t[7]=F,t[8]=H,t[9]=M):M=t[9];const A=M;let D,I;t[10]!==v?(D=v>0&&(0,T.inlineUnistylesStyle)({minWidth:v}),t[10]=v,t[11]=D):D=t[11];t[12]!==D?(I=[$.linesContainer,D],t[12]=D,t[13]=I):I=t[13];const O=I;let R;t[14]!==c?(R=c.map(z),t[14]=c,t[15]=R):R=t[15];const U=R,B=p&&$.fillHeight;let P;t[16]!==B?(P=[$.verticalContent,B],t[16]=B,t[17]=P):P=t[17];const G=P;if(!c.length){let e;return t[18]!==w?(e=(0,b.jsx)(o.View,{style:$.emptyState,children:(0,b.jsx)(n.Text,{style:$.emptyText,children:w})}),t[18]=w,t[19]=e):e=t[19],e}let q,J;t[20]!==U?(q=U.map(V),t[20]=U,t[21]=q):q=t[21];t[22]!==O||t[23]!==q?(J=(0,b.jsx)(o.View,{style:O,dataSet:_.CODE_SURFACE_DATASET,children:q}),t[22]=O,t[23]=q,t[24]=J):J=t[24];const K=J;let N;t[25]!==K||t[26]!==H?(N=(0,b.jsx)(j,{horizontal:!0,nestedScrollEnabled:!0,showsHorizontalScrollIndicator:!0,style:H,contentContainerStyle:$.horizontalContent,onLayout:E,children:K}),t[25]=K,t[26]=H,t[27]=N):N=t[27];const Q=N;let X;t[28]!==Q||t[29]!==A||t[30]!==G?(X=(0,b.jsx)(j,{style:A,contentContainerStyle:G,nestedScrollEnabled:!0,showsVerticalScrollIndicator:!0,children:Q}),t[28]=Q,t[29]=A,t[30]=G,t[31]=X):X=t[31];return X};var e,t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),c=r(d[4]),s=(e=c)&&e.__esModule?e:{default:e},x=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var u=r(d[9]),y=r(d[10]),h=r(d[11]),p=r(d[12]),f=r(d[13]),T=r(d[14]),S=r(d[15]),_=r(d[16]),v=r(d[17]),b=r(d[18]);const j=v.isWeb?t.ScrollView:u.ScrollView;function k(e){const t=(0,l.c)(35),{line:c}=e,s="header"===c.type&&$.headerLine,x="add"===c.type&&$.addLine,u="remove"===c.type&&$.removeLine,y="context"===c.type&&$.contextLine;let p;t[0]!==s||t[1]!==x||t[2]!==u||t[3]!==y?(p=[$.line,s,x,u,y],t[0]=s,t[1]=x,t[2]=u,t[3]=y,t[4]=p):p=t[4];const f=p,T="header"===c.type&&$.headerText,S="add"===c.type&&$.addText,_="remove"===c.type&&$.removeText,v="context"===c.type&&$.contextText;let j;t[5]!==T||t[6]!==S||t[7]!==_||t[8]!==v?(j=[$.lineText,T,S,_,v],t[5]=T,t[6]=S,t[7]=_,t[8]=v,t[9]=j):j=t[9];const k=j,w="add"===c.type&&$.addText,H="remove"===c.type&&$.removeText,V="context"===c.type&&$.contextText;let z;t[10]!==w||t[11]!==H||t[12]!==V?(z=[w,H,V],t[10]=w,t[11]=H,t[12]=V,t[13]=z):z=t[13];const E=z;if(c.tokens){let e,l,s,x,u;return t[14]!==c?(e=(0,h.diffLinePrefix)(c),t[14]=c,t[15]=e):e=t[15],t[16]!==E||t[17]!==e?(l=(0,b.jsx)(n.Text,{style:E,children:e}),t[16]=E,t[17]=e,t[18]=l):l=t[18],t[19]!==c.tokens?(s=(0,b.jsx)(C,{tokens:c.tokens}),t[19]=c.tokens,t[20]=s):s=t[20],t[21]!==l||t[22]!==s?(x=(0,b.jsxs)(n.Text,{style:$.lineText,children:[l,s]}),t[21]=l,t[22]=s,t[23]=x):x=t[23],t[24]!==f||t[25]!==x?(u=(0,b.jsx)(o.View,{style:f,children:x}),t[24]=f,t[25]=x,t[26]=u):u=t[26],u}let W,F;return t[27]!==c.content||t[28]!==c.segments||t[29]!==c.type||t[30]!==k?(W=c.segments?(0,b.jsxs)(n.Text,{style:$.lineText,children:[(0,b.jsx)(n.Text,{style:"add"===c.type?$.addText:$.removeText,children:c.content[0]}),c.segments.map(e=>(0,b.jsx)(L,{segment:e,lineType:c.type},`${e.changed?"c":"u"}:${e.text}`))]}):(0,b.jsx)(n.Text,{style:k,children:c.content}),t[27]=c.content,t[28]=c.segments,t[29]=c.type,t[30]=k,t[31]=W):W=t[31],t[32]!==f||t[33]!==W?(F=(0,b.jsx)(o.View,{style:f,children:W}),t[32]=f,t[33]=W,t[34]=F):F=t[34],F}function C(e){const t=(0,l.c)(6),{tokens:n}=e;let o;t[0]!==n?(o=n.map(H),t[0]=n,t[1]=o):o=t[1];const c=o;let s,x;return t[2]!==c?(s=c.map(w),t[2]=c,t[3]=s):s=t[3],t[4]!==s?(x=(0,b.jsx)(b.Fragment,{children:s}),t[4]=s,t[5]=x):x=t[5],x}function w(e){const{key:t,token:o}=e;return(0,b.jsx)(n.Text,{style:o.style?(0,p.syntaxTokenStyleFor)(o.style):void 0,children:o.text},t)}function H(e,t){return{key:`${t}-${e.text}`,token:e}}function L(e){const t=(0,l.c)(6),{segment:o,lineType:c}=e,s="add"===c?$.addText:$.removeText,x=o.changed&&("add"===c?$.addHighlight:$.removeHighlight);let u;t[0]!==s||t[1]!==x?(u=[s,x],t[0]=s,t[1]=x,t[2]=u):u=t[2];const y=u;let h;return t[3]!==o.text||t[4]!==y?(h=(0,b.jsx)(n.Text,{style:y,children:o.text}),t[3]=o.text,t[4]=y,t[5]=h):h=t[5],h}function V(e){const{key:t,line:n}=e;return(0,b.jsx)(k,{line:n},t)}function z(e,t){return{key:`${t}-${e.type}-${e.content}`,line:e}}const $=y.StyleSheet.create(e=>{const t=(0,S.getCodeInsets)(e);return{verticalScroll:{},fillHeight:{flex:1,minHeight:0},verticalContent:{flexGrow:1,paddingBottom:t.extraBottom},horizontalContent:{flexDirection:"column",paddingRight:t.extraRight},linesContainer:{alignSelf:"flex-start",padding:t.padding},line:{minWidth:"100%",paddingHorizontal:0,paddingVertical:e.spacing[1],uni__dependencies:[0]},lineText:Object.assign({fontFamily:e.fontFamily.mono,fontSize:e.fontSize.code,color:e.colors.foreground},v.isWeb?{whiteSpace:"pre",overflowWrap:"normal"}:null,{uni__dependencies:[0]}),headerLine:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},headerText:{color:e.colors.foregroundMuted,uni__dependencies:[0]},addLine:{backgroundColor:"rgba(46, 160, 67, 0.15)"},addText:{color:e.colors.foreground,uni__dependencies:[0]},removeLine:{backgroundColor:"rgba(248, 81, 73, 0.1)"},removeText:{color:e.colors.foreground,uni__dependencies:[0]},addHighlight:{backgroundColor:"rgba(46, 160, 67, 0.4)"},removeHighlight:{backgroundColor:"rgba(248, 81, 73, 0.35)"},contextLine:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},contextText:{color:e.colors.foregroundMuted,uni__dependencies:[0]},emptyState:{padding:e.spacing[4],alignItems:"center",justifyContent:"center",uni__dependencies:[0]},emptyText:{fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,uni__dependencies:[0]}}})},4566,[2815,349,348,350,36,352,146,234,182,2482,56,4562,3821,3589,3486,3885,3820,3420,279]);
16326
16326
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return k}});var t=r(d[0]);r(d[1]);var s=r(d[2]),n=r(d[3]),o=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),f=r(d[8]),v=r(d[9]),b=r(d[10]),S=r(d[11]);function k(){const k=(0,t.c)(23),{serverId:B}=(0,s.useLocalSearchParams)(),_=(0,s.useRouter)(),j=(0,b.useKanbanBuckets)(),I=(0,b.useDefaultBucketId)();let O;k[0]!==j?(O=new Set(j.map(A)),k[0]=j,k[1]=O):O=k[1];const R=O;let h;k[2]!==B?(h=t=>t.sessions[B??""]?.agents,k[2]=B,k[3]=h):h=k[3];const z=(0,c.useSessionStore)(h);let P;e:{if(!z){let t;k[4]===Symbol.for("react.memo_cache_sentinel")?(t=[],k[4]=t):t=k[4],P=t;break e}let t;if(k[5]!==z||k[6]!==I||k[7]!==R||k[8]!==B){let s;k[10]!==I||k[11]!==R||k[12]!==B?(s=t=>({id:t.id,serverId:B??"",title:t.title??t.id,statusBucket:(0,f.deriveSidebarStateBucket)((0,f.toBucketInput)(t)),tags:Object.entries(t.labels??{}).filter(y).map(p),digest:t.digest??null,kanban:(0,v.resolveBucketId)(t,R,I),provider:t.provider,model:t.model,lastActivityAt:t.lastActivityAt,snoozeCount:t.snooze?.count??0,snoozedUntil:t.snooze?.until??null,origin:(0,u.deriveSessionOrigin)(t.labels??null),createdAt:t.createdAt}),k[10]=I,k[11]=R,k[12]=B,k[13]=s):s=k[13],t=(0,l.selectFeedCandidates)([...z.values()]).map(s),k[5]=z,k[6]=I,k[7]=R,k[8]=B,k[9]=t}else t=k[9];P=t}const w=P;let C;if(k[14]!==z){const t=new Set;for(const s of z?.values()??[])for(const n of Object.keys(s.labels??{}))n.startsWith("tag:")&&t.add(n.slice(4));C=[...t].sort(),k[14]=z,k[15]=C}else C=k[15];const L=C;let W;k[16]!==_||k[17]!==B?(W=()=>{_.replace((0,n.buildHostRootRoute)(B??""))},k[16]=_,k[17]=B,k[18]=W):W=k[18];const x=W;let D;return k[19]!==L||k[20]!==x||k[21]!==w?(D=(0,S.jsx)(o.ReelsScreen,{sessions:w,allTags:L,onLeaveRing:x}),k[19]=L,k[20]=x,k[21]=w,k[22]=D):D=k[22],D}function p(t){const[s]=t;return s.slice(4)}function y(t){const[s]=t;return s.startsWith("tag:")}function A(t){return t.id}},4567,[350,36,379,3492,4568,4576,3427,3621,3441,4008,4007,279]);
16327
- __d(function(g,r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.shouldTrackSheetDrag=O,_e.shouldCloseOnDrag=M,_e.destructiveHint=E,_e.verbAccessibilityLabel=H,Object.defineProperty(_e,"UNWIRED_VERBS",{enumerable:!0,get:function(){return F}}),_e.bucketLabel=K,_e.relativeAge=q,_e.cardMetaLine=U,_e.consolidateRowLabel=ee,_e.emptyRingState=he,_e.relativeWake=be,_e.backgroundTextFor=ge,Object.defineProperty(_e,"ReelsScreen",{enumerable:!0,get:function(){return fe}}),_e.shareTextFor=ve;var t=r(_d[0]),n=r(_d[1]),s=r(_d[2]),o=r(_d[3]),l=r(_d[4]),i=r(_d[5]),a=r(_d[6]),c=r(_d[7]),d=r(_d[8]);r(_d[9]);e(r(_d[10]));var u=e(r(_d[11])),h=e(r(_d[12]));r(_d[13]);var b=e(r(_d[14]));r(_d[15]),r(_d[16]),r(_d[17]),r(_d[18]),r(_d[19]),r(_d[20]);var p=r(_d[21]),y=r(_d[22]),f=r(_d[23]),x=r(_d[24]),j=r(_d[25]),S=r(_d[26]),v=r(_d[27]),k=r(_d[28]),w=r(_d[29]),T=r(_d[30]),_=r(_d[31]),C=r(_d[32]),I=r(_d[33]),D=r(_d[34]),V=r(_d[35]),z=r(_d[36]),R=r(_d[37]),L=r(_d[38]),P=r(_d[39]),A=r(_d[40]),$=r(_d[41]);function O(e){return e>8}function M(e){return e>60}function E(e,t,n){return t&&"hold"!==t?t:e||"hold"===t?"hold to retire, this cannot be undone":n}function H(e,t){return"terminate"===e?`${t}. Hold to confirm, this cannot be undone.`:F.has(e)?`${t}. Not wired yet.`:t}const W={automate:"automate",share:"share",snooze:"snooze",options:"kanban",consolidate:"consolidate"},B={share:null,automate:null,snooze:null,kanban:null,tag:null,consolidate:null},F=new Set([]);function N(e){return e.key}const G={needs_input:"needs you",failed:"failed",attention:"wants a look",pending:"waiting",running:"running",done:"done"};function K(e){return G[e]??e.replace(/_/g," ")}function q(e,t=new Date){if(!e)return"";const n=t.getTime()-e.getTime();if(!Number.isFinite(n)||n<0)return"";const s=Math.floor(n/6e4);if(s<1)return"just now";if(s<60)return`${s}m`;const o=Math.floor(s/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}function U(e,t){return[K(String(e.statusBucket)),q(e.lastActivityAt,t),e.model?`${e.provider}/${e.model}`:e.provider].filter(e=>e.length>0).join(" \xb7 ")}function Y(e,t){const n=(0,c.c)(8);let s,o,l,i;n[0]!==e||n[1]!==t?(s=()=>{if(!e||"undefined"==typeof document)return;const n=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},o=[e,t],n[0]=e,n[1]=t,n[2]=s,n[3]=o):(s=n[2],o=n[3]),(0,d.useEffect)(s,o),n[4]!==e||n[5]!==t?(l=()=>{},i=[e,t],n[4]=e,n[5]=t,n[6]=l,n[7]=i):(l=n[6],i=n[7]),(0,d.useEffect)(l,i)}const X=(0,d.memo)(function(e){const a=(0,c.c)(90),{session:u,visible:y,onClose:f,onSend:x,sendError:j,openDecisions:S,target:v,actAllowed:w}=e,[T,_]=(0,d.useState)(""),C=v?.question??null,I=u.digest;let D;a[0]!==x||a[1]!==T?(D=()=>{const e=T.trim();e.length>0&&(x(e),_(""))},a[0]=x,a[1]=T,a[2]=D):D=a[2];const V=D,z=(0,p.useSafeAreaInsets)(),R=xe.captionSheet,[L,P]=(0,d.useState)(!1);let A,O;a[3]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{const e=h.default.addListener("keyboardDidShow",()=>P(!0)),t=h.default.addListener("keyboardDidHide",()=>P(!1));return()=>{e.remove(),t.remove()}},O=[],a[3]=A,a[4]=O):(A=a[3],O=a[4]),(0,d.useEffect)(A,O);const E=L&&!1?0:z.bottom;let H;a[5]!==E?(H=[xe.sheetInner,{paddingBottom:E}],a[5]=E,a[6]=H):H=a[6];const W=H;let B;a[7]!==f?(B=b.default.create({onMoveShouldSetPanResponder:Oe,onPanResponderRelease:(e,t)=>{M(t.dy)&&f()}}),a[7]=f,a[8]=B):B=a[8];const F=B;let N,G,K;Y(y,f),a[9]!==w?(N=w?null:(0,$.jsx)(s.Text,{style:xe.composerLabel,testID:"reels-composer-capped",children:"Decisions are done for today. This one keeps until tomorrow."}),a[9]=w,a[10]=N):N=a[10],a[11]!==w||a[12]!==C||a[13]!==S.length||a[14]!==V||a[15]!==T?(G=w?(0,$.jsxs)($.Fragment,{children:[C?(0,$.jsx)(s.Text,{style:xe.composerLabel,numberOfLines:2,testID:"reels-composer-target",children:S.length>1?`Answering the first of ${S.length} open decisions: ${C}`:`Answering: ${C}`}):null,(0,$.jsxs)(t.View,{style:xe.composer,children:[(0,$.jsx)(n.TextInput,{value:T,onChangeText:_,placeholder:C?"in your own words":"say what to do",style:xe.composerInput,onSubmitEditing:V,returnKeyType:"send",testID:"reels-composer-input"}),(0,$.jsx)(l.Pressable,{onPress:V,style:xe.composerSend,accessibilityRole:"button",accessibilityLabel:"Send this answer",hitSlop:8,testID:"reels-composer-send",children:(0,$.jsx)(s.Text,{style:xe.link,children:"send"})})]})]}):null,a[11]=w,a[12]=C,a[13]=S.length,a[14]=V,a[15]=T,a[16]=G):G=a[16],a[17]!==N||a[18]!==G?(K=(0,$.jsxs)(t.View,{children:[N,G]}),a[17]=N,a[18]=G,a[19]=K):K=a[19];const q=K;if(!y)return null;let U,X,Z,ee,te,ne,se;a[20]!==f?(U=(0,$.jsx)(l.Pressable,{style:xe.captionBackdrop,onPress:f,accessibilityRole:"button",accessibilityLabel:"Close the digest",testID:"reels-caption-backdrop"}),a[20]=f,a[21]=U):U=a[21],a[22]===Symbol.for("react.memo_cache_sentinel")?(X=(0,$.jsx)(t.View,{style:xe.sheetHandle}),a[22]=X):X=a[22],a[23]!==F.panHandlers?(Z=(0,$.jsx)(t.View,Object.assign({},F.panHandlers,{style:xe.sheetGrab,testID:"reels-caption-grab",children:X})),a[23]=F.panHandlers,a[24]=Z):Z=a[24],a[25]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,$.jsx)(J,{}),a[25]=ee):ee=a[25],a[26]!==f?(te=(0,$.jsx)(l.Pressable,{onPress:f,style:xe.sheetClose,hitSlop:8,accessibilityRole:"button",accessibilityLabel:"Close the digest",testID:"reels-caption-close",children:ee}),a[26]=f,a[27]=te):te=a[27],a[28]!==u.title?(ne=(0,$.jsx)(s.Text,{style:we,numberOfLines:1,children:u.title}),a[28]=u.title,a[29]=ne):ne=a[29],a[30]!==te||a[31]!==ne?(se=(0,$.jsxs)(t.View,{style:xe.sheetHead,children:[te,ne]}),a[30]=te,a[31]=ne,a[32]=se):se=a[32];const oe=I?.summary;let le;a[33]!==oe?(le=(0,$.jsx)(Q,{label:"Summary",value:oe,derived:!0}),a[33]=oe,a[34]=le):le=a[34];const ie=I?.goal;let re;a[35]!==ie?(re=(0,$.jsx)(Q,{label:"Goal",value:ie}),a[35]=ie,a[36]=re):re=a[36];const ae=I?.nextStep;let ce,de,ue,he,be,ge,pe,me,ye,fe,je,Se,ve;if(a[37]!==ae?(ce=(0,$.jsx)(Q,{label:"Next step",value:ae}),a[37]=ae,a[38]=ce):ce=a[38],a[39]!==I?.blockers?(de=I?.blockers?.join("\n"),a[39]=I?.blockers,a[40]=de):de=a[40],a[41]!==de?(ue=(0,$.jsx)(Q,{label:"Blockers",value:de,danger:!0}),a[41]=de,a[42]=ue):ue=a[42],a[43]!==I?.accomplishments?(he=I?.accomplishments?.join("\n"),a[43]=I?.accomplishments,a[44]=he):he=a[44],a[45]!==he?(be=(0,$.jsx)(Q,{label:"Accomplishments",value:he,derived:!0}),a[45]=he,a[46]=be):be=a[46],a[47]!==I?.keyFiles?(ge=I?.keyFiles?.join("\n"),a[47]=I?.keyFiles,a[48]=ge):ge=a[48],a[49]!==ge?(pe=(0,$.jsx)(Q,{label:"Key files",value:ge,derived:!0}),a[49]=ge,a[50]=pe):pe=a[50],a[51]!==I?.links?(me=I?.links?.map(Me).join("\n"),a[51]=I?.links,a[52]=me):me=a[52],a[53]!==me?(ye=(0,$.jsx)(Q,{label:"Links",value:me}),a[53]=me,a[54]=ye):ye=a[54],a[55]!==S){let e;a[57]!==S.length?(e=(e,t)=>(0,$.jsx)(Q,{label:S.length>1?`Decision ${t+1} of ${S.length}`:"Decision",value:e.question},e.id),a[57]=S.length,a[58]=e):e=a[58],fe=S.map(e),a[55]=S,a[56]=fe}else fe=a[56];var ke;let Te,Ce,Ie,De,Ve;return a[59]!==u.tags?(je=u.tags.join(", ")||"no tag",a[59]=u.tags,a[60]=je):je=a[60],a[61]!==je?(Se=(0,$.jsx)(Q,{label:"Tags",value:je}),a[61]=je,a[62]=Se):Se=a[62],a[63]!==u.kanban?(ve=(ke=u.kanban)?(0,k.getBucketLabel)(ke)||ke:"no column",a[63]=u.kanban,a[64]=ve):ve=a[64],a[65]!==ve?(Te=(0,$.jsx)(Q,{label:"Kanban",value:ve}),a[65]=ve,a[66]=Te):Te=a[66],a[67]!==le||a[68]!==re||a[69]!==ce||a[70]!==ue||a[71]!==be||a[72]!==pe||a[73]!==ye||a[74]!==fe||a[75]!==Se||a[76]!==Te?(Ce=(0,$.jsxs)(o.ScrollView,{style:xe.sheetBody,testID:"reels-caption-body",children:[le,re,ce,ue,be,pe,ye,fe,Se,Te]}),a[67]=le,a[68]=re,a[69]=ce,a[70]=ue,a[71]=be,a[72]=pe,a[73]=ye,a[74]=fe,a[75]=Se,a[76]=Te,a[77]=Ce):Ce=a[77],a[78]!==j?(Ie=j?(0,$.jsxs)(s.Text,{style:xe.sendError,testID:"reels-composer-error",children:["Could not send that: ",j,". Nothing was recorded, so try again."]}):null,a[78]=j,a[79]=Ie):Ie=a[79],a[80]!==q||a[81]!==W||a[82]!==Z||a[83]!==se||a[84]!==Ce||a[85]!==Ie?(De=(0,$.jsx)(i.KeyboardAvoidingView,{behavior:"height",style:R,testID:"reels-caption-sheet",children:(0,$.jsxs)(t.View,{style:W,children:[Z,se,Ce,Ie,q]})}),a[80]=q,a[81]=W,a[82]=Z,a[83]=se,a[84]=Ce,a[85]=Ie,a[86]=De):De=a[86],a[87]!==U||a[88]!==De?(Ve=(0,$.jsxs)($.Fragment,{children:[U,De]}),a[87]=U,a[88]=De,a[89]=Ve):Ve=a[89],Ve}),J=(0,d.memo)(function(){const e=(0,c.c)(2),{theme:t}=(0,y.useUnistyles)();let n;return e[0]!==t.colors.foregroundMuted?(n=(0,$.jsx)(f.X,{size:18,color:t.colors.foregroundMuted}),e[0]=t.colors.foregroundMuted,e[1]=n):n=e[1],n}),Q=(0,d.memo)(function(e){const n=(0,c.c)(9),{label:o,value:l,derived:i,danger:a}=e;if(!l)return null;const d=i?" (derived)":"";let u;n[0]!==o||n[1]!==d?(u=(0,$.jsxs)(s.Text,{style:xe.fieldLabel,children:[o,d]}),n[0]=o,n[1]=d,n[2]=u):u=n[2];const h=a?ke:xe.fieldValue;let b,p;return n[3]!==h||n[4]!==l?(b=(0,$.jsx)(s.Text,{style:h,children:l}),n[3]=h,n[4]=l,n[5]=b):b=n[5],n[6]!==u||n[7]!==b?(p=(0,$.jsxs)(t.View,{style:xe.field,children:[u,b]}),n[6]=u,n[7]=b,n[8]=p):p=n[8],p}),Z={on:{selected:!0},off:{selected:!1}};function ee(e,t,n){return t?n?`${e}, picked, survives this consolidation`:`${e}, picked`:`${e}, not picked`}const te=(0,d.memo)(function(e){const n=(0,c.c)(39),{session:o,picked:i,isWinner:a,now:d,onToggle:u,onCrown:h}=e,{theme:b}=(0,y.useUnistyles)();let p;n[0]!==u||n[1]!==o.id?(p=()=>u(o.id),n[0]=u,n[1]=o.id,n[2]=p):p=n[2];const x=p;let j;n[3]!==h||n[4]!==o.id?(j=()=>h(o.id),n[3]=h,n[4]=o.id,n[5]=j):j=n[5];const S=j;let v,k=f.Square;i&&(k=a?f.Crown:f.SquareCheck),n[6]!==a||n[7]!==i||n[8]!==o.title?(v=ee(o.title,i,a),n[6]=a,n[7]=i,n[8]=o.title,n[9]=v):v=n[9];const w=Z[i?"on":"off"],T=i?Te:xe.pickRow,_=`reels-consolidate-pick-${o.id}`;let C,I,D;n[10]!==k||n[11]!==b.colors.accent?(C=(0,$.jsx)(t.View,{style:xe.pickMark,children:(0,$.jsx)(k,{size:16,color:b.colors.accent})}),n[10]=k,n[11]=b.colors.accent,n[12]=C):C=n[12],n[13]!==o.title?(I=(0,$.jsx)(s.Text,{style:xe.pickName,children:o.title}),n[13]=o.title,n[14]=I):I=n[14],n[15]!==d||n[16]!==o.lastActivityAt?(D=q(o.lastActivityAt,d),n[15]=d,n[16]=o.lastActivityAt,n[17]=D):D=n[17];const V=a&&i?" \xb7 survives":"";let z,R,L;return n[18]!==V||n[19]!==D?(z=(0,$.jsxs)(s.Text,{style:xe.pickAux,children:[D,V]}),n[18]=V,n[19]=D,n[20]=z):z=n[20],n[21]!==S||n[22]!==a||n[23]!==i||n[24]!==o.id||n[25]!==o.title||n[26]!==b.colors.foregroundMuted?(R=i&&!a?(0,$.jsx)(l.Pressable,{onPress:S,accessibilityRole:"button",accessibilityLabel:`Make ${o.title} the survivor`,hitSlop:8,style:xe.pickCrown,testID:`reels-consolidate-crown-${o.id}`,children:(0,$.jsx)(f.Crown,{size:14,color:b.colors.foregroundMuted})}):null,n[21]=S,n[22]=a,n[23]=i,n[24]=o.id,n[25]=o.title,n[26]=b.colors.foregroundMuted,n[27]=R):R=n[27],n[28]!==S||n[29]!==z||n[30]!==R||n[31]!==v||n[32]!==w||n[33]!==T||n[34]!==_||n[35]!==C||n[36]!==I||n[37]!==x?(L=(0,$.jsxs)(l.Pressable,{onPress:x,onLongPress:S,accessibilityRole:"button",accessibilityLabel:v,accessibilityState:w,style:T,testID:_,children:[C,I,z,R]}),n[28]=S,n[29]=z,n[30]=R,n[31]=v,n[32]=w,n[33]=T,n[34]=_,n[35]=C,n[36]=I,n[37]=x,n[38]=L):L=n[38],L}),ne=(0,d.memo)(function(e){const n=(0,c.c)(67),{candidates:i,now:a,onCancel:u,onConsolidate:h,verbError:b}=e;let p;n[0]===Symbol.for("react.memo_cache_sentinel")?(p={},n[0]=p):p=n[0];const[y,f]=(0,d.useState)(p);let x;if(n[1]!==i||n[2]!==y){let e;n[4]!==y?(e=e=>y[e.id],n[4]=y,n[5]=e):e=n[5],x=i.filter(e),n[1]=i,n[2]=y,n[3]=x}else x=n[3];const j=x,[S,v]=(0,d.useState)(null);let k;n[6]!==j||n[7]!==S?(k=(0,A.consolidationTargets)(j,S),n[6]=j,n[7]=S,n[8]=k):k=n[8];const{winner:w,sourceIds:T}=k;let _;n[9]===Symbol.for("react.memo_cache_sentinel")?(_=e=>{f(t=>{const n=Object.assign({},t);return n[e]?delete n[e]:n[e]=!0,n})},n[9]=_):_=n[9];const C=_;let I;n[10]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{v(e),f(t=>t[e]?t:Object.assign({},t,{[e]:!0}))},n[10]=I):I=n[10];const V=I;let z;n[11]!==j||n[12]!==w?(z=(0,A.canConsolidate)(j,w),n[11]=j,n[12]=w,n[13]=z):z=n[13];const R=z;let L;n[14]!==j||n[15]!==h||n[16]!==T||n[17]!==w?(L=()=>{w&&j.length>=2&&h(w,T)},n[14]=j,n[15]=h,n[16]=T,n[17]=w,n[18]=L):L=n[18];const P=(0,D.useDestructiveHold)(L,"consolidate");let O;n[19]!==P.progress?(O=Math.round(100*P.progress),n[19]=P.progress,n[20]=O):O=n[20];const M=`${O}%`;let H;n[21]!==M?(H=[xe.verbFill,{width:M}],n[21]=M,n[22]=H):H=n[22];const W=H;let B,F,N,G,K,q,U,Y;if(n[23]===Symbol.for("react.memo_cache_sentinel")?(B=(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Consolidate"}),F=(0,$.jsx)(s.Text,{style:xe.hint,children:"The winner keeps its transcript. The others are archived and linked to it, both ways. Archived is a soft delete: still readable by id, same as Terminate."}),n[23]=B,n[24]=F):(B=n[23],F=n[24]),n[25]!==b?(N=b?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:b}):null,n[25]=b,n[26]=N):N=n[26],n[27]!==i||n[28]!==a||n[29]!==y||n[30]!==w){let e;n[32]!==a||n[33]!==y||n[34]!==w?(e=e=>(0,$.jsx)(te,{session:e,picked:Boolean(y[e.id]),isWinner:w===e.id,now:a,onToggle:C,onCrown:V},e.id),n[32]=a,n[33]=y,n[34]=w,n[35]=e):e=n[35],G=i.map(e),n[27]=i,n[28]=a,n[29]=y,n[30]=w,n[31]=G}else G=n[31];n[36]!==G?(K=(0,$.jsx)(o.ScrollView,{style:xe.pickList,children:G}),n[36]=G,n[37]=K):K=n[37],n[38]===Symbol.for("react.memo_cache_sentinel")?(q=(0,$.jsx)(s.Text,{style:xe.link,children:"cancel"}),n[38]=q):q=n[38],n[39]!==u?(U=(0,$.jsx)(l.Pressable,{onPress:u,accessibilityRole:"button",accessibilityLabel:"Cancel and close",style:xe.send,testID:"reels-consolidate-cancel",children:q}),n[39]=u,n[40]=U):U=n[40],n[41]!==R||n[42]!==P.handlers?(Y=R?P.handlers:{},n[41]=R,n[42]=P.handlers,n[43]=Y):Y=n[43];const X=!R,J=R?xe.send:Re,Q=`Consolidate ${T.length} sessions into the survivor. Hold to confirm.`;let Z;n[44]!==W||n[45]!==P.progress?(Z=P.progress>0?(0,$.jsx)(t.View,{style:W,testID:"reels-consolidate-hold-fill"}):null,n[44]=W,n[45]=P.progress,n[46]=Z):Z=n[46];const ee=`hold to consolidate ${T.length}`;let ne,se,oe,le,ie;return n[47]!==P.hint||n[48]!==P.showLabel||n[49]!==ee?(ne=E(P.showLabel,P.hint,ee),n[47]=P.hint,n[48]=P.showLabel,n[49]=ee,n[50]=ne):ne=n[50],n[51]!==ne?(se=(0,$.jsx)(s.Text,{style:xe.link,children:ne}),n[51]=ne,n[52]=se):se=n[52],n[53]!==Y||n[54]!==X||n[55]!==J||n[56]!==Q||n[57]!==Z||n[58]!==se?(oe=(0,$.jsxs)(l.Pressable,Object.assign({},Y,{disabled:X,style:J,accessibilityRole:"button",accessibilityLabel:Q,testID:"reels-consolidate-commit",children:[Z,se]})),n[53]=Y,n[54]=X,n[55]=J,n[56]=Q,n[57]=Z,n[58]=se,n[59]=oe):oe=n[59],n[60]!==U||n[61]!==oe?(le=(0,$.jsxs)(t.View,{style:xe.rowGap,children:[U,oe]}),n[60]=U,n[61]=oe,n[62]=le):le=n[62],n[63]!==N||n[64]!==K||n[65]!==le?(ie=(0,$.jsxs)(t.View,{style:xe.sheet,testID:"reels-consolidate",children:[B,F,N,K,le]}),n[63]=N,n[64]=K,n[65]=le,n[66]=ie):ie=n[66],ie}),se=(0,d.memo)(function(e){const n=(0,c.c)(46),{verb:o,icon:i,label:a,onVerb:d}=e,{theme:u}=(0,y.useUnistyles)(),h="terminate"===o,{showLabel:b,progress:p,hint:f,handlers:x}=(0,D.useDestructiveHold)(d,o);let j;n[0]!==d||n[1]!==o?(j=()=>d(o),n[0]=d,n[1]=o,n[2]=j):j=n[2];const S=j;let v;n[3]!==p?(v=Math.round(100*p),n[3]=p,n[4]=v):v=n[4];const k=`${v}%`;let w;n[5]!==k?(w=[xe.verbFill,{width:k}],n[5]=k,n[6]=w):w=n[6];const T=w;if(!h){let e;n[7]!==a||n[8]!==o?(e=H(o,a),n[7]=a,n[8]=o,n[9]=e):e=n[9];const t=`reels-verb-${o}`;let c,d,h;return n[10]!==i||n[11]!==u.colors.foreground?(c=(0,$.jsx)(i,{size:18,color:u.colors.foreground}),n[10]=i,n[11]=u.colors.foreground,n[12]=c):c=n[12],n[13]!==a?(d=(0,$.jsx)(s.Text,{style:xe.verbWord,children:a}),n[13]=a,n[14]=d):d=n[14],n[15]!==e||n[16]!==t||n[17]!==c||n[18]!==d||n[19]!==S?(h=(0,$.jsxs)(l.Pressable,{onPress:S,style:xe.verbChip,accessibilityRole:"button",accessibilityLabel:e,hitSlop:8,testID:t,children:[c,d]}),n[15]=e,n[16]=t,n[17]=c,n[18]=d,n[19]=S,n[20]=h):h=n[20],h}let _;n[21]!==a||n[22]!==o?(_=H(o,a),n[21]=a,n[22]=o,n[23]=_):_=n[23];const C=`reels-verb-${o}`;let I,V;n[24]!==T||n[25]!==p?(I=p>0?(0,$.jsx)(t.View,{style:T,testID:"reels-verb-hold-fill"}):null,n[24]=T,n[25]=p,n[26]=I):I=n[26],n[27]!==i||n[28]!==u.colors.destructive?(V=(0,$.jsx)(i,{size:18,color:u.colors.destructive}),n[27]=i,n[28]=u.colors.destructive,n[29]=V):V=n[29];const z=b||f?Ce:xe.verbWord;let R,L,P,A;return n[30]!==a||n[31]!==z?(R=(0,$.jsx)(s.Text,{style:z,children:a}),n[30]=a,n[31]=z,n[32]=R):R=n[32],n[33]!==f||n[34]!==b?(L=E(b,f,"hold to retire"),n[33]=f,n[34]=b,n[35]=L):L=n[35],n[36]!==L?(P=(0,$.jsx)(s.Text,{style:xe.verbHoldLabel,testID:"reels-verb-terminate-hold",children:L}),n[36]=L,n[37]=P):P=n[37],n[38]!==x||n[39]!==R||n[40]!==P||n[41]!==_||n[42]!==C||n[43]!==I||n[44]!==V?(A=(0,$.jsxs)(l.Pressable,Object.assign({},x,{style:xe.verbChip,accessibilityRole:"button",accessibilityLabel:_,hitSlop:8,testID:C,children:[I,V,R,P]})),n[38]=x,n[39]=R,n[40]=P,n[41]=_,n[42]=C,n[43]=I,n[44]=V,n[45]=A):A=n[45],A}),oe=(0,d.memo)(function(e){const t=(0,c.c)(10),{everyMs:n,label:o,onPick:i}=e;let a;t[0]!==n||t[1]!==i?(a=()=>i(n),t[0]=n,t[1]=i,t[2]=a):a=t[2];const d=a,u=`reels-automate-${n}`;let h,b;return t[3]!==o?(h=(0,$.jsx)(s.Text,{style:xe.pickName,children:o}),t[3]=o,t[4]=h):h=t[4],t[5]!==o||t[6]!==d||t[7]!==u||t[8]!==h?(b=(0,$.jsx)(l.Pressable,{onPress:d,style:xe.pickRow,accessibilityRole:"button",accessibilityLabel:o,testID:u,children:h}),t[5]=o,t[6]=d,t[7]=u,t[8]=h,t[9]=b):b=t[9],b}),le=Object.keys(G).sort((e,t)=>(0,j.getWorkspaceStateBucketPriority)(e)-(0,j.getWorkspaceStateBucketPriority)(t)),ie={today:"Today","3d":"3 days","7d":"7 days","30d":"30 days",stale:"Stale"},re={root:"Top-level",delegated:"Subagent"},ae=S.SESSION_ORIGINS.map(e=>({origin:e,label:re[e]})),ce=(0,d.memo)(function(e){const t=(0,c.c)(15),{value:n,label:o,mode:i,onCycle:a}=e;let d;t[0]!==a||t[1]!==n?(d=()=>a(n),t[0]=a,t[1]=n,t[2]=d):d=t[2];const u=d,h=Ie[i],b="include"===i;let p;t[3]!==b?(p=ze(b),t[3]=b,t[4]=p):p=t[4];const y="neutral"===i?o:`${o}, ${"include"===i?"only":"excluded"}`,f=`reels-filter-${n}`,x="exclude"===i?"-":"";let j,S;return t[5]!==o||t[6]!==x?(j=(0,$.jsxs)(s.Text,{style:xe.tagChipText,children:[x,o]}),t[5]=o,t[6]=x,t[7]=j):j=t[7],t[8]!==u||t[9]!==h||t[10]!==p||t[11]!==y||t[12]!==f||t[13]!==j?(S=(0,$.jsx)(l.Pressable,{onPress:u,style:h,accessibilityRole:"button",accessibilityState:p,accessibilityLabel:y,testID:f,children:j}),t[8]=u,t[9]=h,t[10]=p,t[11]=y,t[12]=f,t[13]=j,t[14]=S):S=t[14],S}),de=(0,d.memo)(function(e){const t=(0,c.c)(10),{target:n,label:o,onShare:i}=e;let a;t[0]!==i||t[1]!==n?(a=()=>i(n),t[0]=i,t[1]=n,t[2]=a):a=t[2];const d=a,u=`Send to ${o}`,h=`reels-share-${n}`;let b,p;return t[3]!==o?(b=(0,$.jsx)(s.Text,{style:xe.pickName,children:o}),t[3]=o,t[4]=b):b=t[4],t[5]!==d||t[6]!==u||t[7]!==h||t[8]!==b?(p=(0,$.jsx)(l.Pressable,{onPress:d,style:xe.pickRow,accessibilityRole:"button",accessibilityLabel:u,testID:h,children:b}),t[5]=d,t[6]=u,t[7]=h,t[8]=b,t[9]=p):p=t[9],p}),ue=(0,d.memo)(function(e){const n=(0,c.c)(43),{verb:o,icon:i,label:a,detail:d,onVerb:u}=e,{theme:h}=(0,y.useUnistyles)(),b="terminate"===o,{showLabel:p,progress:f,hint:x,handlers:j}=(0,D.useDestructiveHold)(u,o);let S;n[0]!==u||n[1]!==o?(S=()=>u(o),n[0]=u,n[1]=o,n[2]=S):S=n[2];const v=S;let k;n[3]!==f?(k=Math.round(100*f),n[3]=f,n[4]=k):k=n[4];const w=`${k}%`;let T;n[5]!==w?(T=[xe.verbFill,{width:w}],n[5]=w,n[6]=T):T=n[6];const _=T;let C;n[7]!==b||n[8]!==j||n[9]!==v?(C=b?j:{onPress:v},n[7]=b,n[8]=j,n[9]=v,n[10]=C):C=n[10];const I=C;let V;n[11]!==a||n[12]!==o?(V=H(o,a),n[11]=a,n[12]=o,n[13]=V):V=n[13];const z=`reels-taco-${o}`;let R;n[14]!==b||n[15]!==f||n[16]!==_?(R=b&&f>0?(0,$.jsx)(t.View,{style:_,testID:"reels-taco-hold-fill"}):null,n[14]=b,n[15]=f,n[16]=_,n[17]=R):R=n[17];const L=b?h.colors.destructive:h.colors.foreground;let P,A,O,M,W,B,N;return n[18]!==i||n[19]!==L?(P=(0,$.jsx)(t.View,{style:xe.pickMark,children:(0,$.jsx)(i,{size:16,color:L})}),n[18]=i,n[19]=L,n[20]=P):P=n[20],n[21]!==a?(A=(0,$.jsx)(s.Text,{style:xe.pickName,children:a}),n[21]=a,n[22]=A):A=n[22],n[23]!==b||n[24]!==d||n[25]!==x||n[26]!==p?(O=b?E(p,x,"hold to retire"):d,n[23]=b,n[24]=d,n[25]=x,n[26]=p,n[27]=O):O=n[27],n[28]!==O?(M=(0,$.jsx)(s.Text,{style:xe.hint,children:O}),n[28]=O,n[29]=M):M=n[29],n[30]!==o?(W=F.has(o)?(0,$.jsx)(s.Text,{style:xe.pickAux,children:"not wired yet"}):null,n[30]=o,n[31]=W):W=n[31],n[32]!==A||n[33]!==M||n[34]!==W?(B=(0,$.jsxs)(t.View,{style:xe.grow,children:[A,M,W]}),n[32]=A,n[33]=M,n[34]=W,n[35]=B):B=n[35],n[36]!==I||n[37]!==P||n[38]!==B||n[39]!==V||n[40]!==z||n[41]!==R?(N=(0,$.jsxs)(l.Pressable,Object.assign({},I,{style:xe.pickRow,accessibilityRole:"button",accessibilityLabel:V,testID:z,children:[R,P,B]})),n[36]=I,n[37]=P,n[38]=B,n[39]=V,n[40]=z,n[41]=R,n[42]=N):N=n[42],N});function he(e,t,n){if(t>0){const n=1===t?"filter":"filters";return{filteredOut:!0,exit:"clear-filters",message:`No sessions match. ${e.length} in the fleet, ${t} ${n} on.`}}const s=e.filter(e=>(0,R.isSnoozed)(e,n));if(0===s.length)return{filteredOut:!1,exit:"leave",message:"No sessions in the ring."};const o=s.map(e=>e.snoozedUntil?Date.parse(e.snoozedUntil):Number.NaN).filter(e=>Number.isFinite(e)&&e>n.getTime()).sort((e,t)=>e-t)[0],l=o?` Next one wakes ${be(new Date(o),n)}.`:"",i=1===s.length?"session is":"sessions are";return{filteredOut:!1,exit:"leave",message:`All ${s.length} ${i} snoozed.${l}`}}function be(e,t){const n=e.getTime()-t.getTime();if(!Number.isFinite(n)||n<=0)return"any moment";const s=Math.round(n/6e4);if(s<60)return s<1?"any moment":`in ${s}m`;const o=Math.round(s/60);return o<24?`in ${o}h`:`in ${Math.round(o/24)}d`}function ge(e){const t=e.digest,n=t?.summary??t?.goal,s=[t?.goal,t?.nextStep,t?.blockers?.length?t.blockers.join("\n"):void 0].filter(e=>Boolean(e&&e!==n));return s.length>0?s.join("\n\n"):""}const pe=(0,d.memo)(function({mode:e,text:n,active:o}){const l=(0,d.useRef)(new a.Animated.Value(0)).current,i=o&&"text"===e&&n.length>0;(0,d.useEffect)(()=>{if(!i)return;const e=a.Animated.loop(a.Animated.sequence([a.Animated.timing(l,{toValue:-96,duration:24e3,easing:u.default.inOut(u.default.quad),useNativeDriver:!1}),a.Animated.timing(l,{toValue:0,duration:24e3,easing:u.default.inOut(u.default.quad),useNativeDriver:!1})]));return e.start(),()=>{e.stop(),l.setValue(0)}},[i,l]);const c=(0,d.useMemo)(()=>({transform:[{translateY:l}]}),[l]);return"off"===e?null:(0,$.jsx)(t.View,{style:"text"===e?Le:xe.background,testID:`reels-background-${e}`,children:"text"===e?(0,$.jsx)(a.Animated.View,{style:c,children:(0,$.jsx)(s.Text,{style:xe.backgroundBody,numberOfLines:40,children:n})}):null})}),me=(0,d.memo)(function(e){const n=(0,c.c)(28),{gated:o,allTags:l,onPickTag:i,decision:a,decisions:d,serverId:u,agentId:h,onAnswered:b,onVerb:p,actAllowed:y,capLabel:f,tagError:x}=e;if(o){let e,o,a;return n[0]!==l||n[1]!==i?(e=(0,$.jsx)(_.TagGate,{available:l,onPick:i}),n[0]=l,n[1]=i,n[2]=e):e=n[2],n[3]!==x?(o=x?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:x}):null,n[3]=x,n[4]=o):o=n[4],n[5]!==e||n[6]!==o?(a=(0,$.jsxs)(t.View,{children:[e,o]}),n[5]=e,n[6]=o,n[7]=a):a=n[7],a}if(a){if(!y){let e,o,l,i,a;return n[8]!==f?(e=(0,$.jsx)(s.Text,{style:xe.hint,children:f}),n[8]=f,n[9]=e):e=n[9],n[10]===Symbol.for("react.memo_cache_sentinel")?(o=(0,$.jsx)(s.Text,{style:xe.cardTapHint,children:"Decisions are done for today. You can still retire or snooze this one."}),n[10]=o):o=n[10],n[11]!==p?(l=_.TACO_VERBS.map(e=>(0,$.jsx)(se,{verb:e.id,icon:e.icon,label:e.label,onVerb:p},e.id)),n[11]=p,n[12]=l):l=n[12],n[13]!==l?(i=(0,$.jsx)(t.View,{style:xe.rowGap,children:l}),n[13]=l,n[14]=i):i=n[14],n[15]!==e||n[16]!==i?(a=(0,$.jsxs)(t.View,{testID:"reels-cap-reached",children:[e,o,i]}),n[15]=e,n[16]=i,n[17]=a):a=n[17],a}let e;return n[18]!==h||n[19]!==d||n[20]!==b||n[21]!==u?(e=(0,$.jsx)(T.DecisionChips,{serverId:u,agentId:h,decisions:d,onAnswered:b}),n[18]=h,n[19]=d,n[20]=b,n[21]=u,n[22]=e):e=n[22],e}let j,S,v;return n[23]===Symbol.for("react.memo_cache_sentinel")?(j=(0,$.jsx)(s.Text,{style:xe.hint,children:"Nothing to decide. Why is this still open?"}),n[23]=j):j=n[23],n[24]!==p?(S=_.TACO_VERBS.map(e=>(0,$.jsx)(se,{verb:e.id,icon:e.icon,label:e.label,onVerb:p},e.id)),n[24]=p,n[25]=S):S=n[25],n[26]!==S?(v=(0,$.jsxs)(t.View,{testID:"reels-taco-row",children:[j,(0,$.jsx)(t.View,{style:xe.rowGap,children:S})]}),n[26]=S,n[27]=v):v=n[27],v}),ye=(0,d.memo)(function(e){const n=(0,c.c)(82),{overlay:i,session:a,ring:d,now:u,decisionTarget:h,onClose:b,onSend:p,onSnooze:y,onConsolidate:f,onKanban:j,onVerb:S,overlayStyle:w,sendError:T,timeFieldDisarmed:C,actAllowed:I,verbError:D,openDecisions:V,onShare:z,onAutomate:R,allTags:L,allProviders:P,statusSelection:A,tagSelection:O,kanbanSelection:M,providerSelection:E,originSelection:H,timeSelection:W,onCycleStatus:B,onCycleTag:F,onCycleKanban:N,onCycleProvider:G,onCycleOrigin:q,onToggleTimeWindow:U}=e,J=a;let Q;n[0]!==U?(Q=e=>U(e),n[0]=U,n[1]=Q):Q=n[1];const Z=Q,ee=(0,k.useKanbanBuckets)();Y("none"!==i.kind,b);const te="caption"===i.kind;let se,re,he,be,ge,pe,me,ye,fe;return n[2]!==I||n[3]!==J||n[4]!==h||n[5]!==b||n[6]!==p||n[7]!==V||n[8]!==T||n[9]!==te?(se=(0,$.jsx)(X,{session:J,visible:te,onClose:b,onSend:p,sendError:T,openDecisions:V,target:h,actAllowed:I},J.id),n[2]=I,n[3]=J,n[4]=h,n[5]=b,n[6]=p,n[7]=V,n[8]=T,n[9]=te,n[10]=se):se=n[10],n[11]!==J.snoozeCount||n[12]!==u||n[13]!==b||n[14]!==y||n[15]!==i.kind||n[16]!==w||n[17]!==D?(re="snooze"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(t.View,{children:[(0,$.jsx)(_.SnoozeSheet,{priorCount:J.snoozeCount,now:u,onCancel:b,onSnooze:y}),D?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:D}):null]})}):null,n[11]=J.snoozeCount,n[12]=u,n[13]=b,n[14]=y,n[15]=i.kind,n[16]=w,n[17]=D,n[18]=re):re=n[18],n[19]!==u||n[20]!==b||n[21]!==f||n[22]!==i.kind||n[23]!==w||n[24]!==d||n[25]!==D?(he="consolidate"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsx)(ne,{candidates:d,now:u,onCancel:b,onConsolidate:f,verbError:D})}):null,n[19]=u,n[20]=b,n[21]=f,n[22]=i.kind,n[23]=w,n[24]=d,n[25]=D,n[26]=he):he=n[26],n[27]!==b||n[28]!==S||n[29]!==i.kind||n[30]!==w?(be="taco"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(t.View,{style:xe.sheet,testID:"reels-taco-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"TACO"}),_.TACO_VERBS.map(e=>(0,$.jsx)(ue,{verb:e.id,icon:e.icon,label:e.label,detail:e.detail,onVerb:S},e.id)),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Cancel and close",style:xe.send,testID:"reels-taco-cancel",children:(0,$.jsx)(s.Text,{style:xe.link,children:"cancel"})})]})}):null,n[27]=b,n[28]=S,n[29]=i.kind,n[30]=w,n[31]=be):be=n[31],n[32]!==P||n[33]!==L||n[34]!==ee||n[35]!==M||n[36]!==b||n[37]!==N||n[38]!==q||n[39]!==G||n[40]!==B||n[41]!==F||n[42]!==Z||n[43]!==H||n[44]!==i.kind||n[45]!==w||n[46]!==E||n[47]!==A||n[48]!==O||n[49]!==C||n[50]!==W?(ge="filters"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(o.ScrollView,{style:xe.sheet,testID:"reels-filters-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Filter the ring"}),(0,$.jsx)(s.Text,{style:xe.hint,children:"The same filter the sessions list uses, so setting it here sets it there."}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"State"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:le.map(e=>(0,$.jsx)(ce,{value:e,label:K(e),mode:(0,x.getFilterValueMode)(A,e),onCycle:B},e))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Kanban"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:ee.map(e=>(0,$.jsx)(ce,{value:e.id,label:e.label,mode:(0,x.getFilterValueMode)(M,e.id),onCycle:N},e.id))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Tag"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:L.map(e=>(0,$.jsx)(ce,{value:e,label:e,mode:(0,x.getFilterValueMode)(O,e),onCycle:F},e))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Date"}),C?(0,$.jsx)(s.Text,{style:xe.hint,testID:"reels-filter-date-off",children:"Off while dates are measured on when a session was archived. The ring only holds live sessions. Change it on the sessions bar to filter by date here."}):(0,$.jsx)(t.View,{style:xe.rowGap,children:v.SESSION_TIME_WINDOWS.map(e=>(0,$.jsx)(ce,{value:e,label:ie[e],mode:"window"===W?.kind&&W.window===e?"include":"neutral",onCycle:Z},e))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Provider"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:P.map(e=>(0,$.jsx)(ce,{value:e,label:e,mode:(0,x.getFilterValueMode)(E,e),onCycle:G},e))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Origin"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:ae.map(e=>(0,$.jsx)(ce,{value:e.origin,label:e.label,mode:(0,x.getFilterValueMode)(H,e.origin),onCycle:q},e.origin))}),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Done, close filters",style:xe.send,testID:"reels-filters-done",children:(0,$.jsx)(s.Text,{style:xe.link,children:"done"})})]})}):null,n[32]=P,n[33]=L,n[34]=ee,n[35]=M,n[36]=b,n[37]=N,n[38]=q,n[39]=G,n[40]=B,n[41]=F,n[42]=Z,n[43]=H,n[44]=i.kind,n[45]=w,n[46]=E,n[47]=A,n[48]=O,n[49]=C,n[50]=W,n[51]=ge):ge=n[51],n[52]!==R||n[53]!==b||n[54]!==i.kind||n[55]!==w||n[56]!==D?(pe="automate"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(t.View,{style:xe.sheet,testID:"reels-automate-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Automate"}),(0,$.jsx)(s.Text,{style:xe.hint,children:"Re-runs this session on a cadence, with its next step as the prompt."}),D?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:D}):null,$e.map(e=>(0,$.jsx)(oe,{everyMs:e.everyMs,label:e.label,onPick:R},e.id)),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Cancel and close",style:xe.send,testID:"reels-automate-cancel",children:(0,$.jsx)(s.Text,{style:xe.link,children:"cancel"})})]})}):null,n[52]=R,n[53]=b,n[54]=i.kind,n[55]=w,n[56]=D,n[57]=pe):pe=n[57],n[58]!==b||n[59]!==z||n[60]!==i.kind||n[61]!==w||n[62]!==D?(me="share"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(t.View,{style:xe.sheet,testID:"reels-share-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Send"}),(0,$.jsx)(s.Text,{style:xe.hint,children:"Send this card somewhere a person will read it."}),D?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:D}):null,je.map(e=>(0,$.jsx)(de,{target:e.id,label:e.label,onShare:z},e.id)),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Cancel and close",style:xe.send,testID:"reels-share-cancel",children:(0,$.jsx)(s.Text,{style:xe.link,children:"cancel"})})]})}):null,n[58]=b,n[59]=z,n[60]=i.kind,n[61]=w,n[62]=D,n[63]=me):me=n[63],n[64]!==J.kanban||n[65]!==J.model||n[66]!==J.provider||n[67]!==b||n[68]!==j||n[69]!==i.kind||n[70]!==w||n[71]!==D?(ye="options"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(o.ScrollView,{style:xe.sheet,testID:"reels-options-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Session options"}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Kanban"}),(0,$.jsx)(_.KanbanPicker,{current:J.kanban,onPick:j}),D?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:D}):null,(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Provider and model"}),(0,$.jsx)(s.Text,{style:xe.fieldValue,children:J.model?`${J.provider}/${J.model}`:J.provider}),(0,$.jsx)(s.Text,{style:xe.hint,children:"One control in the app, not two: combined-model-selector with favourites."}),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Close session options",style:xe.send,testID:"reels-options-close",children:(0,$.jsx)(s.Text,{style:xe.link,children:"close"})})]})}):null,n[64]=J.kanban,n[65]=J.model,n[66]=J.provider,n[67]=b,n[68]=j,n[69]=i.kind,n[70]=w,n[71]=D,n[72]=ye):ye=n[72],n[73]!==ye||n[74]!==se||n[75]!==re||n[76]!==he||n[77]!==be||n[78]!==ge||n[79]!==pe||n[80]!==me?(fe=(0,$.jsxs)($.Fragment,{children:[se,re,he,be,ge,pe,me,ye]}),n[73]=ye,n[74]=se,n[75]=re,n[76]=he,n[77]=be,n[78]=ge,n[79]=pe,n[80]=me,n[81]=fe):fe=n[81],fe}),fe=(0,d.memo)(function(e){const n=(0,c.c)(205),{sessions:o,allTags:i,actCap:a,background:u,now:h,onLeaveRing:b}=e,y=void 0===a?L.DEFAULT_ACT_CAP:a,x=void 0===u?"text":u,j=(0,V.useReelsVerbs)(),{answer:S}=(0,I.useAnswerDecision)(),[v,k]=(0,d.useState)(Ee);let T,D,A;n[0]!==h?(T=()=>{if(h)return;const e=setInterval(()=>k(Date.now()),6e4);return()=>clearInterval(e)},D=[h],n[0]=h,n[1]=T,n[2]=D):(T=n[1],D=n[2]),(0,d.useEffect)(T,D),n[3]!==h||n[4]!==v?(A=h??new Date(v),n[3]=h,n[4]=v,n[5]=A):A=n[5];const O=A,[M,E]=(0,d.useState)(1),H=(0,P.useActBudgetStore)(He);let F;n[6]!==O?(F=e=>(0,P.actsOn)(e,O),n[6]=O,n[7]=F):F=n[7];const G=(0,P.useActBudgetStore)(F),K=(0,P.useActBudgetStore)(We);let q;n[8]!==O||n[9]!==H?(q=()=>H(O),n[8]=O,n[9]=H,n[10]=q):q=n[10];const Y=q,[X,J]=(0,d.useState)(0);let Q;n[11]===Symbol.for("react.memo_cache_sentinel")?(Q={kind:"none"},n[11]=Q):Q=n[11];const[Z,ee]=(0,d.useState)(Q);let te;n[12]===Symbol.for("react.memo_cache_sentinel")?(te={},n[12]=te):te=n[12];const[ne,se]=(0,d.useState)(te);let oe;n[13]===Symbol.for("react.memo_cache_sentinel")?(oe={},n[13]=oe):oe=n[13];const[le,ie]=(0,d.useState)(oe),[re,ae]=(0,d.useState)(null),[ce,de]=(0,d.useState)(B);let ue;n[14]===Symbol.for("react.memo_cache_sentinel")?(ue=(e,t)=>{de(n=>Object.assign({},n,{[e]:t}))},n[14]=ue):ue=n[14];const be=ue,fe=(0,d.useRef)(null);let je;n[15]!==le||n[16]!==M||n[17]!==ne||n[18]!==O||n[19]!==o?(je={sessions:o,localTags:ne,actedLaps:le,laps:M,now:O},n[15]=le,n[16]=M,n[17]=ne,n[18]=O,n[19]=o,n[20]=je):je=n[20];const{feed:Se,activeFilters:ke,statusSelection:we,tagSelection:Te,kanbanSelection:Ce,providerSelection:Ie,originSelection:De,timeSelection:Ve,onCycleStatus:ze,onCycleTag:Re,onCycleKanban:Le,onCycleProvider:$e,onCycleOrigin:Oe,onToggleTimeWindow:Me,onClearFilters:qe,timeFieldDisarmed:Ue}=(0,z.useReelsFeed)(je);let Ye;n[21]!==o?(Ye=[...new Set(o.map(Be))].sort(),n[21]=o,n[22]=Ye):Ye=n[22];const Xe=Ye,Je=Se[Math.min(X,Math.max(Se.length-1,0))]??null,Qe=Je?.session??null,Ze=Je?.lap??1;let et;n[23]!==Ze?(et=e=>e.lap===Ze,n[23]=Ze,n[24]=et):et=n[24];const tt=Se.findIndex(et);let nt;if(n[25]!==Se||n[26]!==Ze){let e;n[28]!==Ze?(e=e=>e.lap===Ze,n[28]=Ze,n[29]=e):e=n[29],nt=Se.filter(e),n[25]=Se,n[26]=Ze,n[27]=nt}else nt=n[27];const st=nt.length;let ot;if(n[30]!==Se||n[31]!==Ze){let e;n[33]!==Ze?(e=e=>e.lap===Ze,n[33]=Ze,n[34]=e):e=n[34],ot=Se.filter(e).map(Fe),n[30]=Se,n[31]=Ze,n[32]=ot}else ot=n[32];const lt=ot,it=Qe?.id??"",rt=Qe?.serverId??"",{allowMove:at}=(0,w.useKanbanMoveGuard)(rt);let ct;var dt;n[35]!==Qe?(ct=Qe?(dt=Qe.digest,(dt?.pendingDecisions??[]).filter(e=>!e.answeredAt)):[],n[35]=Qe,n[36]=ct):ct=n[36];const ut=ct,ht=ut[0]??null;let bt;n[37]!==ut?(bt=ut.map(Ne),n[37]=ut,n[38]=bt):bt=n[38];const gt=bt,pt=ut,mt=!!Qe&&0===Qe.tags.length;let yt;n[39]!==y||n[40]!==G||n[41]!==K?(yt=K&&(0,L.canAct)({acts:G,cap:y}),n[39]=y,n[40]=G,n[41]=K,n[42]=yt):yt=n[42];const ft=yt;let xt;n[43]!==y||n[44]!==G?(xt=(0,L.actCapLabel)({acts:G,cap:y}),n[43]=y,n[44]=G,n[45]=xt):xt=n[45];const jt=xt,St=(0,p.useSafeAreaInsets)();let vt;n[46]!==St.top?(vt=[xe.headerSlot,{paddingTop:St.top}],n[46]=St.top,n[47]=vt):vt=n[47];const kt=vt,wt=St.top+56;let Tt;n[48]!==wt?(Tt=[xe.seamBanner,{paddingTop:wt}],n[48]=wt,n[49]=Tt):Tt=n[49];const _t=Tt;let Ct;n[50]!==St.bottom||n[51]!==St.top?(Ct=[xe.overlay,{paddingTop:St.top,paddingBottom:St.bottom}],n[50]=St.bottom,n[51]=St.top,n[52]=Ct):Ct=n[52];const It=Ct;let Dt;n[53]!==X?(Dt=()=>{ee({kind:"none"}),fe.current?.scrollToIndex(X+1)},n[53]=X,n[54]=Dt):Dt=n[54];const Vt=Dt;let zt;n[55]!==Ze?(zt=e=>{ie(t=>Object.assign({},t,{[e]:Ze}))},n[55]=Ze,n[56]=zt):zt=n[56];const Rt=zt;let Lt;n[57]===Symbol.for("react.memo_cache_sentinel")?(Lt=()=>{E(Ge)},n[57]=Lt):Lt=n[57];const Pt=Lt;let At,$t,Ot,Mt,Et,Ht,Wt;n[58]===Symbol.for("react.memo_cache_sentinel")?(At={id:"read",icon:f.BookOpen,label:"read"},n[58]=At):At=n[58],n[59]!==mt?($t={id:"snooze",icon:f.AlarmClock,label:"snooze",disabled:mt},n[59]=mt,n[60]=$t):$t=n[60],n[61]===Symbol.for("react.memo_cache_sentinel")?(Ot={id:"share",icon:f.Send,label:"send"},n[61]=Ot):Ot=n[61],n[62]!==mt?(Mt={id:"taco",icon:f.LayoutList,label:"TACO",disabled:mt},n[62]=mt,n[63]=Mt):Mt=n[63],n[64]===Symbol.for("react.memo_cache_sentinel")?(Et={id:"archive",icon:f.Archive,label:"archive",destructive:!0},Ht={id:"options",icon:f.MoreHorizontal,label:"options"},n[64]=Et,n[65]=Ht):(Et=n[64],Ht=n[65]),n[66]!==$t||n[67]!==Mt?(Wt=[At,$t,Ot,Mt,Et,Ht],n[66]=$t,n[67]=Mt,n[68]=Wt):Wt=n[68];const Bt=Wt;let Ft;n[69]===Symbol.for("react.memo_cache_sentinel")?(Ft=()=>ee({kind:"caption"}),n[69]=Ft):Ft=n[69];const Nt=Ft;let Gt;n[70]===Symbol.for("react.memo_cache_sentinel")?(Gt=()=>ee({kind:"none"}),n[70]=Gt):Gt=n[70];const Kt=Gt;let qt;n[71]===Symbol.for("react.memo_cache_sentinel")?(qt=()=>ee({kind:"filters"}),n[71]=qt):qt=n[71];const Ut=qt;let Yt;n[72]===Symbol.for("react.memo_cache_sentinel")?(Yt=e=>{se(t=>{const n=Object.assign({},t);return delete n[e],n})},n[72]=Yt):Yt=n[72];const Xt=Yt;let Jt;n[73]!==it||n[74]!==rt||n[75]!==j?(Jt=e=>{se(t=>Object.assign({},t,{[it]:[e]})),be("tag",null),j.setTags({serverId:rt,agentId:it},[e]).catch(e=>{Xt(it),be("tag",e instanceof Error?e.message:"could not tag this session")})},n[73]=it,n[74]=rt,n[75]=j,n[76]=Jt):Jt=n[76];const Qt=Jt;let Zt;n[77]!==Vt||n[78]!==it||n[79]!==ut.length||n[80]!==Rt||n[81]!==Y?(Zt=()=>{Y(),Rt(it),ut.length<=1&&Vt()},n[77]=Vt,n[78]=it,n[79]=ut.length,n[80]=Rt,n[81]=Y,n[82]=Zt):Zt=n[82];const en=Zt;let tn;n[83]!==Vt||n[84]!==it||n[85]!==Rt||n[86]!==rt||n[87]!==j?(tn=async e=>{if("terminate"===e)return await j.terminate({serverId:rt,agentId:it}),Rt(it),void Vt();de(B),ee({kind:Ae[e]})},n[83]=Vt,n[84]=it,n[85]=Rt,n[86]=rt,n[87]=j,n[88]=tn):tn=n[88];const nn=tn;let sn;n[89]!==nn?(sn=e=>{if(de(B),"archive"===e)return nn("terminate");const t=Pe[e];t&&ee({kind:t})},n[89]=nn,n[90]=sn):sn=n[90];const on=sn;let ln;n[91]!==Vt||n[92]!==it||n[93]!==Rt||n[94]!==rt||n[95]!==j?(ln=e=>{be("snooze",null),j.snooze({serverId:rt,agentId:it},e.until,e.untilWhat,e.why).then(()=>(Rt(it),Vt(),null)).catch(e=>{be("snooze",e instanceof Error?e.message:"could not snooze this session")})},n[91]=Vt,n[92]=it,n[93]=Rt,n[94]=rt,n[95]=j,n[96]=ln):ln=n[96];const rn=ln;let an;n[97]!==Vt||n[98]!==Rt||n[99]!==rt||n[100]!==j?(an=(e,t)=>{be("consolidate",null),j.consolidate({serverId:rt,winnerId:e,sourceIds:t}).then(()=>{for(const n of[e,...t])Rt(n);return Vt(),null}).catch(e=>{be("consolidate",e instanceof Error?e.message:"could not consolidate these sessions")})},n[97]=Vt,n[98]=Rt,n[99]=rt,n[100]=j,n[101]=an):an=n[101];const cn=an;let dn;n[102]!==ft||n[103]!==S||n[104]!==it||n[105]!==ht||n[106]!==en||n[107]!==rt?(dn=e=>{if(!ft)return void ee({kind:"none"});const t=e.trim();0!==t.length&&ht?(ae(null),S({serverId:rt,agentId:it,decisionId:ht.id,optionId:null,note:t}).then(()=>(en(),null)).catch(e=>{ae(e instanceof Error?e.message:String(e))})):ee({kind:"none"})},n[102]=ft,n[103]=S,n[104]=it,n[105]=ht,n[106]=en,n[107]=rt,n[108]=dn):dn=n[108];const un=dn;let hn;n[109]!==Qe||n[110]!==j?(hn=e=>{Qe&&(be("share",null),j.share(e,ve(Qe)).then(()=>(ee({kind:"none"}),null)).catch(e=>{be("share",e instanceof Error?e.message:"could not open that")}))},n[109]=Qe,n[110]=j,n[111]=hn):hn=n[111];const bn=hn;let gn;n[112]!==Vt||n[113]!==Qe||n[114]!==it||n[115]!==Rt||n[116]!==rt||n[117]!==j?(gn=e=>{if(!Qe)return;be("automate",null);const t=Qe.digest?.nextStep??Qe.digest?.goal??`Continue ${Qe.title}`;j.automate({serverId:rt,agentId:it},e,t,Qe.title).then(()=>(Rt(it),Vt(),null)).catch(e=>{be("automate",e instanceof Error?e.message:"could not create the routine")})},n[112]=Vt,n[113]=Qe,n[114]=it,n[115]=Rt,n[116]=rt,n[117]=j,n[118]=gn):gn=n[118];const pn=gn;let mn;n[119]!==at||n[120]!==Qe?.kanban||n[121]!==it||n[122]!==rt||n[123]!==j?(mn=e=>{be("kanban",null),at(e,Qe?.kanban??null)&&j.setKanban({serverId:rt,agentId:it},e).then(()=>(ee({kind:"none"}),null)).catch(e=>{be("kanban",e instanceof Error?e.message:"could not move this session")})},n[119]=at,n[120]=Qe?.kanban,n[121]=it,n[122]=rt,n[123]=j,n[124]=mn):mn=n[124];const yn=mn;let fn;n[125]!==i||n[126]!==ft||n[127]!==x||n[128]!==jt||n[129]!==ht||n[130]!==pt||n[131]!==Se||n[132]!==mt||n[133]!==X||n[134]!==O||n[135]!==en||n[136]!==on||n[137]!==nn||n[138]!==Qt||n[139]!==Bt||n[140]!==lt.length||n[141]!==_t||n[142]!==ce.tag?(fn=(e,n)=>{const o=n===X,a=e.session;return(0,$.jsxs)(t.View,{style:xe.card,children:[(0,$.jsx)(pe,{mode:x,text:ge(a),active:o}),e.firstOfLap&&e.lap>1?(0,$.jsx)(t.View,{style:_t,testID:`reels-seam-${e.lap}`,children:(0,$.jsx)(_.LapSeam,{lap:e.lap,ringSize:Se.filter(t=>t.lap===e.lap-1).length||lt.length,acted:(0,R.actedThisLap)(Se.filter(t=>t.lap===e.lap-1).map(Ke),e.lap-1)})}):null,(0,$.jsx)(t.View,{style:xe.middle,children:o?(0,$.jsx)(_.ReelsRail,{actions:Bt,contextLabel:a.tags[0]??"untagged",onAction:on}):null}),(0,$.jsxs)(t.View,{style:xe.bottom,children:[(0,$.jsxs)(l.Pressable,{onPress:o?Nt:void 0,disabled:!o,testID:o?"reels-caption-open":void 0,accessibilityRole:"button",accessibilityLabel:`Open the full digest for ${a.title}`,style:xe.captionTap,children:[(0,$.jsx)(s.Text,{style:xe.cardTitle,children:a.title}),(0,$.jsx)(s.Text,{style:xe.cardMeta,children:U(a,O)}),(0,$.jsx)(s.Text,{style:xe.cardSummary,numberOfLines:4,children:a.digest?.summary??a.digest?.goal??"No digest yet."}),o?(0,$.jsx)(s.Text,{style:xe.cardTapHint,children:"tap for the whole digest and to talk to it"}):null]}),o?(0,$.jsx)(me,{gated:mt,allTags:i,onPickTag:Qt,decision:ht,decisions:pt,serverId:a.serverId,agentId:a.id,onAnswered:en,onVerb:nn,actAllowed:ft,capLabel:jt,tagError:ce.tag}):null]})]})},n[125]=i,n[126]=ft,n[127]=x,n[128]=jt,n[129]=ht,n[130]=pt,n[131]=Se,n[132]=mt,n[133]=X,n[134]=O,n[135]=en,n[136]=on,n[137]=nn,n[138]=Qt,n[139]=Bt,n[140]=lt.length,n[141]=_t,n[142]=ce.tag,n[143]=fn):fn=n[143];const xn=fn;if(!Qe){let e;n[144]!==ke||n[145]!==O||n[146]!==o?(e=he(o,ke,O),n[144]=ke,n[145]=O,n[146]=o,n[147]=e):e=n[147];const{message:i,exit:a}=e;let c,d,u;return n[148]!==i?(c=(0,$.jsx)(s.Text,{style:xe.fieldValue,children:i}),n[148]=i,n[149]=c):c=n[149],n[150]!==a||n[151]!==qe||n[152]!==b?(d="clear-filters"===a?(0,$.jsx)(l.Pressable,{onPress:qe,style:xe.send,accessibilityRole:"button",accessibilityLabel:"Clear all filters",testID:"reels-empty-clear-filters",children:(0,$.jsx)(s.Text,{style:xe.link,children:"clear filters"})}):(0,$.jsx)(l.Pressable,{onPress:b,style:xe.send,accessibilityRole:"button",accessibilityLabel:"Back to the sessions list",testID:"reels-empty-leave",children:(0,$.jsx)(s.Text,{style:xe.link,children:"back to sessions"})}),n[150]=a,n[151]=qe,n[152]=b,n[153]=d):d=n[153],n[154]!==c||n[155]!==d?(u=(0,$.jsxs)(t.View,{style:xe.empty,testID:"reels-empty",children:[c,d]}),n[154]=c,n[155]=d,n[156]=u):u=n[156],u}let jn;n[157]!==Se||n[158]!==xn?(jn=(0,$.jsx)(C.ReelsPager,{data:Se,keyExtractor:N,renderCard:xn,onIndexChange:J,onEndReached:Pt,controllerRef:fe}),n[157]=Se,n[158]=xn,n[159]=jn):jn=n[159];const Sn=`${tt>=0?X-tt+1:X+1}/${st} \xb7 lap ${Ze}`;let vn,kn;n[160]!==y||n[161]!==ke||n[162]!==G||n[163]!==Sn?(vn=(0,$.jsx)(_.ReelsHeader,{acts:G,cap:y,activeFilters:ke,onFilter:Ut,position:Sn}),n[160]=y,n[161]=ke,n[162]=G,n[163]=Sn,n[164]=vn):vn=n[164],n[165]!==kt||n[166]!==vn?(kn=(0,$.jsx)(t.View,{style:kt,pointerEvents:"box-none",children:vn}),n[165]=kt,n[166]=vn,n[167]=kn):kn=n[167];const wn=ce[W[Z.kind]??"share"];let Tn,_n;return n[168]!==Xe||n[169]!==i||n[170]!==ft||n[171]!==Qe||n[172]!==ht||n[173]!==Ce||n[174]!==O||n[175]!==pn||n[176]!==un||n[177]!==cn||n[178]!==Le||n[179]!==Oe||n[180]!==$e||n[181]!==ze||n[182]!==Re||n[183]!==yn||n[184]!==bn||n[185]!==rn||n[186]!==Me||n[187]!==nn||n[188]!==gt||n[189]!==De||n[190]!==Z||n[191]!==It||n[192]!==Ie||n[193]!==lt||n[194]!==re||n[195]!==we||n[196]!==wn||n[197]!==Te||n[198]!==Ue||n[199]!==Ve?(Tn=(0,$.jsx)(ye,{overlay:Z,session:Qe,ring:lt,now:O,decisionTarget:ht,onClose:Kt,onSend:un,actAllowed:ft,timeFieldDisarmed:Ue,onSnooze:rn,onConsolidate:cn,onKanban:yn,onVerb:nn,overlayStyle:It,sendError:re,verbError:wn,openDecisions:gt,onShare:bn,onAutomate:pn,allTags:i,allProviders:Xe,statusSelection:we,tagSelection:Te,kanbanSelection:Ce,providerSelection:Ie,originSelection:De,timeSelection:Ve,onCycleStatus:ze,onCycleTag:Re,onCycleKanban:Le,onCycleProvider:$e,onCycleOrigin:Oe,onToggleTimeWindow:Me}),n[168]=Xe,n[169]=i,n[170]=ft,n[171]=Qe,n[172]=ht,n[173]=Ce,n[174]=O,n[175]=pn,n[176]=un,n[177]=cn,n[178]=Le,n[179]=Oe,n[180]=$e,n[181]=ze,n[182]=Re,n[183]=yn,n[184]=bn,n[185]=rn,n[186]=Me,n[187]=nn,n[188]=gt,n[189]=De,n[190]=Z,n[191]=It,n[192]=Ie,n[193]=lt,n[194]=re,n[195]=we,n[196]=wn,n[197]=Te,n[198]=Ue,n[199]=Ve,n[200]=Tn):Tn=n[200],n[201]!==jn||n[202]!==kn||n[203]!==Tn?(_n=(0,$.jsxs)(t.View,{style:xe.root,testID:"reels-screen",children:[jn,kn,Tn]}),n[201]=jn,n[202]=kn,n[203]=Tn,n[204]=_n):_n=n[204],_n}),xe=y.StyleSheet.create(e=>({composerLabel:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,paddingHorizontal:e.spacing[2],paddingTop:e.spacing[1],uni__dependencies:[0]},sheetInner:{flex:1},tagChip:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:e.colors.border,borderRadius:e.borderRadius.full,paddingHorizontal:e.spacing[2],uni__dependencies:[0]},tagChipOn:{borderColor:e.colors.accent,uni__dependencies:[0]},tagChipOff:{borderColor:e.colors.destructive,borderStyle:"dashed",opacity:.6,uni__dependencies:[0]},tagChipText:{color:e.colors.foreground,fontSize:e.fontSize.xs,uni__dependencies:[0]},sheetGrab:{minHeight:44,alignItems:"center",justifyContent:"center"},sheetHandle:{width:38,height:4,borderRadius:e.borderRadius.full,backgroundColor:e.colors.border,uni__dependencies:[0]},verbFill:{position:"absolute",left:0,top:0,bottom:0,backgroundColor:e.colors.destructive,opacity:.18,borderRadius:e.borderRadius.full,uni__dependencies:[0]},sendError:{color:e.colors.destructive,fontSize:e.fontSize.xs,paddingHorizontal:e.spacing[2],uni__dependencies:[0]},verbHoldLabel:{color:e.colors.destructive,fontSize:e.fontSize.xs,uni__dependencies:[0]},captionBackdrop:Object.assign({},y.StyleSheet.absoluteFillObject,{backgroundColor:e.colors.background,opacity:.72,uni__dependencies:[0]}),sheetClose:{minWidth:44,minHeight:44,alignItems:"center",justifyContent:"center"},card:{flex:1,overflow:"hidden"},seamBanner:{paddingHorizontal:e.spacing[2],uni__dependencies:[0]},headerSlot:{position:"absolute",top:0,left:0,right:0},captionTap:{minHeight:44,justifyContent:"flex-end"},root:{flex:1,backgroundColor:e.colors.background,uni__dependencies:[0]},background:Object.assign({},y.StyleSheet.absoluteFillObject,{opacity:.35,backgroundColor:e.colors.surface0,overflow:"hidden",uni__dependencies:[0]}),backgroundText:{padding:e.spacing[2],uni__dependencies:[0]},backgroundBody:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,lineHeight:20,uni__dependencies:[0]},middle:{flex:1,alignItems:"flex-end",justifyContent:"flex-end",paddingHorizontal:e.spacing[2],uni__dependencies:[0]},bottom:{padding:e.spacing[2],gap:e.spacing[1],uni__dependencies:[0]},cardTitle:{color:e.colors.foreground,fontSize:e.fontSize.base,fontWeight:"600",uni__dependencies:[0]},cardMeta:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,marginTop:2,uni__dependencies:[0]},cardSummary:{color:e.colors.foreground,fontSize:e.fontSize.sm,marginTop:6,lineHeight:19,uni__dependencies:[0]},cardTapHint:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,marginTop:4,uni__dependencies:[0]},hint:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,lineHeight:17,uni__dependencies:[0]},rowGap:{flexDirection:"row",flexWrap:"wrap",gap:e.spacing[1],alignItems:"center",uni__dependencies:[0]},verbChip:{minHeight:44,minWidth:44,alignItems:"center",justifyContent:"center",overflow:"hidden",borderWidth:1,borderColor:e.colors.border,borderRadius:e.borderRadius["2xl"],paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],uni__dependencies:[0]},verbWord:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,uni__dependencies:[0]},verbWordDanger:{color:e.colors.destructive,fontSize:e.fontSize.xs,fontWeight:"600",uni__dependencies:[0]},overlay:Object.assign({},y.StyleSheet.absoluteFillObject,{backgroundColor:e.colors.background,uni__dependencies:[0]}),sheet:{padding:e.spacing[2],gap:e.spacing[1],uni__dependencies:[0]},sheetTitle:{color:e.colors.foreground,fontSize:e.fontSize.base,fontWeight:"600",uni__dependencies:[0]},sheetHeadTitle:{flex:1},captionSheet:{position:"absolute",left:0,right:0,bottom:0,top:"42%",backgroundColor:e.colors.background,borderTopWidth:1,borderTopColor:e.colors.border,borderTopLeftRadius:e.borderRadius["2xl"],borderTopRightRadius:e.borderRadius["2xl"],uni__dependencies:[0]},sheetHead:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],padding:e.spacing[2],borderBottomWidth:1,borderBottomColor:e.colors.border,uni__dependencies:[0]},sheetBody:{flex:1,padding:e.spacing[2],uni__dependencies:[0]},field:{marginBottom:e.spacing[1],uni__dependencies:[0]},fieldLabel:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,textTransform:"uppercase",letterSpacing:.6,marginTop:e.spacing[1],uni__dependencies:[0]},fieldValue:{color:e.colors.foreground,fontSize:e.fontSize.xs,lineHeight:18,uni__dependencies:[0]},fieldDanger:{color:e.colors.destructive,uni__dependencies:[0]},composer:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],padding:e.spacing[2],borderTopWidth:1,borderTopColor:e.colors.border,uni__dependencies:[0]},composerInput:{flex:1,borderWidth:1,borderColor:e.colors.border,borderRadius:e.borderRadius.full,paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],color:e.colors.foreground,fontSize:e.fontSize.xs,uni__dependencies:[0]},composerSend:{minHeight:44,justifyContent:"center",paddingHorizontal:e.spacing[1],uni__dependencies:[0]},link:{color:e.colors.accent,fontSize:e.fontSize.xs,uni__dependencies:[0]},send:{borderWidth:1,borderColor:e.colors.accent,borderRadius:e.borderRadius["2xl"],paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],alignSelf:"flex-start",uni__dependencies:[0]},dim:{opacity:.35},pickList:{maxHeight:400},pickRow:{minHeight:44,flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingVertical:e.spacing[1],paddingHorizontal:e.spacing[1],borderWidth:1,borderColor:e.colors.border,borderRadius:e.borderRadius["2xl"],marginBottom:4,uni__dependencies:[0]},pickRowOn:{borderColor:e.colors.accent,uni__dependencies:[0]},pickMark:{width:22,alignItems:"center"},pickName:{color:e.colors.foreground,fontSize:e.fontSize.xs,fontWeight:"600",uni__dependencies:[0]},pickCrown:{paddingHorizontal:6,paddingVertical:4,justifyContent:"center"},pickAux:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,uni__dependencies:[0]},grow:{flex:1},empty:{flex:1,alignItems:"center",justifyContent:"center",padding:e.spacing[3],uni__dependencies:[0]}})),je=[{id:"whatsapp",label:"WhatsApp"},{id:"slack",label:"Slack"},{id:"email",label:"Email"}],Se=400;function ve(e){const t=[`${e.title} (${K(String(e.statusBucket))})`,e.digest?.summary??e.digest?.goal??"",e.digest?.nextStep?`Next: ${e.digest.nextStep}`:"",e.digest?.blockers?.length?`Blocked: ${e.digest.blockers.join("; ")}`:""].filter(e=>e.length>0).join("\n");return t.length>Se?`${t.slice(0,399)}\u2026`:t}const ke=[xe.fieldValue,xe.fieldDanger],we=[xe.sheetTitle,xe.sheetHeadTitle],Te=[xe.pickRow,xe.pickRowOn],Ce=[xe.verbWord,xe.verbWordDanger],Ie={include:[xe.tagChip,xe.tagChipOn],exclude:[xe.tagChip,xe.tagChipOff],neutral:xe.tagChip},De={selected:!0},Ve={selected:!1},ze=e=>e?De:Ve,Re=[xe.send,xe.dim],Le=[xe.background,xe.backgroundText],Pe={read:"caption",snooze:"snooze",share:"share",taco:"taco",options:"options"},Ae={consolidate:"consolidate",outsource:"share",automate:"automate"},$e=[{id:"hourly",label:"Every hour",everyMs:36e5},{id:"daily",label:"Every day",everyMs:864e5},{id:"weekly",label:"Every week",everyMs:6048e5}];function Oe(e,t){return O(t.dy)}function Me(e){return`${e.kind}: ${e.label??e.url}`}function Ee(){return Date.now()}function He(e){return e.recordAct}function We(e){return e.hydrated}function Be(e){return e.provider}function Fe(e){return e.session}function Ne(e){return{id:e.id,question:e.question}}function Ge(e){return e+1}function Ke(e){return e.session}},4568,[348,2838,349,2815,2476,4017,3516,350,36,140,616,252,591,659,649,25,546,182,234,571,146,558,56,811,3619,3442,3621,3618,4007,4009,4013,4016,4569,4014,4019,4570,4571,4572,4018,4574,4575,279]);
16327
+ __d(function(g,r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.shouldTrackSheetDrag=O,_e.shouldCloseOnDrag=M,_e.destructiveHint=E,_e.verbAccessibilityLabel=H,Object.defineProperty(_e,"UNWIRED_VERBS",{enumerable:!0,get:function(){return F}}),_e.bucketLabel=K,_e.relativeAge=q,_e.cardMetaLine=U,_e.consolidateRowLabel=ee,_e.emptyRingState=he,_e.relativeWake=be,_e.backgroundTextFor=ge,Object.defineProperty(_e,"ReelsScreen",{enumerable:!0,get:function(){return fe}}),_e.shareTextFor=ve;var t=r(_d[0]),n=r(_d[1]),s=r(_d[2]),o=r(_d[3]),l=r(_d[4]),i=r(_d[5]),a=r(_d[6]),c=r(_d[7]),d=r(_d[8]);r(_d[9]);e(r(_d[10]));var u=e(r(_d[11])),h=e(r(_d[12]));r(_d[13]);var b=e(r(_d[14]));r(_d[15]),r(_d[16]),r(_d[17]),r(_d[18]),r(_d[19]),r(_d[20]);var p=r(_d[21]),y=r(_d[22]),f=r(_d[23]),x=r(_d[24]),j=r(_d[25]),S=r(_d[26]),v=r(_d[27]),k=r(_d[28]),w=r(_d[29]),T=r(_d[30]),_=r(_d[31]),C=r(_d[32]),I=r(_d[33]),D=r(_d[34]),V=r(_d[35]),z=r(_d[36]),R=r(_d[37]),L=r(_d[38]),P=r(_d[39]),A=r(_d[40]),$=r(_d[41]);function O(e){return e>8}function M(e){return e>60}function E(e,t,n){return t&&"hold"!==t?t:e||"hold"===t?"hold to retire, this cannot be undone":n}function H(e,t){return"terminate"===e?`${t}. Hold to confirm, this cannot be undone.`:F.has(e)?`${t}. Not wired yet.`:t}const W={automate:"automate",share:"share",snooze:"snooze",options:"kanban",consolidate:"consolidate"},B={share:null,automate:null,snooze:null,kanban:null,tag:null,consolidate:null},F=new Set([]);function N(e){return e.key}const G={needs_input:"needs you",failed:"failed",attention:"wants a look",pending:"waiting",running:"running",done:"done"};function K(e){return G[e]??e.replace(/_/g," ")}function q(e,t=new Date){if(!e)return"";const n=t.getTime()-e.getTime();if(!Number.isFinite(n)||n<0)return"";const s=Math.floor(n/6e4);if(s<1)return"just now";if(s<60)return`${s}m`;const o=Math.floor(s/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}function U(e,t){return[K(String(e.statusBucket)),q(e.lastActivityAt,t),e.model?`${e.provider}/${e.model}`:e.provider].filter(e=>e.length>0).join(" \xb7 ")}function Y(e,t){const n=(0,c.c)(8);let s,o,l,i;n[0]!==e||n[1]!==t?(s=()=>{if(!e||"undefined"==typeof document)return;const n=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},o=[e,t],n[0]=e,n[1]=t,n[2]=s,n[3]=o):(s=n[2],o=n[3]),(0,d.useEffect)(s,o),n[4]!==e||n[5]!==t?(l=()=>{},i=[e,t],n[4]=e,n[5]=t,n[6]=l,n[7]=i):(l=n[6],i=n[7]),(0,d.useEffect)(l,i)}const X=(0,d.memo)(function(e){const a=(0,c.c)(90),{session:u,visible:y,onClose:f,onSend:x,sendError:j,openDecisions:S,target:v,actAllowed:w}=e,[T,_]=(0,d.useState)(""),C=v?.question??null,I=u.digest;let D;a[0]!==x||a[1]!==T?(D=()=>{const e=T.trim();e.length>0&&(x(e),_(""))},a[0]=x,a[1]=T,a[2]=D):D=a[2];const V=D,z=(0,p.useSafeAreaInsets)(),R=xe.captionSheet,[L,P]=(0,d.useState)(!1);let A,O;a[3]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{const e=h.default.addListener("keyboardDidShow",()=>P(!0)),t=h.default.addListener("keyboardDidHide",()=>P(!1));return()=>{e.remove(),t.remove()}},O=[],a[3]=A,a[4]=O):(A=a[3],O=a[4]),(0,d.useEffect)(A,O);const E=L&&!1?0:z.bottom;let H;a[5]!==E?(H=[xe.sheetInner,{paddingBottom:E}],a[5]=E,a[6]=H):H=a[6];const W=H;let B;a[7]!==f?(B=b.default.create({onMoveShouldSetPanResponder:Oe,onPanResponderRelease:(e,t)=>{M(t.dy)&&f()}}),a[7]=f,a[8]=B):B=a[8];const F=B;let N,G,K;Y(y,f),a[9]!==w?(N=w?null:(0,$.jsx)(s.Text,{style:xe.composerLabel,testID:"reels-composer-capped",children:"Decisions are done for today. This one keeps until tomorrow."}),a[9]=w,a[10]=N):N=a[10],a[11]!==w||a[12]!==C||a[13]!==S.length||a[14]!==V||a[15]!==T?(G=w?(0,$.jsxs)($.Fragment,{children:[C?(0,$.jsx)(s.Text,{style:xe.composerLabel,numberOfLines:2,testID:"reels-composer-target",children:S.length>1?`Answering the first of ${S.length} open decisions: ${C}`:`Answering: ${C}`}):null,(0,$.jsxs)(t.View,{style:xe.composer,children:[(0,$.jsx)(n.TextInput,{value:T,onChangeText:_,placeholder:C?"in your own words":"say what to do",style:xe.composerInput,onSubmitEditing:V,returnKeyType:"send",testID:"reels-composer-input"}),(0,$.jsx)(l.Pressable,{onPress:V,style:xe.composerSend,accessibilityRole:"button",accessibilityLabel:"Send this answer",hitSlop:8,testID:"reels-composer-send",children:(0,$.jsx)(s.Text,{style:xe.link,children:"send"})})]})]}):null,a[11]=w,a[12]=C,a[13]=S.length,a[14]=V,a[15]=T,a[16]=G):G=a[16],a[17]!==N||a[18]!==G?(K=(0,$.jsxs)(t.View,{children:[N,G]}),a[17]=N,a[18]=G,a[19]=K):K=a[19];const q=K;if(!y)return null;let U,X,Z,ee,te,ne,se;a[20]!==f?(U=(0,$.jsx)(l.Pressable,{style:xe.captionBackdrop,onPress:f,accessibilityRole:"button",accessibilityLabel:"Close the digest",testID:"reels-caption-backdrop"}),a[20]=f,a[21]=U):U=a[21],a[22]===Symbol.for("react.memo_cache_sentinel")?(X=(0,$.jsx)(t.View,{style:xe.sheetHandle}),a[22]=X):X=a[22],a[23]!==F.panHandlers?(Z=(0,$.jsx)(t.View,Object.assign({},F.panHandlers,{style:xe.sheetGrab,testID:"reels-caption-grab",children:X})),a[23]=F.panHandlers,a[24]=Z):Z=a[24],a[25]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,$.jsx)(J,{}),a[25]=ee):ee=a[25],a[26]!==f?(te=(0,$.jsx)(l.Pressable,{onPress:f,style:xe.sheetClose,hitSlop:8,accessibilityRole:"button",accessibilityLabel:"Close the digest",testID:"reels-caption-close",children:ee}),a[26]=f,a[27]=te):te=a[27],a[28]!==u.title?(ne=(0,$.jsx)(s.Text,{style:we,numberOfLines:1,children:u.title}),a[28]=u.title,a[29]=ne):ne=a[29],a[30]!==te||a[31]!==ne?(se=(0,$.jsxs)(t.View,{style:xe.sheetHead,children:[te,ne]}),a[30]=te,a[31]=ne,a[32]=se):se=a[32];const oe=I?.summary;let le;a[33]!==oe?(le=(0,$.jsx)(Q,{label:"Summary",value:oe,derived:!0}),a[33]=oe,a[34]=le):le=a[34];const ie=I?.goal;let re;a[35]!==ie?(re=(0,$.jsx)(Q,{label:"Goal",value:ie}),a[35]=ie,a[36]=re):re=a[36];const ae=I?.nextStep;let ce,de,ue,he,be,ge,pe,me,ye,fe,je,Se,ve;if(a[37]!==ae?(ce=(0,$.jsx)(Q,{label:"Next step",value:ae}),a[37]=ae,a[38]=ce):ce=a[38],a[39]!==I?.blockers?(de=I?.blockers?.join("\n"),a[39]=I?.blockers,a[40]=de):de=a[40],a[41]!==de?(ue=(0,$.jsx)(Q,{label:"Blockers",value:de,danger:!0}),a[41]=de,a[42]=ue):ue=a[42],a[43]!==I?.accomplishments?(he=I?.accomplishments?.join("\n"),a[43]=I?.accomplishments,a[44]=he):he=a[44],a[45]!==he?(be=(0,$.jsx)(Q,{label:"Accomplishments",value:he,derived:!0}),a[45]=he,a[46]=be):be=a[46],a[47]!==I?.keyFiles?(ge=I?.keyFiles?.join("\n"),a[47]=I?.keyFiles,a[48]=ge):ge=a[48],a[49]!==ge?(pe=(0,$.jsx)(Q,{label:"Key files",value:ge,derived:!0}),a[49]=ge,a[50]=pe):pe=a[50],a[51]!==I?.links?(me=I?.links?.map(Me).join("\n"),a[51]=I?.links,a[52]=me):me=a[52],a[53]!==me?(ye=(0,$.jsx)(Q,{label:"Links",value:me}),a[53]=me,a[54]=ye):ye=a[54],a[55]!==S){let e;a[57]!==S.length?(e=(e,t)=>(0,$.jsx)(Q,{label:S.length>1?`Decision ${t+1} of ${S.length}`:"Decision",value:e.question},e.id),a[57]=S.length,a[58]=e):e=a[58],fe=S.map(e),a[55]=S,a[56]=fe}else fe=a[56];var ke;let Te,Ce,Ie,De,Ve;return a[59]!==u.tags?(je=u.tags.join(", ")||"no tag",a[59]=u.tags,a[60]=je):je=a[60],a[61]!==je?(Se=(0,$.jsx)(Q,{label:"Tags",value:je}),a[61]=je,a[62]=Se):Se=a[62],a[63]!==u.kanban?(ve=(ke=u.kanban)?(0,k.getBucketLabel)(ke)||ke:"no column",a[63]=u.kanban,a[64]=ve):ve=a[64],a[65]!==ve?(Te=(0,$.jsx)(Q,{label:"Kanban",value:ve}),a[65]=ve,a[66]=Te):Te=a[66],a[67]!==le||a[68]!==re||a[69]!==ce||a[70]!==ue||a[71]!==be||a[72]!==pe||a[73]!==ye||a[74]!==fe||a[75]!==Se||a[76]!==Te?(Ce=(0,$.jsxs)(o.ScrollView,{style:xe.sheetBody,testID:"reels-caption-body",children:[le,re,ce,ue,be,pe,ye,fe,Se,Te]}),a[67]=le,a[68]=re,a[69]=ce,a[70]=ue,a[71]=be,a[72]=pe,a[73]=ye,a[74]=fe,a[75]=Se,a[76]=Te,a[77]=Ce):Ce=a[77],a[78]!==j?(Ie=j?(0,$.jsxs)(s.Text,{style:xe.sendError,testID:"reels-composer-error",children:["Could not send that: ",j,". Nothing was recorded, so try again."]}):null,a[78]=j,a[79]=Ie):Ie=a[79],a[80]!==q||a[81]!==W||a[82]!==Z||a[83]!==se||a[84]!==Ce||a[85]!==Ie?(De=(0,$.jsx)(i.KeyboardAvoidingView,{behavior:"height",style:R,testID:"reels-caption-sheet",children:(0,$.jsxs)(t.View,{style:W,children:[Z,se,Ce,Ie,q]})}),a[80]=q,a[81]=W,a[82]=Z,a[83]=se,a[84]=Ce,a[85]=Ie,a[86]=De):De=a[86],a[87]!==U||a[88]!==De?(Ve=(0,$.jsxs)($.Fragment,{children:[U,De]}),a[87]=U,a[88]=De,a[89]=Ve):Ve=a[89],Ve}),J=(0,d.memo)(function(){const e=(0,c.c)(2),{theme:t}=(0,y.useUnistyles)();let n;return e[0]!==t.colors.foregroundMuted?(n=(0,$.jsx)(f.X,{size:18,color:t.colors.foregroundMuted}),e[0]=t.colors.foregroundMuted,e[1]=n):n=e[1],n}),Q=(0,d.memo)(function(e){const n=(0,c.c)(9),{label:o,value:l,derived:i,danger:a}=e;if(!l)return null;const d=i?" (derived)":"";let u;n[0]!==o||n[1]!==d?(u=(0,$.jsxs)(s.Text,{style:xe.fieldLabel,children:[o,d]}),n[0]=o,n[1]=d,n[2]=u):u=n[2];const h=a?ke:xe.fieldValue;let b,p;return n[3]!==h||n[4]!==l?(b=(0,$.jsx)(s.Text,{style:h,children:l}),n[3]=h,n[4]=l,n[5]=b):b=n[5],n[6]!==u||n[7]!==b?(p=(0,$.jsxs)(t.View,{style:xe.field,children:[u,b]}),n[6]=u,n[7]=b,n[8]=p):p=n[8],p}),Z={on:{selected:!0},off:{selected:!1}};function ee(e,t,n){return t?n?`${e}, picked, survives this consolidation`:`${e}, picked`:`${e}, not picked`}const te=(0,d.memo)(function(e){const n=(0,c.c)(39),{session:o,picked:i,isWinner:a,now:d,onToggle:u,onCrown:h}=e,{theme:b}=(0,y.useUnistyles)();let p;n[0]!==u||n[1]!==o.id?(p=()=>u(o.id),n[0]=u,n[1]=o.id,n[2]=p):p=n[2];const x=p;let j;n[3]!==h||n[4]!==o.id?(j=()=>h(o.id),n[3]=h,n[4]=o.id,n[5]=j):j=n[5];const S=j;let v,k=f.Square;i&&(k=a?f.Crown:f.SquareCheck),n[6]!==a||n[7]!==i||n[8]!==o.title?(v=ee(o.title,i,a),n[6]=a,n[7]=i,n[8]=o.title,n[9]=v):v=n[9];const w=Z[i?"on":"off"],T=i?Te:xe.pickRow,_=`reels-consolidate-pick-${o.id}`;let C,I,D;n[10]!==k||n[11]!==b.colors.accent?(C=(0,$.jsx)(t.View,{style:xe.pickMark,children:(0,$.jsx)(k,{size:16,color:b.colors.accent})}),n[10]=k,n[11]=b.colors.accent,n[12]=C):C=n[12],n[13]!==o.title?(I=(0,$.jsx)(s.Text,{style:xe.pickName,children:o.title}),n[13]=o.title,n[14]=I):I=n[14],n[15]!==d||n[16]!==o.lastActivityAt?(D=q(o.lastActivityAt,d),n[15]=d,n[16]=o.lastActivityAt,n[17]=D):D=n[17];const V=a&&i?" \xb7 survives":"";let z,R,L;return n[18]!==V||n[19]!==D?(z=(0,$.jsxs)(s.Text,{style:xe.pickAux,children:[D,V]}),n[18]=V,n[19]=D,n[20]=z):z=n[20],n[21]!==S||n[22]!==a||n[23]!==i||n[24]!==o.id||n[25]!==o.title||n[26]!==b.colors.foregroundMuted?(R=i&&!a?(0,$.jsx)(l.Pressable,{onPress:S,accessibilityRole:"button",accessibilityLabel:`Make ${o.title} the survivor`,hitSlop:8,style:xe.pickCrown,testID:`reels-consolidate-crown-${o.id}`,children:(0,$.jsx)(f.Crown,{size:14,color:b.colors.foregroundMuted})}):null,n[21]=S,n[22]=a,n[23]=i,n[24]=o.id,n[25]=o.title,n[26]=b.colors.foregroundMuted,n[27]=R):R=n[27],n[28]!==S||n[29]!==z||n[30]!==R||n[31]!==v||n[32]!==w||n[33]!==T||n[34]!==_||n[35]!==C||n[36]!==I||n[37]!==x?(L=(0,$.jsxs)(l.Pressable,{onPress:x,onLongPress:S,accessibilityRole:"button",accessibilityLabel:v,accessibilityState:w,style:T,testID:_,children:[C,I,z,R]}),n[28]=S,n[29]=z,n[30]=R,n[31]=v,n[32]=w,n[33]=T,n[34]=_,n[35]=C,n[36]=I,n[37]=x,n[38]=L):L=n[38],L}),ne=(0,d.memo)(function(e){const n=(0,c.c)(67),{candidates:i,now:a,onCancel:u,onConsolidate:h,verbError:b}=e;let p;n[0]===Symbol.for("react.memo_cache_sentinel")?(p={},n[0]=p):p=n[0];const[y,f]=(0,d.useState)(p);let x;if(n[1]!==i||n[2]!==y){let e;n[4]!==y?(e=e=>y[e.id],n[4]=y,n[5]=e):e=n[5],x=i.filter(e),n[1]=i,n[2]=y,n[3]=x}else x=n[3];const j=x,[S,v]=(0,d.useState)(null);let k;n[6]!==j||n[7]!==S?(k=(0,A.consolidationTargets)(j,S),n[6]=j,n[7]=S,n[8]=k):k=n[8];const{winner:w,sourceIds:T}=k;let _;n[9]===Symbol.for("react.memo_cache_sentinel")?(_=e=>{f(t=>{const n=Object.assign({},t);return n[e]?delete n[e]:n[e]=!0,n})},n[9]=_):_=n[9];const C=_;let I;n[10]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{v(e),f(t=>t[e]?t:Object.assign({},t,{[e]:!0}))},n[10]=I):I=n[10];const V=I;let z;n[11]!==j||n[12]!==w?(z=(0,A.canConsolidate)(j,w),n[11]=j,n[12]=w,n[13]=z):z=n[13];const R=z;let L;n[14]!==j||n[15]!==h||n[16]!==T||n[17]!==w?(L=()=>{w&&j.length>=2&&h(w,T)},n[14]=j,n[15]=h,n[16]=T,n[17]=w,n[18]=L):L=n[18];const P=(0,D.useDestructiveHold)(L,"consolidate");let O;n[19]!==P.progress?(O=Math.round(100*P.progress),n[19]=P.progress,n[20]=O):O=n[20];const M=`${O}%`;let H;n[21]!==M?(H=[xe.verbFill,{width:M}],n[21]=M,n[22]=H):H=n[22];const W=H;let B,F,N,G,K,q,U,Y;if(n[23]===Symbol.for("react.memo_cache_sentinel")?(B=(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Consolidate"}),F=(0,$.jsx)(s.Text,{style:xe.hint,children:"The winner keeps its transcript. The others are archived and linked to it, both ways. Archived is a soft delete: still readable by id, same as Terminate."}),n[23]=B,n[24]=F):(B=n[23],F=n[24]),n[25]!==b?(N=b?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:b}):null,n[25]=b,n[26]=N):N=n[26],n[27]!==i||n[28]!==a||n[29]!==y||n[30]!==w){let e;n[32]!==a||n[33]!==y||n[34]!==w?(e=e=>(0,$.jsx)(te,{session:e,picked:Boolean(y[e.id]),isWinner:w===e.id,now:a,onToggle:C,onCrown:V},e.id),n[32]=a,n[33]=y,n[34]=w,n[35]=e):e=n[35],G=i.map(e),n[27]=i,n[28]=a,n[29]=y,n[30]=w,n[31]=G}else G=n[31];n[36]!==G?(K=(0,$.jsx)(o.ScrollView,{style:xe.pickList,children:G}),n[36]=G,n[37]=K):K=n[37],n[38]===Symbol.for("react.memo_cache_sentinel")?(q=(0,$.jsx)(s.Text,{style:xe.link,children:"cancel"}),n[38]=q):q=n[38],n[39]!==u?(U=(0,$.jsx)(l.Pressable,{onPress:u,accessibilityRole:"button",accessibilityLabel:"Cancel and close",style:xe.send,testID:"reels-consolidate-cancel",children:q}),n[39]=u,n[40]=U):U=n[40],n[41]!==R||n[42]!==P.handlers?(Y=R?P.handlers:{},n[41]=R,n[42]=P.handlers,n[43]=Y):Y=n[43];const X=!R,J=R?xe.send:Re,Q=`Consolidate ${T.length} sessions into the survivor. Hold to confirm.`;let Z;n[44]!==W||n[45]!==P.progress?(Z=P.progress>0?(0,$.jsx)(t.View,{style:W,testID:"reels-consolidate-hold-fill"}):null,n[44]=W,n[45]=P.progress,n[46]=Z):Z=n[46];const ee=`hold to consolidate ${T.length}`;let ne,se,oe,le,ie;return n[47]!==P.hint||n[48]!==P.showLabel||n[49]!==ee?(ne=E(P.showLabel,P.hint,ee),n[47]=P.hint,n[48]=P.showLabel,n[49]=ee,n[50]=ne):ne=n[50],n[51]!==ne?(se=(0,$.jsx)(s.Text,{style:xe.link,children:ne}),n[51]=ne,n[52]=se):se=n[52],n[53]!==Y||n[54]!==X||n[55]!==J||n[56]!==Q||n[57]!==Z||n[58]!==se?(oe=(0,$.jsxs)(l.Pressable,Object.assign({},Y,{disabled:X,style:J,accessibilityRole:"button",accessibilityLabel:Q,testID:"reels-consolidate-commit",children:[Z,se]})),n[53]=Y,n[54]=X,n[55]=J,n[56]=Q,n[57]=Z,n[58]=se,n[59]=oe):oe=n[59],n[60]!==U||n[61]!==oe?(le=(0,$.jsxs)(t.View,{style:xe.rowGap,children:[U,oe]}),n[60]=U,n[61]=oe,n[62]=le):le=n[62],n[63]!==N||n[64]!==K||n[65]!==le?(ie=(0,$.jsxs)(t.View,{style:xe.sheet,testID:"reels-consolidate",children:[B,F,N,K,le]}),n[63]=N,n[64]=K,n[65]=le,n[66]=ie):ie=n[66],ie}),se=(0,d.memo)(function(e){const n=(0,c.c)(46),{verb:o,icon:i,label:a,onVerb:d}=e,{theme:u}=(0,y.useUnistyles)(),h="terminate"===o,{showLabel:b,progress:p,hint:f,handlers:x}=(0,D.useDestructiveHold)(d,o);let j;n[0]!==d||n[1]!==o?(j=()=>d(o),n[0]=d,n[1]=o,n[2]=j):j=n[2];const S=j;let v;n[3]!==p?(v=Math.round(100*p),n[3]=p,n[4]=v):v=n[4];const k=`${v}%`;let w;n[5]!==k?(w=[xe.verbFill,{width:k}],n[5]=k,n[6]=w):w=n[6];const T=w;if(!h){let e;n[7]!==a||n[8]!==o?(e=H(o,a),n[7]=a,n[8]=o,n[9]=e):e=n[9];const t=`reels-verb-${o}`;let c,d,h;return n[10]!==i||n[11]!==u.colors.foreground?(c=(0,$.jsx)(i,{size:18,color:u.colors.foreground}),n[10]=i,n[11]=u.colors.foreground,n[12]=c):c=n[12],n[13]!==a?(d=(0,$.jsx)(s.Text,{style:xe.verbWord,children:a}),n[13]=a,n[14]=d):d=n[14],n[15]!==e||n[16]!==t||n[17]!==c||n[18]!==d||n[19]!==S?(h=(0,$.jsxs)(l.Pressable,{onPress:S,style:xe.verbChip,accessibilityRole:"button",accessibilityLabel:e,hitSlop:8,testID:t,children:[c,d]}),n[15]=e,n[16]=t,n[17]=c,n[18]=d,n[19]=S,n[20]=h):h=n[20],h}let _;n[21]!==a||n[22]!==o?(_=H(o,a),n[21]=a,n[22]=o,n[23]=_):_=n[23];const C=`reels-verb-${o}`;let I,V;n[24]!==T||n[25]!==p?(I=p>0?(0,$.jsx)(t.View,{style:T,testID:"reels-verb-hold-fill"}):null,n[24]=T,n[25]=p,n[26]=I):I=n[26],n[27]!==i||n[28]!==u.colors.destructive?(V=(0,$.jsx)(i,{size:18,color:u.colors.destructive}),n[27]=i,n[28]=u.colors.destructive,n[29]=V):V=n[29];const z=b||f?Ce:xe.verbWord;let R,L,P,A;return n[30]!==a||n[31]!==z?(R=(0,$.jsx)(s.Text,{style:z,children:a}),n[30]=a,n[31]=z,n[32]=R):R=n[32],n[33]!==f||n[34]!==b?(L=E(b,f,"hold to retire"),n[33]=f,n[34]=b,n[35]=L):L=n[35],n[36]!==L?(P=(0,$.jsx)(s.Text,{style:xe.verbHoldLabel,testID:"reels-verb-terminate-hold",children:L}),n[36]=L,n[37]=P):P=n[37],n[38]!==x||n[39]!==R||n[40]!==P||n[41]!==_||n[42]!==C||n[43]!==I||n[44]!==V?(A=(0,$.jsxs)(l.Pressable,Object.assign({},x,{style:xe.verbChip,accessibilityRole:"button",accessibilityLabel:_,hitSlop:8,testID:C,children:[I,V,R,P]})),n[38]=x,n[39]=R,n[40]=P,n[41]=_,n[42]=C,n[43]=I,n[44]=V,n[45]=A):A=n[45],A}),oe=(0,d.memo)(function(e){const t=(0,c.c)(10),{everyMs:n,label:o,onPick:i}=e;let a;t[0]!==n||t[1]!==i?(a=()=>i(n),t[0]=n,t[1]=i,t[2]=a):a=t[2];const d=a,u=`reels-automate-${n}`;let h,b;return t[3]!==o?(h=(0,$.jsx)(s.Text,{style:xe.pickName,children:o}),t[3]=o,t[4]=h):h=t[4],t[5]!==o||t[6]!==d||t[7]!==u||t[8]!==h?(b=(0,$.jsx)(l.Pressable,{onPress:d,style:xe.pickRow,accessibilityRole:"button",accessibilityLabel:o,testID:u,children:h}),t[5]=o,t[6]=d,t[7]=u,t[8]=h,t[9]=b):b=t[9],b}),le=Object.keys(G).sort((e,t)=>(0,j.getWorkspaceStateBucketPriority)(e)-(0,j.getWorkspaceStateBucketPriority)(t)),ie={today:"Today","3d":"3 days","7d":"7 days","30d":"30 days",stale:"Stale"},re={root:"Top-level",delegated:"Subagent"},ae=S.SESSION_ORIGINS.map(e=>({origin:e,label:re[e]})),ce=(0,d.memo)(function(e){const t=(0,c.c)(15),{value:n,label:o,mode:i,onCycle:a}=e;let d;t[0]!==a||t[1]!==n?(d=()=>a(n),t[0]=a,t[1]=n,t[2]=d):d=t[2];const u=d,h=Ie[i],b="include"===i;let p;t[3]!==b?(p=ze(b),t[3]=b,t[4]=p):p=t[4];const y="neutral"===i?o:`${o}, ${"include"===i?"only":"excluded"}`,f=`reels-filter-${n}`,x="exclude"===i?"-":"";let j,S;return t[5]!==o||t[6]!==x?(j=(0,$.jsxs)(s.Text,{style:xe.tagChipText,children:[x,o]}),t[5]=o,t[6]=x,t[7]=j):j=t[7],t[8]!==u||t[9]!==h||t[10]!==p||t[11]!==y||t[12]!==f||t[13]!==j?(S=(0,$.jsx)(l.Pressable,{onPress:u,style:h,accessibilityRole:"button",accessibilityState:p,accessibilityLabel:y,testID:f,children:j}),t[8]=u,t[9]=h,t[10]=p,t[11]=y,t[12]=f,t[13]=j,t[14]=S):S=t[14],S}),de=(0,d.memo)(function(e){const t=(0,c.c)(10),{target:n,label:o,onShare:i}=e;let a;t[0]!==i||t[1]!==n?(a=()=>i(n),t[0]=i,t[1]=n,t[2]=a):a=t[2];const d=a,u=`Send to ${o}`,h=`reels-share-${n}`;let b,p;return t[3]!==o?(b=(0,$.jsx)(s.Text,{style:xe.pickName,children:o}),t[3]=o,t[4]=b):b=t[4],t[5]!==d||t[6]!==u||t[7]!==h||t[8]!==b?(p=(0,$.jsx)(l.Pressable,{onPress:d,style:xe.pickRow,accessibilityRole:"button",accessibilityLabel:u,testID:h,children:b}),t[5]=d,t[6]=u,t[7]=h,t[8]=b,t[9]=p):p=t[9],p}),ue=(0,d.memo)(function(e){const n=(0,c.c)(43),{verb:o,icon:i,label:a,detail:d,onVerb:u}=e,{theme:h}=(0,y.useUnistyles)(),b="terminate"===o,{showLabel:p,progress:f,hint:x,handlers:j}=(0,D.useDestructiveHold)(u,o);let S;n[0]!==u||n[1]!==o?(S=()=>u(o),n[0]=u,n[1]=o,n[2]=S):S=n[2];const v=S;let k;n[3]!==f?(k=Math.round(100*f),n[3]=f,n[4]=k):k=n[4];const w=`${k}%`;let T;n[5]!==w?(T=[xe.verbFill,{width:w}],n[5]=w,n[6]=T):T=n[6];const _=T;let C;n[7]!==b||n[8]!==j||n[9]!==v?(C=b?j:{onPress:v},n[7]=b,n[8]=j,n[9]=v,n[10]=C):C=n[10];const I=C;let V;n[11]!==a||n[12]!==o?(V=H(o,a),n[11]=a,n[12]=o,n[13]=V):V=n[13];const z=`reels-taco-${o}`;let R;n[14]!==b||n[15]!==f||n[16]!==_?(R=b&&f>0?(0,$.jsx)(t.View,{style:_,testID:"reels-taco-hold-fill"}):null,n[14]=b,n[15]=f,n[16]=_,n[17]=R):R=n[17];const L=b?h.colors.destructive:h.colors.foreground;let P,A,O,M,W,B,N;return n[18]!==i||n[19]!==L?(P=(0,$.jsx)(t.View,{style:xe.pickMark,children:(0,$.jsx)(i,{size:16,color:L})}),n[18]=i,n[19]=L,n[20]=P):P=n[20],n[21]!==a?(A=(0,$.jsx)(s.Text,{style:xe.pickName,children:a}),n[21]=a,n[22]=A):A=n[22],n[23]!==b||n[24]!==d||n[25]!==x||n[26]!==p?(O=b?E(p,x,"hold to retire"):d,n[23]=b,n[24]=d,n[25]=x,n[26]=p,n[27]=O):O=n[27],n[28]!==O?(M=(0,$.jsx)(s.Text,{style:xe.hint,children:O}),n[28]=O,n[29]=M):M=n[29],n[30]!==o?(W=F.has(o)?(0,$.jsx)(s.Text,{style:xe.pickAux,children:"not wired yet"}):null,n[30]=o,n[31]=W):W=n[31],n[32]!==A||n[33]!==M||n[34]!==W?(B=(0,$.jsxs)(t.View,{style:xe.grow,children:[A,M,W]}),n[32]=A,n[33]=M,n[34]=W,n[35]=B):B=n[35],n[36]!==I||n[37]!==P||n[38]!==B||n[39]!==V||n[40]!==z||n[41]!==R?(N=(0,$.jsxs)(l.Pressable,Object.assign({},I,{style:xe.pickRow,accessibilityRole:"button",accessibilityLabel:V,testID:z,children:[R,P,B]})),n[36]=I,n[37]=P,n[38]=B,n[39]=V,n[40]=z,n[41]=R,n[42]=N):N=n[42],N});function he(e,t,n){if(t>0){const n=1===t?"filter":"filters";return{filteredOut:!0,exit:"clear-filters",message:`No sessions match. ${e.length} in the fleet, ${t} ${n} on.`}}const s=e.filter(e=>(0,R.isSnoozed)(e,n));if(0===s.length)return{filteredOut:!1,exit:"leave",message:"No sessions in the ring."};const o=s.map(e=>e.snoozedUntil?Date.parse(e.snoozedUntil):Number.NaN).filter(e=>Number.isFinite(e)&&e>n.getTime()).sort((e,t)=>e-t)[0],l=o?` Next one wakes ${be(new Date(o),n)}.`:"",i=1===s.length?"session is":"sessions are";return{filteredOut:!1,exit:"leave",message:`All ${s.length} ${i} snoozed.${l}`}}function be(e,t){const n=e.getTime()-t.getTime();if(!Number.isFinite(n)||n<=0)return"any moment";const s=Math.round(n/6e4);if(s<60)return s<1?"any moment":`in ${s}m`;const o=Math.round(s/60);return o<24?`in ${o}h`:`in ${Math.round(o/24)}d`}function ge(e){const t=e.digest,n=t?.summary??t?.goal,s=[t?.goal,t?.nextStep,t?.blockers?.length?t.blockers.join("\n"):void 0].filter(e=>Boolean(e&&e!==n));return s.length>0?s.join("\n\n"):""}const pe=(0,d.memo)(function({mode:e,text:n,active:o}){const l=(0,d.useRef)(new a.Animated.Value(0)).current,i=o&&"text"===e&&n.length>0;(0,d.useEffect)(()=>{if(!i)return;const e=a.Animated.loop(a.Animated.sequence([a.Animated.timing(l,{toValue:-96,duration:24e3,easing:u.default.inOut(u.default.quad),useNativeDriver:!1}),a.Animated.timing(l,{toValue:0,duration:24e3,easing:u.default.inOut(u.default.quad),useNativeDriver:!1})]));return e.start(),()=>{e.stop(),l.setValue(0)}},[i,l]);const c=(0,d.useMemo)(()=>({transform:[{translateY:l}]}),[l]);return"off"===e?null:(0,$.jsx)(t.View,{style:"text"===e?Le:xe.background,testID:`reels-background-${e}`,children:"text"===e?(0,$.jsx)(a.Animated.View,{style:c,children:(0,$.jsx)(s.Text,{style:xe.backgroundBody,numberOfLines:40,children:n})}):null})}),me=(0,d.memo)(function(e){const n=(0,c.c)(28),{gated:o,allTags:l,onPickTag:i,decision:a,decisions:d,serverId:u,agentId:h,onAnswered:b,onVerb:p,actAllowed:y,capLabel:f,tagError:x}=e;if(o){let e,o,a;return n[0]!==l||n[1]!==i?(e=(0,$.jsx)(_.TagGate,{available:l,onPick:i}),n[0]=l,n[1]=i,n[2]=e):e=n[2],n[3]!==x?(o=x?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:x}):null,n[3]=x,n[4]=o):o=n[4],n[5]!==e||n[6]!==o?(a=(0,$.jsxs)(t.View,{children:[e,o]}),n[5]=e,n[6]=o,n[7]=a):a=n[7],a}if(a){if(!y){let e,o,l,i,a;return n[8]!==f?(e=(0,$.jsx)(s.Text,{style:xe.hint,children:f}),n[8]=f,n[9]=e):e=n[9],n[10]===Symbol.for("react.memo_cache_sentinel")?(o=(0,$.jsx)(s.Text,{style:xe.cardTapHint,children:"Decisions are done for today. You can still retire or snooze this one."}),n[10]=o):o=n[10],n[11]!==p?(l=_.TACO_VERBS.map(e=>(0,$.jsx)(se,{verb:e.id,icon:e.icon,label:e.label,onVerb:p},e.id)),n[11]=p,n[12]=l):l=n[12],n[13]!==l?(i=(0,$.jsx)(t.View,{style:xe.rowGap,children:l}),n[13]=l,n[14]=i):i=n[14],n[15]!==e||n[16]!==i?(a=(0,$.jsxs)(t.View,{testID:"reels-cap-reached",children:[e,o,i]}),n[15]=e,n[16]=i,n[17]=a):a=n[17],a}let e;return n[18]!==h||n[19]!==d||n[20]!==b||n[21]!==u?(e=(0,$.jsx)(T.DecisionChips,{serverId:u,agentId:h,decisions:d,onAnswered:b}),n[18]=h,n[19]=d,n[20]=b,n[21]=u,n[22]=e):e=n[22],e}let j,S,v;return n[23]===Symbol.for("react.memo_cache_sentinel")?(j=(0,$.jsx)(s.Text,{style:xe.hint,children:"Nothing to decide. Why is this still open?"}),n[23]=j):j=n[23],n[24]!==p?(S=_.TACO_VERBS.map(e=>(0,$.jsx)(se,{verb:e.id,icon:e.icon,label:e.label,onVerb:p},e.id)),n[24]=p,n[25]=S):S=n[25],n[26]!==S?(v=(0,$.jsxs)(t.View,{testID:"reels-taco-row",children:[j,(0,$.jsx)(t.View,{style:xe.rowGap,children:S})]}),n[26]=S,n[27]=v):v=n[27],v}),ye=(0,d.memo)(function(e){const n=(0,c.c)(82),{overlay:i,session:a,ring:d,now:u,decisionTarget:h,onClose:b,onSend:p,onSnooze:y,onConsolidate:f,onKanban:j,onVerb:S,overlayStyle:w,sendError:T,timeFieldDisarmed:C,actAllowed:I,verbError:D,openDecisions:V,onShare:z,onAutomate:R,allTags:L,allProviders:P,statusSelection:A,tagSelection:O,kanbanSelection:M,providerSelection:E,originSelection:H,timeSelection:W,onCycleStatus:B,onCycleTag:F,onCycleKanban:N,onCycleProvider:G,onCycleOrigin:q,onToggleTimeWindow:U}=e,J=a;let Q;n[0]!==U?(Q=e=>U(e),n[0]=U,n[1]=Q):Q=n[1];const Z=Q,ee=(0,k.useKanbanBuckets)();Y("none"!==i.kind,b);const te="caption"===i.kind;let se,re,he,be,ge,pe,me,ye,fe;return n[2]!==I||n[3]!==J||n[4]!==h||n[5]!==b||n[6]!==p||n[7]!==V||n[8]!==T||n[9]!==te?(se=(0,$.jsx)(X,{session:J,visible:te,onClose:b,onSend:p,sendError:T,openDecisions:V,target:h,actAllowed:I},J.id),n[2]=I,n[3]=J,n[4]=h,n[5]=b,n[6]=p,n[7]=V,n[8]=T,n[9]=te,n[10]=se):se=n[10],n[11]!==J.snoozeCount||n[12]!==u||n[13]!==b||n[14]!==y||n[15]!==i.kind||n[16]!==w||n[17]!==D?(re="snooze"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(t.View,{children:[(0,$.jsx)(_.SnoozeSheet,{priorCount:J.snoozeCount,now:u,onCancel:b,onSnooze:y}),D?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:D}):null]})}):null,n[11]=J.snoozeCount,n[12]=u,n[13]=b,n[14]=y,n[15]=i.kind,n[16]=w,n[17]=D,n[18]=re):re=n[18],n[19]!==u||n[20]!==b||n[21]!==f||n[22]!==i.kind||n[23]!==w||n[24]!==d||n[25]!==D?(he="consolidate"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsx)(ne,{candidates:d,now:u,onCancel:b,onConsolidate:f,verbError:D})}):null,n[19]=u,n[20]=b,n[21]=f,n[22]=i.kind,n[23]=w,n[24]=d,n[25]=D,n[26]=he):he=n[26],n[27]!==b||n[28]!==S||n[29]!==i.kind||n[30]!==w?(be="taco"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(t.View,{style:xe.sheet,testID:"reels-taco-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"TACO"}),_.TACO_VERBS.map(e=>(0,$.jsx)(ue,{verb:e.id,icon:e.icon,label:e.label,detail:e.detail,onVerb:S},e.id)),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Cancel and close",style:xe.send,testID:"reels-taco-cancel",children:(0,$.jsx)(s.Text,{style:xe.link,children:"cancel"})})]})}):null,n[27]=b,n[28]=S,n[29]=i.kind,n[30]=w,n[31]=be):be=n[31],n[32]!==P||n[33]!==L||n[34]!==ee||n[35]!==M||n[36]!==b||n[37]!==N||n[38]!==q||n[39]!==G||n[40]!==B||n[41]!==F||n[42]!==Z||n[43]!==H||n[44]!==i.kind||n[45]!==w||n[46]!==E||n[47]!==A||n[48]!==O||n[49]!==C||n[50]!==W?(ge="filters"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(o.ScrollView,{style:xe.sheet,testID:"reels-filters-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Filter the ring"}),(0,$.jsx)(s.Text,{style:xe.hint,children:"The same filter the sessions list uses, so setting it here sets it there."}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"State"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:le.map(e=>(0,$.jsx)(ce,{value:e,label:K(e),mode:(0,x.getFilterValueMode)(A,e),onCycle:B},e))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Kanban"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:ee.map(e=>(0,$.jsx)(ce,{value:e.id,label:e.label,mode:(0,x.getFilterValueMode)(M,e.id),onCycle:N},e.id))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Tag"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:L.map(e=>(0,$.jsx)(ce,{value:e,label:e,mode:(0,x.getFilterValueMode)(O,e),onCycle:F},e))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Date"}),C?(0,$.jsx)(s.Text,{style:xe.hint,testID:"reels-filter-date-off",children:"Off while dates are measured on when a session was archived. The ring only holds live sessions. Change it on the sessions bar to filter by date here."}):(0,$.jsx)(t.View,{style:xe.rowGap,children:v.SESSION_TIME_WINDOWS.map(e=>(0,$.jsx)(ce,{value:e,label:ie[e],mode:"window"===W?.kind&&W.window===e?"include":"neutral",onCycle:Z},e))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Provider"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:P.map(e=>(0,$.jsx)(ce,{value:e,label:e,mode:(0,x.getFilterValueMode)(E,e),onCycle:G},e))}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Origin"}),(0,$.jsx)(t.View,{style:xe.rowGap,children:ae.map(e=>(0,$.jsx)(ce,{value:e.origin,label:e.label,mode:(0,x.getFilterValueMode)(H,e.origin),onCycle:q},e.origin))}),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Done, close filters",style:xe.send,testID:"reels-filters-done",children:(0,$.jsx)(s.Text,{style:xe.link,children:"done"})})]})}):null,n[32]=P,n[33]=L,n[34]=ee,n[35]=M,n[36]=b,n[37]=N,n[38]=q,n[39]=G,n[40]=B,n[41]=F,n[42]=Z,n[43]=H,n[44]=i.kind,n[45]=w,n[46]=E,n[47]=A,n[48]=O,n[49]=C,n[50]=W,n[51]=ge):ge=n[51],n[52]!==R||n[53]!==b||n[54]!==i.kind||n[55]!==w||n[56]!==D?(pe="automate"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(t.View,{style:xe.sheet,testID:"reels-automate-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Automate"}),(0,$.jsx)(s.Text,{style:xe.hint,children:"Re-runs this session on a cadence, with its next step as the prompt."}),D?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:D}):null,$e.map(e=>(0,$.jsx)(oe,{everyMs:e.everyMs,label:e.label,onPick:R},e.id)),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Cancel and close",style:xe.send,testID:"reels-automate-cancel",children:(0,$.jsx)(s.Text,{style:xe.link,children:"cancel"})})]})}):null,n[52]=R,n[53]=b,n[54]=i.kind,n[55]=w,n[56]=D,n[57]=pe):pe=n[57],n[58]!==b||n[59]!==z||n[60]!==i.kind||n[61]!==w||n[62]!==D?(me="share"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(t.View,{style:xe.sheet,testID:"reels-share-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Send"}),(0,$.jsx)(s.Text,{style:xe.hint,children:"Send this card somewhere a person will read it."}),D?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:D}):null,je.map(e=>(0,$.jsx)(de,{target:e.id,label:e.label,onShare:z},e.id)),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Cancel and close",style:xe.send,testID:"reels-share-cancel",children:(0,$.jsx)(s.Text,{style:xe.link,children:"cancel"})})]})}):null,n[58]=b,n[59]=z,n[60]=i.kind,n[61]=w,n[62]=D,n[63]=me):me=n[63],n[64]!==J.kanban||n[65]!==J.model||n[66]!==J.provider||n[67]!==b||n[68]!==j||n[69]!==i.kind||n[70]!==w||n[71]!==D?(ye="options"===i.kind?(0,$.jsx)(t.View,{style:w,children:(0,$.jsxs)(o.ScrollView,{style:xe.sheet,testID:"reels-options-sheet",children:[(0,$.jsx)(s.Text,{style:xe.sheetTitle,children:"Session options"}),(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Kanban"}),(0,$.jsx)(_.KanbanPicker,{current:J.kanban,onPick:j}),D?(0,$.jsx)(s.Text,{style:xe.sendError,testID:"reels-verb-error",children:D}):null,(0,$.jsx)(s.Text,{style:xe.fieldLabel,children:"Provider and model"}),(0,$.jsx)(s.Text,{style:xe.fieldValue,children:J.model?`${J.provider}/${J.model}`:J.provider}),(0,$.jsx)(l.Pressable,{onPress:b,accessibilityRole:"button",accessibilityLabel:"Close session options",style:xe.send,testID:"reels-options-close",children:(0,$.jsx)(s.Text,{style:xe.link,children:"close"})})]})}):null,n[64]=J.kanban,n[65]=J.model,n[66]=J.provider,n[67]=b,n[68]=j,n[69]=i.kind,n[70]=w,n[71]=D,n[72]=ye):ye=n[72],n[73]!==ye||n[74]!==se||n[75]!==re||n[76]!==he||n[77]!==be||n[78]!==ge||n[79]!==pe||n[80]!==me?(fe=(0,$.jsxs)($.Fragment,{children:[se,re,he,be,ge,pe,me,ye]}),n[73]=ye,n[74]=se,n[75]=re,n[76]=he,n[77]=be,n[78]=ge,n[79]=pe,n[80]=me,n[81]=fe):fe=n[81],fe}),fe=(0,d.memo)(function(e){const n=(0,c.c)(205),{sessions:o,allTags:i,actCap:a,background:u,now:h,onLeaveRing:b}=e,y=void 0===a?L.DEFAULT_ACT_CAP:a,x=void 0===u?"text":u,j=(0,V.useReelsVerbs)(),{answer:S}=(0,I.useAnswerDecision)(),[v,k]=(0,d.useState)(Ee);let T,D,A;n[0]!==h?(T=()=>{if(h)return;const e=setInterval(()=>k(Date.now()),6e4);return()=>clearInterval(e)},D=[h],n[0]=h,n[1]=T,n[2]=D):(T=n[1],D=n[2]),(0,d.useEffect)(T,D),n[3]!==h||n[4]!==v?(A=h??new Date(v),n[3]=h,n[4]=v,n[5]=A):A=n[5];const O=A,[M,E]=(0,d.useState)(1),H=(0,P.useActBudgetStore)(He);let F;n[6]!==O?(F=e=>(0,P.actsOn)(e,O),n[6]=O,n[7]=F):F=n[7];const G=(0,P.useActBudgetStore)(F),K=(0,P.useActBudgetStore)(We);let q;n[8]!==O||n[9]!==H?(q=()=>H(O),n[8]=O,n[9]=H,n[10]=q):q=n[10];const Y=q,[X,J]=(0,d.useState)(0);let Q;n[11]===Symbol.for("react.memo_cache_sentinel")?(Q={kind:"none"},n[11]=Q):Q=n[11];const[Z,ee]=(0,d.useState)(Q);let te;n[12]===Symbol.for("react.memo_cache_sentinel")?(te={},n[12]=te):te=n[12];const[ne,se]=(0,d.useState)(te);let oe;n[13]===Symbol.for("react.memo_cache_sentinel")?(oe={},n[13]=oe):oe=n[13];const[le,ie]=(0,d.useState)(oe),[re,ae]=(0,d.useState)(null),[ce,de]=(0,d.useState)(B);let ue;n[14]===Symbol.for("react.memo_cache_sentinel")?(ue=(e,t)=>{de(n=>Object.assign({},n,{[e]:t}))},n[14]=ue):ue=n[14];const be=ue,fe=(0,d.useRef)(null);let je;n[15]!==le||n[16]!==M||n[17]!==ne||n[18]!==O||n[19]!==o?(je={sessions:o,localTags:ne,actedLaps:le,laps:M,now:O},n[15]=le,n[16]=M,n[17]=ne,n[18]=O,n[19]=o,n[20]=je):je=n[20];const{feed:Se,activeFilters:ke,statusSelection:we,tagSelection:Te,kanbanSelection:Ce,providerSelection:Ie,originSelection:De,timeSelection:Ve,onCycleStatus:ze,onCycleTag:Re,onCycleKanban:Le,onCycleProvider:$e,onCycleOrigin:Oe,onToggleTimeWindow:Me,onClearFilters:qe,timeFieldDisarmed:Ue}=(0,z.useReelsFeed)(je);let Ye;n[21]!==o?(Ye=[...new Set(o.map(Be))].sort(),n[21]=o,n[22]=Ye):Ye=n[22];const Xe=Ye,Je=Se[Math.min(X,Math.max(Se.length-1,0))]??null,Qe=Je?.session??null,Ze=Je?.lap??1;let et;n[23]!==Ze?(et=e=>e.lap===Ze,n[23]=Ze,n[24]=et):et=n[24];const tt=Se.findIndex(et);let nt;if(n[25]!==Se||n[26]!==Ze){let e;n[28]!==Ze?(e=e=>e.lap===Ze,n[28]=Ze,n[29]=e):e=n[29],nt=Se.filter(e),n[25]=Se,n[26]=Ze,n[27]=nt}else nt=n[27];const st=nt.length;let ot;if(n[30]!==Se||n[31]!==Ze){let e;n[33]!==Ze?(e=e=>e.lap===Ze,n[33]=Ze,n[34]=e):e=n[34],ot=Se.filter(e).map(Fe),n[30]=Se,n[31]=Ze,n[32]=ot}else ot=n[32];const lt=ot,it=Qe?.id??"",rt=Qe?.serverId??"",{allowMove:at}=(0,w.useKanbanMoveGuard)(rt);let ct;var dt;n[35]!==Qe?(ct=Qe?(dt=Qe.digest,(dt?.pendingDecisions??[]).filter(e=>!e.answeredAt)):[],n[35]=Qe,n[36]=ct):ct=n[36];const ut=ct,ht=ut[0]??null;let bt;n[37]!==ut?(bt=ut.map(Ne),n[37]=ut,n[38]=bt):bt=n[38];const gt=bt,pt=ut,mt=!!Qe&&0===Qe.tags.length;let yt;n[39]!==y||n[40]!==G||n[41]!==K?(yt=K&&(0,L.canAct)({acts:G,cap:y}),n[39]=y,n[40]=G,n[41]=K,n[42]=yt):yt=n[42];const ft=yt;let xt;n[43]!==y||n[44]!==G?(xt=(0,L.actCapLabel)({acts:G,cap:y}),n[43]=y,n[44]=G,n[45]=xt):xt=n[45];const jt=xt,St=(0,p.useSafeAreaInsets)();let vt;n[46]!==St.top?(vt=[xe.headerSlot,{paddingTop:St.top}],n[46]=St.top,n[47]=vt):vt=n[47];const kt=vt,wt=St.top+56;let Tt;n[48]!==wt?(Tt=[xe.seamBanner,{paddingTop:wt}],n[48]=wt,n[49]=Tt):Tt=n[49];const _t=Tt;let Ct;n[50]!==St.bottom||n[51]!==St.top?(Ct=[xe.overlay,{paddingTop:St.top,paddingBottom:St.bottom}],n[50]=St.bottom,n[51]=St.top,n[52]=Ct):Ct=n[52];const It=Ct;let Dt;n[53]!==X?(Dt=()=>{ee({kind:"none"}),fe.current?.scrollToIndex(X+1)},n[53]=X,n[54]=Dt):Dt=n[54];const Vt=Dt;let zt;n[55]!==Ze?(zt=e=>{ie(t=>Object.assign({},t,{[e]:Ze}))},n[55]=Ze,n[56]=zt):zt=n[56];const Rt=zt;let Lt;n[57]===Symbol.for("react.memo_cache_sentinel")?(Lt=()=>{E(Ge)},n[57]=Lt):Lt=n[57];const Pt=Lt;let At,$t,Ot,Mt,Et,Ht,Wt;n[58]===Symbol.for("react.memo_cache_sentinel")?(At={id:"read",icon:f.BookOpen,label:"read"},n[58]=At):At=n[58],n[59]!==mt?($t={id:"snooze",icon:f.AlarmClock,label:"snooze",disabled:mt},n[59]=mt,n[60]=$t):$t=n[60],n[61]===Symbol.for("react.memo_cache_sentinel")?(Ot={id:"share",icon:f.Send,label:"send"},n[61]=Ot):Ot=n[61],n[62]!==mt?(Mt={id:"taco",icon:f.LayoutList,label:"TACO",disabled:mt},n[62]=mt,n[63]=Mt):Mt=n[63],n[64]===Symbol.for("react.memo_cache_sentinel")?(Et={id:"archive",icon:f.Archive,label:"archive",destructive:!0},Ht={id:"options",icon:f.MoreHorizontal,label:"options"},n[64]=Et,n[65]=Ht):(Et=n[64],Ht=n[65]),n[66]!==$t||n[67]!==Mt?(Wt=[At,$t,Ot,Mt,Et,Ht],n[66]=$t,n[67]=Mt,n[68]=Wt):Wt=n[68];const Bt=Wt;let Ft;n[69]===Symbol.for("react.memo_cache_sentinel")?(Ft=()=>ee({kind:"caption"}),n[69]=Ft):Ft=n[69];const Nt=Ft;let Gt;n[70]===Symbol.for("react.memo_cache_sentinel")?(Gt=()=>ee({kind:"none"}),n[70]=Gt):Gt=n[70];const Kt=Gt;let qt;n[71]===Symbol.for("react.memo_cache_sentinel")?(qt=()=>ee({kind:"filters"}),n[71]=qt):qt=n[71];const Ut=qt;let Yt;n[72]===Symbol.for("react.memo_cache_sentinel")?(Yt=e=>{se(t=>{const n=Object.assign({},t);return delete n[e],n})},n[72]=Yt):Yt=n[72];const Xt=Yt;let Jt;n[73]!==it||n[74]!==rt||n[75]!==j?(Jt=e=>{se(t=>Object.assign({},t,{[it]:[e]})),be("tag",null),j.setTags({serverId:rt,agentId:it},[e]).catch(e=>{Xt(it),be("tag",e instanceof Error?e.message:"could not tag this session")})},n[73]=it,n[74]=rt,n[75]=j,n[76]=Jt):Jt=n[76];const Qt=Jt;let Zt;n[77]!==Vt||n[78]!==it||n[79]!==ut.length||n[80]!==Rt||n[81]!==Y?(Zt=()=>{Y(),Rt(it),ut.length<=1&&Vt()},n[77]=Vt,n[78]=it,n[79]=ut.length,n[80]=Rt,n[81]=Y,n[82]=Zt):Zt=n[82];const en=Zt;let tn;n[83]!==Vt||n[84]!==it||n[85]!==Rt||n[86]!==rt||n[87]!==j?(tn=async e=>{if("terminate"===e)return await j.terminate({serverId:rt,agentId:it}),Rt(it),void Vt();de(B),ee({kind:Ae[e]})},n[83]=Vt,n[84]=it,n[85]=Rt,n[86]=rt,n[87]=j,n[88]=tn):tn=n[88];const nn=tn;let sn;n[89]!==nn?(sn=e=>{if(de(B),"archive"===e)return nn("terminate");const t=Pe[e];t&&ee({kind:t})},n[89]=nn,n[90]=sn):sn=n[90];const on=sn;let ln;n[91]!==Vt||n[92]!==it||n[93]!==Rt||n[94]!==rt||n[95]!==j?(ln=e=>{be("snooze",null),j.snooze({serverId:rt,agentId:it},e.until,e.untilWhat,e.why).then(()=>(Rt(it),Vt(),null)).catch(e=>{be("snooze",e instanceof Error?e.message:"could not snooze this session")})},n[91]=Vt,n[92]=it,n[93]=Rt,n[94]=rt,n[95]=j,n[96]=ln):ln=n[96];const rn=ln;let an;n[97]!==Vt||n[98]!==Rt||n[99]!==rt||n[100]!==j?(an=(e,t)=>{be("consolidate",null),j.consolidate({serverId:rt,winnerId:e,sourceIds:t}).then(()=>{for(const n of[e,...t])Rt(n);return Vt(),null}).catch(e=>{be("consolidate",e instanceof Error?e.message:"could not consolidate these sessions")})},n[97]=Vt,n[98]=Rt,n[99]=rt,n[100]=j,n[101]=an):an=n[101];const cn=an;let dn;n[102]!==ft||n[103]!==S||n[104]!==it||n[105]!==ht||n[106]!==en||n[107]!==rt?(dn=e=>{if(!ft)return void ee({kind:"none"});const t=e.trim();0!==t.length&&ht?(ae(null),S({serverId:rt,agentId:it,decisionId:ht.id,optionId:null,note:t}).then(()=>(en(),null)).catch(e=>{ae(e instanceof Error?e.message:String(e))})):ee({kind:"none"})},n[102]=ft,n[103]=S,n[104]=it,n[105]=ht,n[106]=en,n[107]=rt,n[108]=dn):dn=n[108];const un=dn;let hn;n[109]!==Qe||n[110]!==j?(hn=e=>{Qe&&(be("share",null),j.share(e,ve(Qe)).then(()=>(ee({kind:"none"}),null)).catch(e=>{be("share",e instanceof Error?e.message:"could not open that")}))},n[109]=Qe,n[110]=j,n[111]=hn):hn=n[111];const bn=hn;let gn;n[112]!==Vt||n[113]!==Qe||n[114]!==it||n[115]!==Rt||n[116]!==rt||n[117]!==j?(gn=e=>{if(!Qe)return;be("automate",null);const t=Qe.digest?.nextStep??Qe.digest?.goal??`Continue ${Qe.title}`;j.automate({serverId:rt,agentId:it},e,t,Qe.title).then(()=>(Rt(it),Vt(),null)).catch(e=>{be("automate",e instanceof Error?e.message:"could not create the routine")})},n[112]=Vt,n[113]=Qe,n[114]=it,n[115]=Rt,n[116]=rt,n[117]=j,n[118]=gn):gn=n[118];const pn=gn;let mn;n[119]!==at||n[120]!==Qe?.kanban||n[121]!==it||n[122]!==rt||n[123]!==j?(mn=e=>{be("kanban",null),at(e,Qe?.kanban??null)&&j.setKanban({serverId:rt,agentId:it},e).then(()=>(ee({kind:"none"}),null)).catch(e=>{be("kanban",e instanceof Error?e.message:"could not move this session")})},n[119]=at,n[120]=Qe?.kanban,n[121]=it,n[122]=rt,n[123]=j,n[124]=mn):mn=n[124];const yn=mn;let fn;n[125]!==i||n[126]!==ft||n[127]!==x||n[128]!==jt||n[129]!==ht||n[130]!==pt||n[131]!==Se||n[132]!==mt||n[133]!==X||n[134]!==O||n[135]!==en||n[136]!==on||n[137]!==nn||n[138]!==Qt||n[139]!==Bt||n[140]!==lt.length||n[141]!==_t||n[142]!==ce.tag?(fn=(e,n)=>{const o=n===X,a=e.session;return(0,$.jsxs)(t.View,{style:xe.card,children:[(0,$.jsx)(pe,{mode:x,text:ge(a),active:o}),e.firstOfLap&&e.lap>1?(0,$.jsx)(t.View,{style:_t,testID:`reels-seam-${e.lap}`,children:(0,$.jsx)(_.LapSeam,{lap:e.lap,ringSize:Se.filter(t=>t.lap===e.lap-1).length||lt.length,acted:(0,R.actedThisLap)(Se.filter(t=>t.lap===e.lap-1).map(Ke),e.lap-1)})}):null,(0,$.jsx)(t.View,{style:xe.middle,children:o?(0,$.jsx)(_.ReelsRail,{actions:Bt,contextLabel:a.tags[0]??"untagged",onAction:on}):null}),(0,$.jsxs)(t.View,{style:xe.bottom,children:[(0,$.jsxs)(l.Pressable,{onPress:o?Nt:void 0,disabled:!o,testID:o?"reels-caption-open":void 0,accessibilityRole:"button",accessibilityLabel:`Open the full digest for ${a.title}`,style:xe.captionTap,children:[(0,$.jsx)(s.Text,{style:xe.cardTitle,children:a.title}),(0,$.jsx)(s.Text,{style:xe.cardMeta,children:U(a,O)}),(0,$.jsx)(s.Text,{style:xe.cardSummary,numberOfLines:4,children:a.digest?.summary??a.digest?.goal??"No digest yet."}),o?(0,$.jsx)(s.Text,{style:xe.cardTapHint,children:"tap for the whole digest and to talk to it"}):null]}),o?(0,$.jsx)(me,{gated:mt,allTags:i,onPickTag:Qt,decision:ht,decisions:pt,serverId:a.serverId,agentId:a.id,onAnswered:en,onVerb:nn,actAllowed:ft,capLabel:jt,tagError:ce.tag}):null]})]})},n[125]=i,n[126]=ft,n[127]=x,n[128]=jt,n[129]=ht,n[130]=pt,n[131]=Se,n[132]=mt,n[133]=X,n[134]=O,n[135]=en,n[136]=on,n[137]=nn,n[138]=Qt,n[139]=Bt,n[140]=lt.length,n[141]=_t,n[142]=ce.tag,n[143]=fn):fn=n[143];const xn=fn;if(!Qe){let e;n[144]!==ke||n[145]!==O||n[146]!==o?(e=he(o,ke,O),n[144]=ke,n[145]=O,n[146]=o,n[147]=e):e=n[147];const{message:i,exit:a}=e;let c,d,u;return n[148]!==i?(c=(0,$.jsx)(s.Text,{style:xe.fieldValue,children:i}),n[148]=i,n[149]=c):c=n[149],n[150]!==a||n[151]!==qe||n[152]!==b?(d="clear-filters"===a?(0,$.jsx)(l.Pressable,{onPress:qe,style:xe.send,accessibilityRole:"button",accessibilityLabel:"Clear all filters",testID:"reels-empty-clear-filters",children:(0,$.jsx)(s.Text,{style:xe.link,children:"clear filters"})}):(0,$.jsx)(l.Pressable,{onPress:b,style:xe.send,accessibilityRole:"button",accessibilityLabel:"Back to the sessions list",testID:"reels-empty-leave",children:(0,$.jsx)(s.Text,{style:xe.link,children:"back to sessions"})}),n[150]=a,n[151]=qe,n[152]=b,n[153]=d):d=n[153],n[154]!==c||n[155]!==d?(u=(0,$.jsxs)(t.View,{style:xe.empty,testID:"reels-empty",children:[c,d]}),n[154]=c,n[155]=d,n[156]=u):u=n[156],u}let jn;n[157]!==Se||n[158]!==xn?(jn=(0,$.jsx)(C.ReelsPager,{data:Se,keyExtractor:N,renderCard:xn,onIndexChange:J,onEndReached:Pt,controllerRef:fe}),n[157]=Se,n[158]=xn,n[159]=jn):jn=n[159];const Sn=`${tt>=0?X-tt+1:X+1}/${st} \xb7 lap ${Ze}`;let vn,kn;n[160]!==y||n[161]!==ke||n[162]!==G||n[163]!==Sn?(vn=(0,$.jsx)(_.ReelsHeader,{acts:G,cap:y,activeFilters:ke,onFilter:Ut,position:Sn}),n[160]=y,n[161]=ke,n[162]=G,n[163]=Sn,n[164]=vn):vn=n[164],n[165]!==kt||n[166]!==vn?(kn=(0,$.jsx)(t.View,{style:kt,pointerEvents:"box-none",children:vn}),n[165]=kt,n[166]=vn,n[167]=kn):kn=n[167];const wn=ce[W[Z.kind]??"share"];let Tn,_n;return n[168]!==Xe||n[169]!==i||n[170]!==ft||n[171]!==Qe||n[172]!==ht||n[173]!==Ce||n[174]!==O||n[175]!==pn||n[176]!==un||n[177]!==cn||n[178]!==Le||n[179]!==Oe||n[180]!==$e||n[181]!==ze||n[182]!==Re||n[183]!==yn||n[184]!==bn||n[185]!==rn||n[186]!==Me||n[187]!==nn||n[188]!==gt||n[189]!==De||n[190]!==Z||n[191]!==It||n[192]!==Ie||n[193]!==lt||n[194]!==re||n[195]!==we||n[196]!==wn||n[197]!==Te||n[198]!==Ue||n[199]!==Ve?(Tn=(0,$.jsx)(ye,{overlay:Z,session:Qe,ring:lt,now:O,decisionTarget:ht,onClose:Kt,onSend:un,actAllowed:ft,timeFieldDisarmed:Ue,onSnooze:rn,onConsolidate:cn,onKanban:yn,onVerb:nn,overlayStyle:It,sendError:re,verbError:wn,openDecisions:gt,onShare:bn,onAutomate:pn,allTags:i,allProviders:Xe,statusSelection:we,tagSelection:Te,kanbanSelection:Ce,providerSelection:Ie,originSelection:De,timeSelection:Ve,onCycleStatus:ze,onCycleTag:Re,onCycleKanban:Le,onCycleProvider:$e,onCycleOrigin:Oe,onToggleTimeWindow:Me}),n[168]=Xe,n[169]=i,n[170]=ft,n[171]=Qe,n[172]=ht,n[173]=Ce,n[174]=O,n[175]=pn,n[176]=un,n[177]=cn,n[178]=Le,n[179]=Oe,n[180]=$e,n[181]=ze,n[182]=Re,n[183]=yn,n[184]=bn,n[185]=rn,n[186]=Me,n[187]=nn,n[188]=gt,n[189]=De,n[190]=Z,n[191]=It,n[192]=Ie,n[193]=lt,n[194]=re,n[195]=we,n[196]=wn,n[197]=Te,n[198]=Ue,n[199]=Ve,n[200]=Tn):Tn=n[200],n[201]!==jn||n[202]!==kn||n[203]!==Tn?(_n=(0,$.jsxs)(t.View,{style:xe.root,testID:"reels-screen",children:[jn,kn,Tn]}),n[201]=jn,n[202]=kn,n[203]=Tn,n[204]=_n):_n=n[204],_n}),xe=y.StyleSheet.create(e=>({composerLabel:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,paddingHorizontal:e.spacing[2],paddingTop:e.spacing[1],uni__dependencies:[0]},sheetInner:{flex:1},tagChip:{minHeight:44,justifyContent:"center",borderWidth:1,borderColor:e.colors.border,borderRadius:e.borderRadius.full,paddingHorizontal:e.spacing[2],uni__dependencies:[0]},tagChipOn:{borderColor:e.colors.accent,uni__dependencies:[0]},tagChipOff:{borderColor:e.colors.destructive,borderStyle:"dashed",opacity:.6,uni__dependencies:[0]},tagChipText:{color:e.colors.foreground,fontSize:e.fontSize.xs,uni__dependencies:[0]},sheetGrab:{minHeight:44,alignItems:"center",justifyContent:"center"},sheetHandle:{width:38,height:4,borderRadius:e.borderRadius.full,backgroundColor:e.colors.border,uni__dependencies:[0]},verbFill:{position:"absolute",left:0,top:0,bottom:0,backgroundColor:e.colors.destructive,opacity:.18,borderRadius:e.borderRadius.full,uni__dependencies:[0]},sendError:{color:e.colors.destructive,fontSize:e.fontSize.xs,paddingHorizontal:e.spacing[2],uni__dependencies:[0]},verbHoldLabel:{color:e.colors.destructive,fontSize:e.fontSize.xs,uni__dependencies:[0]},captionBackdrop:Object.assign({},y.StyleSheet.absoluteFillObject,{backgroundColor:e.colors.background,opacity:.72,uni__dependencies:[0]}),sheetClose:{minWidth:44,minHeight:44,alignItems:"center",justifyContent:"center"},card:{flex:1,overflow:"hidden"},seamBanner:{paddingHorizontal:e.spacing[2],uni__dependencies:[0]},headerSlot:{position:"absolute",top:0,left:0,right:0},captionTap:{minHeight:44,justifyContent:"flex-end"},root:{flex:1,backgroundColor:e.colors.background,uni__dependencies:[0]},background:Object.assign({},y.StyleSheet.absoluteFillObject,{opacity:.35,backgroundColor:e.colors.surface0,overflow:"hidden",uni__dependencies:[0]}),backgroundText:{padding:e.spacing[2],uni__dependencies:[0]},backgroundBody:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,lineHeight:20,uni__dependencies:[0]},middle:{flex:1,alignItems:"flex-end",justifyContent:"flex-end",paddingHorizontal:e.spacing[2],uni__dependencies:[0]},bottom:{padding:e.spacing[2],gap:e.spacing[1],uni__dependencies:[0]},cardTitle:{color:e.colors.foreground,fontSize:e.fontSize.base,fontWeight:"600",uni__dependencies:[0]},cardMeta:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,marginTop:2,uni__dependencies:[0]},cardSummary:{color:e.colors.foreground,fontSize:e.fontSize.sm,marginTop:6,lineHeight:19,uni__dependencies:[0]},cardTapHint:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,marginTop:4,uni__dependencies:[0]},hint:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,lineHeight:17,uni__dependencies:[0]},rowGap:{flexDirection:"row",flexWrap:"wrap",gap:e.spacing[1],alignItems:"center",uni__dependencies:[0]},verbChip:{minHeight:44,minWidth:44,alignItems:"center",justifyContent:"center",overflow:"hidden",borderWidth:1,borderColor:e.colors.border,borderRadius:e.borderRadius["2xl"],paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],uni__dependencies:[0]},verbWord:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,uni__dependencies:[0]},verbWordDanger:{color:e.colors.destructive,fontSize:e.fontSize.xs,fontWeight:"600",uni__dependencies:[0]},overlay:Object.assign({},y.StyleSheet.absoluteFillObject,{backgroundColor:e.colors.background,uni__dependencies:[0]}),sheet:{padding:e.spacing[2],gap:e.spacing[1],uni__dependencies:[0]},sheetTitle:{color:e.colors.foreground,fontSize:e.fontSize.base,fontWeight:"600",uni__dependencies:[0]},sheetHeadTitle:{flex:1},captionSheet:{position:"absolute",left:0,right:0,bottom:0,top:"42%",backgroundColor:e.colors.background,borderTopWidth:1,borderTopColor:e.colors.border,borderTopLeftRadius:e.borderRadius["2xl"],borderTopRightRadius:e.borderRadius["2xl"],uni__dependencies:[0]},sheetHead:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],padding:e.spacing[2],borderBottomWidth:1,borderBottomColor:e.colors.border,uni__dependencies:[0]},sheetBody:{flex:1,padding:e.spacing[2],uni__dependencies:[0]},field:{marginBottom:e.spacing[1],uni__dependencies:[0]},fieldLabel:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,textTransform:"uppercase",letterSpacing:.6,marginTop:e.spacing[1],uni__dependencies:[0]},fieldValue:{color:e.colors.foreground,fontSize:e.fontSize.xs,lineHeight:18,uni__dependencies:[0]},fieldDanger:{color:e.colors.destructive,uni__dependencies:[0]},composer:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],padding:e.spacing[2],borderTopWidth:1,borderTopColor:e.colors.border,uni__dependencies:[0]},composerInput:{flex:1,borderWidth:1,borderColor:e.colors.border,borderRadius:e.borderRadius.full,paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],color:e.colors.foreground,fontSize:e.fontSize.xs,uni__dependencies:[0]},composerSend:{minHeight:44,justifyContent:"center",paddingHorizontal:e.spacing[1],uni__dependencies:[0]},link:{color:e.colors.accent,fontSize:e.fontSize.xs,uni__dependencies:[0]},send:{borderWidth:1,borderColor:e.colors.accent,borderRadius:e.borderRadius["2xl"],paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],alignSelf:"flex-start",uni__dependencies:[0]},dim:{opacity:.35},pickList:{maxHeight:400},pickRow:{minHeight:44,flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingVertical:e.spacing[1],paddingHorizontal:e.spacing[1],borderWidth:1,borderColor:e.colors.border,borderRadius:e.borderRadius["2xl"],marginBottom:4,uni__dependencies:[0]},pickRowOn:{borderColor:e.colors.accent,uni__dependencies:[0]},pickMark:{width:22,alignItems:"center"},pickName:{color:e.colors.foreground,fontSize:e.fontSize.xs,fontWeight:"600",uni__dependencies:[0]},pickCrown:{paddingHorizontal:6,paddingVertical:4,justifyContent:"center"},pickAux:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,uni__dependencies:[0]},grow:{flex:1},empty:{flex:1,alignItems:"center",justifyContent:"center",padding:e.spacing[3],uni__dependencies:[0]}})),je=[{id:"whatsapp",label:"WhatsApp"},{id:"slack",label:"Slack"},{id:"email",label:"Email"}],Se=400;function ve(e){const t=[`${e.title} (${K(String(e.statusBucket))})`,e.digest?.summary??e.digest?.goal??"",e.digest?.nextStep?`Next: ${e.digest.nextStep}`:"",e.digest?.blockers?.length?`Blocked: ${e.digest.blockers.join("; ")}`:""].filter(e=>e.length>0).join("\n");return t.length>Se?`${t.slice(0,399)}\u2026`:t}const ke=[xe.fieldValue,xe.fieldDanger],we=[xe.sheetTitle,xe.sheetHeadTitle],Te=[xe.pickRow,xe.pickRowOn],Ce=[xe.verbWord,xe.verbWordDanger],Ie={include:[xe.tagChip,xe.tagChipOn],exclude:[xe.tagChip,xe.tagChipOff],neutral:xe.tagChip},De={selected:!0},Ve={selected:!1},ze=e=>e?De:Ve,Re=[xe.send,xe.dim],Le=[xe.background,xe.backgroundText],Pe={read:"caption",snooze:"snooze",share:"share",taco:"taco",options:"options"},Ae={consolidate:"consolidate",outsource:"share",automate:"automate"},$e=[{id:"hourly",label:"Every hour",everyMs:36e5},{id:"daily",label:"Every day",everyMs:864e5},{id:"weekly",label:"Every week",everyMs:6048e5}];function Oe(e,t){return O(t.dy)}function Me(e){return`${e.kind}: ${e.label??e.url}`}function Ee(){return Date.now()}function He(e){return e.recordAct}function We(e){return e.hydrated}function Be(e){return e.provider}function Fe(e){return e.session}function Ne(e){return{id:e.id,question:e.question}}function Ge(e){return e+1}function Ke(e){return e.session}},4568,[348,2838,349,2815,2476,4017,3516,350,36,140,616,252,591,659,649,25,546,182,234,571,146,558,56,811,3619,3442,3621,3618,4007,4009,4013,4016,4569,4014,4019,4570,4571,4572,4018,4574,4575,279]);
16328
16328
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ReelsPager",{enumerable:!0,get:function(){return p}});var e=r(d[0]),t=r(d[1]),n=r(d[2]);r(d[3]);var o,l=r(d[4]),s=(o=l)&&o.__esModule?o:{default:o};r(d[5]);var c=r(d[6]),u=r(d[7]),h=r(d[8]);const f={itemVisiblePercentThreshold:60};function b({data:o,keyExtractor:l,renderCard:u,onIndexChange:b,onEndReached:p,controllerRef:I,testID:R}){const{height:v}=(0,s.default)(),y=(0,n.useRef)(null),T=(0,c.useSafeAreaInsets)(),w=Math.max(1,v-T.top-T.bottom),C=(0,n.useMemo)(()=>[...o],[o]),M=(0,n.useMemo)(()=>[x.list,{paddingTop:T.top,paddingBottom:T.bottom}],[T.bottom,T.top]),E=(0,n.useRef)(b);E.current=b;const S=(0,n.useRef)(({viewableItems:e})=>{const t=e[0];null!=t?.index&&E.current(t.index)}).current,_=(0,n.useRef)(f).current;I&&(I.current={scrollToIndex:e=>{e>=0&&e<C.length&&y.current?.scrollToIndex({index:e,animated:!0})}});const P=(0,n.useCallback)((e,t)=>({length:w,offset:w*t,index:t}),[w]),j=(0,n.useMemo)(()=>({height:w}),[w]),k=(0,n.useCallback)(({item:t,index:n})=>(0,h.jsx)(e.View,{style:j,children:u(t,n,w)}),[w,j,u]);return(0,h.jsx)(t.FlatList,{ref:y,style:M,testID:R??"reels-pager",data:C,keyExtractor:l,renderItem:k,getItemLayout:P,pagingEnabled:!0,snapToInterval:w,snapToAlignment:"start",disableIntervalMomentum:!0,decelerationRate:"fast",showsVerticalScrollIndicator:!1,onViewableItemsChanged:S,viewabilityConfig:_,onEndReached:p,onEndReachedThreshold:.5,initialNumToRender:2,maxToRenderPerBatch:3,windowSize:5,removeClippedSubviews:!1})}const x=u.StyleSheet.create(()=>({list:{flex:1}})),p=(0,n.memo)(b)},4569,[348,2656,36,144,686,146,558,56,279]);
16329
16329
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shareUrlFor=I,e.consolidateSessions=f,e.useReelsVerbs=function(){const s=(0,t.c)(21),y=(0,n.useQueryClient)();let I;s[0]!==y?(I=t=>{y.invalidateQueries({queryKey:(0,o.agentHistoryQueryKey)(t)})},s[0]=y,s[1]=I):I=s[1];const v=I;let h;s[2]!==v?(h=async t=>{const{serverId:n,agentId:s}=t;await w(n).archiveAgent(s),v(n)},s[2]=v,s[3]=h):h=s[3];const b=h;let S;s[4]!==v?(S=async(t,n,s,o)=>{const{serverId:c,agentId:l}=t,u=await w(c).snoozeAgent(l,n,s,o);return v(c),u},s[4]=v,s[5]=S):S=s[5];const A=S;let $;s[6]!==v?($=async(t,n,s)=>{const{serverId:o,agentId:c}=t;await w(o).updateAgent(c,{labels:(0,l.buildLabelsForBucketMove)(s,n,u.useKanbanBoardStore.getState().defaultBucketId)}),v(o)},s[6]=v,s[7]=$):$=s[7];const k=$;let C;s[8]!==v?(C=async(t,n,s)=>{const{serverId:o,agentId:l}=t;await w(o).updateAgent(l,{labels:(0,c.buildLabelPatchForTagSet)(s,n)}),v(o)},s[8]=v,s[9]=C):C=s[9];const K=C;let _;s[10]!==v?(_=async(t,n,s,o)=>{const{serverId:c,agentId:l}=t;await w(c).scheduleCreate({prompt:s,name:o,cadence:{type:"every",everyMs:n},target:{type:"agent",agentId:l}}),v(c)},s[10]=v,s[11]=_):_=s[11];const x=_,B=p;let E;s[12]!==v?(E=async t=>{await f(t),v(t.serverId)},s[12]=v,s[13]=E):E=s[13];const F=E;let M;s[14]!==x||s[15]!==F||s[16]!==k||s[17]!==K||s[18]!==A||s[19]!==b?(M={terminate:b,snooze:A,consolidate:F,setKanban:k,setTags:K,automate:x,share:B},s[14]=x,s[15]=F,s[16]=k,s[17]=K,s[18]=A,s[19]=b,s[20]=M):M=s[20];return M};var t=r(d[0]);r(d[1]);var n=r(d[2]),s=r(d[3]),o=r(d[4]),c=r(d[5]),l=r(d[6]),u=r(d[7]),y=r(d[8]);function I(t,n){const s=encodeURIComponent(n);switch(t){case"whatsapp":return`https://wa.me/?text=${s}`;case"slack":return`slack://open?text=${s}`;case"email":return`mailto:?body=${s}`;default:return v(t)}}function v(t){throw new Error(`unhandled share target: ${String(t)}`)}function w(t){const n=(0,s.getHostRuntimeStore)().getClient(t);if(!n)throw new Error(`No client for server ${t}`);return n}async function f({serverId:t,winnerId:n,sourceIds:s}){const o=w(t);await o.consolidateAgents(n,s.filter(t=>t!==n))}async function p(t,n){await(0,y.openExternalUrl)(I(t,n))}},4570,[350,36,3030,3274,4015,4003,4008,4007,3577]);
16330
16330
  __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.feedKeyFor=o,e.useReelsFeed=function({sessions:c,localTags:u,actedLaps:S,laps:F,now:p}){const f=(0,i.useSessionFilterStore)(t=>t.clearFilters),v=(0,i.useSessionFilterStore)(t=>t.statusSelection),b=(0,i.useSessionFilterStore)(t=>t.tagSelection),k=(0,i.useSessionFilterStore)(t=>t.kanbanSelection),y=(0,i.useSessionFilterStore)(t=>t.providerSelection),C=(0,i.useSessionFilterStore)(t=>t.originSelection),h=(0,i.useSessionFilterStore)(t=>t.timeSelection),A=(0,i.useSessionFilterStore)(t=>t.timeField),M=(0,i.useSessionFilterStore)(t=>t.cycleStatusFilter),R=(0,i.useSessionFilterStore)(t=>t.cycleTagFilter),w=(0,i.useSessionFilterStore)(t=>t.cycleKanbanFilter),T=(0,i.useSessionFilterStore)(t=>t.cycleProviderFilter),L=(0,i.useSessionFilterStore)(t=>t.cycleOriginFilter),B=(0,i.useSessionFilterStore)(t=>t.toggleTimeWindow),O="archived"===A,P=O?null:h,_=[(0,s.isFilterSelectionActive)(v),(0,s.isFilterSelectionActive)(b),(0,s.isFilterSelectionActive)(k),(0,s.isFilterSelectionActive)(y),(0,s.isFilterSelectionActive)(C),null!==P],K=_.some(Boolean),j=_.filter(Boolean).length,x=(0,t.useCallback)(t=>(0,l.sessionPassesListFilter)({statusBucket:t.statusBucket,tags:[...t.tags],kanbanBucket:t.kanban,isArchived:!1,timeValue:"created"===A?t.createdAt:t.lastActivityAt,provider:t.provider,origin:t.origin,searchableText:""},{statusSelection:v,tagSelection:b,kanbanSelection:k,archivedMode:"all",timeSelection:P,providerSelection:y,originSelection:C,textQuery:""},p),[k,p,C,y,P,v,b,A]),W=(0,t.useMemo)(()=>K?c.filter(x):c,[K,x,c]),$=(0,t.useMemo)(()=>W.map(t=>Object.assign({},t,{tags:u[t.id]??t.tags,actedLap:S[t.id]??t.actedLap??null})),[S,W,u]),D=(0,t.useRef)(new Map),E=(0,t.useRef)(v),Q=(0,t.useRef)(b),V=(0,t.useRef)(k),q=(0,t.useRef)(y),z=(0,t.useRef)(C),G=(0,t.useRef)(P);E.current===v&&Q.current===b&&V.current===k&&q.current===y&&z.current===C&&G.current===P||(E.current=v,Q.current=b,V.current=k,q.current=y,z.current=C,G.current=P,D.current=new Map);const H=(0,t.useMemo)(()=>new Map($.map(t=>[t.id,t])),[$]),I=(0,t.useMemo)(()=>{const t=[];for(let i=1;i<=F;i+=1){let s=(D.current.get(i)??[]).map(t=>H.get(t)).filter(t=>void 0!==t);if(0===s.length){const t=(0,n.buildLap)({sessions:$,lap:i,now:p});t.length>0&&D.current.set(i,t.map(t=>t.id)),s=t}s.forEach((s,n)=>{t.push({session:s,lap:i,key:o(i,s.id),firstOfLap:0===n})})}return t},[H,$,F,p]),J=(0,t.useCallback)(t=>M(t),[M]),N=(0,t.useCallback)(t=>R(t),[R]),U=(0,t.useCallback)(t=>w(t),[w]),X=(0,t.useCallback)(t=>T(t),[T]),Y=(0,t.useCallback)(t=>L(t),[L]),Z=(0,t.useCallback)(t=>B(t),[B]);return{feed:I,activeFilters:j,statusSelection:v,tagSelection:b,kanbanSelection:k,providerSelection:y,originSelection:C,timeSelection:P,timeFieldDisarmed:O,onCycleStatus:J,onCycleTag:N,onCycleKanban:U,onCycleProvider:X,onCycleOrigin:Y,onToggleTimeWindow:Z,onClearFilters:f}};var t=r(d[0]),i=r(d[1]),s=r(d[2]),n=r(d[3]),l=r(d[4]);function o(t,i){return`${t}:${i}`}},4571,[36,3617,3622,4572,4573]);
@@ -16700,5 +16700,5 @@ __d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=r(d[0]),n=this&&this.__creat
16700
16700
  __r(694);
16701
16701
  __r(341);
16702
16702
  __r(0);
16703
- //# sourceMappingURL=/_expo/static/js/web/index-f10895609ae9a38a645e2380899e9238.js.map
16704
- //# debugId=538b2f45-387f-40da-9863-f36da6fd926f
16703
+ //# sourceMappingURL=/_expo/static/js/web/index-98fb0396dda5c1146d743e92ada27017.js.map
16704
+ //# debugId=680b4204-b846-487a-bdff-5ecfaf62dee2
@@ -191,6 +191,6 @@
191
191
  <body>
192
192
  <noscript>You need to enable JavaScript to run this app.</noscript>
193
193
  <div id="root"></div>
194
- <script src="/_expo/static/js/web/index-f10895609ae9a38a645e2380899e9238.js" defer></script>
194
+ <script src="/_expo/static/js/web/index-98fb0396dda5c1146d743e92ada27017.js" defer></script>
195
195
  </body>
196
196
  </html>
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperdrive.bot/fleet-server",
3
- "version": "0.3.125",
3
+ "version": "0.3.126",
4
4
  "description": "Paseo backend server",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -66,11 +66,11 @@
66
66
  "@agentclientprotocol/sdk": "^0.17.1",
67
67
  "@anthropic-ai/claude-agent-sdk": "^0.3.195",
68
68
  "@anthropic-ai/sdk": "^0.104.2",
69
- "@hyperdrive.bot/fleet-client": "0.3.125",
70
- "@hyperdrive.bot/fleet-extension-sdk": "0.3.125",
71
- "@hyperdrive.bot/fleet-highlight": "0.3.125",
72
- "@hyperdrive.bot/fleet-protocol": "0.3.125",
73
- "@hyperdrive.bot/fleet-relay": "0.3.125",
69
+ "@hyperdrive.bot/fleet-client": "0.3.126",
70
+ "@hyperdrive.bot/fleet-extension-sdk": "0.3.126",
71
+ "@hyperdrive.bot/fleet-highlight": "0.3.126",
72
+ "@hyperdrive.bot/fleet-protocol": "0.3.126",
73
+ "@hyperdrive.bot/fleet-relay": "0.3.126",
74
74
  "@isaacs/ttlcache": "^2.1.4",
75
75
  "@modelcontextprotocol/sdk": "^1.20.1",
76
76
  "@opencode-ai/sdk": "1.2.6",