PageSourceSearch

https://www.shortcutfoo.com/_next/static/chunks/pages/app/organizations/[slug]-041c9a0bf3afb837.js

js shortcutfoo.com collected 2026-10-03 20:24:13 UTC 10,152 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3544],{566:(e,s,t)=>{"use strict";async function r(e,s){try{let t=await fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(s||{})});return await t.json()}catch(e){if(e instanceof Error)throw Error(e.message);throw e}}t.d(s,{z:()=>r})},2312:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/organizations/[slug]",function(){return t(4729)}])},4729:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>b});var r=t(7876),l=t(4232),a=t(8230),i=t.n(a),n=t(7328),o=t.n(n),d=t(553),c=t(9099),m=t(1801),x=t(8794),u=t(566),h=t(5499),p=t(5797),v=t(746);let g=e=>{let{error:s}=e;return(0,r.jsx)("div",{className:"rounded-md bg-red-50 p-4 mb-2",children:(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)(h.A,{className:"h-5 w-5 text-red-400","aria-hidden":"true"})}),(0,r.jsx)("div",{className:"ml-3 flex-grow",children:(0,r.jsx)("h3",{className:"text-sm font-medium text-red-800 text-center",children:s})})]})})},f=()=>{var e,s,t,a;let{data:n,status:x}=(0,d.useSession)(),[h,f]=(0,l.useState)(""),[b,w]=(0,l.useState)(null),[j,y]=(0,l.useState)(!1),[N,k]=(0,l.useState)(null),_=(0,c.useRouter)(),{slug:S}=_.query,[C,E]=(0,l.useState)(),z=m.i.organizations.getOrganization.useQuery({slug:S},{enabled:!!S,onSuccess:e=>{E(e)}});function M(){y(!1)}let{mutate:F}=m.i.organizations.sendInvite.useMutation({onSuccess:e=>{f(""),w(null),z.refetch()},onError:e=>{w(e.message)}}),{mutate:T}=m.i.organizations.removeMembership.useMutation({onSuccess:e=>{z.refetch(),y(!1),k(null)},onError:e=>{}}),O=(null==C||null==(e=C.Memberships)?void 0:e.length)||0,A=Math.abs(((null==C?void 0:C.total_seats)||1)-O),I=(null==C?void 0:C.primary_owner_id)==(null==n||null==(s=n.user)?void 0:s.id),L=null==C||null==(t=C.Memberships)?void 0:t.some(e=>{var s;return e.person_id==(null==n||null==(s=n.user)?void 0:s.id)});return"loading"===x||L||I?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o(),{children:[(0,r.jsx)("title",{children:"Organization | ShortcutFoo"}),(0,r.jsx)("meta",{name:"description",content:"Organization page"})]}),(0,r.jsx)("header",{children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,r.jsx)("h1",{className:"text-3xl text-center",children:null==C?void 0:C.name})})}),(0,r.jsxs)("div",{className:"flex flex-col items-center text-center my-8 max-w-7xl mx-auto ",children:[I&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"bg-scf-light-gray px-6 py-2 w-full text-xl",children:"Admin"}),(0,r.jsxs)("div",{className:"flex m-auto py-2 space-x-2",children:[(0,r.jsxs)("div",{children:[null==C?void 0:C.total_seats," Seats | "]}),(0,r.jsxs)("div",{children:[A," Remaining | "]}),(0,r.jsx)("div",{children:(0,r.jsx)("button",{className:"text-scf-dark-blue cursor-pointer hover:text-scf-darker-blue hover:underline",onClick:async()=>await (0,u.z)("/api/checkout_sessions/manage",{organizationId:null==C?void 0:C.slug}).then(e=>{_.push(e.url)}),children:"Manage Subscription"})})]})]}),(0,r.jsx)("div",{className:"bg-scf-light-gray px-6 py-2 w-full text-xl mb-4",children:"Members"}),A<0&&(0,r.jsx)(g,{error:"Please remove ".concat(A," ").concat(A>1?"members":"member"," or purchase more seats.")}),(0,r.jsx)("div",{className:"px-4 sm:px-6 lg:px-8 w-full text-left pb-6",children:(0,r.jsx)("div",{className:"flow-root",children:(0,r.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,r.jsx)("div",{className:"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8",children:(0,r.jsx)("div",{className:"overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:rounded-lg",children:(0,r.jsxs)("table",{className:"min-w-full divide-y divide-gray-300",children:[(0,r.jsx)("thead",{className:"bg-gray-50",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6",children:"Email"}),(0,r.jsx)("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",children:"Status"}),(0,r.jsx)("th",{scope:"col",className:"relative py-3.5 pl-3 pr-4 sm:pr-6",children:(0,r.jsx)("span",{className:"sr-only",children:"Actions"})})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-gray-200 bg-white",children:null==C?void 0:C.Memberships.map(e=>{var s,t;return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6",children:(null==(s=e.user)?void 0:s.email)||e.invite_email}),(0,r.jsx)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:(null==(t=e.user)?void 0:t.email)?"Registered":"Invited"}),(0,r.jsx)("td",{className:"relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6",children:I&&(0,r.jsx)("a",{href:"#",className:"text-scf-dark-blue cursor-pointer hover:text-scf-darker-blue hover:underline",onClick:()=>{k(e),y(!0)},children:"Remove"})})]},e.id)})})]})})})})})}),(0,r.jsx)("div",{className:"bg-white px-6 py-2 w-full text-xl border shadow",children:"Invite"}),(0,r.jsx)("div",{className:"mt-4 font-bold border w-full sm:w-[80%] sm:max-w-[500px] bg-white px-6 py-2 text-sm text-left",children:"Use invite link"}),(0,r.jsxs)("div",{className:"bg-white w-full sm:w-[80%] sm:max-w-[500px] border px-6 py-2 text-sm text-left",children:["Send this link to your team to get them registered:",(0,r.jsx)("div",{children:(0,r.jsxs)(i(),{className:"text-scf-dark-blue cursor-pointer hover:text-scf-darker-blue hover:underline",href:"/register/".concat(null==C?void 0:C.sign_up_token),children:["https://www.shortcutfoo.com","/register/",null==C?void 0:C.sign_up_token]})})]}),(0,r.jsx)("div",{className:"py-3",children:"- or -"}),(0,r.jsx)("div",{className:"font-bold border w-full sm:w-[80%] sm:max-w-[500px] bg-white px-6 py-2 text-sm text-left",children:"Invite by email:"}),(0,r.jsxs)("div",{className:"bg-white w-full sm:w-[80%] sm:max-w-[500px] border px-6 py-2 text-sm text-left",children:[b&&(0,r.jsx)(g,{error:b}),"Enter email address:",(0,r.jsxs)("div",{className:"flex mt-2",children:[(0,r.jsx)("div",{className:"flex items-center bg-white border border-[#cccccc] px-2",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"#cccccc",className:"w-6 h-6",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})})}),(0,r.jsx)("input",{className:"placeholder-gray-400 w-[200px] h-[35px] px-2 focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:border-transparent border-[#cccccc] 
1-ml-1",value:h,type:"email",placeholder:"Email",onChange:function(e){f(e.target.value)}}),(0,r.jsx)("button",{onClick:e=>{(null==C?void 0:C.slug)&&h&&h.length>0&&F({email:h,organizationSlug:C.slug})},className:function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return s.filter(Boolean).join(" ")}("ml-2 px-2 relative justify-center border border-transparent text-sm font-medium rounded-md text-white bg-scf-green",h&&h.length>0?"hover:bg-scf-dark-green":"opacity-50 disabled cursor-default"),children:"Send Invite"})]})]})]}),(0,r.jsx)(p.e,{appear:!0,show:j,as:l.Fragment,children:(0,r.jsxs)(v.lG,{as:"div",className:"relative z-10",onClose:M,children:[(0,r.jsx)(p.e.Child,{as:l.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,r.jsx)("div",{className:"fixed inset-0 bg-[#9ad4ed] bg-opacity-50"})}),(0,r.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,r.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,r.jsx)(p.e.Child,{as:l.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,r.jsxs)(v.lG.Panel,{className:"border-b-8 border-[#69bde2] w-full max-w-md transform overflow-hidden bg-white p-6 text-left align-middle shadow-xl transition-all pb-2",children:[(0,r.jsx)(v.lG.Title,{as:"h3",className:"text-xl pb-4 font-medium leading-6 text-gray-900 text-center border-b border-scf-underline-gray",children:(0,r.jsxs)("div",{children:["Remove"," ",(null==N||null==(a=N.user)?void 0:a.email)||(null==N?void 0:N.invite_email),"?"]})}),(0,r.jsxs)("div",{className:"pt-4 flex space-x-1 border-t border-scf-underline-gray",children:[(0,r.jsx)("div",{className:"grow"}),(0,r.jsx)("button",{className:"text-center w-[128px] h-[34px] border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-scf-dark-red hover:bg-scf-darker-red focus:outline-none",onClick:()=>{(null==N?void 0:N.id)&&T({membershipId:N.id})},children:"Delete"}),(0,r.jsx)("button",{type:"submit",className:"text-center w-[128px] h-[34px] border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-scf-orange hover:bg-scf-dark-orange focus:outline-none",onClick:()=>{M()},children:"Cancel"}),(0,r.jsx)("div",{className:"grow"})]})]})})})})]})})]}):(0,r.jsx)("div",{})};f.getLayout=function(e){return(0,r.jsx)(x.A,{currentNav:"home",children:e})};let b=f},5499:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var r=t(4232);let l=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))})},7328:(e,s,t)=>{e.exports=t(9269)},9099:(e,s,t)=>{e.exports=t(6296)}},e=>{e.O(0,[4092,8355,746,8794,636,6593,8792],()=>e(e.s=2312)),_N_E=e.O()}]);

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.