@standards/schema 1.0.0-alpha.398 → 1.0.0-alpha.401

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/{all-C3V2oDah.d.ts → all-CJC6e6AY.d.ts} +70 -70
  2. package/dist/{all-Bzuyzn0y.d.mts → all-XirVn9fd.d.mts} +70 -70
  3. package/dist/api/index.d.mts +116 -41
  4. package/dist/api/index.d.ts +116 -41
  5. package/dist/api/index.js +1 -1
  6. package/dist/api/index.mjs +1 -1
  7. package/dist/{attributes-CEy-sr1b.d.ts → attributes-BOIIZZpP.d.ts} +1 -1
  8. package/dist/{attributes-PtyzCNdA.d.mts → attributes-CAYOHQLt.d.mts} +1 -1
  9. package/dist/{checkbox-Bgp12QeV.d.mts → checkbox-RJEhZTDu.d.mts} +2 -2
  10. package/dist/{checkbox-DCvuizKx.d.ts → checkbox-UJEOyMLV.d.ts} +2 -2
  11. package/dist/{date-Dvks0Jqf.d.mts → date-jqgfgslv.d.mts} +2 -2
  12. package/dist/{date-Daz2i15C.d.ts → date-rwqgadEE.d.ts} +2 -2
  13. package/dist/{exceptions-AVu3tJBr.d.mts → exceptions-RCZEE1uQ.d.mts} +1 -1
  14. package/dist/{exceptions-AVu3tJBr.d.ts → exceptions-RCZEE1uQ.d.ts} +1 -1
  15. package/dist/exceptions.d.mts +1 -1
  16. package/dist/exceptions.d.ts +1 -1
  17. package/dist/{index-CvoBIJEF.d.mts → index-BC5mEVkb.d.mts} +3 -3
  18. package/dist/{index-BJL0V8-3.d.mts → index-Bw0zjY3f.d.mts} +3 -3
  19. package/dist/{index-C4ks8JXC.d.ts → index-CFXgKvOC.d.ts} +1 -1
  20. package/dist/{index-Co6Zb9_f.d.mts → index-CiKELB3w.d.mts} +1 -1
  21. package/dist/{index-B95x_MOr.d.mts → index-CmN1rtc7.d.ts} +226 -66
  22. package/dist/{index-BuhHJbT0.d.ts → index-DMBl9Ahc.d.ts} +3 -3
  23. package/dist/{index-n2TGzmAL.d.ts → index-DXQ3f3MJ.d.ts} +3 -3
  24. package/dist/{index-C-JZ5QKG.d.ts → index-hNOD7QsR.d.mts} +226 -66
  25. package/dist/index.d.mts +14 -14
  26. package/dist/index.d.ts +14 -14
  27. package/dist/index.js +1 -1
  28. package/dist/index.mjs +1 -1
  29. package/dist/{number-D6_fHzO7.d.ts → number-CfG_k0mZ.d.ts} +2 -2
  30. package/dist/{number-HpdoQfMD.d.mts → number-DYkxcIqq.d.mts} +2 -2
  31. package/dist/{objects-DOuyTqUJ.d.ts → objects-Dc4zYk9o.d.ts} +2 -2
  32. package/dist/{objects-Cw0TaEYN.d.mts → objects-Dmn8ZIXZ.d.mts} +2 -2
  33. package/dist/{record-operation-BP69nfIq.mjs → record-operation-BIBY_2rB.mjs} +1 -1
  34. package/dist/{record-operation-BU_PIu6m.js → record-operation-D40yG3EC.js} +1 -1
  35. package/dist/{text-BQGr0wRj.d.ts → text-BkLwT1XH.d.ts} +2 -2
  36. package/dist/{text-B4o5rotA.d.mts → text-DkZ-_8Qs.d.mts} +2 -2
  37. package/dist/{utils-BzfypXEw.d.ts → utils-Brab7BhE.d.ts} +1 -1
  38. package/dist/{utils-DLPt-jMf.d.mts → utils-C8viP5ET.d.mts} +1 -1
  39. package/dist/utils.d.mts +1 -1
  40. package/dist/utils.d.ts +1 -1
  41. package/dist/validation/all.d.mts +4 -4
  42. package/dist/validation/all.d.ts +4 -4
  43. package/dist/validation/all.js +1 -1
  44. package/dist/validation/all.mjs +1 -1
  45. package/dist/validation/complex/currency.d.mts +2 -2
  46. package/dist/validation/complex/currency.d.ts +2 -2
  47. package/dist/validation/complex/location.d.mts +2 -2
  48. package/dist/validation/complex/location.d.ts +2 -2
  49. package/dist/validation/complex/phone.d.mts +2 -2
  50. package/dist/validation/complex/phone.d.ts +2 -2
  51. package/dist/validation/complex/relation.d.mts +2 -2
  52. package/dist/validation/complex/relation.d.ts +2 -2
  53. package/dist/validation/complex/richtext.d.mts +2 -2
  54. package/dist/validation/complex/richtext.d.ts +2 -2
  55. package/dist/validation/complex/select.d.mts +2 -2
  56. package/dist/validation/complex/select.d.ts +2 -2
  57. package/dist/validation/complex/user.d.mts +2 -2
  58. package/dist/validation/complex/user.d.ts +2 -2
  59. package/dist/validation/computed/formula.d.mts +2 -2
  60. package/dist/validation/computed/formula.d.ts +2 -2
  61. package/dist/validation/computed/rollup.d.mts +2 -2
  62. package/dist/validation/computed/rollup.d.ts +2 -2
  63. package/dist/validation/config/index.d.mts +1 -1
  64. package/dist/validation/config/index.d.ts +1 -1
  65. package/dist/validation/core/index.d.mts +1 -1
  66. package/dist/validation/core/index.d.ts +1 -1
  67. package/dist/validation/object/index.d.mts +1 -1
  68. package/dist/validation/object/index.d.ts +1 -1
  69. package/dist/validation/primitives/checkbox.d.mts +1 -1
  70. package/dist/validation/primitives/checkbox.d.ts +1 -1
  71. package/dist/validation/primitives/date.d.mts +1 -1
  72. package/dist/validation/primitives/date.d.ts +1 -1
  73. package/dist/validation/primitives/number.d.mts +1 -1
  74. package/dist/validation/primitives/number.d.ts +1 -1
  75. package/dist/validation/primitives/text.d.mts +1 -1
  76. package/dist/validation/primitives/text.d.ts +1 -1
  77. package/dist/view-config.schema-B9y7-OCJ.mjs +2 -0
  78. package/dist/view-config.schema-Cyl6PedI.js +2 -0
  79. package/package.json +2 -2
  80. package/dist/view-config.schema-BSQWl5PY.js +0 -2
  81. package/dist/view-config.schema-Ch25LHlK.mjs +0 -2
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- import{ACTIONABLE_NOTIFICATION_KINDS as e,AGGREGATE_BUCKETS as t,AGGREGATE_MEASURES as n,MAX_AGGREGATE_GROUPS as r,NOTIFICATION_CHANNELS as i,NOTIFICATION_INBOX_STATES as a,NOTIFICATION_KINDS as o,NOTIFICATION_PRIORITIES as s,NOTIFICATION_PRIORITY_RANK as c,NOTIFICATION_SENSITIVITIES as l,NOTIFICATION_SETTINGS_AREAS as u,NOTIFICATION_SUBJECT_TYPES as d,NOTIFICATION_TYPES_V1 as f,NOTIFICATION_TYPE_ACCESS_GRANTED as p,NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED as m,NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_FAILED as ee,NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_NOTICE as te,NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN as ne,NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED as re,NOTIFICATION_TYPE_CONNECTOR_CONNECTION_ERROR as ie,NOTIFICATION_TYPE_CONNECTOR_CONNECTION_REAUTH_REQUIRED as ae,NOTIFICATION_TYPE_KINDS as h,NOTIFICATION_TYPE_RECORD_ASSIGNED as oe,NOTIFICATION_TYPE_RECORD_MENTIONED as se,NOTIFICATION_WORK_STATES as ce,isActionableNotificationKind as le}from"./record-aggregates-DY8qLwuF.mjs";import{AGENDA_BLOCK as g,ARTIFACT_PREVIEW_EXTENSION as ue,ATTRIBUTE_FILTER_OPERATORS as de,ATTRIBUTE_TYPES as fe,BLOCK_CONTEXTS as pe,BLOCK_PERIODS as me,BLOCK_WIDTHS as _,CARD_BLOCK as v,CHART_BLOCK as y,CHART_KINDS as he,CONTENT_PLACEMENT_CONTEXTS as ge,DEFAULT_LAYOUT_TRAITS as _e,GROUPABLE_ATTRIBUTE_TYPES as ve,HEADING_BLOCK as ye,INBOX_BLOCK as be,INVENTORY_LIMIT as xe,LOCATION_FILTER_PROPERTIES as Se,MAILBOX_BLOCK as Ce,MEASURABLE_ATTRIBUTE_TYPES as we,MEETINGS_UPCOMING_BLOCK as Te,METRIC_BLOCK as b,NATIVE_BLOCKS as Ee,NO_VALUE_OPERATORS as De,OPERATORS_BY_TYPE as Oe,PAGE_GRID_COLUMNS as ke,QUALIFIED_SEPARATOR as Ae,QUERY_OBJECT as je,RECORD_LINKS_BLOCK as Me,RECORD_LINKS_CONTENT as x,RECORD_OBJECT as Ne,RELATION_TARGET_ANY as Pe,REMOVED_OPERATOR_REPLACEMENTS as Fe,RecordQuery as Ie,SYNONYM_ALIASES as Le,SYSTEM_ATTRIBUTES as Re,SYSTEM_ATTRIBUTE_I18N_KEYS as ze,SYSTEM_FILTER_ATTRIBUTE_TYPES as Be,TEXT_BLOCK as S,attributeFilterTarget as Ve,attributeInventory as He,blockObjectInputs as Ue,buildQualifiedAttribute as We,canonicalizeFilterValue as Ge,capped as Ke,collectContentViewCatalogue as qe,collectQualifiedRuleIssues as Je,collectionContentSourceSchema as Ye,collectionSourceAddress as Xe,collectionSourceAddressOf as Ze,columnsSchema as Qe,contentExtensionRegistry as C,contentReadObjects as $e,contentViewDefinitionSchema as w,contentViewDefinitionSchemaFor as et,currentActor as tt,defineBlock as nt,describeViewIssue as rt,displayAttributesSchema as it,draftContentViewDefinitionSchema as at,draftContentViewDefinitionSchemaFor as ot,edgePropertyFilterTarget as st,extractCurrencyFilterValue as ct,extractFilterValue as lt,filterOperatorsOfType as ut,filterStateSchema as dt,filterTargetsOf as ft,findGridViolation as pt,findGroupViolation as mt,findLayoutRuleViolation as ht,findRelationAttribute as gt,findRowLimitViolation as _t,getAttributeCapabilities as vt,getAttributeFilterOperators as yt,getOperatorPolarity as bt,getRollupFilterOperators as xt,getSystemAttributeI18nKey as St,getSystemAttributeList as Ct,gridPositionSchema as wt,groupSizeMessage as Tt,groupedMembers as Et,inferInverseCardinality as Dt,input as Ot,invalidViewMessage as kt,isAttributeFilterable as At,isAttributeGroupable as jt,isAttributeKanbanGroupable as Mt,isAttributeSearchable as Nt,isAttributeSortable as Pt,isBilateralRelation as Ft,isCalendarDay as It,isDynamicValue as Lt,isLocationFilterProperty as Rt,isLocationPartOperator as zt,isManagedSystemAttribute as Bt,isNoValueOperator as Vt,isRelativeDateValue as Ht,isSetMembershipOperator as Ut,isUniversalRelation as Wt,layoutTraitsOf as Gt,locationPartFilterTarget as Kt,memberlessGroups as qt,metricComparePeriod as Jt,normalizeFilterRule as Yt,normalizeForEdgeRpc as Xt,normalizeOperator as Zt,now as Qt,overlaps as $t,pageTraitsOf as en,parseBlockParameters as T,parseQualifiedAttribute as tn,publishedViewContentDefinitionSchema as E,query as nn,recordQueryDefinitionSchema as rn,relationAcceptsObject as an,relationTargetsOf as on,requireContentPlacement as sn,requireRecordContentContext as cn,requireSingleRelationTarget as ln,resolveCollectionActions as un,resolveContentNavigation as dn,resolveEffectiveFilterType as fn,resolveIsWithinBounds as pn,resolveUtcDayBounds as mn,singleRelationTarget as hn,sortsSchema as gn,sourcedAttributeOf as _n,systemColumnFilterTarget as vn,toMultiValueOperator as yn,toUtcDayString as bn,today as xn,validateContentViewCatalogue as Sn,validateQualifiedRule as Cn,validateStoredViews as wn}from"./view-config.schema-Ch25LHlK.mjs";import{AccessDeniedError as Tn,AggregateValidationError as En,AmbiguousSchemaChangeError as Dn,AttributeInUseError as On,AttributeNotFoundError as kn,ConcurrentModificationError as An,DuplicateError as D,ExportTooLargeError as jn,ForbiddenError as Mn,InvalidPermissionGrantError as Nn,LogoProviderUnavailableError as Pn,LogoSearchRateLimitedError as Fn,MemoryNotFoundError as In,NotFoundError as Ln,NotImplementedError as Rn,ObjectNotFoundError as zn,ObjectReferencedError as Bn,OrphanSystemAttributeError as Vn,PageReferencedError as Hn,ProtectedResourceError as Un,ProtectedRoleError as Wn,QueryTimeoutError as Gn,RealtimeDeliveryError as Kn,RealtimeRateLimitedError as qn,RealtimeSubscriptionError as Jn,RecordNotFoundError as Yn,RecordReferencedError as Xn,RepositoryError as Zn,ReservedObjectNameError as O,RoleNotFoundError as Qn,SchemaError as k,SchemaErrorCode as A,SearchBackendError as $n,SearchPathNotIndexedError as er,StorageError as tr,SyncCascadeError as nr,SyncConflictError as rr,SyncError as ir,SystemEntityImmutableError as ar,ToolGroupGrantError as or,ValidationError as j,WorkspaceInvariantReason as sr,isAttributeInUseError as cr,isNotFoundError as lr,isObjectReferencedError as ur,isProtectedResourceError as dr,isRecordReferencedError as fr,isSchemaError as pr,isValidationError as mr}from"./exceptions.mjs";import{ACCESS_LEVELS as hr,ACCESS_ROLES as gr,AGENT_ASIDE_ANSWER_MAX_LENGTH as _r,AGENT_ASIDE_HISTORY_LIMIT as vr,AGENT_ASIDE_QUESTION_MAX_LENGTH as yr,AGENT_AVATAR_EXPRESSIONS as br,AGENT_AVATAR_TYPES as xr,AGENT_MESSAGE_KIND as Sr,AGENT_NOTIFICATION_KIND as Cr,AGENT_SESSION_LIST_ORDERS as wr,AGENT_SESSION_ORIGINS as Tr,AGENT_STARTERS_MAX as Er,AGENT_STARTER_MAX_LENGTH as Dr,AGENT_TASK_KINDS as Or,ALL_CATALOG_TOOL_NAMES as kr,ALWAYS_KINDS as Ar,APPROVAL_FAMILY_TOOL_NAMES as jr,ARCHITECT_PUBLICATION_KIND as Mr,ASK_QUESTIONS_ANSWER_MAX_LENGTH as Nr,ASK_QUESTIONS_ANSWER_MAX_VALUES as Pr,ASK_QUESTIONS_MAX_BATCH as Fr,ASK_QUESTIONS_TOOL_NAME as Ir,AUDIT_ACTIONS as Lr,AUDIT_AGENT_SESSION_METADATA_KEY as Rr,AUDIT_RESOURCE_TYPES as zr,AgentBuilder as M,BROWSER_LAUNCH_TOOL_NAME as Br,BUNDLE_LOCALES as Vr,CONNECTION_GRANT_PROVIDERS as Hr,CONTINUATION_KEY_PATTERN as Ur,CONVERSATION_SURFACES as Wr,CORE_RECORD_TOOL_NAMES as Gr,CORE_TOOL_NAMES as Kr,COUNT_MODES as qr,DEFAULT_AGENT_EXECUTION_CONFIG as Jr,DEFAULT_AGENT_TOOL_GROUPS as Yr,DEFAULT_APPROVAL_POLICY as Xr,DEFAULT_BLUEPRINT_TOOL_GROUPS as Zr,DEFAULT_DAILY_ACTIVITY_DAYS as Qr,DEFAULT_MEETING_BOT_DISPLAY_NAME as $r,DEFAULT_TENANT_SETTINGS as ei,DISCARD_ARCHITECT_DRAFT_TOOL_NAME as ti,DOCUMENT_SORT_MODES as ni,DRAFT_WRITE_TOOL_NAMES as ri,EMAIL_CATEGORY_DEFAULT_COLOR as ii,EMAIL_CATEGORY_DEFAULT_ICON as ai,EMAIL_CATEGORY_DESCRIPTION_MAX as oi,EMAIL_CATEGORY_DESCRIPTION_MIN as si,EMAIL_CATEGORY_LIMIT as ci,EMAIL_CATEGORY_NAME_MAX as li,ENVIRONMENT_HARNESSES as ui,ENVIRONMENT_HARNESS_SANDBOX_WORKDIR as di,ENVIRONMENT_HARNESS_WORKDIR as fi,ENVIRONMENT_NAME_MAX_CHARS as pi,ENVIRONMENT_STANDARDS_WORKDIR as mi,ENV_VAR_KEY_PATTERN as hi,ESTIMATED_COUNT_CAP as gi,FILE_URLS_MAX_IDS as _i,GET_ARCHITECT_DRAFT_TOOL_NAME as vi,GITHUB_TRIGGER_CATALOG as yi,GRANT_ENABLES as bi,HITL_TOOL_NAMES as xi,INFERENCE_REASONING_OPTIONS as Si,INFERENCE_ROUTING_MODES as Ci,INFERENCE_SPEEDS as wi,LAST_RUN_ERROR_MAX_LENGTH as Ti,MAILBOX_LIST_MODES as Ei,MAIL_DRAFT_BODY_MAX_CHARS as Di,MAIL_SIGNATURE_MAX_CHARS as Oi,MAIL_SUBJECT_MAX_CHARS as ki,MAX_DAILY_ACTIVITY_DAYS as Ai,MAX_TODOS as ji,MAX_TODO_DESCRIPTION_CHARS as Mi,MAX_TODO_ID_CHARS as Ni,MCP_SERVER_NAME_MAX_LENGTH as Pi,MEETING_BOT_IMAGE as Fi,MEETING_BOT_IMAGE_BASE64_MAX_LENGTH as Ii,MEETING_RESPONSES as Li,MEMORY_SPEND_LIMIT_PATTERN as Ri,McpOAuthCompletionMode as zi,NATIVE_TOOL_GROUPS as Bi,NATIVE_TOOL_GROUP_CATALOG as Vi,NO_RECORDING as Hi,OPEN_TOOL_PART_STATES as Ui,OPERATION_MAX_STEPS as Wi,PROVIDER_DRAFT_LABEL as Gi,PROVIDER_NAMES as Ki,PUBLIC_MAIL_DOMAINS as qi,QUESTION_FAMILY_TOOL_NAMES as Ji,RECENT_ACTIVITY_LEDGER_LIMIT as Yi,RECORDING_OVERRIDES as Xi,RECORDING_POLICIES as Zi,RECORD_ACCESS_ROLES as Qi,RECORD_ACCESS_SOURCES as $i,RECORD_DRIVE_CURSOR_MAX_LENGTH as ea,RECORD_DRIVE_PAGE_DEFAULT_LIMIT as ta,RECORD_DRIVE_PAGE_MAX_LIMIT as na,RECORD_GRAPH_DEFAULT_LIMIT_PER_NODE as ra,RECORD_GRAPH_MAX_LIMIT_PER_NODE as ia,RECORD_GRAPH_MAX_NODES as aa,RECORD_IMAGE_MAX_BYTES as oa,REPLY_MODES as sa,REQUEST_DESIGN_REVIEW_TOOL_NAME as ca,REQUEST_SETUP_TOOL_NAME as la,RESOURCE_GRANT_KINDS as ua,RESOURCE_KIND_CATALOG as da,ROUTING_PRICE_CEILINGS as fa,SESSION_INFERENCE_PATCH_KEYS as pa,SETUP_SCRIPT_MAX_CHARS as ma,SLACK_TRIGGER_CATALOG as ha,SURFACE_TOOL_NAMES as ga,SYSTEM_EMAIL_CATEGORIES as _a,SYSTEM_EMAIL_CATEGORY_NAMES as va,SYSTEM_PART_CODES as ya,TASK_DEMAND_LEVELS as ba,TODO_PHASES as xa,TODO_PLAN_STATUSES as Sa,TODO_STATUSES as Ca,TOOL_APPROVAL_STATES as wa,TRIAGE_ACTIONS as Ta,TRIGGER_EVENT_TYPES as Ea,TURN_OUTCOMES as Da,UNSHAREABLE_OBJECT_NAMES as Oa,USER_STATUSES as ka,USER_WORK_POSTURES as Aa,VERB_NAMES as ja,agent as Ma,agentAvatarFromMetadata as Na,agentAvatarSchema as Pa,agentDataChunk as Fa,agentDisplayName as Ia,agentInferencePreferencesSchema as La,agentMessageAttachmentSchema as Ra,agentMessagePartSchema as za,agentScheduleSchema as Ba,agentSessionInferenceOverridesInputSchema as Va,agentSessionInferenceOverridesSchema as Ha,agentSessionMessageSchema as Ua,agentStartersSchema as Wa,agentTriggerBaseSchema as Ga,agentTriggerPatchSchema as Ka,agentTriggerSchema as qa,agentUIValidationError as Ja,artifactQuoteSchema as Ya,askQuestionsOutputSchema as Xa,assertCustomAgentUIMessageChunk as Za,assertSessionState as Qa,canonicalToolGroups as $a,classificationRestoreSchema as eo,classifyEmailSchema as to,cliDefaultModelOf as no,compareAgentSessionMessages as ro,compiledHarnessModels as io,connectionGrantKindsOf as ao,connectorTriggerMatchSchema as oo,customDataChunkSchemas as so,deriveViewerAccess as co,durableDateSchema as lo,emailCategoryCreateSchema as uo,emailCategoryDeleteSchema as fo,emailCategoryScopeQuerySchema as po,emailCategoryUpdateSchema as mo,emailRuleScopeSchema as ho,environmentHarness as go,environmentWorkdir as _o,findEnvironmentHarness as vo,githubConditionSchema as yo,githubTriggerMatchSchema as bo,grantKindOf as xo,harnessModelChoices as So,humanRequestId as Co,humanRequestKind as wo,imageModelIdSchema as To,inferenceReasoningSchema as Eo,inferenceRoutingSchema as Do,inferenceSpeedSchema as Oo,isAgentMessageMetadata as ko,isAgentNotificationMetadata as Ao,isAgentUIDataName as jo,isAgentWrittenAuditEntry as Mo,isArchitectPublicationMetadata as No,isAwaitingHuman as Po,isBlocking as Fo,isEnvironmentHarnessId as Io,isMailProvider as Lo,isMailboxListMode as Ro,isNativeToolGroup as zo,isOpenToolPartState as Bo,isParkedOnHuman as Vo,isProviderDraft as Ho,isPublicMailDomain as Uo,isReplyMode as Wo,isResourceGrant as Go,isRoutineActorMetadata as Ko,isSessionInferencePatch as qo,isSystemEmailCategory as Jo,isSystemEmailCategoryName as Yo,isSystemPartCode as Xo,isToolApprovalState as Zo,meetingBotDispatchRequestSchema as Qo,meetingBotDispatchResponseSchema as $o,meetingBotNotificationSchema as es,meetingTranscriptSegmentSchema as ts,mentionReferenceSchema as ns,mergeSessionInferencePatch as rs,modelDefinitionSchema as is,modelReferenceSchema as as,needsManageWhenUnattended as os,normalizedMeetingTranscriptSchema as ss,openRequests as cs,orderAgentSessionMessages as ls,parseAgentDefinitionAccessRole as us,parseCountMode as ds,parseMergedAgentTrigger as fs,parseOptionalCountMode as ps,parsePageAccessRole as ms,parseRecordAccessRole as hs,parseToolGroupGrant as gs,providerNameSchema as _s,readAskQuestionsResult as vs,recentActivityEntryKey as ys,recordGraphNodeKey as bs,recordGraphRequestSchema as xs,recordOperationSchema as Ss,refineTrigger as Cs,resourceGrant as ws,routedMessageInferenceSchema as Ts,sessionInferencePatchSchema as Es,slackConditionSchema as Ds,slackTriggerMatchSchema as Os,todoItemSchema as ks,todoPlanSchema as As,toolImpactSchema as js}from"./record-operation-BP69nfIq.mjs";import"./zod-locale.mjs";import{ATTRIBUTE_NAME_SCHEMA as Ms,LIST_VIEW_TAB_VISIBILITIES as Ns,NATIVE_OBJECT_NAMES as Ps,OBJECT_NAME_SCHEMA as Fs,RECORD_LIST_SCOPES as Is,RESERVED_ATTRIBUTE_NAMES as Ls,RESERVED_OBJECT_NAMES as Rs,RESOURCE_VISIBILITIES as zs,SCHEMA_LIMITS as N,SYSTEM_FIELD_NAMES as Bs,assertUniqueBy as Vs,colorIdSchema as Hs,iconNameSchema as P,isNativeObjectName as Us,isPlainRecord as Ws,parseRecordListScope as Gs,parseResourceVisibility as Ks,validateAttributeName as qs,validateIconName as Js,validateLabel as Ys,validateObjectName as Xs,validateOptions as F,validateViewName as Zs}from"./primitives-D9A6pmXV.mjs";import{COMPUTED_RETURN_TYPES as Qs,SIMPLE_PROPERTY_TYPES as $s,WIRE_OFFERED_BASE_CONFIG as ec,WIRE_OMITTED_CONFIG_KEYS as tc,attributeConfigSchemas as nc,datePrecisionIssues as rc,getAttributeConfigSchema as ic,getAttributeConfigWriteSchema as ac,multiselectOptionWriteSchema as oc,parseAttributeConfig as sc,parseAttributeConfigForCreate as cc,parseAttributeConfigForUpdate as lc,propertyAttributeSchema as uc,propertyAttributeWireSchema as dc,propertySchemaSchema as fc,propertySchemaWireSchema as pc,refuseForeignKeys as mc,selectOptionWriteSchema as hc,statusGroupSchema as gc,statusOptionWriteSchema as _c,wireHiddenTypeConfigMask as vc,wireOmittedConfigKeysFor as yc,withoutUnknownOptionKeys as bc}from"./config-DqidiszP.mjs";import{NonJsonValueError as xc,asTenantId as Sc,asUserId as Cc,canonicalStringify as I,deepEqual as wc,generateId as Tc,indexBy as Ec,sameStableValue as Dc,serializeCanonicalJson as Oc,serializeStableJson as kc}from"./utils-DaejNWxh.mjs";import{createAttributeValidator as Ac,createFormAttributeValidator as jc,createObjectValidator as Mc,isEmptyValue as Nc,isNullishOrEmptyString as Pc,isValuePresent as Fc,rejectUnknownAttributesOrThrow as Ic,validateAttribute as Lc,validateDraft as Rc,validateDraftOrThrow as zc,validateObject as Bc,validateObjectOrThrow as Vc}from"./object-BF5y6bgs.mjs";import{TEXT_FORMAT_PATTERNS as Hc,createTextValidator as Uc,resolveTextPattern as Wc}from"./text-BaxaZ5Vv.mjs";import{DEFAULT_VALIDATION_MESSAGES as Gc,formatZodErrors as Kc}from"./core-rKI7Q9_U.mjs";import{createNumberValidator as qc}from"./validation/primitives/number.mjs";import{createCheckboxValidator as Jc}from"./validation/primitives/checkbox.mjs";import{createDateValidator as Yc}from"./validation/primitives/date.mjs";import{formatPhoneForDisplay as Xc,getIso2 as Zc,normalizeCountrylessPhoneNumber as Qc,normalizePhoneNumber as $c}from"./phone-BGJea5sr.mjs";import*as L from"zod";import{colorIdFromString as el,getCountryByIso2 as tl,isValidCurrencyCode as nl,isValidIso3 as rl}from"@standards/constants";import{parsePhoneNumberFromString as il}from"libphonenumber-js";const al=`__stndrdsNativeUiPartIds`,ol=1;function invalidNativePartIds(){throw new j(`Native agent UI part IDs metadata is invalid`,[])}function isPlainRecord$1(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function nativeAgentUIPartIdMetadataKey(e,t){if(e.type===`text`||e.type===`reasoning`)return`${e.type}:${t}`;if(e.type===`tool`)return`tool:${e.toolCallId}`}function parseNativeAgentUIPartIdsMetadata(e){let t=e.metadata?.[al];isPlainRecord$1(t)||invalidNativePartIds(),(Object.keys(t).length!==2||t.schemaVersion!==1||!isPlainRecord$1(t.partIds))&&invalidNativePartIds();let n=new Map;for(let[t,r]of e.parts.entries()){let e=nativeAgentUIPartIdMetadataKey(r,t);if(!e||n.has(e)){e&&invalidNativePartIds();continue}n.set(e,r)}let r=Object.entries(t.partIds);r.length!==n.size&&invalidNativePartIds();let i=new Map,a={};for(let[e,t]of r){let r=n.get(e);r&&typeof t==`string`&&t.length>0||invalidNativePartIds();let o=i.get(t);o&&(r.type===`tool`||o!==r.type)&&invalidNativePartIds(),r.type===`tool`&&t!==r.toolCallId&&invalidNativePartIds(),i.set(t,r.type),a[e]=t}return a}const sl=`/v1/device-worker/channel`,cl=262144,ll=15e4,ul=1e4,dl=2e3,fl=2e3,pl=2e4,ml=4008,hl={initialMs:1e3,maxMs:3e4};function deviceChannelUrl(e){let t=new URL(e);return`${t.protocol===`https:`?`wss:`:`ws:`}//${t.host}${sl}`}function computeRetryDelay(e,t,n){return Math.min(n.initialMs*2**e,n.maxMs)+Math.floor(t()*250)}function computeReconnectDelay(e,t=Math.random){return computeRetryDelay(e,t,hl)}const gl=[`worker_disconnected`,`cancelled`,`timed_out`,`execution_failed`,`stale_reference`,`tab_unavailable`,`debugger_unavailable`,`blocked_by_user`,`not_actionable`,`javascript_error`,`batch_cap_exceeded`,`no_reference_screenshot`],_l=`UPGRADE_REQUIRED`;var DeviceChannelProtocolError=class extends k{constructor(e){super(e,A.DEVICE_CHANNEL_PROTOCOL),this._tag=`DeviceChannelProtocolError`,this.name=`DeviceChannelProtocolError`}};const R={id:L.uuid(),leaseToken:L.string().min(1)},vl=L.record(L.string(),L.unknown());function defineDeviceChannelFrames(e){return{worker:L.discriminatedUnion(`type`,[L.strictObject({type:L.literal(`authenticate`),credential:L.string().regex(/^(Device|Bearer) \S+$/),protocol:L.number().int().positive().optional()}),L.strictObject({type:L.literal(`running`),...R}),L.strictObject({type:L.literal(`heartbeat`),...R}),L.strictObject({type:L.literal(`output`),...R,stdout:L.string().optional(),stderr:L.string().optional()}),L.strictObject({type:L.literal(`complete`),...R,result:L.strictObject({stdout:L.string().optional(),stderr:L.string().optional(),exitCode:L.number().int(),success:L.boolean(),errorCode:L.enum(gl).optional(),result:e.result.optional()})}),L.strictObject({type:L.literal(`pong`)})]),server:L.discriminatedUnion(`type`,[L.strictObject({type:L.literal(`ready`),device:L.strictObject({id:L.string(),name:L.string(),capability:L.enum([`shell`,`browser`])}),protocol:L.number().int().positive().optional()}),L.strictObject({type:L.literal(`command`),...R,kind:L.enum([`shell`,`browser`]),intent:L.string(),timeoutMs:L.number().int(),command:L.string().optional(),cwd:L.string().nullable().optional(),action:e.action.optional()}),L.strictObject({type:L.literal(`cancel`),id:L.uuid(),reason:L.enum([`cancelled`,`timed_out`,`revoked`])}),L.strictObject({type:L.literal(`reauthenticate`)}),L.strictObject({type:L.literal(`revoked`)}),L.strictObject({type:L.literal(`ping`)})])}}const yl=defineDeviceChannelFrames({action:vl,result:vl}),bl=yl.worker,xl=yl.server;function parseDeviceChannelFrame(e,t){let n;try{n=JSON.parse(t)}catch{throw new DeviceChannelProtocolError(`Frame is not JSON`)}let r=e.safeParse(n);if(!r.success)throw new DeviceChannelProtocolError(`Frame does not match the channel protocol`);return r.data}function parseWorkerFrame(e){return parseDeviceChannelFrame(bl,e)}function parseServerFrame(e){return parseDeviceChannelFrame(xl,e)}const Sl=5;function isFormDefinition(e){return typeof e==`object`&&!!e&&`slots`in e&&`steps`in e&&`name`in e&&typeof e.name==`string`&&Array.isArray(e.slots)&&Array.isArray(e.steps)}const z=[`relation`,`multiRelation`,`formula`,`rollup`,`document`,`richtext`,`user`];function isFormSlotFieldRef(e){return e.type===`slot`}function isFormFreeFieldRef(e){return e.type===`free`}function resolveFieldRequired(e){return e.readOnly===!0?!1:e.fieldRequired===void 0?e.slotMode===`create`&&e.attributeRequired===!0:e.fieldRequired}function getSlotFieldTargets(e){return e.additionalSlotIds?.length?[e.slotId,...e.additionalSlotIds]:[e.slotId]}function formFieldKey(e){return isFormSlotFieldRef(e)?`${e.slotId}.${e.attribute}`:`free.${e.attribute.name}`}function formFieldFlatKey(e){return isFormSlotFieldRef(e)?e.attribute:e.attribute.name}function readFormFieldValue(e,t){return e[formFieldKey(t)]??e[formFieldFlatKey(t)]}function isFormFieldsRow(e){return e.type===`fields`}function isFormHeadingRow(e){return e.type===`heading`}function isFormSeparatorRow(e){return e.type===`separator`}function isFormTextRow(e){return e.type===`text`}function resolvePropertyDefinitions(e){let t=e.properties;if(!t)return[];if(Array.isArray(t))return t;let n=t;return Array.isArray(n.definitions)?n.definitions:[]}function hasOptions(e){return e.type===`select`||e.type===`status`||e.type===`multiselect`}function schemaGroupKey(e){return`${e.kind}:${e.name}`}function refuse$2(e){throw new j(e,[{path:[`label`],message:e}])}function parseSchemaGroupPresentation(e){let t=e??{},n={};if(t.label!==void 0){let e=t.label;if(e===null)n.label=null;else if(typeof e!=`string`)refuse$2(`Label must be a string`);else{let t=e.trim();t.length===0&&refuse$2(`Label must not be empty`),t.length>N.labelLength&&refuse$2(`Label is too long (max ${N.labelLength} characters)`),n.label=t}}return n}const B=/^(?:core|bundle:.+)$/u;function parseSchemaOwner(e){if(e===null)return null;if(!B.test(e))throw new j(`Invalid schema owner "${e}"`,[]);return e}const Cl=16e3,wl=3200,Tl=6400,El=16e3,Dl=65536,Ol=15e3,kl=1e4,Al=5e3,jl=`google/gemini-3.5-transcribe-live`,Ml={maxDurationMs:3e5,dailyDurationMs:36e5,monthlyDurationMs:72e6,tenantMonthlyBudgetMicrousd:5e7,globalMonthlyBudgetMicrousd:5e7,estimatedMicrousdPerSecond:150,reservationMultiplier:2},Nl=[`web`,`presentation`,`document`,`spreadsheet`,`image`,`code`,`other`],Pl=[`ephemeral`,`conversation`,`persistent`],Fl=[`source`,`preview`,`entrypoint`,`asset`];var NoopGeocodingAdapter=class{async autocomplete(){return await Promise.resolve([])}async geocode(){return await Promise.resolve(null)}};const Il=6048e5,Ll=36e5,Rl=2592e6,zl=6e4,Bl=[`square`,`landscape`,`portrait`];function imageModelFormatDefect(e){if(e.formats.length===0)return`declares no output format`;for(let t of e.formats)if(e.requests[t]===void 0)return`declares the format "${t}" without a request`;for(let t of Object.keys(e.requests))if(!e.formats.includes(t))return`carries a request for the undeclared format "${t}"`}function declaredImageRequests(e){let t={};for(let n of e.formats){let r=e.requests[n];r!==void 0&&(t[n]=r)}return t}const Vl=[`storage.bytes`,`members.seats`,`data.live_records`];function computeByteMagnitude(e){if(e<=0)return{value:0,unitIndex:0};let t=1e3,n=Math.min(4,Math.floor(Math.log(e)/Math.log(t)));return{value:Number.parseFloat((e/t**n).toFixed(1)),unitIndex:n}}const Hl=[`B`,`KB`,`MB`,`GB`,`TB`];function formatByteSize(e){let{value:t,unitIndex:n}=computeByteMagnitude(e);return`${t} ${Hl[n]}`}const Ul=Object.freeze([`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`status`,`select`,`multiselect`,`location`]);function buildPropertySchema(e){let t=[];for(let n of e){let e=n.build();if(!Ul.includes(e.type))throw Error(`Property type "${e.type}" is not supported in .qualifyWith()`);t.push(e)}return{definitions:t}}const Wl=[`UPPER`,`LOWER`,`capitalize`,`trim`],Gl=[`prefix`,`suffix`,`wrap`,`default`],V=[...Wl,...Gl],Kl=/^\s*where\s*(?::(.*))?$/s,ql=`[A-Za-z_][A-Za-z0-9_]*`,Jl=/^[^\s,()|{}="']+$/,Yl=RegExp(`^(${ql})\\s*=\\s*(.*)$`),Xl=RegExp(`^(${ql})\\s+in\\s*\\(([^()]*)\\)$`);function isWherePipe(e){return Kl.test(e)}function parseWherePipe(e){let t=e.match(Kl)?.[1]?.trim();if(!t)return null;let n=t.match(Xl);if(n){let e=n[2].split(`,`).map(e=>e.trim());return e.every(e=>Jl.test(e))?{property:n[1],values:e}:null}let r=t.match(Yl);return r&&Jl.test(r[2])?{property:r[1],values:[r[2]]}:null}const H=L.string().min(1,`labelExpression cannot be empty`).refine(e=>isLabelExpression(e),{message:`labelExpression must contain at least one {{ attribute }} interpolation`}).refine(e=>!/\{\{\s*\}\}/.test(e),{message:`labelExpression contains empty {{ }} interpolation`}).refine(e=>{let t=/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g,n;for(;(n=t.exec(e))!==null;){let e=n[1];if(!V.includes(e))return!1}return!0},{message:`Invalid pipe name. Valid pipes: ${V.join(`, `)}`});function validateLabelExpression(e){let t=H.safeParse(e);return t.success?{success:!0,attributes:extractAttributeNames(e)}:{success:!1,error:t.error.issues[0]?.message??`Invalid labelExpression`}}function applyPipe(e,t){let{name:n,args:r}=parsePipeExpression(t);switch(n){case`UPPER`:return e.toUpperCase();case`LOWER`:return e.toLowerCase();case`capitalize`:return e.replace(/(^|\s)\S/g,e=>e.toUpperCase());case`trim`:return e.trim();case`prefix`:return e?`${r[0]??``}${e}`:``;case`suffix`:return e?`${e}${r[0]??``}`:``;case`wrap`:return e?`${r[0]??``}${e}${r[1]??``}`:``;case`default`:return e||r[0]||``;default:return e}}function applyPipes(e,t){let n=e;for(let e of t)n=applyPipe(n,e);return n}function getValue(e,t){return t.split(`.`).reduce((e,t)=>{if(typeof e==`object`&&e)return e[t]},e)}const Zl=`(Untitled)`;function parsePipeExpression(e){let t=e.match(/^(\w+)(?::(.*))?$/);if(!t)return{name:e,args:[]};let n=t[1],r=t[2];if(!r)return{name:n,args:[]};let i=[],a=/["']([^"']*?)["']/g,o;for(;(o=a.exec(r))!==null;)i.push(o[1]);return{name:n,args:i}}function*templateBlocks(e){let t=0;for(;t<e.length;){let n=e.indexOf(`{{`,t);if(n<0)return;let r=e.indexOf(`}`,n+2);if(r<0)return;if(e[r+1]!==`}`){t=r+1;continue}t=r+2;let i=e.slice(n+2,r);i.length>0&&(yield{start:n,end:t,expr:i})}}function resolveLabelBlock(e,t){let n=e.split(`||`).map(e=>e.trim()),r=n[n.length-1].split(`|`).map(e=>e.trim());n[n.length-1]=r[0];let i=r.slice(1).filter(Boolean),a=n.filter(Boolean),o=``;for(let e of a){let n=toText(getValue(t,e));if(n!==``){o=n;break}}return applyPipes(o,i)}function renderLabelExpression(e,t,n=Zl){let r=[],i=0;for(let n of templateBlocks(e))r.push(e.slice(i,n.start),resolveLabelBlock(n.expr,t)),i=n.end;return r.push(e.slice(i)),r.join(``).trim()||n}function toText(e){if(e==null||typeof e==`function`)return``;if(typeof e!=`object`)return String(e);if(Array.isArray(e))return e.map(toText).filter(Boolean).join(`,`);let t=e.toString;return typeof t==`function`&&t!==Object.prototype.toString?String(e):``}function isLabelExpression(e){let t=0;for(;t<e.length;){let n=e.indexOf(`{{`,t);if(n<0)return!1;let r=e.indexOf(`}}`,n+2);if(r<0)return!1;if(e.slice(n+2,r).trim().length>0)return!0;t=r+2}return!1}function extractAttributeNames(e){let t=[];for(let n of templateBlocks(e)){let e=n.expr.trim();if(!e)continue;let r=e.split(`||`).map(e=>e.trim()),i=r[r.length-1];r[r.length-1]=i.split(`|`)[0].trim();for(let e of r){if(!e)continue;let n=e.split(`.`)[0];n&&!t.includes(n)&&t.push(n)}}return t}const Ql=/^\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}$/;function getSingleAttributeFromExpression(e){let t=e.trim().match(Ql);return t?t[1]:null}function getEditableLabelAttribute(e,t){let n=getSingleAttributeFromExpression(e);if(n===null)return null;let r=t.find(e=>e.name===n);return!r||r.type!==`text`||vt(r).authoring.readOnly?null:r}const $l=[{id:`data`,capabilities:[{id:`forms`,resources:[`forms`],levels:[{id:`fill`,add:[`read`]},{id:`edit`,add:[`create`,`update`,`delete`]},{id:`manage`,add:[`manage`]}]}]},{id:`structure`,capabilities:[{id:`schema`,resources:[`architect`],levels:[{id:`use`,add:[`read`]},{id:`edit`,add:[`create`,`update`,`delete`]}]},{id:`pages`,resources:[`pages`],levels:[{id:`read`,add:[`read`]},{id:`create`,add:[`create`,`update`,`delete`]}]}]},{id:`ai`,capabilities:[{id:`agents`,resources:[`agents`],levels:[{id:`chat`,add:[`read`]},{id:`build`,add:[`create`,`update`,`delete`]},{id:`manage`,add:[`manage`]}]},{id:`environments`,resources:[`environments`],levels:[{id:`use`,add:[`read`]},{id:`create`,add:[`create`]}]},{id:`browser-profiles`,resources:[`browser-profiles`],levels:[{id:`use`,add:[`create`]}]},{id:`private-secrets`,resources:[`private-secrets`],levels:[{id:`use`,add:[`create`]}]},{id:`routine-audiences`,resources:[`routine-audiences`],levels:[{id:`use`,add:[`create`]}]}]},{id:`files`,capabilities:[{id:`files`,resources:[`files`,`documents`],levels:[{id:`read`,add:[`read`]},{id:`edit`,add:[`create`,`update`]},{id:`full`,add:[`delete`]}]}]},{id:`team`,capabilities:[{id:`people`,resources:[`people`],levels:[{id:`view`,add:[`read`]},{id:`invite`,add:[`create`]},{id:`manage`,add:[`update`,`delete`]}]}]},{id:`integrations`,capabilities:[{id:`connectors`,resources:[`connectors`],levels:[{id:`use`,add:[`read`,`create`,`update`,`delete`]}]},{id:`api-keys`,resources:[`api-keys`],levels:[{id:`view`,add:[`read`]},{id:`manage`,add:[`create`,`delete`]}]},{id:`env-vars`,resources:[`env-vars`],levels:[{id:`view`,add:[`read`]},{id:`manage`,add:[`create`,`delete`]}]}]},{id:`administration`,capabilities:[{id:`settings`,resources:[`settings`],levels:[{id:`view`,add:[`read`]},{id:`manage`,add:[`update`,`delete`,`manage`]}]},{id:`audit`,resources:[`audit`],levels:[{id:`view`,add:[`read`]}]},{id:`billing`,resources:[`billing`],levels:[{id:`view`,add:[`read`]}]}]}],U=`none`,eu=`custom`,W={actions:[`read`,`create`,`update`,`delete`],purge:`manage`,levels:[{id:`read`,add:[`read`]},{id:`edit`,add:[`create`,`update`]},{id:`full`,add:[`delete`]}]},G=$l.flatMap(e=>e.capabilities),tu=G.flatMap(e=>e.resources),nu=new Map(G.flatMap(e=>e.resources.map(t=>[t,e])));function isCatalogResource(e){return nu.has(e)}function capabilityForResource(e){let t=nu.get(e);if(!t)throw new k(`Unknown catalog resource "${e}"`,A.INVARIANT_VIOLATION);return t}function sameActions(e,t){let n=new Set(e),r=new Set(t);return n.size===r.size&&[...n].every(e=>r.has(e))}function levelActions(e,t){let n=new Set;for(let r of e.levels){for(let e of r.add)n.add(e);if(r.id===t)return[...n]}return[]}function levelFloor(e,t){let n=e.levels[e.levels.length-1];if(t.includes(`*`)&&n)return n.id;let r=new Set(t),i=U;for(let t of e.levels){if(!t.add.every(e=>r.has(e)))break;i=t.id}return i}function levelOf(e,t){if(t.length===0)return U;let n=e.levels[e.levels.length-1];if(t.includes(`*`)&&n)return n.id;let r=new Set(t),i=new Set;for(let t of e.levels){for(let e of t.add)i.add(e);if(i.size===r.size&&[...r].every(e=>i.has(e)))return t.id}return eu}const ru=[`read`,`create`,`update`,`delete`,`manage`],iu=L.object({scope:L.enum([`object`,`system`]),target:L.string().min(1),actions:L.array(L.enum(ru))}).strict();function findGrantIssues(e,t){let n=[],r=new Map;for(let i of e){let e=iu.safeParse(i);if(!e.success){let e=typeof i==`object`&&i&&`target`in i?String(i.target):`?`;n.push({target:e,reason:`shape`});continue}let a=e.data;if(a.scope===`system`){if(!isCatalogResource(a.target)){n.push({target:a.target,reason:`unknown-resource`});continue}if(levelOf(capabilityForResource(a.target),a.actions)===`custom`){n.push({target:a.target,reason:`off-level`});continue}r.set(a.target,a.actions);continue}if(a.target!==`*`&&!t.objectNames.has(a.target)){n.push({target:a.target,reason:`unknown-object`});continue}let o=a.target===`*`?[...W.actions,W.purge]:W.actions;a.actions.every(e=>o.includes(e))||n.push({target:a.target,reason:`object-action`})}let i=new Set;for(let[e,t]of r){let a=capabilityForResource(e);if(!i.has(a)){for(let o of a.resources)if(!sameActions(t,r.get(o)??[])){n.push({target:e,reason:`split-capability`}),i.add(a);break}}}return n}const au=`memory`,ou=4e3,su=`workspace`,K={name:`name`,description:`description`,content:`content`,profileOf:`profileOf`,profileActor:`profileActor`,subjects:`subjects`,subjectId:`subjectId`};function textValue(e){return typeof e==`string`?e:``}function memoryPageViewOf(e){let{values:t}=e;return{id:e.id,name:textValue(t[K.name]),description:textValue(t[K.description]),content:textValue(t[K.content]),visibility:e.visibility,ownedBy:e.ownedBy,updatedAt:new Date(e.updatedAt).toISOString()}}const cu=`@standards/schema`;function createStandardSchemaProps(e){return{version:1,vendor:cu,validate:t=>{let n=e.safeParse(t);return n.success?{value:n.data}:{issues:n.error.issues.map(e=>({message:e.message,path:e.path}))}}}}function isStandardSchema(e){return typeof e==`object`&&!!e&&`~standard`in e&&typeof e[`~standard`]==`object`&&e[`~standard`].version===1}function asMutableArray(e){return e}var BaseAttributeBuilder=class{get"~standard"(){return createStandardSchemaProps(Ac(this.build()))}constructor(e,t,n){qs(t),Ys(n),this.attr={name:t,label:n,type:e,required:!1,system:!0}}setRequired(e){this.attr.required=e}asRequiredState(){return this}asPhantomState(){return this}runtime(){return this.attr.system=!1,this}hidden(){return this.attr.hidden=!0,this}placeholder(e){return this.attr.placeholder=e,this}description(e){return this.attr.description=e,this}icon(e){return Js(e,`attribute "${this.attr.name}"`),this.attr.icon=e,this}order(e){return this.attr.order=e,this}defaultValue(e){return(`defaultValue`in this.attr||![`formula`,`rollup`].includes(this.attr.type))&&(this.attr.defaultValue=e),this}metadata(e){return this.attr.metadata=e,this}build(){return this.attr}},TextAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`text`,e,t)}minLength(e){return this.attr.minLength=e,this}maxLength(e){return this.attr.maxLength=e,this}pattern(e){return this.attr.pattern=e,this.attr.format=void 0,this}multiline(e=!0){return this.attr.multiline=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}email(){return this.attr.format=`email`,this.attr.pattern=void 0,this}url(){return this.attr.format=`url`,this.attr.pattern=void 0,this}slug(){return this.attr.format=`slug`,this.attr.pattern=void 0,this}};function text(e,t){return new TextAttributeBuilder(e,t)}var RichtextAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`richtext`,e,t)}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function richtext(e,t){return new RichtextAttributeBuilder(e,t)}var NumberAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`number`,e,t)}min(e){return this.attr.min=e,this}max(e){return this.attr.max=e,this}integer(){return this.attr.unit=`integer`,this.attr.decimals=0,this}decimal(e=2){return this.attr.unit=`decimal`,this.attr.decimals=e,this}percentage(){return this.attr.unit=`percentage`,this}renderAs(e){return this.attr.renderAs=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function number(e,t){return new NumberAttributeBuilder(e,t)}var CheckboxAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`checkbox`,e,t)}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function checkbox(e,t){return new CheckboxAttributeBuilder(e,t)}var DateAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`date`,e,t)}format(e){return this.attr.dateFormat=e,this}precision(e){return this.attr.precision=e,this}build(){let[e]=rc(`date`,this.attr);if(e!==void 0)throw new j(e.message,[{path:[`precision`],message:e.message}]);return super.build()}minDate(e){return this.attr.minDate=e,this}maxDate(e){return this.attr.maxDate=e,this}endDate(){return this.attr.endDate=!0,this.asPhantomState()}includeTime(){return this.attr.includeTime=!0,this}timeFormat(e){return this.attr.timeFormat=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function date(e,t){return new DateAttributeBuilder(e,t)}var PhoneAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`phone`,e,t)}defaultCountry(e){return this.attr.defaultCountryCode=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function phone(e,t){return new PhoneAttributeBuilder(e,t)}var CurrencyAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`currency`,e,t)}defaultCurrency(e){return this.attr.defaultCurrency=e,this}allowedCurrencies(e){return this.attr.allowedCurrencies=e,this}allowNegative(e=!0){return this.attr.allowNegative=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function currency(e,t){return new CurrencyAttributeBuilder(e,t)}var StatusAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`status`,e,t)}options(e){let t=asMutableArray(e);return F(this.attr.name??`unknown`,t),this.attr.options=t,this.asPhantomState()}option(e){this.attr.options||(this.attr.options=[]);let t=[...this.attr.options,e];return F(this.attr.name??`unknown`,t),this.attr.options.push(e),this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function status(e,t){return new StatusAttributeBuilder(e,t)}var SelectAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`select`,e,t)}options(e){let t=asMutableArray(e);return F(this.attr.name??`unknown`,t),this.attr.options=t,this.asPhantomState()}option(e){this.attr.options||(this.attr.options=[]);let t=[...this.attr.options,e];return F(this.attr.name??`unknown`,t),this.attr.options.push(e),this}renderAs(e){return this.attr.renderAs=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function select(e,t){return new SelectAttributeBuilder(e,t)}var MultiselectAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`multiselect`,e,t)}options(e){let t=asMutableArray(e);return F(this.attr.name??`unknown`,t),this.attr.options=t,this.asPhantomState()}option(e){this.attr.options||(this.attr.options=[]);let t=[...this.attr.options,e];return F(this.attr.name??`unknown`,t),this.attr.options.push(e),this}renderAs(e){return this.attr.renderAs=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function multiselect(e,t){return new MultiselectAttributeBuilder(e,t)}var LocationAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`location`,e,t)}granularity(e){return this.attr.granularity=e,this}defaultCountry(e){return this.attr.defaultCountry=e,this}allowedCountries(e){return this.attr.allowedCountries=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function location(e,t){return new LocationAttributeBuilder(e,t)}var UserAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`user`,e,t),this.attr.types=[`user`,`agent`]}types(e){let t=[...new Set(e)];if(t.length===0)throw Error(`[AttributeBuilder] user.types must contain at least one type.`);return this.attr.types=t,this}multiple(){return this.attr.multiple=!0,this}notifiesOnAssign(){return this.attr.notifiesOnAssign=!0,this}actors(){return this.attr.actors=!0,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function user(e,t){return new UserAttributeBuilder(e,t)}var BaseRelationAttributeBuilder=class extends BaseAttributeBuilder{to(e,t){let n={object:e,...t};return this.attr.targets?.push(n),this}toAny(){return this.attr.targets=[{object:`*`}],this}qualifyWith(...e){let t=this.attr.targets;if(!t||t.length===0)throw Error(`.qualifyWith() must be called AFTER .to(). Example: relation("companies", "Companies").to("companies").qualifyWith(...)`);return this.attr.properties=buildPropertySchema(e),this}bilateral(e){let t=this.attr.targets;if(!t||t.length===0)throw Error(`.bilateral() must be called AFTER .to(). Example: relation("company", "Company").to("companies").bilateral({ ... })`);if(t.length>1)throw Error(`Bilateral relations are not supported for polymorphic relations (multiple .to() targets).`);if(Wt(this.attr))throw Error(`Bilateral relations are not supported for universal relations (.toAny()).`);let n=t[0]?.object;if(!n)throw new j(`Bilateral relation requires one target object`,[{path:[`bilateral`,`object`],message:`Bilateral relation requires one target object`}]);if(e.object&&e.object!==n){let t=`Bilateral inverse object ${e.object} must match relation target ${n}`;throw new j(t,[{path:[`bilateral`,`object`],message:t}])}return this.attr.bilateral={...e,object:n},this}},SingleRelationAttributeBuilder=class extends BaseRelationAttributeBuilder{constructor(e,t){super(`relation`,e,t),this.attr.cardinality=`one`,this.attr.targets=[]}many(){let e=new MultiRelationAttributeBuilder(this.attr.name,this.attr.label??``,{targets:this.attr.targets,isRequired:this.attr.required});return this.attr.system===!1&&e.runtime(),this.attr.hidden&&e.hidden(),this.attr.placeholder&&e.placeholder(this.attr.placeholder),this.attr.description&&e.description(this.attr.description),this.attr.icon&&e.icon(this.attr.icon),this.attr.order!==void 0&&e.order(this.attr.order),this.attr.metadata&&e.metadata(this.attr.metadata),e}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}},MultiRelationAttributeBuilder=class extends BaseRelationAttributeBuilder{constructor(e,t,n){super(`relation`,e,t),this.attr.cardinality=`many`,this.attr.targets=n?.targets??[],this.attr.defaultValue=[],n?.isRequired&&this.setRequired(!0)}maxItems(e){return this.attr.maxItems=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function relation(e,t){return new SingleRelationAttributeBuilder(e,t)}var FormulaAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`formula`,e,t),this.attr.required=!1}expression(e){return this.attr.expression=e,this}returns(e){return this.attr.returnType=e,this}decimals(e){return this.attr.decimals=e,this}currency(e){return this.attr.currencyCode=e,this}required(){throw Error(`Formula attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.`)}optional(){return this}};function formula(e,t){return new FormulaAttributeBuilder(e,t)}var RollupAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`rollup`,e,t),this.attr.required=!1}from(e){return this.attr.relationAttribute=e,this}aggregate(e){return this.attr.targetAttribute=e,this}using(e){return this.attr.function=e,this}decimals(e){return this.attr.decimals=e,this}path(e){return this.attr.relationPath=e,this}targetType(e){return this.attr.targetAttributeType=e,this}targetOptions(e){return this.attr.targetAttributeOptions=asMutableArray(e),this}targetCurrency(e){return this.attr.targetCurrencyCode=e,this}build(){let e=this.attr.function,t=this.attr.targetAttributeType;if(e===`original`&&t!==void 0&&t!==`select`&&t!==`status`&&t!==`multiselect`){let e=this.attr.relationAttribute??`relation`,n=this.attr.targetAttribute??`field`;throw new k(`Rollup "${this.attr.name}": .using("original") only supports a "select", "status", or "multiselect" target, but .targetType("${t}") was given. To surface a plain ${t} value from a related record, use a formula instead — e.g. formula("${this.attr.name}", "…").expression("${e}.${n}").`,A.VALIDATION_FAILED)}return super.build()}required(){throw Error(`Rollup attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.`)}optional(){return this}};function rollup(e,t){return new RollupAttributeBuilder(e,t)}var DocumentAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`document`,e,t)}accepts(e){return this.attr.accepts=e,this}maxFileSize(e){return this.attr.maxFileSize=e,this}qualifyWith(...e){return this.attr.properties=buildPropertySchema(e),this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function document(e,t){return new DocumentAttributeBuilder(e,t)}const q=/^[a-z0-9][a-z0-9-]{0,62}$/,J=`core`;function assertBundleName(e){if(!q.test(e))throw new j(`Invalid bundle name "${e}": expected a lowercase slug matching ${q}`,[]);if(e===`core`)throw new j(`Bundle name "${J}" is reserved`,[])}async function sha256Hex(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,`0`)).join(``)}function nameSlug(e,t){return e.normalize(`NFKD`).replace(/\p{M}/gu,``).toLowerCase().replace(/[^a-z0-9]+/g,`_`).slice(0,t).replace(/^_+|_+$/g,``)}function cloneBuilderValue(e,t){try{return structuredClone(e)}catch{let e=`Builder configuration must contain cloneable data`;throw new j(e,[{path:t,message:e}])}}function requireBuilderName(e,t){if(typeof e!=`string`||e.trim().length===0)throw new j(`Name must not be blank`,[{path:t,message:`Name must not be blank`}])}function validateContentConfiguration(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw new j(`Invalid content configuration`,[{path:t,message:`Expected content configuration`}]);for(let n of[`name`,`label`,`placement`])if(Object.hasOwn(e,n)){let e=`Independent content configuration cannot define ${n}`;throw new j(e,[{path:[...t,n],message:e}])}let n=E.safeParse({...e,name:`content`,placement:e.type===`group`?`grid`:`main`});if(!n.success)throw j.fromZodErrors(n.error.issues.map(e=>({path:[...t,...e.path.map(String)],message:e.message})));n.data.type===`form`&&n.data.groups.forEach((e,n)=>requireBuilderName(e.name,[...t,`groups`,String(n),`name`]));let{name:r,label:i,placement:a,...o}=n.data;return cloneBuilderValue(o,t)}function validateLiteralContent(e,t){return validateContentConfiguration(e,t),cloneBuilderValue(e,t)}function positionOf(e){return{x:e.x,y:e.y,w:e.w,h:e.h}}function bottomOf(e){return e.y+e.h}function collides(e,t){return e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h}function firstCollision(e,t){return t.find(t=>collides(e,t))}function inReadingOrder$1(e){return[...e].sort((e,t)=>e.y-t.y||e.x-t.x)}function snapWidth(e,t,n){let r=12-t,i=_.filter(e=>e>=n&&e<=r);return i.length===0?_.find(e=>e>=n)??n:i.reduce((t,n)=>{let r=Math.abs(n-e),i=Math.abs(t-e);return r<i||r===i&&n>t?n:t})}function sharesColumns(e,t){return e.x<t.x+t.w&&t.x<e.x+e.w}function risenRow(e,t){return t.reduce((t,n)=>n.y<e.y&&sharesColumns(e,n)?Math.max(t,bottomOf(n)):t,0)}function packLayout(e,t){let n=e.map(e=>{let n=t?.get(e.i);return n===void 0?e:{...e,h:n}}),r=n.filter(e=>e.static===!0),i=new Map(r.map(e=>[e.i,e]));for(let e of inReadingOrder$1(n.filter(e=>e.static!==!0))){let t=risenRow(e,r),n=firstCollision({...e,y:t},r);for(;n!==void 0;)t=bottomOf(n),n=firstCollision({...e,y:t},r);let a={...e,y:t};r.push(a),i.set(e.i,a)}return n.map(e=>i.get(e.i)??e)}function settleLayout(e,t){let n=e.filter(e=>e.static===!0),r=e.filter(e=>e.static!==!0),i=new Map;for(let e of[...inReadingOrder$1(r.filter(e=>t.has(e.i))),...inReadingOrder$1(r.filter(e=>!t.has(e.i)))]){let t=e,r=firstCollision(t,n);for(;r!==void 0;)t={...t,y:bottomOf(r)},r=firstCollision(t,n);n.push(t),i.set(e.i,t)}return packLayout(e.map(e=>i.get(e.i)??e))}function pageCompactor(){return{type:`vertical`,allowOverlap:!1,preventCollision:!1,compact:e=>packLayout(e).map(e=>({...e,moved:!1}))}}function clampHeight(e,t){let n=t.minHeight??1,r=t.maxHeight??1/0;return Math.max(1,n,Math.min(r,e))}function widthStepConstraint(e){return{name:`width-steps`,constrainSize:(t,n,r)=>{let i=e(t.i),a=snapWidth(n,t.x,i.minWidth);return i.height===`fit`?{w:a,h:t.h}:i.height===`flexible`?{w:a,h:clampHeight(r,i)}:{w:a,h:Math.max(1,r)}}}}function snapCell(e,t){let n=Math.max(0,Math.min(e.x,11)),r=snapWidth(e.w,n,t(e.i).minWidth);return{...e,x:Math.min(n,12-r),y:Math.max(0,e.y),w:r,h:Math.max(1,e.h)}}function samePosition(e,t){return e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h}function pushApart(e){let t=e.filter(e=>e.static===!0),n=new Map;for(let r of inReadingOrder$1(e.filter(e=>e.static!==!0))){let e=r,i=firstCollision(e,t);for(;i!==void 0;){let n={...e,x:i.x+i.w};e=n.x+n.w<=12&&firstCollision(n,t)===void 0?n:{...e,y:bottomOf(i)},i=firstCollision(e,t)}t.push(e),n.set(r.i,e)}return e.map(e=>n.get(e.i)??e)}function isValidStatic(e){return[e.x,e.y,e.w,e.h].every(Number.isInteger)&&e.x>=0&&e.y>=0&&e.h>=1&&_.includes(e.w)&&e.x+e.w<=12}function keptStatics(e){let t=[],n=new Set;for(let r of inReadingOrder$1(e.filter(e=>e.static===!0)))isValidStatic(r)&&firstCollision(r,t)===void 0?t.push(r):n.add(r.i);return e.map(e=>n.has(e.i)?{...e,static:!1}:e)}function boundedHeight(e,t){let n=t(e.i);if(e.static===!0||n.height!==`flexible`)return e;let r=clampHeight(e.h,n);return r===e.h?e:{...e,h:r}}function repairPageGrid(e,t){let n=[],r=keptStatics(e).map(e=>{let r=boundedHeight(e,t);return r!==e&&n.push({name:e.i,kind:`height`,from:positionOf(e),to:positionOf(r)}),r}).map(e=>{if(e.static===!0)return e;let r=snapCell(e,t);return samePosition(e,r)||n.push({name:e.i,kind:`width`,from:positionOf(e),to:positionOf(r)}),r}),i=pushApart(r);i.forEach((e,t)=>{let i=r[t];i!==void 0&&!samePosition(i,e)&&n.push({name:e.i,kind:`pushed`,from:positionOf(i),to:positionOf(e)})});let a=packLayout(i),o=keptFill(a,t);for(let e of inReadingOrder$1(a))e.i!==o&&t(e.i).height===`fill`&&n.push({name:e.i,kind:`fill`});return{cells:a,repairs:n}}function keptFill(e,t){return inReadingOrder$1(e).find(e=>e.static!==!0&&t(e.i).height===`fill`)?.i}function firstFreeSlot(e,t,n){let r=t.reduce((e,t)=>Math.max(e,bottomOf(t)),0);for(let i=n;i<=r;i+=1)for(let n=0;n+e.w<=6;n+=1)if(firstCollision({x:n,y:i,...e},t)===void 0)return{x:n,y:i};return{x:0,y:r}}function deriveLayout6(e,t){let n=[];for(let r of inReadingOrder$1(e)){let e=Math.min(6,Math.max(t(r.i).minWidth,Math.ceil(r.w/2))),i=n.at(-1)?.y??0;n.push({i:r.i,...firstFreeSlot({w:e,h:r.h},n,i),w:e,h:r.h})}return n}function figureSlot(e,t,n){for(let r of inReadingOrder$1(e.filter(e=>n.has(e.i)))){let n={x:r.x+r.w,y:r.y,...t};if(n.x+n.w<=12&&firstCollision(n,e)===void 0)return n}}function placeNew(e,t,n,r){let i={w:snapWidth(n.size.w,0,n.minWidth),h:Math.max(1,n.size.h)};return n.figure?{i:t,...figureSlot(e,i,r)??{x:0,y:0,...i}}:{i:t,x:0,y:e.reduce((e,t)=>Math.max(e,bottomOf(t)),0),...i}}function spanContent(e,t){if(!_.includes(t)){let e=`A block spans ${_.join(`, `)} columns, not ${String(t)}`;throw new j(e,[{path:[`content`,`span`],message:e}])}return{content:e,span:t}}function configureContent(e,t){try{return typeof e==`object`&&e&&`build`in e&&typeof e.build==`function`?{configuration:validateContentConfiguration(e.build(),t),extension:e.extension}:{configuration:validateContentConfiguration(e,t)}}catch(e){throw e instanceof j?new j(e.message,e.errors.map(e=>({...e,path:e.path[0]===`content`?[...t,...e.path.slice(1)]:e.path}))):e}}function storedQuery(e,t){let n=[`search`,`offset`].filter(t=>e.state[t]!==void 0);if(n.length>0)throw new j(`A ${t} cannot keep a query's ${n.join(` or `)}`,n.map(e=>({path:[t,e],message:`A ${t} stores no ${e}; use filters and limit instead`})));return e.toDefinition()}function checkInputs(e,t){for(let[n,r]of Object.entries(t)){let t=e.inputs[n];r!==void 0&&t!==void 0&&T({parameters:t.schema},r,[`content`,`parameters`,n])}return t}var BlockContentBuilder=class{constructor(e,t,n){this.extension=e,this.parameters=t,this.heightMode=n}copy(e,t){let n=this.constructor;return new n(this.extension,e,t)}with(e){let t={...this.parameters};for(let[n,r]of Object.entries(e)){if(r===void 0){delete t[n];continue}t[n]=r}return checkInputs(this.extension,e),this.copy(t,this.heightMode)}height(e){return this.copy(this.parameters,e)}build(){let e={type:`custom`,extension:this.extension.name,parameters:cloneBuilderValue(this.parameters,[`content`,`parameters`]),...this.heightMode===void 0?{}:{height:this.heightMode}};return validateContentConfiguration(e,[`content`]),T(this.extension,e.parameters,[`content`,`parameters`]),e}span(e){return spanContent(this,e)}},Measures=class{count(){return this.measured(`count`)}sum(e){return this.measured(`sum`,e)}avg(e){return this.measured(`avg`,e)}min(e){return this.measured(`min`,e)}max(e){return this.measured(`max`,e)}};function measure(e,t,n){return{query:e,measure:t,...n===void 0?{}:{attribute:n}}}var MetricBuilder=class extends BlockContentBuilder{label(e){return this.with({label:e})}trend(e,t){return this.with({trend:e,trendBucket:t})}compare(e,t){return this.with({compare:e,period:t})}target(e){return this.with({target:e})}},MetricQuery=class extends Measures{constructor(e){super(),this.query=e}measured(e,t){return new MetricBuilder(b,checkInputs(b,measure(this.query,e,t)))}};function groupBy(e){return typeof e==`string`?[e,void 0]:[e.attribute,e.bucket]}var ChartBuilder=class extends BlockContentBuilder{label(e){return this.with({label:e})}by(e){let[t,n]=groupBy(e);return this.with({by:t,byBucket:n})}by2(e){let[t,n]=groupBy(e);return this.with({by2:t,by2Bucket:n})}kind(e){return this.with({kind:e})}bar(){return this.kind(`bar`)}horizontalBar(){return this.kind(`horizontal_bar`)}line(){return this.kind(`line`)}area(){return this.kind(`area`)}donut(){return this.kind(`donut`)}funnel(){return this.kind(`funnel`)}treemap(){return this.kind(`treemap`)}calendar(){return this.kind(`calendar`)}},ChartQuery=class extends Measures{constructor(e){super(),this.query=e}measured(e,t){return new ChartBuilder(y,checkInputs(y,{...measure(this.query,e,t),kind:`bar`}))}};const lu={"7d":7,"30d":30};var AgendaBuilder=class extends BlockContentBuilder{label(e){return this.with({label:e})}next(e){let t=typeof e==`number`?e:lu[e];if(!Number.isInteger(t)||t<1){let e=`An agenda looks ahead a whole number of days, at least 1`;throw new j(e,[{path:[`content`,`parameters`,`next`],message:e}])}return this.with({next:t})}yearly(){return this.with({yearly:!0})}},CardBuilder=class extends BlockContentBuilder{fields(...e){return this.with({fields:e})}record(e){return this.with({record:e})}},InboxBuilder=class extends BlockContentBuilder{kinds(...e){return this.with({kinds:e})}limit(e){return this.with({limit:e})}},MeetingsUpcomingBuilder=class extends BlockContentBuilder{limit(e){return this.with({limit:e})}},MailboxBuilder=class extends BlockContentBuilder{category(e){return this.with({category:e})}important(){return this.with({important:!0})}unread(){return this.with({unread:!0})}limit(e){return this.with({limit:e})}label(e){return this.with({label:e})}};function metric(e){return new MetricQuery(storedQuery(e,`metric`))}function chart(e){return new ChartQuery(storedQuery(e,`chart`))}function agenda(e,t){return new AgendaBuilder(g,checkInputs(g,{query:storedQuery(e,`agenda`),attribute:t}))}function card(e){let t=e===void 0||typeof e==`string`?e:e.build().name;return new CardBuilder(v,t===void 0?{}:checkInputs(v,{object:t}))}function text$1(e){return new BlockContentBuilder(S,checkInputs(S,{markdown:e}))}function inbox(){return new InboxBuilder(be,{})}function meetingsUpcoming(){return new MeetingsUpcomingBuilder(Te,{})}function mailbox(){return new MailboxBuilder(Ce,{})}function isSpanned(e){return typeof e==`object`&&!!e&&`span`in e&&`content`in e}function total(e){return e.reduce((e,t)=>e+t,0)}function spread(e){return e.length===0?0:Math.max(...e)-Math.min(...e)}function betterSplit(e,t){let n=total(e)-total(t);if(n!==0)return n>0;let r=spread(t)-spread(e);if(r!==0)return r>0;let i=e.findIndex((e,n)=>e!==t[n]);return i!==-1&&(e[i]??0)>(t[i]??0)}function splitColumns(e,t){let n=[...t];function visit(r,i){let a=t[r.length];if(a===void 0){betterSplit(r,n)&&(n=r);return}for(let t of _)t>=a&&i+t<=e&&visit([...r,t],i+t)}return visit([],0),n}function rowWidths(e,t){let n=e.filter(e=>e.span===void 0);n.length>4&&reject(t,`A row holds at most 4 unsized blocks`);let r=total(e.map(e=>e.span??e.minWidth));r>12&&reject(t,`Blocks ${e.map(e=>`"${e.key}"`).join(`, `)} do not fit one row: they need at least ${r} of 12 columns`);let i=splitColumns(12-total(e.map(e=>e.span??0)),n.map(e=>e.minWidth)),a=0;return e.map(e=>{if(e.span!==void 0)return e.span;let t=i[a]??e.minWidth;return a+=1,t})}function reject(e,t){throw new j(t,[{path:e,message:t}])}function traitsOf(e,t=[]){return Gt(e,C,new Map(t.map(e=>[e.name,e])))}function headingNames(e){let t=new Set(e.flatMap(e=>e.kind===`heading`?e.meta.name===void 0?[]:[e.meta.name]:[...Object.keys(e.blocks),...e.group?.name===void 0?[]:[e.group.name]]));return e.flatMap(e=>{if(e.kind!==`heading`)return[];if(e.meta.name!==void 0)return[e.meta.name];let n=nameSlug(e.title,40),r=n===``?`heading`:`heading_${n}`,i=r;for(let e=2;t.has(i);e+=1)i=`${r}_${e}`;return t.add(i),[i]})}function headingEntry(e,t,n){let r={title:t,...n.description===void 0?{}:{description:n.description},...n.icon===void 0?{}:{icon:n.icon}};return{key:e,content:new BlockContentBuilder(ye,r),span:12}}function groupOf(e,t,n){let[r]=e.map(e=>e.name).sort(),i=Tt(e.length);return(i!==void 0||r===void 0)&&reject(n,String(i)),{type:`group`,name:t.name??`group_${r}`,placement:`grid`,...t.label===void 0?{}:{label:t.label},members:e.map(e=>e.name)}}function requirePlacement(e,t,n,r,i){if(e.type===`page`&&reject(i,`Content "${n}" cannot reference a page from a page`),sn(e,t,n,r,i),e.type!==`custom`)return;let a=t?.refine?.(e.parameters??{},r);a&&reject([...i,`parameters`,a.input],a.message)}var Y=class PageBuilder{constructor(e){this.kind=`view`,this.data=e}icon(e){return new PageBuilder({...this.data,icon:e})}description(e){return new PageBuilder({...this.data,description:e})}home(){return new PageBuilder({...this.data,home:!0})}for(e){let t=typeof e==`string`?e:e.build().name;return new PageBuilder({...this.data,object:t})}row(e,t={}){let n=t.group===void 0?{kind:`row`,blocks:e}:{kind:`row`,blocks:e,group:t.group};return new PageBuilder({...this.data,sections:[...this.data.sections,n]})}heading(e,t={}){let n={kind:`heading`,title:e,meta:t};return new PageBuilder({...this.data,sections:[...this.data.sections,n]})}build(){let e=[`views`,`0`],{name:t,label:n,object:r,icon:i,description:a,home:o,sections:s}=this.data;requireBuilderName(t,[...e,`name`]),r!==void 0&&requireBuilderName(r,[...e,`object`]),o&&r!==void 0&&reject([...e,`home`],`Only a standalone page can be the home`),s.every(e=>e.kind===`row`&&Object.keys(e.blocks).length===0)&&reject([...e,`contents`],`A page declares at least one block`);let c=r===void 0?`page`:`record`,l=[],u=[],d=headingNames(s),f=0;for(let t of s){let n=[...e,`contents`,String(l.length)],r=(t.kind===`heading`?[headingEntry(d[f++]??``,t.title,t.meta)]:Object.entries(t.blocks).map(([e,t])=>isSpanned(t)?{key:e,content:t.content,span:t.span}:{key:e,content:t,span:void 0})).map(t=>{let n=[...e,`contents`,String(l.length)];requireBuilderName(t.key,[...n,`name`]);let{configuration:r,extension:i}=configureContent(t.content,n);requirePlacement(r,i,t.key,c,n);let a={...r,name:t.key,placement:`grid`};return l.push(a),{content:a,span:t.span}}),i=rowWidths(r.map(({content:e,span:t})=>({key:e.name,...t===void 0?{}:{span:t},minWidth:traitsOf(e).minWidth})),n),a=u.reduce((e,t)=>Math.max(e,t.y+t.h),0);if(t.kind===`row`&&t.group!==void 0){let e=groupOf(r.map(({content:e})=>e),t.group,n);l.push(e),u.push({i:e.name,x:0,y:a,w:12,h:traitsOf(e,l).size.h});continue}let o=0;r.forEach(({content:e},t)=>{let n=i[t]??0;u.push({i:e.name,x:o,y:a,w:n,h:traitsOf(e).size.h}),o+=n})}let p=Object.fromEntries(packLayout(u).map(({i:e,x:t,y:n,w:r,h:i})=>[e,{x:t,y:n,w:r,h:i}])),m={name:t,label:n,...r===void 0?{}:{object:r},context:`page`,...i===void 0?{}:{icon:i},...a===void 0?{}:{description:a},...o?{home:!0}:{},contents:l,grid:p},ee=w.safeParse(m);if(!ee.success)throw j.fromZodErrors(ee.error.issues.map(t=>({path:[...e,...t.path.map(String)],message:t.message})));return{kind:`view`,definition:cloneBuilderValue(m,e)}}};function page(e,t){return new Y({name:e,label:t,object:void 0,sections:[]})}var X=class ViewBuilder{constructor(e,t=[]){this.kind=`view`,this.data=cloneBuilderValue(e,[`views`,`0`]),this.extensions=t.map(e=>e&&{...e})}for(e){let t=typeof e==`string`?e:e.build().name;return new ViewBuilder({...this.data,object:t},this.extensions)}default(){return new ViewBuilder({...this.data,default:!0},this.extensions)}description(e){return new ViewBuilder({...this.data,description:e},this.extensions)}icon(e){return new ViewBuilder({...this.data,icon:e},this.extensions)}place(e,t,n,r,i){let{configuration:a,extension:o}=configureContent(n,[`views`,`0`,`contents`,String(this.data.contents.length)]),s={...a,name:e,label:t,placement:r},c=[...this.data.contents,s],l=i===void 0?{}:{anchors:{...this.data.anchors,[e]:{after:i}}};return new ViewBuilder({...this.data,...l,contents:c},[...this.extensions,o])}tab(e,t,n,r){return this.place(e,t,n,`main`,r?.after)}aside(e,t,n){return this.place(e,t,n,`aside`)}build(){let e=[`views`,`0`];requireBuilderName(this.data.name,[...e,`name`]),requireBuilderName(this.data.object,[...e,`object`]);let t=w.safeParse(this.data);if(!t.success)throw j.fromZodErrors(t.error.issues.map(t=>({path:[...e,...t.path.map(String)],message:t.message})));return this.data.contents.forEach((t,n)=>{let r=[...e,`contents`,String(n)];requireBuilderName(t.name,[...r,`name`]),t.type===`form`&&t.groups.forEach((e,t)=>requireBuilderName(e.name,[...r,`groups`,String(t),`name`])),sn(t,this.extensions[n],t.name,this.data.context,r)}),{kind:`view`,definition:cloneBuilderValue(this.data,e)}}};function detailView(e,t){return new X({name:e,label:t,object:void 0,context:`record`,contents:[]})}function listView(e,t){return new X({name:e,label:t,object:void 0,context:`collection`,contents:[]})}function isViewPiece(e){return`kind`in e&&e.kind===`view`}function isObjectPiece(e){return!(isViewPiece(e)||e instanceof M)}function assertPiece(e,t){if(typeof e!=`object`||!e)throw new j(`Unsupported bundle piece: ${t}`,[]);if(isViewPiece(e)||e instanceof M||typeof e.build==`function`)return;let n=e.name;throw new j(`Unsupported bundle piece: ${typeof n==`string`?n:String(t)}`,[])}function declarationOf$1(e){return e instanceof Y||e instanceof X?e.build():e}function isPage(e){return e.definition.context===`page`}function validateView(e){let t=w.safeParse(e);if(t.success)return t.data;let n=typeof e==`object`&&e&&`name`in e?String(e.name):`(unnamed)`,r=j.fromZodErrors(t.error.issues.map(e=>({path:e.path.map(String),message:e.message})));throw new j(`View "${n}" is invalid. ${r.message}`,r.errors)}function identityOf(e){return`${e.object??``}:${e.name}`}function assertUniqueIdentities(e,t){let n=new Set;for(let r of t){let t=identityOf(r);if(n.has(t))throw new D(e,r.name);n.add(t)}}function byIdentity(e){return(t,n)=>{let r=identityOf(e(t)),i=identityOf(e(n));return r<i?-1:+(r>i)}}async function hashBundlePieces(e){return sha256Hex(I({objects:[...e.objects].sort(byIdentity(e=>({name:e.name}))),views:[...e.views].sort(byIdentity(e=>e)),pages:[...e.pages].sort(byIdentity(e=>e.definition)),agents:[...e.agents].sort(byIdentity(e=>({name:e.name})))}))}async function builtBundleFromPieces(e){let t=e.name===J;t||assertBundleName(e.name);let{objects:n,pages:r,agents:i}=e,a=e.views.map(validateView),o=n.map(e=>e.name);if(assertUniqueIdentities(`object`,o.map(e=>({name:e}))),assertUniqueIdentities(`view`,a),assertUniqueIdentities(`page`,r.map(e=>e.definition)),assertUniqueIdentities(`agent`,i.map(e=>({name:e.name}))),!t){let e=o.find(Us);if(e!==void 0)throw new O(e,`bundle`)}return{name:e.name,label:e.label.trim(),description:e.description??null,hash:await hashBundlePieces({objects:n,views:a,pages:r,agents:i}),objects:n,views:a,pages:r,agents:i,uses:e.uses??[],samples:e.samples??[],translations:e.translations??{}}}const uu=Symbol.for(`standards.bundle`);function isBundle(e){return typeof e==`object`&&!!e&&e[uu]===!0}var BundleBuilder=class{constructor(e,t){this[uu]=!0,this.pieces=[],this.used=[],this.descriptionText=null,this.sampleRecords=[],this.translationTables={},this.built=null,assertBundleName(e),this.name=e,this.label=t,this.objectBuilders=[]}description(e){return this.descriptionText=e,this.changed()}add(...e){return this.pieces.push(...e),this.objectBuilders.push(...e.filter(isObjectPiece)),this.changed(),this}uses(...e){return this.used.push(...e),this.changed()}samples(e){return this.sampleRecords=e,this.changed()}translations(e,t){return this.translationTables[e]=t,this.changed()}build(){return this.built??=this.assemble(),this.built}changed(){return this.built=null,this}async assemble(){let e=[],t=[],n=[],r=[];for(let[i,a]of this.pieces.entries())if(assertPiece(a,i),a instanceof M)r.push(a.build());else if(isViewPiece(a)){let e=declarationOf$1(a);isPage(e)?n.push(e):t.push(e.definition)}else e.push(a.build());return this.assertNotInUsed(e),builtBundleFromPieces({name:this.name,label:this.label,description:this.descriptionText,objects:e,views:t,pages:n,agents:r,uses:this.used.map(e=>e.name),samples:this.sampleRecords,translations:{...this.translationTables}})}assertNotInUsed(e){let t=new Map,n=new Set([this]),visit=e=>{if(!n.has(e)){n.add(e);for(let n of e.objectBuilders){let r=n.build().name;t.has(r)||t.set(r,e.name)}for(let t of e.used)visit(t)}};for(let e of this.used)visit(e);for(let{name:n}of e){let e=t.get(n);if(e!==void 0)throw new D(`object`,n,`Object "${n}" is declared by bundle "${this.name}" and by its used bundle "${e}"`)}}};function bundle(e,t){return new BundleBuilder(e,t)}function readOnlyOption(e){return e?.readOnly===void 0?{}:{readOnly:e.readOnly}}function buildFreeFieldRef(e,t){return{type:`free`,attribute:e.build(),label:t?.label,required:t?.required,prefillExpression:t?.prefillExpression,...readOnlyOption(t)}}function buildSlotFieldRef(e,t,n){let[r,...i]=Array.isArray(e)?e:[e];return{type:`slot`,slotId:r,additionalSlotIds:i.length>0?i:void 0,attribute:t,label:n?.label,required:n?.required,tooltip:n?.tooltip,...readOnlyOption(n)}}const du=L.boolean().optional();var FormRowBuilder=class{constructor(e,t,n){this._finalized=!1,this.stepBuilder=e,this.rowData={id:t,order:n,type:`fields`,fields:[]}}field(e,t,n){return this.rowData.fields.push(buildSlotFieldRef(e,t,n)),this}freeField(e,t){return this.rowData.fields.push(buildFreeFieldRef(e,t)),this}row(e){return this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData).row(e)}heading(e,t){return this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData).heading(e,t)}separator(){return this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData).separator()}text(e){return this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData).text(e)}endRow(){return this._finalized?this.stepBuilder:(this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData))}},FormStepBuilder=class{constructor(e,t,n){this.rowOrder=0,this.formBuilder=e,this.stepData={id:t,label:n,rows:[]}}description(e){return this.stepData.description=e,this}field(e,t,n){this.rowOrder++;let r=`row-${this.stepData.id}-${this.rowOrder}`,i=buildSlotFieldRef(e,t,n),a={id:r,order:this.rowOrder,type:`fields`,fields:[i]};return this.stepData.rows.push(a),this}freeField(e,t){this.rowOrder++;let n=`row-${this.stepData.id}-${this.rowOrder}`,r=buildFreeFieldRef(e,t),i={id:n,order:this.rowOrder,type:`fields`,fields:[r]};return this.stepData.rows.push(i),this}row(e){return this.rowOrder++,new FormRowBuilder(this,e,this.rowOrder)}heading(e,t){this.rowOrder++;let n={id:`heading-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:`heading`,content:e,level:t};return this.stepData.rows.push(n),this}separator(){this.rowOrder++;let e={id:`sep-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:`separator`};return this.stepData.rows.push(e),this}text(e){this.rowOrder++;let t={id:`text-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:`text`,content:e};return this.stepData.rows.push(t),this}step(e,t){return this.formBuilder._finalizeStep(this.stepData).step(e,t)}build(){return this.formBuilder._finalizeStep(this.stepData).build()}_finalizeRow(e){return e.fields.length>0&&this.stepData.rows.push(e),this}_getData(){return this.stepData}},FormBuilder=class{constructor(e,t){this.data={slots:[],steps:[],status:`draft`,version:1},this.validateName(e),this.data.name=e,this.data.label=t}description(e){return this.data.description=e,this}icon(e){return this.data.icon=e,this}status(e){return this.data.status=e,this}metadata(e){return this.data.metadata=e,this}slot(e,t,n){if(this.data.slots.some(t=>t.id===e))throw Error(`[FormBuilder] Duplicate slot id: "${e}"`);let r={id:e,objectName:t,label:n.label,mode:n.mode??`create`,color:n.color,icon:n.icon};return this.data.slots.push(r),this}step(e,t){if(this.data.steps.some(t=>t.id===e))throw Error(`[FormBuilder] Duplicate step id: "${e}"`);return new FormStepBuilder(this,e,t)}build(){return this.validateRequiredData(),this.validateSlotReferences(),this.validateFreeFields(),this.validatePrefillExpressions(),this.validateReadOnly(),this.data}_finalizeStep(e){return this.data.steps.push(e),this}validateName(e){let t=L.string().min(1,`Form name cannot be empty`).max(63,`Form name is too long (max 63 characters)`).regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:`Invalid form name format. Name must be in kebab-case: 'client-onboarding', 'contact-creation'`});try{t.parse(e)}catch(e){throw e instanceof L.ZodError?Error(`[FormBuilder] ${e.issues[0].message}`):e}}validateRequiredData(){if(this.data.slots.length===0)throw Error(`[FormBuilder] At least one slot is required. Use .slot() to add slots.`);if(this.data.steps.length===0)throw Error(`[FormBuilder] At least one step is required. Use .step() to add steps.`)}validateSlotReferences(){let e=new Map(this.data.slots.map(e=>[e.id,e.objectName]));for(let t of this.data.steps)for(let n of t.rows)if(isFormFieldsRow(n))for(let r of n.fields){if(r.type!==`slot`)continue;let n=getSlotFieldTargets(r);for(let r of n)if(!e.has(r))throw Error(`[FormBuilder] Step "${t.id}" references unknown slot "${r}". Declare it with .slot("${r}", ...) first.`);let i=new Set(n.map(t=>e.get(t)));if(i.size>1)throw Error(`[FormBuilder] Step "${t.id}" field on attribute "${r.attribute}" targets slots of different objects (${[...i].join(`, `)}). A multi-slot field must target slots of the same object.`)}}validatePrefillExpressions(){let e=[...V,`join`,`where`];for(let t of this.data.steps)for(let n of t.rows)if(isFormFieldsRow(n))for(let r of n.fields){if(!isFormFreeFieldRef(r)||!r.prefillExpression)continue;let n=r.prefillExpression,i=`prefillExpression on free field "${r.attribute.name}" in step "${t.id}"`;if(!isLabelExpression(n))throw Error(`[FormBuilder] ${i} must contain at least one {{ attribute }} interpolation.`);if(/\{\{\s*\}\}/.test(n))throw Error(`[FormBuilder] ${i} contains empty {{ }} interpolation.`);for(let a of n.matchAll(/(?<!\|)\|(?!\|)\s*(\w+)(?:\s*:[^|}]*)?/g)){let n=a[1];if(!e.includes(n))throw Error(`[FormBuilder] ${i} uses invalid pipe "${n}". Valid pipes: ${e.join(`, `)}`);let o=a[0].replace(/^\|/,``);if(isWherePipe(o)&&!parseWherePipe(o))throw new j(`[FormBuilder] ${i} has a malformed where: pipe "${o.trim()}". Write where:property=value or where:property in (a,b).`,[{path:[t.id,r.attribute.name,`prefillExpression`],message:`Malformed where: pipe`}])}}}validateReadOnly(){for(let e of this.data.steps)for(let t of e.rows)if(isFormFieldsRow(t))for(let n of t.fields){if(du.safeParse(n.readOnly).success)continue;let t=isFormFreeFieldRef(n)?n.attribute.name:n.attribute,r=isFormFreeFieldRef(n)?`free field`:`field`;throw new j(`[FormBuilder] readOnly on ${r} "${t}" in step "${e.id}" must be a boolean.`,[{path:[e.id,t,`readOnly`],message:`Expected a boolean`}])}}validateFreeFields(){let e=new Set(z);for(let t of this.data.steps)for(let n of t.rows)if(isFormFieldsRow(n)){for(let r of n.fields)if(isFormFreeFieldRef(r)){let n=r.attribute.type;if(e.has(n))throw Error(`[FormBuilder] Free field in step "${t.id}" uses forbidden attribute type "${n}". Forbidden types: ${z.join(`, `)}`)}}}};function form(e,t){return new FormBuilder(e,t)}const fu=`box`,pu=[`circle`,`square`],mu=[`upload`,`website`,`name`,`email`];function isImageSource(e){return mu.some(t=>t===e)}const hu={object:[`icon`,`color`],record:[`icon`,`image`],emailCategory:[`icon`,`color`],option:[`color`],view:[`icon`],agent:[`color`],user:[`image`]};function imageFileIdOf(e){return`image`in e?e.image?.fileId:`imageFileId`in e?e.imageFileId:void 0}function resolveAppearance(e,t){let n=imageFileIdOf(e);if(n)return{kind:`image`,imageFileId:n,shape:t?.image?.shape??`square`};let r=t?.name??e.name,i=e.color??t?.color??(r?el(r):void 0),a=e.icon??t?.icon??`box`;return i?{kind:`tile`,icon:a,color:i}:{kind:`glyph`,icon:a}}const gu=L.object({shape:L.enum(pu),from:L.array(L.string().refine(e=>e.trim().length>0,`Must not be blank`)).optional()}).strict();function imageLookupKindOf(e){return e.type===`text`?e.format===`url`?`website`:e.format===`email`?`email`:`name`:null}function validateObjectImage(e){let t=e.image?.from;if(t===void 0)return;let refuse=(t,n)=>{throw new j(`Object "${e.name}": ${t}`,[{path:n===void 0?[`image`,`from`]:[`image`,`from`,String(n)],message:t}])};t.length===0&&refuse(`image.from must name at least one attribute`);let n=new Map((e.attributes??[]).map(e=>[e.name,e])),r=new Set;for(let[e,i]of t.entries()){r.has(i)&&refuse(`image.from names "${i}" twice`,e),r.add(i);let t=n.get(i);t?imageLookupKindOf(t)===null&&refuse(`image.from names "${i}", a ${t.type} attribute: only text attributes can locate an image`,e):refuse(`image.from names "${i}", which is not one of its attributes`,e)}}function validateObjectExpressions(e){let{name:t,labelExpression:n,embeddingExpression:r}=e;if(!n)throw new k(`Object "${t}" must have a labelExpression. The labelExpression defines how records are displayed in lists and relations (e.g. "{{ name }}").`,A.VALIDATION_FAILED);let i=H.safeParse(n);if(!i.success){let e=i.error.issues[0]?.message??`Invalid labelExpression`;throw new k(`Invalid labelExpression for "${t}": ${e}`,A.VALIDATION_FAILED)}if(r!==void 0){let e=H.safeParse(r);if(!e.success){let n=e.error.issues[0]?.message??`Invalid embeddingExpression`;throw new k(`Invalid embeddingExpression for "${t}": ${n}`,A.VALIDATION_FAILED)}}}var ObjectBuilder=class{get"~standard"(){return createStandardSchemaProps(Mc(this.build()))}constructor(e,t){this._sealed=!1,this._toleratedAttributes=[],this.validateName(e),this.obj={name:e,label:t,attributes:[],system:!0}}id(e){return this.obj.id=e,this}description(e){return this.obj.description=e,this}pluralLabel(e){return this._pluralLabel=e,this}icon(e){return this.obj.icon=e,this}color(e){return this.obj.color=e,this}image(e={}){return this.obj.image={shape:e.shape??`square`,...e.from===void 0?{}:{from:[...e.from]}},this}runtime(){return this.obj.system=!1,this}sealed(){return this._sealed=!0,this}tolerate(e){return this._toleratedAttributes=[...this._toleratedAttributes,...e],this}attribute(e){return this.pushAttributes([e]),this}attributes(e){return this.pushAttributes(e),this}pushAttributes(e){let t=e.map(e=>`build`in e&&typeof e.build==`function`?e.build():e);Vs([...this.obj.attributes,...t],e=>e.name,e=>new D(`attribute`,e,`Object "${this.obj.name}": duplicate attribute name "${e}"`)),this.obj.attributes.push(...t)}metadata(e){return this.obj.metadata={...this.obj.metadata,...e},this}order(e){return this.obj.metadata={...this.obj.metadata,order:e},this}hidden(){return this.obj.metadata={...this.obj.metadata,hidden:!0},this}labelExpression(e){return this._labelExpression=e,this}embeddingExpression(e){return this._embeddingExpression=e,this}documentLayout(e){if(e.presets)for(let t of e.presets)validatePresetStructure(t.id,t.structure,1);return this.obj.documentLayout=e,this}build(){if(!this.obj.name)throw new j(`[ObjectBuilder] Missing required field: name`,[{path:[`name`],message:`name is required`}]);if(!this.obj.label)throw new j(`[ObjectBuilder] Missing required field: label`,[{path:[`label`],message:`label is required`}]);return validateObjectExpressions({name:this.obj.name,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression}),validateObjectImage({name:this.obj.name,image:this.obj.image,attributes:this.obj.attributes}),{...this.obj,pluralLabel:this._pluralLabel,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression,sealed:this._sealed,toleratedAttributes:this._toleratedAttributes}}validateName(e){e!==void 0&&Xs(e)}};function object(e,t){if(Us(e))throw new O(e,`builder`);return new ObjectBuilder(e,t)}function validatePresetStructure(e,t,n){let fail=(t,n)=>{throw new j(t,[{path:[`documentLayout`,`presets`,e],message:n}])};n>5&&fail(`Preset structure exceeds max depth of 5`,`Preset structure too deep`);let r=new Set;for(let i of t){let t=i.title.trim();t.length===0&&fail(`Folder preset node title is required`,`Empty folder title`),t.includes(`/`)&&fail(`Folder preset node title cannot contain /`,`Folder title contains /: "${t}"`),r.has(t)&&fail(`Folder preset sibling titles must be unique`,`Duplicate folder title: "${t}"`),r.add(t),i.children&&i.children.length>0&&validatePresetStructure(e,i.children,n+1)}}function relationProperty(e){return requireBuilderName(e,[`relationProperty`]),{relationProperty:e}}var Z=class ContentBuilder{constructor(e,t){this.data=cloneBuilderValue(e,[`content`]),this.extension=t===void 0?void 0:Object.freeze({name:t.name,contexts:t.contexts,parameters:t.parameters,refine:t.refine})}set(e){return new ContentBuilder({...this.data,...e},this.extension)}icon(e){return this.set({icon:e})}object(e){return this.set({objectName:e})}layout(e){let{layout:t,groupByAttribute:n,columnSizing:r,kanbanColumnOrder:i,kanbanColumnVisibility:a,kanbanPinnedColumns:o,...s}={...this.data,layout:void 0,groupByAttribute:void 0,columnSizing:void 0,kanbanColumnOrder:void 0,kanbanColumnVisibility:void 0,kanbanPinnedColumns:void 0};return new ContentBuilder({...s,...e},this.extension)}table(){return this.layout({layout:`table`})}list(){return this.layout({layout:`list`})}kanban(e){return this.layout({layout:`kanban`,groupByAttribute:e})}columns(...e){return this.set({columns:e})}actions(...e){return this.set({actions:e})}openMode(e){return this.set({openMode:e})}createMode(e){return this.set({createMode:e})}visibility(e){return this.set({visibility:e})}descriptionAttribute(e){return this.set({descriptionAttribute:e})}displayAttributes(...e){return this.set({displayAttributes:e})}columnSizing(e){return this.set({columnSizing:e})}kanbanColumnOrder(...e){return this.set({kanbanColumnOrder:e})}kanbanColumnVisibility(e){return this.set({kanbanColumnVisibility:e})}kanbanPinnedColumns(...e){return this.set({kanbanPinnedColumns:e})}formColumns(e){return this.set({formColumns:e})}density(e){return this.set({density:e})}titleAttribute(e){return this.set({titleAttribute:e})}allowUpload(e){return this.set({allowUpload:e})}allowRemove(e){return this.set({allowRemove:e})}hideAttachments(e){return this.set({hideAttachments:e})}relations(...e){return this.set({relations:e})}span(e){return spanContent(this,e)}height(e){return this.set({height:e})}build(){let e=validateLiteralContent(this.data,[`content`]);return this.extension&&e.type===`custom`&&T(this.extension,e.parameters,[`content`,`parameters`]),e}},_u=class GroupBuilder{constructor(e,t,n,r={}){this.data=cloneBuilderValue({name:e,label:t,fields:n,...r},[`group`])}field(e,t){let{name:n,label:r,fields:i,...a}=this.data;return new GroupBuilder(n,r,[...i,{attribute:e,...t}],a)}fields(...e){let{name:t,label:n,fields:r,...i}=this.data;return new GroupBuilder(t,n,[...r,...e.map(e=>({attribute:e}))],i)}description(e){return new GroupBuilder(this.data.name,this.data.label,this.data.fields,{...this.presentation(),description:e})}collapsible(e=!1){return new GroupBuilder(this.data.name,this.data.label,this.data.fields,{...this.presentation(),collapsible:!0,collapsed:e})}presentation(){let{name:e,label:t,fields:n,...r}=this.data;return r}build(){requireBuilderName(this.data.name,[`group`,`name`]);try{validateLiteralContent({type:`form`,groups:[this.data]},[`group`])}catch(e){throw e instanceof j?new j(e.message,e.errors.map(e=>({...e,path:e.path[1]===`groups`?[`group`,...e.path.slice(3)]:e.path}))):e}return cloneBuilderValue(this.data,[`group`])}};function group(e,t){return new _u(e,t,[])}function collection(e){return new Z({type:`collection`,...storedQuery(e,`collection`)})}function form$1(...e){return new Z({type:`form`,groups:e.map(e=>`build`in e?e.build():e)})}function activity(){return new Z({type:`activity`})}function richtext$1(e){return new Z({type:`richtext`,attribute:e})}function documents(){return new Z({type:`documents`})}function forms(){return new Z({type:`forms`})}function emails(...e){return new Z({type:`emails`,emailAttributes:e})}function meetings(...e){return new Z({type:`meetings`,emailAttributes:e})}function custom(e,t){if(typeof e!=`object`||!e||typeof e.name!=`string`)throw new j(`Expected registered extension declaration`,[{path:[`content`,`extension`],message:`Expected registered extension declaration`}]);let n=validateContentConfiguration({type:`custom`,extension:e.name,parameters:t},[`content`]);if(n.type!==`custom`)throw new j(`Expected custom content`,[]);let r=new Z({...n,extension:e.name},e);return r.build(),r}function recordLinksTab(){return[x.name,x.label,custom(Me,{}).icon(x.icon)]}function page$1(e){let{object:t,name:n}=e.definition;if(typeof t!=`string`){let e=`Page "${n}" is standalone; a record tab renders a record page (\`page(...).for(object)\`)`;throw new j(e,[{path:[`content`,`page`,`object`],message:e}])}return new Z({type:`page`,page:{object:t,name:n}})}const vu={collection,metric,chart,agenda,card,text:text$1,inbox,meetingsUpcoming,mailbox,page:page$1,form:form$1,activity,richtext:richtext$1,documents,forms,emails,meetings,custom};function contentDefinition(e,t){if(t.suppressed)return null;let n=t.workspaceDefinition??t.sourceDefinition;return n===null?null:{...structuredClone(n),name:e}}function storedContentDefinition(e){let{name:t,...n}=e;return structuredClone(n)}function workspaceViewAuthoring(e,t={}){let n={main:0,aside:0};return{origin:`runtime`,mainOrderCustomized:!1,asideOrderCustomized:!1,gridCustomized:Object.keys(t).length>0,homeCustomized:!1,contents:Object.fromEntries(e.map(e=>[e.name,{sourceDefinition:null,workspaceDefinition:storedContentDefinition(e),suppressed:!1,sourcePosition:null,workspacePosition:e.placement===`grid`?null:n[e.placement]++,sourceGrid:null,workspaceGrid:t[e.name]??null}]))}}function byKind(e,t){let rank=e=>Number(e.definition.type===`group`);return rank(e)-rank(t)||e.name.localeCompare(t.name)}function inReadingOrder(e){return(t,n)=>{let r=e(t.name),i=e(n.name);return r===null||i===null?r===i?byKind(t,n):r?-1:1:r.y-i.y||r.x-i.x||byKind(t,n)}}function overLimit(e,t){let n=new Set;if(e.length<=N.tabsPerView)return n;let r=new Map(e.map(e=>[e.name,e])),i=new Map;for(let{name:t,definition:n}of e)if(n.type===`group`)for(let e of n.members)i.has(e)||i.set(e,t);let cellOf=e=>{let n=r.get(e),a=n?t(n.state):null;if(a!==null)return a;let o=r.get(i.get(e)??``);return o?t(o.state):null},a=e.filter(e=>e.state.sourceDefinition===null).sort(inReadingOrder(cellOf)).reverse();for(let t of a){if(e.length-n.size<=N.tabsPerView)break;if(n.has(t.name))continue;let i=t.definition.type===`group`?t.definition.members.flatMap(e=>{let t=r.get(e);return t&&t.definition.type!==`group`?[t]:[]}):[];if(!i.some(e=>e.state.sourceDefinition!==null))for(let e of[t,...i])n.add(e.name)}return n}function resolvePageGrid(e,t={}){let rawCell=t=>e.gridCustomized||t.sourceDefinition===null?t.workspaceGrid:t.sourceGrid,n=Object.entries(e.contents).flatMap(([e,t])=>{let n=contentDefinition(e,t);return n?[{name:e,state:t,definition:n}]:[]}),r=qt(n.map(e=>e.definition)),i=n.filter(e=>!r.has(e.name)).sort((e,t)=>e.name.localeCompare(t.name)),a=overLimit(i,rawCell),o=i.filter(e=>!a.has(e.name)),s=new Map(o.map(e=>[e.name,e.definition])),c=t.traitsOf??en(s,C),l=Et([...s.values()]),u=o.filter(e=>!l.has(e.name)),d={},f=[],place=(e,t)=>{t&&!Object.values(d).some(e=>$t(t,e))?d[e]={...t}:f.push(e)};if(e.gridCustomized)for(let{name:e,state:t}of u)place(e,t.workspaceGrid);else{for(let{name:e,state:t}of u)t.sourceDefinition!==null&&place(e,t.sourceGrid);for(let{name:e,state:t}of u)t.sourceDefinition===null&&place(e,t.workspaceGrid)}let p=Math.max(0,...Object.values(d).map(e=>e.y+e.h));for(let t of f.sort()){let n=e.contents[t],{w:r,h:i}=n.workspaceGrid??n.sourceGrid??c(t).size;d[t]={x:0,y:p,w:r,h:i},p+=i}let m=repairPageGrid(Object.entries(d).map(([e,n])=>({i:e,...n,...t.statics?.has(e)?{static:!0}:{}})),c);return{grid:Object.fromEntries(m.cells.map(({i:e,x:t,y:n,w:r,h:i})=>[e,{x:t,y:n,w:r,h:i}])),repairs:[...[...a].map(e=>({name:e,kind:`dropped`})),...m.repairs]}}function droppedContents(e){return new Set(e.flatMap(e=>e.kind===`dropped`?[e.name]:[]))}function resolveViewContents(e){let t=Object.entries(e.contents).flatMap(([e,t])=>{let n=contentDefinition(e,t);return n?[{definition:n,...t}]:[]}),n=[`main`,`aside`].flatMap(n=>{let r=n===`main`?e.mainOrderCustomized:e.asideOrderCustomized;return t.filter(e=>e.definition.placement===n).sort((e,t)=>{let n=r?e.workspacePosition:e.sourcePosition,i=r?t.workspacePosition:t.sourcePosition;if(n!==null&&i!==null&&n!==i)return n-i;if(n!==null&&i===null)return-1;if(i!==null&&n===null)return 1;let a=e.sourcePosition??e.workspacePosition,o=t.sourcePosition??t.workspacePosition;return a!==null&&o!==null&&a!==o?a-o:a!==null&&o===null?-1:o!==null&&a===null?1:e.definition.name.localeCompare(t.definition.name)}).map(e=>e.definition)}),r=qt(t.map(e=>e.definition)),i=t.filter(e=>e.definition.placement===`grid`&&!r.has(e.definition.name)).map(e=>e.definition).sort((e,t)=>e.name.localeCompare(t.name));return[...n,...i]}const yu=[`record`,`document`,`file`,`email`,`thread`,`event`,`memory`,`skill`,`schema`,`user`,`guide`,`bundle`,`draft`],bu=new Set([`memory`,`schema`]),xu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function isReferenceKind(e){return yu.includes(e)}function refuse$1(e,t){return{ok:!1,reason:e,expected:t}}function parseReference(e){let t=e.trim();if(xu.test(t))return refuse$1(`bare_uuid`,`record:<id>`);let n=t.indexOf(`:`);if(n===-1)return refuse$1(`malformed`,`<kind>:<id>`);let r=t.slice(0,n).toLowerCase();if(!isReferenceKind(r))return refuse$1(`unknown_kind`,`<kind>:<id> with kind one of ${yu.join(`, `)}`);let i=t.slice(n+1).trim();return i===``?refuse$1(`malformed`,`${r}:<id>`):r===`record`&&i.includes(`:`)?refuse$1(`legacy_mention`,`record:${i.slice(i.lastIndexOf(`:`)+1)}`):i===`*`&&!bu.has(r)?refuse$1(`malformed`,`${r}:<id>`):{ok:!0,ref:{kind:r,id:i}}}function formatReference(e){return`${e.kind}:${e.id}`}function isWildcard(e){return e.id===`*`&&bu.has(e.kind)}function requestedCapabilities(e){let t=[];return e.canModify&&t.push(`modify`),e.canSend&&t.push(`send`),t}const Su={status:`connector_status`,error:`connector_error`,provider:`connector_provider`},Cu={phone:`text`,currency:`number`},wu={rename:[`kind`,`object`,`from`,`to`],phone:[`kind`,`object`,`attribute`,`to`,`defaultCountryCode`],currency:[`kind`,`object`,`attribute`,`to`,`currencyCode`]};function refuse(e,t,n){throw new j(n,[{path:t===void 0?[`resolutions`,String(e)]:[`resolutions`,String(e),t],message:n}])}function assertKeys(e,t,n){for(let r of n)(typeof t[r]!=`string`||t[r]===``)&&refuse(e,r,`Resolution ${e} needs a non-empty string \`${r}\``);let r=Object.keys(t).find(e=>!n.includes(e));r!==void 0&&refuse(e,r,`Resolution ${e} has an unknown field \`${r}\``)}function assertResolution(e,t){if(Ws(t)||refuse(e,void 0,`Resolution ${e} must be an object`),t.kind===`rename`){assertKeys(e,t,wu.rename),t.from===t.to&&refuse(e,`to`,`Resolution ${e} renames "${t.from}" to itself`);return}if(t.kind!==`retype`&&refuse(e,`kind`,`Unknown resolution kind ${JSON.stringify(t.kind)}: expected "rename" or "retype"`),t.to!==`phone`&&t.to!==`currency`&&refuse(e,`to`,`Unsupported retype to ${JSON.stringify(t.to)}: a push converts text → phone and number → currency only`),assertKeys(e,t,wu[t.to]),t.to===`phone`){let n=t.defaultCountryCode;/^[A-Z]{3}$/.test(n)&&rl(n)||refuse(e,`defaultCountryCode`,`Resolution ${e}: "${n}" is not an ISO 3166-1 alpha-3 country code`);return}let n=t.currencyCode;/^[A-Z]{3}$/.test(n)&&nl(n)||refuse(e,`currencyCode`,`Resolution ${e}: "${n}" is not a supported ISO 4217 currency code`)}function addressesOf(e){return e.kind===`rename`?{reads:e.from,lands:e.to}:{reads:e.attribute,lands:e.attribute}}function assertSchemaSourceResolutions(e){if(!Array.isArray(e))throw new j("`resolutions` must be an array",[{path:[`resolutions`],message:"`resolutions` must be an array"}]);if(e.length>100)throw new j(`A push carries ${e.length} resolutions; the limit is 100`,[]);let t=new Set;for(let[n,r]of e.entries()){assertResolution(n,r);let{reads:e,lands:i}=addressesOf(r);for(let[a,o]of[[`${r.kind}:${r.object}.${e}`,`of "${r.object}.${e}"`],[`${r.kind}>${r.object}.${i}`,`onto "${r.object}.${i}"`]])t.has(a)&&refuse(n,void 0,`Resolution ${n} repeats a ${r.kind} ${o}`),t.add(a)}}function phoneFromText(e,t){let n=e.trim();if(n===``)return{value:null};let r=il(n,Zc(t));if(!r?.isPossible()||r.country===void 0||r.ext!==void 0)return;let i=tl(r.country)?.iso3;if(i!==void 0)return{value:{countryCode:i,phoneNumber:$c(n,i)}}}function convertRetypedValue(e,t,n={}){if(t===null)return{value:null};if(e.to===`phone`)return typeof t==`string`?phoneFromText(t,e.defaultCountryCode):void 0;if(typeof t==`number`&&Math.abs(t)<=2**53-1&&!(t<0&&n.allowNegative!==!0))return{value:{code:e.currencyCode,value:t}}}const Q=L.string().refine(e=>e.trim().length>0,`Must not be blank`),Tu=L.union([L.tuple([L.literal(`object`),Q]),L.tuple([L.literal(`attribute`),Q,Q]),L.tuple([L.literal(`view`),Q,Q]),L.tuple([L.literal(`content`),Q,Q,Q])]),Eu=L.object({label:Q,pluralLabel:L.string().optional(),description:L.string().optional(),icon:P.optional(),color:Hs.optional(),image:gu.optional(),labelExpression:L.string(),embeddingExpression:L.string().optional(),sealed:L.boolean().optional(),toleratedAttributes:L.array(Q).optional(),metadata:L.record(L.string(),L.unknown()).optional(),documentLayout:L.record(L.string(),L.unknown()).optional()}).strict();function failure(e){throw new j(e,[])}function definitionSchema(e){return L.custom(t=>{let n=L.record(L.string(),L.unknown()).parse(t);for(let t of e[0]===`view`?[`object`,`name`]:[`name`])Object.hasOwn(n,t)&&failure(`Invalid schema state: unrecognized definition key ${t}`);switch(e[0]){case`object`:Eu.parse(n);break;case`attribute`:{let e=L.enum(fe).parse(n.type);ic(e).extend({type:L.literal(e),label:Q,required:L.boolean().optional(),unique:L.boolean().optional(),icon:P.optional()}).strict().parse(n);break}case`view`:{let{contents:t,...r}=n,i=L.array(Q).parse(t);new Set(i).size!==i.length&&failure(`Invalid schema state: duplicate content membership`),at.parse({...r,object:e[1],name:e[2],contents:[]});break}case`content`:E.parse({...n,name:e[3]})}return!0})}function compareSchemaStateEntries(e,t){let n=JSON.stringify(e.address),r=JSON.stringify(t.address);return n<r?-1:+(n>r)}function schemaStateSourcePayload(e){return{modelVersion:1,hashVersion:1,entries:[...e].sort(compareSchemaStateEntries).filter(e=>e.source!==null).map(({address:e,source:t})=>({address:e,source:t}))}}function parseState(e){let t=L.record(L.string(),L.unknown()).parse(e);for(let[e,n]of[[`modelVersion`,`model`],[`hashVersion`,`hash`]])t[e]!==1&&failure(`Unsupported schema ${n} version: expected 1, received ${t[e]===void 0?`missing`:String(t[e])}`);let n=L.object({modelVersion:L.literal(1),hashVersion:L.literal(1),tenant:Q,sourceFingerprint:L.string().regex(/^[a-f0-9]{64}$/),entries:L.array(L.unknown())}).strict().safeParse(e);if(!n.success){let e=n.error.issues.find(e=>e.code===`unrecognized_keys`);throw e?.code===`unrecognized_keys`&&failure(`Invalid schema state: unrecognized key ${e.keys[0]}`),j.fromZodErrors(n.error.issues.map(e=>({path:e.path.map(String),message:e.message})))}let r=new Set,i=n.data.entries.map(e=>{let t=Tu.parse(L.object({address:L.unknown()}).parse(e).address),n=JSON.stringify(t);r.has(n)&&failure(`Invalid schema state: duplicate address ${n}`),r.add(n);let i=definitionSchema(t).nullable(),a=t[0]===`object`||t[0]===`attribute`?L.object({id:L.string().uuid(),updatedAt:L.string().datetime()}).strict():L.object({id:L.string().uuid(),revision:L.number().int().nonnegative()}).strict(),o=L.object({address:Tu,source:i,effective:i,status:L.enum([`source`,`runtime`,`copy`,`suppressed`]),sourceOwner:L.string().regex(B).nullable(),guard:a.nullable()}).strict().parse(e);return(o.status===`runtime`&&(o.source!==null||o.effective===null||o.sourceOwner!==null)||o.status===`suppressed`&&(t[0]!==`content`||o.source===null||o.effective!==null||o.guard===null)||o.status===`copy`&&(o.source===null||o.effective===null)||o.effective!==null&&o.guard===null||o.source===null&&o.effective===null)&&failure(`Invalid schema state: inconsistent status at ${n}`),{...o,sourceOwner:parseSchemaOwner(o.sourceOwner)}});return{...n.data,entries:i.sort(compareSchemaStateEntries)}}function parseSchemaState(e){try{return parseState(e)}catch(e){throw e instanceof L.ZodError?j.fromZodErrors(e.issues.map(e=>({path:e.path.map(String),message:e.message}))):e}}function diffSchemaState(e){let t=[];for(let n of[...e.entries].sort(compareSchemaStateEntries)){let e=n.source===null?`added`:n.status===`suppressed`?`suppressed`:n.effective===null?`removed`:I(n.source)===I(n.effective)?n.status===`copy`?`copied`:null:`changed`;e&&t.push({...n,change:e})}return{modelVersion:1,tenant:e.tenant,sourceFingerprint:e.sourceFingerprint,changes:t}}const $=L.string().min(1),Du=L.union([L.object({objectName:$,viewName:$,contentName:$.optional()}).strict().describe(`Full configuration of a view, or of one content when contentName is given`),L.object({objectId:$}).strict().describe(`An object with its attributes, by id`),L.object({objectName:$}).strict().describe(`An object with its attributes`),L.object({objectId:$,attributeName:$}).strict().describe(`One attribute's config, by name`),L.object({objectId:$,attributeId:$}).strict().describe(`One attribute's config, by id`),L.object({objectId:$,recordId:$}).strict().describe(`One sample record`)]);function parseNamedTarget(e){let t=Du.safeParse(e);if(!t.success)throw new j(`Invalid scoped target`,[{path:[`target`],message:`Expected exactly one named target branch`}]);return t.data}const Ou=[`object`,`attribute`,`view`,`content`,`sample`],ku=L.object({mode:L.enum([`inline`,`window`]),interaction:L.enum([`static`,`interactive`]),size:L.enum([`compact`,`regular`]),aspectRatio:L.number().positive().finite().optional()}).strict(),Au=L.object({artifactId:L.string().min(1),revision:L.number().int().positive(),name:L.string().min(1),kind:L.string().min(1),retention:L.enum(Pl),display:ku}).strict();function readArtifactResult(e){let t=Au.safeParse(e);return t.success?t.data:null}const ju=L.string().regex(/^[^/\s]+\/[^/\s]+$/),Mu=L.object({kind:L.literal(`generated-image`),artifact:L.unknown(),generation:L.object({attemptId:L.uuid(),requestedModelId:ju,executedModelId:ju.nullable(),format:L.enum(Bl),mimeType:L.enum([`image/png`,`image/jpeg`,`image/webp`])}).strict()}).strict();function readGeneratedImageResult(e){let t=Mu.safeParse(e);if(!t.success)return null;let n=readArtifactResult(t.data.artifact);return!n||n.kind!==`image`?null:{...t.data,artifact:{...n,kind:`image`}}}function isCompletedToolPart(e){return e.type===`tool`&&e.state===`completed`}function readString(e,t){let n=e[t];return typeof n==`string`?n:void 0}function upsertWithPrecedence(e,t,n,r){let i=e.get(t),a=i&&r[i.kind]>r[n.kind]?i:n;e.delete(t),e.set(t,a)}function asRecord(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function readRefId(e,t,n){let r=readString(e,t),i=`${n}:`;return r?.startsWith(i)&&r.length>i.length?r.slice(i.length):void 0}function verbResultEntries(e){let t=asRecord(e);if(!t)return[];let n=[t];for(let e of[`members`,`created`,`updated`]){let r=t[e];if(Array.isArray(r))for(let e of r){let t=asRecord(e);t&&n.push(t)}}return n.filter(e=>!(`error`in e))}const Nu={created:1,modified:0};function readSingleRecordEntry(e){if(typeof e!=`object`||!e)return null;let t=e,n=typeof t.record==`object`&&t.record!==null?t.record:void 0,r=(n&&readString(n,`id`))??readString(t,`recordId`);return r?{id:r,label:(n&&readString(n,`label`))??r,objectName:(n&&readString(n,`objectName`))??``}:null}function readBulkRecordEntries(e,t,n){if(typeof e!=`object`||!e)return[];let r=e[t];if(!Array.isArray(r))return[];let i=[];for(let e of r){if(typeof e!=`object`||!e)continue;let t=e,r=readString(t,`id`);r&&i.push({id:r,label:readString(t,`label`)??r,objectName:readString(t,`objectName`)??n})}return i}function readVerbRecordEntries(e){let t=asRecord(asRecord(e.result)?.record),n=readString(e.args,`object`)??(t&&readString(t,`objectName`))??``,r=[];for(let t of verbResultEntries(e.result)){let e=readRefId(t,`ref`,`record`);e&&r.push({id:e,label:readString(t,`title`)||readString(t,`label`)||e,objectName:readString(t,`objectName`)??n})}return r}function extractTouchedRecords(e){let t=new Map;for(let n of e)if(n.role===`assistant`)for(let e of n.parts){if(!isCompletedToolPart(e))continue;let n=[],r;if(e.name===`create_record`||e.name===`update_record`||e.name===`edit_content`){let t=readSingleRecordEntry(e.result);n=t?[t]:[],r=e.name===`create_record`?`created`:`modified`}else if(e.name===`bulk_create_records`||e.name===`bulk_update_records`){let t=readString(e.args,`objectId`)??``,i=e.name===`bulk_create_records`?`created`:`updated`;n=readBulkRecordEntries(e.result,i,t),r=e.name===`bulk_create_records`?`created`:`modified`}else if(e.name===`write`)n=readVerbRecordEntries(e),r=readString(e.args,`action`)===`create`?`created`:`modified`;else continue;for(let e of n){let n={recordId:e.id,objectName:e.objectName,label:e.label,kind:r};upsertWithPrecedence(t,e.id,n,Nu)}}return[...t.values()]}const Pu={modified:1,consulted:0};function isFilePart(e){return e.type===`file`}function entryFromDocumentMutation(e,t){if(typeof e.result!=`object`||e.result===null)return null;let n=e.result,r=readString(n,`documentId`)??(t===`folderId`?readString(n,t):void 0);return r?{id:r,title:readString(e.args,`name`)??readString(e.args,`title`)??r,kind:`modified`}:null}function entryFromReadDocument(e){let t=readString(e.args,`documentId`);return t?{id:t,title:t,kind:`consulted`}:null}function entryFromRef(e,t,n){let r=readRefId(e,`ref`,`file`),i=r??readRefId(e,`ref`,`document`);return i?{id:i,...r?{fileId:r}:{},title:n||readString(e,`title`)||i,kind:t,mimeType:readString(e,`mimeType`)}:null}function entriesFromOrganize(e){let t=asRecord(e.result);if(!t||`error`in t)return[];let n=readString(e.args,`action`),r=readString(e.args,`name`)??readString(e.args,`title`),i=readString(t,`documentId`);if(i)return[{id:i,title:r??i,kind:`modified`}];let a=readString(t,`folderId`);if(a)return n===`create_folder`?[{id:a,title:r??a,kind:`modified`}]:[];let o=entryFromRef(t,`modified`,r);return o?[o]:[]}function entriesFromCopy(e){let t=asRecord(e.result);if(!t||`error`in t)return[];let n=(Array.isArray(t.copied)?t.copied:[]).flatMap(e=>{let t=asRecord(e),n=t?entryFromRef(t,`modified`,void 0):null;return n?[n]:[]});if(n.length>0)return n;let r=entryFromRef(t,t.ref!==void 0&&t.ref===readString(e.args,`from`)?`consulted`:`modified`,void 0);return r?[r]:[]}function entriesFromRead(e){let t=asRecord(e.result);return(Array.isArray(t?.members)?t.members:[]).flatMap(e=>{let t=asRecord(e);if(!t||`error`in t||!readRefId(t,`ref`,`document`))return[];let n=entryFromRef(t,`consulted`,void 0);return n?[n]:[]})}function entriesFromToolPart(e){switch(e.name){case`organize`:return entriesFromOrganize(e);case`copy`:return entriesFromCopy(e);case`read`:return entriesFromRead(e);default:{let t=entryFromToolPart(e);return t?[t]:[]}}}function entryFromSandboxUpload(e){if(typeof e.result!=`object`||e.result===null)return null;let t=e.result,n=readString(t,`fileId`);return n?{id:n,fileId:n,title:readString(t,`title`)??n,kind:`modified`,mimeType:readString(t,`mimeType`)}:null}function entryFromToolPart(e){switch(e.name){case`update_document`:case`attach_file`:return entryFromDocumentMutation(e,`documentId`);case`create_folder`:return entryFromDocumentMutation(e,`folderId`);case`read_document`:return entryFromReadDocument(e);case`sandbox_upload_file`:return entryFromSandboxUpload(e);default:return null}}function extractTouchedDocuments(e){let t=new Map;for(let n of e)if(n.role===`assistant`){for(let e of n.parts)if(isCompletedToolPart(e))for(let n of entriesFromToolPart(e))upsertWithPrecedence(t,n.id,n,Pu);else if(isFilePart(e)&&e.fileId){let n={id:e.fileId,fileId:e.fileId,title:e.name||e.fileId,kind:`modified`,mimeType:e.mimeType};upsertWithPrecedence(t,n.id,n,Pu)}}return[...t.values()]}function extractTouchedArtifacts(e){let t=new Map;for(let n of e)if(n.role===`assistant`)for(let e of n.parts){if(!isCompletedToolPart(e)||e.error)continue;let n=e.name===`generate_image`?readGeneratedImageResult(e.result)?.artifact:e.name===`publish_artifact`?readArtifactResult(e.result):null;if(!n)continue;let r=`${n.artifactId}:${n.revision}`;t.delete(r),t.set(r,n)}return[...t.values()]}function isNonBlankString(e){return typeof e==`string`&&/\S/u.test(e)}const Fu=L.object({provider:L.custom(e=>isNonBlankString(e)&&e.length<=200,{message:`must be a non-blank string of at most 200 characters`}),model:L.string().max(200).regex(/\S/u)});function normalizeNewsLocale(e){return e.toLowerCase().split(`-`)[0]===`fr`?`fr`:`en`}function resolveLocalized(e,t){return e[normalizeNewsLocale(t)]||(e.en?e.en:e.fr||void 0)}function hasLocale(e){return!!(e.fr||e.en)}const Iu=Object.keys({home:!0,agents:!0,routines:!0,object:!0,settings:!0}),Lu=[`dot`,`label`,`bubble`];function parseNewsIntensity(e){return Lu.find(t=>t===e)??`dot`}function parseNewsTarget(e){let[t,...n]=e.split(`:`),r=n.join(`:`);switch(t){case`home`:case`agents`:case`routines`:return r===``?{kind:t}:null;case`object`:return r?{kind:t,name:r}:null;case`settings`:return r?{kind:t,section:r}:null;default:return null}}function formatNewsTarget(e){return e.kind===`object`?`object:${e.name}`:e.kind===`settings`?`settings:${e.section}`:e.kind}function withoutTrailingSlashes(e){let t=e.length;for(;t>0&&e[t-1]===`/`;)--t;return e.slice(0,t)}const Ru=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;function compareIdentifiers(e,t){let n=/^\d+$/.test(e),r=/^\d+$/.test(t);return n&&r?Math.sign(Number(e)-Number(t)):n?-1:r?1:e<t?-1:+(e>t)}function compareVersions(e,t){let n=Ru.exec(e),r=Ru.exec(t);if(!(n&&r))return null;for(let e=1;e<=3;e+=1){let t=Number(n[e])-Number(r[e]);if(t!==0)return t<0?-1:1}let i=n[4],a=r[4];if(i===void 0&&a===void 0)return 0;if(i===void 0)return 1;if(a===void 0)return-1;let o=i.split(`.`),s=a.split(`.`);for(let e=0;e<Math.max(o.length,s.length);e+=1){let t=o[e],n=s[e];if(t===void 0)return-1;if(n===void 0)return 1;let r=compareIdentifiers(t,n);if(r!==0)return r<0?-1:1}return 0}function isSemver(e){return Ru.test(e)}const zu=30,Bu=90,Vu=50,Hu=L.looseObject({fr:L.string().optional(),en:L.string().optional()}),Uu=L.iso.datetime({offset:!0}),Wu=L.looseObject({id:L.string().min(1),slug:L.string().min(1),updatedAt:Uu,publishedAt:Uu,since:L.string(),displayDays:L.number().int().positive().optional(),requires:L.looseObject({capability:L.string(),level:L.string()}).optional(),target:L.string().optional(),intensity:L.unknown().optional(),title:Hu,summary:Hu});function knownRequirement(e){let t=G.find(t=>t.id===e.capability);return t!==void 0&&levelActions(t,e.level).length>0}function parseEntry(e){let t=Wu.safeParse(e);if(!t.success)return`malformed entry: ${t.error.issues[0]?.message??`invalid`}`;let n=t.data;if(!isSemver(n.since))return`entry ${n.id}: since "${n.since}" is not semver`;if(!hasLocale(n.title))return`entry ${n.id}: title has no locale`;if(!hasLocale(n.summary))return`entry ${n.id}: summary has no locale`;if(n.requires&&!knownRequirement(n.requires))return`entry ${n.id}: unknown requirement ${n.requires.capability}/${n.requires.level}`;let r=n.target?parseNewsTarget(n.target):null;return{...n,displayDays:n.displayDays??30,intensity:parseNewsIntensity(n.intensity),target:r??void 0}}function httpsUrl(e){return typeof e==`string`&&e.startsWith(`https://`)?e:void 0}function parseNewsIndex(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw new j(`News feed: document must be an object`,[]);let n=e;if(!Array.isArray(n.entries))throw new j(`News feed: entries must be an array`,[]);let r=[];for(let e of n.entries){let n=parseEntry(e);typeof n==`string`?t?.(n):r.push(n)}let i=httpsUrl(n.blogUrl),a=httpsUrl(n.mediaBaseUrl),o=a?withoutTrailingSlashes(a):void 0;return{...i?{blogUrl:i}:{},...o?{mediaBaseUrl:o}:{},entries:r.slice(0,50)}}const Gu=L.looseObject({id:L.string().min(1),slug:L.string().min(1),updatedAt:Uu,body:Hu});function parseNewsBody(e){let t=Gu.safeParse(e);if(!t.success)throw new j(`News body: malformed document`,[]);if(!hasLocale(t.data.body))throw new j(`News body: body needs at least one locale`,[]);return t.data}function preference(e,t){return{key:e,value:t.value,default:t.default,audited:t.audited??!1,...t.parameter===void 0?{}:{parameter:t.parameter},...t.parameters===void 0?{}:{parameters:t.parameters},...t.refine===void 0?{}:{refine:t.refine}}}const Ku=``;function refusal(e,t){return{ok:!1,field:e,message:t,issues:[{path:[e],message:t}]}}function declarationOf(e,t){return`get`in e?e.get(t):e.find(e=>e.key===t)}function locatePreference(e,t,n){let r=declarationOf(e,t);return r?r.parameter===void 0?n===void 0?{ok:!0,declaration:r,parameter:``}:refusal(`parameter`,`Preference "${t}" takes no parameter`):n===void 0||n===``||n.trim()!==n?refusal(`parameter`,`Preference "${t}" is keyed by ${r.parameter}`):r.parameters&&!r.parameters.includes(n)?refusal(`parameter`,`"${n}" is not a ${r.parameter} of "${t}"`):{ok:!0,declaration:r,parameter:n}:refusal(`key`,`Unknown preference "${t}"`)}function judgePreferenceWrite(e,t,n,r){let i=locatePreference(e,t,n);if(!i.ok)return i;let a=i.declaration.value.safeParse(r);if(a.success){let e=i.declaration.refine?.(a.data,i.parameter);return e===void 0?{...i,value:a.data}:refusal(`value`,e)}return{ok:!1,field:`value`,message:`Invalid value for preference "${t}"`,issues:a.error.issues.map(e=>({path:[`value`,...e.path.map(String)],message:e.message}))}}const qu=L.strictObject({model:Fu.optional(),routing:L.literal(`auto`).optional()}),Ju=L.strictObject({inApp:L.boolean(),email:L.boolean()});function isActionableType(e){let t=h[e];return t!==void 0&&le(t.kind)}const Yu=[preference(`workPosture`,{value:L.enum(Aa),default:`auto`,audited:!0}),preference(`chat.default`,{value:qu,default:{},audited:!0}),preference(`conversationSurface`,{value:L.enum(Wr),default:`panel`}),preference(`mailboxListMode`,{value:L.enum(Ei),default:`threads`}),preference(`home`,{value:L.string().uuid().nullable(),default:null}),preference(`memory.observeActivity`,{value:L.boolean(),default:!0,audited:!0}),preference(`memory.learnFromEmail`,{value:L.boolean(),default:!0,audited:!0}),preference(`notifications.briefingSeenAt`,{value:L.iso.datetime().nullable(),default:null}),preference(`notifications.delivery`,{value:Ju,default:{inApp:!0,email:!1},parameter:`notification type`,parameters:Object.keys(h),refine:(e,t)=>!e.inApp&&isActionableType(t)?`A "${t}" notification asks you to act: it is always shown in-app`:void 0})];function preferenceEntry(e,t,n){return n===void 0?{key:e,value:t}:{key:e,parameter:n,value:t}}function withPreferenceEntry(e,t){if(t.parameter===void 0)return{...e,values:{...e.values,[t.key]:t.value}};let n=e.entries.findIndex(e=>e.key===t.key&&e.parameter===t.parameter),r=n===-1?[...e.entries,t]:e.entries.map((e,r)=>r===n?t:e);return{...e,entries:r}}export{hr as ACCESS_LEVELS,gr as ACCESS_ROLES,e as ACTIONABLE_NOTIFICATION_KINDS,g as AGENDA_BLOCK,_r as AGENT_ASIDE_ANSWER_MAX_LENGTH,vr as AGENT_ASIDE_HISTORY_LIMIT,yr as AGENT_ASIDE_QUESTION_MAX_LENGTH,br as AGENT_AVATAR_EXPRESSIONS,xr as AGENT_AVATAR_TYPES,Sr as AGENT_MESSAGE_KIND,Cr as AGENT_NOTIFICATION_KIND,wr as AGENT_SESSION_LIST_ORDERS,Tr as AGENT_SESSION_ORIGINS,Er as AGENT_STARTERS_MAX,Dr as AGENT_STARTER_MAX_LENGTH,Or as AGENT_TASK_KINDS,t as AGGREGATE_BUCKETS,n as AGGREGATE_MEASURES,Ul as ALLOWED_PROPERTY_TYPES,kr as ALL_CATALOG_TOOL_NAMES,V as ALL_PIPES,Ar as ALWAYS_KINDS,hu as APPEARANCE_FACETS,jr as APPROVAL_FAMILY_TOOL_NAMES,Mr as ARCHITECT_PUBLICATION_KIND,Fl as ARTIFACT_FILE_ROLES,Nl as ARTIFACT_KINDS,ue as ARTIFACT_PREVIEW_EXTENSION,Pl as ARTIFACT_RETENTIONS,Nr as ASK_QUESTIONS_ANSWER_MAX_LENGTH,Pr as ASK_QUESTIONS_ANSWER_MAX_VALUES,Fr as ASK_QUESTIONS_MAX_BATCH,Ir as ASK_QUESTIONS_TOOL_NAME,de as ATTRIBUTE_FILTER_OPERATORS,Ms as ATTRIBUTE_NAME_SCHEMA,fe as ATTRIBUTE_TYPES,Lr as AUDIT_ACTIONS,Rr as AUDIT_AGENT_SESSION_METADATA_KEY,zr as AUDIT_RESOURCE_TYPES,Tn as AccessDeniedError,AgendaBuilder,M as AgentBuilder,En as AggregateValidationError,Dn as AmbiguousSchemaChangeError,On as AttributeInUseError,kn as AttributeNotFoundError,pe as BLOCK_CONTEXTS,me as BLOCK_PERIODS,_ as BLOCK_WIDTHS,ll as BROWSER_IMAGE_MAX_BYTES,Br as BROWSER_LAUNCH_TOOL_NAME,Vr as BUNDLE_LOCALES,q as BUNDLE_NAME_PATTERN,Hl as BYTE_UNIT_LABELS,BlockContentBuilder,BundleBuilder,v as CARD_BLOCK,tu as CATALOG_RESOURCES,y as CHART_BLOCK,he as CHART_KINDS,Qs as COMPUTED_RETURN_TYPES,Hr as CONNECTION_GRANT_PROVIDERS,Su as CONNECTOR_CALLBACK_PARAM,ge as CONTENT_PLACEMENT_CONTEXTS,Ur as CONTINUATION_KEY_PATTERN,Wr as CONVERSATION_SURFACES,J as CORE_BUNDLE_NAME,Yu as CORE_PREFERENCES,Gr as CORE_RECORD_TOOL_NAMES,Kr as CORE_TOOL_NAMES,qr as COUNT_MODES,eu as CUSTOM_LEVEL,CardBuilder,ChartBuilder,ChartQuery,An as ConcurrentModificationError,Z as ContentBuilder,Jr as DEFAULT_AGENT_EXECUTION_CONFIG,Yr as DEFAULT_AGENT_TOOL_GROUPS,fu as DEFAULT_APPEARANCE_ICON,Xr as DEFAULT_APPROVAL_POLICY,Zr as DEFAULT_BLUEPRINT_TOOL_GROUPS,Qr as DEFAULT_DAILY_ACTIVITY_DAYS,Ml as DEFAULT_DICTATION_LIMITS,Zl as DEFAULT_LABEL_FALLBACK,_e as DEFAULT_LAYOUT_TRAITS,$r as DEFAULT_MEETING_BOT_DISPLAY_NAME,ei as DEFAULT_TENANT_SETTINGS,Gc as DEFAULT_VALIDATION_MESSAGES,ul as DEVICE_CHANNEL_AUTHENTICATE_TIMEOUT_MS,dl as DEVICE_CHANNEL_IDLE_POLL_MS,pl as DEVICE_CHANNEL_KEEPALIVE_MS,cl as DEVICE_CHANNEL_MAX_FRAME_BYTES,sl as DEVICE_CHANNEL_PATH,fl as DEVICE_CHANNEL_PRESENCE_MS,_l as DEVICE_CHANNEL_UPGRADE_REQUIRED_REASON,ml as DEVICE_CHANNEL_WORKER_CLOSE_PROTOCOL_VIOLATION,gl as DEVICE_COMMAND_ERROR_CODES,Al as DICTATION_FINALIZATION_TIMEOUT_MS,wl as DICTATION_FRAME_BYTES,El as DICTATION_MAX_BUFFER_BYTES,Tl as DICTATION_MAX_FRAME_BYTES,Dl as DICTATION_MAX_TRANSCRIPT_BYTES,jl as DICTATION_MODEL_ID,kl as DICTATION_PREPARATION_TIMEOUT_MS,Cl as DICTATION_SAMPLE_RATE,Ol as DICTATION_TICKET_TTL_MS,ti as DISCARD_ARCHITECT_DRAFT_TOOL_NAME,ni as DOCUMENT_SORT_MODES,Ou as DRAFT_CONFLICT_KINDS,ri as DRAFT_WRITE_TOOL_NAMES,DeviceChannelProtocolError,xl as DeviceChannelServerFrameSchema,bl as DeviceChannelWorkerFrameSchema,D as DuplicateError,ii as EMAIL_CATEGORY_DEFAULT_COLOR,ai as EMAIL_CATEGORY_DEFAULT_ICON,oi as EMAIL_CATEGORY_DESCRIPTION_MAX,si as EMAIL_CATEGORY_DESCRIPTION_MIN,ci as EMAIL_CATEGORY_LIMIT,li as EMAIL_CATEGORY_NAME_MAX,ui as ENVIRONMENT_HARNESSES,di as ENVIRONMENT_HARNESS_SANDBOX_WORKDIR,fi as ENVIRONMENT_HARNESS_WORKDIR,pi as ENVIRONMENT_NAME_MAX_CHARS,mi as ENVIRONMENT_STANDARDS_WORKDIR,hi as ENV_VAR_KEY_PATTERN,gi as ESTIMATED_COUNT_CAP,jn as ExportTooLargeError,_i as FILE_URLS_MAX_IDS,z as FORM_FORBIDDEN_ATTRIBUTE_TYPES,Mn as ForbiddenError,FormBuilder,FormRowBuilder,FormStepBuilder,vi as GET_ARCHITECT_DRAFT_TOOL_NAME,yi as GITHUB_TRIGGER_CATALOG,bi as GRANT_ENABLES,ve as GROUPABLE_ATTRIBUTE_TYPES,_u as GroupBuilder,ye as HEADING_BLOCK,xi as HITL_TOOL_NAMES,Bl as IMAGE_FORMATS,pu as IMAGE_SHAPES,mu as IMAGE_SOURCES,be as INBOX_BLOCK,Si as INFERENCE_REASONING_OPTIONS,Ci as INFERENCE_ROUTING_MODES,wi as INFERENCE_SPEEDS,xe as INVENTORY_LIMIT,InboxBuilder,Nn as InvalidPermissionGrantError,Ti as LAST_RUN_ERROR_MAX_LENGTH,Ns as LIST_VIEW_TAB_VISIBILITIES,Se as LOCATION_FILTER_PROPERTIES,Pn as LogoProviderUnavailableError,Fn as LogoSearchRateLimitedError,Ce as MAILBOX_BLOCK,Ei as MAILBOX_LIST_MODES,Di as MAIL_DRAFT_BODY_MAX_CHARS,Oi as MAIL_SIGNATURE_MAX_CHARS,ki as MAIL_SUBJECT_MAX_CHARS,r as MAX_AGGREGATE_GROUPS,Ai as MAX_DAILY_ACTIVITY_DAYS,Sl as MAX_PRESET_DEPTH,ji as MAX_TODOS,Mi as MAX_TODO_DESCRIPTION_CHARS,Ni as MAX_TODO_ID_CHARS,Pi as MCP_SERVER_NAME_MAX_LENGTH,we as MEASURABLE_ATTRIBUTE_TYPES,Te as MEETINGS_UPCOMING_BLOCK,Fi as MEETING_BOT_IMAGE,Ii as MEETING_BOT_IMAGE_BASE64_MAX_LENGTH,Li as MEETING_RESPONSES,K as MEMORY_ATTRIBUTES,ou as MEMORY_PAGE_MAX_CHARS,Ri as MEMORY_SPEND_LIMIT_PATTERN,su as MEMORY_WORKSPACE_PROFILE,au as MEMORY_WRITE_SOURCE,b as METRIC_BLOCK,MailboxBuilder,zi as McpOAuthCompletionMode,In as MemoryNotFoundError,MetricBuilder,MetricQuery,MultiRelationAttributeBuilder,al as NATIVE_AGENT_UI_PART_IDS_METADATA_KEY,ol as NATIVE_AGENT_UI_PART_IDS_METADATA_SCHEMA_VERSION,Ee as NATIVE_BLOCKS,Ps as NATIVE_OBJECT_NAMES,Bi as NATIVE_TOOL_GROUPS,Vi as NATIVE_TOOL_GROUP_CATALOG,zu as NEWS_DEFAULT_DISPLAY_DAYS,Bu as NEWS_DISPLAY_CAP_DAYS,Vu as NEWS_INDEX_MAX_ENTRIES,Lu as NEWS_INTENSITIES,Iu as NEWS_TARGET_KINDS,i as NOTIFICATION_CHANNELS,a as NOTIFICATION_INBOX_STATES,o as NOTIFICATION_KINDS,s as NOTIFICATION_PRIORITIES,c as NOTIFICATION_PRIORITY_RANK,l as NOTIFICATION_SENSITIVITIES,u as NOTIFICATION_SETTINGS_AREAS,d as NOTIFICATION_SUBJECT_TYPES,f as NOTIFICATION_TYPES_V1,p as NOTIFICATION_TYPE_ACCESS_GRANTED,m as NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED,ee as NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_FAILED,te as NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_NOTICE,ne as NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN,re as NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED,ie as NOTIFICATION_TYPE_CONNECTOR_CONNECTION_ERROR,ae as NOTIFICATION_TYPE_CONNECTOR_CONNECTION_REAUTH_REQUIRED,h as NOTIFICATION_TYPE_KINDS,oe as NOTIFICATION_TYPE_RECORD_ASSIGNED,se as NOTIFICATION_TYPE_RECORD_MENTIONED,ce as NOTIFICATION_WORK_STATES,U as NO_ACCESS,Ku as NO_PREFERENCE_PARAMETER,Hi as NO_RECORDING,De as NO_VALUE_OPERATORS,xc as NonJsonValueError,NoopGeocodingAdapter,Ln as NotFoundError,Rn as NotImplementedError,W as OBJECT_GRANT,Fs as OBJECT_NAME_SCHEMA,Ui as OPEN_TOOL_PART_STATES,Wi as OPERATION_MAX_STEPS,Oe as OPERATORS_BY_TYPE,ObjectBuilder,zn as ObjectNotFoundError,Bn as ObjectReferencedError,Vn as OrphanSystemAttributeError,ke as PAGE_GRID_COLUMNS,ru as PERMISSION_ACTIONS,G as PERMISSION_CAPABILITIES,$l as PERMISSION_CATALOG,Gl as PIPES_WITH_ARGS,Gi as PROVIDER_DRAFT_LABEL,Ki as PROVIDER_NAMES,qi as PUBLIC_MAIL_DOMAINS,Y as PageBuilder,Hn as PageReferencedError,Un as ProtectedResourceError,Wn as ProtectedRoleError,Ae as QUALIFIED_SEPARATOR,je as QUERY_OBJECT,Ji as QUESTION_FAMILY_TOOL_NAMES,Vl as QUOTA_KEYS,Gn as QueryTimeoutError,Yi as RECENT_ACTIVITY_LEDGER_LIMIT,Xi as RECORDING_OVERRIDES,Zi as RECORDING_POLICIES,Qi as RECORD_ACCESS_ROLES,$i as RECORD_ACCESS_SOURCES,ea as RECORD_DRIVE_CURSOR_MAX_LENGTH,ta as RECORD_DRIVE_PAGE_DEFAULT_LIMIT,na as RECORD_DRIVE_PAGE_MAX_LIMIT,ra as RECORD_GRAPH_DEFAULT_LIMIT_PER_NODE,ia as RECORD_GRAPH_MAX_LIMIT_PER_NODE,aa as RECORD_GRAPH_MAX_NODES,oa as RECORD_IMAGE_MAX_BYTES,Me as RECORD_LINKS_BLOCK,x as RECORD_LINKS_CONTENT,Is as RECORD_LIST_SCOPES,Ne as RECORD_OBJECT,yu as REFERENCE_KINDS,Pe as RELATION_TARGET_ANY,Fe as REMOVED_OPERATOR_REPLACEMENTS,sa as REPLY_MODES,ca as REQUEST_DESIGN_REVIEW_TOOL_NAME,la as REQUEST_SETUP_TOOL_NAME,Ls as RESERVED_ATTRIBUTE_NAMES,Rs as RESERVED_OBJECT_NAMES,ua as RESOURCE_GRANT_KINDS,da as RESOURCE_KIND_CATALOG,zs as RESOURCE_VISIBILITIES,fa as ROUTING_PRICE_CEILINGS,Kn as RealtimeDeliveryError,qn as RealtimeRateLimitedError,Jn as RealtimeSubscriptionError,Yn as RecordNotFoundError,Ie as RecordQuery,Xn as RecordReferencedError,Zn as RepositoryError,O as ReservedObjectNameError,Qn as RoleNotFoundError,N as SCHEMA_LIMITS,B as SCHEMA_OWNER_PATTERN,Cu as SCHEMA_SOURCE_RETYPE_FROM,pa as SESSION_INFERENCE_PATCH_KEYS,ma as SETUP_SCRIPT_MAX_CHARS,Wl as SIMPLE_PIPES,$s as SIMPLE_PROPERTY_TYPES,ha as SLACK_TRIGGER_CATALOG,cu as STANDARD_SCHEMA_VENDOR,ga as SURFACE_TOOL_NAMES,Le as SYNONYM_ALIASES,Re as SYSTEM_ATTRIBUTES,ze as SYSTEM_ATTRIBUTE_I18N_KEYS,_a as SYSTEM_EMAIL_CATEGORIES,va as SYSTEM_EMAIL_CATEGORY_NAMES,Bs as SYSTEM_FIELD_NAMES,Be as SYSTEM_FILTER_ATTRIBUTE_TYPES,ya as SYSTEM_PART_CODES,k as SchemaError,A as SchemaErrorCode,$n as SearchBackendError,er as SearchPathNotIndexedError,SingleRelationAttributeBuilder,tr as StorageError,nr as SyncCascadeError,rr as SyncConflictError,ir as SyncError,ar as SystemEntityImmutableError,ba as TASK_DEMAND_LEVELS,Il as TENANT_INVITATION_DEFAULT_TTL_MS,Rl as TENANT_INVITATION_MAX_TTL_MS,Ll as TENANT_INVITATION_MIN_TTL_MS,zl as TENANT_INVITATION_RESEND_INTERVAL_MS,S as TEXT_BLOCK,Hc as TEXT_FORMAT_PATTERNS,xa as TODO_PHASES,Sa as TODO_PLAN_STATUSES,Ca as TODO_STATUSES,wa as TOOL_APPROVAL_STATES,Ta as TRIAGE_ACTIONS,Ea as TRIGGER_EVENT_TYPES,Da as TURN_OUTCOMES,or as ToolGroupGrantError,Oa as UNSHAREABLE_OBJECT_NAMES,ka as USER_STATUSES,Aa as USER_WORK_POSTURES,ja as VERB_NAMES,j as ValidationError,X as ViewBuilder,ec as WIRE_OFFERED_BASE_CONFIG,tc as WIRE_OMITTED_CONFIG_KEYS,sr as WorkspaceInvariantReason,Ma as agent,Na as agentAvatarFromMetadata,Pa as agentAvatarSchema,Fa as agentDataChunk,Ia as agentDisplayName,La as agentInferencePreferencesSchema,Ra as agentMessageAttachmentSchema,za as agentMessagePartSchema,Ba as agentScheduleSchema,Va as agentSessionInferenceOverridesInputSchema,Ha as agentSessionInferenceOverridesSchema,Ua as agentSessionMessageSchema,Wa as agentStartersSchema,Ga as agentTriggerBaseSchema,Ka as agentTriggerPatchSchema,qa as agentTriggerSchema,Ja as agentUIValidationError,applyPipes,Ya as artifactQuoteSchema,Sc as asTenantId,Cc as asUserId,Xa as askQuestionsOutputSchema,assertBundleName,Za as assertCustomAgentUIMessageChunk,assertSchemaSourceResolutions,Qa as assertSessionState,nc as attributeConfigSchemas,Ve as attributeFilterTarget,He as attributeInventory,Ue as blockObjectInputs,buildPropertySchema,We as buildQualifiedAttribute,builtBundleFromPieces,bundle,I as canonicalStringify,$a as canonicalToolGroups,Ge as canonicalizeFilterValue,capabilityForResource,Ke as capped,checkbox,eo as classificationRestoreSchema,to as classifyEmailSchema,no as cliDefaultModelOf,qe as collectContentViewCatalogue,Je as collectQualifiedRuleIssues,Ye as collectionContentSourceSchema,Xe as collectionSourceAddress,Ze as collectionSourceAddressOf,Hs as colorIdSchema,Qe as columnsSchema,ro as compareAgentSessionMessages,compareSchemaStateEntries,compareVersions,io as compiledHarnessModels,computeByteMagnitude,computeReconnectDelay,computeRetryDelay,ao as connectionGrantKindsOf,oo as connectorTriggerMatchSchema,vu as content,contentDefinition,C as contentExtensionRegistry,$e as contentReadObjects,w as contentViewDefinitionSchema,et as contentViewDefinitionSchemaFor,convertRetypedValue,Ac as createAttributeValidator,Jc as createCheckboxValidator,Yc as createDateValidator,jc as createFormAttributeValidator,qc as createNumberValidator,createStandardSchemaProps,Uc as createTextValidator,currency,tt as currentActor,so as customDataChunkSchemas,date,declaredImageRequests,wc as deepEqual,nt as defineBlock,defineDeviceChannelFrames,deriveLayout6,co as deriveViewerAccess,rt as describeViewIssue,detailView,deviceChannelUrl,diffSchemaState,it as displayAttributesSchema,document,at as draftContentViewDefinitionSchema,ot as draftContentViewDefinitionSchemaFor,droppedContents,lo as durableDateSchema,st as edgePropertyFilterTarget,uo as emailCategoryCreateSchema,fo as emailCategoryDeleteSchema,po as emailCategoryScopeQuerySchema,mo as emailCategoryUpdateSchema,ho as emailRuleScopeSchema,go as environmentHarness,_o as environmentWorkdir,extractAttributeNames,ct as extractCurrencyFilterValue,lt as extractFilterValue,extractTouchedArtifacts,extractTouchedDocuments,extractTouchedRecords,ut as filterOperatorsOfType,dt as filterStateSchema,ft as filterTargetsOf,vo as findEnvironmentHarness,findGrantIssues,pt as findGridViolation,mt as findGroupViolation,ht as findLayoutRuleViolation,gt as findRelationAttribute,_t as findRowLimitViolation,form,formFieldFlatKey,formFieldKey,formatByteSize,formatNewsTarget,Xc as formatPhoneForDisplay,formatReference,Kc as formatZodErrors,formula,Tc as generateId,vt as getAttributeCapabilities,ic as getAttributeConfigSchema,ac as getAttributeConfigWriteSchema,yt as getAttributeFilterOperators,getEditableLabelAttribute,bt as getOperatorPolarity,xt as getRollupFilterOperators,getSingleAttributeFromExpression,getSlotFieldTargets,St as getSystemAttributeI18nKey,Ct as getSystemAttributeList,yo as githubConditionSchema,bo as githubTriggerMatchSchema,xo as grantKindOf,wt as gridPositionSchema,group,Tt as groupSizeMessage,Et as groupedMembers,So as harnessModelChoices,hasLocale,hasOptions,hashBundlePieces,Co as humanRequestId,wo as humanRequestKind,P as iconNameSchema,imageLookupKindOf,imageModelFormatDefect,To as imageModelIdSchema,Ec as indexBy,Dt as inferInverseCardinality,Eo as inferenceReasoningSchema,Do as inferenceRoutingSchema,Oo as inferenceSpeedSchema,Ot as input,kt as invalidViewMessage,le as isActionableNotificationKind,ko as isAgentMessageMetadata,Ao as isAgentNotificationMetadata,jo as isAgentUIDataName,Mo as isAgentWrittenAuditEntry,No as isArchitectPublicationMetadata,At as isAttributeFilterable,jt as isAttributeGroupable,cr as isAttributeInUseError,Mt as isAttributeKanbanGroupable,Nt as isAttributeSearchable,Pt as isAttributeSortable,Po as isAwaitingHuman,Ft as isBilateralRelation,Fo as isBlocking,isBundle,It as isCalendarDay,isCatalogResource,Lt as isDynamicValue,Nc as isEmptyValue,Io as isEnvironmentHarnessId,isFormDefinition,isFormFieldsRow,isFormFreeFieldRef,isFormHeadingRow,isFormSeparatorRow,isFormSlotFieldRef,isFormTextRow,isImageSource,isLabelExpression,Rt as isLocationFilterProperty,zt as isLocationPartOperator,Lo as isMailProvider,Ro as isMailboxListMode,Bt as isManagedSystemAttribute,Us as isNativeObjectName,zo as isNativeToolGroup,Vt as isNoValueOperator,lr as isNotFoundError,Pc as isNullishOrEmptyString,ur as isObjectReferencedError,Bo as isOpenToolPartState,Vo as isParkedOnHuman,Ws as isPlainRecord,dr as isProtectedResourceError,Ho as isProviderDraft,Uo as isPublicMailDomain,fr as isRecordReferencedError,Ht as isRelativeDateValue,Wo as isReplyMode,Go as isResourceGrant,Ko as isRoutineActorMetadata,pr as isSchemaError,isSemver,qo as isSessionInferencePatch,Ut as isSetMembershipOperator,isStandardSchema,Jo as isSystemEmailCategory,Yo as isSystemEmailCategoryName,Xo as isSystemPartCode,Zo as isToolApprovalState,Wt as isUniversalRelation,mr as isValidationError,Fc as isValuePresent,isWherePipe,isWildcard,judgePreferenceWrite,keptFill,H as labelExpressionSchema,Gt as layoutTraitsOf,levelActions,levelFloor,levelOf,listView,locatePreference,location,Kt as locationPartFilterTarget,Qo as meetingBotDispatchRequestSchema,$o as meetingBotDispatchResponseSchema,es as meetingBotNotificationSchema,ts as meetingTranscriptSegmentSchema,qt as memberlessGroups,memoryPageViewOf,ns as mentionReferenceSchema,rs as mergeSessionInferencePatch,Jt as metricComparePeriod,is as modelDefinitionSchema,Fu as modelIdentitySchema,as as modelReferenceSchema,multiselect,oc as multiselectOptionWriteSchema,nameSlug,Du as namedTargetSchema,nativeAgentUIPartIdMetadataKey,os as needsManageWhenUnattended,Qc as normalizeCountrylessPhoneNumber,Yt as normalizeFilterRule,Xt as normalizeForEdgeRpc,normalizeNewsLocale,Zt as normalizeOperator,$c as normalizePhoneNumber,ss as normalizedMeetingTranscriptSchema,Qt as now,number,object,gu as objectImageSchema,cs as openRequests,ls as orderAgentSessionMessages,packLayout,page,pageCompactor,en as pageTraitsOf,us as parseAgentDefinitionAccessRole,sc as parseAttributeConfig,cc as parseAttributeConfigForCreate,lc as parseAttributeConfigForUpdate,T as parseBlockParameters,ds as parseCountMode,parseDeviceChannelFrame,fs as parseMergedAgentTrigger,parseNamedTarget,parseNativeAgentUIPartIdsMetadata,parseNewsBody,parseNewsIndex,parseNewsIntensity,parseNewsTarget,ps as parseOptionalCountMode,ms as parsePageAccessRole,tn as parseQualifiedAttribute,hs as parseRecordAccessRole,Gs as parseRecordListScope,parseReference,Ks as parseResourceVisibility,parseSchemaGroupPresentation,parseSchemaOwner,parseSchemaState,parseServerFrame,gs as parseToolGroupGrant,parseWherePipe,parseWorkerFrame,iu as permissionGrantSchema,phone,placeNew,preference,preferenceEntry,uc as propertyAttributeSchema,dc as propertyAttributeWireSchema,fc as propertySchemaSchema,pc as propertySchemaWireSchema,_s as providerNameSchema,E as publishedViewContentDefinitionSchema,nn as query,readArtifactResult,vs as readAskQuestionsResult,readFormFieldValue,readGeneratedImageResult,ys as recentActivityEntryKey,bs as recordGraphNodeKey,xs as recordGraphRequestSchema,recordLinksTab,Ss as recordOperationSchema,rn as recordQueryDefinitionSchema,Cs as refineTrigger,mc as refuseForeignKeys,Ic as rejectUnknownAttributesOrThrow,relation,an as relationAcceptsObject,relationProperty,on as relationTargetsOf,renderLabelExpression,repairPageGrid,requestedCapabilities,cn as requireRecordContentContext,ln as requireSingleRelationTarget,resolveAppearance,un as resolveCollectionActions,dn as resolveContentNavigation,fn as resolveEffectiveFilterType,resolveFieldRequired,pn as resolveIsWithinBounds,resolveLocalized,resolvePageGrid,resolvePropertyDefinitions,Wc as resolveTextPattern,mn as resolveUtcDayBounds,resolveViewContents,ws as resourceGrant,richtext,rollup,Ts as routedMessageInferenceSchema,sameActions,Dc as sameStableValue,schemaGroupKey,schemaStateSourcePayload,select,hc as selectOptionWriteSchema,Oc as serializeCanonicalJson,kc as serializeStableJson,Es as sessionInferencePatchSchema,settleLayout,sha256Hex,hn as singleRelationTarget,Ds as slackConditionSchema,Os as slackTriggerMatchSchema,snapWidth,gn as sortsSchema,_n as sourcedAttributeOf,status,gc as statusGroupSchema,_c as statusOptionWriteSchema,storedContentDefinition,vn as systemColumnFilterTarget,text,yn as toMultiValueOperator,bn as toUtcDayString,xn as today,ks as todoItemSchema,As as todoPlanSchema,js as toolImpactSchema,user,Lc as validateAttribute,qs as validateAttributeName,Sn as validateContentViewCatalogue,Rc as validateDraft,zc as validateDraftOrThrow,validateLabelExpression,Bc as validateObject,validateObjectExpressions,validateObjectImage,Xs as validateObjectName,Vc as validateObjectOrThrow,Cn as validateQualifiedRule,wn as validateStoredViews,Zs as validateViewName,widthStepConstraint,vc as wireHiddenTypeConfigMask,yc as wireOmittedConfigKeysFor,withPreferenceEntry,withoutTrailingSlashes,bc as withoutUnknownOptionKeys,workspaceViewAuthoring};
2
+ import{ACTIONABLE_NOTIFICATION_KINDS as e,AGGREGATE_BUCKETS as t,AGGREGATE_MEASURES as n,MAX_AGGREGATE_GROUPS as r,NOTIFICATION_CHANNELS as i,NOTIFICATION_INBOX_STATES as a,NOTIFICATION_KINDS as o,NOTIFICATION_PRIORITIES as s,NOTIFICATION_PRIORITY_RANK as c,NOTIFICATION_SENSITIVITIES as l,NOTIFICATION_SETTINGS_AREAS as u,NOTIFICATION_SUBJECT_TYPES as d,NOTIFICATION_TYPES_V1 as f,NOTIFICATION_TYPE_ACCESS_GRANTED as p,NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED as m,NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_FAILED as h,NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_NOTICE as ee,NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN as te,NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED as ne,NOTIFICATION_TYPE_CONNECTOR_CONNECTION_ERROR as re,NOTIFICATION_TYPE_CONNECTOR_CONNECTION_REAUTH_REQUIRED as ie,NOTIFICATION_TYPE_KINDS as g,NOTIFICATION_TYPE_RECORD_ASSIGNED as ae,NOTIFICATION_TYPE_RECORD_MENTIONED as oe,NOTIFICATION_WORK_STATES as se,isActionableNotificationKind as ce}from"./record-aggregates-DY8qLwuF.mjs";import{AGENDA_BLOCK as _,ARTIFACT_PREVIEW_EXTENSION as le,ATTRIBUTE_FILTER_OPERATORS as ue,ATTRIBUTE_TYPES as de,BLOCK_CONTEXTS as fe,BLOCK_PERIODS as pe,BLOCK_WIDTHS as v,CARD_BLOCK as y,CHART_BLOCK as b,CHART_KINDS as me,CONTENT_PLACEMENT_CONTEXTS as he,DEFAULT_LAYOUT_TRAITS as ge,GROUPABLE_ATTRIBUTE_TYPES as _e,HEADING_BLOCK as ve,INBOX_BLOCK as ye,INVENTORY_LIMIT as be,LOCATION_FILTER_PROPERTIES as xe,MAILBOX_BLOCK as Se,MEASURABLE_ATTRIBUTE_TYPES as Ce,MEETINGS_UPCOMING_BLOCK as we,METRIC_BLOCK as x,NATIVE_BLOCKS as Te,NO_VALUE_OPERATORS as Ee,OPERATORS_BY_TYPE as De,PAGE_GRID_COLUMNS as Oe,QUALIFIED_SEPARATOR as ke,QUERY_OBJECT as Ae,RECORD_LINKS_BLOCK as je,RECORD_LINKS_CONTENT as S,RECORD_MEMORY_BLOCK as Me,RECORD_MEMORY_CONTENT as C,RECORD_OBJECT as Ne,RELATION_TARGET_ANY as Pe,REMOVED_OPERATOR_REPLACEMENTS as Fe,RecordQuery as Ie,SYNONYM_ALIASES as Le,SYSTEM_ATTRIBUTES as Re,SYSTEM_ATTRIBUTE_I18N_KEYS as ze,SYSTEM_FILTER_ATTRIBUTE_TYPES as Be,TEXT_BLOCK as w,attributeFilterTarget as Ve,attributeInventory as He,blockObjectInputs as Ue,buildQualifiedAttribute as We,canonicalizeFilterValue as Ge,capped as Ke,collectContentViewCatalogue as qe,collectQualifiedRuleIssues as Je,collectionContentSourceSchema as Ye,collectionSourceAddress as Xe,collectionSourceAddressOf as Ze,columnsSchema as Qe,contentExtensionRegistry as $e,contentReadObjects as et,contentViewDefinitionSchema as T,contentViewDefinitionSchemaFor as tt,currentActor as nt,defineBlock as rt,describeViewIssue as it,displayAttributesSchema as at,draftContentViewDefinitionSchema as ot,draftContentViewDefinitionSchemaFor as st,edgePropertyFilterTarget as ct,extractCurrencyFilterValue as lt,extractFilterValue as ut,filterOperatorsOfType as dt,filterStateSchema as ft,filterTargetsOf as pt,findGridViolation as mt,findGroupViolation as ht,findLayoutRuleViolation as gt,findRelationAttribute as _t,findRowLimitViolation as vt,getAttributeCapabilities as yt,getAttributeFilterOperators as bt,getOperatorPolarity as xt,getRollupFilterOperators as St,getSystemAttributeI18nKey as Ct,getSystemAttributeList as wt,gridPositionSchema as Tt,groupSizeMessage as Et,groupedMembers as Dt,inferInverseCardinality as Ot,input as kt,invalidViewMessage as At,isAttributeFilterable as jt,isAttributeGroupable as Mt,isAttributeKanbanGroupable as Nt,isAttributeSearchable as Pt,isAttributeSortable as Ft,isBilateralRelation as It,isCalendarDay as Lt,isDynamicValue as Rt,isLocationFilterProperty as zt,isLocationPartOperator as Bt,isManagedSystemAttribute as Vt,isNoValueOperator as Ht,isRelativeDateValue as Ut,isSetMembershipOperator as Wt,isUniversalRelation as Gt,layoutTraitsOf as Kt,locationPartFilterTarget as qt,memberlessGroups as E,metricComparePeriod as Jt,normalizeFilterRule as Yt,normalizeForEdgeRpc as Xt,normalizeOperator as Zt,now as Qt,overlaps as $t,pageTraitsOf as en,parseBlockParameters as D,parseQualifiedAttribute as tn,publishedViewContentDefinitionSchema as O,query as nn,recordQueryDefinitionSchema as rn,relationAcceptsObject as an,relationTargetsOf as on,requireContentPlacement as sn,requireRecordContentContext as cn,requireSingleRelationTarget as ln,resolveCollectionActions as un,resolveContentNavigation as dn,resolveEffectiveFilterType as fn,resolveIsWithinBounds as pn,resolveUtcDayBounds as mn,singleRelationTarget as hn,sortsSchema as gn,sourcedAttributeOf as _n,systemColumnFilterTarget as vn,toMultiValueOperator as yn,toUtcDayString as bn,today as xn,validateContentViewCatalogue as Sn,validateQualifiedRule as Cn,validateStoredViews as wn}from"./view-config.schema-B9y7-OCJ.mjs";import{AccessDeniedError as Tn,AggregateValidationError as En,AmbiguousSchemaChangeError as Dn,AttributeInUseError as On,AttributeNotFoundError as kn,ConcurrentModificationError as An,DuplicateError as k,ExportTooLargeError as jn,ForbiddenError as Mn,InvalidPermissionGrantError as Nn,LogoProviderUnavailableError as Pn,LogoSearchRateLimitedError as Fn,MemoryNotFoundError as In,NotFoundError as Ln,NotImplementedError as Rn,ObjectNotFoundError as zn,ObjectReferencedError as Bn,OrphanSystemAttributeError as Vn,PageReferencedError as Hn,ProtectedResourceError as Un,ProtectedRoleError as Wn,QueryTimeoutError as Gn,RealtimeDeliveryError as Kn,RealtimeRateLimitedError as qn,RealtimeSubscriptionError as Jn,RecordNotFoundError as Yn,RecordReferencedError as Xn,RepositoryError as Zn,ReservedObjectNameError as A,RoleNotFoundError as Qn,SchemaError as j,SchemaErrorCode as M,SearchBackendError as $n,SearchPathNotIndexedError as er,StorageError as tr,SyncCascadeError as nr,SyncConflictError as rr,SyncError as ir,SystemEntityImmutableError as ar,ToolGroupGrantError as or,ValidationError as N,WorkspaceInvariantReason as sr,isAttributeInUseError as cr,isNotFoundError as lr,isObjectReferencedError as ur,isProtectedResourceError as dr,isRecordReferencedError as fr,isSchemaError as pr,isValidationError as mr}from"./exceptions.mjs";import{ACCESS_LEVELS as hr,ACCESS_ROLES as gr,AGENT_ASIDE_ANSWER_MAX_LENGTH as _r,AGENT_ASIDE_HISTORY_LIMIT as vr,AGENT_ASIDE_QUESTION_MAX_LENGTH as yr,AGENT_AVATAR_EXPRESSIONS as br,AGENT_AVATAR_TYPES as xr,AGENT_MESSAGE_KIND as Sr,AGENT_NOTIFICATION_KIND as Cr,AGENT_SESSION_LIST_ORDERS as wr,AGENT_SESSION_ORIGINS as Tr,AGENT_STARTERS_MAX as Er,AGENT_STARTER_MAX_LENGTH as Dr,AGENT_TASK_KINDS as Or,ALL_CATALOG_TOOL_NAMES as kr,ALWAYS_KINDS as Ar,APPROVAL_FAMILY_TOOL_NAMES as jr,ARCHITECT_PUBLICATION_KIND as Mr,ASK_QUESTIONS_ANSWER_MAX_LENGTH as Nr,ASK_QUESTIONS_ANSWER_MAX_VALUES as Pr,ASK_QUESTIONS_MAX_BATCH as Fr,ASK_QUESTIONS_TOOL_NAME as Ir,AUDIT_ACTIONS as Lr,AUDIT_AGENT_SESSION_METADATA_KEY as Rr,AUDIT_RESOURCE_TYPES as zr,AgentBuilder as P,BROWSER_LAUNCH_TOOL_NAME as Br,BUNDLE_LOCALES as Vr,CONNECTION_GRANT_PROVIDERS as Hr,CONTINUATION_KEY_PATTERN as Ur,CONVERSATION_SURFACES as Wr,CORE_RECORD_TOOL_NAMES as Gr,CORE_TOOL_NAMES as Kr,COUNT_MODES as qr,DEFAULT_AGENT_EXECUTION_CONFIG as Jr,DEFAULT_AGENT_TOOL_GROUPS as Yr,DEFAULT_APPROVAL_POLICY as Xr,DEFAULT_BLUEPRINT_TOOL_GROUPS as Zr,DEFAULT_DAILY_ACTIVITY_DAYS as Qr,DEFAULT_MEETING_BOT_DISPLAY_NAME as $r,DEFAULT_TENANT_SETTINGS as ei,DISCARD_ARCHITECT_DRAFT_TOOL_NAME as ti,DOCUMENT_SORT_MODES as ni,DRAFT_WRITE_TOOL_NAMES as ri,EMAIL_CATEGORY_DEFAULT_COLOR as ii,EMAIL_CATEGORY_DEFAULT_ICON as ai,EMAIL_CATEGORY_DESCRIPTION_MAX as oi,EMAIL_CATEGORY_DESCRIPTION_MIN as si,EMAIL_CATEGORY_LIMIT as ci,EMAIL_CATEGORY_NAME_MAX as li,ENVIRONMENT_HARNESSES as ui,ENVIRONMENT_HARNESS_SANDBOX_WORKDIR as di,ENVIRONMENT_HARNESS_WORKDIR as fi,ENVIRONMENT_NAME_MAX_CHARS as pi,ENVIRONMENT_STANDARDS_WORKDIR as mi,ENV_VAR_KEY_PATTERN as hi,ESTIMATED_COUNT_CAP as gi,FILE_URLS_MAX_IDS as _i,GET_ARCHITECT_DRAFT_TOOL_NAME as vi,GITHUB_TRIGGER_CATALOG as yi,GRANT_ENABLES as bi,HITL_TOOL_NAMES as xi,INFERENCE_REASONING_OPTIONS as Si,INFERENCE_ROUTING_MODES as Ci,INFERENCE_SPEEDS as wi,LAST_RUN_ERROR_MAX_LENGTH as Ti,MAILBOX_LIST_MODES as Ei,MAIL_DRAFT_BODY_MAX_CHARS as Di,MAIL_SIGNATURE_MAX_CHARS as Oi,MAIL_SUBJECT_MAX_CHARS as ki,MAX_DAILY_ACTIVITY_DAYS as Ai,MAX_TODOS as ji,MAX_TODO_DESCRIPTION_CHARS as Mi,MAX_TODO_ID_CHARS as Ni,MCP_SERVER_NAME_MAX_LENGTH as Pi,MEETING_BOT_IMAGE as Fi,MEETING_BOT_IMAGE_BASE64_MAX_LENGTH as Ii,MEETING_RESPONSES as Li,MEMORY_SPEND_LIMIT_PATTERN as Ri,McpOAuthCompletionMode as zi,NATIVE_TOOL_GROUPS as Bi,NATIVE_TOOL_GROUP_CATALOG as Vi,NO_RECORDING as Hi,OPEN_TOOL_PART_STATES as Ui,OPERATION_MAX_STEPS as Wi,PROVIDER_DRAFT_LABEL as Gi,PROVIDER_NAMES as Ki,PUBLIC_MAIL_DOMAINS as qi,QUESTION_FAMILY_TOOL_NAMES as Ji,RECENT_ACTIVITY_LEDGER_LIMIT as Yi,RECIPIENT_IDENTITIES_MAX as Xi,RECORDING_OVERRIDES as Zi,RECORDING_POLICIES as Qi,RECORD_ACCESS_ROLES as $i,RECORD_ACCESS_SOURCES as ea,RECORD_DRIVE_CURSOR_MAX_LENGTH as ta,RECORD_DRIVE_PAGE_DEFAULT_LIMIT as na,RECORD_DRIVE_PAGE_MAX_LIMIT as ra,RECORD_GRAPH_DEFAULT_LIMIT_PER_NODE as ia,RECORD_GRAPH_MAX_LIMIT_PER_NODE as aa,RECORD_GRAPH_MAX_NODES as oa,RECORD_IMAGE_MAX_BYTES as sa,REPLY_MODES as ca,REQUEST_DESIGN_REVIEW_TOOL_NAME as la,REQUEST_SETUP_TOOL_NAME as ua,RESOURCE_GRANT_KINDS as da,RESOURCE_KIND_CATALOG as fa,ROUTING_PRICE_CEILINGS as pa,SESSION_INFERENCE_PATCH_KEYS as ma,SETUP_SCRIPT_MAX_CHARS as ha,SLACK_TRIGGER_CATALOG as ga,SURFACE_TOOL_NAMES as _a,SYSTEM_EMAIL_CATEGORIES as va,SYSTEM_EMAIL_CATEGORY_NAMES as ya,SYSTEM_PART_CODES as ba,TASK_DEMAND_LEVELS as xa,TODO_PHASES as Sa,TODO_PLAN_STATUSES as Ca,TODO_STATUSES as wa,TOOL_APPROVAL_STATES as Ta,TRIAGE_ACTIONS as Ea,TRIGGER_EVENT_TYPES as Da,TURN_OUTCOMES as Oa,UNSHAREABLE_OBJECT_NAMES as ka,USER_STATUSES as Aa,USER_WORK_POSTURES as ja,VERB_NAMES as Ma,agent as Na,agentAvatarFromMetadata as Pa,agentAvatarSchema as Fa,agentDataChunk as Ia,agentDisplayName as La,agentInferencePreferencesSchema as Ra,agentMessageAttachmentSchema as za,agentMessagePartSchema as Ba,agentScheduleSchema as Va,agentSessionInferenceOverridesInputSchema as Ha,agentSessionInferenceOverridesSchema as Ua,agentSessionMessageSchema as Wa,agentStartersSchema as Ga,agentTriggerBaseSchema as Ka,agentTriggerPatchSchema as qa,agentTriggerSchema as Ja,agentUIValidationError as Ya,artifactQuoteSchema as Xa,askQuestionsOutputSchema as Za,assertCustomAgentUIMessageChunk as Qa,assertSessionState as $a,canonicalToolGroups as eo,classificationRestoreSchema as to,classifyEmailSchema as no,cliDefaultModelOf as ro,compareAgentSessionMessages as io,compiledHarnessModels as ao,connectionGrantKindsOf as oo,connectorTriggerMatchSchema as so,customDataChunkSchemas as co,deriveViewerAccess as lo,durableDateSchema as uo,emailCategoryCreateSchema as fo,emailCategoryDeleteSchema as po,emailCategoryScopeQuerySchema as mo,emailCategoryUpdateSchema as ho,emailRuleScopeSchema as go,environmentHarness as _o,environmentWorkdir as vo,findEnvironmentHarness as yo,githubConditionSchema as bo,githubTriggerMatchSchema as xo,grantKindOf as So,harnessModelChoices as Co,humanRequestId as wo,humanRequestKind as To,imageModelIdSchema as Eo,inferenceReasoningSchema as Do,inferenceRoutingSchema as Oo,inferenceSpeedSchema as ko,isAgentMessageMetadata as Ao,isAgentNotificationMetadata as jo,isAgentUIDataName as Mo,isAgentWrittenAuditEntry as No,isArchitectPublicationMetadata as Po,isAwaitingHuman as Fo,isBlocking as Io,isEnvironmentHarnessId as Lo,isMailProvider as Ro,isMailboxListMode as zo,isNativeToolGroup as Bo,isOpenToolPartState as Vo,isParkedOnHuman as Ho,isProviderDraft as Uo,isPublicMailDomain as Wo,isReplyMode as Go,isResourceGrant as Ko,isRoutineActorMetadata as qo,isSessionInferencePatch as Jo,isSystemEmailCategory as Yo,isSystemEmailCategoryName as Xo,isSystemPartCode as Zo,isToolApprovalState as Qo,meetingBotDispatchRequestSchema as $o,meetingBotDispatchResponseSchema as es,meetingBotNotificationSchema as ts,meetingTranscriptSegmentSchema as ns,mentionReferenceSchema as rs,mergeSessionInferencePatch as is,modelDefinitionSchema as as,modelReferenceSchema as os,needsManageWhenUnattended as ss,normalizedMeetingTranscriptSchema as cs,openRequests as ls,orderAgentSessionMessages as us,parseAgentDefinitionAccessRole as ds,parseCountMode as fs,parseMergedAgentTrigger as ps,parseOptionalCountMode as ms,parsePageAccessRole as hs,parseRecordAccessRole as gs,parseToolGroupGrant as _s,providerNameSchema as vs,readAskQuestionsResult as ys,recentActivityEntryKey as bs,recordGraphNodeKey as xs,recordGraphRequestSchema as Ss,recordOperationSchema as Cs,refineTrigger as ws,resourceGrant as Ts,routedMessageInferenceSchema as Es,sessionInferencePatchSchema as Ds,slackConditionSchema as Os,slackTriggerMatchSchema as ks,todoItemSchema as As,todoPlanSchema as js,toolImpactSchema as Ms}from"./record-operation-BIBY_2rB.mjs";import"./zod-locale.mjs";import{ATTRIBUTE_NAME_SCHEMA as Ns,LIST_VIEW_TAB_VISIBILITIES as Ps,NATIVE_OBJECT_NAMES as Fs,OBJECT_NAME_SCHEMA as Is,RECORD_LIST_SCOPES as Ls,RESERVED_ATTRIBUTE_NAMES as Rs,RESERVED_OBJECT_NAMES as zs,RESOURCE_VISIBILITIES as Bs,SCHEMA_LIMITS as F,SYSTEM_FIELD_NAMES as Vs,assertUniqueBy as Hs,colorIdSchema as Us,iconNameSchema as I,isNativeObjectName as L,isPlainRecord as Ws,parseRecordListScope as Gs,parseResourceVisibility as Ks,validateAttributeName as qs,validateIconName as Js,validateLabel as Ys,validateObjectName as Xs,validateOptions as R,validateViewName as Zs}from"./primitives-D9A6pmXV.mjs";import{COMPUTED_RETURN_TYPES as Qs,SIMPLE_PROPERTY_TYPES as $s,WIRE_OFFERED_BASE_CONFIG as ec,WIRE_OMITTED_CONFIG_KEYS as tc,attributeConfigSchemas as nc,datePrecisionIssues as rc,getAttributeConfigSchema as ic,getAttributeConfigWriteSchema as ac,multiselectOptionWriteSchema as oc,parseAttributeConfig as sc,parseAttributeConfigForCreate as cc,parseAttributeConfigForUpdate as lc,propertyAttributeSchema as uc,propertyAttributeWireSchema as dc,propertySchemaSchema as fc,propertySchemaWireSchema as pc,refuseForeignKeys as mc,selectOptionWriteSchema as hc,statusGroupSchema as gc,statusOptionWriteSchema as _c,wireHiddenTypeConfigMask as vc,wireOmittedConfigKeysFor as yc,withoutUnknownOptionKeys as bc}from"./config-DqidiszP.mjs";import{NonJsonValueError as xc,asTenantId as Sc,asUserId as Cc,canonicalStringify as z,deepEqual as wc,generateId as Tc,indexBy as Ec,sameStableValue as Dc,serializeCanonicalJson as Oc,serializeStableJson as kc}from"./utils-DaejNWxh.mjs";import{createAttributeValidator as Ac,createFormAttributeValidator as jc,createObjectValidator as Mc,isEmptyValue as Nc,isNullishOrEmptyString as Pc,isValuePresent as Fc,rejectUnknownAttributesOrThrow as Ic,validateAttribute as Lc,validateDraft as Rc,validateDraftOrThrow as zc,validateObject as Bc,validateObjectOrThrow as Vc}from"./object-BF5y6bgs.mjs";import{TEXT_FORMAT_PATTERNS as Hc,createTextValidator as Uc,resolveTextPattern as Wc}from"./text-BaxaZ5Vv.mjs";import{DEFAULT_VALIDATION_MESSAGES as Gc,formatZodErrors as Kc}from"./core-rKI7Q9_U.mjs";import{createNumberValidator as qc}from"./validation/primitives/number.mjs";import{createCheckboxValidator as Jc}from"./validation/primitives/checkbox.mjs";import{createDateValidator as Yc}from"./validation/primitives/date.mjs";import{formatPhoneForDisplay as Xc,getIso2 as Zc,normalizeCountrylessPhoneNumber as Qc,normalizePhoneNumber as $c}from"./phone-BGJea5sr.mjs";import*as B from"zod";import{colorIdFromString as el,getCountryByIso2 as tl,isValidCurrencyCode as nl,isValidIso3 as rl}from"@standards/constants";import{parsePhoneNumberFromString as il}from"libphonenumber-js";const al=`__stndrdsNativeUiPartIds`,ol=1;function invalidNativePartIds(){throw new N(`Native agent UI part IDs metadata is invalid`,[])}function isPlainRecord$1(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function nativeAgentUIPartIdMetadataKey(e,t){if(e.type===`text`||e.type===`reasoning`)return`${e.type}:${t}`;if(e.type===`tool`)return`tool:${e.toolCallId}`}function parseNativeAgentUIPartIdsMetadata(e){let t=e.metadata?.[al];isPlainRecord$1(t)||invalidNativePartIds(),(Object.keys(t).length!==2||t.schemaVersion!==1||!isPlainRecord$1(t.partIds))&&invalidNativePartIds();let n=new Map;for(let[t,r]of e.parts.entries()){let e=nativeAgentUIPartIdMetadataKey(r,t);if(!e||n.has(e)){e&&invalidNativePartIds();continue}n.set(e,r)}let r=Object.entries(t.partIds);r.length!==n.size&&invalidNativePartIds();let i=new Map,a={};for(let[e,t]of r){let r=n.get(e);r&&typeof t==`string`&&t.length>0||invalidNativePartIds();let o=i.get(t);o&&(r.type===`tool`||o!==r.type)&&invalidNativePartIds(),r.type===`tool`&&t!==r.toolCallId&&invalidNativePartIds(),i.set(t,r.type),a[e]=t}return a}const sl=`/v1/device-worker/channel`,cl=262144,ll=15e4,ul=1e4,dl=2e3,fl=2e3,pl=2e4,ml=4008,hl={initialMs:1e3,maxMs:3e4};function deviceChannelUrl(e){let t=new URL(e);return`${t.protocol===`https:`?`wss:`:`ws:`}//${t.host}${sl}`}function computeRetryDelay(e,t,n){return Math.min(n.initialMs*2**e,n.maxMs)+Math.floor(t()*250)}function computeReconnectDelay(e,t=Math.random){return computeRetryDelay(e,t,hl)}const gl=[`worker_disconnected`,`cancelled`,`timed_out`,`execution_failed`,`stale_reference`,`tab_unavailable`,`debugger_unavailable`,`blocked_by_user`,`not_actionable`,`javascript_error`,`batch_cap_exceeded`,`no_reference_screenshot`],_l=`UPGRADE_REQUIRED`;var DeviceChannelProtocolError=class extends j{constructor(e){super(e,M.DEVICE_CHANNEL_PROTOCOL),this._tag=`DeviceChannelProtocolError`,this.name=`DeviceChannelProtocolError`}};const V={id:B.uuid(),leaseToken:B.string().min(1)},vl=B.record(B.string(),B.unknown());function defineDeviceChannelFrames(e){return{worker:B.discriminatedUnion(`type`,[B.strictObject({type:B.literal(`authenticate`),credential:B.string().regex(/^(Device|Bearer) \S+$/),protocol:B.number().int().positive().optional()}),B.strictObject({type:B.literal(`running`),...V}),B.strictObject({type:B.literal(`heartbeat`),...V}),B.strictObject({type:B.literal(`output`),...V,stdout:B.string().optional(),stderr:B.string().optional()}),B.strictObject({type:B.literal(`complete`),...V,result:B.strictObject({stdout:B.string().optional(),stderr:B.string().optional(),exitCode:B.number().int(),success:B.boolean(),errorCode:B.enum(gl).optional(),result:e.result.optional()})}),B.strictObject({type:B.literal(`pong`)})]),server:B.discriminatedUnion(`type`,[B.strictObject({type:B.literal(`ready`),device:B.strictObject({id:B.string(),name:B.string(),capability:B.enum([`shell`,`browser`])}),protocol:B.number().int().positive().optional()}),B.strictObject({type:B.literal(`command`),...V,kind:B.enum([`shell`,`browser`]),intent:B.string(),timeoutMs:B.number().int(),command:B.string().optional(),cwd:B.string().nullable().optional(),action:e.action.optional()}),B.strictObject({type:B.literal(`cancel`),id:B.uuid(),reason:B.enum([`cancelled`,`timed_out`,`revoked`])}),B.strictObject({type:B.literal(`reauthenticate`)}),B.strictObject({type:B.literal(`revoked`)}),B.strictObject({type:B.literal(`ping`)})])}}const yl=defineDeviceChannelFrames({action:vl,result:vl}),bl=yl.worker,xl=yl.server;function parseDeviceChannelFrame(e,t){let n;try{n=JSON.parse(t)}catch{throw new DeviceChannelProtocolError(`Frame is not JSON`)}let r=e.safeParse(n);if(!r.success)throw new DeviceChannelProtocolError(`Frame does not match the channel protocol`);return r.data}function parseWorkerFrame(e){return parseDeviceChannelFrame(bl,e)}function parseServerFrame(e){return parseDeviceChannelFrame(xl,e)}const Sl=5;function isFormDefinition(e){return typeof e==`object`&&!!e&&`slots`in e&&`steps`in e&&`name`in e&&typeof e.name==`string`&&Array.isArray(e.slots)&&Array.isArray(e.steps)}const H=[`relation`,`multiRelation`,`formula`,`rollup`,`document`,`richtext`,`user`];function isFormSlotFieldRef(e){return e.type===`slot`}function isFormFreeFieldRef(e){return e.type===`free`}function resolveFieldRequired(e){return e.readOnly===!0?!1:e.fieldRequired===void 0?e.slotMode===`create`&&e.attributeRequired===!0:e.fieldRequired}function getSlotFieldTargets(e){return e.additionalSlotIds?.length?[e.slotId,...e.additionalSlotIds]:[e.slotId]}function formFieldKey(e){return isFormSlotFieldRef(e)?`${e.slotId}.${e.attribute}`:`free.${e.attribute.name}`}function formFieldFlatKey(e){return isFormSlotFieldRef(e)?e.attribute:e.attribute.name}function readFormFieldValue(e,t){return e[formFieldKey(t)]??e[formFieldFlatKey(t)]}function isFormFieldsRow(e){return e.type===`fields`}function isFormHeadingRow(e){return e.type===`heading`}function isFormSeparatorRow(e){return e.type===`separator`}function isFormTextRow(e){return e.type===`text`}function resolvePropertyDefinitions(e){let t=e.properties;if(!t)return[];if(Array.isArray(t))return t;let n=t;return Array.isArray(n.definitions)?n.definitions:[]}function hasOptions(e){return e.type===`select`||e.type===`status`||e.type===`multiselect`}function schemaGroupKey(e){return`${e.kind}:${e.name}`}function refuse$2(e){throw new N(e,[{path:[`label`],message:e}])}function parseSchemaGroupPresentation(e){let t=e??{},n={};if(t.label!==void 0){let e=t.label;if(e===null)n.label=null;else if(typeof e!=`string`)refuse$2(`Label must be a string`);else{let t=e.trim();t.length===0&&refuse$2(`Label must not be empty`),t.length>F.labelLength&&refuse$2(`Label is too long (max ${F.labelLength} characters)`),n.label=t}}return n}const U=/^(?:core|bundle:.+)$/u;function parseSchemaOwner(e){if(e===null)return null;if(!U.test(e))throw new N(`Invalid schema owner "${e}"`,[]);return e}const Cl=16e3,wl=3200,Tl=6400,El=16e3,Dl=65536,Ol=15e3,kl=1e4,Al=5e3,jl=`google/gemini-3.5-transcribe-live`,Ml={maxDurationMs:3e5,dailyDurationMs:36e5,monthlyDurationMs:72e6,tenantMonthlyBudgetMicrousd:5e7,globalMonthlyBudgetMicrousd:5e7,estimatedMicrousdPerSecond:150,reservationMultiplier:2},Nl=[`web`,`presentation`,`document`,`spreadsheet`,`image`,`code`,`other`],Pl=[`ephemeral`,`conversation`,`persistent`],Fl=[`source`,`preview`,`entrypoint`,`asset`];var NoopGeocodingAdapter=class{async autocomplete(){return await Promise.resolve([])}async geocode(){return await Promise.resolve(null)}};const Il=6048e5,Ll=36e5,Rl=2592e6,zl=6e4,Bl=[`square`,`landscape`,`portrait`];function imageModelFormatDefect(e){if(e.formats.length===0)return`declares no output format`;for(let t of e.formats)if(e.requests[t]===void 0)return`declares the format "${t}" without a request`;for(let t of Object.keys(e.requests))if(!e.formats.includes(t))return`carries a request for the undeclared format "${t}"`}function declaredImageRequests(e){let t={};for(let n of e.formats){let r=e.requests[n];r!==void 0&&(t[n]=r)}return t}const Vl=[`storage.bytes`,`members.seats`,`data.live_records`];function computeByteMagnitude(e){if(e<=0)return{value:0,unitIndex:0};let t=1e3,n=Math.min(4,Math.floor(Math.log(e)/Math.log(t)));return{value:Number.parseFloat((e/t**n).toFixed(1)),unitIndex:n}}const Hl=[`B`,`KB`,`MB`,`GB`,`TB`];function formatByteSize(e){let{value:t,unitIndex:n}=computeByteMagnitude(e);return`${t} ${Hl[n]}`}const Ul=Object.freeze([`text`,`number`,`checkbox`,`date`,`phone`,`currency`,`status`,`select`,`multiselect`,`location`]);function buildPropertySchema(e){let t=[];for(let n of e){let e=n.build();if(!Ul.includes(e.type))throw Error(`Property type "${e.type}" is not supported in .qualifyWith()`);t.push(e)}return{definitions:t}}const Wl=[`UPPER`,`LOWER`,`capitalize`,`trim`],Gl=[`prefix`,`suffix`,`wrap`,`default`],W=[...Wl,...Gl],Kl=/^\s*where\s*(?::(.*))?$/s,ql=`[A-Za-z_][A-Za-z0-9_]*`,Jl=/^[^\s,()|{}="']+$/,Yl=RegExp(`^(${ql})\\s*=\\s*(.*)$`),Xl=RegExp(`^(${ql})\\s+in\\s*\\(([^()]*)\\)$`);function isWherePipe(e){return Kl.test(e)}function parseWherePipe(e){let t=e.match(Kl)?.[1]?.trim();if(!t)return null;let n=t.match(Xl);if(n){let e=n[2].split(`,`).map(e=>e.trim());return e.every(e=>Jl.test(e))?{property:n[1],values:e}:null}let r=t.match(Yl);return r&&Jl.test(r[2])?{property:r[1],values:[r[2]]}:null}const G=B.string().min(1,`labelExpression cannot be empty`).refine(e=>isLabelExpression(e),{message:`labelExpression must contain at least one {{ attribute }} interpolation`}).refine(e=>!/\{\{\s*\}\}/.test(e),{message:`labelExpression contains empty {{ }} interpolation`}).refine(e=>{let t=/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g,n;for(;(n=t.exec(e))!==null;){let e=n[1];if(!W.includes(e))return!1}return!0},{message:`Invalid pipe name. Valid pipes: ${W.join(`, `)}`});function validateLabelExpression(e){let t=G.safeParse(e);return t.success?{success:!0,attributes:extractAttributeNames(e)}:{success:!1,error:t.error.issues[0]?.message??`Invalid labelExpression`}}function applyPipe(e,t){let{name:n,args:r}=parsePipeExpression(t);switch(n){case`UPPER`:return e.toUpperCase();case`LOWER`:return e.toLowerCase();case`capitalize`:return e.replace(/(^|\s)\S/g,e=>e.toUpperCase());case`trim`:return e.trim();case`prefix`:return e?`${r[0]??``}${e}`:``;case`suffix`:return e?`${e}${r[0]??``}`:``;case`wrap`:return e?`${r[0]??``}${e}${r[1]??``}`:``;case`default`:return e||r[0]||``;default:return e}}function applyPipes(e,t){let n=e;for(let e of t)n=applyPipe(n,e);return n}function getValue(e,t){return t.split(`.`).reduce((e,t)=>{if(typeof e==`object`&&e)return e[t]},e)}const Zl=`(Untitled)`;function parsePipeExpression(e){let t=e.match(/^(\w+)(?::(.*))?$/);if(!t)return{name:e,args:[]};let n=t[1],r=t[2];if(!r)return{name:n,args:[]};let i=[],a=/["']([^"']*?)["']/g,o;for(;(o=a.exec(r))!==null;)i.push(o[1]);return{name:n,args:i}}function*templateBlocks(e){let t=0;for(;t<e.length;){let n=e.indexOf(`{{`,t);if(n<0)return;let r=e.indexOf(`}`,n+2);if(r<0)return;if(e[r+1]!==`}`){t=r+1;continue}t=r+2;let i=e.slice(n+2,r);i.length>0&&(yield{start:n,end:t,expr:i})}}function resolveLabelBlock(e,t){let n=e.split(`||`).map(e=>e.trim()),r=n[n.length-1].split(`|`).map(e=>e.trim());n[n.length-1]=r[0];let i=r.slice(1).filter(Boolean),a=n.filter(Boolean),o=``;for(let e of a){let n=toText(getValue(t,e));if(n!==``){o=n;break}}return applyPipes(o,i)}function renderLabelExpression(e,t,n=Zl){let r=[],i=0;for(let n of templateBlocks(e))r.push(e.slice(i,n.start),resolveLabelBlock(n.expr,t)),i=n.end;return r.push(e.slice(i)),r.join(``).trim()||n}function toText(e){if(e==null||typeof e==`function`)return``;if(typeof e!=`object`)return String(e);if(Array.isArray(e))return e.map(toText).filter(Boolean).join(`,`);let t=e.toString;return typeof t==`function`&&t!==Object.prototype.toString?String(e):``}function isLabelExpression(e){let t=0;for(;t<e.length;){let n=e.indexOf(`{{`,t);if(n<0)return!1;let r=e.indexOf(`}}`,n+2);if(r<0)return!1;if(e.slice(n+2,r).trim().length>0)return!0;t=r+2}return!1}function extractAttributeNames(e){let t=[];for(let n of templateBlocks(e)){let e=n.expr.trim();if(!e)continue;let r=e.split(`||`).map(e=>e.trim()),i=r[r.length-1];r[r.length-1]=i.split(`|`)[0].trim();for(let e of r){if(!e)continue;let n=e.split(`.`)[0];n&&!t.includes(n)&&t.push(n)}}return t}const Ql=/^\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}$/;function getSingleAttributeFromExpression(e){let t=e.trim().match(Ql);return t?t[1]:null}function getEditableLabelAttribute(e,t){let n=getSingleAttributeFromExpression(e);if(n===null)return null;let r=t.find(e=>e.name===n);return!r||r.type!==`text`||yt(r).authoring.readOnly?null:r}const $l=[{id:`data`,capabilities:[{id:`forms`,resources:[`forms`],levels:[{id:`fill`,add:[`read`]},{id:`edit`,add:[`create`,`update`,`delete`]},{id:`manage`,add:[`manage`]}]}]},{id:`structure`,capabilities:[{id:`schema`,resources:[`architect`],levels:[{id:`use`,add:[`read`]},{id:`edit`,add:[`create`,`update`,`delete`]}]},{id:`pages`,resources:[`pages`],levels:[{id:`read`,add:[`read`]},{id:`create`,add:[`create`,`update`,`delete`]}]}]},{id:`ai`,capabilities:[{id:`agents`,resources:[`agents`],levels:[{id:`chat`,add:[`read`]},{id:`build`,add:[`create`,`update`,`delete`]},{id:`manage`,add:[`manage`]}]},{id:`environments`,resources:[`environments`],levels:[{id:`use`,add:[`read`]},{id:`create`,add:[`create`]}]},{id:`browser-profiles`,resources:[`browser-profiles`],levels:[{id:`use`,add:[`create`]}]},{id:`private-secrets`,resources:[`private-secrets`],levels:[{id:`use`,add:[`create`]}]},{id:`routine-audiences`,resources:[`routine-audiences`],levels:[{id:`use`,add:[`create`]}]}]},{id:`files`,capabilities:[{id:`files`,resources:[`files`,`documents`],levels:[{id:`read`,add:[`read`]},{id:`edit`,add:[`create`,`update`]},{id:`full`,add:[`delete`]}]}]},{id:`team`,capabilities:[{id:`people`,resources:[`people`],levels:[{id:`view`,add:[`read`]},{id:`invite`,add:[`create`]},{id:`manage`,add:[`update`,`delete`]}]}]},{id:`integrations`,capabilities:[{id:`connectors`,resources:[`connectors`],levels:[{id:`use`,add:[`read`,`create`,`update`,`delete`]}]},{id:`api-keys`,resources:[`api-keys`],levels:[{id:`view`,add:[`read`]},{id:`manage`,add:[`create`,`delete`]}]},{id:`env-vars`,resources:[`env-vars`],levels:[{id:`view`,add:[`read`]},{id:`manage`,add:[`create`,`delete`]}]}]},{id:`administration`,capabilities:[{id:`settings`,resources:[`settings`],levels:[{id:`view`,add:[`read`]},{id:`manage`,add:[`update`,`delete`,`manage`]}]},{id:`audit`,resources:[`audit`],levels:[{id:`view`,add:[`read`]}]},{id:`billing`,resources:[`billing`],levels:[{id:`view`,add:[`read`]}]}]}],K=`none`,eu=`custom`,q={actions:[`read`,`create`,`update`,`delete`],purge:`manage`,levels:[{id:`read`,add:[`read`]},{id:`edit`,add:[`create`,`update`]},{id:`full`,add:[`delete`]}]},J=$l.flatMap(e=>e.capabilities),tu=J.flatMap(e=>e.resources),nu=new Map(J.flatMap(e=>e.resources.map(t=>[t,e])));function isCatalogResource(e){return nu.has(e)}function capabilityForResource(e){let t=nu.get(e);if(!t)throw new j(`Unknown catalog resource "${e}"`,M.INVARIANT_VIOLATION);return t}function sameActions(e,t){let n=new Set(e),r=new Set(t);return n.size===r.size&&[...n].every(e=>r.has(e))}function levelActions(e,t){let n=new Set;for(let r of e.levels){for(let e of r.add)n.add(e);if(r.id===t)return[...n]}return[]}function levelFloor(e,t){let n=e.levels[e.levels.length-1];if(t.includes(`*`)&&n)return n.id;let r=new Set(t),i=K;for(let t of e.levels){if(!t.add.every(e=>r.has(e)))break;i=t.id}return i}function levelOf(e,t){if(t.length===0)return K;let n=e.levels[e.levels.length-1];if(t.includes(`*`)&&n)return n.id;let r=new Set(t),i=new Set;for(let t of e.levels){for(let e of t.add)i.add(e);if(i.size===r.size&&[...r].every(e=>i.has(e)))return t.id}return eu}const ru=[`read`,`create`,`update`,`delete`,`manage`],iu=B.object({scope:B.enum([`object`,`system`]),target:B.string().min(1),actions:B.array(B.enum(ru))}).strict();function findGrantIssues(e,t){let n=[],r=new Map;for(let i of e){let e=iu.safeParse(i);if(!e.success){let e=typeof i==`object`&&i&&`target`in i?String(i.target):`?`;n.push({target:e,reason:`shape`});continue}let a=e.data;if(a.scope===`system`){if(!isCatalogResource(a.target)){n.push({target:a.target,reason:`unknown-resource`});continue}if(levelOf(capabilityForResource(a.target),a.actions)===`custom`){n.push({target:a.target,reason:`off-level`});continue}r.set(a.target,a.actions);continue}if(a.target!==`*`&&!t.objectNames.has(a.target)){n.push({target:a.target,reason:`unknown-object`});continue}let o=a.target===`*`?[...q.actions,q.purge]:q.actions;a.actions.every(e=>o.includes(e))||n.push({target:a.target,reason:`object-action`})}let i=new Set;for(let[e,t]of r){let a=capabilityForResource(e);if(!i.has(a)){for(let o of a.resources)if(!sameActions(t,r.get(o)??[])){n.push({target:e,reason:`split-capability`}),i.add(a);break}}}return n}const au=`memory`,ou=4e3,su=`workspace`,Y={name:`name`,description:`description`,content:`content`,profileOf:`profileOf`,profileActor:`profileActor`,subjects:`subjects`,subjectId:`subjectId`};function textValue(e){return typeof e==`string`?e:``}function memoryPageViewOf(e){let{values:t}=e;return{id:e.id,name:textValue(t[Y.name]),description:textValue(t[Y.description]),content:textValue(t[Y.content]),visibility:e.visibility,ownedBy:e.ownedBy,updatedAt:new Date(e.updatedAt).toISOString()}}const cu=`@standards/schema`;function createStandardSchemaProps(e){return{version:1,vendor:cu,validate:t=>{let n=e.safeParse(t);return n.success?{value:n.data}:{issues:n.error.issues.map(e=>({message:e.message,path:e.path}))}}}}function isStandardSchema(e){return typeof e==`object`&&!!e&&`~standard`in e&&typeof e[`~standard`]==`object`&&e[`~standard`].version===1}function asMutableArray(e){return e}var BaseAttributeBuilder=class{get"~standard"(){return createStandardSchemaProps(Ac(this.build()))}constructor(e,t,n){qs(t),Ys(n),this.attr={name:t,label:n,type:e,required:!1,system:!0}}setRequired(e){this.attr.required=e}asRequiredState(){return this}asPhantomState(){return this}runtime(){return this.attr.system=!1,this}hidden(){return this.attr.hidden=!0,this}placeholder(e){return this.attr.placeholder=e,this}description(e){return this.attr.description=e,this}icon(e){return Js(e,`attribute "${this.attr.name}"`),this.attr.icon=e,this}order(e){return this.attr.order=e,this}defaultValue(e){return(`defaultValue`in this.attr||![`formula`,`rollup`].includes(this.attr.type))&&(this.attr.defaultValue=e),this}metadata(e){return this.attr.metadata=e,this}build(){return this.attr}},TextAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`text`,e,t)}minLength(e){return this.attr.minLength=e,this}maxLength(e){return this.attr.maxLength=e,this}pattern(e){return this.attr.pattern=e,this.attr.format=void 0,this}multiline(e=!0){return this.attr.multiline=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}email(){return this.attr.format=`email`,this.attr.pattern=void 0,this}url(){return this.attr.format=`url`,this.attr.pattern=void 0,this}slug(){return this.attr.format=`slug`,this.attr.pattern=void 0,this}};function text(e,t){return new TextAttributeBuilder(e,t)}var RichtextAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`richtext`,e,t)}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function richtext(e,t){return new RichtextAttributeBuilder(e,t)}var NumberAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`number`,e,t)}min(e){return this.attr.min=e,this}max(e){return this.attr.max=e,this}integer(){return this.attr.unit=`integer`,this.attr.decimals=0,this}decimal(e=2){return this.attr.unit=`decimal`,this.attr.decimals=e,this}percentage(){return this.attr.unit=`percentage`,this}renderAs(e){return this.attr.renderAs=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function number(e,t){return new NumberAttributeBuilder(e,t)}var CheckboxAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`checkbox`,e,t)}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function checkbox(e,t){return new CheckboxAttributeBuilder(e,t)}var DateAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`date`,e,t)}format(e){return this.attr.dateFormat=e,this}precision(e){return this.attr.precision=e,this}build(){let[e]=rc(`date`,this.attr);if(e!==void 0)throw new N(e.message,[{path:[`precision`],message:e.message}]);return super.build()}minDate(e){return this.attr.minDate=e,this}maxDate(e){return this.attr.maxDate=e,this}endDate(){return this.attr.endDate=!0,this.asPhantomState()}includeTime(){return this.attr.includeTime=!0,this}timeFormat(e){return this.attr.timeFormat=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function date(e,t){return new DateAttributeBuilder(e,t)}var PhoneAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`phone`,e,t)}defaultCountry(e){return this.attr.defaultCountryCode=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function phone(e,t){return new PhoneAttributeBuilder(e,t)}var CurrencyAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`currency`,e,t)}defaultCurrency(e){return this.attr.defaultCurrency=e,this}allowedCurrencies(e){return this.attr.allowedCurrencies=e,this}allowNegative(e=!0){return this.attr.allowNegative=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function currency(e,t){return new CurrencyAttributeBuilder(e,t)}var StatusAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`status`,e,t)}options(e){let t=asMutableArray(e);return R(this.attr.name??`unknown`,t),this.attr.options=t,this.asPhantomState()}option(e){this.attr.options||(this.attr.options=[]);let t=[...this.attr.options,e];return R(this.attr.name??`unknown`,t),this.attr.options.push(e),this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function status(e,t){return new StatusAttributeBuilder(e,t)}var SelectAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`select`,e,t)}options(e){let t=asMutableArray(e);return R(this.attr.name??`unknown`,t),this.attr.options=t,this.asPhantomState()}option(e){this.attr.options||(this.attr.options=[]);let t=[...this.attr.options,e];return R(this.attr.name??`unknown`,t),this.attr.options.push(e),this}renderAs(e){return this.attr.renderAs=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function select(e,t){return new SelectAttributeBuilder(e,t)}var MultiselectAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`multiselect`,e,t)}options(e){let t=asMutableArray(e);return R(this.attr.name??`unknown`,t),this.attr.options=t,this.asPhantomState()}option(e){this.attr.options||(this.attr.options=[]);let t=[...this.attr.options,e];return R(this.attr.name??`unknown`,t),this.attr.options.push(e),this}renderAs(e){return this.attr.renderAs=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function multiselect(e,t){return new MultiselectAttributeBuilder(e,t)}var LocationAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`location`,e,t)}granularity(e){return this.attr.granularity=e,this}defaultCountry(e){return this.attr.defaultCountry=e,this}allowedCountries(e){return this.attr.allowedCountries=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function location(e,t){return new LocationAttributeBuilder(e,t)}var UserAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`user`,e,t),this.attr.types=[`user`,`agent`]}types(e){let t=[...new Set(e)];if(t.length===0)throw Error(`[AttributeBuilder] user.types must contain at least one type.`);return this.attr.types=t,this}multiple(){return this.attr.multiple=!0,this}notifiesOnAssign(){return this.attr.notifiesOnAssign=!0,this}actors(){return this.attr.actors=!0,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function user(e,t){return new UserAttributeBuilder(e,t)}var BaseRelationAttributeBuilder=class extends BaseAttributeBuilder{to(e,t){let n={object:e,...t};return this.attr.targets?.push(n),this}toAny(){return this.attr.targets=[{object:`*`}],this}qualifyWith(...e){let t=this.attr.targets;if(!t||t.length===0)throw Error(`.qualifyWith() must be called AFTER .to(). Example: relation("companies", "Companies").to("companies").qualifyWith(...)`);return this.attr.properties=buildPropertySchema(e),this}bilateral(e){let t=this.attr.targets;if(!t||t.length===0)throw Error(`.bilateral() must be called AFTER .to(). Example: relation("company", "Company").to("companies").bilateral({ ... })`);if(t.length>1)throw Error(`Bilateral relations are not supported for polymorphic relations (multiple .to() targets).`);if(Gt(this.attr))throw Error(`Bilateral relations are not supported for universal relations (.toAny()).`);let n=t[0]?.object;if(!n)throw new N(`Bilateral relation requires one target object`,[{path:[`bilateral`,`object`],message:`Bilateral relation requires one target object`}]);if(e.object&&e.object!==n){let t=`Bilateral inverse object ${e.object} must match relation target ${n}`;throw new N(t,[{path:[`bilateral`,`object`],message:t}])}return this.attr.bilateral={...e,object:n},this}},SingleRelationAttributeBuilder=class extends BaseRelationAttributeBuilder{constructor(e,t){super(`relation`,e,t),this.attr.cardinality=`one`,this.attr.targets=[]}many(){let e=new MultiRelationAttributeBuilder(this.attr.name,this.attr.label??``,{targets:this.attr.targets,isRequired:this.attr.required});return this.attr.system===!1&&e.runtime(),this.attr.hidden&&e.hidden(),this.attr.placeholder&&e.placeholder(this.attr.placeholder),this.attr.description&&e.description(this.attr.description),this.attr.icon&&e.icon(this.attr.icon),this.attr.order!==void 0&&e.order(this.attr.order),this.attr.metadata&&e.metadata(this.attr.metadata),e}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}},MultiRelationAttributeBuilder=class extends BaseRelationAttributeBuilder{constructor(e,t,n){super(`relation`,e,t),this.attr.cardinality=`many`,this.attr.targets=n?.targets??[],this.attr.defaultValue=[],n?.isRequired&&this.setRequired(!0)}maxItems(e){return this.attr.maxItems=e,this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function relation(e,t){return new SingleRelationAttributeBuilder(e,t)}var FormulaAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`formula`,e,t),this.attr.required=!1}expression(e){return this.attr.expression=e,this}returns(e){return this.attr.returnType=e,this}decimals(e){return this.attr.decimals=e,this}currency(e){return this.attr.currencyCode=e,this}required(){throw Error(`Formula attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.`)}optional(){return this}};function formula(e,t){return new FormulaAttributeBuilder(e,t)}var RollupAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`rollup`,e,t),this.attr.required=!1}from(e){return this.attr.relationAttribute=e,this}aggregate(e){return this.attr.targetAttribute=e,this}using(e){return this.attr.function=e,this}decimals(e){return this.attr.decimals=e,this}path(e){return this.attr.relationPath=e,this}targetType(e){return this.attr.targetAttributeType=e,this}targetOptions(e){return this.attr.targetAttributeOptions=asMutableArray(e),this}targetCurrency(e){return this.attr.targetCurrencyCode=e,this}build(){let e=this.attr.function,t=this.attr.targetAttributeType;if(e===`original`&&t!==void 0&&t!==`select`&&t!==`status`&&t!==`multiselect`){let e=this.attr.relationAttribute??`relation`,n=this.attr.targetAttribute??`field`;throw new j(`Rollup "${this.attr.name}": .using("original") only supports a "select", "status", or "multiselect" target, but .targetType("${t}") was given. To surface a plain ${t} value from a related record, use a formula instead — e.g. formula("${this.attr.name}", "…").expression("${e}.${n}").`,M.VALIDATION_FAILED)}return super.build()}required(){throw Error(`Rollup attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.`)}optional(){return this}};function rollup(e,t){return new RollupAttributeBuilder(e,t)}var DocumentAttributeBuilder=class extends BaseAttributeBuilder{constructor(e,t){super(`document`,e,t)}accepts(e){return this.attr.accepts=e,this}maxFileSize(e){return this.attr.maxFileSize=e,this}qualifyWith(...e){return this.attr.properties=buildPropertySchema(e),this}required(){return this.setRequired(!0),this.asRequiredState()}optional(){return this.setRequired(!1),this.asRequiredState()}};function document(e,t){return new DocumentAttributeBuilder(e,t)}const lu=/^[a-z0-9][a-z0-9-]{0,62}$/,uu=`core`;function assertBundleName(e){if(!lu.test(e))throw new N(`Invalid bundle name "${e}": expected a lowercase slug matching ${lu}`,[]);if(e===`core`)throw new N(`Bundle name "${uu}" is reserved`,[])}async function sha256Hex(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,`0`)).join(``)}function nameSlug(e,t){return e.normalize(`NFKD`).replace(/\p{M}/gu,``).toLowerCase().replace(/[^a-z0-9]+/g,`_`).slice(0,t).replace(/^_+|_+$/g,``)}function cloneBuilderValue(e,t){try{return structuredClone(e)}catch{let e=`Builder configuration must contain cloneable data`;throw new N(e,[{path:t,message:e}])}}function requireBuilderName(e,t){if(typeof e!=`string`||e.trim().length===0)throw new N(`Name must not be blank`,[{path:t,message:`Name must not be blank`}])}function validateContentConfiguration(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw new N(`Invalid content configuration`,[{path:t,message:`Expected content configuration`}]);for(let n of[`name`,`label`,`placement`])if(Object.hasOwn(e,n)){let e=`Independent content configuration cannot define ${n}`;throw new N(e,[{path:[...t,n],message:e}])}let n=O.safeParse({...e,name:`content`,placement:e.type===`group`?`grid`:`main`});if(!n.success)throw N.fromZodErrors(n.error.issues.map(e=>({path:[...t,...e.path.map(String)],message:e.message})));n.data.type===`form`&&n.data.groups.forEach((e,n)=>requireBuilderName(e.name,[...t,`groups`,String(n),`name`]));let{name:r,label:i,placement:a,...o}=n.data;return cloneBuilderValue(o,t)}function validateLiteralContent(e,t){return validateContentConfiguration(e,t),cloneBuilderValue(e,t)}function positionOf(e){return{x:e.x,y:e.y,w:e.w,h:e.h}}function bottomOf(e){return e.y+e.h}function collides(e,t){return e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h}function firstCollision(e,t){return t.find(t=>collides(e,t))}function inReadingOrder$1(e){return[...e].sort((e,t)=>e.y-t.y||e.x-t.x)}function snapWidth(e,t,n){let r=12-t,i=v.filter(e=>e>=n&&e<=r);return i.length===0?v.find(e=>e>=n)??n:i.reduce((t,n)=>{let r=Math.abs(n-e),i=Math.abs(t-e);return r<i||r===i&&n>t?n:t})}function sharesColumns(e,t){return e.x<t.x+t.w&&t.x<e.x+e.w}function risenRow(e,t){return t.reduce((t,n)=>n.y<e.y&&sharesColumns(e,n)?Math.max(t,bottomOf(n)):t,0)}function packLayout(e,t){let n=e.map(e=>{let n=t?.get(e.i);return n===void 0?e:{...e,h:n}}),r=n.filter(e=>e.static===!0),i=new Map(r.map(e=>[e.i,e]));for(let e of inReadingOrder$1(n.filter(e=>e.static!==!0))){let t=risenRow(e,r),n=firstCollision({...e,y:t},r);for(;n!==void 0;)t=bottomOf(n),n=firstCollision({...e,y:t},r);let a={...e,y:t};r.push(a),i.set(e.i,a)}return n.map(e=>i.get(e.i)??e)}function settleLayout(e,t){let n=e.filter(e=>e.static===!0),r=e.filter(e=>e.static!==!0),i=new Map;for(let e of[...inReadingOrder$1(r.filter(e=>t.has(e.i))),...inReadingOrder$1(r.filter(e=>!t.has(e.i)))]){let t=e,r=firstCollision(t,n);for(;r!==void 0;)t={...t,y:bottomOf(r)},r=firstCollision(t,n);n.push(t),i.set(e.i,t)}return packLayout(e.map(e=>i.get(e.i)??e))}function pageCompactor(){return{type:`vertical`,allowOverlap:!1,preventCollision:!1,compact:e=>packLayout(e).map(e=>({...e,moved:!1}))}}function clampHeight(e,t){let n=t.minHeight??1,r=t.maxHeight??1/0;return Math.max(1,n,Math.min(r,e))}function widthStepConstraint(e){return{name:`width-steps`,constrainSize:(t,n,r)=>{let i=e(t.i),a=snapWidth(n,t.x,i.minWidth);return i.height===`fit`?{w:a,h:t.h}:i.height===`flexible`?{w:a,h:clampHeight(r,i)}:{w:a,h:Math.max(1,r)}}}}function snapCell(e,t){let n=Math.max(0,Math.min(e.x,11)),r=snapWidth(e.w,n,t(e.i).minWidth);return{...e,x:Math.min(n,12-r),y:Math.max(0,e.y),w:r,h:Math.max(1,e.h)}}function samePosition(e,t){return e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h}function pushApart(e){let t=e.filter(e=>e.static===!0),n=new Map;for(let r of inReadingOrder$1(e.filter(e=>e.static!==!0))){let e=r,i=firstCollision(e,t);for(;i!==void 0;){let n={...e,x:i.x+i.w};e=n.x+n.w<=12&&firstCollision(n,t)===void 0?n:{...e,y:bottomOf(i)},i=firstCollision(e,t)}t.push(e),n.set(r.i,e)}return e.map(e=>n.get(e.i)??e)}function isValidStatic(e){return[e.x,e.y,e.w,e.h].every(Number.isInteger)&&e.x>=0&&e.y>=0&&e.h>=1&&v.includes(e.w)&&e.x+e.w<=12}function keptStatics(e){let t=[],n=new Set;for(let r of inReadingOrder$1(e.filter(e=>e.static===!0)))isValidStatic(r)&&firstCollision(r,t)===void 0?t.push(r):n.add(r.i);return e.map(e=>n.has(e.i)?{...e,static:!1}:e)}function boundedHeight(e,t){let n=t(e.i);if(e.static===!0||n.height!==`flexible`)return e;let r=clampHeight(e.h,n);return r===e.h?e:{...e,h:r}}function repairPageGrid(e,t){let n=[],r=keptStatics(e).map(e=>{let r=boundedHeight(e,t);return r!==e&&n.push({name:e.i,kind:`height`,from:positionOf(e),to:positionOf(r)}),r}).map(e=>{if(e.static===!0)return e;let r=snapCell(e,t);return samePosition(e,r)||n.push({name:e.i,kind:`width`,from:positionOf(e),to:positionOf(r)}),r}),i=pushApart(r);i.forEach((e,t)=>{let i=r[t];i!==void 0&&!samePosition(i,e)&&n.push({name:e.i,kind:`pushed`,from:positionOf(i),to:positionOf(e)})});let a=packLayout(i),o=keptFill(a,t);for(let e of inReadingOrder$1(a))e.i!==o&&t(e.i).height===`fill`&&n.push({name:e.i,kind:`fill`});return{cells:a,repairs:n}}function keptFill(e,t){return inReadingOrder$1(e).find(e=>e.static!==!0&&t(e.i).height===`fill`)?.i}function firstFreeSlot(e,t,n){let r=t.reduce((e,t)=>Math.max(e,bottomOf(t)),0);for(let i=n;i<=r;i+=1)for(let n=0;n+e.w<=6;n+=1)if(firstCollision({x:n,y:i,...e},t)===void 0)return{x:n,y:i};return{x:0,y:r}}function deriveLayout6(e,t){let n=[];for(let r of inReadingOrder$1(e)){let e=Math.min(6,Math.max(t(r.i).minWidth,Math.ceil(r.w/2))),i=n.at(-1)?.y??0;n.push({i:r.i,...firstFreeSlot({w:e,h:r.h},n,i),w:e,h:r.h})}return n}function figureSlot(e,t,n){for(let r of inReadingOrder$1(e.filter(e=>n.has(e.i)))){let n={x:r.x+r.w,y:r.y,...t};if(n.x+n.w<=12&&firstCollision(n,e)===void 0)return n}}function placeNew(e,t,n,r){let i={w:snapWidth(n.size.w,0,n.minWidth),h:Math.max(1,n.size.h)};return n.figure?{i:t,...figureSlot(e,i,r)??{x:0,y:0,...i}}:{i:t,x:0,y:e.reduce((e,t)=>Math.max(e,bottomOf(t)),0),...i}}function spanContent(e,t){if(!v.includes(t)){let e=`A block spans ${v.join(`, `)} columns, not ${String(t)}`;throw new N(e,[{path:[`content`,`span`],message:e}])}return{content:e,span:t}}function configureContent(e,t){try{return typeof e==`object`&&e&&`build`in e&&typeof e.build==`function`?{configuration:validateContentConfiguration(e.build(),t),extension:e.extension}:{configuration:validateContentConfiguration(e,t)}}catch(e){throw e instanceof N?new N(e.message,e.errors.map(e=>({...e,path:e.path[0]===`content`?[...t,...e.path.slice(1)]:e.path}))):e}}function storedQuery(e,t){let n=[`search`,`offset`].filter(t=>e.state[t]!==void 0);if(n.length>0)throw new N(`A ${t} cannot keep a query's ${n.join(` or `)}`,n.map(e=>({path:[t,e],message:`A ${t} stores no ${e}; use filters and limit instead`})));return e.toDefinition()}function checkInputs(e,t){for(let[n,r]of Object.entries(t)){let t=e.inputs[n];r!==void 0&&t!==void 0&&D({parameters:t.schema},r,[`content`,`parameters`,n])}return t}var BlockContentBuilder=class{constructor(e,t,n){this.extension=e,this.parameters=t,this.heightMode=n}copy(e,t){let n=this.constructor;return new n(this.extension,e,t)}with(e){let t={...this.parameters};for(let[n,r]of Object.entries(e)){if(r===void 0){delete t[n];continue}t[n]=r}return checkInputs(this.extension,e),this.copy(t,this.heightMode)}height(e){return this.copy(this.parameters,e)}build(){let e={type:`custom`,extension:this.extension.name,parameters:cloneBuilderValue(this.parameters,[`content`,`parameters`]),...this.heightMode===void 0?{}:{height:this.heightMode}};return validateContentConfiguration(e,[`content`]),D(this.extension,e.parameters,[`content`,`parameters`]),e}span(e){return spanContent(this,e)}},Measures=class{count(){return this.measured(`count`)}sum(e){return this.measured(`sum`,e)}avg(e){return this.measured(`avg`,e)}min(e){return this.measured(`min`,e)}max(e){return this.measured(`max`,e)}};function measure(e,t,n){return{query:e,measure:t,...n===void 0?{}:{attribute:n}}}var MetricBuilder=class extends BlockContentBuilder{label(e){return this.with({label:e})}trend(e,t){return this.with({trend:e,trendBucket:t})}compare(e,t){return this.with({compare:e,period:t})}target(e){return this.with({target:e})}},MetricQuery=class extends Measures{constructor(e){super(),this.query=e}measured(e,t){return new MetricBuilder(x,checkInputs(x,measure(this.query,e,t)))}};function groupBy(e){return typeof e==`string`?[e,void 0]:[e.attribute,e.bucket]}var ChartBuilder=class extends BlockContentBuilder{label(e){return this.with({label:e})}by(e){let[t,n]=groupBy(e);return this.with({by:t,byBucket:n})}by2(e){let[t,n]=groupBy(e);return this.with({by2:t,by2Bucket:n})}kind(e){return this.with({kind:e})}bar(){return this.kind(`bar`)}horizontalBar(){return this.kind(`horizontal_bar`)}line(){return this.kind(`line`)}area(){return this.kind(`area`)}donut(){return this.kind(`donut`)}funnel(){return this.kind(`funnel`)}treemap(){return this.kind(`treemap`)}calendar(){return this.kind(`calendar`)}},ChartQuery=class extends Measures{constructor(e){super(),this.query=e}measured(e,t){return new ChartBuilder(b,checkInputs(b,{...measure(this.query,e,t),kind:`bar`}))}};const du={"7d":7,"30d":30};var AgendaBuilder=class extends BlockContentBuilder{label(e){return this.with({label:e})}next(e){let t=typeof e==`number`?e:du[e];if(!Number.isInteger(t)||t<1){let e=`An agenda looks ahead a whole number of days, at least 1`;throw new N(e,[{path:[`content`,`parameters`,`next`],message:e}])}return this.with({next:t})}yearly(){return this.with({yearly:!0})}},CardBuilder=class extends BlockContentBuilder{fields(...e){return this.with({fields:e})}record(e){return this.with({record:e})}},InboxBuilder=class extends BlockContentBuilder{kinds(...e){return this.with({kinds:e})}limit(e){return this.with({limit:e})}},MeetingsUpcomingBuilder=class extends BlockContentBuilder{limit(e){return this.with({limit:e})}},MailboxBuilder=class extends BlockContentBuilder{category(e){return this.with({category:e})}important(){return this.with({important:!0})}unread(){return this.with({unread:!0})}limit(e){return this.with({limit:e})}label(e){return this.with({label:e})}};function metric(e){return new MetricQuery(storedQuery(e,`metric`))}function chart(e){return new ChartQuery(storedQuery(e,`chart`))}function agenda(e,t){return new AgendaBuilder(_,checkInputs(_,{query:storedQuery(e,`agenda`),attribute:t}))}function card(e){let t=e===void 0||typeof e==`string`?e:e.build().name;return new CardBuilder(y,t===void 0?{}:checkInputs(y,{object:t}))}function text$1(e){return new BlockContentBuilder(w,checkInputs(w,{markdown:e}))}function inbox(){return new InboxBuilder(ye,{})}function meetingsUpcoming(){return new MeetingsUpcomingBuilder(we,{})}function mailbox(){return new MailboxBuilder(Se,{})}function isSpanned(e){return typeof e==`object`&&!!e&&`span`in e&&`content`in e}function total(e){return e.reduce((e,t)=>e+t,0)}function spread(e){return e.length===0?0:Math.max(...e)-Math.min(...e)}function betterSplit(e,t){let n=total(e)-total(t);if(n!==0)return n>0;let r=spread(t)-spread(e);if(r!==0)return r>0;let i=e.findIndex((e,n)=>e!==t[n]);return i!==-1&&(e[i]??0)>(t[i]??0)}function splitColumns(e,t){let n=[...t];function visit(r,i){let a=t[r.length];if(a===void 0){betterSplit(r,n)&&(n=r);return}for(let t of v)t>=a&&i+t<=e&&visit([...r,t],i+t)}return visit([],0),n}function rowWidths(e,t){let n=e.filter(e=>e.span===void 0);n.length>4&&reject(t,`A row holds at most 4 unsized blocks`);let r=total(e.map(e=>e.span??e.minWidth));r>12&&reject(t,`Blocks ${e.map(e=>`"${e.key}"`).join(`, `)} do not fit one row: they need at least ${r} of 12 columns`);let i=splitColumns(12-total(e.map(e=>e.span??0)),n.map(e=>e.minWidth)),a=0;return e.map(e=>{if(e.span!==void 0)return e.span;let t=i[a]??e.minWidth;return a+=1,t})}function reject(e,t){throw new N(t,[{path:e,message:t}])}function traitsOf(e,t=[]){return Kt(e,$e,new Map(t.map(e=>[e.name,e])))}function headingNames(e){let t=new Set(e.flatMap(e=>e.kind===`heading`?e.meta.name===void 0?[]:[e.meta.name]:[...Object.keys(e.blocks),...e.group?.name===void 0?[]:[e.group.name]]));return e.flatMap(e=>{if(e.kind!==`heading`)return[];if(e.meta.name!==void 0)return[e.meta.name];let n=nameSlug(e.title,40),r=n===``?`heading`:`heading_${n}`,i=r;for(let e=2;t.has(i);e+=1)i=`${r}_${e}`;return t.add(i),[i]})}function headingEntry(e,t,n){let r={title:t,...n.description===void 0?{}:{description:n.description},...n.icon===void 0?{}:{icon:n.icon}};return{key:e,content:new BlockContentBuilder(ve,r),span:12}}function groupOf(e,t,n){let[r]=e.map(e=>e.name).sort(),i=Et(e.length);return(i!==void 0||r===void 0)&&reject(n,String(i)),{type:`group`,name:t.name??`group_${r}`,placement:`grid`,...t.label===void 0?{}:{label:t.label},members:e.map(e=>e.name)}}function requirePlacement(e,t,n,r,i){if(e.type===`page`&&reject(i,`Content "${n}" cannot reference a page from a page`),sn(e,t,n,r,i),e.type!==`custom`)return;let a=t?.refine?.(e.parameters??{},r);a&&reject([...i,`parameters`,a.input],a.message)}var fu=class PageBuilder{constructor(e){this.kind=`view`,this.data=e}icon(e){return new PageBuilder({...this.data,icon:e})}description(e){return new PageBuilder({...this.data,description:e})}home(){return new PageBuilder({...this.data,home:!0})}for(e){let t=typeof e==`string`?e:e.build().name;return new PageBuilder({...this.data,object:t})}row(e,t={}){let n=t.group===void 0?{kind:`row`,blocks:e}:{kind:`row`,blocks:e,group:t.group};return new PageBuilder({...this.data,sections:[...this.data.sections,n]})}heading(e,t={}){let n={kind:`heading`,title:e,meta:t};return new PageBuilder({...this.data,sections:[...this.data.sections,n]})}build(){let e=[`views`,`0`],{name:t,label:n,object:r,icon:i,description:a,home:o,sections:s}=this.data;requireBuilderName(t,[...e,`name`]),r!==void 0&&requireBuilderName(r,[...e,`object`]),o&&r!==void 0&&reject([...e,`home`],`Only a standalone page can be the home`),s.every(e=>e.kind===`row`&&Object.keys(e.blocks).length===0)&&reject([...e,`contents`],`A page declares at least one block`);let c=r===void 0?`page`:`record`,l=[],u=[],d=headingNames(s),f=0;for(let t of s){let n=[...e,`contents`,String(l.length)],r=(t.kind===`heading`?[headingEntry(d[f++]??``,t.title,t.meta)]:Object.entries(t.blocks).map(([e,t])=>isSpanned(t)?{key:e,content:t.content,span:t.span}:{key:e,content:t,span:void 0})).map(t=>{let n=[...e,`contents`,String(l.length)];requireBuilderName(t.key,[...n,`name`]);let{configuration:r,extension:i}=configureContent(t.content,n);requirePlacement(r,i,t.key,c,n);let a={...r,name:t.key,placement:`grid`};return l.push(a),{content:a,span:t.span}}),i=rowWidths(r.map(({content:e,span:t})=>({key:e.name,...t===void 0?{}:{span:t},minWidth:traitsOf(e).minWidth})),n),a=u.reduce((e,t)=>Math.max(e,t.y+t.h),0);if(t.kind===`row`&&t.group!==void 0){let e=groupOf(r.map(({content:e})=>e),t.group,n);l.push(e),u.push({i:e.name,x:0,y:a,w:12,h:traitsOf(e,l).size.h});continue}let o=0;r.forEach(({content:e},t)=>{let n=i[t]??0;u.push({i:e.name,x:o,y:a,w:n,h:traitsOf(e).size.h}),o+=n})}let p=Object.fromEntries(packLayout(u).map(({i:e,x:t,y:n,w:r,h:i})=>[e,{x:t,y:n,w:r,h:i}])),m={name:t,label:n,...r===void 0?{}:{object:r},context:`page`,...i===void 0?{}:{icon:i},...a===void 0?{}:{description:a},...o?{home:!0}:{},contents:l,grid:p},h=T.safeParse(m);if(!h.success)throw N.fromZodErrors(h.error.issues.map(t=>({path:[...e,...t.path.map(String)],message:t.message})));return{kind:`view`,definition:cloneBuilderValue(m,e)}}};function page(e,t){return new fu({name:e,label:t,object:void 0,sections:[]})}var X=class ViewBuilder{constructor(e,t=[]){this.kind=`view`,this.data=cloneBuilderValue(e,[`views`,`0`]),this.extensions=t.map(e=>e&&{...e})}for(e){let t=typeof e==`string`?e:e.build().name;return new ViewBuilder({...this.data,object:t},this.extensions)}default(){return new ViewBuilder({...this.data,default:!0},this.extensions)}description(e){return new ViewBuilder({...this.data,description:e},this.extensions)}icon(e){return new ViewBuilder({...this.data,icon:e},this.extensions)}place(e,t,n,r,i){let{configuration:a,extension:o}=configureContent(n,[`views`,`0`,`contents`,String(this.data.contents.length)]),s={...a,name:e,label:t,placement:r},c=[...this.data.contents,s],l=i===void 0?{}:{anchors:{...this.data.anchors,[e]:{after:i}}};return new ViewBuilder({...this.data,...l,contents:c},[...this.extensions,o])}tab(e,t,n,r){return this.place(e,t,n,`main`,r?.after)}aside(e,t,n){return this.place(e,t,n,`aside`)}build(){let e=[`views`,`0`];requireBuilderName(this.data.name,[...e,`name`]),requireBuilderName(this.data.object,[...e,`object`]);let t=T.safeParse(this.data);if(!t.success)throw N.fromZodErrors(t.error.issues.map(t=>({path:[...e,...t.path.map(String)],message:t.message})));return this.data.contents.forEach((t,n)=>{let r=[...e,`contents`,String(n)];requireBuilderName(t.name,[...r,`name`]),t.type===`form`&&t.groups.forEach((e,t)=>requireBuilderName(e.name,[...r,`groups`,String(t),`name`])),sn(t,this.extensions[n],t.name,this.data.context,r)}),{kind:`view`,definition:cloneBuilderValue(this.data,e)}}};function detailView(e,t){return new X({name:e,label:t,object:void 0,context:`record`,contents:[]})}function listView(e,t){return new X({name:e,label:t,object:void 0,context:`collection`,contents:[]})}function isViewPiece(e){return`kind`in e&&e.kind===`view`}function isObjectPiece(e){return!(isViewPiece(e)||e instanceof P)}function assertPiece(e,t){if(typeof e!=`object`||!e)throw new N(`Unsupported bundle piece: ${t}`,[]);if(isViewPiece(e)||e instanceof P||typeof e.build==`function`)return;let n=e.name;throw new N(`Unsupported bundle piece: ${typeof n==`string`?n:String(t)}`,[])}function declarationOf$1(e){return e instanceof fu||e instanceof X?e.build():e}function isPage(e){return e.definition.context===`page`}function validateView(e){let t=T.safeParse(e);if(t.success)return t.data;let n=typeof e==`object`&&e&&`name`in e?String(e.name):`(unnamed)`,r=N.fromZodErrors(t.error.issues.map(e=>({path:e.path.map(String),message:e.message})));throw new N(`View "${n}" is invalid. ${r.message}`,r.errors)}function identityOf(e){return`${e.object??``}:${e.name}`}function assertUniqueIdentities(e,t){let n=new Set;for(let r of t){let t=identityOf(r);if(n.has(t))throw new k(e,r.name);n.add(t)}}function byIdentity(e){return(t,n)=>{let r=identityOf(e(t)),i=identityOf(e(n));return r<i?-1:+(r>i)}}async function hashBundlePieces(e){return sha256Hex(z({objects:[...e.objects].sort(byIdentity(e=>({name:e.name}))),views:[...e.views].sort(byIdentity(e=>e)),pages:[...e.pages].sort(byIdentity(e=>e.definition)),agents:[...e.agents].sort(byIdentity(e=>({name:e.name})))}))}async function builtBundleFromPieces(e){let t=e.name===uu;t||assertBundleName(e.name);let{objects:n,pages:r,agents:i}=e,a=e.views.map(validateView),o=n.map(e=>e.name);if(assertUniqueIdentities(`object`,o.map(e=>({name:e}))),assertUniqueIdentities(`view`,a),assertUniqueIdentities(`page`,r.map(e=>e.definition)),assertUniqueIdentities(`agent`,i.map(e=>({name:e.name}))),!t){let e=o.find(L);if(e!==void 0)throw new A(e,`bundle`)}return{name:e.name,label:e.label.trim(),description:e.description??null,hash:await hashBundlePieces({objects:n,views:a,pages:r,agents:i}),objects:n,views:a,pages:r,agents:i,uses:e.uses??[],samples:e.samples??[],translations:e.translations??{}}}const pu=Symbol.for(`standards.bundle`);function isBundle(e){return typeof e==`object`&&!!e&&e[pu]===!0}var BundleBuilder=class{constructor(e,t){this[pu]=!0,this.pieces=[],this.used=[],this.descriptionText=null,this.sampleRecords=[],this.translationTables={},this.built=null,assertBundleName(e),this.name=e,this.label=t,this.objectBuilders=[]}description(e){return this.descriptionText=e,this.changed()}add(...e){return this.pieces.push(...e),this.objectBuilders.push(...e.filter(isObjectPiece)),this.changed(),this}uses(...e){return this.used.push(...e),this.changed()}samples(e){return this.sampleRecords=e,this.changed()}translations(e,t){return this.translationTables[e]=t,this.changed()}build(){return this.built??=this.assemble(),this.built}changed(){return this.built=null,this}async assemble(){let e=[],t=[],n=[],r=[];for(let[i,a]of this.pieces.entries())if(assertPiece(a,i),a instanceof P)r.push(a.build());else if(isViewPiece(a)){let e=declarationOf$1(a);isPage(e)?n.push(e):t.push(e.definition)}else e.push(a.build());return this.assertNotInUsed(e),builtBundleFromPieces({name:this.name,label:this.label,description:this.descriptionText,objects:e,views:t,pages:n,agents:r,uses:this.used.map(e=>e.name),samples:this.sampleRecords,translations:{...this.translationTables}})}assertNotInUsed(e){let t=new Map,n=new Set([this]),visit=e=>{if(!n.has(e)){n.add(e);for(let n of e.objectBuilders){let r=n.build().name;t.has(r)||t.set(r,e.name)}for(let t of e.used)visit(t)}};for(let e of this.used)visit(e);for(let{name:n}of e){let e=t.get(n);if(e!==void 0)throw new k(`object`,n,`Object "${n}" is declared by bundle "${this.name}" and by its used bundle "${e}"`)}}};function bundle(e,t){return new BundleBuilder(e,t)}function readOnlyOption(e){return e?.readOnly===void 0?{}:{readOnly:e.readOnly}}function buildFreeFieldRef(e,t){return{type:`free`,attribute:e.build(),label:t?.label,required:t?.required,prefillExpression:t?.prefillExpression,...readOnlyOption(t)}}function buildSlotFieldRef(e,t,n){let[r,...i]=Array.isArray(e)?e:[e];return{type:`slot`,slotId:r,additionalSlotIds:i.length>0?i:void 0,attribute:t,label:n?.label,required:n?.required,tooltip:n?.tooltip,...readOnlyOption(n)}}const mu=B.boolean().optional();var FormRowBuilder=class{constructor(e,t,n){this._finalized=!1,this.stepBuilder=e,this.rowData={id:t,order:n,type:`fields`,fields:[]}}field(e,t,n){return this.rowData.fields.push(buildSlotFieldRef(e,t,n)),this}freeField(e,t){return this.rowData.fields.push(buildFreeFieldRef(e,t)),this}row(e){return this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData).row(e)}heading(e,t){return this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData).heading(e,t)}separator(){return this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData).separator()}text(e){return this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData).text(e)}endRow(){return this._finalized?this.stepBuilder:(this._finalized=!0,this.stepBuilder._finalizeRow(this.rowData))}},FormStepBuilder=class{constructor(e,t,n){this.rowOrder=0,this.formBuilder=e,this.stepData={id:t,label:n,rows:[]}}description(e){return this.stepData.description=e,this}field(e,t,n){this.rowOrder++;let r=`row-${this.stepData.id}-${this.rowOrder}`,i=buildSlotFieldRef(e,t,n),a={id:r,order:this.rowOrder,type:`fields`,fields:[i]};return this.stepData.rows.push(a),this}freeField(e,t){this.rowOrder++;let n=`row-${this.stepData.id}-${this.rowOrder}`,r=buildFreeFieldRef(e,t),i={id:n,order:this.rowOrder,type:`fields`,fields:[r]};return this.stepData.rows.push(i),this}row(e){return this.rowOrder++,new FormRowBuilder(this,e,this.rowOrder)}heading(e,t){this.rowOrder++;let n={id:`heading-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:`heading`,content:e,level:t};return this.stepData.rows.push(n),this}separator(){this.rowOrder++;let e={id:`sep-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:`separator`};return this.stepData.rows.push(e),this}text(e){this.rowOrder++;let t={id:`text-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:`text`,content:e};return this.stepData.rows.push(t),this}step(e,t){return this.formBuilder._finalizeStep(this.stepData).step(e,t)}build(){return this.formBuilder._finalizeStep(this.stepData).build()}_finalizeRow(e){return e.fields.length>0&&this.stepData.rows.push(e),this}_getData(){return this.stepData}},FormBuilder=class{constructor(e,t){this.data={slots:[],steps:[],status:`draft`,version:1},this.validateName(e),this.data.name=e,this.data.label=t}description(e){return this.data.description=e,this}icon(e){return this.data.icon=e,this}status(e){return this.data.status=e,this}metadata(e){return this.data.metadata=e,this}slot(e,t,n){if(this.data.slots.some(t=>t.id===e))throw Error(`[FormBuilder] Duplicate slot id: "${e}"`);let r={id:e,objectName:t,label:n.label,mode:n.mode??`create`,color:n.color,icon:n.icon};return this.data.slots.push(r),this}step(e,t){if(this.data.steps.some(t=>t.id===e))throw Error(`[FormBuilder] Duplicate step id: "${e}"`);return new FormStepBuilder(this,e,t)}build(){return this.validateRequiredData(),this.validateSlotReferences(),this.validateFreeFields(),this.validatePrefillExpressions(),this.validateReadOnly(),this.data}_finalizeStep(e){return this.data.steps.push(e),this}validateName(e){let t=B.string().min(1,`Form name cannot be empty`).max(63,`Form name is too long (max 63 characters)`).regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:`Invalid form name format. Name must be in kebab-case: 'client-onboarding', 'contact-creation'`});try{t.parse(e)}catch(e){throw e instanceof B.ZodError?Error(`[FormBuilder] ${e.issues[0].message}`):e}}validateRequiredData(){if(this.data.slots.length===0)throw Error(`[FormBuilder] At least one slot is required. Use .slot() to add slots.`);if(this.data.steps.length===0)throw Error(`[FormBuilder] At least one step is required. Use .step() to add steps.`)}validateSlotReferences(){let e=new Map(this.data.slots.map(e=>[e.id,e.objectName]));for(let t of this.data.steps)for(let n of t.rows)if(isFormFieldsRow(n))for(let r of n.fields){if(r.type!==`slot`)continue;let n=getSlotFieldTargets(r);for(let r of n)if(!e.has(r))throw Error(`[FormBuilder] Step "${t.id}" references unknown slot "${r}". Declare it with .slot("${r}", ...) first.`);let i=new Set(n.map(t=>e.get(t)));if(i.size>1)throw Error(`[FormBuilder] Step "${t.id}" field on attribute "${r.attribute}" targets slots of different objects (${[...i].join(`, `)}). A multi-slot field must target slots of the same object.`)}}validatePrefillExpressions(){let e=[...W,`join`,`where`];for(let t of this.data.steps)for(let n of t.rows)if(isFormFieldsRow(n))for(let r of n.fields){if(!isFormFreeFieldRef(r)||!r.prefillExpression)continue;let n=r.prefillExpression,i=`prefillExpression on free field "${r.attribute.name}" in step "${t.id}"`;if(!isLabelExpression(n))throw Error(`[FormBuilder] ${i} must contain at least one {{ attribute }} interpolation.`);if(/\{\{\s*\}\}/.test(n))throw Error(`[FormBuilder] ${i} contains empty {{ }} interpolation.`);for(let a of n.matchAll(/(?<!\|)\|(?!\|)\s*(\w+)(?:\s*:[^|}]*)?/g)){let n=a[1];if(!e.includes(n))throw Error(`[FormBuilder] ${i} uses invalid pipe "${n}". Valid pipes: ${e.join(`, `)}`);let o=a[0].replace(/^\|/,``);if(isWherePipe(o)&&!parseWherePipe(o))throw new N(`[FormBuilder] ${i} has a malformed where: pipe "${o.trim()}". Write where:property=value or where:property in (a,b).`,[{path:[t.id,r.attribute.name,`prefillExpression`],message:`Malformed where: pipe`}])}}}validateReadOnly(){for(let e of this.data.steps)for(let t of e.rows)if(isFormFieldsRow(t))for(let n of t.fields){if(mu.safeParse(n.readOnly).success)continue;let t=isFormFreeFieldRef(n)?n.attribute.name:n.attribute,r=isFormFreeFieldRef(n)?`free field`:`field`;throw new N(`[FormBuilder] readOnly on ${r} "${t}" in step "${e.id}" must be a boolean.`,[{path:[e.id,t,`readOnly`],message:`Expected a boolean`}])}}validateFreeFields(){let e=new Set(H);for(let t of this.data.steps)for(let n of t.rows)if(isFormFieldsRow(n)){for(let r of n.fields)if(isFormFreeFieldRef(r)){let n=r.attribute.type;if(e.has(n))throw Error(`[FormBuilder] Free field in step "${t.id}" uses forbidden attribute type "${n}". Forbidden types: ${H.join(`, `)}`)}}}};function form(e,t){return new FormBuilder(e,t)}const hu=`box`,gu=[`circle`,`square`],_u=[`upload`,`website`,`name`,`email`];function isImageSource(e){return _u.some(t=>t===e)}const vu={object:[`icon`,`color`],record:[`icon`,`image`],emailCategory:[`icon`,`color`],option:[`color`],view:[`icon`],agent:[`color`],user:[`image`]};function imageFileIdOf(e){return`image`in e?e.image?.fileId:`imageFileId`in e?e.imageFileId:void 0}function resolveAppearance(e,t){let n=imageFileIdOf(e);if(n)return{kind:`image`,imageFileId:n,shape:t?.image?.shape??`square`};let r=t?.name??e.name,i=e.color??t?.color??(r?el(r):void 0),a=e.icon??t?.icon??`box`;return i?{kind:`tile`,icon:a,color:i}:{kind:`glyph`,icon:a}}const yu=B.object({shape:B.enum(gu),from:B.array(B.string().refine(e=>e.trim().length>0,`Must not be blank`)).optional()}).strict();function imageLookupKindOf(e){return e.type===`text`?e.format===`url`?`website`:e.format===`email`?`email`:`name`:null}function validateObjectImage(e){let t=e.image?.from;if(t===void 0)return;let refuse=(t,n)=>{throw new N(`Object "${e.name}": ${t}`,[{path:n===void 0?[`image`,`from`]:[`image`,`from`,String(n)],message:t}])};t.length===0&&refuse(`image.from must name at least one attribute`);let n=new Map((e.attributes??[]).map(e=>[e.name,e])),r=new Set;for(let[e,i]of t.entries()){r.has(i)&&refuse(`image.from names "${i}" twice`,e),r.add(i);let t=n.get(i);t?imageLookupKindOf(t)===null&&refuse(`image.from names "${i}", a ${t.type} attribute: only text attributes can locate an image`,e):refuse(`image.from names "${i}", which is not one of its attributes`,e)}}function validateObjectExpressions(e){let{name:t,labelExpression:n,embeddingExpression:r}=e;if(!n)throw new j(`Object "${t}" must have a labelExpression. The labelExpression defines how records are displayed in lists and relations (e.g. "{{ name }}").`,M.VALIDATION_FAILED);let i=G.safeParse(n);if(!i.success){let e=i.error.issues[0]?.message??`Invalid labelExpression`;throw new j(`Invalid labelExpression for "${t}": ${e}`,M.VALIDATION_FAILED)}if(r!==void 0){let e=G.safeParse(r);if(!e.success){let n=e.error.issues[0]?.message??`Invalid embeddingExpression`;throw new j(`Invalid embeddingExpression for "${t}": ${n}`,M.VALIDATION_FAILED)}}}var ObjectBuilder=class{get"~standard"(){return createStandardSchemaProps(Mc(this.build()))}constructor(e,t){this._sealed=!1,this._toleratedAttributes=[],this.validateName(e),this.obj={name:e,label:t,attributes:[],system:!0}}id(e){return this.obj.id=e,this}description(e){return this.obj.description=e,this}pluralLabel(e){return this._pluralLabel=e,this}icon(e){return this.obj.icon=e,this}color(e){return this.obj.color=e,this}image(e={}){return this.obj.image={shape:e.shape??`square`,...e.from===void 0?{}:{from:[...e.from]}},this}runtime(){return this.obj.system=!1,this}sealed(){return this._sealed=!0,this}tolerate(e){return this._toleratedAttributes=[...this._toleratedAttributes,...e],this}attribute(e){return this.pushAttributes([e]),this}attributes(e){return this.pushAttributes(e),this}pushAttributes(e){let t=e.map(e=>`build`in e&&typeof e.build==`function`?e.build():e);Hs([...this.obj.attributes,...t],e=>e.name,e=>new k(`attribute`,e,`Object "${this.obj.name}": duplicate attribute name "${e}"`)),this.obj.attributes.push(...t)}metadata(e){return this.obj.metadata={...this.obj.metadata,...e},this}order(e){return this.obj.metadata={...this.obj.metadata,order:e},this}hidden(){return this.obj.metadata={...this.obj.metadata,hidden:!0},this}labelExpression(e){return this._labelExpression=e,this}embeddingExpression(e){return this._embeddingExpression=e,this}documentLayout(e){if(e.presets)for(let t of e.presets)validatePresetStructure(t.id,t.structure,1);return this.obj.documentLayout=e,this}build(){if(!this.obj.name)throw new N(`[ObjectBuilder] Missing required field: name`,[{path:[`name`],message:`name is required`}]);if(!this.obj.label)throw new N(`[ObjectBuilder] Missing required field: label`,[{path:[`label`],message:`label is required`}]);return validateObjectExpressions({name:this.obj.name,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression}),validateObjectImage({name:this.obj.name,image:this.obj.image,attributes:this.obj.attributes}),{...this.obj,pluralLabel:this._pluralLabel,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression,sealed:this._sealed,toleratedAttributes:this._toleratedAttributes}}validateName(e){e!==void 0&&Xs(e)}};function object(e,t){if(L(e))throw new A(e,`builder`);return new ObjectBuilder(e,t)}function validatePresetStructure(e,t,n){let fail=(t,n)=>{throw new N(t,[{path:[`documentLayout`,`presets`,e],message:n}])};n>5&&fail(`Preset structure exceeds max depth of 5`,`Preset structure too deep`);let r=new Set;for(let i of t){let t=i.title.trim();t.length===0&&fail(`Folder preset node title is required`,`Empty folder title`),t.includes(`/`)&&fail(`Folder preset node title cannot contain /`,`Folder title contains /: "${t}"`),r.has(t)&&fail(`Folder preset sibling titles must be unique`,`Duplicate folder title: "${t}"`),r.add(t),i.children&&i.children.length>0&&validatePresetStructure(e,i.children,n+1)}}function relationProperty(e){return requireBuilderName(e,[`relationProperty`]),{relationProperty:e}}var Z=class ContentBuilder{constructor(e,t){this.data=cloneBuilderValue(e,[`content`]),this.extension=t===void 0?void 0:Object.freeze({name:t.name,contexts:t.contexts,parameters:t.parameters,refine:t.refine})}set(e){return new ContentBuilder({...this.data,...e},this.extension)}icon(e){return this.set({icon:e})}object(e){return this.set({objectName:e})}layout(e){let{layout:t,groupByAttribute:n,columnSizing:r,kanbanColumnOrder:i,kanbanColumnVisibility:a,kanbanPinnedColumns:o,...s}={...this.data,layout:void 0,groupByAttribute:void 0,columnSizing:void 0,kanbanColumnOrder:void 0,kanbanColumnVisibility:void 0,kanbanPinnedColumns:void 0};return new ContentBuilder({...s,...e},this.extension)}table(){return this.layout({layout:`table`})}list(){return this.layout({layout:`list`})}kanban(e){return this.layout({layout:`kanban`,groupByAttribute:e})}columns(...e){return this.set({columns:e})}actions(...e){return this.set({actions:e})}openMode(e){return this.set({openMode:e})}createMode(e){return this.set({createMode:e})}visibility(e){return this.set({visibility:e})}descriptionAttribute(e){return this.set({descriptionAttribute:e})}displayAttributes(...e){return this.set({displayAttributes:e})}columnSizing(e){return this.set({columnSizing:e})}kanbanColumnOrder(...e){return this.set({kanbanColumnOrder:e})}kanbanColumnVisibility(e){return this.set({kanbanColumnVisibility:e})}kanbanPinnedColumns(...e){return this.set({kanbanPinnedColumns:e})}formColumns(e){return this.set({formColumns:e})}density(e){return this.set({density:e})}titleAttribute(e){return this.set({titleAttribute:e})}allowUpload(e){return this.set({allowUpload:e})}allowRemove(e){return this.set({allowRemove:e})}hideAttachments(e){return this.set({hideAttachments:e})}relations(...e){return this.set({relations:e})}span(e){return spanContent(this,e)}height(e){return this.set({height:e})}build(){let e=validateLiteralContent(this.data,[`content`]);return this.extension&&e.type===`custom`&&D(this.extension,e.parameters,[`content`,`parameters`]),e}},bu=class GroupBuilder{constructor(e,t,n,r={}){this.data=cloneBuilderValue({name:e,label:t,fields:n,...r},[`group`])}field(e,t){let{name:n,label:r,fields:i,...a}=this.data;return new GroupBuilder(n,r,[...i,{attribute:e,...t}],a)}fields(...e){let{name:t,label:n,fields:r,...i}=this.data;return new GroupBuilder(t,n,[...r,...e.map(e=>({attribute:e}))],i)}description(e){return new GroupBuilder(this.data.name,this.data.label,this.data.fields,{...this.presentation(),description:e})}collapsible(e=!1){return new GroupBuilder(this.data.name,this.data.label,this.data.fields,{...this.presentation(),collapsible:!0,collapsed:e})}presentation(){let{name:e,label:t,fields:n,...r}=this.data;return r}build(){requireBuilderName(this.data.name,[`group`,`name`]);try{validateLiteralContent({type:`form`,groups:[this.data]},[`group`])}catch(e){throw e instanceof N?new N(e.message,e.errors.map(e=>({...e,path:e.path[1]===`groups`?[`group`,...e.path.slice(3)]:e.path}))):e}return cloneBuilderValue(this.data,[`group`])}};function group(e,t){return new bu(e,t,[])}function collection(e){return new Z({type:`collection`,...storedQuery(e,`collection`)})}function form$1(...e){return new Z({type:`form`,groups:e.map(e=>`build`in e?e.build():e)})}function activity(){return new Z({type:`activity`})}function richtext$1(e){return new Z({type:`richtext`,attribute:e})}function documents(){return new Z({type:`documents`})}function forms(){return new Z({type:`forms`})}function emails(...e){return new Z({type:`emails`,emailAttributes:e})}function meetings(...e){return new Z({type:`meetings`,emailAttributes:e})}function custom(e,t){if(typeof e!=`object`||!e||typeof e.name!=`string`)throw new N(`Expected registered extension declaration`,[{path:[`content`,`extension`],message:`Expected registered extension declaration`}]);let n=validateContentConfiguration({type:`custom`,extension:e.name,parameters:t},[`content`]);if(n.type!==`custom`)throw new N(`Expected custom content`,[]);let r=new Z({...n,extension:e.name},e);return r.build(),r}function recordLinksTab(){return[S.name,S.label,custom(je,{}).icon(S.icon)]}function recordMemoryTab(){return[C.name,C.label,custom(Me,{}).icon(C.icon)]}function page$1(e){let{object:t,name:n}=e.definition;if(typeof t!=`string`){let e=`Page "${n}" is standalone; a record tab renders a record page (\`page(...).for(object)\`)`;throw new N(e,[{path:[`content`,`page`,`object`],message:e}])}return new Z({type:`page`,page:{object:t,name:n}})}const xu={collection,metric,chart,agenda,card,text:text$1,inbox,meetingsUpcoming,mailbox,page:page$1,form:form$1,activity,richtext:richtext$1,documents,forms,emails,meetings,custom};function contentDefinition(e,t){if(t.suppressed)return null;let n=t.workspaceDefinition??t.sourceDefinition;return n===null?null:{...structuredClone(n),name:e}}function storedContentDefinition(e){let{name:t,...n}=e;return structuredClone(n)}function workspaceViewAuthoring(e,t={}){let n={main:0,aside:0};return{origin:`runtime`,mainOrderCustomized:!1,asideOrderCustomized:!1,gridCustomized:Object.keys(t).length>0,homeCustomized:!1,contents:Object.fromEntries(e.map(e=>[e.name,{sourceDefinition:null,workspaceDefinition:storedContentDefinition(e),suppressed:!1,sourcePosition:null,workspacePosition:e.placement===`grid`?null:n[e.placement]++,sourceGrid:null,workspaceGrid:t[e.name]??null}]))}}function byKind(e,t){let rank=e=>Number(e.definition.type===`group`);return rank(e)-rank(t)||e.name.localeCompare(t.name)}function inReadingOrder(e){return(t,n)=>{let r=e(t.name),i=e(n.name);return r===null||i===null?r===i?byKind(t,n):r?-1:1:r.y-i.y||r.x-i.x||byKind(t,n)}}function overLimit(e,t){let n=new Set;if(e.length<=F.tabsPerView)return n;let r=new Map(e.map(e=>[e.name,e])),i=new Map;for(let{name:t,definition:n}of e)if(n.type===`group`)for(let e of n.members)i.has(e)||i.set(e,t);let cellOf=e=>{let n=r.get(e),a=n?t(n.state):null;if(a!==null)return a;let o=r.get(i.get(e)??``);return o?t(o.state):null},a=e.filter(e=>e.state.sourceDefinition===null).sort(inReadingOrder(cellOf)).reverse();for(let t of a){if(e.length-n.size<=F.tabsPerView)break;if(n.has(t.name))continue;let i=t.definition.type===`group`?t.definition.members.flatMap(e=>{let t=r.get(e);return t&&t.definition.type!==`group`?[t]:[]}):[];if(!i.some(e=>e.state.sourceDefinition!==null))for(let e of[t,...i])n.add(e.name)}return n}function resolvePageGrid(e,t={}){let rawCell=t=>e.gridCustomized||t.sourceDefinition===null?t.workspaceGrid:t.sourceGrid,n=Object.entries(e.contents).flatMap(([e,t])=>{let n=contentDefinition(e,t);return n?[{name:e,state:t,definition:n}]:[]}),r=E(n.map(e=>e.definition)),i=n.filter(e=>!r.has(e.name)).sort((e,t)=>e.name.localeCompare(t.name)),a=overLimit(i,rawCell),o=i.filter(e=>!a.has(e.name)),s=new Map(o.map(e=>[e.name,e.definition])),c=t.traitsOf??en(s,$e),l=Dt([...s.values()]),u=o.filter(e=>!l.has(e.name)),d={},f=[],place=(e,t)=>{t&&!Object.values(d).some(e=>$t(t,e))?d[e]={...t}:f.push(e)};if(e.gridCustomized)for(let{name:e,state:t}of u)place(e,t.workspaceGrid);else{for(let{name:e,state:t}of u)t.sourceDefinition!==null&&place(e,t.sourceGrid);for(let{name:e,state:t}of u)t.sourceDefinition===null&&place(e,t.workspaceGrid)}let p=Math.max(0,...Object.values(d).map(e=>e.y+e.h));for(let t of f.sort()){let n=e.contents[t],{w:r,h:i}=n.workspaceGrid??n.sourceGrid??c(t).size;d[t]={x:0,y:p,w:r,h:i},p+=i}let m=repairPageGrid(Object.entries(d).map(([e,n])=>({i:e,...n,...t.statics?.has(e)?{static:!0}:{}})),c);return{grid:Object.fromEntries(m.cells.map(({i:e,x:t,y:n,w:r,h:i})=>[e,{x:t,y:n,w:r,h:i}])),repairs:[...[...a].map(e=>({name:e,kind:`dropped`})),...m.repairs]}}function droppedContents(e){return new Set(e.flatMap(e=>e.kind===`dropped`?[e.name]:[]))}function resolveViewContents(e){let t=Object.entries(e.contents).flatMap(([e,t])=>{let n=contentDefinition(e,t);return n?[{definition:n,...t}]:[]}),n=[`main`,`aside`].flatMap(n=>{let r=n===`main`?e.mainOrderCustomized:e.asideOrderCustomized;return t.filter(e=>e.definition.placement===n).sort((e,t)=>{let n=r?e.workspacePosition:e.sourcePosition,i=r?t.workspacePosition:t.sourcePosition;if(n!==null&&i!==null&&n!==i)return n-i;if(n!==null&&i===null)return-1;if(i!==null&&n===null)return 1;let a=e.sourcePosition??e.workspacePosition,o=t.sourcePosition??t.workspacePosition;return a!==null&&o!==null&&a!==o?a-o:a!==null&&o===null?-1:o!==null&&a===null?1:e.definition.name.localeCompare(t.definition.name)}).map(e=>e.definition)}),r=E(t.map(e=>e.definition)),i=t.filter(e=>e.definition.placement===`grid`&&!r.has(e.definition.name)).map(e=>e.definition).sort((e,t)=>e.name.localeCompare(t.name));return[...n,...i]}const Su=[`record`,`document`,`file`,`email`,`thread`,`event`,`memory`,`skill`,`schema`,`user`,`guide`,`bundle`,`draft`],Cu=new Set([`memory`,`schema`]),wu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function isReferenceKind(e){return Su.includes(e)}function refuse$1(e,t){return{ok:!1,reason:e,expected:t}}function parseReference(e){let t=e.trim();if(wu.test(t))return refuse$1(`bare_uuid`,`record:<id>`);let n=t.indexOf(`:`);if(n===-1)return refuse$1(`malformed`,`<kind>:<id>`);let r=t.slice(0,n).toLowerCase();if(!isReferenceKind(r))return refuse$1(`unknown_kind`,`<kind>:<id> with kind one of ${Su.join(`, `)}`);let i=t.slice(n+1).trim();return i===``?refuse$1(`malformed`,`${r}:<id>`):r===`record`&&i.includes(`:`)?refuse$1(`legacy_mention`,`record:${i.slice(i.lastIndexOf(`:`)+1)}`):i===`*`&&!Cu.has(r)?refuse$1(`malformed`,`${r}:<id>`):{ok:!0,ref:{kind:r,id:i}}}function formatReference(e){return`${e.kind}:${e.id}`}function isWildcard(e){return e.id===`*`&&Cu.has(e.kind)}function requestedCapabilities(e){let t=[];return e.canModify&&t.push(`modify`),e.canSend&&t.push(`send`),t}const Tu={status:`connector_status`,error:`connector_error`,provider:`connector_provider`},Eu={phone:`text`,currency:`number`},Du={rename:[`kind`,`object`,`from`,`to`],phone:[`kind`,`object`,`attribute`,`to`,`defaultCountryCode`],currency:[`kind`,`object`,`attribute`,`to`,`currencyCode`]};function refuse(e,t,n){throw new N(n,[{path:t===void 0?[`resolutions`,String(e)]:[`resolutions`,String(e),t],message:n}])}function assertKeys(e,t,n){for(let r of n)(typeof t[r]!=`string`||t[r]===``)&&refuse(e,r,`Resolution ${e} needs a non-empty string \`${r}\``);let r=Object.keys(t).find(e=>!n.includes(e));r!==void 0&&refuse(e,r,`Resolution ${e} has an unknown field \`${r}\``)}function assertResolution(e,t){if(Ws(t)||refuse(e,void 0,`Resolution ${e} must be an object`),t.kind===`rename`){assertKeys(e,t,Du.rename),t.from===t.to&&refuse(e,`to`,`Resolution ${e} renames "${t.from}" to itself`);return}if(t.kind!==`retype`&&refuse(e,`kind`,`Unknown resolution kind ${JSON.stringify(t.kind)}: expected "rename" or "retype"`),t.to!==`phone`&&t.to!==`currency`&&refuse(e,`to`,`Unsupported retype to ${JSON.stringify(t.to)}: a push converts text → phone and number → currency only`),assertKeys(e,t,Du[t.to]),t.to===`phone`){let n=t.defaultCountryCode;/^[A-Z]{3}$/.test(n)&&rl(n)||refuse(e,`defaultCountryCode`,`Resolution ${e}: "${n}" is not an ISO 3166-1 alpha-3 country code`);return}let n=t.currencyCode;/^[A-Z]{3}$/.test(n)&&nl(n)||refuse(e,`currencyCode`,`Resolution ${e}: "${n}" is not a supported ISO 4217 currency code`)}function addressesOf(e){return e.kind===`rename`?{reads:e.from,lands:e.to}:{reads:e.attribute,lands:e.attribute}}function assertSchemaSourceResolutions(e){if(!Array.isArray(e))throw new N("`resolutions` must be an array",[{path:[`resolutions`],message:"`resolutions` must be an array"}]);if(e.length>100)throw new N(`A push carries ${e.length} resolutions; the limit is 100`,[]);let t=new Set;for(let[n,r]of e.entries()){assertResolution(n,r);let{reads:e,lands:i}=addressesOf(r);for(let[a,o]of[[`${r.kind}:${r.object}.${e}`,`of "${r.object}.${e}"`],[`${r.kind}>${r.object}.${i}`,`onto "${r.object}.${i}"`]])t.has(a)&&refuse(n,void 0,`Resolution ${n} repeats a ${r.kind} ${o}`),t.add(a)}}function phoneFromText(e,t){let n=e.trim();if(n===``)return{value:null};let r=il(n,Zc(t));if(!r?.isPossible()||r.country===void 0||r.ext!==void 0)return;let i=tl(r.country)?.iso3;if(i!==void 0)return{value:{countryCode:i,phoneNumber:$c(n,i)}}}function convertRetypedValue(e,t,n={}){if(t===null)return{value:null};if(e.to===`phone`)return typeof t==`string`?phoneFromText(t,e.defaultCountryCode):void 0;if(typeof t==`number`&&Math.abs(t)<=2**53-1&&!(t<0&&n.allowNegative!==!0))return{value:{code:e.currencyCode,value:t}}}const Q=B.string().refine(e=>e.trim().length>0,`Must not be blank`),Ou=B.union([B.tuple([B.literal(`object`),Q]),B.tuple([B.literal(`attribute`),Q,Q]),B.tuple([B.literal(`view`),Q,Q]),B.tuple([B.literal(`content`),Q,Q,Q])]),ku=B.object({label:Q,pluralLabel:B.string().optional(),description:B.string().optional(),icon:I.optional(),color:Us.optional(),image:yu.optional(),labelExpression:B.string(),embeddingExpression:B.string().optional(),sealed:B.boolean().optional(),toleratedAttributes:B.array(Q).optional(),metadata:B.record(B.string(),B.unknown()).optional(),documentLayout:B.record(B.string(),B.unknown()).optional()}).strict();function failure(e){throw new N(e,[])}function definitionSchema(e){return B.custom(t=>{let n=B.record(B.string(),B.unknown()).parse(t);for(let t of e[0]===`view`?[`object`,`name`]:[`name`])Object.hasOwn(n,t)&&failure(`Invalid schema state: unrecognized definition key ${t}`);switch(e[0]){case`object`:ku.parse(n);break;case`attribute`:{let e=B.enum(de).parse(n.type);ic(e).extend({type:B.literal(e),label:Q,required:B.boolean().optional(),unique:B.boolean().optional(),icon:I.optional()}).strict().parse(n);break}case`view`:{let{contents:t,...r}=n,i=B.array(Q).parse(t);new Set(i).size!==i.length&&failure(`Invalid schema state: duplicate content membership`),ot.parse({...r,object:e[1],name:e[2],contents:[]});break}case`content`:O.parse({...n,name:e[3]})}return!0})}function compareSchemaStateEntries(e,t){let n=JSON.stringify(e.address),r=JSON.stringify(t.address);return n<r?-1:+(n>r)}function schemaStateSourcePayload(e){return{modelVersion:1,hashVersion:1,entries:[...e].sort(compareSchemaStateEntries).filter(e=>e.source!==null).map(({address:e,source:t})=>({address:e,source:t}))}}function parseState(e){let t=B.record(B.string(),B.unknown()).parse(e);for(let[e,n]of[[`modelVersion`,`model`],[`hashVersion`,`hash`]])t[e]!==1&&failure(`Unsupported schema ${n} version: expected 1, received ${t[e]===void 0?`missing`:String(t[e])}`);let n=B.object({modelVersion:B.literal(1),hashVersion:B.literal(1),tenant:Q,sourceFingerprint:B.string().regex(/^[a-f0-9]{64}$/),entries:B.array(B.unknown())}).strict().safeParse(e);if(!n.success){let e=n.error.issues.find(e=>e.code===`unrecognized_keys`);throw e?.code===`unrecognized_keys`&&failure(`Invalid schema state: unrecognized key ${e.keys[0]}`),N.fromZodErrors(n.error.issues.map(e=>({path:e.path.map(String),message:e.message})))}let r=new Set,i=n.data.entries.map(e=>{let t=Ou.parse(B.object({address:B.unknown()}).parse(e).address),n=JSON.stringify(t);r.has(n)&&failure(`Invalid schema state: duplicate address ${n}`),r.add(n);let i=definitionSchema(t).nullable(),a=t[0]===`object`||t[0]===`attribute`?B.object({id:B.string().uuid(),updatedAt:B.string().datetime()}).strict():B.object({id:B.string().uuid(),revision:B.number().int().nonnegative()}).strict(),o=B.object({address:Ou,source:i,effective:i,status:B.enum([`source`,`runtime`,`copy`,`suppressed`]),sourceOwner:B.string().regex(U).nullable(),guard:a.nullable()}).strict().parse(e);return(o.status===`runtime`&&(o.source!==null||o.effective===null||o.sourceOwner!==null)||o.status===`suppressed`&&(t[0]!==`content`||o.source===null||o.effective!==null||o.guard===null)||o.status===`copy`&&(o.source===null||o.effective===null)||o.effective!==null&&o.guard===null||o.source===null&&o.effective===null)&&failure(`Invalid schema state: inconsistent status at ${n}`),{...o,sourceOwner:parseSchemaOwner(o.sourceOwner)}});return{...n.data,entries:i.sort(compareSchemaStateEntries)}}function parseSchemaState(e){try{return parseState(e)}catch(e){throw e instanceof B.ZodError?N.fromZodErrors(e.issues.map(e=>({path:e.path.map(String),message:e.message}))):e}}function diffSchemaState(e){let t=[];for(let n of[...e.entries].sort(compareSchemaStateEntries)){let e=n.source===null?`added`:n.status===`suppressed`?`suppressed`:n.effective===null?`removed`:z(n.source)===z(n.effective)?n.status===`copy`?`copied`:null:`changed`;e&&t.push({...n,change:e})}return{modelVersion:1,tenant:e.tenant,sourceFingerprint:e.sourceFingerprint,changes:t}}const $=B.string().min(1),Au=B.union([B.object({objectName:$,viewName:$,contentName:$.optional()}).strict().describe(`Full configuration of a view, or of one content when contentName is given`),B.object({objectId:$}).strict().describe(`An object with its attributes, by id`),B.object({objectName:$}).strict().describe(`An object with its attributes`),B.object({objectId:$,attributeName:$}).strict().describe(`One attribute's config, by name`),B.object({objectId:$,attributeId:$}).strict().describe(`One attribute's config, by id`),B.object({objectId:$,recordId:$}).strict().describe(`One sample record`)]);function parseNamedTarget(e){let t=Au.safeParse(e);if(!t.success)throw new N(`Invalid scoped target`,[{path:[`target`],message:`Expected exactly one named target branch`}]);return t.data}const ju=[`object`,`attribute`,`view`,`content`,`sample`],Mu=B.object({mode:B.enum([`inline`,`window`]),interaction:B.enum([`static`,`interactive`]),size:B.enum([`compact`,`regular`]),aspectRatio:B.number().positive().finite().optional()}).strict(),Nu=B.object({artifactId:B.string().min(1),revision:B.number().int().positive(),name:B.string().min(1),kind:B.string().min(1),retention:B.enum(Pl),display:Mu}).strict();function readArtifactResult(e){let t=Nu.safeParse(e);return t.success?t.data:null}const Pu=B.string().regex(/^[^/\s]+\/[^/\s]+$/),Fu=B.object({kind:B.literal(`generated-image`),artifact:B.unknown(),generation:B.object({attemptId:B.uuid(),requestedModelId:Pu,executedModelId:Pu.nullable(),format:B.enum(Bl),mimeType:B.enum([`image/png`,`image/jpeg`,`image/webp`])}).strict()}).strict();function readGeneratedImageResult(e){let t=Fu.safeParse(e);if(!t.success)return null;let n=readArtifactResult(t.data.artifact);return!n||n.kind!==`image`?null:{...t.data,artifact:{...n,kind:`image`}}}function isCompletedToolPart(e){return e.type===`tool`&&e.state===`completed`}function readString(e,t){let n=e[t];return typeof n==`string`?n:void 0}function upsertWithPrecedence(e,t,n,r){let i=e.get(t),a=i&&r[i.kind]>r[n.kind]?i:n;e.delete(t),e.set(t,a)}function asRecord(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function readRefId(e,t,n){let r=readString(e,t),i=`${n}:`;return r?.startsWith(i)&&r.length>i.length?r.slice(i.length):void 0}function verbResultEntries(e){let t=asRecord(e);if(!t)return[];let n=[t];for(let e of[`members`,`created`,`updated`]){let r=t[e];if(Array.isArray(r))for(let e of r){let t=asRecord(e);t&&n.push(t)}}return n.filter(e=>!(`error`in e))}function extractReadRecordIds(e){let t=new Set;for(let n of e)if(n.role===`assistant`)for(let e of n.parts){if(!isCompletedToolPart(e)||e.name!==`read`)continue;let n=e.args.refs;if(Array.isArray(n))for(let e of n){if(typeof e!=`string`)continue;let n=parseReference(e);n.ok&&n.ref.kind===`record`&&t.add(n.ref.id)}}return[...t]}const Iu={created:1,modified:0};function readSingleRecordEntry(e){if(typeof e!=`object`||!e)return null;let t=e,n=typeof t.record==`object`&&t.record!==null?t.record:void 0,r=(n&&readString(n,`id`))??readString(t,`recordId`);return r?{id:r,label:(n&&readString(n,`label`))??r,objectName:(n&&readString(n,`objectName`))??``}:null}function readBulkRecordEntries(e,t,n){if(typeof e!=`object`||!e)return[];let r=e[t];if(!Array.isArray(r))return[];let i=[];for(let e of r){if(typeof e!=`object`||!e)continue;let t=e,r=readString(t,`id`);r&&i.push({id:r,label:readString(t,`label`)??r,objectName:readString(t,`objectName`)??n})}return i}function readVerbRecordEntries(e){let t=asRecord(asRecord(e.result)?.record),n=readString(e.args,`object`)??(t&&readString(t,`objectName`))??``,r=[];for(let t of verbResultEntries(e.result)){let e=readRefId(t,`ref`,`record`);e&&r.push({id:e,label:readString(t,`title`)||readString(t,`label`)||e,objectName:readString(t,`objectName`)??n})}return r}function extractTouchedRecords(e){let t=new Map;for(let n of e)if(n.role===`assistant`)for(let e of n.parts){if(!isCompletedToolPart(e))continue;let n=[],r;if(e.name===`create_record`||e.name===`update_record`||e.name===`edit_content`){let t=readSingleRecordEntry(e.result);n=t?[t]:[],r=e.name===`create_record`?`created`:`modified`}else if(e.name===`bulk_create_records`||e.name===`bulk_update_records`){let t=readString(e.args,`objectId`)??``,i=e.name===`bulk_create_records`?`created`:`updated`;n=readBulkRecordEntries(e.result,i,t),r=e.name===`bulk_create_records`?`created`:`modified`}else if(e.name===`write`)n=readVerbRecordEntries(e),r=readString(e.args,`action`)===`create`?`created`:`modified`;else continue;for(let e of n){let n={recordId:e.id,objectName:e.objectName,label:e.label,kind:r};upsertWithPrecedence(t,e.id,n,Iu)}}return[...t.values()]}const Lu={modified:1,consulted:0};function isFilePart(e){return e.type===`file`}function entryFromDocumentMutation(e,t){if(typeof e.result!=`object`||e.result===null)return null;let n=e.result,r=readString(n,`documentId`)??(t===`folderId`?readString(n,t):void 0);return r?{id:r,title:readString(e.args,`name`)??readString(e.args,`title`)??r,kind:`modified`}:null}function entryFromReadDocument(e){let t=readString(e.args,`documentId`);return t?{id:t,title:t,kind:`consulted`}:null}function entryFromRef(e,t,n){let r=readRefId(e,`ref`,`file`),i=r??readRefId(e,`ref`,`document`);return i?{id:i,...r?{fileId:r}:{},title:n||readString(e,`title`)||i,kind:t,mimeType:readString(e,`mimeType`)}:null}function entriesFromOrganize(e){let t=asRecord(e.result);if(!t||`error`in t)return[];let n=readString(e.args,`action`),r=readString(e.args,`name`)??readString(e.args,`title`),i=readString(t,`documentId`);if(i)return[{id:i,title:r??i,kind:`modified`}];let a=readString(t,`folderId`);if(a)return n===`create_folder`?[{id:a,title:r??a,kind:`modified`}]:[];let o=entryFromRef(t,`modified`,r);return o?[o]:[]}function entriesFromCopy(e){let t=asRecord(e.result);if(!t||`error`in t)return[];let n=(Array.isArray(t.copied)?t.copied:[]).flatMap(e=>{let t=asRecord(e),n=t?entryFromRef(t,`modified`,void 0):null;return n?[n]:[]});if(n.length>0)return n;let r=entryFromRef(t,t.ref!==void 0&&t.ref===readString(e.args,`from`)?`consulted`:`modified`,void 0);return r?[r]:[]}function entriesFromRead(e){let t=asRecord(e.result);return(Array.isArray(t?.members)?t.members:[]).flatMap(e=>{let t=asRecord(e);if(!t||`error`in t||!readRefId(t,`ref`,`document`))return[];let n=entryFromRef(t,`consulted`,void 0);return n?[n]:[]})}function entriesFromToolPart(e){switch(e.name){case`organize`:return entriesFromOrganize(e);case`copy`:return entriesFromCopy(e);case`read`:return entriesFromRead(e);default:{let t=entryFromToolPart(e);return t?[t]:[]}}}function entryFromSandboxUpload(e){if(typeof e.result!=`object`||e.result===null)return null;let t=e.result,n=readString(t,`fileId`);return n?{id:n,fileId:n,title:readString(t,`title`)??n,kind:`modified`,mimeType:readString(t,`mimeType`)}:null}function entryFromToolPart(e){switch(e.name){case`update_document`:case`attach_file`:return entryFromDocumentMutation(e,`documentId`);case`create_folder`:return entryFromDocumentMutation(e,`folderId`);case`read_document`:return entryFromReadDocument(e);case`sandbox_upload_file`:return entryFromSandboxUpload(e);default:return null}}function extractTouchedDocuments(e){let t=new Map;for(let n of e)if(n.role===`assistant`){for(let e of n.parts)if(isCompletedToolPart(e))for(let n of entriesFromToolPart(e))upsertWithPrecedence(t,n.id,n,Lu);else if(isFilePart(e)&&e.fileId){let n={id:e.fileId,fileId:e.fileId,title:e.name||e.fileId,kind:`modified`,mimeType:e.mimeType};upsertWithPrecedence(t,n.id,n,Lu)}}return[...t.values()]}function extractTouchedArtifacts(e){let t=new Map;for(let n of e)if(n.role===`assistant`)for(let e of n.parts){if(!isCompletedToolPart(e)||e.error)continue;let n=e.name===`generate_image`?readGeneratedImageResult(e.result)?.artifact:e.name===`publish_artifact`?readArtifactResult(e.result):null;if(!n)continue;let r=`${n.artifactId}:${n.revision}`;t.delete(r),t.set(r,n)}return[...t.values()]}function isNonBlankString(e){return typeof e==`string`&&/\S/u.test(e)}const Ru=B.object({provider:B.custom(e=>isNonBlankString(e)&&e.length<=200,{message:`must be a non-blank string of at most 200 characters`}),model:B.string().max(200).regex(/\S/u)});function normalizeNewsLocale(e){return e.toLowerCase().split(`-`)[0]===`fr`?`fr`:`en`}function resolveLocalized(e,t){return e[normalizeNewsLocale(t)]||(e.en?e.en:e.fr||void 0)}function hasLocale(e){return!!(e.fr||e.en)}const zu=Object.keys({home:!0,agents:!0,routines:!0,object:!0,settings:!0}),Bu=[`dot`,`label`,`bubble`];function parseNewsIntensity(e){return Bu.find(t=>t===e)??`dot`}function parseNewsTarget(e){let[t,...n]=e.split(`:`),r=n.join(`:`);switch(t){case`home`:case`agents`:case`routines`:return r===``?{kind:t}:null;case`object`:return r?{kind:t,name:r}:null;case`settings`:return r?{kind:t,section:r}:null;default:return null}}function formatNewsTarget(e){return e.kind===`object`?`object:${e.name}`:e.kind===`settings`?`settings:${e.section}`:e.kind}function withoutTrailingSlashes(e){let t=e.length;for(;t>0&&e[t-1]===`/`;)--t;return e.slice(0,t)}const Vu=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;function compareIdentifiers(e,t){let n=/^\d+$/.test(e),r=/^\d+$/.test(t);return n&&r?Math.sign(Number(e)-Number(t)):n?-1:r?1:e<t?-1:+(e>t)}function compareVersions(e,t){let n=Vu.exec(e),r=Vu.exec(t);if(!(n&&r))return null;for(let e=1;e<=3;e+=1){let t=Number(n[e])-Number(r[e]);if(t!==0)return t<0?-1:1}let i=n[4],a=r[4];if(i===void 0&&a===void 0)return 0;if(i===void 0)return 1;if(a===void 0)return-1;let o=i.split(`.`),s=a.split(`.`);for(let e=0;e<Math.max(o.length,s.length);e+=1){let t=o[e],n=s[e];if(t===void 0)return-1;if(n===void 0)return 1;let r=compareIdentifiers(t,n);if(r!==0)return r<0?-1:1}return 0}function isSemver(e){return Vu.test(e)}const Hu=30,Uu=90,Wu=50,Gu=B.looseObject({fr:B.string().optional(),en:B.string().optional()}),Ku=B.iso.datetime({offset:!0}),qu=B.looseObject({id:B.string().min(1),slug:B.string().min(1),updatedAt:Ku,publishedAt:Ku,since:B.string(),displayDays:B.number().int().positive().optional(),requires:B.looseObject({capability:B.string(),level:B.string()}).optional(),target:B.string().optional(),intensity:B.unknown().optional(),title:Gu,summary:Gu});function knownRequirement(e){let t=J.find(t=>t.id===e.capability);return t!==void 0&&levelActions(t,e.level).length>0}function parseEntry(e){let t=qu.safeParse(e);if(!t.success)return`malformed entry: ${t.error.issues[0]?.message??`invalid`}`;let n=t.data;if(!isSemver(n.since))return`entry ${n.id}: since "${n.since}" is not semver`;if(!hasLocale(n.title))return`entry ${n.id}: title has no locale`;if(!hasLocale(n.summary))return`entry ${n.id}: summary has no locale`;if(n.requires&&!knownRequirement(n.requires))return`entry ${n.id}: unknown requirement ${n.requires.capability}/${n.requires.level}`;let r=n.target?parseNewsTarget(n.target):null;return{...n,displayDays:n.displayDays??30,intensity:parseNewsIntensity(n.intensity),target:r??void 0}}function httpsUrl(e){return typeof e==`string`&&e.startsWith(`https://`)?e:void 0}function parseNewsIndex(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw new N(`News feed: document must be an object`,[]);let n=e;if(!Array.isArray(n.entries))throw new N(`News feed: entries must be an array`,[]);let r=[];for(let e of n.entries){let n=parseEntry(e);typeof n==`string`?t?.(n):r.push(n)}let i=httpsUrl(n.blogUrl),a=httpsUrl(n.mediaBaseUrl),o=a?withoutTrailingSlashes(a):void 0;return{...i?{blogUrl:i}:{},...o?{mediaBaseUrl:o}:{},entries:r.slice(0,50)}}const Ju=B.looseObject({id:B.string().min(1),slug:B.string().min(1),updatedAt:Ku,body:Gu});function parseNewsBody(e){let t=Ju.safeParse(e);if(!t.success)throw new N(`News body: malformed document`,[]);if(!hasLocale(t.data.body))throw new N(`News body: body needs at least one locale`,[]);return t.data}function preference(e,t){return{key:e,value:t.value,default:t.default,audited:t.audited??!1,...t.parameter===void 0?{}:{parameter:t.parameter},...t.parameters===void 0?{}:{parameters:t.parameters},...t.refine===void 0?{}:{refine:t.refine}}}const Yu=``;function refusal(e,t){return{ok:!1,field:e,message:t,issues:[{path:[e],message:t}]}}function declarationOf(e,t){return`get`in e?e.get(t):e.find(e=>e.key===t)}function locatePreference(e,t,n){let r=declarationOf(e,t);return r?r.parameter===void 0?n===void 0?{ok:!0,declaration:r,parameter:``}:refusal(`parameter`,`Preference "${t}" takes no parameter`):n===void 0||n===``||n.trim()!==n?refusal(`parameter`,`Preference "${t}" is keyed by ${r.parameter}`):r.parameters&&!r.parameters.includes(n)?refusal(`parameter`,`"${n}" is not a ${r.parameter} of "${t}"`):{ok:!0,declaration:r,parameter:n}:refusal(`key`,`Unknown preference "${t}"`)}function judgePreferenceWrite(e,t,n,r){let i=locatePreference(e,t,n);if(!i.ok)return i;let a=i.declaration.value.safeParse(r);if(a.success){let e=i.declaration.refine?.(a.data,i.parameter);return e===void 0?{...i,value:a.data}:refusal(`value`,e)}return{ok:!1,field:`value`,message:`Invalid value for preference "${t}"`,issues:a.error.issues.map(e=>({path:[`value`,...e.path.map(String)],message:e.message}))}}const Xu=B.strictObject({model:Ru.optional(),routing:B.literal(`auto`).optional()}),Zu=B.strictObject({inApp:B.boolean(),email:B.boolean()});function isActionableType(e){let t=g[e];return t!==void 0&&ce(t.kind)}const Qu=[preference(`workPosture`,{value:B.enum(ja),default:`auto`,audited:!0}),preference(`chat.default`,{value:Xu,default:{},audited:!0}),preference(`conversationSurface`,{value:B.enum(Wr),default:`panel`}),preference(`mailboxListMode`,{value:B.enum(Ei),default:`threads`}),preference(`home`,{value:B.string().uuid().nullable(),default:null}),preference(`memory.learnFromEmail`,{value:B.boolean(),default:!0,audited:!0}),preference(`memory.shareWithTeam`,{value:B.boolean(),default:!0,audited:!0}),preference(`notifications.briefingSeenAt`,{value:B.iso.datetime().nullable(),default:null}),preference(`notifications.delivery`,{value:Zu,default:{inApp:!0,email:!1},parameter:`notification type`,parameters:Object.keys(g),refine:(e,t)=>!e.inApp&&isActionableType(t)?`A "${t}" notification asks you to act: it is always shown in-app`:void 0})];function preferenceEntry(e,t,n){return n===void 0?{key:e,value:t}:{key:e,parameter:n,value:t}}function withPreferenceEntry(e,t){if(t.parameter===void 0)return{...e,values:{...e.values,[t.key]:t.value}};let n=e.entries.findIndex(e=>e.key===t.key&&e.parameter===t.parameter),r=n===-1?[...e.entries,t]:e.entries.map((e,r)=>r===n?t:e);return{...e,entries:r}}export{hr as ACCESS_LEVELS,gr as ACCESS_ROLES,e as ACTIONABLE_NOTIFICATION_KINDS,_ as AGENDA_BLOCK,_r as AGENT_ASIDE_ANSWER_MAX_LENGTH,vr as AGENT_ASIDE_HISTORY_LIMIT,yr as AGENT_ASIDE_QUESTION_MAX_LENGTH,br as AGENT_AVATAR_EXPRESSIONS,xr as AGENT_AVATAR_TYPES,Sr as AGENT_MESSAGE_KIND,Cr as AGENT_NOTIFICATION_KIND,wr as AGENT_SESSION_LIST_ORDERS,Tr as AGENT_SESSION_ORIGINS,Er as AGENT_STARTERS_MAX,Dr as AGENT_STARTER_MAX_LENGTH,Or as AGENT_TASK_KINDS,t as AGGREGATE_BUCKETS,n as AGGREGATE_MEASURES,Ul as ALLOWED_PROPERTY_TYPES,kr as ALL_CATALOG_TOOL_NAMES,W as ALL_PIPES,Ar as ALWAYS_KINDS,vu as APPEARANCE_FACETS,jr as APPROVAL_FAMILY_TOOL_NAMES,Mr as ARCHITECT_PUBLICATION_KIND,Fl as ARTIFACT_FILE_ROLES,Nl as ARTIFACT_KINDS,le as ARTIFACT_PREVIEW_EXTENSION,Pl as ARTIFACT_RETENTIONS,Nr as ASK_QUESTIONS_ANSWER_MAX_LENGTH,Pr as ASK_QUESTIONS_ANSWER_MAX_VALUES,Fr as ASK_QUESTIONS_MAX_BATCH,Ir as ASK_QUESTIONS_TOOL_NAME,ue as ATTRIBUTE_FILTER_OPERATORS,Ns as ATTRIBUTE_NAME_SCHEMA,de as ATTRIBUTE_TYPES,Lr as AUDIT_ACTIONS,Rr as AUDIT_AGENT_SESSION_METADATA_KEY,zr as AUDIT_RESOURCE_TYPES,Tn as AccessDeniedError,AgendaBuilder,P as AgentBuilder,En as AggregateValidationError,Dn as AmbiguousSchemaChangeError,On as AttributeInUseError,kn as AttributeNotFoundError,fe as BLOCK_CONTEXTS,pe as BLOCK_PERIODS,v as BLOCK_WIDTHS,ll as BROWSER_IMAGE_MAX_BYTES,Br as BROWSER_LAUNCH_TOOL_NAME,Vr as BUNDLE_LOCALES,lu as BUNDLE_NAME_PATTERN,Hl as BYTE_UNIT_LABELS,BlockContentBuilder,BundleBuilder,y as CARD_BLOCK,tu as CATALOG_RESOURCES,b as CHART_BLOCK,me as CHART_KINDS,Qs as COMPUTED_RETURN_TYPES,Hr as CONNECTION_GRANT_PROVIDERS,Tu as CONNECTOR_CALLBACK_PARAM,he as CONTENT_PLACEMENT_CONTEXTS,Ur as CONTINUATION_KEY_PATTERN,Wr as CONVERSATION_SURFACES,uu as CORE_BUNDLE_NAME,Qu as CORE_PREFERENCES,Gr as CORE_RECORD_TOOL_NAMES,Kr as CORE_TOOL_NAMES,qr as COUNT_MODES,eu as CUSTOM_LEVEL,CardBuilder,ChartBuilder,ChartQuery,An as ConcurrentModificationError,Z as ContentBuilder,Jr as DEFAULT_AGENT_EXECUTION_CONFIG,Yr as DEFAULT_AGENT_TOOL_GROUPS,hu as DEFAULT_APPEARANCE_ICON,Xr as DEFAULT_APPROVAL_POLICY,Zr as DEFAULT_BLUEPRINT_TOOL_GROUPS,Qr as DEFAULT_DAILY_ACTIVITY_DAYS,Ml as DEFAULT_DICTATION_LIMITS,Zl as DEFAULT_LABEL_FALLBACK,ge as DEFAULT_LAYOUT_TRAITS,$r as DEFAULT_MEETING_BOT_DISPLAY_NAME,ei as DEFAULT_TENANT_SETTINGS,Gc as DEFAULT_VALIDATION_MESSAGES,ul as DEVICE_CHANNEL_AUTHENTICATE_TIMEOUT_MS,dl as DEVICE_CHANNEL_IDLE_POLL_MS,pl as DEVICE_CHANNEL_KEEPALIVE_MS,cl as DEVICE_CHANNEL_MAX_FRAME_BYTES,sl as DEVICE_CHANNEL_PATH,fl as DEVICE_CHANNEL_PRESENCE_MS,_l as DEVICE_CHANNEL_UPGRADE_REQUIRED_REASON,ml as DEVICE_CHANNEL_WORKER_CLOSE_PROTOCOL_VIOLATION,gl as DEVICE_COMMAND_ERROR_CODES,Al as DICTATION_FINALIZATION_TIMEOUT_MS,wl as DICTATION_FRAME_BYTES,El as DICTATION_MAX_BUFFER_BYTES,Tl as DICTATION_MAX_FRAME_BYTES,Dl as DICTATION_MAX_TRANSCRIPT_BYTES,jl as DICTATION_MODEL_ID,kl as DICTATION_PREPARATION_TIMEOUT_MS,Cl as DICTATION_SAMPLE_RATE,Ol as DICTATION_TICKET_TTL_MS,ti as DISCARD_ARCHITECT_DRAFT_TOOL_NAME,ni as DOCUMENT_SORT_MODES,ju as DRAFT_CONFLICT_KINDS,ri as DRAFT_WRITE_TOOL_NAMES,DeviceChannelProtocolError,xl as DeviceChannelServerFrameSchema,bl as DeviceChannelWorkerFrameSchema,k as DuplicateError,ii as EMAIL_CATEGORY_DEFAULT_COLOR,ai as EMAIL_CATEGORY_DEFAULT_ICON,oi as EMAIL_CATEGORY_DESCRIPTION_MAX,si as EMAIL_CATEGORY_DESCRIPTION_MIN,ci as EMAIL_CATEGORY_LIMIT,li as EMAIL_CATEGORY_NAME_MAX,ui as ENVIRONMENT_HARNESSES,di as ENVIRONMENT_HARNESS_SANDBOX_WORKDIR,fi as ENVIRONMENT_HARNESS_WORKDIR,pi as ENVIRONMENT_NAME_MAX_CHARS,mi as ENVIRONMENT_STANDARDS_WORKDIR,hi as ENV_VAR_KEY_PATTERN,gi as ESTIMATED_COUNT_CAP,jn as ExportTooLargeError,_i as FILE_URLS_MAX_IDS,H as FORM_FORBIDDEN_ATTRIBUTE_TYPES,Mn as ForbiddenError,FormBuilder,FormRowBuilder,FormStepBuilder,vi as GET_ARCHITECT_DRAFT_TOOL_NAME,yi as GITHUB_TRIGGER_CATALOG,bi as GRANT_ENABLES,_e as GROUPABLE_ATTRIBUTE_TYPES,bu as GroupBuilder,ve as HEADING_BLOCK,xi as HITL_TOOL_NAMES,Bl as IMAGE_FORMATS,gu as IMAGE_SHAPES,_u as IMAGE_SOURCES,ye as INBOX_BLOCK,Si as INFERENCE_REASONING_OPTIONS,Ci as INFERENCE_ROUTING_MODES,wi as INFERENCE_SPEEDS,be as INVENTORY_LIMIT,InboxBuilder,Nn as InvalidPermissionGrantError,Ti as LAST_RUN_ERROR_MAX_LENGTH,Ps as LIST_VIEW_TAB_VISIBILITIES,xe as LOCATION_FILTER_PROPERTIES,Pn as LogoProviderUnavailableError,Fn as LogoSearchRateLimitedError,Se as MAILBOX_BLOCK,Ei as MAILBOX_LIST_MODES,Di as MAIL_DRAFT_BODY_MAX_CHARS,Oi as MAIL_SIGNATURE_MAX_CHARS,ki as MAIL_SUBJECT_MAX_CHARS,r as MAX_AGGREGATE_GROUPS,Ai as MAX_DAILY_ACTIVITY_DAYS,Sl as MAX_PRESET_DEPTH,ji as MAX_TODOS,Mi as MAX_TODO_DESCRIPTION_CHARS,Ni as MAX_TODO_ID_CHARS,Pi as MCP_SERVER_NAME_MAX_LENGTH,Ce as MEASURABLE_ATTRIBUTE_TYPES,we as MEETINGS_UPCOMING_BLOCK,Fi as MEETING_BOT_IMAGE,Ii as MEETING_BOT_IMAGE_BASE64_MAX_LENGTH,Li as MEETING_RESPONSES,Y as MEMORY_ATTRIBUTES,ou as MEMORY_PAGE_MAX_CHARS,Ri as MEMORY_SPEND_LIMIT_PATTERN,su as MEMORY_WORKSPACE_PROFILE,au as MEMORY_WRITE_SOURCE,x as METRIC_BLOCK,MailboxBuilder,zi as McpOAuthCompletionMode,In as MemoryNotFoundError,MetricBuilder,MetricQuery,MultiRelationAttributeBuilder,al as NATIVE_AGENT_UI_PART_IDS_METADATA_KEY,ol as NATIVE_AGENT_UI_PART_IDS_METADATA_SCHEMA_VERSION,Te as NATIVE_BLOCKS,Fs as NATIVE_OBJECT_NAMES,Bi as NATIVE_TOOL_GROUPS,Vi as NATIVE_TOOL_GROUP_CATALOG,Hu as NEWS_DEFAULT_DISPLAY_DAYS,Uu as NEWS_DISPLAY_CAP_DAYS,Wu as NEWS_INDEX_MAX_ENTRIES,Bu as NEWS_INTENSITIES,zu as NEWS_TARGET_KINDS,i as NOTIFICATION_CHANNELS,a as NOTIFICATION_INBOX_STATES,o as NOTIFICATION_KINDS,s as NOTIFICATION_PRIORITIES,c as NOTIFICATION_PRIORITY_RANK,l as NOTIFICATION_SENSITIVITIES,u as NOTIFICATION_SETTINGS_AREAS,d as NOTIFICATION_SUBJECT_TYPES,f as NOTIFICATION_TYPES_V1,p as NOTIFICATION_TYPE_ACCESS_GRANTED,m as NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED,h as NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_FAILED,ee as NOTIFICATION_TYPE_AGENT_ROUTINE_RUN_NOTICE,te as NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN,ne as NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED,re as NOTIFICATION_TYPE_CONNECTOR_CONNECTION_ERROR,ie as NOTIFICATION_TYPE_CONNECTOR_CONNECTION_REAUTH_REQUIRED,g as NOTIFICATION_TYPE_KINDS,ae as NOTIFICATION_TYPE_RECORD_ASSIGNED,oe as NOTIFICATION_TYPE_RECORD_MENTIONED,se as NOTIFICATION_WORK_STATES,K as NO_ACCESS,Yu as NO_PREFERENCE_PARAMETER,Hi as NO_RECORDING,Ee as NO_VALUE_OPERATORS,xc as NonJsonValueError,NoopGeocodingAdapter,Ln as NotFoundError,Rn as NotImplementedError,q as OBJECT_GRANT,Is as OBJECT_NAME_SCHEMA,Ui as OPEN_TOOL_PART_STATES,Wi as OPERATION_MAX_STEPS,De as OPERATORS_BY_TYPE,ObjectBuilder,zn as ObjectNotFoundError,Bn as ObjectReferencedError,Vn as OrphanSystemAttributeError,Oe as PAGE_GRID_COLUMNS,ru as PERMISSION_ACTIONS,J as PERMISSION_CAPABILITIES,$l as PERMISSION_CATALOG,Gl as PIPES_WITH_ARGS,Gi as PROVIDER_DRAFT_LABEL,Ki as PROVIDER_NAMES,qi as PUBLIC_MAIL_DOMAINS,fu as PageBuilder,Hn as PageReferencedError,Un as ProtectedResourceError,Wn as ProtectedRoleError,ke as QUALIFIED_SEPARATOR,Ae as QUERY_OBJECT,Ji as QUESTION_FAMILY_TOOL_NAMES,Vl as QUOTA_KEYS,Gn as QueryTimeoutError,Yi as RECENT_ACTIVITY_LEDGER_LIMIT,Xi as RECIPIENT_IDENTITIES_MAX,Zi as RECORDING_OVERRIDES,Qi as RECORDING_POLICIES,$i as RECORD_ACCESS_ROLES,ea as RECORD_ACCESS_SOURCES,ta as RECORD_DRIVE_CURSOR_MAX_LENGTH,na as RECORD_DRIVE_PAGE_DEFAULT_LIMIT,ra as RECORD_DRIVE_PAGE_MAX_LIMIT,ia as RECORD_GRAPH_DEFAULT_LIMIT_PER_NODE,aa as RECORD_GRAPH_MAX_LIMIT_PER_NODE,oa as RECORD_GRAPH_MAX_NODES,sa as RECORD_IMAGE_MAX_BYTES,je as RECORD_LINKS_BLOCK,S as RECORD_LINKS_CONTENT,Ls as RECORD_LIST_SCOPES,Me as RECORD_MEMORY_BLOCK,C as RECORD_MEMORY_CONTENT,Ne as RECORD_OBJECT,Su as REFERENCE_KINDS,Pe as RELATION_TARGET_ANY,Fe as REMOVED_OPERATOR_REPLACEMENTS,ca as REPLY_MODES,la as REQUEST_DESIGN_REVIEW_TOOL_NAME,ua as REQUEST_SETUP_TOOL_NAME,Rs as RESERVED_ATTRIBUTE_NAMES,zs as RESERVED_OBJECT_NAMES,da as RESOURCE_GRANT_KINDS,fa as RESOURCE_KIND_CATALOG,Bs as RESOURCE_VISIBILITIES,pa as ROUTING_PRICE_CEILINGS,Kn as RealtimeDeliveryError,qn as RealtimeRateLimitedError,Jn as RealtimeSubscriptionError,Yn as RecordNotFoundError,Ie as RecordQuery,Xn as RecordReferencedError,Zn as RepositoryError,A as ReservedObjectNameError,Qn as RoleNotFoundError,F as SCHEMA_LIMITS,U as SCHEMA_OWNER_PATTERN,Eu as SCHEMA_SOURCE_RETYPE_FROM,ma as SESSION_INFERENCE_PATCH_KEYS,ha as SETUP_SCRIPT_MAX_CHARS,Wl as SIMPLE_PIPES,$s as SIMPLE_PROPERTY_TYPES,ga as SLACK_TRIGGER_CATALOG,cu as STANDARD_SCHEMA_VENDOR,_a as SURFACE_TOOL_NAMES,Le as SYNONYM_ALIASES,Re as SYSTEM_ATTRIBUTES,ze as SYSTEM_ATTRIBUTE_I18N_KEYS,va as SYSTEM_EMAIL_CATEGORIES,ya as SYSTEM_EMAIL_CATEGORY_NAMES,Vs as SYSTEM_FIELD_NAMES,Be as SYSTEM_FILTER_ATTRIBUTE_TYPES,ba as SYSTEM_PART_CODES,j as SchemaError,M as SchemaErrorCode,$n as SearchBackendError,er as SearchPathNotIndexedError,SingleRelationAttributeBuilder,tr as StorageError,nr as SyncCascadeError,rr as SyncConflictError,ir as SyncError,ar as SystemEntityImmutableError,xa as TASK_DEMAND_LEVELS,Il as TENANT_INVITATION_DEFAULT_TTL_MS,Rl as TENANT_INVITATION_MAX_TTL_MS,Ll as TENANT_INVITATION_MIN_TTL_MS,zl as TENANT_INVITATION_RESEND_INTERVAL_MS,w as TEXT_BLOCK,Hc as TEXT_FORMAT_PATTERNS,Sa as TODO_PHASES,Ca as TODO_PLAN_STATUSES,wa as TODO_STATUSES,Ta as TOOL_APPROVAL_STATES,Ea as TRIAGE_ACTIONS,Da as TRIGGER_EVENT_TYPES,Oa as TURN_OUTCOMES,or as ToolGroupGrantError,ka as UNSHAREABLE_OBJECT_NAMES,Aa as USER_STATUSES,ja as USER_WORK_POSTURES,Ma as VERB_NAMES,N as ValidationError,X as ViewBuilder,ec as WIRE_OFFERED_BASE_CONFIG,tc as WIRE_OMITTED_CONFIG_KEYS,sr as WorkspaceInvariantReason,Na as agent,Pa as agentAvatarFromMetadata,Fa as agentAvatarSchema,Ia as agentDataChunk,La as agentDisplayName,Ra as agentInferencePreferencesSchema,za as agentMessageAttachmentSchema,Ba as agentMessagePartSchema,Va as agentScheduleSchema,Ha as agentSessionInferenceOverridesInputSchema,Ua as agentSessionInferenceOverridesSchema,Wa as agentSessionMessageSchema,Ga as agentStartersSchema,Ka as agentTriggerBaseSchema,qa as agentTriggerPatchSchema,Ja as agentTriggerSchema,Ya as agentUIValidationError,applyPipes,Xa as artifactQuoteSchema,Sc as asTenantId,Cc as asUserId,Za as askQuestionsOutputSchema,assertBundleName,Qa as assertCustomAgentUIMessageChunk,assertSchemaSourceResolutions,$a as assertSessionState,nc as attributeConfigSchemas,Ve as attributeFilterTarget,He as attributeInventory,Ue as blockObjectInputs,buildPropertySchema,We as buildQualifiedAttribute,builtBundleFromPieces,bundle,z as canonicalStringify,eo as canonicalToolGroups,Ge as canonicalizeFilterValue,capabilityForResource,Ke as capped,checkbox,to as classificationRestoreSchema,no as classifyEmailSchema,ro as cliDefaultModelOf,qe as collectContentViewCatalogue,Je as collectQualifiedRuleIssues,Ye as collectionContentSourceSchema,Xe as collectionSourceAddress,Ze as collectionSourceAddressOf,Us as colorIdSchema,Qe as columnsSchema,io as compareAgentSessionMessages,compareSchemaStateEntries,compareVersions,ao as compiledHarnessModels,computeByteMagnitude,computeReconnectDelay,computeRetryDelay,oo as connectionGrantKindsOf,so as connectorTriggerMatchSchema,xu as content,contentDefinition,$e as contentExtensionRegistry,et as contentReadObjects,T as contentViewDefinitionSchema,tt as contentViewDefinitionSchemaFor,convertRetypedValue,Ac as createAttributeValidator,Jc as createCheckboxValidator,Yc as createDateValidator,jc as createFormAttributeValidator,qc as createNumberValidator,createStandardSchemaProps,Uc as createTextValidator,currency,nt as currentActor,co as customDataChunkSchemas,date,declaredImageRequests,wc as deepEqual,rt as defineBlock,defineDeviceChannelFrames,deriveLayout6,lo as deriveViewerAccess,it as describeViewIssue,detailView,deviceChannelUrl,diffSchemaState,at as displayAttributesSchema,document,ot as draftContentViewDefinitionSchema,st as draftContentViewDefinitionSchemaFor,droppedContents,uo as durableDateSchema,ct as edgePropertyFilterTarget,fo as emailCategoryCreateSchema,po as emailCategoryDeleteSchema,mo as emailCategoryScopeQuerySchema,ho as emailCategoryUpdateSchema,go as emailRuleScopeSchema,_o as environmentHarness,vo as environmentWorkdir,extractAttributeNames,lt as extractCurrencyFilterValue,ut as extractFilterValue,extractReadRecordIds,extractTouchedArtifacts,extractTouchedDocuments,extractTouchedRecords,dt as filterOperatorsOfType,ft as filterStateSchema,pt as filterTargetsOf,yo as findEnvironmentHarness,findGrantIssues,mt as findGridViolation,ht as findGroupViolation,gt as findLayoutRuleViolation,_t as findRelationAttribute,vt as findRowLimitViolation,form,formFieldFlatKey,formFieldKey,formatByteSize,formatNewsTarget,Xc as formatPhoneForDisplay,formatReference,Kc as formatZodErrors,formula,Tc as generateId,yt as getAttributeCapabilities,ic as getAttributeConfigSchema,ac as getAttributeConfigWriteSchema,bt as getAttributeFilterOperators,getEditableLabelAttribute,xt as getOperatorPolarity,St as getRollupFilterOperators,getSingleAttributeFromExpression,getSlotFieldTargets,Ct as getSystemAttributeI18nKey,wt as getSystemAttributeList,bo as githubConditionSchema,xo as githubTriggerMatchSchema,So as grantKindOf,Tt as gridPositionSchema,group,Et as groupSizeMessage,Dt as groupedMembers,Co as harnessModelChoices,hasLocale,hasOptions,hashBundlePieces,wo as humanRequestId,To as humanRequestKind,I as iconNameSchema,imageLookupKindOf,imageModelFormatDefect,Eo as imageModelIdSchema,Ec as indexBy,Ot as inferInverseCardinality,Do as inferenceReasoningSchema,Oo as inferenceRoutingSchema,ko as inferenceSpeedSchema,kt as input,At as invalidViewMessage,ce as isActionableNotificationKind,Ao as isAgentMessageMetadata,jo as isAgentNotificationMetadata,Mo as isAgentUIDataName,No as isAgentWrittenAuditEntry,Po as isArchitectPublicationMetadata,jt as isAttributeFilterable,Mt as isAttributeGroupable,cr as isAttributeInUseError,Nt as isAttributeKanbanGroupable,Pt as isAttributeSearchable,Ft as isAttributeSortable,Fo as isAwaitingHuman,It as isBilateralRelation,Io as isBlocking,isBundle,Lt as isCalendarDay,isCatalogResource,Rt as isDynamicValue,Nc as isEmptyValue,Lo as isEnvironmentHarnessId,isFormDefinition,isFormFieldsRow,isFormFreeFieldRef,isFormHeadingRow,isFormSeparatorRow,isFormSlotFieldRef,isFormTextRow,isImageSource,isLabelExpression,zt as isLocationFilterProperty,Bt as isLocationPartOperator,Ro as isMailProvider,zo as isMailboxListMode,Vt as isManagedSystemAttribute,L as isNativeObjectName,Bo as isNativeToolGroup,Ht as isNoValueOperator,lr as isNotFoundError,Pc as isNullishOrEmptyString,ur as isObjectReferencedError,Vo as isOpenToolPartState,Ho as isParkedOnHuman,Ws as isPlainRecord,dr as isProtectedResourceError,Uo as isProviderDraft,Wo as isPublicMailDomain,fr as isRecordReferencedError,Ut as isRelativeDateValue,Go as isReplyMode,Ko as isResourceGrant,qo as isRoutineActorMetadata,pr as isSchemaError,isSemver,Jo as isSessionInferencePatch,Wt as isSetMembershipOperator,isStandardSchema,Yo as isSystemEmailCategory,Xo as isSystemEmailCategoryName,Zo as isSystemPartCode,Qo as isToolApprovalState,Gt as isUniversalRelation,mr as isValidationError,Fc as isValuePresent,isWherePipe,isWildcard,judgePreferenceWrite,keptFill,G as labelExpressionSchema,Kt as layoutTraitsOf,levelActions,levelFloor,levelOf,listView,locatePreference,location,qt as locationPartFilterTarget,$o as meetingBotDispatchRequestSchema,es as meetingBotDispatchResponseSchema,ts as meetingBotNotificationSchema,ns as meetingTranscriptSegmentSchema,E as memberlessGroups,memoryPageViewOf,rs as mentionReferenceSchema,is as mergeSessionInferencePatch,Jt as metricComparePeriod,as as modelDefinitionSchema,Ru as modelIdentitySchema,os as modelReferenceSchema,multiselect,oc as multiselectOptionWriteSchema,nameSlug,Au as namedTargetSchema,nativeAgentUIPartIdMetadataKey,ss as needsManageWhenUnattended,Qc as normalizeCountrylessPhoneNumber,Yt as normalizeFilterRule,Xt as normalizeForEdgeRpc,normalizeNewsLocale,Zt as normalizeOperator,$c as normalizePhoneNumber,cs as normalizedMeetingTranscriptSchema,Qt as now,number,object,yu as objectImageSchema,ls as openRequests,us as orderAgentSessionMessages,packLayout,page,pageCompactor,en as pageTraitsOf,ds as parseAgentDefinitionAccessRole,sc as parseAttributeConfig,cc as parseAttributeConfigForCreate,lc as parseAttributeConfigForUpdate,D as parseBlockParameters,fs as parseCountMode,parseDeviceChannelFrame,ps as parseMergedAgentTrigger,parseNamedTarget,parseNativeAgentUIPartIdsMetadata,parseNewsBody,parseNewsIndex,parseNewsIntensity,parseNewsTarget,ms as parseOptionalCountMode,hs as parsePageAccessRole,tn as parseQualifiedAttribute,gs as parseRecordAccessRole,Gs as parseRecordListScope,parseReference,Ks as parseResourceVisibility,parseSchemaGroupPresentation,parseSchemaOwner,parseSchemaState,parseServerFrame,_s as parseToolGroupGrant,parseWherePipe,parseWorkerFrame,iu as permissionGrantSchema,phone,placeNew,preference,preferenceEntry,uc as propertyAttributeSchema,dc as propertyAttributeWireSchema,fc as propertySchemaSchema,pc as propertySchemaWireSchema,vs as providerNameSchema,O as publishedViewContentDefinitionSchema,nn as query,readArtifactResult,ys as readAskQuestionsResult,readFormFieldValue,readGeneratedImageResult,bs as recentActivityEntryKey,xs as recordGraphNodeKey,Ss as recordGraphRequestSchema,recordLinksTab,recordMemoryTab,Cs as recordOperationSchema,rn as recordQueryDefinitionSchema,ws as refineTrigger,mc as refuseForeignKeys,Ic as rejectUnknownAttributesOrThrow,relation,an as relationAcceptsObject,relationProperty,on as relationTargetsOf,renderLabelExpression,repairPageGrid,requestedCapabilities,cn as requireRecordContentContext,ln as requireSingleRelationTarget,resolveAppearance,un as resolveCollectionActions,dn as resolveContentNavigation,fn as resolveEffectiveFilterType,resolveFieldRequired,pn as resolveIsWithinBounds,resolveLocalized,resolvePageGrid,resolvePropertyDefinitions,Wc as resolveTextPattern,mn as resolveUtcDayBounds,resolveViewContents,Ts as resourceGrant,richtext,rollup,Es as routedMessageInferenceSchema,sameActions,Dc as sameStableValue,schemaGroupKey,schemaStateSourcePayload,select,hc as selectOptionWriteSchema,Oc as serializeCanonicalJson,kc as serializeStableJson,Ds as sessionInferencePatchSchema,settleLayout,sha256Hex,hn as singleRelationTarget,Os as slackConditionSchema,ks as slackTriggerMatchSchema,snapWidth,gn as sortsSchema,_n as sourcedAttributeOf,status,gc as statusGroupSchema,_c as statusOptionWriteSchema,storedContentDefinition,vn as systemColumnFilterTarget,text,yn as toMultiValueOperator,bn as toUtcDayString,xn as today,As as todoItemSchema,js as todoPlanSchema,Ms as toolImpactSchema,user,Lc as validateAttribute,qs as validateAttributeName,Sn as validateContentViewCatalogue,Rc as validateDraft,zc as validateDraftOrThrow,validateLabelExpression,Bc as validateObject,validateObjectExpressions,validateObjectImage,Xs as validateObjectName,Vc as validateObjectOrThrow,Cn as validateQualifiedRule,wn as validateStoredViews,Zs as validateViewName,widthStepConstraint,vc as wireHiddenTypeConfigMask,yc as wireOmittedConfigKeysFor,withPreferenceEntry,withoutTrailingSlashes,bc as withoutUnknownOptionKeys,workspaceViewAuthoring};