1import{aI as A}from"./index-B7Ng5BsD.js";import{m as S}from"./module-aliases-B4JB1RUJ.js";function f(i){return i==="automation_notification"||i==="automation_run_failed"}const I="automation_approval_requested";function p(i){return i.startsWith("booking.")}const l="form_submission",_=["record_due_reminder","object_due_reminder"],b="record_assigned",h="lead_scraper_import",m="bulletin_published",R="credential_expiring",g="payroll_run_finalized",w="transcription_failed",E="transcription_ready",O="safe_countersign_requested",k="safe_envelope_ended",U="/tools/safes",N=["hr_timecard_submitted","hr_timecard_reviewed"],D=["hr_time_off_requested","hr_time_off_reviewed"];function C(i,r,e){if(!i)return null;const o=S(e);let s=null;for(const n of i){if(n.workspaceId!==r||n.kind!=="module"||!n.moduleKey)continue;const d=o.indexOf(n.moduleKey);d!==-1&&(!s||d<s.rank||d===s.rank&&n.sortOrder<s.page.sortOrder)&&(s={page:n,rank:d})}return s?.page??null}function t(i,r){const e=i?.[r];return typeof e=="string"&&e.length>0?e:null}function c(i,r,e,o,s){const n=e??C(s?.pages,i,r)?.id??null,d=`/dashboard/w/${encodeURIComponent(i)}`;if(n){const a=`${d}/pages/${encodeURIComponent(n)}`;return Object.keys(o).length>0?{to:a,search:o}:{to:a}}return{to:d,search:{open:r,...o}}}const u=/^\+\d{10,15}$/;function P(i,r){const{kind:e,diff:o}=i;if(e==="chat_direct_message"||e==="chat_direct_request"){const n=t(o,"directId");return n?{to:new URL(`/people?conversation=${encodeURIComponent(n)}`,A).toString()}:{to:"/dashboard/notifications"}}if(_.includes(e)){const n=t(o,"recordId"),d=t(o,"collectionId"),a=t(o,"workspaceId");return n&&d?{to:`/dashboard/objects/${encodeURIComponent(d)}/records/${encodeURIComponent(n)}`,...a?{search:{w:a}}:{}}:{to:"/dashboard/calendar"}}if(e===b){const n=t(o,"recordId"),d=t(o,"collectionId");if(n&&d){const a=t(o,"workspaceId");return{to:`/dashboard/objects/${encodeURIComponent(d)}/records/${encodeURIComponent(n)}`,...a?{search:{w:a}}:{}}}return{to:"/dashboard/notifications"}}if(e===h){const n=t(o,"collectionId"),d=t(o,"workspaceId");return n&&d?{to:`/dashboard/objects/${encodeURIComponent(n)}`,search:{w:d}}:{to:"/dashboard/notifications"}}if(e===w||e===E){const n=t(o,"transcriptionId");if(n){const d=t(o,"workspaceId");return{to:`/dashboard/transcripts/${encodeURIComponent(n)}`,...d?{search:{w:d}}:{}}}return{to:"/dashboard/notifications"}}if(e==="sms_inbound")return{to:"/dashboard/phone",search:{tab:"texts"}};if(e==="phone_missed_call"){const n=t(o,"number");return{to:"/dashboard/phone",search:{tab:"calls",direction:"inbound",...n&&u.test(n)?{number:n}:{}}}}if(e==="phone_unassigned_inbound"){const n=t(o,"number");return{to:"/dashboard/phone",search:{tab:t(o,"kind")==="sms"?"texts":"calls",...n&&u.test(n)?{number:n}:{}}}}if(e===I){const n=t(o,"runId");return n?{to:"/dashboard/runs",search:{run:n}}:{to:"/dashboard/runs"}}if(f(e))return{to:"/dashboard/runs"};if(e==="billing_payment_failed")return{to:"/dashboard/settings",search:{tab:"billing"}};if(e==="workspace_ownership_transferred")return{to:"/dashboard/settings",search:{tab:"workspace"}};const s=t(o,"workspaceId");if((e===O||e===k)&&s){const n=t(o,"envelopeId");return{to:U,search:{workspace:s,...n?{envelope:n}:{}}}}if(N.includes(e)&&s)return c(s,"timecards",t(o,"pageId"),{},r);if(D.includes(e)&&s)return c(s,"time-off",t(o,"pageId"),{},r);if(e===R&&s){const n=t(o,"vaultId");return c(s,"credentials",t(o,"pageId"),n?{vault:n}:{},r)}if(e===g&&s){const n=t(o,"runId");return c(s,"payroll",t(o,"pageId"),n?{run:n}:{},r)}if(e===m&&s){const n=t(o,"bulletinId");return c(s,"bulletins",t(o,"pageId"),n?{bulletin:n}:{},r)}if(p(e)&&s)return c(s,"bookings",t(o,"pageId"),{tab:"appointments"},r);if(e===l&&s){const n=t(o,"formId");return c(s,"forms",t(o,"pageId"),{tab:"submissions",...n?{form:n}:{}},r)}return{to:"/dashboard/notifications"}}function K(i){return i.workspaceId??t(i.diff,"workspaceId")}function L(i,r){const e=K(i),o=e?{...i,diff:{...i.diff,workspaceId:e}}:i,s=P(o,r);return e&&["/dashboard/phone","/dashboard/runs","/dashboard/notifications","/dashboard/settings"].includes(s.to)?{...s,search:{...s.search,w:e}}:s}function y(i,r){const{to:e,search:o}=L(i,r),s=o?new URLSearchParams(o).toString():"";return s?`${e}?${s}`:e}function $(i){const{kind:r,diff:e}=i;if((r==="chat_direct_message"||r==="chat_direct_request")&&t(e,"directId"))return"Open direct message";if(_.includes(r))return t(e,"recordId")&&t(e,"collectionId")?"Open record":"View calendar";if(r===b)return t(e,"recordId")&&t(e,"collectionId")?"Open record":"Open notifications";if(r===h)return t(e,"collectionId")&&(t(e,"workspaceId")||i.workspaceId)?"Open Leads":"Open notifications";if(r===w||r===E)return t(e,"transcriptionId")?"Open transcript":"Open notifications";
1if(r==="sms_inbound"||r==="phone_unassigned_inbound"||r==="phone_missed_call")return"Open phone";if(r===I)return t(e,"runId")?"Review approval":"View runs";if(f(r))return"View runs";if(r==="billing_payment_failed")return"Update payment method";if(r==="workspace_ownership_transferred")return"Open workspace settings";if(t(e,"workspaceId")||i.workspaceId){if(r===O)return"Countersign SAFE";if(r===k)return"Open SAFE";if(p(r))return"View booking";if(r===l)return"View submission";if(N.includes(r))return"Open timecards";if(D.includes(r))return"Open time off";if(r===m)return"Read bulletin";if(r===R)return"Open credentials";if(r===g)return"Open payroll"}return"Open notifications"}export{y as a,K as b,L as c,C as f,$ as n};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.