https://www.holopin.io/_next/static/chunks/pages/organizations/manage/[username]-f105de784497c496.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2230],{56348:function(e,t,s){"use strict";var n=s(59499),a=s(4730),r=(s(67294),s(86010)),i=s(37437),l=s.n(i),o=s(85893),c=["children","variant","iconOnly","icon","className"];function d(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function m(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?d(Object(s),!0).forEach((function(t){(0,n.Z)(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):d(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}t.Z=function(e){var t=e.children,s=e.variant,i=void 0===s?"primary":s,d=e.iconOnly,u=void 0!==d&&d,x=e.icon,h=void 0===x?null:x,p=e.className,f=void 0===p?"":p,v=(0,a.Z)(e,c);return(0,o.jsxs)("button",m(m({},v),{},{className:(0,r.Z)(l().button,l()[i],(0,n.Z)({},l().disabled,v.disabled))+" ".concat(f),children:[u?h:null,!u&&t]}))}},84256:function(e,t,s){"use strict";s(67294);var n=s(9008),a=s.n(n),r=s(41336),i=s(78186),l=s(83047),o=s(85893);t.Z=function(e){var t=e.title,s=void 0===t?null:t,n=e.description,c=void 0===n?"Get recognized and validate your skills and achievements with digital badges that work on GitHub, GitLab, and social media platforms. Holopin makes it easy to create, issue, and collect badges for the things you do best.":n,d=e.children,m=e.navbar,u=void 0===m||m,x=e.contentStyle,h=e.contentClassName,p=e.noVerify,f=void 0!==p&&p;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(a(),{children:[(0,o.jsx)("title",{children:s?"".concat(s," | Holopin"):"Holopin"}),(0,o.jsx)("meta",{name:"description",content:c}),(0,o.jsx)("meta",{name:"keywords",content:"digital badges, skills, achievements, GitHub, GitLab, social media, recognition, validation, open badges"}),(0,o.jsx)("meta",{name:"author",content:"Holopin"}),(0,o.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),(0,o.jsx)("link",{rel:"canonical",href:"https://www.holopin.io"}),(0,o.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,o.jsxs)("div",{className:"relative flex flex-col items-stretch min-h-screen bg-neutral-850",style:{zIndex:0,background:"transparent"},children:[u&&(0,o.jsx)(i.Z,{}),!f&&(0,o.jsx)(l.Z,{}),(0,o.jsx)("div",{style:x,className:"".concat(h||""," w-full min-h-screen p-5 mx-auto mt-20 lg:py-20 md:px-10 lg:px-40 max-w-screen-2xl"),children:d})]}),(0,o.jsx)("div",{className:"w-full mt-60",children:(0,o.jsx)(r.Z,{})})]})}},27318:function(e,t,s){"use strict";var n=s(41664),a=s.n(n),r=s(56348),i=s(85893),l=function(e,t){if("string"===typeof e)return e.replace("[orgUsername]",t);var s=e.pathname;return e.query&&(s+="?",s+="string"===typeof e.query?e.query:new URLSearchParams(e.query).toString()),s=s.replace("[orgUsername]",t)};t.Z=function(e){var t=e.organizations,s=e.showButtons,n=void 0===s||s,o=e.customHref,c=void 0===o?null:o;return(0,i.jsx)(i.Fragment,{children:t&&t.length>0&&(0,i.jsx)("div",{className:"grid grid-cols-1 gap-3",children:t.map((function(e){return(0,i.jsxs)("div",{id:e.id,className:"flex flex-col items-center justify-between w-full px-8 py-4 rounded-md bg-neutral-700 md:flex-row",children:[(0,i.jsx)("div",{className:"flex flex-row items-center justify-center",children:(0,i.jsx)("div",{className:"w-full mb-4 text-2xl font-semibold text-center md:text-left md:w-fit md:m-0",children:(0,i.jsx)(a(),{href:c?l(c,e.username):"/@".concat(e.username),children:(0,i.jsx)("a",{children:(0,i.jsxs)("span",{className:"cursor-pointer",children:[(0,i.jsx)("span",{className:"",children:e.name}),(0,i.jsxs)("span",{className:"block text-lg text-neutral-400",children:["@",(0,i.jsx)("span",{className:"cursor-pointer",children:e.username})]})]})})})})}),n&&(0,i.jsxs)("div",{className:"flex flex-col items-center justify-center w-full pointer-none md:w-fit md:flex-row gap-3",children:[(0,i.jsx)(a(),{href:"/organizations/manage/".concat(e.username),children:(0,i.jsx)("a",{children:(0,i.jsx)(r.Z,{variant:"secondary",className:"w-full md:w-fit hover:border hover:border-blue-300",children:"Settings"})})}),(0,i.jsx)(a(),{href:"/sticker/new?id=".concat(e.id),children:(0,i.jsx)("a",{children:(0,i.jsx)(r.Z,{variant:"primary",className:"w-full md:w-fit hover:border hover:border-green-300",children:"Create Badge"})})})]})]},e.id)}))})})}},3040:function(e,t,s){"use strict";var n=s(67294),a=s(77768),r=s(85893);t.Z=function(e){var t=e.title,s=e.description,i=e.enabled,l=e.setEnabled,o=(0,n.use
1State)(i),c=o[0],d=o[1];function m(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter(Boolean).join(" ")}return(0,r.jsxs)(a.r.Group,{as:"div",className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"flex flex-col flex-grow",children:[(0,r.jsx)("label",{children:t}),(0,r.jsx)(a.r.Description,{as:"span",className:"text-sm text-gray-400",children:s})]}),(0,r.jsx)(a.r,{checked:c,onChange:function(e){d(e),l(e)},className:m(c?"bg-green-400":"bg-gray-200","relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-green-300 focus:ring-offset-2"),children:(0,r.jsx)("span",{"aria-hidden":"true",className:m(c?"translate-x-5":"translate-x-0","pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out")})})]})}},83047:function(e,t,s){"use strict";var n=s(50029),a=s(87794),r=s.n(a),i=s(67294),l=s(33299),o=s(11163),c=s(85893);t.Z=function(){var e,t=(0,o.useRouter)(),s=(0,l.useSession)(),a=s.data,d=(s.status,(0,i.useState)("init")),m=d[0],u=d[1];if(t.query.verified)return(0,c.jsx)("div",{className:"w-full h-12 px-2 mt-16 text-center bg-blue-300 sm:h-8",children:(0,c.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,c.jsx)("p",{className:"text-xs font-semibold text-black sm:text-sm",children:"Thanks! Your email has been verified."})})});var x=null===a||void 0===a||null===(e=a.user)||void 0===e?void 0:e.emailVerified,h=function(){var e=(0,n.Z)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u("loading"),e.next=3,fetch("/api/auth/verify",{method:"POST"});case 3:if(200!==e.sent.status){e.next=7;break}return u("success"),e.abrupt("return");case 7:u("error");case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.jsx)(c.Fragment,{children:!1===x&&(null===a||void 0===a?void 0:a.user)&&(0,c.jsx)("div",{className:"w-full h-12 px-2 mt-16 text-center bg-blue-300 sm:h-8",children:(0,c.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,c.jsxs)("p",{className:"text-xs font-semibold text-black sm:text-sm",children:["Please verify your email address."," ","init"==m&&(0,c.jsx)("a",{className:"underline cursor-pointer",onClick:h,children:"Re-send verification email"}),"loading"==m&&(0,c.jsx)("span",{className:"text-xs font-semibold text-black sm:text-sm",children:"Sending..."}),"success"==m&&(0,c.jsx)("span",{className:"text-xs font-semibold text-black sm:text-sm",children:"Verification email sent!"}),"error"==m&&(0,c.jsx)("span",{className:"text-xs font-semibold text-black sm:text-sm",children:"Error sending verification email. Please try again."})]})})})})}},72785:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return ce},default:function(){return de}});var n=s(67294),a=s(39590),r=s(24635),i=s(80943),l=s(92484),o=s(86010),c=s(41664),d=s.n(c),m=s(11163),u=s(61121),x=s(78633),h=s(52091),p=s(19042),f=s(84256),v=s(50029),j=s(87794),b=s.n(j),g=s(27812),y=s(59499),N=s(11355),w=s(85479),k=s(47533),S=s(87536),C=s(74231),z=s(56348),O=s(85893);function Z(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function F(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(s),!0).forEach((function(t){(0,y.Z)(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Z(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var _=function(e){var t,s=e.apiKeys,a=e.setApiKeys,r=e.username,i=e.open,l=e.setOpen,o=(0,n.useRef)(null),c=(0,n.useState)(null),d=(c[0],c[1]),m=(0,n.useState)(!1),u=m[0],x=(m[1],(0,n.useState)(null)),h=x[0],p=x[1],f=C.Ry().shape({name:C.Z_().required("Name is required.").min(3,"Name must be at least 3 characters.").max(50,"Name must be 50 characters or less.")}),j={resolver:(0,k.X)(f)},y=(0,S.cI)(F({mode:"onBlur"},j)),Z=y.register,_=y.handleSubmit,P=(y.reset,y.formState.errors),T=function(){var e=(0,v.Z)(b().mark((function e(t){var n,i,o;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/auth/organization/keys?organization=".concat(r),{method:"POST",body:JSON.stringify({name:t.name}),headers:{"Content-Type":"application/json"}});case 2:if(200===(n=e.sent).status){e.next=10;break}return e.next=6,n.json();case 6:i=e.sent,p(i.error),e.next=16;break;case 10:return e.next=12,n.json();case 12:o=e.sent,a([o.data].concat((0,g.Z)(s))),d("API key created successfully."),l(!1);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,O.jsx)(N.u.Root,{show:i,as:n.Fragment,children:(0,O.jsxs)(w.V,{as:"div",className:"relative z-10",initialFocus:o,onClose:l,children:[(0,O.jsx)(N.u.Child,{as:n.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,O.jsx)("div",{className:"fixed inset-0 bg-neutral-900 bg-opacity-60 transition-opacity"})}),(0,O.jsx)("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:(0,O.jsx)("div",{className:"flex justify-center min-h-full p-4 text-center sm:items-center sm:p-0",children:(0,O.jsx)(N.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,O.jsxs)(w.V.Panel,{className:"relative px-4 pt-5 pb-4 overflow-hidden text-left rounded-lg shadow-xl bg-neutral-800 transform transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6 h-fit",children:[(0,O.jsx)("div",{className:"sm:flex sm:items-start",children:(0,O.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:text-left",children:[(0,O.jsx)(w.V.Title,{as:"h3",className:"text-lg font-medium text-white leading-6",children:"New API Key"}),(0,O.jsx)("div",{className:"mt-2",children:(0,O.jsx)("p",{className:"text-sm text-neutral-400",children:"Give your API key a name so you can easily identify it"})})]})}),(0,O.jsxs)("form",{className:"mt-5",onSubmit:_(T),children:[(0,O.jsxs)("div",{className:"w-full sm:max-w-xs",children:[(0,O.jsx)("label",{htmlFor:"name",className:"sr-only",children:"Name"}),(0,O.jsx)("input",F(F({type:"text",name:"name",id:"name"},Z("name")),{},{className:"form-text-field"})),(0,O.jsx)("div",{className:"pb-3 text-xs text-red-500",children:null===(t=P.name)||void 0===t?void 0:t.message})]}),(0,O.jsx)(z.Z,{variant:"primary",type:"submit",disabled:u,children:u?"Creating...":"Create"}),h&&(0,O.jsx)("div",{className:"mt-3 text-xs text-red-500",children:h})]})]})})})})]})})},P=s(5506),T=function(e){e.apiKeys,e.setApiKeys;var t=e.username,s=e.name,a=e.apiKey,r=e.open,i=e.setOpen,l=(0,n.useRef)(null),o=(0,n.use
1State)(null),c=o[0],d=o[1],m=(0,n.useState)(null),u=m[0],x=m[1];function h(){return(h=(0,v.Z)(b().mark((function e(s){var n,r,l;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.preventDefault(),e.next=3,fetch("/api/auth/organization/keys?organization=".concat(t),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:a,expired:!0})});case 3:if(200===(n=e.sent).status){e.next=12;break}return e.next=7,n.json();case 7:r=e.sent,l=r.message,x(l),e.next=18;break;case 12:return e.next=14,n.json();case 14:e.sent,d("API key deleted successfully."),window.location.reload(),i(!1);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,O.jsx)(N.u.Root,{show:r,as:n.Fragment,children:(0,O.jsxs)(w.V,{as:"div",className:"relative z-10",initialFocus:l,onClose:i,children:[(0,O.jsx)(N.u.Child,{as:n.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,O.jsx)("div",{className:"fixed inset-0 bg-neutral-900 bg-opacity-60 transition-opacity"})}),(0,O.jsx)("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:(0,O.jsx)("div",{className:"flex items-end justify-center min-h-full p-4 text-center sm:items-center sm:p-0",children:(0,O.jsx)(N.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,O.jsxs)(w.V.Panel,{className:"relative px-4 pt-5 pb-4 overflow-hidden text-left rounded-lg shadow-xl bg-neutral-800 transform transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6 h-fit",children:[(0,O.jsxs)("div",{className:"sm:flex sm:items-start",children:[(0,O.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto rounded-full sm:mx-0 sm:h-10 sm:w-10",children:(0,O.jsx)(P.Z,{className:"w-6 h-6 text-red-600","aria-hidden":"true"})}),(0,O.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,O.jsxs)(w.V.Title,{as:"h3",className:"text-lg font-medium text-white leading-6",children:['Deactivate API Key "',s,'"']}),(0,O.jsx)("div",{className:"mt-2",children:(0,O.jsx)("p",{className:"text-sm text-neutral-300",children:"Are you sure you want to delete this API key? All of your workflows using this API key will stop working."})})]})]}),(0,O.jsxs)("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse gap-3",children:[(0,O.jsx)(z.Z,{type:"button",onClick:function(e){return h.apply(this,arguments)},variant:"danger",children:"Deactivate"}),(0,O.jsx)(z.Z,{type:"button",variant:"secondary",onClick:function(){return i(!1)},ref:l,children:"Cancel"}),c&&(0,O.jsx)("div",{className:"flex items-center justify-center text-xs text-green-600",children:c}),u&&(0,O.jsx)("div",{className:"flex items-center justify-center text-xs text-red-600",children:u})]})]})})})})]})})},A=function(e){e.session;var t=e.organization,s=(0,n.useState)(!1),a=s[0],r=s[1],i=(0,n.useState)(null),l=i[0],o=i[1],c=(0,n.useState)(!1),d=c[0],u=c[1],x=(0,n.useState)(null),p=x[0],f=x[1],j=(0,n.useState)(null),g=j[0],y=j[1],N=(0,n.useState)(!1),w=N[0],k=N[1],S=(0,n.useState)(!0),C=S[0],Z=S[1],F=(0,m.useRouter)();function P(){r(!0),setTimeout((function(){r(!1)}),1e3)}return(0,n.useEffect)((function(){if(F.isReady){var e=function(){var e=(0,v.Z)(b().mark((function e(){var s,n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/auth/organization/keys?organization=".concat(t.username),{method:"GET",headers:{"Content-Type":"application/json"}});case 2:return s=e.sent,e.next=5,s.json();case 5:n=e.sent,o(n.data),Z(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[F,t]),(0,O.jsxs)("div",{className:"relative px-4 sm:px-6 lg:px-8",children:[(0,O.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,O.jsxs)("div",{className:"sm:flex-auto",children:[(0,O.jsxs)("h1",{className:"text-xl font-semibold text-white",children:["API Keys",(0,O.jsx)("span",{className:"ml-1 text-neutral-400",children:"(@".concat(t.username,")")})]}),(0,O.jsx)("p",{className:"mt-2 text-sm text-neutral-400",children:"API keys allow you to access the API and share badges."})]}),(0,O.jsxs)("div",{className:"mt-4 sm:mt-0 sm:ml-16 sm:flex-none",children:[(0,O.jsx)(z.Z,{variant:"primary",onClick:function(){return k(!0)},children:"Create API Key"}),(0,O.jsx)(_,{apiKeys:l,setApiKeys:o,username:t.username,open:w,setOpen:k})]})]}),(0,O.jsxs)("div",{className:"relative mt-8 -mx-4 overflow-hidden rounded-sm shadow ring-1 ring-black ring-opacity-5 sm:-mx-6 md:mx-0",children:[a&&(0,O.jsx)("div",{className:"absolute top-0 left-0 right-0 flex justify-center text-xs font-semibold text-green-300",children:"Copied to clipboard!"}),(0,O.jsxs)("table",{className:"min-w-full divide-y divide-neutral-300",children:[(0,O.jsx)("thead",{className:"bg-transparent",children:(0,O.jsxs)("tr",{children:[(0,O.jsx)("th",{scope:"col",className:"pl-4 pr-3 text-sm font-semibold text-left text-white py-3.5 sm:pl-6",children:"API Key"}),(0,O.jsx)("th",{scope:"col",className:"hidden px-3 text-sm font-semibold text-left text-white py-3.5 sm:table-cell",children:"Value"}),(0,O.jsx)("th",{scope:"col",className:"relative pl-3 pr-4 py-3.5 sm:pr-6",children:(0,O.jsx)("span",{className:"sr-only",children:"Edit"})})]})}),(0,O.jsxs)("tbody",{className:"bg-transparent divide-y divide-neutral-600",children:[C&&
1(0,O.jsxs)("div",{className:"flex flex-row mt-4 text-sm text-neutral-600",children:[(0,O.jsx)("div",{className:"w-4 h-4 mr-2 border-b-2 rounded-full animate-spin border-neutral-600"}),"Loading keys. This may take a few seconds..."]}),l&&l.map((function(e){return(0,O.jsxs)("tr",{children:[(0,O.jsxs)("td",{className:"w-full py-4 pl-4 pr-3 text-sm font-medium text-white max-w-0 sm:w-auto sm:max-w-none sm:pl-6",children:[e.name,(0,O.jsxs)("dl",{className:"font-normal lg:hidden",children:[(0,O.jsx)("dt",{className:"sr-only sm:hidden",children:"Value"}),(0,O.jsx)("dd",{className:"mt-1 font-mono text-white truncate sm:hidden",children:e.expired?(0,O.jsx)(O.Fragment,{children:e.key}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(h.VD6,{className:"inline mb-1 mr-1 hover:text-green-300 hover:cursor-pointer",onClick:function(){navigator.clipboard.writeText(e.key),P()}}),e.key]})})]})]}),(0,O.jsx)("td",{className:"hidden inline px-3 py-4 font-mono text-sm text-white sm:table-cell",children:e.expired?(0,O.jsx)(O.Fragment,{children:e.key}):(0,O.jsxs)(O.Fragment,{children:[e.key,(0,O.jsx)(h.VD6,{className:"inline mb-1 ml-1 hover:text-green-300 hover:cursor-pointer",onClick:function(){navigator.clipboard.writeText(e.key),P()}})]})}),(0,O.jsx)("td",{className:"py-4 pl-3 pr-4 text-sm font-medium text-right sm:pr-6",children:e.expired?(0,O.jsx)("span",{className:"italic text-neutral-400",children:"Expired"}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(z.Z,{variant:"danger",onClick:function(){u(!0),f(e.key),y(e.name)},children:["Delete",(0,O.jsxs)("span",{className:"sr-only",children:[", ",e.name]})]}),(0,O.jsx)(T,{apiKeys:l,apiKey:p,name:g,setApiKeys:o,username:t.username,open:d,setOpen:u})]})})]},e.key)}))]})]})]})]})},E=s(82580),R=s(542),B=s(25675),I=s.n(B),M=s(48764).Buffer,D=function(e){var t,s,a,r,i,l,o,c=e.organization,d=(0,n.useState)(null!==(t=c.website)&&void 0!==t?t:null),m=d[0],u=(d[1],(0,n.useState)(null!==(s=c.description)&&void 0!==s?s:null)),x=u[0],h=(u[1],(0,n.useState)(null!==(a=c.name)&&void 0!==a?a:null)),p=h[0],f=(h[1],(0,n.useState)(null!==(r=c.twitter)&&void 0!==r?r:null)),j=f[0],g=(f[1],(0,n.useState)(null!==(i=c.location)&&void 0!==i?i:null)),y=g[0],N=(g[1],(0,n.useState)(null!==(l=c.image)&&void 0!==l?l:R.Z)),w=N[0],k=N[1],S=(0,n.useState)(null!==(o=c.imageId)&&void 0!==o?o:null),Z=S[0],F=(S[1],(0,n.useState)(null)),_=F[0],P=F[1],T=(0,n.useState)(!1),A=T[0],B=T[1],D=(0,n.useState)(null),V=D[0],L=D[1],H=(0,n.use
1State)(null),G=H[0],K=H[1],W=(0,n.useState)(null),U=W[0],q=W[1],J=C.Ry().shape({name:C.Z_().max(30,"Must not be longer than 30 characters").nullable(),website:C.Z_().url("Must be a valid URL").nullable(),description:C.Z_().max(300,"Must not be longer than 300 characters").nullable(),twitter:C.Z_().max(30,"Must not be longer than 30 characters").nullable(),location:C.Z_().max(30,"Must not be longer than 30 characters").nullable()}),Y=function(){var e=(0,v.Z)(b().mark((function e(t,s){var n,a,r,i,l,o;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),o=function(){var e=(0,v.Z)(b().mark((function e(){var t,n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_){e.next=23;break}return e.t0=fetch,e.t1={"Content-Type":"application/json"},e.t2=JSON,e.t3=M,e.next=7,_.arrayBuffer();case 7:return e.t4=e.sent,e.t5=e.t3.from.call(e.t3,e.t4).toString("base64"),e.t6={image:e.t5},e.t7=e.t2.stringify.call(e.t2,e.t6),e.t8={method:"POST",headers:e.t1,body:e.t7},e.next=14,(0,e.t0)("/api/assets",e.t8);case 14:return t=e.sent,e.next=17,t.json();case 17:if(n=e.sent,200==t.status){e.next=22;break}return K("Error uploading image: "+((null===n||void 0===n?void 0:n.message)||t.statusText)),s(!1),e.abrupt("return");case 22:return e.abrupt("return",n.data.id);case 23:return e.abrupt("return",Z);case 24:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.t0=fetch,e.t1="/api/auth/organization?id=".concat(c.id),e.t2={"Content-Type":"application/json"},e.t3=JSON,e.t4=null!==(n=t.name)&&void 0!==n?n:null,e.t5=null!==(a=t.website)&&void 0!==a?a:null,e.t6=null!==(r=t.description)&&void 0!==r?r:null,e.t7=null!==(i=t.twitter)&&void 0!==i?i:null,e.t8=null!==(l=t.location)&&void 0!==l?l:null,e.next=13,o();case 13:return e.t9=e.sent,e.t10={name:e.t4,website:e.t5,description:e.t6,twitter:e.t7,location:e.t8,imageId:e.t9},e.t11=e.t3.stringify.call(e.t3,e.t10),e.t12={method:"PATCH",headers:e.t2,body:e.t11},e.next=19,(0,e.t0)(e.t1,e.t12);case 19:200!=e.sent.status?(K("Error updating profile"),s(!1)):(L("Profile updated"),s(!1),setTimeout((function(){L(null)}),800)),s(!1);case 22:case"end":return e.stop()}}),e)})));return function(t,s){return e.apply(this,arguments)}}();function X(e){var t=e.target.files;if(q(null),t&&0!==t.length){if(t){var s=t[0];if(s.size>3145728)return q("File must be under 2MB"),void P(null);if("image/png"!==s.type&&"image/svg+xml"!==s.type&&"image/jpeg"!==s.type)return q("File must be PNG, JPEG or SVG"),void P(null);if(s){P(s);var n=new FileReader;n.onload=function(e){k(e.target.result)},n.readAsDataURL(s)}}}else P(null)}return(0,O.jsx)(E.J9,{initialValues:{name:p,website:m,description:x,twitter:j,location:y},validationSchema:J,enableReinitialize:!0,onSubmit:function(){var e=(0,v.Z)(b().mark((function e(t){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:L(null),K(null),B(!0),Y(t,B);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:function(e){var t=e.errors,s=e.touched;return(0,O.jsx)(E.l0,{onChange:function(){L(null),K(null)},children:(0,O.jsxs)("div",{className:"shadow sm:overflow-hidden sm:rounded-md",children:[(0,O.jsx)("div",{className:"px-4 pb-6 hp-page-content space-y-6 sm:pb-6 sm:pl-6",children:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"sm:flex-auto",children:[(0,O.jsxs)("h1",{className:"text-xl font-semibold text-white",children:["Profile",(0,O.jsx)("span",{className:"ml-1 text-neutral-400",children:"(@".concat(c.username,")")})]}),(0,O.jsx)("p",{className:"mt-2 text-sm text-neutral-400",children:"Edit your profile information."})]}),(0,O.jsxs)("div",{className:"grid grid-cols-3 gap-6",children:[(0,O.jsx)("div",{className:"col-span-3 sm:col-span-2",children:(0,O.jsxs)("label",{htmlFor:"image",className:"mb-3 form-label",children:["Image",(0,O.jsx)("div",{className:"flex flex-col justify-start py-5 sm:flex-row",children:(0,O.jsxs)("div",{className:"relative z-1",children:[(0,O.jsx)(E.gN,{type:"file",name:"image",className:"hidden opacity-0",id:"image",onChange:X}),(0,O.jsx)("div",{className:"p-0.5 w-36 rounded-md bg-neutral-900 aspect-w-1 aspect-h-1 xl:aspect-w-7 xl:aspect-h-8",children:(0,O.jsx)("div",{className:"transition-transform ease-in-out hover:scale-105 hover:cursor-pointer",children:(0,O.jsx)(I(),{src:w,width:"90%",height:"90%",layout:"responsive",objectFit:w===R.Z?"fill":"cover",alt:"user image",className:"rounded-md"})})}),(0,O.jsx)("div",{className:"absolute top-0 w-full h-full bg-black opacity-0 z-3 rounded-md hover:opacity-90"})]})}),U?(0,O.jsx)("div",{className:"text-xs text-red-500",children:U}):null]})}),(0,O.jsxs)("div",{className:"col-span-3 sm:col-span-2",children:[(0,O.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium",children:"Display name"}),(0,O.jsx)("div",{className:"mt-1",children:(0,O.jsx)(E.gN,{type:"text",name:"name",id:"name",className:"flex-1 w-full p-2 bg-transparent border border-neutral-600 rounded-md",placeholder:""})})]}),(0,O.jsxs)("div",{className:"col-span-3 sm:col-span-2",children:[(0,O.jsx)("label",{htmlFor:"location",className:"block text-sm font-medium",children:"Location"}),(0,O.jsx)("div",{className:"mt-1",children:(0,O.jsx)(E.gN,{type:"text",name:"location",id:"location",className:"flex-1 w-full p-2 bg-transparent border border-neutral-600 rounded-md",placeholder:""})})]}),t.location&&s.location?(0,O.jsx)("div",{className:"text-xs text-red-500",children:t.location}):null,(0,O.jsxs)("div",{className:"col-span-3 sm:col-span-2",children:[(0,O.jsx)("label",{htmlFor:"website",className:"block text-sm font-medium",children:"Website"}),(0,O.jsx)("div",{className:"mt-1",children:(0,O.jsx)(E.gN,{type:"text",name:"website",id:"website",autoComplete:"url",className:"flex-1 w-full p-2 bg-transparent border border-neutral-600 rounded-md",placeholder:"https://"})}),t.website&&s.website?(0,O.jsx)("div",{className:"mt-2 text-xs text-red-500",children:t.website}):null]}),(0,O.jsxs)("div",{className:"col-span-3 sm:col-span-2",children:[(0,O.jsx)("label",{htmlFor:"twitter",className:"block text-sm font-medium",children:"Twitter handle"}),(0,O.jsxs)("div",{className:"flex mt-1",children:[(0,O.jsx)("span",{className:"inline mt-2 mr-2 text-lg font-bold",children:"@"}),(0,O.jsx)(E.gN,{type:"text",name:"twitter",id:"twitter",className:"flex-1 inline w-full p-2 bg-transparent border border-neutral-600 rounded-md",placeholder:"optional"})]}),t.twitter&&s.twitter?(0,O.jsx)("div",{className:"mt-2 text-xs text-red-500",children:t.twitter}):null]}),(0,O.jsxs)("div",{className:"col-span-3 sm:col-span-2",children:[(0,O.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium",children:"Description"}),(0,O.jsx)("div",{className:"mt-1",children:(0,O.jsx)(E.gN,{as:"textarea",id:"description",name:"description",rows:3,className:"flex-1 w-full p-2 bg-transparent border border-neutral-600 rounded-md",placeholder:""})}),t.description&&s.description?(0,O.jsx)("div",{className:"mt-2 text-xs text-red-500",children:t.description}):null]})]}),G&&(0,O.jsxs)("div",{className:"bg-red-900 border-l-4 border-red-600 p-4 mt-5",role:"alert",children:[(0,O.jsx)("p",{className:"font-bold",children:"There was an issue saving."}),(0,O.jsx)("p",{children:G})]})]})}),(0,O.jsxs)("div",{className:"w-full px-4 py-3 sm:w-fit sm:text-left sm:px-6",children:[(0,O.jsx)(z.Z,{type:"submit",variant:"primary",children:(0,O.jsx)("div",{className:"relative mx-auto",children:(0,O.jsx)("span",{className:"".concat(A?"bg-opacity-0":"bg-opacity-100"),children:A?"Saving...":"Save"})})}),A?null:(0,O.jsx)("div",{className:"mt-3 text-sm text-green-300",children:V}),A?null:(0,O.jsx)("div",{className:"mt-3 text-sm text-red-300",children:G})]})]})})}})},V=function(e){var t=e.showCancelModal,s=e.setShowCancelModal,a=e.subscription,r=e.organization;return(0,O.jsx)(N.u.Root,{show:t,as:n.Fragment,children:(0,O.jsxs)(w.V,{as:"div",className:"relative z-10",onClose:s,children:[(0,O.jsx)(N.u.Child,{as:n.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,O.jsx)("div",{className:"fixed inset-0 bg-neutral-900 bg-opacity-90 transition-opacity"})}),(0,O.jsx)("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:(0,O.jsx)("div",{className:"flex items-end justify-center min-h-full p-4 text-center sm:items-center sm:p-0",children:(0,O.jsx)(N.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,O.jsxs)(w.V.Panel,{className:"relative px-4 pt-5 pb-4 overflow-hidden text-left rounded-lg shadow-xl bg-neutral-800 transform transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6 h-fit",children:[(0,O.jsx)("div",{className:"sm:flex sm:items-start",children:(0,O.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,O.jsx)(w.V.Title,{as:"h3",className:"text-lg font-medium text-white leading-6",children:"Are you sure you want to cancel your subscription?"}),(0,O.jsx)("div",{className:"mt-2",children:(0,O.jsx)("p",{className:"text-sm text-neutral-300",children:"Cancellations are effective immediately and you will not be able to create or issue any more rewards until you re-subscribe."})})]})}),(0,O.jsxs)("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse gap-3",children:[(0,O.jsx)("form",{method:"POST",action:"/api/billing/create-billing-portal-org-cancel?organization=".concat(r.username,"&subId=").concat(a.id),children:(0,O.jsx)(z.Z,{type:"submit",variant:"danger",children:"Continue to Cancel"})}),(0,O.jsx)(z.Z,{type:"button",variant:"outline",onClick:function(){return s(!1)},children:"Go Back"})]})]})})})})]})},a.id)}
1,L=function(e){var t=e.session,s=e.organization,a=(0,n.useState)([]),r=a[0],i=a[1],l=(0,n.useState)(!0),o=(l[0],l[1]),c=(0,n.useState)([]),u=c[0],x=c[1],h=(0,n.useState)(""),p=(h[0],h[1]),f=(0,n.useState)(!1),j=f[0],y=f[1],N=(0,m.useRouter)();return(0,n.useEffect)((function(){if(N.isReady){var e=function(){var e=(0,v.Z)(b().mark((function e(){var t,n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/auth/organization/subscriptions?organization=".concat(s.username));case 2:return t=e.sent,e.next=5,t.json();case 5:(n=e.sent).error?p(n.error):(i((0,g.Z)(n.data.subscriptions)),x((0,g.Z)(n.data.plans))),o(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[N,s]),(0,O.jsxs)("div",{className:"max-w-2xl px-4 py-6 hp-page-content space-y-6 sm:p-6",children:[(0,O.jsx)("h3",{className:"text-2xl font-semibold leading-6",children:"Billing"}),(0,O.jsx)("p",{className:"mt-2 text-sm text-neutral-400",children:"If you have any active subscriptions enabled for your organization, they will appear here."}),u.length>0&&u.map((function(e){return(0,O.jsxs)("div",{className:"rounded-lg shadow-lg bg-neutral-800",children:[(0,O.jsxs)("div",{className:"px-6 py-4",children:[(0,O.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,O.jsx)("h4",{className:"text-lg font-semibold leading-6",children:"Custom Plan"}),"ACTIVE"===e.status&&(0,O.jsx)("span",{className:"px-2 py-1 text-xs font-normal text-green-300 border border-green-300 rounded-md",children:"Active"}),"ACTIVE"!==e.status&&(0,O.jsx)("span",{className:"px-2 py-1 text-xs font-normal text-red-300 border border-red-300 rounded-md",children:"Expired"})]}),(0,O.jsxs)("p",{className:"mt-2 text-sm text-neutral-400",children:[e.stickers," stickers per term"]}),(0,O.jsxs)("p",{className:"mt-2 text-sm text-neutral-400",children:[e.seats," seats per term"]}),(0,O.jsx)("p",{className:"mt-2 text-sm text-neutral-400",children:"Unlimited Holobytes"})]}),(0,O.jsxs)("div",{className:"pb-2 pl-4 text-sm text-neutral-400",children:["To manage your plan, please contact your account manager or email"," ",(0,O.jsx)(d(),{href:"mailto:[email protected]",children:(0,O.jsx)("a",{className:"font-semibold hover:text-green-300",children:"[email protected]"})}),"."]})]},e.id)})),r.length>0&&r.map((function(e){return(0,O.jsxs)("div",{className:"rounded-lg shadow-lg bg-neutral-800",children:[(0,O.jsxs)("div",{className:"px-6 py-4",children:[(0,O.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,O.jsx)("h4",{className:"text-lg font-semibold leading-6",children:e.name}),"active"===e.status&&(0,O.jsx)("span",{className:"px-2 py-1 text-xs font-normal text-green-300 border border-green-300 rounded-md",children:"Active"}),"canceled"===e.status&&(0,O.jsx)("span",{className:"px-2 py-1 text-xs font-normal text-red-300 border border-red-300 rounded-md",children:"Canceled"})]}),(0,O.jsxs)("p",{className:"mt-2 text-sm text-neutral-400",children:[e.seatQuota," seat(s)"]}),(0,O.jsxs)("p",{className:"mt-2 text-sm text-neutral-400",children:[e.stickerQuota," Badge(s)"]})]}),"active"===e.status&&(0,O.jsxs)("div",{className:"flex justify-end px-4 pb-4 space-x-4",children:[(0,O.jsx)("form",{method:"POST",action:"/api/billing/create-billing-portal-org-manage?organization=".concat(s.username,"&subId=").concat(e.id),children:(0,O.jsx)(z.Z,{type:"submit",variant:"primary",children:"Manage"})}),(0,O.jsx)(z.Z,{type:"button",variant:"danger",onClick:function(){return y(!0)},children:"Cancel"}),(0,O.jsx)(V,{showCancelModal:j,setShowCancelModal:y,subscription:e,organization:s})]})]},e.id)})),r.length>0&&r.every((function(e){return"canceled"===e.status}))&&(0,O.jsx)("div",{className:"pb-2 pl-4",children:(0,O.jsx)("form",{method:"POST",action:"/api/billing/create-checkout-session-org-resub?organization=".concat(s.username,"&orgId=").concat(s.id,"&userId=").concat(t.user.id),children:(0,O.jsx)(z.Z,{type:"submit",variant:"primary",children:"Re-activate"})})})]})},H=s(96402),G=function(e){var t=e.organization,s=e.members,a=e.member,r=e.open,i=e.setOpen,l=e.setMembers,o=(0,n.useRef)(null),c=(0,n.use
1State)(null),d=c[0],m=c[1],u=(0,n.useState)(null),x=u[0],h=u[1];function p(){return(p=(0,v.Z)(b().mark((function e(n){var r,o,c,d,u,x,p;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),e.next=3,fetch("/api/auth/organization/members?organization=".concat(t),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a.username})});case 3:if(200===(r=e.sent).status){e.next=12;break}return e.next=7,r.json();case 7:o=e.sent,c=o.message,h(c),e.next=22;break;case 12:return e.next=14,r.json();case 14:d=e.sent,u=d.data,x=(0,g.Z)(s),-1!==(p=x.findIndex((function(e){return e.username===u.username})))&&x.splice(p,1),l(x),m("Member removed successfully."),i(!1);case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,n.useEffect)((function(){h(null),m(null)}),[a]),(0,O.jsx)(N.u.Root,{show:r,as:n.Fragment,children:(0,O.jsxs)(w.V,{as:"div",className:"relative z-10",initialFocus:o,onClose:i,children:[(0,O.jsx)(N.u.Child,{as:n.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,O.jsx)("div",{className:"fixed inset-0 bg-neutral-900 bg-opacity-60 transition-opacity"})}),(0,O.jsx)("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:(0,O.jsx)("div",{className:"flex items-end justify-center min-h-full p-4 text-center sm:items-center sm:p-0",children:(0,O.jsx)(N.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,O.jsxs)(w.V.Panel,{className:"relative px-4 pt-5 pb-4 overflow-hidden text-left rounded-lg shadow-xl bg-neutral-800 transform transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6 h-fit",children:[(0,O.jsxs)("div",{className:"sm:flex sm:items-start",children:[(0,O.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto rounded-full sm:mx-0 sm:h-10 sm:w-10",children:(0,O.jsx)(P.Z,{className:"w-6 h-6 text-red-600","aria-hidden":"true"})}),(0,O.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,O.jsxs)(w.V.Title,{as:"h3",className:"text-lg font-medium text-white leading-6",children:['Remove Member - "',null===a||void 0===a?void 0:a.username,'"']}),(0,O.jsx)("div",{className:"mt-2",children:(0,O.jsx)("p",{className:"text-sm text-neutral-300",children:"Are you sure you want to remove this member from your organization?"})})]})]}),(0,O.jsxs)("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse gap-3",children:[(0,O.jsx)(z.Z,{type:"button",onClick:function(e){return p.apply(this,arguments)},variant:"danger",children:"Remove"}),(0,O.jsx)(z.Z,{type:"button",variant:"secondary",onClick:function(){return i(!1)},ref:o,children:"Cancel"}),d&&(0,O.jsx)("div",{className:"flex items-center justify-center text-xs text-green-600",children:d}),x&&(0,O.jsx)("div",{className:"flex items-center justify-center text-xs text-red-600",children:x})]})]})})})})]})})},K=s(35079),W=s(13342),U=s(58057),q=function(e){var t=e.title,s=e.items,a=e.selectedItem,r=e.onChange,i=(0,n.useState)(a||s[0]),l=i[0],o=i[1];(0,n.useEffect)((function(){d(a||s[0])}),[]);var c=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter(Boolean).join(" ")},d=function(e){o(e),r(e)};return(0,O.jsx)(K.R,{value:l,onChange:d,children:function(e){var a=e.open;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("label",{children:t}),(0,O.jsxs)("div",{className:"relative mt-2 mb-5",children:[(0,O.jsxs)(K.R.Button,{className:"relative w-full pl-3 pr-10 text-left bg-black cursor-default py-2.5 rounded-md shadow-sm focus:border-white focus:outline-none focus:ring-1 focus:ring-geen-300 sm:text-sm",children:[(0,O.jsx)("span",{className:"block truncate",children:null===l||void 0===l?void 0:l.label}),(0,O.jsx)("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none",children:(0,O.jsx)(W.Z,{className:"w-5 h-5 text-white-400","aria-hidden":"true"})})]}),(0,O.jsx)(N.u,{show:a,as:n.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,O.jsx)(K.R.Options,{className:"absolute z-10 w-full mt-1 overflow-auto text-base bg-black shadow-lg py-2.5 max-h-60 rounded-md ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:s.map((function(e){return(0,O.jsx)(K.R.Option,{className:function(e){var t=e.active;return c(t?"text-black font-bold bg-green-300":"text-white-900","relative cursor-default select-none py-2 pl-3 pr-9")},value:e,children:function(t){var s=t.selected,n=t.active;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{className:c(s?"font-semibold":"font-normal","block truncate"),children:e.label}),s?(0,O.jsx)("span",{className:c(n?"text-black":"text-green-300","absolute inset-y-0 right-0 flex items-center pr-4"),children:(0,O.jsx)(U.Z,{className:"w-5 h-5","aria-hidden":"true"})}):null]})}},e.id)}))})})]})]})}})},J=s(3040);function Y(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function X(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Y(Object(s),!0).forEach((function(t){(0,y.Z)(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Y(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var Q=[{id:"member",label:"Member",value:"member",selected:!1},{id:"admin",label:"Admin",value:"admin",selected:!1}],$=function(e){var t,s=e.seats,a=e.member,r=e.members,i=e.setMembers,l=e.organization,o=e.open,c=e.setOpen,d=e.isEdit,m=(0,n.useRef)(null),u=(0,n.useState)(null),x=(u[0],u[1]),h=(0,n.useState)(!1),p=h[0],f=h[1],j=(0,n.useState)(null),y=j[0],Z=j[1],F=(0,n.useState)(null),_=F[0],P=F[1],T=(0,n.useState)(0),A=T[0],E=T[1],R=(0,n.useState)(!1),B=R[0],I=R[1],M=C.Ry().shape({username:C.Z_().required("Username is required.")}),D={resolver:(0,k.X)(M)};(0,n.useEffect)((function(){s&&E(s-((null===r||void 0===r?void 0:r.length)||0))}),[s,r]),(0,n.useEffect)((function(){G(a||{username:""}),Z(null),I(!1)}),[a]);var V=(0,S.cI)(X({mode:"onBlur"},D)),L=V.register,H=V.handleSubmit,G=V.reset,K=V.formState.errors,W=function(){var e=(0,v.Z)(b().mark((function e(t){var s,n,a,o,m,u,h;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.next=3,fetch("/api/auth/organization/members?organization=".concat(l),{method:d?"PUT":"POST",body:JSON.stringify({username:t.username,roleName:_,sendEmail:B}),headers:{"Content-Type":"application/json"}});case 3:if(200===(s=e.sent).status){e.next=13;break}return e.next=7,s.json();case 7:n=e.sent,a=n.message,Z(a),f(!1),e.next=26;break;case 13:return e.next=15,s.json();case 15:o=e.sent,m=o.data,u=(0,g.Z)(r),-1!==(h=u.findIndex((function(e){return e.username===m.username})))?u[h]=m:u.push(m),i(u),x("Member saved successfully."),c(!1),f(!1),I(!1),G({username:""});case 26:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,O.jsx)(N.u.Root,{show:o,as:n.Fragment,children:(0,O.jsxs)(w.V,{as:"div",className:"relative z-10",initialFocus:m,onClose:function(e){c(e),G({username:""})},children:[(0,O.jsx)(N.u.Child,{as:n.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,O.jsx)("div",{className:"fixed inset-0 bg-neutral-900 bg-opacity-60 transition-opacity"})}),(0,O.jsx)("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:(0,O.jsx)("div",{className:"flex justify-center min-h-full p-4 text-center sm:items-center sm:p-0",children:(0,O.jsx)(N.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,O.jsxs)(w.V.Panel,{className:"relative px-4 pt-5 pb-4 text-left rounded-lg shadow-xl bg-neutral-800 transform transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6 h-fit",children:[(0,O.jsx)("div",{className:"sm:flex sm:items-start",children:(0,O.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:text-left",children:[(0,O.jsx)(w.V.Title,{as:"h3",className:"text-lg font-medium text-white leading-6",children:"New Member"}),(0,O.jsx)("div",{className:"mt-2",children:(0,O.jsx)("p",{className:"text-sm text-neutral-400",children:"Enter the username of the user you want to add as a member to your organisation."})})]})}),(0,O.jsxs)("form",{className:"mt-5",onSubmit:H(W),children:[(0,O.jsxs)("div",{className:"w-full",children:[(0,O.jsx)("label",{htmlFor:"username",children:"Username"}),(0,O.jsx)("input",X(X({readOnly:d,type:"text",name:"username",id:"username"},L("username")),{},{className:"!mb-1 form-text-field",value:a?a.username:null})),(0,O.jsx)("div",{className:"pb-3 text-xs text-red-500",children:null===(t=K.username)||void 0===t?void 0:t.message})]}),(0,O.jsx)("div",{className:"w-full",children:(0,O.jsx)(q,{title:"Role",items:Q,selectedItem:Q.find((function(e){return e.value===(null===a||void 0===a?void 0:a.role)})),onChange:function(e){P(null===e||void 0===e?void 0:e.value)}})}),d?null:(0,O.jsx)("div",{className:"w-full mb-5",children:(0,O.jsx)(J.Z,{title:"Send notification",description:"Do you want the user to get notified by email?",enabled:B,setEnabled:I})}),(0,O.jsx)(z.Z,{variant:p||!d&&A<=0?"disabled":"primary",type:"submit",children:p?"Saving...":"Save"}),s&&!d?(0,O.jsxs)("label",{htmlFor:"availableSeats",className:"ml-2 text-xs",children:["Available number of seats: ",A]}):null,A<=0&&!d?(0,O.jsx)("label",{htmlFor:"availableSeats",className:"ml-2 text-xs",children:"You have reached the maximum number of seats."}):null,y&&(0,O.jsx)("div",{className:"mt-3 text-xs text-red-500",children:y})]})]})})})})]})})}
1,ee=function(e){var t=e.session,s=e.organization,a=(0,n.useState)(0),r=a[0],i=a[1],l=(0,n.useState)(null),o=l[0],c=l[1],d=(0,n.useState)(null),u=d[0],x=d[1],p=(0,n.useState)(!1),f=p[0],j=p[1],g=(0,n.useState)(!1),y=g[0],N=g[1],w=(0,n.useState)(!1),k=w[0],S=w[1],C=(0,n.useState)(!1),Z=C[0],F=(C[1],(0,n.useState)(!0)),_=F[0],P=F[1],T=(0,m.useRouter)();return(0,n.useEffect)((function(){if(T.isReady){var e=function(){var e=(0,v.Z)(b().mark((function e(){var t,n,a,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s){e.next=2;break}return e.abrupt("return");case 2:if(T.isReady){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,fetch("/api/auth/organization/members?organization=".concat(s.username),{method:"GET",headers:{"Content-Type":"application/json"}});case 6:return t=e.sent,e.next=9,t.json();case 9:n=e.sent,a=n.members,r=n.plan,c(a),i(null===r||void 0===r?void 0:r.seats),P(!1);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[T,s]),(0,O.jsxs)("div",{className:"relative px-4 sm:px-6 lg:px-8",children:[(0,O.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,O.jsxs)("div",{className:"sm:flex-auto",children:[(0,O.jsxs)("h1",{className:"text-xl font-semibold text-white",children:["Members",(0,O.jsx)("span",{className:"ml-1 text-neutral-400",children:"(@".concat(s.username,")")})]}),(0,O.jsx)("p",{className:"mt-2 text-sm text-neutral-400",children:"Members are user who are part of your organization."})]}),(0,O.jsxs)("div",{className:"flex mt-4 sm:mt-0 sm:ml-16",children:[(0,O.jsx)(z.Z,{variant:"primary",onClick:function(){x(null),j(!1),N(!0)},children:"Add Member"}),(0,O.jsx)($,{seats:r,isEdit:f,member:u,members:o,setMembers:c,organization:s.username,open:y,setOpen:N}),(0,O.jsx)(G,{organization:s.username,member:u,members:o,setMembers:c,open:k,setOpen:S})]})]}),(0,O.jsx)("div",{className:"relative mt-8 -mx-4 overflow-hidden rounded-sm shadow ring-1 ring-black ring-opacity-5 sm:-mx-6 md:mx-0",children:(0,O.jsxs)("table",{className:"min-w-full divide-y divide-neutral-300",children:[(0,O.jsx)("thead",{className:"bg-transparent",children:(0,O.jsxs)("tr",{children:[(0,O.jsx)("th",{scope:"col",className:"pl-4 pr-3 text-sm font-semibold text-left text-white py-3.5 sm:pl-6",children:"Username"}),(0,O.jsx)("th",{scope:"col",className:"hidden px-3 text-sm font-semibold text-left text-white py-3.5 sm:table-cell",children:"Role"}),(0,O.jsx)("th",{scope:"col",className:"hidden px-3 text-sm font-semibold text-left text-white py-3.5 sm:table-cell",children:"Created"})]})}),(0,O.jsxs)("tbody",{className:"bg-transparent divide-y divide-neutral-600",children:[_&&(0,O.jsxs)("div",{className:"flex flex-row mt-4 text-sm text-neutral-600",children:[(0,O.jsx)("div",{className:"w-4 h-4 mr-2 border-b-2 rounded-full animate-spin border-neutral-600"}),"Loading members. This may take a few seconds..."]}),o&&o.map((function(e){var s,n;return(0,O.jsxs)("tr",{children:[(0,O.jsxs)("td",{className:"w-full px-3 py-4 text-sm font-medium text-white max-w-0 sm:w-auto sm:max-w-none sm:pl-6",children:[null===e||void 0===e?void 0:e.username,(0,O.jsxs)("dl",{className:"font-normal sm:hidden",children:[(0,O.jsx)("dt",{className:"sr-only",children:"Role"}),(0,O.jsx)("dd",{className:"flex items-center text-sm text-neutral-400",children:(0,O.jsx)("span",{className:"truncate",children:null===e||void 0===e?void 0:e.role})}),(0,O.jsx)("dt",{className:"sr-only",children:"Created"}),(0,O.jsx)("dd",{className:"flex items-center text-sm text-neutral-400",children:(0,O.jsx)("span",{className:"truncate",children:(0,O.jsx)(H.Z,{date:null===e||void 0===e?void 0:e.createdAt})})})]})]}),(0,O.jsx)("td",{className:"hidden w-full px-3 py-4 text-sm font-medium text-white sm:table-cell max-w-0 sm:w-auto sm:max-w-none",children:null===e||void 0===e?void 0:e.role}),(0,O.jsx)("td",{className:"hidden w-full px-3 py-4 text-sm font-medium text-white sm:table-cell max-w-0 sm:w-auto sm:max-w-none",children:(0,O.jsx)(H.Z,{date:null===e||void 0===e?void 0:e.createdAt})}),(0,O.jsx)("td",{className:"px-3 py-4 text-sm font-medium text-right sm:pr-6",children:Z||"owner"===(null===e||void 0===e||null===(s=e.role)||void 0===s?void 0:s.toLowerCase())||(null===e||void 0===e?void 0:e.username)===(null===t||void 0===t||null===(n=t.user)||void 0===n?void 0:n.username)?null:(0,O.jsxs)("div",{className:"flex items-center justify-end space-x-4",children:[(0,O.jsx)(z.Z,{variant:"outline",onClick:function(){x(e),j(!0),N(!0)},className:"text-neutral-400 hover:text-white",children:(0,O.jsx)(h.fmQ,{className:"m-1"})}),(0,O.jsx)(z.Z,{variant:"danger",onClick:function(){x(e),S(!0)},children:"Remove"})]})})]},null===e||void 0===e?void 0:e.username)}))]})]})})]})},te=s(87771),se=s(23148),ne=s(26495);se.kL.register(se.uw,se.f$,se.od,se.jn,se.Dx,se.u,se.De);var ae=function(e){var t=e.dailyHolobyteCounts,s=Object.keys(t).sort(),n=s.map((function(e){return t[e].issued})),a=s.map((function(e){return t[e].redeemed})),r={labels:s,datasets:[{label:"Redeemed Holobytes",data:a,borderWidth:1,borderColor:"#2dd4bf",backgroundColor:"#2dd4bf",pointBackgroun
1dColor:"#2dd4bf"},{label:"Issued Holobytes",data:n,borderWidth:1,borderColor:"#134e4a",backgroundColor:"#134e4a",pointBackgroundColor:"#134e4a"}]};return(0,O.jsx)("div",{className:"p-12 m-4 bg-black shadow-md rounded-md",children:(0,O.jsx)(ne.x1,{data:r,options:{plugins:{legend:{display:!0,position:"bottom",align:"start",labels:{usePointStyle:!0,boxWidth:15,padding:8}},tooltip:{backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"white",borderWidth:1,titleFont:{size:12,weight:"bold"},bodyFont:{size:12}}},scales:{x:{title:{display:!0,text:"Day (last 28 days)"},type:"time",time:{unit:"day",displayFormats:{day:"MMM dd"}}},y:{beginAtZero:!0,title:{display:!0,text:"Count",font:{size:12}},ticks:{color:"white",precision:0,stepSize:1}}}}})})};s(68668);se.kL.register(se.RM),se.kL.register(se.f$),se.kL.register(se.od),se.kL.register(se.jn),se.kL.register(se.De),se.kL.register(se.u);var re=function(e){var t=e.weeklyCountsAll,s=e.weeklyCountsAllRedeemed;return(0,O.jsx)("div",{className:"p-12 m-4 bg-black shadow-md rounded-md",children:(0,O.jsx)(ne.x1,{data:function(){var e=Object.keys(t),n=Object.values(t);return{labels:e,datasets:[{label:"Redeemed",data:Object.values(s),borderColor:"#a78bfa",borderWidth:1,pointBackgroun
1dColor:"#a78bfa",backgroundColor:"#a78bfa"},{label:"Issued",data:n,borderColor:"#312e81",borderWidth:2,pointBackgroundColor:"#312e81",backgroundColor:"#312e81"}]}}(),options:{plugins:{legend:{display:!0,position:"bottom",align:"start",itemWrap:!0,padding:0,labels:{usePointStyle:!0,boxWidth:15,itemWrap:!0,fontSize:10,fontFamily:"Inter",fontColor:"#3C4242",padding:8}},tooltip:{backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"white",borderWidth:1,titleFont:{size:12,weight:"bold",color:"white"},bodyFont:{size:12,color:"white"}}},scales:{x:{type:"timeseries",time:{unit:"week",displayFormats:{week:"MMM dd"}},title:{display:!0,text:"Week of",font:{size:12,color:"#3C4242"}},ticks:{color:"#3C4242",precision:0,stepSize:1}},y:{type:"linear",beginAtZero:!0,title:{display:!0,text:"Count",font:{size:12,color:"white"}},ticks:{color:"white",precision:0,stepSize:1}}},responsive:!0,maintainAspectRatio:!1}})})},ie=function(e){e.session;var t=e.organization,s=(0,n.useState)(null),a=s[0],r=s[1],i=(0,n.useState)(null),l=i[0],o=i[1],c=(0,n.useState)(null),u=c[0],x=c[1],h=(0,n.use
1State)(null),p=h[0],f=h[1],j=(0,n.useState)(null),g=(j[0],j[1],(0,n.useState)(null)),y=g[0],N=g[1],w=(0,n.useState)(null),k=w[0],S=w[1],C=(0,n.useState)(!0),Z=(C[0],C[1]),F=(0,n.useState)(!0),_=F[0],P=(F[1],(0,n.useState)(!0)),T=P[0],A=P[1],E=(0,n.useState)(!0),R=E[0],B=E[1],M=(0,n.useState)(!0),D=M[0],V=M[1],L=(0,m.useRouter)();return(0,n.useEffect)((function(){if(L.isReady){var e=function(){var e=(0,v.Z)(b().mark((function e(){var s,n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V(!0),e.next=3,fetch("/api/auth/organization/analytics/badgestats?organization=".concat(t.username),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return s=e.sent,e.next=6,s.json();case 6:n=e.sent,r(n.stickers),o(n.evolvingStickers),S(n.verified),V(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=function(){var e=(0,v.Z)(b().mark((function e(){var s,n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),e.next=3,fetch("/api/auth/organization/analytics/weeklycounts?organization=".concat(t.username),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return s=e.sent,e.next=6,s.json();case 6:n=e.sent,x(n.weeklyCountsAll),f(n.weeklyCountsAllRedeemed),A(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=function(){var e=(0,v.Z)(b().mark((function e(){var s,n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,fetch("/api/auth/organization/analytics/holobytestatsdaily?organization=".concat(t.username),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return s=e.sent,e.next=6,s.json();case 6:n=e.sent,N(n.dailyHolobyteCounts),B(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e(),s(),n()}}),[L,t]),(0,n.useEffect)((function(){_||T||R||Z(!1)}),[_,T,R]),(0,O.jsxs)("div",{className:"relative px-4 sm:px-6 lg:px-8",children:[(0,O.jsxs)("h1",{className:"text-xl font-semibold text-white",children:["Badges & Analytics"," ",(0,O.jsx)("span",{className:"ml-1 text-neutral-400",children:"(@".concat(t.username,")")})]}),(0,O.jsxs)("div",{className:"flex items-center",children:[(0,O.jsxs)("h1",{className:"text-lg font-semibold text-neutral-300",children:["Badge Activity"," "]})," ",(0,O.jsx)("span",{className:"px-1 ml-2 text-xs font-normal text-blue-300 border border-blue-300 py-0.2 rounded-md",children:"Beta"})]}),(0,O.jsx)("div",{children:T&&(0,O.jsx)("div",{className:"flex",children:(0,O.jsxs)("p",{className:"flex text-sm text-blue-200",children:["Loading badge activity...",(0,O.jsx)("div",{className:"flex inline w-4 h-4 ml-2 border-b-2 border-blue-300 rounded-full animate-spin"})]})})}),u&&p&&Object.keys(u).length>0&&Object.keys(p).length>0&&!T&&(0,O.jsx)(re,{weeklyCountsAll:u,weeklyCountsAllRedeemed:p}),(0,O.jsxs)("div",{className:"flex items-center",children:[(0,O.jsxs)("h1",{className:"text-lg font-semibold text-neutral-300",children:["Holobyte Activity"," "]})," ",(0,O.jsx)("span",{className:"px-1 ml-2 text-xs font-normal text-blue-300 border border-blue-300 py-0.2 rounded-md",children:"Beta"})]}),(0,O.jsx)("div",{children:R&&(0,O.jsx)("div",{className:"flex",children:(0,O.jsxs)("p",{className:"flex text-sm text-blue-200",children:["Loading holobyte activity...",(0,O.jsx)("div",{className:"flex inline w-4 h-4 ml-2 border-b-2 border-blue-300 rounded-full animate-spin"})]})})}),y&&Object.keys(y).length>0&&!R&&(0,O.jsx)(ae,{dailyHolobyteCounts:y}),(0,O.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,O.jsxs)("div",{className:"sm:flex-auto",children:[(0,O.jsx)("h1",{className:"text-xl font-semibold text-neutral-300",children:"All Badges"}),(0,O.jsx)("p",{className:"mt-2 text-sm text-neutral-400",children:"All your organization's badges will be displayed here."}),!1===k&&(0,O.jsx)("p",{className:"mt-2 text-xs text-red-300",children:"Your organization has not been verified yet. Unverified organizations can still create badges and submit them for review, but they will not be issuable until the organization is verified."})]}),(0,O.jsx)("div",{className:"mt-4 sm:mt-0 sm:ml-16 sm:flex-none",children:(0,O.jsx)(d(),{href:"/sticker/new?id=".concat(t.id),children:(0,O.jsx)("a",{children:(0,O.jsx)(z.Z,{variant:"primary",className:"w-full md:w-fit hover:border hover:border-green-300",children:"Create New Badge"})})})})]}),(0,O.jsxs)("div",{className:"mt-4",children:[D&&(0,O.jsx)("div",{className:"flex",children:(0,O.jsxs)("p",{className:"flex text-sm text-blue-200",children:["Loading badges...",(0,O.jsx)("div",{className:"flex inline w-4 h-4 ml-2 border-b-2 border-blue-300 rounded-full animate-spin"})]})}),(0,O.jsxs)("div",{className:"flex flex-col divide-y divide-neutral-600",children:[a&&!D&&a.length>0&&a.map((function(e){return(0,O.jsxs)("div",{className:"flex flex-row pt-4 pb-4",children:[(0,O.jsx)("div",{role:"group",className:"w-32",children:(0,O.jsx)(d(),{href:"/sticker/".concat(e.id),children:(0,O.jsx)("a",{children:(0,O.jsx)("div",{className:"p-5 rounded-lg bg-neutral-800",children:(0,O.jsx)(I(),{src:e.image,width:"90%",height:"90%",layout:"responsive",objectFit:"contain",alt:e.name})})})})}),(0,O.jsxs)("div",{className:"flex-col ml-5",children:[(0,O.jsxs)("div",{className:"flex flex-row items-center mb-1",children:[(0,O.jsx)("div",{className:"font-semibold hover:text-green-300",children:(0,O.jsx)(d(),{href:"/sticker/".concat(e.id),children:(0,O.jsx)("a",{children:e.name})})}),!1===e.listed&&(0,O.jsx)("div",{className:"px-2 mx-2 text-xs border rounded-lg text-neutral-400 border-neutral-400 tag w-fit",children:"Unlisted"}),"approved"!==e.status&&(0,O.jsx)("div",{className:"px-2 mx-2 text-xs text-red-400 border border-red-400 rounded-lg tag w-fit",children:"Awaiting review"})]}),(0,O.jsxs)("div",{className:"flex flex-row items-center mb-1 text-sm gap-x-1 text-neutral-400",children:[(0,O.jsx)(te.cjn,{}),(0,O.jsx)(H.Z,{date:e.createdAt})]}),(0,O.jsxs)("div",{className:"text-sm text-neutral-400",children:[e.userStickerCount," users.",(0,O.jsx)("span",{className:"ml-2 text-sm font-semibold text-green-300 hover:text-white ease-in-out duration-200",children:(0,O.jsx)(d(),{href:"/sticker/users/".concat(e.id),children:(0,O.jsx)("a",{children:"View users"})})})]}),(0,O.jsxs)("div",{className:"text-sm text-neutral-400",children:[e.couponCount," single-use coupons"]}),(0,O.jsxs)("div",{className:"text-sm text-neutral-400",children:[e.multicouponCount," multi-use
1coupons"]})]})]},e.id)})),l&&!D&&l.length>0&&l.map((function(e){return(0,O.jsxs)("div",{className:"flex flex-row pt-4 pb-4",children:[(0,O.jsx)("div",{role:"group",className:"w-32",children:(0,O.jsx)(d(),{href:"/sticker/evolving/".concat(e.id),children:(0,O.jsx)("a",{children:(0,O.jsx)("div",{className:"p-5 rounded-lg bg-neutral-800",children:(0,O.jsx)(I(),{src:e.image,width:"90%",height:"90%",layout:"responsive",objectFit:"contain",alt:e.name})})})})}),(0,O.jsxs)("div",{className:"flex-col ml-5",children:[(0,O.jsxs)("div",{className:"flex flex-row items-center mb-1",children:[(0,O.jsx)("div",{className:"font-semibold hover:text-green-300",children:(0,O.jsx)(d(),{href:"/sticker/evolving/".concat(e.id),children:(0,O.jsx)("a",{children:e.name})})}),!1===e.listed&&(0,O.jsx)("div",{className:"px-2 mx-2 text-xs border rounded-lg text-neutral-400 border-neutral-400 tag w-fit",children:"Unlisted"}),(0,O.jsx)("div",{className:"px-2 ml-1 text-xs text-blue-300 border border-blue-300 rounded-lg tag w-fit",children:"Series"}),"approved"!==e.status&&(0,O.jsx)("div",{className:"px-2 mx-2 text-xs text-red-400 border border-red-400 rounded-lg tag w-fit",children:"Awaiting review"})]}),(0,O.jsxs)("div",{className:"flex flex-row items-center mb-1 text-sm gap-x-1 text-neutral-400",children:[(0,O.jsx)(te.cjn,{}),(0,O.jsx)(H.Z,{date:e.createdAt})]}),(0,O.jsxs)("div",{className:"text-sm text-neutral-400",children:[e.holobyteCount," holobyte",e.holobyteCount>1&&"s"]}),(0,O.jsxs)("div",{className:"text-sm text-neutral-400",children:[e.redeemedHolobyteCount," redeemed"]}),(0,O.jsxs)("div",{className:"text-sm text-neutral-400",children:[e.userStickerCount," users.",(0,O.jsx)("span",{className:"ml-2 text-sm font-semibold text-green-300 hover:text-white ease-in-out duration-200",children:(0,O.jsx)(d(),{href:"/sticker/evolving/users/".concat(e.id),children:(0,O.jsx)("a",{children:"View users"})})})]})]})]},e.id)}))]})]})]})},le=s(27318),oe=function(e){e.session;var t=e.organization,s=e.suborgs,n=(0,m.useRouter)();return(0,O.jsxs)("div",{className:"relative px-4 sm:px-6 lg:px-8",children:[(0,O.jsxs)("div",{children:[(0,O.jsxs)("div",{className:"flex items-center justify-between",children:[(0,O.jsxs)("h3",{className:"text-lg font-medium text-white leading-6",children:["Suborganizations of ",null===t||void 0===t?void 0:t.name]}),(0,O.jsx)("div",{className:"flex items-center",children:(null===t||void 0===t?void 0:t.canCreateChildOrgs)&&(0,O.jsx)(z.Z,{onClick:function(){return n.push("/organizations/new?parentOrgId=".concat(null===t||void 0===t?void 0:t.id))},children:(0,O.jsx)("span",{children:"New"})})})]}),(0,O.jsx)("p",{className:"mt-1 text-sm text-neutral-500",children:"Suborganizations are organizations that are owned and managed by this organization."})]}),(0,O.jsx)("div",{className:"mt-6",children:(0,O.jsx)(le.Z,{organizations:s})})]})},ce=!0,de=function(e){var t=e.session,s=e.organization,c=e.suborgs,v=(0,m.useRouter)(),j=(0,n.useState)(""),b=j[0],g=(j[1],(0,n.useState)(v.query.tab||"appearance")),y=g[0],N=g[1];(0,n.useEffect)((function(){v.isReady}),[v]);var w=[{name:"Appearance",ref:"appearance",icon:p.Moc,current:"appearance"===y},{name:"Badges & Analytics",ref:"badges",icon:u.LmY,current:"badges"===y},{name:"Members",ref:"members",icon:x.fFq,current:"members"===y},{name:"API Keys",ref:"apikeys",icon:a.Z,current:"apikeys"===y},{name:"Billing",ref:"billing",icon:r.Z,current:"billing"===y},{name:"Docs",ref:"docs",icon:i.Z,current:"docs"===y},{name:"Suborganizations",ref:"suborgs",icon:l.Z,current:"suborgs"===y}];return(0,O.jsx)(f.Z,{title:"Organization settings",children:(0,O.jsxs)("div",{className:"relative lg:grid lg:grid-cols-12 lg:gap-x-5",children:[(0,O.jsx)("aside",{className:"px-2 py-6 sm:px-6 lg:col-span-3 lg:py-0 lg:px-0",children:(0,O.jsxs)("nav",{className:"sticky top-20 space-y-1",children:[(0,O.jsx)("div",{className:"flex flex-row items-center mb-5 ml-1 text-md text-neutral-400",children:(0,O.jsx)(d(),{href:"/organizations",children:(0,O.jsx)("a",{children:(0,O.jsxs)("span",{className:"flex flex-row items-center cursor-pointer hover:text-green-300",children:[(0,O.jsx)(h.x_l,{className:"mr-1 text-xs"}),"Your organizations"]})})})}),w.map((function(e){return(0,O.jsxs)("a",{className:(0,o.Z)(e.current?" text-green-300 bg-neutral-800":"text-neutral-100 hover:bg-neutral-700 hover:text-white","group rounded-md px-3 py-2 flex items-center text-sm font-medium transition-colors ease-in-out"),"aria-current":e.current?"page":void 0,onClick:function(){return t=e.ref,N(t),void v.push("/organizations/manage/".concat(s.username,"?tab=").concat(t));var t},children:[(0,O.jsx)(e.icon,{className:(0,o.Z)(e.current?"text-green-300":"text-neutral-500 group-hover:text-neutral-400","flex-shrink-0 -ml-1 mr-3 h-6 w-6 transition-colors ease-in-out"),"aria-hidden":"true"}),(0,O.jsx)("span",{className:"truncate",children:e.name}),"Badges & Analytics"===e.name&&(0,O.jsx)("span",{className:"px-1 ml-2 text-xs font-normal text-green-600 border border-green-600 py-0.2 rounded-md",children:"New"})]},e.name)}))]})}),(0,O.jsxs)("div",{className:"space-y-6 sm:px-6 lg:col-span-9 lg:px-0",children:[b&&(0,O.jsxs)("div",{className:"p-4 bg-red-800 border-l-4 border-red-400",children:[(0,O.jsx)("strong",{children:"Error:"}),(0,O.jsx)("p",{children:b})]}),"appearance"===y&&(0,O.jsx)(D,{organization:s}),"badges"===y&&(0,O.jsx)(ie,{session:t,organization:s}),"members"===y&&(0,O.jsx)(ee,{session:t,organization:s}),"apikeys"===y&&(0,O.jsx)(A,{session:t,organization:s}),"billing"===y&&(0,O.jsx)(L,{session:t,organization:s}),"docs"===y&&(0,O.jsx)("div",{className:"relative px-4 sm:px-6 lg:px-8",children:(0,O.jsx)("div",{className:"sm:flex sm:items-center",children:(0,O.jsxs)("div",{className:"sm:flex-auto",children:[(0,O.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Documentation"}),(0,O.jsxs)("p",{className:"mt-1 text-sm text-neutral-400",children:["API documentation has moved"," ",(0,O.jsx)(d(),{href:"https://docs.holopin.io",children:(0,O.jsx)("a",{className:"font-semibold text-green-300 hover:text-white",children:"here"})}),"."]})]})})}),"suborgs"===y&&(0,O.jsx)(oe,{session:t,organization:s,suborgs:c})]})]})})}},74170:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/organizations/manage/[username]",function(){return s(72785)}])},542:function(e,t){"use strict";t.Z={src:"/_next/static/media/unknown.bc53212f.svg",height:256,width:224}},37437:function(e){e.exports={button:"Button_button__PjVhE",secondary:"Button_secondary__2SNo1",primary:"Button_primary___XGO6",close:"Button_close__pPp_W",disabled:"Button_disabled__063Xs",hold:"Button_hold__WeACw",social:"Button_social__EF7MJ",ghost:"Button_ghost__CPfYf",subtle:"Button_subtle__3cV3v",outline:"Button_outline__EsWgH",danger:"Button_danger__gw1OL",purple:"Button_purple__dIsBv",marketing:"Button_marketing__BSg_s",marketing2:"Button_marketing2__Y2Q_0","no-border":"Button_no-border__dojA4"}}},function(e){e.O(0,[3365,594,4738,4817,4321,2196,56,2422,9925,4231,2580,7536,2923,324,3775,9774,2888,179],(function(){return t=74170,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.