1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="45b53b1b-0d9f-4f1f-8271-49d203caf37f",e._sentryDebugIdIdentifier="sentry-dbid-45b53b1b-0d9f-4f1f-8271-49d203caf37f")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3648],{11193:(e,t,n)=>{n.d(t,{BL:()=>u,KO:()=>o,NB:()=>i,cW:()=>l,nc:()=>c,pc:()=>s,z1:()=>a});var r=n(44705);let i={free:{metadata:{key:"free",displayName:"Free",description:"For small teams getting started",positioning:"Up to 15 users",price:"$0",priceInterval:"/month",popular:!1,cta:"Get started"},limits:{alertsPerMonth:1e3,auditLogRetentionDays:30,userLimit:"up to 15 users",agentIdentitiesLimit:3},capabilities:{chromePluginDeployment:!0,prebuiltGuardrailLibrary:!0,customPolicyFilters:{enabled:!1,label:"Read-only"},scopeByTeamEnvironment:!1,exceptionWorkflows:!1,siemExport:!1,ssoEnforcementScim:!1,advancedMdmPostureChecks:!1,dedicatedSupportChannel:!1,agentTeams:{enabled:!0,label:"Shadow only"},agentEnforceMode:!1,agentFederation:!1}},professional:{metadata:{key:"professional",displayName:"Professional",description:"Retired from active sale",positioning:"Existing subscriptions unaffected",price:"Retired",priceInterval:"",popular:!1,cta:"Contact sales",retiredFromSale:!0,stripePriceId:"price_1Szhw1LWtsWuSuvAcXhFaHW1"},limits:{alertsPerMonth:5e4,auditLogRetentionDays:365,userLimit:"16+ users",agentIdentitiesLimit:25},capabilities:{chromePluginDeployment:!0,prebuiltGuardrailLibrary:!0,customPolicyFilters:!0,scopeByTeamEnvironment:{enabled:!0,label:"Basic"},exceptionWorkflows:!0,siemExport:!1,ssoEnforcementScim:!1,advancedMdmPostureChecks:{enabled:!0,label:"Limited"},dedicatedSupportChannel:{enabled:!0,label:"Business hours"},agentTeams:{enabled:!0,label:"Enforce-eligible"},agentEnforceMode:!0,agentFederation:!1}},enterprise:{metadata:{key:"enterprise",displayName:"Enterprise",description:"For regulated and global orgs",positioning:"Regulated & mission-critical environments",price:"Custom",priceInterval:"",popular:!1,cta:"Contact sales",stripePriceId:n(41463).env.NEXT_PUBLIC_STRIPE_ENTERPRISE_PRICE_ID},limits:{alertsPerMonth:"unlimited",auditLogRetentionDays:365,userLimit:"unlimited",agentIdentitiesLimit:"unlimited"},capabilities:{chromePluginDeployment:!0,prebuiltGuardrailLibrary:!0,customPolicyFilters:!0,scopeByTeamEnvironment:!0,exceptionWorkflows:!0,siemExport:!0,ssoEnforcementScim:!0,advancedMdmPostureChecks:!0,dedicatedSupportChannel:!0,agentTeams:{enabled:!0,label:"Federation-eligible"},agentEnforceMode:!0,agentFederation:!0}}},a={alertsPerMonth:"Alerts per month",auditLogRetention:"Audit log retention",chromePluginDeployment:"Chrome extension deployment",prebuiltGuardrailLibrary:"Prebuilt guardrail library",customPolicyFilters:"Custom policy filters",scopeByTeamEnvironment:"Scope by team & environment",exceptionWorkflows:"Exception workflows",siemExport:"SIEM export integration",ssoEnforcementScim:"SSO enforcement & SCIM",advancedMdmPostureChecks:"Advanced MDM posture checks",dedicatedSupportChannel:"Dedicated support channel"},l={coreUsage:{label:"Core Usage",features:["alertsPerMonth","auditLogRetention","chromePluginDeployment"]},policiesGuardrails:{label:"Policies & Guardrails",features:["prebuiltGuardrailLibrary","customPolicyFilters","scopeByTeamEnvironment","exceptionWorkflows"]},enterpriseControls:{label:"Enterprise Controls",features:["siemExport","ssoEnforcementScim","advancedMdmPostureChecks","dedicatedSupportChannel"]}};function o(e){return"boolean"==typeof e?e:e.enabled}function s(e){return"boolean"==typeof e?null:e.label}function u(e){return"unlimited"===e?"Unlimited":(0,r.ZV)(e)}function c(e){return e>=365?"12+ months":e>=90?"90 days":e>=30?"30 days":"".concat(e," days")}},28752:(e,t,n)=>{n.d(t,{H:()=>u,d:()=>s});var r=n(95155),i=n(12115),a=n(28144),l=n(42584);let o=(0,i.createContext)(null);function s(e){let{children:t}=e,{activeOrg:n}=(0,l.Z5)(),s=null==n?void 0:n.organization_id,[u,c]=(0,i.useState)({subscription:null,orgTrialExpiresAt:null,capabilities:[],isLoading:!0,error:null}),d=(0,i.useId)(),p=(0,i.useRef)(null!=s?s:null),b=(0,i.useCallback)(async e=>{let t=null!=s?s:null;if(p.current===t){if(!t)return void c(e=>({...e,isLoading:!1}));try{c(e=>({...e,isLoading:!0,error:null}));let n=await fetch("/api/org/".concat(encodeURIComponent(t),"/plan"),{headers:{Accept:"application/json"},signal:e});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||"Failed to fetch subscription (".concat(n.status,")"))}let{subscription:r,trialExpiresAt:i,capabilities:a}=await n.json();if(p.current!==t)return;c({subscription:null!=r?r:null,orgTrialExpiresAt:null!=i?i:null,capabilities:a||[],isLoading:!1,error:null})}catch(n){if((null==n?void 0:n.name)==="AbortError"||(null==e?void 0:e.aborted)||p.current!==t)return;console.error("Error fetching subscription data:",n),c(e=>({...e,isLoading:!1,error:n}))}}},[s]),m=(0,i.useRef)(null),f=(0,i.useRef)(!1),g=(0,i.useCallback)(e=>{var t;let n=null!=s?s:null,r=m.current;if(r&&r.orgId===n&&!(null==(t=r.signal)?void 0:t.aborted))return f.current=!0,r.promise;let i=(async()=>{do f.current=!1,await b(e);while(f.current&&!(null==e?void 0:e.aborted)&&p.current===n)})().finally(()=>{var e;(null==(e=m.current)?void 0:e.promise)===i&&(m.current=null)});return m.current={orgId:n,promise:i,signal:e},i},[b,s]),h=(0,i.useCallback)(()=>g(),[g]);(0,i.useEffect)(()=>{p.current=null!=s?s:null;let e=new AbortController;if(g(e.signal),!s)return()=>{e.abort()};let t=a.N.channel("subscription_changes:".concat(s,":").concat(d)).on("postgres_changes",{event:"*",schema:"public",table:"organization_subscriptions",filter:"organization_id=eq.".concat(s)},()=>{g()}).subscribe();return()=>{e.abort(),a.N.removeChannel(t)}},[g,s,d]);let y=(0,i.useMemo)(()=>
1({organizationId:null!=s?s:null,subscription:u.subscription,orgTrialExpiresAt:u.orgTrialExpiresAt,capabilities:u.capabilities,isLoading:u.isLoading,error:u.error,refetch:h}),[s,u,h]);return(0,r.jsx)(o.Provider,{value:y,"data-sentry-element":"SubscriptionContext.Provider","data-sentry-component":"SubscriptionProvider","data-sentry-source-file":"SubscriptionContext.tsx",children:t})}function u(){return(0,i.useContext)(o)}},93648:(e,t,n)=>{n.d(t,{O:()=>d});var r=n(12115),i=n(28144),a=n(42584),l=n(28752),o=n(11193);let s=["free","professional","enterprise"],u="active",c="trialing";function d(e){var t,n,o;let{activeOrg:d}=(0,a.Z5)(),p=(0,l.H)(),[b,m]=(0,r.useState)(null),[f,g]=(0,r.useState)([]),[h,y]=(0,r.useState)(null),[v,E]=(0,r.useState)(!0),[C,w]=(0,r.useState)(null),P=e||(null==d?void 0:d.organization_id),S=null!==p&&(null!=P?P:null)===p.organizationId?p:null,_=(0,r.useId)(),L=(0,r.useCallback)(async e=>{if(!P)return void E(!1);try{E(!0),w(null);let t=await fetch("/api/org/".concat(encodeURIComponent(P),"/plan"),{headers:{Accept:"application/json"},signal:e});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||"Failed to fetch subscription (".concat(t.status,")"))}let{subscription:n,trialExpiresAt:r,capabilities:i}=await t.json();m(null!=n?n:null),y(null!=r?r:null),g(i||[])}catch(t){if((null==t?void 0:t.name)==="AbortError"||(null==e?void 0:e.aborted))return;console.error("Error fetching subscription data:",t),w(t)}finally{(null==e?void 0:e.aborted)||E(!1)}},[P]),I=null!==S;(0,r.useEffect)(()=>{if(I)return;let e=new AbortController;if(L(e.signal),!P)return()=>{e.abort()};let t=i.N.channel("subscription_changes:".concat(P,":").concat(_)).on("postgres_changes",{event:"*",schema:"public",table:"organization_subscriptions",filter:"organization_id=eq.".concat(P)},()=>{L()}).subscribe();return()=>{e.abort(),i.N.removeChannel(t)}},[I,L,P,_]);let k=S?S.subscription:b,x=S?S.orgTrialExpiresAt:h,T=S?S.capabilities:f,D=S?S.isLoading:v,M=S?S.error:C,R=S?S.refetch:L,A=(null==k?void 0:k.status)==="trialing",F=!!x&&new Date(x).getTime()>Date.now()&&!(k&&["active","past_due"].includes(k.status)),N=A?"stripe":F?"org":null,B=A?null!=(t=null==k?void 0:k.current_period_end)?t:null:F?x:null,z=(null==k?void 0:k.plan_tier)==="demo"||(null==k?void 0:k.status)==="active"||(null==k?void 0:k.status)==="trialing",W=B?Math.max(0,Math.ceil((new Date(B).getTime()-Date.now())/864e5)):0,j=function(e){let{status:t,planTier:n}=e;return t===c||function(e){var t;let{status:n,trialExpiresAt:r}=e;if(n===u||"past_due"===n||n===c||!r)return!1;let i=r instanceof Date?r.getTime():new Date(r).getTime();return!Number.isNaN(i)&&i>(null!=(t=e.nowMs)?t:Date.now())}(e)||"demo"===n?"professional":t===u&&n&&s.includes(n)?n:"free"}({status:null!=(n=null==k?void 0:k.status)?n:null,planTier:null!=(o=null==k?void 0:k.plan_tier)?o:null,trialExpiresAt:x});return{subscription:k,isSubscribed:z,isInTrial:null!==N,trialSource:N,trialEndsAt:B,trialDaysRemaining:W,planTier:j,capabilities:T,isLoading:D,error:M,refetch:R}}Object.keys(o.NB.free.capabilities)}}]);
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.